@ui-ddy-process/design 1.6.27 → 1.6.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,18 +34,18 @@
34
34
  * @vue/shared v3.5.16
35
35
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
36
36
  * @license MIT
37
- **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const qQ=Object.prototype.hasOwnProperty,$Q=(e,t)=>qQ.call(e,t),eh=/(%|)\{([0-9a-zA-Z_]+)\}/g;function th(e){function t(n="",...A){return typeof n!="string"?n:(A.length===1&&typeof A[0]=="object"&&(A=A[0]),(!A||!A.hasOwnProperty)&&(A={}),n.replace(eh,(i,o,r,a)=>{let c;return n[a-1]==="{"&&n[a+i.length]==="}"?r:(c=$Q(A,r)?A[r]:null,c??"")}))}return t}const nh={nf:{lang:"zh",panel:{process:{tab:"流程配置",basic:{label:"基本配置",key:"流程key",name:"流程名称",description:"流程描述",skipFirstNode:"跳过第一节点",skipWhenStartUser:"任务审核人为发起人时跳过",skipWhenAssignee:"任务审核人之前审核过时跳过",rollbackNode:{label:"默认驳回节点",placeholder:"不选择默认驳回到上一节点"}},sn:{label:"流水号配置",useExistSN:"使用已有流水号",useExistSNTip:"请保持名称和前缀与已有流水号一致",configure:"配置",format:"流水号格式",name:"名称",prefix:"前缀",dateFormat:"日期格式",suffixLength:"后缀位数",initialValue:"初始数值",connector:"连接符",resetCycle:{label:"重置周期",dicData:[{label:"不重置",value:"none"},{label:"按天重置",value:"day"},{label:"按周重置",value:"week"},{label:"按月重置",value:"month"},{label:"按年重置",value:"year"}]}},title:{label:"流程标题配置"},callBack:{label:"回调配置"}},node:{tab:"节点配置",message:"选择节点后配置",basic:{title:"基本配置",id:"节点id",name:"节点名称",text:"注解内容",description:"节点描述",rollbackNode:{label:"驳回节点",placeholder:"不选择默认使用流程配置",backToRejecter:"重新提交后回到驳回人",backToRejecterText:"假如D驳回到A,A重新发起时直接到D,跳过B、C"},priority:"优先级",async:{label:"异步",yes:"是",no:"否"},dueDate:"超时",skipExpression:"跳过表达式"},assignee:{title:"人员配置",v1:{assignee:"处理人",candidateUsers:"候选用户",candidateGroups:"候选组",title:"人员选择",unselected:"未选择",selected:"已选择",message:"请至少选择一项"},v2:{configure:"人员配置",type:"类型",value:"值",typeDic:{user:"用户",role:"角色",dept:"部门",post:"职位",custom:"自定义"},typeList:[{label:"用户",value:"user"},{label:"角色",value:"role"},{label:"部门",value:"dept"},{label:"职位",value:"post"},{label:"自定义",value:"custom"}],customRemark:"请确保选择/填写的选项已实现相关逻辑",title:"人员选择",cancel:"取 消",submit:"确 定",user:{avatar:"头像",name:"姓名",dept:"部门",post:"职位",phone:"手机号"},message:"请至少选择一项",dept:{title:"部门选择",name:"部门名称",fullName:"部门全称",category:"部门类型"}}},button:{title:"按钮配置",label:"字段",prop:"属性",display:"是否显示"},condition:{title:"流转条件",conditionExpression:"流转条件"},examine:{hideAttachment:"隐藏审批附件",hideCopy:"隐藏选择抄送人",copyUser:"默认抄送人",hideAssignee:"隐藏选择审核人"},form:{title:"表单配置",exFormKey:"表单key",exFormUrl:"表单路由",router:"路由",remark:{r1:"发起流程会自动匹配",r2:"查看详情会自动匹配",r3:"请拷贝模版页面或参考demo项目实现自己的逻辑",r4:"会动态添加路由,无需配置。已知小问题:框架限制,刷新404",r5:"若配置此项,表单key的自动匹配路由将失效",r6:"请自行配置相应路由",r7:"移动端会自动匹配"},exAppFormUrl:"移动端路由",label:"字段",prop:"属性",readable:"可读",writable:"可写",required:"必填",unknown:"未知表单配置,请自行控制字段显隐等属性。"},listener:{taskTitle:"任务监听",executionTitle:"执行监听",add:"添加",edit:"编辑",delete:"删除",event:"事件",type:"类型",value:"值",operations:"操作",submit:"确定",listenerType:{class:"类",expression:"表达式",delegateExpression:"代理表达式"},message:"确定要删除吗",warning:"警告",name:"名称",quick:"快捷配置",quickTip:"快捷配置以下选项,无实际作用"},extendedProperty:{taskTitle:"扩展属性",executionTitle:"执行扩展属性",add:"添加",edit:"编辑",name:"属性名",value:"属性值",remark:"备注",delete:"删除",event:"事件",type:"类型",operations:"操作",submit:"确定",listenerType:{class:"类",expression:"表达式",delegateExpression:"代理表达式"},isDeleteType:{yes:"是",no:"否"},message:"确定要删除吗",warning:"警告",quick:"快捷配置",quickTip:"快捷配置以下选项,无实际作用"},multiInstance:{title:"多实例配置",type:"类型",parallel:"并行",sequential:"串行",completionCondition:"完成条件"},event:{title:"事件配置",isInterrupting:"是否中断",condition:"表达式",activityRef:"活动引用",errorRef:"错误引用",escalationRef:"升级引用",messageRef:"消息引用",signalRef:"信号引用",terminateAll:"全部终止",timer:{timeCycle:"时间周期",timeDate:"时间日期",timeDuration:"持续时间"}},call:{title:"调用活动",calledElement:"子流程key",inheritVariables:"继承变量",sameDeployment:"同一部署"},service:{title:"服务配置",type:"类型",typeOption:[{label:"类",value:"class"},{label:"代理表达式",value:"delegateExpression"},{label:"表达式",value:"expression"},{label:"Http",value:"http"},{label:"Shell",value:"shell"},{label:"Mail",value:"mail"}]},script:{title:"脚本配置"}}},toolbar:{open:"打开",create:"新建",fit:"自适应屏幕",center:"居中",zoomIn:"放大",zoomOut:"缩小",undo:"后退",redo:"前进",download:"下载",downloadXml:"下载XML",downloadSvg:"下载SVG",importXml:"导入",previewXml:"查看",getXml:"获取XML"}}},Rn=s.createApp({}),Ah=th();let to=nh,Jl=!1,Za=function(){const e=Object.getPrototypeOf(this||Rn||{}).$t;if(typeof e=="function"&&Rn.locale)return Jl||(Jl=!0,Rn.locale(Rn.config.lang,Object.assign(to,Rn.locale(Rn.config.lang)||{},{clone:!0}))),e.apply(this,arguments)};const jl=function(e,t){let n=Za.apply(this,arguments);if(n!=null)return n;const A=e.split(".");let i=to;for(let o=0,r=A.length;o<r;o++){const a=A[o];if(n=i[a],o===r-1)return Ah(n,t);if(!n)return"";i=n}return""},Vl={use:function(e){to=e||to},t:jl,i18n:function(e){Za=e||Za}},v0={methods:{t(...e){return jl.apply(this,e)}}},F0=(e,t)=>{const n=e.__vccOpts||e;for(const[A,i]of t)n[A]=i;return n},ih={name:"bpmn-tools",mixins:[v0],emits:["open","create","fit","undo","redo","download","import","preview"],props:{toolbar:{type:Array,default:()=>[]}},methods:{handleBeforeUpload(e){const t=new FileReader;return t.readAsText(e,"utf-8"),t.onload=()=>{this.$emit("open",t.result)},!1},handleCreate(){this.$confirm("确定要新建吗?","警告",{type:"warning"}).then(()=>{this.$emit("create")}).catch(()=>{})}}},oh={class:"nf-tools"},rh={class:"nf-tools--left"},ah={style:{padding:"10px",display:"flex"}};function ch(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("el-tooltip"),c=s.resolveComponent("el-upload"),l=s.resolveComponent("el-popover");return s.openBlock(),s.createElementBlock("div",oh,[s.createElementVNode("div",rh,[n.toolbar.includes("open")?(s.openBlock(),s.createBlock(c,{key:0,accept:".xml, .bpmn",action:"","before-upload":o.handleBeforeUpload,style:{"margin-right":"10px",display:"inline-block"}},{default:s.withCtx(()=>[s.createVNode(a,{effect:"dark",content:e.t("nf.toolbar.open"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-folder-opened"})]),_:1},8,["content"])]),_:1},8,["before-upload"])):s.createCommentVNode("",!0),n.toolbar.includes("create")?(s.openBlock(),s.createBlock(a,{key:1,effect:"dark",content:e.t("nf.toolbar.create"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-circle-plus",onClick:o.handleCreate},null,8,["onClick"])]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("fit")?(s.openBlock(),s.createBlock(a,{key:2,effect:"dark",content:e.t("nf.toolbar.fit"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-rank",onClick:t[0]||(t[0]=B=>e.$emit("fit","init"))})]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("fit")?(s.openBlock(),s.createBlock(a,{key:3,effect:"dark",content:e.t("nf.toolbar.center"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-aim",onClick:t[1]||(t[1]=B=>e.$emit("fit","auto"))})]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("zoom-in")?(s.openBlock(),s.createBlock(a,{key:4,effect:"dark",content:e.t("nf.toolbar.zoomIn"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-zoom-in",onClick:t[2]||(t[2]=B=>e.$emit("fit",!0))})]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("zoom-out")?(s.openBlock(),s.createBlock(a,{key:5,effect:"dark",content:e.t("nf.toolbar.zoomOut"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-zoom-out",onClick:t[3]||(t[3]=B=>e.$emit("fit",!1))})]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("undo")?(s.openBlock(),s.createBlock(a,{key:6,effect:"dark",content:e.t("nf.toolbar.undo"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-refresh-left",onClick:t[4]||(t[4]=B=>e.$emit("undo"))})]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("redo")?(s.openBlock(),s.createBlock(a,{key:7,effect:"dark",content:e.t("nf.toolbar.redo"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-refresh-right",onClick:t[5]||(t[5]=B=>e.$emit("redo"))})]),_:1},8,["content"])):s.createCommentVNode("",!0)]),s.createElementVNode("div",null,[n.toolbar.includes("download-xml")||n.toolbar.includes("download-svg")?(s.openBlock(),s.createBlock(l,{key:0,placement:"bottom",width:"200px",trigger:"hover",style:{margin:"0 10px"}},{reference:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-download"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.download")),1)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("div",ah,[n.toolbar.includes("download-xml")?(s.openBlock(),s.createBlock(r,{key:0,size:"default",type:"primary",icon:"el-icon-download",onClick:t[6]||(t[6]=B=>e.$emit("download","xml",!0))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.downloadXml")),1)]),_:1})):s.createCommentVNode("",!0),n.toolbar.includes("download-svg")?(s.openBlock(),s.createBlock(r,{key:1,size:"default",type:"warning",icon:"el-icon-picture",onClick:t[7]||(t[7]=B=>e.$emit("download","svg",!0))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.downloadSvg")),1)]),_:1})):s.createCommentVNode("",!0)])]),_:1})):s.createCommentVNode("",!0),n.toolbar.includes("import")?(s.openBlock(),s.createBlock(r,{key:1,size:"default",icon:"el-icon-upload",onClick:t[8]||(t[8]=B=>e.$emit("import"))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.importXml")),1)]),_:1})):s.createCommentVNode("",!0),n.toolbar.includes("preview")?(s.openBlock(),s.createBlock(r,{key:2,size:"default",icon:"el-icon-view",onClick:t[9]||(t[9]=B=>e.$emit("preview","preview"))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.previewXml")),1)]),_:1})):s.createCommentVNode("",!0),n.toolbar.includes("get")?(s.openBlock(),s.createBlock(r,{key:3,size:"default",icon:"el-icon-finished",onClick:t[10]||(t[10]=B=>e.$emit("preview","get"))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.getXml")),1)]),_:1})):s.createCommentVNode("",!0),s.renderSlot(e.$slots,"toolbar",{},void 0,!0)])])}const sh=F0(ih,[["render",ch],["__scopeId","data-v-14b3a24e"]]),z0={props:{modeler:{type:Object,required:!0},element:{type:Object,default:()=>({})},nodes:{type:Array,default:()=>[]},formOption:{type:[Object,String],default:null},exFormOption:{type:[Object,String],default:null},indepFormOption:{type:[Object,String],default:null},userOption:{type:Object,default:null},groupOption:{type:Object,default:null},buttonOption:{type:Array,default:()=>[]},scriptOption:{type:Object,default:()=>{}},conditionOption:{type:Array,default:()=>[]},listenerOption:{type:Array,default:()=>[]},extendedPropertyOption:{type:Array,default:()=>[]}},computed:{backNodes(){const{id:e}=this.formData;return this.nodes.findIndex(n=>n.id==e)>0&&!this.nodes.find(n=>n.nodeType=="bpmn:Collaboration")?this.nodes.filter(n=>["bpmn:StartEvent","bpmn:UserTask"].includes(n.nodeType)):this.nodes},labelPosition(){return["zh"].includes(this.$nfDesign.lang)?"left":"top"}},data(){return{formData:{}}},watch:{element:{handler(e){if(Object.keys(e)==0)return;const t={...e.businessObject,...e.businessObject.$attrs},n=t.documentation;n&&n.length>0&&(t.description=n[0].text),this.formData=t},deep:!0,immediate:!0}},methods:{updateProperties(e){this.modeler.get("modeling").updateProperties(this.element,((this.element.businessObject||{}).$attrs||{}).customType=="抄送任务"?{...e,customType:"QQ抄送任务","flowable:customType":"flowable QQ抄送任务"}:{...e})},updateDocumentation(e){if(e){const t=this.modeler.get("bpmnFactory").create("bpmn:Documentation",{text:e});this.updateProperties({documentation:[t]})}else this.updateProperties({documentation:[]})},updateFormalExpression(e,t){e&&t?t=this.modeler.get("bpmnFactory").create("bpmn:FormalExpression",{body:t}):t=void 0,this.updateProperties({[e]:t})},createElement(e,t){return e&&t?this.modeler.get("bpmnFactory").create(e,t):null},getRootElements(e){const t=this.modeler.get("canvas").getRootElement().businessObject.$parent.rootElements;return e?t.filter(n=>n.$type==e):t},getExtensionElementsEq(e){const t=[],{extensionElements:n}=this.element.businessObject;return n&&n.values&&n.values.length>0&&n.values.forEach(A=>{A.$type===e&&t.push(A)}),t},getExtensionElementsNotEq(e){const t=[],{extensionElements:n}=this.element.businessObject;return n&&n.values&&n.values.length>0&&n.values.forEach(A=>{A.$type!==e&&t.push(A)}),t},setExtensionElements(e,t){if(e&&t){const n=this.modeler.get("bpmnFactory");let A=[];t.forEach(i=>A.push(n.create(e,i))),A=this.getExtensionElementsNotEq(e).concat(A),this.updateProperties({extensionElements:n.create("bpmn:ExtensionElements",{values:A})})}},deleteExtensionElements(e){const t=this.getExtensionElementsNotEq(e),n=this.modeler.get("bpmnFactory");t&&t.length>0&&this.updateProperties({extensionElements:n.create("bpmn:ExtensionElements",{values:t})})},clearExtensionElements(e){let t=[];e&&e.forEach(A=>{const i=this.getExtensionElementsEq(A);i&&i.length>0&&(t=t.concat(i))});const n=this.modeler.get("bpmnFactory");this.updateProperties({extensionElements:t.length>0?n.create("bpmn:ExtensionElements",{values:t}):void 0})},getEventDefinitions(e){const{eventDefinitions:t}=this.element.businessObject;if(!e)return!t||t.length==0?null:t;const n=[];if(t&&t.length>0)t.forEach(A=>{A.$type==e&&n.push(A)});else return null;return n},setEventDefinitions(e,t){if(e&&t){const n=this.modeler.get("bpmnFactory");let A=this.getEventDefinitions(e)||[];A&&A.length>0?A={...A[0],...t}:A={...t};for(let i in A)i.startsWith("$")&&delete A[i];this.updateProperties({eventDefinitions:[n.create(e,A)]})}}}},lh={name:"nf-basic",mixins:[z0,v0],watch:{formData:{handler(e){const{name:t}=e;this.element.type=="bpmn:StartEvent"&&t&&t.includes("请先点击")&&(this.updateProperties({name:"开始"}),this.formData.name="开始")},deep:!0,immediate:!0}}};function Bh(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-icon-question-filled"),B=s.resolveComponent("el-icon"),g=s.resolveComponent("el-link"),p=s.resolveComponent("el-divider"),E=s.resolveComponent("el-option"),d=s.resolveComponent("el-select"),u=s.resolveComponent("el-tooltip"),h=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(h,{model:e.formData,"label-position":e.labelPosition,"label-width":"100px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{label:e.t("nf.panel.node.basic.id"),prop:"id",rules:{required:!0,trigger:"change"}},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.id,"onUpdate:modelValue":t[0]||(t[0]=D=>e.formData.id=D),clearable:"",placeholder:e.t("nf.panel.node.basic.id"),onInput:t[1]||(t[1]=D=>e.updateProperties({id:e.formData.id}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),["bpmn:TextAnnotation","bpmn:Association"].includes(e.element.type)?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.basic.name")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.name,"onUpdate:modelValue":t[2]||(t[2]=D=>e.formData.name=D),clearable:"",placeholder:e.t("nf.panel.node.basic.name"),onInput:t[3]||(t[3]=D=>e.updateProperties({name:e.formData.name||void 0}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"])),["bpmn:TextAnnotation"].includes(e.element.type)?(s.openBlock(),s.createBlock(a,{key:1,label:e.t("nf.panel.node.basic.text")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.text,"onUpdate:modelValue":t[4]||(t[4]=D=>e.formData.text=D),clearable:"",placeholder:e.t("nf.panel.node.basic.text"),onInput:t[5]||(t[5]=D=>e.updateProperties({text:e.formData.text||void 0}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.basic.description")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.description,"onUpdate:modelValue":t[6]||(t[6]=D=>e.formData.description=D),clearable:"",placeholder:e.t("nf.panel.node.basic.description"),onInput:e.updateDocumentation},null,8,["modelValue","placeholder","onInput"])]),_:1},8,["label"]),["bpmn:ServiceTask"].includes(e.element.type)?(s.openBlock(),s.createBlock(a,{key:2,label:e.t("nf.panel.node.basic.async.label")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:e.formData.async,"onUpdate:modelValue":t[7]||(t[7]=D=>e.formData.async=D),"active-text":e.t("nf.panel.node.basic.async.yes"),"inactive-text":e.t("nf.panel.node.basic.async.no"),"active-value":!0,"inactive-value":!1,onChange:t[8]||(t[8]=D=>e.updateProperties({async:e.formData.async||void 0}))},null,8,["modelValue","active-text","inactive-text"])]),_:1},8,["label"])):s.createCommentVNode("",!0),e.element.type=="bpmn:UserTask"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:3},[s.createVNode(a,{label:e.t("nf.panel.node.basic.priority")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.priority,"onUpdate:modelValue":t[9]||(t[9]=D=>e.formData.priority=D),placeholder:e.t("nf.panel.node.basic.priority"),clearable:"",onChange:t[10]||(t[10]=D=>e.updateProperties({priority:e.formData.priority||void 0}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.basic.dueDate")},{label:s.withCtx(()=>[s.createVNode(g,{href:"https://tkjohn.github.io/flowable-userguide/#bpmnUserTask",underline:!1,target:"_blank"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.basic.dueDate"))+" ",1),s.createVNode(B,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),t[19]||(t[19]=s.createTextVNode(" : "))]),_:1,__:[19]})]),default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.dueDate,"onUpdate:modelValue":t[11]||(t[11]=D=>e.formData.dueDate=D),placeholder:e.t("nf.panel.node.basic.dueDate"),clearable:"",onChange:t[12]||(t[12]=D=>e.updateProperties({dueDate:e.formData.dueDate||void 0}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.basic.skipExpression")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.skipExpression,"onUpdate:modelValue":t[13]||(t[13]=D=>e.formData.skipExpression=D),placeholder:e.t("nf.panel.node.basic.skipExpression"),clearable:"",onChange:t[14]||(t[14]=D=>e.updateProperties({skipExpression:e.formData.skipExpression||void 0}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(p),s.createVNode(a,{label:e.t("nf.panel.node.basic.rollbackNode.label"),"label-width":"90px"},{default:s.withCtx(()=>[s.createVNode(d,{modelValue:e.formData.rollbackNode,"onUpdate:modelValue":t[15]||(t[15]=D=>e.formData.rollbackNode=D),clearable:"",placeholder:e.t("nf.panel.node.basic.rollbackNode.placeholder"),onChange:t[16]||(t[16]=D=>e.updateProperties({rollbackNode:e.formData.rollbackNode||void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.nodes,D=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[["bpmn:UserTask","bpmn:StartEvent"].includes(D.nodeType)&&D.id!=e.formData.id?(s.openBlock(),s.createBlock(E,{key:D.id,label:D.name,value:D.id},null,8,["label","value"])):s.createCommentVNode("",!0)],64))),256))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{"label-width":"190px"},{label:s.withCtx(()=>[s.createVNode(u,{effect:"dark",placement:"top"},{content:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.basic.rollbackNode.backToRejecterText")),1)]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.basic.rollbackNode.backToRejecter"))+" ",1),s.createVNode(B,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),t[20]||(t[20]=s.createTextVNode(" : "))])]),_:1})]),default:s.withCtx(()=>[s.createVNode(c,{modelValue:e.formData.backToRejecter,"onUpdate:modelValue":t[17]||(t[17]=D=>e.formData.backToRejecter=D),"active-value":"true","inactive-value":"false",onChange:t[18]||(t[18]=D=>e.updateProperties({backToRejecter:e.formData.backToRejecter||void 0}))},null,8,["modelValue"])]),_:1})],64)):s.createCommentVNode("",!0)]),_:1},8,["model","label-position"])}const gh=F0(lh,[["render",Bh]]),ph={name:"user-select",mixins:[v0],props:{userUrl:String,customOption:Object,defaultChecked:String,defaultCheckedText:String},watch:{text:{handler(e){this.isInit&&e&&this.$emit("confirm",e[this.props.value],e[this.props.label])},deep:!0}},data(){const e=this;return{visible:!1,isInit:!1,text:"",option:{size:"default",border:!0,search:!0,searchSize:"default",searchMenuSpan:6,searchIcon:!0,searchIconIndex:3,column:[{label:e.t("nf.panel.node.assignee.v2.user.name"),prop:"realName",overHidden:!0,search:!0},{label:e.t("nf.panel.node.assignee.v2.user.dept"),prop:"deptName",overHidden:!0,search:!0},{label:e.t("nf.panel.node.assignee.v2.user.phone"),prop:"phone",overHidden:!0,search:!0}],props:{url:e.userUrl,method:"get",needPage:!0,currentPageKey:"current",pageSizeKey:"size",totalKey:"total",recordsKey:"records",resKey:"data"}},props:{label:"realName",value:"id"}}},methods:{init(){if(!this.isInit){if(this.customOption){const{column:e,userProps:t}=this.customOption;e&&(this.option.column=e),t&&(this.props=t)}if(this.defaultChecked&&this.defaultCheckedText){const e=this.defaultChecked,t=this.defaultCheckedText.includes(" | ")?this.defaultCheckedText:this.defaultCheckedText.split(",").join(" | ");this.text={[this.props.value]:e,[this.props.label]:t}}this.isInit=!0,this.$nextTick(()=>{this.$refs["nf-table-select"].handleTableSelect()})}}}};function Eh(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("nf-table-select");return s.openBlock(),s.createElementBlock("div",null,[i.isInit?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(r,{key:0,"model-value":n.defaultCheckedText,placeholder:"人员选择","suffix-icon":"el-icon-search",readonly:""},null,8,["model-value"])),i.isInit?(s.openBlock(),s.createBlock(a,{key:1,ref:"nf-table-select",modelValue:i.text,"onUpdate:modelValue":t[0]||(t[0]=c=>i.text=c),children:i.option,props:i.props,placeholder:"人员选择",multiple:""},null,8,["modelValue","children","props"])):s.createCommentVNode("",!0)])}const Ll=F0(ph,[["render",Eh]]),dh={mixins:[v0],props:{userOption:Object,assigneeRetain:String},components:{UserSelect:Ll},emits:["submit","update:assigneeRetain"],computed:{userUrl(){return this.userOption.userUrl},roleUrl(){return this.userOption.roleUrl},deptUrl(){return this.userOption.deptUrl},postUrl(){return this.userOption.postUrl},customUrl(){return this.userOption.customUrl},customOption(){return this.userOption.customOption},roleProps(){return this.customOption?this.customOption.roleProps:{label:"roleName",value:"id",children:"children",records:"data.data"}},deptProps(){return this.customOption?this.customOption.deptProps:{label:"deptName",value:"id",children:"children",records:"data.data"}},postProps(){return this.customOption?this.customOption.postProps:{label:"postName",value:"id",children:"children",records:"data.data.records"}}},watch:{visible(e){var t;if(this.init||(this.getRoleList(),this.getDeptList(),this.getPostList(),this.getCustomList(),this.init=!0),e&&this.userOption&&this.userOption.data){const n=JSON.parse(JSON.stringify(this.userOption.data));for(let A of n)["role","post","dept"].includes(A.type)&&typeof A.value=="string"&&(A.value=((t=A.value)==null?void 0:t.split(","))||[]);this.data=n}}},data(){return{init:!1,visible:!1,data:[],roleList:[],deptList:[],postList:[],customList:[],selectIndex:0}},methods:{handleSelect(e,t){this.selectIndex=e,this.$refs[t].init()},handleSelectConfirm(e,t){this.data[this.selectIndex].value=e,this.data[this.selectIndex].text=t},handleTypeChange(e){const t=this.data[e].type;this.data[e]={type:t,value:["role","post","dept"].includes(t)?[]:""}},handleChange(e,t){setTimeout(()=>{let n=this.$refs[t].getCheckedNodes();console.error(n,"rext change"),n=n.map(A=>A.label).join(","),console.error(n,"rext change 2"),n&&(this.data[e].text=n)})},handleCustomChange(e,t){const n=this.customList.find(A=>A.expression==e);n?this.data[t].text=n.name:this.data[t].text=e},getRoleList(){this.$axios.get(this.roleUrl).then(e=>{const{records:t}=this.roleProps,n=this.getAsVal(e,t);this.handleList(n,this.roleProps),this.roleList=n})},getDeptList(){this.$axios.get(this.deptUrl).then(e=>{const{records:t}=this.deptProps,n=this.getAsVal(e,t);this.handleList(n,this.deptProps),this.deptList=n})},getPostList(){this.$axios.get(this.postUrl,{params:{size:-1}}).then(e=>{const{records:t}=this.postProps,n=this.getAsVal(e,t);this.handleList(n,this.postProps),this.postList=n})},getCustomList(){const e={size:-1,type:"user",status:1};this.$axios.get(this.customUrl,{params:e}).then(t=>{this.customList=t.data.data.records})},handleSubmit(){this.$emit("submit",this.data.filter(e=>e.type&&e.value)),this.visible=!1},handleClose(e){this.visible=!1,e&&typeof e=="function"&&e()},getAsVal(e,t=""){let n=this.deepClone(e);return this.validateNull(t)||t.split(".").forEach(A=>{this.validateNull(n[A])?n="":n=n[A]}),n},handleList(e,t){for(let n of e)n.label=n[t.label],n.value=n[t.value],n[t.children]&&(n.children=n[t.children],this.handleList(n.children,t))},handleRetainChange(e){this.$emit("update:assigneeRetain",e)}}};function uh(e,t,n,A,i,o){const r=s.resolveComponent("el-switch"),a=s.resolveComponent("el-icon-question-filled"),c=s.resolveComponent("el-icon"),l=s.resolveComponent("el-tooltip"),B=s.resolveComponent("el-button"),g=s.resolveComponent("el-table-column"),p=s.resolveComponent("el-option"),E=s.resolveComponent("el-select"),d=s.resolveComponent("user-select"),u=s.resolveComponent("el-tree-select"),h=s.resolveComponent("el-table"),D=s.resolveComponent("el-dialog");return s.openBlock(),s.createBlock(D,{ref:"nf-dialog",class:"nf-dialog",modelValue:i.visible,"onUpdate:modelValue":t[1]||(t[1]=y=>i.visible=y),title:e.t("nf.panel.node.assignee.v2.configure"),width:"60%","before-close":o.handleClose,"append-to-body":""},{footer:s.withCtx(()=>[s.createVNode(B,{onClick:o.handleClose,size:"default"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.assignee.v2.cancel")),1)]),_:1},8,["onClick"]),s.createVNode(B,{type:"primary",onClick:o.handleSubmit,size:"default"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.assignee.v2.submit")),1)]),_:1},8,["onClick"])]),default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(r,{"active-text":"交集","inactive-text":"并集","active-value":"true","inactive-value":"false","model-value":n.assigneeRetain,onChange:o.handleRetainChange},null,8,["model-value","onChange"]),s.createVNode(l,{effect:"dark",placement:"top","raw-content":"",content:"<span>并集:所有配置查询出来的全部用户。</span><br /><span>交集:每个配置查询出来的用户取交集。</span>"},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(a)]),_:1})]),_:1})]),i.visible?(s.openBlock(),s.createBlock(h,{key:0,data:i.data,border:"",size:"default"},{default:s.withCtx(()=>[s.createVNode(g,{align:"center","header-align":"center",width:"80"},{header:s.withCtx(()=>[s.createVNode(B,{circle:"",type:"primary",size:"default",icon:"el-icon-plus",onClick:t[0]||(t[0]=y=>i.data.push({value:""}))})]),default:s.withCtx(({$index:y})=>[s.createVNode(B,{circle:"",type:"danger",size:"default",icon:"el-icon-delete",onClick:C=>i.data.splice(y,1)},null,8,["onClick"])]),_:1}),s.createVNode(g,{label:e.t("nf.panel.node.assignee.v2.type"),prop:"type",align:"center","header-align":"center"},{default:s.withCtx(({row:y,$index:C})=>[s.createVNode(E,{modelValue:y.type,"onUpdate:modelValue":m=>y.type=m,size:"default",filterable:"",placeholder:e.t("nf.panel.node.assignee.v2.type"),onChange:m=>o.handleTypeChange(C)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.t("nf.panel.node.assignee.v2.typeList"),m=>(s.openBlock(),s.createBlock(p,{key:m.value,label:m.label,value:m.value,disabled:!!i.data.find(I=>I.type==m.value)},null,8,["label","value","disabled"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","onChange"])]),_:1},8,["label"]),s.createVNode(g,{label:e.t("nf.panel.node.assignee.v2.value"),prop:"text",align:"center","header-align":"center"},{default:s.withCtx(({row:y,$index:C})=>[y.type=="user"?(s.openBlock(),s.createBlock(d,{key:0,ref:"user-select","user-url":o.userUrl,"custom-option":o.customOption,"default-checked":y.value,"default-checked-text":y.text,onConfirm:o.handleSelectConfirm,onClick:m=>o.handleSelect(C,"user-select")},null,8,["user-url","custom-option","default-checked","default-checked-text","onConfirm","onClick"])):y.type=="role"?(s.openBlock(),s.createBlock(u,{key:1,ref:`role_${C}`,modelValue:y.value,"onUpdate:modelValue":m=>y.value=m,size:"default",multiple:"",filterable:"",clearable:"","check-strictly":"","show-checkbox":"","collapse-tags":"","max-collapse-tags":2,placeholder:e.t("nf.panel.node.assignee.v2.typeDic.role"),data:i.roleList,onChange:m=>o.handleChange(C,`role_${C}`),onCheck:m=>o.handleChange(C,`role_${C}`)},null,8,["modelValue","onUpdate:modelValue","placeholder","data","onChange","onCheck"])):y.type=="dept"?(s.openBlock(),s.createBlock(u,{key:2,ref:`dept_${C}`,modelValue:y.value,"onUpdate:modelValue":m=>y.value=m,size:"default",multiple:"",clearable:"",filterable:"","check-strictly":"","show-checkbox":"","collapse-tags":"","max-collapse-tags":2,placeholder:e.t("nf.panel.node.assignee.v2.typeDic.dept"),data:i.deptList,onChange:m=>o.handleChange(C,`dept_${C}`),onCheck:m=>o.handleChange(C,`dept_${C}`)},null,8,["modelValue","onUpdate:modelValue","placeholder","data","onChange","onCheck"])):y.type=="post"?(s.openBlock(),s.createBlock(u,{key:3,ref:`post_${C}`,modelValue:y.value,"onUpdate:modelValue":m=>y.value=m,size:"default",multiple:"",clearable:"",filterable:"","check-strictly":"","show-checkbox":"","collapse-tags":"","max-collapse-tags":2,placeholder:e.t("nf.panel.node.assignee.v2.typeDic.post"),data:i.postList,onChange:m=>o.handleChange(C,`post_${C}`),onCheck:m=>o.handleChange(C,`post_${C}`)},null,8,["modelValue","onUpdate:modelValue","placeholder","data","onChange","onCheck"])):y.type=="custom"?(s.openBlock(),s.createBlock(E,{key:4,modelValue:y.value,"onUpdate:modelValue":m=>y.value=m,size:"default",filterable:"",clearable:"",placeholder:e.t("nf.panel.node.assignee.v2.customRemark"),"allow-create":"",onChange:m=>o.handleCustomChange(m,C)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.customList,m=>(s.openBlock(),s.createBlock(p,{key:m.expression,value:m.expression,label:m.name},null,8,["value","label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","onChange"])):s.createCommentVNode("",!0)]),_:1},8,["label"])]),_:1},8,["data"])):s.createCommentVNode("",!0)]),_:1},8,["modelValue","title","before-close"])}const Qh={name:"nf-select-v2",mixins:[z0,v0],components:{UserOption:F0(dh,[["render",uh]])},data(){return{extensionType:"flowable:Assignee",data:[],typeDic:this.t("nf.panel.node.assignee.v2.typeDic"),option:{},assigneeRetain:"false"}},watch:{formData:{handler(e){if(this.element.type=="bpmn:UserTask"){const{assigneeRetain:A}=e;A?this.assigneeRetain=A:this.assigneeRetain="false"}else{const A=this.getExtensionElementsEq("flowable:AssigneeRetain");A&&A.length>0?this.assigneeRetain=A[0].value:this.assigneeRetain="false"}const n=this.getExtensionElementsEq(this.extensionType).map(A=>{const{type:i,value:o,text:r}=A;return{type:i,value:o,text:r}});this.data=n,this.option={...this.userOption,data:n}},deep:!0,immediate:!0}},methods:{handleSubmit(e){this.data=e,this.option.data=e,this.setExtensionElements(this.extensionType,e),this.element.type=="bpmn:UserTask"?this.updateProperties({assigneeRetain:this.assigneeRetain}):this.setExtensionElements("flowable:AssigneeRetain",[{value:this.assigneeRetain}]);const{assignee:t}=this.element.businessObject;t!="${assignee}"&&this.updateProperties({assignee:void 0}),this.updateProperties({candidateUsers:void 0}),this.updateProperties({candidateGroups:void 0})}}};function hh(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("el-table-column"),c=s.resolveComponent("el-table"),l=s.resolveComponent("user-option");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(r,{type:"primary",onClick:t[0]||(t[0]=B=>e.$refs["user-option"].visible=!0),size:"small"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.assignee.v2.configure")),1)]),_:1}),s.createVNode(c,{data:i.data,border:"",size:"small",style:{"margin-top":"5px"}},{default:s.withCtx(()=>[s.createVNode(a,{prop:"type",label:e.t("nf.panel.node.assignee.v2.type"),align:"center",width:"100"},{default:s.withCtx(({row:B})=>[s.createTextVNode(s.toDisplayString(i.typeDic[B.type]),1)]),_:1},8,["label"]),s.createVNode(a,{prop:"text",label:e.t("nf.panel.node.assignee.v2.value"),align:"center","show-overflow-tooltip":""},null,8,["label"])]),_:1},8,["data"]),s.createVNode(l,{ref:"user-option","user-option":i.option,assigneeRetain:i.assigneeRetain,"onUpdate:assigneeRetain":t[1]||(t[1]=B=>i.assigneeRetain=B),onSubmit:o.handleSubmit},null,8,["user-option","assigneeRetain","onSubmit"])])}const wh=F0(Qh,[["render",hh]]),mh={name:"nf-field",mixins:[v0],props:{row:{type:Object,default:()=>({})}},computed:{data(){return this.row.fields||[]}},data(){return{form:{},rules:{name:[{required:!0}],type:[{required:!0}],value:[{required:!0}]},visible:!1,isAdd:!0,rowIndex:0}},methods:{handleSubmit(){this.$refs.form.validate(e=>{if(e){const t=JSON.parse(JSON.stringify(this.form));this.isAdd?this.$emit("row-save",t):this.$emit("row-update",t,this.rowIndex),this.handleClose()}})},handleOpen(e=!0,t,n){this.visible=!0,this.isAdd=e,this.rowIndex=n,e||(this.form=JSON.parse(JSON.stringify(t)))},handleClose(e){e&&e(),this.visible=!1,this.form={}},handleDelete(e){this.$confirm(this.t("nf.panel.node.listener.message"),this.t("nf.panel.node.listener.warning"),{type:"warning"}).then(()=>{this.$emit("row-del",{},e)}).catch(()=>{})}}},fh={key:0};function Ch(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("el-table-column"),c=s.resolveComponent("el-table"),l=s.resolveComponent("el-input"),B=s.resolveComponent("el-form-item"),g=s.resolveComponent("el-radio"),p=s.resolveComponent("el-radio-group"),E=s.resolveComponent("el-form"),d=s.resolveComponent("el-drawer");return Object.keys(n.row).length>0?(s.openBlock(),s.createElementBlock("div",fh,[t[6]||(t[6]=s.createElementVNode("p",null,"字段注入",-1)),s.createVNode(r,{type:"primary",size:"small",onClick:o.handleOpen},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.add")),1)]),_:1},8,["onClick"]),s.createVNode(c,{data:o.data,border:"",size:"small",style:{"margin-top":"5px"}},{default:s.withCtx(()=>[s.createVNode(a,{prop:"name",label:e.t("nf.panel.node.listener.name"),align:"center"},null,8,["label"]),s.createVNode(a,{prop:"type",label:e.t("nf.panel.node.listener.type"),align:"center"},null,8,["label"]),s.createVNode(a,{prop:"value",label:e.t("nf.panel.node.listener.value"),align:"center"},null,8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.listener.operations"),align:"center",width:"100"},{default:s.withCtx(u=>[s.createVNode(r,{size:"default",type:"primary",text:"",onClick:s.withModifiers(h=>o.handleOpen(!1,u.row,u.$index),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.edit")),1)]),_:2},1032,["onClick"]),s.createVNode(r,{size:"default",type:"danger",text:"",onClick:s.withModifiers(h=>o.handleDelete(u.$index),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"]),s.createVNode(d,{modelValue:i.visible,"onUpdate:modelValue":t[3]||(t[3]=u=>i.visible=u),title:i.isAdd?e.t("nf.panel.node.listener.add"):e.t("nf.panel.node.listener.edit"),"append-to-body":"","before-close":o.handleClose,size:"50%"},{default:s.withCtx(()=>[s.createVNode(E,{ref:"form",style:{padding:"0 20px"},model:i.form,rules:i.rules,size:"default","label-suffix":":","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(B,{label:e.t("nf.panel.node.listener.name"),prop:"name"},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.form.name,"onUpdate:modelValue":t[0]||(t[0]=u=>i.form.name=u),placeholder:e.t("nf.panel.node.listener.name")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(B,{label:e.t("nf.panel.node.listener.type"),prop:"type"},{default:s.withCtx(()=>[s.createVNode(p,{modelValue:i.form.type,"onUpdate:modelValue":t[1]||(t[1]=u=>i.form.type=u)},{default:s.withCtx(()=>[s.createVNode(g,{label:"string",value:"string"},{default:s.withCtx(()=>t[4]||(t[4]=[s.createTextVNode("String")])),_:1,__:[4]}),s.createVNode(g,{label:"expression",value:"expression"},{default:s.withCtx(()=>t[5]||(t[5]=[s.createTextVNode(" Expression ")])),_:1,__:[5]})]),_:1},8,["modelValue"])]),_:1},8,["label"]),s.createVNode(B,{label:e.t("nf.panel.node.listener.value"),prop:"value"},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.form.value,"onUpdate:modelValue":t[2]||(t[2]=u=>i.form.value=u),placeholder:e.t("nf.panel.node.listener.value")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(B,null,{default:s.withCtx(()=>[s.createVNode(r,{type:"primary",size:"default",onClick:o.handleSubmit},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.submit")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title","before-close"])])):s.createCommentVNode("",!0)}const Mh={name:"nf-listener",components:{NfField:F0(mh,[["render",Ch]])},mixins:[z0,v0],props:{type:{type:String,required:!0,validator:e=>["Execution","Task"].includes(e)},listenerOption:{type:Array}},computed:{listenerOptionList(){return this.listenerOption&&this.listenerOption.length>0?this.listenerOption.filter(e=>e.category==this.type):[]}},data(){return{listener:[],listenerVisible:!1,eventTypeExecution:["start","take","end"],eventTypeTask:["create","assignment","complete","delete"],isAdd:!0,form:{listenerType:"class"},rules:{event:{required:!0,trigger:"change"},listenerType:{required:!0,trigger:"change"},value:{required:!0,trigger:"blur"}},currentListener:{}}},watch:{formData:{handler(e){const{extensionElements:t}=e,n=[];t&&t.values&&t.values.length>0&&t.values.forEach(A=>{if(A.$type.includes(this.type)||A.$type.includes(this.type.toLowerCase())){const i={id:zn(16),event:A.event};if(A.class?(i.value=A.class,i.listenerType="class"):A.expression?(i.value=A.expression,i.listenerType="expression"):A.delegateExpression&&(i.value=A.delegateExpression,i.listenerType="delegateExpression"),A.fields){const o=[];A.fields.forEach(r=>{r.string?o.push({name:r.name,type:"string",value:r.string}):r.expression&&o.push({name:r.name,type:"expression",value:r.expression})}),i.fields=o}n.push(i)}}),this.listener=n,setTimeout(()=>{const A=n[0];n.length>0&&this.$refs.table&&this.$refs.table.setCurrentRow(A),this.rowClick(A)})},deep:!0,immediate:!0}},mounted(){this.form.event=this[`eventType${this.type}`][0]},methods:{handleSubmit(){this.$refs.form.validate(e=>{if(e){const t=this.form;this.isAdd?(t.id=zn(16),this.listener.push(t)):this.listener.splice(this.listener.findIndex(n=>n.id==t.id),1,t),this.changeExtensionElements(),this.handleClose()}})},handleDelete(e){this.$confirm(this.t("nf.panel.node.listener.message"),this.t("nf.panel.node.listener.warning"),{type:"warning"}).then(()=>{this.listener.splice(e,1),this.changeExtensionElements()}).catch(()=>{})},changeExtensionElements(){const e=this.modeler.get("bpmnFactory"),t=[];this.listener.forEach(i=>{const{listenerType:o,value:r,event:a,fields:c}=i,l={[o]:r,event:a};if(c&&c.length>0){const g=[];c.forEach(p=>{g.push(this.createElement("flowable:Field",{[p.type]:p.value,name:p.name}))}),l.fields=g}const B=e.create(`flowable:${this.type}Listener`,l);t.push(B)});const n=[],{extensionElements:A}=this.element.businessObject;A&&A.values&&A.values.length>0&&A.values.forEach(i=>{i.$type.includes(this.type)||i.$type.includes(this.type.toLowerCase())||n.push(i)}),this.updateProperties({extensionElements:e.create("bpmn:ExtensionElements",{values:t.concat(n)})})},handleOpen(e=!0,t){this.listenerVisible=!0,this.isAdd=e,e||(this.form=JSON.parse(JSON.stringify(t)))},handleClose(){this.listenerVisible=!1,this.form={id:"",event:this[`eventType${this.type}`][0],listenerType:"class",value:""}},rowClick(e){this.currentListener=e},fieldSave(e){let{id:t,fields:n}=this.currentListener;n||(n=[]),n.push(e),this.currentListener.fields=n,this.listener.splice(this.listener.findIndex(A=>A.id==t),1,this.currentListener),this.changeExtensionElements()},fieldUpdate(e,t){this.currentListener.fields[t]=e,this.changeExtensionElements()},fieldDel(e,t){this.currentListener.fields.splice(t,1),this.changeExtensionElements()},handleQuickOptionChange(e){const t=this.listenerOptionList.find(n=>n.id==e);if(t){const{event:n,type:A,val:i}=t;this.form={event:n,listenerType:A,value:i}}}}};function Dh(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("el-table-column"),c=s.resolveComponent("el-table"),l=s.resolveComponent("el-icon-question-filled"),B=s.resolveComponent("el-icon"),g=s.resolveComponent("el-tooltip"),p=s.resolveComponent("el-option"),E=s.resolveComponent("el-select"),d=s.resolveComponent("el-form-item"),u=s.resolveComponent("el-input"),h=s.resolveComponent("el-form"),D=s.resolveComponent("el-drawer"),y=s.resolveComponent("nf-field");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(r,{type:"primary",size:"small",onClick:o.handleOpen},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.add")),1)]),_:1},8,["onClick"]),s.createVNode(c,{ref:"table",data:i.listener,border:"",size:"small",style:{"margin-top":"5px"},"highlight-current-row":"",onRowClick:o.rowClick},{default:s.withCtx(()=>[s.createVNode(a,{prop:"event",label:e.t("nf.panel.node.listener.event"),align:"center"},null,8,["label"]),s.createVNode(a,{prop:"listenerType",label:e.t("nf.panel.node.listener.type"),align:"center"},{default:s.withCtx(C=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.listener.listenerType")[C.row.listenerType]),1)]),_:1},8,["label"]),s.createVNode(a,{prop:"value",label:e.t("nf.panel.node.listener.value"),align:"center"},null,8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.listener.operations"),align:"center",width:"100"},{default:s.withCtx(C=>[s.createVNode(r,{size:"default",type:"primary",text:"",onClick:s.withModifiers(m=>o.handleOpen(!1,C.row),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.edit")),1)]),_:2},1032,["onClick"]),s.createVNode(r,{size:"default",type:"danger",text:"",onClick:s.withModifiers(m=>o.handleDelete(C.$index),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data","onRowClick"]),s.createVNode(D,{modelValue:i.listenerVisible,"onUpdate:modelValue":t[3]||(t[3]=C=>i.listenerVisible=C),title:i.isAdd?e.t("nf.panel.node.listener.add"):e.t("nf.panel.node.listener.edit"),"append-to-body":"","before-close":o.handleClose,size:"50%"},{default:s.withCtx(()=>[s.createVNode(h,{ref:"form",style:{padding:"0 20px"},model:i.form,rules:i.rules,size:"default","label-suffix":":","label-position":e.labelPosition,"label-width":"120px"},{default:s.withCtx(()=>[o.listenerOptionList&&o.listenerOptionList.length>0?(s.openBlock(),s.createBlock(d,{key:0},{label:s.withCtx(()=>[s.createVNode(g,{effect:"dark",content:e.t("nf.panel.node.listener.quickTip"),placement:"top"},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(B,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.listener.quick"))+": ",1)])]),_:1},8,["content"])]),default:s.withCtx(()=>[s.createVNode(E,{style:{width:"100%"},placeholder:e.t("nf.panel.node.listener.quick"),filterable:"",onChange:o.handleQuickOptionChange},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.listenerOptionList,(C,m)=>(s.openBlock(),s.createBlock(p,{key:m,label:C.name,value:C.id},null,8,["label","value"]))),128))]),_:1},8,["placeholder","onChange"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(d,{label:e.t("nf.panel.node.listener.event"),prop:"event"},{default:s.withCtx(()=>[s.createVNode(E,{style:{width:"100%"},modelValue:i.form.event,"onUpdate:modelValue":t[0]||(t[0]=C=>i.form.event=C),placeholder:e.t("nf.panel.node.listener.event")},{default:s.withCtx(()=>[n.type=="Task"?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(i.eventTypeTask,C=>(s.openBlock(),s.createBlock(p,{key:C,label:C,value:C},null,8,["label","value"]))),128)):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(i.eventTypeExecution,C=>(s.openBlock(),s.createBlock(p,{key:C,label:C,value:C},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,{label:e.t("nf.panel.node.listener.type"),prop:"listenerType"},{default:s.withCtx(()=>[s.createVNode(E,{style:{width:"100%"},modelValue:i.form.listenerType,"onUpdate:modelValue":t[1]||(t[1]=C=>i.form.listenerType=C),placeholder:e.t("nf.panel.node.listener.type")},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.t("nf.panel.node.listener.listenerType"),(C,m)=>(s.openBlock(),s.createBlock(p,{key:m,label:C,value:m},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,{label:e.t("nf.panel.node.listener.value"),prop:"value"},{default:s.withCtx(()=>[s.createVNode(u,{modelValue:i.form.value,"onUpdate:modelValue":t[2]||(t[2]=C=>i.form.value=C),placeholder:e.t("nf.panel.node.listener.value")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,null,{default:s.withCtx(()=>[s.createVNode(r,{type:"primary",size:"default",onClick:o.handleSubmit},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.submit")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model","rules","label-position"])]),_:1},8,["modelValue","title","before-close"]),s.createVNode(y,{style:{"margin-top":"20px"},row:i.currentListener,onRowSave:o.fieldSave,onRowUpdate:o.fieldUpdate,onRowDel:o.fieldDel},null,8,["row","onRowSave","onRowUpdate","onRowDel"])])}const yh=F0(Mh,[["render",Dh]]),Ih={name:"nf-extendedPropertyOption",mixins:[z0,v0],props:{type:{type:String,required:!0},extendedPropertyOption:{type:Array}},computed:{listenerOptionList(){return this.extendedPropertyOption&&this.extendedPropertyOption.length>0?this.extendedPropertyOption.filter(e=>e.category==this.type):[]}},data(){return{extendedPropertyOption:[],listenerVisible:!1,eventTypeExecution:["start","take","end"],eventTypeExtendedProperty:["create","assignment","complete","delete"],isAdd:!0,form:{name:"",value:"",remark:""},rules:{name:{required:!0,trigger:"change"},value:{required:!0,trigger:"change"},remark:{required:!1,trigger:"change"}},currentListener:{}}},watch:{formData:{handler(e){const{extensionElements:t}=e,n=[];t&&t.values&&t.values.length>0&&t.values.forEach(A=>{if(A.$type.includes(this.type)||A.$type.includes(this.type.toLowerCase())){const i={id:zn(16),...A};n.push(i)}}),this.extendedPropertyOption=n,setTimeout(()=>{const A=n[0];n.length>0&&this.$refs.table&&this.$refs.table.setCurrentRow(A),this.rowClick(A)})},deep:!0,immediate:!0}},mounted(){this.form.event=this[`eventType${this.type}`][0]},methods:{handleSubmit(){this.$refs.form.validate(e=>{if(e){const t=this.form;this.isAdd?(t.id=zn(16),this.extendedPropertyOption.push(t)):this.extendedPropertyOption.splice(this.extendedPropertyOption.findIndex(n=>n.id==t.id),1,t),this.changeExtensionElements(),this.handleClose()}})},handleDelete(e){this.$confirm(this.t("nf.panel.node.extendedProperty.message"),this.t("nf.panel.node.extendedProperty.warning"),{type:"warning"}).then(()=>{this.extendedPropertyOption.splice(e,1),this.changeExtensionElements()}).catch(()=>{})},changeExtensionElements(){const e=this.modeler.get("bpmnFactory"),t=[];this.extendedPropertyOption.forEach(i=>{const o=e.create(`flowable:${this.type}`,{...i});t.push(o)});const n=[],{extensionElements:A}=this.element.businessObject;A&&A.values&&A.values.length>0&&A.values.forEach(i=>{i.$type.includes(this.type)||i.$type.includes(this.type.toLowerCase())||n.push(i)}),this.updateProperties({extensionElements:e.create("bpmn:ExtensionElements",{values:t.concat(n)})})},handleOpen(e=!0,t){this.listenerVisible=!0,this.isAdd=e,e?this.$refs.form.resetFields():this.form=JSON.parse(JSON.stringify(t))},handleClose(){this.listenerVisible=!1,this.form={name:"",value:"",remark:""},this.$refs.form.clearValidate()},rowClick(e){this.currentListener=e},fieldSave(e){let{id:t,fields:n}=this.currentListener;n||(n=[]),n.push(e),this.currentListener.fields=n,this.extendedPropertyOption.splice(this.extendedPropertyOption.findIndex(A=>A.id==t),1,this.currentListener),this.changeExtensionElements()},fieldUpdate(e,t){this.currentListener.fields[t]=e,this.changeExtensionElements()},fieldDel(e,t){this.currentListener.fields.splice(t,1),this.changeExtensionElements()},handleQuickOptionChange(e){const t=this.listenerOptionList.find(n=>n.id==e);if(t){const{event:n,type:A,val:i}=t;this.form={event:n,listenerType:A,value:i}}}}};function Fh(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("el-table-column"),c=s.resolveComponent("el-table"),l=s.resolveComponent("el-icon-question-filled"),B=s.resolveComponent("el-icon"),g=s.resolveComponent("el-tooltip"),p=s.resolveComponent("el-option"),E=s.resolveComponent("el-select"),d=s.resolveComponent("el-form-item"),u=s.resolveComponent("el-input"),h=s.resolveComponent("el-form"),D=s.resolveComponent("el-drawer");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(r,{type:"primary",size:"small",onClick:o.handleOpen},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.extendedProperty.add")),1)]),_:1},8,["onClick"]),s.createVNode(c,{ref:"table",data:i.extendedPropertyOption,border:"",size:"small",style:{"margin-top":"5px"},"highlight-current-row":"",onRowClick:o.rowClick},{default:s.withCtx(()=>[s.createVNode(a,{prop:"name",label:e.t("nf.panel.node.extendedProperty.name"),align:"center"},null,8,["label"]),s.createVNode(a,{prop:"value",label:e.t("nf.panel.node.extendedProperty.value"),align:"center"},null,8,["label"]),s.createVNode(a,{prop:"remark",label:e.t("nf.panel.node.extendedProperty.remark"),align:"center"},null,8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.extendedProperty.operations"),align:"center",width:"100"},{default:s.withCtx(y=>[s.createVNode(r,{size:"default",type:"primary",text:"",onClick:s.withModifiers(C=>o.handleOpen(!1,y.row),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.extendedProperty.edit")),1)]),_:2},1032,["onClick"]),s.createVNode(r,{size:"default",type:"danger",text:"",onClick:s.withModifiers(C=>o.handleDelete(y.$index),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.extendedProperty.delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data","onRowClick"]),s.createVNode(D,{modelValue:i.listenerVisible,"onUpdate:modelValue":t[3]||(t[3]=y=>i.listenerVisible=y),title:i.isAdd?e.t("nf.panel.node.extendedProperty.add"):e.t("nf.panel.node.extendedProperty.edit"),"append-to-body":"","before-close":o.handleClose,size:"50%"},{default:s.withCtx(()=>[s.createVNode(h,{ref:"form",style:{padding:"0 20px"},model:i.form,rules:i.rules,size:"default","label-suffix":":","label-position":e.labelPosition,"label-width":"120px"},{default:s.withCtx(()=>[o.listenerOptionList&&o.listenerOptionList.length>0?(s.openBlock(),s.createBlock(d,{key:0},{label:s.withCtx(()=>[s.createVNode(g,{effect:"dark",content:e.t("nf.panel.node.extendedProperty.quickTip"),placement:"top"},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(B,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.extendedProperty.quick"))+": ",1)])]),_:1},8,["content"])]),default:s.withCtx(()=>[s.createVNode(E,{style:{width:"100%"},placeholder:e.t("nf.panel.node.extendedProperty.quick"),filterable:"",onChange:o.handleQuickOptionChange},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.listenerOptionList,(y,C)=>(s.openBlock(),s.createBlock(p,{key:C,label:y.name,value:y.id},null,8,["label","value"]))),128))]),_:1},8,["placeholder","onChange"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(d,{label:e.t("nf.panel.node.extendedProperty.name"),prop:"name"},{default:s.withCtx(()=>[s.createVNode(u,{modelValue:i.form.name,"onUpdate:modelValue":t[0]||(t[0]=y=>i.form.name=y),placeholder:e.t("nf.panel.node.extendedProperty.name")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,{label:e.t("nf.panel.node.extendedProperty.value"),prop:"value"},{default:s.withCtx(()=>[s.createVNode(u,{modelValue:i.form.value,"onUpdate:modelValue":t[1]||(t[1]=y=>i.form.value=y),placeholder:e.t("nf.panel.node.extendedProperty.value")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,{label:e.t("nf.panel.node.extendedProperty.remark"),prop:"remark"},{default:s.withCtx(()=>[s.createVNode(u,{type:"textarea",rows:"3",modelValue:i.form.remark,"onUpdate:modelValue":t[2]||(t[2]=y=>i.form.remark=y),placeholder:e.t("nf.panel.node.extendedProperty.remark")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,null,{default:s.withCtx(()=>[s.createVNode(r,{type:"primary",size:"default",onClick:o.handleSubmit},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.extendedProperty.submit")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model","rules","label-position"])]),_:1},8,["modelValue","title","before-close"])])}const vh=F0(Ih,[["render",Fh]]),xh={name:"multi-instance",mixins:[z0,v0],props:{type:{type:String,required:!0,validator:e=>["UserTask","SubProcess"].includes(e)}},watch:{formData:{handler(e){const{loopCharacteristics:t}=e;if(t){const{isSequential:n,completionCondition:A,loopCardinality:i,collection:o,elementVariable:r}=t;if(n?this.multiInstance.isSequential="Sequential":this.multiInstance.isSequential="Parallel",A){const a=A.body;a.includes("${")&&a.includes(">=")?this.multiInstance.completionCondition=Number(a.substring(a.indexOf(">=")+2,a.indexOf("}")).trim())*100:this.multiInstance.completionCondition=a}else delete this.multiInstance.completionCondition;i?this.multiInstance.loopCardinality=i.body:delete this.multiInstance.loopCardinality,this.multiInstance.collection=o,this.multiInstance.elementVariable=r}else this.multiInstance={}},deep:!0,immediate:!0}},data(){return{multiInstance:{}}},methods:{handleMultiInstance(e){let t,n;e?(t=this.modeler.get("bpmnFactory").create("bpmn:MultiInstanceLoopCharacteristics"),e==="Sequential"&&(t.isSequential=!0),t.elementVariable="assignee",t.collection="${wfMultiInstanceHandler.getList(execution)}",t.completionCondition=this.modeler.get("bpmnFactory").create("bpmn:FormalExpression",{body:"${nrOfCompletedInstances/nrOfInstances >= 100}"}),this.multiInstance.completionCondition=100,n="${assignee}"):(t=void 0,n=void 0),this.element.type=="bpmn:UserTask"&&this.updateProperties({assignee:n}),this.updateProperties({loopCharacteristics:t})},updateMultiInstanceProperties(e){const t=this.element.businessObject.loopCharacteristics;if(t)for(let n in e)t[n]=e[n];for(let n in e)t[n]=e[n];this.updateProperties({loopCharacteristics:t})},updateFormalExpression(e,t){e&&t?t=this.modeler.get("bpmnFactory").create("bpmn:FormalExpression",{body:t}):t=void 0;const n=this.element.businessObject.loopCharacteristics;n[e]=t,this.updateProperties({loopCharacteristics:n})}}},bh={key:0};function Yh(e,t,n,A,i,o){const r=s.resolveComponent("el-option"),a=s.resolveComponent("el-select"),c=s.resolveComponent("el-form-item"),l=s.resolveComponent("el-slider"),B=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(B,{model:i.multiInstance,"label-position":e.labelPosition,"label-width":"90px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[s.createVNode(c,{label:e.t("nf.panel.node.multiInstance.type")},{default:s.withCtx(()=>[s.createVNode(a,{style:{width:"100%"},modelValue:i.multiInstance.isSequential,"onUpdate:modelValue":t[0]||(t[0]=g=>i.multiInstance.isSequential=g),clearable:"",placeholder:e.t("nf.panel.node.multiInstance.type"),onChange:o.handleMultiInstance},{default:s.withCtx(()=>[s.createVNode(r,{label:e.t("nf.panel.node.multiInstance.parallel"),value:"Parallel"},null,8,["label"]),s.createVNode(r,{label:e.t("nf.panel.node.multiInstance.sequential"),value:"Sequential"},null,8,["label"])]),_:1},8,["modelValue","placeholder","onChange"])]),_:1},8,["label"]),i.multiInstance.isSequential?(s.openBlock(),s.createElementBlock("div",bh,[s.createVNode(c,{label:e.t("nf.panel.node.multiInstance.completionCondition")},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.multiInstance.completionCondition,"onUpdate:modelValue":t[1]||(t[1]=g=>i.multiInstance.completionCondition=g),"show-input":"",min:0,max:100,"format-tooltip":g=>g+"%",onChange:t[2]||(t[2]=g=>o.updateFormalExpression("completionCondition","${nrOfCompletedInstances/nrOfInstances >= "+g/100+"}"))},null,8,["modelValue","format-tooltip"])]),_:1},8,["label"])])):s.createCommentVNode("",!0)]),_:1},8,["model","label-position"])}const Uh=F0(xh,[["render",Yh]]),Nh={name:"nf-form-config",mixins:[z0,v0],components:{UserSelect:Ll},computed:{userUrl(){return this.userOption.userUrl},customOption(){return this.userOption.customOption},indepFormList(){return this.formOption.list||[]}},data(){return{extensionType:"flowable:FormProperty",formExtensionType:"flowable:FormProp",form:{},column:[],align:"center",mode:"",defaultChecked:"",copyExtensionType:"flowable:CopyUser",indepOption:{menuBtn:!1,size:"default",column:[{prop:"indepFormSummary",label:"汇总表单",labelTip:"1、系统会自动汇总当前节点之前/选择的所有表单,并且表单只读。<br>2、确保所有表单字段的prop唯一。<br>3、请确保当前节点之前的表单配置正确。",span:24,type:"radio",dicData:[{label:"是",value:"1"},{label:"否",value:"0"}],value:"0",change:({value:e})=>{if(!e)return;const t=this.findObject(this.indepOption.column,"indepSummaryNode");t!=-1&&(e=="1"?(t.display=!0,t.dicData=this.nodes):t.display=!1,this.handleUpdateProperties("indepFormSummary",e))},display:!0},{prop:"indepSummaryNode",label:"汇总节点",type:"select",span:24,placeholder:"不选择则表示之前所有节点",multiple:!0,dicData:[],props:{label:"name",value:"id"},display:!0,change:({value:e})=>{!e||e.length==0||this.handleUpdateProperties("indepSummaryNode",e.join(","))}},{prop:"indepFormKey",label:"表单key",dicData:[],props:{label:"name",value:"formKey"},type:"select",span:24,change:({value:e,column:t})=>{if(this.indepOption.init)if(e){const n=t.dicData.find(A=>A.formKey==e);n&&(this.handleUpdateProperties("indepFormKey",e),this.resolveColumn(this.getFormColumn(n.content)))}else this.handleUpdateProperties("indepFormKey",void 0),this.resolveColumn([])},display:!0}]},readableCheckAll:!0,writableCheckAll:!0,requiredCheckAll:!0}},watch:{formData:{handler(e){let{hideAttachment:t,hideCopy:n,hideExamine:A,exFormKey:i,exFormUrl:o,exAppFormUrl:r,indepFormKey:a,indepFormSummary:c,indepSummaryNode:l}=e;if(this.element.type=="bpmn:UserTask")t?t=JSON.parse(t):t=!1,n?n=JSON.parse(n):n=!1,A?A=JSON.parse(A):A=!1;else if(this.element.type=="bpmn:StartEvent"){const p=this.getExtensionElementsEq("flowable:HideCopy");p&&p.length>0?n=JSON.parse(p[0].value):n=!1;const E=this.getExtensionElementsEq("flowable:HideExamine");E&&E.length>0?A=JSON.parse(E[0].value):A=!1;const d=this.getExtensionElementsEq("flowable:ExFormKey");d&&d.length>0&&(i=d[0].value);const u=this.getExtensionElementsEq("flowable:ExFormUrl");u&&u.length>0&&(o=u[0].value);const h=this.getExtensionElementsEq("flowable:ExAppFormUrl");h&&h.length>0&&(r=h[0].value);const D=this.getExtensionElementsEq("flowable:IndepFormKey");D&&D.length>0&&(a=D[0].value)}this.form.hideAttachment=t,this.form.hideCopy=n,this.form.hideExamine=A;const B=this.getExtensionElementsEq(this.copyExtensionType);if(B&&B.length>0){const p=[],E=[];B.forEach(d=>{p.push(d.value),E.push(d.text)}),this.form.copyUser=p.join(","),this.form.$copyUser=E.join(" | ")}else delete this.form.copyUser,delete this.form.$copyUser;let g=[];if(this.formOption)g=this.getFormColumn(this.formOption),this.handleUpdateProperties("exFormKey",void 0),this.handleUpdateProperties("exFormUrl",void 0),this.handleUpdateProperties("exAppFormUrl",void 0),this.handleUpdateProperties("indepFormKey",void 0),this.resolveColumn(g);else if(this.exFormOption){const p=this.exFormOption.column;if(!p||p.length==0){let E=this.getExtensionElementsEq(this.extensionType);(!E||E.length==0)&&(E=this.getExtensionElementsEq(this.formExtensionType)),E&&E.length>0?g=E.map(d=>({label:d.name,prop:d.id,readable:!!d.readable,writable:!!d.writable})):g=[]}else g=this.getFormColumn(this.exFormOption);i=this.exFormOption.exFormKey||i||"",o=this.exFormOption.exFormUrl||o||"",r=this.exFormOption.exAppFormUrl||r||"",this.form.exFormKey=i,this.form.exFormUrl=o,this.form.exAppFormUrl=r,this.mode="ex-form",this.handleUpdateProperties("exFormKey",i),this.handleUpdateProperties("exFormUrl",o),this.handleUpdateProperties("exAppFormUrl",r),this.handleUpdateProperties("indepFormKey",void 0),this.resolveColumn(g)}else if(this.indepFormOption){this.indepOption.init=!1,this.handleUpdateProperties("exFormKey",void 0),this.handleUpdateProperties("exFormUrl",void 0),this.handleUpdateProperties("exAppFormUrl",void 0);const{list:p}=this.indepFormOption;if(this.findObject(this.indepOption.column,"indepFormKey").dicData=p,this.mode="indep",a){const E=p.find(d=>d.formKey==a);E&&this.resolveColumn(this.getFormColumn(E.content)),this.form.indepFormKey=a}else this.resolveColumn([]),delete this.form.indepFormKey;if(c){this.form.indepFormSummary=c;const E=this.findObject(this.indepOption.column,"indepSummaryNode");E!=-1&&(E.dicData=this.nodes)}else this.form.indepFormSummary="0";l?this.form.indepSummaryNode=l.split(","):this.form.indepSummaryNode=[],this.$nextTick(()=>{this.indepOption.init=!0,this.element.type=="bpmn:StartEvent"&&(this.findObject(this.indepOption.column,"indepFormSummary").display=!1,this.findObject(this.indepOption.column,"indepSummaryNode").display=!1)})}},deep:!0,immediate:!0}},methods:{handleCheckChange(){const e=[],t=[],n=[],A=[],i=[],o=r=>!r||r.length==0?null:(r.forEach(a=>{const{prop:c,label:l,readable:B,writable:g,required:p}=a;e.push({id:c,name:l,readable:B,writable:g,required:p}),B&&t.push(a),g&&n.push(a),p&&A.push(a),i.push(a),a.children&&a.children.length>0&&(this.align="left",a.children=o(a.children))}),r);o(this.column),this.deleteExtensionElements(this.extensionType),this.setExtensionElements(this.formExtensionType,e),t.length==i.length?this.readableCheckAll=!0:this.readableCheckAll=!1,n.length==i.length?this.writableCheckAll=!0:this.writableCheckAll=!1,A.length==i.length?this.requiredCheckAll=!0:this.requiredCheckAll=!1},resolveColumn(e=[]){const t=[],n=[],A=[],i=[],o=[];if(e.length>0){let r=this.getExtensionElementsEq(this.extensionType);(!r||r.length==0)&&(r=this.getExtensionElementsEq(this.formExtensionType));const a=c=>!c||c.length==0?null:(c.forEach(l=>{if(r&&r.length>0){let u=r.find(h=>h.id==l.prop);if(u){const{readable:h,writable:D,required:y}=u;l.readable=JSON.parse(h),l.writable=JSON.parse(D),l.required=y!=null?JSON.parse(y):!0}}const{prop:B,label:g,readable:p,writable:E,required:d}=l;t.push({id:B,name:g,readable:p,writable:E,required:d}),p&&n.push(l),E&&A.push(l),d&&i.push(l),o.push(l),l.children&&l.children.length>0&&(this.align="left",l.children=a(l.children))}),c);e=a(e)}this.deleteExtensionElements(this.extensionType),this.setExtensionElements(this.formExtensionType,t),this.column=e,n.length==o.length?this.readableCheckAll=!0:this.readableCheckAll=!1,A.length==o.length?this.writableCheckAll=!0:this.writableCheckAll=!1,i.length==o.length?this.requiredCheckAll=!0:this.requiredCheckAll=!1},getFormColumn(e){let t=[];if(!e)return t;typeof e=="string"&&(e=Function('"use strict";return ('+e+")")());const n=A=>{if(!Array.isArray(A))return null;const i=[];return A.forEach(o=>{const r={label:o.type=="title"?`${o.label}(${o.textValue})`:o.label,prop:o.prop,writable:!0,readable:!0,required:!0,random:Math.ceil(Math.random()*1e4)};let a;if(o.children&&o.children.column)a=n(o.children.column);else if(o.params&&o.params.children&&o.params.children.column&&o.params.children.column.length>0)a=n(o.params.children.column);else if(o.rows&&o.rows.length>0){let c=[];o.rows.forEach(l=>{l.cols&&l.cols.length>0&&l.cols.forEach(B=>{B.column&&B.column.length>0&&(c=c.concat(n(B.column)))})}),a=c}a&&a.length>0&&(this.align="left",r.children=a),i.push(r)}),i};if(e.column&&e.column.length>0){const A=n(e.column);A&&Array.isArray(A)&&(t=t.concat(A))}return e.group&&e.group.length>0&&e.group.forEach(A=>{if(A.column&&A.column.length>0){const i=n(A.column);i&&Array.isArray(i)&&(t=t.concat(i))}}),t},handleUpdateProperties(e,t){this.element.type=="bpmn:UserTask"?this.updateProperties({[e]:t||void 0}):this.setExtensionElements(`flowable:${e.replace(e[0],e[0].toUpperCase())}`,t?[{value:t+""}]:[])},handleUserSelect(){setTimeout(()=>{this.$refs["user-select"].init()})},handleUserSelectConfirm(e,t){const n=[];t&&(t=t.includes(" | ")?t.split(" | ").join(","):t),e.split(",").forEach((A,i)=>{A&&n.push({value:A,text:t.split(",")[i]})}),this.setExtensionElements(this.copyExtensionType,n),this.form.copyUser=e,this.form.$copyUser=t},handleUserClear(){this.setExtensionElements(this.copyExtensionType,[]),delete this.form.copyUser,delete this.form.$copyUser},handleCheckAll(e,t,n){n.forEach(A=>{A[t]=e,A.children&&A.children.length>0&&this.handleCheckAll(e,t,A.children)}),this.handleCheckChange()}}};function zh(e,t,n,A,i,o){const r=s.resolveComponent("el-icon-question-filled"),a=s.resolveComponent("el-icon"),c=s.resolveComponent("el-tooltip"),l=s.resolveComponent("el-input"),B=s.resolveComponent("el-form-item"),g=s.resolveComponent("nf-form"),p=s.resolveComponent("el-table-column"),E=s.resolveComponent("el-checkbox"),d=s.resolveComponent("el-table"),u=s.resolveComponent("el-tag"),h=s.resolveComponent("el-divider"),D=s.resolveComponent("el-switch"),y=s.resolveComponent("user-select"),C=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(C,{model:i.form,"label-position":e.labelPosition,"label-width":"100px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[i.mode=="ex-form"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(B,null,{label:s.withCtx(()=>[s.createVNode(c,{effect:"dark",placement:"top"},{content:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.remark.r1"))+" "+s.toDisplayString(`/workflow/process/external/${i.form.exFormKey}/start`)+" "+s.toDisplayString(e.t("nf.panel.node.form.router"))+" ",1),t[19]||(t[19]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r2"))+" "+s.toDisplayString(`/workflow/process/external/${i.form.exFormKey}/detail`)+" "+s.toDisplayString(e.t("nf.panel.node.form.router"))+" ",1),t[20]||(t[20]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r7"))+" "+s.toDisplayString(`/pages/plugin/workflow/pages/external/${i.form.exFormKey}/{type}`)+" "+s.toDisplayString(e.t("nf.panel.node.form.router"))+" ",1),t[21]||(t[21]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r3"))+" ",1),t[22]||(t[22]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r4")),1)]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.exFormKey"))+" ",1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1}),t[23]||(t[23]=s.createTextVNode(" : "))])]),_:1})]),default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.form.exFormKey,"onUpdate:modelValue":t[0]||(t[0]=m=>i.form.exFormKey=m),readonly:"",placeholder:e.t("nf.panel.node.form.exFormKey"),onInput:t[1]||(t[1]=m=>o.handleUpdateProperties("exFormKey",i.form.exFormKey))},null,8,["modelValue","placeholder"])]),_:1}),s.createVNode(B,null,{label:s.withCtx(()=>[s.createVNode(c,{effect:"dark",placement:"top"},{content:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.remark.r5"))+" ",1),t[24]||(t[24]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r6")),1)]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.exFormUrl"))+" ",1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1}),t[25]||(t[25]=s.createTextVNode(" : "))])]),_:1})]),default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.form.exFormUrl,"onUpdate:modelValue":t[2]||(t[2]=m=>i.form.exFormUrl=m),clearable:"",placeholder:e.t("nf.panel.node.form.exFormUrl"),onInput:t[3]||(t[3]=m=>o.handleUpdateProperties("exFormUrl",i.form.exFormUrl))},null,8,["modelValue","placeholder"])]),_:1}),s.createVNode(B,{"label-width":"110px"},{label:s.withCtx(()=>[s.createVNode(c,{effect:"dark",placement:"top"},{content:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.remark.r5"))+" ",1),t[26]||(t[26]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r6")),1)]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.exAppFormUrl"))+" ",1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1}),t[27]||(t[27]=s.createTextVNode(" : "))])]),_:1})]),default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.form.exAppFormUrl,"onUpdate:modelValue":t[4]||(t[4]=m=>i.form.exAppFormUrl=m),clearable:"",placeholder:"/pages/xxx",onInput:t[5]||(t[5]=m=>o.handleUpdateProperties("exAppFormUrl",i.form.exAppFormUrl))},null,8,["modelValue"])]),_:1})],64)):i.mode=="indep"?(s.openBlock(),s.createBlock(g,{key:1,modelValue:i.form,"onUpdate:modelValue":t[6]||(t[6]=m=>i.form=m),option:i.indepOption},null,8,["modelValue","option"])):s.createCommentVNode("",!0),i.column&&i.column.length>0?(s.openBlock(),s.createBlock(d,{key:2,data:i.column,border:"","default-expand-all":"","row-key":m=>m.prop+"-"+m.random,size:"small",style:{"margin-top":"5px"},indent:6},{default:s.withCtx(()=>[s.createVNode(p,{prop:"label",label:e.t("nf.panel.node.form.label"),width:"110","header-align":"center",align:i.align,"show-overflow-tooltip":""},null,8,["label","align"]),s.createVNode(p,{prop:"readable",label:e.t("nf.panel.node.form.readable"),align:"center",width:"70"},{header:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.readable"))+" ",1),s.createVNode(E,{size:"small",modelValue:i.readableCheckAll,"onUpdate:modelValue":t[7]||(t[7]=m=>i.readableCheckAll=m),onChange:t[8]||(t[8]=m=>o.handleCheckAll(m,"readable",i.column))},null,8,["modelValue"])]),default:s.withCtx(({row:m})=>[s.createVNode(E,{modelValue:m.readable,"onUpdate:modelValue":I=>m.readable=I,onChange:I=>o.handleCheckChange(m,"readable")},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1},8,["label"]),s.createVNode(p,{prop:"writable",label:e.t("nf.panel.node.form.writable"),align:"center",width:"70"},{header:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.writable"))+" ",1),s.createVNode(E,{size:"small",modelValue:i.writableCheckAll,"onUpdate:modelValue":t[9]||(t[9]=m=>i.writableCheckAll=m),onChange:t[10]||(t[10]=m=>o.handleCheckAll(m,"writable",i.column))},null,8,["modelValue"])]),default:s.withCtx(({row:m})=>[s.createVNode(E,{modelValue:m.writable,"onUpdate:modelValue":I=>m.writable=I,onChange:I=>o.handleCheckChange(m,"writable")},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1},8,["label"]),s.createVNode(p,{prop:"required",label:e.t("nf.panel.node.form.required"),align:"center",width:"70"},{header:s.withCtx(()=>[s.createVNode(c,{placement:"top"},{content:s.withCtx(()=>t[28]||(t[28]=[s.createTextVNode(" 1、表单字段必填与此项必填时, 字段必填 "),s.createElementVNode("span",{style:{color:"red"}},"生效",-1),s.createElementVNode("br",null,null,-1),s.createTextVNode(" 2、表单字段必填, 此项非必填时, 字段必填 "),s.createElementVNode("span",{style:{color:"red"}},"不",-1),s.createTextVNode(" 生效 "),s.createElementVNode("br",null,null,-1),s.createTextVNode(" 3、表单字段非必填, 此项必填时, 字段必填 "),s.createElementVNode("span",{style:{color:"red"}},"不",-1),s.createTextVNode(" 生效 ")])),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.form.required"))+" ",1)]),_:1}),s.createVNode(E,{size:"small",modelValue:i.requiredCheckAll,"onUpdate:modelValue":t[11]||(t[11]=m=>i.requiredCheckAll=m),onChange:t[12]||(t[12]=m=>o.handleCheckAll(m,"required",i.column))},null,8,["modelValue"])]),default:s.withCtx(({row:m})=>[s.createVNode(E,{modelValue:m.required,"onUpdate:modelValue":I=>m.required=I,onChange:I=>o.handleCheckChange(m,"required")},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1},8,["label"]),s.createVNode(p,{prop:"prop",label:e.t("nf.panel.node.form.prop"),align:"center","show-overflow-tooltip":""},null,8,["label"])]),_:1},8,["data","row-key"])):(!i.column||i.column.length==0)&&i.mode!="indep"?(s.openBlock(),s.createBlock(u,{key:3,type:"danger",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1}),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.unknown")),1)]),_:1})):s.createCommentVNode("",!0),s.createVNode(h),e.element.type=="bpmn:UserTask"?(s.openBlock(),s.createBlock(B,{key:4,label:e.t("nf.panel.node.examine.hideAttachment"),"label-width":"130px"},{default:s.withCtx(()=>[s.createVNode(D,{modelValue:i.form.hideAttachment,"onUpdate:modelValue":t[13]||(t[13]=m=>i.form.hideAttachment=m),onChange:t[14]||(t[14]=m=>o.handleUpdateProperties("hideAttachment",i.form.hideAttachment))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(B,{label:e.t("nf.panel.node.examine.hideCopy"),"label-width":"130px"},{default:s.withCtx(()=>[s.createVNode(D,{modelValue:i.form.hideCopy,"onUpdate:modelValue":t[15]||(t[15]=m=>i.form.hideCopy=m),onChange:t[16]||(t[16]=m=>o.handleUpdateProperties("hideCopy",i.form.hideCopy))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(B,{label:e.t("nf.panel.node.examine.hideAssignee"),"label-width":"130px"},{default:s.withCtx(()=>[s.createVNode(D,{modelValue:i.form.hideExamine,"onUpdate:modelValue":t[17]||(t[17]=m=>i.form.hideExamine=m),onChange:t[18]||(t[18]=m=>o.handleUpdateProperties("hideExamine",i.form.hideExamine))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(B,{label:e.t("nf.panel.node.examine.copyUser"),"label-width":"130px"},{default:s.withCtx(()=>[s.createVNode(y,{ref:"user-select","user-url":o.userUrl,"custom-option":o.customOption,"default-checked":i.form.copyUser,"default-checked-text":i.form.$copyUser,onConfirm:o.handleUserSelectConfirm,onClick:o.handleUserSelect},null,8,["user-url","custom-option","default-checked","default-checked-text","onConfirm","onClick"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Rh=F0(Nh,[["render",zh]]),Sh={name:"nf-button",mixins:[z0,v0],data(){return{extensionType:"flowable:Button",form:{},column:[]}},watch:{formData:{handler(e){const{extensionElements:t}=e;let n=[];if(this.buttonOption&&this.buttonOption.length>0){const A=JSON.parse(JSON.stringify(this.buttonOption)),i=[];if(t&&t.values&&t.values.length>0){const o=this.getExtensionElementsEq(this.extensionType);A.forEach(r=>{const a=o.find(c=>c.prop==r.prop);a&&(r.display=JSON.parse(a.display)),i.push(r)})}else A.forEach(o=>i.push(o));this.setExtensionElements(this.extensionType,i),n=A}this.column=n},deep:!0,immediate:!0}}};function Th(e,t,n,A,i,o){const r=s.resolveComponent("el-table-column"),a=s.resolveComponent("el-checkbox"),c=s.resolveComponent("el-table"),l=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(l,{model:i.form,"label-position":e.labelPosition,"label-width":"90px","label-suffix":":"},{default:s.withCtx(()=>[s.createVNode(c,{data:i.column,border:"",size:"small",style:{"margin-top":"5px"}},{default:s.withCtx(()=>[s.createVNode(r,{prop:"label",label:e.t("nf.panel.node.button.label"),align:"center",width:"90","show-overflow-tooltip":""},null,8,["label"]),s.createVNode(r,{prop:"prop",label:e.t("nf.panel.node.button.prop"),align:"center","show-overflow-tooltip":""},null,8,["label"]),s.createVNode(r,{prop:"display",label:e.t("nf.panel.node.button.display"),align:"center",width:"100"},{default:s.withCtx(({row:B})=>[s.createVNode(a,{modelValue:B.display,"onUpdate:modelValue":g=>B.display=g,size:"default",onChange:t[0]||(t[0]=g=>e.setExtensionElements(i.extensionType,i.column))},null,8,["modelValue","onUpdate:modelValue"])]),_:1},8,["label"])]),_:1},8,["data"])]),_:1},8,["model","label-position"])}const kh=F0(Sh,[["render",Th]]),Gh={name:"nf-condition",mixins:[z0,v0],data(){return{condition:{}}},watch:{formData:{handler(e){const{conditionExpression:t}=e;t?this.condition.conditionExpression=t.body:delete this.condition.conditionExpression},deep:!0,immediate:!0}}};function Hh(e,t,n,A,i,o){const r=s.resolveComponent("el-option"),a=s.resolveComponent("el-select"),c=s.resolveComponent("el-input"),l=s.resolveComponent("el-form-item"),B=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(B,{model:i.condition,"label-position":e.labelPosition,"label-width":"90px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[s.createVNode(l,{label:e.t("nf.panel.node.condition.conditionExpression")},{default:s.withCtx(()=>[e.conditionOption&&e.conditionOption.length>0?(s.openBlock(),s.createBlock(a,{key:0,modelValue:i.condition.conditionExpression,"onUpdate:modelValue":t[0]||(t[0]=g=>i.condition.conditionExpression=g),"allow-create":"",clearable:"",filterable:"",placeholder:e.t("nf.panel.node.condition.conditionExpression"),onChange:t[1]||(t[1]=g=>e.updateFormalExpression("conditionExpression",i.condition.conditionExpression))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.conditionOption,g=>(s.openBlock(),s.createBlock(r,{key:g.expression,label:g.name,value:g.expression},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])):(s.openBlock(),s.createBlock(c,{key:1,modelValue:i.condition.conditionExpression,"onUpdate:modelValue":t[2]||(t[2]=g=>i.condition.conditionExpression=g),clearable:"",placeholder:e.t("nf.panel.node.condition.conditionExpression"),onInput:t[3]||(t[3]=g=>e.updateFormalExpression("conditionExpression",i.condition.conditionExpression))},null,8,["modelValue","placeholder"]))]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Ph=F0(Gh,[["render",Hh]]),Jh={name:"nf-timer-event",mixins:[z0,v0],watch:{formData:{handler(e){let{isInterrupting:t,cancelActivity:n}=e;t==null&&(t=!0),n==null&&(n=!0),this.timer.isInterrupting=t,this.timer.cancelActivity=n;let A=this.getEventDefinitions(this.type);if(A&&A.length>0){const{timeCycle:i,timeDate:o,timeDuration:r}=A[0];i?this.timer.timeCycle=i.body:delete this.timer.timeCycle,o?this.timer.timeDate=o.body:delete this.timer.timeDate,r?this.timer.timeDuration=r.body:delete this.timer.timeDuration}},deep:!0,immediate:!0}},data(){return{type:"bpmn:TimerEventDefinition",expressionType:"bpmn:Expression",timer:{}}}};function jh(e,t,n,A,i,o){const r=s.resolveComponent("el-switch"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-input"),l=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(l,{model:i.timer,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[["bpmn:StartEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.timer.isInterrupting,"onUpdate:modelValue":t[0]||(t[0]=B=>i.timer.isInterrupting=B),onChange:t[1]||(t[1]=B=>e.updateProperties({isInterrupting:i.timer.isInterrupting}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),["bpmn:BoundaryEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:1,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.timer.cancelActivity,"onUpdate:modelValue":t[2]||(t[2]=B=>i.timer.cancelActivity=B),onChange:t[3]||(t[3]=B=>e.updateProperties({cancelActivity:i.timer.cancelActivity}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.timer.timeCycle")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.timer.timeCycle,"onUpdate:modelValue":t[4]||(t[4]=B=>i.timer.timeCycle=B),clearable:"",placeholder:e.t("nf.panel.node.event.timer.timeCycle"),onInput:t[5]||(t[5]=B=>e.setEventDefinitions(i.type,{timeCycle:e.createElement(i.expressionType,{body:i.timer.timeCycle})}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.event.timer.timeDate")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.timer.timeDate,"onUpdate:modelValue":t[6]||(t[6]=B=>i.timer.timeDate=B),clearable:"",placeholder:e.t("nf.panel.node.event.timer.timeDate"),onInput:t[7]||(t[7]=B=>e.setEventDefinitions(i.type,{timeDate:e.createElement(i.expressionType,{body:i.timer.timeDate})}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.event.timer.timeDuration")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.timer.timeDuration,"onUpdate:modelValue":t[8]||(t[8]=B=>i.timer.timeDuration=B),clearable:"",placeholder:e.t("nf.panel.node.event.timer.timeDuration"),onInput:t[9]||(t[9]=B=>e.setEventDefinitions(i.type,{timeDuration:e.createElement(i.expressionType,{body:i.timer.timeDuration})}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Vh=F0(Jh,[["render",jh]]),Lh={name:"nf-signal-event",mixins:[z0,v0],watch:{formData:{handler(e){let{isInterrupting:t,cancelActivity:n}=e;t==null&&(t=!0),n==null&&(n=!0),this.signal.isInterrupting=t,this.signal.cancelActivity=n;const A=this.getRootElements(this.signalType);this.signalList=A;let i=this.getEventDefinitions(this.type);if(i&&i.length>0){const{signalRef:o}=i[0];o?A.find(r=>r.id==o.id)?this.signal.signalRef=o.id:this.setEventDefinitions(this.type,{signalRef:void 0}):delete this.signal.signalRef}},deep:!0,immediate:!0}},data(){return{type:"bpmn:SignalEventDefinition",signalType:"bpmn:Signal",signal:{},signalList:[],option:{column:[{label:"ID",prop:"id",overHidden:!0,span:24,editDisabled:!0,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]},{label:"Name",prop:"name",overHidden:!0,span:24,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]}]}}},methods:{}};function Wh(e,t,n,A,i,o){const r=s.resolveComponent("nf-dynamic"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-option"),B=s.resolveComponent("el-select"),g=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(g,{model:i.signal,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{"label-width":"0"},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.signalList,"onUpdate:modelValue":t[0]||(t[0]=p=>i.signalList=p),children:i.option},null,8,["modelValue","children"])]),_:1}),["bpmn:StartEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.signal.isInterrupting,"onUpdate:modelValue":t[1]||(t[1]=p=>i.signal.isInterrupting=p),onChange:t[2]||(t[2]=p=>e.updateProperties({isInterrupting:i.signal.isInterrupting}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),["bpmn:BoundaryEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:1,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.signal.cancelActivity,"onUpdate:modelValue":t[3]||(t[3]=p=>i.signal.cancelActivity=p),onChange:t[4]||(t[4]=p=>e.updateProperties({cancelActivity:i.signal.cancelActivity}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.signalRef")},{default:s.withCtx(()=>[s.createVNode(B,{modelValue:i.signal.signalRef,"onUpdate:modelValue":t[5]||(t[5]=p=>i.signal.signalRef=p),clearable:"",filterable:"","allow-create":"",placeholder:e.t("nf.panel.node.event.signalRef"),onChange:t[6]||(t[6]=p=>e.setEventDefinitions(i.type,{signalRef:p?e.createElement(i.signalType,{id:p,name:p}):void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.signalList,(p,E)=>(s.openBlock(),s.createBlock(l,{label:p.name,value:p.id,key:E},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const _h=F0(Lh,[["render",Wh]]),Oh={name:"nf-message-event",mixins:[z0,v0],watch:{formData:{handler(e){let{isInterrupting:t,cancelActivity:n}=e;t==null&&(t=!0),n==null&&(n=!0),this.message.isInterrupting=t,this.message.cancelActivity=n;const A=this.getRootElements(this.messageType);this.messageList=A;let i=this.getEventDefinitions(this.type);if(i&&i.length>0){const{messageRef:o}=i[0];o?A.find(r=>r.id==o.id)?this.message.messageRef=o.id:this.setEventDefinitions(this.type,{messageRef:void 0}):delete this.message.messageRef}},deep:!0,immediate:!0}},data(){return{type:"bpmn:MessageEventDefinition",messageType:"bpmn:Message",message:{},messageList:[],option:{column:[{label:"ID",prop:"id",overHidden:!0,span:24,editDisabled:!0,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]},{label:"Name",prop:"name",overHidden:!0,span:24,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]}]}}},methods:{}};function Xh(e,t,n,A,i,o){const r=s.resolveComponent("nf-dynamic"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-option"),B=s.resolveComponent("el-select"),g=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(g,{model:i.message,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{"label-width":"0"},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.messageList,"onUpdate:modelValue":t[0]||(t[0]=p=>i.messageList=p),children:i.option},null,8,["modelValue","children"])]),_:1}),["bpmn:StartEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.message.isInterrupting,"onUpdate:modelValue":t[1]||(t[1]=p=>i.message.isInterrupting=p),onChange:t[2]||(t[2]=p=>e.updateProperties({isInterrupting:i.message.isInterrupting}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),["bpmn:BoundaryEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:1,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.message.cancelActivity,"onUpdate:modelValue":t[3]||(t[3]=p=>i.message.cancelActivity=p),onChange:t[4]||(t[4]=p=>e.updateProperties({cancelActivity:i.message.cancelActivity}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.messageRef")},{default:s.withCtx(()=>[s.createVNode(B,{modelValue:i.message.messageRef,"onUpdate:modelValue":t[5]||(t[5]=p=>i.message.messageRef=p),clearable:"",filterable:"","allow-create":"",placeholder:e.t("nf.panel.node.event.messageRef"),onChange:t[6]||(t[6]=p=>e.setEventDefinitions(i.type,{messageRef:p?e.createElement(i.messageType,{id:p,name:p}):void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.messageList,(p,E)=>(s.openBlock(),s.createBlock(l,{label:p.name,value:p.id,key:E},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Kh=F0(Oh,[["render",Xh]]),Zh={name:"nf-error-event",mixins:[z0,v0],watch:{formData:{handler(e){let{isInterrupting:t}=e;t==null&&(t=!0),this.error.isInterrupting=t;const n=this.getRootElements(this.errorType);this.errorList=n;let A=this.getEventDefinitions(this.type);if(A&&A.length>0){const{errorRef:i}=A[0];i?n.find(o=>o.id==i.id)?this.error.errorRef=i.id:this.setEventDefinitions(this.type,{errorRef:void 0}):delete this.error.errorRef}},deep:!0,immediate:!0}},data(){return{type:"bpmn:ErrorEventDefinition",errorType:"bpmn:Error",error:{},errorList:[],form:{},option:{column:[{label:"ID",prop:"id",rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]},{label:"Name",prop:"name",rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]}]}}},methods:{}};function qh(e,t,n,A,i,o){const r=s.resolveComponent("nf-dynamic"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-option"),B=s.resolveComponent("el-select"),g=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(g,{model:i.error,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{"label-width":"0"},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.errorList,"onUpdate:modelValue":t[0]||(t[0]=p=>i.errorList=p),children:i.option},null,8,["modelValue","children"])]),_:1}),["bpmn:StartEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.error.isInterrupting,"onUpdate:modelValue":t[1]||(t[1]=p=>i.error.isInterrupting=p),onChange:t[2]||(t[2]=p=>e.updateProperties({isInterrupting:i.error.isInterrupting}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.errorRef")},{default:s.withCtx(()=>[s.createVNode(B,{modelValue:i.error.errorRef,"onUpdate:modelValue":t[3]||(t[3]=p=>i.error.errorRef=p),clearable:"",filterable:"","allow-create":"",placeholder:e.t("nf.panel.node.event.errorRef"),onChange:t[4]||(t[4]=p=>e.setEventDefinitions(i.type,{errorRef:p?e.createElement(i.errorType,{id:p,name:p}):void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.errorList,(p,E)=>(s.openBlock(),s.createBlock(l,{label:p.name,value:p.id,key:E},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const $h=F0(Zh,[["render",qh]]),ew={name:"nf-terminate-event",mixins:[z0,v0],watch:{formData:{handler(e){let t=this.getEventDefinitions(this.type);if(t&&t.length>0){const n=t[0].$attrs["flowable:terminateAll"];n?this.terminate.terminateAll=JSON.parse(n):delete this.terminate.terminateAll}},deep:!0,immediate:!0}},data(){return{terminate:{}}}};function tw(e,t,n,A,i,o){const r=s.resolveComponent("el-switch"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(c,{model:i.terminate,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{label:e.t("nf.panel.node.event.terminateAll")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.terminate.terminateAll,"onUpdate:modelValue":t[0]||(t[0]=l=>i.terminate.terminateAll=l),onChange:t[1]||(t[1]=l=>e.element.businessObject.eventDefinitions[0].$attrs["flowable:terminateAll"]=l)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const nw=F0(ew,[["render",tw]]),Aw={name:"nf-compensate-event",mixins:[z0,v0],watch:{formData:{handler(){this.compensateList=this.nodes.filter(t=>t.nodeType.toLowerCase().includes("task")||["bpmn:SubProcess","bpmn:CallActivity"].includes(t.nodeType));let e=this.getEventDefinitions(this.type);if(e&&e.length>0){const{activityRef:t}=e[0];t?this.compensate.activityRef=t.id:delete this.compensate.activityRef}},deep:!0,immediate:!0}},data(){return{type:"bpmn:CompensateEventDefinition",compensateType:"bpmn:Activity",compensate:{},form:{},compensateList:[]}}};function iw(e,t,n,A,i,o){const r=s.resolveComponent("el-option"),a=s.resolveComponent("el-select"),c=s.resolveComponent("el-form-item"),l=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(l,{model:i.compensate,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[s.createVNode(c,{label:e.t("nf.panel.node.event.activityRef")},{default:s.withCtx(()=>[s.createVNode(a,{modelValue:i.compensate.activityRef,"onUpdate:modelValue":t[0]||(t[0]=B=>i.compensate.activityRef=B),clearable:"",filterable:"","allow-create":"",placeholder:e.t("nf.panel.node.event.activityRef"),onChange:t[1]||(t[1]=B=>e.setEventDefinitions(i.type,{activityRef:B?{id:B}:void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.compensateList,(B,g)=>(s.openBlock(),s.createBlock(r,{label:B.name,value:B.id,key:g},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const ow=F0(Aw,[["render",iw]]),rw={name:"nf-conditional-event",mixins:[z0,v0],watch:{formData:{handler(e){let{isInterrupting:t,cancelActivity:n}=e;t==null&&(t=!0),n==null&&(n=!0),this.conditional.isInterrupting=t,this.conditional.cancelActivity=n;let A=this.getEventDefinitions(this.type);if(A&&A.length>0){const{condition:i}=A[0];i?this.conditional.condition=i.body:delete this.conditional.condition}},deep:!0,immediate:!0}},data(){return{type:"bpmn:ConditionalEventDefinition",conditionType:"bpmn:FormalExpression",conditional:{}}}};function aw(e,t,n,A,i,o){const r=s.resolveComponent("el-switch"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-input"),l=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(l,{model:i.conditional,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[["bpmn:StartEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.conditional.isInterrupting,"onUpdate:modelValue":t[0]||(t[0]=B=>i.conditional.isInterrupting=B),onChange:t[1]||(t[1]=B=>e.updateProperties({isInterrupting:i.conditional.isInterrupting}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),["bpmn:BoundaryEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:1,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.conditional.cancelActivity,"onUpdate:modelValue":t[2]||(t[2]=B=>i.conditional.cancelActivity=B),onChange:t[3]||(t[3]=B=>e.updateProperties({cancelActivity:i.conditional.cancelActivity}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.condition")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.conditional.condition,"onUpdate:modelValue":t[4]||(t[4]=B=>i.conditional.condition=B),clearable:"",placeholder:e.t("nf.panel.node.event.condition"),onInput:t[5]||(t[5]=B=>e.setEventDefinitions(i.type,{condition:e.createElement(i.conditionType,{body:i.conditional.condition})}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const cw=F0(rw,[["render",aw]]),sw={name:"nf-escalation-event",mixins:[z0,v0],watch:{formData:{handler(e){let{cancelActivity:t}=e;t==null&&(t=!0),this.escalation.cancelActivity=t;const n=this.getRootElements(this.escalationType);this.escalationList=n;let A=this.getEventDefinitions(this.type);if(A&&A.length>0){const{escalationRef:i}=A[0];i?n.find(o=>o.id==i.id)?this.escalation.escalationRef=i.id:this.setEventDefinitions(this.type,{escalationRef:void 0}):delete this.escalation.escalationRef}},deep:!0,immediate:!0}},data(){return{type:"bpmn:EscalationEventDefinition",escalationType:"bpmn:Escalation",escalation:{},escalationList:[],option:{column:[{label:"ID",prop:"id",overHidden:!0,span:24,editDisabled:!0,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母,且不能包含中文"}]},{label:"Name",prop:"name",overHidden:!0,span:24,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母,且不能包含中文"}]}]}}},methods:{}};function lw(e,t,n,A,i,o){const r=s.resolveComponent("nf-dynamic"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-option"),B=s.resolveComponent("el-select"),g=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(g,{model:i.escalation,"label-position":e.labelPosition,"label-suffix":":","label-width":"120px",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{"label-width":"0"},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.escalationList,"onUpdate:modelValue":t[0]||(t[0]=p=>i.escalationList=p),children:i.option},null,8,["modelValue","children"])]),_:1}),["bpmn:BoundaryEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.escalation.cancelActivity,"onUpdate:modelValue":t[1]||(t[1]=p=>i.escalation.cancelActivity=p),onChange:t[2]||(t[2]=p=>e.updateProperties({cancelActivity:i.escalation.cancelActivity}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.escalationRef")},{default:s.withCtx(()=>[s.createVNode(B,{modelValue:i.escalation.escalationRef,"onUpdate:modelValue":t[3]||(t[3]=p=>i.escalation.escalationRef=p),clearable:"",filterable:"","allow-create":"",placeholder:e.t("nf.panel.node.event.escalationRef"),onChange:t[4]||(t[4]=p=>e.setEventDefinitions(i.type,{escalationRef:p?e.createElement(i.escalationType,{id:p,name:p}):void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.escalationList,(p,E)=>(s.openBlock(),s.createBlock(l,{label:p.name,value:p.id,key:E},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Bw={name:"nf-event",mixins:[z0],components:{NfTimerEvent:Vh,NfSignalEvent:_h,NfMessageEvent:Kh,NfErrorEvent:$h,NfTerminateEvent:nw,NfCompensateEvent:ow,NfConditionalEvent:cw,NfEscalationEvent:F0(sw,[["render",lw]])},watch:{formData:{handler(){const e=this.getEventDefinitions();e&&e.length>0&&(this.type=e[0].$type)},deep:!0,immediate:!0}},data(){return{type:""}}};function gw(e,t,n,A,i,o){const r=s.resolveComponent("nf-timer-event"),a=s.resolveComponent("nf-signal-event"),c=s.resolveComponent("nf-message-event"),l=s.resolveComponent("nf-conditional-event"),B=s.resolveComponent("nf-error-event"),g=s.resolveComponent("nf-terminate-event"),p=s.resolveComponent("nf-compensate-event"),E=s.resolveComponent("nf-escalation-event");return s.openBlock(),s.createElementBlock("div",null,[i.type=="bpmn:TimerEventDefinition"?(s.openBlock(),s.createBlock(r,{key:0,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:SignalEventDefinition"?(s.openBlock(),s.createBlock(a,{key:1,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:MessageEventDefinition"?(s.openBlock(),s.createBlock(c,{key:2,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:ConditionalEventDefinition"?(s.openBlock(),s.createBlock(l,{key:3,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:ErrorEventDefinition"?(s.openBlock(),s.createBlock(B,{key:4,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:TerminateEventDefinition"?(s.openBlock(),s.createBlock(g,{key:5,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:CompensateEventDefinition"?(s.openBlock(),s.createBlock(p,{key:6,modeler:e.modeler,element:e.element,nodes:e.nodes},null,8,["modeler","element","nodes"])):s.createCommentVNode("",!0),i.type=="bpmn:EscalationEventDefinition"?(s.openBlock(),s.createBlock(E,{key:7,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0)])}const pw=F0(Bw,[["render",gw]]),Ew={name:"nf-call",mixins:[z0,v0],watch:{formData:{handler(e){this.clearExtensionElements(["flowable:ExecutionListener","flowable:Assignee"])},deep:!0,immediate:!0}}};function dw(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(l,{model:e.formData,"label-position":e.labelPosition,"label-width":"100px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{label:e.t("nf.panel.node.call.calledElement"),prop:"callElement"},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.calledElement,"onUpdate:modelValue":t[0]||(t[0]=B=>e.formData.calledElement=B),clearable:"",placeholder:e.t("nf.panel.node.call.calledElement"),onInput:t[1]||(t[1]=B=>e.updateProperties({calledElement:e.formData.calledElement,calledElementType:"key"}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.call.inheritVariables")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:e.formData.inheritVariables,"onUpdate:modelValue":t[2]||(t[2]=B=>e.formData.inheritVariables=B),"active-value":"true","inactive-value":"false",onChange:t[3]||(t[3]=B=>e.updateProperties({inheritVariables:e.formData.inheritVariables||void 0}))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.call.sameDeployment")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:e.formData.sameDeployment,"onUpdate:modelValue":t[4]||(t[4]=B=>e.formData.sameDeployment=B),"active-value":"true","inactive-value":"false",onChange:t[5]||(t[5]=B=>e.updateProperties({sameDeployment:e.formData.sameDeployment||void 0}))},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const uw=F0(Ew,[["render",dw]]),Qw={name:"java",mixins:[z0,v0],props:{javaType:String,disabled:{type:Boolean,default:!1}},watch:{formData:{handler(e){const{delegateExpression:t,expression:n}=e,A=e.class;A?this.java.class=A:t?this.java.delegateExpression=t:n&&(this.java.expression=n)},deep:!0,immediate:!0}},data(){return{java:{}}},methods:{handleChange(e,t){this.updateProperties(Object.assign({type:void 0,class:void 0,delegateExpression:void 0,expression:void 0},{[e]:t})),this.updateProperties({extensionElements:this.modeler.get("bpmnFactory").create("bpmn:ExtensionElements",{values:this.getExtensionElementsNotEq("flowable:Field")})})}}};function hw(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("el-form-item");return s.openBlock(),s.createElementBlock("div",null,[n.javaType=="class"?(s.openBlock(),s.createBlock(a,{key:0,label:"类"},{default:s.withCtx(()=>[s.createVNode(r,{disabled:n.disabled,modelValue:i.java.class,"onUpdate:modelValue":t[0]||(t[0]=c=>i.java.class=c),placeholder:"类",clearable:"",onChange:t[1]||(t[1]=c=>o.handleChange("class",c))},null,8,["disabled","modelValue"])]),_:1})):s.createCommentVNode("",!0),n.javaType=="delegateExpression"?(s.openBlock(),s.createBlock(a,{key:1,label:"代理表达式","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(r,{disabled:n.disabled,modelValue:i.java.delegateExpression,"onUpdate:modelValue":t[2]||(t[2]=c=>i.java.delegateExpression=c),placeholder:"代理表达式",clearable:"",onChange:t[3]||(t[3]=c=>o.handleChange("delegateExpression",c))},null,8,["disabled","modelValue"])]),_:1})):s.createCommentVNode("",!0),n.javaType=="expression"?(s.openBlock(),s.createBlock(a,{key:2,label:"表达式"},{default:s.withCtx(()=>[s.createVNode(r,{disabled:n.disabled,modelValue:i.java.expression,"onUpdate:modelValue":t[4]||(t[4]=c=>i.java.expression=c),placeholder:"表达式",clearable:"",onChange:t[5]||(t[5]=c=>o.handleChange("expression",c))},null,8,["disabled","modelValue"])]),_:1})):s.createCommentVNode("",!0)])}const ww=F0(Qw,[["render",hw]]),mw={name:"http",props:{disabled:{type:Boolean,default:!1}},mixins:[z0,v0],watch:{formData:{handler(){const e=this.getExtensionElementsEq("flowable:Field");e&&e.length>0&&e.forEach(t=>{this.http[t.name]=t.string||t.expression})},deep:!0,immediate:!0}},data(){return{http:{}}},methods:{handleChange(e,t){let n="string",A="expression";(t.includes("${")||t.includes("#{"))&&(n="expression",A="string");const i=this.getExtensionElementsEq("flowable:Field");let o=i.find(a=>a.name==e);o?(o[n]=t,o[A]=void 0):(o={[n]:t,name:e},i.push(o));const r=[];i.forEach(a=>{const{name:c,string:l,expression:B}=a;r.push({name:c,[l?"string":"expression"]:l||B})}),this.setExtensionElements("flowable:Field",r)}}};function fw(e,t,n,A,i,o){const r=s.resolveComponent("el-option"),a=s.resolveComponent("el-select"),c=s.resolveComponent("el-form-item"),l=s.resolveComponent("el-input"),B=s.resolveComponent("el-switch");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(c,{label:"请求方法",prop:"requestMethod"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.http.requestMethod,"onUpdate:modelValue":t[0]||(t[0]=g=>i.http.requestMethod=g),placeholder:"请求方法",clearable:"",onChange:t[1]||(t[1]=g=>o.handleChange("requestMethod",g))},{default:s.withCtx(()=>[s.createVNode(r,{label:"GET",value:"GET"}),s.createVNode(r,{label:"POST",value:"POST"}),s.createVNode(r,{label:"PUT",value:"PUT"}),s.createVNode(r,{label:"DELETE",value:"DELETE"})]),_:1},8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"请求URL",prop:"requestUrl"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.requestUrl,"onUpdate:modelValue":t[2]||(t[2]=g=>i.http.requestUrl=g),type:"textarea",placeholder:"请求URL",autosize:"",clearable:"",onChange:t[3]||(t[3]=g=>o.handleChange("requestUrl",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"请求头",prop:"requestHeaders"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.requestHeaders,"onUpdate:modelValue":t[4]||(t[4]=g=>i.http.requestHeaders=g),type:"textarea",placeholder:"请求头,多条请换行",autosize:"",clearable:"",onChange:t[5]||(t[5]=g=>o.handleChange("requestHeaders",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"请求体",prop:"requestBody"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.requestBody,"onUpdate:modelValue":t[6]||(t[6]=g=>i.http.requestBody=g),type:"textarea",placeholder:`{
37
+ **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const qQ=Object.prototype.hasOwnProperty,$Q=(e,t)=>qQ.call(e,t),eh=/(%|)\{([0-9a-zA-Z_]+)\}/g;function th(e){function t(n="",...A){return typeof n!="string"?n:(A.length===1&&typeof A[0]=="object"&&(A=A[0]),(!A||!A.hasOwnProperty)&&(A={}),n.replace(eh,(i,o,r,a)=>{let c;return n[a-1]==="{"&&n[a+i.length]==="}"?r:(c=$Q(A,r)?A[r]:null,c??"")}))}return t}const nh={nf:{lang:"zh",panel:{process:{tab:"流程配置",basic:{label:"基本配置",key:"流程key",name:"流程名称",description:"流程描述",skipFirstNode:"跳过第一节点",skipWhenStartUser:"任务审核人为发起人时跳过",skipWhenAssignee:"任务审核人之前审核过时跳过",rollbackNode:{label:"默认驳回节点",placeholder:"不选择默认驳回到上一节点"}},sn:{label:"流水号配置",useExistSN:"使用已有流水号",useExistSNTip:"请保持名称和前缀与已有流水号一致",configure:"配置",format:"流水号格式",name:"名称",prefix:"前缀",dateFormat:"日期格式",suffixLength:"后缀位数",initialValue:"初始数值",connector:"连接符",resetCycle:{label:"重置周期",dicData:[{label:"不重置",value:"none"},{label:"按天重置",value:"day"},{label:"按周重置",value:"week"},{label:"按月重置",value:"month"},{label:"按年重置",value:"year"}]}},title:{label:"流程标题配置"},callBack:{label:"回调配置"}},node:{tab:"节点配置",message:"选择节点后配置",basic:{title:"基本配置",id:"节点id",name:"节点名称",text:"注解内容",description:"节点描述",rollbackNode:{label:"驳回节点",placeholder:"不选择默认使用流程配置",backToRejecter:"重新提交后回到驳回人",backToRejecterText:"假如D驳回到A,A重新发起时直接到D,跳过B、C"},priority:"优先级",async:{label:"异步",yes:"是",no:"否"},dueDate:"超时",skipExpression:"跳过表达式"},assignee:{title:"人员配置",v1:{assignee:"处理人",candidateUsers:"候选用户",candidateGroups:"候选组",title:"人员选择",unselected:"未选择",selected:"已选择",message:"请至少选择一项"},v2:{configure:"人员配置",type:"类型",value:"值",typeDic:{user:"用户",role:"角色",dept:"部门",post:"职位",custom:"自定义"},typeList:[{label:"用户",value:"user"},{label:"角色",value:"role"},{label:"部门",value:"dept"},{label:"职位",value:"post"},{label:"自定义",value:"custom"}],customRemark:"请确保选择/填写的选项已实现相关逻辑",title:"人员选择",cancel:"取 消",submit:"确 定",user:{avatar:"头像",name:"姓名",dept:"部门",post:"职位",phone:"手机号"},message:"请至少选择一项",dept:{title:"部门选择",name:"部门名称",fullName:"部门全称",category:"部门类型"}}},button:{title:"按钮配置",label:"字段",prop:"属性",display:"是否显示"},condition:{title:"流转条件",conditionExpression:"流转条件"},examine:{hideAttachment:"隐藏审批附件",hideCopy:"隐藏选择抄送人",copyUser:"默认抄送人",hideAssignee:"隐藏选择审核人"},form:{title:"表单配置",exFormKey:"表单key",exFormUrl:"表单路由",router:"路由",remark:{r1:"发起流程会自动匹配",r2:"查看详情会自动匹配",r3:"请拷贝模版页面或参考demo项目实现自己的逻辑",r4:"会动态添加路由,无需配置。已知小问题:框架限制,刷新404",r5:"若配置此项,表单key的自动匹配路由将失效",r6:"请自行配置相应路由",r7:"移动端会自动匹配"},exAppFormUrl:"移动端路由",label:"字段",prop:"属性",readable:"可读",writable:"可写",required:"必填",unknown:"未知表单配置,请自行控制字段显隐等属性。"},listener:{taskTitle:"任务监听",executionTitle:"执行监听",add:"添加",edit:"编辑",delete:"删除",event:"事件",type:"类型",value:"值",operations:"操作",submit:"确定",listenerType:{class:"类",expression:"表达式",delegateExpression:"代理表达式"},message:"确定要删除吗",warning:"警告",name:"名称",quick:"快捷配置",quickTip:"快捷配置以下选项,无实际作用"},extendedProperty:{taskTitle:"扩展属性",executionTitle:"执行扩展属性",add:"添加",edit:"编辑",name:"属性名",value:"属性值",remark:"备注",delete:"删除",event:"事件",type:"类型",operations:"操作",submit:"确定",listenerType:{class:"类",expression:"表达式",delegateExpression:"代理表达式"},isDeleteType:{yes:"是",no:"否"},message:"确定要删除吗",warning:"警告",quick:"快捷配置",quickTip:"快捷配置以下选项,无实际作用"},multiInstance:{title:"多实例配置",type:"类型",parallel:"并行",sequential:"串行",completionCondition:"完成条件"},event:{title:"事件配置",isInterrupting:"是否中断",condition:"表达式",activityRef:"活动引用",errorRef:"错误引用",escalationRef:"升级引用",messageRef:"消息引用",signalRef:"信号引用",terminateAll:"全部终止",timer:{timeCycle:"时间周期",timeDate:"时间日期",timeDuration:"持续时间"}},call:{title:"调用活动",calledElement:"子流程key",inheritVariables:"继承变量",sameDeployment:"同一部署"},service:{title:"服务配置",type:"类型",typeOption:[{label:"类",value:"class"},{label:"代理表达式",value:"delegateExpression"},{label:"表达式",value:"expression"},{label:"Http",value:"http"},{label:"Shell",value:"shell"},{label:"Mail",value:"mail"}]},script:{title:"脚本配置"}}},toolbar:{open:"打开",create:"新建",fit:"自适应屏幕",center:"居中",zoomIn:"放大",zoomOut:"缩小",undo:"后退",redo:"前进",download:"下载",downloadXml:"下载XML",downloadSvg:"下载SVG",importXml:"导入",previewXml:"查看",getXml:"获取XML"}}},Rn=s.createApp({}),Ah=th();let to=nh,Jl=!1,Za=function(){const e=Object.getPrototypeOf(this||Rn||{}).$t;if(typeof e=="function"&&Rn.locale)return Jl||(Jl=!0,Rn.locale(Rn.config.lang,Object.assign(to,Rn.locale(Rn.config.lang)||{},{clone:!0}))),e.apply(this,arguments)};const jl=function(e,t){let n=Za.apply(this,arguments);if(n!=null)return n;const A=e.split(".");let i=to;for(let o=0,r=A.length;o<r;o++){const a=A[o];if(n=i[a],o===r-1)return Ah(n,t);if(!n)return"";i=n}return""},Vl={use:function(e){to=e||to},t:jl,i18n:function(e){Za=e||Za}},v0={methods:{t(...e){return jl.apply(this,e)}}},F0=(e,t)=>{const n=e.__vccOpts||e;for(const[A,i]of t)n[A]=i;return n},ih={name:"bpmn-tools",mixins:[v0],emits:["open","create","fit","undo","redo","download","import","preview"],props:{toolbar:{type:Array,default:()=>[]}},methods:{handleBeforeUpload(e){const t=new FileReader;return t.readAsText(e,"utf-8"),t.onload=()=>{this.$emit("open",t.result)},!1},handleCreate(){this.$confirm("确定要新建吗?","警告",{type:"warning"}).then(()=>{this.$emit("create")}).catch(()=>{})}}},oh={class:"nf-tools"},rh={class:"nf-tools--left"},ah={style:{padding:"10px",display:"flex"}};function ch(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("el-tooltip"),c=s.resolveComponent("el-upload"),l=s.resolveComponent("el-popover");return s.openBlock(),s.createElementBlock("div",oh,[s.createElementVNode("div",rh,[n.toolbar.includes("open")?(s.openBlock(),s.createBlock(c,{key:0,accept:".xml, .bpmn",action:"","before-upload":o.handleBeforeUpload,style:{"margin-right":"10px",display:"inline-block"}},{default:s.withCtx(()=>[s.createVNode(a,{effect:"dark",content:e.t("nf.toolbar.open"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-folder-opened"})]),_:1},8,["content"])]),_:1},8,["before-upload"])):s.createCommentVNode("",!0),n.toolbar.includes("create")?(s.openBlock(),s.createBlock(a,{key:1,effect:"dark",content:e.t("nf.toolbar.create"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-circle-plus",onClick:o.handleCreate},null,8,["onClick"])]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("fit")?(s.openBlock(),s.createBlock(a,{key:2,effect:"dark",content:e.t("nf.toolbar.fit"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-rank",onClick:t[0]||(t[0]=B=>e.$emit("fit","init"))})]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("fit")?(s.openBlock(),s.createBlock(a,{key:3,effect:"dark",content:e.t("nf.toolbar.center"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-aim",onClick:t[1]||(t[1]=B=>e.$emit("fit","auto"))})]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("zoom-in")?(s.openBlock(),s.createBlock(a,{key:4,effect:"dark",content:e.t("nf.toolbar.zoomIn"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-zoom-in",onClick:t[2]||(t[2]=B=>e.$emit("fit",!0))})]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("zoom-out")?(s.openBlock(),s.createBlock(a,{key:5,effect:"dark",content:e.t("nf.toolbar.zoomOut"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-zoom-out",onClick:t[3]||(t[3]=B=>e.$emit("fit",!1))})]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("undo")?(s.openBlock(),s.createBlock(a,{key:6,effect:"dark",content:e.t("nf.toolbar.undo"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-refresh-left",onClick:t[4]||(t[4]=B=>e.$emit("undo"))})]),_:1},8,["content"])):s.createCommentVNode("",!0),n.toolbar.includes("redo")?(s.openBlock(),s.createBlock(a,{key:7,effect:"dark",content:e.t("nf.toolbar.redo"),placement:"bottom"},{default:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-refresh-right",onClick:t[5]||(t[5]=B=>e.$emit("redo"))})]),_:1},8,["content"])):s.createCommentVNode("",!0)]),s.createElementVNode("div",null,[n.toolbar.includes("download-xml")||n.toolbar.includes("download-svg")?(s.openBlock(),s.createBlock(l,{key:0,placement:"bottom",width:"200px",trigger:"hover",style:{margin:"0 10px"}},{reference:s.withCtx(()=>[s.createVNode(r,{size:"default",icon:"el-icon-download"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.download")),1)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("div",ah,[n.toolbar.includes("download-xml")?(s.openBlock(),s.createBlock(r,{key:0,size:"default",type:"primary",icon:"el-icon-download",onClick:t[6]||(t[6]=B=>e.$emit("download","xml",!0))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.downloadXml")),1)]),_:1})):s.createCommentVNode("",!0),n.toolbar.includes("download-svg")?(s.openBlock(),s.createBlock(r,{key:1,size:"default",type:"warning",icon:"el-icon-picture",onClick:t[7]||(t[7]=B=>e.$emit("download","svg",!0))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.downloadSvg")),1)]),_:1})):s.createCommentVNode("",!0)])]),_:1})):s.createCommentVNode("",!0),n.toolbar.includes("import")?(s.openBlock(),s.createBlock(r,{key:1,size:"default",icon:"el-icon-upload",onClick:t[8]||(t[8]=B=>e.$emit("import"))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.importXml")),1)]),_:1})):s.createCommentVNode("",!0),n.toolbar.includes("preview")?(s.openBlock(),s.createBlock(r,{key:2,size:"default",icon:"el-icon-view",onClick:t[9]||(t[9]=B=>e.$emit("preview","preview"))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.previewXml")),1)]),_:1})):s.createCommentVNode("",!0),n.toolbar.includes("get")?(s.openBlock(),s.createBlock(r,{key:3,size:"default",icon:"el-icon-finished",onClick:t[10]||(t[10]=B=>e.$emit("preview","get"))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.toolbar.getXml")),1)]),_:1})):s.createCommentVNode("",!0),s.renderSlot(e.$slots,"toolbar",{},void 0,!0)])])}const sh=F0(ih,[["render",ch],["__scopeId","data-v-14b3a24e"]]);function no(e){return Array.prototype.concat.apply([],e)}const yA=Object.prototype.toString,lh=Object.prototype.hasOwnProperty;function Je(e){return e===void 0}function a2(e){return e!==void 0}function en(e){return e==null}function n0(e){return yA.call(e)==="[object Array]"}function V0(e){return yA.call(e)==="[object Object]"}function A0(e){return yA.call(e)==="[object Number]"}function n2(e){const t=yA.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function U2(e){return yA.call(e)==="[object String]"}function Ll(e){if(!n0(e))throw new Error("must supply array")}function I2(e,t){return!en(e)&&lh.call(e,t)}function m0(e,t){const n=Ao(t);let A;return U(e,function(i,o){if(n(i,o))return A=i,!1}),A}function qa(e,t){const n=Ao(t);let A=n0(e)?-1:void 0;return U(e,function(i,o){if(n(i,o))return A=o,!1}),A}function l0(e,t){const n=Ao(t);let A=[];return U(e,function(i,o){n(i,o)&&A.push(i)}),A}function U(e,t){let n,A;if(Je(e))return;const i=n0(e)?gh:Bh;for(let o in e)if(I2(e,o)&&(n=e[o],A=t(n,i(o)),A===!1))return n}function Wl(e,t){if(Je(e))return[];Ll(e);const n=Ao(t);return e.filter(function(A,i){return!n(A,i)})}function F2(e,t,n){return U(e,function(A,i){n=t(n,A,i)}),n}function je(e,t){return!!F2(e,function(n,A,i){return n&&t(A,i)},!0)}function ue(e,t){return!!m0(e,t)}function B2(e,t){let n=[];return U(e,function(A,i){n.push(t(A,i))}),n}function IA(e){return e&&Object.keys(e)||[]}function _l(e){return IA(e).length}function FA(e){return B2(e,t=>t)}function Ve(e,t,n={}){return t=ec(t),U(e,function(A){let i=t(A)||"_",o=n[i];o||(o=n[i]=[]),o.push(A)}),n}function $a(e,...t){e=ec(e);let n={};return U(t,i=>Ve(i,e,n)),B2(n,function(i,o){return i[0]})}const Ol=$a;function Qe(e,t){t=ec(t);let n=[];return U(e,function(A,i){let o=t(A,i),r={d:o,v:A};for(var a=0;a<n.length;a++){let{d:c}=n[a];if(o<c){n.splice(a,0,r);return}}n.push(r)}),B2(n,A=>A.v)}function Z2(e){return function(t){return je(e,function(n,A){return t[A]===n})}}function ec(e){return n2(e)?e:t=>t[e]}function Ao(e){return n2(e)?e:t=>t===e}function Bh(e){return e}function gh(e){return Number(e)}function tc(e,t){let n,A,i,o;function r(g){let p=Date.now(),E=g?0:o+t-p;if(E>0)return a(E);e.apply(i,A),c()}function a(g){n=setTimeout(r,g)}function c(){n&&clearTimeout(n),n=o=A=i=void 0}function l(){n&&r(!0),c()}function B(...g){o=Date.now(),A=g,i=this,n||a(t)}return B.flush=l,B.cancel=c,B}function ph(e,t){let n=!1;return function(...A){n||(e(...A),n=!0,setTimeout(()=>{n=!1},t))}}function v2(e,t){return e.bind(t)}function N(e,...t){return Object.assign(e,...t)}function Xl(e,t,n){let A=e;return U(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let r=t[o+1],a=A[i];a2(r)&&en(a)&&(a=A[i]=isNaN(+r)?{}:[]),Je(r)?Je(n)?delete A[i]:A[i]=n:A=a}),e}function Eh(e,t,n){let A=e;return U(t,function(i){if(en(A))return A=void 0,!1;A=A[i]}),Je(A)?n:A}function q2(e,t){let n={},A=Object(e);return U(t,function(i){i in A&&(n[i]=e[i])}),n}function he(e,t){let n={},A=Object(e);return U(A,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Kl(e,...t){return t.length&&U(t,function(n){!n||!V0(n)||U(n,function(A,i){if(i==="__proto__")return;let o=e[i];V0(A)?(V0(o)||(o={}),e[i]=Kl(o,A)):e[i]=A})}),e}const dh=Object.freeze(Object.defineProperty({__proto__:null,assign:N,bind:v2,debounce:tc,ensureArray:Ll,every:je,filter:l0,find:m0,findIndex:qa,flatten:no,forEach:U,get:Eh,groupBy:Ve,has:I2,isArray:n0,isDefined:a2,isFunction:n2,isNil:en,isNumber:A0,isObject:V0,isString:U2,isUndefined:Je,keys:IA,map:B2,matchPattern:Z2,merge:Kl,omit:he,pick:q2,reduce:F2,set:Xl,size:_l,some:ue,sortBy:Qe,throttle:ph,unionBy:Ol,uniqueBy:$a,values:FA,without:Wl},Symbol.toStringTag,{value:"Module"}));function f(e,t){var n=P(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function a0(e,t){return ue(t,function(n){return f(e,n)})}function P(e){return e&&e.businessObject||e}function Q0(e){return e&&e.di}const z0={props:{modeler:{type:Object,required:!0},element:{type:Object,default:()=>({})},nodes:{type:Array,default:()=>[]},formOption:{type:[Object,String],default:null},exFormOption:{type:[Object,String],default:null},indepFormOption:{type:[Object,String],default:null},userOption:{type:Object,default:null},groupOption:{type:Object,default:null},buttonOption:{type:Array,default:()=>[]},scriptOption:{type:Object,default:()=>{}},conditionOption:{type:Array,default:()=>[]},listenerOption:{type:Array,default:()=>[]},extendedPropertyOption:{type:Array,default:()=>[]}},computed:{backNodes(){const{id:e}=this.formData;return this.nodes.findIndex(n=>n.id==e)>0&&!this.nodes.find(n=>n.nodeType=="bpmn:Collaboration")?this.nodes.filter(n=>["bpmn:StartEvent","bpmn:UserTask"].includes(n.nodeType)):this.nodes},labelPosition(){return["zh"].includes(this.$nfDesign.lang)?"left":"top"}},data(){return{formData:{}}},watch:{element:{handler(e){if(Object.keys(e)==0)return;const t={...e.businessObject,...e.businessObject.$attrs},n=t.documentation;n&&n.length>0&&(t.description=n[0].text),console.error("elementform",e,t),this.formData=t},deep:!0,immediate:!0}},methods:{updateProperties(e){this.modeler.get("modeling").updateProperties(this.element,((this.element.businessObject||{}).$attrs||{}).customType=="抄送任务"?{...e,customType:"QQ抄送任务","flowable:customType":"flowable QQ抄送任务","flowable:delegateExpression":"${myCopyService}"}:{...e})},updateDocumentation(e){if(e){const t=this.modeler.get("bpmnFactory").create("bpmn:Documentation",{text:e});this.updateProperties({documentation:[t]})}else this.updateProperties({documentation:[]})},updateFormalExpression(e,t){e&&t?t=this.modeler.get("bpmnFactory").create("bpmn:FormalExpression",{body:t}):t=void 0,this.updateProperties({[e]:t})},createElement(e,t){return e&&t?this.modeler.get("bpmnFactory").create(e,t):null},getRootElements(e){const t=this.modeler.get("canvas").getRootElement().businessObject.$parent.rootElements;return e?t.filter(n=>n.$type==e):t},getExtensionElementsEq(e){const t=[],{extensionElements:n}=this.element.businessObject;return n&&n.values&&n.values.length>0&&n.values.forEach(A=>{A.$type===e&&t.push(A)}),t},getExtensionElementsNotEq(e){const t=[],{extensionElements:n}=this.element.businessObject;return n&&n.values&&n.values.length>0&&n.values.forEach(A=>{A.$type!==e&&t.push(A)}),t},setExtensionElements(e,t){if(e&&t){const n=this.modeler.get("bpmnFactory");let A=[];t.forEach(i=>A.push(n.create(e,i))),A=this.getExtensionElementsNotEq(e).concat(A),this.updateProperties({extensionElements:n.create("bpmn:ExtensionElements",{values:A})})}},deleteExtensionElements(e){const t=this.getExtensionElementsNotEq(e),n=this.modeler.get("bpmnFactory");t&&t.length>0&&this.updateProperties({extensionElements:n.create("bpmn:ExtensionElements",{values:t})})},clearExtensionElements(e){let t=[];e&&e.forEach(A=>{const i=this.getExtensionElementsEq(A);i&&i.length>0&&(t=t.concat(i))});const n=this.modeler.get("bpmnFactory");this.updateProperties({extensionElements:t.length>0?n.create("bpmn:ExtensionElements",{values:t}):void 0})},getEventDefinitions(e){const{eventDefinitions:t}=this.element.businessObject;if(!e)return!t||t.length==0?null:t;const n=[];if(t&&t.length>0)t.forEach(A=>{A.$type==e&&n.push(A)});else return null;return n},setEventDefinitions(e,t){if(e&&t){const n=this.modeler.get("bpmnFactory");let A=this.getEventDefinitions(e)||[];A&&A.length>0?A={...A[0],...t}:A={...t};for(let i in A)i.startsWith("$")&&delete A[i];this.updateProperties({eventDefinitions:[n.create(e,A)]})}}}},uh={name:"nf-basic",mixins:[z0,v0],watch:{formData:{handler(e){const{name:t}=e;this.element.type=="bpmn:StartEvent"&&t&&t.includes("请先点击")&&(this.updateProperties({name:"开始"}),this.formData.name="开始")},deep:!0,immediate:!0}}};function Qh(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-icon-question-filled"),B=s.resolveComponent("el-icon"),g=s.resolveComponent("el-link"),p=s.resolveComponent("el-divider"),E=s.resolveComponent("el-option"),d=s.resolveComponent("el-select"),u=s.resolveComponent("el-tooltip"),h=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(h,{model:e.formData,"label-position":e.labelPosition,"label-width":"100px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{label:e.t("nf.panel.node.basic.id"),prop:"id",rules:{required:!0,trigger:"change"}},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.id,"onUpdate:modelValue":t[0]||(t[0]=D=>e.formData.id=D),clearable:"",placeholder:e.t("nf.panel.node.basic.id"),onInput:t[1]||(t[1]=D=>e.updateProperties({id:e.formData.id}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),["bpmn:TextAnnotation","bpmn:Association"].includes(e.element.type)?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.basic.name")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.name,"onUpdate:modelValue":t[2]||(t[2]=D=>e.formData.name=D),clearable:"",placeholder:e.t("nf.panel.node.basic.name"),onInput:t[3]||(t[3]=D=>e.updateProperties({name:e.formData.name||void 0}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"])),["bpmn:TextAnnotation"].includes(e.element.type)?(s.openBlock(),s.createBlock(a,{key:1,label:e.t("nf.panel.node.basic.text")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.text,"onUpdate:modelValue":t[4]||(t[4]=D=>e.formData.text=D),clearable:"",placeholder:e.t("nf.panel.node.basic.text"),onInput:t[5]||(t[5]=D=>e.updateProperties({text:e.formData.text||void 0}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.basic.description")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.description,"onUpdate:modelValue":t[6]||(t[6]=D=>e.formData.description=D),clearable:"",placeholder:e.t("nf.panel.node.basic.description"),onInput:e.updateDocumentation},null,8,["modelValue","placeholder","onInput"])]),_:1},8,["label"]),["bpmn:ServiceTask"].includes(e.element.type)?(s.openBlock(),s.createBlock(a,{key:2,label:e.t("nf.panel.node.basic.async.label")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:e.formData.async,"onUpdate:modelValue":t[7]||(t[7]=D=>e.formData.async=D),"active-text":e.t("nf.panel.node.basic.async.yes"),"inactive-text":e.t("nf.panel.node.basic.async.no"),"active-value":!0,"inactive-value":!1,onChange:t[8]||(t[8]=D=>e.updateProperties({async:e.formData.async||void 0}))},null,8,["modelValue","active-text","inactive-text"])]),_:1},8,["label"])):s.createCommentVNode("",!0),e.element.type=="bpmn:UserTask"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:3},[s.createVNode(a,{label:e.t("nf.panel.node.basic.priority")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.priority,"onUpdate:modelValue":t[9]||(t[9]=D=>e.formData.priority=D),placeholder:e.t("nf.panel.node.basic.priority"),clearable:"",onChange:t[10]||(t[10]=D=>e.updateProperties({priority:e.formData.priority||void 0}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.basic.dueDate")},{label:s.withCtx(()=>[s.createVNode(g,{href:"https://tkjohn.github.io/flowable-userguide/#bpmnUserTask",underline:!1,target:"_blank"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.basic.dueDate"))+" ",1),s.createVNode(B,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),t[19]||(t[19]=s.createTextVNode(" : "))]),_:1,__:[19]})]),default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.dueDate,"onUpdate:modelValue":t[11]||(t[11]=D=>e.formData.dueDate=D),placeholder:e.t("nf.panel.node.basic.dueDate"),clearable:"",onChange:t[12]||(t[12]=D=>e.updateProperties({dueDate:e.formData.dueDate||void 0}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.basic.skipExpression")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.skipExpression,"onUpdate:modelValue":t[13]||(t[13]=D=>e.formData.skipExpression=D),placeholder:e.t("nf.panel.node.basic.skipExpression"),clearable:"",onChange:t[14]||(t[14]=D=>e.updateProperties({skipExpression:e.formData.skipExpression||void 0}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(p),s.createVNode(a,{label:e.t("nf.panel.node.basic.rollbackNode.label"),"label-width":"90px"},{default:s.withCtx(()=>[s.createVNode(d,{modelValue:e.formData.rollbackNode,"onUpdate:modelValue":t[15]||(t[15]=D=>e.formData.rollbackNode=D),clearable:"",placeholder:e.t("nf.panel.node.basic.rollbackNode.placeholder"),onChange:t[16]||(t[16]=D=>e.updateProperties({rollbackNode:e.formData.rollbackNode||void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.nodes,D=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[["bpmn:UserTask","bpmn:StartEvent"].includes(D.nodeType)&&D.id!=e.formData.id?(s.openBlock(),s.createBlock(E,{key:D.id,label:D.name,value:D.id},null,8,["label","value"])):s.createCommentVNode("",!0)],64))),256))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{"label-width":"190px"},{label:s.withCtx(()=>[s.createVNode(u,{effect:"dark",placement:"top"},{content:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.basic.rollbackNode.backToRejecterText")),1)]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.basic.rollbackNode.backToRejecter"))+" ",1),s.createVNode(B,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),t[20]||(t[20]=s.createTextVNode(" : "))])]),_:1})]),default:s.withCtx(()=>[s.createVNode(c,{modelValue:e.formData.backToRejecter,"onUpdate:modelValue":t[17]||(t[17]=D=>e.formData.backToRejecter=D),"active-value":"true","inactive-value":"false",onChange:t[18]||(t[18]=D=>e.updateProperties({backToRejecter:e.formData.backToRejecter||void 0}))},null,8,["modelValue"])]),_:1})],64)):s.createCommentVNode("",!0)]),_:1},8,["model","label-position"])}const hh=F0(uh,[["render",Qh]]),wh={name:"user-select",mixins:[v0],props:{userUrl:String,customOption:Object,defaultChecked:String,defaultCheckedText:String},watch:{text:{handler(e){this.isInit&&e&&this.$emit("confirm",e[this.props.value],e[this.props.label])},deep:!0}},data(){const e=this;return{visible:!1,isInit:!1,text:"",option:{size:"default",border:!0,search:!0,searchSize:"default",searchMenuSpan:6,searchIcon:!0,searchIconIndex:3,column:[{label:e.t("nf.panel.node.assignee.v2.user.name"),prop:"realName",overHidden:!0,search:!0},{label:e.t("nf.panel.node.assignee.v2.user.dept"),prop:"deptName",overHidden:!0,search:!0},{label:e.t("nf.panel.node.assignee.v2.user.phone"),prop:"phone",overHidden:!0,search:!0}],props:{url:e.userUrl,method:"get",needPage:!0,currentPageKey:"current",pageSizeKey:"size",totalKey:"total",recordsKey:"records",resKey:"data"}},props:{label:"realName",value:"id"}}},methods:{init(){if(!this.isInit){if(this.customOption){const{column:e,userProps:t}=this.customOption;e&&(this.option.column=e),t&&(this.props=t)}if(this.defaultChecked&&this.defaultCheckedText){const e=this.defaultChecked,t=this.defaultCheckedText.includes(" | ")?this.defaultCheckedText:this.defaultCheckedText.split(",").join(" | ");this.text={[this.props.value]:e,[this.props.label]:t}}this.isInit=!0,this.$nextTick(()=>{this.$refs["nf-table-select"].handleTableSelect()})}}}};function mh(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("nf-table-select");return s.openBlock(),s.createElementBlock("div",null,[i.isInit?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(r,{key:0,"model-value":n.defaultCheckedText,placeholder:"人员选择","suffix-icon":"el-icon-search",readonly:""},null,8,["model-value"])),i.isInit?(s.openBlock(),s.createBlock(a,{key:1,ref:"nf-table-select",modelValue:i.text,"onUpdate:modelValue":t[0]||(t[0]=c=>i.text=c),children:i.option,props:i.props,placeholder:"人员选择",multiple:""},null,8,["modelValue","children","props"])):s.createCommentVNode("",!0)])}const Zl=F0(wh,[["render",mh]]),fh={mixins:[v0],props:{userOption:Object,assigneeRetain:String},components:{UserSelect:Zl},emits:["submit","update:assigneeRetain"],computed:{userUrl(){return this.userOption.userUrl},roleUrl(){return this.userOption.roleUrl},deptUrl(){return this.userOption.deptUrl},postUrl(){return this.userOption.postUrl},customUrl(){return this.userOption.customUrl},customOption(){return this.userOption.customOption},roleProps(){return this.customOption?this.customOption.roleProps:{label:"roleName",value:"id",children:"children",records:"data.data"}},deptProps(){return this.customOption?this.customOption.deptProps:{label:"deptName",value:"id",children:"children",records:"data.data"}},postProps(){return this.customOption?this.customOption.postProps:{label:"postName",value:"id",children:"children",records:"data.data.records"}}},watch:{visible(e){var t;if(this.init||(this.getRoleList(),this.getDeptList(),this.getPostList(),this.getCustomList(),this.init=!0),e&&this.userOption&&this.userOption.data){const n=JSON.parse(JSON.stringify(this.userOption.data));for(let A of n)["role","post","dept"].includes(A.type)&&typeof A.value=="string"&&(A.value=((t=A.value)==null?void 0:t.split(","))||[]);this.data=n}}},data(){return{init:!1,visible:!1,data:[],roleList:[],deptList:[],postList:[],customList:[],selectIndex:0}},methods:{handleSelect(e,t){this.selectIndex=e,this.$refs[t].init()},handleSelectConfirm(e,t){this.data[this.selectIndex].value=e,this.data[this.selectIndex].text=t},handleTypeChange(e){const t=this.data[e].type;this.data[e]={type:t,value:["role","post","dept"].includes(t)?[]:""}},handleChange(e,t){setTimeout(()=>{let n=this.$refs[t].getCheckedNodes();n=n.map(A=>A.label).join(","),n&&(this.data[e].text=n)})},handleCustomChange(e,t){const n=this.customList.find(A=>A.expression==e);n?this.data[t].text=n.name:this.data[t].text=e},getRoleList(){this.$axios.get(this.roleUrl).then(e=>{const{records:t}=this.roleProps,n=this.getAsVal(e,t);this.handleList(n,this.roleProps),this.roleList=n})},getDeptList(){this.$axios.get(this.deptUrl).then(e=>{const{records:t}=this.deptProps,n=this.getAsVal(e,t);this.handleList(n,this.deptProps),this.deptList=n})},getPostList(){this.$axios.get(this.postUrl,{params:{size:-1}}).then(e=>{const{records:t}=this.postProps,n=this.getAsVal(e,t);this.handleList(n,this.postProps),this.postList=n})},getCustomList(){const e={size:-1,type:"user",status:1};this.$axios.get(this.customUrl,{params:e}).then(t=>{this.customList=t.data.data.records})},handleSubmit(){this.$emit("submit",this.data.filter(e=>e.type&&e.value)),this.visible=!1},handleClose(e){this.visible=!1,e&&typeof e=="function"&&e()},getAsVal(e,t=""){let n=this.deepClone(e);return this.validateNull(t)||t.split(".").forEach(A=>{this.validateNull(n[A])?n="":n=n[A]}),n},handleList(e,t){for(let n of e)n.label=n[t.label],n.value=n[t.value],n[t.children]&&(n.children=n[t.children],this.handleList(n.children,t))},handleRetainChange(e){this.$emit("update:assigneeRetain",e)}}};function Ch(e,t,n,A,i,o){const r=s.resolveComponent("el-switch"),a=s.resolveComponent("el-icon-question-filled"),c=s.resolveComponent("el-icon"),l=s.resolveComponent("el-tooltip"),B=s.resolveComponent("el-button"),g=s.resolveComponent("el-table-column"),p=s.resolveComponent("el-option"),E=s.resolveComponent("el-select"),d=s.resolveComponent("user-select"),u=s.resolveComponent("el-tree-select"),h=s.resolveComponent("el-table"),D=s.resolveComponent("el-dialog");return s.openBlock(),s.createBlock(D,{ref:"nf-dialog",class:"nf-dialog",modelValue:i.visible,"onUpdate:modelValue":t[1]||(t[1]=y=>i.visible=y),title:e.t("nf.panel.node.assignee.v2.configure"),width:"60%","before-close":o.handleClose,"append-to-body":""},{footer:s.withCtx(()=>[s.createVNode(B,{onClick:o.handleClose,size:"default"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.assignee.v2.cancel")),1)]),_:1},8,["onClick"]),s.createVNode(B,{type:"primary",onClick:o.handleSubmit,size:"default"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.assignee.v2.submit")),1)]),_:1},8,["onClick"])]),default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(r,{"active-text":"交集","inactive-text":"并集","active-value":"true","inactive-value":"false","model-value":n.assigneeRetain,onChange:o.handleRetainChange},null,8,["model-value","onChange"]),s.createVNode(l,{effect:"dark",placement:"top","raw-content":"",content:"<span>并集:所有配置查询出来的全部用户。</span><br /><span>交集:每个配置查询出来的用户取交集。</span>"},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(a)]),_:1})]),_:1})]),i.visible?(s.openBlock(),s.createBlock(h,{key:0,data:i.data,border:"",size:"default"},{default:s.withCtx(()=>[s.createVNode(g,{align:"center","header-align":"center",width:"80"},{header:s.withCtx(()=>[s.createVNode(B,{circle:"",type:"primary",size:"default",icon:"el-icon-plus",onClick:t[0]||(t[0]=y=>i.data.push({value:""}))})]),default:s.withCtx(({$index:y})=>[s.createVNode(B,{circle:"",type:"danger",size:"default",icon:"el-icon-delete",onClick:C=>i.data.splice(y,1)},null,8,["onClick"])]),_:1}),s.createVNode(g,{label:e.t("nf.panel.node.assignee.v2.type"),prop:"type",align:"center","header-align":"center"},{default:s.withCtx(({row:y,$index:C})=>[s.createVNode(E,{modelValue:y.type,"onUpdate:modelValue":m=>y.type=m,size:"default",filterable:"",placeholder:e.t("nf.panel.node.assignee.v2.type"),onChange:m=>o.handleTypeChange(C)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.t("nf.panel.node.assignee.v2.typeList"),m=>(s.openBlock(),s.createBlock(p,{key:m.value,label:m.label,value:m.value,disabled:!!i.data.find(I=>I.type==m.value)},null,8,["label","value","disabled"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","onChange"])]),_:1},8,["label"]),s.createVNode(g,{label:e.t("nf.panel.node.assignee.v2.value"),prop:"text",align:"center","header-align":"center"},{default:s.withCtx(({row:y,$index:C})=>[y.type=="user"?(s.openBlock(),s.createBlock(d,{key:0,ref:"user-select","user-url":o.userUrl,"custom-option":o.customOption,"default-checked":y.value,"default-checked-text":y.text,onConfirm:o.handleSelectConfirm,onClick:m=>o.handleSelect(C,"user-select")},null,8,["user-url","custom-option","default-checked","default-checked-text","onConfirm","onClick"])):y.type=="role"?(s.openBlock(),s.createBlock(u,{key:1,ref:`role_${C}`,modelValue:y.value,"onUpdate:modelValue":m=>y.value=m,size:"default",multiple:"",filterable:"",clearable:"","check-strictly":"","show-checkbox":"","collapse-tags":"","max-collapse-tags":2,placeholder:e.t("nf.panel.node.assignee.v2.typeDic.role"),data:i.roleList,onChange:m=>o.handleChange(C,`role_${C}`),onCheck:m=>o.handleChange(C,`role_${C}`)},null,8,["modelValue","onUpdate:modelValue","placeholder","data","onChange","onCheck"])):y.type=="dept"?(s.openBlock(),s.createBlock(u,{key:2,ref:`dept_${C}`,modelValue:y.value,"onUpdate:modelValue":m=>y.value=m,size:"default",multiple:"",clearable:"",filterable:"","check-strictly":"","show-checkbox":"","collapse-tags":"","max-collapse-tags":2,placeholder:e.t("nf.panel.node.assignee.v2.typeDic.dept"),data:i.deptList,onChange:m=>o.handleChange(C,`dept_${C}`),onCheck:m=>o.handleChange(C,`dept_${C}`)},null,8,["modelValue","onUpdate:modelValue","placeholder","data","onChange","onCheck"])):y.type=="post"?(s.openBlock(),s.createBlock(u,{key:3,ref:`post_${C}`,modelValue:y.value,"onUpdate:modelValue":m=>y.value=m,size:"default",multiple:"",clearable:"",filterable:"","check-strictly":"","show-checkbox":"","collapse-tags":"","max-collapse-tags":2,placeholder:e.t("nf.panel.node.assignee.v2.typeDic.post"),data:i.postList,onChange:m=>o.handleChange(C,`post_${C}`),onCheck:m=>o.handleChange(C,`post_${C}`)},null,8,["modelValue","onUpdate:modelValue","placeholder","data","onChange","onCheck"])):y.type=="custom"?(s.openBlock(),s.createBlock(E,{key:4,modelValue:y.value,"onUpdate:modelValue":m=>y.value=m,size:"default",filterable:"",clearable:"",placeholder:e.t("nf.panel.node.assignee.v2.customRemark"),"allow-create":"",onChange:m=>o.handleCustomChange(m,C)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.customList,m=>(s.openBlock(),s.createBlock(p,{key:m.expression,value:m.expression,label:m.name},null,8,["value","label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","onChange"])):s.createCommentVNode("",!0)]),_:1},8,["label"])]),_:1},8,["data"])):s.createCommentVNode("",!0)]),_:1},8,["modelValue","title","before-close"])}const Mh={name:"nf-select-v2",mixins:[z0,v0],components:{UserOption:F0(fh,[["render",Ch]])},data(){return{extensionType:"flowable:Assignee",data:[],typeDic:this.t("nf.panel.node.assignee.v2.typeDic"),option:{},assigneeRetain:"false"}},watch:{formData:{handler(e){if(this.element.type=="bpmn:UserTask"){const{assigneeRetain:A}=e;A?this.assigneeRetain=A:this.assigneeRetain="false"}else{const A=this.getExtensionElementsEq("flowable:AssigneeRetain");A&&A.length>0?this.assigneeRetain=A[0].value:this.assigneeRetain="false"}const n=this.getExtensionElementsEq(this.extensionType).map(A=>{const{type:i,value:o,text:r}=A;return{type:i,value:o,text:r}});this.data=n,this.option={...this.userOption,data:n}},deep:!0,immediate:!0}},methods:{handleSubmit(e){this.data=e,this.option.data=e,this.setExtensionElements(this.extensionType,e),this.element.type=="bpmn:UserTask"?this.updateProperties({assigneeRetain:this.assigneeRetain}):this.setExtensionElements("flowable:AssigneeRetain",[{value:this.assigneeRetain}]);const{assignee:t}=this.element.businessObject;t!="${assignee}"&&this.updateProperties({assignee:void 0}),this.updateProperties({candidateUsers:void 0}),this.updateProperties({candidateGroups:void 0})}}};function Dh(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("el-table-column"),c=s.resolveComponent("el-table"),l=s.resolveComponent("user-option");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(r,{type:"primary",onClick:t[0]||(t[0]=B=>e.$refs["user-option"].visible=!0),size:"small"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.assignee.v2.configure")),1)]),_:1}),s.createVNode(c,{data:i.data,border:"",size:"small",style:{"margin-top":"5px"}},{default:s.withCtx(()=>[s.createVNode(a,{prop:"type",label:e.t("nf.panel.node.assignee.v2.type"),align:"center",width:"100"},{default:s.withCtx(({row:B})=>[s.createTextVNode(s.toDisplayString(i.typeDic[B.type]),1)]),_:1},8,["label"]),s.createVNode(a,{prop:"text",label:e.t("nf.panel.node.assignee.v2.value"),align:"center","show-overflow-tooltip":""},null,8,["label"])]),_:1},8,["data"]),s.createVNode(l,{ref:"user-option","user-option":i.option,assigneeRetain:i.assigneeRetain,"onUpdate:assigneeRetain":t[1]||(t[1]=B=>i.assigneeRetain=B),onSubmit:o.handleSubmit},null,8,["user-option","assigneeRetain","onSubmit"])])}const yh=F0(Mh,[["render",Dh]]),Ih={name:"nf-field",mixins:[v0],props:{row:{type:Object,default:()=>({})}},computed:{data(){return this.row.fields||[]}},data(){return{form:{},rules:{name:[{required:!0}],type:[{required:!0}],value:[{required:!0}]},visible:!1,isAdd:!0,rowIndex:0}},methods:{handleSubmit(){this.$refs.form.validate(e=>{if(e){const t=JSON.parse(JSON.stringify(this.form));this.isAdd?this.$emit("row-save",t):this.$emit("row-update",t,this.rowIndex),this.handleClose()}})},handleOpen(e=!0,t,n){this.visible=!0,this.isAdd=e,this.rowIndex=n,e||(this.form=JSON.parse(JSON.stringify(t)))},handleClose(e){e&&e(),this.visible=!1,this.form={}},handleDelete(e){this.$confirm(this.t("nf.panel.node.listener.message"),this.t("nf.panel.node.listener.warning"),{type:"warning"}).then(()=>{this.$emit("row-del",{},e)}).catch(()=>{})}}},Fh={key:0};function vh(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("el-table-column"),c=s.resolveComponent("el-table"),l=s.resolveComponent("el-input"),B=s.resolveComponent("el-form-item"),g=s.resolveComponent("el-radio"),p=s.resolveComponent("el-radio-group"),E=s.resolveComponent("el-form"),d=s.resolveComponent("el-drawer");return Object.keys(n.row).length>0?(s.openBlock(),s.createElementBlock("div",Fh,[t[6]||(t[6]=s.createElementVNode("p",null,"字段注入",-1)),s.createVNode(r,{type:"primary",size:"small",onClick:o.handleOpen},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.add")),1)]),_:1},8,["onClick"]),s.createVNode(c,{data:o.data,border:"",size:"small",style:{"margin-top":"5px"}},{default:s.withCtx(()=>[s.createVNode(a,{prop:"name",label:e.t("nf.panel.node.listener.name"),align:"center"},null,8,["label"]),s.createVNode(a,{prop:"type",label:e.t("nf.panel.node.listener.type"),align:"center"},null,8,["label"]),s.createVNode(a,{prop:"value",label:e.t("nf.panel.node.listener.value"),align:"center"},null,8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.listener.operations"),align:"center",width:"100"},{default:s.withCtx(u=>[s.createVNode(r,{size:"default",type:"primary",text:"",onClick:s.withModifiers(h=>o.handleOpen(!1,u.row,u.$index),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.edit")),1)]),_:2},1032,["onClick"]),s.createVNode(r,{size:"default",type:"danger",text:"",onClick:s.withModifiers(h=>o.handleDelete(u.$index),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"]),s.createVNode(d,{modelValue:i.visible,"onUpdate:modelValue":t[3]||(t[3]=u=>i.visible=u),title:i.isAdd?e.t("nf.panel.node.listener.add"):e.t("nf.panel.node.listener.edit"),"append-to-body":"","before-close":o.handleClose,size:"50%"},{default:s.withCtx(()=>[s.createVNode(E,{ref:"form",style:{padding:"0 20px"},model:i.form,rules:i.rules,size:"default","label-suffix":":","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(B,{label:e.t("nf.panel.node.listener.name"),prop:"name"},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.form.name,"onUpdate:modelValue":t[0]||(t[0]=u=>i.form.name=u),placeholder:e.t("nf.panel.node.listener.name")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(B,{label:e.t("nf.panel.node.listener.type"),prop:"type"},{default:s.withCtx(()=>[s.createVNode(p,{modelValue:i.form.type,"onUpdate:modelValue":t[1]||(t[1]=u=>i.form.type=u)},{default:s.withCtx(()=>[s.createVNode(g,{label:"string",value:"string"},{default:s.withCtx(()=>t[4]||(t[4]=[s.createTextVNode("String")])),_:1,__:[4]}),s.createVNode(g,{label:"expression",value:"expression"},{default:s.withCtx(()=>t[5]||(t[5]=[s.createTextVNode(" Expression ")])),_:1,__:[5]})]),_:1},8,["modelValue"])]),_:1},8,["label"]),s.createVNode(B,{label:e.t("nf.panel.node.listener.value"),prop:"value"},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.form.value,"onUpdate:modelValue":t[2]||(t[2]=u=>i.form.value=u),placeholder:e.t("nf.panel.node.listener.value")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(B,null,{default:s.withCtx(()=>[s.createVNode(r,{type:"primary",size:"default",onClick:o.handleSubmit},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.submit")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title","before-close"])])):s.createCommentVNode("",!0)}const xh={name:"nf-listener",components:{NfField:F0(Ih,[["render",vh]])},mixins:[z0,v0],props:{type:{type:String,required:!0,validator:e=>["Execution","Task"].includes(e)},listenerOption:{type:Array}},computed:{listenerOptionList(){return this.listenerOption&&this.listenerOption.length>0?this.listenerOption.filter(e=>e.category==this.type):[]}},data(){return{listener:[],listenerVisible:!1,eventTypeExecution:["start","take","end"],eventTypeTask:["create","assignment","complete","delete"],isAdd:!0,form:{listenerType:"class"},rules:{event:{required:!0,trigger:"change"},listenerType:{required:!0,trigger:"change"},value:{required:!0,trigger:"blur"}},currentListener:{}}},watch:{formData:{handler(e){const{extensionElements:t}=e,n=[];t&&t.values&&t.values.length>0&&t.values.forEach(A=>{if(A.$type.includes(this.type)||A.$type.includes(this.type.toLowerCase())){const i={id:zn(16),event:A.event};if(A.class?(i.value=A.class,i.listenerType="class"):A.expression?(i.value=A.expression,i.listenerType="expression"):A.delegateExpression&&(i.value=A.delegateExpression,i.listenerType="delegateExpression"),A.fields){const o=[];A.fields.forEach(r=>{r.string?o.push({name:r.name,type:"string",value:r.string}):r.expression&&o.push({name:r.name,type:"expression",value:r.expression})}),i.fields=o}n.push(i)}}),this.listener=n,setTimeout(()=>{const A=n[0];n.length>0&&this.$refs.table&&this.$refs.table.setCurrentRow(A),this.rowClick(A)})},deep:!0,immediate:!0}},mounted(){this.form.event=this[`eventType${this.type}`][0]},methods:{handleSubmit(){this.$refs.form.validate(e=>{if(e){const t=this.form;this.isAdd?(t.id=zn(16),this.listener.push(t)):this.listener.splice(this.listener.findIndex(n=>n.id==t.id),1,t),this.changeExtensionElements(),this.handleClose()}})},handleDelete(e){this.$confirm(this.t("nf.panel.node.listener.message"),this.t("nf.panel.node.listener.warning"),{type:"warning"}).then(()=>{this.listener.splice(e,1),this.changeExtensionElements()}).catch(()=>{})},changeExtensionElements(){const e=this.modeler.get("bpmnFactory"),t=[];this.listener.forEach(i=>{const{listenerType:o,value:r,event:a,fields:c}=i,l={[o]:r,event:a};if(c&&c.length>0){const g=[];c.forEach(p=>{g.push(this.createElement("flowable:Field",{[p.type]:p.value,name:p.name}))}),l.fields=g}const B=e.create(`flowable:${this.type}Listener`,l);t.push(B)});const n=[],{extensionElements:A}=this.element.businessObject;A&&A.values&&A.values.length>0&&A.values.forEach(i=>{i.$type.includes(this.type)||i.$type.includes(this.type.toLowerCase())||n.push(i)}),this.updateProperties({extensionElements:e.create("bpmn:ExtensionElements",{values:t.concat(n)})})},handleOpen(e=!0,t){this.listenerVisible=!0,this.isAdd=e,e||(this.form=JSON.parse(JSON.stringify(t)))},handleClose(){this.listenerVisible=!1,this.form={id:"",event:this[`eventType${this.type}`][0],listenerType:"class",value:""}},rowClick(e){this.currentListener=e},fieldSave(e){let{id:t,fields:n}=this.currentListener;n||(n=[]),n.push(e),this.currentListener.fields=n,this.listener.splice(this.listener.findIndex(A=>A.id==t),1,this.currentListener),this.changeExtensionElements()},fieldUpdate(e,t){this.currentListener.fields[t]=e,this.changeExtensionElements()},fieldDel(e,t){this.currentListener.fields.splice(t,1),this.changeExtensionElements()},handleQuickOptionChange(e){const t=this.listenerOptionList.find(n=>n.id==e);if(t){const{event:n,type:A,val:i}=t;this.form={event:n,listenerType:A,value:i}}}}};function bh(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("el-table-column"),c=s.resolveComponent("el-table"),l=s.resolveComponent("el-icon-question-filled"),B=s.resolveComponent("el-icon"),g=s.resolveComponent("el-tooltip"),p=s.resolveComponent("el-option"),E=s.resolveComponent("el-select"),d=s.resolveComponent("el-form-item"),u=s.resolveComponent("el-input"),h=s.resolveComponent("el-form"),D=s.resolveComponent("el-drawer"),y=s.resolveComponent("nf-field");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(r,{type:"primary",size:"small",onClick:o.handleOpen},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.add")),1)]),_:1},8,["onClick"]),s.createVNode(c,{ref:"table",data:i.listener,border:"",size:"small",style:{"margin-top":"5px"},"highlight-current-row":"",onRowClick:o.rowClick},{default:s.withCtx(()=>[s.createVNode(a,{prop:"event",label:e.t("nf.panel.node.listener.event"),align:"center"},null,8,["label"]),s.createVNode(a,{prop:"listenerType",label:e.t("nf.panel.node.listener.type"),align:"center"},{default:s.withCtx(C=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.listener.listenerType")[C.row.listenerType]),1)]),_:1},8,["label"]),s.createVNode(a,{prop:"value",label:e.t("nf.panel.node.listener.value"),align:"center"},null,8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.listener.operations"),align:"center",width:"100"},{default:s.withCtx(C=>[s.createVNode(r,{size:"default",type:"primary",text:"",onClick:s.withModifiers(m=>o.handleOpen(!1,C.row),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.edit")),1)]),_:2},1032,["onClick"]),s.createVNode(r,{size:"default",type:"danger",text:"",onClick:s.withModifiers(m=>o.handleDelete(C.$index),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data","onRowClick"]),s.createVNode(D,{modelValue:i.listenerVisible,"onUpdate:modelValue":t[3]||(t[3]=C=>i.listenerVisible=C),title:i.isAdd?e.t("nf.panel.node.listener.add"):e.t("nf.panel.node.listener.edit"),"append-to-body":"","before-close":o.handleClose,size:"50%"},{default:s.withCtx(()=>[s.createVNode(h,{ref:"form",style:{padding:"0 20px"},model:i.form,rules:i.rules,size:"default","label-suffix":":","label-position":e.labelPosition,"label-width":"120px"},{default:s.withCtx(()=>[o.listenerOptionList&&o.listenerOptionList.length>0?(s.openBlock(),s.createBlock(d,{key:0},{label:s.withCtx(()=>[s.createVNode(g,{effect:"dark",content:e.t("nf.panel.node.listener.quickTip"),placement:"top"},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(B,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.listener.quick"))+": ",1)])]),_:1},8,["content"])]),default:s.withCtx(()=>[s.createVNode(E,{style:{width:"100%"},placeholder:e.t("nf.panel.node.listener.quick"),filterable:"",onChange:o.handleQuickOptionChange},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.listenerOptionList,(C,m)=>(s.openBlock(),s.createBlock(p,{key:m,label:C.name,value:C.id},null,8,["label","value"]))),128))]),_:1},8,["placeholder","onChange"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(d,{label:e.t("nf.panel.node.listener.event"),prop:"event"},{default:s.withCtx(()=>[s.createVNode(E,{style:{width:"100%"},modelValue:i.form.event,"onUpdate:modelValue":t[0]||(t[0]=C=>i.form.event=C),placeholder:e.t("nf.panel.node.listener.event")},{default:s.withCtx(()=>[n.type=="Task"?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(i.eventTypeTask,C=>(s.openBlock(),s.createBlock(p,{key:C,label:C,value:C},null,8,["label","value"]))),128)):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(i.eventTypeExecution,C=>(s.openBlock(),s.createBlock(p,{key:C,label:C,value:C},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,{label:e.t("nf.panel.node.listener.type"),prop:"listenerType"},{default:s.withCtx(()=>[s.createVNode(E,{style:{width:"100%"},modelValue:i.form.listenerType,"onUpdate:modelValue":t[1]||(t[1]=C=>i.form.listenerType=C),placeholder:e.t("nf.panel.node.listener.type")},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.t("nf.panel.node.listener.listenerType"),(C,m)=>(s.openBlock(),s.createBlock(p,{key:m,label:C,value:m},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,{label:e.t("nf.panel.node.listener.value"),prop:"value"},{default:s.withCtx(()=>[s.createVNode(u,{modelValue:i.form.value,"onUpdate:modelValue":t[2]||(t[2]=C=>i.form.value=C),placeholder:e.t("nf.panel.node.listener.value")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,null,{default:s.withCtx(()=>[s.createVNode(r,{type:"primary",size:"default",onClick:o.handleSubmit},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.listener.submit")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model","rules","label-position"])]),_:1},8,["modelValue","title","before-close"]),s.createVNode(y,{style:{"margin-top":"20px"},row:i.currentListener,onRowSave:o.fieldSave,onRowUpdate:o.fieldUpdate,onRowDel:o.fieldDel},null,8,["row","onRowSave","onRowUpdate","onRowDel"])])}const Yh=F0(xh,[["render",bh]]),Uh={name:"nf-extendedPropertyOption",mixins:[z0,v0],props:{type:{type:String,required:!0},extendedPropertyOption:{type:Array}},computed:{listenerOptionList(){return this.extendedPropertyOption&&this.extendedPropertyOption.length>0?this.extendedPropertyOption.filter(e=>e.category==this.type):[]}},data(){return{extendedPropertyOption:[],listenerVisible:!1,eventTypeExecution:["start","take","end"],eventTypeExtendedProperty:["create","assignment","complete","delete"],isAdd:!0,form:{name:"",value:"",remark:""},rules:{name:{required:!0,trigger:"change"},value:{required:!0,trigger:"change"},remark:{required:!1,trigger:"change"}},currentListener:{}}},watch:{formData:{handler(e){const{extensionElements:t}=e,n=[];t&&t.values&&t.values.length>0&&t.values.forEach(A=>{if(A.$type.includes(this.type)||A.$type.includes(this.type.toLowerCase())){const i={id:zn(16),...A};n.push(i)}}),this.extendedPropertyOption=n,setTimeout(()=>{const A=n[0];n.length>0&&this.$refs.table&&this.$refs.table.setCurrentRow(A),this.rowClick(A)})},deep:!0,immediate:!0}},mounted(){this.form.event=this[`eventType${this.type}`][0]},methods:{handleSubmit(){this.$refs.form.validate(e=>{if(e){const t=this.form;this.isAdd?(t.id=zn(16),this.extendedPropertyOption.push(t)):this.extendedPropertyOption.splice(this.extendedPropertyOption.findIndex(n=>n.id==t.id),1,t),this.changeExtensionElements(),this.handleClose()}})},handleDelete(e){this.$confirm(this.t("nf.panel.node.extendedProperty.message"),this.t("nf.panel.node.extendedProperty.warning"),{type:"warning"}).then(()=>{this.extendedPropertyOption.splice(e,1),this.changeExtensionElements()}).catch(()=>{})},changeExtensionElements(){const e=this.modeler.get("bpmnFactory"),t=[];this.extendedPropertyOption.forEach(i=>{const o=e.create(`flowable:${this.type}`,{...i});t.push(o)});const n=[],{extensionElements:A}=this.element.businessObject;A&&A.values&&A.values.length>0&&A.values.forEach(i=>{i.$type.includes(this.type)||i.$type.includes(this.type.toLowerCase())||n.push(i)}),this.updateProperties({extensionElements:e.create("bpmn:ExtensionElements",{values:t.concat(n)})})},handleOpen(e=!0,t){this.listenerVisible=!0,this.isAdd=e,e?this.$refs.form.resetFields():this.form=JSON.parse(JSON.stringify(t))},handleClose(){this.listenerVisible=!1,this.form={name:"",value:"",remark:""},this.$refs.form.clearValidate()},rowClick(e){this.currentListener=e},fieldSave(e){let{id:t,fields:n}=this.currentListener;n||(n=[]),n.push(e),this.currentListener.fields=n,this.extendedPropertyOption.splice(this.extendedPropertyOption.findIndex(A=>A.id==t),1,this.currentListener),this.changeExtensionElements()},fieldUpdate(e,t){this.currentListener.fields[t]=e,this.changeExtensionElements()},fieldDel(e,t){this.currentListener.fields.splice(t,1),this.changeExtensionElements()},handleQuickOptionChange(e){const t=this.listenerOptionList.find(n=>n.id==e);if(t){const{event:n,type:A,val:i}=t;this.form={event:n,listenerType:A,value:i}}}}};function Nh(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("el-table-column"),c=s.resolveComponent("el-table"),l=s.resolveComponent("el-icon-question-filled"),B=s.resolveComponent("el-icon"),g=s.resolveComponent("el-tooltip"),p=s.resolveComponent("el-option"),E=s.resolveComponent("el-select"),d=s.resolveComponent("el-form-item"),u=s.resolveComponent("el-input"),h=s.resolveComponent("el-form"),D=s.resolveComponent("el-drawer");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(r,{type:"primary",size:"small",onClick:o.handleOpen},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.extendedProperty.add")),1)]),_:1},8,["onClick"]),s.createVNode(c,{ref:"table",data:i.extendedPropertyOption,border:"",size:"small",style:{"margin-top":"5px"},"highlight-current-row":"",onRowClick:o.rowClick},{default:s.withCtx(()=>[s.createVNode(a,{prop:"name",label:e.t("nf.panel.node.extendedProperty.name"),align:"center"},null,8,["label"]),s.createVNode(a,{prop:"value",label:e.t("nf.panel.node.extendedProperty.value"),align:"center"},null,8,["label"]),s.createVNode(a,{prop:"remark",label:e.t("nf.panel.node.extendedProperty.remark"),align:"center"},null,8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.extendedProperty.operations"),align:"center",width:"100"},{default:s.withCtx(y=>[s.createVNode(r,{size:"default",type:"primary",text:"",onClick:s.withModifiers(C=>o.handleOpen(!1,y.row),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.extendedProperty.edit")),1)]),_:2},1032,["onClick"]),s.createVNode(r,{size:"default",type:"danger",text:"",onClick:s.withModifiers(C=>o.handleDelete(y.$index),["stop"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.extendedProperty.delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data","onRowClick"]),s.createVNode(D,{modelValue:i.listenerVisible,"onUpdate:modelValue":t[3]||(t[3]=y=>i.listenerVisible=y),title:i.isAdd?e.t("nf.panel.node.extendedProperty.add"):e.t("nf.panel.node.extendedProperty.edit"),"append-to-body":"","before-close":o.handleClose,size:"50%"},{default:s.withCtx(()=>[s.createVNode(h,{ref:"form",style:{padding:"0 20px"},model:i.form,rules:i.rules,size:"default","label-suffix":":","label-position":e.labelPosition,"label-width":"120px"},{default:s.withCtx(()=>[o.listenerOptionList&&o.listenerOptionList.length>0?(s.openBlock(),s.createBlock(d,{key:0},{label:s.withCtx(()=>[s.createVNode(g,{effect:"dark",content:e.t("nf.panel.node.extendedProperty.quickTip"),placement:"top"},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(B,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.extendedProperty.quick"))+": ",1)])]),_:1},8,["content"])]),default:s.withCtx(()=>[s.createVNode(E,{style:{width:"100%"},placeholder:e.t("nf.panel.node.extendedProperty.quick"),filterable:"",onChange:o.handleQuickOptionChange},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.listenerOptionList,(y,C)=>(s.openBlock(),s.createBlock(p,{key:C,label:y.name,value:y.id},null,8,["label","value"]))),128))]),_:1},8,["placeholder","onChange"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(d,{label:e.t("nf.panel.node.extendedProperty.name"),prop:"name"},{default:s.withCtx(()=>[s.createVNode(u,{modelValue:i.form.name,"onUpdate:modelValue":t[0]||(t[0]=y=>i.form.name=y),placeholder:e.t("nf.panel.node.extendedProperty.name")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,{label:e.t("nf.panel.node.extendedProperty.value"),prop:"value"},{default:s.withCtx(()=>[s.createVNode(u,{modelValue:i.form.value,"onUpdate:modelValue":t[1]||(t[1]=y=>i.form.value=y),placeholder:e.t("nf.panel.node.extendedProperty.value")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,{label:e.t("nf.panel.node.extendedProperty.remark"),prop:"remark"},{default:s.withCtx(()=>[s.createVNode(u,{type:"textarea",rows:"3",modelValue:i.form.remark,"onUpdate:modelValue":t[2]||(t[2]=y=>i.form.remark=y),placeholder:e.t("nf.panel.node.extendedProperty.remark")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(d,null,{default:s.withCtx(()=>[s.createVNode(r,{type:"primary",size:"default",onClick:o.handleSubmit},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.extendedProperty.submit")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model","rules","label-position"])]),_:1},8,["modelValue","title","before-close"])])}const zh=F0(Uh,[["render",Nh]]),Rh={name:"multi-instance",mixins:[z0,v0],props:{type:{type:String,required:!0,validator:e=>["UserTask","SubProcess"].includes(e)}},watch:{formData:{handler(e){const{loopCharacteristics:t}=e;if(t){const{isSequential:n,completionCondition:A,loopCardinality:i,collection:o,elementVariable:r}=t;if(n?this.multiInstance.isSequential="Sequential":this.multiInstance.isSequential="Parallel",A){const a=A.body;a.includes("${")&&a.includes(">=")?this.multiInstance.completionCondition=Number(a.substring(a.indexOf(">=")+2,a.indexOf("}")).trim())*100:this.multiInstance.completionCondition=a}else delete this.multiInstance.completionCondition;i?this.multiInstance.loopCardinality=i.body:delete this.multiInstance.loopCardinality,this.multiInstance.collection=o,this.multiInstance.elementVariable=r}else this.multiInstance={}},deep:!0,immediate:!0}},data(){return{multiInstance:{}}},methods:{handleMultiInstance(e){let t,n;e?(t=this.modeler.get("bpmnFactory").create("bpmn:MultiInstanceLoopCharacteristics"),e==="Sequential"&&(t.isSequential=!0),t.elementVariable="assignee",t.collection="${wfMultiInstanceHandler.getList(execution)}",t.completionCondition=this.modeler.get("bpmnFactory").create("bpmn:FormalExpression",{body:"${nrOfCompletedInstances/nrOfInstances >= 100}"}),this.multiInstance.completionCondition=100,n="${assignee}"):(t=void 0,n=void 0),this.element.type=="bpmn:UserTask"&&this.updateProperties({assignee:n}),this.updateProperties({loopCharacteristics:t})},updateMultiInstanceProperties(e){const t=this.element.businessObject.loopCharacteristics;if(t)for(let n in e)t[n]=e[n];for(let n in e)t[n]=e[n];this.updateProperties({loopCharacteristics:t})},updateFormalExpression(e,t){e&&t?t=this.modeler.get("bpmnFactory").create("bpmn:FormalExpression",{body:t}):t=void 0;const n=this.element.businessObject.loopCharacteristics;n[e]=t,this.updateProperties({loopCharacteristics:n})}}},Sh={key:0};function Th(e,t,n,A,i,o){const r=s.resolveComponent("el-option"),a=s.resolveComponent("el-select"),c=s.resolveComponent("el-form-item"),l=s.resolveComponent("el-slider"),B=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(B,{model:i.multiInstance,"label-position":e.labelPosition,"label-width":"90px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[s.createVNode(c,{label:e.t("nf.panel.node.multiInstance.type")},{default:s.withCtx(()=>[s.createVNode(a,{style:{width:"100%"},modelValue:i.multiInstance.isSequential,"onUpdate:modelValue":t[0]||(t[0]=g=>i.multiInstance.isSequential=g),clearable:"",placeholder:e.t("nf.panel.node.multiInstance.type"),onChange:o.handleMultiInstance},{default:s.withCtx(()=>[s.createVNode(r,{label:e.t("nf.panel.node.multiInstance.parallel"),value:"Parallel"},null,8,["label"]),s.createVNode(r,{label:e.t("nf.panel.node.multiInstance.sequential"),value:"Sequential"},null,8,["label"])]),_:1},8,["modelValue","placeholder","onChange"])]),_:1},8,["label"]),i.multiInstance.isSequential?(s.openBlock(),s.createElementBlock("div",Sh,[s.createVNode(c,{label:e.t("nf.panel.node.multiInstance.completionCondition")},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.multiInstance.completionCondition,"onUpdate:modelValue":t[1]||(t[1]=g=>i.multiInstance.completionCondition=g),"show-input":"",min:0,max:100,"format-tooltip":g=>g+"%",onChange:t[2]||(t[2]=g=>o.updateFormalExpression("completionCondition","${nrOfCompletedInstances/nrOfInstances >= "+g/100+"}"))},null,8,["modelValue","format-tooltip"])]),_:1},8,["label"])])):s.createCommentVNode("",!0)]),_:1},8,["model","label-position"])}const kh=F0(Rh,[["render",Th]]),Gh={name:"nf-form-config",mixins:[z0,v0],components:{UserSelect:Zl},computed:{userUrl(){return this.userOption.userUrl},customOption(){return this.userOption.customOption},indepFormList(){return this.formOption.list||[]}},data(){return{extensionType:"flowable:FormProperty",formExtensionType:"flowable:FormProp",form:{},column:[],align:"center",mode:"",defaultChecked:"",copyExtensionType:"flowable:CopyUser",indepOption:{menuBtn:!1,size:"default",column:[{prop:"indepFormSummary",label:"汇总表单",labelTip:"1、系统会自动汇总当前节点之前/选择的所有表单,并且表单只读。<br>2、确保所有表单字段的prop唯一。<br>3、请确保当前节点之前的表单配置正确。",span:24,type:"radio",dicData:[{label:"是",value:"1"},{label:"否",value:"0"}],value:"0",change:({value:e})=>{if(!e)return;const t=this.findObject(this.indepOption.column,"indepSummaryNode");t!=-1&&(e=="1"?(t.display=!0,t.dicData=this.nodes):t.display=!1,this.handleUpdateProperties("indepFormSummary",e))},display:!0},{prop:"indepSummaryNode",label:"汇总节点",type:"select",span:24,placeholder:"不选择则表示之前所有节点",multiple:!0,dicData:[],props:{label:"name",value:"id"},display:!0,change:({value:e})=>{!e||e.length==0||this.handleUpdateProperties("indepSummaryNode",e.join(","))}},{prop:"indepFormKey",label:"表单key",dicData:[],props:{label:"name",value:"formKey"},type:"select",span:24,change:({value:e,column:t})=>{if(this.indepOption.init)if(e){const n=t.dicData.find(A=>A.formKey==e);n&&(this.handleUpdateProperties("indepFormKey",e),this.resolveColumn(this.getFormColumn(n.content)))}else this.handleUpdateProperties("indepFormKey",void 0),this.resolveColumn([])},display:!0}]},readableCheckAll:!0,writableCheckAll:!0,requiredCheckAll:!0}},watch:{formData:{handler(e){let{hideAttachment:t,hideCopy:n,hideExamine:A,exFormKey:i,exFormUrl:o,exAppFormUrl:r,indepFormKey:a,indepFormSummary:c,indepSummaryNode:l}=e;if(this.element.type=="bpmn:UserTask")t?t=JSON.parse(t):t=!1,n?n=JSON.parse(n):n=!1,A?A=JSON.parse(A):A=!1;else if(this.element.type=="bpmn:StartEvent"){const p=this.getExtensionElementsEq("flowable:HideCopy");p&&p.length>0?n=JSON.parse(p[0].value):n=!1;const E=this.getExtensionElementsEq("flowable:HideExamine");E&&E.length>0?A=JSON.parse(E[0].value):A=!1;const d=this.getExtensionElementsEq("flowable:ExFormKey");d&&d.length>0&&(i=d[0].value);const u=this.getExtensionElementsEq("flowable:ExFormUrl");u&&u.length>0&&(o=u[0].value);const h=this.getExtensionElementsEq("flowable:ExAppFormUrl");h&&h.length>0&&(r=h[0].value);const D=this.getExtensionElementsEq("flowable:IndepFormKey");D&&D.length>0&&(a=D[0].value)}this.form.hideAttachment=t,this.form.hideCopy=n,this.form.hideExamine=A;const B=this.getExtensionElementsEq(this.copyExtensionType);if(B&&B.length>0){const p=[],E=[];B.forEach(d=>{p.push(d.value),E.push(d.text)}),this.form.copyUser=p.join(","),this.form.$copyUser=E.join(" | ")}else delete this.form.copyUser,delete this.form.$copyUser;let g=[];if(this.formOption)g=this.getFormColumn(this.formOption),this.handleUpdateProperties("exFormKey",void 0),this.handleUpdateProperties("exFormUrl",void 0),this.handleUpdateProperties("exAppFormUrl",void 0),this.handleUpdateProperties("indepFormKey",void 0),this.resolveColumn(g);else if(this.exFormOption){const p=this.exFormOption.column;if(!p||p.length==0){let E=this.getExtensionElementsEq(this.extensionType);(!E||E.length==0)&&(E=this.getExtensionElementsEq(this.formExtensionType)),E&&E.length>0?g=E.map(d=>({label:d.name,prop:d.id,readable:!!d.readable,writable:!!d.writable})):g=[]}else g=this.getFormColumn(this.exFormOption);i=this.exFormOption.exFormKey||i||"",o=this.exFormOption.exFormUrl||o||"",r=this.exFormOption.exAppFormUrl||r||"",this.form.exFormKey=i,this.form.exFormUrl=o,this.form.exAppFormUrl=r,this.mode="ex-form",this.handleUpdateProperties("exFormKey",i),this.handleUpdateProperties("exFormUrl",o),this.handleUpdateProperties("exAppFormUrl",r),this.handleUpdateProperties("indepFormKey",void 0),this.resolveColumn(g)}else if(this.indepFormOption){this.indepOption.init=!1,this.handleUpdateProperties("exFormKey",void 0),this.handleUpdateProperties("exFormUrl",void 0),this.handleUpdateProperties("exAppFormUrl",void 0);const{list:p}=this.indepFormOption;if(this.findObject(this.indepOption.column,"indepFormKey").dicData=p,this.mode="indep",a){const E=p.find(d=>d.formKey==a);E&&this.resolveColumn(this.getFormColumn(E.content)),this.form.indepFormKey=a}else this.resolveColumn([]),delete this.form.indepFormKey;if(c){this.form.indepFormSummary=c;const E=this.findObject(this.indepOption.column,"indepSummaryNode");E!=-1&&(E.dicData=this.nodes)}else this.form.indepFormSummary="0";l?this.form.indepSummaryNode=l.split(","):this.form.indepSummaryNode=[],this.$nextTick(()=>{this.indepOption.init=!0,this.element.type=="bpmn:StartEvent"&&(this.findObject(this.indepOption.column,"indepFormSummary").display=!1,this.findObject(this.indepOption.column,"indepSummaryNode").display=!1)})}},deep:!0,immediate:!0}},methods:{handleCheckChange(){const e=[],t=[],n=[],A=[],i=[],o=r=>!r||r.length==0?null:(r.forEach(a=>{const{prop:c,label:l,readable:B,writable:g,required:p}=a;e.push({id:c,name:l,readable:B,writable:g,required:p}),B&&t.push(a),g&&n.push(a),p&&A.push(a),i.push(a),a.children&&a.children.length>0&&(this.align="left",a.children=o(a.children))}),r);o(this.column),this.deleteExtensionElements(this.extensionType),this.setExtensionElements(this.formExtensionType,e),t.length==i.length?this.readableCheckAll=!0:this.readableCheckAll=!1,n.length==i.length?this.writableCheckAll=!0:this.writableCheckAll=!1,A.length==i.length?this.requiredCheckAll=!0:this.requiredCheckAll=!1},resolveColumn(e=[]){const t=[],n=[],A=[],i=[],o=[];if(e.length>0){let r=this.getExtensionElementsEq(this.extensionType);(!r||r.length==0)&&(r=this.getExtensionElementsEq(this.formExtensionType));const a=c=>!c||c.length==0?null:(c.forEach(l=>{if(r&&r.length>0){let u=r.find(h=>h.id==l.prop);if(u){const{readable:h,writable:D,required:y}=u;l.readable=JSON.parse(h),l.writable=JSON.parse(D),l.required=y!=null?JSON.parse(y):!0}}const{prop:B,label:g,readable:p,writable:E,required:d}=l;t.push({id:B,name:g,readable:p,writable:E,required:d}),p&&n.push(l),E&&A.push(l),d&&i.push(l),o.push(l),l.children&&l.children.length>0&&(this.align="left",l.children=a(l.children))}),c);e=a(e)}this.deleteExtensionElements(this.extensionType),this.setExtensionElements(this.formExtensionType,t),this.column=e,n.length==o.length?this.readableCheckAll=!0:this.readableCheckAll=!1,A.length==o.length?this.writableCheckAll=!0:this.writableCheckAll=!1,i.length==o.length?this.requiredCheckAll=!0:this.requiredCheckAll=!1},getFormColumn(e){let t=[];if(!e)return t;typeof e=="string"&&(e=Function('"use strict";return ('+e+")")());const n=A=>{if(!Array.isArray(A))return null;const i=[];return A.forEach(o=>{const r={label:o.type=="title"?`${o.label}(${o.textValue})`:o.label,prop:o.prop,writable:!0,readable:!0,required:!0,random:Math.ceil(Math.random()*1e4)};let a;if(o.children&&o.children.column)a=n(o.children.column);else if(o.params&&o.params.children&&o.params.children.column&&o.params.children.column.length>0)a=n(o.params.children.column);else if(o.rows&&o.rows.length>0){let c=[];o.rows.forEach(l=>{l.cols&&l.cols.length>0&&l.cols.forEach(B=>{B.column&&B.column.length>0&&(c=c.concat(n(B.column)))})}),a=c}a&&a.length>0&&(this.align="left",r.children=a),i.push(r)}),i};if(e.column&&e.column.length>0){const A=n(e.column);A&&Array.isArray(A)&&(t=t.concat(A))}return e.group&&e.group.length>0&&e.group.forEach(A=>{if(A.column&&A.column.length>0){const i=n(A.column);i&&Array.isArray(i)&&(t=t.concat(i))}}),t},handleUpdateProperties(e,t){this.element.type=="bpmn:UserTask"?this.updateProperties({[e]:t||void 0}):this.setExtensionElements(`flowable:${e.replace(e[0],e[0].toUpperCase())}`,t?[{value:t+""}]:[])},handleUserSelect(){setTimeout(()=>{this.$refs["user-select"].init()})},handleUserSelectConfirm(e,t){const n=[];t&&(t=t.includes(" | ")?t.split(" | ").join(","):t),e.split(",").forEach((A,i)=>{A&&n.push({value:A,text:t.split(",")[i]})}),this.setExtensionElements(this.copyExtensionType,n),this.form.copyUser=e,this.form.$copyUser=t},handleUserClear(){this.setExtensionElements(this.copyExtensionType,[]),delete this.form.copyUser,delete this.form.$copyUser},handleCheckAll(e,t,n){n.forEach(A=>{A[t]=e,A.children&&A.children.length>0&&this.handleCheckAll(e,t,A.children)}),this.handleCheckChange()}}};function Hh(e,t,n,A,i,o){const r=s.resolveComponent("el-icon-question-filled"),a=s.resolveComponent("el-icon"),c=s.resolveComponent("el-tooltip"),l=s.resolveComponent("el-input"),B=s.resolveComponent("el-form-item"),g=s.resolveComponent("nf-form"),p=s.resolveComponent("el-table-column"),E=s.resolveComponent("el-checkbox"),d=s.resolveComponent("el-table"),u=s.resolveComponent("el-tag"),h=s.resolveComponent("el-divider"),D=s.resolveComponent("el-switch"),y=s.resolveComponent("user-select"),C=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(C,{model:i.form,"label-position":e.labelPosition,"label-width":"100px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[i.mode=="ex-form"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(B,null,{label:s.withCtx(()=>[s.createVNode(c,{effect:"dark",placement:"top"},{content:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.remark.r1"))+" "+s.toDisplayString(`/workflow/process/external/${i.form.exFormKey}/start`)+" "+s.toDisplayString(e.t("nf.panel.node.form.router"))+" ",1),t[19]||(t[19]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r2"))+" "+s.toDisplayString(`/workflow/process/external/${i.form.exFormKey}/detail`)+" "+s.toDisplayString(e.t("nf.panel.node.form.router"))+" ",1),t[20]||(t[20]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r7"))+" "+s.toDisplayString(`/pages/plugin/workflow/pages/external/${i.form.exFormKey}/{type}`)+" "+s.toDisplayString(e.t("nf.panel.node.form.router"))+" ",1),t[21]||(t[21]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r3"))+" ",1),t[22]||(t[22]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r4")),1)]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.exFormKey"))+" ",1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1}),t[23]||(t[23]=s.createTextVNode(" : "))])]),_:1})]),default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.form.exFormKey,"onUpdate:modelValue":t[0]||(t[0]=m=>i.form.exFormKey=m),readonly:"",placeholder:e.t("nf.panel.node.form.exFormKey"),onInput:t[1]||(t[1]=m=>o.handleUpdateProperties("exFormKey",i.form.exFormKey))},null,8,["modelValue","placeholder"])]),_:1}),s.createVNode(B,null,{label:s.withCtx(()=>[s.createVNode(c,{effect:"dark",placement:"top"},{content:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.remark.r5"))+" ",1),t[24]||(t[24]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r6")),1)]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.exFormUrl"))+" ",1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1}),t[25]||(t[25]=s.createTextVNode(" : "))])]),_:1})]),default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.form.exFormUrl,"onUpdate:modelValue":t[2]||(t[2]=m=>i.form.exFormUrl=m),clearable:"",placeholder:e.t("nf.panel.node.form.exFormUrl"),onInput:t[3]||(t[3]=m=>o.handleUpdateProperties("exFormUrl",i.form.exFormUrl))},null,8,["modelValue","placeholder"])]),_:1}),s.createVNode(B,{"label-width":"110px"},{label:s.withCtx(()=>[s.createVNode(c,{effect:"dark",placement:"top"},{content:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.remark.r5"))+" ",1),t[26]||(t[26]=s.createElementVNode("br",null,null,-1)),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.remark.r6")),1)]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.exAppFormUrl"))+" ",1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1}),t[27]||(t[27]=s.createTextVNode(" : "))])]),_:1})]),default:s.withCtx(()=>[s.createVNode(l,{modelValue:i.form.exAppFormUrl,"onUpdate:modelValue":t[4]||(t[4]=m=>i.form.exAppFormUrl=m),clearable:"",placeholder:"/pages/xxx",onInput:t[5]||(t[5]=m=>o.handleUpdateProperties("exAppFormUrl",i.form.exAppFormUrl))},null,8,["modelValue"])]),_:1})],64)):i.mode=="indep"?(s.openBlock(),s.createBlock(g,{key:1,modelValue:i.form,"onUpdate:modelValue":t[6]||(t[6]=m=>i.form=m),option:i.indepOption},null,8,["modelValue","option"])):s.createCommentVNode("",!0),i.column&&i.column.length>0?(s.openBlock(),s.createBlock(d,{key:2,data:i.column,border:"","default-expand-all":"","row-key":m=>m.prop+"-"+m.random,size:"small",style:{"margin-top":"5px"},indent:6},{default:s.withCtx(()=>[s.createVNode(p,{prop:"label",label:e.t("nf.panel.node.form.label"),width:"110","header-align":"center",align:i.align,"show-overflow-tooltip":""},null,8,["label","align"]),s.createVNode(p,{prop:"readable",label:e.t("nf.panel.node.form.readable"),align:"center",width:"70"},{header:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.readable"))+" ",1),s.createVNode(E,{size:"small",modelValue:i.readableCheckAll,"onUpdate:modelValue":t[7]||(t[7]=m=>i.readableCheckAll=m),onChange:t[8]||(t[8]=m=>o.handleCheckAll(m,"readable",i.column))},null,8,["modelValue"])]),default:s.withCtx(({row:m})=>[s.createVNode(E,{modelValue:m.readable,"onUpdate:modelValue":I=>m.readable=I,onChange:I=>o.handleCheckChange(m,"readable")},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1},8,["label"]),s.createVNode(p,{prop:"writable",label:e.t("nf.panel.node.form.writable"),align:"center",width:"70"},{header:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.form.writable"))+" ",1),s.createVNode(E,{size:"small",modelValue:i.writableCheckAll,"onUpdate:modelValue":t[9]||(t[9]=m=>i.writableCheckAll=m),onChange:t[10]||(t[10]=m=>o.handleCheckAll(m,"writable",i.column))},null,8,["modelValue"])]),default:s.withCtx(({row:m})=>[s.createVNode(E,{modelValue:m.writable,"onUpdate:modelValue":I=>m.writable=I,onChange:I=>o.handleCheckChange(m,"writable")},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1},8,["label"]),s.createVNode(p,{prop:"required",label:e.t("nf.panel.node.form.required"),align:"center",width:"70"},{header:s.withCtx(()=>[s.createVNode(c,{placement:"top"},{content:s.withCtx(()=>t[28]||(t[28]=[s.createTextVNode(" 1、表单字段必填与此项必填时, 字段必填 "),s.createElementVNode("span",{style:{color:"red"}},"生效",-1),s.createElementVNode("br",null,null,-1),s.createTextVNode(" 2、表单字段必填, 此项非必填时, 字段必填 "),s.createElementVNode("span",{style:{color:"red"}},"不",-1),s.createTextVNode(" 生效 "),s.createElementVNode("br",null,null,-1),s.createTextVNode(" 3、表单字段非必填, 此项必填时, 字段必填 "),s.createElementVNode("span",{style:{color:"red"}},"不",-1),s.createTextVNode(" 生效 ")])),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.form.required"))+" ",1)]),_:1}),s.createVNode(E,{size:"small",modelValue:i.requiredCheckAll,"onUpdate:modelValue":t[11]||(t[11]=m=>i.requiredCheckAll=m),onChange:t[12]||(t[12]=m=>o.handleCheckAll(m,"required",i.column))},null,8,["modelValue"])]),default:s.withCtx(({row:m})=>[s.createVNode(E,{modelValue:m.required,"onUpdate:modelValue":I=>m.required=I,onChange:I=>o.handleCheckChange(m,"required")},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1},8,["label"]),s.createVNode(p,{prop:"prop",label:e.t("nf.panel.node.form.prop"),align:"center","show-overflow-tooltip":""},null,8,["label"])]),_:1},8,["data","row-key"])):(!i.column||i.column.length==0)&&i.mode!="indep"?(s.openBlock(),s.createBlock(u,{key:3,type:"danger",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1}),s.createTextVNode(" "+s.toDisplayString(e.t("nf.panel.node.form.unknown")),1)]),_:1})):s.createCommentVNode("",!0),s.createVNode(h),e.element.type=="bpmn:UserTask"?(s.openBlock(),s.createBlock(B,{key:4,label:e.t("nf.panel.node.examine.hideAttachment"),"label-width":"130px"},{default:s.withCtx(()=>[s.createVNode(D,{modelValue:i.form.hideAttachment,"onUpdate:modelValue":t[13]||(t[13]=m=>i.form.hideAttachment=m),onChange:t[14]||(t[14]=m=>o.handleUpdateProperties("hideAttachment",i.form.hideAttachment))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(B,{label:e.t("nf.panel.node.examine.hideCopy"),"label-width":"130px"},{default:s.withCtx(()=>[s.createVNode(D,{modelValue:i.form.hideCopy,"onUpdate:modelValue":t[15]||(t[15]=m=>i.form.hideCopy=m),onChange:t[16]||(t[16]=m=>o.handleUpdateProperties("hideCopy",i.form.hideCopy))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(B,{label:e.t("nf.panel.node.examine.hideAssignee"),"label-width":"130px"},{default:s.withCtx(()=>[s.createVNode(D,{modelValue:i.form.hideExamine,"onUpdate:modelValue":t[17]||(t[17]=m=>i.form.hideExamine=m),onChange:t[18]||(t[18]=m=>o.handleUpdateProperties("hideExamine",i.form.hideExamine))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(B,{label:e.t("nf.panel.node.examine.copyUser"),"label-width":"130px"},{default:s.withCtx(()=>[s.createVNode(y,{ref:"user-select","user-url":o.userUrl,"custom-option":o.customOption,"default-checked":i.form.copyUser,"default-checked-text":i.form.$copyUser,onConfirm:o.handleUserSelectConfirm,onClick:o.handleUserSelect},null,8,["user-url","custom-option","default-checked","default-checked-text","onConfirm","onClick"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Ph=F0(Gh,[["render",Hh]]),Jh={name:"nf-button",mixins:[z0,v0],data(){return{extensionType:"flowable:Button",form:{},column:[]}},watch:{formData:{handler(e){const{extensionElements:t}=e;let n=[];if(this.buttonOption&&this.buttonOption.length>0){const A=JSON.parse(JSON.stringify(this.buttonOption)),i=[];if(t&&t.values&&t.values.length>0){const o=this.getExtensionElementsEq(this.extensionType);A.forEach(r=>{const a=o.find(c=>c.prop==r.prop);a&&(r.display=JSON.parse(a.display)),i.push(r)})}else A.forEach(o=>i.push(o));this.setExtensionElements(this.extensionType,i),n=A}this.column=n},deep:!0,immediate:!0}}};function jh(e,t,n,A,i,o){const r=s.resolveComponent("el-table-column"),a=s.resolveComponent("el-checkbox"),c=s.resolveComponent("el-table"),l=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(l,{model:i.form,"label-position":e.labelPosition,"label-width":"90px","label-suffix":":"},{default:s.withCtx(()=>[s.createVNode(c,{data:i.column,border:"",size:"small",style:{"margin-top":"5px"}},{default:s.withCtx(()=>[s.createVNode(r,{prop:"label",label:e.t("nf.panel.node.button.label"),align:"center",width:"90","show-overflow-tooltip":""},null,8,["label"]),s.createVNode(r,{prop:"prop",label:e.t("nf.panel.node.button.prop"),align:"center","show-overflow-tooltip":""},null,8,["label"]),s.createVNode(r,{prop:"display",label:e.t("nf.panel.node.button.display"),align:"center",width:"100"},{default:s.withCtx(({row:B})=>[s.createVNode(a,{modelValue:B.display,"onUpdate:modelValue":g=>B.display=g,size:"default",onChange:t[0]||(t[0]=g=>e.setExtensionElements(i.extensionType,i.column))},null,8,["modelValue","onUpdate:modelValue"])]),_:1},8,["label"])]),_:1},8,["data"])]),_:1},8,["model","label-position"])}const Vh=F0(Jh,[["render",jh]]),Lh={name:"nf-condition",mixins:[z0,v0],data(){return{condition:{}}},watch:{formData:{handler(e){const{conditionExpression:t}=e;t?this.condition.conditionExpression=t.body:delete this.condition.conditionExpression},deep:!0,immediate:!0}}};function Wh(e,t,n,A,i,o){const r=s.resolveComponent("el-option"),a=s.resolveComponent("el-select"),c=s.resolveComponent("el-input"),l=s.resolveComponent("el-form-item"),B=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(B,{model:i.condition,"label-position":e.labelPosition,"label-width":"90px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[s.createVNode(l,{label:e.t("nf.panel.node.condition.conditionExpression")},{default:s.withCtx(()=>[e.conditionOption&&e.conditionOption.length>0?(s.openBlock(),s.createBlock(a,{key:0,modelValue:i.condition.conditionExpression,"onUpdate:modelValue":t[0]||(t[0]=g=>i.condition.conditionExpression=g),"allow-create":"",clearable:"",filterable:"",placeholder:e.t("nf.panel.node.condition.conditionExpression"),onChange:t[1]||(t[1]=g=>e.updateFormalExpression("conditionExpression",i.condition.conditionExpression))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.conditionOption,g=>(s.openBlock(),s.createBlock(r,{key:g.expression,label:g.name,value:g.expression},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])):(s.openBlock(),s.createBlock(c,{key:1,modelValue:i.condition.conditionExpression,"onUpdate:modelValue":t[2]||(t[2]=g=>i.condition.conditionExpression=g),clearable:"",placeholder:e.t("nf.panel.node.condition.conditionExpression"),onInput:t[3]||(t[3]=g=>e.updateFormalExpression("conditionExpression",i.condition.conditionExpression))},null,8,["modelValue","placeholder"]))]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const _h=F0(Lh,[["render",Wh]]),Oh={name:"nf-timer-event",mixins:[z0,v0],watch:{formData:{handler(e){let{isInterrupting:t,cancelActivity:n}=e;t==null&&(t=!0),n==null&&(n=!0),this.timer.isInterrupting=t,this.timer.cancelActivity=n;let A=this.getEventDefinitions(this.type);if(A&&A.length>0){const{timeCycle:i,timeDate:o,timeDuration:r}=A[0];i?this.timer.timeCycle=i.body:delete this.timer.timeCycle,o?this.timer.timeDate=o.body:delete this.timer.timeDate,r?this.timer.timeDuration=r.body:delete this.timer.timeDuration}},deep:!0,immediate:!0}},data(){return{type:"bpmn:TimerEventDefinition",expressionType:"bpmn:Expression",timer:{}}}};function Xh(e,t,n,A,i,o){const r=s.resolveComponent("el-switch"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-input"),l=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(l,{model:i.timer,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[["bpmn:StartEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.timer.isInterrupting,"onUpdate:modelValue":t[0]||(t[0]=B=>i.timer.isInterrupting=B),onChange:t[1]||(t[1]=B=>e.updateProperties({isInterrupting:i.timer.isInterrupting}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),["bpmn:BoundaryEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:1,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.timer.cancelActivity,"onUpdate:modelValue":t[2]||(t[2]=B=>i.timer.cancelActivity=B),onChange:t[3]||(t[3]=B=>e.updateProperties({cancelActivity:i.timer.cancelActivity}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.timer.timeCycle")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.timer.timeCycle,"onUpdate:modelValue":t[4]||(t[4]=B=>i.timer.timeCycle=B),clearable:"",placeholder:e.t("nf.panel.node.event.timer.timeCycle"),onInput:t[5]||(t[5]=B=>e.setEventDefinitions(i.type,{timeCycle:e.createElement(i.expressionType,{body:i.timer.timeCycle})}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.event.timer.timeDate")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.timer.timeDate,"onUpdate:modelValue":t[6]||(t[6]=B=>i.timer.timeDate=B),clearable:"",placeholder:e.t("nf.panel.node.event.timer.timeDate"),onInput:t[7]||(t[7]=B=>e.setEventDefinitions(i.type,{timeDate:e.createElement(i.expressionType,{body:i.timer.timeDate})}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.event.timer.timeDuration")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.timer.timeDuration,"onUpdate:modelValue":t[8]||(t[8]=B=>i.timer.timeDuration=B),clearable:"",placeholder:e.t("nf.panel.node.event.timer.timeDuration"),onInput:t[9]||(t[9]=B=>e.setEventDefinitions(i.type,{timeDuration:e.createElement(i.expressionType,{body:i.timer.timeDuration})}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Kh=F0(Oh,[["render",Xh]]),Zh={name:"nf-signal-event",mixins:[z0,v0],watch:{formData:{handler(e){let{isInterrupting:t,cancelActivity:n}=e;t==null&&(t=!0),n==null&&(n=!0),this.signal.isInterrupting=t,this.signal.cancelActivity=n;const A=this.getRootElements(this.signalType);this.signalList=A;let i=this.getEventDefinitions(this.type);if(i&&i.length>0){const{signalRef:o}=i[0];o?A.find(r=>r.id==o.id)?this.signal.signalRef=o.id:this.setEventDefinitions(this.type,{signalRef:void 0}):delete this.signal.signalRef}},deep:!0,immediate:!0}},data(){return{type:"bpmn:SignalEventDefinition",signalType:"bpmn:Signal",signal:{},signalList:[],option:{column:[{label:"ID",prop:"id",overHidden:!0,span:24,editDisabled:!0,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]},{label:"Name",prop:"name",overHidden:!0,span:24,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]}]}}},methods:{}};function qh(e,t,n,A,i,o){const r=s.resolveComponent("nf-dynamic"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-option"),B=s.resolveComponent("el-select"),g=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(g,{model:i.signal,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{"label-width":"0"},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.signalList,"onUpdate:modelValue":t[0]||(t[0]=p=>i.signalList=p),children:i.option},null,8,["modelValue","children"])]),_:1}),["bpmn:StartEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.signal.isInterrupting,"onUpdate:modelValue":t[1]||(t[1]=p=>i.signal.isInterrupting=p),onChange:t[2]||(t[2]=p=>e.updateProperties({isInterrupting:i.signal.isInterrupting}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),["bpmn:BoundaryEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:1,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.signal.cancelActivity,"onUpdate:modelValue":t[3]||(t[3]=p=>i.signal.cancelActivity=p),onChange:t[4]||(t[4]=p=>e.updateProperties({cancelActivity:i.signal.cancelActivity}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.signalRef")},{default:s.withCtx(()=>[s.createVNode(B,{modelValue:i.signal.signalRef,"onUpdate:modelValue":t[5]||(t[5]=p=>i.signal.signalRef=p),clearable:"",filterable:"","allow-create":"",placeholder:e.t("nf.panel.node.event.signalRef"),onChange:t[6]||(t[6]=p=>e.setEventDefinitions(i.type,{signalRef:p?e.createElement(i.signalType,{id:p,name:p}):void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.signalList,(p,E)=>(s.openBlock(),s.createBlock(l,{label:p.name,value:p.id,key:E},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const $h=F0(Zh,[["render",qh]]),ew={name:"nf-message-event",mixins:[z0,v0],watch:{formData:{handler(e){let{isInterrupting:t,cancelActivity:n}=e;t==null&&(t=!0),n==null&&(n=!0),this.message.isInterrupting=t,this.message.cancelActivity=n;const A=this.getRootElements(this.messageType);this.messageList=A;let i=this.getEventDefinitions(this.type);if(i&&i.length>0){const{messageRef:o}=i[0];o?A.find(r=>r.id==o.id)?this.message.messageRef=o.id:this.setEventDefinitions(this.type,{messageRef:void 0}):delete this.message.messageRef}},deep:!0,immediate:!0}},data(){return{type:"bpmn:MessageEventDefinition",messageType:"bpmn:Message",message:{},messageList:[],option:{column:[{label:"ID",prop:"id",overHidden:!0,span:24,editDisabled:!0,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]},{label:"Name",prop:"name",overHidden:!0,span:24,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]}]}}},methods:{}};function tw(e,t,n,A,i,o){const r=s.resolveComponent("nf-dynamic"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-option"),B=s.resolveComponent("el-select"),g=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(g,{model:i.message,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{"label-width":"0"},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.messageList,"onUpdate:modelValue":t[0]||(t[0]=p=>i.messageList=p),children:i.option},null,8,["modelValue","children"])]),_:1}),["bpmn:StartEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.message.isInterrupting,"onUpdate:modelValue":t[1]||(t[1]=p=>i.message.isInterrupting=p),onChange:t[2]||(t[2]=p=>e.updateProperties({isInterrupting:i.message.isInterrupting}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),["bpmn:BoundaryEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:1,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.message.cancelActivity,"onUpdate:modelValue":t[3]||(t[3]=p=>i.message.cancelActivity=p),onChange:t[4]||(t[4]=p=>e.updateProperties({cancelActivity:i.message.cancelActivity}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.messageRef")},{default:s.withCtx(()=>[s.createVNode(B,{modelValue:i.message.messageRef,"onUpdate:modelValue":t[5]||(t[5]=p=>i.message.messageRef=p),clearable:"",filterable:"","allow-create":"",placeholder:e.t("nf.panel.node.event.messageRef"),onChange:t[6]||(t[6]=p=>e.setEventDefinitions(i.type,{messageRef:p?e.createElement(i.messageType,{id:p,name:p}):void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.messageList,(p,E)=>(s.openBlock(),s.createBlock(l,{label:p.name,value:p.id,key:E},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const nw=F0(ew,[["render",tw]]),Aw={name:"nf-error-event",mixins:[z0,v0],watch:{formData:{handler(e){let{isInterrupting:t}=e;t==null&&(t=!0),this.error.isInterrupting=t;const n=this.getRootElements(this.errorType);this.errorList=n;let A=this.getEventDefinitions(this.type);if(A&&A.length>0){const{errorRef:i}=A[0];i?n.find(o=>o.id==i.id)?this.error.errorRef=i.id:this.setEventDefinitions(this.type,{errorRef:void 0}):delete this.error.errorRef}},deep:!0,immediate:!0}},data(){return{type:"bpmn:ErrorEventDefinition",errorType:"bpmn:Error",error:{},errorList:[],form:{},option:{column:[{label:"ID",prop:"id",rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]},{label:"Name",prop:"name",rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母"}]}]}}},methods:{}};function iw(e,t,n,A,i,o){const r=s.resolveComponent("nf-dynamic"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-option"),B=s.resolveComponent("el-select"),g=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(g,{model:i.error,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{"label-width":"0"},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.errorList,"onUpdate:modelValue":t[0]||(t[0]=p=>i.errorList=p),children:i.option},null,8,["modelValue","children"])]),_:1}),["bpmn:StartEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.error.isInterrupting,"onUpdate:modelValue":t[1]||(t[1]=p=>i.error.isInterrupting=p),onChange:t[2]||(t[2]=p=>e.updateProperties({isInterrupting:i.error.isInterrupting}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.errorRef")},{default:s.withCtx(()=>[s.createVNode(B,{modelValue:i.error.errorRef,"onUpdate:modelValue":t[3]||(t[3]=p=>i.error.errorRef=p),clearable:"",filterable:"","allow-create":"",placeholder:e.t("nf.panel.node.event.errorRef"),onChange:t[4]||(t[4]=p=>e.setEventDefinitions(i.type,{errorRef:p?e.createElement(i.errorType,{id:p,name:p}):void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.errorList,(p,E)=>(s.openBlock(),s.createBlock(l,{label:p.name,value:p.id,key:E},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const ow=F0(Aw,[["render",iw]]),rw={name:"nf-terminate-event",mixins:[z0,v0],watch:{formData:{handler(e){let t=this.getEventDefinitions(this.type);if(t&&t.length>0){const n=t[0].$attrs["flowable:terminateAll"];n?this.terminate.terminateAll=JSON.parse(n):delete this.terminate.terminateAll}},deep:!0,immediate:!0}},data(){return{terminate:{}}}};function aw(e,t,n,A,i,o){const r=s.resolveComponent("el-switch"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(c,{model:i.terminate,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{label:e.t("nf.panel.node.event.terminateAll")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.terminate.terminateAll,"onUpdate:modelValue":t[0]||(t[0]=l=>i.terminate.terminateAll=l),onChange:t[1]||(t[1]=l=>e.element.businessObject.eventDefinitions[0].$attrs["flowable:terminateAll"]=l)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const cw=F0(rw,[["render",aw]]),sw={name:"nf-compensate-event",mixins:[z0,v0],watch:{formData:{handler(){this.compensateList=this.nodes.filter(t=>t.nodeType.toLowerCase().includes("task")||["bpmn:SubProcess","bpmn:CallActivity"].includes(t.nodeType));let e=this.getEventDefinitions(this.type);if(e&&e.length>0){const{activityRef:t}=e[0];t?this.compensate.activityRef=t.id:delete this.compensate.activityRef}},deep:!0,immediate:!0}},data(){return{type:"bpmn:CompensateEventDefinition",compensateType:"bpmn:Activity",compensate:{},form:{},compensateList:[]}}};function lw(e,t,n,A,i,o){const r=s.resolveComponent("el-option"),a=s.resolveComponent("el-select"),c=s.resolveComponent("el-form-item"),l=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(l,{model:i.compensate,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[s.createVNode(c,{label:e.t("nf.panel.node.event.activityRef")},{default:s.withCtx(()=>[s.createVNode(a,{modelValue:i.compensate.activityRef,"onUpdate:modelValue":t[0]||(t[0]=B=>i.compensate.activityRef=B),clearable:"",filterable:"","allow-create":"",placeholder:e.t("nf.panel.node.event.activityRef"),onChange:t[1]||(t[1]=B=>e.setEventDefinitions(i.type,{activityRef:B?{id:B}:void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.compensateList,(B,g)=>(s.openBlock(),s.createBlock(r,{label:B.name,value:B.id,key:g},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Bw=F0(sw,[["render",lw]]),gw={name:"nf-conditional-event",mixins:[z0,v0],watch:{formData:{handler(e){let{isInterrupting:t,cancelActivity:n}=e;t==null&&(t=!0),n==null&&(n=!0),this.conditional.isInterrupting=t,this.conditional.cancelActivity=n;let A=this.getEventDefinitions(this.type);if(A&&A.length>0){const{condition:i}=A[0];i?this.conditional.condition=i.body:delete this.conditional.condition}},deep:!0,immediate:!0}},data(){return{type:"bpmn:ConditionalEventDefinition",conditionType:"bpmn:FormalExpression",conditional:{}}}};function pw(e,t,n,A,i,o){const r=s.resolveComponent("el-switch"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-input"),l=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(l,{model:i.conditional,"label-position":e.labelPosition,"label-suffix":":","label-width":"115px",size:"default"},{default:s.withCtx(()=>[["bpmn:StartEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.conditional.isInterrupting,"onUpdate:modelValue":t[0]||(t[0]=B=>i.conditional.isInterrupting=B),onChange:t[1]||(t[1]=B=>e.updateProperties({isInterrupting:i.conditional.isInterrupting}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),["bpmn:BoundaryEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:1,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.conditional.cancelActivity,"onUpdate:modelValue":t[2]||(t[2]=B=>i.conditional.cancelActivity=B),onChange:t[3]||(t[3]=B=>e.updateProperties({cancelActivity:i.conditional.cancelActivity}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.condition")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.conditional.condition,"onUpdate:modelValue":t[4]||(t[4]=B=>i.conditional.condition=B),clearable:"",placeholder:e.t("nf.panel.node.event.condition"),onInput:t[5]||(t[5]=B=>e.setEventDefinitions(i.type,{condition:e.createElement(i.conditionType,{body:i.conditional.condition})}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Ew=F0(gw,[["render",pw]]),dw={name:"nf-escalation-event",mixins:[z0,v0],watch:{formData:{handler(e){let{cancelActivity:t}=e;t==null&&(t=!0),this.escalation.cancelActivity=t;const n=this.getRootElements(this.escalationType);this.escalationList=n;let A=this.getEventDefinitions(this.type);if(A&&A.length>0){const{escalationRef:i}=A[0];i?n.find(o=>o.id==i.id)?this.escalation.escalationRef=i.id:this.setEventDefinitions(this.type,{escalationRef:void 0}):delete this.escalation.escalationRef}},deep:!0,immediate:!0}},data(){return{type:"bpmn:EscalationEventDefinition",escalationType:"bpmn:Escalation",escalation:{},escalationList:[],option:{column:[{label:"ID",prop:"id",overHidden:!0,span:24,editDisabled:!0,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母,且不能包含中文"}]},{label:"Name",prop:"name",overHidden:!0,span:24,rules:[{required:!0,trigger:"blur"},{pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:"开头必须是字母,且不能包含中文"}]}]}}},methods:{}};function uw(e,t,n,A,i,o){const r=s.resolveComponent("nf-dynamic"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-option"),B=s.resolveComponent("el-select"),g=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(g,{model:i.escalation,"label-position":e.labelPosition,"label-suffix":":","label-width":"120px",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{"label-width":"0"},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:i.escalationList,"onUpdate:modelValue":t[0]||(t[0]=p=>i.escalationList=p),children:i.option},null,8,["modelValue","children"])]),_:1}),["bpmn:BoundaryEvent"].includes(e.formData.$type)?(s.openBlock(),s.createBlock(a,{key:0,label:e.t("nf.panel.node.event.isInterrupting")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:i.escalation.cancelActivity,"onUpdate:modelValue":t[1]||(t[1]=p=>i.escalation.cancelActivity=p),onChange:t[2]||(t[2]=p=>e.updateProperties({cancelActivity:i.escalation.cancelActivity}))},null,8,["modelValue"])]),_:1},8,["label"])):s.createCommentVNode("",!0),s.createVNode(a,{label:e.t("nf.panel.node.event.escalationRef")},{default:s.withCtx(()=>[s.createVNode(B,{modelValue:i.escalation.escalationRef,"onUpdate:modelValue":t[3]||(t[3]=p=>i.escalation.escalationRef=p),clearable:"",filterable:"","allow-create":"",placeholder:e.t("nf.panel.node.event.escalationRef"),onChange:t[4]||(t[4]=p=>e.setEventDefinitions(i.type,{escalationRef:p?e.createElement(i.escalationType,{id:p,name:p}):void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.escalationList,(p,E)=>(s.openBlock(),s.createBlock(l,{label:p.name,value:p.id,key:E},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Qw={name:"nf-event",mixins:[z0],components:{NfTimerEvent:Kh,NfSignalEvent:$h,NfMessageEvent:nw,NfErrorEvent:ow,NfTerminateEvent:cw,NfCompensateEvent:Bw,NfConditionalEvent:Ew,NfEscalationEvent:F0(dw,[["render",uw]])},watch:{formData:{handler(){const e=this.getEventDefinitions();e&&e.length>0&&(this.type=e[0].$type)},deep:!0,immediate:!0}},data(){return{type:""}}};function hw(e,t,n,A,i,o){const r=s.resolveComponent("nf-timer-event"),a=s.resolveComponent("nf-signal-event"),c=s.resolveComponent("nf-message-event"),l=s.resolveComponent("nf-conditional-event"),B=s.resolveComponent("nf-error-event"),g=s.resolveComponent("nf-terminate-event"),p=s.resolveComponent("nf-compensate-event"),E=s.resolveComponent("nf-escalation-event");return s.openBlock(),s.createElementBlock("div",null,[i.type=="bpmn:TimerEventDefinition"?(s.openBlock(),s.createBlock(r,{key:0,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:SignalEventDefinition"?(s.openBlock(),s.createBlock(a,{key:1,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:MessageEventDefinition"?(s.openBlock(),s.createBlock(c,{key:2,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:ConditionalEventDefinition"?(s.openBlock(),s.createBlock(l,{key:3,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:ErrorEventDefinition"?(s.openBlock(),s.createBlock(B,{key:4,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:TerminateEventDefinition"?(s.openBlock(),s.createBlock(g,{key:5,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0),i.type=="bpmn:CompensateEventDefinition"?(s.openBlock(),s.createBlock(p,{key:6,modeler:e.modeler,element:e.element,nodes:e.nodes},null,8,["modeler","element","nodes"])):s.createCommentVNode("",!0),i.type=="bpmn:EscalationEventDefinition"?(s.openBlock(),s.createBlock(E,{key:7,modeler:e.modeler,element:e.element},null,8,["modeler","element"])):s.createCommentVNode("",!0)])}const ww=F0(Qw,[["render",hw]]),mw={name:"nf-call",mixins:[z0,v0],watch:{formData:{handler(e){this.clearExtensionElements(["flowable:ExecutionListener","flowable:Assignee"])},deep:!0,immediate:!0}}};function fw(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-switch"),l=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(l,{model:e.formData,"label-position":e.labelPosition,"label-width":"100px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{label:e.t("nf.panel.node.call.calledElement"),prop:"callElement"},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.calledElement,"onUpdate:modelValue":t[0]||(t[0]=B=>e.formData.calledElement=B),clearable:"",placeholder:e.t("nf.panel.node.call.calledElement"),onInput:t[1]||(t[1]=B=>e.updateProperties({calledElement:e.formData.calledElement,calledElementType:"key"}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.call.inheritVariables")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:e.formData.inheritVariables,"onUpdate:modelValue":t[2]||(t[2]=B=>e.formData.inheritVariables=B),"active-value":"true","inactive-value":"false",onChange:t[3]||(t[3]=B=>e.updateProperties({inheritVariables:e.formData.inheritVariables||void 0}))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.node.call.sameDeployment")},{default:s.withCtx(()=>[s.createVNode(c,{modelValue:e.formData.sameDeployment,"onUpdate:modelValue":t[4]||(t[4]=B=>e.formData.sameDeployment=B),"active-value":"true","inactive-value":"false",onChange:t[5]||(t[5]=B=>e.updateProperties({sameDeployment:e.formData.sameDeployment||void 0}))},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Cw=F0(mw,[["render",fw]]),Mw={name:"java",mixins:[z0,v0],props:{javaType:String,disabled:{type:Boolean,default:!1}},watch:{formData:{handler(e){const{delegateExpression:t,expression:n}=e,A=e.class;A?this.java.class=A:t?this.java.delegateExpression=t:n&&(this.java.expression=n)},deep:!0,immediate:!0}},computed:{type(){return getBusinessObject(this.element).$attrs.customType||this.element.type}},data(){return{java:{}}},methods:{handleChange(e,t){this.updateProperties(Object.assign({type:void 0,class:void 0,delegateExpression:void 0,expression:void 0},{[e]:t})),this.updateProperties({extensionElements:this.modeler.get("bpmnFactory").create("bpmn:ExtensionElements",{values:this.getExtensionElementsNotEq("flowable:Field")})})}}};function Dw(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("el-form-item");return s.openBlock(),s.createElementBlock("div",null,[n.javaType=="class"?(s.openBlock(),s.createBlock(a,{key:0,label:"类"},{default:s.withCtx(()=>[s.createVNode(r,{disabled:n.disabled,modelValue:i.java.class,"onUpdate:modelValue":t[0]||(t[0]=c=>i.java.class=c),placeholder:"类",clearable:"",onChange:t[1]||(t[1]=c=>o.handleChange("class",c))},null,8,["disabled","modelValue"])]),_:1})):s.createCommentVNode("",!0),n.javaType=="delegateExpression"?(s.openBlock(),s.createBlock(a,{key:1,label:"代理表达式","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(r,{disabled:n.disabled,modelValue:i.java.delegateExpression,"onUpdate:modelValue":t[2]||(t[2]=c=>i.java.delegateExpression=c),placeholder:"代理表达式",clearable:"",onChange:t[3]||(t[3]=c=>o.handleChange("delegateExpression",c))},null,8,["disabled","modelValue"])]),_:1})):s.createCommentVNode("",!0),n.javaType=="expression"?(s.openBlock(),s.createBlock(a,{key:2,label:"表达式"},{default:s.withCtx(()=>[s.createVNode(r,{disabled:n.disabled,modelValue:i.java.expression,"onUpdate:modelValue":t[4]||(t[4]=c=>i.java.expression=c),placeholder:"表达式",clearable:"",onChange:t[5]||(t[5]=c=>o.handleChange("expression",c))},null,8,["disabled","modelValue"])]),_:1})):s.createCommentVNode("",!0)])}const yw=F0(Mw,[["render",Dw]]),Iw={name:"http",props:{disabled:{type:Boolean,default:!1}},mixins:[z0,v0],watch:{formData:{handler(){const e=this.getExtensionElementsEq("flowable:Field");e&&e.length>0&&e.forEach(t=>{this.http[t.name]=t.string||t.expression})},deep:!0,immediate:!0}},data(){return{http:{}}},methods:{handleChange(e,t){let n="string",A="expression";(t.includes("${")||t.includes("#{"))&&(n="expression",A="string");const i=this.getExtensionElementsEq("flowable:Field");let o=i.find(a=>a.name==e);o?(o[n]=t,o[A]=void 0):(o={[n]:t,name:e},i.push(o));const r=[];i.forEach(a=>{const{name:c,string:l,expression:B}=a;r.push({name:c,[l?"string":"expression"]:l||B})}),this.setExtensionElements("flowable:Field",r)}}};function Fw(e,t,n,A,i,o){const r=s.resolveComponent("el-option"),a=s.resolveComponent("el-select"),c=s.resolveComponent("el-form-item"),l=s.resolveComponent("el-input"),B=s.resolveComponent("el-switch");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(c,{label:"请求方法",prop:"requestMethod"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.http.requestMethod,"onUpdate:modelValue":t[0]||(t[0]=g=>i.http.requestMethod=g),placeholder:"请求方法",clearable:"",onChange:t[1]||(t[1]=g=>o.handleChange("requestMethod",g))},{default:s.withCtx(()=>[s.createVNode(r,{label:"GET",value:"GET"}),s.createVNode(r,{label:"POST",value:"POST"}),s.createVNode(r,{label:"PUT",value:"PUT"}),s.createVNode(r,{label:"DELETE",value:"DELETE"})]),_:1},8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"请求URL",prop:"requestUrl"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.requestUrl,"onUpdate:modelValue":t[2]||(t[2]=g=>i.http.requestUrl=g),type:"textarea",placeholder:"请求URL",autosize:"",clearable:"",onChange:t[3]||(t[3]=g=>o.handleChange("requestUrl",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"请求头",prop:"requestHeaders"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.requestHeaders,"onUpdate:modelValue":t[4]||(t[4]=g=>i.http.requestHeaders=g),type:"textarea",placeholder:"请求头,多条请换行",autosize:"",clearable:"",onChange:t[5]||(t[5]=g=>o.handleChange("requestHeaders",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"请求体",prop:"requestBody"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.requestBody,"onUpdate:modelValue":t[6]||(t[6]=g=>i.http.requestBody=g),type:"textarea",placeholder:`{
38
38
  name: \${name},
39
39
  age: \${age}
40
- }`,autosize:"",clearable:"",onChange:t[7]||(t[7]=g=>o.handleChange("requestBody",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"请求体编码",prop:"requestBodyEncoding","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.requestBodyEncoding,"onUpdate:modelValue":t[8]||(t[8]=g=>i.http.requestBodyEncoding=g),placeholder:"请求体编码",autosize:"",clearable:"",onChange:t[9]||(t[9]=g=>o.handleChange("requestBodyEncoding",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"超时时间"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.requestTimeout,"onUpdate:modelValue":t[10]||(t[10]=g=>i.http.requestTimeout=g),placeholder:"超时时间,单位毫秒",clearable:"",onChange:t[11]||(t[11]=g=>o.handleChange("requestTimeout",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"禁用重定向","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.disallowRedirects,"onUpdate:modelValue":t[12]||(t[12]=g=>i.http.disallowRedirects=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[13]||(t[13]=g=>o.handleChange("disallowRedirects",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"错误状态码","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.failStatusCodes,"onUpdate:modelValue":t[14]||(t[14]=g=>i.http.failStatusCodes=g),type:"textarea",placeholder:"逗号分隔的Http状态码,将令请求失败并抛出FlowableException",autosize:"",onChange:t[15]||(t[15]=g=>o.handleChange("failStatusCodes",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"捕获状态码","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.handleStatusCodes,"onUpdate:modelValue":t[16]||(t[16]=g=>i.http.handleStatusCodes=g),type:"textarea",placeholder:"逗号分隔的Http状态码,将令任务抛出BpmnError,并可用错误边界事件捕获",autosize:"",onChange:t[17]||(t[17]=g=>o.handleChange("handleStatusCodes",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"忽略异常","label-width":"160px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.ignoreException,"onUpdate:modelValue":t[18]||(t[18]=g=>i.http.ignoreException=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[19]||(t[19]=g=>o.handleChange("ignoreException",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"保存请求变量","label-width":"160px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.saveRequestVariables,"onUpdate:modelValue":t[20]||(t[20]=g=>i.http.saveRequestVariables=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[21]||(t[21]=g=>o.handleChange("saveRequestVariables",g))},null,8,["disabled","modelValue"]),t[30]||(t[30]=s.createElementVNode("h5",null,"默认只会保存响应相关的变量。",-1))]),_:1,__:[30]}),s.createVNode(c,{label:"保存全部的响应变量","label-width":"160px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.saveResponseParameters,"onUpdate:modelValue":t[22]||(t[22]=g=>i.http.saveResponseParameters=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[23]||(t[23]=g=>o.handleChange("saveResponseParameters",g))},null,8,["disabled","modelValue"]),t[31]||(t[31]=s.createElementVNode("h5",null,"包括HTTP状态码,响应头等。默认只会将响应体保存为变量。",-1))]),_:1,__:[31]}),s.createVNode(c,{label:"变量名前缀","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.resultVariablePrefix,"onUpdate:modelValue":t[24]||(t[24]=g=>i.http.resultVariablePrefix=g),placeholder:"默认变量名为<taskId>.fieldName",clearable:"",onChange:t[25]||(t[25]=g=>o.handleChange("resultVariablePrefix",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"瞬时变量","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.saveResponseParametersTransient,"onUpdate:modelValue":t[26]||(t[26]=g=>i.http.saveResponseParametersTransient=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[27]||(t[27]=g=>o.handleChange("saveResponseParametersTransient",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"JSON格式","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.saveResponseVariableAsJson,"onUpdate:modelValue":t[28]||(t[28]=g=>i.http.saveResponseVariableAsJson=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[29]||(t[29]=g=>o.handleChange("saveResponseVariableAsJson",g))},null,8,["disabled","modelValue"])]),_:1})])}const Cw=F0(mw,[["render",fw]]),Mw={name:"shell",props:{disabled:{type:Boolean,default:!1}},mixins:[z0,v0],watch:{formData:{handler(){const e=this.getExtensionElementsEq("flowable:Field");e&&e.length>0&&e.forEach(t=>{this.shell[t.name]=t.string||t.expression})},deep:!0,immediate:!0}},data(){return{shell:{}}},methods:{handleChange(e,t){let{pattern:n}=this.scriptOption;if(n&&(n=new RegExp(n)),n&&e=="command"&&n.test(t)){this.$message.error("危险命令"),this.shell={},this.setExtensionElements("flowable:Field",[]);return}let A="string",i="expression";(t.includes("${")||t.includes("#{"))&&(A="expression",i="string");const o=this.getExtensionElementsEq("flowable:Field");let r=o.find(c=>c.name==e);r?(r[A]=t,r[i]=void 0):(r={[A]:t,name:e},o.push(r));const a=[];o.forEach(c=>{const{name:l,string:B,expression:g}=c;a.push({name:l,[B?"string":"expression"]:B||g})}),this.setExtensionElements("flowable:Field",a)}}},Dw=["innerHTML"],yw={key:0};function Iw(e,t,n,A,i,o){const r=s.resolveComponent("el-alert"),a=s.resolveComponent("el-input"),c=s.resolveComponent("el-form-item");return s.openBlock(),s.createElementBlock("div",null,[e.scriptOption&&e.scriptOption.alert?(s.openBlock(),s.createBlock(r,{key:0,style:{"margin-bottom":"10px"},type:"warning",closable:!1},{title:s.withCtx(()=>[s.createElementVNode("span",{innerHTML:e.scriptOption.alert},null,8,Dw)]),_:1})):s.createCommentVNode("",!0),e.scriptOption&&e.scriptOption.enable?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[i.shell.command?(s.openBlock(),s.createBlock(r,{key:0,style:{"margin-bottom":"10px"},type:"success",closable:!1},{title:s.withCtx(()=>[i.shell.directory?(s.openBlock(),s.createElementBlock("span",yw,"cd "+s.toDisplayString(i.shell.directory),1)):s.createCommentVNode("",!0)]),default:s.withCtx(()=>[s.createTextVNode(" "+s.toDisplayString(i.shell.command)+" "+s.toDisplayString(i.shell.arg0)+" "+s.toDisplayString(i.shell.arg1)+" "+s.toDisplayString(i.shell.arg2)+" "+s.toDisplayString(i.shell.arg3)+" "+s.toDisplayString(i.shell.arg4)+" "+s.toDisplayString(i.shell.arg5),1)]),_:1})):s.createCommentVNode("",!0),s.createVNode(c,{label:"命令",prop:"command"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.command,"onUpdate:modelValue":t[0]||(t[0]=l=>i.shell.command=l),placeholder:"命令",autosize:"",clearable:"",onChange:t[1]||(t[1]=l=>o.handleChange("command",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数0",prop:"arg0"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg0,"onUpdate:modelValue":t[2]||(t[2]=l=>i.shell.arg0=l),placeholder:"参数0",clearable:"",onChange:t[3]||(t[3]=l=>o.handleChange("arg0",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数1",prop:"arg1"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg1,"onUpdate:modelValue":t[4]||(t[4]=l=>i.shell.arg1=l),placeholder:"参数1",clearable:"",onChange:t[5]||(t[5]=l=>o.handleChange("arg1",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数2",prop:"arg2"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg2,"onUpdate:modelValue":t[6]||(t[6]=l=>i.shell.arg2=l),placeholder:"参数2",clearable:"",onChange:t[7]||(t[7]=l=>o.handleChange("arg2",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数3",prop:"arg3"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg3,"onUpdate:modelValue":t[8]||(t[8]=l=>i.shell.arg3=l),placeholder:"参数3",clearable:"",onChange:t[9]||(t[9]=l=>o.handleChange("arg3",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数4",prop:"arg4"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg4,"onUpdate:modelValue":t[10]||(t[10]=l=>i.shell.arg4=l),placeholder:"参数4",clearable:"",onChange:t[11]||(t[11]=l=>o.handleChange("arg4",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数5",prop:"arg5"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg5,"onUpdate:modelValue":t[12]||(t[12]=l=>i.shell.arg5=l),placeholder:"参数5",clearable:"",onChange:t[13]||(t[13]=l=>o.handleChange("arg5",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"输出变量",prop:"outputVariable"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.outputVariable,"onUpdate:modelValue":t[14]||(t[14]=l=>i.shell.outputVariable=l),placeholder:"输出变量",clearable:"",onChange:t[15]||(t[15]=l=>o.handleChange("outputVariable",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"错误变量",prop:"errorCodeVariable"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.errorCodeVariable,"onUpdate:modelValue":t[16]||(t[16]=l=>i.shell.errorCodeVariable=l),placeholder:"错误变量",clearable:"",onChange:t[17]||(t[17]=l=>o.handleChange("errorCodeVariable",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"初始目录",prop:"directory"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.directory,"onUpdate:modelValue":t[18]||(t[18]=l=>i.shell.directory=l),placeholder:"初始目录",clearable:"",onChange:t[19]||(t[19]=l=>o.handleChange("directory",l))},null,8,["disabled","modelValue"])]),_:1})],64)):s.createCommentVNode("",!0)])}const Fw=F0(Mw,[["render",Iw]]),vw={name:"mail",props:{disabled:{type:Boolean,default:!1}},mixins:[z0,v0],watch:{formData:{handler(){const e=this.getExtensionElementsEq("flowable:Field");e&&e.length>0&&e.forEach(t=>{this.mail[t.name]=t.string||t.expression})},deep:!0,immediate:!0}},data(){return{mail:{}}},methods:{handleChange(e,t){let n="string",A="expression";(t.includes("${")||t.includes("#{"))&&(n="expression",A="string");const i=this.getExtensionElementsEq("flowable:Field");let o=i.find(a=>a.name==e);o?(o[n]=t,o[A]=void 0):(o={[n]:t,name:e},i.push(o));const r=[];i.forEach(a=>{const{name:c,string:l,expression:B}=a;r.push({name:c,[l?"string":"expression"]:l||B})}),this.setExtensionElements("flowable:Field",r)}}};function xw(e,t,n,A,i,o){const r=s.resolveComponent("el-alert"),a=s.resolveComponent("el-input"),c=s.resolveComponent("el-form-item");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(r,{style:{"margin-bottom":"10px"},type:"warning",title:"使用前请先参照文档配置邮件服务器!!!",closable:!1}),s.createVNode(c,{label:"收信人"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.to,"onUpdate:modelValue":t[0]||(t[0]=l=>i.mail.to=l),placeholder:"收信人,多个逗号分隔",type:"textarea",autosize:"",clearable:"",onChange:t[1]||(t[1]=l=>o.handleChange("to",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"发信人"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.from,"onUpdate:modelValue":t[2]||(t[2]=l=>i.mail.from=l),placeholder:"发信人,不设置使用默认发信人",clearable:"",onChange:t[3]||(t[3]=l=>o.handleChange("from",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"主题"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.subject,"onUpdate:modelValue":t[4]||(t[4]=l=>i.mail.subject=l),placeholder:"主题",type:"textarea",autosize:"",onChange:t[5]||(t[5]=l=>o.handleChange("subject",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"抄送人"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.cc,"onUpdate:modelValue":t[6]||(t[6]=l=>i.mail.cc=l),placeholder:"抄送人,多个逗号分隔",type:"textarea",autosize:"",onChange:t[7]||(t[7]=l=>o.handleChange("cc",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"密送人"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.bcc,"onUpdate:modelValue":t[8]||(t[8]=l=>i.mail.bcc=l),placeholder:"密送人,多个逗号分隔",type:"textarea",autosize:"",onChange:t[9]||(t[9]=l=>o.handleChange("bcc",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"字符集"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.charset,"onUpdate:modelValue":t[10]||(t[10]=l=>i.mail.charset=l),placeholder:"字符集",clearable:"",onChange:t[11]||(t[11]=l=>o.handleChange("charset",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"html"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.html,"onUpdate:modelValue":t[12]||(t[12]=l=>i.mail.html=l),placeholder:"html",type:"textarea",autosize:"",onChange:t[13]||(t[13]=l=>o.handleChange("html",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"text"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.text,"onUpdate:modelValue":t[14]||(t[14]=l=>i.mail.text=l),placeholder:"text",type:"textarea",autosize:"",onChange:t[15]||(t[15]=l=>o.handleChange("text",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"html变量"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.htmlVar,"onUpdate:modelValue":t[16]||(t[16]=l=>i.mail.htmlVar=l),placeholder:"html变量名",clearable:"",onChange:t[17]||(t[17]=l=>o.handleChange("htmlVar",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"text变量"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.textVar,"onUpdate:modelValue":t[18]||(t[18]=l=>i.mail.textVar=l),placeholder:"text变量名",clearable:"",onChange:t[19]||(t[19]=l=>o.handleChange("textVar",l))},null,8,["disabled","modelValue"])]),_:1})])}const bw={name:"service",props:{disabled:{type:Boolean,default:!1}},mixins:[z0,v0],components:{NfJavaService:ww,NfHttpService:Cw,NfShellService:Fw,NfMailService:F0(vw,[["render",xw]])},watch:{formData:{handler(e){const{delegateExpression:t,expression:n}=e,A=e.type,i=e.class;A?this.service.type=A:i?this.service.class="clazz":t?this.service.type="delegateExpression":n&&(this.service.type="expression")},deep:!0,immediate:!0}},data(){return{service:{}}},methods:{handleTypeChange(e){this.service.type=e,["http","shell","mail"].includes(e)&&this.updateProperties({type:e,class:void 0,delegateExpression:void 0,expression:void 0});const t=this.getExtensionElementsNotEq("flowable:Field");this.updateProperties({extensionElements:this.modeler.get("bpmnFactory").create("bpmn:ExtensionElements",{values:t})})}}};function Yw(e,t,n,A,i,o){const r=s.resolveComponent("el-option"),a=s.resolveComponent("el-select"),c=s.resolveComponent("el-form-item"),l=s.resolveComponent("nf-java-service"),B=s.resolveComponent("nf-http-service"),g=s.resolveComponent("nf-shell-service"),p=s.resolveComponent("nf-mail-service"),E=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(E,{model:i.service,"label-position":e.labelPosition,"label-suffix":":","label-width":"90px",size:"default"},{default:s.withCtx(()=>[s.createVNode(c,{label:e.t("nf.panel.node.service.type"),prop:"type"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.service.type,"onUpdate:modelValue":t[0]||(t[0]=d=>i.service.type=d),onChange:o.handleTypeChange,placeholder:e.t("nf.panel.node.service.type")},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.t("nf.panel.node.service.typeOption"),d=>(s.openBlock(),s.createBlock(r,{key:d.label,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["disabled","modelValue","onChange","placeholder"])]),_:1},8,["label"]),["class","delegateExpression","expression"].includes(i.service.type)?(s.openBlock(),s.createBlock(l,{key:0,disabled:n.disabled,modeler:e.modeler,element:e.element,"java-type":i.service.type},null,8,["disabled","modeler","element","java-type"])):s.createCommentVNode("",!0),["http"].includes(i.service.type)?(s.openBlock(),s.createBlock(B,{key:1,disabled:n.disabled,modeler:e.modeler,element:e.element},null,8,["disabled","modeler","element"])):s.createCommentVNode("",!0),["shell"].includes(i.service.type)?(s.openBlock(),s.createBlock(g,{key:2,disabled:n.disabled,modeler:e.modeler,element:e.element,"script-option":e.scriptOption},null,8,["disabled","modeler","element","script-option"])):s.createCommentVNode("",!0),["mail"].includes(i.service.type)?(s.openBlock(),s.createBlock(p,{key:3,disabled:n.disabled,modeler:e.modeler,element:e.element},null,8,["disabled","modeler","element"])):s.createCommentVNode("",!0)]),_:1},8,["model","label-position"])}const Uw=F0(bw,[["render",Yw]]),Nw={name:"nf-script",mixins:[z0,v0],watch:{formData:{handler(){this.updateProperties({extensionElements:this.modeler.get("bpmnFactory").create("bpmn:ExtensionElements",{values:void 0})})},deep:!0,immediate:!0}}},zw=["innerHTML"];function Rw(e,t,n,A,i,o){const r=s.resolveComponent("el-alert"),a=s.resolveComponent("el-input"),c=s.resolveComponent("el-form-item"),l=s.resolveComponent("el-form");return s.openBlock(),s.createElementBlock("div",null,[e.scriptOption&&e.scriptOption.alert?(s.openBlock(),s.createBlock(r,{key:0,style:{"margin-bottom":"10px"},type:"warning",closable:!1},{title:s.withCtx(()=>[s.createElementVNode("span",{innerHTML:e.scriptOption.alert},null,8,zw)]),_:1})):s.createCommentVNode("",!0),e.scriptOption&&e.scriptOption.enable?(s.openBlock(),s.createBlock(l,{key:1,"label-position":e.labelPosition,"label-suffix":":","label-width":"90px",size:"default"},{default:s.withCtx(()=>[s.createVNode(c,{label:"类型"},{default:s.withCtx(()=>[s.createVNode(a,{modelValue:e.formData.scriptFormat,"onUpdate:modelValue":t[0]||(t[0]=B=>e.formData.scriptFormat=B),placeholder:"类型",autosize:"",clearable:"",onInput:t[1]||(t[1]=B=>e.updateProperties({scriptFormat:e.formData.scriptFormat||void 0}))},null,8,["modelValue"])]),_:1}),s.createVNode(c,{label:"脚本"},{default:s.withCtx(()=>[s.createVNode(a,{modelValue:e.formData.script,"onUpdate:modelValue":t[2]||(t[2]=B=>e.formData.script=B),type:"textarea",placeholder:"脚本",autosize:"",onInput:t[3]||(t[3]=B=>e.updateProperties({script:e.formData.script||void 0}))},null,8,["modelValue"])]),_:1}),s.createVNode(c,{label:"结果变量"},{default:s.withCtx(()=>[s.createVNode(a,{modelValue:e.formData.resultVariable,"onUpdate:modelValue":t[4]||(t[4]=B=>e.formData.resultVariable=B),placeholder:"结果变量",autosize:"",clearable:"",onInput:t[5]||(t[5]=B=>e.updateProperties({resultVariable:e.formData.resultVariable||void 0}))},null,8,["modelValue"])]),_:1})]),_:1},8,["label-position"])):s.createCommentVNode("",!0)])}const Sw={name:"node-panel",mixins:[z0,v0],components:{NfBasic:gh,NfAssignee:wh,NfListener:yh,NfExtendedProperty:vh,NfMultiInstance:Uh,NfFormConfig:Rh,NfButton:kh,NfCondition:Ph,NfEvent:pw,NfCall:uw,NfService:Uw,NfScript:F0(Nw,[["render",Rw]])},mounted(){},computed:{type(){return this.element.customType||this.element.type}},data(){return{activeName:["1"]}},methods:{changeCollapse(e){e=="close"?this.activeName=[]:this.activeName=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","99"]}}};function Tw(e,t,n,A,i,o){const r=s.resolveComponent("el-icon-info-filled"),a=s.resolveComponent("el-icon"),c=s.resolveComponent("nf-basic"),l=s.resolveComponent("el-collapse-item"),B=s.resolveComponent("el-icon-comment"),g=s.resolveComponent("nf-form-config"),p=s.resolveComponent("el-icon-user-filled"),E=s.resolveComponent("nf-assignee"),d=s.resolveComponent("el-icon-histogram"),u=s.resolveComponent("nf-multi-instance"),h=s.resolveComponent("el-icon-warning-filled"),D=s.resolveComponent("nf-listener"),y=s.resolveComponent("nf-extended-property"),C=s.resolveComponent("el-icon-help-filled"),m=s.resolveComponent("nf-button"),I=s.resolveComponent("el-icon-promotion"),x=s.resolveComponent("nf-condition"),v=s.resolveComponent("el-icon-wallet-filled"),F=s.resolveComponent("nf-event"),z=s.resolveComponent("nf-call"),R=s.resolveComponent("nf-service"),k=s.resolveComponent("nf-script"),T=s.resolveComponent("el-icon-question-filled"),H=s.resolveComponent("el-collapse");return s.openBlock(),s.createBlock(H,{modelValue:i.activeName,"onUpdate:modelValue":t[0]||(t[0]=K=>i.activeName=K)},{default:s.withCtx(()=>[s.createVNode(l,{name:"1"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.basic.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1})]),default:s.withCtx(()=>[s.createVNode(c,{modeler:e.modeler,element:e.element,nodes:e.backNodes},null,8,["modeler","element","nodes"])]),_:1}),o.type=="bpmn:StartEvent"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[e.getEventDefinitions(null)?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(l,{key:0,name:"5"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.form.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(B)]),_:1})]),default:s.withCtx(()=>[s.createVNode(g,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"form-option":e.formOption,"ex-form-option":e.exFormOption,"indep-form-option":e.indepFormOption},null,8,["modeler","element","user-option","form-option","ex-form-option","indep-form-option"])]),_:1}))],64)):s.createCommentVNode("",!0),o.type=="bpmn:UserTask"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(l,{name:"2"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.assignee.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(p)]),_:1})]),default:s.withCtx(()=>[s.createVNode(E,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"group-option":e.groupOption},null,8,["modeler","element","user-option","group-option"])]),_:1}),s.createVNode(l,{name:"3"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.multiInstance.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),default:s.withCtx(()=>[s.createVNode(u,{type:"UserTask",modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1}),s.createVNode(l,{name:"4"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.listener.taskTitle")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(h)]),_:1})]),default:s.withCtx(()=>[s.createVNode(D,{type:"Task",modeler:e.modeler,element:e.element,"listener-option":e.listenerOption},null,8,["modeler","element","listener-option"])]),_:1}),s.createVNode(l,{name:"41"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.extendedProperty.taskTitle")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(h)]),_:1})]),default:s.withCtx(()=>[s.createVNode(y,{type:"ExtendedProperty",modeler:e.modeler,element:e.element,"listener-option":e.extendedPropertyOption},null,8,["modeler","element","listener-option"])]),_:1}),s.createVNode(l,{name:"5"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.form.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(B)]),_:1})]),default:s.withCtx(()=>[s.createVNode(g,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"form-option":e.formOption,"ex-form-option":e.exFormOption,"indep-form-option":e.indepFormOption,nodes:e.backNodes},null,8,["modeler","element","user-option","form-option","ex-form-option","indep-form-option","nodes"])]),_:1}),e.buttonOption&&e.buttonOption.length>0?(s.openBlock(),s.createBlock(l,{key:0,name:"6"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.button.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(C)]),_:1})]),default:s.withCtx(()=>[s.createVNode(m,{modeler:e.modeler,element:e.element,"button-option":e.buttonOption},null,8,["modeler","element","button-option"])]),_:1})):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0),o.type=="bpmn:SequenceFlow"?(s.openBlock(),s.createBlock(l,{key:2,name:"2"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.condition.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(I)]),_:1})]),default:s.withCtx(()=>[s.createVNode(x,{modeler:e.modeler,element:e.element,"condition-option":e.conditionOption},null,8,["modeler","element","condition-option"])]),_:1})):s.createCommentVNode("",!0),o.type=="bpmn:SubProcess"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:3},[s.createVNode(l,{name:"2"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.assignee.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(p)]),_:1})]),default:s.withCtx(()=>[s.createVNode(E,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"group-option":e.groupOption},null,8,["modeler","element","user-option","group-option"])]),_:1}),s.createVNode(l,{name:"3"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.multiInstance.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),default:s.withCtx(()=>[s.createVNode(u,{type:"SubProcess",modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1})],64)):s.createCommentVNode("",!0),["bpmn:StartEvent","bpmn:EndEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:BoundaryEvent"].includes(o.type)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:4},[e.getEventDefinitions(null)?(s.openBlock(),s.createBlock(l,{key:0,name:"7"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.event.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(v)]),_:1})]),default:s.withCtx(()=>[s.createVNode(F,{modeler:e.modeler,element:e.element,nodes:e.nodes},null,8,["modeler","element","nodes"])]),_:1})):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0),["bpmn:CallActivity"].includes(o.type)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:5},[s.createVNode(l,{name:"8"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.call.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(v)]),_:1})]),default:s.withCtx(()=>[s.createVNode(z,{modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1}),s.createVNode(l,{name:"2"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.assignee.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(p)]),_:1})]),default:s.withCtx(()=>[s.createVNode(E,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"group-option":e.groupOption},null,8,["modeler","element","user-option","group-option"])]),_:1}),s.createVNode(l,{name:"3"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.multiInstance.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),default:s.withCtx(()=>[s.createVNode(u,{type:"SubProcess",modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1})],64)):s.createCommentVNode("",!0),["bpmn:ServiceTask","抄送任务"].includes(o.type)?(s.openBlock(),s.createBlock(l,{key:6,name:"9"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.service.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(v)]),_:1})]),default:s.withCtx(()=>[s.createVNode(R,{disabled:["抄送任务"].includes(o.type),modeler:e.modeler,element:e.element,"script-option":e.scriptOption?e.scriptOption.shell:null},null,8,["disabled","modeler","element","script-option"])]),_:1})):s.createCommentVNode("",!0),["bpmn:ScriptTask"].includes(o.type)?(s.openBlock(),s.createBlock(l,{key:7,name:"10"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.script.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(v)]),_:1})]),default:s.withCtx(()=>[s.createVNode(k,{modeler:e.modeler,element:e.element,"script-option":e.scriptOption?e.scriptOption.script:null},null,8,["modeler","element","script-option"])]),_:1})):s.createCommentVNode("",!0),["抄送任务"].includes(o.type)?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(l,{key:8,name:"99"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.listener.executionTitle")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(T)]),_:1})]),default:s.withCtx(()=>[s.createVNode(D,{type:"Execution",modeler:e.modeler,element:e.element,"listener-option":e.listenerOption},null,8,["modeler","element","listener-option"])]),_:1})),o.type=="抄送任务"?(s.openBlock(),s.createBlock(l,{key:9,name:"100"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.assignee.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(p)]),_:1})]),default:s.withCtx(()=>[s.createVNode(E,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"group-option":e.groupOption},null,8,["modeler","element","user-option","group-option"])]),_:1})):s.createCommentVNode("",!0)]),_:1},8,["modelValue"])}const kw=F0(Sw,[["render",Tw]]),Gw={name:"nf-basic",mixins:[z0,v0]};function Hw(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-divider"),l=s.resolveComponent("el-switch"),B=s.resolveComponent("el-option"),g=s.resolveComponent("el-select"),p=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(p,{model:e.formData,"label-position":e.labelPosition,"label-width":"110px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{label:e.t("nf.panel.process.basic.key")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.id,"onUpdate:modelValue":t[0]||(t[0]=E=>e.formData.id=E),clearable:"",placeholder:e.t("nf.panel.process.basic.key"),onInput:t[1]||(t[1]=E=>e.updateProperties({id:e.formData.id}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.process.basic.name")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.name,"onUpdate:modelValue":t[2]||(t[2]=E=>e.formData.name=E),clearable:"",placeholder:e.t("nf.panel.process.basic.name"),onInput:t[3]||(t[3]=E=>e.updateProperties({name:e.formData.name}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.process.basic.description")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.description,"onUpdate:modelValue":t[4]||(t[4]=E=>e.formData.description=E),placeholder:e.t("nf.panel.process.basic.description"),clearable:"",onInput:e.updateDocumentation},null,8,["modelValue","placeholder","onInput"])]),_:1},8,["label"]),s.createVNode(c),s.createVNode(a,{label:e.t("nf.panel.process.basic.skipFirstNode"),"label-width":"120px"},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:e.formData.skipFirstNode,"onUpdate:modelValue":t[5]||(t[5]=E=>e.formData.skipFirstNode=E),onChange:t[6]||(t[6]=E=>e.updateProperties({skipFirstNode:e.formData.skipFirstNode||void 0}))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.process.basic.skipWhenStartUser"),"label-width":"210px"},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:e.formData.skipWhenStartUser,"onUpdate:modelValue":t[7]||(t[7]=E=>e.formData.skipWhenStartUser=E),onChange:t[8]||(t[8]=E=>e.updateProperties({skipWhenStartUser:e.formData.skipWhenStartUser||void 0}))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.process.basic.skipWhenAssignee"),"label-width":"210px"},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:e.formData.skipWhenAssignee,"onUpdate:modelValue":t[9]||(t[9]=E=>e.formData.skipWhenAssignee=E),onChange:t[10]||(t[10]=E=>e.updateProperties({skipWhenAssignee:e.formData.skipWhenAssignee||void 0}))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.process.basic.rollbackNode.label"),"label-width":"120px"},{default:s.withCtx(()=>[s.createVNode(g,{modelValue:e.formData.rollbackNode,"onUpdate:modelValue":t[11]||(t[11]=E=>e.formData.rollbackNode=E),clearable:"",placeholder:e.t("nf.panel.process.basic.rollbackNode.placeholder"),onChange:t[12]||(t[12]=E=>e.updateProperties({rollbackNode:e.formData.rollbackNode||void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.nodes,E=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[["bpmn:UserTask","bpmn:StartEvent"].includes(E.nodeType)?(s.openBlock(),s.createBlock(B,{key:E.id,label:E.name,value:E.id},null,8,["label","value"])):s.createCommentVNode("",!0)],64))),256))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const Pw=F0(Gw,[["render",Hw]]),Jw={name:"nf-basic",mixins:[z0,v0],watch:{formData:{handler(e){const t=this.getExtensionElementsEq(this.extensionType);t.length>0&&(this.serial=t[0])},deep:!0,immediate:!0},visible(e){e&&(this.option={labelWidth:110,labelPosition:this.labelPosition,column:[{label:this.t("nf.panel.process.sn.useExistSN"),prop:"useExistSN",labelWidth:150,labelTip:this.t("nf.panel.process.sn.useExistSNTip"),span:24,type:"switch",value:!1,rules:[{required:!0,trigger:"blur"}],change:({value:t})=>{const n=this.findObject(this.option.column,"dateFormat"),A=this.findObject(this.option.column,"suffixLength"),i=this.findObject(this.option.column,"startSequence"),o=this.findObject(this.option.column,"connector"),r=this.findObject(this.option.column,"cycle");t?(n.display=!1,A.display=!1,i.display=!1,o.display=!1,r.display=!1):(n.display=!0,A.display=!0,i.display=!0,o.display=!0,r.display=!0)}},{label:this.t("nf.panel.process.sn.name"),prop:"name",span:24,rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.name")}`}]},{label:this.t("nf.panel.process.sn.prefix"),prop:"prefix",span:24,rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.prefix")}`}]},{label:this.t("nf.panel.process.sn.dateFormat"),prop:"dateFormat",span:24,value:"yyyyMMdd",rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.dateFormat")}`}]},{label:this.t("nf.panel.process.sn.suffixLength"),prop:"suffixLength",type:"number",span:24,min:2,max:10,value:5,event:{change:t=>{if(!t)return;let n="";for(let i=0;i<t;i++)n+="9";const A=this.findObject(this.option.column,"startSequence");A&&A!=-1&&(A.maxRows=Number(n)),this.serial.startSequence>Number(n)&&(this.serial.startSequence=Number(n))}},rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.suffixLength")}`}]},{label:this.t("nf.panel.process.sn.initialValue"),prop:"startSequence",type:"number",span:24,min:0,value:0,rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.initialValue")}`}]},{label:this.t("nf.panel.process.sn.connector"),prop:"connector",span:24},{label:this.t("nf.panel.process.sn.resetCycle.label"),prop:"cycle",type:"select",span:24,dicData:this.t("nf.panel.process.sn.resetCycle.dicData"),value:"none",rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.resetCycle")}`}]}]})}},data(){return{extensionType:"flowable:Serial",visible:!1,serial:{},option:{}}},methods:{handleSerialSubmit(e,t){const n=this.deepClone(this.serial);for(let A in n)A.startsWith("$")&&delete n[A];this.setExtensionElements(this.extensionType,[n]),t(),this.visible=!1}}},jw={key:0,style:{"margin-top":"10px"},class:"el-form-item"},Vw={class:"el-form-item__label",style:{width:"100px","text-align":"left"}},Lw={key:0,class:"el-form-item__content"},Ww={key:1,class:"el-form-item__content"};function _w(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("nf-form"),c=s.resolveComponent("el-drawer");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(r,{type:"primary",size:"default",onClick:t[0]||(t[0]=l=>i.visible=!0)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.process.sn.configure")),1)]),_:1}),i.serial&&i.serial.prefix&&i.serial.dateFormat&&i.serial.suffixLength?(s.openBlock(),s.createElementBlock("div",jw,[s.createElementVNode("label",Vw,s.toDisplayString(e.t("nf.panel.process.sn.format"))+": ",1),i.serial&&i.serial.useExistSN?(s.openBlock(),s.createElementBlock("div",Lw,s.toDisplayString(e.t("nf.panel.process.sn.useExistSN"))+":"+s.toDisplayString(i.serial.name),1)):i.serial&&i.serial.prefix&&i.serial.dateFormat&&i.serial.suffixLength?(s.openBlock(),s.createElementBlock("div",Ww,s.toDisplayString(i.serial.prefix)+s.toDisplayString(i.serial.connector)+s.toDisplayString(i.serial.dateFormat)+s.toDisplayString(i.serial.connector)+s.toDisplayString((i.serial.start?i.serial.start.toString():"1").padStart(i.serial.suffixLength,"0")),1)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),s.createVNode(c,{modelValue:i.visible,"onUpdate:modelValue":t[2]||(t[2]=l=>i.visible=l),title:e.t("nf.panel.process.sn.label"),size:"50%","append-to-body":""},{default:s.withCtx(()=>[i.visible?(s.openBlock(),s.createBlock(a,{key:0,modelValue:i.serial,"onUpdate:modelValue":t[1]||(t[1]=l=>i.serial=l),option:i.option,onSubmit:o.handleSerialSubmit},null,8,["modelValue","option","onSubmit"])):s.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}const Ow=F0(Jw,[["render",_w]]),Xw={name:"nf-title",mixins:[z0,v0]};function Kw(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("el-alert");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(r,{modelValue:e.formData.title,"onUpdate:modelValue":t[0]||(t[0]=c=>e.formData.title=c),type:"textarea",clearable:"",autosize:"",placeholder:"流程标题,默认值${#processDefName}",onInput:t[1]||(t[1]=c=>e.updateProperties({title:e.formData.title}))},null,8,["modelValue"]),t[5]||(t[5]=s.createElementVNode("p",null,"${#processDefId}: 流程部署id",-1)),t[6]||(t[6]=s.createElementVNode("p",null,"${#processDefName}: 流程部署名称",-1)),t[7]||(t[7]=s.createElementVNode("p",null,"${#processDefKey}: 流程部署key",-1)),t[8]||(t[8]=s.createElementVNode("p",null,"${#applyUser}: 发起人id",-1)),t[9]||(t[9]=s.createElementVNode("p",null,"${#applyUserName}: 发起人姓名",-1)),t[10]||(t[10]=s.createElementVNode("p",null,"${#dateFormat('yyMMddHHmm')}: 时间日期格式化",-1)),t[11]||(t[11]=s.createElementVNode("p",null,"${#xx}: xx为表单字段prop,请确保发起时存在",-1)),s.createVNode(a,{class:"alert",title:"SpEL表达式,使用${}包裹,被包裹的表达式才会被解析,防止+-*/等被认作运算符。需解析的变量、方法以#开头。",type:"error",closable:!1}),t[12]||(t[12]=s.createElementVNode("p",null,null,-1)),t[13]||(t[13]=s.createElementVNode("p",null,"流程回调地址:",-1)),s.createVNode(r,{modelValue:e.formData.callBack,"onUpdate:modelValue":t[2]||(t[2]=c=>e.formData.callBack=c),type:"textarea",clearable:"",autosize:"",placeholder:"测试值,默认值${#processDefName}",onInput:t[3]||(t[3]=c=>e.updateProperties({callBack:e.formData.callBack}))},null,8,["modelValue"]),s.createVNode(a,{class:"alert",type:"success",closable:!1},{title:s.withCtx(()=>t[4]||(t[4]=[s.createElementVNode("span",null," 例:【${#processDefName} - ${#applyUserName} - ${#dateFormat('yyMMddHHmm')}】会被解析为 ",-1),s.createElementVNode("br",null,null,-1),s.createElementVNode("span",null,"【流程名称 - 发起人 - 2312311200】",-1)])),_:1})],64)}const Zw={name:"process",mixins:[z0,v0],components:{NfBasic:Pw,NfSerial:Ow,NfTitle:F0(Xw,[["render",Kw],["__scopeId","data-v-2f0d4156"]])},data(){return{activeName:["1","2","3","99"]}}};function qw(e,t,n,A,i,o){const r=s.resolveComponent("el-icon-info-filled"),a=s.resolveComponent("el-icon"),c=s.resolveComponent("nf-basic"),l=s.resolveComponent("el-collapse-item"),B=s.resolveComponent("el-icon-warning-filled"),g=s.resolveComponent("nf-serial"),p=s.resolveComponent("nf-title"),E=s.resolveComponent("el-collapse");return s.openBlock(),s.createBlock(E,{modelValue:i.activeName,"onUpdate:modelValue":t[0]||(t[0]=d=>i.activeName=d)},{default:s.withCtx(()=>[s.createVNode(l,{name:"1"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.process.basic.label")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1})]),default:s.withCtx(()=>[s.createVNode(c,{modeler:e.modeler,element:e.element,nodes:e.nodes},null,8,["modeler","element","nodes"])]),_:1}),s.createVNode(l,{name:"2"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.process.sn.label")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(B)]),_:1})]),default:s.withCtx(()=>[s.createVNode(g,{modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1}),s.createVNode(l,{name:"3"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.process.title.label")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(B)]),_:1})]),default:s.withCtx(()=>[s.createVNode(p,{modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1})]),_:1},8,["modelValue"])}const $w={name:"panel",components:{NodePanel:kw,ProcessPanel:F0(Zw,[["render",qw]])},mixins:[v0],props:{autoInit:{type:Boolean,default:!0},modeler:{type:Object,required:!0},formOption:[Object,String],exFormOption:[Object,String],indepFormOption:[Object,String],userOption:Object,groupOption:Object,buttonOption:Array,scriptOption:Object,conditionOption:Array,listenerOption:Array,extendedPropertyOption:Array},data(){return{activeTab:"process",openAllCollapse:!0,rootElement:null,element:null,nodes:[],needInit:!0}},watch:{modeler:{handler(){this.addEventListener()},immediate:!0}},methods:{addEventListener(){this.modeler.on("root.added",e=>{const{element:t}=e;if(t.type=="bpmn:Process")this.rootElement=s.markRaw(t);else{const n=this.modeler.getDefinitions().rootElements.find(A=>A.$type=="bpmn:Process");this.rootElement={id:n.id,type:n.$type,businessObject:n}}}),this.modeler.on("selection.changed",e=>{const{newSelection:t}=e;t.length==0?(this.element=null,this.activeTab="process",this.$nextTick(()=>{this.handleClickable()&&this.handleInitNodes()})):t.length==1?(this.element=s.markRaw(t[0]),this.activeTab="node"):(this.element=null,this.activeTab="process"),this.handleGetNodes()})},handleGetNodes(){const e=[];this.modeler.get("elementRegistry").forEach(n=>{if(["bpmn:StartEvent","bpmn:UserTask","bpmn:SequenceFlow","bpmn:Collaboration"].includes(n.type)){const{id:A,name:i}=n.businessObject;e.push({id:A,name:i||A,nodeType:n.type})}}),this.nodes=e},handleInitNodes(e=!1){if(!this.handleClickable(e))return;this.needInit=!1;const t=this.$loading({lock:!0,text:"初始化节点中, 请稍等...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"}),n=new MouseEvent("click",{bubbles:!0,cancelable:!0});try{const A=[];this.modeler.get("elementRegistry").forEach(o=>{["bpmn:UserTask","bpmn:StartEvent","bpmn:SubProcess"].includes(o.type)&&A.push(new Promise(r=>{setTimeout(()=>{const a=document.querySelector(`g[data-element-id='${o.businessObject.id}']`);a&&a.dispatchEvent(n),r()})}))}),Promise.all(A).then(()=>{if(this.rootElement){const o=document.querySelector(`svg[data-element-id='${this.rootElement.id}']`);o&&o.dispatchEvent(n)}setTimeout(()=>{t.close()},500)})}catch(A){console.error(A),t.close()}},handleClickable(e=!1){return this.autoInit&&(this.needInit||e)},handleChangeCollapse(e){const{node:t}=this.$refs;t?(this.openAllCollapse=!this.openAllCollapse,t.changeCollapse(e)):this.$message.error(this.t("nf.panel.node.message"))}}},em={key:1,style:{"margin-top":"50%","text-align":"center","font-size":"14px"}};function tm(e,t,n,A,i,o){const r=s.resolveComponent("el-icon-open"),a=s.resolveComponent("el-icon"),c=s.resolveComponent("el-icon-turn-off"),l=s.resolveComponent("node-panel"),B=s.resolveComponent("el-tab-pane"),g=s.resolveComponent("process-panel"),p=s.resolveComponent("el-tabs");return s.openBlock(),s.createBlock(p,{modelValue:i.activeTab,"onUpdate:modelValue":t[2]||(t[2]=E=>i.activeTab=E),stretch:""},{default:s.withCtx(()=>[s.createVNode(B,{label:e.t("nf.panel.node.tab"),name:"node",style:{padding:"0 10px"}},{label:s.withCtx(()=>[s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.tab"))+" ",1),i.openAllCollapse?(s.openBlock(),s.createBlock(a,{key:0,class:"el-icon-open",onClick:t[0]||(t[0]=E=>o.handleChangeCollapse("close"))},{default:s.withCtx(()=>[s.createVNode(r)]),_:1})):(s.openBlock(),s.createBlock(a,{key:1,onClick:t[1]||(t[1]=E=>o.handleChangeCollapse("open"))},{default:s.withCtx(()=>[s.createVNode(c)]),_:1}))])]),default:s.withCtx(()=>[i.element?(s.openBlock(),s.createBlock(l,{key:0,ref:"node",modeler:n.modeler,element:i.element,"form-option":n.formOption,"ex-form-option":n.exFormOption,"indep-form-option":n.indepFormOption,"user-option":n.userOption,"group-option":n.groupOption,"button-option":n.buttonOption,"script-option":n.scriptOption,"condition-option":n.conditionOption,"listener-option":n.listenerOption,"extended-properties-option":n.extendedPropertyOption,nodes:i.nodes},null,8,["modeler","element","form-option","ex-form-option","indep-form-option","user-option","group-option","button-option","script-option","condition-option","listener-option","extended-properties-option","nodes"])):(s.openBlock(),s.createElementBlock("div",em,[t[3]||(t[3]=s.createElementVNode("img",{style:{height:"100px"},src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjQgMzEuNjcpIj4KICAgICAgPGVsbGlwc2UgZmlsbC1vcGFjaXR5PSIuOCIgZmlsbD0iI0Y1RjVGNyIgY3g9IjY3Ljc5NyIgY3k9IjEwNi44OSIgcng9IjY3Ljc5NyIgcnk9IjEyLjY2OCIvPgogICAgICA8cGF0aCBkPSJNMTIyLjAzNCA2OS42NzRMOTguMTA5IDQwLjIyOWMtMS4xNDgtMS4zODYtMi44MjYtMi4yMjUtNC41OTMtMi4yMjVoLTUxLjQ0Yy0xLjc2NiAwLTMuNDQ0LjgzOS00LjU5MiAyLjIyNUwxMy41NiA2OS42NzR2MTUuMzgzaDEwOC40NzVWNjkuNjc0eiIgZmlsbD0iI0FFQjhDMiIvPgogICAgICA8cGF0aCBkPSJNMTAxLjUzNyA4Ni4yMTRMODAuNjMgNjEuMTAyYy0xLjAwMS0xLjIwNy0yLjUwNy0xLjg2Ny00LjA0OC0xLjg2N0gzMS43MjRjLTEuNTQgMC0zLjA0Ny42Ni00LjA0OCAxLjg2N0w2Ljc2OSA4Ni4yMTR2MTMuNzkyaDk0Ljc2OFY4Ni4yMTR6IiBmaWxsPSJ1cmwoI2xpbmVhckdyYWRpZW50LTEpIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMy41NikiLz4KICAgICAgPHBhdGggZD0iTTMzLjgzIDBoNjcuOTMzYTQgNCAwIDAgMSA0IDR2OTMuMzQ0YTQgNCAwIDAgMS00IDRIMzMuODNhNCA0IDAgMCAxLTQtNFY0YTQgNCAwIDAgMSA0LTR6IiBmaWxsPSIjRjVGNUY3Ii8+CiAgICAgIDxwYXRoIGQ9Ik00Mi42NzggOS45NTNoNTAuMjM3YTIgMiAwIDAgMSAyIDJWMzYuOTFhMiAyIDAgMCAxLTIgMkg0Mi42NzhhMiAyIDAgMCAxLTItMlYxMS45NTNhMiAyIDAgMCAxIDItMnpNNDIuOTQgNDkuNzY3aDQ5LjcxM2EyLjI2MiAyLjI2MiAwIDEgMSAwIDQuNTI0SDQyLjk0YTIuMjYyIDIuMjYyIDAgMCAxIDAtNC41MjR6TTQyLjk0IDYxLjUzaDQ5LjcxM2EyLjI2MiAyLjI2MiAwIDEgMSAwIDQuNTI1SDQyLjk0YTIuMjYyIDIuMjYyIDAgMCAxIDAtNC41MjV6TTEyMS44MTMgMTA1LjAzMmMtLjc3NSAzLjA3MS0zLjQ5NyA1LjM2LTYuNzM1IDUuMzZIMjAuNTE1Yy0zLjIzOCAwLTUuOTYtMi4yOS02LjczNC01LjM2YTcuMzA5IDcuMzA5IDAgMCAxLS4yMjItMS43OVY2OS42NzVoMjYuMzE4YzIuOTA3IDAgNS4yNSAyLjQ0OCA1LjI1IDUuNDJ2LjA0YzAgMi45NzEgMi4zNyA1LjM3IDUuMjc3IDUuMzdoMzQuNzg1YzIuOTA3IDAgNS4yNzctMi40MjEgNS4yNzctNS4zOTNWNzUuMWMwLTIuOTcyIDIuMzQzLTUuNDI2IDUuMjUtNS40MjZoMjYuMzE4djMzLjU2OWMwIC42MTctLjA3NyAxLjIxNi0uMjIxIDEuNzg5eiIgZmlsbD0iI0RDRTBFNiIvPgogICAgPC9nPgogICAgPHBhdGggZD0iTTE0OS4xMjEgMzMuMjkybC02LjgzIDIuNjVhMSAxIDAgMCAxLTEuMzE3LTEuMjNsMS45MzctNi4yMDdjLTIuNTg5LTIuOTQ0LTQuMTA5LTYuNTM0LTQuMTA5LTEwLjQwOEMxMzguODAyIDguMTAyIDE0OC45MiAwIDE2MS40MDIgMCAxNzMuODgxIDAgMTg0IDguMTAyIDE4NCAxOC4wOTdjMCA5Ljk5NS0xMC4xMTggMTguMDk3LTIyLjU5OSAxOC4wOTctNC41MjggMC04Ljc0NC0xLjA2Ni0xMi4yOC0yLjkwMnoiIGZpbGw9IiNEQ0UwRTYiLz4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE0OS42NSAxNS4zODMpIiBmaWxsPSIjRkZGIj4KICAgICAgPGVsbGlwc2UgY3g9IjIwLjY1NCIgY3k9IjMuMTY3IiByeD0iMi44NDkiIHJ5PSIyLjgxNSIvPgogICAgICA8cGF0aCBkPSJNNS42OTggNS42M0gwTDIuODk4LjcwNHpNOS4yNTkuNzA0aDQuOTg1VjUuNjNIOS4yNTl6Ii8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K"},null,-1)),s.createElementVNode("p",null,s.toDisplayString(e.t("nf.panel.node.message")),1)]))]),_:1},8,["label"]),s.createVNode(B,{label:e.t("nf.panel.process.tab"),name:"process",style:{padding:"0 10px"}},{default:s.withCtx(()=>[i.rootElement?(s.openBlock(),s.createBlock(g,{key:0,ref:"process",modeler:n.modeler,element:i.rootElement,nodes:i.nodes},null,8,["modeler","element","nodes"])):s.createCommentVNode("",!0)]),_:1},8,["label"])]),_:1},8,["modelValue"])}const nm=F0($w,[["render",tm]]);function W(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function Am(e,t){return t={exports:{}},e(t,t.exports),t.exports}var im=Am(function(e){var t=e.exports=function(n,A){if(A||(A=16),n===void 0&&(n=128),n<=0)return"0";for(var i=Math.log(Math.pow(2,n))/Math.log(A),o=2;i===1/0;o*=2)i=Math.log(Math.pow(2,n/o))/Math.log(A)*o;for(var r=i-Math.floor(i),a="",o=0;o<Math.floor(i);o++){var c=Math.floor(Math.random()*A).toString(A);a=c+a}if(r){var l=Math.pow(A,r),c=Math.floor(Math.random()*l).toString(A);a=c+a}var B=parseInt(a,A);return B!==1/0&&B>=Math.pow(2,n)?t(n,A):a};t.rack=function(n,A,i){var o=function(a){var c=0;do{if(c++>10)if(i)n+=i;else throw new Error("too many ID collisions, use more bits");var l=t(n,A)}while(Object.hasOwnProperty.call(r,l));return r[l]=a,l},r=o.hats={};return o.get=function(a){return o.hats[a]},o.set=function(a,c){return o.hats[a]=c,o},o.bits=n||128,o.base=A||16,o}});function ue(e){if(!(this instanceof ue))return new ue(e);e=e||[128,36,1],this._seed=e.length?im.rack(e[0],e[1],e[2]):e}ue.prototype.next=function(e){return this._seed(e||!0)},ue.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},ue.prototype.claim=function(e,t){this._seed.set(e,t||!0)},ue.prototype.assigned=function(e){return this._seed.get(e)||!1},ue.prototype.unclaim=function(e){delete this._seed.hats[e]},ue.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};function no(e){return Array.prototype.concat.apply([],e)}const yA=Object.prototype.toString,om=Object.prototype.hasOwnProperty;function Je(e){return e===void 0}function a2(e){return e!==void 0}function en(e){return e==null}function n0(e){return yA.call(e)==="[object Array]"}function V0(e){return yA.call(e)==="[object Object]"}function A0(e){return yA.call(e)==="[object Number]"}function n2(e){const t=yA.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function U2(e){return yA.call(e)==="[object String]"}function Wl(e){if(!n0(e))throw new Error("must supply array")}function I2(e,t){return!en(e)&&om.call(e,t)}function m0(e,t){const n=Ao(t);let A;return U(e,function(i,o){if(n(i,o))return A=i,!1}),A}function qa(e,t){const n=Ao(t);let A=n0(e)?-1:void 0;return U(e,function(i,o){if(n(i,o))return A=o,!1}),A}function l0(e,t){const n=Ao(t);let A=[];return U(e,function(i,o){n(i,o)&&A.push(i)}),A}function U(e,t){let n,A;if(Je(e))return;const i=n0(e)?am:rm;for(let o in e)if(I2(e,o)&&(n=e[o],A=t(n,i(o)),A===!1))return n}function _l(e,t){if(Je(e))return[];Wl(e);const n=Ao(t);return e.filter(function(A,i){return!n(A,i)})}function F2(e,t,n){return U(e,function(A,i){n=t(n,A,i)}),n}function je(e,t){return!!F2(e,function(n,A,i){return n&&t(A,i)},!0)}function Qe(e,t){return!!m0(e,t)}function B2(e,t){let n=[];return U(e,function(A,i){n.push(t(A,i))}),n}function IA(e){return e&&Object.keys(e)||[]}function Ol(e){return IA(e).length}function FA(e){return B2(e,t=>t)}function Ve(e,t,n={}){return t=ec(t),U(e,function(A){let i=t(A)||"_",o=n[i];o||(o=n[i]=[]),o.push(A)}),n}function $a(e,...t){e=ec(e);let n={};return U(t,i=>Ve(i,e,n)),B2(n,function(i,o){return i[0]})}const Xl=$a;function he(e,t){t=ec(t);let n=[];return U(e,function(A,i){let o=t(A,i),r={d:o,v:A};for(var a=0;a<n.length;a++){let{d:c}=n[a];if(o<c){n.splice(a,0,r);return}}n.push(r)}),B2(n,A=>A.v)}function Z2(e){return function(t){return je(e,function(n,A){return t[A]===n})}}function ec(e){return n2(e)?e:t=>t[e]}function Ao(e){return n2(e)?e:t=>t===e}function rm(e){return e}function am(e){return Number(e)}function tc(e,t){let n,A,i,o;function r(g){let p=Date.now(),E=g?0:o+t-p;if(E>0)return a(E);e.apply(i,A),c()}function a(g){n=setTimeout(r,g)}function c(){n&&clearTimeout(n),n=o=A=i=void 0}function l(){n&&r(!0),c()}function B(...g){o=Date.now(),A=g,i=this,n||a(t)}return B.flush=l,B.cancel=c,B}function cm(e,t){let n=!1;return function(...A){n||(e(...A),n=!0,setTimeout(()=>{n=!1},t))}}function v2(e,t){return e.bind(t)}function N(e,...t){return Object.assign(e,...t)}function Kl(e,t,n){let A=e;return U(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let r=t[o+1],a=A[i];a2(r)&&en(a)&&(a=A[i]=isNaN(+r)?{}:[]),Je(r)?Je(n)?delete A[i]:A[i]=n:A=a}),e}function sm(e,t,n){let A=e;return U(t,function(i){if(en(A))return A=void 0,!1;A=A[i]}),Je(A)?n:A}function q2(e,t){let n={},A=Object(e);return U(t,function(i){i in A&&(n[i]=e[i])}),n}function we(e,t){let n={},A=Object(e);return U(A,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Zl(e,...t){return t.length&&U(t,function(n){!n||!V0(n)||U(n,function(A,i){if(i==="__proto__")return;let o=e[i];V0(A)?(V0(o)||(o={}),e[i]=Zl(o,A)):e[i]=A})}),e}const lm=Object.freeze(Object.defineProperty({__proto__:null,assign:N,bind:v2,debounce:tc,ensureArray:Wl,every:je,filter:l0,find:m0,findIndex:qa,flatten:no,forEach:U,get:sm,groupBy:Ve,has:I2,isArray:n0,isDefined:a2,isFunction:n2,isNil:en,isNumber:A0,isObject:V0,isString:U2,isUndefined:Je,keys:IA,map:B2,matchPattern:Z2,merge:Zl,omit:we,pick:q2,reduce:F2,set:Kl,size:Ol,some:Qe,sortBy:he,throttle:cm,unionBy:Xl,uniqueBy:$a,values:FA,without:_l},Symbol.toStringTag,{value:"Module"}));function Bm(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(A){if(A!=="default"&&!(A in e)){var i=Object.getOwnPropertyDescriptor(n,A);Object.defineProperty(e,A,i.get?i:{enumerable:!0,get:function(){return n[A]}})}})}),Object.freeze(e)}const gm=Object.prototype.toString,pm=Object.prototype.hasOwnProperty;function Em(e){return e===void 0}function dm(e){return gm.call(e)==="[object Array]"}function um(e,t){return pm.call(e,t)}function ql(e,t){let n,A;if(Em(e))return;const i=dm(e)?hm:Qm;for(let o in e)if(um(e,o)&&(n=e[o],A=t(n,i(o)),A===!1))return n}function Qm(e){return e}function hm(e){return Number(e)}function m2(e,...t){const n=e.style;return ql(t,function(A){A&&ql(A,function(i,o){n[o]=i})}),e}function g2(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}const wm=Object.prototype.toString;function X(e){return new ut(e)}function ut(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}ut.prototype.add=function(e){return this.list.add(e),this},ut.prototype.remove=function(e){return wm.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},ut.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},ut.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},ut.prototype.array=function(){return Array.from(this.list)},ut.prototype.has=ut.prototype.contains=function(e){return this.list.contains(e)};function vA(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Sn(e,t,n){var A=n?e:e.parentNode;return A&&typeof A.closest=="function"&&A.closest(t)||null}var io={},oo,nc,Ac;function $l(){oo=window.addEventListener?"addEventListener":"attachEvent",nc=window.removeEventListener?"removeEventListener":"detachEvent",Ac=oo!=="addEventListener"?"on":""}var mm=io.bind=function(e,t,n,A){return oo||$l(),e[oo](Ac+t,n,A||!1),n},fm=io.unbind=function(e,t,n,A){return nc||$l(),e[nc](Ac+t,n,A||!1),n},O=Bm({__proto__:null,bind:mm,unbind:fm,default:io},[io]),eB=["focus","blur"];function Cm(e,t,n,A,i){return eB.indexOf(n)!==-1&&(i=!0),O.bind(e,n,function(o){var r=o.target||o.srcElement;o.delegateTarget=Sn(r,t,!0),o.delegateTarget&&A.call(e,o)},i)}function Mm(e,t,n,A){return eB.indexOf(t)!==-1&&(A=!0),O.unbind(e,t,n,A)}var x2={bind:Cm,unbind:Mm},Dm=ym,tB=!1,ro;typeof document<"u"&&(ro=document.createElement("div"),ro.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',tB=!ro.getElementsByTagName("link").length,ro=void 0);var A2={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:tB?[1,"X<div>","</div>"]:[0,"",""]};A2.td=A2.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],A2.option=A2.optgroup=[1,'<select multiple="multiple">',"</select>"],A2.thead=A2.tbody=A2.colgroup=A2.caption=A2.tfoot=[1,"<table>","</table>"],A2.polyline=A2.ellipse=A2.polygon=A2.circle=A2.text=A2.line=A2.path=A2.rect=A2.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function ym(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var A=n[1];if(A=="body"){var c=t.createElement("html");return c.innerHTML=e,c.removeChild(c.lastChild)}var i=Object.prototype.hasOwnProperty.call(A2,A)?A2[A]:A2._default,o=i[0],r=i[1],a=i[2],c=t.createElement("div");for(c.innerHTML=r+e+a;o--;)c=c.lastChild;if(c.firstChild==c.lastChild)return c.removeChild(c.firstChild);for(var l=t.createDocumentFragment();c.firstChild;)l.appendChild(c.removeChild(c.firstChild));return l}var $=Dm;function nB(e,t){return e&&typeof e.matches=="function"&&e.matches(t)||!1}function p0(e,t){return t=t||document,t.querySelector(e)}function Le(e,t){return t=t||document,t.querySelectorAll(e)}function xe(e){e.parentNode&&e.parentNode.removeChild(e)}function Im(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function Fm(e,t){return t.appendChild(Im(e,t))}function me(e,t){return Fm(t,e),e}var ic=2,AB={"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":ic,"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":ic,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function vm(e,t){return AB[t]?e.style[t]:e.getAttributeNS(null,t)}function xm(e,t,n){var A=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=AB[A];i?(i===ic&&typeof n=="number"&&(n=String(n)+"px"),e.style[A]=n):e.setAttributeNS(null,t,n)}function bm(e,t){var n=Object.keys(t),A,i;for(A=0,i;i=n[A];A++)xm(e,i,t[i])}function N2(e,t,n){return typeof t=="string"?vm(e,t):(bm(e,t),e)}const Ym=Object.prototype.toString;function Um(e){return new Qt(e)}function Qt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Qt.prototype.add=function(e){return this.list.add(e),this},Qt.prototype.remove=function(e){return Ym.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Qt.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Qt.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Qt.prototype.array=function(){return Array.from(this.list)},Qt.prototype.has=Qt.prototype.contains=function(e){return this.list.contains(e)};var oc={svg:"http://www.w3.org/2000/svg"},iB='<svg xmlns="'+oc.svg+'"';function Nm(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(oc.svg)===-1&&(e=iB+e.substring(4)):(e=iB+">"+e+"</svg>",t=!0);var n=zm(e);if(!t)return n;for(var A=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)A.appendChild(i.firstChild);return A}function zm(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function c2(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=Nm(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(oc.svg,e),t&&N2(n,t),n}var oB=/([&<>]{1})/g,Rm=/([&<>\n\r"]{1})/g,Sm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function rc(e,t){function n(A,i){return Sm[i]||i}return e.replace(t,n)}function rB(e,t){var n,A,i,o,r;switch(e.nodeType){case 3:t.push(rc(e.textContent,oB));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,A=i.length;n<A;++n)o=i.item(n),t.push(" ",o.name,'="',rc(o.value,Rm),'"');if(e.hasChildNodes()){for(t.push(">"),r=e.childNodes,n=0,A=r.length;n<A;++n)rB(r.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",rc(e.nodeValue,oB),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Tm(e){for(var t=e.firstChild,n=[];t;)rB(t,n),t=t.nextSibling;return n.join("")}function aB(e,t){return Tm(e)}function km(e){var t=e.parentNode;return t&&t.removeChild(e),e}const Gm=/^class[ {]/;function Hm(e){return Gm.test(e.toString())}function ac(e){return Array.isArray(e)}function cc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ao(...e){e.length===1&&ac(e[0])&&(e=e[0]),e=[...e];const t=e.pop();return t.$inject=e,t}const Pm=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Jm=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,jm=/\/\*([^*]*)\*\//m;function Vm(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(Hm(e)?Pm:Jm);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map(A=>{const i=A.match(jm);return(i&&i[1]||A).trim()})||[]}function cB(e,t){const n=t||{get:function(C,m){if(A.push(C),m===!1)return null;throw a(`No provider for "${C}"!`)}},A=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),r=o.injector=this,a=function(C){const m=A.join(" -> ");return A.length=0,new Error(m?`${C} (Resolving: ${m})`:C)};function c(C,m){if(!i[C]&&C.includes(".")){const I=C.split(".");let x=c(I.shift());for(;I.length;)x=x[I.shift()];return x}if(cc(o,C))return o[C];if(cc(i,C)){if(A.indexOf(C)!==-1)throw A.push(C),a("Cannot resolve circular dependency!");return A.push(C),o[C]=i[C][0](i[C][1]),A.pop(),o[C]}return n.get(C,m)}function l(C,m){if(typeof m>"u"&&(m={}),typeof C!="function")if(ac(C))C=ao(C.slice());else throw a(`Cannot invoke "${C}". Expected a function!`);const x=(C.$inject||Vm(C)).map(v=>cc(m,v)?m[v]:c(v));return{fn:C,dependencies:x}}function B(C){const{fn:m,dependencies:I}=l(C),x=Function.prototype.bind.call(m,null,...I);return new x}function g(C,m,I){const{fn:x,dependencies:v}=l(C,I);return x.apply(m,v)}function p(C){return ao(m=>C.get(m))}function E(C,m){if(m&&m.length){const I=Object.create(null),x=Object.create(null),v=[],F=[],z=[];let R,k,T,H;for(let K in i)R=i[K],m.indexOf(K)!==-1&&(R[2]==="private"?(k=v.indexOf(R[3]),k===-1?(T=R[3].createChild([],m),H=p(T),v.push(R[3]),F.push(T),z.push(H),I[K]=[H,K,"private",T]):I[K]=[z[k],K,"private",F[k]]):I[K]=[R[2],R[1]],x[K]=!0),(R[2]==="factory"||R[2]==="type")&&R[1].$scope&&m.forEach(x0=>{R[1].$scope.indexOf(x0)!==-1&&(I[K]=[R[2],R[1]],x[x0]=!0)});m.forEach(K=>{if(!x[K])throw new Error('No provider for "'+K+'". Cannot use provider from the parent!')}),C.unshift(I)}return new cB(C,r)}const d={factory:g,type:B,value:function(C){return C}};function u(C,m){const I=C.__init__||[];return function(){I.forEach(x=>{typeof x=="string"?m.get(x):m.invoke(x)})}}function h(C){const m=C.__exports__;if(m){const I=C.__modules__,x=Object.keys(C).reduce((k,T)=>(T!=="__exports__"&&T!=="__modules__"&&T!=="__init__"&&T!=="__depends__"&&(k[T]=C[T]),k),Object.create(null)),v=(I||[]).concat(x),F=E(v),z=ao(function(k){return F.get(k)});m.forEach(function(k){i[k]=[z,k,"private",F]});const R=(C.__init__||[]).slice();return R.unshift(function(){F.init()}),C=Object.assign({},C,{__init__:R}),u(C,F)}return Object.keys(C).forEach(function(I){if(I==="__init__"||I==="__depends__")return;const x=C[I];if(x[2]==="private"){i[I]=x;return}const v=x[0],F=x[1];i[I]=[d[v],Lm(v,F),v]}),u(C,r)}function D(C,m){return C.indexOf(m)!==-1||(C=(m.__depends__||[]).reduce(D,C),C.indexOf(m)!==-1)?C:C.concat(m)}function y(C){const m=C.reduce(D,[]).map(h);let I=!1;return function(){I||(I=!0,m.forEach(x=>x()))}}this.get=c,this.invoke=g,this.instantiate=B,this.createChild=E,this.init=y(e)}function Lm(e,t){return e!=="value"&&ac(t)&&(t=ao(t.slice())),t}var Wm=1e3;function be(e,t){var n=this;t=t||Wm,e.on(["render.shape","render.connection"],t,function(A,i){var o=A.type,r=i.element,a=i.gfx,c=i.attrs;if(n.canRender(r))return o==="render.shape"?n.drawShape(a,r,c):n.drawConnection(a,r,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(A,i){if(n.canRender(i))return A.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}be.prototype.canRender=function(e){},be.prototype.drawShape=function(e,t){},be.prototype.drawConnection=function(e,t){},be.prototype.getShapePath=function(e){},be.prototype.getConnectionPath=function(e){};function _m(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function Om(e,t){return t.appendChild(_m(e,t))}function Q0(e,t){return Om(t,e),e}var sc=2,sB={"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":sc,"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":sc,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Xm(e,t){return sB[t]?e.style[t]:e.getAttributeNS(null,t)}function lB(e,t,n){var A=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=sB[A];i?(i===sc&&typeof n=="number"&&(n=String(n)+"px"),e.style[A]=n):e.setAttributeNS(null,t,n)}function Km(e,t){var n=Object.keys(t),A,i;for(A=0,i;i=n[A];A++)lB(e,i,t[i])}function q(e,t,n){if(typeof t=="string")if(n!==void 0)lB(e,t,n);else return Xm(e,t);else Km(e,t);return e}const Zm=Object.prototype.toString;function D0(e){return new ht(e)}function ht(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}ht.prototype.add=function(e){return this.list.add(e),this},ht.prototype.remove=function(e){return Zm.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},ht.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},ht.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},ht.prototype.array=function(){return Array.from(this.list)},ht.prototype.has=ht.prototype.contains=function(e){return this.list.contains(e)};function co(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function BB(e){return e.cloneNode(!0)}var lc={svg:"http://www.w3.org/2000/svg"},gB='<svg xmlns="'+lc.svg+'"';function qm(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(lc.svg)===-1&&(e=gB+e.substring(4)):(e=gB+">"+e+"</svg>",t=!0);var n=$m(e);if(!t)return n;for(var A=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)A.appendChild(i.firstChild);return A}function $m(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function g0(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=qm(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(lc.svg,e),t&&q(n,t),n}var Bc=null;function pB(){return Bc===null&&(Bc=g0("svg")),Bc}function EB(e,t){var n,A,i=Object.keys(t);for(n=0;A=i[n];n++)e[A]=t[A];return e}function ef(e,t,n,A,i,o){var r=pB().createSVGMatrix();switch(arguments.length){case 0:return r;case 1:return EB(r,e);case 6:return EB(r,{a:e,b:t,c:n,d:A,e:i,f:o})}}function xA(e){return pB().createSVGTransform()}function s2(e){var t=e.parentNode;return t&&t.removeChild(e),e}function tf(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function nf(e,t){var n,A;for(e.clear(),n=0;A=t[n];n++)e.appendItem(tf(e,A))}function bA(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),nf(n,t)),n.consolidate()}function tn(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function Af(e){return["M",e.x,e.y]}function gc(e){return["L",e.x,e.y]}function of(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function rf(e,t){const n=e.length,A=[Af(e[0])];for(let i=1;i<n;i++){const o=e[i-1],r=e[i],a=e[i+1];if(!a||!t){A.push(gc(r));continue}const c=Math.min(t,pc(r.x-o.x,r.y-o.y),pc(a.x-r.x,a.y-r.y));if(!c){A.push(gc(r));continue}const l=so(r,o,c),B=so(r,o,c*.5),g=so(r,a,c),p=so(r,a,c*.5);A.push(gc(l)),A.push(of(B,p,g))}return A}function so(e,t,n){const A=t.x-e.x,i=t.y-e.y,o=pc(A,i),r=n/o;return{x:e.x+A*r,y:e.y+i*r}}function pc(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function lo(e,t,n){A0(t)&&(n=t,t=null),t||(t={});const A=g0("path",t);return A0(n)&&(A.dataset.cornerRadius=String(n)),dB(A,e)}function dB(e,t){const n=parseInt(e.dataset.cornerRadius,10)||0;return q(e,{d:tn(rf(t,n))}),e}function Bo(e){return l0(e,function(t){return!m0(e,function(n){return n!==t&&uB(t,n)})})}function uB(e,t){if(t){if(e===t)return t;if(e.parent)return uB(e.parent,t)}}function QB(e,t,n){var A=!n||e.indexOf(t)===-1;return A&&e.push(t),A}function nn(e,t,n){n=n||0,n0(e)||(e=[e]),U(e,function(A,i){var o=t(A,i,n);n0(o)&&o.length&&nn(o,t,n+1)})}function af(e,t,n){var A=[],i=[];return nn(e,function(o,r,a){QB(A,o,t);var c=o.children;if(c&&QB(i,c,t))return c}),A}function YA(e,t){return af(e,!t)}function cf(e,t,n){Je(t)&&(t=!0),V0(t)&&(n=t,t=!0),n=n||{};var A=UA(n.allShapes),i=UA(n.allConnections),o=UA(n.enclosedElements),r=UA(n.enclosedConnections),a=UA(n.topLevel,t&&Ve(e,function(B){return B.id}));function c(B){a[B.source.id]&&a[B.target.id]&&(a[B.id]=[B]),A[B.source.id]&&A[B.target.id]&&(r[B.id]=o[B.id]=B),i[B.id]=B}function l(B){if(o[B.id]=B,B.waypoints)r[B.id]=i[B.id]=B;else return A[B.id]=B,U(B.incoming,c),U(B.outgoing,c),B.children}return nn(e,l),{allShapes:A,allConnections:i,topLevel:a,enclosedConnections:r,enclosedElements:o}}function i2(e,t){t=!!t,n0(e)||(e=[e]);var n,A,i,o;return U(e,function(r){var a=r;r.waypoints&&!t&&(a=i2(r.waypoints,!0));var c=a.x,l=a.y,B=a.height||0,g=a.width||0;(c<n||n===void 0)&&(n=c),(l<A||A===void 0)&&(A=l),(c+g>i||i===void 0)&&(i=c+g),(l+B>o||o===void 0)&&(o=l+B)}),{x:n,y:A,height:o-A,width:i-n}}function hB(e,t){var n={};return U(e,function(A){var i=A;i.waypoints&&(i=i2(i)),!A0(t.y)&&i.x>t.x&&(n[A.id]=A),!A0(t.x)&&i.y>t.y&&(n[A.id]=A),i.x>t.x&&i.y>t.y&&(A0(t.width)&&A0(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y||!A0(t.width)||!A0(t.height))&&(n[A.id]=A)}),n}function wB(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function mB(e){return!!(e&&e.isFrame)}function UA(e,t){return N({},e||{},t||{})}var sf=1;function wt(e,t){be.call(this,e,sf),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}W(wt,be),wt.prototype.canRender=function(){return!0},wt.prototype.drawShape=function(t,n,A){var i=g0("rect");return q(i,{x:0,y:0,width:n.width||0,height:n.height||0}),mB(n)?q(i,N({},this.FRAME_STYLE,A||{})):q(i,N({},this.SHAPE_STYLE,A||{})),Q0(t,i),i},wt.prototype.drawConnection=function(t,n,A){var i=lo(n.waypoints,N({},this.CONNECTION_STYLE,A||{}));return Q0(t,i),i},wt.prototype.getShapePath=function(t){var n=t.x,A=t.y,i=t.width,o=t.height,r=[["M",n,A],["l",i,0],["l",0,o],["l",-i,0],["z"]];return tn(r)},wt.prototype.getConnectionPath=function(t){var n=t.waypoints,A,i,o=[];for(A=0;i=n[A];A++)i=i.original||i,o.push([A===0?"M":"L",i.x,i.y]);return tn(o)},wt.$inject=["eventBus","styles"];function lf(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,A,i){var o=this.style(A,i);return N(o,{class:n})},this.style=function(n,A){!n0(n)&&!A&&(A=n,n=[]);var i=F2(n,function(o,r){return N(o,e[r]||{})},{});return A?N(i,A):i},this.computeStyle=function(n,A,i){return n0(A)||(i=A,A=[]),t.style(A||[],N({},i,n||{}))}}const Bf={__init__:["defaultRenderer"],defaultRenderer:["type",wt],styles:["type",lf]};function X0(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function o2(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var A=e.indexOf(t);if(A!==-1){if(A===n)return;if(n!==-1)e.splice(A,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function Ec(e,t){return!e||!t?-1:e.indexOf(t)}function NA(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function dc(e,t,n,A){if(typeof A>"u"&&(A=5),!e||!t||!n)return!1;var i=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=NA(e,t);return Math.abs(i/o)<=A}var gf=2;function We(e,t){var n=Array.from(arguments).flat();const A={x:"v",y:"h"};for(const[i,o]of Object.entries(A))if(pf(i,n))return o;return!1}function pf(e,t){const n=t[0];return je(t,function(A){return Math.abs(n[e]-A[e])<=gf})}function fB(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function uc(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var Ef=/,?([a-z]),?/gi,CB=parseFloat,K0=Math,mt=K0.PI,Ye=K0.min,Ue=K0.max,MB=K0.pow,ft=K0.abs,df=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,uf=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,go=Array.isArray||function(e){return e instanceof Array};function Qc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function zA(e){if(typeof e=="function"||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)Qc(e,n)&&(t[n]=zA(e[n]));return t}function Qf(e,t){for(var n=0,A=e.length;n<A;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function hf(e){function t(){var n=Array.prototype.slice.call(arguments,0),A=n.join("␀"),i=t.cache=t.cache||{},o=t.count=t.count||[];return Qc(i,A)?(Qf(o,A),i[A]):(o.length>=1e3&&delete i[o.shift()],o.push(A),i[A]=e(...arguments),i[A])}return t}function wf(e){if(!e)return null;var t=Tn(e);if(t.arr)return zA(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},A=[];return go(e)&&go(e[0])&&(A=zA(e)),A.length||String(e).replace(df,function(i,o,r){var a=[],c=o.toLowerCase();for(r.replace(uf,function(l,B){B&&a.push(+B)}),c=="m"&&a.length>2&&(A.push([o,...a.splice(0,2)]),c="l",o=o=="m"?"l":"L");a.length>=n[c]&&(A.push([o,...a.splice(0,n[c])]),!!n[c]););}),A.toString=Tn.toString,t.arr=zA(A),A}function Tn(e){var t=Tn.ps=Tn.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)Qc(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function hc(e,t,n,A){return arguments.length===1&&(t=e.y,n=e.width,A=e.height,e=e.x),{x:e,y:t,width:n,height:A,x2:e+n,y2:t+A}}function DB(){return this.join(",").replace(Ef,"$1")}function po(e){var t=zA(e);return t.toString=DB,t}function yB(e,t,n,A,i,o,r,a,c){var l=1-c,B=MB(l,3),g=MB(l,2),p=c*c,E=p*c,d=B*e+g*3*c*n+l*3*c*c*i+E*r,u=B*t+g*3*c*A+l*3*c*c*o+E*a;return{x:Eo(d),y:Eo(u)}}function IB(e){var t=Df(...e);return hc(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Ct(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function mf(e,t){return e=hc(e),t=hc(t),Ct(t,e.x,e.y)||Ct(t,e.x2,e.y)||Ct(t,e.x,e.y2)||Ct(t,e.x2,e.y2)||Ct(e,t.x,t.y)||Ct(e,t.x2,t.y)||Ct(e,t.x,t.y2)||Ct(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function FB(e,t,n,A,i){var o=-3*t+9*n-9*A+3*i,r=e*o+6*t-12*n+6*A;return e*r-3*t+3*n}function vB(e,t,n,A,i,o,r,a,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var l=c/2,B=12,g=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],E=0,d=0;d<B;d++){var u=l*g[d]+l,h=FB(u,e,n,i,r),D=FB(u,t,A,o,a),y=h*h+D*D;E+=p[d]*K0.sqrt(y)}return l*E}function ff(e,t,n,A,i,o,r,a){if(!(Ue(e,n)<Ye(i,r)||Ye(e,n)>Ue(i,r)||Ue(t,A)<Ye(o,a)||Ye(t,A)>Ue(o,a))){var c=(e*A-t*n)*(i-r)-(e-n)*(i*a-o*r),l=(e*A-t*n)*(o-a)-(t-A)*(i*a-o*r),B=(e-n)*(o-a)-(t-A)*(i-r);if(B){var g=Eo(c/B),p=Eo(l/B),E=+g.toFixed(2),d=+p.toFixed(2);if(!(E<+Ye(e,n).toFixed(2)||E>+Ue(e,n).toFixed(2)||E<+Ye(i,r).toFixed(2)||E>+Ue(i,r).toFixed(2)||d<+Ye(t,A).toFixed(2)||d>+Ue(t,A).toFixed(2)||d<+Ye(o,a).toFixed(2)||d>+Ue(o,a).toFixed(2)))return{x:g,y:p}}}}function Eo(e){return Math.round(e*1e11)/1e11}function Cf(e,t,n){var A=IB(e),i=IB(t);if(!mf(A,i))return n?0:[];for(var o=vB(...e),r=vB(...t),a=bB(e)?1:~~(o/5)||1,c=bB(t)?1:~~(r/5)||1,l=[],B=[],g={},p=n?0:[],E=0;E<a+1;E++){var d=yB(...e,E/a);l.push({x:d.x,y:d.y,t:E/a})}for(E=0;E<c+1;E++)d=yB(...t,E/c),B.push({x:d.x,y:d.y,t:E/c});for(E=0;E<a;E++)for(var u=0;u<c;u++){var h=l[E],D=l[E+1],y=B[u],C=B[u+1],m=ft(D.x-h.x)<.01?"y":"x",I=ft(C.x-y.x)<.01?"y":"x",x=ff(h.x,h.y,D.x,D.y,y.x,y.y,C.x,C.y),v;if(x){if(v=x.x.toFixed(9)+"#"+x.y.toFixed(9),g[v])continue;g[v]=!0;var F=h.t+ft((x[m]-h[m])/(D[m]-h[m]))*(D.t-h.t),z=y.t+ft((x[I]-y[I])/(C[I]-y[I]))*(C.t-y.t);F>=0&&F<=1&&z>=0&&z<=1&&(n?p++:p.push({x:x.x,y:x.y,t1:F,t2:z}))}}return p}function xB(e,t,n){e=NB(e),t=NB(t);for(var A,i,o,r,a,c,l,B,g,p,E=n?0:[],d=0,u=e.length;d<u;d++){var h=e[d];if(h[0]=="M")A=a=h[1],i=c=h[2];else{h[0]=="C"?(g=[A,i,...h.slice(1)],A=g[6],i=g[7]):(g=[A,i,A,i,a,c,a,c],A=a,i=c);for(var D=0,y=t.length;D<y;D++){var C=t[D];if(C[0]=="M")o=l=C[1],r=B=C[2];else{C[0]=="C"?(p=[o,r,...C.slice(1)],o=p[6],r=p[7]):(p=[o,r,o,r,l,B,l,B],o=l,r=B);var m=Cf(g,p,n);if(n)E+=m;else{for(var I=0,x=m.length;I<x;I++)m[I].segment1=d,m[I].segment2=D,m[I].bez1=g,m[I].bez2=p;E=E.concat(m)}}}}}return E}function Mf(e){var t=Tn(e);if(t.abs)return po(t.abs);if((!go(e)||!go(e&&e[0]))&&(e=wf(e)),!e||!e.length)return[["M",0,0]];var n=[],A=0,i=0,o=0,r=0,a=0,c;e[0][0]=="M"&&(A=+e[0][1],i=+e[0][2],o=A,r=i,a++,n[0]=["M",A,i]);for(var l,B,g=a,p=e.length;g<p;g++){if(n.push(l=[]),B=e[g],c=B[0],c!=c.toUpperCase())switch(l[0]=c.toUpperCase(),l[0]){case"A":l[1]=B[1],l[2]=B[2],l[3]=B[3],l[4]=B[4],l[5]=B[5],l[6]=+B[6]+A,l[7]=+B[7]+i;break;case"V":l[1]=+B[1]+i;break;case"H":l[1]=+B[1]+A;break;case"M":o=+B[1]+A,r=+B[2]+i;default:for(var E=1,d=B.length;E<d;E++)l[E]=+B[E]+(E%2?A:i)}else for(var u=0,h=B.length;u<h;u++)l[u]=B[u];switch(c=c.toUpperCase(),l[0]){case"Z":A=+o,i=+r;break;case"H":A=l[1];break;case"V":i=l[1];break;case"M":o=l[l.length-2],r=l[l.length-1];default:A=l[l.length-2],i=l[l.length-1]}}return n.toString=DB,t.abs=po(n),n}function bB(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function uo(e,t,n,A){return[e,t,n,A,n,A]}function YB(e,t,n,A,i,o){var r=.3333333333333333,a=2/3;return[r*e+a*n,r*t+a*A,r*i+a*n,r*o+a*A,i,o]}function UB(e,t,n,A,i,o,r,a,c,l){var B=mt*120/180,g=mt/180*(+i||0),p=[],E,d=hf(function(M,w,Q){var b=M*K0.cos(Q)-w*K0.sin(Q),Y=M*K0.sin(Q)+w*K0.cos(Q);return{x:b,y:Y}});if(l)v=l[0],F=l[1],I=l[2],x=l[3];else{E=d(e,t,-g),e=E.x,t=E.y,E=d(a,c,-g),a=E.x,c=E.y;var u=(e-a)/2,h=(t-c)/2,D=u*u/(n*n)+h*h/(A*A);D>1&&(D=K0.sqrt(D),n=D*n,A=D*A);var y=n*n,C=A*A,m=(o==r?-1:1)*K0.sqrt(ft((y*C-y*h*h-C*u*u)/(y*h*h+C*u*u))),I=m*n*h/A+(e+a)/2,x=m*-A*u/n+(t+c)/2,v=K0.asin(((t-x)/A).toFixed(9)),F=K0.asin(((c-x)/A).toFixed(9));v=e<I?mt-v:v,F=a<I?mt-F:F,v<0&&(v=mt*2+v),F<0&&(F=mt*2+F),r&&v>F&&(v=v-mt*2),!r&&F>v&&(F=F-mt*2)}var z=F-v;if(ft(z)>B){var R=F,k=a,T=c;F=v+B*(r&&F>v?1:-1),a=I+n*K0.cos(F),c=x+A*K0.sin(F),p=UB(a,c,n,A,i,0,r,k,T,[F,R,I,x])}z=F-v;var H=K0.cos(v),K=K0.sin(v),x0=K0.cos(F),d0=K0.sin(F),t0=K0.tan(z/4),G0=4/3*n*t0,u2=4/3*A*t0,R0=[e,t],r2=[e+G0*K,t-u2*H],J=[a+G0*d0,c-u2*x0],V=[a,c];if(r2[0]=2*R0[0]-r2[0],r2[1]=2*R0[1]-r2[1],l)return[r2,J,V].concat(p);p=[r2,J,V].concat(p).join().split(",");for(var Z=[],u0=0,y2=p.length;u0<y2;u0++)Z[u0]=u0%2?d(p[u0-1],p[u0],g).y:d(p[u0],p[u0+1],g).x;return Z}function Df(e,t,n,A,i,o,r,a){for(var c=[],l=[[],[]],B,g,p,E,d,u,h,D,y=0;y<2;++y){if(y==0?(g=6*e-12*n+6*i,B=-3*e+9*n-9*i+3*r,p=3*n-3*e):(g=6*t-12*A+6*o,B=-3*t+9*A-9*o+3*a,p=3*A-3*t),ft(B)<1e-12){if(ft(g)<1e-12)continue;E=-p/g,0<E&&E<1&&c.push(E);continue}h=g*g-4*p*B,D=K0.sqrt(h),!(h<0)&&(d=(-g+D)/(2*B),0<d&&d<1&&c.push(d),u=(-g-D)/(2*B),0<u&&u<1&&c.push(u))}for(var C=c.length,m=C,I;C--;)E=c[C],I=1-E,l[0][C]=I*I*I*e+3*I*I*E*n+3*I*E*E*i+E*E*E*r,l[1][C]=I*I*I*t+3*I*I*E*A+3*I*E*E*o+E*E*E*a;return l[0][m]=e,l[1][m]=t,l[0][m+1]=r,l[1][m+1]=a,l[0].length=l[1].length=m+2,{x0:Ye(...l[0]),y0:Ye(...l[1]),x1:Ue(...l[0]),y1:Ue(...l[1])}}function NB(e){var t=Tn(e);if(t.curve)return po(t.curve);for(var n=Mf(e),A={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=function(E,d,u){var h,D;if(!E)return["C",d.x,d.y,d.x,d.y,d.x,d.y];switch(!(E[0]in{T:1,Q:1})&&(d.qx=d.qy=null),E[0]){case"M":d.X=E[1],d.Y=E[2];break;case"A":E=["C",...UB(d.x,d.y,...E.slice(1))];break;case"S":u=="C"||u=="S"?(h=d.x*2-d.bx,D=d.y*2-d.by):(h=d.x,D=d.y),E=["C",h,D,...E.slice(1)];break;case"T":u=="Q"||u=="T"?(d.qx=d.x*2-d.qx,d.qy=d.y*2-d.qy):(d.qx=d.x,d.qy=d.y),E=["C",...YB(d.x,d.y,d.qx,d.qy,E[1],E[2])];break;case"Q":d.qx=E[1],d.qy=E[2],E=["C",...YB(d.x,d.y,E[1],E[2],E[3],E[4])];break;case"L":E=["C",...uo(d.x,d.y,E[1],E[2])];break;case"H":E=["C",...uo(d.x,d.y,E[1],d.y)];break;case"V":E=["C",...uo(d.x,d.y,d.x,E[1])];break;case"Z":E=["C",...uo(d.x,d.y,d.X,d.Y)];break}return E},o=function(E,d){if(E[d].length>7){E[d].shift();for(var u=E[d];u.length;)r[d]="A",E.splice(d++,0,["C",...u.splice(0,6)]);E.splice(d,1),B=n.length}},r=[],a="",c="",l=0,B=n.length;l<B;l++){n[l]&&(a=n[l][0]),a!="C"&&(r[l]=a,l&&(c=r[l-1])),n[l]=i(n[l],A,c),r[l]!="A"&&a=="C"&&(r[l]="C"),o(n,l);var g=n[l],p=g.length;A.x=g[p-2],A.y=g[p-1],A.bx=CB(g[p-4])||A.x,A.by=CB(g[p-3])||A.y}return t.curve=po(n),n}function Y0(e){return V0(e)&&I2(e,"waypoints")}function f0(e){return V0(e)&&I2(e,"labelTarget")}function zB(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function _e(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function e0(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Qo(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function yf(e){return _e({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function If(e){for(var t=e.waypoints,n=t.reduce(function(l,B,g){var p=t[g-1];if(p){var E=l[l.length-1],d=E&&E.endLength||0,u=xf(p,B);l.push({start:p,end:B,startLength:d,endLength:d+u,length:u})}return l},[]),A=n.reduce(function(l,B){return l+B.length},0),i=A/2,o=0,r=n[o];r.endLength<i;)r=n[++o];var a=(i-r.startLength)/r.length,c={x:r.start.x+(r.end.x-r.start.x)*a,y:r.start.y+(r.end.y-r.start.y)*a};return c}function i0(e){return Y0(e)?If(e):yf(e)}function f2(e,t,n){n=n||0,V0(n)||(n={x:n,y:n});var A=e0(e),i=e0(t),o=A.bottom+n.y<=i.top,r=A.left-n.x>=i.right,a=A.top-n.y>=i.bottom,c=A.right+n.x<=i.left,l=o?"top":a?"bottom":null,B=c?"left":r?"right":null;return B&&l?l+"-"+B:B||l||"intersect"}function wc(e,t,n){var A=Ff(e,t);return A.length===1||A.length===2&&NA(A[0],A[1])<1?_e(A[0]):A.length>1?(A=he(A,function(i){var o=Math.floor(i.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,i.segment2+"#"+o}),_e(A[n?0:A.length-1])):null}function Ff(e,t){return xB(e,t)}function vf(e){e=e.slice();for(var t=0,n,A,i;e[t];)n=e[t],A=e[t-1],i=e[t+1],NA(n,i)===0||dc(A,i,n)?e.splice(t,1):t++;return e}function xf(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ho(e,t){return Math.round(e*t)/t}function RB(e){return A0(e)?e+"px":e}function bf(e){for(;e.parent;)e=e.parent;return e}function Yf(e){e=N({},{width:"100%",height:"100%"},e);const t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),m2(n,{position:"relative",overflow:"hidden",width:RB(e.width),height:RB(e.height)}),t.appendChild(n),n}function SB(e,t,n){const A=g0("g");D0(A).add(t);const i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(A,e.childNodes[i]||null),A}const Uf="base",TB=0,Nf=1,zf={shape:["x","y","width","height"],connection:["waypoints"]};function o0(e,t,n,A){this._eventBus=t,this._elementRegistry=A,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}o0.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],o0.prototype._init=function(e){const t=this._eventBus,n=this._container=Yf(e),A=this._svg=g0("svg");q(A,{width:"100%",height:"100%"}),g2(A,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),A.addEventListener("focusin",()=>{this._setFocused(!0)}),A.addEventListener("focusout",()=>{this._setFocused(!1)}),Q0(n,A);const i=this._viewport=SB(A,"viewport");e.deferUpdate&&(this._viewboxChanged=tc(v2(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:A,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},o0.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},o0.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},o0.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{const n=wB(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},o0.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},o0.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()},o0.prototype.isFocused=function(){return this._focused},o0.prototype.getDefaultLayer=function(){return this.getLayer(Uf,TB)},o0.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t<"u"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},o0.prototype._getChildIndex=function(e){return F2(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},o0.prototype._createLayer=function(e,t){typeof t>"u"&&(t=Nf);const n=this._getChildIndex(t);return{group:SB(this._viewport,"layer-"+e,n),index:t,visible:!0}},o0.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,A=t.group,i=t.index;if(t.visible)return A;const o=this._getChildIndex(i);return n.insertBefore(A,n.childNodes[o]||null),t.visible=!0,A},o0.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible&&(s2(n),t.visible=!1),n},o0.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],s2(t.group))},o0.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},o0.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(bf(e))||{}).rootElement:void 0},o0.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},o0.prototype._findPlaneForRoot=function(e){return m0(this._planes,function(t){return t.rootElement===e})},o0.prototype.getContainer=function(){return this._container},o0.prototype._updateMarker=function(e,t,n){let A;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,A=this._elementRegistry._elements[e.id],A&&(U([A.gfx,A.secondaryGfx],function(i){i&&(n?(e.markers.add(t),D0(i).add(t)):(e.markers.delete(t),D0(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:A.gfx,marker:t,add:!!n}))},o0.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},o0.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},o0.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1},o0.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},o0.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},o0.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const A=this.getLayer(n,TB);return this.hideLayer(n),this._addRoot(e,A),this._planes.push({rootElement:e,layer:A}),e},o0.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},o0.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},o0.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},o0.prototype._addRoot=function(e,t){const n=this._elementRegistry,A=this._eventBus;A.fire("root.add",{element:e}),n.add(e,t),A.fire("root.added",{element:e,gfx:t})},o0.prototype._setRoot=function(e,t){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},o0.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const n=zf[e];if(!je(n,function(i){return typeof t[i]<"u"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},o0.prototype._setParent=function(e,t,n){o2(t.children,e,n),e.parent=t},o0.prototype._addElement=function(e,t,n,A){n=n||this.getRootElement();const i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,A);const r=o.create(e,t,A);return this._elementRegistry.add(t,r),o.update(e,t,r),i.fire(e+".added",{element:t,gfx:r}),t},o0.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},o0.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},o0.prototype._removeElement=function(e,t){const n=this._elementRegistry,A=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),A.remove(e),X0(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e},o0.prototype.removeShape=function(e){return this._removeElement(e,"shape")},o0.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},o0.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},o0.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},o0.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},o0.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let A,i,o,r,a,c,l;if(e)this._changeViewbox(function(){a=Math.min(n.width/e.width,n.height/e.height);const B=this._svg.createSVGMatrix().scale(a).translate(-e.x,-e.y);bA(t,B)});else return o=this._rootElement?this.getActiveLayer():null,A=o&&o.getBBox()||{},r=bA(t),i=r?r.matrix:ef(),a=ho(i.a,1e3),c=ho(-i.e||0,1e3),l=ho(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/a:0,y:l?l/a:0,width:n.width/a,height:n.height/a,scale:a,inner:{width:A.width||0,height:A.height||0,x:A.x||0,y:A.y||0},outer:n},e;return e},o0.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox(function(){e=N({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),kB(t,n)}),{x:n.e,y:n.f}},o0.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));const A=this.findRoot(e);if(A!==this.getRootElement()&&this.setRootElement(A),A===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const i=i2(e),o=e0(i),r=this.viewbox(),a=this.zoom();let c,l;r.y+=t.top/a,r.x+=t.left/a,r.width-=(t.right+t.left)/a,r.height-=(t.bottom+t.top)/a;const B=e0(r);if(!(i.width<r.width&&i.height<r.height))c=i.x-r.x,l=i.y-r.y;else{const p=Math.max(0,o.right-B.right),E=Math.min(0,o.left-B.left),d=Math.max(0,o.bottom-B.bottom),u=Math.min(0,o.top-B.top);c=p||E,l=d||u}this.scroll({dx:-c*a,dy:-l*a})},o0.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let n,A;return this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),A=this._setZoom(e,t)}),ho(A.a,1e3)};function kB(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}o0.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,A=t.inner;let i,o;return A.x>=0&&A.y>=0&&A.x+A.width<=n.width&&A.y+A.height<=n.height&&!e?o={x:0,y:0,width:Math.max(A.width+A.x,n.width),height:Math.max(A.height+A.y,n.height)}:(i=Math.min(1,n.width/A.width,n.height/A.height),o={x:A.x+(e?A.width/2-n.width/i/2:0),y:A.y+(e?A.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale},o0.prototype._setZoom=function(e,t){const n=this._svg,A=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint();let r,a,c,l,B;c=A.getCTM();const g=c.a;return t?(r=N(o,t),a=r.matrixTransform(c.inverse()),l=i.translate(a.x,a.y).scale(1/g*e).translate(-a.x,-a.y),B=c.multiply(l)):B=i.scale(e),kB(this._viewport,B),B},o0.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},o0.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;const A=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,r=n.height*t.scale;return{x:A,y:i,width:o,height:r}},o0.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var kn="data-element-id";function J2(e){this._elements={},this._eventBus=e}J2.$inject=["eventBus"],J2.prototype.add=function(e,t,n){var A=e.id;this._validateId(A),q(t,kn,A),n&&q(n,kn,A),this._elements[A]={element:e,gfx:t,secondaryGfx:n}},J2.prototype.remove=function(e){var t=this._elements,n=e.id||e,A=n&&t[n];A&&(q(A.gfx,kn,""),A.secondaryGfx&&q(A.secondaryGfx,kn,""),delete t[n])},J2.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),A=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,A)},J2.prototype.updateGraphics=function(e,t,n){var A=e.id||e,i=this._elements[A];return n?i.secondaryGfx=t:i.gfx=t,t&&q(t,kn,A),t},J2.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&q(e,kn);var n=this._elements[t];return n&&n.element},J2.prototype.filter=function(e){var t=[];return this.forEach(function(n,A){e(n,A)&&t.push(n)}),t},J2.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),A=0;A<n.length;A++){var i=n[A],o=t[i],r=o.element,a=o.gfx;if(e(r,a))return r}},J2.prototype.getAll=function(){return this.filter(function(e){return e})},J2.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var A=t[n],i=A.element,o=A.gfx;return e(i,o)})},J2.prototype.getGraphics=function(e,t){var n=e.id||e,A=this._elements[n];return A&&(t?A.secondaryGfx:A.gfx)},J2.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};function Rf(e,t,n,A){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var r=this.indexOf(o);return r!==-1&&(this.splice(r,1),t.unset(o,i,A)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,r){var a=this.indexOf(o);if(typeof r>"u"){if(a!==-1)return;r=this.length}a!==-1&&this.splice(a,1),this.splice(r,0,o),a===-1&&t.set(o,i,A)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function Sf(e){return e.__refs_collection===!0}function Tf(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function GB(e,t,n){var A=Rf(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:A}),A.length&&A.forEach(function(i){e.set(i,t.inverse,n)})}function kf(e,t,n){var A=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(o){if(o!==i){var r=i;i=null,r&&e.unset(r,A,n),i=o,e.set(i,A,n)}}})}function $2(e,t){if(!(this instanceof $2))return new $2(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}$2.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?GB(this,t,e):kf(this,t,e)},$2.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Sf(n)||GB(this,t,e),n},$2.prototype.ensureBound=function(e,t){Tf(e,t)||this.bind(e,t)},$2.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},$2.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var mc=new $2({name:"children",enumerable:!0,collection:!0},{name:"parent"}),HB=new $2({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),PB=new $2({name:"attachers",collection:!0},{name:"host"}),JB=new $2({name:"outgoing",collection:!0},{name:"source"}),jB=new $2({name:"incoming",collection:!0},{name:"target"});function Gn(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),mc.bind(this,"parent"),HB.bind(this,"labels"),JB.bind(this,"outgoing"),jB.bind(this,"incoming")}function RA(){Gn.call(this),mc.bind(this,"children"),PB.bind(this,"host"),PB.bind(this,"attachers")}W(RA,Gn);function VB(){Gn.call(this),mc.bind(this,"children")}W(VB,RA);function LB(){RA.call(this),HB.bind(this,"labelTarget")}W(LB,RA);function WB(){Gn.call(this),JB.bind(this,"source"),jB.bind(this,"target")}W(WB,Gn);var Gf={connection:WB,shape:RA,label:LB,root:VB};function Hf(e,t){var n=Gf[e];if(!n)throw new Error("unknown type: <"+e+">");return N(new n,t)}function Pf(e){return e instanceof Gn}function Oe(){this._uid=12}Oe.prototype.createRoot=function(e){return this.create("root",e)},Oe.prototype.createLabel=function(e){return this.create("label",e)},Oe.prototype.createShape=function(e){return this.create("shape",e)},Oe.prototype.createConnection=function(e){return this.create("connection",e)},Oe.prototype.create=function(e,t){return t=N({},t||{}),t.id||(t.id=e+"_"+this._uid++),Hf(e,t)};var wo="__fn",_B=1e3,Jf=Array.prototype.slice;function k2(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}k2.prototype.on=function(e,t,n,A){if(e=n0(e)?e:[e],n2(t)&&(A=n,n=t,t=_B),!A0(t))throw new Error("priority must be a number");var i=n;A&&(i=v2(n,A),i[wo]=n[wo]||n);var o=this;e.forEach(function(r){o._addListener(r,{priority:t,callback:i,next:null})})},k2.prototype.once=function(e,t,n,A){var i=this;if(n2(t)&&(A=n,n=t,t=_B),!A0(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var r=n.apply(A,arguments);return i.off(e,o),r}o[wo]=n,this.on(e,t,o)},k2.prototype.off=function(e,t){e=n0(e)?e:[e];var n=this;e.forEach(function(A){n._removeListener(A,t)})},k2.prototype.createEvent=function(e){var t=new SA;return t.init(e),t},k2.prototype.fire=function(e,t){var n,A,i,o;if(o=Jf.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(A=this._listeners[e],!!A){t instanceof SA?n=t:n=this.createEvent(t),o[0]=n;var r=n.type;e!==r&&(n.type=e);try{i=this._invokeListeners(n,o,A)}finally{e!==r&&(n.type=r)}return i===void 0&&n.defaultPrevented&&(i=!1),i}},k2.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},k2.prototype._destroy=function(){this._listeners={}},k2.prototype._invokeListeners=function(e,t,n){for(var A;n&&!e.cancelBubble;)A=this._invokeListener(e,t,n),n=n.next;return A},k2.prototype._invokeListener=function(e,t,n){var A;if(n.callback.__isTomb)return A;try{A=jf(n.callback,t),A!==void 0&&(e.returnValue=A,e.stopPropagation()),A===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return A},k2.prototype._addListener=function(e,t){var n=this._getListeners(e),A;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority<t.priority){t.next=n,A?A.next=t:this._setListeners(e,t);return}A=n,n=n.next}A.next=t},k2.prototype._getListeners=function(e){return this._listeners[e]},k2.prototype._setListeners=function(e,t){this._listeners[e]=t},k2.prototype._removeListener=function(e,t){var n=this._getListeners(e),A,i,o;if(!t){this._setListeners(e,null);return}for(;n;)A=n.next,o=n.callback,(o===t||o[wo]===t)&&(i?i.next=A:this._setListeners(e,A)),i=n,n=A};function SA(){}SA.prototype.stopPropagation=function(){this.cancelBubble=!0},SA.prototype.preventDefault=function(){this.defaultPrevented=!0},SA.prototype.init=function(e){N(this,e||{})};function jf(e,t){return e.apply(null,t)}function Mt(e){return e.childNodes[0]}function Vf(e){return e.parentNode.childNodes[1]}function mo(e,t,n,A,i){var o=xA();o.setTranslate(t,n);var r=xA();r.setRotate(A||0,0,0);var a=xA();a.setScale(1,1),bA(e,[o,r,a])}function Q2(e,t,n){var A=xA();A.setTranslate(t,n),bA(e,A)}function OB(e,t){var n=xA();n.setRotate(t,0,0),bA(e,n)}function j2(e,t){this._eventBus=e,this._elementRegistry=t}j2.$inject=["eventBus","elementRegistry"],j2.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=Vf(t),n||(n=g0("g"),D0(n).add("djs-children"),Q0(t.parentNode,n))):n=t,n},j2.prototype._clear=function(e){var t=Mt(e);return vA(t),t},j2.prototype._createContainer=function(e,t,n,A){var i=g0("g");D0(i).add("djs-group"),typeof n<"u"?XB(i,t,t.childNodes[n]):Q0(t,i);var o=g0("g");D0(o).add("djs-element"),D0(o).add("djs-"+e),A&&D0(o).add("djs-frame"),Q0(i,o);var r=g0("g");return D0(r).add("djs-visual"),Q0(o,r),o},j2.prototype.create=function(e,t,n){var A=this._getChildrenContainer(t.parent);return this._createContainer(e,A,n,mB(t))},j2.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,A;A=F2(e,function(i,o){return o.parent&&(i[o.parent.id]=o.parent),i},{}),U(A,function(i){var o=i.children;if(o){var r=t._getChildrenContainer(i);U(o.slice().reverse(),function(a){var c=n.getGraphics(a);XB(c.parentNode,r)})}})},j2.prototype.drawShape=function(e,t,n={}){var A=this._eventBus;return A.fire("render.shape",{gfx:e,element:t,attrs:n})},j2.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)},j2.prototype.drawConnection=function(e,t,n={}){var A=this._eventBus;return A.fire("render.connection",{gfx:e,element:t,attrs:n})},j2.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)},j2.prototype.update=function(e,t,n){if(t.parent){var A=this._clear(n);if(e==="shape")this.drawShape(A,t),Q2(n,t.x,t.y);else if(e==="connection")this.drawConnection(A,t);else throw new Error("unknown type: "+e);t.hidden?q(n,"display","none"):q(n,"display","block")}},j2.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);s2(t.parentNode)};function XB(e,t,n){var A=n||t.firstChild;e!==A&&t.insertBefore(e,A)}const Lf={__depends__:[Bf],__init__:["canvas"],canvas:["type",o0],elementRegistry:["type",J2],elementFactory:["type",Oe],eventBus:["type",k2],graphicsFactory:["type",j2]};function Wf(e){var t=new cB(e);return t.init(),t}function _f(e){e=e||{};var t={config:["value",e]},n=[t,Lf].concat(e.modules||[]);return Wf(n)}function Dt(e,t){this._injector=t||_f(e),this.get("eventBus").fire("diagram.init")}Dt.prototype.get=function(e,t){return this._injector.get(e,t)},Dt.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},Dt.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Dt.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};function fc(){}fc.prototype.get=function(e){return this.$model.properties.get(this,e)},fc.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function KB(e,t){this.model=e,this.properties=t}KB.prototype.createType=function(e){var t=this.model,n=this.properties,A=Object.create(fc.prototype);U(e.properties,function(r){!r.isMany&&r.default!==void 0&&(A[r.name]=r.default)}),n.defineModel(A,t),n.defineDescriptor(A,e);var i=e.ns.name;function o(r){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),U(r,v2(function(a,c){this.set(c,a)},this))}return o.prototype=A,o.hasType=A.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Of={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},ZB={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Cc(e,t){var n=ZB[e];return n?n(t):t}function Mc(e){return!!Of[e]}function qB(e){return!!ZB[e]}function C2(e,t){var n=e.split(/:/),A,i;if(n.length===1)A=e,i=t;else if(n.length===2)A=n[1],i=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+e);return e=(i?i+":":"")+A,{name:e,prefix:i,localName:A}}function V2(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}V2.prototype.build=function(){return q2(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},V2.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var A=this.properties;t!==void 0?A.splice(t,0,e):A.push(e)},V2.prototype.replaceProperty=function(e,t,n){var A=e.ns,i=this.properties,o=this.propertiesByName,r=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var a=i.indexOf(e);if(a===-1)throw new Error("property <"+A.name+"> not found in property list");i.splice(a,1),this.addProperty(t,n?void 0:a,r),o[A.name]=o[A.localName]=t},V2.prototype.redefineProperty=function(e,t,n){var A=e.ns.prefix,i=t.split("#"),o=C2(i[0],A),r=C2(i[1],o.prefix).name,a=this.propertiesByName[r];if(a)this.replaceProperty(a,e,n);else throw new Error("refined property <"+r+"> not found");delete e.redefines},V2.prototype.addNamedProperty=function(e,t){var n=e.ns,A=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),A[n.name]=A[n.localName]=e},V2.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},V2.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},V2.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},V2.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},V2.prototype.assertNotDefined=function(e,t){var n=e.name,A=this.propertiesByName[n];if(A)throw new Error("property <"+n+"> already defined; override of <"+A.definedBy.ns.name+"#"+A.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},V2.prototype.hasProperty=function(e){return this.propertiesByName[e]},V2.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,A=this.allTypes,i=e.name;i in n||(U(e.properties,v2(function(o){o=N({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var r=o.replaces,a=o.redefines;r||a?this.redefineProperty(o,r||a,r):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),A.push(e),n[i]=e)};function yt(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,U(e,v2(this.registerPackage,this))}yt.prototype.getPackage=function(e){return this.packageMap[e]},yt.prototype.getPackages=function(){return this.packages},yt.prototype.registerPackage=function(e){e=N({},e);var t=this.packageMap;$B(t,e,"prefix"),$B(t,e,"uri"),U(e.types,v2(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},yt.prototype.registerType=function(e,t){e=N({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:N(e.meta||{})});var n=C2(e.name,t.prefix),A=n.name,i={};U(e.properties,v2(function(o){var r=C2(o.name,n.prefix),a=r.name;Mc(o.type)||(o.type=C2(o.type,r.prefix).name),N(o,{ns:r,name:a}),i[a]=o},this)),N(e,{ns:n,name:A,propertiesByName:i}),U(e.extends,v2(function(o){var r=C2(o,n.prefix),a=this.typeMap[r.name];a.traits=a.traits||[],a.traits.push(A)},this)),this.definePackage(e,t),this.typeMap[A]=e},yt.prototype.mapTypes=function(e,t,n){var A=Mc(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,l){var B=C2(c,Mc(c)?"":e.prefix);i.mapTypes(B,t,l)}function r(c){return o(c,!0)}function a(c){return o(c,!1)}if(!A)throw new Error("unknown type <"+e.name+">");U(A.superClass,n?r:a),t(A,!n),U(A.traits,r)},yt.prototype.getEffectiveDescriptor=function(e){var t=C2(e),n=new V2(t);this.mapTypes(t,function(i,o){n.addTrait(i,o)});var A=n.build();return this.definePackage(A,A.allTypes[A.allTypes.length-1].$pkg),A},yt.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function $B(e,t,n){var A=t[n];if(A in e)throw new Error("package with "+n+" <"+A+"> already defined")}function An(e){this.model=e}An.prototype.set=function(e,t,n){if(!U2(t)||!t.length)throw new TypeError("property name must be a non-empty string");var A=this.getProperty(e,t),i=A&&A.name;Xf(n)?A?delete e[i]:delete e.$attrs[Dc(t)]:A?i in e?e[i]=n:eg(e,A,n):e.$attrs[Dc(t)]=n},An.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Dc(t)];var A=n.name;return!e[A]&&n.isMany&&eg(e,n,[]),e[A]},An.prototype.define=function(e,t,n){if(!n.writable){var A=n.value;n=N({},n,{get:function(){return A}}),delete n.value}Object.defineProperty(e,t,n)},An.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},An.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},An.prototype.getProperty=function(e,t){var n=this.model,A=n.getPropertyDescriptor(e,t);if(A)return A;if(t.includes(":"))return null;const i=n.config.strict;if(typeof i<"u"){const o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console<"u"&&console.warn(o)}return null};function Xf(e){return typeof e>"u"}function eg(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Dc(e){return e.replace(/^:/,"")}function ee(e,t={}){this.properties=new An(this),this.factory=new KB(this,this.properties),this.registry=new yt(e,this.properties),this.typeCache={},this.config=t}ee.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},ee.prototype.getType=function(e){var t=this.typeCache,n=U2(e)?e:e.ns.name,A=t[n];return A||(e=this.registry.getEffectiveDescriptor(n),A=t[n]=this.factory.createType(e)),A},ee.prototype.createAny=function(e,t,n){var A=C2(e),i={$type:e,$instanceOf:function(r){return r===this.$type},get:function(r){return this[r]},set:function(r,a){Kl(this,[r],a)}},o={name:e,isGeneric:!0,ns:{prefix:A.prefix,localName:A.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),U(n,function(r,a){V0(r)&&r.value!==void 0?i[r.name]=r.value:i[a]=r}),i},ee.prototype.getPackage=function(e){return this.registry.getPackage(e)},ee.prototype.getPackages=function(){return this.registry.getPackages()},ee.prototype.getElementDescriptor=function(e){return e.$descriptor},ee.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName},ee.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},ee.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var tg=String.fromCharCode,Kf=Object.prototype.hasOwnProperty,Zf=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,TA={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(TA).forEach(function(e){TA[e.toUpperCase()]=TA[e]});function qf(e,t,n,A){return A?Kf.call(TA,A)?TA[A]:"&"+A+";":tg(t||parseInt(n,16))}function on(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(Zf,qf):e}var ng="non-whitespace outside of root node";function Hn(e){return new Error(e)}function Ag(e){return"missing namespace for prefix <"+e+">"}function fo(e){return{get:e,enumerable:!0}}function $f(e){var t={},n;for(n in e)t[n]=e[n];return t}function yc(e){return e+"$uri"}function eC(e){var t={},n,A;for(n in e)A=e[n],t[A]=A,t[yc(A)]=n;return t}function ig(){return{line:0,column:0}}function tC(e){throw e}function og(e){if(!this)return new og(e);var t=e&&e.proxy,n,A,i,o,r=tC,a,c,l,B,g=ig,p=!1,E=!1,d=null,u=!1,h;function D(m){m instanceof Error||(m=Hn(m)),d=m,r(m,g)}function y(m){a&&(m instanceof Error||(m=Hn(m)),a(m,g))}this.on=function(m,I){if(typeof I!="function")throw Hn("required args <name, cb>");switch(m){case"openTag":A=I;break;case"text":n=I;break;case"closeTag":i=I;break;case"error":r=I;break;case"warn":a=I;break;case"cdata":o=I;break;case"attention":B=I;break;case"question":l=I;break;case"comment":c=I;break;default:throw Hn("unsupported event: "+m)}return this},this.ns=function(m){if(typeof m>"u"&&(m={}),typeof m!="object")throw Hn("required args <nsMap={}>");var I={},x;for(x in m)I[x]=m[x];return E=!0,h=I,this},this.parse=function(m){if(typeof m!="string")throw Hn("required args <xml=string>");return d=null,C(m),g=ig,u=!1,d},this.stop=function(){u=!0};function C(m){var I=E?[]:null,x=E?eC(h):null,v,F=[],z=0,R=!1,k=!1,T=0,H=0,K,x0,d0,t0,G0,u2,R0,r2,J,V="",Z=0,u0;function y2(){if(u0!==null)return u0;var w,Q,b,Y=E&&x.xmlns,S=E&&p?[]:null,G=Z,_=V,s0=_.length,W0,j0,I0,de,N0,dt={},Xa={},K2,c0,b0;e:for(;G<s0;G++)if(K2=!1,c0=_.charCodeAt(G),!(c0===32||c0<14&&c0>8)){for((c0<65||c0>122||c0>90&&c0<97)&&c0!==95&&c0!==58&&(y("illegal first char attribute name"),K2=!0),b0=G+1;b0<s0;b0++)if(c0=_.charCodeAt(b0),!(c0>96&&c0<123||c0>64&&c0<91||c0>47&&c0<59||c0===46||c0===45||c0===95)){if(c0===32||c0<14&&c0>8){y("missing attribute value"),G=b0;continue e}if(c0===61)break;y("illegal attribute name char"),K2=!0}if(N0=_.substring(G,b0),N0==="xmlns:xmlns"&&(y("illegal declaration of xmlns"),K2=!0),c0=_.charCodeAt(b0+1),c0===34)b0=_.indexOf('"',G=b0+2),b0===-1&&(b0=_.indexOf("'",G),b0!==-1&&(y("attribute value quote missmatch"),K2=!0));else if(c0===39)b0=_.indexOf("'",G=b0+2),b0===-1&&(b0=_.indexOf('"',G),b0!==-1&&(y("attribute value quote missmatch"),K2=!0));else for(y("missing attribute value quotes"),K2=!0,b0=b0+1;b0<s0&&(c0=_.charCodeAt(b0+1),!(c0===32||c0<14&&c0>8));b0++);for(b0===-1&&(y("missing closing quotes"),b0=s0,K2=!0),K2||(I0=_.substring(G,b0)),G=b0;b0+1<s0&&(c0=_.charCodeAt(b0+1),!(c0===32||c0<14&&c0>8));b0++)G===b0&&(y("illegal character after attribute end"),K2=!0);if(G=b0+1,K2)continue e;if(N0 in Xa){y("attribute <"+N0+"> already defined");continue}if(Xa[N0]=!0,!E){dt[N0]=I0;continue}if(p){if(j0=N0==="xmlns"?"xmlns":N0.charCodeAt(0)===120&&N0.substr(0,6)==="xmlns:"?N0.substr(6):null,j0!==null){if(w=on(I0),Q=yc(j0),de=h[w],!de){if(j0==="xmlns"||Q in x&&x[Q]!==w)do de="ns"+z++;while(typeof x[de]<"u");else de=j0;h[w]=de}x[j0]!==de&&(W0||(x=$f(x),W0=!0),x[j0]=de,j0==="xmlns"&&(x[yc(de)]=w,Y=de),x[Q]=w),dt[N0]=I0;continue}S.push(N0,I0);continue}if(c0=N0.indexOf(":"),c0===-1){dt[N0]=I0;continue}if(!(b=x[N0.substring(0,c0)])){y(Ag(N0.substring(0,c0)));continue}N0=Y===b?N0.substr(c0+1):b+N0.substr(c0),dt[N0]=I0}if(p)for(G=0,s0=S.length;G<s0;G++){if(N0=S[G++],I0=S[G],c0=N0.indexOf(":"),c0!==-1){if(!(b=x[N0.substring(0,c0)])){y(Ag(N0.substring(0,c0)));continue}N0=Y===b?N0.substr(c0+1):b+N0.substr(c0)}dt[N0]=I0}return u0=dt}function M(){for(var w=/(\r\n|\r|\n)/g,Q=0,b=0,Y=0,S=H,G,_;T>=Y&&(G=w.exec(m),!(!G||(S=G[0].length+G.index,S>T)));)Q+=1,Y=S;return T==-1?(b=S,_=m.substring(H)):H===0?_=m.substring(H,T):(b=T-Y,_=H==-1?m.substring(T):m.substring(T,H+1)),{data:_,line:Q,column:b}}for(g=M,t&&(J=Object.create({},{name:fo(function(){return R0}),originalName:fo(function(){return r2}),attrs:fo(y2),ns:fo(function(){return x})}));H!==-1;){if(m.charCodeAt(H)===60?T=H:T=m.indexOf("<",H),T===-1){if(F.length)return D("unexpected end of file");if(H===0)return D("missing start tag");H<m.length&&m.substring(H).trim()&&y(ng);return}if(H!==T){if(F.length){if(n&&(n(m.substring(H,T),on,g),u))return}else if(m.substring(H,T).trim()&&(y(ng),u))return}if(t0=m.charCodeAt(T+1),t0===33){if(d0=m.charCodeAt(T+2),d0===91&&m.substr(T+3,6)==="CDATA["){if(H=m.indexOf("]]>",T),H===-1)return D("unclosed cdata");if(o&&(o(m.substring(T+9,H),g),u))return;H+=3;continue}if(d0===45&&m.charCodeAt(T+3)===45){if(H=m.indexOf("-->",T),H===-1)return D("unclosed comment");if(c&&(c(m.substring(T+4,H),on,g),u))return;H+=3;continue}}if(t0===63){if(H=m.indexOf("?>",T),H===-1)return D("unclosed question");if(l&&(l(m.substring(T,H+2),g),u))return;H+=2;continue}for(K=T+1;;K++){if(G0=m.charCodeAt(K),isNaN(G0))return H=-1,D("unclosed tag");if(G0===34)d0=m.indexOf('"',K+1),K=d0!==-1?d0:K;else if(G0===39)d0=m.indexOf("'",K+1),K=d0!==-1?d0:K;else if(G0===62){H=K;break}}if(t0===33){if(B&&(B(m.substring(T,H+1),on,g),u))return;H+=1;continue}if(u0={},t0===47){if(R=!1,k=!0,!F.length)return D("missing open tag");if(K=R0=F.pop(),d0=T+2+K.length,m.substring(T+2,d0)!==K)return D("closing tag mismatch");for(;d0<H;d0++)if(t0=m.charCodeAt(d0),!(t0===32||t0>8&&t0<14))return D("close tag")}else{if(m.charCodeAt(H-1)===47?(K=R0=m.substring(T+1,H-1),R=!0,k=!0):(K=R0=m.substring(T+1,H),R=!0,k=!1),!(t0>96&&t0<123||t0>64&&t0<91||t0===95||t0===58))return D("illegal first char nodeName");for(d0=1,x0=K.length;d0<x0;d0++)if(t0=K.charCodeAt(d0),!(t0>96&&t0<123||t0>64&&t0<91||t0>47&&t0<59||t0===45||t0===95||t0==46)){if(t0===32||t0<14&&t0>8){R0=K.substring(0,d0),u0=null;break}return D("invalid nodeName")}k||F.push(R0)}if(E){if(v=x,R&&(k||I.push(v),u0===null&&(p=K.indexOf("xmlns",d0)!==-1)&&(Z=d0,V=K,y2(),p=!1)),r2=R0,t0=R0.indexOf(":"),t0!==-1){if(u2=x[R0.substring(0,t0)],!u2)return D("missing namespace on <"+r2+">");R0=R0.substr(t0+1)}else u2=x.xmlns;u2&&(R0=u2+":"+R0)}if(R&&(Z=d0,V=K,A&&(t?A(J,on,k,g):A(R0,y2,on,k,g),u)))return;if(k){if(i&&(i(t?J:R0,on,R,g),u))return;E&&(R?x=v:x=I.pop())}H+=1}}}function rg(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Ic={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},ag="property";function cg(e){return e.xml&&e.xml.serialize}function nC(e){const t=cg(e);return t!==ag&&(t||null)}function AC(e){return e.charAt(0).toUpperCase()+e.slice(1)}function sg(e,t){return rg(t)?e.prefix+":"+AC(e.localName):e.name}function iC(e,t){var n=e.name,A=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&A.indexOf(i)===0?e.prefix+":"+A.slice(i.length):n}function oC(e,t,n){const A=C2(e,t.xmlns),i=`${t[A.prefix]||A.prefix}:${A.localName}`,o=C2(i);var r=n.getPackage(o.prefix);return iC(o,r)}function It(e){return new Error(e)}function Xe(e){return e.$descriptor}function rC(e){N(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw It("expected element");var n=this.elementsById,A=Xe(t),i=A.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw It("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function kA(){}kA.prototype.handleEnd=function(){},kA.prototype.handleText=function(){},kA.prototype.handleNode=function(){};function Fc(){}Fc.prototype=Object.create(kA.prototype),Fc.prototype.handleNode=function(){return this};function Pn(){}Pn.prototype=Object.create(kA.prototype),Pn.prototype.handleText=function(e){this.body=(this.body||"")+e};function GA(e,t){this.property=e,this.context=t}GA.prototype=Object.create(Pn.prototype),GA.prototype.handleNode=function(e){if(this.element)throw It("expected no sub nodes");return this.element=this.createReference(e),this},GA.prototype.handleEnd=function(){this.element.id=this.body},GA.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function vc(e,t){this.element=t,this.propertyDesc=e}vc.prototype=Object.create(Pn.prototype),vc.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Cc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function Co(){}Co.prototype=Object.create(Pn.prototype),Co.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function b2(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}b2.prototype=Object.create(Co.prototype),b2.prototype.addReference=function(e){this.context.addReference(e)},b2.prototype.handleText=function(e){var t=this.element,n=Xe(t),A=n.bodyProperty;if(!A)throw It("unexpected body text <"+e+">");Pn.prototype.handleText.call(this,e)},b2.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Xe(t),A=n.bodyProperty;A&&e!==void 0&&(e=Cc(A.type,e),t.set(A.name,e))},b2.prototype.createElement=function(e){var t=e.attributes,n=this.type,A=Xe(n),i=this.context,o=new n({}),r=this.model,a;return U(t,function(c,l){var B=A.propertiesByName[l],g;B&&B.isReference?B.isMany?(g=c.split(" "),U(g,function(p){i.addReference({element:o,property:B.ns.name,id:p})})):i.addReference({element:o,property:B.ns.name,id:c}):(B?c=Cc(B.type,c):l==="xmlns"?l=":"+l:(a=C2(l,A.ns.prefix),r.getPackage(a.prefix)&&i.addWarning({message:"unknown attribute <"+l+">",element:o,property:l,value:c})),o.set(l,c))}),o},b2.prototype.getPropertyForNode=function(e){var t=e.name,n=C2(t),A=this.type,i=this.model,o=Xe(A),r=n.name,a=o.propertiesByName[r];if(a&&!a.isAttr){const l=nC(a);if(l){const B=e.attributes[l];if(B){const g=oC(B,e.ns,i),p=i.getType(g);return N({},a,{effectiveType:Xe(p).name})}}return a}var c=i.getPackage(n.prefix);if(c){const l=sg(n,c),B=i.getType(l);if(a=m0(o.properties,function(g){return!g.isVirtual&&!g.isReference&&!g.isAttribute&&B.hasType(g.type)}),a)return N({},a,{effectiveType:Xe(B).name})}else if(a=m0(o.properties,function(l){return!l.isReference&&!l.isAttribute&&l.type==="Element"}),a)return a;throw It("unrecognized element <"+n.name+">")},b2.prototype.toString=function(){return"ElementDescriptor["+Xe(this.type).name+"]"},b2.prototype.valueHandler=function(e,t){return new vc(e,t)},b2.prototype.referenceHandler=function(e){return new GA(e,this.context)},b2.prototype.handler=function(e){return e==="Element"?new Jn(this.model,e,this.context):new b2(this.model,e,this.context)},b2.prototype.handleChild=function(e){var t,n,A,i;if(t=this.getPropertyForNode(e),A=this.element,n=t.effectiveType||t.type,qB(n))return this.valueHandler(t,A);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?A.get(t.name).push(o):A.set(t.name,o),t.isReference?(N(o,{element:A}),this.context.addReference(o)):o.$parent=A),i};function xc(e,t,n){b2.call(this,e,t,n)}xc.prototype=Object.create(b2.prototype),xc.prototype.createElement=function(e){var t=e.name,n=C2(t),A=this.model,i=this.type,o=A.getPackage(n.prefix),r=o&&sg(n,o)||t;if(!i.hasType(r))throw It("unexpected element <"+e.originalName+">");return b2.prototype.createElement.call(this,e)};function Jn(e,t,n){this.model=e,this.context=n}Jn.prototype=Object.create(Co.prototype),Jn.prototype.createElement=function(e){var t=e.name,n=C2(t),A=n.prefix,i=e.ns[A+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)},Jn.prototype.handleChild=function(e){var t=new Jn(this.model,"Element",this.context).handleNode(e),n=this.element,A=t.element,i;return A!==void 0&&(i=n.$children=n.$children||[],i.push(A),A.$parent=n),t},Jn.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function bc(e){e instanceof ee&&(e={model:e}),N(this,{lax:!1},e)}bc.prototype.fromXML=function(e,t,n){var A=t.rootHandler;t instanceof b2?(A=t,t={}):typeof t=="string"?(A=this.handler(t),t={}):typeof A=="string"&&(A=this.handler(A));var i=this.model,o=this.lax,r=new rC(N({},t,{rootHandler:A})),a=new og({proxy:!0}),c=aC();A.context=r,c.push(A);function l(I,x,v){var F=x(),z=F.line,R=F.column,k=F.data;k.charAt(0)==="<"&&k.indexOf(" ")!==-1&&(k=k.slice(0,k.indexOf(" "))+">");var T="unparsable content "+(k?k+" ":"")+`detected
40
+ }`,autosize:"",clearable:"",onChange:t[7]||(t[7]=g=>o.handleChange("requestBody",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"请求体编码",prop:"requestBodyEncoding","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.requestBodyEncoding,"onUpdate:modelValue":t[8]||(t[8]=g=>i.http.requestBodyEncoding=g),placeholder:"请求体编码",autosize:"",clearable:"",onChange:t[9]||(t[9]=g=>o.handleChange("requestBodyEncoding",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"超时时间"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.requestTimeout,"onUpdate:modelValue":t[10]||(t[10]=g=>i.http.requestTimeout=g),placeholder:"超时时间,单位毫秒",clearable:"",onChange:t[11]||(t[11]=g=>o.handleChange("requestTimeout",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"禁用重定向","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.disallowRedirects,"onUpdate:modelValue":t[12]||(t[12]=g=>i.http.disallowRedirects=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[13]||(t[13]=g=>o.handleChange("disallowRedirects",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"错误状态码","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.failStatusCodes,"onUpdate:modelValue":t[14]||(t[14]=g=>i.http.failStatusCodes=g),type:"textarea",placeholder:"逗号分隔的Http状态码,将令请求失败并抛出FlowableException",autosize:"",onChange:t[15]||(t[15]=g=>o.handleChange("failStatusCodes",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"捕获状态码","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.handleStatusCodes,"onUpdate:modelValue":t[16]||(t[16]=g=>i.http.handleStatusCodes=g),type:"textarea",placeholder:"逗号分隔的Http状态码,将令任务抛出BpmnError,并可用错误边界事件捕获",autosize:"",onChange:t[17]||(t[17]=g=>o.handleChange("handleStatusCodes",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"忽略异常","label-width":"160px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.ignoreException,"onUpdate:modelValue":t[18]||(t[18]=g=>i.http.ignoreException=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[19]||(t[19]=g=>o.handleChange("ignoreException",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"保存请求变量","label-width":"160px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.saveRequestVariables,"onUpdate:modelValue":t[20]||(t[20]=g=>i.http.saveRequestVariables=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[21]||(t[21]=g=>o.handleChange("saveRequestVariables",g))},null,8,["disabled","modelValue"]),t[30]||(t[30]=s.createElementVNode("h5",null,"默认只会保存响应相关的变量。",-1))]),_:1,__:[30]}),s.createVNode(c,{label:"保存全部的响应变量","label-width":"160px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.saveResponseParameters,"onUpdate:modelValue":t[22]||(t[22]=g=>i.http.saveResponseParameters=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[23]||(t[23]=g=>o.handleChange("saveResponseParameters",g))},null,8,["disabled","modelValue"]),t[31]||(t[31]=s.createElementVNode("h5",null,"包括HTTP状态码,响应头等。默认只会将响应体保存为变量。",-1))]),_:1,__:[31]}),s.createVNode(c,{label:"变量名前缀","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(l,{disabled:n.disabled,modelValue:i.http.resultVariablePrefix,"onUpdate:modelValue":t[24]||(t[24]=g=>i.http.resultVariablePrefix=g),placeholder:"默认变量名为<taskId>.fieldName",clearable:"",onChange:t[25]||(t[25]=g=>o.handleChange("resultVariablePrefix",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"瞬时变量","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.saveResponseParametersTransient,"onUpdate:modelValue":t[26]||(t[26]=g=>i.http.saveResponseParametersTransient=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[27]||(t[27]=g=>o.handleChange("saveResponseParametersTransient",g))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"JSON格式","label-width":"100px"},{default:s.withCtx(()=>[s.createVNode(B,{disabled:n.disabled,modelValue:i.http.saveResponseVariableAsJson,"onUpdate:modelValue":t[28]||(t[28]=g=>i.http.saveResponseVariableAsJson=g),"active-text":"是","inactive-text":"否","active-value":"true","inactive-value":"false",onChange:t[29]||(t[29]=g=>o.handleChange("saveResponseVariableAsJson",g))},null,8,["disabled","modelValue"])]),_:1})])}const vw=F0(Iw,[["render",Fw]]),xw={name:"shell",props:{disabled:{type:Boolean,default:!1}},mixins:[z0,v0],watch:{formData:{handler(){const e=this.getExtensionElementsEq("flowable:Field");e&&e.length>0&&e.forEach(t=>{this.shell[t.name]=t.string||t.expression})},deep:!0,immediate:!0}},data(){return{shell:{}}},methods:{handleChange(e,t){let{pattern:n}=this.scriptOption;if(n&&(n=new RegExp(n)),n&&e=="command"&&n.test(t)){this.$message.error("危险命令"),this.shell={},this.setExtensionElements("flowable:Field",[]);return}let A="string",i="expression";(t.includes("${")||t.includes("#{"))&&(A="expression",i="string");const o=this.getExtensionElementsEq("flowable:Field");let r=o.find(c=>c.name==e);r?(r[A]=t,r[i]=void 0):(r={[A]:t,name:e},o.push(r));const a=[];o.forEach(c=>{const{name:l,string:B,expression:g}=c;a.push({name:l,[B?"string":"expression"]:B||g})}),this.setExtensionElements("flowable:Field",a)}}},bw=["innerHTML"],Yw={key:0};function Uw(e,t,n,A,i,o){const r=s.resolveComponent("el-alert"),a=s.resolveComponent("el-input"),c=s.resolveComponent("el-form-item");return s.openBlock(),s.createElementBlock("div",null,[e.scriptOption&&e.scriptOption.alert?(s.openBlock(),s.createBlock(r,{key:0,style:{"margin-bottom":"10px"},type:"warning",closable:!1},{title:s.withCtx(()=>[s.createElementVNode("span",{innerHTML:e.scriptOption.alert},null,8,bw)]),_:1})):s.createCommentVNode("",!0),e.scriptOption&&e.scriptOption.enable?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[i.shell.command?(s.openBlock(),s.createBlock(r,{key:0,style:{"margin-bottom":"10px"},type:"success",closable:!1},{title:s.withCtx(()=>[i.shell.directory?(s.openBlock(),s.createElementBlock("span",Yw,"cd "+s.toDisplayString(i.shell.directory),1)):s.createCommentVNode("",!0)]),default:s.withCtx(()=>[s.createTextVNode(" "+s.toDisplayString(i.shell.command)+" "+s.toDisplayString(i.shell.arg0)+" "+s.toDisplayString(i.shell.arg1)+" "+s.toDisplayString(i.shell.arg2)+" "+s.toDisplayString(i.shell.arg3)+" "+s.toDisplayString(i.shell.arg4)+" "+s.toDisplayString(i.shell.arg5),1)]),_:1})):s.createCommentVNode("",!0),s.createVNode(c,{label:"命令",prop:"command"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.command,"onUpdate:modelValue":t[0]||(t[0]=l=>i.shell.command=l),placeholder:"命令",autosize:"",clearable:"",onChange:t[1]||(t[1]=l=>o.handleChange("command",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数0",prop:"arg0"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg0,"onUpdate:modelValue":t[2]||(t[2]=l=>i.shell.arg0=l),placeholder:"参数0",clearable:"",onChange:t[3]||(t[3]=l=>o.handleChange("arg0",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数1",prop:"arg1"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg1,"onUpdate:modelValue":t[4]||(t[4]=l=>i.shell.arg1=l),placeholder:"参数1",clearable:"",onChange:t[5]||(t[5]=l=>o.handleChange("arg1",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数2",prop:"arg2"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg2,"onUpdate:modelValue":t[6]||(t[6]=l=>i.shell.arg2=l),placeholder:"参数2",clearable:"",onChange:t[7]||(t[7]=l=>o.handleChange("arg2",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数3",prop:"arg3"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg3,"onUpdate:modelValue":t[8]||(t[8]=l=>i.shell.arg3=l),placeholder:"参数3",clearable:"",onChange:t[9]||(t[9]=l=>o.handleChange("arg3",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数4",prop:"arg4"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg4,"onUpdate:modelValue":t[10]||(t[10]=l=>i.shell.arg4=l),placeholder:"参数4",clearable:"",onChange:t[11]||(t[11]=l=>o.handleChange("arg4",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"参数5",prop:"arg5"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.arg5,"onUpdate:modelValue":t[12]||(t[12]=l=>i.shell.arg5=l),placeholder:"参数5",clearable:"",onChange:t[13]||(t[13]=l=>o.handleChange("arg5",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"输出变量",prop:"outputVariable"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.outputVariable,"onUpdate:modelValue":t[14]||(t[14]=l=>i.shell.outputVariable=l),placeholder:"输出变量",clearable:"",onChange:t[15]||(t[15]=l=>o.handleChange("outputVariable",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"错误变量",prop:"errorCodeVariable"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.errorCodeVariable,"onUpdate:modelValue":t[16]||(t[16]=l=>i.shell.errorCodeVariable=l),placeholder:"错误变量",clearable:"",onChange:t[17]||(t[17]=l=>o.handleChange("errorCodeVariable",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"初始目录",prop:"directory"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.shell.directory,"onUpdate:modelValue":t[18]||(t[18]=l=>i.shell.directory=l),placeholder:"初始目录",clearable:"",onChange:t[19]||(t[19]=l=>o.handleChange("directory",l))},null,8,["disabled","modelValue"])]),_:1})],64)):s.createCommentVNode("",!0)])}const Nw=F0(xw,[["render",Uw]]),zw={name:"mail",props:{disabled:{type:Boolean,default:!1}},mixins:[z0,v0],watch:{formData:{handler(){const e=this.getExtensionElementsEq("flowable:Field");e&&e.length>0&&e.forEach(t=>{this.mail[t.name]=t.string||t.expression})},deep:!0,immediate:!0}},data(){return{mail:{}}},methods:{handleChange(e,t){let n="string",A="expression";(t.includes("${")||t.includes("#{"))&&(n="expression",A="string");const i=this.getExtensionElementsEq("flowable:Field");let o=i.find(a=>a.name==e);o?(o[n]=t,o[A]=void 0):(o={[n]:t,name:e},i.push(o));const r=[];i.forEach(a=>{const{name:c,string:l,expression:B}=a;r.push({name:c,[l?"string":"expression"]:l||B})}),this.setExtensionElements("flowable:Field",r)}}};function Rw(e,t,n,A,i,o){const r=s.resolveComponent("el-alert"),a=s.resolveComponent("el-input"),c=s.resolveComponent("el-form-item");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(r,{style:{"margin-bottom":"10px"},type:"warning",title:"使用前请先参照文档配置邮件服务器!!!",closable:!1}),s.createVNode(c,{label:"收信人"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.to,"onUpdate:modelValue":t[0]||(t[0]=l=>i.mail.to=l),placeholder:"收信人,多个逗号分隔",type:"textarea",autosize:"",clearable:"",onChange:t[1]||(t[1]=l=>o.handleChange("to",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"发信人"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.from,"onUpdate:modelValue":t[2]||(t[2]=l=>i.mail.from=l),placeholder:"发信人,不设置使用默认发信人",clearable:"",onChange:t[3]||(t[3]=l=>o.handleChange("from",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"主题"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.subject,"onUpdate:modelValue":t[4]||(t[4]=l=>i.mail.subject=l),placeholder:"主题",type:"textarea",autosize:"",onChange:t[5]||(t[5]=l=>o.handleChange("subject",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"抄送人"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.cc,"onUpdate:modelValue":t[6]||(t[6]=l=>i.mail.cc=l),placeholder:"抄送人,多个逗号分隔",type:"textarea",autosize:"",onChange:t[7]||(t[7]=l=>o.handleChange("cc",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"密送人"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.bcc,"onUpdate:modelValue":t[8]||(t[8]=l=>i.mail.bcc=l),placeholder:"密送人,多个逗号分隔",type:"textarea",autosize:"",onChange:t[9]||(t[9]=l=>o.handleChange("bcc",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"字符集"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.charset,"onUpdate:modelValue":t[10]||(t[10]=l=>i.mail.charset=l),placeholder:"字符集",clearable:"",onChange:t[11]||(t[11]=l=>o.handleChange("charset",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"html"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.html,"onUpdate:modelValue":t[12]||(t[12]=l=>i.mail.html=l),placeholder:"html",type:"textarea",autosize:"",onChange:t[13]||(t[13]=l=>o.handleChange("html",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"text"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.text,"onUpdate:modelValue":t[14]||(t[14]=l=>i.mail.text=l),placeholder:"text",type:"textarea",autosize:"",onChange:t[15]||(t[15]=l=>o.handleChange("text",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"html变量"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.htmlVar,"onUpdate:modelValue":t[16]||(t[16]=l=>i.mail.htmlVar=l),placeholder:"html变量名",clearable:"",onChange:t[17]||(t[17]=l=>o.handleChange("htmlVar",l))},null,8,["disabled","modelValue"])]),_:1}),s.createVNode(c,{label:"text变量"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.mail.textVar,"onUpdate:modelValue":t[18]||(t[18]=l=>i.mail.textVar=l),placeholder:"text变量名",clearable:"",onChange:t[19]||(t[19]=l=>o.handleChange("textVar",l))},null,8,["disabled","modelValue"])]),_:1})])}const Sw={name:"service",props:{disabled:{type:Boolean,default:!1}},mixins:[z0,v0],components:{NfJavaService:yw,NfHttpService:vw,NfShellService:Nw,NfMailService:F0(zw,[["render",Rw]])},watch:{formData:{handler(e){const{delegateExpression:t,expression:n}=e,A=e.type,i=e.class;A?this.service.type=A:i?this.service.class="clazz":t?this.service.type="delegateExpression":n&&(this.service.type="expression")},deep:!0,immediate:!0}},data(){return{service:{}}},methods:{handleTypeChange(e){this.service.type=e,["http","shell","mail"].includes(e)&&this.updateProperties({type:e,class:void 0,delegateExpression:void 0,expression:void 0});const t=this.getExtensionElementsNotEq("flowable:Field");this.updateProperties({extensionElements:this.modeler.get("bpmnFactory").create("bpmn:ExtensionElements",{values:t})})}}};function Tw(e,t,n,A,i,o){const r=s.resolveComponent("el-option"),a=s.resolveComponent("el-select"),c=s.resolveComponent("el-form-item"),l=s.resolveComponent("nf-java-service"),B=s.resolveComponent("nf-http-service"),g=s.resolveComponent("nf-shell-service"),p=s.resolveComponent("nf-mail-service"),E=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(E,{model:i.service,"label-position":e.labelPosition,"label-suffix":":","label-width":"90px",size:"default"},{default:s.withCtx(()=>[s.createVNode(c,{label:e.t("nf.panel.node.service.type"),prop:"type"},{default:s.withCtx(()=>[s.createVNode(a,{disabled:n.disabled,modelValue:i.service.type,"onUpdate:modelValue":t[0]||(t[0]=d=>i.service.type=d),onChange:o.handleTypeChange,placeholder:e.t("nf.panel.node.service.type")},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.t("nf.panel.node.service.typeOption"),d=>(s.openBlock(),s.createBlock(r,{key:d.label,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["disabled","modelValue","onChange","placeholder"])]),_:1},8,["label"]),["class","delegateExpression","expression"].includes(i.service.type)?(s.openBlock(),s.createBlock(l,{key:0,disabled:n.disabled,modeler:e.modeler,element:e.element,"java-type":i.service.type},null,8,["disabled","modeler","element","java-type"])):s.createCommentVNode("",!0),["http"].includes(i.service.type)?(s.openBlock(),s.createBlock(B,{key:1,disabled:n.disabled,modeler:e.modeler,element:e.element},null,8,["disabled","modeler","element"])):s.createCommentVNode("",!0),["shell"].includes(i.service.type)?(s.openBlock(),s.createBlock(g,{key:2,disabled:n.disabled,modeler:e.modeler,element:e.element,"script-option":e.scriptOption},null,8,["disabled","modeler","element","script-option"])):s.createCommentVNode("",!0),["mail"].includes(i.service.type)?(s.openBlock(),s.createBlock(p,{key:3,disabled:n.disabled,modeler:e.modeler,element:e.element},null,8,["disabled","modeler","element"])):s.createCommentVNode("",!0)]),_:1},8,["model","label-position"])}const kw=F0(Sw,[["render",Tw]]),Gw={name:"nf-script",mixins:[z0,v0],watch:{formData:{handler(){this.updateProperties({extensionElements:this.modeler.get("bpmnFactory").create("bpmn:ExtensionElements",{values:void 0})})},deep:!0,immediate:!0}}},Hw=["innerHTML"];function Pw(e,t,n,A,i,o){const r=s.resolveComponent("el-alert"),a=s.resolveComponent("el-input"),c=s.resolveComponent("el-form-item"),l=s.resolveComponent("el-form");return s.openBlock(),s.createElementBlock("div",null,[e.scriptOption&&e.scriptOption.alert?(s.openBlock(),s.createBlock(r,{key:0,style:{"margin-bottom":"10px"},type:"warning",closable:!1},{title:s.withCtx(()=>[s.createElementVNode("span",{innerHTML:e.scriptOption.alert},null,8,Hw)]),_:1})):s.createCommentVNode("",!0),e.scriptOption&&e.scriptOption.enable?(s.openBlock(),s.createBlock(l,{key:1,"label-position":e.labelPosition,"label-suffix":":","label-width":"90px",size:"default"},{default:s.withCtx(()=>[s.createVNode(c,{label:"类型"},{default:s.withCtx(()=>[s.createVNode(a,{modelValue:e.formData.scriptFormat,"onUpdate:modelValue":t[0]||(t[0]=B=>e.formData.scriptFormat=B),placeholder:"类型",autosize:"",clearable:"",onInput:t[1]||(t[1]=B=>e.updateProperties({scriptFormat:e.formData.scriptFormat||void 0}))},null,8,["modelValue"])]),_:1}),s.createVNode(c,{label:"脚本"},{default:s.withCtx(()=>[s.createVNode(a,{modelValue:e.formData.script,"onUpdate:modelValue":t[2]||(t[2]=B=>e.formData.script=B),type:"textarea",placeholder:"脚本",autosize:"",onInput:t[3]||(t[3]=B=>e.updateProperties({script:e.formData.script||void 0}))},null,8,["modelValue"])]),_:1}),s.createVNode(c,{label:"结果变量"},{default:s.withCtx(()=>[s.createVNode(a,{modelValue:e.formData.resultVariable,"onUpdate:modelValue":t[4]||(t[4]=B=>e.formData.resultVariable=B),placeholder:"结果变量",autosize:"",clearable:"",onInput:t[5]||(t[5]=B=>e.updateProperties({resultVariable:e.formData.resultVariable||void 0}))},null,8,["modelValue"])]),_:1})]),_:1},8,["label-position"])):s.createCommentVNode("",!0)])}const Jw={name:"node-panel",mixins:[z0,v0],components:{NfBasic:hh,NfAssignee:yh,NfListener:Yh,NfExtendedProperty:zh,NfMultiInstance:kh,NfFormConfig:Ph,NfButton:Vh,NfCondition:_h,NfEvent:ww,NfCall:Cw,NfService:kw,NfScript:F0(Gw,[["render",Pw]])},mounted(){},computed:{type(){return P(this.element).$attrs.customType||this.element.type}},data(){return{activeName:["1"]}},methods:{changeCollapse(e){e=="close"?this.activeName=[]:this.activeName=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","99"]}}};function jw(e,t,n,A,i,o){const r=s.resolveComponent("el-icon-info-filled"),a=s.resolveComponent("el-icon"),c=s.resolveComponent("nf-basic"),l=s.resolveComponent("el-collapse-item"),B=s.resolveComponent("el-icon-comment"),g=s.resolveComponent("nf-form-config"),p=s.resolveComponent("el-icon-user-filled"),E=s.resolveComponent("nf-assignee"),d=s.resolveComponent("el-icon-histogram"),u=s.resolveComponent("nf-multi-instance"),h=s.resolveComponent("el-icon-warning-filled"),D=s.resolveComponent("nf-listener"),y=s.resolveComponent("nf-extended-property"),C=s.resolveComponent("el-icon-help-filled"),m=s.resolveComponent("nf-button"),I=s.resolveComponent("el-icon-promotion"),x=s.resolveComponent("nf-condition"),v=s.resolveComponent("el-icon-wallet-filled"),F=s.resolveComponent("nf-event"),z=s.resolveComponent("nf-call"),R=s.resolveComponent("nf-service"),k=s.resolveComponent("nf-script"),T=s.resolveComponent("el-icon-question-filled"),H=s.resolveComponent("el-collapse");return s.openBlock(),s.createBlock(H,{modelValue:i.activeName,"onUpdate:modelValue":t[0]||(t[0]=K=>i.activeName=K)},{default:s.withCtx(()=>[s.createElementVNode("pre",null,s.toDisplayString(o.type),1),s.createVNode(l,{name:"1"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.basic.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1})]),default:s.withCtx(()=>[s.createVNode(c,{modeler:e.modeler,element:e.element,nodes:e.backNodes},null,8,["modeler","element","nodes"])]),_:1}),o.type=="bpmn:StartEvent"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[e.getEventDefinitions(null)?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(l,{key:0,name:"5"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.form.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(B)]),_:1})]),default:s.withCtx(()=>[s.createVNode(g,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"form-option":e.formOption,"ex-form-option":e.exFormOption,"indep-form-option":e.indepFormOption},null,8,["modeler","element","user-option","form-option","ex-form-option","indep-form-option"])]),_:1}))],64)):s.createCommentVNode("",!0),o.type=="bpmn:UserTask"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(l,{name:"2"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.assignee.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(p)]),_:1})]),default:s.withCtx(()=>[s.createVNode(E,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"group-option":e.groupOption},null,8,["modeler","element","user-option","group-option"])]),_:1}),s.createVNode(l,{name:"3"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.multiInstance.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),default:s.withCtx(()=>[s.createVNode(u,{type:"UserTask",modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1}),s.createVNode(l,{name:"4"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.listener.taskTitle")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(h)]),_:1})]),default:s.withCtx(()=>[s.createVNode(D,{type:"Task",modeler:e.modeler,element:e.element,"listener-option":e.listenerOption},null,8,["modeler","element","listener-option"])]),_:1}),s.createVNode(l,{name:"41"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.extendedProperty.taskTitle")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(h)]),_:1})]),default:s.withCtx(()=>[s.createVNode(y,{type:"ExtendedProperty",modeler:e.modeler,element:e.element,"listener-option":e.extendedPropertyOption},null,8,["modeler","element","listener-option"])]),_:1}),s.createVNode(l,{name:"5"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.form.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(B)]),_:1})]),default:s.withCtx(()=>[s.createVNode(g,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"form-option":e.formOption,"ex-form-option":e.exFormOption,"indep-form-option":e.indepFormOption,nodes:e.backNodes},null,8,["modeler","element","user-option","form-option","ex-form-option","indep-form-option","nodes"])]),_:1}),e.buttonOption&&e.buttonOption.length>0?(s.openBlock(),s.createBlock(l,{key:0,name:"6"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.button.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(C)]),_:1})]),default:s.withCtx(()=>[s.createVNode(m,{modeler:e.modeler,element:e.element,"button-option":e.buttonOption},null,8,["modeler","element","button-option"])]),_:1})):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0),o.type=="bpmn:SequenceFlow"?(s.openBlock(),s.createBlock(l,{key:2,name:"2"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.condition.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(I)]),_:1})]),default:s.withCtx(()=>[s.createVNode(x,{modeler:e.modeler,element:e.element,"condition-option":e.conditionOption},null,8,["modeler","element","condition-option"])]),_:1})):s.createCommentVNode("",!0),o.type=="bpmn:SubProcess"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:3},[s.createVNode(l,{name:"2"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.assignee.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(p)]),_:1})]),default:s.withCtx(()=>[s.createVNode(E,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"group-option":e.groupOption},null,8,["modeler","element","user-option","group-option"])]),_:1}),s.createVNode(l,{name:"3"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.multiInstance.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),default:s.withCtx(()=>[s.createVNode(u,{type:"SubProcess",modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1})],64)):s.createCommentVNode("",!0),["bpmn:StartEvent","bpmn:EndEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:BoundaryEvent"].includes(o.type)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:4},[e.getEventDefinitions(null)?(s.openBlock(),s.createBlock(l,{key:0,name:"7"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.event.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(v)]),_:1})]),default:s.withCtx(()=>[s.createVNode(F,{modeler:e.modeler,element:e.element,nodes:e.nodes},null,8,["modeler","element","nodes"])]),_:1})):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0),["bpmn:CallActivity"].includes(o.type)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:5},[s.createVNode(l,{name:"8"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.call.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(v)]),_:1})]),default:s.withCtx(()=>[s.createVNode(z,{modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1}),s.createVNode(l,{name:"2"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.assignee.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(p)]),_:1})]),default:s.withCtx(()=>[s.createVNode(E,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"group-option":e.groupOption},null,8,["modeler","element","user-option","group-option"])]),_:1}),s.createVNode(l,{name:"3"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.multiInstance.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),default:s.withCtx(()=>[s.createVNode(u,{type:"SubProcess",modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1})],64)):s.createCommentVNode("",!0),["bpmn:ServiceTask","抄送任务"].includes(o.type)?(s.openBlock(),s.createBlock(l,{key:6,name:"9"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.service.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(v)]),_:1})]),default:s.withCtx(()=>[s.createVNode(R,{disabled:["抄送任务"].includes(o.type),modeler:e.modeler,element:e.element,"script-option":e.scriptOption?e.scriptOption.shell:null},null,8,["disabled","modeler","element","script-option"])]),_:1})):s.createCommentVNode("",!0),["bpmn:ScriptTask"].includes(o.type)?(s.openBlock(),s.createBlock(l,{key:7,name:"10"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.script.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(v)]),_:1})]),default:s.withCtx(()=>[s.createVNode(k,{modeler:e.modeler,element:e.element,"script-option":e.scriptOption?e.scriptOption.script:null},null,8,["modeler","element","script-option"])]),_:1})):s.createCommentVNode("",!0),["抄送任务"].includes(o.type)?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(l,{key:8,name:"99"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.listener.executionTitle")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(T)]),_:1})]),default:s.withCtx(()=>[s.createVNode(D,{type:"Execution",modeler:e.modeler,element:e.element,"listener-option":e.listenerOption},null,8,["modeler","element","listener-option"])]),_:1})),o.type=="抄送任务"?(s.openBlock(),s.createBlock(l,{key:9,name:"100"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.node.assignee.title")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(p)]),_:1})]),default:s.withCtx(()=>[s.createVNode(E,{modeler:e.modeler,element:e.element,"user-option":e.userOption,"group-option":e.groupOption},null,8,["modeler","element","user-option","group-option"])]),_:1})):s.createCommentVNode("",!0)]),_:1},8,["modelValue"])}const Vw=F0(Jw,[["render",jw]]),Lw={name:"nf-basic",mixins:[z0,v0]};function Ww(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("el-form-item"),c=s.resolveComponent("el-divider"),l=s.resolveComponent("el-switch"),B=s.resolveComponent("el-option"),g=s.resolveComponent("el-select"),p=s.resolveComponent("el-form");return s.openBlock(),s.createBlock(p,{model:e.formData,"label-position":e.labelPosition,"label-width":"110px","label-suffix":":",size:"default"},{default:s.withCtx(()=>[s.createVNode(a,{label:e.t("nf.panel.process.basic.key")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.id,"onUpdate:modelValue":t[0]||(t[0]=E=>e.formData.id=E),clearable:"",placeholder:e.t("nf.panel.process.basic.key"),onInput:t[1]||(t[1]=E=>e.updateProperties({id:e.formData.id}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.process.basic.name")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.name,"onUpdate:modelValue":t[2]||(t[2]=E=>e.formData.name=E),clearable:"",placeholder:e.t("nf.panel.process.basic.name"),onInput:t[3]||(t[3]=E=>e.updateProperties({name:e.formData.name}))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.process.basic.description")},{default:s.withCtx(()=>[s.createVNode(r,{modelValue:e.formData.description,"onUpdate:modelValue":t[4]||(t[4]=E=>e.formData.description=E),placeholder:e.t("nf.panel.process.basic.description"),clearable:"",onInput:e.updateDocumentation},null,8,["modelValue","placeholder","onInput"])]),_:1},8,["label"]),s.createVNode(c),s.createVNode(a,{label:e.t("nf.panel.process.basic.skipFirstNode"),"label-width":"120px"},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:e.formData.skipFirstNode,"onUpdate:modelValue":t[5]||(t[5]=E=>e.formData.skipFirstNode=E),onChange:t[6]||(t[6]=E=>e.updateProperties({skipFirstNode:e.formData.skipFirstNode||void 0}))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.process.basic.skipWhenStartUser"),"label-width":"210px"},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:e.formData.skipWhenStartUser,"onUpdate:modelValue":t[7]||(t[7]=E=>e.formData.skipWhenStartUser=E),onChange:t[8]||(t[8]=E=>e.updateProperties({skipWhenStartUser:e.formData.skipWhenStartUser||void 0}))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.process.basic.skipWhenAssignee"),"label-width":"210px"},{default:s.withCtx(()=>[s.createVNode(l,{modelValue:e.formData.skipWhenAssignee,"onUpdate:modelValue":t[9]||(t[9]=E=>e.formData.skipWhenAssignee=E),onChange:t[10]||(t[10]=E=>e.updateProperties({skipWhenAssignee:e.formData.skipWhenAssignee||void 0}))},null,8,["modelValue"])]),_:1},8,["label"]),s.createVNode(a,{label:e.t("nf.panel.process.basic.rollbackNode.label"),"label-width":"120px"},{default:s.withCtx(()=>[s.createVNode(g,{modelValue:e.formData.rollbackNode,"onUpdate:modelValue":t[11]||(t[11]=E=>e.formData.rollbackNode=E),clearable:"",placeholder:e.t("nf.panel.process.basic.rollbackNode.placeholder"),onChange:t[12]||(t[12]=E=>e.updateProperties({rollbackNode:e.formData.rollbackNode||void 0}))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.nodes,E=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[["bpmn:UserTask","bpmn:StartEvent"].includes(E.nodeType)?(s.openBlock(),s.createBlock(B,{key:E.id,label:E.name,value:E.id},null,8,["label","value"])):s.createCommentVNode("",!0)],64))),256))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","label-position"])}const _w=F0(Lw,[["render",Ww]]),Ow={name:"nf-basic",mixins:[z0,v0],watch:{formData:{handler(e){const t=this.getExtensionElementsEq(this.extensionType);t.length>0&&(this.serial=t[0])},deep:!0,immediate:!0},visible(e){e&&(this.option={labelWidth:110,labelPosition:this.labelPosition,column:[{label:this.t("nf.panel.process.sn.useExistSN"),prop:"useExistSN",labelWidth:150,labelTip:this.t("nf.panel.process.sn.useExistSNTip"),span:24,type:"switch",value:!1,rules:[{required:!0,trigger:"blur"}],change:({value:t})=>{const n=this.findObject(this.option.column,"dateFormat"),A=this.findObject(this.option.column,"suffixLength"),i=this.findObject(this.option.column,"startSequence"),o=this.findObject(this.option.column,"connector"),r=this.findObject(this.option.column,"cycle");t?(n.display=!1,A.display=!1,i.display=!1,o.display=!1,r.display=!1):(n.display=!0,A.display=!0,i.display=!0,o.display=!0,r.display=!0)}},{label:this.t("nf.panel.process.sn.name"),prop:"name",span:24,rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.name")}`}]},{label:this.t("nf.panel.process.sn.prefix"),prop:"prefix",span:24,rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.prefix")}`}]},{label:this.t("nf.panel.process.sn.dateFormat"),prop:"dateFormat",span:24,value:"yyyyMMdd",rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.dateFormat")}`}]},{label:this.t("nf.panel.process.sn.suffixLength"),prop:"suffixLength",type:"number",span:24,min:2,max:10,value:5,event:{change:t=>{if(!t)return;let n="";for(let i=0;i<t;i++)n+="9";const A=this.findObject(this.option.column,"startSequence");A&&A!=-1&&(A.maxRows=Number(n)),this.serial.startSequence>Number(n)&&(this.serial.startSequence=Number(n))}},rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.suffixLength")}`}]},{label:this.t("nf.panel.process.sn.initialValue"),prop:"startSequence",type:"number",span:24,min:0,value:0,rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.initialValue")}`}]},{label:this.t("nf.panel.process.sn.connector"),prop:"connector",span:24},{label:this.t("nf.panel.process.sn.resetCycle.label"),prop:"cycle",type:"select",span:24,dicData:this.t("nf.panel.process.sn.resetCycle.dicData"),value:"none",rules:[{required:!0,trigger:"blur",message:`请输入${this.t("nf.panel.process.sn.resetCycle")}`}]}]})}},data(){return{extensionType:"flowable:Serial",visible:!1,serial:{},option:{}}},methods:{handleSerialSubmit(e,t){const n=this.deepClone(this.serial);for(let A in n)A.startsWith("$")&&delete n[A];this.setExtensionElements(this.extensionType,[n]),t(),this.visible=!1}}},Xw={key:0,style:{"margin-top":"10px"},class:"el-form-item"},Kw={class:"el-form-item__label",style:{width:"100px","text-align":"left"}},Zw={key:0,class:"el-form-item__content"},qw={key:1,class:"el-form-item__content"};function $w(e,t,n,A,i,o){const r=s.resolveComponent("el-button"),a=s.resolveComponent("nf-form"),c=s.resolveComponent("el-drawer");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(r,{type:"primary",size:"default",onClick:t[0]||(t[0]=l=>i.visible=!0)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.t("nf.panel.process.sn.configure")),1)]),_:1}),i.serial&&i.serial.prefix&&i.serial.dateFormat&&i.serial.suffixLength?(s.openBlock(),s.createElementBlock("div",Xw,[s.createElementVNode("label",Kw,s.toDisplayString(e.t("nf.panel.process.sn.format"))+": ",1),i.serial&&i.serial.useExistSN?(s.openBlock(),s.createElementBlock("div",Zw,s.toDisplayString(e.t("nf.panel.process.sn.useExistSN"))+":"+s.toDisplayString(i.serial.name),1)):i.serial&&i.serial.prefix&&i.serial.dateFormat&&i.serial.suffixLength?(s.openBlock(),s.createElementBlock("div",qw,s.toDisplayString(i.serial.prefix)+s.toDisplayString(i.serial.connector)+s.toDisplayString(i.serial.dateFormat)+s.toDisplayString(i.serial.connector)+s.toDisplayString((i.serial.start?i.serial.start.toString():"1").padStart(i.serial.suffixLength,"0")),1)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),s.createVNode(c,{modelValue:i.visible,"onUpdate:modelValue":t[2]||(t[2]=l=>i.visible=l),title:e.t("nf.panel.process.sn.label"),size:"50%","append-to-body":""},{default:s.withCtx(()=>[i.visible?(s.openBlock(),s.createBlock(a,{key:0,modelValue:i.serial,"onUpdate:modelValue":t[1]||(t[1]=l=>i.serial=l),option:i.option,onSubmit:o.handleSerialSubmit},null,8,["modelValue","option","onSubmit"])):s.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}const em=F0(Ow,[["render",$w]]),tm={name:"nf-title",mixins:[z0,v0]};function nm(e,t,n,A,i,o){const r=s.resolveComponent("el-input"),a=s.resolveComponent("el-alert");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(r,{modelValue:e.formData.title,"onUpdate:modelValue":t[0]||(t[0]=c=>e.formData.title=c),type:"textarea",clearable:"",autosize:"",placeholder:"流程标题,默认值${#processDefName}",onInput:t[1]||(t[1]=c=>e.updateProperties({title:e.formData.title}))},null,8,["modelValue"]),t[5]||(t[5]=s.createElementVNode("p",null,"${#processDefId}: 流程部署id",-1)),t[6]||(t[6]=s.createElementVNode("p",null,"${#processDefName}: 流程部署名称",-1)),t[7]||(t[7]=s.createElementVNode("p",null,"${#processDefKey}: 流程部署key",-1)),t[8]||(t[8]=s.createElementVNode("p",null,"${#applyUser}: 发起人id",-1)),t[9]||(t[9]=s.createElementVNode("p",null,"${#applyUserName}: 发起人姓名",-1)),t[10]||(t[10]=s.createElementVNode("p",null,"${#dateFormat('yyMMddHHmm')}: 时间日期格式化",-1)),t[11]||(t[11]=s.createElementVNode("p",null,"${#xx}: xx为表单字段prop,请确保发起时存在",-1)),s.createVNode(a,{class:"alert",title:"SpEL表达式,使用${}包裹,被包裹的表达式才会被解析,防止+-*/等被认作运算符。需解析的变量、方法以#开头。",type:"error",closable:!1}),t[12]||(t[12]=s.createElementVNode("p",null,null,-1)),t[13]||(t[13]=s.createElementVNode("p",null,"流程回调地址:",-1)),s.createVNode(r,{modelValue:e.formData.callBack,"onUpdate:modelValue":t[2]||(t[2]=c=>e.formData.callBack=c),type:"textarea",clearable:"",autosize:"",placeholder:"测试值,默认值${#processDefName}",onInput:t[3]||(t[3]=c=>e.updateProperties({callBack:e.formData.callBack}))},null,8,["modelValue"]),s.createVNode(a,{class:"alert",type:"success",closable:!1},{title:s.withCtx(()=>t[4]||(t[4]=[s.createElementVNode("span",null," 例:【${#processDefName} - ${#applyUserName} - ${#dateFormat('yyMMddHHmm')}】会被解析为 ",-1),s.createElementVNode("br",null,null,-1),s.createElementVNode("span",null,"【流程名称 - 发起人 - 2312311200】",-1)])),_:1})],64)}const Am={name:"process",mixins:[z0,v0],components:{NfBasic:_w,NfSerial:em,NfTitle:F0(tm,[["render",nm],["__scopeId","data-v-2f0d4156"]])},data(){return{activeName:["1","2","3","99"]}}};function im(e,t,n,A,i,o){const r=s.resolveComponent("el-icon-info-filled"),a=s.resolveComponent("el-icon"),c=s.resolveComponent("nf-basic"),l=s.resolveComponent("el-collapse-item"),B=s.resolveComponent("el-icon-warning-filled"),g=s.resolveComponent("nf-serial"),p=s.resolveComponent("nf-title"),E=s.resolveComponent("el-collapse");return s.openBlock(),s.createBlock(E,{modelValue:i.activeName,"onUpdate:modelValue":t[0]||(t[0]=d=>i.activeName=d)},{default:s.withCtx(()=>[s.createVNode(l,{name:"1"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.process.basic.label")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r)]),_:1})]),default:s.withCtx(()=>[s.createVNode(c,{modeler:e.modeler,element:e.element,nodes:e.nodes},null,8,["modeler","element","nodes"])]),_:1}),s.createVNode(l,{name:"2"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.process.sn.label")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(B)]),_:1})]),default:s.withCtx(()=>[s.createVNode(g,{modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1}),s.createVNode(l,{name:"3"},{title:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(e.t("nf.panel.process.title.label")),1),s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(B)]),_:1})]),default:s.withCtx(()=>[s.createVNode(p,{modeler:e.modeler,element:e.element},null,8,["modeler","element"])]),_:1})]),_:1},8,["modelValue"])}const om={name:"panel",components:{NodePanel:Vw,ProcessPanel:F0(Am,[["render",im]])},mixins:[v0],props:{autoInit:{type:Boolean,default:!0},modeler:{type:Object,required:!0},formOption:[Object,String],exFormOption:[Object,String],indepFormOption:[Object,String],userOption:Object,groupOption:Object,buttonOption:Array,scriptOption:Object,conditionOption:Array,listenerOption:Array,extendedPropertyOption:Array},data(){return{activeTab:"process",openAllCollapse:!0,rootElement:null,element:null,nodes:[],needInit:!0}},watch:{modeler:{handler(){this.addEventListener()},immediate:!0}},methods:{addEventListener(){this.modeler.on("root.added",e=>{const{element:t}=e;if(t.type=="bpmn:Process")this.rootElement=s.markRaw(t);else{const n=this.modeler.getDefinitions().rootElements.find(A=>A.$type=="bpmn:Process");this.rootElement={id:n.id,type:n.$type,businessObject:n}}}),this.modeler.on("selection.changed",e=>{const{newSelection:t}=e;t.length==0?(this.element=null,this.activeTab="process",this.$nextTick(()=>{this.handleClickable()&&this.handleInitNodes()})):t.length==1?(this.element=s.markRaw(t[0]),this.activeTab="node"):(this.element=null,this.activeTab="process"),this.handleGetNodes()})},handleGetNodes(){const e=[];this.modeler.get("elementRegistry").forEach(n=>{if(["bpmn:StartEvent","bpmn:UserTask","bpmn:SequenceFlow","bpmn:Collaboration"].includes(n.type)){const{id:A,name:i}=n.businessObject;e.push({id:A,name:i||A,nodeType:n.type})}}),this.nodes=e},handleInitNodes(e=!1){if(!this.handleClickable(e))return;this.needInit=!1;const t=this.$loading({lock:!0,text:"初始化节点中, 请稍等...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"}),n=new MouseEvent("click",{bubbles:!0,cancelable:!0});try{const A=[];this.modeler.get("elementRegistry").forEach(o=>{["bpmn:UserTask","bpmn:StartEvent","bpmn:SubProcess"].includes(o.type)&&A.push(new Promise(r=>{setTimeout(()=>{const a=document.querySelector(`g[data-element-id='${o.businessObject.id}']`);a&&a.dispatchEvent(n),r()})}))}),Promise.all(A).then(()=>{if(this.rootElement){const o=document.querySelector(`svg[data-element-id='${this.rootElement.id}']`);o&&o.dispatchEvent(n)}setTimeout(()=>{t.close()},500)})}catch(A){console.error(A),t.close()}},handleClickable(e=!1){return this.autoInit&&(this.needInit||e)},handleChangeCollapse(e){const{node:t}=this.$refs;t?(this.openAllCollapse=!this.openAllCollapse,t.changeCollapse(e)):this.$message.error(this.t("nf.panel.node.message"))}}},rm={key:1,style:{"margin-top":"50%","text-align":"center","font-size":"14px"}};function am(e,t,n,A,i,o){const r=s.resolveComponent("el-icon-open"),a=s.resolveComponent("el-icon"),c=s.resolveComponent("el-icon-turn-off"),l=s.resolveComponent("node-panel"),B=s.resolveComponent("el-tab-pane"),g=s.resolveComponent("process-panel"),p=s.resolveComponent("el-tabs");return s.openBlock(),s.createBlock(p,{modelValue:i.activeTab,"onUpdate:modelValue":t[2]||(t[2]=E=>i.activeTab=E),stretch:""},{default:s.withCtx(()=>[s.createVNode(B,{label:e.t("nf.panel.node.tab"),name:"node",style:{padding:"0 10px"}},{label:s.withCtx(()=>[s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(e.t("nf.panel.node.tab"))+" ",1),i.openAllCollapse?(s.openBlock(),s.createBlock(a,{key:0,class:"el-icon-open",onClick:t[0]||(t[0]=E=>o.handleChangeCollapse("close"))},{default:s.withCtx(()=>[s.createVNode(r)]),_:1})):(s.openBlock(),s.createBlock(a,{key:1,onClick:t[1]||(t[1]=E=>o.handleChangeCollapse("open"))},{default:s.withCtx(()=>[s.createVNode(c)]),_:1}))])]),default:s.withCtx(()=>[i.element?(s.openBlock(),s.createBlock(l,{key:0,ref:"node",modeler:n.modeler,element:i.element,"form-option":n.formOption,"ex-form-option":n.exFormOption,"indep-form-option":n.indepFormOption,"user-option":n.userOption,"group-option":n.groupOption,"button-option":n.buttonOption,"script-option":n.scriptOption,"condition-option":n.conditionOption,"listener-option":n.listenerOption,"extended-properties-option":n.extendedPropertyOption,nodes:i.nodes},null,8,["modeler","element","form-option","ex-form-option","indep-form-option","user-option","group-option","button-option","script-option","condition-option","listener-option","extended-properties-option","nodes"])):(s.openBlock(),s.createElementBlock("div",rm,[t[3]||(t[3]=s.createElementVNode("img",{style:{height:"100px"},src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjQgMzEuNjcpIj4KICAgICAgPGVsbGlwc2UgZmlsbC1vcGFjaXR5PSIuOCIgZmlsbD0iI0Y1RjVGNyIgY3g9IjY3Ljc5NyIgY3k9IjEwNi44OSIgcng9IjY3Ljc5NyIgcnk9IjEyLjY2OCIvPgogICAgICA8cGF0aCBkPSJNMTIyLjAzNCA2OS42NzRMOTguMTA5IDQwLjIyOWMtMS4xNDgtMS4zODYtMi44MjYtMi4yMjUtNC41OTMtMi4yMjVoLTUxLjQ0Yy0xLjc2NiAwLTMuNDQ0LjgzOS00LjU5MiAyLjIyNUwxMy41NiA2OS42NzR2MTUuMzgzaDEwOC40NzVWNjkuNjc0eiIgZmlsbD0iI0FFQjhDMiIvPgogICAgICA8cGF0aCBkPSJNMTAxLjUzNyA4Ni4yMTRMODAuNjMgNjEuMTAyYy0xLjAwMS0xLjIwNy0yLjUwNy0xLjg2Ny00LjA0OC0xLjg2N0gzMS43MjRjLTEuNTQgMC0zLjA0Ny42Ni00LjA0OCAxLjg2N0w2Ljc2OSA4Ni4yMTR2MTMuNzkyaDk0Ljc2OFY4Ni4yMTR6IiBmaWxsPSJ1cmwoI2xpbmVhckdyYWRpZW50LTEpIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMy41NikiLz4KICAgICAgPHBhdGggZD0iTTMzLjgzIDBoNjcuOTMzYTQgNCAwIDAgMSA0IDR2OTMuMzQ0YTQgNCAwIDAgMS00IDRIMzMuODNhNCA0IDAgMCAxLTQtNFY0YTQgNCAwIDAgMSA0LTR6IiBmaWxsPSIjRjVGNUY3Ii8+CiAgICAgIDxwYXRoIGQ9Ik00Mi42NzggOS45NTNoNTAuMjM3YTIgMiAwIDAgMSAyIDJWMzYuOTFhMiAyIDAgMCAxLTIgMkg0Mi42NzhhMiAyIDAgMCAxLTItMlYxMS45NTNhMiAyIDAgMCAxIDItMnpNNDIuOTQgNDkuNzY3aDQ5LjcxM2EyLjI2MiAyLjI2MiAwIDEgMSAwIDQuNTI0SDQyLjk0YTIuMjYyIDIuMjYyIDAgMCAxIDAtNC41MjR6TTQyLjk0IDYxLjUzaDQ5LjcxM2EyLjI2MiAyLjI2MiAwIDEgMSAwIDQuNTI1SDQyLjk0YTIuMjYyIDIuMjYyIDAgMCAxIDAtNC41MjV6TTEyMS44MTMgMTA1LjAzMmMtLjc3NSAzLjA3MS0zLjQ5NyA1LjM2LTYuNzM1IDUuMzZIMjAuNTE1Yy0zLjIzOCAwLTUuOTYtMi4yOS02LjczNC01LjM2YTcuMzA5IDcuMzA5IDAgMCAxLS4yMjItMS43OVY2OS42NzVoMjYuMzE4YzIuOTA3IDAgNS4yNSAyLjQ0OCA1LjI1IDUuNDJ2LjA0YzAgMi45NzEgMi4zNyA1LjM3IDUuMjc3IDUuMzdoMzQuNzg1YzIuOTA3IDAgNS4yNzctMi40MjEgNS4yNzctNS4zOTNWNzUuMWMwLTIuOTcyIDIuMzQzLTUuNDI2IDUuMjUtNS40MjZoMjYuMzE4djMzLjU2OWMwIC42MTctLjA3NyAxLjIxNi0uMjIxIDEuNzg5eiIgZmlsbD0iI0RDRTBFNiIvPgogICAgPC9nPgogICAgPHBhdGggZD0iTTE0OS4xMjEgMzMuMjkybC02LjgzIDIuNjVhMSAxIDAgMCAxLTEuMzE3LTEuMjNsMS45MzctNi4yMDdjLTIuNTg5LTIuOTQ0LTQuMTA5LTYuNTM0LTQuMTA5LTEwLjQwOEMxMzguODAyIDguMTAyIDE0OC45MiAwIDE2MS40MDIgMCAxNzMuODgxIDAgMTg0IDguMTAyIDE4NCAxOC4wOTdjMCA5Ljk5NS0xMC4xMTggMTguMDk3LTIyLjU5OSAxOC4wOTctNC41MjggMC04Ljc0NC0xLjA2Ni0xMi4yOC0yLjkwMnoiIGZpbGw9IiNEQ0UwRTYiLz4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE0OS42NSAxNS4zODMpIiBmaWxsPSIjRkZGIj4KICAgICAgPGVsbGlwc2UgY3g9IjIwLjY1NCIgY3k9IjMuMTY3IiByeD0iMi44NDkiIHJ5PSIyLjgxNSIvPgogICAgICA8cGF0aCBkPSJNNS42OTggNS42M0gwTDIuODk4LjcwNHpNOS4yNTkuNzA0aDQuOTg1VjUuNjNIOS4yNTl6Ii8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K"},null,-1)),s.createElementVNode("p",null,s.toDisplayString(e.t("nf.panel.node.message")),1)]))]),_:1},8,["label"]),s.createVNode(B,{label:e.t("nf.panel.process.tab"),name:"process",style:{padding:"0 10px"}},{default:s.withCtx(()=>[i.rootElement?(s.openBlock(),s.createBlock(g,{key:0,ref:"process",modeler:n.modeler,element:i.rootElement,nodes:i.nodes},null,8,["modeler","element","nodes"])):s.createCommentVNode("",!0)]),_:1},8,["label"])]),_:1},8,["modelValue"])}const cm=F0(om,[["render",am]]);function W(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function sm(e,t){return t={exports:{}},e(t,t.exports),t.exports}var lm=sm(function(e){var t=e.exports=function(n,A){if(A||(A=16),n===void 0&&(n=128),n<=0)return"0";for(var i=Math.log(Math.pow(2,n))/Math.log(A),o=2;i===1/0;o*=2)i=Math.log(Math.pow(2,n/o))/Math.log(A)*o;for(var r=i-Math.floor(i),a="",o=0;o<Math.floor(i);o++){var c=Math.floor(Math.random()*A).toString(A);a=c+a}if(r){var l=Math.pow(A,r),c=Math.floor(Math.random()*l).toString(A);a=c+a}var B=parseInt(a,A);return B!==1/0&&B>=Math.pow(2,n)?t(n,A):a};t.rack=function(n,A,i){var o=function(a){var c=0;do{if(c++>10)if(i)n+=i;else throw new Error("too many ID collisions, use more bits");var l=t(n,A)}while(Object.hasOwnProperty.call(r,l));return r[l]=a,l},r=o.hats={};return o.get=function(a){return o.hats[a]},o.set=function(a,c){return o.hats[a]=c,o},o.bits=n||128,o.base=A||16,o}});function we(e){if(!(this instanceof we))return new we(e);e=e||[128,36,1],this._seed=e.length?lm.rack(e[0],e[1],e[2]):e}we.prototype.next=function(e){return this._seed(e||!0)},we.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},we.prototype.claim=function(e,t){this._seed.set(e,t||!0)},we.prototype.assigned=function(e){return this._seed.get(e)||!1},we.prototype.unclaim=function(e){delete this._seed.hats[e]},we.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};function Bm(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(A){if(A!=="default"&&!(A in e)){var i=Object.getOwnPropertyDescriptor(n,A);Object.defineProperty(e,A,i.get?i:{enumerable:!0,get:function(){return n[A]}})}})}),Object.freeze(e)}const gm=Object.prototype.toString,pm=Object.prototype.hasOwnProperty;function Em(e){return e===void 0}function dm(e){return gm.call(e)==="[object Array]"}function um(e,t){return pm.call(e,t)}function ql(e,t){let n,A;if(Em(e))return;const i=dm(e)?hm:Qm;for(let o in e)if(um(e,o)&&(n=e[o],A=t(n,i(o)),A===!1))return n}function Qm(e){return e}function hm(e){return Number(e)}function m2(e,...t){const n=e.style;return ql(t,function(A){A&&ql(A,function(i,o){n[o]=i})}),e}function g2(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}const wm=Object.prototype.toString;function X(e){return new ut(e)}function ut(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}ut.prototype.add=function(e){return this.list.add(e),this},ut.prototype.remove=function(e){return wm.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},ut.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},ut.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},ut.prototype.array=function(){return Array.from(this.list)},ut.prototype.has=ut.prototype.contains=function(e){return this.list.contains(e)};function vA(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Sn(e,t,n){var A=n?e:e.parentNode;return A&&typeof A.closest=="function"&&A.closest(t)||null}var io={},oo,nc,Ac;function $l(){oo=window.addEventListener?"addEventListener":"attachEvent",nc=window.removeEventListener?"removeEventListener":"detachEvent",Ac=oo!=="addEventListener"?"on":""}var mm=io.bind=function(e,t,n,A){return oo||$l(),e[oo](Ac+t,n,A||!1),n},fm=io.unbind=function(e,t,n,A){return nc||$l(),e[nc](Ac+t,n,A||!1),n},O=Bm({__proto__:null,bind:mm,unbind:fm,default:io},[io]),eB=["focus","blur"];function Cm(e,t,n,A,i){return eB.indexOf(n)!==-1&&(i=!0),O.bind(e,n,function(o){var r=o.target||o.srcElement;o.delegateTarget=Sn(r,t,!0),o.delegateTarget&&A.call(e,o)},i)}function Mm(e,t,n,A){return eB.indexOf(t)!==-1&&(A=!0),O.unbind(e,t,n,A)}var x2={bind:Cm,unbind:Mm},Dm=ym,tB=!1,ro;typeof document<"u"&&(ro=document.createElement("div"),ro.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',tB=!ro.getElementsByTagName("link").length,ro=void 0);var A2={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:tB?[1,"X<div>","</div>"]:[0,"",""]};A2.td=A2.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],A2.option=A2.optgroup=[1,'<select multiple="multiple">',"</select>"],A2.thead=A2.tbody=A2.colgroup=A2.caption=A2.tfoot=[1,"<table>","</table>"],A2.polyline=A2.ellipse=A2.polygon=A2.circle=A2.text=A2.line=A2.path=A2.rect=A2.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function ym(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var A=n[1];if(A=="body"){var c=t.createElement("html");return c.innerHTML=e,c.removeChild(c.lastChild)}var i=Object.prototype.hasOwnProperty.call(A2,A)?A2[A]:A2._default,o=i[0],r=i[1],a=i[2],c=t.createElement("div");for(c.innerHTML=r+e+a;o--;)c=c.lastChild;if(c.firstChild==c.lastChild)return c.removeChild(c.firstChild);for(var l=t.createDocumentFragment();c.firstChild;)l.appendChild(c.removeChild(c.firstChild));return l}var $=Dm;function nB(e,t){return e&&typeof e.matches=="function"&&e.matches(t)||!1}function p0(e,t){return t=t||document,t.querySelector(e)}function Le(e,t){return t=t||document,t.querySelectorAll(e)}function xe(e){e.parentNode&&e.parentNode.removeChild(e)}function Im(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function Fm(e,t){return t.appendChild(Im(e,t))}function me(e,t){return Fm(t,e),e}var ic=2,AB={"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":ic,"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":ic,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function vm(e,t){return AB[t]?e.style[t]:e.getAttributeNS(null,t)}function xm(e,t,n){var A=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=AB[A];i?(i===ic&&typeof n=="number"&&(n=String(n)+"px"),e.style[A]=n):e.setAttributeNS(null,t,n)}function bm(e,t){var n=Object.keys(t),A,i;for(A=0,i;i=n[A];A++)xm(e,i,t[i])}function N2(e,t,n){return typeof t=="string"?vm(e,t):(bm(e,t),e)}const Ym=Object.prototype.toString;function Um(e){return new Qt(e)}function Qt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Qt.prototype.add=function(e){return this.list.add(e),this},Qt.prototype.remove=function(e){return Ym.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Qt.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Qt.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Qt.prototype.array=function(){return Array.from(this.list)},Qt.prototype.has=Qt.prototype.contains=function(e){return this.list.contains(e)};var oc={svg:"http://www.w3.org/2000/svg"},iB='<svg xmlns="'+oc.svg+'"';function Nm(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(oc.svg)===-1&&(e=iB+e.substring(4)):(e=iB+">"+e+"</svg>",t=!0);var n=zm(e);if(!t)return n;for(var A=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)A.appendChild(i.firstChild);return A}function zm(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function c2(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=Nm(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(oc.svg,e),t&&N2(n,t),n}var oB=/([&<>]{1})/g,Rm=/([&<>\n\r"]{1})/g,Sm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function rc(e,t){function n(A,i){return Sm[i]||i}return e.replace(t,n)}function rB(e,t){var n,A,i,o,r;switch(e.nodeType){case 3:t.push(rc(e.textContent,oB));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,A=i.length;n<A;++n)o=i.item(n),t.push(" ",o.name,'="',rc(o.value,Rm),'"');if(e.hasChildNodes()){for(t.push(">"),r=e.childNodes,n=0,A=r.length;n<A;++n)rB(r.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",rc(e.nodeValue,oB),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Tm(e){for(var t=e.firstChild,n=[];t;)rB(t,n),t=t.nextSibling;return n.join("")}function aB(e,t){return Tm(e)}function km(e){var t=e.parentNode;return t&&t.removeChild(e),e}const Gm=/^class[ {]/;function Hm(e){return Gm.test(e.toString())}function ac(e){return Array.isArray(e)}function cc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ao(...e){e.length===1&&ac(e[0])&&(e=e[0]),e=[...e];const t=e.pop();return t.$inject=e,t}const Pm=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Jm=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,jm=/\/\*([^*]*)\*\//m;function Vm(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(Hm(e)?Pm:Jm);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map(A=>{const i=A.match(jm);return(i&&i[1]||A).trim()})||[]}function cB(e,t){const n=t||{get:function(C,m){if(A.push(C),m===!1)return null;throw a(`No provider for "${C}"!`)}},A=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),r=o.injector=this,a=function(C){const m=A.join(" -> ");return A.length=0,new Error(m?`${C} (Resolving: ${m})`:C)};function c(C,m){if(!i[C]&&C.includes(".")){const I=C.split(".");let x=c(I.shift());for(;I.length;)x=x[I.shift()];return x}if(cc(o,C))return o[C];if(cc(i,C)){if(A.indexOf(C)!==-1)throw A.push(C),a("Cannot resolve circular dependency!");return A.push(C),o[C]=i[C][0](i[C][1]),A.pop(),o[C]}return n.get(C,m)}function l(C,m){if(typeof m>"u"&&(m={}),typeof C!="function")if(ac(C))C=ao(C.slice());else throw a(`Cannot invoke "${C}". Expected a function!`);const x=(C.$inject||Vm(C)).map(v=>cc(m,v)?m[v]:c(v));return{fn:C,dependencies:x}}function B(C){const{fn:m,dependencies:I}=l(C),x=Function.prototype.bind.call(m,null,...I);return new x}function g(C,m,I){const{fn:x,dependencies:v}=l(C,I);return x.apply(m,v)}function p(C){return ao(m=>C.get(m))}function E(C,m){if(m&&m.length){const I=Object.create(null),x=Object.create(null),v=[],F=[],z=[];let R,k,T,H;for(let K in i)R=i[K],m.indexOf(K)!==-1&&(R[2]==="private"?(k=v.indexOf(R[3]),k===-1?(T=R[3].createChild([],m),H=p(T),v.push(R[3]),F.push(T),z.push(H),I[K]=[H,K,"private",T]):I[K]=[z[k],K,"private",F[k]]):I[K]=[R[2],R[1]],x[K]=!0),(R[2]==="factory"||R[2]==="type")&&R[1].$scope&&m.forEach(x0=>{R[1].$scope.indexOf(x0)!==-1&&(I[K]=[R[2],R[1]],x[x0]=!0)});m.forEach(K=>{if(!x[K])throw new Error('No provider for "'+K+'". Cannot use provider from the parent!')}),C.unshift(I)}return new cB(C,r)}const d={factory:g,type:B,value:function(C){return C}};function u(C,m){const I=C.__init__||[];return function(){I.forEach(x=>{typeof x=="string"?m.get(x):m.invoke(x)})}}function h(C){const m=C.__exports__;if(m){const I=C.__modules__,x=Object.keys(C).reduce((k,T)=>(T!=="__exports__"&&T!=="__modules__"&&T!=="__init__"&&T!=="__depends__"&&(k[T]=C[T]),k),Object.create(null)),v=(I||[]).concat(x),F=E(v),z=ao(function(k){return F.get(k)});m.forEach(function(k){i[k]=[z,k,"private",F]});const R=(C.__init__||[]).slice();return R.unshift(function(){F.init()}),C=Object.assign({},C,{__init__:R}),u(C,F)}return Object.keys(C).forEach(function(I){if(I==="__init__"||I==="__depends__")return;const x=C[I];if(x[2]==="private"){i[I]=x;return}const v=x[0],F=x[1];i[I]=[d[v],Lm(v,F),v]}),u(C,r)}function D(C,m){return C.indexOf(m)!==-1||(C=(m.__depends__||[]).reduce(D,C),C.indexOf(m)!==-1)?C:C.concat(m)}function y(C){const m=C.reduce(D,[]).map(h);let I=!1;return function(){I||(I=!0,m.forEach(x=>x()))}}this.get=c,this.invoke=g,this.instantiate=B,this.createChild=E,this.init=y(e)}function Lm(e,t){return e!=="value"&&ac(t)&&(t=ao(t.slice())),t}var Wm=1e3;function be(e,t){var n=this;t=t||Wm,e.on(["render.shape","render.connection"],t,function(A,i){var o=A.type,r=i.element,a=i.gfx,c=i.attrs;if(n.canRender(r))return o==="render.shape"?n.drawShape(a,r,c):n.drawConnection(a,r,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(A,i){if(n.canRender(i))return A.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}be.prototype.canRender=function(e){},be.prototype.drawShape=function(e,t){},be.prototype.drawConnection=function(e,t){},be.prototype.getShapePath=function(e){},be.prototype.getConnectionPath=function(e){};function _m(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function Om(e,t){return t.appendChild(_m(e,t))}function h0(e,t){return Om(t,e),e}var sc=2,sB={"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":sc,"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":sc,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Xm(e,t){return sB[t]?e.style[t]:e.getAttributeNS(null,t)}function lB(e,t,n){var A=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=sB[A];i?(i===sc&&typeof n=="number"&&(n=String(n)+"px"),e.style[A]=n):e.setAttributeNS(null,t,n)}function Km(e,t){var n=Object.keys(t),A,i;for(A=0,i;i=n[A];A++)lB(e,i,t[i])}function q(e,t,n){if(typeof t=="string")if(n!==void 0)lB(e,t,n);else return Xm(e,t);else Km(e,t);return e}const Zm=Object.prototype.toString;function D0(e){return new ht(e)}function ht(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}ht.prototype.add=function(e){return this.list.add(e),this},ht.prototype.remove=function(e){return Zm.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},ht.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},ht.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},ht.prototype.array=function(){return Array.from(this.list)},ht.prototype.has=ht.prototype.contains=function(e){return this.list.contains(e)};function co(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function BB(e){return e.cloneNode(!0)}var lc={svg:"http://www.w3.org/2000/svg"},gB='<svg xmlns="'+lc.svg+'"';function qm(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(lc.svg)===-1&&(e=gB+e.substring(4)):(e=gB+">"+e+"</svg>",t=!0);var n=$m(e);if(!t)return n;for(var A=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)A.appendChild(i.firstChild);return A}function $m(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function g0(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=qm(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(lc.svg,e),t&&q(n,t),n}var Bc=null;function pB(){return Bc===null&&(Bc=g0("svg")),Bc}function EB(e,t){var n,A,i=Object.keys(t);for(n=0;A=i[n];n++)e[A]=t[A];return e}function ef(e,t,n,A,i,o){var r=pB().createSVGMatrix();switch(arguments.length){case 0:return r;case 1:return EB(r,e);case 6:return EB(r,{a:e,b:t,c:n,d:A,e:i,f:o})}}function xA(e){return pB().createSVGTransform()}function s2(e){var t=e.parentNode;return t&&t.removeChild(e),e}function tf(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function nf(e,t){var n,A;for(e.clear(),n=0;A=t[n];n++)e.appendItem(tf(e,A))}function bA(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),nf(n,t)),n.consolidate()}function tn(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function Af(e){return["M",e.x,e.y]}function gc(e){return["L",e.x,e.y]}function of(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function rf(e,t){const n=e.length,A=[Af(e[0])];for(let i=1;i<n;i++){const o=e[i-1],r=e[i],a=e[i+1];if(!a||!t){A.push(gc(r));continue}const c=Math.min(t,pc(r.x-o.x,r.y-o.y),pc(a.x-r.x,a.y-r.y));if(!c){A.push(gc(r));continue}const l=so(r,o,c),B=so(r,o,c*.5),g=so(r,a,c),p=so(r,a,c*.5);A.push(gc(l)),A.push(of(B,p,g))}return A}function so(e,t,n){const A=t.x-e.x,i=t.y-e.y,o=pc(A,i),r=n/o;return{x:e.x+A*r,y:e.y+i*r}}function pc(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function lo(e,t,n){A0(t)&&(n=t,t=null),t||(t={});const A=g0("path",t);return A0(n)&&(A.dataset.cornerRadius=String(n)),dB(A,e)}function dB(e,t){const n=parseInt(e.dataset.cornerRadius,10)||0;return q(e,{d:tn(rf(t,n))}),e}function Bo(e){return l0(e,function(t){return!m0(e,function(n){return n!==t&&uB(t,n)})})}function uB(e,t){if(t){if(e===t)return t;if(e.parent)return uB(e.parent,t)}}function QB(e,t,n){var A=!n||e.indexOf(t)===-1;return A&&e.push(t),A}function nn(e,t,n){n=n||0,n0(e)||(e=[e]),U(e,function(A,i){var o=t(A,i,n);n0(o)&&o.length&&nn(o,t,n+1)})}function af(e,t,n){var A=[],i=[];return nn(e,function(o,r,a){QB(A,o,t);var c=o.children;if(c&&QB(i,c,t))return c}),A}function YA(e,t){return af(e,!t)}function cf(e,t,n){Je(t)&&(t=!0),V0(t)&&(n=t,t=!0),n=n||{};var A=UA(n.allShapes),i=UA(n.allConnections),o=UA(n.enclosedElements),r=UA(n.enclosedConnections),a=UA(n.topLevel,t&&Ve(e,function(B){return B.id}));function c(B){a[B.source.id]&&a[B.target.id]&&(a[B.id]=[B]),A[B.source.id]&&A[B.target.id]&&(r[B.id]=o[B.id]=B),i[B.id]=B}function l(B){if(o[B.id]=B,B.waypoints)r[B.id]=i[B.id]=B;else return A[B.id]=B,U(B.incoming,c),U(B.outgoing,c),B.children}return nn(e,l),{allShapes:A,allConnections:i,topLevel:a,enclosedConnections:r,enclosedElements:o}}function i2(e,t){t=!!t,n0(e)||(e=[e]);var n,A,i,o;return U(e,function(r){var a=r;r.waypoints&&!t&&(a=i2(r.waypoints,!0));var c=a.x,l=a.y,B=a.height||0,g=a.width||0;(c<n||n===void 0)&&(n=c),(l<A||A===void 0)&&(A=l),(c+g>i||i===void 0)&&(i=c+g),(l+B>o||o===void 0)&&(o=l+B)}),{x:n,y:A,height:o-A,width:i-n}}function hB(e,t){var n={};return U(e,function(A){var i=A;i.waypoints&&(i=i2(i)),!A0(t.y)&&i.x>t.x&&(n[A.id]=A),!A0(t.x)&&i.y>t.y&&(n[A.id]=A),i.x>t.x&&i.y>t.y&&(A0(t.width)&&A0(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y||!A0(t.width)||!A0(t.height))&&(n[A.id]=A)}),n}function wB(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function mB(e){return!!(e&&e.isFrame)}function UA(e,t){return N({},e||{},t||{})}var sf=1;function wt(e,t){be.call(this,e,sf),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}W(wt,be),wt.prototype.canRender=function(){return!0},wt.prototype.drawShape=function(t,n,A){var i=g0("rect");return q(i,{x:0,y:0,width:n.width||0,height:n.height||0}),mB(n)?q(i,N({},this.FRAME_STYLE,A||{})):q(i,N({},this.SHAPE_STYLE,A||{})),h0(t,i),i},wt.prototype.drawConnection=function(t,n,A){var i=lo(n.waypoints,N({},this.CONNECTION_STYLE,A||{}));return h0(t,i),i},wt.prototype.getShapePath=function(t){var n=t.x,A=t.y,i=t.width,o=t.height,r=[["M",n,A],["l",i,0],["l",0,o],["l",-i,0],["z"]];return tn(r)},wt.prototype.getConnectionPath=function(t){var n=t.waypoints,A,i,o=[];for(A=0;i=n[A];A++)i=i.original||i,o.push([A===0?"M":"L",i.x,i.y]);return tn(o)},wt.$inject=["eventBus","styles"];function lf(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,A,i){var o=this.style(A,i);return N(o,{class:n})},this.style=function(n,A){!n0(n)&&!A&&(A=n,n=[]);var i=F2(n,function(o,r){return N(o,e[r]||{})},{});return A?N(i,A):i},this.computeStyle=function(n,A,i){return n0(A)||(i=A,A=[]),t.style(A||[],N({},i,n||{}))}}const Bf={__init__:["defaultRenderer"],defaultRenderer:["type",wt],styles:["type",lf]};function X0(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function o2(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var A=e.indexOf(t);if(A!==-1){if(A===n)return;if(n!==-1)e.splice(A,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function Ec(e,t){return!e||!t?-1:e.indexOf(t)}function NA(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function dc(e,t,n,A){if(typeof A>"u"&&(A=5),!e||!t||!n)return!1;var i=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=NA(e,t);return Math.abs(i/o)<=A}var gf=2;function We(e,t){var n=Array.from(arguments).flat();const A={x:"v",y:"h"};for(const[i,o]of Object.entries(A))if(pf(i,n))return o;return!1}function pf(e,t){const n=t[0];return je(t,function(A){return Math.abs(n[e]-A[e])<=gf})}function fB(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function uc(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var Ef=/,?([a-z]),?/gi,CB=parseFloat,K0=Math,mt=K0.PI,Ye=K0.min,Ue=K0.max,MB=K0.pow,ft=K0.abs,df=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,uf=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,go=Array.isArray||function(e){return e instanceof Array};function Qc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function zA(e){if(typeof e=="function"||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)Qc(e,n)&&(t[n]=zA(e[n]));return t}function Qf(e,t){for(var n=0,A=e.length;n<A;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function hf(e){function t(){var n=Array.prototype.slice.call(arguments,0),A=n.join("␀"),i=t.cache=t.cache||{},o=t.count=t.count||[];return Qc(i,A)?(Qf(o,A),i[A]):(o.length>=1e3&&delete i[o.shift()],o.push(A),i[A]=e(...arguments),i[A])}return t}function wf(e){if(!e)return null;var t=Tn(e);if(t.arr)return zA(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},A=[];return go(e)&&go(e[0])&&(A=zA(e)),A.length||String(e).replace(df,function(i,o,r){var a=[],c=o.toLowerCase();for(r.replace(uf,function(l,B){B&&a.push(+B)}),c=="m"&&a.length>2&&(A.push([o,...a.splice(0,2)]),c="l",o=o=="m"?"l":"L");a.length>=n[c]&&(A.push([o,...a.splice(0,n[c])]),!!n[c]););}),A.toString=Tn.toString,t.arr=zA(A),A}function Tn(e){var t=Tn.ps=Tn.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)Qc(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function hc(e,t,n,A){return arguments.length===1&&(t=e.y,n=e.width,A=e.height,e=e.x),{x:e,y:t,width:n,height:A,x2:e+n,y2:t+A}}function DB(){return this.join(",").replace(Ef,"$1")}function po(e){var t=zA(e);return t.toString=DB,t}function yB(e,t,n,A,i,o,r,a,c){var l=1-c,B=MB(l,3),g=MB(l,2),p=c*c,E=p*c,d=B*e+g*3*c*n+l*3*c*c*i+E*r,u=B*t+g*3*c*A+l*3*c*c*o+E*a;return{x:Eo(d),y:Eo(u)}}function IB(e){var t=Df(...e);return hc(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Ct(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function mf(e,t){return e=hc(e),t=hc(t),Ct(t,e.x,e.y)||Ct(t,e.x2,e.y)||Ct(t,e.x,e.y2)||Ct(t,e.x2,e.y2)||Ct(e,t.x,t.y)||Ct(e,t.x2,t.y)||Ct(e,t.x,t.y2)||Ct(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function FB(e,t,n,A,i){var o=-3*t+9*n-9*A+3*i,r=e*o+6*t-12*n+6*A;return e*r-3*t+3*n}function vB(e,t,n,A,i,o,r,a,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var l=c/2,B=12,g=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],E=0,d=0;d<B;d++){var u=l*g[d]+l,h=FB(u,e,n,i,r),D=FB(u,t,A,o,a),y=h*h+D*D;E+=p[d]*K0.sqrt(y)}return l*E}function ff(e,t,n,A,i,o,r,a){if(!(Ue(e,n)<Ye(i,r)||Ye(e,n)>Ue(i,r)||Ue(t,A)<Ye(o,a)||Ye(t,A)>Ue(o,a))){var c=(e*A-t*n)*(i-r)-(e-n)*(i*a-o*r),l=(e*A-t*n)*(o-a)-(t-A)*(i*a-o*r),B=(e-n)*(o-a)-(t-A)*(i-r);if(B){var g=Eo(c/B),p=Eo(l/B),E=+g.toFixed(2),d=+p.toFixed(2);if(!(E<+Ye(e,n).toFixed(2)||E>+Ue(e,n).toFixed(2)||E<+Ye(i,r).toFixed(2)||E>+Ue(i,r).toFixed(2)||d<+Ye(t,A).toFixed(2)||d>+Ue(t,A).toFixed(2)||d<+Ye(o,a).toFixed(2)||d>+Ue(o,a).toFixed(2)))return{x:g,y:p}}}}function Eo(e){return Math.round(e*1e11)/1e11}function Cf(e,t,n){var A=IB(e),i=IB(t);if(!mf(A,i))return n?0:[];for(var o=vB(...e),r=vB(...t),a=bB(e)?1:~~(o/5)||1,c=bB(t)?1:~~(r/5)||1,l=[],B=[],g={},p=n?0:[],E=0;E<a+1;E++){var d=yB(...e,E/a);l.push({x:d.x,y:d.y,t:E/a})}for(E=0;E<c+1;E++)d=yB(...t,E/c),B.push({x:d.x,y:d.y,t:E/c});for(E=0;E<a;E++)for(var u=0;u<c;u++){var h=l[E],D=l[E+1],y=B[u],C=B[u+1],m=ft(D.x-h.x)<.01?"y":"x",I=ft(C.x-y.x)<.01?"y":"x",x=ff(h.x,h.y,D.x,D.y,y.x,y.y,C.x,C.y),v;if(x){if(v=x.x.toFixed(9)+"#"+x.y.toFixed(9),g[v])continue;g[v]=!0;var F=h.t+ft((x[m]-h[m])/(D[m]-h[m]))*(D.t-h.t),z=y.t+ft((x[I]-y[I])/(C[I]-y[I]))*(C.t-y.t);F>=0&&F<=1&&z>=0&&z<=1&&(n?p++:p.push({x:x.x,y:x.y,t1:F,t2:z}))}}return p}function xB(e,t,n){e=NB(e),t=NB(t);for(var A,i,o,r,a,c,l,B,g,p,E=n?0:[],d=0,u=e.length;d<u;d++){var h=e[d];if(h[0]=="M")A=a=h[1],i=c=h[2];else{h[0]=="C"?(g=[A,i,...h.slice(1)],A=g[6],i=g[7]):(g=[A,i,A,i,a,c,a,c],A=a,i=c);for(var D=0,y=t.length;D<y;D++){var C=t[D];if(C[0]=="M")o=l=C[1],r=B=C[2];else{C[0]=="C"?(p=[o,r,...C.slice(1)],o=p[6],r=p[7]):(p=[o,r,o,r,l,B,l,B],o=l,r=B);var m=Cf(g,p,n);if(n)E+=m;else{for(var I=0,x=m.length;I<x;I++)m[I].segment1=d,m[I].segment2=D,m[I].bez1=g,m[I].bez2=p;E=E.concat(m)}}}}}return E}function Mf(e){var t=Tn(e);if(t.abs)return po(t.abs);if((!go(e)||!go(e&&e[0]))&&(e=wf(e)),!e||!e.length)return[["M",0,0]];var n=[],A=0,i=0,o=0,r=0,a=0,c;e[0][0]=="M"&&(A=+e[0][1],i=+e[0][2],o=A,r=i,a++,n[0]=["M",A,i]);for(var l,B,g=a,p=e.length;g<p;g++){if(n.push(l=[]),B=e[g],c=B[0],c!=c.toUpperCase())switch(l[0]=c.toUpperCase(),l[0]){case"A":l[1]=B[1],l[2]=B[2],l[3]=B[3],l[4]=B[4],l[5]=B[5],l[6]=+B[6]+A,l[7]=+B[7]+i;break;case"V":l[1]=+B[1]+i;break;case"H":l[1]=+B[1]+A;break;case"M":o=+B[1]+A,r=+B[2]+i;default:for(var E=1,d=B.length;E<d;E++)l[E]=+B[E]+(E%2?A:i)}else for(var u=0,h=B.length;u<h;u++)l[u]=B[u];switch(c=c.toUpperCase(),l[0]){case"Z":A=+o,i=+r;break;case"H":A=l[1];break;case"V":i=l[1];break;case"M":o=l[l.length-2],r=l[l.length-1];default:A=l[l.length-2],i=l[l.length-1]}}return n.toString=DB,t.abs=po(n),n}function bB(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function uo(e,t,n,A){return[e,t,n,A,n,A]}function YB(e,t,n,A,i,o){var r=.3333333333333333,a=2/3;return[r*e+a*n,r*t+a*A,r*i+a*n,r*o+a*A,i,o]}function UB(e,t,n,A,i,o,r,a,c,l){var B=mt*120/180,g=mt/180*(+i||0),p=[],E,d=hf(function(M,w,Q){var b=M*K0.cos(Q)-w*K0.sin(Q),Y=M*K0.sin(Q)+w*K0.cos(Q);return{x:b,y:Y}});if(l)v=l[0],F=l[1],I=l[2],x=l[3];else{E=d(e,t,-g),e=E.x,t=E.y,E=d(a,c,-g),a=E.x,c=E.y;var u=(e-a)/2,h=(t-c)/2,D=u*u/(n*n)+h*h/(A*A);D>1&&(D=K0.sqrt(D),n=D*n,A=D*A);var y=n*n,C=A*A,m=(o==r?-1:1)*K0.sqrt(ft((y*C-y*h*h-C*u*u)/(y*h*h+C*u*u))),I=m*n*h/A+(e+a)/2,x=m*-A*u/n+(t+c)/2,v=K0.asin(((t-x)/A).toFixed(9)),F=K0.asin(((c-x)/A).toFixed(9));v=e<I?mt-v:v,F=a<I?mt-F:F,v<0&&(v=mt*2+v),F<0&&(F=mt*2+F),r&&v>F&&(v=v-mt*2),!r&&F>v&&(F=F-mt*2)}var z=F-v;if(ft(z)>B){var R=F,k=a,T=c;F=v+B*(r&&F>v?1:-1),a=I+n*K0.cos(F),c=x+A*K0.sin(F),p=UB(a,c,n,A,i,0,r,k,T,[F,R,I,x])}z=F-v;var H=K0.cos(v),K=K0.sin(v),x0=K0.cos(F),d0=K0.sin(F),t0=K0.tan(z/4),G0=4/3*n*t0,u2=4/3*A*t0,R0=[e,t],r2=[e+G0*K,t-u2*H],J=[a+G0*d0,c-u2*x0],V=[a,c];if(r2[0]=2*R0[0]-r2[0],r2[1]=2*R0[1]-r2[1],l)return[r2,J,V].concat(p);p=[r2,J,V].concat(p).join().split(",");for(var Z=[],u0=0,y2=p.length;u0<y2;u0++)Z[u0]=u0%2?d(p[u0-1],p[u0],g).y:d(p[u0],p[u0+1],g).x;return Z}function Df(e,t,n,A,i,o,r,a){for(var c=[],l=[[],[]],B,g,p,E,d,u,h,D,y=0;y<2;++y){if(y==0?(g=6*e-12*n+6*i,B=-3*e+9*n-9*i+3*r,p=3*n-3*e):(g=6*t-12*A+6*o,B=-3*t+9*A-9*o+3*a,p=3*A-3*t),ft(B)<1e-12){if(ft(g)<1e-12)continue;E=-p/g,0<E&&E<1&&c.push(E);continue}h=g*g-4*p*B,D=K0.sqrt(h),!(h<0)&&(d=(-g+D)/(2*B),0<d&&d<1&&c.push(d),u=(-g-D)/(2*B),0<u&&u<1&&c.push(u))}for(var C=c.length,m=C,I;C--;)E=c[C],I=1-E,l[0][C]=I*I*I*e+3*I*I*E*n+3*I*E*E*i+E*E*E*r,l[1][C]=I*I*I*t+3*I*I*E*A+3*I*E*E*o+E*E*E*a;return l[0][m]=e,l[1][m]=t,l[0][m+1]=r,l[1][m+1]=a,l[0].length=l[1].length=m+2,{x0:Ye(...l[0]),y0:Ye(...l[1]),x1:Ue(...l[0]),y1:Ue(...l[1])}}function NB(e){var t=Tn(e);if(t.curve)return po(t.curve);for(var n=Mf(e),A={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=function(E,d,u){var h,D;if(!E)return["C",d.x,d.y,d.x,d.y,d.x,d.y];switch(!(E[0]in{T:1,Q:1})&&(d.qx=d.qy=null),E[0]){case"M":d.X=E[1],d.Y=E[2];break;case"A":E=["C",...UB(d.x,d.y,...E.slice(1))];break;case"S":u=="C"||u=="S"?(h=d.x*2-d.bx,D=d.y*2-d.by):(h=d.x,D=d.y),E=["C",h,D,...E.slice(1)];break;case"T":u=="Q"||u=="T"?(d.qx=d.x*2-d.qx,d.qy=d.y*2-d.qy):(d.qx=d.x,d.qy=d.y),E=["C",...YB(d.x,d.y,d.qx,d.qy,E[1],E[2])];break;case"Q":d.qx=E[1],d.qy=E[2],E=["C",...YB(d.x,d.y,E[1],E[2],E[3],E[4])];break;case"L":E=["C",...uo(d.x,d.y,E[1],E[2])];break;case"H":E=["C",...uo(d.x,d.y,E[1],d.y)];break;case"V":E=["C",...uo(d.x,d.y,d.x,E[1])];break;case"Z":E=["C",...uo(d.x,d.y,d.X,d.Y)];break}return E},o=function(E,d){if(E[d].length>7){E[d].shift();for(var u=E[d];u.length;)r[d]="A",E.splice(d++,0,["C",...u.splice(0,6)]);E.splice(d,1),B=n.length}},r=[],a="",c="",l=0,B=n.length;l<B;l++){n[l]&&(a=n[l][0]),a!="C"&&(r[l]=a,l&&(c=r[l-1])),n[l]=i(n[l],A,c),r[l]!="A"&&a=="C"&&(r[l]="C"),o(n,l);var g=n[l],p=g.length;A.x=g[p-2],A.y=g[p-1],A.bx=CB(g[p-4])||A.x,A.by=CB(g[p-3])||A.y}return t.curve=po(n),n}function Y0(e){return V0(e)&&I2(e,"waypoints")}function f0(e){return V0(e)&&I2(e,"labelTarget")}function zB(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function _e(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function e0(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Qo(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function yf(e){return _e({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function If(e){for(var t=e.waypoints,n=t.reduce(function(l,B,g){var p=t[g-1];if(p){var E=l[l.length-1],d=E&&E.endLength||0,u=xf(p,B);l.push({start:p,end:B,startLength:d,endLength:d+u,length:u})}return l},[]),A=n.reduce(function(l,B){return l+B.length},0),i=A/2,o=0,r=n[o];r.endLength<i;)r=n[++o];var a=(i-r.startLength)/r.length,c={x:r.start.x+(r.end.x-r.start.x)*a,y:r.start.y+(r.end.y-r.start.y)*a};return c}function i0(e){return Y0(e)?If(e):yf(e)}function f2(e,t,n){n=n||0,V0(n)||(n={x:n,y:n});var A=e0(e),i=e0(t),o=A.bottom+n.y<=i.top,r=A.left-n.x>=i.right,a=A.top-n.y>=i.bottom,c=A.right+n.x<=i.left,l=o?"top":a?"bottom":null,B=c?"left":r?"right":null;return B&&l?l+"-"+B:B||l||"intersect"}function wc(e,t,n){var A=Ff(e,t);return A.length===1||A.length===2&&NA(A[0],A[1])<1?_e(A[0]):A.length>1?(A=Qe(A,function(i){var o=Math.floor(i.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,i.segment2+"#"+o}),_e(A[n?0:A.length-1])):null}function Ff(e,t){return xB(e,t)}function vf(e){e=e.slice();for(var t=0,n,A,i;e[t];)n=e[t],A=e[t-1],i=e[t+1],NA(n,i)===0||dc(A,i,n)?e.splice(t,1):t++;return e}function xf(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ho(e,t){return Math.round(e*t)/t}function RB(e){return A0(e)?e+"px":e}function bf(e){for(;e.parent;)e=e.parent;return e}function Yf(e){e=N({},{width:"100%",height:"100%"},e);const t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),m2(n,{position:"relative",overflow:"hidden",width:RB(e.width),height:RB(e.height)}),t.appendChild(n),n}function SB(e,t,n){const A=g0("g");D0(A).add(t);const i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(A,e.childNodes[i]||null),A}const Uf="base",TB=0,Nf=1,zf={shape:["x","y","width","height"],connection:["waypoints"]};function o0(e,t,n,A){this._eventBus=t,this._elementRegistry=A,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}o0.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],o0.prototype._init=function(e){const t=this._eventBus,n=this._container=Yf(e),A=this._svg=g0("svg");q(A,{width:"100%",height:"100%"}),g2(A,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),A.addEventListener("focusin",()=>{this._setFocused(!0)}),A.addEventListener("focusout",()=>{this._setFocused(!1)}),h0(n,A);const i=this._viewport=SB(A,"viewport");e.deferUpdate&&(this._viewboxChanged=tc(v2(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:A,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},o0.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},o0.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},o0.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{const n=wB(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},o0.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},o0.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()},o0.prototype.isFocused=function(){return this._focused},o0.prototype.getDefaultLayer=function(){return this.getLayer(Uf,TB)},o0.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t<"u"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},o0.prototype._getChildIndex=function(e){return F2(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},o0.prototype._createLayer=function(e,t){typeof t>"u"&&(t=Nf);const n=this._getChildIndex(t);return{group:SB(this._viewport,"layer-"+e,n),index:t,visible:!0}},o0.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,A=t.group,i=t.index;if(t.visible)return A;const o=this._getChildIndex(i);return n.insertBefore(A,n.childNodes[o]||null),t.visible=!0,A},o0.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible&&(s2(n),t.visible=!1),n},o0.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],s2(t.group))},o0.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},o0.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(bf(e))||{}).rootElement:void 0},o0.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},o0.prototype._findPlaneForRoot=function(e){return m0(this._planes,function(t){return t.rootElement===e})},o0.prototype.getContainer=function(){return this._container},o0.prototype._updateMarker=function(e,t,n){let A;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,A=this._elementRegistry._elements[e.id],A&&(U([A.gfx,A.secondaryGfx],function(i){i&&(n?(e.markers.add(t),D0(i).add(t)):(e.markers.delete(t),D0(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:A.gfx,marker:t,add:!!n}))},o0.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},o0.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},o0.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1},o0.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},o0.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},o0.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const A=this.getLayer(n,TB);return this.hideLayer(n),this._addRoot(e,A),this._planes.push({rootElement:e,layer:A}),e},o0.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},o0.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},o0.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},o0.prototype._addRoot=function(e,t){const n=this._elementRegistry,A=this._eventBus;A.fire("root.add",{element:e}),n.add(e,t),A.fire("root.added",{element:e,gfx:t})},o0.prototype._setRoot=function(e,t){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},o0.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const n=zf[e];if(!je(n,function(i){return typeof t[i]<"u"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},o0.prototype._setParent=function(e,t,n){o2(t.children,e,n),e.parent=t},o0.prototype._addElement=function(e,t,n,A){n=n||this.getRootElement();const i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,A);const r=o.create(e,t,A);return this._elementRegistry.add(t,r),o.update(e,t,r),i.fire(e+".added",{element:t,gfx:r}),t},o0.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},o0.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},o0.prototype._removeElement=function(e,t){const n=this._elementRegistry,A=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),A.remove(e),X0(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e},o0.prototype.removeShape=function(e){return this._removeElement(e,"shape")},o0.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},o0.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},o0.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},o0.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},o0.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let A,i,o,r,a,c,l;if(e)this._changeViewbox(function(){a=Math.min(n.width/e.width,n.height/e.height);const B=this._svg.createSVGMatrix().scale(a).translate(-e.x,-e.y);bA(t,B)});else return o=this._rootElement?this.getActiveLayer():null,A=o&&o.getBBox()||{},r=bA(t),i=r?r.matrix:ef(),a=ho(i.a,1e3),c=ho(-i.e||0,1e3),l=ho(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/a:0,y:l?l/a:0,width:n.width/a,height:n.height/a,scale:a,inner:{width:A.width||0,height:A.height||0,x:A.x||0,y:A.y||0},outer:n},e;return e},o0.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox(function(){e=N({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),kB(t,n)}),{x:n.e,y:n.f}},o0.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));const A=this.findRoot(e);if(A!==this.getRootElement()&&this.setRootElement(A),A===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const i=i2(e),o=e0(i),r=this.viewbox(),a=this.zoom();let c,l;r.y+=t.top/a,r.x+=t.left/a,r.width-=(t.right+t.left)/a,r.height-=(t.bottom+t.top)/a;const B=e0(r);if(!(i.width<r.width&&i.height<r.height))c=i.x-r.x,l=i.y-r.y;else{const p=Math.max(0,o.right-B.right),E=Math.min(0,o.left-B.left),d=Math.max(0,o.bottom-B.bottom),u=Math.min(0,o.top-B.top);c=p||E,l=d||u}this.scroll({dx:-c*a,dy:-l*a})},o0.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let n,A;return this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),A=this._setZoom(e,t)}),ho(A.a,1e3)};function kB(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}o0.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,A=t.inner;let i,o;return A.x>=0&&A.y>=0&&A.x+A.width<=n.width&&A.y+A.height<=n.height&&!e?o={x:0,y:0,width:Math.max(A.width+A.x,n.width),height:Math.max(A.height+A.y,n.height)}:(i=Math.min(1,n.width/A.width,n.height/A.height),o={x:A.x+(e?A.width/2-n.width/i/2:0),y:A.y+(e?A.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale},o0.prototype._setZoom=function(e,t){const n=this._svg,A=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint();let r,a,c,l,B;c=A.getCTM();const g=c.a;return t?(r=N(o,t),a=r.matrixTransform(c.inverse()),l=i.translate(a.x,a.y).scale(1/g*e).translate(-a.x,-a.y),B=c.multiply(l)):B=i.scale(e),kB(this._viewport,B),B},o0.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},o0.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;const A=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,r=n.height*t.scale;return{x:A,y:i,width:o,height:r}},o0.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var kn="data-element-id";function J2(e){this._elements={},this._eventBus=e}J2.$inject=["eventBus"],J2.prototype.add=function(e,t,n){var A=e.id;this._validateId(A),q(t,kn,A),n&&q(n,kn,A),this._elements[A]={element:e,gfx:t,secondaryGfx:n}},J2.prototype.remove=function(e){var t=this._elements,n=e.id||e,A=n&&t[n];A&&(q(A.gfx,kn,""),A.secondaryGfx&&q(A.secondaryGfx,kn,""),delete t[n])},J2.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),A=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,A)},J2.prototype.updateGraphics=function(e,t,n){var A=e.id||e,i=this._elements[A];return n?i.secondaryGfx=t:i.gfx=t,t&&q(t,kn,A),t},J2.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&q(e,kn);var n=this._elements[t];return n&&n.element},J2.prototype.filter=function(e){var t=[];return this.forEach(function(n,A){e(n,A)&&t.push(n)}),t},J2.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),A=0;A<n.length;A++){var i=n[A],o=t[i],r=o.element,a=o.gfx;if(e(r,a))return r}},J2.prototype.getAll=function(){return this.filter(function(e){return e})},J2.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var A=t[n],i=A.element,o=A.gfx;return e(i,o)})},J2.prototype.getGraphics=function(e,t){var n=e.id||e,A=this._elements[n];return A&&(t?A.secondaryGfx:A.gfx)},J2.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};function Rf(e,t,n,A){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var r=this.indexOf(o);return r!==-1&&(this.splice(r,1),t.unset(o,i,A)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,r){var a=this.indexOf(o);if(typeof r>"u"){if(a!==-1)return;r=this.length}a!==-1&&this.splice(a,1),this.splice(r,0,o),a===-1&&t.set(o,i,A)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function Sf(e){return e.__refs_collection===!0}function Tf(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function GB(e,t,n){var A=Rf(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:A}),A.length&&A.forEach(function(i){e.set(i,t.inverse,n)})}function kf(e,t,n){var A=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(o){if(o!==i){var r=i;i=null,r&&e.unset(r,A,n),i=o,e.set(i,A,n)}}})}function $2(e,t){if(!(this instanceof $2))return new $2(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}$2.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?GB(this,t,e):kf(this,t,e)},$2.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Sf(n)||GB(this,t,e),n},$2.prototype.ensureBound=function(e,t){Tf(e,t)||this.bind(e,t)},$2.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},$2.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var mc=new $2({name:"children",enumerable:!0,collection:!0},{name:"parent"}),HB=new $2({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),PB=new $2({name:"attachers",collection:!0},{name:"host"}),JB=new $2({name:"outgoing",collection:!0},{name:"source"}),jB=new $2({name:"incoming",collection:!0},{name:"target"});function Gn(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),mc.bind(this,"parent"),HB.bind(this,"labels"),JB.bind(this,"outgoing"),jB.bind(this,"incoming")}function RA(){Gn.call(this),mc.bind(this,"children"),PB.bind(this,"host"),PB.bind(this,"attachers")}W(RA,Gn);function VB(){Gn.call(this),mc.bind(this,"children")}W(VB,RA);function LB(){RA.call(this),HB.bind(this,"labelTarget")}W(LB,RA);function WB(){Gn.call(this),JB.bind(this,"source"),jB.bind(this,"target")}W(WB,Gn);var Gf={connection:WB,shape:RA,label:LB,root:VB};function Hf(e,t){var n=Gf[e];if(!n)throw new Error("unknown type: <"+e+">");return N(new n,t)}function Pf(e){return e instanceof Gn}function Oe(){this._uid=12}Oe.prototype.createRoot=function(e){return this.create("root",e)},Oe.prototype.createLabel=function(e){return this.create("label",e)},Oe.prototype.createShape=function(e){return this.create("shape",e)},Oe.prototype.createConnection=function(e){return this.create("connection",e)},Oe.prototype.create=function(e,t){return t=N({},t||{}),t.id||(t.id=e+"_"+this._uid++),Hf(e,t)};var wo="__fn",_B=1e3,Jf=Array.prototype.slice;function k2(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}k2.prototype.on=function(e,t,n,A){if(e=n0(e)?e:[e],n2(t)&&(A=n,n=t,t=_B),!A0(t))throw new Error("priority must be a number");var i=n;A&&(i=v2(n,A),i[wo]=n[wo]||n);var o=this;e.forEach(function(r){o._addListener(r,{priority:t,callback:i,next:null})})},k2.prototype.once=function(e,t,n,A){var i=this;if(n2(t)&&(A=n,n=t,t=_B),!A0(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var r=n.apply(A,arguments);return i.off(e,o),r}o[wo]=n,this.on(e,t,o)},k2.prototype.off=function(e,t){e=n0(e)?e:[e];var n=this;e.forEach(function(A){n._removeListener(A,t)})},k2.prototype.createEvent=function(e){var t=new SA;return t.init(e),t},k2.prototype.fire=function(e,t){var n,A,i,o;if(o=Jf.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(A=this._listeners[e],!!A){t instanceof SA?n=t:n=this.createEvent(t),o[0]=n;var r=n.type;e!==r&&(n.type=e);try{i=this._invokeListeners(n,o,A)}finally{e!==r&&(n.type=r)}return i===void 0&&n.defaultPrevented&&(i=!1),i}},k2.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},k2.prototype._destroy=function(){this._listeners={}},k2.prototype._invokeListeners=function(e,t,n){for(var A;n&&!e.cancelBubble;)A=this._invokeListener(e,t,n),n=n.next;return A},k2.prototype._invokeListener=function(e,t,n){var A;if(n.callback.__isTomb)return A;try{A=jf(n.callback,t),A!==void 0&&(e.returnValue=A,e.stopPropagation()),A===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return A},k2.prototype._addListener=function(e,t){var n=this._getListeners(e),A;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority<t.priority){t.next=n,A?A.next=t:this._setListeners(e,t);return}A=n,n=n.next}A.next=t},k2.prototype._getListeners=function(e){return this._listeners[e]},k2.prototype._setListeners=function(e,t){this._listeners[e]=t},k2.prototype._removeListener=function(e,t){var n=this._getListeners(e),A,i,o;if(!t){this._setListeners(e,null);return}for(;n;)A=n.next,o=n.callback,(o===t||o[wo]===t)&&(i?i.next=A:this._setListeners(e,A)),i=n,n=A};function SA(){}SA.prototype.stopPropagation=function(){this.cancelBubble=!0},SA.prototype.preventDefault=function(){this.defaultPrevented=!0},SA.prototype.init=function(e){N(this,e||{})};function jf(e,t){return e.apply(null,t)}function Mt(e){return e.childNodes[0]}function Vf(e){return e.parentNode.childNodes[1]}function mo(e,t,n,A,i){var o=xA();o.setTranslate(t,n);var r=xA();r.setRotate(A||0,0,0);var a=xA();a.setScale(1,1),bA(e,[o,r,a])}function Q2(e,t,n){var A=xA();A.setTranslate(t,n),bA(e,A)}function OB(e,t){var n=xA();n.setRotate(t,0,0),bA(e,n)}function j2(e,t){this._eventBus=e,this._elementRegistry=t}j2.$inject=["eventBus","elementRegistry"],j2.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=Vf(t),n||(n=g0("g"),D0(n).add("djs-children"),h0(t.parentNode,n))):n=t,n},j2.prototype._clear=function(e){var t=Mt(e);return vA(t),t},j2.prototype._createContainer=function(e,t,n,A){var i=g0("g");D0(i).add("djs-group"),typeof n<"u"?XB(i,t,t.childNodes[n]):h0(t,i);var o=g0("g");D0(o).add("djs-element"),D0(o).add("djs-"+e),A&&D0(o).add("djs-frame"),h0(i,o);var r=g0("g");return D0(r).add("djs-visual"),h0(o,r),o},j2.prototype.create=function(e,t,n){var A=this._getChildrenContainer(t.parent);return this._createContainer(e,A,n,mB(t))},j2.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,A;A=F2(e,function(i,o){return o.parent&&(i[o.parent.id]=o.parent),i},{}),U(A,function(i){var o=i.children;if(o){var r=t._getChildrenContainer(i);U(o.slice().reverse(),function(a){var c=n.getGraphics(a);XB(c.parentNode,r)})}})},j2.prototype.drawShape=function(e,t,n={}){var A=this._eventBus;return A.fire("render.shape",{gfx:e,element:t,attrs:n})},j2.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)},j2.prototype.drawConnection=function(e,t,n={}){var A=this._eventBus;return A.fire("render.connection",{gfx:e,element:t,attrs:n})},j2.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)},j2.prototype.update=function(e,t,n){if(t.parent){var A=this._clear(n);if(e==="shape")this.drawShape(A,t),Q2(n,t.x,t.y);else if(e==="connection")this.drawConnection(A,t);else throw new Error("unknown type: "+e);t.hidden?q(n,"display","none"):q(n,"display","block")}},j2.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);s2(t.parentNode)};function XB(e,t,n){var A=n||t.firstChild;e!==A&&t.insertBefore(e,A)}const Lf={__depends__:[Bf],__init__:["canvas"],canvas:["type",o0],elementRegistry:["type",J2],elementFactory:["type",Oe],eventBus:["type",k2],graphicsFactory:["type",j2]};function Wf(e){var t=new cB(e);return t.init(),t}function _f(e){e=e||{};var t={config:["value",e]},n=[t,Lf].concat(e.modules||[]);return Wf(n)}function Dt(e,t){this._injector=t||_f(e),this.get("eventBus").fire("diagram.init")}Dt.prototype.get=function(e,t){return this._injector.get(e,t)},Dt.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},Dt.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Dt.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};function fc(){}fc.prototype.get=function(e){return this.$model.properties.get(this,e)},fc.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function KB(e,t){this.model=e,this.properties=t}KB.prototype.createType=function(e){var t=this.model,n=this.properties,A=Object.create(fc.prototype);U(e.properties,function(r){!r.isMany&&r.default!==void 0&&(A[r.name]=r.default)}),n.defineModel(A,t),n.defineDescriptor(A,e);var i=e.ns.name;function o(r){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),U(r,v2(function(a,c){this.set(c,a)},this))}return o.prototype=A,o.hasType=A.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Of={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},ZB={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Cc(e,t){var n=ZB[e];return n?n(t):t}function Mc(e){return!!Of[e]}function qB(e){return!!ZB[e]}function C2(e,t){var n=e.split(/:/),A,i;if(n.length===1)A=e,i=t;else if(n.length===2)A=n[1],i=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+e);return e=(i?i+":":"")+A,{name:e,prefix:i,localName:A}}function V2(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}V2.prototype.build=function(){return q2(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},V2.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var A=this.properties;t!==void 0?A.splice(t,0,e):A.push(e)},V2.prototype.replaceProperty=function(e,t,n){var A=e.ns,i=this.properties,o=this.propertiesByName,r=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var a=i.indexOf(e);if(a===-1)throw new Error("property <"+A.name+"> not found in property list");i.splice(a,1),this.addProperty(t,n?void 0:a,r),o[A.name]=o[A.localName]=t},V2.prototype.redefineProperty=function(e,t,n){var A=e.ns.prefix,i=t.split("#"),o=C2(i[0],A),r=C2(i[1],o.prefix).name,a=this.propertiesByName[r];if(a)this.replaceProperty(a,e,n);else throw new Error("refined property <"+r+"> not found");delete e.redefines},V2.prototype.addNamedProperty=function(e,t){var n=e.ns,A=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),A[n.name]=A[n.localName]=e},V2.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},V2.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},V2.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},V2.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},V2.prototype.assertNotDefined=function(e,t){var n=e.name,A=this.propertiesByName[n];if(A)throw new Error("property <"+n+"> already defined; override of <"+A.definedBy.ns.name+"#"+A.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},V2.prototype.hasProperty=function(e){return this.propertiesByName[e]},V2.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,A=this.allTypes,i=e.name;i in n||(U(e.properties,v2(function(o){o=N({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var r=o.replaces,a=o.redefines;r||a?this.redefineProperty(o,r||a,r):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),A.push(e),n[i]=e)};function yt(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,U(e,v2(this.registerPackage,this))}yt.prototype.getPackage=function(e){return this.packageMap[e]},yt.prototype.getPackages=function(){return this.packages},yt.prototype.registerPackage=function(e){e=N({},e);var t=this.packageMap;$B(t,e,"prefix"),$B(t,e,"uri"),U(e.types,v2(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},yt.prototype.registerType=function(e,t){e=N({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:N(e.meta||{})});var n=C2(e.name,t.prefix),A=n.name,i={};U(e.properties,v2(function(o){var r=C2(o.name,n.prefix),a=r.name;Mc(o.type)||(o.type=C2(o.type,r.prefix).name),N(o,{ns:r,name:a}),i[a]=o},this)),N(e,{ns:n,name:A,propertiesByName:i}),U(e.extends,v2(function(o){var r=C2(o,n.prefix),a=this.typeMap[r.name];a.traits=a.traits||[],a.traits.push(A)},this)),this.definePackage(e,t),this.typeMap[A]=e},yt.prototype.mapTypes=function(e,t,n){var A=Mc(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,l){var B=C2(c,Mc(c)?"":e.prefix);i.mapTypes(B,t,l)}function r(c){return o(c,!0)}function a(c){return o(c,!1)}if(!A)throw new Error("unknown type <"+e.name+">");U(A.superClass,n?r:a),t(A,!n),U(A.traits,r)},yt.prototype.getEffectiveDescriptor=function(e){var t=C2(e),n=new V2(t);this.mapTypes(t,function(i,o){n.addTrait(i,o)});var A=n.build();return this.definePackage(A,A.allTypes[A.allTypes.length-1].$pkg),A},yt.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function $B(e,t,n){var A=t[n];if(A in e)throw new Error("package with "+n+" <"+A+"> already defined")}function An(e){this.model=e}An.prototype.set=function(e,t,n){if(!U2(t)||!t.length)throw new TypeError("property name must be a non-empty string");var A=this.getProperty(e,t),i=A&&A.name;Xf(n)?A?delete e[i]:delete e.$attrs[Dc(t)]:A?i in e?e[i]=n:eg(e,A,n):e.$attrs[Dc(t)]=n},An.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Dc(t)];var A=n.name;return!e[A]&&n.isMany&&eg(e,n,[]),e[A]},An.prototype.define=function(e,t,n){if(!n.writable){var A=n.value;n=N({},n,{get:function(){return A}}),delete n.value}Object.defineProperty(e,t,n)},An.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},An.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},An.prototype.getProperty=function(e,t){var n=this.model,A=n.getPropertyDescriptor(e,t);if(A)return A;if(t.includes(":"))return null;const i=n.config.strict;if(typeof i<"u"){const o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console<"u"&&console.warn(o)}return null};function Xf(e){return typeof e>"u"}function eg(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Dc(e){return e.replace(/^:/,"")}function ee(e,t={}){this.properties=new An(this),this.factory=new KB(this,this.properties),this.registry=new yt(e,this.properties),this.typeCache={},this.config=t}ee.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},ee.prototype.getType=function(e){var t=this.typeCache,n=U2(e)?e:e.ns.name,A=t[n];return A||(e=this.registry.getEffectiveDescriptor(n),A=t[n]=this.factory.createType(e)),A},ee.prototype.createAny=function(e,t,n){var A=C2(e),i={$type:e,$instanceOf:function(r){return r===this.$type},get:function(r){return this[r]},set:function(r,a){Xl(this,[r],a)}},o={name:e,isGeneric:!0,ns:{prefix:A.prefix,localName:A.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),U(n,function(r,a){V0(r)&&r.value!==void 0?i[r.name]=r.value:i[a]=r}),i},ee.prototype.getPackage=function(e){return this.registry.getPackage(e)},ee.prototype.getPackages=function(){return this.registry.getPackages()},ee.prototype.getElementDescriptor=function(e){return e.$descriptor},ee.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName},ee.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},ee.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var tg=String.fromCharCode,Kf=Object.prototype.hasOwnProperty,Zf=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,TA={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(TA).forEach(function(e){TA[e.toUpperCase()]=TA[e]});function qf(e,t,n,A){return A?Kf.call(TA,A)?TA[A]:"&"+A+";":tg(t||parseInt(n,16))}function on(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(Zf,qf):e}var ng="non-whitespace outside of root node";function Hn(e){return new Error(e)}function Ag(e){return"missing namespace for prefix <"+e+">"}function fo(e){return{get:e,enumerable:!0}}function $f(e){var t={},n;for(n in e)t[n]=e[n];return t}function yc(e){return e+"$uri"}function eC(e){var t={},n,A;for(n in e)A=e[n],t[A]=A,t[yc(A)]=n;return t}function ig(){return{line:0,column:0}}function tC(e){throw e}function og(e){if(!this)return new og(e);var t=e&&e.proxy,n,A,i,o,r=tC,a,c,l,B,g=ig,p=!1,E=!1,d=null,u=!1,h;function D(m){m instanceof Error||(m=Hn(m)),d=m,r(m,g)}function y(m){a&&(m instanceof Error||(m=Hn(m)),a(m,g))}this.on=function(m,I){if(typeof I!="function")throw Hn("required args <name, cb>");switch(m){case"openTag":A=I;break;case"text":n=I;break;case"closeTag":i=I;break;case"error":r=I;break;case"warn":a=I;break;case"cdata":o=I;break;case"attention":B=I;break;case"question":l=I;break;case"comment":c=I;break;default:throw Hn("unsupported event: "+m)}return this},this.ns=function(m){if(typeof m>"u"&&(m={}),typeof m!="object")throw Hn("required args <nsMap={}>");var I={},x;for(x in m)I[x]=m[x];return E=!0,h=I,this},this.parse=function(m){if(typeof m!="string")throw Hn("required args <xml=string>");return d=null,C(m),g=ig,u=!1,d},this.stop=function(){u=!0};function C(m){var I=E?[]:null,x=E?eC(h):null,v,F=[],z=0,R=!1,k=!1,T=0,H=0,K,x0,d0,t0,G0,u2,R0,r2,J,V="",Z=0,u0;function y2(){if(u0!==null)return u0;var w,Q,b,Y=E&&x.xmlns,S=E&&p?[]:null,G=Z,_=V,s0=_.length,W0,j0,I0,de,N0,dt={},Xa={},K2,c0,b0;e:for(;G<s0;G++)if(K2=!1,c0=_.charCodeAt(G),!(c0===32||c0<14&&c0>8)){for((c0<65||c0>122||c0>90&&c0<97)&&c0!==95&&c0!==58&&(y("illegal first char attribute name"),K2=!0),b0=G+1;b0<s0;b0++)if(c0=_.charCodeAt(b0),!(c0>96&&c0<123||c0>64&&c0<91||c0>47&&c0<59||c0===46||c0===45||c0===95)){if(c0===32||c0<14&&c0>8){y("missing attribute value"),G=b0;continue e}if(c0===61)break;y("illegal attribute name char"),K2=!0}if(N0=_.substring(G,b0),N0==="xmlns:xmlns"&&(y("illegal declaration of xmlns"),K2=!0),c0=_.charCodeAt(b0+1),c0===34)b0=_.indexOf('"',G=b0+2),b0===-1&&(b0=_.indexOf("'",G),b0!==-1&&(y("attribute value quote missmatch"),K2=!0));else if(c0===39)b0=_.indexOf("'",G=b0+2),b0===-1&&(b0=_.indexOf('"',G),b0!==-1&&(y("attribute value quote missmatch"),K2=!0));else for(y("missing attribute value quotes"),K2=!0,b0=b0+1;b0<s0&&(c0=_.charCodeAt(b0+1),!(c0===32||c0<14&&c0>8));b0++);for(b0===-1&&(y("missing closing quotes"),b0=s0,K2=!0),K2||(I0=_.substring(G,b0)),G=b0;b0+1<s0&&(c0=_.charCodeAt(b0+1),!(c0===32||c0<14&&c0>8));b0++)G===b0&&(y("illegal character after attribute end"),K2=!0);if(G=b0+1,K2)continue e;if(N0 in Xa){y("attribute <"+N0+"> already defined");continue}if(Xa[N0]=!0,!E){dt[N0]=I0;continue}if(p){if(j0=N0==="xmlns"?"xmlns":N0.charCodeAt(0)===120&&N0.substr(0,6)==="xmlns:"?N0.substr(6):null,j0!==null){if(w=on(I0),Q=yc(j0),de=h[w],!de){if(j0==="xmlns"||Q in x&&x[Q]!==w)do de="ns"+z++;while(typeof x[de]<"u");else de=j0;h[w]=de}x[j0]!==de&&(W0||(x=$f(x),W0=!0),x[j0]=de,j0==="xmlns"&&(x[yc(de)]=w,Y=de),x[Q]=w),dt[N0]=I0;continue}S.push(N0,I0);continue}if(c0=N0.indexOf(":"),c0===-1){dt[N0]=I0;continue}if(!(b=x[N0.substring(0,c0)])){y(Ag(N0.substring(0,c0)));continue}N0=Y===b?N0.substr(c0+1):b+N0.substr(c0),dt[N0]=I0}if(p)for(G=0,s0=S.length;G<s0;G++){if(N0=S[G++],I0=S[G],c0=N0.indexOf(":"),c0!==-1){if(!(b=x[N0.substring(0,c0)])){y(Ag(N0.substring(0,c0)));continue}N0=Y===b?N0.substr(c0+1):b+N0.substr(c0)}dt[N0]=I0}return u0=dt}function M(){for(var w=/(\r\n|\r|\n)/g,Q=0,b=0,Y=0,S=H,G,_;T>=Y&&(G=w.exec(m),!(!G||(S=G[0].length+G.index,S>T)));)Q+=1,Y=S;return T==-1?(b=S,_=m.substring(H)):H===0?_=m.substring(H,T):(b=T-Y,_=H==-1?m.substring(T):m.substring(T,H+1)),{data:_,line:Q,column:b}}for(g=M,t&&(J=Object.create({},{name:fo(function(){return R0}),originalName:fo(function(){return r2}),attrs:fo(y2),ns:fo(function(){return x})}));H!==-1;){if(m.charCodeAt(H)===60?T=H:T=m.indexOf("<",H),T===-1){if(F.length)return D("unexpected end of file");if(H===0)return D("missing start tag");H<m.length&&m.substring(H).trim()&&y(ng);return}if(H!==T){if(F.length){if(n&&(n(m.substring(H,T),on,g),u))return}else if(m.substring(H,T).trim()&&(y(ng),u))return}if(t0=m.charCodeAt(T+1),t0===33){if(d0=m.charCodeAt(T+2),d0===91&&m.substr(T+3,6)==="CDATA["){if(H=m.indexOf("]]>",T),H===-1)return D("unclosed cdata");if(o&&(o(m.substring(T+9,H),g),u))return;H+=3;continue}if(d0===45&&m.charCodeAt(T+3)===45){if(H=m.indexOf("-->",T),H===-1)return D("unclosed comment");if(c&&(c(m.substring(T+4,H),on,g),u))return;H+=3;continue}}if(t0===63){if(H=m.indexOf("?>",T),H===-1)return D("unclosed question");if(l&&(l(m.substring(T,H+2),g),u))return;H+=2;continue}for(K=T+1;;K++){if(G0=m.charCodeAt(K),isNaN(G0))return H=-1,D("unclosed tag");if(G0===34)d0=m.indexOf('"',K+1),K=d0!==-1?d0:K;else if(G0===39)d0=m.indexOf("'",K+1),K=d0!==-1?d0:K;else if(G0===62){H=K;break}}if(t0===33){if(B&&(B(m.substring(T,H+1),on,g),u))return;H+=1;continue}if(u0={},t0===47){if(R=!1,k=!0,!F.length)return D("missing open tag");if(K=R0=F.pop(),d0=T+2+K.length,m.substring(T+2,d0)!==K)return D("closing tag mismatch");for(;d0<H;d0++)if(t0=m.charCodeAt(d0),!(t0===32||t0>8&&t0<14))return D("close tag")}else{if(m.charCodeAt(H-1)===47?(K=R0=m.substring(T+1,H-1),R=!0,k=!0):(K=R0=m.substring(T+1,H),R=!0,k=!1),!(t0>96&&t0<123||t0>64&&t0<91||t0===95||t0===58))return D("illegal first char nodeName");for(d0=1,x0=K.length;d0<x0;d0++)if(t0=K.charCodeAt(d0),!(t0>96&&t0<123||t0>64&&t0<91||t0>47&&t0<59||t0===45||t0===95||t0==46)){if(t0===32||t0<14&&t0>8){R0=K.substring(0,d0),u0=null;break}return D("invalid nodeName")}k||F.push(R0)}if(E){if(v=x,R&&(k||I.push(v),u0===null&&(p=K.indexOf("xmlns",d0)!==-1)&&(Z=d0,V=K,y2(),p=!1)),r2=R0,t0=R0.indexOf(":"),t0!==-1){if(u2=x[R0.substring(0,t0)],!u2)return D("missing namespace on <"+r2+">");R0=R0.substr(t0+1)}else u2=x.xmlns;u2&&(R0=u2+":"+R0)}if(R&&(Z=d0,V=K,A&&(t?A(J,on,k,g):A(R0,y2,on,k,g),u)))return;if(k){if(i&&(i(t?J:R0,on,R,g),u))return;E&&(R?x=v:x=I.pop())}H+=1}}}function rg(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Ic={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},ag="property";function cg(e){return e.xml&&e.xml.serialize}function nC(e){const t=cg(e);return t!==ag&&(t||null)}function AC(e){return e.charAt(0).toUpperCase()+e.slice(1)}function sg(e,t){return rg(t)?e.prefix+":"+AC(e.localName):e.name}function iC(e,t){var n=e.name,A=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&A.indexOf(i)===0?e.prefix+":"+A.slice(i.length):n}function oC(e,t,n){const A=C2(e,t.xmlns),i=`${t[A.prefix]||A.prefix}:${A.localName}`,o=C2(i);var r=n.getPackage(o.prefix);return iC(o,r)}function It(e){return new Error(e)}function Xe(e){return e.$descriptor}function rC(e){N(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw It("expected element");var n=this.elementsById,A=Xe(t),i=A.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw It("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function kA(){}kA.prototype.handleEnd=function(){},kA.prototype.handleText=function(){},kA.prototype.handleNode=function(){};function Fc(){}Fc.prototype=Object.create(kA.prototype),Fc.prototype.handleNode=function(){return this};function Pn(){}Pn.prototype=Object.create(kA.prototype),Pn.prototype.handleText=function(e){this.body=(this.body||"")+e};function GA(e,t){this.property=e,this.context=t}GA.prototype=Object.create(Pn.prototype),GA.prototype.handleNode=function(e){if(this.element)throw It("expected no sub nodes");return this.element=this.createReference(e),this},GA.prototype.handleEnd=function(){this.element.id=this.body},GA.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function vc(e,t){this.element=t,this.propertyDesc=e}vc.prototype=Object.create(Pn.prototype),vc.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Cc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function Co(){}Co.prototype=Object.create(Pn.prototype),Co.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function b2(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}b2.prototype=Object.create(Co.prototype),b2.prototype.addReference=function(e){this.context.addReference(e)},b2.prototype.handleText=function(e){var t=this.element,n=Xe(t),A=n.bodyProperty;if(!A)throw It("unexpected body text <"+e+">");Pn.prototype.handleText.call(this,e)},b2.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Xe(t),A=n.bodyProperty;A&&e!==void 0&&(e=Cc(A.type,e),t.set(A.name,e))},b2.prototype.createElement=function(e){var t=e.attributes,n=this.type,A=Xe(n),i=this.context,o=new n({}),r=this.model,a;return U(t,function(c,l){var B=A.propertiesByName[l],g;B&&B.isReference?B.isMany?(g=c.split(" "),U(g,function(p){i.addReference({element:o,property:B.ns.name,id:p})})):i.addReference({element:o,property:B.ns.name,id:c}):(B?c=Cc(B.type,c):l==="xmlns"?l=":"+l:(a=C2(l,A.ns.prefix),r.getPackage(a.prefix)&&i.addWarning({message:"unknown attribute <"+l+">",element:o,property:l,value:c})),o.set(l,c))}),o},b2.prototype.getPropertyForNode=function(e){var t=e.name,n=C2(t),A=this.type,i=this.model,o=Xe(A),r=n.name,a=o.propertiesByName[r];if(a&&!a.isAttr){const l=nC(a);if(l){const B=e.attributes[l];if(B){const g=oC(B,e.ns,i),p=i.getType(g);return N({},a,{effectiveType:Xe(p).name})}}return a}var c=i.getPackage(n.prefix);if(c){const l=sg(n,c),B=i.getType(l);if(a=m0(o.properties,function(g){return!g.isVirtual&&!g.isReference&&!g.isAttribute&&B.hasType(g.type)}),a)return N({},a,{effectiveType:Xe(B).name})}else if(a=m0(o.properties,function(l){return!l.isReference&&!l.isAttribute&&l.type==="Element"}),a)return a;throw It("unrecognized element <"+n.name+">")},b2.prototype.toString=function(){return"ElementDescriptor["+Xe(this.type).name+"]"},b2.prototype.valueHandler=function(e,t){return new vc(e,t)},b2.prototype.referenceHandler=function(e){return new GA(e,this.context)},b2.prototype.handler=function(e){return e==="Element"?new Jn(this.model,e,this.context):new b2(this.model,e,this.context)},b2.prototype.handleChild=function(e){var t,n,A,i;if(t=this.getPropertyForNode(e),A=this.element,n=t.effectiveType||t.type,qB(n))return this.valueHandler(t,A);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?A.get(t.name).push(o):A.set(t.name,o),t.isReference?(N(o,{element:A}),this.context.addReference(o)):o.$parent=A),i};function xc(e,t,n){b2.call(this,e,t,n)}xc.prototype=Object.create(b2.prototype),xc.prototype.createElement=function(e){var t=e.name,n=C2(t),A=this.model,i=this.type,o=A.getPackage(n.prefix),r=o&&sg(n,o)||t;if(!i.hasType(r))throw It("unexpected element <"+e.originalName+">");return b2.prototype.createElement.call(this,e)};function Jn(e,t,n){this.model=e,this.context=n}Jn.prototype=Object.create(Co.prototype),Jn.prototype.createElement=function(e){var t=e.name,n=C2(t),A=n.prefix,i=e.ns[A+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)},Jn.prototype.handleChild=function(e){var t=new Jn(this.model,"Element",this.context).handleNode(e),n=this.element,A=t.element,i;return A!==void 0&&(i=n.$children=n.$children||[],i.push(A),A.$parent=n),t},Jn.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function bc(e){e instanceof ee&&(e={model:e}),N(this,{lax:!1},e)}bc.prototype.fromXML=function(e,t,n){var A=t.rootHandler;t instanceof b2?(A=t,t={}):typeof t=="string"?(A=this.handler(t),t={}):typeof A=="string"&&(A=this.handler(A));var i=this.model,o=this.lax,r=new rC(N({},t,{rootHandler:A})),a=new og({proxy:!0}),c=aC();A.context=r,c.push(A);function l(I,x,v){var F=x(),z=F.line,R=F.column,k=F.data;k.charAt(0)==="<"&&k.indexOf(" ")!==-1&&(k=k.slice(0,k.indexOf(" "))+">");var T="unparsable content "+(k?k+" ":"")+`detected
41
41
  line: `+z+`
42
42
  column: `+R+`
43
43
  nested error: `+I.message;if(v)return r.addWarning({message:T,error:I}),!0;throw It(T)}function B(I,x){return l(I,x,!0)}function g(){var I=r.elementsById,x=r.references,v,F;for(v=0;F=x[v];v++){var z=F.element,R=I[F.id],k=Xe(z).propertiesByName[F.property];if(R||r.addWarning({message:"unresolved reference <"+F.id+">",element:F.element,property:F.property,value:F.id}),k.isMany){var T=z.get(k.name),H=T.indexOf(F);H===-1&&(H=T.length),R?T[H]=R:T.splice(H,1)}else z.set(k.name,R)}}function p(){c.pop().handleEnd()}var E=/^<\?xml /i,d=/ encoding="([^"]+)"/i,u=/^utf-8$/i;function h(I){if(E.test(I)){var x=d.exec(I),v=x&&x[1];!v||u.test(v)||r.addWarning({message:"unsupported document encoding <"+v+">, falling back to UTF-8"})}}function D(I,x){var v=c.peek();try{c.push(v.handleNode(I))}catch(F){l(F,x,o)&&c.push(new Fc)}}function y(I,x){try{c.peek().handleText(I)}catch(v){B(v,x)}}function C(I,x){I.trim()&&y(I,x)}var m=i.getPackages().reduce(function(I,x){return I[x.uri]=x.prefix,I},Object.entries(Ic).reduce(function(I,[x,v]){return I[v]=x,I},i.config&&i.config.nsMap||{}));return a.ns(m).on("openTag",function(I,x,v,F){var z=I.attrs||{},R=Object.keys(z).reduce(function(T,H){var K=x(z[H]);return T[H]=K,T},{}),k={name:I.name,originalName:I.originalName,attributes:R,ns:I.ns};D(k,F)}).on("question",h).on("closeTag",p).on("cdata",y).on("text",function(I,x,v){C(x(I),v)}).on("error",l).on("warn",B),new Promise(function(I,x){var v;try{a.parse(e),g()}catch(T){v=T}var F=A.element;!v&&!F&&(v=It("failed to parse document as <"+A.type.$descriptor.name+">"));var z=r.warnings,R=r.references,k=r.elementsById;return v?(v.warnings=z,x(v)):I({rootElement:F,elementsById:k,references:R,warnings:z})})},bc.prototype.handler=function(e){return new xc(this.model,e)};function aC(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var cC=`<?xml version="1.0" encoding="UTF-8"?>
44
44
  `,sC=/<|>|'|"|&|\n\r|\n/g,lg=/<|>|&/g;function Ne(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}Ne.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},Ne.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},Ne.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)},Ne.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)},Ne.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)},Ne.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},Ne.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri},Ne.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)},Ne.prototype.getUsed=function(e){var t=[].concat(this.wellknown,this.custom);return t.filter(n=>{var A=this.getNSKey(n);return this.used[A]})};function lC(e){return e.charAt(0).toLowerCase()+e.slice(1)}function BC(e,t){return rg(t)?lC(e):e}function Bg(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function gg(e){return U2(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function gC(e){return e.getUsed().filter(function(t){return t.prefix!=="xml"}).map(function(t){var n="xmlns"+(t.prefix?":"+t.prefix:"");return{name:n,value:t.uri}})}function pC(e,t){return t.isGeneric?N({localName:t.ns.localName},e):N({localName:BC(t.ns.localName,t.$pkg)},e)}function EC(e,t){return N({localName:t.ns.localName},e)}function dC(e){var t=e.$descriptor;return l0(t.properties,function(n){var A=n.name;if(n.isVirtual||!I2(e,A))return!1;var i=e[A];return i===n.default||i===null?!1:n.isMany?i.length:!0})}var uC={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},QC={"<":"lt",">":"gt","&":"amp"};function pg(e,t,n){return e=U2(e)?e:""+e,e.replace(t,function(A){return"&"+n[A]+";"})}function hC(e){return pg(e,sC,uC)}function wC(e){return pg(e,lg,QC)}function mC(e){return l0(e,function(t){return t.isAttr})}function fC(e){return l0(e,function(t){return!t.isAttr})}function Yc(e){this.tagName=e}Yc.prototype.build=function(e){return this.element=e,this},Yc.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()};function rn(){}rn.prototype.serializeValue=rn.prototype.serializeTo=function(e){e.append(this.escape?wC(this.value):this.value)},rn.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(lg)!==-1&&(this.escape=!0),this};function Uc(e){this.tagName=e}Bg(Uc,rn),Uc.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()};function T0(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}T0.prototype.build=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,A,i,o=t.isGeneric;return o?A=this.parseGenericNsAttributes(e):A=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(i=dC(e),this.parseAttributes(mC(i)),this.parseContainments(fC(i))),this.parseGenericAttributes(e,A),this},T0.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return pC(t,e)},T0.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return EC(t,e)},T0.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},T0.prototype.nsAttributeName=function(e){var t;if(U2(e)?t=C2(e):t=e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:N({localName:t.localName},n)},T0.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n)).map(([t,n])=>({name:t,value:n}))},T0.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new rn().build({type:"String"},t));var n=e.$children;n&&U(n,A=>{this.body.push(new T0(this).build(A))})},T0.prototype.parseNsAttribute=function(e,t,n){var A=e.$model,i=C2(t),o;if(i.prefix==="xmlns"&&(o={prefix:i.localName,uri:n}),!i.prefix&&i.localName==="xmlns"&&(o={uri:n}),!o)return{name:t,value:n};if(A&&A.getPackage(n))this.logNamespace(o,!0,!0);else{var r=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(r)}},T0.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,A=[];return U(n,function(i,o){var r=t.parseNsAttribute(e,o,i);r&&A.push(r)}),A},T0.prototype.parseGenericAttributes=function(e,t){var n=this;U(t,function(A){try{n.addAttribute(n.nsAttributeName(A.name),A.value)}catch(i){typeof console<"u"&&console.warn(`missing namespace information for <${A.name}=${A.value}> on`,e,i)}})},T0.prototype.parseContainments=function(e){var t=this,n=this.body,A=this.element;U(e,function(i){var o=A.get(i.name),r=i.isReference,a=i.isMany;if(a||(o=[o]),i.isBody)n.push(new rn().build(i,o[0]));else if(qB(i.type))U(o,function(l){n.push(new Uc(t.addTagName(t.nsPropertyTagName(i))).build(i,l))});else if(r)U(o,function(l){n.push(new Yc(t.addTagName(t.nsPropertyTagName(i))).build(l))});else{var c=cg(i);U(o,function(l){var B;c?c===ag?B=new T0(t,i):B=new Mo(t,i,c):B=new T0(t),n.push(B.build(l))})}})},T0.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,A;return t||(A=n&&n.getNamespaces(),e||!A?this.namespaces=t=new Ne(A):t=A),t},T0.prototype.logNamespace=function(e,t,n){var A=this.getNamespaces(n),i=e.uri,o=e.prefix,r=A.byUri(i);return(!r||n)&&A.add(e,t),A.mapPrefix(o,i),e},T0.prototype.logNamespaceUsed=function(e,t){var n=this.getNamespaces(t),A=e.prefix,i=e.uri,o,r,a;if(!A&&!i)return{localName:e.localName};if(a=n.defaultUriByPrefix(A),i=i||a||n.uriByPrefix(A),!i)throw new Error("no namespace uri given for prefix <"+A+">");if(e=n.byUri(i),!e&&!A&&(e=this.logNamespace({uri:i},a===i,!0)),!e){for(o=A,r=1;n.uriByPrefix(o);)o=A+"_"+r++;e=this.logNamespace({prefix:o,uri:i},a===i)}return A&&n.mapPrefix(A,i),e},T0.prototype.parseAttributes=function(e){var t=this,n=this.element;U(e,function(A){var i=n.get(A.name);if(A.isReference)if(!A.isMany)i=i.id;else{var o=[];U(i,function(r){o.push(r.id)}),i=o.join(" ")}t.addAttribute(t.nsAttributeName(A),i)})},T0.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),gg(e)},T0.prototype.addAttribute=function(e,t){var n=this.attrs;U2(t)&&(t=hC(t));var A=qa(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),i={name:e,value:t};A!==-1?n.splice(A,1,i):n.push(i)},T0.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=gC(n).concat(t)),U(t,function(A){e.append(" ").append(gg(A.name)).append('="').append(A.value).append('"')})},T0.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==rn;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),U(this.body,function(A){A.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()};function Mo(e,t,n){T0.call(this,e,t),this.serialization=n}Bg(Mo,T0),Mo.prototype.parseNsAttributes=function(e){var t=T0.prototype.parseNsAttributes.call(this,e).filter(r=>r.name!==this.serialization),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var A=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(A.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(A.prefix?A.prefix+":":"")+o+n.ns.localName),t},Mo.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function CC(){this.value="",this.write=function(e){this.value+=e}}function MC(e,t){var n=[""];this.append=function(A){return e.write(A),this},this.appendNewLine=function(){return t&&e.write(`
45
- `),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function DC(e){e=N({format:!1,preamble:!0},e||{});function t(n,A){var i=A||new CC,o=new MC(i,e.format);e.preamble&&o.append(cC);var r=new T0,a=n.$model;if(r.getNamespaces().mapDefaultPrefixes(yC(a)),r.build(n).serializeTo(o),!A)return i.value}return{toXML:t}}function yC(e){const t=e.config&&e.config.nsMap||{},n={};for(const A in Ic)n[A]=Ic[A];for(const A in t){const i=t[A];n[i]=A}for(const A of e.getPackages())n[A.prefix]=A.uri;return n}function Do(e,t){ee.call(this,e,t)}Do.prototype=Object.create(ee.prototype),Do.prototype.fromXML=function(e,t,n){U2(t)||(n=t,t="bpmn:Definitions");var A=new bc(N({model:this,lax:!0},n)),i=A.handler(t);return A.fromXML(e,i)},Do.prototype.toXML=function(e,t){var n=new DC(t);return new Promise(function(A,i){try{var o=n.toXML(e);return A({xml:o})}catch(r){return i(r)}})};var IC="BPMN20",FC="http://www.omg.org/spec/BPMN/20100524/MODEL",vC="bpmn",xC=[],bC=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],YC=[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],UC={tagAlias:"lowerCase",typePrefix:"t"},NC={name:IC,uri:FC,prefix:vC,associations:xC,types:bC,enumerations:YC,xml:UC},zC="BPMNDI",RC="http://www.omg.org/spec/BPMN/20100524/DI",SC="bpmndi",TC=[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],kC=[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],GC=[],HC={name:zC,uri:RC,prefix:SC,types:TC,enumerations:kC,associations:GC},PC="DC",JC="http://www.omg.org/spec/DD/20100524/DC",jC="dc",VC=[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],LC=[],WC={name:PC,uri:JC,prefix:jC,types:VC,associations:LC},_C="DI",OC="http://www.omg.org/spec/DD/20100524/DI",XC="di",KC=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],ZC=[],qC={tagAlias:"lowerCase"},$C={name:_C,uri:OC,prefix:XC,types:KC,associations:ZC,xml:qC},eM="bpmn.io colors for BPMN",tM="http://bpmn.io/schema/bpmn/biocolor/1.0",nM="bioc",AM=[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],iM=[],oM=[],rM={name:eM,uri:tM,prefix:nM,types:AM,enumerations:iM,associations:oM},aM="BPMN in Color",cM="http://www.omg.org/spec/BPMN/non-normative/color/1.0",sM="color",lM=[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],BM=[],gM=[],pM={name:aM,uri:cM,prefix:sM,types:lM,enumerations:BM,associations:gM};const EM={bpmn:NC,bpmndi:HC,dc:WC,di:$C,bioc:rM,color:pM};function dM(e,t){const n=N({},EM,e);return new Do(n,t)}function M2(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var uM="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function Eg(e){I2(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(uM)}})}function z2(e,t){return e.$instanceOf(t)}function QM(e){return m0(e.rootElements,function(t){return z2(t,"bpmn:Process")||z2(t,"bpmn:Collaboration")})}function hM(e){var t={},n=[],A={};function i(J,V){return function(Z){J(Z,V)}}function o(J){t[J.id]=J}function r(J){return t[J.id]}function a(J,V){var Z=J.gfx;if(Z)throw new Error(`already rendered ${M2(J)}`);return e.element(J,A[J.id],V)}function c(J,V){return e.root(J,A[J.id],V)}function l(J,V){try{var Z=A[J.id]&&a(J,V);return o(J),Z}catch(u0){B(u0.message,{element:J,error:u0}),console.error(`failed to import ${M2(J)}`,u0)}}function B(J,V){e.error(J,V)}var g=this.registerDi=function(V){var Z=V.bpmnElement;Z?A[Z.id]?B(`multiple DI elements defined for ${M2(Z)}`,{element:Z}):(A[Z.id]=V,Eg(Z)):B(`no bpmnElement referenced in ${M2(V)}`,{element:V})};function p(J){E(J.plane)}function E(J){g(J),U(J.planeElement,d)}function d(J){g(J)}this.handleDefinitions=function(V,Z){var u0=V.diagrams;if(Z&&u0.indexOf(Z)===-1)throw new Error("diagram not part of <bpmn:Definitions />");if(!Z&&u0&&u0.length&&(Z=u0[0]),!Z)throw new Error("no diagram to display");A={},p(Z);var y2=Z.plane;if(!y2)throw new Error(`no plane for ${M2(Z)}`);var M=y2.bpmnElement;if(!M)if(M=QM(V),M)B(`correcting missing bpmnElement on ${M2(y2)} to ${M2(M)}`),y2.bpmnElement=M,g(y2);else throw new Error("no process or collaboration to display");var w=c(M,y2);if(z2(M,"bpmn:Process")||z2(M,"bpmn:SubProcess"))h(M,w);else if(z2(M,"bpmn:Collaboration"))R0(M,w),D(V.rootElements,w);else throw new Error(`unsupported bpmnElement for ${M2(y2)}: ${M2(M)}`);u(n)};var u=this.handleDeferred=function(){for(var V;n.length;)V=n.shift(),V()};function h(J,V){t0(J,V),z(J.ioSpecification,V),F(J.artifacts,V),o(J)}function D(J,V){var Z=l0(J,function(u0){return!r(u0)&&z2(u0,"bpmn:Process")&&u0.laneSets});Z.forEach(i(h,V))}function y(J,V){l(J,V)}function C(J,V){U(J,i(y,V))}function m(J,V){l(J,V)}function I(J,V){l(J,V)}function x(J,V){l(J,V)}function v(J,V){l(J,V)}function F(J,V){U(J,function(Z){z2(Z,"bpmn:Association")?n.push(function(){v(Z,V)}):v(Z,V)})}function z(J,V){J&&(U(J.dataInputs,i(I,V)),U(J.dataOutputs,i(x,V)))}var R=this.handleSubProcess=function(V,Z){t0(V,Z),F(V.artifacts,Z)};function k(J,V){var Z=l(J,V);z2(J,"bpmn:SubProcess")&&R(J,Z||V),z2(J,"bpmn:Activity")&&z(J.ioSpecification,V),n.push(function(){U(J.dataInputAssociations,i(m,V)),U(J.dataOutputAssociations,i(m,V))})}function T(J,V){l(J,V)}function H(J,V){l(J,V)}function K(J,V){n.push(function(){var Z=l(J,V);J.childLaneSet&&x0(J.childLaneSet,Z||V),r2(J)})}function x0(J,V){U(J.lanes,i(K,V))}function d0(J,V){U(J,i(x0,V))}function t0(J,V){G0(J.flowElements,V),J.laneSets&&d0(J.laneSets,V)}function G0(J,V){U(J,function(Z){z2(Z,"bpmn:SequenceFlow")?n.push(function(){T(Z,V)}):z2(Z,"bpmn:BoundaryEvent")?n.unshift(function(){k(Z,V)}):z2(Z,"bpmn:FlowNode")?k(Z,V):z2(Z,"bpmn:DataObject")||(z2(Z,"bpmn:DataStoreReference")||z2(Z,"bpmn:DataObjectReference")?H(Z,V):B(`unrecognized flowElement ${M2(Z)} in context ${M2(V&&V.businessObject)}`,{element:Z,context:V}))})}function u2(J,V){var Z=l(J,V),u0=J.processRef;u0&&h(u0,Z||V)}function R0(J,V){U(J.participants,i(u2,V)),n.push(function(){C(J.messageFlows,V)}),F(J.artifacts,V)}function r2(J){U(J.flowNodeRef,function(V){var Z=V.get("lanes");Z&&Z.push(J)})}}function f(e,t){var n=P(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function a0(e,t){return Qe(t,function(n){return f(e,n)})}function P(e){return e&&e.businessObject||e}function h0(e){return e&&e.di}function wM(e,t,n){var A,i,o,r,a=[];function c(l,B){var g={root:function(u,h){return A.add(u,h)},element:function(u,h,D){return A.add(u,h,D)},error:function(u,h){a.push({message:u,context:h})}},p=new hM(g);B=B||l.diagrams&&l.diagrams[0];var E=mM(l,B);if(!E)throw new Error("no diagram to display");U(E,function(u){p.handleDefinitions(l,u)});var d=B.plane.bpmnElement.id;o.setRootElement(o.findRoot(d+"_plane")||o.findRoot(d))}return new Promise(function(l,B){try{return A=e.get("bpmnImporter"),i=e.get("eventBus"),o=e.get("canvas"),i.fire("import.render.start",{definitions:t}),c(t,n),i.fire("import.render.complete",{error:r,warnings:a}),l({warnings:a})}catch(g){return g.warnings=a,B(g)}})}function mM(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,A=n;!f(n,"bpmn:Process")&&!f(n,"bpmn:Collaboration")&&(A=fM(n));var i;f(A,"bpmn:Collaboration")?i=A:i=m0(e.rootElements,function(l){if(f(l,"bpmn:Collaboration"))return m0(l.participants,function(B){return B.processRef===A})});var o=[A];i&&(o=B2(i.participants,function(l){return l.processRef}),o.push(i));var r=dg(o),a=[t],c=[n];return U(e.diagrams,function(l){if(l.plane){var B=l.plane.bpmnElement;r.indexOf(B)!==-1&&c.indexOf(B)===-1&&(a.push(l),c.push(B))}}),a}}function dg(e){var t=[];return U(e,function(n){n&&(t.push(n),t=t.concat(dg(n.flowElements)))}),t}function fM(e){for(var t=e;t;){if(f(t,"bpmn:Process"))return t;t=t.$parent}}var CM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" 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="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',ug=CM,Qg={verticalAlign:"middle"},hg={color:"#404040"},MM={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},DM={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},yM={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},IM='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+ug+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>',ze;function FM(){ze=$(IM),m2(ze,MM),m2(p0("svg",ze),Qg),m2(p0(".backdrop",ze),DM),m2(p0(".notice",ze),yM),m2(p0(".link",ze),hg,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function vM(){ze||(FM(),x2.bind(ze,".backdrop","click",function(e){document.body.removeChild(ze)})),document.body.appendChild(ze)}function H0(e){e=N({},bM,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),UM(this._container)}W(H0,Dt),H0.prototype.importXML=async function(t,n){const A=this;function i(r){return A.get("eventBus").createEvent(r)}let o=[];try{t=this._emit("import.parse.start",{xml:t})||t;let r;try{r=await this._moddle.fromXML(t,"bpmn:Definitions")}catch(p){throw this._emit("import.parse.complete",{error:p}),p}let a=r.rootElement;const c=r.references,l=r.warnings,B=r.elementsById;o=o.concat(l),a=this._emit("import.parse.complete",i({error:null,definitions:a,elementsById:B,references:c,warnings:o}))||a;const g=await this.importDefinitions(a,n);return o=o.concat(g.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(r){let a=r;throw o=o.concat(a.warnings||[]),yo(a,o),a=xM(a),this._emit("import.done",{error:a,warnings:a.warnings}),a}},H0.prototype.importDefinitions=async function(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}},H0.prototype.open=async function(t){const n=this._definitions;let A=t;if(!n){const o=new Error("no XML imported");throw yo(o,[]),o}if(typeof t=="string"&&(A=YM(n,t),!A)){const o=new Error("BPMNDiagram <"+t+"> not found");throw yo(o,[]),o}try{this.clear()}catch(o){throw yo(o,[]),o}const{warnings:i}=await wM(this,n,A);return{warnings:i}},H0.prototype.saveXML=async function(t){t=t||{};let n=this._definitions,A,i;try{if(!n)throw new Error("no definitions loaded");n=this._emit("saveXML.start",{definitions:n})||n,i=(await this._moddle.toXML(n,t)).xml,i=this._emit("saveXML.serialized",{xml:i})||i}catch(r){A=r}const o=A?{error:A}:{xml:i};if(this._emit("saveXML.done",o),A)throw A;return o},H0.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,n;try{const A=this.get("canvas"),i=A.getActiveLayer(),o=p0(":scope > defs",A._svg),r=aB(i),a=o?"<defs>"+aB(o)+"</defs>":"",c=i.getBBox();t=`<?xml version="1.0" encoding="utf-8"?>
45
+ `),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function DC(e){e=N({format:!1,preamble:!0},e||{});function t(n,A){var i=A||new CC,o=new MC(i,e.format);e.preamble&&o.append(cC);var r=new T0,a=n.$model;if(r.getNamespaces().mapDefaultPrefixes(yC(a)),r.build(n).serializeTo(o),!A)return i.value}return{toXML:t}}function yC(e){const t=e.config&&e.config.nsMap||{},n={};for(const A in Ic)n[A]=Ic[A];for(const A in t){const i=t[A];n[i]=A}for(const A of e.getPackages())n[A.prefix]=A.uri;return n}function Do(e,t){ee.call(this,e,t)}Do.prototype=Object.create(ee.prototype),Do.prototype.fromXML=function(e,t,n){U2(t)||(n=t,t="bpmn:Definitions");var A=new bc(N({model:this,lax:!0},n)),i=A.handler(t);return A.fromXML(e,i)},Do.prototype.toXML=function(e,t){var n=new DC(t);return new Promise(function(A,i){try{var o=n.toXML(e);return A({xml:o})}catch(r){return i(r)}})};var IC="BPMN20",FC="http://www.omg.org/spec/BPMN/20100524/MODEL",vC="bpmn",xC=[],bC=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],YC=[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],UC={tagAlias:"lowerCase",typePrefix:"t"},NC={name:IC,uri:FC,prefix:vC,associations:xC,types:bC,enumerations:YC,xml:UC},zC="BPMNDI",RC="http://www.omg.org/spec/BPMN/20100524/DI",SC="bpmndi",TC=[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],kC=[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],GC=[],HC={name:zC,uri:RC,prefix:SC,types:TC,enumerations:kC,associations:GC},PC="DC",JC="http://www.omg.org/spec/DD/20100524/DC",jC="dc",VC=[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],LC=[],WC={name:PC,uri:JC,prefix:jC,types:VC,associations:LC},_C="DI",OC="http://www.omg.org/spec/DD/20100524/DI",XC="di",KC=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],ZC=[],qC={tagAlias:"lowerCase"},$C={name:_C,uri:OC,prefix:XC,types:KC,associations:ZC,xml:qC},eM="bpmn.io colors for BPMN",tM="http://bpmn.io/schema/bpmn/biocolor/1.0",nM="bioc",AM=[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],iM=[],oM=[],rM={name:eM,uri:tM,prefix:nM,types:AM,enumerations:iM,associations:oM},aM="BPMN in Color",cM="http://www.omg.org/spec/BPMN/non-normative/color/1.0",sM="color",lM=[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],BM=[],gM=[],pM={name:aM,uri:cM,prefix:sM,types:lM,enumerations:BM,associations:gM};const EM={bpmn:NC,bpmndi:HC,dc:WC,di:$C,bioc:rM,color:pM};function dM(e,t){const n=N({},EM,e);return new Do(n,t)}function M2(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var uM="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function Eg(e){I2(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(uM)}})}function z2(e,t){return e.$instanceOf(t)}function QM(e){return m0(e.rootElements,function(t){return z2(t,"bpmn:Process")||z2(t,"bpmn:Collaboration")})}function hM(e){var t={},n=[],A={};function i(J,V){return function(Z){J(Z,V)}}function o(J){t[J.id]=J}function r(J){return t[J.id]}function a(J,V){var Z=J.gfx;if(Z)throw new Error(`already rendered ${M2(J)}`);return e.element(J,A[J.id],V)}function c(J,V){return e.root(J,A[J.id],V)}function l(J,V){try{var Z=A[J.id]&&a(J,V);return o(J),Z}catch(u0){B(u0.message,{element:J,error:u0}),console.error(`failed to import ${M2(J)}`,u0)}}function B(J,V){e.error(J,V)}var g=this.registerDi=function(V){var Z=V.bpmnElement;Z?A[Z.id]?B(`multiple DI elements defined for ${M2(Z)}`,{element:Z}):(A[Z.id]=V,Eg(Z)):B(`no bpmnElement referenced in ${M2(V)}`,{element:V})};function p(J){E(J.plane)}function E(J){g(J),U(J.planeElement,d)}function d(J){g(J)}this.handleDefinitions=function(V,Z){var u0=V.diagrams;if(Z&&u0.indexOf(Z)===-1)throw new Error("diagram not part of <bpmn:Definitions />");if(!Z&&u0&&u0.length&&(Z=u0[0]),!Z)throw new Error("no diagram to display");A={},p(Z);var y2=Z.plane;if(!y2)throw new Error(`no plane for ${M2(Z)}`);var M=y2.bpmnElement;if(!M)if(M=QM(V),M)B(`correcting missing bpmnElement on ${M2(y2)} to ${M2(M)}`),y2.bpmnElement=M,g(y2);else throw new Error("no process or collaboration to display");var w=c(M,y2);if(z2(M,"bpmn:Process")||z2(M,"bpmn:SubProcess"))h(M,w);else if(z2(M,"bpmn:Collaboration"))R0(M,w),D(V.rootElements,w);else throw new Error(`unsupported bpmnElement for ${M2(y2)}: ${M2(M)}`);u(n)};var u=this.handleDeferred=function(){for(var V;n.length;)V=n.shift(),V()};function h(J,V){t0(J,V),z(J.ioSpecification,V),F(J.artifacts,V),o(J)}function D(J,V){var Z=l0(J,function(u0){return!r(u0)&&z2(u0,"bpmn:Process")&&u0.laneSets});Z.forEach(i(h,V))}function y(J,V){l(J,V)}function C(J,V){U(J,i(y,V))}function m(J,V){l(J,V)}function I(J,V){l(J,V)}function x(J,V){l(J,V)}function v(J,V){l(J,V)}function F(J,V){U(J,function(Z){z2(Z,"bpmn:Association")?n.push(function(){v(Z,V)}):v(Z,V)})}function z(J,V){J&&(U(J.dataInputs,i(I,V)),U(J.dataOutputs,i(x,V)))}var R=this.handleSubProcess=function(V,Z){t0(V,Z),F(V.artifacts,Z)};function k(J,V){var Z=l(J,V);z2(J,"bpmn:SubProcess")&&R(J,Z||V),z2(J,"bpmn:Activity")&&z(J.ioSpecification,V),n.push(function(){U(J.dataInputAssociations,i(m,V)),U(J.dataOutputAssociations,i(m,V))})}function T(J,V){l(J,V)}function H(J,V){l(J,V)}function K(J,V){n.push(function(){var Z=l(J,V);J.childLaneSet&&x0(J.childLaneSet,Z||V),r2(J)})}function x0(J,V){U(J.lanes,i(K,V))}function d0(J,V){U(J,i(x0,V))}function t0(J,V){G0(J.flowElements,V),J.laneSets&&d0(J.laneSets,V)}function G0(J,V){U(J,function(Z){z2(Z,"bpmn:SequenceFlow")?n.push(function(){T(Z,V)}):z2(Z,"bpmn:BoundaryEvent")?n.unshift(function(){k(Z,V)}):z2(Z,"bpmn:FlowNode")?k(Z,V):z2(Z,"bpmn:DataObject")||(z2(Z,"bpmn:DataStoreReference")||z2(Z,"bpmn:DataObjectReference")?H(Z,V):B(`unrecognized flowElement ${M2(Z)} in context ${M2(V&&V.businessObject)}`,{element:Z,context:V}))})}function u2(J,V){var Z=l(J,V),u0=J.processRef;u0&&h(u0,Z||V)}function R0(J,V){U(J.participants,i(u2,V)),n.push(function(){C(J.messageFlows,V)}),F(J.artifacts,V)}function r2(J){U(J.flowNodeRef,function(V){var Z=V.get("lanes");Z&&Z.push(J)})}}function wM(e,t,n){var A,i,o,r,a=[];function c(l,B){var g={root:function(u,h){return A.add(u,h)},element:function(u,h,D){return A.add(u,h,D)},error:function(u,h){a.push({message:u,context:h})}},p=new hM(g);B=B||l.diagrams&&l.diagrams[0];var E=mM(l,B);if(!E)throw new Error("no diagram to display");U(E,function(u){p.handleDefinitions(l,u)});var d=B.plane.bpmnElement.id;o.setRootElement(o.findRoot(d+"_plane")||o.findRoot(d))}return new Promise(function(l,B){try{return A=e.get("bpmnImporter"),i=e.get("eventBus"),o=e.get("canvas"),i.fire("import.render.start",{definitions:t}),c(t,n),i.fire("import.render.complete",{error:r,warnings:a}),l({warnings:a})}catch(g){return g.warnings=a,B(g)}})}function mM(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,A=n;!f(n,"bpmn:Process")&&!f(n,"bpmn:Collaboration")&&(A=fM(n));var i;f(A,"bpmn:Collaboration")?i=A:i=m0(e.rootElements,function(l){if(f(l,"bpmn:Collaboration"))return m0(l.participants,function(B){return B.processRef===A})});var o=[A];i&&(o=B2(i.participants,function(l){return l.processRef}),o.push(i));var r=dg(o),a=[t],c=[n];return U(e.diagrams,function(l){if(l.plane){var B=l.plane.bpmnElement;r.indexOf(B)!==-1&&c.indexOf(B)===-1&&(a.push(l),c.push(B))}}),a}}function dg(e){var t=[];return U(e,function(n){n&&(t.push(n),t=t.concat(dg(n.flowElements)))}),t}function fM(e){for(var t=e;t;){if(f(t,"bpmn:Process"))return t;t=t.$parent}}var CM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" 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="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',ug=CM,Qg={verticalAlign:"middle"},hg={color:"#404040"},MM={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},DM={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},yM={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},IM='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+ug+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>',ze;function FM(){ze=$(IM),m2(ze,MM),m2(p0("svg",ze),Qg),m2(p0(".backdrop",ze),DM),m2(p0(".notice",ze),yM),m2(p0(".link",ze),hg,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function vM(){ze||(FM(),x2.bind(ze,".backdrop","click",function(e){document.body.removeChild(ze)})),document.body.appendChild(ze)}function H0(e){e=N({},bM,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),UM(this._container)}W(H0,Dt),H0.prototype.importXML=async function(t,n){const A=this;function i(r){return A.get("eventBus").createEvent(r)}let o=[];try{t=this._emit("import.parse.start",{xml:t})||t;let r;try{r=await this._moddle.fromXML(t,"bpmn:Definitions")}catch(p){throw this._emit("import.parse.complete",{error:p}),p}let a=r.rootElement;const c=r.references,l=r.warnings,B=r.elementsById;o=o.concat(l),a=this._emit("import.parse.complete",i({error:null,definitions:a,elementsById:B,references:c,warnings:o}))||a;const g=await this.importDefinitions(a,n);return o=o.concat(g.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(r){let a=r;throw o=o.concat(a.warnings||[]),yo(a,o),a=xM(a),this._emit("import.done",{error:a,warnings:a.warnings}),a}},H0.prototype.importDefinitions=async function(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}},H0.prototype.open=async function(t){const n=this._definitions;let A=t;if(!n){const o=new Error("no XML imported");throw yo(o,[]),o}if(typeof t=="string"&&(A=YM(n,t),!A)){const o=new Error("BPMNDiagram <"+t+"> not found");throw yo(o,[]),o}try{this.clear()}catch(o){throw yo(o,[]),o}const{warnings:i}=await wM(this,n,A);return{warnings:i}},H0.prototype.saveXML=async function(t){t=t||{};let n=this._definitions,A,i;try{if(!n)throw new Error("no definitions loaded");n=this._emit("saveXML.start",{definitions:n})||n,i=(await this._moddle.toXML(n,t)).xml,i=this._emit("saveXML.serialized",{xml:i})||i}catch(r){A=r}const o=A?{error:A}:{xml:i};if(this._emit("saveXML.done",o),A)throw A;return o},H0.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,n;try{const A=this.get("canvas"),i=A.getActiveLayer(),o=p0(":scope > defs",A._svg),r=aB(i),a=o?"<defs>"+aB(o)+"</defs>":"",c=i.getBBox();t=`<?xml version="1.0" encoding="utf-8"?>
46
46
  <!-- created with bpmn-js / http://bpmn.io -->
47
47
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
48
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+a+r+"</svg>"}catch(A){n=A}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}},H0.prototype._setDefinitions=function(e){this._definitions=e},H0.prototype.getModules=function(){return this._modules},H0.prototype.clear=function(){this.getDefinitions()&&Dt.prototype.clear.call(this)},H0.prototype.destroy=function(){Dt.prototype.destroy.call(this),xe(this._container)},H0.prototype.on=function(e,t,n,A){return this.get("eventBus").on(e,t,n,A)},H0.prototype.off=function(e,t){this.get("eventBus").off(e,t)},H0.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=p0(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},H0.prototype.getDefinitions=function(){return this._definitions},H0.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},H0.prototype._init=function(e,t,n){const A=n.modules||this.getModules(n),i=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],r=[].concat(o,A,i),a=N(we(n,["additionalModules"]),{canvas:N({},n.canvas,{container:e}),modules:r});Dt.call(this,a),n&&n.container&&this.attachTo(n.container)},H0.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},H0.prototype._createContainer=function(e){const t=$('<div class="bjs-container"></div>');return m2(t,{width:wg(e.width),height:wg(e.height),position:e.position}),t},H0.prototype._createModdle=function(e){const t=N({},this._moddleExtensions,e.moddleExtensions);return new dM(t)},H0.prototype._modules=[];function yo(e,t){return e.warnings=t,e}function xM(e){const n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}const bM={width:"100%",height:"100%",position:"relative"};function wg(e){return e+(A0(e)?"px":"")}function YM(e,t){return t&&m0(e.diagrams,function(n){return n.id===t})||null}function UM(e){const n='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+ug+"</a>",A=$(n);m2(p0("svg",A),Qg),m2(A,hg,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(A),O.bind(A,"click",function(i){vM(),i.preventDefault()})}function HA(e){H0.call(this,e),this.on("import.parse.complete",function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}W(HA,H0),HA.prototype._createModdle=function(e){var t=H0.prototype._createModdle.call(this,e);return t.ids=new ue([32,36,1]),t},HA.prototype._collectIds=function(e,t){var n=e.$model,A=n.ids,i;A.clear();for(i in t)A.claim(i,t[i])};function E0(e,t){return f(e,"bpmn:CallActivity")?!1:f(e,"bpmn:SubProcess")?(t=t||h0(e),t&&f(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):f(e,"bpmn:Participant")?!!P(e).processRef:!0}function l2(e){if(!(!f(e,"bpmn:Participant")&&!f(e,"bpmn:Lane"))){var t=h0(e).isHorizontal;return t===void 0?!0:t}}function NM(e){return e&&P(e).isInterrupting!==!1}function h2(e){return e&&!!P(e).triggeredByEvent}function jn(e,t){var n=P(e).eventDefinitions;return Qe(n,function(A){return f(A,t)})}function zM(e){return jn(e,"bpmn:ErrorEventDefinition")}function RM(e){return jn(e,"bpmn:EscalationEventDefinition")}function SM(e){return jn(e,"bpmn:CompensateEventDefinition")}var PA={width:90,height:20},mg=15;function an(e){return f(e,"bpmn:Event")||f(e,"bpmn:Gateway")||f(e,"bpmn:DataStoreReference")||f(e,"bpmn:DataObjectReference")||f(e,"bpmn:DataInput")||f(e,"bpmn:DataOutput")||f(e,"bpmn:SequenceFlow")||f(e,"bpmn:MessageFlow")||f(e,"bpmn:Group")}function Io(e){return f0(e.label)}function TM(e){var t=e.length/2-1,n=e[Math.floor(t)],A=e[Math.ceil(t+.01)],i=kM(e),o=Math.atan((A.y-n.y)/(A.x-n.x)),r=i.x,a=i.y;return Math.abs(o)<Math.PI/2?a-=mg:r+=mg,{x:r,y:a}}function kM(e){var t=e.length/2-1,n=e[Math.floor(t)],A=e[Math.ceil(t+.01)];return{x:n.x+(A.x-n.x)/2,y:n.y+(A.y-n.y)/2}}function Nc(e){return e.waypoints?TM(e.waypoints):f(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+PA.height/2}:{x:e.x+e.width/2,y:e.y+e.height+PA.height/2}}function GM(e,t){var n,A,i,o=e.label;return o&&o.bounds?(i=o.bounds,A={width:Math.max(PA.width,i.width),height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=Nc(t),A=PA),N({x:n.x-A.width/2,y:n.y-A.height/2},A)}function fg(e){if(f(e,"bpmn:FlowElement")||f(e,"bpmn:Participant")||f(e,"bpmn:Lane")||f(e,"bpmn:SequenceFlow")||f(e,"bpmn:MessageFlow")||f(e,"bpmn:DataInput")||f(e,"bpmn:DataOutput"))return"name";if(f(e,"bpmn:TextAnnotation"))return"text";if(f(e,"bpmn:Group"))return"categoryValueRef"}function HM(e){var t=e.categoryValueRef;return t&&t.value||""}function fe(e){var t=e.businessObject,n=fg(t);if(n)return n==="categoryValueRef"?HM(t):t[n]||""}function PM(e,t){var n=e.businessObject,A=fg(n);if(A)if(A==="categoryValueRef"){if(!n[A])return e;n[A].value=t}else n[A]=t;return e}var zc="hsl(225, 10%, 15%)",JM="white";function Re(e,t){return Qe(e.eventDefinitions,function(n){return n.$type===t})}function jM(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function VM(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function B0(e,t,n){var A=h0(e);return n||A.get("color:background-color")||A.get("bioc:fill")||t||JM}function L(e,t,n){var A=h0(e);return n||A.get("color:border-color")||A.get("bioc:stroke")||t||zc}function JA(e,t,n,A){var i=h0(e),o=i.get("label");return A||o&&o.get("color:color")||t||L(e,n)}function LM(e){var t=e.x+e.width/2,n=e.y+e.height/2,A=e.width/2,i=[["M",t,n],["m",0,-A],["a",A,A,0,1,1,0,2*A],["a",A,A,0,1,1,0,-2*A],["z"]];return tn(i)}function Cg(e,t){var n=e.x,A=e.y,i=e.width,o=e.height,r=[["M",n+t,A],["l",i-t*2,0],["a",t,t,0,0,1,t,t],["l",0,o-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-i,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-o],["a",t,t,0,0,1,t,-t],["z"]];return tn(r)}function WM(e){var t=e.width,n=e.height,A=e.x,i=e.y,o=t/2,r=n/2,a=[["M",A+o,i],["l",o,r],["l",-o,r],["l",-o,-r],["z"]];return tn(a)}function _M(e){var t=e.x,n=e.y,A=e.width,i=e.height,o=[["M",t,n],["l",A,0],["l",0,i],["l",-A,0],["z"]];return tn(o)}function jA(e,t={}){return{width:te(e,t),height:G2(e,t)}}function te(e,t={}){return I2(t,"width")?t.width:e.width}function G2(e,t={}){return I2(t,"height")?t.height:e.height}var OM=new ue,XM=10,Fo=3,KM=1.5,vo=10,Vn=.95,ZM=1,qM=.25;function cn(e,t,n,A,i,o,r){be.call(this,t,r);var a=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,l=e&&e.defaultLabelColor;function B(M){return n.computeStyle(M,{strokeLinecap:"round",strokeLinejoin:"round",stroke:zc,strokeWidth:2,fill:"white"})}function g(M){return n.computeStyle(M,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:zc,strokeWidth:2})}function p(M,w){var{ref:Q={x:0,y:0},scale:b=1,element:Y,parentGfx:S=i._svg}=w,G=c2("marker",{id:M,viewBox:"0 0 20 20",refX:Q.x,refY:Q.y,markerWidth:20*b,markerHeight:20*b,orient:"auto"});me(G,Y);var _=p0(":scope > defs",S);_||(_=c2("defs"),me(S,_)),me(_,G)}function E(M,w,Q,b){var Y=OM.nextPrefixed("marker-");return d(M,Y,w,Q,b),"url(#"+Y+")"}function d(M,w,Q,b,Y){if(Q==="sequenceflow-end"){var S=c2("path",{d:"M 1 5 L 11 10 L 1 15 Z",...B({fill:Y,stroke:Y,strokeWidth:1})});p(w,{element:S,ref:{x:11,y:10},scale:.5,parentGfx:M})}if(Q==="messageflow-start"){var G=c2("circle",{cx:6,cy:6,r:3.5,...B({fill:b,stroke:Y,strokeWidth:1,strokeDasharray:[1e4,1]})});p(w,{element:G,ref:{x:6,y:6},parentGfx:M})}if(Q==="messageflow-end"){var _=c2("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...B({fill:b,stroke:Y,strokeWidth:1,strokeDasharray:[1e4,1]})});p(w,{element:_,ref:{x:8.5,y:5},parentGfx:M})}if(Q==="association-start"){var s0=c2("path",{d:"M 11 5 L 1 10 L 11 15",...g({fill:"none",stroke:Y,strokeWidth:1.5,strokeDasharray:[1e4,1]})});p(w,{element:s0,ref:{x:1,y:10},scale:.5,parentGfx:M})}if(Q==="association-end"){var W0=c2("path",{d:"M 1 5 L 11 10 L 1 15",...g({fill:"none",stroke:Y,strokeWidth:1.5,strokeDasharray:[1e4,1]})});p(w,{element:W0,ref:{x:11,y:10},scale:.5,parentGfx:M})}if(Q==="conditional-flow-marker"){var j0=c2("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...B({fill:b,stroke:Y})});p(w,{element:j0,ref:{x:-1,y:10},scale:.5,parentGfx:M})}if(Q==="conditional-default-flow-marker"){var I0=c2("path",{d:"M 6 4 L 10 16",...B({stroke:Y,fill:"none"})});p(w,{element:I0,ref:{x:0,y:10},scale:.5,parentGfx:M})}}function u(M,w,Q,b,Y={}){V0(b)&&(Y=b,b=0),b=b||0,Y=B(Y);var S=w/2,G=Q/2,_=c2("circle",{cx:S,cy:G,r:Math.round((w+Q)/4-b),...Y});return me(M,_),_}function h(M,w,Q,b,Y,S){V0(Y)&&(S=Y,Y=0),Y=Y||0,S=B(S);var G=c2("rect",{x:Y,y:Y,width:w-Y*2,height:Q-Y*2,rx:b,ry:b,...S});return me(M,G),G}function D(M,w,Q,b){var Y=w/2,S=Q/2,G=[{x:Y,y:0},{x:w,y:S},{x:Y,y:Q},{x:0,y:S}],_=G.map(function(W0){return W0.x+","+W0.y}).join(" ");b=B(b);var s0=c2("polygon",{...b,points:_});return me(M,s0),s0}function y(M,w,Q,b){Q=g(Q);var Y=lo(w,Q,b);return me(M,Y),Y}function C(M,w,Q){return y(M,w,Q,5)}function m(M,w,Q){Q=g(Q);var b=c2("path",{...Q,d:w});return me(M,b),b}function I(M,w,Q,b){return m(w,Q,N({"data-marker":M},b))}function x(M){return y2[M]}function v(M){return function(w,Q,b){return x(M)(w,Q,b)}}var F={"bpmn:MessageEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.235,my:.315}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill),G=b?B0(w,a,Q.fill):L(w,c,Q.stroke),_=m(M,Y,{fill:S,stroke:G,strokeWidth:1});return _},"bpmn:TimerEventDefinition":function(M,w,Q={}){var b=Q.width||w.width,Y=Q.height||w.height,S=Q.width?1:2,G=u(M,b,Y,.2*Y,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:S}),_=A.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:b,containerHeight:Y,position:{mx:.5,my:.5}});m(M,_,{stroke:L(w,c,Q.stroke),strokeWidth:S});for(var s0=0;s0<12;s0++){var W0=A.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:b,containerHeight:Y,position:{mx:.5,my:.5}}),j0=b/2,I0=Y/2;m(M,W0,{strokeWidth:1,stroke:L(w,c,Q.stroke),transform:"rotate("+s0*30+","+I0+","+j0+")"})}return G},"bpmn:EscalationEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.5,my:.2}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(M,w,Q={}){var b=A.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.5,my:.222}});return m(M,b,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:.57,my:.263}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.2,my:.722}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:.638,my:-.055}}),S=b?L(w,c,Q.stroke):"none",G=m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1});return OB(G,45),G},"bpmn:CompensateEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.22,my:.5}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.5,my:.2}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{strokeWidth:1,fill:S,stroke:L(w,c,Q.stroke)})},"bpmn:MultipleEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.211,my:.36}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(M,w,Q={}){var b=A.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.458,my:.194}});return m(M,b,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(M,w,Q={}){var b=u(M,w.width,w.height,8,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:4});return b}};function z(M,w,Q={},b){var Y=P(M),S=jM(Y),G=b||M;return Y.get("eventDefinitions")&&Y.get("eventDefinitions").length>1?Y.get("parallelMultiple")?F["bpmn:ParallelMultipleEventDefinition"](w,G,Q,S):F["bpmn:MultipleEventDefinition"](w,G,Q,S):Re(Y,"bpmn:MessageEventDefinition")?F["bpmn:MessageEventDefinition"](w,G,Q,S):Re(Y,"bpmn:TimerEventDefinition")?F["bpmn:TimerEventDefinition"](w,G,Q,S):Re(Y,"bpmn:ConditionalEventDefinition")?F["bpmn:ConditionalEventDefinition"](w,G,Q,S):Re(Y,"bpmn:SignalEventDefinition")?F["bpmn:SignalEventDefinition"](w,G,Q,S):Re(Y,"bpmn:EscalationEventDefinition")?F["bpmn:EscalationEventDefinition"](w,G,Q,S):Re(Y,"bpmn:LinkEventDefinition")?F["bpmn:LinkEventDefinition"](w,G,Q,S):Re(Y,"bpmn:ErrorEventDefinition")?F["bpmn:ErrorEventDefinition"](w,G,Q,S):Re(Y,"bpmn:CancelEventDefinition")?F["bpmn:CancelEventDefinition"](w,G,Q,S):Re(Y,"bpmn:CompensateEventDefinition")?F["bpmn:CompensateEventDefinition"](w,G,Q,S):Re(Y,"bpmn:TerminateEventDefinition")?F["bpmn:TerminateEventDefinition"](w,G,Q,S):null}var R={ParticipantMultiplicityMarker:function(M,w,Q={}){var b=te(w,Q),Y=G2(w,Q),S=A.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:b,containerHeight:Y,position:{mx:(b/2-6)/b,my:(Y-15)/Y}});I("participant-multiplicity",M,S,{strokeWidth:2,fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})},SubProcessMarker:function(M,w,Q={}){var b=h(M,14,14,0,{strokeWidth:1,fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)});Q2(b,w.width/2-7.5,w.height-20);var Y=A.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:w.width,containerHeight:w.height,position:{mx:(w.width/2-7.5)/w.width,my:(w.height-20)/w.height}});I("sub-process",M,Y,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})},ParallelMarker:function(M,w,Q){var b=te(w,Q),Y=G2(w,Q),S=A.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:b,containerHeight:Y,position:{mx:(b/2+Q.parallel)/b,my:(Y-20)/Y}});I("parallel",M,S,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})},SequentialMarker:function(M,w,Q){var b=A.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:(w.width/2+Q.seq)/w.width,my:(w.height-19)/w.height}});I("sequential",M,b,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})},CompensationMarker:function(M,w,Q){var b=A.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:(w.width/2+Q.compensation)/w.width,my:(w.height-13)/w.height}});I("compensation",M,b,{strokeWidth:1,fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})},LoopMarker:function(M,w,Q){var b=te(w,Q),Y=G2(w,Q),S=A.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:b,containerHeight:Y,position:{mx:(b/2+Q.loop)/b,my:(Y-7)/Y}});I("loop",M,S,{strokeWidth:1.5,fill:"none",stroke:L(w,c,Q.stroke),strokeMiterlimit:.5})},AdhocMarker:function(M,w,Q){var b=te(w,Q),Y=G2(w,Q),S=A.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:b,containerHeight:Y,position:{mx:(b/2+Q.adhoc)/b,my:(Y-15)/Y}});I("adhoc",M,S,{strokeWidth:1,fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke)})}};function k(M,w,Q,b){R[M](w,Q,b)}function T(M,w,Q=[],b={}){b={fill:b.fill,stroke:b.stroke,width:te(w,b),height:G2(w,b)};var Y=P(w),S=Q.includes("SubProcessMarker");S?b={...b,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:b={...b,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},Y.get("isForCompensation")&&Q.push("CompensationMarker"),f(Y,"bpmn:AdHocSubProcess")&&(Q.push("AdhocMarker"),S||N(b,{compensation:b.compensation-18}));var G=Y.get("loopCharacteristics"),_=G&&G.get("isSequential");G&&(N(b,{compensation:b.compensation-18}),Q.includes("AdhocMarker")&&N(b,{seq:-23,loop:-18,parallel:-24}),_===void 0&&Q.push("LoopMarker"),_===!1&&Q.push("ParallelMarker"),_===!0&&Q.push("SequentialMarker")),Q.includes("CompensationMarker")&&Q.length===1&&N(b,{compensation:-8}),U(Q,function(s0){k(s0,M,w,b)})}function H(M,w,Q={}){Q=N({size:{width:100}},Q);var b=o.createText(w||"",Q);return Um(b).add("djs-label"),me(M,b),b}function K(M,w,Q,b={}){var Y=P(w),S=jA({x:w.x,y:w.y,width:w.width,height:w.height},b);return H(M,Y.name,{align:Q,box:S,padding:7,style:{fill:JA(w,l,c,b.stroke)}})}function x0(M,w,Q={}){var b={width:90,height:30,x:w.width/2+w.x,y:w.height/2+w.y};return H(M,fe(w),{box:b,fitBox:!0,style:N({},o.getExternalStyle(),{fill:JA(w,l,c,Q.stroke)})})}function d0(M,w,Q,b={}){var Y=l2(Q),S=H(M,w,{box:{height:30,width:Y?G2(Q,b):te(Q,b)},align:"center-middle",style:{fill:JA(Q,l,c,b.stroke)}});if(Y){var G=-1*G2(Q,b);mo(S,0,-G,270)}}function t0(M,w,Q={}){var{width:b,height:Y}=jA(w,Q);return h(M,b,Y,vo,{...Q,fill:B0(w,a,Q.fill),fillOpacity:Vn,stroke:L(w,c,Q.stroke)})}function G0(M,w,Q={}){var b=P(w),Y=B0(w,a,Q.fill),S=L(w,c,Q.stroke);return(b.get("associationDirection")==="One"||b.get("associationDirection")==="Both")&&(Q.markerEnd=E(M,"association-end",Y,S)),b.get("associationDirection")==="Both"&&(Q.markerStart=E(M,"association-start",Y,S)),Q=C0(Q,["markerStart","markerEnd"]),C(M,w.waypoints,{...Q,stroke:S,strokeDasharray:"0, 5"})}function u2(M,w,Q={}){var b=B0(w,a,Q.fill),Y=L(w,c,Q.stroke),S=A.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:.474,my:.296}}),G=m(M,S,{fill:b,fillOpacity:Vn,stroke:Y}),_=P(w);if(VM(_)){var s0=A.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:.33,my:(w.height-18)/w.height}});m(M,s0,{strokeWidth:2,fill:b,stroke:Y})}return G}function R0(M,w,Q={}){return u(M,w.width,w.height,{fillOpacity:Vn,...Q,fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})}function r2(M,w,Q={}){return D(M,w.width,w.height,{fill:B0(w,a,Q.fill),fillOpacity:Vn,stroke:L(w,c,Q.stroke)})}function J(M,w,Q={}){var b=h(M,te(w,Q),G2(w,Q),0,{fill:B0(w,a,Q.fill),fillOpacity:Q.fillOpacity||Vn,stroke:L(w,c,Q.stroke),strokeWidth:1.5}),Y=P(w);if(f(Y,"bpmn:Lane")){var S=Y.get("name");d0(M,S,w,Q)}return b}function V(M,w,Q={}){var b=t0(M,w,Q),Y=E0(w);if(h2(w)&&(N2(b,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!Y)){var S=P(w).flowElements||[],G=S.filter(_=>f(_,"bpmn:StartEvent"));G.length===1&&Z(G[0],M,Q,w)}return K(M,w,Y?"center-top":"center-middle",Q),Y?T(M,w,void 0,Q):T(M,w,["SubProcessMarker"],Q),b}function Z(M,w,Q,b){var Y=22,S={fill:B0(b,a,Q.fill),stroke:L(b,c,Q.stroke),width:Y,height:Y},G=P(M).isInterrupting,_=G?0:3,s0=G?1:1.2,W0=20,j0=(Y-W0)/2,I0="translate("+j0+","+j0+")";u(w,W0,W0,{fill:S.fill,stroke:S.stroke,strokeWidth:s0,strokeDasharray:_,transform:I0}),z(M,w,S,b)}function u0(M,w,Q={}){var b=t0(M,w,Q);return K(M,w,"center-middle",Q),T(M,w,void 0,Q),b}var y2=this.handlers={"bpmn:AdHocSubProcess":function(M,w,Q={}){return E0(w)?Q=C0(Q,["fill","stroke","width","height"]):Q=C0(Q,["fill","stroke"]),V(M,w,Q)},"bpmn:Association":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),G0(M,w,Q)},"bpmn:BoundaryEvent":function(M,w,Q={}){var{renderIcon:b=!0}=Q;Q=C0(Q,["fill","stroke"]);var Y=P(w),S=Y.get("cancelActivity");Q={strokeWidth:1.5,fill:B0(w,a,Q.fill),fillOpacity:ZM,stroke:L(w,c,Q.stroke)},S||(Q.strokeDasharray="6");var G=R0(M,w,Q);return u(M,w.width,w.height,Fo,{...Q,fill:"none"}),b&&z(w,M,Q),G},"bpmn:BusinessRuleTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q),Y=A.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),S=m(M,Y);N2(S,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1});var G=A.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),_=m(M,G);return N2(_,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:CallActivity":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),V(M,w,{strokeWidth:5,...Q})},"bpmn:ComplexGateway":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=r2(M,w,Q),Y=A.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:w.width,containerHeight:w.height,position:{mx:.46,my:.26}});return m(M,Y,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:DataInput":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=A.getRawPath("DATA_ARROW"),Y=u2(M,w,Q);return m(M,b,{fill:"none",stroke:L(w,c,Q.stroke),strokeWidth:1}),Y},"bpmn:DataInputAssociation":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),G0(M,w,{...Q,markerEnd:E(M,"association-end",B0(w,a,Q.fill),L(w,c,Q.stroke))})},"bpmn:DataObject":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),u2(M,w,Q)},"bpmn:DataObjectReference":v("bpmn:DataObject"),"bpmn:DataOutput":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=A.getRawPath("DATA_ARROW"),Y=u2(M,w,Q);return m(M,b,{strokeWidth:1,fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)}),Y},"bpmn:DataOutputAssociation":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),G0(M,w,{...Q,markerEnd:E(M,"association-end",B0(w,a,Q.fill),L(w,c,Q.stroke))})},"bpmn:DataStoreReference":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=A.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:0,my:.133}});return m(M,b,{fill:B0(w,a,Q.fill),fillOpacity:Vn,stroke:L(w,c,Q.stroke),strokeWidth:2})},"bpmn:EndEvent":function(M,w,Q={}){var{renderIcon:b=!0}=Q;Q=C0(Q,["fill","stroke"]);var Y=R0(M,w,{...Q,strokeWidth:4});return b&&z(w,M,Q),Y},"bpmn:EventBasedGateway":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=P(w),Y=r2(M,w,Q);u(M,w.width,w.height,w.height*.2,{fill:B0(w,"none",Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1});var S=b.get("eventGatewayType"),G=!!b.get("instantiate");function _(){var W0=A.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:w.width,containerHeight:w.height,position:{mx:.36,my:.44}});m(M,W0,{fill:"none",stroke:L(w,c,Q.stroke),strokeWidth:2})}if(S==="Parallel"){var s0=A.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:w.width,containerHeight:w.height,position:{mx:.474,my:.296}});m(M,s0,{fill:"none",stroke:L(w,c,Q.stroke),strokeWidth:1})}else S==="Exclusive"&&(G||u(M,w.width,w.height,w.height*.26,{fill:"none",stroke:L(w,c,Q.stroke),strokeWidth:1}),_());return Y},"bpmn:ExclusiveGateway":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=r2(M,w,Q),Y=A.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:w.width,containerHeight:w.height,position:{mx:.32,my:.3}}),S=h0(w);return S.get("isMarkerVisible")&&m(M,Y,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:Gateway":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),r2(M,w,Q)},"bpmn:Group":function(M,w,Q={}){return Q=C0(Q,["fill","stroke","width","height"]),h(M,w.width,w.height,vo,{stroke:L(w,c,Q.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:te(w,Q),height:G2(w,Q)})},"bpmn:InclusiveGateway":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=r2(M,w,Q);return u(M,w.width,w.height,w.height*.24,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:2.5}),b},"bpmn:IntermediateEvent":function(M,w,Q={}){var{renderIcon:b=!0}=Q;Q=C0(Q,["fill","stroke"]);var Y=R0(M,w,{...Q,strokeWidth:1.5});return u(M,w.width,w.height,Fo,{fill:"none",stroke:L(w,c,Q.stroke),strokeWidth:1.5}),b&&z(w,M,Q),Y},"bpmn:IntermediateCatchEvent":v("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":v("bpmn:IntermediateEvent"),"bpmn:Lane":function(M,w,Q={}){return Q=C0(Q,["fill","stroke","width","height"]),J(M,w,{...Q,fillOpacity:qM})},"bpmn:ManualTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q),Y=A.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return m(M,Y,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:.5}),b},"bpmn:MessageFlow":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=P(w),Y=h0(w),S=B0(w,a,Q.fill),G=L(w,c,Q.stroke),_=C(M,w.waypoints,{markerEnd:E(M,"messageflow-end",S,G),markerStart:E(M,"messageflow-start",S,G),stroke:G,strokeDasharray:"10, 11",strokeWidth:1.5});if(b.get("messageRef")){var s0=_.getPointAtLength(_.getTotalLength()/2),W0=A.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:s0.x,y:s0.y}}),j0={strokeWidth:1};Y.get("messageVisibleKind")==="initiating"?(j0.fill=S,j0.stroke=G):(j0.fill=G,j0.stroke=S);var I0=m(M,W0,j0),de=b.get("messageRef"),N0=de.get("name"),dt=H(M,N0,{align:"center-top",fitBox:!0,style:{fill:G}}),Xa=I0.getBBox(),K2=dt.getBBox(),c0=s0.x-K2.width/2,b0=s0.y+Xa.height/2+XM;mo(dt,c0,b0,0)}return _},"bpmn:ParallelGateway":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=r2(M,w,Q),Y=A.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:w.width,containerHeight:w.height,position:{mx:.46,my:.2}});return m(M,Y,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:Participant":function(M,w,Q={}){Q=C0(Q,["fill","stroke","width","height"]);var b=J(M,w,Q),Y=E0(w),S=l2(w),G=P(w),_=G.get("name");if(Y){var s0=S?[{x:30,y:0},{x:30,y:G2(w,Q)}]:[{x:0,y:30},{x:te(w,Q),y:30}];y(M,s0,{stroke:L(w,c,Q.stroke),strokeWidth:KM}),d0(M,_,w,Q)}else{var W0=jA(w,Q);S||(W0.height=te(w,Q),W0.width=G2(w,Q));var j0=H(M,_,{box:W0,align:"center-middle",style:{fill:JA(w,l,c,Q.stroke)}});if(!S){var I0=-1*G2(w,Q);mo(j0,0,-I0,270)}}return G.get("participantMultiplicity")&&k("ParticipantMultiplicityMarker",M,w,Q),b},"bpmn:ReceiveTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=P(w),Y=u0(M,w,Q),S;return b.get("instantiate")?(u(M,28,28,20*.22,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1}),S=A.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):S=A.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),m(M,S,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1}),Y},"bpmn:ScriptTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q),Y=A.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return m(M,Y,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:SendTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q),Y=A.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return m(M,Y,{fill:L(w,c,Q.stroke),stroke:B0(w,a,Q.fill),strokeWidth:1}),b},"bpmn:SequenceFlow":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=B0(w,a,Q.fill),Y=L(w,c,Q.stroke),S=C(M,w.waypoints,{markerEnd:E(M,"sequenceflow-end",b,Y),stroke:Y}),G=P(w),{source:_}=w;if(_){var s0=P(_);G.get("conditionExpression")&&f(s0,"bpmn:Activity")&&N2(S,{markerStart:E(M,"conditional-flow-marker",b,Y)}),s0.get("default")&&(f(s0,"bpmn:Gateway")||f(s0,"bpmn:Activity"))&&s0.get("default")===G&&N2(S,{markerStart:E(M,"conditional-default-flow-marker",b,Y)})}return S},"bpmn:ServiceTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q);u(M,10,10,{fill:B0(w,a,Q.fill),stroke:"none",transform:"translate(6, 6)"});var Y=A.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});m(M,Y,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1}),u(M,10,10,{fill:B0(w,a,Q.fill),stroke:"none",transform:"translate(11, 10)"});var S=A.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return m(M,S,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:StartEvent":function(M,w,Q={}){var{renderIcon:b=!0}=Q;Q=C0(Q,["fill","stroke"]);var Y=P(w);Y.get("isInterrupting")||(Q={...Q,strokeDasharray:"6"});var S=R0(M,w,Q);return b&&z(w,M,Q),S},"bpmn:SubProcess":function(M,w,Q={}){return E0(w)?Q=C0(Q,["fill","stroke","width","height"]):Q=C0(Q,["fill","stroke"]),V(M,w,Q)},"bpmn:Task":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),u0(M,w,Q)},"bpmn:TextAnnotation":function(M,w,Q={}){Q=C0(Q,["fill","stroke","width","height"]);var{width:b,height:Y}=jA(w,Q),S=h(M,b,Y,0,0,{fill:"none",stroke:"none"}),G=A.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:b,containerHeight:Y,position:{mx:0,my:0}});m(M,G,{stroke:L(w,c,Q.stroke)});var _=P(w),s0=_.get("text")||"";return H(M,s0,{align:"left-top",box:jA(w,Q),padding:7,style:{fill:JA(w,l,c,Q.stroke)}}),S},"bpmn:Transaction":function(M,w,Q={}){E0(w)?Q=C0(Q,["fill","stroke","width","height"]):Q=C0(Q,["fill","stroke"]);var b=V(M,w,{strokeWidth:1.5,...Q}),Y=n.style(["no-fill","no-events"],{stroke:L(w,c,Q.stroke),strokeWidth:1.5}),S=E0(w);return S||(Q={}),h(M,te(w,Q),G2(w,Q),vo-Fo,Fo,Y),b},"bpmn:UserTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q),Y=15,S=12,G=A.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:Y,y:S}});m(M,G,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:.5});var _=A.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:Y,y:S}});m(M,_,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:.5});var s0=A.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:Y,y:S}});return m(M,s0,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:.5}),b},label:function(M,w,Q={}){return x0(M,w,Q)}};this._drawPath=m,this._renderer=x}W(cn,be),cn.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],cn.prototype.canRender=function(e){return f(e,"bpmn:BaseElement")},cn.prototype.drawShape=function(e,t,n={}){var{type:A}=t,i=this._renderer(A);return i(e,t,n)},cn.prototype.drawConnection=function(e,t,n={}){var{type:A}=t,i=this._renderer(A);return i(e,t,n)},cn.prototype.getShapePath=function(e){return f(e,"bpmn:Event")?LM(e):f(e,"bpmn:Activity")?Cg(e,vo):f(e,"bpmn:Gateway")?WM(e):_M(e)};function C0(e,t=[]){return t.reduce((n,A)=>(e[A]&&(n[A]=e[A]),n),{})}var $M=0,e5={width:150,height:50};function t5(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function n5(e){return V0(e)?N({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function A5(e,t){t.textContent=e;var n;try{var A,i=e==="";return t.textContent=i?"dummy":e,n=t.getBBox(),A={width:n.width+n.x*2,height:n.height},i&&(A.width=0),A}catch(o){return console.log(o),{width:0,height:0}}}function i5(e,t,n){for(var A=e.shift(),i=A,o;;){if(o=A5(i,n),o.width=i?o.width:0,i===" "||i===""||o.width<Math.round(t)||i.length<2)return o5(e,i,A,o);i=a5(i,o.width,t)}}function o5(e,t,n,A){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:A.width,height:A.height,text:t}}var Mg="­";function r5(e,t){var n=e.split(/(\s|-|\u00AD)/g),A,i=[],o=0;if(n.length>1)for(;A=n.shift();)if(A.length+o<t)i.push(A),o+=A.length;else{(A==="-"||A===Mg)&&i.pop();break}var r=i[i.length-1];return r&&r===Mg&&(i[i.length-1]="-"),i.join("")}function a5(e,t,n){var A=Math.max(e.length*(n/t),1),i=r5(e,A);return i||(i=e.slice(0,Math.max(Math.round(A-1),1))),i}function c5(){var e=document.getElementById("helper-svg");return e||(e=g0("svg"),q(e,{id:"helper-svg"}),m2(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}function xo(e){this._config=N({},{size:e5,padding:$M,style:{},align:"center-top"},e||{})}xo.prototype.createText=function(e,t){return this.layoutText(e,t).element},xo.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},xo.prototype.layoutText=function(e,t){var n=N({},this._config.size,t.box),A=N({},this._config.style,t.style),i=t5(t.align||this._config.align),o=n5(t.padding!==void 0?t.padding:this._config.padding),r=t.fitBox||!1,a=s5(A),c=e.split(/\u00AD?\r?\n/),l=[],B=n.width-o.left-o.right,g=g0("text");q(g,{x:0,y:0}),q(g,A);var p=c5();for(Q0(p,g);c.length;)l.push(i5(c,B,g));i.vertical==="middle"&&(o.top=o.bottom=0);var E=F2(l,function(y,C,m){return y+(a||C.height)},0)+o.top+o.bottom,d=F2(l,function(y,C,m){return C.width>y?C.width:y},0),u=o.top;i.vertical==="middle"&&(u+=(n.height-E)/2),u-=(a||l[0].height)/4;var h=g0("text");q(h,A),U(l,function(y){var C;switch(u+=a||y.height,i.horizontal){case"left":C=o.left;break;case"right":C=(r?d:B)-o.right-y.width;break;default:C=Math.max(((r?d:B)-y.width)/2+o.left,0)}var m=g0("tspan");q(m,{x:C,y:u}),m.textContent=y.text,Q0(h,m)}),s2(g);var D={width:d,height:E};return{dimensions:D,element:h}};function s5(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var l5=12,B5=1.2,g5=30;function Dg(e){var t=N({fontFamily:"Arial, sans-serif",fontSize:l5,fontWeight:"normal",lineHeight:B5},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,A=N({},t,{fontSize:n},e&&e.externalStyle||{}),i=new xo({style:t});this.getExternalLabelBounds=function(o,r){var a=i.getDimensions(r,{box:{width:90,height:30},style:A});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,r){var a=i.getDimensions(r,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(g5,Math.round(a.height))}},this.createText=function(o,r){return i.createText(o,r||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return A}}Dg.$inject=["config.textRenderer"];function p5(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var A=this.pathMap[t],i,o;n.abspos?(i=n.abspos.x,o=n.abspos.y):(i=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var r={};if(n.position){for(var a=n.containerHeight/A.height*n.yScaleFactor,c=n.containerWidth/A.width*n.xScaleFactor,l=0;l<A.heightElements.length;l++)r["y"+l]=A.heightElements[l]*a;for(var B=0;B<A.widthElements.length;B++)r["x"+B]=A.widthElements[B]*c}var g=Q5(A.d,{mx:i,my:o,e:r});return g}}var E5=/\{([^{}]+)\}/g,d5=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function u5(e,t,n){var A=n;return t.replace(d5,function(i,o,r,a,c){o=o||a,A&&(o in A&&(A=A[o]),typeof A=="function"&&c&&(A=A()))}),A=(A==null||A==n?e:A)+"",A}function Q5(e,t){return String(e).replace(E5,function(n,A){return u5(n,A,t)})}const h5={__init__:["bpmnRenderer"],bpmnRenderer:["type",cn],textRenderer:["type",Dg],pathMap:["type",p5]};function w5(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,A){return t[A]||"{"+A+"}"})}const bo={translate:["value",w5]};function Yo(e,t,n){return N({id:e.id,type:e.$type,businessObject:e,di:t},n)}function m5(e,t,n){var A=e.waypoint;return!A||A.length<2?[i0(t),i0(n)]:A.map(function(i){return{x:i.x,y:i.y}})}function yg(e,t,n){return new Error(`element ${M2(t)} referenced by ${M2(e)}#${n} not yet drawn`)}function Ke(e,t,n,A,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=A,this._textRenderer=i}Ke.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],Ke.prototype.add=function(e,t,n){var A,i,o;if(f(t,"bpmndi:BPMNPlane")){var r=f(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};A=this._elementFactory.createRoot(Yo(e,t,r)),this._canvas.addRootElement(A)}else if(f(t,"bpmndi:BPMNShape")){var a=!E0(e,t),c=C5(e);i=n&&(n.hidden||n.collapsed);var l=t.bounds;A=this._elementFactory.createShape(Yo(e,t,{collapsed:a,hidden:i,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:c})),f(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,A),f(e,"bpmn:Lane")&&(o=0),f(e,"bpmn:DataStoreReference")&&(f5(n,i0(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(A,n,o)}else if(f(t,"bpmndi:BPMNEdge")){var B=this._getSource(e),g=this._getTarget(e);i=n&&(n.hidden||n.collapsed),A=this._elementFactory.createConnection(Yo(e,t,{hidden:i,source:B,target:g,waypoints:m5(t,B,g)})),f(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(A,n,o)}else throw new Error(`unknown di ${M2(t)} for element ${M2(e)}`);return an(e)&&fe(A)&&this.addLabel(e,t,A),this._eventBus.fire("bpmnElement.added",{element:A}),A},Ke.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${M2(e)}#attachedToRef`);var A=this._elementRegistry.get(n.id),i=A&&A.attachers;if(!A)throw yg(e,n,"attachedToRef");t.host=A,i||(A.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)},Ke.prototype.addLabel=function(e,t,n){var A,i,o;return A=GM(t,n),i=fe(n),i&&(A=this._textRenderer.getExternalLabelBounds(A,i)),o=this._elementFactory.createLabel(Yo(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!fe(n),x:Math.round(A.x),y:Math.round(A.y),width:Math.round(A.width),height:Math.round(A.height)})),this._canvas.addShape(o,n.parent)},Ke.prototype._getConnectedElement=function(e,t){var n,A,i=e.$type;if(A=e[t+"Ref"],t==="source"&&i==="bpmn:DataInputAssociation"&&(A=A&&A[0]),(t==="source"&&i==="bpmn:DataOutputAssociation"||t==="target"&&i==="bpmn:DataInputAssociation")&&(A=e.$parent),n=A&&this._getElement(A),n)return n;throw A?yg(e,A,t+"Ref"):new Error(`${M2(e)}#${t} Ref not specified`)},Ke.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Ke.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Ke.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function f5(e,t){var n=t.x,A=t.y;return n>=e.x&&n<=e.x+e.width&&A>=e.y&&A<=e.y+e.height}function C5(e){return f(e,"bpmn:Group")}const M5={__depends__:[h5,{__depends__:[bo],bpmnImporter:["type",Ke]}]};function VA(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}VA.prototype.next=function(){return this._prefix+ ++this._counter};var D5=new VA("ov"),y5=500;function p2(e,t,n,A){this._eventBus=t,this._canvas=n,this._elementRegistry=A,this._ids=D5,this._overlayDefaults=N({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=I5(n.getContainer()),this._init()}p2.$inject=["config.overlays","eventBus","canvas","elementRegistry"],p2.prototype.get=function(e){if(U2(e)&&(e={id:e}),U2(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?l0(t.overlays,Z2({type:e.type})):t.overlays.slice():[]}else return e.type?l0(this._overlays,Z2({type:e.type})):e.id?this._overlays[e.id]:null},p2.prototype.add=function(e,t,n){if(V0(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var A=this._ids.next();return n=N({},this._overlayDefaults,n,{id:A,type:t,element:e,html:n.html}),this._addOverlay(n),A},p2.prototype.remove=function(e){var t=this.get(e)||[];n0(t)||(t=[t]);var n=this;U(t,function(A){var i=n._getOverlayContainer(A.element,!0);if(A&&(xe(A.html),xe(A.htmlContainer),delete A.htmlContainer,delete A.element,delete n._overlays[A.id]),i){var o=i.overlays.indexOf(A);o!==-1&&i.overlays.splice(o,1)}})},p2.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},p2.prototype.show=function(){Uo(this._overlayRoot)},p2.prototype.hide=function(){Uo(this._overlayRoot,!1)},p2.prototype.clear=function(){this._overlays={},this._overlayContainers=[],vA(this._overlayRoot)},p2.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,A=t.x,i=t.y;if(t.waypoints){var o=i2(t);A=o.x,i=o.y}Ig(n,A,i),g2(e.html,"data-container-id",t.id)},p2.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,A=e.element,i=t.left,o=t.top;if(t.right!==void 0){var r;A.waypoints?r=i2(A).width:r=A.width,i=t.right*-1+r}if(t.bottom!==void 0){var a;A.waypoints?a=i2(A).height:a=A.height,o=t.bottom*-1+a}Ig(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},p2.prototype._createOverlayContainer=function(e){var t=$('<div class="djs-overlays" />');m2(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},p2.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Fg(this._overlayRoot,n)},p2.prototype._getOverlayContainer=function(e,t){var n=m0(this._overlayContainers,function(A){return A.element===e});return!n&&!t?this._createOverlayContainer(e):n},p2.prototype._addOverlay=function(e){var t=e.id,n=e.element,A=e.html,i,o;A.get&&A.constructor.prototype.jquery&&(A=A.get(0)),U2(A)&&(A=$(A)),o=this._getOverlayContainer(n),i=$('<div class="djs-overlay" data-overlay-id="'+t+'">'),m2(i,{position:"absolute"}),i.appendChild(A),e.type&&X(i).add("djs-overlay-"+e.type);var r=this._canvas.findRoot(n),a=this._canvas.getRootElement();Uo(i,r===a),e.htmlContainer=i,o.overlays.push(e),o.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},p2.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,A=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,r=e.htmlContainer,a=this._canvas.getRootElement(),c=!0;(A!==a||n&&(a2(i)&&i>t.scale||a2(o)&&o<t.scale))&&(c=!1),Uo(r,c),this._updateOverlayScale(e,t)},p2.prototype._updateOverlayScale=function(e,t){var n=e.scale,A,i,o=e.htmlContainer,r,a="";n!==!0&&(n===!1?(A=1,i=1):(A=n.min,i=n.max),a2(A)&&t.scale<A&&(r=(1/t.scale||1)*A),a2(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),a2(r)&&(a="scale("+r+","+r+")"),Fg(o,a)},p2.prototype._updateOverlaysVisibilty=function(e){var t=this;U(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},p2.prototype._init=function(){var e=this._eventBus,t=this;function n(A){t._updateRoot(A),t._updateOverlaysVisibilty(A),t.show()}e.on("canvas.viewbox.changing",function(A){t.hide()}),e.on("canvas.viewbox.changed",function(A){n(A.viewbox)}),e.on(["shape.remove","connection.remove"],function(A){var i=A.element,o=t.get({element:i});U(o,function(c){t.remove(c.id)});var r=t._getOverlayContainer(i);if(r){xe(r.html);var a=t._overlayContainers.indexOf(r);a!==-1&&t._overlayContainers.splice(a,1)}}),e.on("element.changed",y5,function(A){var i=A.element,o=t._getOverlayContainer(i,!0);o&&(U(o.overlays,function(r){t._updateOverlay(r)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(A){var i=t._getOverlayContainer(A.element,!0);i&&X(i.html)[A.add?"add":"remove"](A.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function I5(e){var t=$('<div class="djs-overlay-container" />');return m2(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Ig(e,t,n){m2(e,{left:t+"px",top:n+"px"})}function Uo(e,t){e.style.display=t===!1?"none":""}function Fg(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}const No={__init__:["overlays"],overlays:["type",p2]};function vg(e,t,n,A){e.on("element.changed",function(i){var o=i.element;(o.parent||o===t.getRootElement())&&(i.gfx=n.getGraphics(o)),i.gfx&&e.fire(wB(o)+".changed",i)}),e.on("elements.changed",function(i){var o=i.elements;o.forEach(function(r){e.fire("element.changed",{element:r})}),A.updateContainments(o)}),e.on("shape.changed",function(i){A.update("shape",i.element,i.gfx)}),e.on("connection.changed",function(i){A.update("connection",i.element,i.gfx)})}vg.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const Rc={__init__:["changeSupport"],changeSupport:["type",vg]};var F5=1e3;function j(e){this._eventBus=e}j.$inject=["eventBus"];function v5(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}j.prototype.on=function(e,t,n,A,i,o){if((n2(t)||A0(t))&&(o=i,i=A,A=n,n=t,t=null),n2(n)&&(o=i,i=A,A=n,n=F5),V0(i)&&(o=i,i=!1),!n2(A))throw new Error("handlerFn must be a function");n0(e)||(e=[e]);var r=this._eventBus;U(e,function(a){var c=["commandStack",a,t].filter(function(l){return l}).join(".");r.on(c,n,i?v5(A,o):A,o)})},j.prototype.canExecute=Ze("canExecute"),j.prototype.preExecute=Ze("preExecute"),j.prototype.preExecuted=Ze("preExecuted"),j.prototype.execute=Ze("execute"),j.prototype.executed=Ze("executed"),j.prototype.postExecute=Ze("postExecute"),j.prototype.postExecuted=Ze("postExecuted"),j.prototype.revert=Ze("revert"),j.prototype.reverted=Ze("reverted");function Ze(e){return function(n,A,i,o,r){(n2(n)||A0(n))&&(r=o,o=i,i=A,A=n,n=null),this.on(n,e,A,i,o,r)}}function Sc(e,t){t.invoke(j,this),this.executed(function(n){var A=n.context;A.rootElement?e.setRootElement(A.rootElement):A.rootElement=e.getRootElement()}),this.revert(function(n){var A=n.context;A.rootElement&&e.setRootElement(A.rootElement)})}W(Sc,j),Sc.$inject=["canvas","injector"];const x5={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Sc]};function LA(e){return CSS.escape(e)}var b5={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function qe(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return b5[t]})}var xg="_plane";function bg(e){var t=e.id;return Y5(t)}function $e(e){var t=e.id;return f(e,"bpmn:SubProcess")?Yg(t):t}function sn(e){return Yg(e)}function zo(e){var t=h0(e);return f(t,"bpmndi:BPMNPlane")}function Yg(e){return e+xg}function Y5(e){return e.replace(new RegExp(xg+"$"),"")}var U5="bjs-breadcrumbs-shown";function Ug(e,t,n){var A=$('<ul class="bjs-breadcrumbs"></ul>'),i=n.getContainer(),o=X(i);i.appendChild(A);var r=[];e.on("element.changed",function(c){var l=c.element,B=P(l),g=m0(r,function(p){return p===B});g&&a()});function a(c){c&&(r=N5(c));var l=r.flatMap(function(g){var p=n.findRoot($e(g))||n.findRoot(g.id);if(!p&&f(g,"bpmn:Process")){var E=t.find(function(h){var D=P(h);return D&&D.get("processRef")===g});p=E&&n.findRoot(E.id)}if(!p)return[];var d=qe(g.name||g.id),u=$('<li><span class="bjs-crumb"><a title="'+d+'">'+d+"</a></span></li>");return u.addEventListener("click",function(){n.setRootElement(p)}),u});A.innerHTML="";var B=l.length>1;o.toggle(U5,B),l.forEach(function(g){A.appendChild(g)})}e.on("root.set",function(c){a(c.element)})}Ug.$inject=["eventBus","elementRegistry","canvas"];function N5(e){for(var t=P(e),n=[],A=t;A;A=A.$parent)(f(A,"bpmn:SubProcess")||f(A,"bpmn:Process"))&&n.push(A);return n.reverse()}function Ng(e,t){var n=null,A=new z5;e.on("root.set",function(i){var o=i.element,r=t.viewbox(),a=A.get(o);if(A.set(n,{x:r.x,y:r.y,zoom:r.scale}),n=o,!(!f(o,"bpmn:SubProcess")&&!a)){a=a||{x:0,y:0,zoom:1};var c=(r.x-a.x)*r.scale,l=(r.y-a.y)*r.scale;(c!==0||l!==0)&&t.scroll({dx:c,dy:l}),a.zoom!==r.scale&&t.zoom(a.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){A.clear(),n=null})}Ng.$inject=["eventBus","canvas"];function z5(){this._entries=[],this.set=function(e,t){var n=!1;for(var A in this._entries)if(this._entries[A][0]===e){this._entries[A][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var zg={x:180,y:160};function ln(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(A,i){n._handleImport(i.definitions)})}ln.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(A){!A.plane||!A.plane.bpmnElement||(t._processToDiagramMap[A.plane.bpmnElement.id]=A)});var n=e.diagrams.filter(A=>A.plane).flatMap(A=>t._createNewDiagrams(A.plane));n.forEach(function(A){t._movePlaneElementsToOrigin(A.plane)})}},ln.prototype._createNewDiagrams=function(e){var t=this,n=[],A=[];e.get("planeElement").forEach(function(o){var r=o.bpmnElement;if(r){var a=r.$parent;f(r,"bpmn:SubProcess")&&!o.isExpanded&&n.push(r),S5(r,e)&&A.push({diElement:o,parent:a})}});var i=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var r=t._createDiagram(o);t._processToDiagramMap[o.id]=r,i.push(r)}}),A.forEach(function(o){for(var r=o.diElement,a=o.parent;a&&n.indexOf(a)===-1;)a=a.$parent;if(a){var c=t._processToDiagramMap[a.id];t._moveToDiPlane(r,c.plane)}}),i},ln.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=R5(e),A={x:n.x-zg.x,y:n.y-zg.y};t.forEach(function(i){i.waypoint?i.waypoint.forEach(function(o){o.x=o.x-A.x,o.y=o.y-A.y}):i.bounds&&(i.bounds.x=i.bounds.x-A.x,i.bounds.y=i.bounds.y-A.y)})},ln.prototype._moveToDiPlane=function(e,t){var n=Rg(e),A=n.plane.get("planeElement");A.splice(A.indexOf(e),1),t.get("planeElement").push(e)},ln.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},ln.$inject=["eventBus","moddle"];function Rg(e){return f(e,"bpmndi:BPMNDiagram")?e:Rg(e.$parent)}function R5(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var A=e0(n.bounds);t.top=Math.min(A.top,t.top),t.left=Math.min(A.left,t.left)}}),Qo(t)}function S5(e,t){var n=e.$parent;return!(!f(n,"bpmn:SubProcess")||n===t.bpmnElement||a0(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Ro=250,T5='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>',k5="bjs-drilldown-empty";function Ft(e,t,n,A,i){j.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=A,this._translate=i;var o=this;this.executed("shape.toggleCollapse",Ro,function(r){var a=r.shape;o._canDrillDown(a)?o._addOverlay(a):o._removeOverlay(a)},!0),this.reverted("shape.toggleCollapse",Ro,function(r){var a=r.shape;o._canDrillDown(a)?o._addOverlay(a):o._removeOverlay(a)},!0),this.executed(["shape.create","shape.move","shape.delete"],Ro,function(r){var a=r.oldParent,c=r.newParent||r.parent,l=r.shape;o._canDrillDown(l)&&o._addOverlay(l),o._updateDrilldownOverlay(a),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(l)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Ro,function(r){var a=r.oldParent,c=r.newParent||r.parent,l=r.shape;o._canDrillDown(l)&&o._addOverlay(l),o._updateDrilldownOverlay(a),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(l)},!0),t.on("import.render.complete",function(){n.filter(function(r){return o._canDrillDown(r)}).map(function(r){o._addOverlay(r)})})}W(Ft,j),Ft.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Ft.prototype._canDrillDown=function(e){var t=this._canvas;return f(e,"bpmn:SubProcess")&&t.findRoot($e(e))},Ft.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=P(e),A=t.get({element:n.id,type:"drilldown"})[0];if(A){var i=n&&n.get("flowElements")&&n.get("flowElements").length;X(A.html).toggle(k5,!i)}},Ft.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,A=P(e),i=n.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var o=$('<button type="button" class="bjs-drilldown">'+T5+"</button>"),r=A.get("name")||A.get("id"),a=this._translate("Open {element}",{element:r});o.setAttribute("title",a),o.addEventListener("click",function(){t.setRootElement(t.findRoot($e(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)},Ft.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})},Ft.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];const G5={__depends__:[No,Rc,x5],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Ug],drilldownCentering:["type",Ng],drilldownOverlayBehavior:["type",Ft],subprocessCompatibility:["type",ln]};function Sg(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function Ln(e){return e.originalEvent||e.srcEvent}function Tc(e){Sg(e),Sg(Ln(e))}function Bn(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Tg(){return/mac/i.test(navigator.platform)}function kg(e,t){return(Ln(e)||e).button===t}function vt(e){return kg(e,0)}function H5(e){return kg(e,1)}function Wn(e){var t=Ln(e)||e;return vt(e)?Tg()?t.metaKey:t.ctrlKey:!1}function So(e){var t=Ln(e)||e;return vt(e)&&t.shiftKey}function P5(e){return!0}function To(e){return vt(e)||H5(e)}var Gg=500;function Hg(e,t,n){var A=this;function i(F,z,R){if(!a(F,z)){var k,T,H;R?T=t.getGraphics(R):(k=z.delegateTarget||z.target,k&&(T=k,R=t.get(T))),!(!T||!R)&&(H=e.fire(F,{element:R,gfx:T,originalEvent:z}),H===!1&&(z.stopPropagation(),z.preventDefault()))}}var o={};function r(F){return o[F]}function a(F,z){var R=l[F]||vt;return!R(z)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":P5,"element.mousedown":To,"element.mouseup":To,"element.click":To,"element.dblclick":To};function B(F,z,R){var k=c[F];if(!k)throw new Error("unmapped DOM event name <"+F+">");return i(k,z,R)}var g="svg, .djs-element";function p(F,z,R,k){var T=o[R]=function(H){i(R,H)};k&&(l[R]=k),T.$delegate=x2.bind(F,g,z,T)}function E(F,z,R){var k=r(R);k&&x2.unbind(F,z,k.$delegate)}function d(F){U(c,function(z,R){p(F,R,z)})}function u(F){U(c,function(z,R){E(F,R,z)})}e.on("canvas.destroy",function(F){u(F.svg)}),e.on("canvas.init",function(F){d(F.svg)}),e.on(["shape.added","connection.added"],function(F){var z=F.element,R=F.gfx;e.fire("interactionEvents.createHit",{element:z,gfx:R})}),e.on(["shape.changed","connection.changed"],Gg,function(F){var z=F.element,R=F.gfx;e.fire("interactionEvents.updateHit",{element:z,gfx:R})}),e.on("interactionEvents.createHit",Gg,function(F){var z=F.element,R=F.gfx;A.createDefaultHit(z,R)}),e.on("interactionEvents.updateHit",function(F){var z=F.element,R=F.gfx;A.updateDefaultHit(z,R)});var h=I("djs-hit djs-hit-stroke"),D=I("djs-hit djs-hit-click-stroke"),y=I("djs-hit djs-hit-all"),C=I("djs-hit djs-hit-no-move"),m={all:y,"click-stroke":D,stroke:h,"no-move":C};function I(F,z){return z=N({stroke:"white",strokeWidth:15},z||{}),n.cls(F,["no-fill","no-border"],z)}function x(F,z){var R=m[z];if(!R)throw new Error("invalid hit type <"+z+">");return q(F,R),F}function v(F,z){Q0(F,z)}this.removeHits=function(F){var z=Le(".djs-hit",F);U(z,s2)},this.createDefaultHit=function(F,z){var R=F.waypoints,k=F.isFrame,T;return R?this.createWaypointsHit(z,R):(T=k?"stroke":"all",this.createBoxHit(z,T,{width:F.width,height:F.height}))},this.createWaypointsHit=function(F,z){var R=lo(z);return x(R,"stroke"),v(F,R),R},this.createBoxHit=function(F,z,R){R=N({x:0,y:0},R);var k=g0("rect");return x(k,z),q(k,R),v(F,k),k},this.updateDefaultHit=function(F,z){var R=p0(".djs-hit",z);if(R)return F.waypoints?dB(R,F.waypoints):q(R,{width:F.width,height:F.height}),R},this.fire=i,this.triggerMouseEvent=B,this.mouseHandler=r,this.registerEvent=p,this.unregisterEvent=E}Hg.$inject=["eventBus","elementRegistry","styles"];const ko={__init__:["interactionEvents"],interactionEvents:["type",Hg]};function _n(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(A){var i=A.element;n.deselect(i)}),e.on(["diagram.clear","root.set"],function(A){n.select(null)})}_n.$inject=["eventBus","canvas"],_n.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var A=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:A,newSelection:t})}},_n.prototype.get=function(){return this._selectedElements},_n.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},_n.prototype.select=function(e,t){var n=this._selectedElements,A=n.slice();n0(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter(function(r){var a=i.findRoot(r);return o===a}),t?U(e,function(r){n.indexOf(r)===-1&&n.push(r)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:A,newSelection:n})};var Pg="hover",Jg="selected";function jg(e,t){this._canvas=e;function n(i,o){e.addMarker(i,o)}function A(i,o){e.removeMarker(i,o)}t.on("element.hover",function(i){n(i.element,Pg)}),t.on("element.out",function(i){A(i.element,Pg)}),t.on("selection.changed",function(i){function o(l){A(l,Jg)}function r(l){n(l,Jg)}var a=i.oldSelection,c=i.newSelection;U(a,function(l){c.indexOf(l)===-1&&o(l)}),U(c,function(l){a.indexOf(l)===-1&&r(l)})})}jg.$inject=["canvas","eventBus"];function Vg(e,t,n,A){e.on("create.end",500,function(i){var o=i.context,r=o.canExecute,a=o.elements,c=o.hints||{},l=c.autoSelect;if(r){if(l===!1)return;n0(l)?t.select(l):t.select(a.filter(J5))}}),e.on("connect.end",500,function(i){var o=i.context,r=o.connection;r&&t.select(r)}),e.on("shape.move.end",500,function(i){var o=i.previousSelection||[],r=A.get(i.context.shape.id),a=m0(o,function(c){return r.id===c.id});a||t.select(r)}),e.on("element.click",function(i){if(vt(i)){var o=i.element;o===n.getRootElement()&&(o=null);var r=t.isSelected(o),a=t.get().length>1,c=So(i);if(r&&a)return c?t.deselect(o):t.select(o);r?t.deselect(o):t.select(o,c)}})}Vg.$inject=["eventBus","selection","canvas","elementRegistry"];function J5(e){return!e.hidden}const Ce={__init__:["selectionVisuals","selectionBehavior"],__depends__:[ko],selection:["type",_n],selectionVisuals:["type",jg],selectionBehavior:["type",Vg]};function et(e){H0.call(this,e)}W(et,H0),et.prototype._modules=[M5,G5,No,Ce,bo],et.prototype._moddleExtensions={};var j5=["c","C"],V5=["v","V"],L5=["y","Y"],Lg=["z","Z"];function W5(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function ne(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function E2(e,t){return e=n0(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function kc(e){return e.shiftKey}function _5(e){return ne(e)&&E2(j5,e)}function O5(e){return ne(e)&&E2(V5,e)}function X5(e){return ne(e)&&!kc(e)&&E2(Lg,e)}function K5(e){return ne(e)&&(E2(L5,e)||E2(Lg,e)&&kc(e))}var Go="keyboard.keydown",Z5="keyboard.keyup",q5=1e3,Wg="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function Y2(e,t){var n=this;this._config=e=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(Wg));var A=e&&e.bind!==!1;t.on("canvas.init",function(i){n._target=i.svg,A&&n.bind(),n._fire("init")})}Y2.$inject=["config.keyboard","eventBus"],Y2.prototype._keydownHandler=function(e){this._keyHandler(e,Go)},Y2.prototype._keyupHandler=function(e){this._keyHandler(e,Z5)},Y2.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var A={keyEvent:e};n=this._eventBus.fire(t||Go,A),n&&e.preventDefault()}},Y2.prototype._isEventIgnored=function(e){return!1},Y2.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(Wg)),this.unbind(),e=this._node=this._target,O.bind(e,"keydown",this._keydownHandler),O.bind(e,"keyup",this._keyupHandler),this._fire("bind")},Y2.prototype.getBinding=function(){return this._node},Y2.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),O.unbind(e,"keydown",this._keydownHandler),O.unbind(e,"keyup",this._keyupHandler)),this._node=null},Y2.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Y2.prototype.addListener=function(e,t,n){n2(e)&&(n=t,t=e,e=q5),this._eventBus.on(n||Go,e,t)},Y2.prototype.removeListener=function(e,t){this._eventBus.off(t||Go,e)},Y2.prototype.hasModifier=W5,Y2.prototype.isCmd=ne,Y2.prototype.isShift=kc,Y2.prototype.isKey=E2;var $5=500;function On(e,t){var n=this;e.on("editorActions.init",$5,function(A){var i=A.editorActions;n.registerBindings(t,i)})}On.$inject=["eventBus","keyboard"],On.prototype.registerBindings=function(e,t){function n(A,i){t.isRegistered(A)&&e.addListener(i)}n("undo",function(A){var i=A.keyEvent;if(X5(i))return t.trigger("undo"),!0}),n("redo",function(A){var i=A.keyEvent;if(K5(i))return t.trigger("redo"),!0}),n("copy",function(A){var i=A.keyEvent;if(_5(i))return t.trigger("copy"),!0}),n("paste",function(A){var i=A.keyEvent;if(O5(i))return t.trigger("paste"),!0}),n("stepZoom",function(A){var i=A.keyEvent;if(E2(["+","Add","="],i)&&ne(i))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(A){var i=A.keyEvent;if(E2(["-","Subtract"],i)&&ne(i))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(A){var i=A.keyEvent;if(E2("0",i)&&ne(i))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(A){var i=A.keyEvent;if(E2(["Backspace","Delete","Del"],i))return t.trigger("removeSelection"),!0})};const Gc={__init__:["keyboard","keyboardBindings"],keyboard:["type",Y2],keyboardBindings:["type",On]};var eD={moveSpeed:50,moveSpeedAccelerated:200};function _g(e,t,n){var A=this;this._config=N({},eD,e||{}),t.addListener(i);function i(o){var r=o.keyEvent,a=A._config;if(t.isCmd(r)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],r)){var c=t.isShift(r)?a.moveSpeedAccelerated:a.moveSpeed,l;switch(r.key){case"ArrowLeft":case"Left":l="left";break;case"ArrowUp":case"Up":l="up";break;case"ArrowRight":case"Right":l="right";break;case"ArrowDown":case"Down":l="down";break}return A.moveCanvas({speed:c,direction:l}),!0}}this.moveCanvas=function(o){var r=0,a=0,c=o.speed,l=c/Math.min(Math.sqrt(n.viewbox().scale),1);switch(o.direction){case"left":r=l;break;case"up":a=l;break;case"right":r=-l;break;case"down":a=-l;break}n.scroll({dx:r,dy:a})}}_g.$inject=["config.keyboardMove","keyboard","canvas"];const Og={__depends__:[Gc],__init__:["keyboardMove"],keyboardMove:["type",_g]};var tD=/^djs-cursor-.*$/;function Ho(e){var t=X(document.body);t.removeMatching(tD),e&&t.add("djs-cursor-"+e)}function Xg(){Ho(null)}var nD=5e3;function Kg(e,t){t=t||"element.click";function n(){return!1}return e.once(t,nD,n),function(){e.off(t,n)}}function WA(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Me(e,t){return{x:e.x-t.x,y:e.y-t.y}}var AD=15;function Zg(e,t){var n;function A(a){return r(a.originalEvent)}e.on("canvas.focus.changed",function(a){a.focused?e.on("element.mousedown",500,A):e.off("element.mousedown",A)});function i(a){var c=n.start,l=n.button,B=Bn(a),g=Me(B,c);if(!n.dragging&&iD(g)>AD&&(n.dragging=!0,l===0&&Kg(e),Ho("grab")),n.dragging){var p=n.last||n.start;g=Me(B,p),t.scroll({dx:g.x,dy:g.y}),n.last=B}a.preventDefault()}function o(a){O.unbind(document,"mousemove",i),O.unbind(document,"mouseup",o),n=null,Xg()}function r(a){if(!Sn(a.target,".djs-draggable")){var c=a.button;if(!(c>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:c,start:Bn(a)},O.bind(document,"mousemove",i),O.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!n}}Zg.$inject=["eventBus","canvas"];function iD(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}const Hc={__init__:["moveCanvas"],moveCanvas:["type",Zg]};function Pc(e){return Math.log(e)/Math.log(10)}function qg(e,t){var n=Pc(e.min),A=Pc(e.max),i=Math.abs(n)+Math.abs(A);return i/t}function oD(e,t){return Math.max(e.min,Math.min(e.max,t))}var rD=Math.sign||function(e){return e>=0?1:-1},Jc={min:.2,max:4},$g=10,aD=.1,cD=.75;function Se(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=v2(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||cD;var A=this;t.on("canvas.focus.changed",function(i){A._init(i.focused&&e.enabled!==!1)})}Se.$inject=["config.zoomScroll","eventBus","canvas"],Se.prototype.scroll=function(t){this._canvas.scroll(t)},Se.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Se.prototype.zoom=function(t,n){var A=qg(Jc,$g*2);this._totalDelta+=t,Math.abs(this._totalDelta)>aD&&(this._zoom(t,n,A),this._totalDelta=0)},Se.prototype._handleWheel=function(t){if(this._canvas.isFocused()){var n=this._container;t.preventDefault();var A=t.ctrlKey||Tg()&&t.metaKey,i=t.shiftKey,o=-1*this._scale,r;if(A?o*=t.deltaMode===0?.02:.32:o*=t.deltaMode===0?1:16,A){var a=n.getBoundingClientRect(),c={x:t.clientX-a.left,y:t.clientY-a.top};r=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*rD(t.deltaY)*o,this.zoom(r,c)}else i?r={dx:o*t.deltaY,dy:0}:r={dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(r)}},Se.prototype.stepZoom=function(t,n){var A=qg(Jc,$g);this._zoom(t,n,A)},Se.prototype._zoom=function(e,t,n){var A=this._canvas,i=e>0?1:-1,o=Pc(A.zoom()),r=Math.round(o/n)*n;r+=n*i;var a=Math.pow(10,r);A.zoom(oD(Jc,a),t)},Se.prototype.toggle=function(t){var n=this._container,A=this._handleWheel,i=this._enabled;return typeof t>"u"&&(t=!i),i!==t&&O[t?"bind":"unbind"](n,"wheel",A,!1),this._enabled=t,t},Se.prototype._init=function(e){this.toggle(e)};const jc={__init__:["zoomScroll"],zoomScroll:["type",Se]};function _A(e){et.call(this,e)}W(_A,et),_A.prototype._navigationModules=[Og,Hc,jc],_A.prototype._modules=[].concat(et.prototype._modules,_A.prototype._navigationModules);function Vc(e){return e&&e[e.length-1]}function ep(e){return e.y}function tp(e){return e.x}var sD={left:tp,center:tp,right:function(e){return e.x+e.width},top:ep,middle:ep,bottom:function(e){return e.y+e.height}};function Xn(e,t){this._modeling=e,this._rules=t}Xn.$inject=["modeling","rules"],Xn.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],n="x",A="width";return t.indexOf(e)!==-1&&(n="y",A="height"),{axis:n,dimension:A}},Xn.prototype._isType=function(e,t){return t.indexOf(e)!==-1},Xn.prototype._alignmentPosition=function(e,t){var n=this._getOrientationDetails(e),A=n.axis,i=n.dimension,o={},r={},a=!1,c,l,B;function g(p,E){return Math.round((p[A]+E[A]+E[i])/2)}if(this._isType(e,["left","top"]))o[e]=t[0][A];else if(this._isType(e,["right","bottom"]))B=Vc(t),o[e]=B[A]+B[i];else if(this._isType(e,["center","middle"])){if(U(t,function(p){var E=p[A]+Math.round(p[i]/2);r[E]?r[E].elements.push(p):r[E]={elements:[p],center:E}}),c=he(r,function(p){return p.elements.length>1&&(a=!0),p.elements.length}),a)return o[e]=Vc(c).center,o;l=t[0],t=he(t,function(p){return p[A]+p[i]}),B=Vc(t),o[e]=g(l,B)}return o},Xn.prototype.trigger=function(e,t){var n=this._modeling,A,i=l0(e,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(A=this._rules.allowed("elements.align",{elements:i}),n0(A)&&(i=A),!(i.length<2||!A)){var o=sD[t],r=he(i,o),a=this._alignmentPosition(t,r);n.alignElements(r,a)}};const lD={__init__:["alignElements"],alignElements:["type",Xn]},BD=new VA;function Kn(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}Kn.$inject=["eventBus"],Kn.prototype.schedule=function(e,t=BD.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},Kn.prototype._schedule=function(e,t){const n=gD();return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(i){n.reject(i)}}catch(i){console.error("Scheduler#_schedule execution failed",i)}}),promise:n.promise}},Kn.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},Kn.prototype._cancel=function(e){clearTimeout(e.executionId)};function gD(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const pD={scheduler:["type",Kn]};var ED="djs-element-hidden",Po=".entry",dD=1e3,np=8,uD=300;function Z0(e,t,n,A){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=A,this._current=null,this._init()}Z0.$inject=["canvas","elementRegistry","eventBus","scheduler"],Z0.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,A=n.length?n.length===1?n[0]:n:null;A?e.open(A,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,A=e._current;if(A){var i=A.target,o=n0(i)?i:[i],r=o.filter(function(c){return n.includes(c)});if(r.length){e.close();var a=o.filter(function(c){return e._elementRegistry.get(c.id)});a.length&&e._updateAndOpen(a.length>1?a:a[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,A=e._current,i=n0(A.target)?A.target:[A.target];i.includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()},Z0.prototype._createContainer=function(){var e=$('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},Z0.prototype.registerProvider=function(e,t){t||(t=e,e=dD),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})},Z0.prototype.getEntries=function(e){var t=this._getProviders(),n=n0(e)?"getMultiElementContextPadEntries":"getContextPadEntries",A={};return U(t,function(i){if(n2(i[n])){var o=i[n](e);n2(o)?A=o(A):U(o,function(r,a){A[a]=r})}}),A},Z0.prototype.trigger=function(e,t,n){var A=this,i,o,r=t.delegateTarget||t.target;if(!r)return t.preventDefault();if(i=g2(r,"data-action"),o=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){A._mouseout=A.triggerEntry(i,"hover",o,n)},uD);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(i,e,o,n)},Z0.prototype.triggerEntry=function(e,t,n,A){if(this.isShown()){var i=this._current.target,o=this._current.entries,r=o[e];if(r){var a=r.action;if(this._eventBus.fire("contextPad.trigger",{entry:r,event:n})!==!1){if(n2(a)){if(t==="click")return a(n,i,A)}else if(a[t])return a[t](n,i,A);n.preventDefault()}}}},Z0.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},Z0.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Z0.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this._createHtml(e),A;U(t,function(i,o){var r=i.group||"default",a=$(i.html||'<div class="entry" draggable="true"></div>'),c;g2(a,"data-action",o),c=p0("[data-group="+LA(r)+"]",n),c||(c=$('<div class="group"></div>'),g2(c,"data-group",r),n.appendChild(c)),c.appendChild(a),i.className&&QD(a,i.className),i.title&&g2(a,"title",i.title),i.imageUrl&&(A=$("<img>"),g2(A,"src",i.imageUrl),A.style.width="100%",A.style.height="100%",a.appendChild(A))}),X(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},Z0.prototype._createHtml=function(e){var t=this,n=$('<div class="djs-context-pad"></div>');return x2.bind(n,Po,"click",function(A){t.trigger("click",A)}),x2.bind(n,Po,"dragstart",function(A){t.trigger("dragstart",A)}),x2.bind(n,Po,"mouseover",function(A){t.trigger("mouseover",A)}),x2.bind(n,Po,"mouseout",function(A){t.trigger("mouseout",A)}),O.bind(n,"mousedown",function(A){A.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},Z0.prototype.getPad=function(e){console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888"));let t;return this.isOpen()&&wD(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}},Z0.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},Z0.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return n0(e)!==n0(n)?!1:n0(e)?e.length===n.length&&je(e,function(A){return n.includes(A)}):n===e},Z0.prototype.isShown=function(){return this.isOpen()&&X(this._current.html).has("open")},Z0.prototype.show=function(){this.isOpen()&&(X(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},Z0.prototype.hide=function(){this.isOpen()&&(X(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},Z0.prototype._getPosition=function(e){if(!n0(e)&&Y0(e)){var t=this._canvas.viewbox(),n=hD(e),A=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale;return{left:A+np*this._canvas.zoom(),top:i}}var o=this._canvas.getContainer(),r=o.getBoundingClientRect(),a=this._getTargetBounds(e);return{left:a.right-r.left+np*this._canvas.zoom(),top:a.top-r.top}},Z0.prototype._updatePosition=function(){const e=()=>{if(this.isOpen()){var t=this._current.html,n=this._getPosition(this._current.target);"x"in n&&"y"in n?(t.style.left=n.x+"px",t.style.top=n.y+"px"):["top","right","bottom","left"].forEach(function(A){A in n&&(t.style[A]=n[A]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")},Z0.prototype._updateVisibility=function(){const e=()=>{if(this.isOpen()){var t=this,n=this._current.target,A=n0(n)?n:[n],i=A.some(function(o){return t._canvas.hasMarker(o,ED)});i?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")},Z0.prototype._getTargetBounds=function(e){var t=this,n=n0(e)?e:[e],A=n.map(function(i){return t._canvas.getGraphics(i)});return A.reduce(function(i,o){const r=o.getBoundingClientRect();return i.top=Math.min(i.top,r.top),i.right=Math.max(i.right,r.right),i.bottom=Math.max(i.bottom,r.bottom),i.left=Math.min(i.left,r.left),i.x=i.left,i.y=i.top,i.width=i.right-i.left,i.height=i.bottom-i.top,i},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function QD(e,t){var n=X(e);t=n0(t)?t:t.split(/\s+/g),t.forEach(function(A){n.add(A)})}function hD(e){return e.waypoints[e.waypoints.length-1]}function wD(e,t){return e=n0(e)?e:[e],t=n0(t)?t:[t],e.length===t.length&&je(e,function(n){return t.includes(n)})}const Ap={__depends__:[ko,pD,No],contextPad:["type",Z0]};var Jo,w0,ip,gn,op,rp,Lc,jo={},ap=[],mD=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function xt(e,t){for(var n in t)e[n]=t[n];return e}function cp(e){var t=e.parentNode;t&&t.removeChild(e)}function sp(e,t,n){var A,i,o,r={};for(o in t)o=="key"?A=t[o]:o=="ref"?i=t[o]:r[o]=t[o];if(arguments.length>2&&(r.children=arguments.length>3?Jo.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)r[o]===void 0&&(r[o]=e.defaultProps[o]);return Vo(e,r,A,i,null)}function Vo(e,t,n,A,i){var o={type:e,props:t,key:n,ref:A,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++ip};return i==null&&w0.vnode!=null&&w0.vnode(o),o}function Lo(e){return e.children}function Wo(e,t){this.props=e,this.context=t}function OA(e,t){if(t==null)return e.__?OA(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?OA(e):null}function lp(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return lp(e)}}function Bp(e){(!e.__d&&(e.__d=!0)&&gn.push(e)&&!_o.__r++||op!==w0.debounceRendering)&&((op=w0.debounceRendering)||rp)(_o)}function _o(){var e,t,n,A,i,o,r,a;for(gn.sort(Lc);e=gn.shift();)e.__d&&(t=gn.length,A=void 0,i=void 0,r=(o=(n=e).__v).__e,(a=n.__P)&&(A=[],(i=xt({},o)).__v=o.__v+1,Wc(a,o,i,n.__n,a.ownerSVGElement!==void 0,o.__h!=null?[r]:null,A,r??OA(o),o.__h),wp(A,o),o.__e!=r&&lp(o)),gn.length>t&&gn.sort(Lc));_o.__r=0}function gp(e,t,n,A,i,o,r,a,c,l){var B,g,p,E,d,u,h,D=A&&A.__k||ap,y=D.length;for(n.__k=[],B=0;B<t.length;B++)if((E=n.__k[B]=(E=t[B])==null||typeof E=="boolean"||typeof E=="function"?null:typeof E=="string"||typeof E=="number"||typeof E=="bigint"?Vo(null,E,null,null,E):Array.isArray(E)?Vo(Lo,{children:E},null,null,null):E.__b>0?Vo(E.type,E.props,E.key,E.ref?E.ref:null,E.__v):E)!=null){if(E.__=n,E.__b=n.__b+1,(p=D[B])===null||p&&E.key==p.key&&E.type===p.type)D[B]=void 0;else for(g=0;g<y;g++){if((p=D[g])&&E.key==p.key&&E.type===p.type){D[g]=void 0;break}p=null}Wc(e,E,p=p||jo,i,o,r,a,c,l),d=E.__e,(g=E.ref)&&p.ref!=g&&(h||(h=[]),p.ref&&h.push(p.ref,null,E),h.push(g,E.__c||d,E)),d!=null?(u==null&&(u=d),typeof E.type=="function"&&E.__k===p.__k?E.__d=c=pp(E,c,e):c=Ep(e,E,p,D,d,c),typeof n.type=="function"&&(n.__d=c)):c&&p.__e==c&&c.parentNode!=e&&(c=OA(p))}for(n.__e=u,B=y;B--;)D[B]!=null&&(typeof n.type=="function"&&D[B].__e!=null&&D[B].__e==n.__d&&(n.__d=dp(A).nextSibling),fp(D[B],D[B]));if(h)for(B=0;B<h.length;B++)mp(h[B],h[++B],h[++B])}function pp(e,t,n){for(var A,i=e.__k,o=0;i&&o<i.length;o++)(A=i[o])&&(A.__=e,t=typeof A.type=="function"?pp(A,t,n):Ep(n,A,A,i,A.__e,t));return t}function Ep(e,t,n,A,i,o){var r,a,c;if(t.__d!==void 0)r=t.__d,t.__d=void 0;else if(n==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(i),r=null;else{for(a=o,c=0;(a=a.nextSibling)&&c<A.length;c+=1)if(a==i)break e;e.insertBefore(i,o),r=o}return r!==void 0?r:i.nextSibling}function dp(e){var t,n,A;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(A=dp(n)))return A}return null}function fD(e,t,n,A,i){var o;for(o in n)o==="children"||o==="key"||o in t||Oo(e,o,null,n[o],A);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||n[o]===t[o]||Oo(e,o,t[o],n[o],A)}function up(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||mD.test(t)?n:n+"px"}function Oo(e,t,n,A,i){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof A=="string"&&(e.style.cssText=A=""),A)for(t in A)n&&t in n||up(e.style,t,"");if(n)for(t in n)A&&n[t]===A[t]||up(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?A||e.addEventListener(t,o?hp:Qp,o):e.removeEventListener(t,o?hp:Qp,o);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function Qp(e){return this.l[e.type+!1](w0.event?w0.event(e):e)}function hp(e){return this.l[e.type+!0](w0.event?w0.event(e):e)}function Wc(e,t,n,A,i,o,r,a,c){var l,B,g,p,E,d,u,h,D,y,C,m,I,x,v,F=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(l=w0.__b)&&l(t);try{e:if(typeof F=="function"){if(h=t.props,D=(l=F.contextType)&&A[l.__c],y=l?D?D.props.value:l.__:A,n.__c?u=(B=t.__c=n.__c).__=B.__E:("prototype"in F&&F.prototype.render?t.__c=B=new F(h,y):(t.__c=B=new Wo(h,y),B.constructor=F,B.render=MD),D&&D.sub(B),B.props=h,B.state||(B.state={}),B.context=y,B.__n=A,g=B.__d=!0,B.__h=[],B._sb=[]),B.__s==null&&(B.__s=B.state),F.getDerivedStateFromProps!=null&&(B.__s==B.state&&(B.__s=xt({},B.__s)),xt(B.__s,F.getDerivedStateFromProps(h,B.__s))),p=B.props,E=B.state,B.__v=t,g)F.getDerivedStateFromProps==null&&B.componentWillMount!=null&&B.componentWillMount(),B.componentDidMount!=null&&B.__h.push(B.componentDidMount);else{if(F.getDerivedStateFromProps==null&&h!==p&&B.componentWillReceiveProps!=null&&B.componentWillReceiveProps(h,y),!B.__e&&B.shouldComponentUpdate!=null&&B.shouldComponentUpdate(h,B.__s,y)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(B.props=h,B.state=B.__s,B.__d=!1),B.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(z){z&&(z.__=t)}),C=0;C<B._sb.length;C++)B.__h.push(B._sb[C]);B._sb=[],B.__h.length&&r.push(B);break e}B.componentWillUpdate!=null&&B.componentWillUpdate(h,B.__s,y),B.componentDidUpdate!=null&&B.__h.push(function(){B.componentDidUpdate(p,E,d)})}if(B.context=y,B.props=h,B.__P=e,m=w0.__r,I=0,"prototype"in F&&F.prototype.render){for(B.state=B.__s,B.__d=!1,m&&m(t),l=B.render(B.props,B.state,B.context),x=0;x<B._sb.length;x++)B.__h.push(B._sb[x]);B._sb=[]}else do B.__d=!1,m&&m(t),l=B.render(B.props,B.state,B.context),B.state=B.__s;while(B.__d&&++I<25);B.state=B.__s,B.getChildContext!=null&&(A=xt(xt({},A),B.getChildContext())),g||B.getSnapshotBeforeUpdate==null||(d=B.getSnapshotBeforeUpdate(p,E)),v=l!=null&&l.type===Lo&&l.key==null?l.props.children:l,gp(e,Array.isArray(v)?v:[v],t,n,A,i,o,r,a,c),B.base=t.__e,t.__h=null,B.__h.length&&r.push(B),u&&(B.__E=B.__=null),B.__e=!1}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=CD(n.__e,t,n,A,i,o,r,c);(l=w0.diffed)&&l(t)}catch(z){t.__v=null,(c||o!=null)&&(t.__e=a,t.__h=!!c,o[o.indexOf(a)]=null),w0.__e(z,t,n)}}function wp(e,t){w0.__c&&w0.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(A){A.call(n)})}catch(A){w0.__e(A,n.__v)}})}function CD(e,t,n,A,i,o,r,a){var c,l,B,g=n.props,p=t.props,E=t.type,d=0;if(E==="svg"&&(i=!0),o!=null){for(;d<o.length;d++)if((c=o[d])&&"setAttribute"in c==!!E&&(E?c.localName===E:c.nodeType===3)){e=c,o[d]=null;break}}if(e==null){if(E===null)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",E):document.createElement(E,p.is&&p),o=null,a=!1}if(E===null)g===p||a&&e.data===p||(e.data=p);else{if(o=o&&Jo.call(e.childNodes),l=(g=n.props||jo).dangerouslySetInnerHTML,B=p.dangerouslySetInnerHTML,!a){if(o!=null)for(g={},d=0;d<e.attributes.length;d++)g[e.attributes[d].name]=e.attributes[d].value;(B||l)&&(B&&(l&&B.__html==l.__html||B.__html===e.innerHTML)||(e.innerHTML=B&&B.__html||""))}if(fD(e,p,g,i,a),B)t.__k=[];else if(d=t.props.children,gp(e,Array.isArray(d)?d:[d],t,n,A,i&&E!=="foreignObject",o,r,o?o[0]:n.__k&&OA(n,0),a),o!=null)for(d=o.length;d--;)o[d]!=null&&cp(o[d]);a||("value"in p&&(d=p.value)!==void 0&&(d!==e.value||E==="progress"&&!d||E==="option"&&d!==g.value)&&Oo(e,"value",d,g.value,!1),"checked"in p&&(d=p.checked)!==void 0&&d!==e.checked&&Oo(e,"checked",d,g.checked,!1))}return e}function mp(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(A){w0.__e(A,n)}}function fp(e,t,n){var A,i;if(w0.unmount&&w0.unmount(e),(A=e.ref)&&(A.current&&A.current!==e.__e||mp(A,null,t)),(A=e.__c)!=null){if(A.componentWillUnmount)try{A.componentWillUnmount()}catch(o){w0.__e(o,t)}A.base=A.__P=null,e.__c=void 0}if(A=e.__k)for(i=0;i<A.length;i++)A[i]&&fp(A[i],t,n||typeof e.type!="function");n||e.__e==null||cp(e.__e),e.__=e.__e=e.__d=void 0}function MD(e,t,n){return this.constructor(e,n)}function Cp(e,t,n){var A,i,o;w0.__&&w0.__(e,t),i=(A=typeof n=="function")?null:t.__k,o=[],Wc(t,e=(!A&&n||t).__k=sp(Lo,null,[e]),i||jo,jo,t.ownerSVGElement!==void 0,!A&&n?[n]:i?null:t.firstChild?Jo.call(t.childNodes):null,o,!A&&n?n:i?i.__e:t.firstChild,A),wp(o,e)}Jo=ap.slice,w0={__e:function(e,t,n,A){for(var i,o,r;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),r=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,A||{}),r=i.__d),r)return i.__E=i}catch(a){e=a}throw e}},ip=0,Wo.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=xt({},this.state),typeof e=="function"&&(e=e(xt({},n),this.props)),e&&xt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Bp(this))},Wo.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Bp(this))},Wo.prototype.render=Lo,gn=[],rp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Lc=function(e,t){return e.__v.__b-t.__v.__b},_o.__r=0;var Mp=function(e,t,n,A){var i;t[0]=0;for(var o=1;o<t.length;o++){var r=t[o++],a=t[o]?(t[0]|=r?1:2,n[t[o++]]):t[++o];r===3?A[0]=a:r===4?A[1]=Object.assign(A[1]||{},a):r===5?(A[1]=A[1]||{})[t[++o]]=a:r===6?A[1][t[++o]]+=a+"":r?(i=e.apply(a,Mp(e,a,n,["",null])),A.push(i),a[0]?t[0]|=2:(t[o-2]=0,t[o]=i)):A.push(a)}return A},Dp=new Map;function DD(e){var t=Dp.get(this);return t||(t=new Map,Dp.set(this,t)),(t=Mp(this,t.get(e)||(t.set(e,t=function(n){for(var A,i,o=1,r="",a="",c=[0],l=function(p){o===1&&(p||(r=r.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?c.push(0,p,r):o===3&&(p||r)?(c.push(3,p,r),o=2):o===2&&r==="..."&&p?c.push(4,p,0):o===2&&r&&!p?c.push(5,0,!0,r):o>=5&&((r||!p&&o===5)&&(c.push(o,0,r,i),o=6),p&&(c.push(o,p,0,i),o=6)),r=""},B=0;B<n.length;B++){B&&(o===1&&l(),l(B));for(var g=0;g<n[B].length;g++)A=n[B][g],o===1?A==="<"?(l(),c=[c],o=3):r+=A:o===4?r==="--"&&A===">"?(o=1,r=""):r=A+r[0]:a?A===a?a="":r+=A:A==='"'||A==="'"?a=A:A===">"?(l(),o=1):o&&(A==="="?(o=5,i=r,r=""):A==="/"&&(o<5||n[B][g+1]===">")?(l(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):A===" "||A===" "||A===`
48
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+a+r+"</svg>"}catch(A){n=A}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}},H0.prototype._setDefinitions=function(e){this._definitions=e},H0.prototype.getModules=function(){return this._modules},H0.prototype.clear=function(){this.getDefinitions()&&Dt.prototype.clear.call(this)},H0.prototype.destroy=function(){Dt.prototype.destroy.call(this),xe(this._container)},H0.prototype.on=function(e,t,n,A){return this.get("eventBus").on(e,t,n,A)},H0.prototype.off=function(e,t){this.get("eventBus").off(e,t)},H0.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=p0(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},H0.prototype.getDefinitions=function(){return this._definitions},H0.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},H0.prototype._init=function(e,t,n){const A=n.modules||this.getModules(n),i=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],r=[].concat(o,A,i),a=N(he(n,["additionalModules"]),{canvas:N({},n.canvas,{container:e}),modules:r});Dt.call(this,a),n&&n.container&&this.attachTo(n.container)},H0.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},H0.prototype._createContainer=function(e){const t=$('<div class="bjs-container"></div>');return m2(t,{width:wg(e.width),height:wg(e.height),position:e.position}),t},H0.prototype._createModdle=function(e){const t=N({},this._moddleExtensions,e.moddleExtensions);return new dM(t)},H0.prototype._modules=[];function yo(e,t){return e.warnings=t,e}function xM(e){const n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}const bM={width:"100%",height:"100%",position:"relative"};function wg(e){return e+(A0(e)?"px":"")}function YM(e,t){return t&&m0(e.diagrams,function(n){return n.id===t})||null}function UM(e){const n='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+ug+"</a>",A=$(n);m2(p0("svg",A),Qg),m2(A,hg,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(A),O.bind(A,"click",function(i){vM(),i.preventDefault()})}function HA(e){H0.call(this,e),this.on("import.parse.complete",function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}W(HA,H0),HA.prototype._createModdle=function(e){var t=H0.prototype._createModdle.call(this,e);return t.ids=new we([32,36,1]),t},HA.prototype._collectIds=function(e,t){var n=e.$model,A=n.ids,i;A.clear();for(i in t)A.claim(i,t[i])};function E0(e,t){return f(e,"bpmn:CallActivity")?!1:f(e,"bpmn:SubProcess")?(t=t||Q0(e),t&&f(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):f(e,"bpmn:Participant")?!!P(e).processRef:!0}function l2(e){if(!(!f(e,"bpmn:Participant")&&!f(e,"bpmn:Lane"))){var t=Q0(e).isHorizontal;return t===void 0?!0:t}}function NM(e){return e&&P(e).isInterrupting!==!1}function h2(e){return e&&!!P(e).triggeredByEvent}function jn(e,t){var n=P(e).eventDefinitions;return ue(n,function(A){return f(A,t)})}function zM(e){return jn(e,"bpmn:ErrorEventDefinition")}function RM(e){return jn(e,"bpmn:EscalationEventDefinition")}function SM(e){return jn(e,"bpmn:CompensateEventDefinition")}var PA={width:90,height:20},mg=15;function an(e){return f(e,"bpmn:Event")||f(e,"bpmn:Gateway")||f(e,"bpmn:DataStoreReference")||f(e,"bpmn:DataObjectReference")||f(e,"bpmn:DataInput")||f(e,"bpmn:DataOutput")||f(e,"bpmn:SequenceFlow")||f(e,"bpmn:MessageFlow")||f(e,"bpmn:Group")}function Io(e){return f0(e.label)}function TM(e){var t=e.length/2-1,n=e[Math.floor(t)],A=e[Math.ceil(t+.01)],i=kM(e),o=Math.atan((A.y-n.y)/(A.x-n.x)),r=i.x,a=i.y;return Math.abs(o)<Math.PI/2?a-=mg:r+=mg,{x:r,y:a}}function kM(e){var t=e.length/2-1,n=e[Math.floor(t)],A=e[Math.ceil(t+.01)];return{x:n.x+(A.x-n.x)/2,y:n.y+(A.y-n.y)/2}}function Nc(e){return e.waypoints?TM(e.waypoints):f(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+PA.height/2}:{x:e.x+e.width/2,y:e.y+e.height+PA.height/2}}function GM(e,t){var n,A,i,o=e.label;return o&&o.bounds?(i=o.bounds,A={width:Math.max(PA.width,i.width),height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=Nc(t),A=PA),N({x:n.x-A.width/2,y:n.y-A.height/2},A)}function fg(e){if(f(e,"bpmn:FlowElement")||f(e,"bpmn:Participant")||f(e,"bpmn:Lane")||f(e,"bpmn:SequenceFlow")||f(e,"bpmn:MessageFlow")||f(e,"bpmn:DataInput")||f(e,"bpmn:DataOutput"))return"name";if(f(e,"bpmn:TextAnnotation"))return"text";if(f(e,"bpmn:Group"))return"categoryValueRef"}function HM(e){var t=e.categoryValueRef;return t&&t.value||""}function fe(e){var t=e.businessObject,n=fg(t);if(n)return n==="categoryValueRef"?HM(t):t[n]||""}function PM(e,t){var n=e.businessObject,A=fg(n);if(A)if(A==="categoryValueRef"){if(!n[A])return e;n[A].value=t}else n[A]=t;return e}var zc="hsl(225, 10%, 15%)",JM="white";function Re(e,t){return ue(e.eventDefinitions,function(n){return n.$type===t})}function jM(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function VM(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function B0(e,t,n){var A=Q0(e);return n||A.get("color:background-color")||A.get("bioc:fill")||t||JM}function L(e,t,n){var A=Q0(e);return n||A.get("color:border-color")||A.get("bioc:stroke")||t||zc}function JA(e,t,n,A){var i=Q0(e),o=i.get("label");return A||o&&o.get("color:color")||t||L(e,n)}function LM(e){var t=e.x+e.width/2,n=e.y+e.height/2,A=e.width/2,i=[["M",t,n],["m",0,-A],["a",A,A,0,1,1,0,2*A],["a",A,A,0,1,1,0,-2*A],["z"]];return tn(i)}function Cg(e,t){var n=e.x,A=e.y,i=e.width,o=e.height,r=[["M",n+t,A],["l",i-t*2,0],["a",t,t,0,0,1,t,t],["l",0,o-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-i,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-o],["a",t,t,0,0,1,t,-t],["z"]];return tn(r)}function WM(e){var t=e.width,n=e.height,A=e.x,i=e.y,o=t/2,r=n/2,a=[["M",A+o,i],["l",o,r],["l",-o,r],["l",-o,-r],["z"]];return tn(a)}function _M(e){var t=e.x,n=e.y,A=e.width,i=e.height,o=[["M",t,n],["l",A,0],["l",0,i],["l",-A,0],["z"]];return tn(o)}function jA(e,t={}){return{width:te(e,t),height:G2(e,t)}}function te(e,t={}){return I2(t,"width")?t.width:e.width}function G2(e,t={}){return I2(t,"height")?t.height:e.height}var OM=new we,XM=10,Fo=3,KM=1.5,vo=10,Vn=.95,ZM=1,qM=.25;function cn(e,t,n,A,i,o,r){be.call(this,t,r);var a=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,l=e&&e.defaultLabelColor;function B(M){return n.computeStyle(M,{strokeLinecap:"round",strokeLinejoin:"round",stroke:zc,strokeWidth:2,fill:"white"})}function g(M){return n.computeStyle(M,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:zc,strokeWidth:2})}function p(M,w){var{ref:Q={x:0,y:0},scale:b=1,element:Y,parentGfx:S=i._svg}=w,G=c2("marker",{id:M,viewBox:"0 0 20 20",refX:Q.x,refY:Q.y,markerWidth:20*b,markerHeight:20*b,orient:"auto"});me(G,Y);var _=p0(":scope > defs",S);_||(_=c2("defs"),me(S,_)),me(_,G)}function E(M,w,Q,b){var Y=OM.nextPrefixed("marker-");return d(M,Y,w,Q,b),"url(#"+Y+")"}function d(M,w,Q,b,Y){if(Q==="sequenceflow-end"){var S=c2("path",{d:"M 1 5 L 11 10 L 1 15 Z",...B({fill:Y,stroke:Y,strokeWidth:1})});p(w,{element:S,ref:{x:11,y:10},scale:.5,parentGfx:M})}if(Q==="messageflow-start"){var G=c2("circle",{cx:6,cy:6,r:3.5,...B({fill:b,stroke:Y,strokeWidth:1,strokeDasharray:[1e4,1]})});p(w,{element:G,ref:{x:6,y:6},parentGfx:M})}if(Q==="messageflow-end"){var _=c2("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...B({fill:b,stroke:Y,strokeWidth:1,strokeDasharray:[1e4,1]})});p(w,{element:_,ref:{x:8.5,y:5},parentGfx:M})}if(Q==="association-start"){var s0=c2("path",{d:"M 11 5 L 1 10 L 11 15",...g({fill:"none",stroke:Y,strokeWidth:1.5,strokeDasharray:[1e4,1]})});p(w,{element:s0,ref:{x:1,y:10},scale:.5,parentGfx:M})}if(Q==="association-end"){var W0=c2("path",{d:"M 1 5 L 11 10 L 1 15",...g({fill:"none",stroke:Y,strokeWidth:1.5,strokeDasharray:[1e4,1]})});p(w,{element:W0,ref:{x:11,y:10},scale:.5,parentGfx:M})}if(Q==="conditional-flow-marker"){var j0=c2("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...B({fill:b,stroke:Y})});p(w,{element:j0,ref:{x:-1,y:10},scale:.5,parentGfx:M})}if(Q==="conditional-default-flow-marker"){var I0=c2("path",{d:"M 6 4 L 10 16",...B({stroke:Y,fill:"none"})});p(w,{element:I0,ref:{x:0,y:10},scale:.5,parentGfx:M})}}function u(M,w,Q,b,Y={}){V0(b)&&(Y=b,b=0),b=b||0,Y=B(Y);var S=w/2,G=Q/2,_=c2("circle",{cx:S,cy:G,r:Math.round((w+Q)/4-b),...Y});return me(M,_),_}function h(M,w,Q,b,Y,S){V0(Y)&&(S=Y,Y=0),Y=Y||0,S=B(S);var G=c2("rect",{x:Y,y:Y,width:w-Y*2,height:Q-Y*2,rx:b,ry:b,...S});return me(M,G),G}function D(M,w,Q,b){var Y=w/2,S=Q/2,G=[{x:Y,y:0},{x:w,y:S},{x:Y,y:Q},{x:0,y:S}],_=G.map(function(W0){return W0.x+","+W0.y}).join(" ");b=B(b);var s0=c2("polygon",{...b,points:_});return me(M,s0),s0}function y(M,w,Q,b){Q=g(Q);var Y=lo(w,Q,b);return me(M,Y),Y}function C(M,w,Q){return y(M,w,Q,5)}function m(M,w,Q){Q=g(Q);var b=c2("path",{...Q,d:w});return me(M,b),b}function I(M,w,Q,b){return m(w,Q,N({"data-marker":M},b))}function x(M){return y2[M]}function v(M){return function(w,Q,b){return x(M)(w,Q,b)}}var F={"bpmn:MessageEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.235,my:.315}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill),G=b?B0(w,a,Q.fill):L(w,c,Q.stroke),_=m(M,Y,{fill:S,stroke:G,strokeWidth:1});return _},"bpmn:TimerEventDefinition":function(M,w,Q={}){var b=Q.width||w.width,Y=Q.height||w.height,S=Q.width?1:2,G=u(M,b,Y,.2*Y,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:S}),_=A.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:b,containerHeight:Y,position:{mx:.5,my:.5}});m(M,_,{stroke:L(w,c,Q.stroke),strokeWidth:S});for(var s0=0;s0<12;s0++){var W0=A.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:b,containerHeight:Y,position:{mx:.5,my:.5}}),j0=b/2,I0=Y/2;m(M,W0,{strokeWidth:1,stroke:L(w,c,Q.stroke),transform:"rotate("+s0*30+","+I0+","+j0+")"})}return G},"bpmn:EscalationEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.5,my:.2}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(M,w,Q={}){var b=A.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.5,my:.222}});return m(M,b,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:.57,my:.263}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.2,my:.722}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:.638,my:-.055}}),S=b?L(w,c,Q.stroke):"none",G=m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1});return OB(G,45),G},"bpmn:CompensateEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.22,my:.5}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.5,my:.2}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{strokeWidth:1,fill:S,stroke:L(w,c,Q.stroke)})},"bpmn:MultipleEventDefinition":function(M,w,Q={},b){var Y=A.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.211,my:.36}}),S=b?L(w,c,Q.stroke):B0(w,a,Q.fill);return m(M,Y,{fill:S,stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(M,w,Q={}){var b=A.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:Q.width||w.width,containerHeight:Q.height||w.height,position:{mx:.458,my:.194}});return m(M,b,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(M,w,Q={}){var b=u(M,w.width,w.height,8,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:4});return b}};function z(M,w,Q={},b){var Y=P(M),S=jM(Y),G=b||M;return Y.get("eventDefinitions")&&Y.get("eventDefinitions").length>1?Y.get("parallelMultiple")?F["bpmn:ParallelMultipleEventDefinition"](w,G,Q,S):F["bpmn:MultipleEventDefinition"](w,G,Q,S):Re(Y,"bpmn:MessageEventDefinition")?F["bpmn:MessageEventDefinition"](w,G,Q,S):Re(Y,"bpmn:TimerEventDefinition")?F["bpmn:TimerEventDefinition"](w,G,Q,S):Re(Y,"bpmn:ConditionalEventDefinition")?F["bpmn:ConditionalEventDefinition"](w,G,Q,S):Re(Y,"bpmn:SignalEventDefinition")?F["bpmn:SignalEventDefinition"](w,G,Q,S):Re(Y,"bpmn:EscalationEventDefinition")?F["bpmn:EscalationEventDefinition"](w,G,Q,S):Re(Y,"bpmn:LinkEventDefinition")?F["bpmn:LinkEventDefinition"](w,G,Q,S):Re(Y,"bpmn:ErrorEventDefinition")?F["bpmn:ErrorEventDefinition"](w,G,Q,S):Re(Y,"bpmn:CancelEventDefinition")?F["bpmn:CancelEventDefinition"](w,G,Q,S):Re(Y,"bpmn:CompensateEventDefinition")?F["bpmn:CompensateEventDefinition"](w,G,Q,S):Re(Y,"bpmn:TerminateEventDefinition")?F["bpmn:TerminateEventDefinition"](w,G,Q,S):null}var R={ParticipantMultiplicityMarker:function(M,w,Q={}){var b=te(w,Q),Y=G2(w,Q),S=A.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:b,containerHeight:Y,position:{mx:(b/2-6)/b,my:(Y-15)/Y}});I("participant-multiplicity",M,S,{strokeWidth:2,fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})},SubProcessMarker:function(M,w,Q={}){var b=h(M,14,14,0,{strokeWidth:1,fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)});Q2(b,w.width/2-7.5,w.height-20);var Y=A.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:w.width,containerHeight:w.height,position:{mx:(w.width/2-7.5)/w.width,my:(w.height-20)/w.height}});I("sub-process",M,Y,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})},ParallelMarker:function(M,w,Q){var b=te(w,Q),Y=G2(w,Q),S=A.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:b,containerHeight:Y,position:{mx:(b/2+Q.parallel)/b,my:(Y-20)/Y}});I("parallel",M,S,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})},SequentialMarker:function(M,w,Q){var b=A.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:(w.width/2+Q.seq)/w.width,my:(w.height-19)/w.height}});I("sequential",M,b,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})},CompensationMarker:function(M,w,Q){var b=A.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:(w.width/2+Q.compensation)/w.width,my:(w.height-13)/w.height}});I("compensation",M,b,{strokeWidth:1,fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})},LoopMarker:function(M,w,Q){var b=te(w,Q),Y=G2(w,Q),S=A.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:b,containerHeight:Y,position:{mx:(b/2+Q.loop)/b,my:(Y-7)/Y}});I("loop",M,S,{strokeWidth:1.5,fill:"none",stroke:L(w,c,Q.stroke),strokeMiterlimit:.5})},AdhocMarker:function(M,w,Q){var b=te(w,Q),Y=G2(w,Q),S=A.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:b,containerHeight:Y,position:{mx:(b/2+Q.adhoc)/b,my:(Y-15)/Y}});I("adhoc",M,S,{strokeWidth:1,fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke)})}};function k(M,w,Q,b){R[M](w,Q,b)}function T(M,w,Q=[],b={}){b={fill:b.fill,stroke:b.stroke,width:te(w,b),height:G2(w,b)};var Y=P(w),S=Q.includes("SubProcessMarker");S?b={...b,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:b={...b,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},Y.get("isForCompensation")&&Q.push("CompensationMarker"),f(Y,"bpmn:AdHocSubProcess")&&(Q.push("AdhocMarker"),S||N(b,{compensation:b.compensation-18}));var G=Y.get("loopCharacteristics"),_=G&&G.get("isSequential");G&&(N(b,{compensation:b.compensation-18}),Q.includes("AdhocMarker")&&N(b,{seq:-23,loop:-18,parallel:-24}),_===void 0&&Q.push("LoopMarker"),_===!1&&Q.push("ParallelMarker"),_===!0&&Q.push("SequentialMarker")),Q.includes("CompensationMarker")&&Q.length===1&&N(b,{compensation:-8}),U(Q,function(s0){k(s0,M,w,b)})}function H(M,w,Q={}){Q=N({size:{width:100}},Q);var b=o.createText(w||"",Q);return Um(b).add("djs-label"),me(M,b),b}function K(M,w,Q,b={}){var Y=P(w),S=jA({x:w.x,y:w.y,width:w.width,height:w.height},b);return H(M,Y.name,{align:Q,box:S,padding:7,style:{fill:JA(w,l,c,b.stroke)}})}function x0(M,w,Q={}){var b={width:90,height:30,x:w.width/2+w.x,y:w.height/2+w.y};return H(M,fe(w),{box:b,fitBox:!0,style:N({},o.getExternalStyle(),{fill:JA(w,l,c,Q.stroke)})})}function d0(M,w,Q,b={}){var Y=l2(Q),S=H(M,w,{box:{height:30,width:Y?G2(Q,b):te(Q,b)},align:"center-middle",style:{fill:JA(Q,l,c,b.stroke)}});if(Y){var G=-1*G2(Q,b);mo(S,0,-G,270)}}function t0(M,w,Q={}){var{width:b,height:Y}=jA(w,Q);return h(M,b,Y,vo,{...Q,fill:B0(w,a,Q.fill),fillOpacity:Vn,stroke:L(w,c,Q.stroke)})}function G0(M,w,Q={}){var b=P(w),Y=B0(w,a,Q.fill),S=L(w,c,Q.stroke);return(b.get("associationDirection")==="One"||b.get("associationDirection")==="Both")&&(Q.markerEnd=E(M,"association-end",Y,S)),b.get("associationDirection")==="Both"&&(Q.markerStart=E(M,"association-start",Y,S)),Q=C0(Q,["markerStart","markerEnd"]),C(M,w.waypoints,{...Q,stroke:S,strokeDasharray:"0, 5"})}function u2(M,w,Q={}){var b=B0(w,a,Q.fill),Y=L(w,c,Q.stroke),S=A.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:.474,my:.296}}),G=m(M,S,{fill:b,fillOpacity:Vn,stroke:Y}),_=P(w);if(VM(_)){var s0=A.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:.33,my:(w.height-18)/w.height}});m(M,s0,{strokeWidth:2,fill:b,stroke:Y})}return G}function R0(M,w,Q={}){return u(M,w.width,w.height,{fillOpacity:Vn,...Q,fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)})}function r2(M,w,Q={}){return D(M,w.width,w.height,{fill:B0(w,a,Q.fill),fillOpacity:Vn,stroke:L(w,c,Q.stroke)})}function J(M,w,Q={}){var b=h(M,te(w,Q),G2(w,Q),0,{fill:B0(w,a,Q.fill),fillOpacity:Q.fillOpacity||Vn,stroke:L(w,c,Q.stroke),strokeWidth:1.5}),Y=P(w);if(f(Y,"bpmn:Lane")){var S=Y.get("name");d0(M,S,w,Q)}return b}function V(M,w,Q={}){var b=t0(M,w,Q),Y=E0(w);if(h2(w)&&(N2(b,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!Y)){var S=P(w).flowElements||[],G=S.filter(_=>f(_,"bpmn:StartEvent"));G.length===1&&Z(G[0],M,Q,w)}return K(M,w,Y?"center-top":"center-middle",Q),Y?T(M,w,void 0,Q):T(M,w,["SubProcessMarker"],Q),b}function Z(M,w,Q,b){var Y=22,S={fill:B0(b,a,Q.fill),stroke:L(b,c,Q.stroke),width:Y,height:Y},G=P(M).isInterrupting,_=G?0:3,s0=G?1:1.2,W0=20,j0=(Y-W0)/2,I0="translate("+j0+","+j0+")";u(w,W0,W0,{fill:S.fill,stroke:S.stroke,strokeWidth:s0,strokeDasharray:_,transform:I0}),z(M,w,S,b)}function u0(M,w,Q={}){var b=t0(M,w,Q);return K(M,w,"center-middle",Q),T(M,w,void 0,Q),b}var y2=this.handlers={"bpmn:AdHocSubProcess":function(M,w,Q={}){return E0(w)?Q=C0(Q,["fill","stroke","width","height"]):Q=C0(Q,["fill","stroke"]),V(M,w,Q)},"bpmn:Association":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),G0(M,w,Q)},"bpmn:BoundaryEvent":function(M,w,Q={}){var{renderIcon:b=!0}=Q;Q=C0(Q,["fill","stroke"]);var Y=P(w),S=Y.get("cancelActivity");Q={strokeWidth:1.5,fill:B0(w,a,Q.fill),fillOpacity:ZM,stroke:L(w,c,Q.stroke)},S||(Q.strokeDasharray="6");var G=R0(M,w,Q);return u(M,w.width,w.height,Fo,{...Q,fill:"none"}),b&&z(w,M,Q),G},"bpmn:BusinessRuleTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q),Y=A.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),S=m(M,Y);N2(S,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1});var G=A.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),_=m(M,G);return N2(_,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:CallActivity":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),V(M,w,{strokeWidth:5,...Q})},"bpmn:ComplexGateway":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=r2(M,w,Q),Y=A.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:w.width,containerHeight:w.height,position:{mx:.46,my:.26}});return m(M,Y,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:DataInput":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=A.getRawPath("DATA_ARROW"),Y=u2(M,w,Q);return m(M,b,{fill:"none",stroke:L(w,c,Q.stroke),strokeWidth:1}),Y},"bpmn:DataInputAssociation":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),G0(M,w,{...Q,markerEnd:E(M,"association-end",B0(w,a,Q.fill),L(w,c,Q.stroke))})},"bpmn:DataObject":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),u2(M,w,Q)},"bpmn:DataObjectReference":v("bpmn:DataObject"),"bpmn:DataOutput":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=A.getRawPath("DATA_ARROW"),Y=u2(M,w,Q);return m(M,b,{strokeWidth:1,fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke)}),Y},"bpmn:DataOutputAssociation":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),G0(M,w,{...Q,markerEnd:E(M,"association-end",B0(w,a,Q.fill),L(w,c,Q.stroke))})},"bpmn:DataStoreReference":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=A.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:w.width,containerHeight:w.height,position:{mx:0,my:.133}});return m(M,b,{fill:B0(w,a,Q.fill),fillOpacity:Vn,stroke:L(w,c,Q.stroke),strokeWidth:2})},"bpmn:EndEvent":function(M,w,Q={}){var{renderIcon:b=!0}=Q;Q=C0(Q,["fill","stroke"]);var Y=R0(M,w,{...Q,strokeWidth:4});return b&&z(w,M,Q),Y},"bpmn:EventBasedGateway":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=P(w),Y=r2(M,w,Q);u(M,w.width,w.height,w.height*.2,{fill:B0(w,"none",Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1});var S=b.get("eventGatewayType"),G=!!b.get("instantiate");function _(){var W0=A.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:w.width,containerHeight:w.height,position:{mx:.36,my:.44}});m(M,W0,{fill:"none",stroke:L(w,c,Q.stroke),strokeWidth:2})}if(S==="Parallel"){var s0=A.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:w.width,containerHeight:w.height,position:{mx:.474,my:.296}});m(M,s0,{fill:"none",stroke:L(w,c,Q.stroke),strokeWidth:1})}else S==="Exclusive"&&(G||u(M,w.width,w.height,w.height*.26,{fill:"none",stroke:L(w,c,Q.stroke),strokeWidth:1}),_());return Y},"bpmn:ExclusiveGateway":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=r2(M,w,Q),Y=A.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:w.width,containerHeight:w.height,position:{mx:.32,my:.3}}),S=Q0(w);return S.get("isMarkerVisible")&&m(M,Y,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:Gateway":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),r2(M,w,Q)},"bpmn:Group":function(M,w,Q={}){return Q=C0(Q,["fill","stroke","width","height"]),h(M,w.width,w.height,vo,{stroke:L(w,c,Q.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:te(w,Q),height:G2(w,Q)})},"bpmn:InclusiveGateway":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=r2(M,w,Q);return u(M,w.width,w.height,w.height*.24,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:2.5}),b},"bpmn:IntermediateEvent":function(M,w,Q={}){var{renderIcon:b=!0}=Q;Q=C0(Q,["fill","stroke"]);var Y=R0(M,w,{...Q,strokeWidth:1.5});return u(M,w.width,w.height,Fo,{fill:"none",stroke:L(w,c,Q.stroke),strokeWidth:1.5}),b&&z(w,M,Q),Y},"bpmn:IntermediateCatchEvent":v("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":v("bpmn:IntermediateEvent"),"bpmn:Lane":function(M,w,Q={}){return Q=C0(Q,["fill","stroke","width","height"]),J(M,w,{...Q,fillOpacity:qM})},"bpmn:ManualTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q),Y=A.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return m(M,Y,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:.5}),b},"bpmn:MessageFlow":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=P(w),Y=Q0(w),S=B0(w,a,Q.fill),G=L(w,c,Q.stroke),_=C(M,w.waypoints,{markerEnd:E(M,"messageflow-end",S,G),markerStart:E(M,"messageflow-start",S,G),stroke:G,strokeDasharray:"10, 11",strokeWidth:1.5});if(b.get("messageRef")){var s0=_.getPointAtLength(_.getTotalLength()/2),W0=A.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:s0.x,y:s0.y}}),j0={strokeWidth:1};Y.get("messageVisibleKind")==="initiating"?(j0.fill=S,j0.stroke=G):(j0.fill=G,j0.stroke=S);var I0=m(M,W0,j0),de=b.get("messageRef"),N0=de.get("name"),dt=H(M,N0,{align:"center-top",fitBox:!0,style:{fill:G}}),Xa=I0.getBBox(),K2=dt.getBBox(),c0=s0.x-K2.width/2,b0=s0.y+Xa.height/2+XM;mo(dt,c0,b0,0)}return _},"bpmn:ParallelGateway":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=r2(M,w,Q),Y=A.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:w.width,containerHeight:w.height,position:{mx:.46,my:.2}});return m(M,Y,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:Participant":function(M,w,Q={}){Q=C0(Q,["fill","stroke","width","height"]);var b=J(M,w,Q),Y=E0(w),S=l2(w),G=P(w),_=G.get("name");if(Y){var s0=S?[{x:30,y:0},{x:30,y:G2(w,Q)}]:[{x:0,y:30},{x:te(w,Q),y:30}];y(M,s0,{stroke:L(w,c,Q.stroke),strokeWidth:KM}),d0(M,_,w,Q)}else{var W0=jA(w,Q);S||(W0.height=te(w,Q),W0.width=G2(w,Q));var j0=H(M,_,{box:W0,align:"center-middle",style:{fill:JA(w,l,c,Q.stroke)}});if(!S){var I0=-1*G2(w,Q);mo(j0,0,-I0,270)}}return G.get("participantMultiplicity")&&k("ParticipantMultiplicityMarker",M,w,Q),b},"bpmn:ReceiveTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=P(w),Y=u0(M,w,Q),S;return b.get("instantiate")?(u(M,28,28,20*.22,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1}),S=A.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):S=A.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),m(M,S,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1}),Y},"bpmn:ScriptTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q),Y=A.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return m(M,Y,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:SendTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q),Y=A.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return m(M,Y,{fill:L(w,c,Q.stroke),stroke:B0(w,a,Q.fill),strokeWidth:1}),b},"bpmn:SequenceFlow":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=B0(w,a,Q.fill),Y=L(w,c,Q.stroke),S=C(M,w.waypoints,{markerEnd:E(M,"sequenceflow-end",b,Y),stroke:Y}),G=P(w),{source:_}=w;if(_){var s0=P(_);G.get("conditionExpression")&&f(s0,"bpmn:Activity")&&N2(S,{markerStart:E(M,"conditional-flow-marker",b,Y)}),s0.get("default")&&(f(s0,"bpmn:Gateway")||f(s0,"bpmn:Activity"))&&s0.get("default")===G&&N2(S,{markerStart:E(M,"conditional-default-flow-marker",b,Y)})}return S},"bpmn:ServiceTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q);u(M,10,10,{fill:B0(w,a,Q.fill),stroke:"none",transform:"translate(6, 6)"});var Y=A.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});m(M,Y,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1}),u(M,10,10,{fill:B0(w,a,Q.fill),stroke:"none",transform:"translate(11, 10)"});var S=A.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return m(M,S,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:1}),b},"bpmn:StartEvent":function(M,w,Q={}){var{renderIcon:b=!0}=Q;Q=C0(Q,["fill","stroke"]);var Y=P(w);Y.get("isInterrupting")||(Q={...Q,strokeDasharray:"6"});var S=R0(M,w,Q);return b&&z(w,M,Q),S},"bpmn:SubProcess":function(M,w,Q={}){return E0(w)?Q=C0(Q,["fill","stroke","width","height"]):Q=C0(Q,["fill","stroke"]),V(M,w,Q)},"bpmn:Task":function(M,w,Q={}){return Q=C0(Q,["fill","stroke"]),u0(M,w,Q)},"bpmn:TextAnnotation":function(M,w,Q={}){Q=C0(Q,["fill","stroke","width","height"]);var{width:b,height:Y}=jA(w,Q),S=h(M,b,Y,0,0,{fill:"none",stroke:"none"}),G=A.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:b,containerHeight:Y,position:{mx:0,my:0}});m(M,G,{stroke:L(w,c,Q.stroke)});var _=P(w),s0=_.get("text")||"";return H(M,s0,{align:"left-top",box:jA(w,Q),padding:7,style:{fill:JA(w,l,c,Q.stroke)}}),S},"bpmn:Transaction":function(M,w,Q={}){E0(w)?Q=C0(Q,["fill","stroke","width","height"]):Q=C0(Q,["fill","stroke"]);var b=V(M,w,{strokeWidth:1.5,...Q}),Y=n.style(["no-fill","no-events"],{stroke:L(w,c,Q.stroke),strokeWidth:1.5}),S=E0(w);return S||(Q={}),h(M,te(w,Q),G2(w,Q),vo-Fo,Fo,Y),b},"bpmn:UserTask":function(M,w,Q={}){Q=C0(Q,["fill","stroke"]);var b=u0(M,w,Q),Y=15,S=12,G=A.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:Y,y:S}});m(M,G,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:.5});var _=A.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:Y,y:S}});m(M,_,{fill:B0(w,a,Q.fill),stroke:L(w,c,Q.stroke),strokeWidth:.5});var s0=A.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:Y,y:S}});return m(M,s0,{fill:L(w,c,Q.stroke),stroke:L(w,c,Q.stroke),strokeWidth:.5}),b},label:function(M,w,Q={}){return x0(M,w,Q)}};this._drawPath=m,this._renderer=x}W(cn,be),cn.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],cn.prototype.canRender=function(e){return f(e,"bpmn:BaseElement")},cn.prototype.drawShape=function(e,t,n={}){var{type:A}=t,i=this._renderer(A);return i(e,t,n)},cn.prototype.drawConnection=function(e,t,n={}){var{type:A}=t,i=this._renderer(A);return i(e,t,n)},cn.prototype.getShapePath=function(e){return f(e,"bpmn:Event")?LM(e):f(e,"bpmn:Activity")?Cg(e,vo):f(e,"bpmn:Gateway")?WM(e):_M(e)};function C0(e,t=[]){return t.reduce((n,A)=>(e[A]&&(n[A]=e[A]),n),{})}var $M=0,e5={width:150,height:50};function t5(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function n5(e){return V0(e)?N({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function A5(e,t){t.textContent=e;var n;try{var A,i=e==="";return t.textContent=i?"dummy":e,n=t.getBBox(),A={width:n.width+n.x*2,height:n.height},i&&(A.width=0),A}catch(o){return console.log(o),{width:0,height:0}}}function i5(e,t,n){for(var A=e.shift(),i=A,o;;){if(o=A5(i,n),o.width=i?o.width:0,i===" "||i===""||o.width<Math.round(t)||i.length<2)return o5(e,i,A,o);i=a5(i,o.width,t)}}function o5(e,t,n,A){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:A.width,height:A.height,text:t}}var Mg="­";function r5(e,t){var n=e.split(/(\s|-|\u00AD)/g),A,i=[],o=0;if(n.length>1)for(;A=n.shift();)if(A.length+o<t)i.push(A),o+=A.length;else{(A==="-"||A===Mg)&&i.pop();break}var r=i[i.length-1];return r&&r===Mg&&(i[i.length-1]="-"),i.join("")}function a5(e,t,n){var A=Math.max(e.length*(n/t),1),i=r5(e,A);return i||(i=e.slice(0,Math.max(Math.round(A-1),1))),i}function c5(){var e=document.getElementById("helper-svg");return e||(e=g0("svg"),q(e,{id:"helper-svg"}),m2(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}function xo(e){this._config=N({},{size:e5,padding:$M,style:{},align:"center-top"},e||{})}xo.prototype.createText=function(e,t){return this.layoutText(e,t).element},xo.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},xo.prototype.layoutText=function(e,t){var n=N({},this._config.size,t.box),A=N({},this._config.style,t.style),i=t5(t.align||this._config.align),o=n5(t.padding!==void 0?t.padding:this._config.padding),r=t.fitBox||!1,a=s5(A),c=e.split(/\u00AD?\r?\n/),l=[],B=n.width-o.left-o.right,g=g0("text");q(g,{x:0,y:0}),q(g,A);var p=c5();for(h0(p,g);c.length;)l.push(i5(c,B,g));i.vertical==="middle"&&(o.top=o.bottom=0);var E=F2(l,function(y,C,m){return y+(a||C.height)},0)+o.top+o.bottom,d=F2(l,function(y,C,m){return C.width>y?C.width:y},0),u=o.top;i.vertical==="middle"&&(u+=(n.height-E)/2),u-=(a||l[0].height)/4;var h=g0("text");q(h,A),U(l,function(y){var C;switch(u+=a||y.height,i.horizontal){case"left":C=o.left;break;case"right":C=(r?d:B)-o.right-y.width;break;default:C=Math.max(((r?d:B)-y.width)/2+o.left,0)}var m=g0("tspan");q(m,{x:C,y:u}),m.textContent=y.text,h0(h,m)}),s2(g);var D={width:d,height:E};return{dimensions:D,element:h}};function s5(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var l5=12,B5=1.2,g5=30;function Dg(e){var t=N({fontFamily:"Arial, sans-serif",fontSize:l5,fontWeight:"normal",lineHeight:B5},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,A=N({},t,{fontSize:n},e&&e.externalStyle||{}),i=new xo({style:t});this.getExternalLabelBounds=function(o,r){var a=i.getDimensions(r,{box:{width:90,height:30},style:A});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,r){var a=i.getDimensions(r,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(g5,Math.round(a.height))}},this.createText=function(o,r){return i.createText(o,r||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return A}}Dg.$inject=["config.textRenderer"];function p5(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var A=this.pathMap[t],i,o;n.abspos?(i=n.abspos.x,o=n.abspos.y):(i=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var r={};if(n.position){for(var a=n.containerHeight/A.height*n.yScaleFactor,c=n.containerWidth/A.width*n.xScaleFactor,l=0;l<A.heightElements.length;l++)r["y"+l]=A.heightElements[l]*a;for(var B=0;B<A.widthElements.length;B++)r["x"+B]=A.widthElements[B]*c}var g=Q5(A.d,{mx:i,my:o,e:r});return g}}var E5=/\{([^{}]+)\}/g,d5=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function u5(e,t,n){var A=n;return t.replace(d5,function(i,o,r,a,c){o=o||a,A&&(o in A&&(A=A[o]),typeof A=="function"&&c&&(A=A()))}),A=(A==null||A==n?e:A)+"",A}function Q5(e,t){return String(e).replace(E5,function(n,A){return u5(n,A,t)})}const h5={__init__:["bpmnRenderer"],bpmnRenderer:["type",cn],textRenderer:["type",Dg],pathMap:["type",p5]};function w5(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,A){return t[A]||"{"+A+"}"})}const bo={translate:["value",w5]};function Yo(e,t,n){return N({id:e.id,type:e.$type,businessObject:e,di:t},n)}function m5(e,t,n){var A=e.waypoint;return!A||A.length<2?[i0(t),i0(n)]:A.map(function(i){return{x:i.x,y:i.y}})}function yg(e,t,n){return new Error(`element ${M2(t)} referenced by ${M2(e)}#${n} not yet drawn`)}function Ke(e,t,n,A,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=A,this._textRenderer=i}Ke.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],Ke.prototype.add=function(e,t,n){var A,i,o;if(f(t,"bpmndi:BPMNPlane")){var r=f(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};A=this._elementFactory.createRoot(Yo(e,t,r)),this._canvas.addRootElement(A)}else if(f(t,"bpmndi:BPMNShape")){var a=!E0(e,t),c=C5(e);i=n&&(n.hidden||n.collapsed);var l=t.bounds;A=this._elementFactory.createShape(Yo(e,t,{collapsed:a,hidden:i,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:c})),f(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,A),f(e,"bpmn:Lane")&&(o=0),f(e,"bpmn:DataStoreReference")&&(f5(n,i0(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(A,n,o)}else if(f(t,"bpmndi:BPMNEdge")){var B=this._getSource(e),g=this._getTarget(e);i=n&&(n.hidden||n.collapsed),A=this._elementFactory.createConnection(Yo(e,t,{hidden:i,source:B,target:g,waypoints:m5(t,B,g)})),f(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(A,n,o)}else throw new Error(`unknown di ${M2(t)} for element ${M2(e)}`);return an(e)&&fe(A)&&this.addLabel(e,t,A),this._eventBus.fire("bpmnElement.added",{element:A}),A},Ke.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${M2(e)}#attachedToRef`);var A=this._elementRegistry.get(n.id),i=A&&A.attachers;if(!A)throw yg(e,n,"attachedToRef");t.host=A,i||(A.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)},Ke.prototype.addLabel=function(e,t,n){var A,i,o;return A=GM(t,n),i=fe(n),i&&(A=this._textRenderer.getExternalLabelBounds(A,i)),o=this._elementFactory.createLabel(Yo(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!fe(n),x:Math.round(A.x),y:Math.round(A.y),width:Math.round(A.width),height:Math.round(A.height)})),this._canvas.addShape(o,n.parent)},Ke.prototype._getConnectedElement=function(e,t){var n,A,i=e.$type;if(A=e[t+"Ref"],t==="source"&&i==="bpmn:DataInputAssociation"&&(A=A&&A[0]),(t==="source"&&i==="bpmn:DataOutputAssociation"||t==="target"&&i==="bpmn:DataInputAssociation")&&(A=e.$parent),n=A&&this._getElement(A),n)return n;throw A?yg(e,A,t+"Ref"):new Error(`${M2(e)}#${t} Ref not specified`)},Ke.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Ke.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Ke.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function f5(e,t){var n=t.x,A=t.y;return n>=e.x&&n<=e.x+e.width&&A>=e.y&&A<=e.y+e.height}function C5(e){return f(e,"bpmn:Group")}const M5={__depends__:[h5,{__depends__:[bo],bpmnImporter:["type",Ke]}]};function VA(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}VA.prototype.next=function(){return this._prefix+ ++this._counter};var D5=new VA("ov"),y5=500;function p2(e,t,n,A){this._eventBus=t,this._canvas=n,this._elementRegistry=A,this._ids=D5,this._overlayDefaults=N({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=I5(n.getContainer()),this._init()}p2.$inject=["config.overlays","eventBus","canvas","elementRegistry"],p2.prototype.get=function(e){if(U2(e)&&(e={id:e}),U2(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?l0(t.overlays,Z2({type:e.type})):t.overlays.slice():[]}else return e.type?l0(this._overlays,Z2({type:e.type})):e.id?this._overlays[e.id]:null},p2.prototype.add=function(e,t,n){if(V0(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var A=this._ids.next();return n=N({},this._overlayDefaults,n,{id:A,type:t,element:e,html:n.html}),this._addOverlay(n),A},p2.prototype.remove=function(e){var t=this.get(e)||[];n0(t)||(t=[t]);var n=this;U(t,function(A){var i=n._getOverlayContainer(A.element,!0);if(A&&(xe(A.html),xe(A.htmlContainer),delete A.htmlContainer,delete A.element,delete n._overlays[A.id]),i){var o=i.overlays.indexOf(A);o!==-1&&i.overlays.splice(o,1)}})},p2.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},p2.prototype.show=function(){Uo(this._overlayRoot)},p2.prototype.hide=function(){Uo(this._overlayRoot,!1)},p2.prototype.clear=function(){this._overlays={},this._overlayContainers=[],vA(this._overlayRoot)},p2.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,A=t.x,i=t.y;if(t.waypoints){var o=i2(t);A=o.x,i=o.y}Ig(n,A,i),g2(e.html,"data-container-id",t.id)},p2.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,A=e.element,i=t.left,o=t.top;if(t.right!==void 0){var r;A.waypoints?r=i2(A).width:r=A.width,i=t.right*-1+r}if(t.bottom!==void 0){var a;A.waypoints?a=i2(A).height:a=A.height,o=t.bottom*-1+a}Ig(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},p2.prototype._createOverlayContainer=function(e){var t=$('<div class="djs-overlays" />');m2(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},p2.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Fg(this._overlayRoot,n)},p2.prototype._getOverlayContainer=function(e,t){var n=m0(this._overlayContainers,function(A){return A.element===e});return!n&&!t?this._createOverlayContainer(e):n},p2.prototype._addOverlay=function(e){var t=e.id,n=e.element,A=e.html,i,o;A.get&&A.constructor.prototype.jquery&&(A=A.get(0)),U2(A)&&(A=$(A)),o=this._getOverlayContainer(n),i=$('<div class="djs-overlay" data-overlay-id="'+t+'">'),m2(i,{position:"absolute"}),i.appendChild(A),e.type&&X(i).add("djs-overlay-"+e.type);var r=this._canvas.findRoot(n),a=this._canvas.getRootElement();Uo(i,r===a),e.htmlContainer=i,o.overlays.push(e),o.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},p2.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,A=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,r=e.htmlContainer,a=this._canvas.getRootElement(),c=!0;(A!==a||n&&(a2(i)&&i>t.scale||a2(o)&&o<t.scale))&&(c=!1),Uo(r,c),this._updateOverlayScale(e,t)},p2.prototype._updateOverlayScale=function(e,t){var n=e.scale,A,i,o=e.htmlContainer,r,a="";n!==!0&&(n===!1?(A=1,i=1):(A=n.min,i=n.max),a2(A)&&t.scale<A&&(r=(1/t.scale||1)*A),a2(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),a2(r)&&(a="scale("+r+","+r+")"),Fg(o,a)},p2.prototype._updateOverlaysVisibilty=function(e){var t=this;U(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},p2.prototype._init=function(){var e=this._eventBus,t=this;function n(A){t._updateRoot(A),t._updateOverlaysVisibilty(A),t.show()}e.on("canvas.viewbox.changing",function(A){t.hide()}),e.on("canvas.viewbox.changed",function(A){n(A.viewbox)}),e.on(["shape.remove","connection.remove"],function(A){var i=A.element,o=t.get({element:i});U(o,function(c){t.remove(c.id)});var r=t._getOverlayContainer(i);if(r){xe(r.html);var a=t._overlayContainers.indexOf(r);a!==-1&&t._overlayContainers.splice(a,1)}}),e.on("element.changed",y5,function(A){var i=A.element,o=t._getOverlayContainer(i,!0);o&&(U(o.overlays,function(r){t._updateOverlay(r)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(A){var i=t._getOverlayContainer(A.element,!0);i&&X(i.html)[A.add?"add":"remove"](A.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function I5(e){var t=$('<div class="djs-overlay-container" />');return m2(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Ig(e,t,n){m2(e,{left:t+"px",top:n+"px"})}function Uo(e,t){e.style.display=t===!1?"none":""}function Fg(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}const No={__init__:["overlays"],overlays:["type",p2]};function vg(e,t,n,A){e.on("element.changed",function(i){var o=i.element;(o.parent||o===t.getRootElement())&&(i.gfx=n.getGraphics(o)),i.gfx&&e.fire(wB(o)+".changed",i)}),e.on("elements.changed",function(i){var o=i.elements;o.forEach(function(r){e.fire("element.changed",{element:r})}),A.updateContainments(o)}),e.on("shape.changed",function(i){A.update("shape",i.element,i.gfx)}),e.on("connection.changed",function(i){A.update("connection",i.element,i.gfx)})}vg.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const Rc={__init__:["changeSupport"],changeSupport:["type",vg]};var F5=1e3;function j(e){this._eventBus=e}j.$inject=["eventBus"];function v5(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}j.prototype.on=function(e,t,n,A,i,o){if((n2(t)||A0(t))&&(o=i,i=A,A=n,n=t,t=null),n2(n)&&(o=i,i=A,A=n,n=F5),V0(i)&&(o=i,i=!1),!n2(A))throw new Error("handlerFn must be a function");n0(e)||(e=[e]);var r=this._eventBus;U(e,function(a){var c=["commandStack",a,t].filter(function(l){return l}).join(".");r.on(c,n,i?v5(A,o):A,o)})},j.prototype.canExecute=Ze("canExecute"),j.prototype.preExecute=Ze("preExecute"),j.prototype.preExecuted=Ze("preExecuted"),j.prototype.execute=Ze("execute"),j.prototype.executed=Ze("executed"),j.prototype.postExecute=Ze("postExecute"),j.prototype.postExecuted=Ze("postExecuted"),j.prototype.revert=Ze("revert"),j.prototype.reverted=Ze("reverted");function Ze(e){return function(n,A,i,o,r){(n2(n)||A0(n))&&(r=o,o=i,i=A,A=n,n=null),this.on(n,e,A,i,o,r)}}function Sc(e,t){t.invoke(j,this),this.executed(function(n){var A=n.context;A.rootElement?e.setRootElement(A.rootElement):A.rootElement=e.getRootElement()}),this.revert(function(n){var A=n.context;A.rootElement&&e.setRootElement(A.rootElement)})}W(Sc,j),Sc.$inject=["canvas","injector"];const x5={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Sc]};function LA(e){return CSS.escape(e)}var b5={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function qe(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return b5[t]})}var xg="_plane";function bg(e){var t=e.id;return Y5(t)}function $e(e){var t=e.id;return f(e,"bpmn:SubProcess")?Yg(t):t}function sn(e){return Yg(e)}function zo(e){var t=Q0(e);return f(t,"bpmndi:BPMNPlane")}function Yg(e){return e+xg}function Y5(e){return e.replace(new RegExp(xg+"$"),"")}var U5="bjs-breadcrumbs-shown";function Ug(e,t,n){var A=$('<ul class="bjs-breadcrumbs"></ul>'),i=n.getContainer(),o=X(i);i.appendChild(A);var r=[];e.on("element.changed",function(c){var l=c.element,B=P(l),g=m0(r,function(p){return p===B});g&&a()});function a(c){c&&(r=N5(c));var l=r.flatMap(function(g){var p=n.findRoot($e(g))||n.findRoot(g.id);if(!p&&f(g,"bpmn:Process")){var E=t.find(function(h){var D=P(h);return D&&D.get("processRef")===g});p=E&&n.findRoot(E.id)}if(!p)return[];var d=qe(g.name||g.id),u=$('<li><span class="bjs-crumb"><a title="'+d+'">'+d+"</a></span></li>");return u.addEventListener("click",function(){n.setRootElement(p)}),u});A.innerHTML="";var B=l.length>1;o.toggle(U5,B),l.forEach(function(g){A.appendChild(g)})}e.on("root.set",function(c){a(c.element)})}Ug.$inject=["eventBus","elementRegistry","canvas"];function N5(e){for(var t=P(e),n=[],A=t;A;A=A.$parent)(f(A,"bpmn:SubProcess")||f(A,"bpmn:Process"))&&n.push(A);return n.reverse()}function Ng(e,t){var n=null,A=new z5;e.on("root.set",function(i){var o=i.element,r=t.viewbox(),a=A.get(o);if(A.set(n,{x:r.x,y:r.y,zoom:r.scale}),n=o,!(!f(o,"bpmn:SubProcess")&&!a)){a=a||{x:0,y:0,zoom:1};var c=(r.x-a.x)*r.scale,l=(r.y-a.y)*r.scale;(c!==0||l!==0)&&t.scroll({dx:c,dy:l}),a.zoom!==r.scale&&t.zoom(a.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){A.clear(),n=null})}Ng.$inject=["eventBus","canvas"];function z5(){this._entries=[],this.set=function(e,t){var n=!1;for(var A in this._entries)if(this._entries[A][0]===e){this._entries[A][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var zg={x:180,y:160};function ln(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(A,i){n._handleImport(i.definitions)})}ln.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(A){!A.plane||!A.plane.bpmnElement||(t._processToDiagramMap[A.plane.bpmnElement.id]=A)});var n=e.diagrams.filter(A=>A.plane).flatMap(A=>t._createNewDiagrams(A.plane));n.forEach(function(A){t._movePlaneElementsToOrigin(A.plane)})}},ln.prototype._createNewDiagrams=function(e){var t=this,n=[],A=[];e.get("planeElement").forEach(function(o){var r=o.bpmnElement;if(r){var a=r.$parent;f(r,"bpmn:SubProcess")&&!o.isExpanded&&n.push(r),S5(r,e)&&A.push({diElement:o,parent:a})}});var i=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var r=t._createDiagram(o);t._processToDiagramMap[o.id]=r,i.push(r)}}),A.forEach(function(o){for(var r=o.diElement,a=o.parent;a&&n.indexOf(a)===-1;)a=a.$parent;if(a){var c=t._processToDiagramMap[a.id];t._moveToDiPlane(r,c.plane)}}),i},ln.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=R5(e),A={x:n.x-zg.x,y:n.y-zg.y};t.forEach(function(i){i.waypoint?i.waypoint.forEach(function(o){o.x=o.x-A.x,o.y=o.y-A.y}):i.bounds&&(i.bounds.x=i.bounds.x-A.x,i.bounds.y=i.bounds.y-A.y)})},ln.prototype._moveToDiPlane=function(e,t){var n=Rg(e),A=n.plane.get("planeElement");A.splice(A.indexOf(e),1),t.get("planeElement").push(e)},ln.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},ln.$inject=["eventBus","moddle"];function Rg(e){return f(e,"bpmndi:BPMNDiagram")?e:Rg(e.$parent)}function R5(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var A=e0(n.bounds);t.top=Math.min(A.top,t.top),t.left=Math.min(A.left,t.left)}}),Qo(t)}function S5(e,t){var n=e.$parent;return!(!f(n,"bpmn:SubProcess")||n===t.bpmnElement||a0(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Ro=250,T5='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>',k5="bjs-drilldown-empty";function Ft(e,t,n,A,i){j.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=A,this._translate=i;var o=this;this.executed("shape.toggleCollapse",Ro,function(r){var a=r.shape;o._canDrillDown(a)?o._addOverlay(a):o._removeOverlay(a)},!0),this.reverted("shape.toggleCollapse",Ro,function(r){var a=r.shape;o._canDrillDown(a)?o._addOverlay(a):o._removeOverlay(a)},!0),this.executed(["shape.create","shape.move","shape.delete"],Ro,function(r){var a=r.oldParent,c=r.newParent||r.parent,l=r.shape;o._canDrillDown(l)&&o._addOverlay(l),o._updateDrilldownOverlay(a),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(l)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Ro,function(r){var a=r.oldParent,c=r.newParent||r.parent,l=r.shape;o._canDrillDown(l)&&o._addOverlay(l),o._updateDrilldownOverlay(a),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(l)},!0),t.on("import.render.complete",function(){n.filter(function(r){return o._canDrillDown(r)}).map(function(r){o._addOverlay(r)})})}W(Ft,j),Ft.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Ft.prototype._canDrillDown=function(e){var t=this._canvas;return f(e,"bpmn:SubProcess")&&t.findRoot($e(e))},Ft.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=P(e),A=t.get({element:n.id,type:"drilldown"})[0];if(A){var i=n&&n.get("flowElements")&&n.get("flowElements").length;X(A.html).toggle(k5,!i)}},Ft.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,A=P(e),i=n.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var o=$('<button type="button" class="bjs-drilldown">'+T5+"</button>"),r=A.get("name")||A.get("id"),a=this._translate("Open {element}",{element:r});o.setAttribute("title",a),o.addEventListener("click",function(){t.setRootElement(t.findRoot($e(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)},Ft.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})},Ft.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];const G5={__depends__:[No,Rc,x5],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Ug],drilldownCentering:["type",Ng],drilldownOverlayBehavior:["type",Ft],subprocessCompatibility:["type",ln]};function Sg(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function Ln(e){return e.originalEvent||e.srcEvent}function Tc(e){Sg(e),Sg(Ln(e))}function Bn(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Tg(){return/mac/i.test(navigator.platform)}function kg(e,t){return(Ln(e)||e).button===t}function vt(e){return kg(e,0)}function H5(e){return kg(e,1)}function Wn(e){var t=Ln(e)||e;return vt(e)?Tg()?t.metaKey:t.ctrlKey:!1}function So(e){var t=Ln(e)||e;return vt(e)&&t.shiftKey}function P5(e){return!0}function To(e){return vt(e)||H5(e)}var Gg=500;function Hg(e,t,n){var A=this;function i(F,z,R){if(!a(F,z)){var k,T,H;R?T=t.getGraphics(R):(k=z.delegateTarget||z.target,k&&(T=k,R=t.get(T))),!(!T||!R)&&(H=e.fire(F,{element:R,gfx:T,originalEvent:z}),H===!1&&(z.stopPropagation(),z.preventDefault()))}}var o={};function r(F){return o[F]}function a(F,z){var R=l[F]||vt;return!R(z)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":P5,"element.mousedown":To,"element.mouseup":To,"element.click":To,"element.dblclick":To};function B(F,z,R){var k=c[F];if(!k)throw new Error("unmapped DOM event name <"+F+">");return i(k,z,R)}var g="svg, .djs-element";function p(F,z,R,k){var T=o[R]=function(H){i(R,H)};k&&(l[R]=k),T.$delegate=x2.bind(F,g,z,T)}function E(F,z,R){var k=r(R);k&&x2.unbind(F,z,k.$delegate)}function d(F){U(c,function(z,R){p(F,R,z)})}function u(F){U(c,function(z,R){E(F,R,z)})}e.on("canvas.destroy",function(F){u(F.svg)}),e.on("canvas.init",function(F){d(F.svg)}),e.on(["shape.added","connection.added"],function(F){var z=F.element,R=F.gfx;e.fire("interactionEvents.createHit",{element:z,gfx:R})}),e.on(["shape.changed","connection.changed"],Gg,function(F){var z=F.element,R=F.gfx;e.fire("interactionEvents.updateHit",{element:z,gfx:R})}),e.on("interactionEvents.createHit",Gg,function(F){var z=F.element,R=F.gfx;A.createDefaultHit(z,R)}),e.on("interactionEvents.updateHit",function(F){var z=F.element,R=F.gfx;A.updateDefaultHit(z,R)});var h=I("djs-hit djs-hit-stroke"),D=I("djs-hit djs-hit-click-stroke"),y=I("djs-hit djs-hit-all"),C=I("djs-hit djs-hit-no-move"),m={all:y,"click-stroke":D,stroke:h,"no-move":C};function I(F,z){return z=N({stroke:"white",strokeWidth:15},z||{}),n.cls(F,["no-fill","no-border"],z)}function x(F,z){var R=m[z];if(!R)throw new Error("invalid hit type <"+z+">");return q(F,R),F}function v(F,z){h0(F,z)}this.removeHits=function(F){var z=Le(".djs-hit",F);U(z,s2)},this.createDefaultHit=function(F,z){var R=F.waypoints,k=F.isFrame,T;return R?this.createWaypointsHit(z,R):(T=k?"stroke":"all",this.createBoxHit(z,T,{width:F.width,height:F.height}))},this.createWaypointsHit=function(F,z){var R=lo(z);return x(R,"stroke"),v(F,R),R},this.createBoxHit=function(F,z,R){R=N({x:0,y:0},R);var k=g0("rect");return x(k,z),q(k,R),v(F,k),k},this.updateDefaultHit=function(F,z){var R=p0(".djs-hit",z);if(R)return F.waypoints?dB(R,F.waypoints):q(R,{width:F.width,height:F.height}),R},this.fire=i,this.triggerMouseEvent=B,this.mouseHandler=r,this.registerEvent=p,this.unregisterEvent=E}Hg.$inject=["eventBus","elementRegistry","styles"];const ko={__init__:["interactionEvents"],interactionEvents:["type",Hg]};function _n(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(A){var i=A.element;n.deselect(i)}),e.on(["diagram.clear","root.set"],function(A){n.select(null)})}_n.$inject=["eventBus","canvas"],_n.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var A=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:A,newSelection:t})}},_n.prototype.get=function(){return this._selectedElements},_n.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},_n.prototype.select=function(e,t){var n=this._selectedElements,A=n.slice();n0(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter(function(r){var a=i.findRoot(r);return o===a}),t?U(e,function(r){n.indexOf(r)===-1&&n.push(r)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:A,newSelection:n})};var Pg="hover",Jg="selected";function jg(e,t){this._canvas=e;function n(i,o){e.addMarker(i,o)}function A(i,o){e.removeMarker(i,o)}t.on("element.hover",function(i){n(i.element,Pg)}),t.on("element.out",function(i){A(i.element,Pg)}),t.on("selection.changed",function(i){function o(l){A(l,Jg)}function r(l){n(l,Jg)}var a=i.oldSelection,c=i.newSelection;U(a,function(l){c.indexOf(l)===-1&&o(l)}),U(c,function(l){a.indexOf(l)===-1&&r(l)})})}jg.$inject=["canvas","eventBus"];function Vg(e,t,n,A){e.on("create.end",500,function(i){var o=i.context,r=o.canExecute,a=o.elements,c=o.hints||{},l=c.autoSelect;if(r){if(l===!1)return;n0(l)?t.select(l):t.select(a.filter(J5))}}),e.on("connect.end",500,function(i){var o=i.context,r=o.connection;r&&t.select(r)}),e.on("shape.move.end",500,function(i){var o=i.previousSelection||[],r=A.get(i.context.shape.id),a=m0(o,function(c){return r.id===c.id});a||t.select(r)}),e.on("element.click",function(i){if(vt(i)){var o=i.element;o===n.getRootElement()&&(o=null);var r=t.isSelected(o),a=t.get().length>1,c=So(i);if(r&&a)return c?t.deselect(o):t.select(o);r?t.deselect(o):t.select(o,c)}})}Vg.$inject=["eventBus","selection","canvas","elementRegistry"];function J5(e){return!e.hidden}const Ce={__init__:["selectionVisuals","selectionBehavior"],__depends__:[ko],selection:["type",_n],selectionVisuals:["type",jg],selectionBehavior:["type",Vg]};function et(e){H0.call(this,e)}W(et,H0),et.prototype._modules=[M5,G5,No,Ce,bo],et.prototype._moddleExtensions={};var j5=["c","C"],V5=["v","V"],L5=["y","Y"],Lg=["z","Z"];function W5(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function ne(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function E2(e,t){return e=n0(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function kc(e){return e.shiftKey}function _5(e){return ne(e)&&E2(j5,e)}function O5(e){return ne(e)&&E2(V5,e)}function X5(e){return ne(e)&&!kc(e)&&E2(Lg,e)}function K5(e){return ne(e)&&(E2(L5,e)||E2(Lg,e)&&kc(e))}var Go="keyboard.keydown",Z5="keyboard.keyup",q5=1e3,Wg="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function Y2(e,t){var n=this;this._config=e=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(Wg));var A=e&&e.bind!==!1;t.on("canvas.init",function(i){n._target=i.svg,A&&n.bind(),n._fire("init")})}Y2.$inject=["config.keyboard","eventBus"],Y2.prototype._keydownHandler=function(e){this._keyHandler(e,Go)},Y2.prototype._keyupHandler=function(e){this._keyHandler(e,Z5)},Y2.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var A={keyEvent:e};n=this._eventBus.fire(t||Go,A),n&&e.preventDefault()}},Y2.prototype._isEventIgnored=function(e){return!1},Y2.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(Wg)),this.unbind(),e=this._node=this._target,O.bind(e,"keydown",this._keydownHandler),O.bind(e,"keyup",this._keyupHandler),this._fire("bind")},Y2.prototype.getBinding=function(){return this._node},Y2.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),O.unbind(e,"keydown",this._keydownHandler),O.unbind(e,"keyup",this._keyupHandler)),this._node=null},Y2.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Y2.prototype.addListener=function(e,t,n){n2(e)&&(n=t,t=e,e=q5),this._eventBus.on(n||Go,e,t)},Y2.prototype.removeListener=function(e,t){this._eventBus.off(t||Go,e)},Y2.prototype.hasModifier=W5,Y2.prototype.isCmd=ne,Y2.prototype.isShift=kc,Y2.prototype.isKey=E2;var $5=500;function On(e,t){var n=this;e.on("editorActions.init",$5,function(A){var i=A.editorActions;n.registerBindings(t,i)})}On.$inject=["eventBus","keyboard"],On.prototype.registerBindings=function(e,t){function n(A,i){t.isRegistered(A)&&e.addListener(i)}n("undo",function(A){var i=A.keyEvent;if(X5(i))return t.trigger("undo"),!0}),n("redo",function(A){var i=A.keyEvent;if(K5(i))return t.trigger("redo"),!0}),n("copy",function(A){var i=A.keyEvent;if(_5(i))return t.trigger("copy"),!0}),n("paste",function(A){var i=A.keyEvent;if(O5(i))return t.trigger("paste"),!0}),n("stepZoom",function(A){var i=A.keyEvent;if(E2(["+","Add","="],i)&&ne(i))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(A){var i=A.keyEvent;if(E2(["-","Subtract"],i)&&ne(i))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(A){var i=A.keyEvent;if(E2("0",i)&&ne(i))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(A){var i=A.keyEvent;if(E2(["Backspace","Delete","Del"],i))return t.trigger("removeSelection"),!0})};const Gc={__init__:["keyboard","keyboardBindings"],keyboard:["type",Y2],keyboardBindings:["type",On]};var eD={moveSpeed:50,moveSpeedAccelerated:200};function _g(e,t,n){var A=this;this._config=N({},eD,e||{}),t.addListener(i);function i(o){var r=o.keyEvent,a=A._config;if(t.isCmd(r)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],r)){var c=t.isShift(r)?a.moveSpeedAccelerated:a.moveSpeed,l;switch(r.key){case"ArrowLeft":case"Left":l="left";break;case"ArrowUp":case"Up":l="up";break;case"ArrowRight":case"Right":l="right";break;case"ArrowDown":case"Down":l="down";break}return A.moveCanvas({speed:c,direction:l}),!0}}this.moveCanvas=function(o){var r=0,a=0,c=o.speed,l=c/Math.min(Math.sqrt(n.viewbox().scale),1);switch(o.direction){case"left":r=l;break;case"up":a=l;break;case"right":r=-l;break;case"down":a=-l;break}n.scroll({dx:r,dy:a})}}_g.$inject=["config.keyboardMove","keyboard","canvas"];const Og={__depends__:[Gc],__init__:["keyboardMove"],keyboardMove:["type",_g]};var tD=/^djs-cursor-.*$/;function Ho(e){var t=X(document.body);t.removeMatching(tD),e&&t.add("djs-cursor-"+e)}function Xg(){Ho(null)}var nD=5e3;function Kg(e,t){t=t||"element.click";function n(){return!1}return e.once(t,nD,n),function(){e.off(t,n)}}function WA(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Me(e,t){return{x:e.x-t.x,y:e.y-t.y}}var AD=15;function Zg(e,t){var n;function A(a){return r(a.originalEvent)}e.on("canvas.focus.changed",function(a){a.focused?e.on("element.mousedown",500,A):e.off("element.mousedown",A)});function i(a){var c=n.start,l=n.button,B=Bn(a),g=Me(B,c);if(!n.dragging&&iD(g)>AD&&(n.dragging=!0,l===0&&Kg(e),Ho("grab")),n.dragging){var p=n.last||n.start;g=Me(B,p),t.scroll({dx:g.x,dy:g.y}),n.last=B}a.preventDefault()}function o(a){O.unbind(document,"mousemove",i),O.unbind(document,"mouseup",o),n=null,Xg()}function r(a){if(!Sn(a.target,".djs-draggable")){var c=a.button;if(!(c>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:c,start:Bn(a)},O.bind(document,"mousemove",i),O.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!n}}Zg.$inject=["eventBus","canvas"];function iD(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}const Hc={__init__:["moveCanvas"],moveCanvas:["type",Zg]};function Pc(e){return Math.log(e)/Math.log(10)}function qg(e,t){var n=Pc(e.min),A=Pc(e.max),i=Math.abs(n)+Math.abs(A);return i/t}function oD(e,t){return Math.max(e.min,Math.min(e.max,t))}var rD=Math.sign||function(e){return e>=0?1:-1},Jc={min:.2,max:4},$g=10,aD=.1,cD=.75;function Se(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=v2(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||cD;var A=this;t.on("canvas.focus.changed",function(i){A._init(i.focused&&e.enabled!==!1)})}Se.$inject=["config.zoomScroll","eventBus","canvas"],Se.prototype.scroll=function(t){this._canvas.scroll(t)},Se.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Se.prototype.zoom=function(t,n){var A=qg(Jc,$g*2);this._totalDelta+=t,Math.abs(this._totalDelta)>aD&&(this._zoom(t,n,A),this._totalDelta=0)},Se.prototype._handleWheel=function(t){if(this._canvas.isFocused()){var n=this._container;t.preventDefault();var A=t.ctrlKey||Tg()&&t.metaKey,i=t.shiftKey,o=-1*this._scale,r;if(A?o*=t.deltaMode===0?.02:.32:o*=t.deltaMode===0?1:16,A){var a=n.getBoundingClientRect(),c={x:t.clientX-a.left,y:t.clientY-a.top};r=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*rD(t.deltaY)*o,this.zoom(r,c)}else i?r={dx:o*t.deltaY,dy:0}:r={dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(r)}},Se.prototype.stepZoom=function(t,n){var A=qg(Jc,$g);this._zoom(t,n,A)},Se.prototype._zoom=function(e,t,n){var A=this._canvas,i=e>0?1:-1,o=Pc(A.zoom()),r=Math.round(o/n)*n;r+=n*i;var a=Math.pow(10,r);A.zoom(oD(Jc,a),t)},Se.prototype.toggle=function(t){var n=this._container,A=this._handleWheel,i=this._enabled;return typeof t>"u"&&(t=!i),i!==t&&O[t?"bind":"unbind"](n,"wheel",A,!1),this._enabled=t,t},Se.prototype._init=function(e){this.toggle(e)};const jc={__init__:["zoomScroll"],zoomScroll:["type",Se]};function _A(e){et.call(this,e)}W(_A,et),_A.prototype._navigationModules=[Og,Hc,jc],_A.prototype._modules=[].concat(et.prototype._modules,_A.prototype._navigationModules);function Vc(e){return e&&e[e.length-1]}function ep(e){return e.y}function tp(e){return e.x}var sD={left:tp,center:tp,right:function(e){return e.x+e.width},top:ep,middle:ep,bottom:function(e){return e.y+e.height}};function Xn(e,t){this._modeling=e,this._rules=t}Xn.$inject=["modeling","rules"],Xn.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],n="x",A="width";return t.indexOf(e)!==-1&&(n="y",A="height"),{axis:n,dimension:A}},Xn.prototype._isType=function(e,t){return t.indexOf(e)!==-1},Xn.prototype._alignmentPosition=function(e,t){var n=this._getOrientationDetails(e),A=n.axis,i=n.dimension,o={},r={},a=!1,c,l,B;function g(p,E){return Math.round((p[A]+E[A]+E[i])/2)}if(this._isType(e,["left","top"]))o[e]=t[0][A];else if(this._isType(e,["right","bottom"]))B=Vc(t),o[e]=B[A]+B[i];else if(this._isType(e,["center","middle"])){if(U(t,function(p){var E=p[A]+Math.round(p[i]/2);r[E]?r[E].elements.push(p):r[E]={elements:[p],center:E}}),c=Qe(r,function(p){return p.elements.length>1&&(a=!0),p.elements.length}),a)return o[e]=Vc(c).center,o;l=t[0],t=Qe(t,function(p){return p[A]+p[i]}),B=Vc(t),o[e]=g(l,B)}return o},Xn.prototype.trigger=function(e,t){var n=this._modeling,A,i=l0(e,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(A=this._rules.allowed("elements.align",{elements:i}),n0(A)&&(i=A),!(i.length<2||!A)){var o=sD[t],r=Qe(i,o),a=this._alignmentPosition(t,r);n.alignElements(r,a)}};const lD={__init__:["alignElements"],alignElements:["type",Xn]},BD=new VA;function Kn(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}Kn.$inject=["eventBus"],Kn.prototype.schedule=function(e,t=BD.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},Kn.prototype._schedule=function(e,t){const n=gD();return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(i){n.reject(i)}}catch(i){console.error("Scheduler#_schedule execution failed",i)}}),promise:n.promise}},Kn.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},Kn.prototype._cancel=function(e){clearTimeout(e.executionId)};function gD(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const pD={scheduler:["type",Kn]};var ED="djs-element-hidden",Po=".entry",dD=1e3,np=8,uD=300;function Z0(e,t,n,A){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=A,this._current=null,this._init()}Z0.$inject=["canvas","elementRegistry","eventBus","scheduler"],Z0.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,A=n.length?n.length===1?n[0]:n:null;A?e.open(A,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,A=e._current;if(A){var i=A.target,o=n0(i)?i:[i],r=o.filter(function(c){return n.includes(c)});if(r.length){e.close();var a=o.filter(function(c){return e._elementRegistry.get(c.id)});a.length&&e._updateAndOpen(a.length>1?a:a[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,A=e._current,i=n0(A.target)?A.target:[A.target];i.includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()},Z0.prototype._createContainer=function(){var e=$('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},Z0.prototype.registerProvider=function(e,t){t||(t=e,e=dD),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})},Z0.prototype.getEntries=function(e){var t=this._getProviders(),n=n0(e)?"getMultiElementContextPadEntries":"getContextPadEntries",A={};return U(t,function(i){if(n2(i[n])){var o=i[n](e);n2(o)?A=o(A):U(o,function(r,a){A[a]=r})}}),A},Z0.prototype.trigger=function(e,t,n){var A=this,i,o,r=t.delegateTarget||t.target;if(!r)return t.preventDefault();if(i=g2(r,"data-action"),o=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){A._mouseout=A.triggerEntry(i,"hover",o,n)},uD);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(i,e,o,n)},Z0.prototype.triggerEntry=function(e,t,n,A){if(this.isShown()){var i=this._current.target,o=this._current.entries,r=o[e];if(r){var a=r.action;if(this._eventBus.fire("contextPad.trigger",{entry:r,event:n})!==!1){if(n2(a)){if(t==="click")return a(n,i,A)}else if(a[t])return a[t](n,i,A);n.preventDefault()}}}},Z0.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},Z0.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Z0.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this._createHtml(e),A;U(t,function(i,o){var r=i.group||"default",a=$(i.html||'<div class="entry" draggable="true"></div>'),c;g2(a,"data-action",o),c=p0("[data-group="+LA(r)+"]",n),c||(c=$('<div class="group"></div>'),g2(c,"data-group",r),n.appendChild(c)),c.appendChild(a),i.className&&QD(a,i.className),i.title&&g2(a,"title",i.title),i.imageUrl&&(A=$("<img>"),g2(A,"src",i.imageUrl),A.style.width="100%",A.style.height="100%",a.appendChild(A))}),X(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},Z0.prototype._createHtml=function(e){var t=this,n=$('<div class="djs-context-pad"></div>');return x2.bind(n,Po,"click",function(A){t.trigger("click",A)}),x2.bind(n,Po,"dragstart",function(A){t.trigger("dragstart",A)}),x2.bind(n,Po,"mouseover",function(A){t.trigger("mouseover",A)}),x2.bind(n,Po,"mouseout",function(A){t.trigger("mouseout",A)}),O.bind(n,"mousedown",function(A){A.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},Z0.prototype.getPad=function(e){console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888"));let t;return this.isOpen()&&wD(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}},Z0.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},Z0.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return n0(e)!==n0(n)?!1:n0(e)?e.length===n.length&&je(e,function(A){return n.includes(A)}):n===e},Z0.prototype.isShown=function(){return this.isOpen()&&X(this._current.html).has("open")},Z0.prototype.show=function(){this.isOpen()&&(X(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},Z0.prototype.hide=function(){this.isOpen()&&(X(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},Z0.prototype._getPosition=function(e){if(!n0(e)&&Y0(e)){var t=this._canvas.viewbox(),n=hD(e),A=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale;return{left:A+np*this._canvas.zoom(),top:i}}var o=this._canvas.getContainer(),r=o.getBoundingClientRect(),a=this._getTargetBounds(e);return{left:a.right-r.left+np*this._canvas.zoom(),top:a.top-r.top}},Z0.prototype._updatePosition=function(){const e=()=>{if(this.isOpen()){var t=this._current.html,n=this._getPosition(this._current.target);"x"in n&&"y"in n?(t.style.left=n.x+"px",t.style.top=n.y+"px"):["top","right","bottom","left"].forEach(function(A){A in n&&(t.style[A]=n[A]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")},Z0.prototype._updateVisibility=function(){const e=()=>{if(this.isOpen()){var t=this,n=this._current.target,A=n0(n)?n:[n],i=A.some(function(o){return t._canvas.hasMarker(o,ED)});i?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")},Z0.prototype._getTargetBounds=function(e){var t=this,n=n0(e)?e:[e],A=n.map(function(i){return t._canvas.getGraphics(i)});return A.reduce(function(i,o){const r=o.getBoundingClientRect();return i.top=Math.min(i.top,r.top),i.right=Math.max(i.right,r.right),i.bottom=Math.max(i.bottom,r.bottom),i.left=Math.min(i.left,r.left),i.x=i.left,i.y=i.top,i.width=i.right-i.left,i.height=i.bottom-i.top,i},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function QD(e,t){var n=X(e);t=n0(t)?t:t.split(/\s+/g),t.forEach(function(A){n.add(A)})}function hD(e){return e.waypoints[e.waypoints.length-1]}function wD(e,t){return e=n0(e)?e:[e],t=n0(t)?t:[t],e.length===t.length&&je(e,function(n){return t.includes(n)})}const Ap={__depends__:[ko,pD,No],contextPad:["type",Z0]};var Jo,w0,ip,gn,op,rp,Lc,jo={},ap=[],mD=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function xt(e,t){for(var n in t)e[n]=t[n];return e}function cp(e){var t=e.parentNode;t&&t.removeChild(e)}function sp(e,t,n){var A,i,o,r={};for(o in t)o=="key"?A=t[o]:o=="ref"?i=t[o]:r[o]=t[o];if(arguments.length>2&&(r.children=arguments.length>3?Jo.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)r[o]===void 0&&(r[o]=e.defaultProps[o]);return Vo(e,r,A,i,null)}function Vo(e,t,n,A,i){var o={type:e,props:t,key:n,ref:A,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++ip};return i==null&&w0.vnode!=null&&w0.vnode(o),o}function Lo(e){return e.children}function Wo(e,t){this.props=e,this.context=t}function OA(e,t){if(t==null)return e.__?OA(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?OA(e):null}function lp(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return lp(e)}}function Bp(e){(!e.__d&&(e.__d=!0)&&gn.push(e)&&!_o.__r++||op!==w0.debounceRendering)&&((op=w0.debounceRendering)||rp)(_o)}function _o(){var e,t,n,A,i,o,r,a;for(gn.sort(Lc);e=gn.shift();)e.__d&&(t=gn.length,A=void 0,i=void 0,r=(o=(n=e).__v).__e,(a=n.__P)&&(A=[],(i=xt({},o)).__v=o.__v+1,Wc(a,o,i,n.__n,a.ownerSVGElement!==void 0,o.__h!=null?[r]:null,A,r??OA(o),o.__h),wp(A,o),o.__e!=r&&lp(o)),gn.length>t&&gn.sort(Lc));_o.__r=0}function gp(e,t,n,A,i,o,r,a,c,l){var B,g,p,E,d,u,h,D=A&&A.__k||ap,y=D.length;for(n.__k=[],B=0;B<t.length;B++)if((E=n.__k[B]=(E=t[B])==null||typeof E=="boolean"||typeof E=="function"?null:typeof E=="string"||typeof E=="number"||typeof E=="bigint"?Vo(null,E,null,null,E):Array.isArray(E)?Vo(Lo,{children:E},null,null,null):E.__b>0?Vo(E.type,E.props,E.key,E.ref?E.ref:null,E.__v):E)!=null){if(E.__=n,E.__b=n.__b+1,(p=D[B])===null||p&&E.key==p.key&&E.type===p.type)D[B]=void 0;else for(g=0;g<y;g++){if((p=D[g])&&E.key==p.key&&E.type===p.type){D[g]=void 0;break}p=null}Wc(e,E,p=p||jo,i,o,r,a,c,l),d=E.__e,(g=E.ref)&&p.ref!=g&&(h||(h=[]),p.ref&&h.push(p.ref,null,E),h.push(g,E.__c||d,E)),d!=null?(u==null&&(u=d),typeof E.type=="function"&&E.__k===p.__k?E.__d=c=pp(E,c,e):c=Ep(e,E,p,D,d,c),typeof n.type=="function"&&(n.__d=c)):c&&p.__e==c&&c.parentNode!=e&&(c=OA(p))}for(n.__e=u,B=y;B--;)D[B]!=null&&(typeof n.type=="function"&&D[B].__e!=null&&D[B].__e==n.__d&&(n.__d=dp(A).nextSibling),fp(D[B],D[B]));if(h)for(B=0;B<h.length;B++)mp(h[B],h[++B],h[++B])}function pp(e,t,n){for(var A,i=e.__k,o=0;i&&o<i.length;o++)(A=i[o])&&(A.__=e,t=typeof A.type=="function"?pp(A,t,n):Ep(n,A,A,i,A.__e,t));return t}function Ep(e,t,n,A,i,o){var r,a,c;if(t.__d!==void 0)r=t.__d,t.__d=void 0;else if(n==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(i),r=null;else{for(a=o,c=0;(a=a.nextSibling)&&c<A.length;c+=1)if(a==i)break e;e.insertBefore(i,o),r=o}return r!==void 0?r:i.nextSibling}function dp(e){var t,n,A;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(A=dp(n)))return A}return null}function fD(e,t,n,A,i){var o;for(o in n)o==="children"||o==="key"||o in t||Oo(e,o,null,n[o],A);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||n[o]===t[o]||Oo(e,o,t[o],n[o],A)}function up(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||mD.test(t)?n:n+"px"}function Oo(e,t,n,A,i){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof A=="string"&&(e.style.cssText=A=""),A)for(t in A)n&&t in n||up(e.style,t,"");if(n)for(t in n)A&&n[t]===A[t]||up(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?A||e.addEventListener(t,o?hp:Qp,o):e.removeEventListener(t,o?hp:Qp,o);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function Qp(e){return this.l[e.type+!1](w0.event?w0.event(e):e)}function hp(e){return this.l[e.type+!0](w0.event?w0.event(e):e)}function Wc(e,t,n,A,i,o,r,a,c){var l,B,g,p,E,d,u,h,D,y,C,m,I,x,v,F=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(l=w0.__b)&&l(t);try{e:if(typeof F=="function"){if(h=t.props,D=(l=F.contextType)&&A[l.__c],y=l?D?D.props.value:l.__:A,n.__c?u=(B=t.__c=n.__c).__=B.__E:("prototype"in F&&F.prototype.render?t.__c=B=new F(h,y):(t.__c=B=new Wo(h,y),B.constructor=F,B.render=MD),D&&D.sub(B),B.props=h,B.state||(B.state={}),B.context=y,B.__n=A,g=B.__d=!0,B.__h=[],B._sb=[]),B.__s==null&&(B.__s=B.state),F.getDerivedStateFromProps!=null&&(B.__s==B.state&&(B.__s=xt({},B.__s)),xt(B.__s,F.getDerivedStateFromProps(h,B.__s))),p=B.props,E=B.state,B.__v=t,g)F.getDerivedStateFromProps==null&&B.componentWillMount!=null&&B.componentWillMount(),B.componentDidMount!=null&&B.__h.push(B.componentDidMount);else{if(F.getDerivedStateFromProps==null&&h!==p&&B.componentWillReceiveProps!=null&&B.componentWillReceiveProps(h,y),!B.__e&&B.shouldComponentUpdate!=null&&B.shouldComponentUpdate(h,B.__s,y)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(B.props=h,B.state=B.__s,B.__d=!1),B.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(z){z&&(z.__=t)}),C=0;C<B._sb.length;C++)B.__h.push(B._sb[C]);B._sb=[],B.__h.length&&r.push(B);break e}B.componentWillUpdate!=null&&B.componentWillUpdate(h,B.__s,y),B.componentDidUpdate!=null&&B.__h.push(function(){B.componentDidUpdate(p,E,d)})}if(B.context=y,B.props=h,B.__P=e,m=w0.__r,I=0,"prototype"in F&&F.prototype.render){for(B.state=B.__s,B.__d=!1,m&&m(t),l=B.render(B.props,B.state,B.context),x=0;x<B._sb.length;x++)B.__h.push(B._sb[x]);B._sb=[]}else do B.__d=!1,m&&m(t),l=B.render(B.props,B.state,B.context),B.state=B.__s;while(B.__d&&++I<25);B.state=B.__s,B.getChildContext!=null&&(A=xt(xt({},A),B.getChildContext())),g||B.getSnapshotBeforeUpdate==null||(d=B.getSnapshotBeforeUpdate(p,E)),v=l!=null&&l.type===Lo&&l.key==null?l.props.children:l,gp(e,Array.isArray(v)?v:[v],t,n,A,i,o,r,a,c),B.base=t.__e,t.__h=null,B.__h.length&&r.push(B),u&&(B.__E=B.__=null),B.__e=!1}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=CD(n.__e,t,n,A,i,o,r,c);(l=w0.diffed)&&l(t)}catch(z){t.__v=null,(c||o!=null)&&(t.__e=a,t.__h=!!c,o[o.indexOf(a)]=null),w0.__e(z,t,n)}}function wp(e,t){w0.__c&&w0.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(A){A.call(n)})}catch(A){w0.__e(A,n.__v)}})}function CD(e,t,n,A,i,o,r,a){var c,l,B,g=n.props,p=t.props,E=t.type,d=0;if(E==="svg"&&(i=!0),o!=null){for(;d<o.length;d++)if((c=o[d])&&"setAttribute"in c==!!E&&(E?c.localName===E:c.nodeType===3)){e=c,o[d]=null;break}}if(e==null){if(E===null)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",E):document.createElement(E,p.is&&p),o=null,a=!1}if(E===null)g===p||a&&e.data===p||(e.data=p);else{if(o=o&&Jo.call(e.childNodes),l=(g=n.props||jo).dangerouslySetInnerHTML,B=p.dangerouslySetInnerHTML,!a){if(o!=null)for(g={},d=0;d<e.attributes.length;d++)g[e.attributes[d].name]=e.attributes[d].value;(B||l)&&(B&&(l&&B.__html==l.__html||B.__html===e.innerHTML)||(e.innerHTML=B&&B.__html||""))}if(fD(e,p,g,i,a),B)t.__k=[];else if(d=t.props.children,gp(e,Array.isArray(d)?d:[d],t,n,A,i&&E!=="foreignObject",o,r,o?o[0]:n.__k&&OA(n,0),a),o!=null)for(d=o.length;d--;)o[d]!=null&&cp(o[d]);a||("value"in p&&(d=p.value)!==void 0&&(d!==e.value||E==="progress"&&!d||E==="option"&&d!==g.value)&&Oo(e,"value",d,g.value,!1),"checked"in p&&(d=p.checked)!==void 0&&d!==e.checked&&Oo(e,"checked",d,g.checked,!1))}return e}function mp(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(A){w0.__e(A,n)}}function fp(e,t,n){var A,i;if(w0.unmount&&w0.unmount(e),(A=e.ref)&&(A.current&&A.current!==e.__e||mp(A,null,t)),(A=e.__c)!=null){if(A.componentWillUnmount)try{A.componentWillUnmount()}catch(o){w0.__e(o,t)}A.base=A.__P=null,e.__c=void 0}if(A=e.__k)for(i=0;i<A.length;i++)A[i]&&fp(A[i],t,n||typeof e.type!="function");n||e.__e==null||cp(e.__e),e.__=e.__e=e.__d=void 0}function MD(e,t,n){return this.constructor(e,n)}function Cp(e,t,n){var A,i,o;w0.__&&w0.__(e,t),i=(A=typeof n=="function")?null:t.__k,o=[],Wc(t,e=(!A&&n||t).__k=sp(Lo,null,[e]),i||jo,jo,t.ownerSVGElement!==void 0,!A&&n?[n]:i?null:t.firstChild?Jo.call(t.childNodes):null,o,!A&&n?n:i?i.__e:t.firstChild,A),wp(o,e)}Jo=ap.slice,w0={__e:function(e,t,n,A){for(var i,o,r;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),r=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,A||{}),r=i.__d),r)return i.__E=i}catch(a){e=a}throw e}},ip=0,Wo.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=xt({},this.state),typeof e=="function"&&(e=e(xt({},n),this.props)),e&&xt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Bp(this))},Wo.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Bp(this))},Wo.prototype.render=Lo,gn=[],rp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Lc=function(e,t){return e.__v.__b-t.__v.__b},_o.__r=0;var Mp=function(e,t,n,A){var i;t[0]=0;for(var o=1;o<t.length;o++){var r=t[o++],a=t[o]?(t[0]|=r?1:2,n[t[o++]]):t[++o];r===3?A[0]=a:r===4?A[1]=Object.assign(A[1]||{},a):r===5?(A[1]=A[1]||{})[t[++o]]=a:r===6?A[1][t[++o]]+=a+"":r?(i=e.apply(a,Mp(e,a,n,["",null])),A.push(i),a[0]?t[0]|=2:(t[o-2]=0,t[o]=i)):A.push(a)}return A},Dp=new Map;function DD(e){var t=Dp.get(this);return t||(t=new Map,Dp.set(this,t)),(t=Mp(this,t.get(e)||(t.set(e,t=function(n){for(var A,i,o=1,r="",a="",c=[0],l=function(p){o===1&&(p||(r=r.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?c.push(0,p,r):o===3&&(p||r)?(c.push(3,p,r),o=2):o===2&&r==="..."&&p?c.push(4,p,0):o===2&&r&&!p?c.push(5,0,!0,r):o>=5&&((r||!p&&o===5)&&(c.push(o,0,r,i),o=6),p&&(c.push(o,p,0,i),o=6)),r=""},B=0;B<n.length;B++){B&&(o===1&&l(),l(B));for(var g=0;g<n[B].length;g++)A=n[B][g],o===1?A==="<"?(l(),c=[c],o=3):r+=A:o===4?r==="--"&&A===">"?(o=1,r=""):r=A+r[0]:a?A===a?a="":r+=A:A==='"'||A==="'"?a=A:A===">"?(l(),o=1):o&&(A==="="?(o=5,i=r,r=""):A==="/"&&(o<5||n[B][g+1]===">")?(l(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):A===" "||A===" "||A===`
49
49
  `||A==="\r"?(l(),o=2):r+=A),o===3&&r==="!--"&&(o=4,c=c[0])}return l(),c}(e)),t),arguments,[])).length>1?t:t[0]}var _0=DD.bind(sp),XA,q0,_c,yp,KA=0,Ip=[],Xo=[],Fp=w0.__b,vp=w0.__r,xp=w0.diffed,bp=w0.__c,Yp=w0.unmount;function Ko(e,t){w0.__h&&w0.__h(q0,e,KA||t),KA=0;var n=q0.__H||(q0.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Xo}),n.__[e]}function Oc(e){return KA=1,yD(zp,e)}function yD(e,t,n){var A=Ko(XA++,2);if(A.t=e,!A.__c&&(A.__=[zp(void 0,t),function(a){var c=A.__N?A.__N[0]:A.__[0],l=A.t(c,a);c!==l&&(A.__N=[l,A.__[1]],A.__c.setState({}))}],A.__c=q0,!q0.u)){var i=function(a,c,l){if(!A.__c.__H)return!0;var B=A.__c.__H.__.filter(function(p){return p.__c});if(B.every(function(p){return!p.__N}))return!o||o.call(this,a,c,l);var g=!1;return B.forEach(function(p){if(p.__N){var E=p.__[0];p.__=p.__N,p.__N=void 0,E!==p.__[0]&&(g=!0)}}),!(!g&&A.__c.props===a)&&(!o||o.call(this,a,c,l))};q0.u=!0;var o=q0.shouldComponentUpdate,r=q0.componentWillUpdate;q0.componentWillUpdate=function(a,c,l){if(this.__e){var B=o;o=void 0,i(a,c,l),o=B}r&&r.call(this,a,c,l)},q0.shouldComponentUpdate=i}return A.__N||A.__}function Xc(e,t){var n=Ko(XA++,3);!w0.__s&&qc(n.__H,t)&&(n.__=e,n.i=t,q0.__H.__h.push(n))}function Kc(e,t){var n=Ko(XA++,4);!w0.__s&&qc(n.__H,t)&&(n.__=e,n.i=t,q0.__h.push(n))}function Up(e){return KA=5,Zn(function(){return{current:e}},[])}function Zn(e,t){var n=Ko(XA++,7);return qc(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function ZA(e,t){return KA=8,Zn(function(){return e},t)}function ID(){for(var e;e=Ip.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Zo),e.__H.__h.forEach(Zc),e.__H.__h=[]}catch(t){e.__H.__h=[],w0.__e(t,e.__v)}}w0.__b=function(e){q0=null,Fp&&Fp(e)},w0.__r=function(e){vp&&vp(e),XA=0;var t=(q0=e.__c).__H;t&&(_c===q0?(t.__h=[],q0.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Xo,n.__N=n.i=void 0})):(t.__h.forEach(Zo),t.__h.forEach(Zc),t.__h=[])),_c=q0},w0.diffed=function(e){xp&&xp(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ip.push(t)!==1&&yp===w0.requestAnimationFrame||((yp=w0.requestAnimationFrame)||FD)(ID)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Xo&&(n.__=n.__V),n.i=void 0,n.__V=Xo})),_c=q0=null},w0.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Zo),n.__h=n.__h.filter(function(A){return!A.__||Zc(A)})}catch(A){t.some(function(i){i.__h&&(i.__h=[])}),t=[],w0.__e(A,n.__v)}}),bp&&bp(e,t)},w0.unmount=function(e){Yp&&Yp(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(A){try{Zo(A)}catch(i){t=i}}),n.__H=void 0,t&&w0.__e(t,n.__v))};var Np=typeof requestAnimationFrame=="function";function FD(e){var t,n=function(){clearTimeout(A),Np&&cancelAnimationFrame(t),setTimeout(e)},A=setTimeout(n,100);Np&&(t=requestAnimationFrame(n))}function Zo(e){var t=q0,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),q0=t}function Zc(e){var t=q0;e.__c=e.__(),q0=t}function qc(e,t){return!e||e.length!==t.length||t.some(function(n,A){return n!==e[A]})}function zp(e,t){return typeof t=="function"?t(e):t}function Rp(e){var t,n,A="";if(typeof e=="string"||typeof e=="number")A+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Rp(e[t]))&&(A&&(A+=" "),A+=n)}else for(n in e)e[n]&&(A&&(A+=" "),A+=n);return A}function qo(){for(var e,t,n=0,A="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Rp(e))&&(A&&(A+=" "),A+=t);return A}function vD(e){const{headerEntries:t,onSelect:n,selectedEntry:A,setSelectedEntry:i,title:o}=e,r=Zn(()=>xD(t),[t]);return _0`
50
50
  <div class="djs-popup-header">
51
51
  <h3 class="djs-popup-title" title=${o}>${o}</h3>
@@ -216,7 +216,7 @@
216
216
  searchFn=${this._search}
217
217
  ...${{...o}}
218
218
  />
219
- `,this._current.container)},P0.prototype.open=function(e,t,n,A){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();const{entries:i,headerEntries:o,emptyPlaceholder:r}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:i,headerEntries:o,emptyPlaceholder:r,container:this._createContainer({provider:t}),options:A},this._emit("open"),this._bindAutoClose(),this._render()},P0.prototype.refresh=function(){if(!this.isOpen())return;const{target:e,providerId:t}=this._current,{entries:n,headerEntries:A,emptyPlaceholder:i}=this._getContext(e,t);this._current={...this._current,entries:n,headerEntries:A,emptyPlaceholder:i},this._emit("refresh"),this._render()},P0.prototype._getContext=function(e,t){const n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");const A=this._getEntries(e,n),i=this._getHeaderEntries(e,n),o=this._getEmptyPlaceholder(n);return{entries:A,headerEntries:i,emptyPlaceholder:o,empty:!(Object.keys(A).length||Object.keys(i).length)}},P0.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)},P0.prototype.reset=function(){const e=this._current.container;Cp(null,e),xe(e)},P0.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},P0.prototype._onOpened=function(){this._emit("opened")},P0.prototype._onClosed=function(){this._emit("closed")},P0.prototype._createContainer=function(e){var t=this._canvas,n=t.getContainer();const A=$(`<div class="djs-popup-parent djs-scrollable" data-popup=${e.provider}></div>`);return n.appendChild(A),A},P0.prototype._bindAutoClose=function(){this._eventBus.once(Tp,this.close,this)},P0.prototype._unbindAutoClose=function(){this._eventBus.off(Tp,this.close,this)},P0.prototype._updateScale=function(){var e=this._canvas.zoom(),t=this._config.scale,n,A,i=e;return t!==!0&&(t===!1?(n=1,A=1):(n=t.min,A=t.max),a2(n)&&e<n&&(i=n),a2(A)&&e>A&&(i=A)),i},P0.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),A=e.getBoundingClientRect(),i={},o=t.x,r=t.y;return t.x+A.width>n.width&&(i.x=!0),t.y+A.height>n.height&&(i.y=!0),i.x&&i.y?(o=t.x-A.width,r=t.y-A.height):i.x?(o=t.x-A.width,r=t.y):i.y&&t.y<A.height?(o=t.x,r=10):i.y&&(o=t.x,r=t.y-A.height),t.y<n.top&&(r=t.y+A.height),{x:o,y:r}},P0.prototype.isEmpty=function(e,t){if(!e)throw new Error("target is missing");if(!t)throw new Error("provider ID is missing");const n=this._getProviders(t);return!n||!n.length?!0:this._getContext(e,t).empty},P0.prototype.registerProvider=function(e,t,n){n||(n=t,t=kD),this._eventBus.on("popupMenu.getProviders."+e,t,function(A){A.providers.push(n)})},P0.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},P0.prototype._getEntries=function(e,t){var n={};return U(t,function(A){if(!A.getPopupMenuEntries){U(A.getEntries(e),function(o){var r=o.id;if(!r)throw new Error("entry ID is missing");n[r]=we(o,["id"])});return}var i=A.getPopupMenuEntries(e);n2(i)?n=i(n):U(i,function(o,r){n[r]=o})}),n},P0.prototype._getHeaderEntries=function(e,t){var n={};return U(t,function(A){if(!A.getPopupMenuHeaderEntries){if(!A.getHeaderEntries)return;U(A.getHeaderEntries(e),function(o){var r=o.id;if(!r)throw new Error("entry ID is missing");n[r]=we(o,["id"])});return}var i=A.getPopupMenuHeaderEntries(e);n2(i)?n=i(n):U(i,function(o,r){n[r]=o})}),n},P0.prototype._getEmptyPlaceholder=function(e){const t=e.find(n=>n2(n.getEmptyPlaceholder));return t&&t.getEmptyPlaceholder()},P0.prototype.isOpen=function(){return!!this._current},P0.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let i=Sn(e.delegateTarget||e.target,".entry",!0),o=g2(i,TD);t={id:o,...this._getEntry(o)}}const A=t.action;if(this._emit("trigger",{entry:t,event:e})!==!1){if(n2(A)){if(n==="click")return A(e,t)}else if(A[n])return A[n](e,t)}},P0.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw new Error("entry not found");return t};function GD(e,t,n){const{keys:A}=n;if(t=t.trim().toLowerCase(),!t)throw new Error("<pattern> must not be empty");const i=t.trim().toLowerCase().split(/\s+/);return e.flatMap(o=>{const r=HD(o,i,A);return r?{item:o,tokens:r}:[]}).sort(PD(A))}function HD(e,t,n){const{matchedWords:A,tokens:i}=n.reduce((o,r)=>{const a=e[r],{tokens:c,matchedWords:l}=n0(a)?a.reduce((B,g)=>{const{tokens:p,matchedWords:E}=Pp(g,t);return{tokens:[...B.tokens,p],matchedWords:{...B.matchedWords,...E}}},{matchedWords:{},tokens:[]}):Pp(a,t);return{tokens:{...o.tokens,[r]:c},matchedWords:{...o.matchedWords,...l}}},{matchedWords:{},tokens:{}});return Object.keys(A).length!==t.length?null:i}function PD(e){return(t,n)=>{let A=0,i=1;for(const o of e){const r=JD(t.tokens[o],n.tokens[o]);if(r!==0){A+=r*i,i*=.9;continue}const a=jD(t.item[o],n.item[o]);if(a!==0){A+=a*i,i*=.9;continue}}return A}}function JD(e,t){return kp(t)-kp(e)}function kp(e){return e.reduce((t,n)=>t+Gp(n),0)}function Gp(e){if(n0(e))return Math.max(...e.map(Gp));const t=Math.log(e.value.length);return e.match?(e.start?e.end?131.9:7.87:e.wordStart?2.19:1)*t:-.07*t}function Hp(e=""){return n0(e)?e.join(", "):e}function jD(e,t){return Hp(e).localeCompare(Hp(t))}function Pp(e,t){if(!e)return{tokens:[],matchedWords:{}};const n=[],A={},i=t.map(VD),o=[`(?<all>${i.join("\\s+")})`,...i].join("|"),r=new RegExp(o,"ig");let a,c=0;for(;a=r.exec(e);){const[l]=a,B=a.index,g=a.index+l.length,p=B===0,E=g===e.length,d=!!a.groups.all,u=p||/\s/.test(e.charAt(B-1)),h=E||/\s/.test(e.charAt(g));a.index>c&&n.push({value:e.slice(c,a.index),index:c}),n.push({value:l,index:a.index,match:!0,wordStart:u,wordEnd:h,start:p,end:E,all:d});const D=d?t:[l];for(const y of D)A[y.toLowerCase()]=!0;c=a.index+l.length}return c<e.length&&n.push({value:e.slice(c),index:c}),{tokens:n,matchedWords:A}}function VD(e){return e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}const Jp={search:["value",GD]},$c={__depends__:[Jp],__init__:["popupMenu"],popupMenu:["type",P0]};var jp={align:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
219
+ `,this._current.container)},P0.prototype.open=function(e,t,n,A){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();const{entries:i,headerEntries:o,emptyPlaceholder:r}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:i,headerEntries:o,emptyPlaceholder:r,container:this._createContainer({provider:t}),options:A},this._emit("open"),this._bindAutoClose(),this._render()},P0.prototype.refresh=function(){if(!this.isOpen())return;const{target:e,providerId:t}=this._current,{entries:n,headerEntries:A,emptyPlaceholder:i}=this._getContext(e,t);this._current={...this._current,entries:n,headerEntries:A,emptyPlaceholder:i},this._emit("refresh"),this._render()},P0.prototype._getContext=function(e,t){const n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");const A=this._getEntries(e,n),i=this._getHeaderEntries(e,n),o=this._getEmptyPlaceholder(n);return{entries:A,headerEntries:i,emptyPlaceholder:o,empty:!(Object.keys(A).length||Object.keys(i).length)}},P0.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)},P0.prototype.reset=function(){const e=this._current.container;Cp(null,e),xe(e)},P0.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},P0.prototype._onOpened=function(){this._emit("opened")},P0.prototype._onClosed=function(){this._emit("closed")},P0.prototype._createContainer=function(e){var t=this._canvas,n=t.getContainer();const A=$(`<div class="djs-popup-parent djs-scrollable" data-popup=${e.provider}></div>`);return n.appendChild(A),A},P0.prototype._bindAutoClose=function(){this._eventBus.once(Tp,this.close,this)},P0.prototype._unbindAutoClose=function(){this._eventBus.off(Tp,this.close,this)},P0.prototype._updateScale=function(){var e=this._canvas.zoom(),t=this._config.scale,n,A,i=e;return t!==!0&&(t===!1?(n=1,A=1):(n=t.min,A=t.max),a2(n)&&e<n&&(i=n),a2(A)&&e>A&&(i=A)),i},P0.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),A=e.getBoundingClientRect(),i={},o=t.x,r=t.y;return t.x+A.width>n.width&&(i.x=!0),t.y+A.height>n.height&&(i.y=!0),i.x&&i.y?(o=t.x-A.width,r=t.y-A.height):i.x?(o=t.x-A.width,r=t.y):i.y&&t.y<A.height?(o=t.x,r=10):i.y&&(o=t.x,r=t.y-A.height),t.y<n.top&&(r=t.y+A.height),{x:o,y:r}},P0.prototype.isEmpty=function(e,t){if(!e)throw new Error("target is missing");if(!t)throw new Error("provider ID is missing");const n=this._getProviders(t);return!n||!n.length?!0:this._getContext(e,t).empty},P0.prototype.registerProvider=function(e,t,n){n||(n=t,t=kD),this._eventBus.on("popupMenu.getProviders."+e,t,function(A){A.providers.push(n)})},P0.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},P0.prototype._getEntries=function(e,t){var n={};return U(t,function(A){if(!A.getPopupMenuEntries){U(A.getEntries(e),function(o){var r=o.id;if(!r)throw new Error("entry ID is missing");n[r]=he(o,["id"])});return}var i=A.getPopupMenuEntries(e);n2(i)?n=i(n):U(i,function(o,r){n[r]=o})}),n},P0.prototype._getHeaderEntries=function(e,t){var n={};return U(t,function(A){if(!A.getPopupMenuHeaderEntries){if(!A.getHeaderEntries)return;U(A.getHeaderEntries(e),function(o){var r=o.id;if(!r)throw new Error("entry ID is missing");n[r]=he(o,["id"])});return}var i=A.getPopupMenuHeaderEntries(e);n2(i)?n=i(n):U(i,function(o,r){n[r]=o})}),n},P0.prototype._getEmptyPlaceholder=function(e){const t=e.find(n=>n2(n.getEmptyPlaceholder));return t&&t.getEmptyPlaceholder()},P0.prototype.isOpen=function(){return!!this._current},P0.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let i=Sn(e.delegateTarget||e.target,".entry",!0),o=g2(i,TD);t={id:o,...this._getEntry(o)}}const A=t.action;if(this._emit("trigger",{entry:t,event:e})!==!1){if(n2(A)){if(n==="click")return A(e,t)}else if(A[n])return A[n](e,t)}},P0.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw new Error("entry not found");return t};function GD(e,t,n){const{keys:A}=n;if(t=t.trim().toLowerCase(),!t)throw new Error("<pattern> must not be empty");const i=t.trim().toLowerCase().split(/\s+/);return e.flatMap(o=>{const r=HD(o,i,A);return r?{item:o,tokens:r}:[]}).sort(PD(A))}function HD(e,t,n){const{matchedWords:A,tokens:i}=n.reduce((o,r)=>{const a=e[r],{tokens:c,matchedWords:l}=n0(a)?a.reduce((B,g)=>{const{tokens:p,matchedWords:E}=Pp(g,t);return{tokens:[...B.tokens,p],matchedWords:{...B.matchedWords,...E}}},{matchedWords:{},tokens:[]}):Pp(a,t);return{tokens:{...o.tokens,[r]:c},matchedWords:{...o.matchedWords,...l}}},{matchedWords:{},tokens:{}});return Object.keys(A).length!==t.length?null:i}function PD(e){return(t,n)=>{let A=0,i=1;for(const o of e){const r=JD(t.tokens[o],n.tokens[o]);if(r!==0){A+=r*i,i*=.9;continue}const a=jD(t.item[o],n.item[o]);if(a!==0){A+=a*i,i*=.9;continue}}return A}}function JD(e,t){return kp(t)-kp(e)}function kp(e){return e.reduce((t,n)=>t+Gp(n),0)}function Gp(e){if(n0(e))return Math.max(...e.map(Gp));const t=Math.log(e.value.length);return e.match?(e.start?e.end?131.9:7.87:e.wordStart?2.19:1)*t:-.07*t}function Hp(e=""){return n0(e)?e.join(", "):e}function jD(e,t){return Hp(e).localeCompare(Hp(t))}function Pp(e,t){if(!e)return{tokens:[],matchedWords:{}};const n=[],A={},i=t.map(VD),o=[`(?<all>${i.join("\\s+")})`,...i].join("|"),r=new RegExp(o,"ig");let a,c=0;for(;a=r.exec(e);){const[l]=a,B=a.index,g=a.index+l.length,p=B===0,E=g===e.length,d=!!a.groups.all,u=p||/\s/.test(e.charAt(B-1)),h=E||/\s/.test(e.charAt(g));a.index>c&&n.push({value:e.slice(c,a.index),index:c}),n.push({value:l,index:a.index,match:!0,wordStart:u,wordEnd:h,start:p,end:E,all:d});const D=d?t:[l];for(const y of D)A[y.toLowerCase()]=!0;c=a.index+l.length}return c<e.length&&n.push({value:e.slice(c),index:c}),{tokens:n,matchedWords:A}}function VD(e){return e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}const Jp={search:["value",GD]},$c={__depends__:[Jp],__init__:["popupMenu"],popupMenu:["type",P0]};var jp={align:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
220
220
  <line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
221
221
  <rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
222
222
  <rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
@@ -244,7 +244,7 @@
244
244
  <line x1="150" y1="900" x2="1650" y2="900" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
245
245
  <rect x="150" y="250" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
246
246
  <rect x="1050" y="500" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
247
- </svg>`},LD=900;function qn(e,t,n,A){e.registerProvider(LD,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=A}qn.$inject=["contextPad","popupMenu","translate","canvas"],qn.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&N(t,this._getEntries(e)),t},qn.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},qn.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`<div class="entry">${jp.align}</div>`,action:{click:function(t,n){var A=e._getMenuPosition(n);N(A,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",A)}}}}},qn.prototype._getMenuPosition=function(e){var t=5,n=this._contextPad.getPad(e).html,A=n.getBoundingClientRect(),i={x:A.left,y:A.bottom+t};return i};var WD=["left","center","right","top","middle","bottom"];function qA(e,t,n,A){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=A,e.registerProvider("align-elements",this)}qA.$inject=["popupMenu","alignElements","translate","rules"],qA.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&N(t,this._getEntries(e)),t},qA.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},qA.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,A=this._popupMenu,i={};return U(WD,function(o){i["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:jp[o],action:function(){t.trigger(e,o),A.close()}}}),i};function Ae(e){j.call(this,e),this.init()}Ae.$inject=["eventBus"],W(Ae,j),Ae.prototype.addRule=function(e,t,n){var A=this;typeof e=="string"&&(e=[e]),e.forEach(function(i){A.canExecute(i,t,function(o,r,a){return n(o)},!0)})},Ae.prototype.init=function(){};function $o(e){Ae.call(this,e)}$o.$inject=["eventBus"],W($o,Ae),$o.prototype.init=function(){this.addRule("elements.align",function(e){var t=e.elements,n=l0(t,function(A){return!(A.waypoints||A.host||A.labelTarget)});return n=Bo(n),n.length<2?!1:n})};const _D={__depends__:[lD,Ap,$c],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",qn],alignElementsMenuProvider:["type",qA],bpmnAlignElements:["type",$o]};var OD=10,Vp=50,XD=250;function es(e,t,n,A){for(var i;i=KD(e,n,t);)n=A(t,n,i);return n}function ts(e){return function(t,n,A){var i={x:n.x,y:n.y};return["x","y"].forEach(function(o){var r=e[o];if(r){var a=o==="x"?"width":"height",c=r.margin,l=r.minDistance;c<0?i[o]=Math.min(A[o]+c-t[a]/2,n[o]-l+c):i[o]=Math.max(A[o]+A[a]+c+t[a]/2,n[o]+l+c)}}),i}}function KD(e,t,n){var A={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},i=qD(e);return m0(i,function(o){if(o===n)return!1;var r=f2(o,A,OD);return r==="intersect"})}function ZD(e,t){t||(t={});function n(d){return d.source===e?1:-1}var A=t.defaultDistance||Vp,i=t.direction||"e",o=t.filter,r=t.getWeight||n,a=t.maxDistance||XD,c=t.reference||"start";o||(o=ty);function l(d,u){return i==="n"?c==="start"?e0(d).top-e0(u).bottom:c==="center"?e0(d).top-i0(u).y:e0(d).top-e0(u).top:i==="w"?c==="start"?e0(d).left-e0(u).right:c==="center"?e0(d).left-i0(u).x:e0(d).left-e0(u).left:i==="s"?c==="start"?e0(u).top-e0(d).bottom:c==="center"?i0(u).y-e0(d).bottom:e0(u).bottom-e0(d).bottom:c==="start"?e0(u).left-e0(d).right:c==="center"?i0(u).x-e0(d).right:e0(u).right-e0(d).right}var B=e.incoming.filter(o).map(function(d){var u=r(d),h=u<0?l(d.source,e):l(e,d.source);return{id:d.source.id,distance:h,weight:u}}),g=e.outgoing.filter(o).map(function(d){var u=r(d),h=u>0?l(e,d.target):l(d.target,e);return{id:d.target.id,distance:h,weight:u}}),p=B.concat(g).reduce(function(d,u){return d[u.id+"__weight_"+u.weight]=u,d},{}),E=F2(p,function(d,u){var h=u.distance,D=u.weight;return h<0||h>a||(d[String(h)]||(d[String(h)]=0),d[String(h)]+=1*D,(!d.distance||d[d.distance]<d[String(h)])&&(d.distance=h)),d},{});return E.distance||A}function qD(e){var t=ns(e);return e.host&&(t=t.concat(ns(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce(function(n,A){return n.concat(ns(A))},[]))),t}function ns(e){return ey(e).concat($D(e))}function $D(e){return e.incoming.map(function(t){return t.source})}function ey(e){return e.outgoing.map(function(t){return t.target})}function ty(){return!0}var ny=100;function Lp(e,t,n){e.on("autoPlace",ny,function(A){var i=A.shape,o=A.source;return Ay(o,i)}),e.on("autoPlace.end",function(A){n.scrollToElement(A.shape)}),this.append=function(A,i,o){e.fire("autoPlace.start",{source:A,shape:i});var r=e.fire("autoPlace",{source:A,shape:i}),a=t.appendShape(A,i,r,A.parent,o);return e.fire("autoPlace.end",{source:A,shape:a}),a}}Lp.$inject=["eventBus","modeling","canvas"];function Ay(e,t,n){n||(n={});var A=n.defaultDistance||Vp,i=i0(e),o=e0(e);return{x:o.right+A+t.width/2,y:i.y}}function Wp(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}Wp.$inject=["eventBus","selection"];const iy={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Lp],autoPlaceSelectionBehavior:["type",Wp]};function $n(e,t){for(U2(t)&&(t=[t]);e=e.parent;)if(a0(e,t))return e;return null}function _p(e,t){var n=$n(e,"bpmn:Process");if(n)return!0;var A=["bpmn:Participant","bpmn:Lane"];if(n=$n(e,A),n)return l2(n);if(a0(e,A))return l2(e);var i;for(i=P(e);i&&!f(i,"bpmn:Process");i=i.$parent);if(!t)return!0;var o=t.find(function(r){var a=P(r);return a&&a.get("processRef")===i});return o?l2(o):!0}function Op(e,t,n){var A=_p(e,n);if(f(t,"bpmn:TextAnnotation"))return ry(e,t,A);if(a0(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"]))return ay(e,t,A);if(f(t,"bpmn:FlowNode"))return oy(e,t,A)}function oy(e,t,n){var A=e0(e),i=i0(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"},r=ZD(e,{filter:function(E){return f(E,"bpmn:SequenceFlow")},direction:o.directionHint}),a=30,c=o.minDistance,l=o.baseOrientation;f(e,"bpmn:BoundaryEvent")&&(l=f2(e,e.host,-25),l.indexOf(o.boundaryOrientation)!==-1&&(a*=-1));var B=n?{x:A.right+r+t.width/2,y:i.y+Xp(l,c,o)}:{x:i.x+Xp(l,c,o),y:A.bottom+r+t.height/2},g={margin:a,minDistance:c},p=n?{y:g}:{x:g};return es(e,t,B,ts(p))}function Xp(e,t,n){return e.includes(n.start)?-1*t:e.includes(n.end)?t:0}function ry(e,t,n){var A=e0(e),i=n?{x:A.right+t.width/2,y:A.top-50-t.height/2}:{x:A.right+50+t.width/2,y:A.bottom+t.height/2};Y0(e)&&(i=i0(e),n?(i.x+=100,i.y-=50):(i.x+=100,i.y+=50));var o={margin:n?-30:30,minDistance:20},r=n?{y:o}:{x:o};return es(e,t,i,ts(r))}function ay(e,t,n){var A=e0(e),i=n?{x:A.right-10+t.width/2,y:A.bottom+40+t.width/2}:{x:A.left-40-t.width/2,y:A.bottom-10+t.height/2},o={margin:30,minDistance:30},r=n?{x:o}:{y:o};return es(e,t,i,ts(r))}function Kp(e,t){e.on("autoPlace",function(n){var A=n.shape,i=n.source;return Op(i,A,t)})}Kp.$inject=["eventBus","elementRegistry"];const As={__depends__:[iy],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",Kp]};function tt(e,t,n,A){j.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=A;var i=this;this.postExecuted(["shape.create"],function(o){var r=o.context,a=r.hints||{},c=r.shape,l=r.parent||r.newParent;a.autoResize!==!1&&i._expand([c],l)}),this.postExecuted(["elements.move"],function(o){var r=o.context,a=no(FA(r.closure.topLevel)),c=r.hints,l=c?c.autoResize:!0;if(l!==!1){var B=Ve(a,function(g){return g.parent.id});U(B,function(g,p){n0(l)&&(g=g.filter(function(E){return m0(l,Z2({id:E.id}))})),i._expand(g,p)})}}),this.postExecuted(["shape.toggleCollapse"],function(o){var r=o.context,a=r.hints,c=r.shape;a&&a.autoResize===!1||c.collapsed||i._expand(c.children||[],c)}),this.postExecuted(["shape.resize"],function(o){var r=o.context,a=r.hints,c=r.shape,l=c.parent;a&&a.autoResize===!1||l&&i._expand([c],l)})}tt.$inject=["eventBus","elementRegistry","modeling","rules"],W(tt,j),tt.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),A=this.getPadding(t),i=e0(i2(e)),o=e0(t),r={};return i.top-o.top<A.top&&(r.top=i.top-n.top),i.left-o.left<A.left&&(r.left=i.left-n.left),o.right-i.right<A.right&&(r.right=i.right+n.right),o.bottom-i.bottom<A.bottom&&(r.bottom=i.bottom+n.bottom),Qo(N({},o,r))},tt.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 A=this._getOptimalBounds(e,t);if(cy(A,t)){var i=sy(q2(t,["x","y","width","height"]),A);this.resize(t,A,{autoResize:i});var o=t.parent;o&&this._expand([t],o)}}},tt.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},tt.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},tt.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)};function cy(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function sy(e,t){var n="";return e=e0(e),t=e0(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 er(e){e.invoke(tt,this)}er.$inject=["injector"],W(er,tt),er.prototype.resize=function(e,t,n){f(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)};function $A(e){Ae.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}$A.$inject=["eventBus"],W($A,Ae),$A.prototype.canResize=function(e,t){return!1};function tr(e,t){$A.call(this,e),this._modeling=t}W(tr,$A),tr.$inject=["eventBus","modeling"],tr.prototype.canResize=function(e,t){if(f(t.di,"bpmndi:BPMNPlane")||!f(t,"bpmn:Participant")&&!f(t,"bpmn:Lane")&&!f(t,"bpmn:SubProcess"))return!1;var n=!0;return U(e,function(A){if(f(A,"bpmn:Lane")||f0(A)){n=!1;return}}),n};const ly={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",er],bpmnAutoResizeProvider:["type",tr]};var Zp=1500;function qp(e,t,n){var A=this,i=n.get("dragging",!1);function o(r){if(!r.hover){var a=r.originalEvent,c=A._findTargetGfx(a),l=c&&e.get(c);c&&l&&(r.stopPropagation(),i.hover({element:l,gfx:c}),i.move(a))}}i&&t.on("drag.start",function(r){t.once("drag.move",Zp,function(a){o(a)})}),function(){var r,a;t.on("element.hover",function(c){r=c.gfx,a=c.element}),t.on("element.hover",Zp,function(c){a&&t.fire("element.out",{element:a,gfx:r})}),t.on("element.out",function(){r=null,a=null})}(),this._findTargetGfx=function(r){var a,c;if(r instanceof MouseEvent)return a=Bn(r),c=document.elementFromPoint(a.x,a.y),By(c)}}qp.$inject=["elementRegistry","eventBus","injector"];function By(e){return Sn(e,"svg, .djs-element",!0)}const gy={__init__:["hoverFix"],hoverFix:["type",qp]};var eA=Math.round,$p="djs-drag-active";function pn(e){e.preventDefault()}function py(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function Ey(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function e4(e,t,n,A){var i={threshold:5,trapClick:!0},o;function r(C){var m=t.viewbox(),I=t._container.getBoundingClientRect();return{x:m.x+(C.x-I.left)/m.scale,y:m.y+(C.y-I.top)/m.scale}}function a(C,m){m=m||o;var I=e.createEvent(N({},m.payload,m.data,{isTouch:m.isTouch}));return e.fire("drag."+C,I)===!1?!1:e.fire(m.prefix+"."+C,I)}function c(C){var m=C.filter(function(I){return A.get(I.id)});m.length&&n.select(m)}function l(C,m){var I=o.payload,x=o.displacement,v=o.globalStart,F=Bn(C),z=Me(F,v),R=o.localStart,k=r(F),T=Me(k,R);if(!o.active&&(m||Ey(z)>o.threshold)){if(N(I,{x:eA(R.x+x.x),y:eA(R.y+x.y),dx:0,dy:0},{originalEvent:C}),a("start")===!1)return h();o.active=!0,o.keepSelection||(I.previousSelection=n.get(),n.select(null)),o.cursor&&Ho(o.cursor),t.addMarker(t.getRootElement(),$p)}Tc(C),o.active&&(N(I,{x:eA(k.x+x.x),y:eA(k.y+x.y),dx:eA(T.x),dy:eA(T.y)},{originalEvent:C}),a("move"))}function B(C){var m,I=!0;o.active&&(C&&(o.payload.originalEvent=C,Tc(C)),I=a("end")),I===!1&&a("rejected"),m=D(I!==!0),a("ended",m)}function g(C){E2("Escape",C)&&(pn(C),h())}function p(C){var m;o.active&&(m=Kg(e),setTimeout(m,400),pn(C)),B(C)}function E(C){l(C)}function d(C){var m=o.payload;m.hoverGfx=C.gfx,m.hover=C.element,a("hover")}function u(C){a("out");var m=o.payload;m.hoverGfx=null,m.hover=null}function h(C){var m;if(o){var I=o.active;I&&a("cancel"),m=D(C),I&&a("canceled",m)}}function D(C){var m,I;a("cleanup"),Xg(),o.trapClick?I=p:I=B,O.unbind(document,"mousemove",l),O.unbind(document,"dragstart",pn),O.unbind(document,"selectstart",pn),O.unbind(document,"mousedown",I,!0),O.unbind(document,"mouseup",I,!0),O.unbind(document,"keyup",g),O.unbind(document,"touchstart",E,!0),O.unbind(document,"touchcancel",h,!0),O.unbind(document,"touchmove",l,!0),O.unbind(document,"touchend",B,!0),e.off("element.hover",d),e.off("element.out",u),t.removeMarker(t.getRootElement(),$p);var x=o.payload.previousSelection;return C!==!1&&x&&!n.get().length&&c(x),m=o,o=null,m}function y(C,m,I,x){o&&h(!1),typeof m=="string"&&(x=I,I=m,m=null),x=N({},i,x||{});var v=x.data||{},F,z,R,k,T;x.trapClick?k=p:k=B,C?(F=Ln(C)||C,z=Bn(C),Tc(C),F.type==="dragstart"&&pn(F)):(F=null,z={x:0,y:0}),R=r(z),m||(m=R),T=py(F),o=N({prefix:I,data:v,payload:{},globalStart:z,displacement:Me(m,R),localStart:R,isTouch:T},x),x.manual||(T?(O.bind(document,"touchstart",E,!0),O.bind(document,"touchcancel",h,!0),O.bind(document,"touchmove",l,!0),O.bind(document,"touchend",B,!0)):(O.bind(document,"mousemove",l),O.bind(document,"dragstart",pn),O.bind(document,"selectstart",pn),O.bind(document,"mousedown",k,!0),O.bind(document,"mouseup",k,!0)),O.bind(document,"keyup",g),e.on("element.hover",d),e.on("element.out",u)),a("init"),x.autoActivate&&l(C,!0)}e.on("diagram.destroy",h),this.init=y,this.move=l,this.hover=d,this.out=u,this.end=B,this.cancel=h,this.context=function(){return o},this.setOptions=function(C){N(i,C)}}e4.$inject=["eventBus","canvas","selection","elementRegistry"];const nt={__depends__:[gy,Ce],dragging:["type",e4]};function tA(e,t,n){this._canvas=n,this._opts=N({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var A=this;t.on("drag.move",function(i){var o=A._toBorderPoint(i);A.startScroll(o)}),t.on(["drag.cleanup"],function(){A.stopScroll()})}tA.$inject=["config.autoScroll","eventBus","canvas"],tA.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,A=this,i=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,i.width-e.x,i.height-e.y];this.stopScroll();for(var r=0,a=0,c=0;c<4;c++)dy(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(c===0?r=n.scrollStep:c==1?a=n.scrollStep:c==2?r=-n.scrollStep:c==3&&(a=-n.scrollStep));(r!==0||a!==0)&&(t.scroll({dx:r,dy:a}),this._scrolling=setTimeout(function(){A.startScroll(e)},n.scrollRepeatTimeout))};function dy(e,t,n){return t<e&&e<n}tA.prototype.stopScroll=function(){clearTimeout(this._scrolling)},tA.prototype.setOptions=function(e){this._opts=N({},this._opts,e)},tA.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=Bn(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};const uy={__depends__:[nt],__init__:["autoScroll"],autoScroll:["type",tA]};function is(e){this._commandStack=e.get("commandStack",!1)}is.$inject=["injector"],is.prototype.allowed=function(e,t){var n=!0,A=this._commandStack;return A&&(n=A.canExecute(e,t)),n===void 0?!0:n};const Te={__init__:["rules"],rules:["type",is]};var nr=Math.round,Qy=Math.max;function hy(e,t){var n=e.x,A=e.y;return[["M",n,A],["m",0,-t],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}function wy(e){var t=[];return e.forEach(function(n,A){t.push([A===0?"M":"L",n.x,n.y])}),t}var t4=10;function my(e,t){var n,A;for(n=0;A=e[n];n++)if(NA(A,t)<=t4)return{point:e[n],bendpoint:!0,index:n};return null}function fy(e,t){var n=xB(hy(t,t4),wy(e)),A=n[0],i=n[n.length-1],o;return A?A!==i?A.segment2!==i.segment2?(o=Qy(A.segment2,i.segment2)-1,{point:e[o],bendpoint:!0,index:o}):{point:{x:nr(A.x+i.x)/2,y:nr(A.y+i.y)/2},index:A.segment2}:{point:{x:nr(A.x),y:nr(A.y)},index:A.segment2}:null}function os(e,t){return my(e,t)||fy(e,t)}function n4(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function A4(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function Cy(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 My(e,t,n){var A=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}],i=A[0].n*t[0]+A[1].n*t[1],o=A[0].lambda*t[0]+A[1].lambda*t[1];return-i/o}function rs(e,t){var n=t[0],A=t[1],i={x:A.x-n.x,y:A.y-n.y},o=My([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 i4(e,t){var n=rs(e,t),A={x:n.x-e.x,y:n.y-e.y};return n4(A)}function Ar(e,t){return n4({x:e.x-t.x,y:e.y-t.y})}var o4="djs-bendpoint",r4="djs-segment-dragger";function Dy(e,t){var n=Bn(t),A=e._container.getBoundingClientRect(),i;i={x:A.left,y:A.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 as(e,t,n){var A=Dy(e,n),i=os(t,A);return i}function cs(e,t){var n=g0("g");D0(n).add(o4),Q0(e,n);var A=g0("circle");q(A,{cx:0,cy:0,r:4}),D0(A).add("djs-visual"),Q0(n,A);var i=g0("circle");return q(i,{cx:0,cy:0,r:10}),D0(i).add("djs-hit"),Q0(n,i),t&&D0(n).add(t),n}function yy(e,t,n,A){var i=g0("g");Q0(e,i);var o=18,r=6,a=11,c=Fy(t,n,A),l=r+a,B=g0("rect");q(B,{x:-o/2,y:-r/2,width:o,height:r}),D0(B).add("djs-visual"),Q0(i,B);var g=g0("rect");return q(g,{x:-c/2,y:-l/2,width:c,height:l}),D0(g).add("djs-hit"),Q0(i,g),OB(i,A==="v"?90:0),i}function a4(e,t,n){var A=g0("g"),i=uc(t,n),o=We(t,n);return Q0(e,A),yy(A,t,n,o),D0(A).add(r4),D0(A).add(o==="h"?"horizontal":"vertical"),Q2(A,i.x,i.y),A}function ss(e){return Math.abs(Math.round(e*2/3))}function Iy(e,t){var n=vy(e,t);return rs(e,n)}function Fy(e,t,n){var A=t.x-e.x,i=t.y-e.y;return ss(n==="h"?A:i)}function vy(e,t){for(var n=t.waypoints,A=1/0,i,o=0;o<n.length-1;o++){var r=n[o],a=n[o+1],c=i4(e,[r,a]);c<A&&(A=c,i=o)}return[n[i],n[i+1]]}function c4(e,t,n,A,i){function o(C,m,I){var x=C.index,v=C.point,F,z,R,k,T,H;return x<=0||C.bendpoint?!1:(F=m[x-1],z=m[x],R=uc(F,z),k=We(F,z),T=Math.abs(v.x-R.x),H=Math.abs(v.y-R.y),k&&T<=I&&H<=I)}function r(C,m){var I=C.waypoints,x,v,F,z;return m.index<=0||m.bendpoint||(x={start:I[m.index-1],end:I[m.index]},v=We(x.start,x.end),!v)?null:(v==="h"?F=x.end.x-x.start.x:F=x.end.y-x.start.y,z=ss(F)/2,z)}function a(C,m){var I=m.waypoints,x=as(t,I,C),v;if(x)return v=r(m,x),o(x,I,v)?i.start(C,m,x.index):A.start(C,m,x.index,!x.bendpoint),!0}function c(C,m,I){O.bind(C,m,function(x){n.triggerMouseEvent(m,x,I),x.stopPropagation()})}function l(C,m){var I=t.getLayer("overlays"),x=p0('.djs-bendpoints[data-element-id="'+LA(C.id)+'"]',I);return!x&&m&&(x=g0("g"),q(x,{"data-element-id":C.id}),D0(x).add("djs-bendpoints"),Q0(I,x),c(x,"mousedown",C),c(x,"click",C),c(x,"dblclick",C)),x}function B(C,m){return p0('.djs-segment-dragger[data-segment-idx="'+C+'"]',m)}function g(C,m){m.waypoints.forEach(function(I,x){var v=cs(C);Q0(C,v),Q2(v,I.x,I.y)}),cs(C,"floating")}function p(C,m){for(var I=m.waypoints,x,v,F,z=1;z<I.length;z++)x=I[z-1],v=I[z],We(x,v)&&(F=a4(C,x,v),q(F,{"data-segment-idx":z}),c(F,"mousemove",m))}function E(C){U(Le("."+o4,C),function(m){s2(m)})}function d(C){U(Le("."+r4,C),function(m){s2(m)})}function u(C){var m=l(C);return m||(m=l(C,!0),g(m,C),p(m,C)),m}function h(C){var m=l(C);m&&(d(m),E(m),p(m,C),g(m,C))}function D(C,m){var I=p0(".floating",C),x=m.point;I&&Q2(I,x.x,x.y)}function y(C,m,I){var x=B(m.index,C),v=I[m.index-1],F=I[m.index],z=m.point,R=uc(v,F),k=We(v,F),T,H;x&&(T=xy(x),H={x:z.x-R.x,y:z.y-R.y},k==="v"&&(H={x:H.y,y:H.x}),Q2(T,H.x,H.y))}e.on("connection.changed",function(C){h(C.element)}),e.on("connection.remove",function(C){var m=l(C.element);m&&s2(m)}),e.on("element.marker.update",function(C){var m=C.element,I;m.waypoints&&(I=u(m),C.add?D0(I).add(C.marker):D0(I).remove(C.marker))}),e.on("element.mousemove",function(C){var m=C.element,I=m.waypoints,x,v;if(I){if(x=l(m,!0),v=as(t,I,C.originalEvent),!v)return;D(x,v),v.bendpoint||y(x,v,I)}}),e.on("element.mousedown",function(C){if(vt(C)){var m=C.originalEvent,I=C.element;if(I.waypoints)return a(m,I)}}),e.on("selection.changed",function(C){var m=C.newSelection,I=m[0];I&&I.waypoints&&u(I)}),e.on("element.hover",function(C){var m=C.element;m.waypoints&&(u(m),n.registerEvent(C.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(C){n.unregisterEvent(C.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(C){var m=C.element,I=C.newId;if(m.waypoints){var x=l(m);x&&q(x,{"data-element-id":I})}}),this.addHandles=u,this.updateHandles=h,this.getBendpointsContainer=l,this.getSegmentDragger=B}c4.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];function xy(e){return p0(".djs-visual",e)}var s4=Math.round,En="reconnectStart",dn="reconnectEnd",ei="updateWaypoints";function ls(e,t,n,A,i,o){this._injector=e,this.start=function(r,a,c,l){var B=n.getGraphics(a),g=a.source,p=a.target,E=a.waypoints,d;!l&&c===0?d=En:!l&&c===E.length-1?d=dn:d=ei;var u=d===ei?"connection.updateWaypoints":"connection.reconnect",h=i.allowed(u,{connection:a,source:g,target:p});h===!1&&(h=i.allowed(u,{connection:a,source:p,target:g})),h!==!1&&A.init(r,"bendpoint.move",{data:{connection:a,connectionGfx:B,context:{allowed:h,bendpointIndex:c,connection:a,source:g,target:p,insert:l,type:d}}})},t.on("bendpoint.move.hover",function(r){var a=r.context,c=a.connection,l=c.source,B=c.target,g=r.hover,p=a.type;a.hover=g;var E;if(g){var d=p===ei?"connection.updateWaypoints":"connection.reconnect";if(E=a.allowed=i.allowed(d,{connection:c,source:p===En?g:l,target:p===dn?g:B}),E){a.source=p===En?g:l,a.target=p===dn?g:B;return}E===!1&&(E=a.allowed=i.allowed(d,{connection:c,source:p===dn?g:B,target:p===En?g:l})),E&&(a.source=p===dn?g:B,a.target=p===En?g:l)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(r){var a=r.context,c=a.type;a.hover=null,a.source=null,a.target=null,c!==ei&&(a.allowed=!1)}),t.on("bendpoint.move.end",function(r){var a=r.context,c=a.allowed,l=a.bendpointIndex,B=a.connection,g=a.insert,p=B.waypoints.slice(),E=a.source,d=a.target,u=a.type,h=a.hints||{},D={x:s4(r.x),y:s4(r.y)};if(!c)return!1;u===ei?(g?p.splice(l,0,D):p[l]=D,h.bendpointMove={insert:g,bendpointIndex:l},p=this.cropWaypoints(B,p),o.updateWaypoints(B,vf(p),h)):(u===En?(h.docking="source",ir(a)&&(h.docking="target",h.newWaypoints=p.reverse())):u===dn&&(h.docking="target",ir(a)&&(h.docking="source",h.newWaypoints=p.reverse())),o.reconnect(B,E,d,D,h))},this)}ls.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],ls.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var A=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=A,t};function ir(e){var t=e.hover,n=e.source,A=e.target,i=e.type;if(i===En)return t&&A&&t===A&&n!==A;if(i===dn)return t&&n&&t===n&&n!==A}var by="reconnectStart",Yy="reconnectEnd",l4="updateWaypoints",ti="connect-ok",or="connect-not-ok",B4="connect-hover",g4="djs-updating",p4="djs-dragging",E4=1100;function d4(e,t,n,A){this._injector=t;var i=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(o){var r=o.context,a=r.bendpointIndex,c=r.connection,l=r.insert,B=c.waypoints,g=B.slice();r.waypoints=B,l&&g.splice(a,0,{x:o.x,y:o.y}),c.waypoints=g;var p=r.draggerGfx=cs(A.getLayer("overlays"));D0(p).add("djs-dragging"),A.addMarker(c,p4),A.addMarker(c,g4)}),n.on("bendpoint.move.hover",function(o){var r=o.context,a=r.allowed,c=r.hover,l=r.type;if(c){if(A.addMarker(c,B4),l===l4)return;a?(A.removeMarker(c,or),A.addMarker(c,ti)):a===!1&&(A.removeMarker(c,ti),A.addMarker(c,or))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],E4,function(o){var r=o.context,a=r.hover,c=r.target;a&&(A.removeMarker(a,B4),A.removeMarker(a,c?ti:or))}),n.on("bendpoint.move.move",function(o){var r=o.context,a=r.allowed,c=r.bendpointIndex,l=r.draggerGfx,B=r.hover,g=r.type,p=r.connection,E=p.source,d=p.target,u=p.waypoints.slice(),h={x:o.x,y:o.y},D=r.hints||{},y={};i&&(D.connectionStart&&(y.connectionStart=D.connectionStart),D.connectionEnd&&(y.connectionEnd=D.connectionEnd),g===by?ir(r)?(y.connectionEnd=y.connectionEnd||h,y.source=d,y.target=B||E,u=u.reverse()):(y.connectionStart=y.connectionStart||h,y.source=B||E,y.target=d):g===Yy?ir(r)?(y.connectionStart=y.connectionStart||h,y.source=B||d,y.target=E,u=u.reverse()):(y.connectionEnd=y.connectionEnd||h,y.source=E,y.target=B||d):(y.noCropping=!0,y.noLayout=!0,u[c]=h),g===l4&&(u=e.cropWaypoints(p,u)),y.waypoints=u,i.drawPreview(r,a,y)),Q2(l,o.x,o.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],E4,function(o){var r=o.context,a=r.connection,c=r.draggerGfx,l=r.hover,B=r.target,g=r.waypoints;a.waypoints=g,s2(c),A.removeMarker(a,g4),A.removeMarker(a,p4),l&&(A.removeMarker(l,ti),A.removeMarker(l,B?ti:or)),i&&i.cleanUp(r)})}d4.$inject=["bendpointMove","injector","eventBus","canvas"];var u4="connect-hover",Q4="djs-updating";function h4(e,t,n){return Bs(e,t,e[t]+n)}function Bs(e,t,n){return{x:t==="x"?n:e.x,y:t==="y"?n:e.y}}function Uy(e,t,n,A){var i=Math.max(t[A],n[A]),o=Math.min(t[A],n[A]),r=20,a=Math.min(Math.max(o+r,e[A]),i-r);return Bs(t,A,a)}function w4(e){return e==="x"?"y":"x"}function m4(e,t,n){var A,i;return e.original?e.original:(A=i0(t),i=w4(n),Bs(e,i,A[i]))}function f4(e,t,n,A,i,o){var r=e.get("connectionDocking",!1);this.start=function(g,p,E){var d,u=n.getGraphics(p),h=E-1,D=E,y=p.waypoints,C=y[h],m=y[D],I=as(n,y,g),x,v,F;x=We(C,m),x&&(v=x==="v"?"x":"y",h===0&&(C=m4(C,p.source,v)),D===y.length-1&&(m=m4(m,p.target,v)),I?F=I.point:F={x:(C.x+m.x)/2,y:(C.y+m.y)/2},d={connection:p,segmentStartIndex:h,segmentEndIndex:D,segmentStart:C,segmentEnd:m,axis:v,dragPosition:F},A.init(g,F,"connectionSegment.move",{cursor:v==="x"?"resize-ew":"resize-ns",data:{connection:p,connectionGfx:u,context:d}}))};function a(g,p){if(!r)return p;var E=g.waypoints,d;return g.waypoints=p,d=r.getCroppedWaypoints(g),g.waypoints=E,d}function c(g){i.update("connection",g.connection,g.connectionGfx)}function l(g,p,E){var d=g.newWaypoints,u=g.segmentStartIndex+p,h=d[u],D=g.segmentEndIndex+p,y=d[D],C=w4(g.axis),m=Uy(E,h,y,C);Q2(g.draggerGfx,m.x,m.y)}function B(g,p){var E=0,d=g.filter(function(u,h){return dc(g[h-1],g[h+1],u)?(E=h<=p?E-1:E,!1):!0});return{waypoints:d,segmentOffset:E}}t.on("connectionSegment.move.start",function(g){var p=g.context,E=g.connection,d=n.getLayer("overlays");p.originalWaypoints=E.waypoints.slice(),p.draggerGfx=a4(d,p.segmentStart,p.segmentEnd),D0(p.draggerGfx).add("djs-dragging"),n.addMarker(E,Q4)}),t.on("connectionSegment.move.move",function(g){var p=g.context,E=p.connection,d=p.segmentStartIndex,u=p.segmentEndIndex,h=p.segmentStart,D=p.segmentEnd,y=p.axis,C=p.originalWaypoints.slice(),m=h4(h,y,g["d"+y]),I=h4(D,y,g["d"+y]),x=C.length,v=0;C[d]=m,C[u]=I;var F,z;d<2&&(F=f2(E.source,m),d===1?F==="intersect"&&(C.shift(),C[0]=m,v--):F!=="intersect"&&(C.unshift(h),v++)),u>x-3&&(z=f2(E.target,I),u===x-2?z==="intersect"&&(C.pop(),C[C.length-1]=I):z!=="intersect"&&C.push(D)),p.newWaypoints=E.waypoints=a(E,C),l(p,v,g),p.newSegmentStartIndex=d+v,c(g)}),t.on("connectionSegment.move.hover",function(g){g.context.hover=g.hover,n.addMarker(g.hover,u4)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(g){var p=g.context.hover;p&&n.removeMarker(p,u4)}),t.on("connectionSegment.move.cleanup",function(g){var p=g.context,E=p.connection;p.draggerGfx&&s2(p.draggerGfx),n.removeMarker(E,Q4)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(g){var p=g.context,E=p.connection;E.waypoints=p.originalWaypoints,c(g)}),t.on("connectionSegment.move.end",function(g){var p=g.context,E=p.connection,d=p.newWaypoints,u=p.newSegmentStartIndex;d=d.map(function(I){return{original:I.original,x:Math.round(I.x),y:Math.round(I.y)}});var h=B(d,u),D=h.waypoints,y=a(E,D),C=h.segmentOffset,m={segmentMove:{segmentStartIndex:p.segmentStartIndex,newSegmentStartIndex:u+C}};o.updateWaypoints(E,y,m)})}f4.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var Ny=Math.abs,C4=Math.round;function zy(e,t,n){n=n===void 0?10:n;var A,i;for(A=0;A<t.length;A++)if(i=t[A],Ny(i-e)<=n)return i}function M4(e){return{x:e.x,y:e.y}}function D4(e){return{x:e.x+e.width,y:e.y+e.height}}function ie(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:C4(e.x+e.width/2),y:C4(e.y+e.height/2)}}function nA(e,t){var n=e.snapped;return n?typeof t=="string"?n[t]:n.x&&n.y:!1}function $0(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 A,i=e[t],o=e.snapped=e.snapped||{};return n===!1?o[t]=!1:(o[t]=!0,A=n-i,e[t]+=A,e["d"+t]+=A),i}function y4(e){return e.children||[]}var Ry=Math.abs,I4=Math.round,gs=10;function F4(e){function t(o,r){if(n0(o)){for(var a=o.length;a--;)if(Ry(o[a]-r)<=gs)return o[a]}else{o=+o;var c=r%o;if(c<gs)return r-c;if(c>o-gs)return r-c+o}return r}function n(o,r){if(o.waypoints)return Iy(r,o);if(o.width)return{x:I4(o.width/2+o.x),y:I4(o.height/2+o.y)}}function A(o){var r=o.context,a=r.snapPoints,c=r.connection,l=c.waypoints,B=r.segmentStart,g=r.segmentStartIndex,p=r.segmentEnd,E=r.segmentEndIndex,d=r.axis;if(a)return a;var u=[l[g-1],B,p,l[E+1]];return g<2&&u.unshift(n(c.source,o)),E>l.length-3&&u.unshift(n(c.target,o)),r.snapPoints=a={horizontal:[],vertical:[]},U(u,function(h){h&&(h=h.original||h,d==="y"&&a.horizontal.push(h.y),d==="x"&&a.vertical.push(h.x))}),a}e.on("connectionSegment.move.move",1500,function(o){var r=A(o),a=o.x,c=o.y,l,B;if(r){l=t(r.vertical,a),B=t(r.horizontal,c);var g=a-l,p=c-B;N(o,{dx:o.dx-g,dy:o.dy-p,x:l,y:B}),(g||r.vertical.indexOf(a)!==-1)&&$0(o,"x",l),(p||r.horizontal.indexOf(c)!==-1)&&$0(o,"y",B)}});function i(o){var r=o.snapPoints,a=o.connection.waypoints,c=o.bendpointIndex;if(r)return r;var l=[a[c-1],a[c+1]];return o.snapPoints=r={horizontal:[],vertical:[]},U(l,function(B){B&&(B=B.original||B,r.horizontal.push(B.y),r.vertical.push(B.x))}),r}e.on(["connect.hover","connect.move","connect.end"],1500,function(o){var r=o.context,a=r.hover,c=a&&n(a,o);!Y0(a)||!c||!c.x||!c.y||($0(o,"x",c.x),$0(o,"y",c.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(o){var r=o.context,a=i(r),c=r.hover,l=c&&n(c,o),B=o.x,g=o.y,p,E;if(a){p=t(l?a.vertical.concat([l.x]):a.vertical,B),E=t(l?a.horizontal.concat([l.y]):a.horizontal,g);var d=B-p,u=g-E;N(o,{dx:o.dx-d,dy:o.dy-u,x:o.x-d,y:o.y-u}),(d||a.vertical.indexOf(B)!==-1)&&$0(o,"x",p),(u||a.horizontal.indexOf(g)!==-1)&&$0(o,"y",E)}})}F4.$inject=["eventBus"];const Sy={__depends__:[nt,Te],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",c4],bendpointMove:["type",ls],bendpointMovePreview:["type",d4],connectionSegmentMove:["type",f4],bendpointSnapping:["type",F4]};function v4(e,t,n,A){function i(r,a){return A.allowed("connection.create",{source:r,target:a})}function o(r,a){return i(a,r)}e.on("connect.hover",function(r){var a=r.context,c=a.start,l=r.hover,B;if(a.hover=l,B=a.canExecute=i(c,l),!en(B)){if(B!==!1){a.source=c,a.target=l;return}B=a.canExecute=o(c,l),!en(B)&&B!==!1&&(a.source=l,a.target=c)}}),e.on(["connect.out","connect.cleanup"],function(r){var a=r.context;a.hover=null,a.source=null,a.target=null,a.canExecute=!1}),e.on("connect.end",function(r){var a=r.context,c=a.canExecute,l=a.connectionStart,B={x:r.x,y:r.y},g=a.source,p=a.target;if(!c)return!1;var E=null,d={connectionStart:ps(a)?B:l,connectionEnd:ps(a)?l:B};V0(c)&&(E=c),a.connection=n.connect(g,p,E,d)}),this.start=function(r,a,c,l){V0(c)||(l=c,c=i0(a)),t.init(r,"connect",{autoActivate:l,data:{shape:a,context:{start:a,connectionStart:c}}})}}v4.$inject=["eventBus","dragging","modeling","rules"];function ps(e){var t=e.hover,n=e.source,A=e.target;return t&&n&&t===n&&n!==A}var Ty=1100,ky=900,x4="connect-ok",b4="connect-not-ok";function Y4(e,t,n){var A=e.get("connectionPreview",!1);A&&t.on("connect.move",function(i){var o=i.context,r=o.canExecute,a=o.hover,c=o.source,l=o.start,B=o.startPosition,g=o.target,p=o.connectionStart||B,E=o.connectionEnd||{x:i.x,y:i.y},d=p,u=E;ps(o)&&(d=E,u=p),A.drawPreview(o,r,{source:c||l,target:g||a,connectionStart:d,connectionEnd:u})}),t.on("connect.hover",ky,function(i){var o=i.context,r=i.hover,a=o.canExecute;a!==null&&n.addMarker(r,a?x4:b4)}),t.on(["connect.out","connect.cleanup"],Ty,function(i){var o=i.hover;o&&(n.removeMarker(o,x4),n.removeMarker(o,b4))}),A&&t.on("connect.cleanup",function(i){A.cleanUp(i.context)})}Y4.$inject=["injector","eventBus","canvas"];const Es={__depends__:[Ce,Te,nt],__init__:["connectPreview"],connect:["type",v4],connectPreview:["type",Y4]};var Gy="djs-dragger";function At(e,t,n,A){this._canvas=t,this._graphicsFactory=n,this._elementFactory=A,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}At.$inject=["injector","canvas","graphicsFactory","elementFactory"],At.prototype.drawPreview=function(e,t,n){n=n||{};var A=e.connectionPreviewGfx,i=e.getConnection,o=n.source,r=n.target,a=n.waypoints,c=n.connectionStart,l=n.connectionEnd,B=n.noLayout,g=n.noCropping,p=n.noNoop,E,d=this;if(A||(A=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),co(A),i||(i=e.getConnection=Hy(function(u,h,D){return d.getConnection(u,h,D)})),t&&(E=i(t,o,r)),!E){!p&&this.drawNoopPreview(A,n);return}E.waypoints=a||[],this._layouter&&!B&&(E.waypoints=this._layouter.layoutConnection(E,{source:o,target:r,connectionStart:c,connectionEnd:l,waypoints:n.waypoints||E.waypoints})),(!E.waypoints||!E.waypoints.length)&&(E.waypoints=[o?i0(o):c,r?i0(r):l]),this._connectionDocking&&(o||r)&&!g&&(E.waypoints=this._connectionDocking.getCroppedWaypoints(E,o,r)),this._graphicsFactory.drawConnection(A,E,{stroke:"var(--element-dragger-color)"})},At.prototype.drawNoopPreview=function(e,t){var n=t.source,A=t.target,i=t.connectionStart||i0(n),o=t.connectionEnd||i0(A),r=this.cropWaypoints(i,o,n,A),a=this.createNoopConnection(r[0],r[1]);Q0(e,a)},At.prototype.cropWaypoints=function(e,t,n,A){var i=this._graphicsFactory,o=n&&i.getShapePath(n),r=A&&i.getShapePath(A),a=i.getConnectionPath({waypoints:[e,t]});return e=n&&wc(o,a,!0)||e,t=A&&wc(r,a,!1)||t,[e,t]},At.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&s2(e.connectionPreviewGfx)},At.prototype.getConnection=function(e){var t=Py(e);return this._elementFactory.createConnection(t)},At.prototype.createConnectionPreviewGfx=function(){var e=g0("g");return q(e,{pointerEvents:"none"}),D0(e).add(Gy),Q0(this._canvas.getActiveLayer(),e),e},At.prototype.createNoopConnection=function(e,t){return lo([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function Hy(e){var t={};return function(n){var A=JSON.stringify(n),i=t[A];return i||(i=t[A]=e.apply(null,arguments)),i}}function Py(e){return V0(e)?e:{}}const Jy={__init__:["connectionPreview"],connectionPreview:["type",At]},jy=new VA("ps");var Vy=["marker-start","marker-mid","marker-end"],Ly=["circle","ellipse","line","path","polygon","polyline","path","rect"];function bt(e,t,n,A){this._elementRegistry=e,this._canvas=n,this._styles=A}bt.$inject=["elementRegistry","eventBus","canvas","styles"],bt.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")},bt.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},bt.prototype.addDragger=function(e,t,n,A="djs-dragger"){n=n||this.getGfx(e);var i=BB(n),o=n.getBoundingClientRect();return this._cloneMarkers(Mt(i),A),q(i,this._styles.cls(A,[],{x:o.top,y:o.left})),Q0(t,i),q(i,"data-preview-support-element-id",e.id),i},bt.prototype.addFrame=function(e,t){var n=g0("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return Q0(t,n),q(n,"data-preview-support-element-id",e.id),n},bt.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var A=this;e.childNodes&&e.childNodes.forEach(i=>{A._cloneMarkers(i,t,n)}),Xy(e)&&Vy.forEach(function(i){if(q(e,i)){var o=Wy(e,i,A._canvas.getContainer());o&&A._cloneMarker(n,e,o,i,t)}})},bt.prototype._cloneMarker=function(e,t,n,A,i="djs-dragger"){var o=[n.id,i,jy.next()].join("-"),r=p0("marker#"+n.id,e);e=e||this._canvas._svg;var a=r||BB(n);a.id=o,D0(a).add(i);var c=p0(":scope > defs",e);c||(c=g0("defs"),Q0(e,c)),Q0(c,a);var l=Oy(a.id);q(t,A,l)};function Wy(e,t,n){var A=_y(q(e,t));return p0("marker#"+A,n||document)}function _y(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function Oy(e){return"url(#"+e+")"}function Xy(e){return Ly.indexOf(e.nodeName)!==-1}const AA={__init__:["previewSupport"],previewSupport:["type",bt]},rr="complex-preview";class U4{constructor(t,n,A){this._canvas=t,this._graphicsFactory=n,this._previewSupport=A,this._markers=[]}create(t){this.cleanUp();const{created:n=[],moved:A=[],removed:i=[],resized:o=[]}=t,r=this._canvas.getLayer(rr);n.filter(a=>!Ky(a)).forEach(a=>{let c;Y0(a)?(c=this._graphicsFactory._createContainer("connection",g0("g")),this._graphicsFactory.drawConnection(Mt(c),a)):(c=this._graphicsFactory._createContainer("shape",g0("g")),this._graphicsFactory.drawShape(Mt(c),a),Q2(c,a.x,a.y)),this._previewSupport.addDragger(a,r,c)}),A.forEach(({element:a,delta:c})=>{this._previewSupport.addDragger(a,r,void 0,"djs-dragging"),this._canvas.addMarker(a,"djs-element-hidden"),this._markers.push([a,"djs-element-hidden"]);const l=this._previewSupport.addDragger(a,r);Y0(a)?Q2(l,c.x,c.y):Q2(l,a.x+c.x,a.y+c.y)}),i.forEach(a=>{this._previewSupport.addDragger(a,r,void 0,"djs-dragging"),this._canvas.addMarker(a,"djs-element-hidden"),this._markers.push([a,"djs-element-hidden"])}),o.forEach(({shape:a,bounds:c})=>{this._canvas.addMarker(a,"djs-hidden"),this._markers.push([a,"djs-hidden"]),this._previewSupport.addDragger(a,r,void 0,"djs-dragging");const l=this._graphicsFactory._createContainer("shape",g0("g"));this._graphicsFactory.drawShape(Mt(l),a,{width:c.width,height:c.height}),Q2(l,c.x,c.y),this._previewSupport.addDragger(a,r,l)})}cleanUp(){co(this._canvas.getLayer(rr)),this._markers.forEach(([t,n])=>this._canvas.removeMarker(t,n)),this._markers=[]}show(){this._canvas.showLayer(rr)}hide(){this._canvas.hideLayer(rr)}}U4.$inject=["canvas","graphicsFactory","previewSupport"];function Ky(e){return e.hidden}const Zy={__depends__:[AA],__init__:["complexPreview"],complexPreview:["type",U4]};var ds=["top","bottom","left","right"],ar=10;function us(e,t){j.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(i){var o=i.context,r=o.connection,a=r.source,c=r.target,l=o.hints||{};l.createElementsBehavior!==!1&&(n(a),n(c))}),this.postExecuted(["label.create"],function(i){var o=i.context,r=o.shape,a=o.hints||{};a.createElementsBehavior!==!1&&n(r.labelTarget)}),this.postExecuted(["elements.create"],function(i){var o=i.context,r=o.elements,a=o.hints||{};a.createElementsBehavior!==!1&&r.forEach(function(c){n(c)})});function n(i){if(Io(i)&&!Y0(i)){var o=eI(i);o&&A(i,o)}}function A(i,o){var r=i0(i),a=i.label,c=i0(a);if(a.parent){var l=e0(i),B;switch(o){case"top":B={x:r.x,y:l.top-ar-a.height/2};break;case"left":B={x:l.left-ar-a.width/2,y:r.y};break;case"bottom":B={x:r.x,y:l.bottom+ar+a.height/2};break;case"right":B={x:l.right+ar+a.width/2,y:r.y};break}var g=Me(B,c);t.moveShape(a,g)}}}W(us,j),us.$inject=["eventBus","modeling"];function qy(e){var t=e.host,n=i0(e),A=f2(n,t),i;A.indexOf("-")>=0?i=A.split("-"):i=[A];var o=ds.filter(function(r){return i.indexOf(r)===-1});return o}function $y(e){var t=i0(e),n=[].concat(e.incoming.map(function(A){return A.waypoints[A.waypoints.length-2]}),e.outgoing.map(function(A){return A.waypoints[1]})).map(function(A){return N4(t,A)});return n}function eI(e){var t=i0(e.label),n=i0(e),A=N4(n,t);if(tI(A)){var i=$y(e);if(e.host){var o=qy(e);i=i.concat(o)}var r=ds.filter(function(a){return i.indexOf(a)===-1});if(r.indexOf(A)===-1)return r[0]}}function N4(e,t){return f2(t,e,5)}function tI(e){return ds.indexOf(e)!==-1}function Qs(e){j.call(this,e),this.preExecute("shape.append",function(t){var n=t.source,A=t.shape;t.position||(f(A,"bpmn:TextAnnotation")?t.position={x:n.x+n.width/2+75,y:n.y-50-A.height/2}:t.position={x:n.x+n.width+80+A.width/2,y:n.y+n.height/2})},!0)}W(Qs,j),Qs.$inject=["eventBus"];function hs(e,t){e.invoke(j,this),this.postExecute("shape.move",function(n){var A=n.newParent,i=n.shape,o=l0(i.incoming.concat(i.outgoing),function(r){return f(r,"bpmn:Association")});U(o,function(r){t.moveConnection(r,{x:0,y:0},A)})},!0)}W(hs,j),hs.$inject=["injector","modeling"];var z4=500;function cr(e,t){t.invoke(j,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",z4,function(A){var i=A.elements;i=i.filter(function(o){var r=o.host;return R4(o,r)}),i.length===1&&i.map(function(o){return i.indexOf(o)}).forEach(function(o){var r=i[o];A.elements[o]=n._replaceShape(i[o],r)})},!0),this.preExecute("elements.move",z4,function(A){var i=A.shapes,o=A.newHost;if(i.length===1){var r=i[0];R4(r,o)&&(A.shapes=[n._replaceShape(r,o)])}},!0)}cr.$inject=["bpmnReplace","injector"],W(cr,j),cr.prototype._replaceShape=function(e,t){var n=nI(e),A={type:"bpmn:BoundaryEvent",host:t};return n&&(A.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,A,{layoutConnection:!1})};function nI(e){var t=P(e),n=t.eventDefinitions;return n&&n[0]}function R4(e,t){return!f0(e)&&a0(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function ws(e,t){j.call(this,e);function n(A){return l0(A.attachers,function(i){return f(i,"bpmn:BoundaryEvent")})}this.postExecute("connection.create",function(A){var i=A.context.source,o=A.context.target,r=n(o);f(i,"bpmn:EventBasedGateway")&&f(o,"bpmn:ReceiveTask")&&r.length>0&&t.removeElements(r)}),this.postExecute("connection.reconnect",function(A){var i=A.context.oldSource,o=A.context.newSource;f(i,"bpmn:Gateway")&&f(o,"bpmn:EventBasedGateway")&&U(o.outgoing,function(r){var a=r.target,c=n(a);f(a,"bpmn:ReceiveTask")&&c.length>0&&t.removeElements(c)})})}ws.$inject=["eventBus","modeling"],W(ws,j);function ms(e,t,n){j.call(this,e),this.preExecute("shape.replace",a,!0),this.postExecuted("shape.replace",c,!0),this.preExecute("connection.create",i,!0),this.postExecuted("connection.delete",A,!0),this.postExecuted("connection.reconnect",o,!0),this.postExecuted("element.updateProperties",r,!0);function A(h){const D=h.source,y=h.target;iA(D)&&ni(y)&&B(y)}function i(h){const D=h.connection,y=h.source,C=h.target;iA(y)&&sr(C)&&(l(C),p(y,[D]))}function o(h){const D=h.newTarget,y=h.oldSource,C=h.oldTarget;if(C!==D){const m=y;ni(C)&&B(C),iA(m)&&sr(D)&&l(D)}}function r(h){const{element:D}=h;ni(D)?(g(D),E(D)):sr(D)&&d(D)}function a(h){const{newData:D,oldShape:y}=h;if(iA(h.oldShape)&&D.eventDefinitionType!=="bpmn:CompensateEventDefinition"||D.type!=="bpmn:BoundaryEvent"){const C=y.outgoing.find(({target:m})=>ni(m));C&&C.target&&(h._connectionTarget=C.target)}else if(!iA(h.oldShape)&&D.eventDefinitionType==="bpmn:CompensateEventDefinition"&&D.type==="bpmn:BoundaryEvent"){const C=y.outgoing.find(({target:m})=>sr(m));C&&C.target&&(h._connectionTarget=C.target),u(y)}}function c(h){const{_connectionTarget:D,newShape:y}=h;D&&t.connect(y,D)}function l(h){t.updateProperties(h,{isForCompensation:!0})}function B(h){t.updateProperties(h,{isForCompensation:void 0})}function g(h){for(const D of h.incoming)n.canConnect(D.source,h)||t.removeConnection(D);for(const D of h.outgoing)n.canConnect(h,D.target)||t.removeConnection(D)}function p(h,D){h.outgoing.filter(m=>f(m,"bpmn:Association")).filter(m=>ni(m.target)&&!D.includes(m)).forEach(m=>t.removeConnection(m))}function E(h){const D=h.attachers.slice();D.length&&t.removeElements(D)}function d(h){const D=h.incoming.filter(y=>iA(y.source));t.removeElements(D)}function u(h){const D=h.outgoing.filter(y=>f(y,"bpmn:SequenceFlow"));t.removeElements(D)}}W(ms,j),ms.$inject=["eventBus","modeling","bpmnRules"];function ni(e){const t=P(e);return t&&t.get("isForCompensation")}function iA(e){return e&&f(e,"bpmn:BoundaryEvent")&&jn(e,"bpmn:CompensateEventDefinition")}function sr(e){return e&&f(e,"bpmn:Activity")&&!h2(e)}function fs(e){e.invoke(j,this),this.preExecute("shape.create",1500,function(t){var n=t.context,A=n.parent,i=n.shape;f(A,"bpmn:Lane")&&!f(i,"bpmn:Lane")&&(n.parent=$n(A,"bpmn:Participant"))})}fs.$inject=["injector"],W(fs,j);function Cs(e,t){j.call(this,e),this.preExecute("shape.create",function(n){var A=n.context,i=A.shape;if(f(i,"bpmn:DataObjectReference")&&i.type!=="label"){var o=t.create("bpmn:DataObject");i.businessObject.dataObjectRef=o}})}Cs.$inject=["eventBus","bpmnFactory"],W(Cs,j);var Ms=20,Ds=20,S4=30,lr=2e3;function ys(e,t,n){j.call(this,t),t.on(["create.start","shape.move.start"],lr,function(i){var o=i.context,r=o.shape,a=e.getRootElement();if(!(!f(r,"bpmn:Participant")||!f(a,"bpmn:Process")||!a.children.length)){var c=a.children.filter(function(g){return!f(g,"bpmn:Group")&&!f0(g)&&!Y0(g)});if(c.length){var l=i2(c),B=AI(r,l);N(r,B),o.createConstraints=iI(r,l)}}}),t.on("create.start",lr,function(i){var o=i.context,r=o.shape,a=e.getRootElement(),c=e.getGraphics(a);function l(B){B.element=a,B.gfx=c}f(r,"bpmn:Participant")&&f(a,"bpmn:Process")&&(t.on("element.hover",lr,l),t.once("create.cleanup",function(){t.off("element.hover",l)}))});function A(){var i=e.getRootElement();return f(i,"bpmn:Collaboration")?i:n.makeCollaboration()}this.preExecute("elements.create",lr,function(i){var o=i.elements,r=i.parent,a=oI(o),c;a&&f(r,"bpmn:Process")&&(i.parent=A(),c=i.hints=i.hints||{},c.participant=a,c.process=r,c.processRef=P(a).get("processRef"))},!0),this.preExecute("shape.create",function(i){var o=i.parent,r=i.shape;f(r,"bpmn:Participant")&&f(o,"bpmn:Process")&&(i.parent=A(),i.process=o,i.processRef=P(r).get("processRef"))},!0),this.execute("shape.create",function(i){var o=i.hints||{},r=i.process||o.process,a=i.shape,c=o.participant;r&&(!c||a===c)&&P(a).set("processRef",P(r))},!0),this.revert("shape.create",function(i){var o=i.hints||{},r=i.process||o.process,a=i.processRef||o.processRef,c=i.shape,l=o.participant;r&&(!l||c===l)&&P(c).set("processRef",a)},!0),this.postExecute("shape.create",function(i){var o=i.hints||{},r=i.process||i.hints.process,a=i.shape,c=o.participant;if(r){var l=r.children.slice();c?a===c&&n.moveElements(l,{x:0,y:0},c):n.moveElements(l,{x:0,y:0},a)}},!0)}ys.$inject=["canvas","eventBus","modeling"],W(ys,j);function AI(e,t){t={width:t.width+Ms*2+S4,height:t.height+Ds*2};var n=Math.max(e.width,t.width),A=Math.max(e.height,t.height);return{x:-n/2,y:-A/2,width:n,height:A}}function iI(e,t){return t=e0(t),{bottom:t.top+e.height/2-Ds,left:t.right-e.width/2+Ms,top:t.bottom-e.height/2+Ds,right:t.left+e.width/2-Ms-S4}}function oI(e){return m0(e,function(t){return f(t,"bpmn:Participant")})}var T4="__targetRef_placeholder";function Is(e,t){j.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],k4(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],k4(o));function n(r,a,c){var l=r.get("dataInputAssociations");return m0(l,function(B){return B!==c&&B.targetRef===a})}function A(r,a){var c=r.get("properties"),l=m0(c,function(B){return B.name===T4});return!l&&a&&(l=t.create("bpmn:Property",{name:T4}),o2(c,l)),l}function i(r,a){var c=A(r);c&&(n(r,c,a)||X0(r.get("properties"),c))}function o(r){var a=r.context,c=a.connection,l=c.businessObject,B=c.target,g=B&&B.businessObject,p=a.newTarget,E=p&&p.businessObject,d=a.oldTarget||a.target,u=d&&d.businessObject,h=c.businessObject,D;u&&u!==g&&i(u,l),E&&E!==g&&i(E,l),g?(D=A(g,!0),h.targetRef=D):h.targetRef=null}}Is.$inject=["eventBus","bpmnFactory"],W(Is,j);function k4(e){return function(t){var n=t.context,A=n.connection;if(f(A,"bpmn:DataInputAssociation"))return e(t)}}function Br(e){this._bpmnUpdater=e}Br.$inject=["bpmnUpdater"],Br.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,A=e.newSemanticParent,i=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,A),this._bpmnUpdater.updateDiParent(n,i),[]},Br.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,A=e.oldSemanticParent,i=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,A),this._bpmnUpdater.updateDiParent(n,i),[]};function Fs(e,t,n,A){j.call(this,A),t.registerHandler("dataStore.updateContainment",Br);function i(){return n.filter(function(a){return f(a,"bpmn:Participant")&&P(a).processRef})[0]}function o(a){return a.children.filter(function(c){return f(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function r(a,c){var l=a.businessObject||a;if(c=c||i(),c){var B=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:l,dataStoreDi:h0(a),newSemanticParent:B.processRef||B,newDiParent:h0(c)})}}this.preExecute("shape.create",function(a){var c=a.context,l=c.shape;f(l,"bpmn:DataStoreReference")&&l.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(a){var c=a.context,l=c.shapes,B=l.filter(function(g){return f(g,"bpmn:DataStoreReference")});B.length&&(c.hints||(c.hints={}),c.hints.autoResize=l.filter(function(g){return!f(g,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(a){var c=a.context,l=c.shape,B=l.parent;f(l,"bpmn:DataStoreReference")&&l.type!=="label"&&f(B,"bpmn:Collaboration")&&r(l)}),this.postExecute("shape.move",function(a){var c=a.context,l=c.shape,B=c.oldParent,g=l.parent;if(!f(B,"bpmn:Collaboration")&&f(l,"bpmn:DataStoreReference")&&l.type!=="label"&&f(g,"bpmn:Collaboration")){var p=f(B,"bpmn:Participant")?B:aI(B,"bpmn:Participant");r(l,p)}}),this.postExecute("shape.delete",function(a){var c=a.context,l=c.shape,B=e.getRootElement();a0(l,["bpmn:Participant","bpmn:SubProcess"])&&f(B,"bpmn:Collaboration")&&o(B).filter(function(g){return rI(g,l)}).forEach(function(g){r(g)})}),this.postExecute("canvas.updateRoot",function(a){var c=a.context,l=c.oldRoot,B=c.newRoot,g=o(l);g.forEach(function(p){f(B,"bpmn:Process")&&r(p,B)})})}Fs.$inject=["canvas","commandStack","elementRegistry","eventBus"],W(Fs,j);function rI(e,t){for(var n=e.businessObject||e,A=t.businessObject||t;n.$parent;){if(n.$parent===A.processRef||A)return!0;n=n.$parent}return!1}function aI(e,t){for(;e.parent;){if(f(e.parent,t))return e.parent;e=e.parent}}var gr=Math.max,pr=Math.min,cI=20;function G4(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function sI(e,t,n){var A=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+A:t.indexOf("w")!==-1&&(o.x=e.x+A,o.width=e.width-A),o}function lI(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 Er(e,t,n){var A=t[e],i=n.min&&n.min[e],o=n.max&&n.max[e];return A0(i)&&(A=(/top|left/.test(e)?pr:gr)(A,i)),A0(o)&&(A=(/top|left/.test(e)?gr:pr)(A,o)),A}function BI(e,t){if(!t)return e;var n=e0(e);return Qo({top:Er("top",n,t),right:Er("right",n,t),bottom:Er("bottom",n,t),left:Er("left",n,t)})}function gI(e,t,n,A){var i=e0(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},r=A?e0(A):o,a={top:pr(o.top,r.top),left:pr(o.left,r.left),bottom:gr(o.bottom,r.bottom),right:gr(o.right,r.right)};return Qo(a)}function Ai(e,t){return typeof e<"u"?e:cI}function pI(e,t){var n,A,i,o;return typeof t=="object"?(n=Ai(t.left),A=Ai(t.right),i=Ai(t.top),o=Ai(t.bottom)):n=A=i=o=Ai(t),{x:e.x-n,y:e.y-i,width:e.width+n+A,height:e.height+i+o}}function EI(e){return!(e.waypoints||e.type==="label")}function H4(e,t){var n;if(e.length===void 0?n=l0(e.children,EI):n=e,n.length)return pI(i2(n),t)}var Yt=Math.abs;function dI(e,t){return G4(e0(t),e0(e))}var uI=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],oe=30;function dr(e,t){return t=t||[],e.children.filter(function(n){f(n,"bpmn:Lane")&&(dr(n,t),t.push(n))}),t}function it(e){return e.children.filter(function(t){return f(t,"bpmn:Lane")})}function re(e){return $n(e,uI)||e}function QI(e,t){var n=re(e),A=f(n,"bpmn:Process")?[]:[n],i=dr(n,A),o=e0(e),r=e0(t),a=dI(e,t),c=[],l=l2(e);return i.forEach(function(B){if(B!==e){var g=l?0:a.top,p=l?a.right:0,E=l?0:a.bottom,d=l?a.left:0,u=e0(B);a.top&&(Yt(u.bottom-o.top)<10&&(E=r.top-u.bottom),Yt(u.top-o.top)<5&&(g=r.top-u.top)),a.left&&(Yt(u.right-o.left)<10&&(p=r.left-u.right),Yt(u.left-o.left)<5&&(d=r.left-u.left)),a.bottom&&(Yt(u.top-o.bottom)<10&&(g=r.bottom-u.top),Yt(u.bottom-o.bottom)<5&&(E=r.bottom-u.bottom)),a.right&&(Yt(u.left-o.right)<10&&(d=r.right-u.left),Yt(u.right-o.right)<5&&(p=r.right-u.right)),(g||p||E||d)&&c.push({shape:B,newBounds:lI(B,{top:g,right:p,bottom:E,left:d})})}}),c}var hI=500;function vs(e,t){j.call(this,e);function n(A,i){var o=l2(A),r=it(i),a=[],c=[],l=[],B=[];if(nn(r,function(h){return o?h.y>A.y?c.push(h):a.push(h):h.x>A.x?B.push(h):l.push(h),h.children}),!!r.length){var g;o?c.length&&a.length?g=A.height/2:g=A.height:B.length&&l.length?g=A.width/2:g=A.width;var p,E,d,u;a.length&&(p=t.calculateAdjustments(a,"y",g,A.y-10),t.makeSpace(p.movingShapes,p.resizingShapes,{x:0,y:g},"s")),c.length&&(E=t.calculateAdjustments(c,"y",-g,A.y+A.height+10),t.makeSpace(E.movingShapes,E.resizingShapes,{x:0,y:-g},"n")),l.length&&(d=t.calculateAdjustments(l,"x",g,A.x-10),t.makeSpace(d.movingShapes,d.resizingShapes,{x:g,y:0},"e")),B.length&&(u=t.calculateAdjustments(B,"x",-g,A.x+A.width+10),t.makeSpace(u.movingShapes,u.resizingShapes,{x:-g,y:0},"w"))}}this.postExecuted("shape.delete",hI,function(A){var i=A.context,o=i.hints,r=i.shape,a=i.oldParent;f(r,"bpmn:Lane")&&(o&&o.nested||n(r,a))})}vs.$inject=["eventBus","spaceTool"],W(vs,j);var P4=500;function ur(e,t){t.invoke(j,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",P4,function(A){var i=A.elements;i.filter(function(o){var r=o.host;return J4(o,r)}).map(function(o){return i.indexOf(o)}).forEach(function(o){A.elements[o]=n._replaceShape(i[o])})},!0),this.preExecute("elements.move",P4,function(A){var i=A.shapes,o=A.newHost;i.forEach(function(r,a){var c=r.host;J4(r,mI(i,c)?c:o)&&(i[a]=n._replaceShape(r))})},!0)}ur.$inject=["bpmnReplace","injector"],W(ur,j),ur.prototype._replaceShape=function(e){var t=wI(e),n;return t?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function wI(e){var t=P(e),n=t.eventDefinitions;return n&&n[0]}function J4(e,t){return!f0(e)&&f(e,"bpmn:BoundaryEvent")&&!t}function mI(e,t){return e.indexOf(t)!==-1}function xs(e,t,n){j.call(this,e);function A(i,o,r){var a=o.waypoints,c,l,B,g,p,E,d,u=i.outgoing.slice(),h=i.incoming.slice(),D;A0(r.width)?D=i0(r):D=r;var y=os(a,D);if(y){if(c=a.slice(0,y.index),l=a.slice(y.index+(y.bendpoint?1:0)),!c.length||!l.length)return;B=y.bendpoint?a[y.index]:D,(c.length===1||!j4(i,c[c.length-1]))&&c.push(V4(B)),(l.length===1||!j4(i,l[0]))&&l.unshift(V4(B))}g=o.source,p=o.target,t.canConnect(g,i,o)&&(n.reconnectEnd(o,i,c||D),E=o),t.canConnect(i,p,o)&&(E?d=n.connect(i,p,{type:o.type,waypoints:l}):(n.reconnectStart(o,i,l||D),d=o));var C=[].concat(E&&l0(h,function(m){return m.source===E.source})||[],d&&l0(u,function(m){return m.target===d.target})||[]);C.length&&n.removeElements(C)}this.preExecute("elements.move",function(i){var o=i.newParent,r=i.shapes,a=i.delta,c=r[0];if(!(!c||!o)){o&&o.waypoints&&(i.newParent=o=o.parent);var l=i0(c),B={x:l.x+a.x,y:l.y+a.y},g=m0(o.children,function(p){var E=t.canInsert(r,p);return E&&os(p.waypoints,B)});g&&(i.targetFlow=g,i.position=B)}},!0),this.postExecuted("elements.move",function(i){var o=i.shapes,r=i.targetFlow,a=i.position;r&&A(o[0],r,a)},!0),this.preExecute("shape.create",function(i){var o=i.parent,r=i.shape;t.canInsert(r,o)&&(i.targetFlow=o,i.parent=o.parent)},!0),this.postExecuted("shape.create",function(i){var o=i.shape,r=i.targetFlow,a=i.position;r&&A(o,r,a)},!0)}W(xs,j),xs.$inject=["eventBus","bpmnRules","modeling"];function j4(e,t){var n=t.x,A=t.y;return n>=e.x&&n<=e.x+e.width&&A>=e.y&&A<=e.y+e.height}function V4(e){return N({},e)}function bs(e,t){j.call(this,e),this.preExecuted("connection.create",function(n){var A=n.context,i=A.connection,o=A.source,r=A.target,a=A.hints;if(!(a&&a.createElementsBehavior===!1)&&oA(i)){var c=[];f(o,"bpmn:EventBasedGateway")?c=r.incoming.filter(l=>l!==i&&oA(l)):c=r.incoming.filter(l=>l!==i&&oA(l)&&f(l.source,"bpmn:EventBasedGateway")),c.forEach(function(l){t.removeConnection(l)})}}),this.preExecuted("shape.replace",function(n){var A=n.context,i=A.newShape;if(f(i,"bpmn:EventBasedGateway")){var o=i.outgoing.filter(oA).reduce(function(r,a){return r.includes(a.target)?r:r.concat(a.target)},[]);o.forEach(function(r){r.incoming.filter(oA).forEach(function(a){const c=r.incoming.filter(oA).filter(function(l){return l.source===i});(a.source!==i||c.length>1)&&t.removeConnection(a)})})}})}bs.$inject=["eventBus","modeling"],W(bs,j);function oA(e){return f(e,"bpmn:SequenceFlow")}var Qr=1500,L4=2e3;function W4(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"],Qr,function(A){var i=A.context,o=i.shape||A.shape,r=A.hover;f(r,"bpmn:Lane")&&!a0(o,["bpmn:Lane","bpmn:Participant"])&&(A.hover=re(r),A.hoverGfx=e.getGraphics(A.hover));var a=n.getRootElement();r!==a&&(o.labelTarget||a0(o,["bpmn:Group","bpmn:TextAnnotation"]))&&(A.hover=a,A.hoverGfx=e.getGraphics(A.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],Qr,function(A){var i=A.hover;f(i,"bpmn:Lane")&&(A.hover=re(i)||i,A.hoverGfx=e.getGraphics(A.hover))}),t.on(["bendpoint.move.hover"],Qr,function(A){var i=A.context,o=A.hover,r=i.type;f(o,"bpmn:Lane")&&/reconnect/.test(r)&&(A.hover=re(o)||o,A.hoverGfx=e.getGraphics(A.hover))}),t.on(["connect.start"],Qr,function(A){var i=A.context,o=i.start;f(o,"bpmn:Lane")&&(i.start=re(o)||o)}),t.on("shape.move.start",L4,function(A){var i=A.shape;f(i,"bpmn:Lane")&&(A.shape=re(i)||i)}),t.on("spaceTool.move",L4,function(A){var i=A.hover;i&&f(i,"bpmn:Lane")&&(A.hover=re(i))})}W4.$inject=["elementRegistry","eventBus","canvas"];function fI(e){return e.create("bpmn:Category")}function CI(e){return e.create("bpmn:CategoryValue")}function MI(e,t,n){return o2(t.get("categoryValue"),e),e.$parent=t,o2(n.get("rootElements"),t),t.$parent=n,e}function DI(e){var t=e.$parent;return t&&(X0(t.get("categoryValue"),e),e.$parent=null),e}function yI(e){var t=e.$parent;return t&&(X0(t.get("rootElements"),e),e.$parent=null),e}var _4=770;function Ys(e,t,n,A,i,o){i.invoke(j,this);function r(){return n.filter(function(d){return f(d,"bpmn:Group")})}function a(d,u){return d.some(function(h){var D=P(h),y=D.categoryValueRef&&D.categoryValueRef.$parent;return y===u})}function c(d,u){return d.some(function(h){var D=P(h);return D.categoryValueRef===u})}function l(d,u,h){var D=r().filter(function(y){return y.businessObject!==h});u&&!a(D,u)&&yI(u),d&&!c(D,d)&&DI(d)}function B(d,u){return MI(d,u,t.getDefinitions())}function g(d,u){var h=P(d),D=h.categoryValueRef;D||(D=h.categoryValueRef=u.categoryValue=u.categoryValue||CI(e));var y=D.$parent;y||(y=D.$parent=u.category=u.category||fI(e)),B(D,y,t.getDefinitions())}function p(d,u){var h=u.category,D=u.categoryValue,y=P(d);D?(y.categoryValueRef=null,l(D,h,y)):l(null,y.categoryValueRef.$parent,y)}this.execute("label.create",function(d){var u=d.context,h=u.labelTarget;f(h,"bpmn:Group")&&g(h,u)}),this.revert("label.create",function(d){var u=d.context,h=u.labelTarget;f(h,"bpmn:Group")&&p(h,u)}),this.execute("shape.delete",function(d){var u=d.context,h=u.shape,D=P(h);if(!(!f(h,"bpmn:Group")||h.labelTarget)){var y=u.categoryValue=D.categoryValueRef,C;y&&(C=u.category=y.$parent,l(y,C,D),D.categoryValueRef=null)}}),this.reverted("shape.delete",function(d){var u=d.context,h=u.shape;if(!(!f(h,"bpmn:Group")||h.labelTarget)){var D=u.category,y=u.categoryValue,C=P(h);y&&(C.categoryValueRef=y,B(y,D))}}),this.execute("shape.create",function(d){var u=d.context,h=u.shape;!f(h,"bpmn:Group")||h.labelTarget||P(h).categoryValueRef&&g(h,u)}),this.reverted("shape.create",function(d){var u=d.context,h=u.shape;!f(h,"bpmn:Group")||h.labelTarget||P(h).categoryValueRef&&p(h,u)});function E(d,u){var h=e.create(d.$type);return o.copyElement(d,h,null,u)}A.on("copyPaste.copyElement",_4,function(d){var u=d.descriptor,h=d.element;if(!(!f(h,"bpmn:Group")||h.labelTarget)){var D=P(h);if(D.categoryValueRef){var y=D.categoryValueRef;u.categoryValue=E(y,!0),y.$parent&&(u.category=E(y.$parent,!0))}}}),A.on("copyPaste.pasteElement",_4,function(d){var u=d.descriptor,h=u.businessObject,D=u.categoryValue,y=u.category;D&&(D=h.categoryValueRef=E(D)),y&&(D.$parent=E(y)),delete u.category,delete u.categoryValue})}Ys.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],W(Ys,j);function Us(e,t,n,A){var i,o,r,a,c;return i=(A.y-n.y)*(t.x-e.x)-(A.x-n.x)*(t.y-e.y),i==0?null:(o=e.y-n.y,r=e.x-n.x,c=(A.x-n.x)*o-(A.y-n.y)*r,a=c/i,{x:Math.round(e.x+a*(t.x-e.x)),y:Math.round(e.y+a*(t.y-e.y))})}function O4(e){function t(A,i,o){var r={x:o.x,y:o.y-50},a={x:o.x-50,y:o.y},c=Us(A,i,o,r),l=Us(A,i,o,a),B;c&&l?X4(c,o)>X4(l,o)?B=l:B=c:B=c||l,A.original=B}function n(A){var i=A.waypoints;t(i[0],i[1],i0(A.source)),t(i[i.length-1],i[i.length-2],i0(A.target))}e.on("bpmnElement.added",function(A){var i=A.element;i.waypoints&&n(i)})}O4.$inject=["eventBus"];function X4(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ns(e){j.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var A=n.context.shape,i=P(A),o=h0(A);if(a0(i,t)){var r=o.get("isHorizontal");r===void 0&&(r=!0),o.set("isHorizontal",r)}})}Ns.$inject=["eventBus"],W(Ns,j);var K4=Math.sqrt,Z4=Math.min,II=Math.max,q4=Math.abs;function $4(e){return Math.pow(e,2)}function ii(e,t){return K4($4(e.x-t.x)+$4(e.y-t.y))}function FI(e,t){var n=0,A,i,o,r,a,c,l,B,g,p,E;for(n=0;n<t.length-1;n++){if(A=t[n],i=t[n+1],tE(A,i)?l=[A]:(o=ii(e,A),r=ii(e,i),c=Z4(o,r),l=vI(A,i,e,c)),l.length<1)throw new Error("expected between [1, 2] circle -> line intersections");l.length===1&&(B={type:"bendpoint",position:l[0],segmentIndex:n,bendpointIndex:tE(A,l[0])?n:n+1}),l.length===2&&(a=bI(l[0],l[1]),B={type:"segment",position:a,segmentIndex:n,relativeLocation:ii(A,a)/ii(A,i)}),g=ii(B.position,e),(!E||p>g)&&(E=B,p=g)}return E}function vI(e,t,n,A){var i=t.x-e.x,o=t.y-e.y,r=n.x-e.x,a=n.y-e.y,c=i*i+o*o,l=i*r+o*a,B=r*r+a*a-A*A,g=l/c,p=B/c,E=g*g-p;if(E<0&&E>-1e-6&&(E=0),E<0)return[];var d=K4(E),u=-g+d,h=-g-d,D={x:e.x-i*u,y:e.y-o*u};if(E===0)return[D];var y={x:e.x-i*h,y:e.y-o*h};return[D,y].filter(function(C){return xI(C,e,t)})}function xI(e,t,n){return eE(e.x,t.x,n.x)&&eE(e.y,t.y,n.y)}function eE(e,t,n){return e>=Z4(t,n)-hr&&e<=II(t,n)+hr}function bI(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var hr=.1;function tE(e,t){return q4(e.x-t.x)<=hr&&q4(e.y-t.y)<=hr}function YI(e,t,n,A){var i=n.segmentIndex,o=t.length-e.length;if(A.segmentMove){var r=A.segmentMove.segmentStartIndex,a=A.segmentMove.newSegmentStartIndex;return i===r?a:i>=a?i+o<a?a:i+o:i}if(A.bendpointMove){var c=A.bendpointMove.insert,l=A.bendpointMove.bendpointIndex,B;if(o===0)return i;if(i>=l&&(B=c?i+1:i-1),i<l&&(B=i,c&&n.type!=="bendpoint"&&l-1===i)){var g=AE(t,l);g<n.relativeLocation&&B++}return B}return o===0?i:A.connectionStart&&i===0?0:A.connectionEnd&&i===e.length-2?t.length-2:Math.floor((t.length-2)/2)}function nE(e,t,n,A){var i=0,o=0,r={point:e,delta:{x:0,y:0}},a=FI(e,n),c=a.segmentIndex,l=YI(n,t,a,A);if(l<0||l>t.length-2||l===null)return r;var B=iE(n,c),g=iE(t,l),p=a.position,E=NI(B,p),d=UI(B,g);if(a.type==="bendpoint"){var u=t.length-n.length,h=a.bendpointIndex,D=n[h];if(t.indexOf(D)!==-1)return r;if(u===0){var y=t[h];return i=y.x-a.position.x,o=y.y-a.position.y,{delta:{x:i,y:o},point:{x:e.x+i,y:e.y+o}}}u<0&&h!==0&&h<n.length-1&&(E=AE(n,h))}var C={x:(g[1].x-g[0].x)*E+g[0].x,y:(g[1].y-g[0].y)*E+g[0].y},m=Cy({x:e.x-p.x,y:e.y-p.y},d);return i=C.x+m.x-e.x,o=C.y+m.y-e.y,{point:_e(C),delta:_e({x:i,y:o})}}function AE(e,t){var n=Ar(e[t-1],e[t]),A=Ar(e[t],e[t+1]),i=n/(n+A);return i}function UI(e,t){var n=A4(e),A=A4(t);return A-n}function iE(e,t){return[e[t],e[t+1]]}function NI(e,t){var n=Ar(e[0],e[1]),A=Ar(e[0],t);return n===0?0:A/n}function zI(e,t,n,A){var i=i0(e);return nE(i,t,n,A).delta}function oi(e,t,n){var A=WA(t),i=WA(n),o=Me(e,A),r={x:o.x*(n.width/t.width),y:o.y*(n.height/t.height)};return _e({x:i.x+r.x,y:i.y+r.y})}function oE(e,t,n){var A=WA(e),i=WA(t),o=WA(n),r=Me(e,A),a=Me(A,i),c=RI(A,t,n);if(c)return c;var l={x:a.x*(n.width/t.width),y:a.y*(n.height/t.height)},B={x:o.x+l.x,y:o.y+l.y};return _e({x:B.x+r.x-e.x,y:B.y+r.y-e.y})}function RI(e,t,n){var A=e0(t),i=e0(n);if(SI(A,i))return null;var o=f2(t,e),r,a,c;if(o==="top")r={x:0,y:i.bottom-A.bottom};else if(o==="bottom")r={x:0,y:i.top-A.top};else if(o==="right")r={x:i.left-A.left,y:0};else if(o==="left")r={x:i.right-A.right,y:0};else return null;return a={x:e.x+r.x,y:e.y+r.y},c=f2(n,a),c!==o?null:r}function SI(e,t){return TI(e,t)||kI(e,t)}function TI(e,t){return e.right!==t.right&&e.left!==t.left}function kI(e,t){return e.top!==t.top&&e.bottom!==t.bottom}var rE="name",aE="text";function zs(e,t,n,A){j.call(this,e),this.postExecute("element.updateProperties",i),this.postExecute("element.updateModdleProperties",r=>{P(r.context.element)===r.context.moddleElement&&i(r)});function i(r){var a=r.context,c=a.element,l=a.properties;if(rE in l&&t.updateLabel(c,l[rE]),aE in l&&f(c,"bpmn:TextAnnotation")){var B=A.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},l[aE]||"");t.updateLabel(c,l.text,B)}}this.postExecute(["shape.create","connection.create"],function(r){var a=r.context,c=a.hints||{};if(c.createElementsBehavior!==!1){var l=a.shape||a.connection;f0(l)||!an(l)||fe(l)&&t.updateLabel(l,fe(l))}}),this.postExecute("shape.delete",function(r){var a=r.context,c=a.labelTarget,l=a.hints||{};c&&l.unsetLabel!==!1&&t.updateLabel(c,null,null,{removeShape:!1})});function o(r){var a=r.context,c=a.connection,l=c.label,B=N({},a.hints),g=a.newWaypoints||c.waypoints,p=a.oldWaypoints;return typeof B.startChanged>"u"&&(B.startChanged=!!B.connectionStart),typeof B.endChanged>"u"&&(B.endChanged=!!B.connectionEnd),zI(l,g,p,B)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(r){var a=r.context,c=a.hints||{};if(c.labelBehavior!==!1){var l=a.connection,B=l.label,g;!B||!B.parent||(g=o(r),t.moveShape(B,g))}}),this.postExecute(["shape.replace"],function(r){var a=r.context,c=a.newShape,l=a.oldShape,B=P(c);B&&an(B)&&l.label&&c.label&&(c.label.x=l.label.x,c.label.y=l.label.y)}),this.postExecute("shape.resize",function(r){var a=r.context,c=a.shape,l=a.newBounds,B=a.oldBounds;if(Io(c)){var g=c.label,p=i0(g),E=PI(B),d=HI(p,E),u=GI(d,B,l);t.moveShape(g,u)}})}W(zs,j),zs.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function GI(e,t,n){var A=oi(e,t,n);return _e(Me(A,e))}function HI(e,t){if(t.length){var n=JI(e,t);return rs(e,n)}}function PI(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 JI(e,t){var n=t.map(function(i){return{line:i,distance:i4(e,i)}}),A=he(n,"distance");return A[0].line}function jI(e,t,n,A){return nE(e,t,n,A).point}function Rs(e,t){j.call(this,e);function n(A,i){var o=A.context,r=o.connection,a=N({},o.hints),c=o.newWaypoints||r.waypoints,l=o.oldWaypoints;return typeof a.startChanged>"u"&&(a.startChanged=!!a.connectionStart),typeof a.endChanged>"u"&&(a.endChanged=!!a.connectionEnd),jI(i,c,l,a)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(A){var i=A.context,o=i.connection,r=o.outgoing,a=o.incoming;a.forEach(function(c){var l=c.waypoints[c.waypoints.length-1],B=n(A,l),g=[].concat(c.waypoints.slice(0,-1),[B]);t.updateWaypoints(c,g)}),r.forEach(function(c){var l=c.waypoints[0],B=n(A,l),g=[].concat([B],c.waypoints.slice(1));t.updateWaypoints(c,g)})}),this.postExecute(["connection.move"],function(A){var i=A.context,o=i.connection,r=o.outgoing,a=o.incoming,c=i.delta;a.forEach(function(l){var B=l.waypoints[l.waypoints.length-1],g={x:B.x+c.x,y:B.y+c.y},p=[].concat(l.waypoints.slice(0,-1),[g]);t.updateWaypoints(l,p)}),r.forEach(function(l){var B=l.waypoints[0],g={x:B.x+c.x,y:B.y+c.y},p=[].concat([g],l.waypoints.slice(1));t.updateWaypoints(l,p)})})}W(Rs,j),Rs.$inject=["eventBus","modeling"];function wr(e,t,n){var A=fr(e),i=sE(A,t),o=A[0];return i.length?i[i.length-1]:oi(o.original||o,n,t)}function mr(e,t,n){var A=fr(e),i=sE(A,t),o=A[A.length-1];return i.length?i[0]:oi(o.original||o,n,t)}function Ss(e,t,n){var A=fr(e),i=cE(t,n),o=A[0];return oi(o.original||o,i,t)}function Ts(e,t,n){var A=fr(e),i=cE(t,n),o=A[A.length-1];return oi(o.original||o,i,t)}function cE(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function fr(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function sE(e,t){var n=B2(e,LI);return l0(n,function(A){return VI(A,t)})}function VI(e,t){return f2(t,e,1)==="intersect"}function LI(e){return e.original||e}function ks(e,t){j.call(this,e),this.postExecute("shape.replace",function(n){var A=n.oldShape,i=n.newShape;if(WI(A,i)){var o=_I(A);o.incoming.forEach(function(r){var a=mr(r,i,A);t.reconnectEnd(r,i,a)}),o.outgoing.forEach(function(r){var a=wr(r,i,A);t.reconnectStart(r,i,a)})}},!0)}ks.$inject=["eventBus","modeling"],W(ks,j);function WI(e,t){return f(e,"bpmn:Participant")&&E0(e)&&f(t,"bpmn:Participant")&&!E0(t)}function _I(e){var t=YA([e],!1),n=[],A=[];return t.forEach(function(i){i!==e&&(i.incoming.forEach(function(o){f(o,"bpmn:MessageFlow")&&n.push(o)}),i.outgoing.forEach(function(o){f(o,"bpmn:MessageFlow")&&A.push(o)}))},[]),{incoming:n,outgoing:A}}const OI=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function lE(e){const t=P(e);if(!f(t,"bpmn:BoundaryEvent")&&!(f(t,"bpmn:StartEvent")&&h2(t.$parent)))return!1;const n=t.get("eventDefinitions");return!n||!n.length?!1:OI.some(A=>f(n[0],A))}function BE(e){return f(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function Gs(e,t){e.invoke(j,this),this.postExecuted("shape.replace",function(n){const A=n.context.oldShape,i=n.context.newShape,o=n.context.hints;if(!lE(i))return;const r=BE(i);if(o.targetElement&&o.targetElement[r]!==void 0)return;const c=P(A).get(r),l=P(i).get(r);c!==l&&t.updateProperties(i,{[r]:c})})}Gs.$inject=["injector","modeling"],W(Gs,j);function Hs(e,t){j.call(this,e),this.preExecute("shape.resize",function(n){var A=n.shape,i=h0(A),o=i&&i.get("label"),r=o&&o.get("bounds");r&&t.updateModdleProperties(A,o,{bounds:void 0})},!0)}W(Hs,j),Hs.$inject=["eventBus","modeling"];function Ps(e,t,n){j.call(this,e),this.preExecute("shape.delete",function(A){var i=A.context.shape;if(!(i.incoming.length!==1||i.outgoing.length!==1)){var o=i.incoming[0],r=i.outgoing[0];if(!(!f(o,"bpmn:SequenceFlow")||!f(r,"bpmn:SequenceFlow"))&&t.canConnect(o.source,r.target,o)){var a=XI(o.waypoints,r.waypoints);n.reconnectEnd(o,r.target,a)}}})}W(Ps,j),Ps.$inject=["eventBus","bpmnRules","modeling"];function rA(e){return e.original||e}function XI(e,t){var n=Us(rA(e[e.length-2]),rA(e[e.length-1]),rA(t[1]),rA(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[rA(e[0]),rA(t[t.length-1])]}function Js(e,t){j.call(this,e),this.preExecute("shape.delete",function(n){var A=n.shape,i=A.parent;f(A,"bpmn:Participant")&&(n.collaborationRoot=i)},!0),this.postExecute("shape.delete",function(n){var A=n.collaborationRoot;if(A&&!A.businessObject.participants.length){var i=t.makeProcess(),o=A.children.slice();t.moveElements(o,{x:0,y:0},i)}},!0)}Js.$inject=["eventBus","modeling"],W(Js,j);function js(e,t,n,A){j.call(this,e);var i=A.get("dragging",!1);function o(c){var l=c.source,B=c.target,g=c.parent;if(g){var p,E;f(c,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(l,B)||(E=!0),n.canConnectMessageFlow(l,B)&&(p="bpmn:MessageFlow")),f(c,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(l,B)||(E=!0),n.canConnectSequenceFlow(l,B)&&(p="bpmn:SequenceFlow")),E&&t.removeConnection(c),p&&t.connect(l,B,{type:p,waypoints:c.waypoints.slice()})}}function r(c){var l=c.context,B=l.connection,g=l.newSource||B.source,p=l.newTarget||B.target,E,d;E=n.canConnect(g,p),!(!E||E.type===B.type)&&(d=t.connect(g,p,{type:E.type,associationDirection:E.associationDirection,waypoints:B.waypoints.slice()}),B.parent&&t.removeConnection(B),l.connection=d,i&&a(B,d))}function a(c,l){var B=i.context(),g=B&&B.payload.previousSelection,p;!g||!g.length||(p=g.indexOf(c),p!==-1&&g.splice(p,1,l))}this.postExecuted("elements.move",function(c){var l=c.closure,B=l.allConnections;U(B,o)},!0),this.preExecute("connection.reconnect",r),this.postExecuted("element.updateProperties",function(c){var l=c.context,B=l.properties,g=l.element,p=g.businessObject,E;B.default&&(E=m0(g.outgoing,Z2({id:g.businessObject.default.id})),E&&t.updateProperties(E,{conditionExpression:void 0})),B.conditionExpression&&p.sourceRef.default===p&&t.updateProperties(g.source,{default:void 0})})}W(js,j),js.$inject=["eventBus","modeling","bpmnRules","injector"];function Cr(e,t,n,A,i,o){A.invoke(j,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(r){var a=r.context,c=a.parent,l=a.elements,B=F2(l,function(g,p){var E=t.canReplace([p],p.host||p.parent||c);return E?g.concat(E.replacements):g},[]);B.length&&this._replaceElements(l,B)},this),this.postExecuted(["elements.move"],500,function(r){var a=r.context,c=a.newParent,l=a.newHost,B=[];U(a.closure.topLevel,function(p){h2(p)?B=B.concat(p.children):B=B.concat(p)}),B.length===1&&l&&(c=l);var g=t.canReplace(B,c);g&&this._replaceElements(B,g.replacements,l)},this),this.postExecute(["shape.replace"],1500,function(r){var a=r.context,c=a.oldShape,l=a.newShape,B=c.attachers,g;B&&B.length&&(g=t.canReplace(B,l),this._replaceElements(B,g.replacements))},this),this.postExecuted(["shape.replace"],1500,function(r){var a=r.context,c=a.oldShape,l=a.newShape;i.unclaimId(c.businessObject.id,c.businessObject),i.updateProperties(l,{id:c.id})})}W(Cr,j),Cr.prototype._replaceElements=function(e,t){var n=this._elementRegistry,A=this._bpmnReplace,i=this._selection;U(t,function(o){var r={type:o.newElementType},a=n.get(o.oldElementId),c=e.indexOf(a);e[c]=A.replaceElement(a,r,{select:!1})}),t&&i.select(e)},Cr.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var KI=1500,ZI={width:140,height:120},Vs={width:300,height:60},Ls={width:60,height:300},Mr={width:300,height:150},Dr={width:150,height:300},gE={width:140,height:120},pE={width:50,height:30};function EE(e){e.on("resize.start",KI,function(t){var n=t.context,A=n.shape,i=n.direction,o=n.balanced;(f(A,"bpmn:Lane")||f(A,"bpmn:Participant"))&&(n.resizeConstraints=nF(A,i,o)),f(A,"bpmn:SubProcess")&&E0(A)&&(n.minDimensions=gE),f(A,"bpmn:TextAnnotation")&&(n.minDimensions=pE)})}EE.$inject=["eventBus"];var Ut=Math.abs,qI=Math.min,$I=Math.max;function dE(e,t,n,A){var i=e[t];e[t]=i===void 0?n:A(n,i)}function aA(e,t,n){return dE(e,t,n,qI)}function cA(e,t,n){return dE(e,t,n,$I)}var eF={top:20,left:50,right:20,bottom:20},tF={top:50,left:20,right:20,bottom:20};function nF(e,t,n){var A=re(e),i=!0,o=!0,r=dr(A,[A]),a=e0(e),c={},l={},B=l2(e),g=B?Vs:Ls;/n/.test(t)?l.top=a.bottom-g.height:/e/.test(t)?l.right=a.left+g.width:/s/.test(t)?l.bottom=a.top+g.height:/w/.test(t)&&(l.left=a.right-g.width),r.forEach(function(d){var u=e0(d);B?(u.top<a.top-10&&(i=!1),u.bottom>a.bottom+10&&(o=!1)):(u.left<a.left-10&&(i=!1),u.right>a.right+10&&(o=!1)),/n/.test(t)&&(n&&Ut(a.top-u.bottom)<10&&cA(c,"top",u.top+g.height),Ut(a.top-u.top)<5&&aA(l,"top",u.bottom-g.height)),/e/.test(t)&&(n&&Ut(a.right-u.left)<10&&aA(c,"right",u.right-g.width),Ut(a.right-u.right)<5&&cA(l,"right",u.left+g.width)),/s/.test(t)&&(n&&Ut(a.bottom-u.top)<10&&aA(c,"bottom",u.bottom-g.height),Ut(a.bottom-u.bottom)<5&&cA(l,"bottom",u.top+g.height)),/w/.test(t)&&(n&&Ut(a.left-u.right)<10&&cA(c,"left",u.left+g.width),Ut(a.left-u.left)<5&&aA(l,"left",u.right-g.width))});var p=A.children.filter(function(d){return!d.hidden&&!d.waypoints&&(f(d,"bpmn:FlowElement")||f(d,"bpmn:Artifact"))}),E=B?eF:tF;return p.forEach(function(d){var u=e0(d);/n/.test(t)&&(!B||i)&&aA(l,"top",u.top-E.top),/e/.test(t)&&(B||o)&&cA(l,"right",u.right+E.right),/s/.test(t)&&(!B||o)&&cA(l,"bottom",u.bottom+E.bottom),/w/.test(t)&&(B||i)&&aA(l,"left",u.left-E.left)}),{min:l,max:c}}var uE=1001;function QE(e,t){e.on("resize.start",uE+500,function(n){var A=n.context,i=A.shape;(f(i,"bpmn:Lane")||f(i,"bpmn:Participant"))&&(A.balanced=!Wn(n))}),e.on("resize.end",uE,function(n){var A=n.context,i=A.shape,o=A.canExecute,r=A.newBounds;if(f(i,"bpmn:Lane")||f(i,"bpmn:Participant"))return o&&(r=zB(r),t.resizeLane(i,r,A.balanced)),!1})}QE.$inject=["eventBus","modeling"];var AF=500;function Ws(e,t,n,A,i){n.invoke(j,this);function o(B){return a0(B,["bpmn:ReceiveTask","bpmn:SendTask"])||iF(B,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function r(B){var g=e.getDefinitions(),p=g.get("rootElements");return!!m0(p,Z2({id:B.id}))}function a(B){if(f(B,"bpmn:ErrorEventDefinition"))return"errorRef";if(f(B,"bpmn:EscalationEventDefinition"))return"escalationRef";if(f(B,"bpmn:MessageEventDefinition"))return"messageRef";if(f(B,"bpmn:SignalEventDefinition"))return"signalRef"}function c(B){if(a0(B,["bpmn:ReceiveTask","bpmn:SendTask"]))return B.get("messageRef");var g=B.get("eventDefinitions"),p=g[0];return p.get(a(p))}function l(B,g){if(a0(B,["bpmn:ReceiveTask","bpmn:SendTask"]))return B.set("messageRef",g);var p=B.get("eventDefinitions"),E=p[0];return E.set(a(E),g)}this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(B){var g=B.shape||B.element;if(o(g)){var p=P(g),E=c(p),d;E&&!r(E)&&(d=e.getDefinitions().get("rootElements"),o2(d,E),B.addedRootElement=E)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(B){var g=B.addedRootElement;if(g){var p=e.getDefinitions().get("rootElements");X0(p,g)}},!0),t.on("copyPaste.copyElement",function(B){var g=B.descriptor,p=B.element;if(!(p.labelTarget||!o(p))){var E=P(p),d=c(E);d&&(g.referencedRootElement=d)}}),t.on("copyPaste.pasteElement",AF,function(B){var g=B.descriptor,p=g.businessObject,E=g.referencedRootElement;E&&(r(E)||(E=A.copyElement(E,i.create(E.$type))),l(p,E),delete g.referencedRootElement)})}Ws.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],W(Ws,j);function iF(e,t){return n0(t)||(t=[t]),Qe(t,function(n){return jn(e,n)})}var hE=Math.max;function wE(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,A=t.axis,i=t.start,o={};return U(n,function(r){var a=r.id;f(r,"bpmn:Participant")&&(o[a]=rF(r,A,i)),f(r,"bpmn:Lane")&&(o[a]=l2(r)?Vs:Ls),f(r,"bpmn:SubProcess")&&E0(r)&&(o[a]=gE),f(r,"bpmn:TextAnnotation")&&(o[a]=pE),f(r,"bpmn:Group")&&(o[a]=ZI)}),o})}wE.$inject=["eventBus"];function oF(e){return e==="x"}function rF(e,t,n){var A=l2(e);if(!sF(e))return A?Mr:Dr;var i=oF(t),o={};return i?A?o=Mr:o={width:cF(e,n,i),height:Dr.height}:A?o={width:Mr.width,height:aF(e,n,i)}:o=Dr,o}function aF(e,t,n){var A;return A=lF(e,t,n),hE(Mr.height,A)}function cF(e,t,n){var A;return A=BF(e,t,n),hE(Dr.width,A)}function sF(e){return!!it(e).length}function lF(e,t,n){var A=it(e),i;return i=_s(A,t,n),e.height-i.height+Vs.height}function BF(e,t,n){var A=it(e),i;return i=_s(A,t,n),e.width-i.width+Ls.width}function _s(e,t,n){var A,i,o;for(A=0;A<e.length;A++)if(i=e[A],!n&&t>=i.y&&t<=i.y+i.height||n&&t>=i.x&&t<=i.x+i.width)return o=it(i),o.length?_s(o,t,n):i}var mE=400,gF=600,fE={x:180,y:160};function Nt(e,t,n,A,i,o,r){j.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=A,this._bpmnFactory=i,this._bpmnjs=o,this._elementRegistry=r;var a=this;function c(g){return f(g,"bpmn:SubProcess")&&!E0(g)}function l(g){var p=g.shape,E=g.newRootElement,d=P(p);E=a._addDiagram(E||d),g.newRootElement=e.addRootElement(E)}function B(g){var p=g.shape,E=P(p);a._removeDiagram(E);var d=g.newRootElement=r.get($e(E));e.removeRootElement(d)}this.executed("shape.create",function(g){var p=g.shape;c(p)&&l(g)},!0),this.postExecuted("shape.create",function(g){var p=g.shape,E=g.newRootElement;!E||!p.children||(a._showRecursively(p.children),a._moveChildrenToShape(p,E))},!0),this.reverted("shape.create",function(g){var p=g.shape;c(p)&&B(g)},!0),this.preExecuted("shape.delete",function(g){var p=g.shape;if(c(p)){var E=r.get($e(p));E&&n.removeElements(E.children.slice())}},!0),this.executed("shape.delete",function(g){var p=g.shape;c(p)&&B(g)},!0),this.reverted("shape.delete",function(g){var p=g.shape;c(p)&&l(g)},!0),this.preExecuted("shape.replace",function(g){var p=g.oldShape,E=g.newShape;!c(p)||!c(E)||(g.oldRoot=e.removeRootElement($e(p)))},!0),this.postExecuted("shape.replace",function(g){var p=g.newShape,E=g.oldRoot,d=e.findRoot($e(p));if(!(!E||!d)){var u=E.children;n.moveElements(u,{x:0,y:0},d)}},!0),this.executed("element.updateProperties",function(g){var p=g.element;if(f(p,"bpmn:SubProcess")){var E=g.properties,d=g.oldProperties,u=d.id,h=E.id;if(u!==h){if(zo(p)){r.updateId(p,sn(h)),r.updateId(u,h);return}var D=r.get(sn(u));D&&r.updateId(sn(u),sn(h))}}},!0),this.reverted("element.updateProperties",function(g){var p=g.element;if(f(p,"bpmn:SubProcess")){var E=g.properties,d=g.oldProperties,u=d.id,h=E.id;if(u!==h){if(zo(p)){r.updateId(p,sn(u)),r.updateId(h,u);return}var D=r.get(sn(h));D&&r.updateId(D,sn(u))}}},!0),t.on("element.changed",function(g){var p=g.element;if(zo(p)){var E=p,d=r.get(bg(E));!d||d===E||t.fire("element.changed",{element:d})}}),this.executed("shape.toggleCollapse",mE,function(g){var p=g.shape;f(p,"bpmn:SubProcess")&&(E0(p)?B(g):(l(g),a._showRecursively(p.children)))},!0),this.reverted("shape.toggleCollapse",mE,function(g){var p=g.shape;f(p,"bpmn:SubProcess")&&(E0(p)?B(g):(l(g),a._showRecursively(p.children)))},!0),this.postExecuted("shape.toggleCollapse",gF,function(g){var p=g.shape;if(f(p,"bpmn:SubProcess")){var E=g.newRootElement;E&&(E0(p)?a._moveChildrenToShape(E,p):a._moveChildrenToShape(p,E))}},!0),t.on("copyPaste.createTree",function(g){var p=g.element,E=g.children;if(c(p)){var d=$e(p),u=r.get(d);u&&E.push.apply(E,u.children)}}),t.on("copyPaste.copyElement",function(g){var p=g.descriptor,E=g.element,d=g.elements,u=E.parent,h=f(h0(u),"bpmndi:BPMNPlane");if(h){var D=bg(u),y=m0(d,function(C){return C.id===D});y&&(p.parent=y.id)}}),t.on("copyPaste.pasteElement",function(g){var p=g.descriptor;p.parent&&(c(p.parent)||p.parent.hidden)&&(p.hidden=!0)})}W(Nt,j),Nt.prototype._moveChildrenToShape=function(e,t){var n=this._modeling,A=e.children,i;if(A){A=A.concat(A.reduce(function(l,B){return B.label&&B.label.parent!==e?l.concat(B.label):l},[]));var o=A.filter(function(l){return!l.hidden});if(!o.length){n.moveElements(A,{x:0,y:0},t,{autoResize:!1});return}var r=i2(o);if(!t.x)i={x:fE.x-r.x,y:fE.y-r.y};else{var a=i0(t),c=i0(r);i={x:a.x-c.x,y:a.y-c.y}}n.moveElements(A,i,t,{autoResize:!1})}},Nt.prototype._showRecursively=function(e,t){var n=this,A=[];return e.forEach(function(i){i.hidden=!!t,A=A.concat(i),i.children&&(A=A.concat(n._showRecursively(i.children,i.collapsed||t)))}),A},Nt.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},Nt.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,A=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),i=t.create("bpmndi:BPMNDiagram",{plane:A});A.$parent=i;var o=n.createRoot({id:$e(e),type:e.$type,di:A,businessObject:e,collapsed:!0});return o},Nt.prototype._removeDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams,A=m0(n,function(i){return i.plane.bpmnElement.id===e.id});return n.splice(n.indexOf(A),1),A},Nt.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function Os(e,t){e.invoke(j,this),this.postExecuted("shape.replace",function(n){var A=n.context.oldShape,i=n.context.newShape;if(!(!f(i,"bpmn:SubProcess")||f(i,"bpmn:AdHocSubProcess")||!(f(A,"bpmn:Task")||f(A,"bpmn:CallActivity"))||!E0(i))){var o=pF(i);t.createShape({type:"bpmn:StartEvent"},o,i)}})}Os.$inject=["injector","modeling"],W(Os,j);function pF(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function Xs(e){j.call(this,e),this.preExecute("connection.create",function(t){const{target:n}=t;f(n,"bpmn:TextAnnotation")&&(t.parent=n.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(t){const n=t.shapes||[t.shape];n.length===1&&f(n[0],"bpmn:TextAnnotation")&&(t.hints=t.hints||{},t.hints.autoResize=!1)},!0)}W(Xs,j),Xs.$inject=["eventBus"];function Ks(e,t){j.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var A=n.shape;if(E0(A))return;var i=YA(A);i.forEach(function(r){var a=r.incoming.slice(),c=r.outgoing.slice();U(a,function(l){o(l,!0)}),U(c,function(l){o(l,!1)})});function o(r,a){i.indexOf(r.source)!==-1&&i.indexOf(r.target)!==-1||(a?t.reconnectEnd(r,A,i0(A)):t.reconnectStart(r,A,i0(A)))}},!0)}W(Ks,j),Ks.$inject=["eventBus","modeling"];var Zs=500;function qs(e,t,n){j.call(this,e);function A(r){r.length&&r.forEach(function(a){a.type==="label"&&!a.businessObject.name&&(a.hidden=!0)})}function i(r,a){var c=r.children,l=a,B,g;return B=EF(c).concat([r]),g=H4(B),g?(l.width=Math.max(g.width,l.width),l.height=Math.max(g.height,l.height),l.x=g.x+(g.width-l.width)/2,l.y=g.y+(g.height-l.height)/2):(l.x=r.x+(r.width-l.width)/2,l.y=r.y+(r.height-l.height)/2),l}function o(r,a){return{x:r.x+(r.width-a.width)/2,y:r.y+(r.height-a.height)/2,width:a.width,height:a.height}}this.executed(["shape.toggleCollapse"],Zs,function(r){var a=r.context,c=a.shape;f(c,"bpmn:SubProcess")&&(c.collapsed?h0(c).isExpanded=!1:(A(c.children),h0(c).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],Zs,function(r){var a=r.context,c=a.shape;c.collapsed?h0(c).isExpanded=!1:h0(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],Zs,function(r){var a=r.context.shape,c=t.getDefaultSize(a),l;a.collapsed?l=o(a,c):l=i(a,c),n.resizeShape(a,l,null,{autoResize:a.collapsed?!1:"nwse"})})}W(qs,j),qs.$inject=["eventBus","elementFactory","modeling"];function EF(e){return e.filter(function(t){return!t.hidden})}function $s(e,t,n,A){t.invoke(j,this),this.preExecute("shape.delete",function(i){var o=i.context,r=o.shape,a=r.businessObject;f0(r)||(f(r,"bpmn:Participant")&&E0(r)&&n.ids.unclaim(a.processRef.id),A.unclaimId(a.id,a))}),this.preExecute("connection.delete",function(i){var o=i.context,r=o.connection,a=r.businessObject;A.unclaimId(a.id,a)}),this.preExecute("canvas.updateRoot",function(){var i=e.getRootElement(),o=i.businessObject;f(i,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}W($s,j),$s.$inject=["canvas","injector","moddle","modeling"];function e1(e,t){j.call(this,e),this.preExecute("connection.delete",function(n){var A=n.context,i=A.connection,o=i.source;dF(i,o)&&t.updateProperties(o,{default:null})})}W(e1,j),e1.$inject=["eventBus","modeling"];function dF(e,t){if(!f(e,"bpmn:SequenceFlow"))return!1;var n=P(t),A=P(e);return n.get("default")===A}var uF=500,QF=5e3;function t1(e,t){j.call(this,e);var n;function A(){return n=n||new hF,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 a=n.leave();return a&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null),a}var r=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(r,QF,function(a){A()}),this.postExecuted(r,uF,function(a){o()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(a){var c=a.context,l=c.shape,B=i();l.labelTarget||(f(l,"bpmn:Lane")&&B.addLane(l),f(l,"bpmn:FlowNode")&&B.addFlowNode(l))})}t1.$inject=["eventBus","modeling"],W(t1,j);function hF(){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 n1(e,t){j.call(this,e),this.postExecuted("elements.create",function(n){const A=n.context,i=A.elements;for(const o of i)wF(o)&&!fF(o)&&t.updateProperties(o,{isForCompensation:void 0})})}W(n1,j),n1.$inject=["eventBus","modeling"];function wF(e){const t=P(e);return t&&t.isForCompensation}function mF(e){return e&&f(e,"bpmn:BoundaryEvent")&&jn(e,"bpmn:CompensateEventDefinition")}function fF(e){return e.incoming.filter(n=>mF(n.source)).length>0}const CF={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","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",us],appendBehavior:["type",Qs],associationBehavior:["type",hs],attachEventBehavior:["type",cr],boundaryEventBehavior:["type",ws],compensateBoundaryEventBehaviour:["type",ms],createBehavior:["type",fs],createDataObjectBehavior:["type",Cs],createParticipantBehavior:["type",ys],dataInputAssociationBehavior:["type",Is],dataStoreBehavior:["type",Fs],deleteLaneBehavior:["type",vs],detachEventBehavior:["type",ur],dropOnFlowBehavior:["type",xs],eventBasedGatewayBehavior:["type",bs],fixHoverBehavior:["type",W4],groupBehavior:["type",Ys],importDockingFix:["type",O4],isHorizontalFix:["type",Ns],labelBehavior:["type",zs],layoutConnectionBehavior:["type",Rs],messageFlowBehavior:["type",ks],nonInterruptingBehavior:["type",Gs],removeElementBehavior:["type",Ps],removeEmbeddedLabelBoundsBehavior:["type",Hs],removeParticipantBehavior:["type",Js],replaceConnectionBehavior:["type",js],replaceElementBehaviour:["type",Cr],resizeBehavior:["type",EE],resizeLaneBehavior:["type",QE],rootElementReferenceBehavior:["type",Ws],spaceToolBehavior:["type",wE],subProcessPlaneBehavior:["type",Nt],subProcessStartEventBehavior:["type",Os],textAnnotationBehavior:["type",Xs],toggleCollapseConnectionBehaviour:["type",Ks],toggleElementCollapseBehaviour:["type",qs],unclaimIdBehavior:["type",$s],unsetDefaultFlowBehavior:["type",e1],updateFlowNodeRefsBehavior:["type",t1],setCompensationActivityAfterPasteBehavior:["type",n1]};function CE(e,t){var n=f2(e,t,-15);return n!=="intersect"?n:null}function w2(e){Ae.call(this,e)}W(w2,Ae),w2.$inject=["eventBus"],w2.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return MF(t)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,A=e.hints||{},i=A.targetParent,o=A.targetAttach;if(o)return!1;i&&(n.parent=i);try{return Ir(t,n)}finally{i&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,A=e.target;return Ir(n,A,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){var t=e.shape,n=e.newBounds;return NE(t,n)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,A=e.target;return Y0(A)&&!Fr(t,A)?!1:je(t,function(i){return Y0(i)?Ir(i.source,i.target,i):i.host?ri(i,i.host,null,n):a1(i,A,null)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,A=e.position;return ri(n,t,null,A)||YE(n,t,A)||UE(n,t)||Fr(n,t)}),this.addRule("shape.create",function(e){return a1(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return ri(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element,n=e.elements;return kE(n,t)})},w2.prototype.canConnectMessageFlow=SE,w2.prototype.canConnectSequenceFlow=TE,w2.prototype.canConnectDataAssociation=c1,w2.prototype.canConnectAssociation=zE,w2.prototype.canConnectCompensationAssociation=RE,w2.prototype.canMove=UE,w2.prototype.canAttach=ri,w2.prototype.canReplace=YE,w2.prototype.canDrop=sA,w2.prototype.canInsert=Fr,w2.prototype.canCreate=a1,w2.prototype.canConnect=Ir,w2.prototype.canResize=NE,w2.prototype.canCopy=kE;function MF(e){return A1(e)?null:a0(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function A1(e){return!e||f0(e)}function DF(e,t){return e===t}function ME(e){do{if(f(e,"bpmn:Process"))return P(e);if(f(e,"bpmn:Participant"))return P(e).processRef||P(e)}while(e=e.parent)}function i1(e){return f(e,"bpmn:TextAnnotation")}function o1(e){return f(e,"bpmn:Group")&&!e.labelTarget}function DE(e){return f(e,"bpmn:BoundaryEvent")&&ke(e,"bpmn:CompensateEventDefinition")}function yr(e){return P(e).isForCompensation}function yF(e,t){var n=ME(e),A=ME(t);return n===A}function IF(e){return f(e,"bpmn:InteractionNode")&&!f(e,"bpmn:BoundaryEvent")&&(!f(e,"bpmn:Event")||f(e,"bpmn:ThrowEvent")&&FE(e,"bpmn:MessageEventDefinition"))}function FF(e){return f(e,"bpmn:InteractionNode")&&!yr(e)&&(!f(e,"bpmn:Event")||f(e,"bpmn:CatchEvent")&&FE(e,"bpmn:MessageEventDefinition"))&&!(f(e,"bpmn:BoundaryEvent")&&!ke(e,"bpmn:MessageEventDefinition"))}function yE(e){for(var t=e;t=t.parent;){if(f(t,"bpmn:FlowElementsContainer"))return P(t);if(f(t,"bpmn:Participant"))return P(t).processRef}return null}function IE(e,t){var n=yE(e),A=yE(t);return n===A}function ke(e,t){var n=P(e);return!!m0(n.eventDefinitions||[],function(A){return f(A,t)})}function FE(e,t){var n=P(e);return(n.eventDefinitions||[]).every(function(A){return f(A,t)})}function vF(e){return f(e,"bpmn:FlowNode")&&!f(e,"bpmn:EndEvent")&&!h2(e)&&!(f(e,"bpmn:IntermediateThrowEvent")&&ke(e,"bpmn:LinkEventDefinition"))&&!DE(e)&&!yr(e)}function xF(e){return f(e,"bpmn:FlowNode")&&!f(e,"bpmn:StartEvent")&&!f(e,"bpmn:BoundaryEvent")&&!h2(e)&&!(f(e,"bpmn:IntermediateCatchEvent")&&ke(e,"bpmn:LinkEventDefinition"))&&!yr(e)}function bF(e){return f(e,"bpmn:ReceiveTask")||f(e,"bpmn:IntermediateCatchEvent")&&(ke(e,"bpmn:MessageEventDefinition")||ke(e,"bpmn:TimerEventDefinition")||ke(e,"bpmn:ConditionalEventDefinition")||ke(e,"bpmn:SignalEventDefinition"))}function YF(e){for(var t=[];e;)e=e.parent,e&&t.push(e);return t}function r1(e,t){var n=YF(t);return n.indexOf(e)!==-1}function Ir(e,t,n){if(A1(e)||A1(t))return null;if(!f(n,"bpmn:DataAssociation")){if(SE(e,t))return{type:"bpmn:MessageFlow"};if(TE(e,t))return{type:"bpmn:SequenceFlow"}}var A=c1(e,t);return A||(RE(e,t)?{type:"bpmn:Association",associationDirection:"One"}:zE(e,t)?{type:"bpmn:Association",associationDirection:"None"}:!1)}function sA(e,t){return f0(e)||o1(e)?!0:f(t,"bpmn:Participant")&&!E0(t)?!1:f(e,"bpmn:Participant")?f(t,"bpmn:Process")||f(t,"bpmn:Collaboration"):a0(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:f(e,"bpmn:Lane")?f(t,"bpmn:Participant")||f(t,"bpmn:Lane"):f(e,"bpmn:BoundaryEvent")&&!UF(e)?!1:f(e,"bpmn:FlowElement")&&!f(e,"bpmn:DataStoreReference")?f(t,"bpmn:FlowElementsContainer")?E0(t):a0(t,["bpmn:Participant","bpmn:Lane"]):f(e,"bpmn:DataStoreReference")&&f(t,"bpmn:Collaboration")?Qe(P(t).get("participants"),function(n){return!!n.get("processRef")}):a0(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?a0(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):f(e,"bpmn:MessageFlow")?f(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t:!1}function UF(e){return P(e).cancelActivity&&(vE(e)||xE(e))}function NF(e){return!f0(e)&&f(e,"bpmn:BoundaryEvent")}function zF(e){return f(e,"bpmn:Lane")}function RF(e){return NF(e)||f(e,"bpmn:IntermediateThrowEvent")&&vE(e)?!0:f(e,"bpmn:IntermediateCatchEvent")&&xE(e)}function vE(e){var t=P(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function xE(e){return bE(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function bE(e,t){return t.some(function(n){return ke(e,n)})}function SF(e){return f(e,"bpmn:ReceiveTask")&&m0(e.incoming,function(t){return f(t.source,"bpmn:EventBasedGateway")})}function ri(e,t,n,A){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var i=e[0];return f0(i)||!RF(i)||h2(t)||!f(t,"bpmn:Activity")||yr(t)||A&&!CE(A,t)||SF(t)?!1:"attach"}function YE(e,t,n){if(!t)return!1;var A={replacements:[]};return U(e,function(i){h2(t)||f(i,"bpmn:StartEvent")&&i.type!=="label"&&sA(i,t)&&(NM(i)||A.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"}),(zM(i)||RM(i)||SM(i))&&A.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"}),bE(i,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&f(t,"bpmn:SubProcess")&&A.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"})),f(t,"bpmn:Transaction")||ke(i,"bpmn:CancelEventDefinition")&&i.type!=="label"&&(f(i,"bpmn:EndEvent")&&sA(i,t)&&A.replacements.push({oldElementId:i.id,newElementType:"bpmn:EndEvent"}),f(i,"bpmn:BoundaryEvent")&&ri(i,t,null,n)&&A.replacements.push({oldElementId:i.id,newElementType:"bpmn:BoundaryEvent"}))}),A.replacements.length?A:!1}function UE(e,t){return Qe(e,zF)?!1:t?e.every(function(n){return sA(n,t)}):!0}function a1(e,t,n,A){return t?f0(e)||o1(e)?!0:DF(n,t)||n&&r1(n,t)?!1:sA(e,t)||Fr(e,t):!1}function NE(e,t){return f(e,"bpmn:SubProcess")?E0(e)&&(!t||t.width>=100&&t.height>=80):!!(f(e,"bpmn:Lane")||f(e,"bpmn:Participant")||i1(e)||o1(e))}function TF(e,t){var n=i1(e),A=i1(t);return(n||A)&&n!==A}function zE(e,t){return r1(t,e)||r1(e,t)?!1:TF(e,t)?!0:!!c1(e,t)}function RE(e,t){return IE(e,t)&&DE(e)&&f(t,"bpmn:Activity")&&!GF(t,e)&&!h2(t)}function SE(e,t){return GE(e)&&!GE(t)?!1:IF(e)&&FF(t)&&!yF(e,t)}function TE(e,t){return vF(e)&&xF(t)&&IE(e,t)&&!(f(e,"bpmn:EventBasedGateway")&&!bF(t))}function c1(e,t){return a0(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&a0(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:a0(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&a0(e,["bpmn:Activity","bpmn:CatchEvent"])?{type:"bpmn:DataOutputAssociation"}:!1}function Fr(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:a0(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!f0(t)&&f(e,"bpmn:FlowNode")&&!f(e,"bpmn:BoundaryEvent")&&sA(e,t.parent)}function kF(e,t){return e&&t&&e.indexOf(t)!==-1}function kE(e,t){return f0(t)?!0:!(f(t,"bpmn:Lane")&&!kF(e,t.parent))}function GE(e){return $n(e,"bpmn:Process")||$n(e,"bpmn:Collaboration")}function GF(e,t){return e.attachers.includes(t)}const HF={__depends__:[Te],__init__:["bpmnRules"],bpmnRules:["type",w2]};var PF=2e3;function HE(e,t){e.on("saveXML.start",PF,n);function n(){var A=t.getRootElements();U(A,function(i){var o=h0(i),r,a;r=YA([i],!1),r=l0(r,function(c){return c!==i&&!c.labelTarget}),a=B2(r,h0),o.set("planeElement",a)})}}HE.$inject=["eventBus","canvas"];const JF={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",HE]};function vr(e){j.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var A=n.context,i=A.shape||A.connection,o=A.parent,r=t.getOrdering(i,o);r&&(r.parent!==void 0&&(A.parent=r.parent),A.parentIndex=r.index)}),this.preExecute(["shape.move","connection.move"],function(n){var A=n.context,i=A.shape||A.connection,o=A.newParent||i.parent,r=t.getOrdering(i,o);r&&(r.parent!==void 0&&(A.newParent=r.parent),A.newParentIndex=r.index)})}vr.prototype.getOrdering=function(e,t){return null},W(vr,j);function s1(e,t){vr.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 A(r){if(r.labelTarget)return{level:10};var a=m0(n,function(c){return a0(r,[c.type])});return a&&a.order||{level:1}}function i(r){var a=r.order;if(a||(r.order=a=A(r)),!a)throw new Error(`no order for <${r.id}>`);return a}function o(r,a,c){for(var l=a;l&&!a0(l,c);)l=l.parent;if(!l)throw new Error(`no parent for <${r.id}> in <${a&&a.id}>`);return l}this.getOrdering=function(r,a){if(r.labelTarget||f(r,"bpmn:TextAnnotation"))return{parent:t.findRoot(a)||t.getRootElement(),index:-1};var c=i(r);c.containers&&(a=o(r,a,c.containers));var l=a.children.indexOf(r),B=qa(a.children,function(g){return!r.labelTarget&&g.labelTarget?!1:c.level<i(g).level});return B!==-1&&l!==-1&&l<B&&(B-=1),{index:B,parent:a}}}s1.$inject=["eventBus","canvas"],W(s1,vr);const jF={__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",s1]};function ai(){}ai.prototype.get=function(){return this._data},ai.prototype.set=function(e){this._data=e},ai.prototype.clear=function(){var e=this._data;return delete this._data,e},ai.prototype.isEmpty=function(){return!this._data};const VF={clipboard:["type",ai]};var LF="drop-ok",PE="drop-not-ok",JE="attach-ok",jE="new-parent",VE="create",WF=2e3;function LE(e,t,n,A,i){function o(c,l,B,g,p){if(!l)return!1;c=l0(c,function(y){var C=y.labelTarget;return!y.parent&&!(f0(y)&&c.indexOf(C)!==-1)});var E=m0(c,function(y){return!Y0(y)}),d=!1,u=!1,h=!1;_E(c)&&(d=i.allowed("shape.attach",{position:B,shape:E,target:l})),d||(_E(c)?h=i.allowed("shape.create",{position:B,shape:E,source:g,target:l}):h=i.allowed("elements.create",{elements:c,position:B,target:l}));var D=p.connectionTarget;return h||d?(E&&g&&(u=i.allowed("connection.create",{source:D===g?E:g,target:D===g?g:E,hints:{targetParent:l,targetAttach:d}})),{attach:d,connect:u}):h===null||d===null?null:!1}function r(c,l){[JE,LF,PE,jE].forEach(function(B){B===l?e.addMarker(c,B):e.removeMarker(c,B)})}n.on(["create.move","create.hover"],function(c){var l=c.context,B=l.elements,g=c.hover,p=l.source,E=l.hints||{};if(!g){l.canExecute=!1,l.target=null;return}WE(c);var d={x:c.x,y:c.y},u=l.canExecute=g&&o(B,g,d,p,E);g&&u!==null&&(l.target=g,u&&u.attach?r(g,JE):r(g,u?jE:PE))}),n.on(["create.end","create.out","create.cleanup"],function(c){var l=c.hover;l&&r(l,null)}),n.on("create.end",function(c){var l=c.context,B=l.source,g=l.shape,p=l.elements,E=l.target,d=l.canExecute,u=d&&d.attach,h=d&&d.connect,D=l.hints||{};if(d===!1||!E)return!1;WE(c);var y={x:c.x,y:c.y};h?g=A.appendShape(B,g,y,E,{attach:u,connection:h===!0?{}:h,connectionTarget:D.connectionTarget}):(p=A.createElements(p,y,E,N({},D,{attach:u})),g=m0(p,function(C){return!Y0(C)})),N(l,{elements:p,shape:g}),N(c,{elements:p,shape:g})});function a(){var c=t.context();c&&c.prefix===VE&&t.cancel()}n.on("create.init",function(){n.on("elements.changed",a),n.once(["create.cancel","create.end"],WF,function(){n.off("elements.changed",a)})}),this.start=function(c,l,B){n0(l)||(l=[l]);var g=m0(l,function(d){return!Y0(d)});if(g){B=N({elements:l,hints:{},shape:g},B||{}),U(l,function(d){A0(d.x)||(d.x=0),A0(d.y)||(d.y=0)});var p=l0(l,function(d){return!d.hidden}),E=i2(p);U(l,function(d){Y0(d)&&(d.waypoints=B2(d.waypoints,function(u){return{x:u.x-E.x-E.width/2,y:u.y-E.y-E.height/2}})),N(d,{x:d.x-E.x-E.width/2,y:d.y-E.y-E.height/2})}),t.init(c,VE,{cursor:"grabbing",autoActivate:!0,data:{shape:g,elements:l,context:B}})}}}LE.$inject=["canvas","dragging","eventBus","modeling","rules"];function WE(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 _E(e){return e&&e.length===1&&!Y0(e[0])}var _F=750;function OE(e,t,n,A,i){function o(r){var a=g0("g");q(a,i.cls("djs-drag-group",["no-events"]));var c=g0("g");return r.forEach(function(l){var B;l.hidden||(l.waypoints?(B=n._createContainer("connection",c),n.drawConnection(Mt(B),l)):(B=n._createContainer("shape",c),n.drawShape(Mt(B),l),Q2(B,l.x,l.y)),A.addDragger(l,a,B))}),a}t.on("create.move",_F,function(r){var a=r.hover,c=r.context,l=c.elements,B=c.dragGroup;B||(B=c.dragGroup=o(l));var g;a?(B.parentNode||(g=e.getActiveLayer(),Q0(g,B)),Q2(B,r.x,r.y)):s2(B)}),t.on("create.cleanup",function(r){var a=r.context,c=a.dragGroup;c&&s2(c)})}OE.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const xr={__depends__:[nt,AA,Te,Ce],__init__:["create","createPreview"],create:["type",LE],createPreview:["type",OE]};function l1(e){var t=this;this._lastMoveEvent=null;function n(A){t._lastMoveEvent=A}e.on("canvas.init",function(A){var i=t._svg=A.svg;i.addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}l1.$inject=["eventBus"],l1.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||OF(0,0)};function OF(e,t){var n=document.createEvent("MouseEvent"),A=e,i=t,o=e,r=t;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,A,i,o,r,!1,!1,!1,!1,0,null),n}const ci={__init__:["mouse"],mouse:["type",l1]};function De(e,t,n,A,i,o,r,a){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=A,this._eventBus=i,this._modeling=o,this._mouse=r,this._rules=a,i.on("copyPaste.copyElement",function(c){var l=c.descriptor,B=c.element,g=c.elements;l.priority=1,l.id=B.id;var p=m0(g,function(E){return E===B.parent});p&&(l.parent=B.parent.id),XF(B)&&(l.priority=2,l.host=B.host.id),Y0(B)&&(l.priority=3,l.source=B.source.id,l.target=B.target.id,l.waypoints=KF(B)),f0(B)&&(l.priority=4,l.labelTarget=B.labelTarget.id),U(["x","y","width","height"],function(E){A0(B[E])&&(l[E]=B[E])}),l.hidden=B.hidden,l.collapsed=B.collapsed}),i.on("copyPaste.pasteElements",function(c){var l=c.hints;N(l,{createElementsBehavior:!1})})}De.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],De.prototype.copy=function(e){var t,n;return n0(e)||(e=e?[e]:[]),t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}),t===!1?n={}:n=this.createTree(n0(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},De.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var A=this._createElements(t);if(e&&e.element&&e.point)return this._paste(A,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),A,{hints:n||{}})}},De.prototype._paste=function(e,t,n,A){U(e,function(o){A0(o.x)||(o.x=0),A0(o.y)||(o.y=0)});var i=i2(e);return U(e,function(o){Y0(o)&&(o.waypoints=B2(o.waypoints,function(r){return{x:r.x-i.x-i.width/2,y:r.y-i.y-i.height/2}})),N(o,{x:o.x-i.x-i.width/2,y:o.y-i.y-i.height/2})}),this._modeling.createElements(e,n,t,N({},A))},De.prototype._createElements=function(e){var t=this,n=this._eventBus,A={},i=[];return U(e,function(o,r){o=he(o,"priority"),U(o,function(a){var c=N({},we(a,["priority"]));A[a.parent]?c.parent=A[a.parent]:delete c.parent,n.fire("copyPaste.pasteElement",{cache:A,descriptor:c});var l;if(Y0(c)){c.source=A[a.source],c.target=A[a.target],l=A[a.id]=t.createConnection(c),i.push(l);return}if(f0(c)){c.labelTarget=A[c.labelTarget],l=A[a.id]=t.createLabel(c),i.push(l);return}c.host&&(c.host=A[c.host]),l=A[a.id]=t.createShape(c),i.push(l)})}),i},De.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(we(e,["id"]));return t},De.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(we(e,["id"]));return t},De.prototype.createShape=function(e){var t=this._elementFactory.createShape(we(e,["id"]));return t},De.prototype.hasRelations=function(e,t){var n,A,i;return!(Y0(e)&&(A=m0(t,Z2({id:e.source.id})),i=m0(t,Z2({id:e.target.id})),!A||!i)||f0(e)&&(n=m0(t,Z2({id:e.labelTarget.id})),!n))},De.prototype.createTree=function(e){var t=this._rules,n=this,A={},i=[],o=Bo(e);function r(l,B){return t.allowed("element.copy",{element:l,elements:B})}function a(l,B){var g=m0(i,function(p){return l===p.element});if(!g){i.push({element:l,depth:B});return}g.depth<B&&(i=c(g,i),i.push({element:g.element,depth:B}))}function c(l,B){var g=B.indexOf(l);return g!==-1&&B.splice(g,1),B}return nn(o,function(l,B,g){if(f0(l))return;U(l.labels,function(d){a(d,g)});function p(d){d&&d.length&&U(d,function(u){U(u.labels,function(h){a(h,g)}),a(u,g)})}U([l.attachers,l.incoming,l.outgoing],p),a(l,g);var E=[];return l.children&&(E=l.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:l,children:E}),E}),e=B2(i,function(l){return l.element}),i=B2(i,function(l){return l.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:l.descriptor,element:l.element,elements:e}),l}),i=he(i,function(l){return l.descriptor.priority}),e=B2(i,function(l){return l.element}),U(i,function(l){var B=l.depth;if(!n.hasRelations(l.element,e)){KE(l.element,e);return}if(!r(l.element,e)){KE(l.element,e);return}A[B]||(A[B]=[]),A[B].push(l.descriptor)}),A};function XF(e){return!!e.host}function KF(e){return B2(e.waypoints,function(t){return t=XE(t),t.original&&(t.original=XE(t.original)),t})}function XE(e){return N({},e)}function KE(e,t){var n=t.indexOf(e);return n===-1?t:t.splice(n,1)}const ZF={__depends__:[VF,xr,ci,Te],__init__:["copyPaste"],copyPaste:["type",De]};function B1(e,t,n){n0(n)||(n=[n]),U(n,function(A){Je(e[A])||(t[A]=e[A])})}var g1=750;function ZE(e,t,n){function A(c,l){var B=e.create(c.$type);return n.copyElement(c,B,null,l)}t.on("copyPaste.copyElement",g1,function(c){var l=c.descriptor,B=c.element,g=P(B);if(f0(B))return l;var p=l.businessObject=A(g,!0),E=l.di=A(h0(B),!0);E.bpmnElement=p,B1(p,l,"name"),B1(E,l,"isExpanded"),g.default&&(l.default=g.default.id)});var i="-bpmn-js-refs";function o(c){return c[i]=c[i]||{}}function r(c,l){c[i]=l}function a(c,l,B){var g=P(c);return c.default&&(B[c.default]={element:g,property:"default"}),c.host&&(P(c).attachedToRef=P(l[c.host])),we(B,F2(B,function(p,E,d){var u=E.element,h=E.property;return d===c.id&&(u.set(h,g),p.push(c.id)),p},[]))}t.on("copyPaste.pasteElement",function(c){var l=c.cache,B=c.descriptor,g=B.businessObject,p=B.di;if(f0(B)){B.businessObject=P(l[B.labelTarget]),B.di=h0(l[B.labelTarget]);return}g=B.businessObject=A(g),p=B.di=A(p),p.bpmnElement=g,B1(B,g,["isExpanded","name"]),B.type=g.$type}),t.on("copyPaste.copyElement",g1,function(c){var l=c.descriptor,B=c.element;if(f(B,"bpmn:Participant")){var g=P(B);g.processRef&&(l.processRef=A(g.processRef,!0))}}),t.on("copyPaste.pasteElement",function(c){var l=c.descriptor,B=l.processRef;B&&(l.processRef=A(B))}),t.on("copyPaste.pasteElement",g1,function(c){var l=c.cache,B=c.descriptor;r(l,a(B,l,o(l)))})}ZE.$inject=["bpmnFactory","eventBus","moddleCopy"];const qF=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"],$F=["errorRef","escalationRef","messageRef","signalRef"];function si(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",A=>{const{propertyNames:i}=A;if(!(!i||!i.length))return he(i,o=>o==="extensionElements")}),e.on("moddleCopy.canCopyProperty",A=>{const{parent:i,property:o,propertyName:r}=A,a=V0(i)&&i.$descriptor;if(r&&$F.includes(r))return o;if(r&&qF.includes(r)||r&&a&&!m0(a.properties,Z2({name:r})))return!1}),e.on("moddleCopy.canSetCopiedProperty",A=>{const{property:i}=A;if(f(i,"bpmn:ExtensionElements")&&(!i.values||!i.values.length))return!1})}si.$inject=["eventBus","bpmnFactory","moddle"],si.prototype.copyElement=function(e,t,n,A=!1){n&&!n0(n)&&(n=[n]),n=n||p1(e.$descriptor);const i=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:A});return i===!1||(n0(i)&&(n=i),U(n,o=>{let r;I2(e,o)&&(r=e.get(o));const a=this.copyProperty(r,t,o,A);!a2(a)||this._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:a,propertyName:o})===!1||t.set(o,a)})),t},si.prototype.copyProperty=function(e,t,n,A=!1){let i=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:A});if(i===!1)return;if(i)return V0(i)&&i.$type&&!i.$parent&&(i.$parent=t),i;const o=this._moddle.getPropertyDescriptor(t,n);if(!o.isReference)return o.isId?e&&this._copyId(e,t,A):n0(e)?F2(e,(r,a)=>{const c=this.copyProperty(a,t,n,A);return c?r.concat(c):r},[]):V0(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,A),i):e},si.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 p1(e,t){return F2(e.properties,(n,A)=>t&&A.default?n:n.concat(A.name),[])}const qE={__depends__:[ZF],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",ZE],moddleCopy:["type",si]};var $E=Math.round;function E1(e,t){this._modeling=e,this._eventBus=t}E1.$inject=["modeling","eventBus"],E1.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var A=this._modeling,i=this._eventBus;i.fire("replace.start",{element:e,attrs:t,hints:n});var o=t.width||e.width,r=t.height||e.height,a=t.x||e.x,c=t.y||e.y,l=$E(a+o/2),B=$E(c+r/2),g=A.replaceShape(e,N({},t,{x:l,y:B,width:o,height:r}),n);return i.fire("replace.end",{element:e,newElement:g,hints:n}),g};function e3(e,t){t.on("replace.end",500,function(n){const{newElement:A,hints:i={}}=n;i.select!==!1&&e.select(A)})}e3.$inject=["selection","eventBus"];const e8={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",e3],replace:["type",E1]};function t8(e,t,n){n0(n)||(n=[n]),U(n,function(A){Je(e[A])||(t[A]=e[A])})}var n8=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function A8(e,t){var n=e&&I2(e,"collapsed")?e.collapsed:!E0(e),A;return t&&(I2(t,"collapsed")||I2(t,"isExpanded"))?A=I2(t,"collapsed")?t.collapsed:!t.isExpanded:A=n,n!==A}function t3(e,t,n,A,i,o){function r(a,c,l){l=l||{};var B=c.type,g=a.businessObject;if(br(g)&&(B==="bpmn:SubProcess"||B==="bpmn:AdHocSubProcess")&&A8(a,c))return A.toggleCollapse(a),a;var p=e.create(B),E={type:B,businessObject:p};E.di={},B==="bpmn:ExclusiveGateway"&&(E.di.isMarkerVisible=!0),t8(a.di,E.di,["fill","stroke","background-color","border-color","color"]);var d=p1(g.$descriptor),u=p1(p.$descriptor,!0),h=i8(d,u);N(p,q2(c,n8));var D=l0(h,function(m){return m==="eventDefinitions"?n3(a,c.eventDefinitionType):m==="loopCharacteristics"?!h2(p):I2(p,m)||m==="processRef"&&c.isExpanded===!1||m==="triggeredByEvent"?!1:m==="isForCompensation"?!h2(p):!0});if(p=n.copyElement(g,p,D),c.eventDefinitionType&&(n3(p,c.eventDefinitionType)||(E.eventDefinitionType=c.eventDefinitionType,E.eventDefinitionAttrs=c.eventDefinitionAttrs)),f(g,"bpmn:Activity")){if(br(g))E.isExpanded=E0(a);else if(c&&I2(c,"isExpanded")){E.isExpanded=c.isExpanded;var y=t.getDefaultSize(p,{isExpanded:E.isExpanded});E.width=y.width,E.height=y.height,E.x=a.x-(E.width-a.width)/2,E.y=a.y-(E.height-a.height)/2}E0(a)&&!f(g,"bpmn:Task")&&E.isExpanded&&(E.width=a.width,E.height=a.height)}if(br(g)&&!br(p)&&(l.moveChildren=!1),f(g,"bpmn:Participant")){c.isExpanded===!0?p.processRef=e.create("bpmn:Process"):l.moveChildren=!1;var C=l2(a);h0(a).isHorizontal||(h0(E).isHorizontal=C),E.width=C?a.width:t.getDefaultSize(E).width,E.height=C?t.getDefaultSize(E).height:a.height}return o.allowed("shape.resize",{shape:p})||(E.height=t.getDefaultSize(E).height,E.width=t.getDefaultSize(E).width),p.name=g.name,a0(g,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&a0(p,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(p.default=g.default),c.host&&!f(g,"bpmn:BoundaryEvent")&&f(p,"bpmn:BoundaryEvent")&&(E.host=c.host),(E.type==="bpmn:DataStoreReference"||E.type==="bpmn:DataObjectReference")&&(E.x=a.x+(a.width-E.width)/2),i.replaceElement(a,E,{...l,targetElement:c})}this.replaceElement=r}t3.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];function br(e){return f(e,"bpmn:SubProcess")}function n3(e,t){var n=P(e);return t&&n.get("eventDefinitions").some(function(A){return f(A,t)})}function i8(e,t){return e.filter(function(n){return t.includes(n)})}const A3={__depends__:[qE,e8,Ce],bpmnReplace:["type",t3]};var o8=250;function un(e){this._eventBus=e,this._tools=[],this._active=null}un.$inject=["eventBus"],un.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)},un.prototype.isActive=function(e){return e&&this._active===e},un.prototype.length=function(e){return this._tools.length},un.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},un.prototype.bindEvents=function(e,t){var n=this._eventBus,A=[];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),U(t,function(i){A.push(i+".ended"),A.push(i+".canceled")}),n.on(A,o8,function(i){this._active&&(r8(i)||this.setActive(null))},this)};function r8(e){var t=e.originalEvent&&e.originalEvent.target;return t&&Sn(t,'.group[data-group="tools"]')}const Yr={__depends__:[nt],__init__:["toolManager"],toolManager:["type",un]};function a8(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 c8(e,t){var n=[];return U(e.concat(t),function(A){var i=A.incoming,o=A.outgoing;U(i.concat(o),function(r){var a=r.source,c=r.target;(li(e,a)||li(e,c)||li(t,a)||li(t,c))&&(li(n,r)||n.push(r))})}),n}function li(e,t){return e.indexOf(t)!==-1}function s8(e,t,n){var A=e.x,i=e.y,o=e.width,r=e.height,a=n.x,c=n.y;switch(t){case"n":return{x:A,y:i+c,width:o,height:r-c};case"s":return{x:A,y:i,width:o,height:r+c};case"w":return{x:A+a,y:i,width:o-a,height:r};case"e":return{x:A,y:i,width:o+a,height:r};default:throw new Error("unknown direction: "+t)}}var d1=Math.abs,l8=Math.round,ot={x:"width",y:"height"},i3="crosshair",zt={n:"top",w:"left",s:"bottom",e:"right"},B8=1500,Ur={n:"s",w:"e",s:"n",e:"w"},Nr=20;function ae(e,t,n,A,i,o,r){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=A,this._rules=i,this._toolManager=o,this._mouse=r;var a=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(c){n.once("spaceTool.selection.ended",function(){a.activateMakeSpace(c.originalEvent)})}),n.on("spaceTool.move",B8,function(c){var l=c.context,B=l.initialized;B||(B=l.initialized=a.init(c,l)),B&&r3(c)}),n.on("spaceTool.end",function(c){var l=c.context,B=l.axis,g=l.direction,p=l.movingShapes,E=l.resizingShapes,d=l.start;if(l.initialized){r3(c);var u={x:0,y:0};u[B]=l8(c["d"+B]),a.makeSpace(p,E,u,g,d),n.once("spaceTool.ended",function(h){a.activateSelection(h.originalEvent,!0,!0)})}})}ae.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],ae.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:i3,data:{context:{reactivate:n}},trapClick:!1})},ae.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:i3,data:{context:{}}})},ae.prototype.makeSpace=function(e,t,n,A,i){return this._modeling.createSpace(e,t,n,A,i)},ae.prototype.init=function(e,t){var n=d1(e.dx)>d1(e.dy)?"x":"y",A=e["d"+n],i=e[n]-A;if(d1(A)<5)return!1;A<0&&(A*=-1),Wn(e)&&(A*=-1);var o=a8(n,A),r=this._canvas.getRootElement();!So(e)&&e.hover&&(r=e.hover);var a=[...YA(r,!0),...r.attachers||[]],c=this.calculateAdjustments(a,n,A,i),l=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:i}),B=g8(c,n,o,i,l);return N(t,c,{axis:n,direction:o,spaceToolConstraints:B,start:i}),Ho("resize-"+(n==="x"?"ew":"ns")),!0},ae.prototype.calculateAdjustments=function(e,t,n,A){var i=this._rules,o=[],r=[],a=[],c=[];function l(p){o.includes(p)||o.push(p);var E=p.label;E&&!o.includes(E)&&o.push(E)}function B(p){r.includes(p)||r.push(p)}U(e,function(p){if(!(!p.parent||f0(p))){if(Y0(p)){c.push(p);return}var E=p[t],d=E+p[ot[t]];if(p8(p)&&(n>0&&i0(p)[t]>A||n<0&&i0(p)[t]<A)){a.push(p);return}if(n>0&&E>A||n<0&&d<A){l(p);return}if(E<A&&d>A&&i.allowed("shape.resize",{shape:p})){B(p);return}}}),U(o,function(p){var E=p.attachers;E&&U(E,function(d){l(d)})});var g=o.concat(r);return U(a,function(p){var E=p.host;Qn(g,E)&&l(p)}),g=o.concat(r),U(c,function(p){var E=p.source,d=p.target,u=p.label;Qn(g,E)&&Qn(g,d)&&u&&l(u)}),{movingShapes:o,resizingShapes:r}},ae.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},ae.prototype.isActive=function(){var e=this._dragging.context();return e?/^spaceTool/.test(e.prefix):!1};function o3(e){return{top:e.top-Nr,right:e.right+Nr,bottom:e.bottom+Nr,left:e.left-Nr}}function r3(e){var t=e.context,n=t.spaceToolConstraints;if(n){var A,i;A0(n.left)&&(A=Math.max(e.x,n.left),e.dx=e.dx+A-e.x,e.x=A),A0(n.right)&&(A=Math.min(e.x,n.right),e.dx=e.dx+A-e.x,e.x=A),A0(n.top)&&(i=Math.max(e.y,n.top),e.dy=e.dy+i-e.y,e.y=i),A0(n.bottom)&&(i=Math.min(e.y,n.bottom),e.dy=e.dy+i-e.y,e.y=i)}}function g8(e,t,n,A,i){var o=e.movingShapes,r=e.resizingShapes;if(r.length){var a={},c,l;return U(r,function(B){var g=B.attachers,p=B.children,E=e0(B),d=l0(p,function(R){return!Y0(R)&&!f0(R)&&!Qn(o,R)&&!Qn(r,R)}),u=l0(p,function(R){return!Y0(R)&&!f0(R)&&Qn(o,R)}),h,D,y,C=[],m=[],I,x,v,F;d.length&&(D=o3(e0(i2(d))),h=A-E[zt[n]]+D[zt[n]],n==="n"?a.bottom=l=A0(l)?Math.min(l,h):h:n==="w"?a.right=l=A0(l)?Math.min(l,h):h:n==="s"?a.top=c=A0(c)?Math.max(c,h):h:n==="e"&&(a.left=c=A0(c)?Math.max(c,h):h)),u.length&&(y=o3(e0(i2(u))),h=A-y[zt[Ur[n]]]+E[zt[Ur[n]]],n==="n"?a.bottom=l=A0(l)?Math.min(l,h):h:n==="w"?a.right=l=A0(l)?Math.min(l,h):h:n==="s"?a.top=c=A0(c)?Math.max(c,h):h:n==="e"&&(a.left=c=A0(c)?Math.max(c,h):h)),g&&g.length&&(g.forEach(function(R){Qn(o,R)?C.push(R):m.push(R)}),C.length&&(I=e0(i2(C.map(i0))),x=E[zt[Ur[n]]]-(I[zt[Ur[n]]]-A)),m.length&&(v=e0(i2(m.map(i0))),F=v[zt[n]]-(E[zt[n]]-A)),n==="n"?(h=Math.min(x||1/0,F||1/0),a.bottom=l=A0(l)?Math.min(l,h):h):n==="w"?(h=Math.min(x||1/0,F||1/0),a.right=l=A0(l)?Math.min(l,h):h):n==="s"?(h=Math.max(x||-1/0,F||-1/0),a.top=c=A0(c)?Math.max(c,h):h):n==="e"&&(h=Math.max(x||-1/0,F||-1/0),a.left=c=A0(c)?Math.max(c,h):h));var z=i&&i[B.id];z&&(n==="n"?(h=A+B[ot[t]]-z[ot[t]],a.bottom=l=A0(l)?Math.min(l,h):h):n==="w"?(h=A+B[ot[t]]-z[ot[t]],a.right=l=A0(l)?Math.min(l,h):h):n==="s"?(h=A-B[ot[t]]+z[ot[t]],a.top=c=A0(c)?Math.max(c,h):h):n==="e"&&(h=A-B[ot[t]]+z[ot[t]],a.left=c=A0(c)?Math.max(c,h):h))}),a}}function Qn(e,t){return e.indexOf(t)!==-1}function p8(e){return!!e.host}var u1="djs-dragging",a3="djs-resizing",E8=250,zr=Math.max;function c3(e,t,n,A,i){function o(r,a){U(r,function(c){i.addDragger(c,a),n.addMarker(c,u1)})}e.on("spaceTool.selection.start",function(r){var a=n.getLayer("space"),c=r.context,l={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},B=g0("g");q(B,A.cls("djs-crosshair-group",["no-events"])),Q0(a,B);var g=g0("path");q(g,"d",l.x),D0(g).add("djs-crosshair"),Q0(B,g);var p=g0("path");q(p,"d",l.y),D0(p).add("djs-crosshair"),Q0(B,p),c.crosshairGroup=B}),e.on("spaceTool.selection.move",function(r){var a=r.context.crosshairGroup;Q2(a,r.x,r.y)}),e.on("spaceTool.selection.cleanup",function(r){var a=r.context,c=a.crosshairGroup;c&&s2(c)}),e.on("spaceTool.move",E8,function(r){var a=r.context,c=a.line,l=a.axis,B=a.movingShapes,g=a.resizingShapes;if(a.initialized){if(!a.dragGroup){var p=n.getLayer("space");c=g0("path"),q(c,"d","M0,0 L0,0"),D0(c).add("djs-crosshair"),Q0(p,c),a.line=c;var E=g0("g");q(E,A.cls("djs-drag-group",["no-events"])),Q0(n.getActiveLayer(),E),o(B,E);var d=a.movingConnections=t.filter(function(m){var I=!1;U(B,function(z){U(z.outgoing,function(R){m===R&&(I=!0)})});var x=!1;U(B,function(z){U(z.incoming,function(R){m===R&&(x=!0)})});var v=!1;U(g,function(z){U(z.outgoing,function(R){m===R&&(v=!0)})});var F=!1;return U(g,function(z){U(z.incoming,function(R){m===R&&(F=!0)})}),Y0(m)&&(I||v)&&(x||F)});o(d,E),a.dragGroup=E}if(!a.frameGroup){var u=g0("g");q(u,A.cls("djs-frame-group",["no-events"])),Q0(n.getActiveLayer(),u);var h=[];U(g,function(m){var I=i.addFrame(m,u),x=I.getBBox();h.push({element:I,initialBounds:x}),n.addMarker(m,a3)}),a.frameGroup=u,a.frames=h}var D={x:"M"+r.x+", -10000 L"+r.x+", 10000",y:"M -10000, "+r.y+" L 10000, "+r.y};q(c,{d:D[l]});var y={x:"y",y:"x"},C={x:r.dx,y:r.dy};C[y[a.axis]]=0,Q2(a.dragGroup,C.x,C.y),U(a.frames,function(m){var I=m.element,x=m.initialBounds,v,F;a.direction==="e"?q(I,{width:zr(x.width+C.x,5)}):(v=zr(x.width-C.x,5),q(I,{width:v,x:x.x+x.width-v})),a.direction==="s"?q(I,{height:zr(x.height+C.y,5)}):(F=zr(x.height-C.y,5),q(I,{height:F,y:x.y+x.height-F}))})}}),e.on("spaceTool.cleanup",function(r){var a=r.context,c=a.movingShapes,l=a.movingConnections,B=a.resizingShapes,g=a.line,p=a.dragGroup,E=a.frameGroup;U(c,function(d){n.removeMarker(d,u1)}),U(l,function(d){n.removeMarker(d,u1)}),p&&(s2(g),s2(p)),U(B,function(d){n.removeMarker(d,a3)}),E&&s2(E)})}c3.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const d8={__init__:["spaceToolPreview"],__depends__:[nt,Te,Yr,AA,ci],spaceTool:["type",ae],spaceToolPreview:["type",c3]};function Rr(e,t){e.invoke(ae,this),this._canvas=t}Rr.$inject=["injector","canvas"],W(Rr,ae),Rr.prototype.calculateAdjustments=function(e,t,n,A){var i=this._canvas.getRootElement(),o=e[0]===i?null:e[0],r=[];o&&(r=FA(hB(i.children.filter(l=>f(l,"bpmn:Artifact")),i2(o))));const a=[...e,...r];var c=ae.prototype.calculateAdjustments.call(this,a,t,n,A);return c.resizingShapes=c.resizingShapes.filter(function(l){return!(f(l,"bpmn:TextAnnotation")||u8(l)&&(t==="y"&&l2(l)||t==="x"&&!l2(l)))}),c};function u8(e){return f(e,"bpmn:Participant")&&!P(e).processRef}const s3={__depends__:[d8],spaceTool:["type",Rr]};function J0(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)}J0.$inject=["eventBus","injector"],J0.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},J0.prototype.canExecute=function(e,t){const n={command:e,context:t},A=this._getHandler(e);let i=this._fire(e,"canExecute",n);if(i===void 0){if(!A)return!1;A.canExecute&&(i=A.canExecute(t))}return i},J0.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},J0.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()}},J0.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()}},J0.prototype.register=function(e,t){this._setHandler(e,t)},J0.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},J0.prototype.canUndo=function(){return!!this._getUndoAction()},J0.prototype.canRedo=function(){return!!this._getRedoAction()},J0.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},J0.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},J0.prototype._internalUndo=function(e){const t=e.command,n=e.context,A=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),A.revert&&this._markDirty(A.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)})},J0.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const A=t?[e+"."+t,t]:[e];let i;n=this._eventBus.createEvent(n);for(const o of A)if(i=this._eventBus.fire("commandStack."+o,n),n.cancelBubble)break;return i},J0.prototype._createId=function(){return this._uid++},J0.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},J0.prototype._internalExecute=function(e,t){const n=e.command,A=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(A),this._fire(n,"preExecuted",e)),this._atomicDo(()=>{this._fire(n,"execute",e),i.execute&&this._markDirty(i.execute(A)),this._executedAction(e,t),this._fire(n,"executed",e)}),t||(this._fire(n,"postExecute",e),i.postExecute&&i.postExecute(A),this._fire(n,"postExecuted",e)),this._popAction()},J0.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,A=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=A&&A.id||this._createId()),n.push(e)},J0.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,A=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:$a("id",A.reverse())}),A.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},J0.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=n0(e)?e:[e],t.dirty=t.dirty.concat(e))},J0.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},J0.prototype._revertedAction=function(e){this._stackIdx--},J0.prototype._getHandler=function(e){return this._handlerMap[e]},J0.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const Q8={commandStack:["type",J0]};function Rt(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}var h8=250,l3=1400;function Q1(e,t,n){j.call(this,t);var A=e.get("movePreview",!1);t.on("shape.move.start",l3,function(i){var o=i.context,r=o.shapes,a=o.validatedShapes;o.shapes=B3(r),o.validatedShapes=B3(a)}),A&&t.on("shape.move.start",h8,function(i){var o=i.context,r=o.shapes,a=[];U(r,function(c){U(c.labels,function(l){!l.hidden&&o.shapes.indexOf(l)===-1&&a.push(l),c.labelTarget&&a.push(c)})}),U(a,function(c){A.makeDraggable(o,c,!0)})}),this.preExecuted("elements.move",l3,function(i){var o=i.context,r=o.closure,a=r.enclosedElements,c=[];U(a,function(l){U(l.labels,function(B){a[B.id]||c.push(B)})}),r.addAll(c)}),this.preExecute(["connection.delete","shape.delete"],function(i){var o=i.context,r=o.connection||o.shape;Rt(r.labels,function(a){n.removeShape(a,{nested:!0})})}),this.execute("shape.delete",function(i){var o=i.context,r=o.shape,a=r.labelTarget;a&&(o.labelTargetIndex=Ec(a.labels,r),o.labelTarget=a,r.labelTarget=null)}),this.revert("shape.delete",function(i){var o=i.context,r=o.shape,a=o.labelTarget,c=o.labelTargetIndex;a&&(o2(a.labels,r,c),r.labelTarget=a)})}W(Q1,j),Q1.$inject=["injector","eventBus","modeling"];function B3(e){return l0(e,function(t){return e.indexOf(t.labelTarget)===-1})}const w8={__init__:["labelSupport"],labelSupport:["type",Q1]};var m8=251,g3=1401,p3="attach-ok";function h1(e,t,n,A,i){j.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",g3,function(r){var a=r.context,c=a.shapes,l=a.validatedShapes;a.shapes=f8(c),a.validatedShapes=C8(l)}),o&&t.on("shape.move.start",m8,function(r){var a=r.context,c=a.shapes,l=w1(c);U(l,function(B){o.makeDraggable(a,B,!0),U(B.labels,function(g){o.makeDraggable(a,g,!0)})})}),o&&t.on("shape.move.start",function(r){var a=r.context,c=a.shapes;if(c.length===1){var l=c[0],B=l.host;B&&(n.addMarker(B,p3),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(B,p3)}))}}),this.preExecuted("elements.move",g3,function(r){var a=r.context,c=a.closure,l=a.shapes,B=w1(l);U(B,function(g){c.add(g,c.topLevel[g.host.id])})}),this.postExecuted("elements.move",function(r){var a=r.context,c=a.shapes,l=a.newHost,B;l&&c.length!==1||(l?B=c:B=l0(c,function(g){var p=g.host;return M8(g)&&!D8(c,p)}),U(B,function(g){i.updateAttachment(g,l)}))}),this.postExecuted("elements.move",function(r){var a=r.context.shapes;U(a,function(c){U(c.attachers,function(l){U(l.outgoing.slice(),function(B){var g=A.allowed("connection.reconnect",{connection:B,source:B.source,target:B.target});g||i.removeConnection(B)}),U(l.incoming.slice(),function(B){var g=A.allowed("connection.reconnect",{connection:B,source:B.source,target:B.target});g||i.removeConnection(B)})})})}),this.postExecute("shape.create",function(r){var a=r.context,c=a.shape,l=a.host;l&&i.updateAttachment(c,l)}),this.postExecute("shape.replace",function(r){var a=r.context,c=a.oldShape,l=a.newShape;Rt(c.attachers,function(B){var g=A.allowed("elements.move",{target:l,shapes:[B]});g==="attach"?i.updateAttachment(B,l):i.removeShape(B)}),l.attachers.length&&U(l.attachers,function(B){var g=oE(B,c,l);i.moveShape(B,g,B.parent)})}),this.postExecute("shape.resize",function(r){var a=r.context,c=a.shape,l=a.oldBounds,B=a.newBounds,g=c.attachers,p=a.hints||{};p.attachSupport!==!1&&U(g,function(E){var d=oE(E,l,B);i.moveShape(E,d,E.parent),U(E.labels,function(u){i.moveShape(u,d,u.parent)})})}),this.preExecute("shape.delete",function(r){var a=r.context.shape;Rt(a.attachers,function(c){i.removeShape(c)}),a.host&&i.updateAttachment(a,null)})}W(h1,j),h1.$inject=["injector","eventBus","canvas","rules","modeling"];function w1(e){return no(B2(e,function(t){return t.attachers||[]}))}function f8(e){var t=w1(e);return Xl("id",e,t)}function C8(e){var t=Ve(e,"id");return l0(e,function(n){for(;n;){if(n.host&&t[n.host.id])return!1;n=n.parent}return!0})}function M8(e){return!!e.host}function D8(e,t){return e.indexOf(t)!==-1}const y8={__depends__:[Te],__init__:["attachSupport"],attachSupport:["type",h1]};function ce(e){this._model=e}ce.$inject=["moddle"],ce.prototype._needsId=function(e){return a0(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"])},ce.prototype._ensureId=function(e){if(e.id){this._model.ids.claim(e.id,e);return}var t;f(e,"bpmn:Activity")?t="Activity":f(e,"bpmn:Event")?t="Event":f(e,"bpmn:Gateway")?t="Gateway":a0(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))},ce.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},ce.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},ce.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",N({bpmnElement:e,bounds:this.createDiBounds()},t))},ce.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},ce.prototype.createDiWaypoints=function(e){var t=this;return B2(e,function(n){return t.createDiWaypoint(n)})},ce.prototype.createDiWaypoint=function(e){return this.create("dc:Point",q2(e,["x","y"]))},ce.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",N({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},ce.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",N({bpmnElement:e},t))};function H2(e,t,n){j.call(this,e),this._bpmnFactory=t;var A=this;function i(E){var d=E.context,u=d.hints||{},h;!d.cropped&&u.createElementsBehavior!==!1&&(h=d.connection,h.waypoints=n.getCroppedWaypoints(h),d.cropped=!0)}this.executed(["connection.layout","connection.create"],i),this.reverted(["connection.layout"],function(E){delete E.context.cropped});function o(E){var d=E.context;A.updateParent(d.shape||d.connection,d.oldParent)}function r(E){var d=E.context,u=d.shape||d.connection,h=d.parent||d.newParent;A.updateParent(u,h)}this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],P2(o)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],P2(r));function a(E){var d=E.context,u=d.oldRoot,h=u.children;U(h,function(D){f(D,"bpmn:BaseElement")&&A.updateParent(D)})}this.executed(["canvas.updateRoot"],a),this.reverted(["canvas.updateRoot"],a);function c(E){var d=E.context.shape;f(d,"bpmn:BaseElement")&&A.updateBounds(d)}this.executed(["shape.move","shape.create","shape.resize"],P2(function(E){E.context.shape.type!=="label"&&c(E)})),this.reverted(["shape.move","shape.create","shape.resize"],P2(function(E){E.context.shape.type!=="label"&&c(E)})),e.on("shape.changed",function(E){E.element.type==="label"&&c({context:{shape:E.element}})});function l(E){A.updateConnection(E.context)}this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],P2(l)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],P2(l));function B(E){A.updateConnectionWaypoints(E.context.connection)}this.executed(["connection.layout","connection.move","connection.updateWaypoints"],P2(B)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],P2(B)),this.executed("connection.reconnect",P2(function(E){var d=E.context,u=d.connection,h=d.oldSource,D=d.newSource,y=P(u),C=P(h),m=P(D);y.conditionExpression&&!a0(m,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(d.oldConditionExpression=y.conditionExpression,delete y.conditionExpression),h!==D&&C.default===y&&(d.oldDefault=C.default,delete C.default)})),this.reverted("connection.reconnect",P2(function(E){var d=E.context,u=d.connection,h=d.oldSource,D=d.newSource,y=P(u),C=P(h),m=P(D);d.oldConditionExpression&&(y.conditionExpression=d.oldConditionExpression),d.oldDefault&&(C.default=d.oldDefault,delete m.default)}));function g(E){A.updateAttachment(E.context)}this.executed(["element.updateAttachment"],P2(g)),this.reverted(["element.updateAttachment"],P2(g)),this.executed("element.updateLabel",P2(p)),this.reverted("element.updateLabel",P2(p));function p(E){const{element:d}=E.context,u=fe(d),h=h0(d),D=h&&h.get("label");an(d)||zo(d)||(u&&!D?h.set("label",t.create("bpmndi:BPMNLabel")):!u&&D&&h.set("label",void 0))}}W(H2,j),H2.$inject=["eventBus","bpmnFactory","connectionDocking"],H2.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,A=t.host;n.attachedToRef=A&&A.businessObject},H2.prototype.updateParent=function(e,t){if(!f0(e)&&!(f(e,"bpmn:DataStoreReference")&&e.parent&&f(e.parent,"bpmn:Collaboration"))){var n=e.parent,A=e.businessObject,i=h0(e),o=n&&n.businessObject,r=h0(n);f(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(A,o,t&&t.businessObject),f(e,"bpmn:DataOutputAssociation")&&(e.source?o=e.source.businessObject:o=null),f(e,"bpmn:DataInputAssociation")&&(e.target?o=e.target.businessObject:o=null),this.updateSemanticParent(A,o),f(e,"bpmn:DataObjectReference")&&A.dataObjectRef&&this.updateSemanticParent(A.dataObjectRef,o),this.updateDiParent(i,r)}},H2.prototype.updateBounds=function(e){var t=h0(e),n=F8(e);if(n){var A=Me(n,t.get("bounds"));N(n,{x:e.x+A.x,y:e.y+A.y})}var i=f0(e)?this._getLabel(t):t,o=i.bounds;o||(o=this._bpmnFactory.createDiBounds(),i.set("bounds",o)),N(o,{x:e.x,y:e.y,width:e.width,height:e.height})},H2.prototype.updateFlowNodeRefs=function(e,t,n){if(n!==t){var A,i;f(n,"bpmn:Lane")&&(A=n.get("flowNodeRef"),X0(A,e)),f(t,"bpmn:Lane")&&(i=t.get("flowNodeRef"),o2(i,e))}},H2.prototype.updateDiConnection=function(e,t,n){var A=h0(e),i=h0(t),o=h0(n);A.sourceElement&&A.sourceElement.bpmnElement!==P(t)&&(A.sourceElement=t&&i),A.targetElement&&A.targetElement.bpmnElement!==P(n)&&(A.targetElement=n&&o)},H2.prototype.updateDiParent=function(e,t){if(t&&!f(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(X0(n,e),e.$parent=null)}};function I8(e){for(;e&&!f(e,"bpmn:Definitions");)e=e.$parent;return e}H2.prototype.getLaneSet=function(e){var t,n;return f(e,"bpmn:Lane")?(t=e.childLaneSet,t||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(f(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)},H2.prototype.updateSemanticParent=function(e,t,n){var A;if(e.$parent!==t&&!((f(e,"bpmn:DataInput")||f(e,"bpmn:DataOutput"))&&(f(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),"ioSpecification"in t&&t.ioSpecification===e.$parent))){if(f(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),A="lanes";else if(f(e,"bpmn:FlowElement")){if(t){if(f(t,"bpmn:Participant"))t=t.processRef;else if(f(t,"bpmn:Lane"))do t=t.$parent.$parent;while(f(t,"bpmn:Lane"))}A="flowElements"}else if(f(e,"bpmn:Artifact")){for(;t&&!f(t,"bpmn:Process")&&!f(t,"bpmn:SubProcess")&&!f(t,"bpmn:Collaboration");)if(f(t,"bpmn:Participant")){t=t.processRef;break}else t=t.$parent;A="artifacts"}else if(f(e,"bpmn:MessageFlow"))A="messageFlows";else if(f(e,"bpmn:Participant")){A="participants";var i=e.processRef,o;i&&(o=I8(e.$parent||t),e.$parent&&(X0(o.get("rootElements"),i),i.$parent=null),t&&(o2(o.get("rootElements"),i),i.$parent=o))}else f(e,"bpmn:DataOutputAssociation")?A="dataOutputAssociations":f(e,"bpmn:DataInputAssociation")&&(A="dataInputAssociations");if(!A)throw new Error(`no parent for <${e.id}> in <${t.id}>`);var r;if(e.$parent&&(r=e.$parent.get(A),X0(r,e)),t?(r=t.get(A),r.push(e),e.$parent=t):e.$parent=null,n){var a=n.get(A);X0(r,e),t&&(a||(a=[],t.set(A,a)),a.push(e))}}},H2.prototype.updateConnectionWaypoints=function(e){var t=h0(e);t.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},H2.prototype.updateConnection=function(e){var t=e.connection,n=P(t),A=t.source,i=P(A),o=t.target,r=P(t.target),a;if(f(n,"bpmn:DataAssociation"))f(n,"bpmn:DataInputAssociation")?(n.get("sourceRef")[0]=i,a=e.parent||e.newParent||r,this.updateSemanticParent(n,r,a)):f(n,"bpmn:DataOutputAssociation")&&(a=e.parent||e.newParent||i,this.updateSemanticParent(n,i,a),n.targetRef=r);else{var c=f(n,"bpmn:SequenceFlow");n.sourceRef!==i&&(c&&(X0(n.sourceRef&&n.sourceRef.get("outgoing"),n),i&&i.get("outgoing")&&i.get("outgoing").push(n)),n.sourceRef=i),n.targetRef!==r&&(c&&(X0(n.targetRef&&n.targetRef.get("incoming"),n),r&&r.get("incoming")&&r.get("incoming").push(n)),n.targetRef=r)}this.updateConnectionWaypoints(t),this.updateDiConnection(t,A,o)},H2.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};function P2(e){return function(t){var n=t.context,A=n.shape||n.connection||n.element;f(A,"bpmn:BaseElement")&&e(t)}}function F8(e){if(f(e,"bpmn:Activity")){var t=h0(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}function St(e,t){Oe.call(this),this._bpmnFactory=e,this._moddle=t}W(St,Oe),St.$inject=["bpmnFactory","moddle"],St.prototype._baseCreate=Oe.prototype.create,St.prototype.create=function(e,t){if(e==="label"){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,N({type:"label",di:n},PA,t))}return this.createElement(e,t)},St.prototype.createElement=function(e,t){t=N({},t||{});var n,A=t.businessObject,i=t.di;if(!A){if(!t.type)throw new Error("no shape type specified");A=this._bpmnFactory.create(t.type),Eg(A)}if(!x8(i)){var o=N({},i||{},{id:A.id+"_di"});e==="root"?i=this._bpmnFactory.createDiPlane(A,o):e==="connection"?i=this._bpmnFactory.createDiEdge(A,o):i=this._bpmnFactory.createDiShape(A,o)}f(A,"bpmn:Group")&&(t=N({isFrame:!0},t)),t=v8(A,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=m1(i,t,"isExpanded")),a0(A,["bpmn:Lane","bpmn:Participant"])&&(t=m1(i,t,"isHorizontal")),f(A,"bpmn:SubProcess")&&(t.collapsed=!E0(A,i)),f(A,"bpmn:ExclusiveGateway")&&(I2(i,"isMarkerVisible")?i.isMarkerVisible===void 0&&(i.isMarkerVisible=!1):i.isMarkerVisible=!0),a2(t.triggeredByEvent)&&(A.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),a2(t.cancelActivity)&&(A.cancelActivity=t.cancelActivity,delete t.cancelActivity);var r,a;return t.eventDefinitionType&&(r=A.get("eventDefinitions")||[],a=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(a.condition=this._bpmnFactory.create("bpmn:FormalExpression")),r.push(a),a.$parent=A,A.eventDefinitions=r,delete t.eventDefinitionType),n=this.getDefaultSize(A,i),t=N({id:A.id},n,t,{businessObject:A,di:i}),this._baseCreate(e,t)},St.prototype.getDefaultSize=function(e,t){var n=P(e);if(t=t||h0(e),f(n,"bpmn:SubProcess"))return E0(n,t)?{width:350,height:200}:{width:100,height:80};if(f(n,"bpmn:Task"))return{width:100,height:80};if(f(n,"bpmn:Gateway"))return{width:50,height:50};if(f(n,"bpmn:Event"))return{width:36,height:36};if(f(n,"bpmn:Participant")){var A=t.isHorizontal===void 0||t.isHorizontal===!0;return E0(n,t)?A?{width:600,height:250}:{width:250,height:600}:A?{width:400,height:60}:{width:60,height:400}}return f(n,"bpmn:Lane")?{width:400,height:100}:f(n,"bpmn:DataObjectReference")?{width:36,height:50}:f(n,"bpmn:DataStoreReference")?{width:50,height:50}:f(n,"bpmn:TextAnnotation")?{width:100,height:30}:f(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},St.prototype.createParticipantShape=function(e){return V0(e)||(e={isExpanded:e}),e=N({type:"bpmn:Participant"},e||{}),e.isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)};function v8(e,t,n){return U(n,function(A){t=m1(e,t,A)}),t}function m1(e,t,n){return t[n]===void 0?t:(e[n]=t[n],we(t,[n]))}function x8(e){return a0(e,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}function Sr(e,t){this._modeling=e,this._canvas=t}Sr.$inject=["modeling","canvas"],Sr.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,A=e.alignment;U(n,function(i){var o={x:0,y:0};a2(A.left)?o.x=A.left-i.x:a2(A.right)?o.x=A.right-i.width-i.x:a2(A.center)?o.x=A.center-Math.round(i.width/2)-i.x:a2(A.top)?o.y=A.top-i.y:a2(A.bottom)?o.y=A.bottom-i.height-i.y:a2(A.middle)&&(o.y=A.middle-Math.round(i.height/2)-i.y),t.moveElements([i],o,i.parent)})},Sr.prototype.postExecute=function(e){};function Tr(e){this._modeling=e}Tr.$inject=["modeling"],Tr.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,A=e.shape,i=e.hints||{};A=e.shape=this._modeling.createShape(A,e.position,n,{attach:i.attach}),e.shape=A},Tr.prototype.postExecute=function(e){var t=e.hints||{};b8(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 b8(e,t){return Qe(e.outgoing,function(n){return n.target===t})}function kr(e,t){this._canvas=e,this._layouter=t}kr.$inject=["canvas","layouter"],kr.prototype.execute=function(e){var t=e.connection,n=e.source,A=e.target,i=e.parent,o=e.parentIndex,r=e.hints;if(!n||!A)throw new Error("source and target required");if(!i)throw new Error("parent required");return t.source=n,t.target=A,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,r)),this._canvas.addConnection(t,i,o),t},kr.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Gr=Math.round;function f1(e){this._modeling=e}f1.$inject=["modeling"],f1.prototype.preExecute=function(e){var t=e.elements,n=e.parent,A=e.parentIndex,i=e.position,o=e.hints,r=this._modeling;U(t,function(g){A0(g.x)||(g.x=0),A0(g.y)||(g.y=0)});var a=l0(t,function(g){return!g.hidden}),c=i2(a);U(t,function(g){Y0(g)&&(g.waypoints=B2(g.waypoints,function(p){return{x:Gr(p.x-c.x-c.width/2+i.x),y:Gr(p.y-c.y-c.height/2+i.y)}})),N(g,{x:Gr(g.x-c.x-c.width/2+i.x),y:Gr(g.y-c.y-c.height/2+i.y)})});var l=Bo(t),B={};U(t,function(g){if(Y0(g)){B[g.id]=A0(A)?r.createConnection(B[g.source.id],B[g.target.id],A,g,g.parent||n,o):r.createConnection(B[g.source.id],B[g.target.id],g,g.parent||n,o);return}var p=N({},o);l.indexOf(g)===-1&&(p.autoResize=!1),f0(g)&&(p=we(p,["attach"])),B[g.id]=A0(A)?r.createShape(g,q2(g,["x","y","width","height"]),g.parent||n,A,p):r.createShape(g,q2(g,["x","y","width","height"]),g.parent||n,p)}),e.elements=FA(B)};var E3=Math.round;function Tt(e){this._canvas=e}Tt.$inject=["canvas"],Tt.prototype.execute=function(e){var t=e.shape,n=e.position,A=e.parent,i=e.parentIndex;if(!A)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?N(t,n):N(t,{x:n.x-E3(t.width/2),y:n.y-E3(t.height/2)}),this._canvas.addShape(t,A,i),t},Tt.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function Bi(e){Tt.call(this,e)}W(Bi,Tt),Bi.$inject=["canvas"];var Y8=Tt.prototype.execute;Bi.prototype.execute=function(e){var t=e.shape;return N8(t),t.labelTarget=e.labelTarget,Y8.call(this,e)};var U8=Tt.prototype.revert;Bi.prototype.revert=function(e){return e.shape.labelTarget=null,U8.call(this,e)};function N8(e){["width","height"].forEach(function(t){typeof e[t]>"u"&&(e[t]=0)})}function gi(e,t){this._canvas=e,this._modeling=t}gi.$inject=["canvas","modeling"],gi.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;Rt(n.incoming,function(A){t.removeConnection(A,{nested:!0})}),Rt(n.outgoing,function(A){t.removeConnection(A,{nested:!0})})},gi.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Ec(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},gi.prototype.revert=function(e){var t=e.connection,n=e.parent,A=e.parentIndex;return t.source=e.source,t.target=e.target,o2(n.children,t,A),this._canvas.addConnection(t,n),t};function C1(e,t){this._modeling=e,this._elementRegistry=t}C1.$inject=["modeling","elementRegistry"],C1.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,A=e.elements;U(A,function(i){n.get(i.id)&&(i.waypoints?t.removeConnection(i):t.removeShape(i))})};function pi(e,t){this._canvas=e,this._modeling=t}pi.$inject=["canvas","modeling"],pi.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;Rt(n.incoming,function(A){t.removeConnection(A,{nested:!0})}),Rt(n.outgoing,function(A){t.removeConnection(A,{nested:!0})}),Rt(n.children,function(A){Y0(A)?t.removeConnection(A,{nested:!0}):t.removeShape(A,{nested:!0})})},pi.prototype.execute=function(e){var t=this._canvas,n=e.shape,A=n.parent;return e.oldParent=A,e.oldParentIndex=Ec(A.children,n),t.removeShape(n),n},pi.prototype.revert=function(e){var t=this._canvas,n=e.shape,A=e.oldParent,i=e.oldParentIndex;return o2(A.children,n,i),t.addShape(n,A),n};function Hr(e){this._modeling=e}Hr.$inject=["modeling"];var d3={x:"y",y:"x"};Hr.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,A=e.axis,i=e.dimension;function o(h,D){h.range.min=Math.min(D[A],h.range.min),h.range.max=Math.max(D[A]+D[i],h.range.max)}function r(h){return h[A]+h[i]/2}function a(h){return h.length-1}function c(h){return h.max-h.min}function l(h,D){var y={y:0};y[A]=h-r(D),y[A]&&(y[d3[A]]=0,t.moveElements([D],y,D.parent))}var B=n[0],g=a(n),p=n[g],E,d,u=0;U(n,function(h,D){var y,C,m;if(h.elements.length<2){D&&D!==n.length-1&&(o(h,h.elements[0]),u+=c(h.range));return}y=he(h.elements,A),C=y[0],D===g&&(C=y[a(y)]),m=r(C),h.range=null,U(y,function(I){if(l(m,I),h.range===null){h.range={min:I[A],max:I[A]+I[i]};return}o(h,I)}),D&&D!==n.length-1&&(u+=c(h.range))}),d=Math.abs(p.range.min-B.range.max),E=Math.round((d-u)/(n.length-1)),!(E<n.length-1)&&U(n,function(h,D){var y={},C;h===B||h===p||(C=n[D-1],h.range.max=0,U(h.elements,function(m,I){y[d3[A]]=0,y[A]=C.range.max-m[A]+E,h.range.min!==m[A]&&(y[A]+=m[A]-h.range.min),y[A]&&t.moveElements([m],y,m.parent),h.range.max=Math.max(m[A]+m[i],I?h.range.max:0)}))})},Hr.prototype.postExecute=function(e){};function Pr(e,t){this._layouter=e,this._canvas=t}Pr.$inject=["layouter","canvas"],Pr.prototype.execute=function(e){var t=e.connection,n=t.waypoints;return N(e,{oldWaypoints:n}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Pr.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};function M1(){}M1.prototype.execute=function(e){var t=e.connection,n=e.delta,A=e.newParent||t.parent,i=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=X0(o.children,t),o2(A.children,t,i),t.parent=A,U(t.waypoints,function(r){r.x+=n.x,r.y+=n.y,r.original&&(r.original.x+=n.x,r.original.y+=n.y)}),t},M1.prototype.revert=function(e){var t=e.connection,n=t.parent,A=e.oldParent,i=e.oldParentIndex,o=e.delta;return X0(n.children,t),o2(A.children,t,i),t.parent=A,U(t.waypoints,function(r){r.x-=o.x,r.y-=o.y,r.original&&(r.original.x-=o.x,r.original.y-=o.y)}),t};function D1(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}D1.prototype.add=function(e,t){return this.addAll([e],t)},D1.prototype.addAll=function(e,t){var n=cf(e,!!t,this);return N(this,n),this};function Ei(e){this._modeling=e}Ei.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},Ei.prototype.moveClosure=function(e,t,n,A,i){var o=this._modeling,r=e.allShapes,a=e.allConnections,c=e.enclosedConnections,l=e.topLevel,B=!1;i&&i.parent===n&&(B=!0),U(r,function(g){o.moveShape(g,t,l[g.id]&&!B&&n,{recurse:!1,layout:!1})}),U(a,function(g){var p=!!r[g.source.id],E=!!r[g.target.id];c[g.id]&&p&&E?o.moveConnection(g,t,l[g.id]&&!B&&n):o.layoutConnection(g,{connectionStart:p&&Ss(g,g.source,t),connectionEnd:E&&Ts(g,g.target,t)})})},Ei.prototype.getClosure=function(e){return new D1().addAll(e,!0)};function Jr(e){this._helper=new Ei(e)}Jr.$inject=["modeling"],Jr.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Jr.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)};function hn(e){this._modeling=e,this._helper=new Ei(e)}hn.$inject=["modeling"],hn.prototype.execute=function(e){var t=e.shape,n=e.delta,A=e.newParent||t.parent,i=e.newParentIndex,o=t.parent;return e.oldBounds=q2(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=X0(o.children,t),o2(A.children,t,i),N(t,{parent:A,x:t.x+n.x,y:t.y+n.y}),t},hn.prototype.postExecute=function(e){var t=e.shape,n=e.delta,A=e.hints,i=this._modeling;A.layout!==!1&&(U(t.incoming,function(o){i.layoutConnection(o,{connectionEnd:Ts(o,t,n)})}),U(t.outgoing,function(o){i.layoutConnection(o,{connectionStart:Ss(o,t,n)})})),A.recurse!==!1&&this.moveChildren(e)},hn.prototype.revert=function(e){var t=e.shape,n=e.oldParent,A=e.oldParentIndex,i=e.delta;return o2(n.children,t,A),N(t,{parent:n,x:t.x-i.x,y:t.y-i.y}),t},hn.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},hn.prototype.getNewParent=function(e){return e.newParent||e.shape.parent};function di(e){this._modeling=e}di.$inject=["modeling"],di.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,A=e.connection,i=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return n0(i)&&(e.oldWaypoints=A.waypoints,A.waypoints=i),t&&(e.oldSource=A.source,A.source=t),n&&(e.oldTarget=A.target,A.target=n),A},di.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,A=e.newTarget,i=e.dockingOrPoints,o=e.hints||{},r={};o.connectionStart&&(r.connectionStart=o.connectionStart),o.connectionEnd&&(r.connectionEnd=o.connectionEnd),o.layoutConnection!==!1&&(n&&(!A||o.docking==="source")&&(r.connectionStart=r.connectionStart||u3(n0(i)?i[0]:i)),A&&(!n||o.docking==="target")&&(r.connectionEnd=r.connectionEnd||u3(n0(i)?i[i.length-1]:i)),o.newWaypoints&&(r.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,r))},di.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,A=e.oldWaypoints,i=e.connection;return t&&(i.source=t),n&&(i.target=n),A&&(i.waypoints=A),i};function u3(e){return e.original||e}function rt(e,t){this._modeling=e,this._rules=t}rt.$inject=["modeling","rules"],rt.prototype.preExecute=function(e){var t=this,n=this._modeling,A=this._rules,i=e.oldShape,o=e.newData,r=e.hints||{},a;function c(d,u,h){return A.allowed("connection.reconnect",{connection:h,source:d,target:u})}var l={x:o.x,y:o.y},B={x:i.x,y:i.y,width:i.width,height:i.height};a=e.newShape=e.newShape||t.createShape(o,l,i.parent,r),i.host&&n.updateAttachment(a,i.host);var g;r.moveChildren!==!1&&(g=i.children.slice(),n.moveElements(g,{x:0,y:0},a,r));var p=i.incoming.slice(),E=i.outgoing.slice();U(p,function(d){var u=d.source,h=c(u,a,d);h&&t.reconnectEnd(d,a,mr(d,a,B),r)}),U(E,function(d){var u=d.target,h=c(a,u,d);h&&t.reconnectStart(d,a,wr(d,a,B),r)})},rt.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},rt.prototype.execute=function(e){},rt.prototype.revert=function(e){},rt.prototype.createShape=function(e,t,n,A){return this._modeling.createShape(e,t,n,A)},rt.prototype.reconnectStart=function(e,t,n,A){this._modeling.reconnectStart(e,t,n,A)},rt.prototype.reconnectEnd=function(e,t,n,A){this._modeling.reconnectEnd(e,t,n,A)};function ui(e){this._modeling=e}ui.$inject=["modeling"],ui.prototype.execute=function(e){var t=e.shape,n=e.newBounds,A=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(A&&(n.width<A.width||n.height<A.height))throw new Error("width and height cannot be less than minimum height and width");if(!A&&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},N(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},ui.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,A=e.oldBounds,i=e.hints||{};i.layout!==!1&&(U(n.incoming,function(o){t.layoutConnection(o,{connectionEnd:mr(o,n,A)})}),U(n.outgoing,function(o){t.layoutConnection(o,{connectionStart:wr(o,n,A)})}))},ui.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return N(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t};function kt(e){this._modeling=e}kt.$inject=["modeling"],kt.prototype.preExecute=function(e){var t=e.delta,n=e.direction,A=e.movingShapes,i=e.resizingShapes,o=e.start,r={};this.moveShapes(A,t),U(i,function(a){r[a.id]=R8(a)}),this.resizeShapes(i,t,n),this.updateConnectionWaypoints(c8(A,i),t,n,o,A,i,r)},kt.prototype.execute=function(){},kt.prototype.revert=function(){},kt.prototype.moveShapes=function(e,t){var n=this;U(e,function(A){n._modeling.moveShape(A,t,null,{autoResize:!1,layout:!1,recurse:!1})})},kt.prototype.resizeShapes=function(e,t,n){var A=this;U(e,function(i){var o=s8(i,n,t);A._modeling.resizeShape(i,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})},kt.prototype.updateConnectionWaypoints=function(e,t,n,A,i,o,r){var a=this,c=i.concat(o);U(e,function(l){var B=l.source,g=l.target,p=z8(l),E=h3(n),d={};Gt(c,B)&&Gt(c,g)?(p=B2(p,function(u){return w3(u,A,n)&&(u[E]=u[E]+t[E]),u.original&&w3(u.original,A,n)&&(u.original[E]=u.original[E]+t[E]),u}),a._modeling.updateWaypoints(l,p,{labelBehavior:!1})):(Gt(c,B)||Gt(c,g))&&(Gt(i,B)?d.connectionStart=Ss(l,B,t):Gt(i,g)?d.connectionEnd=Ts(l,g,t):Gt(o,B)?d.connectionStart=wr(l,B,r[B.id]):Gt(o,g)&&(d.connectionEnd=mr(l,g,r[g.id])),a._modeling.layoutConnection(l,d))})};function Q3(e){return N({},e)}function z8(e){return B2(e.waypoints,function(t){return t=Q3(t),t.original&&(t.original=Q3(t.original)),t})}function h3(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function w3(e,t,n){var A=h3(n);if(/e|s/.test(n))return e[A]>t;if(/n|w/.test(n))return e[A]<t}function Gt(e,t){return e.indexOf(t)!==-1}function R8(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}function jr(e){this._modeling=e}jr.$inject=["modeling"],jr.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=m3(n),t.collapsed=!t.collapsed;var A=f3(n,t.collapsed);return[t].concat(A)},jr.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,A=t.children,i=C3(A,n);return t.collapsed=!t.collapsed,[t].concat(i)};function m3(e){var t={};return U(e,function(n){t[n.id]=n.hidden,n.children&&(t=N({},t,m3(n.children)))}),t}function f3(e,t){var n=[];return U(e,function(A){A.hidden=t,n=n.concat(A),A.children&&(n=n.concat(f3(A.children,A.collapsed||t)))}),n}function C3(e,t){var n=[];return U(e,function(A){A.hidden=t[A.id],n=n.concat(A),A.children&&(n=n.concat(C3(A.children,t)))}),n}function Vr(e){this._modeling=e}Vr.$inject=["modeling"],Vr.prototype.execute=function(e){var t=e.shape,n=e.newHost,A=t.host;return e.oldHost=A,e.attacherIdx=M3(A,t),D3(n,t),t.host=n,t},Vr.prototype.revert=function(e){var t=e.shape,n=e.newHost,A=e.oldHost,i=e.attacherIdx;return t.host=A,M3(n,t),D3(A,t,i),t};function M3(e,t){return X0(e&&e.attachers,t)}function D3(e,t,n){if(e){var A=e.attachers;A||(e.attachers=A=[]),o2(A,t,n)}}function y1(){}y1.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},y1.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t};function U0(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var A=this;e.on("diagram.init",function(){A.registerHandlers(n)})}U0.$inject=["eventBus","elementFactory","commandStack"],U0.prototype.getHandlers=function(){return{"shape.append":Tr,"shape.create":Tt,"shape.delete":pi,"shape.move":hn,"shape.resize":ui,"shape.replace":rt,"shape.toggleCollapse":jr,spaceTool:kt,"label.create":Bi,"connection.create":kr,"connection.delete":gi,"connection.move":M1,"connection.layout":Pr,"connection.updateWaypoints":y1,"connection.reconnect":di,"elements.create":f1,"elements.move":Jr,"elements.delete":C1,"elements.distribute":Hr,"elements.align":Sr,"element.updateAttachment":Vr}},U0.prototype.registerHandlers=function(e){U(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},U0.prototype.moveShape=function(e,t,n,A,i){typeof A=="object"&&(i=A,A=null);var o={shape:e,delta:t,newParent:n,newParentIndex:A,hints:i||{}};this._commandStack.execute("shape.move",o)},U0.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},U0.prototype.moveElements=function(e,t,n,A){A=A||{};var i=A.attach,o=n,r;i===!0?(r=n,o=n.parent):i===!1&&(r=null);var a={shapes:e,delta:t,newParent:o,newHost:r,hints:A};this._commandStack.execute("elements.move",a)},U0.prototype.moveConnection=function(e,t,n,A,i){typeof A=="object"&&(i=A,A=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:A,hints:i||{}};this._commandStack.execute("connection.move",o)},U0.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},U0.prototype.createConnection=function(e,t,n,A,i,o){typeof n=="object"&&(o=i,i=A,A=n,n=void 0),A=this._create("connection",A);var r={source:e,target:t,parent:i,parentIndex:n,connection:A,hints:o};return this._commandStack.execute("connection.create",r),r.connection},U0.prototype.createShape=function(e,t,n,A,i){typeof A!="number"&&(i=A,A=void 0),i=i||{};var o=i.attach,r,a;e=this._create("shape",e),o?(r=n.parent,a=n):r=n;var c={position:t,shape:e,parent:r,parentIndex:A,host:a,hints:i};return this._commandStack.execute("shape.create",c),c.shape},U0.prototype.createElements=function(e,t,n,A,i){n0(e)||(e=[e]),typeof A!="number"&&(i=A,A=void 0),i=i||{};var o={position:t,elements:e,parent:n,parentIndex:A,hints:i};return this._commandStack.execute("elements.create",o),o.elements},U0.prototype.createLabel=function(e,t,n,A){n=this._create("label",n);var i={labelTarget:e,position:t,parent:A||e.parent,shape:n};return this._commandStack.execute("label.create",i),i.shape},U0.prototype.appendShape=function(e,t,n,A,i){i=i||{},t=this._create("shape",t);var o={source:e,position:n,target:A,shape:t,connection:i.connection,connectionParent:i.connectionParent,hints:i};return this._commandStack.execute("shape.append",o),o.shape},U0.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},U0.prototype.distributeElements=function(e,t,n){var A={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",A)},U0.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},U0.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},U0.prototype.replaceShape=function(e,t,n){var A={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",A),A.newShape},U0.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},U0.prototype.resizeShape=function(e,t,n,A){var i={shape:e,newBounds:t,minBounds:n,hints:A};this._commandStack.execute("shape.resize",i)},U0.prototype.createSpace=function(e,t,n,A,i){var o={delta:n,direction:A,movingShapes:e,resizingShapes:t,start:i};this._commandStack.execute("spaceTool",o)},U0.prototype.updateWaypoints=function(e,t,n){var A={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",A)},U0.prototype.reconnect=function(e,t,n,A,i){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:A,hints:i||{}};this._commandStack.execute("connection.reconnect",o)},U0.prototype.reconnectStart=function(e,t,n,A){A||(A={}),this.reconnect(e,t,e.target,n,N(A,{docking:"source"}))},U0.prototype.reconnectEnd=function(e,t,n,A){A||(A={}),this.reconnect(e,e.source,t,n,N(A,{docking:"target"}))},U0.prototype.connect=function(e,t,n,A){return this.createConnection(e,t,n||{},e.parent,A)},U0.prototype._create=function(e,t){return Pf(t)?t:this._elementFactory.create(e,t)},U0.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)};function Qi(e){this._elementRegistry=e}Qi.$inject=["elementRegistry"],Qi.prototype.execute=function(e){var t=e.element,n=e.moddleElement,A=e.properties;if(!n)throw new Error("<moddleElement> required");var i=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||S8(n,IA(A));return y3(n,A),e.oldProperties=o,e.changed=i,i},Qi.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,A=e.changed;return y3(n,t),A},Qi.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return f(e,"bpmn:DataObject")?T8(e,t):[]};function S8(e,t){return F2(t,function(n,A){return n[A]=e.get(A),n},{})}function y3(e,t){U(t,function(n,A){e.set(A,n)})}function T8(e,t){return t.filter(function(n){return f(n,"bpmn:DataObjectReference")&&P(n).dataObjectRef===e})}var hi="default",at="id",I3="di",k8={width:0,height:0};function wi(e,t,n,A){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=A}wi.$inject=["elementRegistry","moddle","modeling","textRenderer"],wi.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var A=this._elementRegistry,i=this._moddle.ids,o=t.businessObject,r=j8(e.properties),a=e.oldProperties||G8(t,r);return F3(r,o)&&(i.unclaim(o[at]),A.updateId(t,r[at]),i.claim(r[at],o)),hi in r&&(r[hi]&&n.push(A.get(r[hi].id)),o[hi]&&n.push(A.get(o[hi].id))),v3(t,r),e.oldProperties=a,e.changed=n,n},wi.prototype.postExecute=function(e){var t=e.element,n=t.label,A=n&&P(n).name;if(A){var i=this._textRenderer.getExternalLabelBounds(n,A);this._modeling.resizeShape(n,i,k8)}},wi.prototype.revert=function(e){var t=e.element,n=e.properties,A=e.oldProperties,i=t.businessObject,o=this._elementRegistry,r=this._moddle.ids;return v3(t,A),F3(n,i)&&(r.unclaim(n[at]),o.updateId(t,A[at]),r.claim(A[at],i)),e.changed};function F3(e,t){return at in e&&e[at]!==t[at]}function G8(e,t){var n=IA(t),A=e.businessObject,i=h0(e);return F2(n,function(o,r){return r!==I3?o[r]=A.get(r):o[r]=H8(i,IA(t.di)),o},{})}function H8(e,t){return F2(t,function(n,A){return n[A]=e&&e.get(A),n},{})}function v3(e,t){var n=e.businessObject,A=h0(e);U(t,function(i,o){o!==I3?n.set(o,i):A&&P8(A,i)})}function P8(e,t){U(t,function(n,A){e.set(A,n)})}var J8=["default"];function j8(e){var t=N({},e);return J8.forEach(function(n){n in e&&(t[n]=P(t[n]))}),t}function Lr(e,t){this._canvas=e,this._modeling=t}Lr.$inject=["canvas","modeling"],Lr.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,A=n.businessObject,i=t.getRootElement(),o=i.businessObject,r=o.$parent,a=h0(i);return t.setRootElement(n),t.removeRootElement(i),o2(r.rootElements,A),A.$parent=r,X0(r.rootElements,o),o.$parent=null,i.di=null,a.bpmnElement=A,n.di=a,e.oldRoot=i,[]},Lr.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,A=n.businessObject,i=e.oldRoot,o=i.businessObject,r=A.$parent,a=h0(n);return t.setRootElement(i),t.removeRootElement(n),X0(r.rootElements,A),A.$parent=null,o2(r.rootElements,o),o.$parent=r,n.di=null,a.bpmnElement=o,i.di=a,[]};function I1(e,t){this._modeling=e,this._spaceTool=t}I1.$inject=["modeling","spaceTool"],I1.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,A=e.shape,i=e.location,o=re(A),r=o===A,a=r?A:A.parent,c=it(a),l=l2(A);if(l?i==="left"?i="top":i==="right"&&(i="bottom"):i==="top"?i="left":i==="bottom"&&(i="right"),!c.length){var B=l?{x:A.x+oe,y:A.y,width:A.width-oe,height:A.height}:{x:A.x,y:A.y+oe,width:A.width,height:A.height-oe};n.createShape({type:"bpmn:Lane",isHorizontal:l},B,a)}var g=[];nn(o,function(m){return g.push(m),m.label&&g.push(m.label),m===A?[]:l0(m.children,function(I){return I!==A})});var p,E,d,u,h;i==="top"?(p=-120,E=A.y,d=E+10,u="n",h="y"):i==="left"?(p=-120,E=A.x,d=E+10,u="w",h="x"):i==="bottom"?(p=120,E=A.y+A.height,d=E-10,u="s",h="y"):i==="right"&&(p=120,E=A.x+A.width,d=E-10,u="e",h="x");var D=t.calculateAdjustments(g,h,p,d),y=l?{x:0,y:p}:{x:p,y:0};t.makeSpace(D.movingShapes,D.resizingShapes,y,u,d);var C=l?{x:A.x+(r?oe:0),y:E-(i==="top"?120:0),width:A.width-(r?oe:0),height:120}:{x:E-(i==="left"?120:0),y:A.y+(r?oe:0),width:120,height:A.height-(r?oe:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:l},C,a)};function F1(e){this._modeling=e}F1.$inject=["modeling"],F1.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,A=e.count,i=it(n),o=i.length;if(o>A)throw new Error(`more than <${A}> child lanes`);var r=l2(n),a=r?n.height:n.width,c=Math.round(a/A),l,B,g,p;for(p=0;p<A;p++)p===A-1?l=a-c*p:l=c,B=r?{x:n.x+oe,y:n.y+p*c,width:n.width-oe,height:l}:{x:n.x+p*c,y:n.y+oe,width:l,height:n.height-oe},p<o?t.resizeShape(i[p],B):(g={type:"bpmn:Lane",isHorizontal:r},t.createShape(g,B,n))};function mi(e,t){this._modeling=e,this._spaceTool=t}mi.$inject=["modeling","spaceTool"],mi.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds,A=e.balanced;A!==!1?this.resizeBalanced(t,n):this.resizeSpace(t,n)},mi.prototype.resizeBalanced=function(e,t){var n=this._modeling,A=QI(e,t);n.resizeShape(e,t),A.forEach(function(i){n.resizeShape(i.shape,i.newBounds)})},mi.prototype.resizeSpace=function(e,t){var n=this._spaceTool,A=e0(e),i=e0(t),o=G4(i,A),r=re(e),a=[],c=[];nn(r,function(d){return a.push(d),(f(d,"bpmn:Lane")||f(d,"bpmn:Participant"))&&c.push(d),d.children});var l,B,g,p,E;(o.bottom||o.top)&&(l=o.bottom||o.top,B=e.y+(o.bottom?e.height:0)+(o.bottom?-10:10),g=o.bottom?"s":"n",p=o.top>0||o.bottom<0?-l:l,E=n.calculateAdjustments(a,"y",p,B),n.makeSpace(E.movingShapes,E.resizingShapes,{x:0,y:l},g)),(o.left||o.right)&&(l=o.right||o.left,B=e.x+(o.right?e.width:0)+(o.right?-10:100),g=o.right?"e":"w",p=o.left>0||o.right<0?-l:l,E=n.calculateAdjustments(c,"x",p,B),n.makeSpace(E.movingShapes,E.resizingShapes,{x:l,y:0},g))};var fi="flowNodeRef",v1="lanes";function Ci(e){this._elementRegistry=e}Ci.$inject=["elementRegistry"],Ci.prototype._computeUpdates=function(e,t){var n=[],A=[],i={},o=[];function r(B,g){var p=e0(g),E={x:B.x+B.width/2,y:B.y+B.height/2};return E.x>p.left&&E.x<p.right&&E.y>p.top&&E.y<p.bottom}function a(B){n.indexOf(B)===-1&&(o.push(B),n.push(B))}function c(B){var g=re(B);return i[g.id]||(i[g.id]=dr(g)),i[g.id]}function l(B){if(!B.parent)return[];var g=c(B);return g.filter(function(p){return r(B,p)}).map(function(p){return p.businessObject})}return t.forEach(function(B){var g=re(B);if(!(!g||n.indexOf(g)!==-1)){var p=g.children.filter(function(E){return f(E,"bpmn:FlowNode")});p.forEach(a),n.push(g)}}),e.forEach(a),o.forEach(function(B){var g=B.businessObject,p=g.get(v1),E=p.slice(),d=l(B);A.push({flowNode:g,remove:E,add:d})}),t.forEach(function(B){var g=B.businessObject;B.parent||g.get(fi).forEach(function(p){A.push({flowNode:p,remove:[g],add:[]})})}),A},Ci.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach(function(n){var A=n.flowNode,i=A.get(v1);n.remove.forEach(function(o){X0(i,o),X0(o.get(fi),A)}),n.add.forEach(function(o){o2(i,o),o2(o.get(fi),A)})}),[]},Ci.prototype.revert=function(e){var t=e.updates;return t.forEach(function(n){var A=n.flowNode,i=A.get(v1);n.add.forEach(function(o){X0(i,o),X0(o.get(fi),A)}),n.remove.forEach(function(o){o2(i,o),o2(o.get(fi),A)})}),[]};function Wr(e){this._moddle=e}Wr.$inject=["moddle"],Wr.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,A=e.element,i=e.claiming;return i?t.claim(n,A):t.unclaim(n),[]},Wr.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,A=e.element,i=e.claiming;return i?t.unclaim(n):t.claim(n,A),[]};var V8={fill:void 0,stroke:void 0};function x1(e){this._commandStack=e,this._normalizeColor=function(t){if(t){if(U2(t)){var n=L8(t);if(n)return n}throw new Error(`invalid color value: ${t}`)}}}x1.$inject=["commandStack"],x1.prototype.postExecute=function(e){var t=e.elements,n=e.colors||V8,A=this,i={};"fill"in n&&N(i,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&N(i,{"border-color":this._normalizeColor(n.stroke)}),U(t,function(o){var r=Y0(o)?q2(i,["border-color"]):i,a=h0(o);if(W8(r),f0(o))A._commandStack.execute("element.updateModdleProperties",{element:o,moddleElement:a.label,properties:{color:i["border-color"]}});else{if(!a0(a,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;A._commandStack.execute("element.updateProperties",{element:o,properties:{di:r}})}})};function L8(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 W8(e){"border-color"in e&&(e.stroke=e["border-color"]),"background-color"in e&&(e.fill=e["background-color"])}var _8={width:0,height:0};function x3(e,t,n){function A(c,l){var B=c.label||c,g=c.labelTarget||c;return PM(B,l),[B,g]}function i(c){var l=c.element,B=l.businessObject,g=c.newLabel;if(!f0(l)&&an(l)&&!Io(l)&&!b3(g)){var p=7,E=Nc(l);E={x:E.x,y:E.y+p},e.createLabel(l,E,{id:B.id+"_label",businessObject:B,di:l.di})}}function o(c){return c.oldLabel=fe(c.element),A(c.element,c.newLabel)}function r(c){return A(c.element,c.oldLabel)}function a(c){var l=c.element,B=l.label||l,g=c.newLabel,p=c.newBounds,E=c.hints||{};if(!(!f0(B)&&!f(B,"bpmn:TextAnnotation"))){if(f0(B)&&b3(g)){E.removeShape!==!1&&e.removeShape(B,{unsetLabel:!1});return}var d=fe(l);typeof p>"u"&&(p=t.getExternalLabelBounds(B,d)),p&&e.resizeShape(B,p,_8)}}this.preExecute=i,this.execute=o,this.revert=r,this.postExecute=a}x3.$inject=["modeling","textRenderer","bpmnFactory"];function b3(e){return!e||!e.trim()}function D2(e,t,n,A){U0.call(this,e,t,n),this._bpmnRules=A}W(D2,U0),D2.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],D2.prototype.getHandlers=function(){var e=U0.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=Qi,e["element.updateProperties"]=wi,e["canvas.updateRoot"]=Lr,e["lane.add"]=I1,e["lane.resize"]=mi,e["lane.split"]=F1,e["lane.updateRefs"]=Ci,e["id.updateClaim"]=Wr,e["element.setColor"]=x1,e["element.updateLabel"]=x3,e},D2.prototype.updateLabel=function(e,t,n,A){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:A||{}})},D2.prototype.connect=function(e,t,n,A){var i=this._bpmnRules;if(n||(n=i.canConnect(e,t)),!!n)return this.createConnection(e,t,n,e.parent,A)},D2.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},D2.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},D2.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},D2.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},D2.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},D2.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},D2.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},D2.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},D2.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},D2.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},D2.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})};function Y3(){}Y3.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||i0(t.source||e.source),t.connectionEnd||i0(t.target||e.target)]};var _r=20,O8=5,Or=Math.round,U3=20,X8={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function K8(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function Z8(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function N3(e,t,n){var A=f2(t,e,O8),i=n.split(":")[0],o=Or((t.x-e.x)/2+e.x),r=Or((t.y-e.y)/2+e.y),a,c,l=Z8(i,A),B=/h|r|l/.test(i),g=!1,p=!1;return l?(a=B?{x:o,y:e.y}:{x:e.x,y:r},c=B?"h:h":"v:v"):(g=K8(A,i),c=B?"h:v":"v:h",g?B?(p=r===e.y,a={x:e.x+_r*(/l/.test(i)?-1:1),y:p?r+_r:r}):(p=o===e.x,a={x:p?o+_r:o,y:e.y+_r*(/t/.test(i)?-1:1)}):a={x:o,y:r}),{waypoints:b1(e,a,c).concat(a),directions:c,turnNextDirections:p}}function q8(e,t,n){return N3(e,t,n)}function $8(e,t,n){var A=N3(t,e,z3(n));return{waypoints:A.waypoints.slice().reverse(),directions:z3(A.directions),turnNextDirections:A.turnNextDirections}}function ev(e,t){var n=e.directions.split(":")[1],A=t.directions.split(":")[0];e.turnNextDirections&&(n=n=="h"?"v":"h"),t.turnNextDirections&&(A=A=="h"?"v":"h");var i=n+":"+A,o=b1(e.waypoints[e.waypoints.length-1],t.waypoints[0],i);return{waypoints:o,directions:i}}function z3(e){return e.split(":").reverse().join(":")}function tv(e,t,n){var A=Or((t.x-e.x)/2+e.x),i=Or((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:A,y:e.y},{x:A,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 b1(e,t,n){if(n=n||"h:h",!lv(n))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(S3(n)){var A=q8(e,t,n),i=$8(e,t,n),o=ev(A,i);return[].concat(A.waypoints,o.waypoints,i.waypoints)}return tv(e,t,n)}function nv(e,t,n){var A=b1(e,t,n);return A.unshift(e),A.push(t),k3(A)}function Av(e,t,n,A,i){var o=i&&i.preferredLayouts||[],r=_l(o,"straight")[0]||"h:h",a=X8[r]||0,c=f2(e,t,a),l=sv(c,r);n=n||i0(e),A=A||i0(t);var B=l.split(":"),g=T3(n,e,B[0],Bv(c)),p=T3(A,t,B[1],c);return nv(g,p,l)}function iv(e,t,n,A,i,o){n0(n)&&(i=n,o=A,n=i0(e),A=i0(t)),o=N({preferredLayouts:[]},o),i=i||[];var r=o.preferredLayouts,a=r.indexOf("straight")!==-1,c;return c=a&&rv(e,t,n,A,o),c||(c=o.connectionEnd&&cv(t,e,A,i),c)||(c=o.connectionStart&&av(e,t,n,i),c)?c:!o.connectionStart&&!o.connectionEnd&&i&&i.length?i:Av(e,t,n,A,o)}function ov(e,t,n){return e>=t&&e<=n}function R3(e,t,n){var A={x:"width",y:"height"};return ov(t[e],n[e],n[e]+n[A[e]])}function rv(e,t,n,A,i){var o={},r,a;return a=f2(e,t),/^(top|bottom|left|right)$/.test(a)?(/top|bottom/.test(a)&&(r="x"),/left|right/.test(a)&&(r="y"),i.preserveDocking==="target"?R3(r,A,e)?(o[r]=A[r],[{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:A.x,y:A.y}]):null:R3(r,n,t)?(o[r]=n[r],[{x:n.x,y:n.y},{x:o.x!==void 0?o.x:A.x,y:o.y!==void 0?o.y:A.y,original:{x:o.x!==void 0?o.x:A.x,y:o.y!==void 0?o.y:A.y}}]):null):null}function av(e,t,n,A){return Y1(e,t,n,A)}function cv(e,t,n,A){var i=A.slice().reverse();return i=Y1(e,t,n,i),i?i.reverse():null}function Y1(e,t,n,A){function i(B){return B.length<3?!0:B.length>4?!1:!!m0(B,function(g,p){var E=B[p-1];return E&&NA(g,E)<3})}function o(B,g,p){var E=We(g,B);switch(E){case"v":return{x:p.x,y:B.y};case"h":return{x:B.x,y:p.y}}return{x:B.x,y:B.y}}function r(B,g,p){var E;for(E=B.length-2;E!==0;E--)if(fB(B[E],g,U3)||fB(B[E],p,U3))return B.slice(E);return B}if(i(A))return null;var a=A[0],c=A.slice(),l;return c[0]=n,c[1]=o(c[1],a,n),l=r(c,e,t),l!==c&&(c=Y1(e,t,n,l)),c&&We(c)?null:c}function sv(e,t){if(S3(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 lv(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function S3(e){return e&&/t|r|b|l/.test(e)}function Bv(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 T3(e,t,n,A){if(n==="h"&&(n=/left/.test(A)?"l":"r"),n==="v"&&(n=/top/.test(A)?"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 k3(e){return e.reduce(function(t,n,A){var i=t[t.length-1],o=e[A+1];return dc(i,o,n,0)||t.push(n),t},[])}var gv=-10,pv=40,Ev={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},dv={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},U1={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},Mi={top:"t",right:"r",bottom:"b",left:"l"};function Xr(e){this._elementRegistry=e}W(Xr,Y3),Xr.prototype.layoutConnection=function(e,t){t||(t={});var n=t.source||e.source,A=t.target||e.target,i=t.waypoints||e.waypoints,o=t.connectionStart,r=t.connectionEnd,a=this._elementRegistry,c,l;if(o||(o=G3(i&&i[0],n)),r||(r=G3(i&&i[i.length-1],A)),(f(e,"bpmn:Association")||f(e,"bpmn:DataAssociation"))&&i&&!H3(n,A))return[].concat([o],i.slice(1,-1),[r]);var B=_p(n,a)?Ev:dv;return f(e,"bpmn:MessageFlow")?c=Qv(n,A,B):(f(e,"bpmn:SequenceFlow")||H3(n,A))&&(n===A?c={preferredLayouts:Mv(n,e,B)}:f(n,"bpmn:BoundaryEvent")?c={preferredLayouts:Dv(n,A,r,B)}:Di(n)||Di(A)?c={preferredLayouts:B.subProcess,preserveDocking:wv(n)}:f(n,"bpmn:Gateway")?c={preferredLayouts:B.fromGateway}:f(A,"bpmn:Gateway")?c={preferredLayouts:B.toGateway}:c={preferredLayouts:B.default}),c&&(c=N(c,t),l=k3(iv(n,A,o,r,i,c))),l||[o,r]};function uv(e){var t=e.host;return f2(i0(e),t,gv)}function Qv(e,t,n){return{preferredLayouts:n.messageFlow,preserveDocking:hv(e,t)}}function hv(e,t){return f(t,"bpmn:Participant")?"source":f(e,"bpmn:Participant")?"target":Di(t)?"source":Di(e)||f(t,"bpmn:Event")?"target":f(e,"bpmn:Event")?"source":null}function wv(e){return Di(e)?"target":"source"}function G3(e,t){return e?e.original||e:i0(t)}function H3(e,t){return f(t,"bpmn:Activity")&&f(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Di(e){return f(e,"bpmn:SubProcess")&&E0(e)}function wn(e,t){return e===t}function mv(e,t){return t.indexOf(e)!==-1}function lA(e){var t=/right|left/.exec(e);return t&&t[0]}function BA(e){var t=/top|bottom/.exec(e);return t&&t[0]}function P3(e,t){return U1[e]===t}function fv(e,t){var n=lA(e),A=U1[n];return t.indexOf(A)!==-1}function Cv(e,t){var n=BA(e),A=U1[n];return t.indexOf(A)!==-1}function J3(e){return e==="right"||e==="left"}function Mv(e,t,n){var A=t.waypoints,i=A&&A.length&&f2(A[0],e);return i==="top"?n.loop.fromTop:i==="right"?n.loop.fromRight:i==="left"?n.loop.fromLeft:n.loop.fromBottom}function Dv(e,t,n,A){var i=i0(e),o=i0(t),r=uv(e),a,c,l=wn(e.host,t),B=mv(r,["top","right","bottom","left"]),g=f2(o,i,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return l?yv(r,B,e,t,n,A):(a=Iv(r,g,B,A.isHorizontal),c=Fv(r,g,B,A.isHorizontal),[a+":"+c])}function yv(e,t,n,A,i,o){var r=t?e:o.isHorizontal?BA(e):lA(e),a=Mi[r],c;return t?J3(e)?c=j3("y",n,A,i)?"h":o.boundaryLoop.alternateHorizontalSide:c=j3("x",n,A,i)?"v":o.boundaryLoop.alternateVerticalSide:c=o.boundaryLoop.default,[a+":"+c]}function j3(e,t,n,A){var i=pv;return!(N1(e,A,n,i)||N1(e,A,{x:n.x+n.width,y:n.y+n.height},i)||N1(e,A,i0(t),i))}function N1(e,t,n,A){return Math.abs(t[e]-n[e])<A}function Iv(e,t,n,A){if(n)return Mi[e];var i=BA(e),o=lA(e),r=BA(t),a=lA(t);if(A){if(wn(i,r)||P3(o,a))return Mi[i]}else if(wn(o,a)||P3(i,r))return Mi[o];return Mi[A?o:i]}function Fv(e,t,n,A){return n?J3(e)?fv(e,t)||wn(e,t)?"h":"v":Cv(e,t)||wn(e,t)?"v":"h":A?wn(BA(e),BA(t))?"h":"v":wn(lA(e),lA(t))?"v":"h"}Xr.$inject=["elementRegistry"];function V3(e){return N({original:e.point.original||e.point},e.actual)}function Ht(e,t){this._elementRegistry=e,this._graphicsFactory=t}Ht.$inject=["elementRegistry","graphicsFactory"],Ht.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var A=this.getDockingPoint(e,t,!0),i=this.getDockingPoint(e,n),o=e.waypoints.slice(A.idx+1,i.idx);return o.unshift(V3(A)),o.push(V3(i)),o},Ht.prototype.getDockingPoint=function(e,t,n){var A=e.waypoints,i,o,r;return i=n?0:A.length-1,o=A[i],r=this._getIntersection(t,e,n),{point:o,actual:r||o,idx:i}},Ht.prototype._getIntersection=function(e,t,n){var A=this._getShapePath(e),i=this._getConnectionPath(t);return wc(A,i,n)},Ht.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},Ht.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},Ht.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};const L3={__init__:["modeling","bpmnUpdater"],__depends__:[CF,HF,JF,jF,A3,Q8,w8,y8,Ce,Rc,s3],bpmnFactory:["type",ce],bpmnUpdater:["type",H2],elementFactory:["type",St],modeling:["type",D2],layouter:["type",Xr],connectionDocking:["type",Ht]},W3=Math.round;function Kr(e,t,n,A,i,o){this._complexPreview=e,this._connectionDocking=t,this._elementFactory=n,this._eventBus=A,this._layouter=i,this._rules=o}Kr.prototype.create=function(e,t,n){const A=this._complexPreview,i=this._connectionDocking,o=this._elementFactory,r=this._eventBus,a=this._layouter,c=this._rules,l=o.createShape(N({type:t},n)),B=r.fire("autoPlace",{source:e,shape:l});if(!B)return;N(l,{x:B.x-W3(l.width/2),y:B.y-W3(l.height/2)});const g=c.allowed("connection.create",{source:e,target:l,hints:{targetParent:e.parent}});let p=null;g&&(p=o.createConnection(g),p.waypoints=a.layoutConnection(p,{source:e,target:l}),p.waypoints=i.getCroppedWaypoints(p,e,l)),A.create({created:[l,p].filter(E=>!en(E))})},Kr.prototype.cleanUp=function(){this._complexPreview.cleanUp()},Kr.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];const vv={__depends__:[As,Zy,L3],__init__:["appendPreview"],appendPreview:["type",Kr]};var _3=Math.min,O3=Math.max;function z1(e){e.preventDefault()}function yi(e){e.stopPropagation()}function xv(e){return e.nodeType===Node.TEXT_NODE}function bv(e){return[].slice.call(e)}function ye(e){this.container=e.container,this.parent=$('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=p0("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=v2(this.autoResize,this),this.handlePaste=v2(this.handlePaste,this)}ye.prototype.create=function(e,t,n,A){var i=this,o=this.parent,r=this.content,a=this.container;A=this.options=A||{},t=this.style=t||{};var c=q2(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);N(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var l=q2(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return N(r.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),A.centerVertically&&N(r.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),r.innerText=n,O.bind(r,"keydown",this.keyHandler),O.bind(r,"mousedown",yi),O.bind(r,"paste",i.handlePaste),A.autoResize&&O.bind(r,"input",this.autoResize),A.resizable&&this.resizable(t),a.appendChild(o),this.setSelection(r.lastChild,r.lastChild&&r.lastChild.length),o},ye.prototype.handlePaste=function(e){var t=this.options,n=this.style;e.preventDefault();var A;if(e.clipboardData?A=e.clipboardData.getData("text/plain"):A=window.clipboardData.getData("Text"),this.insertText(A),t.autoResize){var i=this.autoResize(n);i&&this.resizeHandler(i)}},ye.prototype.insertText=function(e){e=Yv(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)},ye.prototype._insertTextIE=function(e){var t=this.getSelection(),n=t.startContainer,A=t.endContainer,i=t.startOffset,o=t.endOffset,r=t.commonAncestorContainer,a=bv(r.childNodes),c,l;if(xv(r)){var B=n.textContent;n.textContent=B.substring(0,i)+e+B.substring(o),c=n,l=i+e.length}else if(n===this.content&&A===this.content){var g=document.createTextNode(e);this.content.insertBefore(g,a[i]),c=g,l=g.textContent.length}else{var p=a.indexOf(n),E=a.indexOf(A);a.forEach(function(d,u){u===p?d.textContent=n.textContent.substring(0,i)+e+A.textContent.substring(o):u>p&&u<=E&&xe(d)}),c=n,l=i+e.length}c&&l!==void 0&&setTimeout(function(){self.setSelection(c,l)})},ye.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 A=e.getBoundingClientRect(),i=t.scrollHeight;e.style.height=i+"px",this.resizeHandler({width:A.width,height:A.height,dx:0,dy:i-A.height})}},ye.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,A=parseInt(this.style.minWidth)||0,i=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,r=parseInt(this.style.maxHeight)||1/0;if(!n){n=this.resizeHandle=$('<div class="djs-direct-editing-resize-handle"></div>');var a,c,l,B,g=function(d){z1(d),yi(d),a=d.clientX,c=d.clientY;var u=t.getBoundingClientRect();l=u.width,B=u.height,O.bind(document,"mousemove",p),O.bind(document,"mouseup",E)},p=function(d){z1(d),yi(d);var u=_3(O3(l+d.clientX-a,A),o),h=_3(O3(B+d.clientY-c,i),r);t.style.width=u+"px",t.style.height=h+"px",e.resizeHandler({width:l,height:B,dx:d.clientX-a,dy:d.clientY-c})},E=function(d){z1(d),yi(d),O.unbind(document,"mousemove",p,!1),O.unbind(document,"mouseup",E,!1)};O.bind(n,"mousedown",g)}N(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},ye.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),O.unbind(t,"keydown",this.keyHandler),O.unbind(t,"mousedown",yi),O.unbind(t,"input",this.autoResize),O.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),xe(n)),xe(e)},ye.prototype.getValue=function(){return this.content.innerText.trim()},ye.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t},ye.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var A=window.getSelection();A.removeAllRanges(),A.addRange(n)};function Yv(e){return e.replace(/\r\n|\r|\n/g,`
247
+ </svg>`},LD=900;function qn(e,t,n,A){e.registerProvider(LD,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=A}qn.$inject=["contextPad","popupMenu","translate","canvas"],qn.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&N(t,this._getEntries(e)),t},qn.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},qn.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`<div class="entry">${jp.align}</div>`,action:{click:function(t,n){var A=e._getMenuPosition(n);N(A,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",A)}}}}},qn.prototype._getMenuPosition=function(e){var t=5,n=this._contextPad.getPad(e).html,A=n.getBoundingClientRect(),i={x:A.left,y:A.bottom+t};return i};var WD=["left","center","right","top","middle","bottom"];function qA(e,t,n,A){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=A,e.registerProvider("align-elements",this)}qA.$inject=["popupMenu","alignElements","translate","rules"],qA.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&N(t,this._getEntries(e)),t},qA.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},qA.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,A=this._popupMenu,i={};return U(WD,function(o){i["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:jp[o],action:function(){t.trigger(e,o),A.close()}}}),i};function Ae(e){j.call(this,e),this.init()}Ae.$inject=["eventBus"],W(Ae,j),Ae.prototype.addRule=function(e,t,n){var A=this;typeof e=="string"&&(e=[e]),e.forEach(function(i){A.canExecute(i,t,function(o,r,a){return n(o)},!0)})},Ae.prototype.init=function(){};function $o(e){Ae.call(this,e)}$o.$inject=["eventBus"],W($o,Ae),$o.prototype.init=function(){this.addRule("elements.align",function(e){var t=e.elements,n=l0(t,function(A){return!(A.waypoints||A.host||A.labelTarget)});return n=Bo(n),n.length<2?!1:n})};const _D={__depends__:[lD,Ap,$c],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",qn],alignElementsMenuProvider:["type",qA],bpmnAlignElements:["type",$o]};var OD=10,Vp=50,XD=250;function es(e,t,n,A){for(var i;i=KD(e,n,t);)n=A(t,n,i);return n}function ts(e){return function(t,n,A){var i={x:n.x,y:n.y};return["x","y"].forEach(function(o){var r=e[o];if(r){var a=o==="x"?"width":"height",c=r.margin,l=r.minDistance;c<0?i[o]=Math.min(A[o]+c-t[a]/2,n[o]-l+c):i[o]=Math.max(A[o]+A[a]+c+t[a]/2,n[o]+l+c)}}),i}}function KD(e,t,n){var A={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},i=qD(e);return m0(i,function(o){if(o===n)return!1;var r=f2(o,A,OD);return r==="intersect"})}function ZD(e,t){t||(t={});function n(d){return d.source===e?1:-1}var A=t.defaultDistance||Vp,i=t.direction||"e",o=t.filter,r=t.getWeight||n,a=t.maxDistance||XD,c=t.reference||"start";o||(o=ty);function l(d,u){return i==="n"?c==="start"?e0(d).top-e0(u).bottom:c==="center"?e0(d).top-i0(u).y:e0(d).top-e0(u).top:i==="w"?c==="start"?e0(d).left-e0(u).right:c==="center"?e0(d).left-i0(u).x:e0(d).left-e0(u).left:i==="s"?c==="start"?e0(u).top-e0(d).bottom:c==="center"?i0(u).y-e0(d).bottom:e0(u).bottom-e0(d).bottom:c==="start"?e0(u).left-e0(d).right:c==="center"?i0(u).x-e0(d).right:e0(u).right-e0(d).right}var B=e.incoming.filter(o).map(function(d){var u=r(d),h=u<0?l(d.source,e):l(e,d.source);return{id:d.source.id,distance:h,weight:u}}),g=e.outgoing.filter(o).map(function(d){var u=r(d),h=u>0?l(e,d.target):l(d.target,e);return{id:d.target.id,distance:h,weight:u}}),p=B.concat(g).reduce(function(d,u){return d[u.id+"__weight_"+u.weight]=u,d},{}),E=F2(p,function(d,u){var h=u.distance,D=u.weight;return h<0||h>a||(d[String(h)]||(d[String(h)]=0),d[String(h)]+=1*D,(!d.distance||d[d.distance]<d[String(h)])&&(d.distance=h)),d},{});return E.distance||A}function qD(e){var t=ns(e);return e.host&&(t=t.concat(ns(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce(function(n,A){return n.concat(ns(A))},[]))),t}function ns(e){return ey(e).concat($D(e))}function $D(e){return e.incoming.map(function(t){return t.source})}function ey(e){return e.outgoing.map(function(t){return t.target})}function ty(){return!0}var ny=100;function Lp(e,t,n){e.on("autoPlace",ny,function(A){var i=A.shape,o=A.source;return Ay(o,i)}),e.on("autoPlace.end",function(A){n.scrollToElement(A.shape)}),this.append=function(A,i,o){e.fire("autoPlace.start",{source:A,shape:i});var r=e.fire("autoPlace",{source:A,shape:i}),a=t.appendShape(A,i,r,A.parent,o);return e.fire("autoPlace.end",{source:A,shape:a}),a}}Lp.$inject=["eventBus","modeling","canvas"];function Ay(e,t,n){n||(n={});var A=n.defaultDistance||Vp,i=i0(e),o=e0(e);return{x:o.right+A+t.width/2,y:i.y}}function Wp(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}Wp.$inject=["eventBus","selection"];const iy={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Lp],autoPlaceSelectionBehavior:["type",Wp]};function $n(e,t){for(U2(t)&&(t=[t]);e=e.parent;)if(a0(e,t))return e;return null}function _p(e,t){var n=$n(e,"bpmn:Process");if(n)return!0;var A=["bpmn:Participant","bpmn:Lane"];if(n=$n(e,A),n)return l2(n);if(a0(e,A))return l2(e);var i;for(i=P(e);i&&!f(i,"bpmn:Process");i=i.$parent);if(!t)return!0;var o=t.find(function(r){var a=P(r);return a&&a.get("processRef")===i});return o?l2(o):!0}function Op(e,t,n){var A=_p(e,n);if(f(t,"bpmn:TextAnnotation"))return ry(e,t,A);if(a0(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"]))return ay(e,t,A);if(f(t,"bpmn:FlowNode"))return oy(e,t,A)}function oy(e,t,n){var A=e0(e),i=i0(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"},r=ZD(e,{filter:function(E){return f(E,"bpmn:SequenceFlow")},direction:o.directionHint}),a=30,c=o.minDistance,l=o.baseOrientation;f(e,"bpmn:BoundaryEvent")&&(l=f2(e,e.host,-25),l.indexOf(o.boundaryOrientation)!==-1&&(a*=-1));var B=n?{x:A.right+r+t.width/2,y:i.y+Xp(l,c,o)}:{x:i.x+Xp(l,c,o),y:A.bottom+r+t.height/2},g={margin:a,minDistance:c},p=n?{y:g}:{x:g};return es(e,t,B,ts(p))}function Xp(e,t,n){return e.includes(n.start)?-1*t:e.includes(n.end)?t:0}function ry(e,t,n){var A=e0(e),i=n?{x:A.right+t.width/2,y:A.top-50-t.height/2}:{x:A.right+50+t.width/2,y:A.bottom+t.height/2};Y0(e)&&(i=i0(e),n?(i.x+=100,i.y-=50):(i.x+=100,i.y+=50));var o={margin:n?-30:30,minDistance:20},r=n?{y:o}:{x:o};return es(e,t,i,ts(r))}function ay(e,t,n){var A=e0(e),i=n?{x:A.right-10+t.width/2,y:A.bottom+40+t.width/2}:{x:A.left-40-t.width/2,y:A.bottom-10+t.height/2},o={margin:30,minDistance:30},r=n?{x:o}:{y:o};return es(e,t,i,ts(r))}function Kp(e,t){e.on("autoPlace",function(n){var A=n.shape,i=n.source;return Op(i,A,t)})}Kp.$inject=["eventBus","elementRegistry"];const As={__depends__:[iy],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",Kp]};function tt(e,t,n,A){j.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=A;var i=this;this.postExecuted(["shape.create"],function(o){var r=o.context,a=r.hints||{},c=r.shape,l=r.parent||r.newParent;a.autoResize!==!1&&i._expand([c],l)}),this.postExecuted(["elements.move"],function(o){var r=o.context,a=no(FA(r.closure.topLevel)),c=r.hints,l=c?c.autoResize:!0;if(l!==!1){var B=Ve(a,function(g){return g.parent.id});U(B,function(g,p){n0(l)&&(g=g.filter(function(E){return m0(l,Z2({id:E.id}))})),i._expand(g,p)})}}),this.postExecuted(["shape.toggleCollapse"],function(o){var r=o.context,a=r.hints,c=r.shape;a&&a.autoResize===!1||c.collapsed||i._expand(c.children||[],c)}),this.postExecuted(["shape.resize"],function(o){var r=o.context,a=r.hints,c=r.shape,l=c.parent;a&&a.autoResize===!1||l&&i._expand([c],l)})}tt.$inject=["eventBus","elementRegistry","modeling","rules"],W(tt,j),tt.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),A=this.getPadding(t),i=e0(i2(e)),o=e0(t),r={};return i.top-o.top<A.top&&(r.top=i.top-n.top),i.left-o.left<A.left&&(r.left=i.left-n.left),o.right-i.right<A.right&&(r.right=i.right+n.right),o.bottom-i.bottom<A.bottom&&(r.bottom=i.bottom+n.bottom),Qo(N({},o,r))},tt.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 A=this._getOptimalBounds(e,t);if(cy(A,t)){var i=sy(q2(t,["x","y","width","height"]),A);this.resize(t,A,{autoResize:i});var o=t.parent;o&&this._expand([t],o)}}},tt.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},tt.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},tt.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)};function cy(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function sy(e,t){var n="";return e=e0(e),t=e0(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 er(e){e.invoke(tt,this)}er.$inject=["injector"],W(er,tt),er.prototype.resize=function(e,t,n){f(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)};function $A(e){Ae.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}$A.$inject=["eventBus"],W($A,Ae),$A.prototype.canResize=function(e,t){return!1};function tr(e,t){$A.call(this,e),this._modeling=t}W(tr,$A),tr.$inject=["eventBus","modeling"],tr.prototype.canResize=function(e,t){if(f(t.di,"bpmndi:BPMNPlane")||!f(t,"bpmn:Participant")&&!f(t,"bpmn:Lane")&&!f(t,"bpmn:SubProcess"))return!1;var n=!0;return U(e,function(A){if(f(A,"bpmn:Lane")||f0(A)){n=!1;return}}),n};const ly={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",er],bpmnAutoResizeProvider:["type",tr]};var Zp=1500;function qp(e,t,n){var A=this,i=n.get("dragging",!1);function o(r){if(!r.hover){var a=r.originalEvent,c=A._findTargetGfx(a),l=c&&e.get(c);c&&l&&(r.stopPropagation(),i.hover({element:l,gfx:c}),i.move(a))}}i&&t.on("drag.start",function(r){t.once("drag.move",Zp,function(a){o(a)})}),function(){var r,a;t.on("element.hover",function(c){r=c.gfx,a=c.element}),t.on("element.hover",Zp,function(c){a&&t.fire("element.out",{element:a,gfx:r})}),t.on("element.out",function(){r=null,a=null})}(),this._findTargetGfx=function(r){var a,c;if(r instanceof MouseEvent)return a=Bn(r),c=document.elementFromPoint(a.x,a.y),By(c)}}qp.$inject=["elementRegistry","eventBus","injector"];function By(e){return Sn(e,"svg, .djs-element",!0)}const gy={__init__:["hoverFix"],hoverFix:["type",qp]};var eA=Math.round,$p="djs-drag-active";function pn(e){e.preventDefault()}function py(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function Ey(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function e4(e,t,n,A){var i={threshold:5,trapClick:!0},o;function r(C){var m=t.viewbox(),I=t._container.getBoundingClientRect();return{x:m.x+(C.x-I.left)/m.scale,y:m.y+(C.y-I.top)/m.scale}}function a(C,m){m=m||o;var I=e.createEvent(N({},m.payload,m.data,{isTouch:m.isTouch}));return e.fire("drag."+C,I)===!1?!1:e.fire(m.prefix+"."+C,I)}function c(C){var m=C.filter(function(I){return A.get(I.id)});m.length&&n.select(m)}function l(C,m){var I=o.payload,x=o.displacement,v=o.globalStart,F=Bn(C),z=Me(F,v),R=o.localStart,k=r(F),T=Me(k,R);if(!o.active&&(m||Ey(z)>o.threshold)){if(N(I,{x:eA(R.x+x.x),y:eA(R.y+x.y),dx:0,dy:0},{originalEvent:C}),a("start")===!1)return h();o.active=!0,o.keepSelection||(I.previousSelection=n.get(),n.select(null)),o.cursor&&Ho(o.cursor),t.addMarker(t.getRootElement(),$p)}Tc(C),o.active&&(N(I,{x:eA(k.x+x.x),y:eA(k.y+x.y),dx:eA(T.x),dy:eA(T.y)},{originalEvent:C}),a("move"))}function B(C){var m,I=!0;o.active&&(C&&(o.payload.originalEvent=C,Tc(C)),I=a("end")),I===!1&&a("rejected"),m=D(I!==!0),a("ended",m)}function g(C){E2("Escape",C)&&(pn(C),h())}function p(C){var m;o.active&&(m=Kg(e),setTimeout(m,400),pn(C)),B(C)}function E(C){l(C)}function d(C){var m=o.payload;m.hoverGfx=C.gfx,m.hover=C.element,a("hover")}function u(C){a("out");var m=o.payload;m.hoverGfx=null,m.hover=null}function h(C){var m;if(o){var I=o.active;I&&a("cancel"),m=D(C),I&&a("canceled",m)}}function D(C){var m,I;a("cleanup"),Xg(),o.trapClick?I=p:I=B,O.unbind(document,"mousemove",l),O.unbind(document,"dragstart",pn),O.unbind(document,"selectstart",pn),O.unbind(document,"mousedown",I,!0),O.unbind(document,"mouseup",I,!0),O.unbind(document,"keyup",g),O.unbind(document,"touchstart",E,!0),O.unbind(document,"touchcancel",h,!0),O.unbind(document,"touchmove",l,!0),O.unbind(document,"touchend",B,!0),e.off("element.hover",d),e.off("element.out",u),t.removeMarker(t.getRootElement(),$p);var x=o.payload.previousSelection;return C!==!1&&x&&!n.get().length&&c(x),m=o,o=null,m}function y(C,m,I,x){o&&h(!1),typeof m=="string"&&(x=I,I=m,m=null),x=N({},i,x||{});var v=x.data||{},F,z,R,k,T;x.trapClick?k=p:k=B,C?(F=Ln(C)||C,z=Bn(C),Tc(C),F.type==="dragstart"&&pn(F)):(F=null,z={x:0,y:0}),R=r(z),m||(m=R),T=py(F),o=N({prefix:I,data:v,payload:{},globalStart:z,displacement:Me(m,R),localStart:R,isTouch:T},x),x.manual||(T?(O.bind(document,"touchstart",E,!0),O.bind(document,"touchcancel",h,!0),O.bind(document,"touchmove",l,!0),O.bind(document,"touchend",B,!0)):(O.bind(document,"mousemove",l),O.bind(document,"dragstart",pn),O.bind(document,"selectstart",pn),O.bind(document,"mousedown",k,!0),O.bind(document,"mouseup",k,!0)),O.bind(document,"keyup",g),e.on("element.hover",d),e.on("element.out",u)),a("init"),x.autoActivate&&l(C,!0)}e.on("diagram.destroy",h),this.init=y,this.move=l,this.hover=d,this.out=u,this.end=B,this.cancel=h,this.context=function(){return o},this.setOptions=function(C){N(i,C)}}e4.$inject=["eventBus","canvas","selection","elementRegistry"];const nt={__depends__:[gy,Ce],dragging:["type",e4]};function tA(e,t,n){this._canvas=n,this._opts=N({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var A=this;t.on("drag.move",function(i){var o=A._toBorderPoint(i);A.startScroll(o)}),t.on(["drag.cleanup"],function(){A.stopScroll()})}tA.$inject=["config.autoScroll","eventBus","canvas"],tA.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,A=this,i=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,i.width-e.x,i.height-e.y];this.stopScroll();for(var r=0,a=0,c=0;c<4;c++)dy(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(c===0?r=n.scrollStep:c==1?a=n.scrollStep:c==2?r=-n.scrollStep:c==3&&(a=-n.scrollStep));(r!==0||a!==0)&&(t.scroll({dx:r,dy:a}),this._scrolling=setTimeout(function(){A.startScroll(e)},n.scrollRepeatTimeout))};function dy(e,t,n){return t<e&&e<n}tA.prototype.stopScroll=function(){clearTimeout(this._scrolling)},tA.prototype.setOptions=function(e){this._opts=N({},this._opts,e)},tA.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=Bn(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};const uy={__depends__:[nt],__init__:["autoScroll"],autoScroll:["type",tA]};function is(e){this._commandStack=e.get("commandStack",!1)}is.$inject=["injector"],is.prototype.allowed=function(e,t){var n=!0,A=this._commandStack;return A&&(n=A.canExecute(e,t)),n===void 0?!0:n};const Te={__init__:["rules"],rules:["type",is]};var nr=Math.round,Qy=Math.max;function hy(e,t){var n=e.x,A=e.y;return[["M",n,A],["m",0,-t],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}function wy(e){var t=[];return e.forEach(function(n,A){t.push([A===0?"M":"L",n.x,n.y])}),t}var t4=10;function my(e,t){var n,A;for(n=0;A=e[n];n++)if(NA(A,t)<=t4)return{point:e[n],bendpoint:!0,index:n};return null}function fy(e,t){var n=xB(hy(t,t4),wy(e)),A=n[0],i=n[n.length-1],o;return A?A!==i?A.segment2!==i.segment2?(o=Qy(A.segment2,i.segment2)-1,{point:e[o],bendpoint:!0,index:o}):{point:{x:nr(A.x+i.x)/2,y:nr(A.y+i.y)/2},index:A.segment2}:{point:{x:nr(A.x),y:nr(A.y)},index:A.segment2}:null}function os(e,t){return my(e,t)||fy(e,t)}function n4(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function A4(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function Cy(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 My(e,t,n){var A=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}],i=A[0].n*t[0]+A[1].n*t[1],o=A[0].lambda*t[0]+A[1].lambda*t[1];return-i/o}function rs(e,t){var n=t[0],A=t[1],i={x:A.x-n.x,y:A.y-n.y},o=My([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 i4(e,t){var n=rs(e,t),A={x:n.x-e.x,y:n.y-e.y};return n4(A)}function Ar(e,t){return n4({x:e.x-t.x,y:e.y-t.y})}var o4="djs-bendpoint",r4="djs-segment-dragger";function Dy(e,t){var n=Bn(t),A=e._container.getBoundingClientRect(),i;i={x:A.left,y:A.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 as(e,t,n){var A=Dy(e,n),i=os(t,A);return i}function cs(e,t){var n=g0("g");D0(n).add(o4),h0(e,n);var A=g0("circle");q(A,{cx:0,cy:0,r:4}),D0(A).add("djs-visual"),h0(n,A);var i=g0("circle");return q(i,{cx:0,cy:0,r:10}),D0(i).add("djs-hit"),h0(n,i),t&&D0(n).add(t),n}function yy(e,t,n,A){var i=g0("g");h0(e,i);var o=18,r=6,a=11,c=Fy(t,n,A),l=r+a,B=g0("rect");q(B,{x:-o/2,y:-r/2,width:o,height:r}),D0(B).add("djs-visual"),h0(i,B);var g=g0("rect");return q(g,{x:-c/2,y:-l/2,width:c,height:l}),D0(g).add("djs-hit"),h0(i,g),OB(i,A==="v"?90:0),i}function a4(e,t,n){var A=g0("g"),i=uc(t,n),o=We(t,n);return h0(e,A),yy(A,t,n,o),D0(A).add(r4),D0(A).add(o==="h"?"horizontal":"vertical"),Q2(A,i.x,i.y),A}function ss(e){return Math.abs(Math.round(e*2/3))}function Iy(e,t){var n=vy(e,t);return rs(e,n)}function Fy(e,t,n){var A=t.x-e.x,i=t.y-e.y;return ss(n==="h"?A:i)}function vy(e,t){for(var n=t.waypoints,A=1/0,i,o=0;o<n.length-1;o++){var r=n[o],a=n[o+1],c=i4(e,[r,a]);c<A&&(A=c,i=o)}return[n[i],n[i+1]]}function c4(e,t,n,A,i){function o(C,m,I){var x=C.index,v=C.point,F,z,R,k,T,H;return x<=0||C.bendpoint?!1:(F=m[x-1],z=m[x],R=uc(F,z),k=We(F,z),T=Math.abs(v.x-R.x),H=Math.abs(v.y-R.y),k&&T<=I&&H<=I)}function r(C,m){var I=C.waypoints,x,v,F,z;return m.index<=0||m.bendpoint||(x={start:I[m.index-1],end:I[m.index]},v=We(x.start,x.end),!v)?null:(v==="h"?F=x.end.x-x.start.x:F=x.end.y-x.start.y,z=ss(F)/2,z)}function a(C,m){var I=m.waypoints,x=as(t,I,C),v;if(x)return v=r(m,x),o(x,I,v)?i.start(C,m,x.index):A.start(C,m,x.index,!x.bendpoint),!0}function c(C,m,I){O.bind(C,m,function(x){n.triggerMouseEvent(m,x,I),x.stopPropagation()})}function l(C,m){var I=t.getLayer("overlays"),x=p0('.djs-bendpoints[data-element-id="'+LA(C.id)+'"]',I);return!x&&m&&(x=g0("g"),q(x,{"data-element-id":C.id}),D0(x).add("djs-bendpoints"),h0(I,x),c(x,"mousedown",C),c(x,"click",C),c(x,"dblclick",C)),x}function B(C,m){return p0('.djs-segment-dragger[data-segment-idx="'+C+'"]',m)}function g(C,m){m.waypoints.forEach(function(I,x){var v=cs(C);h0(C,v),Q2(v,I.x,I.y)}),cs(C,"floating")}function p(C,m){for(var I=m.waypoints,x,v,F,z=1;z<I.length;z++)x=I[z-1],v=I[z],We(x,v)&&(F=a4(C,x,v),q(F,{"data-segment-idx":z}),c(F,"mousemove",m))}function E(C){U(Le("."+o4,C),function(m){s2(m)})}function d(C){U(Le("."+r4,C),function(m){s2(m)})}function u(C){var m=l(C);return m||(m=l(C,!0),g(m,C),p(m,C)),m}function h(C){var m=l(C);m&&(d(m),E(m),p(m,C),g(m,C))}function D(C,m){var I=p0(".floating",C),x=m.point;I&&Q2(I,x.x,x.y)}function y(C,m,I){var x=B(m.index,C),v=I[m.index-1],F=I[m.index],z=m.point,R=uc(v,F),k=We(v,F),T,H;x&&(T=xy(x),H={x:z.x-R.x,y:z.y-R.y},k==="v"&&(H={x:H.y,y:H.x}),Q2(T,H.x,H.y))}e.on("connection.changed",function(C){h(C.element)}),e.on("connection.remove",function(C){var m=l(C.element);m&&s2(m)}),e.on("element.marker.update",function(C){var m=C.element,I;m.waypoints&&(I=u(m),C.add?D0(I).add(C.marker):D0(I).remove(C.marker))}),e.on("element.mousemove",function(C){var m=C.element,I=m.waypoints,x,v;if(I){if(x=l(m,!0),v=as(t,I,C.originalEvent),!v)return;D(x,v),v.bendpoint||y(x,v,I)}}),e.on("element.mousedown",function(C){if(vt(C)){var m=C.originalEvent,I=C.element;if(I.waypoints)return a(m,I)}}),e.on("selection.changed",function(C){var m=C.newSelection,I=m[0];I&&I.waypoints&&u(I)}),e.on("element.hover",function(C){var m=C.element;m.waypoints&&(u(m),n.registerEvent(C.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(C){n.unregisterEvent(C.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(C){var m=C.element,I=C.newId;if(m.waypoints){var x=l(m);x&&q(x,{"data-element-id":I})}}),this.addHandles=u,this.updateHandles=h,this.getBendpointsContainer=l,this.getSegmentDragger=B}c4.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];function xy(e){return p0(".djs-visual",e)}var s4=Math.round,En="reconnectStart",dn="reconnectEnd",ei="updateWaypoints";function ls(e,t,n,A,i,o){this._injector=e,this.start=function(r,a,c,l){var B=n.getGraphics(a),g=a.source,p=a.target,E=a.waypoints,d;!l&&c===0?d=En:!l&&c===E.length-1?d=dn:d=ei;var u=d===ei?"connection.updateWaypoints":"connection.reconnect",h=i.allowed(u,{connection:a,source:g,target:p});h===!1&&(h=i.allowed(u,{connection:a,source:p,target:g})),h!==!1&&A.init(r,"bendpoint.move",{data:{connection:a,connectionGfx:B,context:{allowed:h,bendpointIndex:c,connection:a,source:g,target:p,insert:l,type:d}}})},t.on("bendpoint.move.hover",function(r){var a=r.context,c=a.connection,l=c.source,B=c.target,g=r.hover,p=a.type;a.hover=g;var E;if(g){var d=p===ei?"connection.updateWaypoints":"connection.reconnect";if(E=a.allowed=i.allowed(d,{connection:c,source:p===En?g:l,target:p===dn?g:B}),E){a.source=p===En?g:l,a.target=p===dn?g:B;return}E===!1&&(E=a.allowed=i.allowed(d,{connection:c,source:p===dn?g:B,target:p===En?g:l})),E&&(a.source=p===dn?g:B,a.target=p===En?g:l)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(r){var a=r.context,c=a.type;a.hover=null,a.source=null,a.target=null,c!==ei&&(a.allowed=!1)}),t.on("bendpoint.move.end",function(r){var a=r.context,c=a.allowed,l=a.bendpointIndex,B=a.connection,g=a.insert,p=B.waypoints.slice(),E=a.source,d=a.target,u=a.type,h=a.hints||{},D={x:s4(r.x),y:s4(r.y)};if(!c)return!1;u===ei?(g?p.splice(l,0,D):p[l]=D,h.bendpointMove={insert:g,bendpointIndex:l},p=this.cropWaypoints(B,p),o.updateWaypoints(B,vf(p),h)):(u===En?(h.docking="source",ir(a)&&(h.docking="target",h.newWaypoints=p.reverse())):u===dn&&(h.docking="target",ir(a)&&(h.docking="source",h.newWaypoints=p.reverse())),o.reconnect(B,E,d,D,h))},this)}ls.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],ls.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var A=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=A,t};function ir(e){var t=e.hover,n=e.source,A=e.target,i=e.type;if(i===En)return t&&A&&t===A&&n!==A;if(i===dn)return t&&n&&t===n&&n!==A}var by="reconnectStart",Yy="reconnectEnd",l4="updateWaypoints",ti="connect-ok",or="connect-not-ok",B4="connect-hover",g4="djs-updating",p4="djs-dragging",E4=1100;function d4(e,t,n,A){this._injector=t;var i=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(o){var r=o.context,a=r.bendpointIndex,c=r.connection,l=r.insert,B=c.waypoints,g=B.slice();r.waypoints=B,l&&g.splice(a,0,{x:o.x,y:o.y}),c.waypoints=g;var p=r.draggerGfx=cs(A.getLayer("overlays"));D0(p).add("djs-dragging"),A.addMarker(c,p4),A.addMarker(c,g4)}),n.on("bendpoint.move.hover",function(o){var r=o.context,a=r.allowed,c=r.hover,l=r.type;if(c){if(A.addMarker(c,B4),l===l4)return;a?(A.removeMarker(c,or),A.addMarker(c,ti)):a===!1&&(A.removeMarker(c,ti),A.addMarker(c,or))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],E4,function(o){var r=o.context,a=r.hover,c=r.target;a&&(A.removeMarker(a,B4),A.removeMarker(a,c?ti:or))}),n.on("bendpoint.move.move",function(o){var r=o.context,a=r.allowed,c=r.bendpointIndex,l=r.draggerGfx,B=r.hover,g=r.type,p=r.connection,E=p.source,d=p.target,u=p.waypoints.slice(),h={x:o.x,y:o.y},D=r.hints||{},y={};i&&(D.connectionStart&&(y.connectionStart=D.connectionStart),D.connectionEnd&&(y.connectionEnd=D.connectionEnd),g===by?ir(r)?(y.connectionEnd=y.connectionEnd||h,y.source=d,y.target=B||E,u=u.reverse()):(y.connectionStart=y.connectionStart||h,y.source=B||E,y.target=d):g===Yy?ir(r)?(y.connectionStart=y.connectionStart||h,y.source=B||d,y.target=E,u=u.reverse()):(y.connectionEnd=y.connectionEnd||h,y.source=E,y.target=B||d):(y.noCropping=!0,y.noLayout=!0,u[c]=h),g===l4&&(u=e.cropWaypoints(p,u)),y.waypoints=u,i.drawPreview(r,a,y)),Q2(l,o.x,o.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],E4,function(o){var r=o.context,a=r.connection,c=r.draggerGfx,l=r.hover,B=r.target,g=r.waypoints;a.waypoints=g,s2(c),A.removeMarker(a,g4),A.removeMarker(a,p4),l&&(A.removeMarker(l,ti),A.removeMarker(l,B?ti:or)),i&&i.cleanUp(r)})}d4.$inject=["bendpointMove","injector","eventBus","canvas"];var u4="connect-hover",Q4="djs-updating";function h4(e,t,n){return Bs(e,t,e[t]+n)}function Bs(e,t,n){return{x:t==="x"?n:e.x,y:t==="y"?n:e.y}}function Uy(e,t,n,A){var i=Math.max(t[A],n[A]),o=Math.min(t[A],n[A]),r=20,a=Math.min(Math.max(o+r,e[A]),i-r);return Bs(t,A,a)}function w4(e){return e==="x"?"y":"x"}function m4(e,t,n){var A,i;return e.original?e.original:(A=i0(t),i=w4(n),Bs(e,i,A[i]))}function f4(e,t,n,A,i,o){var r=e.get("connectionDocking",!1);this.start=function(g,p,E){var d,u=n.getGraphics(p),h=E-1,D=E,y=p.waypoints,C=y[h],m=y[D],I=as(n,y,g),x,v,F;x=We(C,m),x&&(v=x==="v"?"x":"y",h===0&&(C=m4(C,p.source,v)),D===y.length-1&&(m=m4(m,p.target,v)),I?F=I.point:F={x:(C.x+m.x)/2,y:(C.y+m.y)/2},d={connection:p,segmentStartIndex:h,segmentEndIndex:D,segmentStart:C,segmentEnd:m,axis:v,dragPosition:F},A.init(g,F,"connectionSegment.move",{cursor:v==="x"?"resize-ew":"resize-ns",data:{connection:p,connectionGfx:u,context:d}}))};function a(g,p){if(!r)return p;var E=g.waypoints,d;return g.waypoints=p,d=r.getCroppedWaypoints(g),g.waypoints=E,d}function c(g){i.update("connection",g.connection,g.connectionGfx)}function l(g,p,E){var d=g.newWaypoints,u=g.segmentStartIndex+p,h=d[u],D=g.segmentEndIndex+p,y=d[D],C=w4(g.axis),m=Uy(E,h,y,C);Q2(g.draggerGfx,m.x,m.y)}function B(g,p){var E=0,d=g.filter(function(u,h){return dc(g[h-1],g[h+1],u)?(E=h<=p?E-1:E,!1):!0});return{waypoints:d,segmentOffset:E}}t.on("connectionSegment.move.start",function(g){var p=g.context,E=g.connection,d=n.getLayer("overlays");p.originalWaypoints=E.waypoints.slice(),p.draggerGfx=a4(d,p.segmentStart,p.segmentEnd),D0(p.draggerGfx).add("djs-dragging"),n.addMarker(E,Q4)}),t.on("connectionSegment.move.move",function(g){var p=g.context,E=p.connection,d=p.segmentStartIndex,u=p.segmentEndIndex,h=p.segmentStart,D=p.segmentEnd,y=p.axis,C=p.originalWaypoints.slice(),m=h4(h,y,g["d"+y]),I=h4(D,y,g["d"+y]),x=C.length,v=0;C[d]=m,C[u]=I;var F,z;d<2&&(F=f2(E.source,m),d===1?F==="intersect"&&(C.shift(),C[0]=m,v--):F!=="intersect"&&(C.unshift(h),v++)),u>x-3&&(z=f2(E.target,I),u===x-2?z==="intersect"&&(C.pop(),C[C.length-1]=I):z!=="intersect"&&C.push(D)),p.newWaypoints=E.waypoints=a(E,C),l(p,v,g),p.newSegmentStartIndex=d+v,c(g)}),t.on("connectionSegment.move.hover",function(g){g.context.hover=g.hover,n.addMarker(g.hover,u4)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(g){var p=g.context.hover;p&&n.removeMarker(p,u4)}),t.on("connectionSegment.move.cleanup",function(g){var p=g.context,E=p.connection;p.draggerGfx&&s2(p.draggerGfx),n.removeMarker(E,Q4)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(g){var p=g.context,E=p.connection;E.waypoints=p.originalWaypoints,c(g)}),t.on("connectionSegment.move.end",function(g){var p=g.context,E=p.connection,d=p.newWaypoints,u=p.newSegmentStartIndex;d=d.map(function(I){return{original:I.original,x:Math.round(I.x),y:Math.round(I.y)}});var h=B(d,u),D=h.waypoints,y=a(E,D),C=h.segmentOffset,m={segmentMove:{segmentStartIndex:p.segmentStartIndex,newSegmentStartIndex:u+C}};o.updateWaypoints(E,y,m)})}f4.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var Ny=Math.abs,C4=Math.round;function zy(e,t,n){n=n===void 0?10:n;var A,i;for(A=0;A<t.length;A++)if(i=t[A],Ny(i-e)<=n)return i}function M4(e){return{x:e.x,y:e.y}}function D4(e){return{x:e.x+e.width,y:e.y+e.height}}function ie(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:C4(e.x+e.width/2),y:C4(e.y+e.height/2)}}function nA(e,t){var n=e.snapped;return n?typeof t=="string"?n[t]:n.x&&n.y:!1}function $0(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 A,i=e[t],o=e.snapped=e.snapped||{};return n===!1?o[t]=!1:(o[t]=!0,A=n-i,e[t]+=A,e["d"+t]+=A),i}function y4(e){return e.children||[]}var Ry=Math.abs,I4=Math.round,gs=10;function F4(e){function t(o,r){if(n0(o)){for(var a=o.length;a--;)if(Ry(o[a]-r)<=gs)return o[a]}else{o=+o;var c=r%o;if(c<gs)return r-c;if(c>o-gs)return r-c+o}return r}function n(o,r){if(o.waypoints)return Iy(r,o);if(o.width)return{x:I4(o.width/2+o.x),y:I4(o.height/2+o.y)}}function A(o){var r=o.context,a=r.snapPoints,c=r.connection,l=c.waypoints,B=r.segmentStart,g=r.segmentStartIndex,p=r.segmentEnd,E=r.segmentEndIndex,d=r.axis;if(a)return a;var u=[l[g-1],B,p,l[E+1]];return g<2&&u.unshift(n(c.source,o)),E>l.length-3&&u.unshift(n(c.target,o)),r.snapPoints=a={horizontal:[],vertical:[]},U(u,function(h){h&&(h=h.original||h,d==="y"&&a.horizontal.push(h.y),d==="x"&&a.vertical.push(h.x))}),a}e.on("connectionSegment.move.move",1500,function(o){var r=A(o),a=o.x,c=o.y,l,B;if(r){l=t(r.vertical,a),B=t(r.horizontal,c);var g=a-l,p=c-B;N(o,{dx:o.dx-g,dy:o.dy-p,x:l,y:B}),(g||r.vertical.indexOf(a)!==-1)&&$0(o,"x",l),(p||r.horizontal.indexOf(c)!==-1)&&$0(o,"y",B)}});function i(o){var r=o.snapPoints,a=o.connection.waypoints,c=o.bendpointIndex;if(r)return r;var l=[a[c-1],a[c+1]];return o.snapPoints=r={horizontal:[],vertical:[]},U(l,function(B){B&&(B=B.original||B,r.horizontal.push(B.y),r.vertical.push(B.x))}),r}e.on(["connect.hover","connect.move","connect.end"],1500,function(o){var r=o.context,a=r.hover,c=a&&n(a,o);!Y0(a)||!c||!c.x||!c.y||($0(o,"x",c.x),$0(o,"y",c.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(o){var r=o.context,a=i(r),c=r.hover,l=c&&n(c,o),B=o.x,g=o.y,p,E;if(a){p=t(l?a.vertical.concat([l.x]):a.vertical,B),E=t(l?a.horizontal.concat([l.y]):a.horizontal,g);var d=B-p,u=g-E;N(o,{dx:o.dx-d,dy:o.dy-u,x:o.x-d,y:o.y-u}),(d||a.vertical.indexOf(B)!==-1)&&$0(o,"x",p),(u||a.horizontal.indexOf(g)!==-1)&&$0(o,"y",E)}})}F4.$inject=["eventBus"];const Sy={__depends__:[nt,Te],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",c4],bendpointMove:["type",ls],bendpointMovePreview:["type",d4],connectionSegmentMove:["type",f4],bendpointSnapping:["type",F4]};function v4(e,t,n,A){function i(r,a){return A.allowed("connection.create",{source:r,target:a})}function o(r,a){return i(a,r)}e.on("connect.hover",function(r){var a=r.context,c=a.start,l=r.hover,B;if(a.hover=l,B=a.canExecute=i(c,l),!en(B)){if(B!==!1){a.source=c,a.target=l;return}B=a.canExecute=o(c,l),!en(B)&&B!==!1&&(a.source=l,a.target=c)}}),e.on(["connect.out","connect.cleanup"],function(r){var a=r.context;a.hover=null,a.source=null,a.target=null,a.canExecute=!1}),e.on("connect.end",function(r){var a=r.context,c=a.canExecute,l=a.connectionStart,B={x:r.x,y:r.y},g=a.source,p=a.target;if(!c)return!1;var E=null,d={connectionStart:ps(a)?B:l,connectionEnd:ps(a)?l:B};V0(c)&&(E=c),a.connection=n.connect(g,p,E,d)}),this.start=function(r,a,c,l){V0(c)||(l=c,c=i0(a)),t.init(r,"connect",{autoActivate:l,data:{shape:a,context:{start:a,connectionStart:c}}})}}v4.$inject=["eventBus","dragging","modeling","rules"];function ps(e){var t=e.hover,n=e.source,A=e.target;return t&&n&&t===n&&n!==A}var Ty=1100,ky=900,x4="connect-ok",b4="connect-not-ok";function Y4(e,t,n){var A=e.get("connectionPreview",!1);A&&t.on("connect.move",function(i){var o=i.context,r=o.canExecute,a=o.hover,c=o.source,l=o.start,B=o.startPosition,g=o.target,p=o.connectionStart||B,E=o.connectionEnd||{x:i.x,y:i.y},d=p,u=E;ps(o)&&(d=E,u=p),A.drawPreview(o,r,{source:c||l,target:g||a,connectionStart:d,connectionEnd:u})}),t.on("connect.hover",ky,function(i){var o=i.context,r=i.hover,a=o.canExecute;a!==null&&n.addMarker(r,a?x4:b4)}),t.on(["connect.out","connect.cleanup"],Ty,function(i){var o=i.hover;o&&(n.removeMarker(o,x4),n.removeMarker(o,b4))}),A&&t.on("connect.cleanup",function(i){A.cleanUp(i.context)})}Y4.$inject=["injector","eventBus","canvas"];const Es={__depends__:[Ce,Te,nt],__init__:["connectPreview"],connect:["type",v4],connectPreview:["type",Y4]};var Gy="djs-dragger";function At(e,t,n,A){this._canvas=t,this._graphicsFactory=n,this._elementFactory=A,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}At.$inject=["injector","canvas","graphicsFactory","elementFactory"],At.prototype.drawPreview=function(e,t,n){n=n||{};var A=e.connectionPreviewGfx,i=e.getConnection,o=n.source,r=n.target,a=n.waypoints,c=n.connectionStart,l=n.connectionEnd,B=n.noLayout,g=n.noCropping,p=n.noNoop,E,d=this;if(A||(A=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),co(A),i||(i=e.getConnection=Hy(function(u,h,D){return d.getConnection(u,h,D)})),t&&(E=i(t,o,r)),!E){!p&&this.drawNoopPreview(A,n);return}E.waypoints=a||[],this._layouter&&!B&&(E.waypoints=this._layouter.layoutConnection(E,{source:o,target:r,connectionStart:c,connectionEnd:l,waypoints:n.waypoints||E.waypoints})),(!E.waypoints||!E.waypoints.length)&&(E.waypoints=[o?i0(o):c,r?i0(r):l]),this._connectionDocking&&(o||r)&&!g&&(E.waypoints=this._connectionDocking.getCroppedWaypoints(E,o,r)),this._graphicsFactory.drawConnection(A,E,{stroke:"var(--element-dragger-color)"})},At.prototype.drawNoopPreview=function(e,t){var n=t.source,A=t.target,i=t.connectionStart||i0(n),o=t.connectionEnd||i0(A),r=this.cropWaypoints(i,o,n,A),a=this.createNoopConnection(r[0],r[1]);h0(e,a)},At.prototype.cropWaypoints=function(e,t,n,A){var i=this._graphicsFactory,o=n&&i.getShapePath(n),r=A&&i.getShapePath(A),a=i.getConnectionPath({waypoints:[e,t]});return e=n&&wc(o,a,!0)||e,t=A&&wc(r,a,!1)||t,[e,t]},At.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&s2(e.connectionPreviewGfx)},At.prototype.getConnection=function(e){var t=Py(e);return this._elementFactory.createConnection(t)},At.prototype.createConnectionPreviewGfx=function(){var e=g0("g");return q(e,{pointerEvents:"none"}),D0(e).add(Gy),h0(this._canvas.getActiveLayer(),e),e},At.prototype.createNoopConnection=function(e,t){return lo([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function Hy(e){var t={};return function(n){var A=JSON.stringify(n),i=t[A];return i||(i=t[A]=e.apply(null,arguments)),i}}function Py(e){return V0(e)?e:{}}const Jy={__init__:["connectionPreview"],connectionPreview:["type",At]},jy=new VA("ps");var Vy=["marker-start","marker-mid","marker-end"],Ly=["circle","ellipse","line","path","polygon","polyline","path","rect"];function bt(e,t,n,A){this._elementRegistry=e,this._canvas=n,this._styles=A}bt.$inject=["elementRegistry","eventBus","canvas","styles"],bt.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")},bt.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},bt.prototype.addDragger=function(e,t,n,A="djs-dragger"){n=n||this.getGfx(e);var i=BB(n),o=n.getBoundingClientRect();return this._cloneMarkers(Mt(i),A),q(i,this._styles.cls(A,[],{x:o.top,y:o.left})),h0(t,i),q(i,"data-preview-support-element-id",e.id),i},bt.prototype.addFrame=function(e,t){var n=g0("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return h0(t,n),q(n,"data-preview-support-element-id",e.id),n},bt.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var A=this;e.childNodes&&e.childNodes.forEach(i=>{A._cloneMarkers(i,t,n)}),Xy(e)&&Vy.forEach(function(i){if(q(e,i)){var o=Wy(e,i,A._canvas.getContainer());o&&A._cloneMarker(n,e,o,i,t)}})},bt.prototype._cloneMarker=function(e,t,n,A,i="djs-dragger"){var o=[n.id,i,jy.next()].join("-"),r=p0("marker#"+n.id,e);e=e||this._canvas._svg;var a=r||BB(n);a.id=o,D0(a).add(i);var c=p0(":scope > defs",e);c||(c=g0("defs"),h0(e,c)),h0(c,a);var l=Oy(a.id);q(t,A,l)};function Wy(e,t,n){var A=_y(q(e,t));return p0("marker#"+A,n||document)}function _y(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function Oy(e){return"url(#"+e+")"}function Xy(e){return Ly.indexOf(e.nodeName)!==-1}const AA={__init__:["previewSupport"],previewSupport:["type",bt]},rr="complex-preview";class U4{constructor(t,n,A){this._canvas=t,this._graphicsFactory=n,this._previewSupport=A,this._markers=[]}create(t){this.cleanUp();const{created:n=[],moved:A=[],removed:i=[],resized:o=[]}=t,r=this._canvas.getLayer(rr);n.filter(a=>!Ky(a)).forEach(a=>{let c;Y0(a)?(c=this._graphicsFactory._createContainer("connection",g0("g")),this._graphicsFactory.drawConnection(Mt(c),a)):(c=this._graphicsFactory._createContainer("shape",g0("g")),this._graphicsFactory.drawShape(Mt(c),a),Q2(c,a.x,a.y)),this._previewSupport.addDragger(a,r,c)}),A.forEach(({element:a,delta:c})=>{this._previewSupport.addDragger(a,r,void 0,"djs-dragging"),this._canvas.addMarker(a,"djs-element-hidden"),this._markers.push([a,"djs-element-hidden"]);const l=this._previewSupport.addDragger(a,r);Y0(a)?Q2(l,c.x,c.y):Q2(l,a.x+c.x,a.y+c.y)}),i.forEach(a=>{this._previewSupport.addDragger(a,r,void 0,"djs-dragging"),this._canvas.addMarker(a,"djs-element-hidden"),this._markers.push([a,"djs-element-hidden"])}),o.forEach(({shape:a,bounds:c})=>{this._canvas.addMarker(a,"djs-hidden"),this._markers.push([a,"djs-hidden"]),this._previewSupport.addDragger(a,r,void 0,"djs-dragging");const l=this._graphicsFactory._createContainer("shape",g0("g"));this._graphicsFactory.drawShape(Mt(l),a,{width:c.width,height:c.height}),Q2(l,c.x,c.y),this._previewSupport.addDragger(a,r,l)})}cleanUp(){co(this._canvas.getLayer(rr)),this._markers.forEach(([t,n])=>this._canvas.removeMarker(t,n)),this._markers=[]}show(){this._canvas.showLayer(rr)}hide(){this._canvas.hideLayer(rr)}}U4.$inject=["canvas","graphicsFactory","previewSupport"];function Ky(e){return e.hidden}const Zy={__depends__:[AA],__init__:["complexPreview"],complexPreview:["type",U4]};var ds=["top","bottom","left","right"],ar=10;function us(e,t){j.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(i){var o=i.context,r=o.connection,a=r.source,c=r.target,l=o.hints||{};l.createElementsBehavior!==!1&&(n(a),n(c))}),this.postExecuted(["label.create"],function(i){var o=i.context,r=o.shape,a=o.hints||{};a.createElementsBehavior!==!1&&n(r.labelTarget)}),this.postExecuted(["elements.create"],function(i){var o=i.context,r=o.elements,a=o.hints||{};a.createElementsBehavior!==!1&&r.forEach(function(c){n(c)})});function n(i){if(Io(i)&&!Y0(i)){var o=eI(i);o&&A(i,o)}}function A(i,o){var r=i0(i),a=i.label,c=i0(a);if(a.parent){var l=e0(i),B;switch(o){case"top":B={x:r.x,y:l.top-ar-a.height/2};break;case"left":B={x:l.left-ar-a.width/2,y:r.y};break;case"bottom":B={x:r.x,y:l.bottom+ar+a.height/2};break;case"right":B={x:l.right+ar+a.width/2,y:r.y};break}var g=Me(B,c);t.moveShape(a,g)}}}W(us,j),us.$inject=["eventBus","modeling"];function qy(e){var t=e.host,n=i0(e),A=f2(n,t),i;A.indexOf("-")>=0?i=A.split("-"):i=[A];var o=ds.filter(function(r){return i.indexOf(r)===-1});return o}function $y(e){var t=i0(e),n=[].concat(e.incoming.map(function(A){return A.waypoints[A.waypoints.length-2]}),e.outgoing.map(function(A){return A.waypoints[1]})).map(function(A){return N4(t,A)});return n}function eI(e){var t=i0(e.label),n=i0(e),A=N4(n,t);if(tI(A)){var i=$y(e);if(e.host){var o=qy(e);i=i.concat(o)}var r=ds.filter(function(a){return i.indexOf(a)===-1});if(r.indexOf(A)===-1)return r[0]}}function N4(e,t){return f2(t,e,5)}function tI(e){return ds.indexOf(e)!==-1}function Qs(e){j.call(this,e),this.preExecute("shape.append",function(t){var n=t.source,A=t.shape;t.position||(f(A,"bpmn:TextAnnotation")?t.position={x:n.x+n.width/2+75,y:n.y-50-A.height/2}:t.position={x:n.x+n.width+80+A.width/2,y:n.y+n.height/2})},!0)}W(Qs,j),Qs.$inject=["eventBus"];function hs(e,t){e.invoke(j,this),this.postExecute("shape.move",function(n){var A=n.newParent,i=n.shape,o=l0(i.incoming.concat(i.outgoing),function(r){return f(r,"bpmn:Association")});U(o,function(r){t.moveConnection(r,{x:0,y:0},A)})},!0)}W(hs,j),hs.$inject=["injector","modeling"];var z4=500;function cr(e,t){t.invoke(j,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",z4,function(A){var i=A.elements;i=i.filter(function(o){var r=o.host;return R4(o,r)}),i.length===1&&i.map(function(o){return i.indexOf(o)}).forEach(function(o){var r=i[o];A.elements[o]=n._replaceShape(i[o],r)})},!0),this.preExecute("elements.move",z4,function(A){var i=A.shapes,o=A.newHost;if(i.length===1){var r=i[0];R4(r,o)&&(A.shapes=[n._replaceShape(r,o)])}},!0)}cr.$inject=["bpmnReplace","injector"],W(cr,j),cr.prototype._replaceShape=function(e,t){var n=nI(e),A={type:"bpmn:BoundaryEvent",host:t};return n&&(A.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,A,{layoutConnection:!1})};function nI(e){var t=P(e),n=t.eventDefinitions;return n&&n[0]}function R4(e,t){return!f0(e)&&a0(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function ws(e,t){j.call(this,e);function n(A){return l0(A.attachers,function(i){return f(i,"bpmn:BoundaryEvent")})}this.postExecute("connection.create",function(A){var i=A.context.source,o=A.context.target,r=n(o);f(i,"bpmn:EventBasedGateway")&&f(o,"bpmn:ReceiveTask")&&r.length>0&&t.removeElements(r)}),this.postExecute("connection.reconnect",function(A){var i=A.context.oldSource,o=A.context.newSource;f(i,"bpmn:Gateway")&&f(o,"bpmn:EventBasedGateway")&&U(o.outgoing,function(r){var a=r.target,c=n(a);f(a,"bpmn:ReceiveTask")&&c.length>0&&t.removeElements(c)})})}ws.$inject=["eventBus","modeling"],W(ws,j);function ms(e,t,n){j.call(this,e),this.preExecute("shape.replace",a,!0),this.postExecuted("shape.replace",c,!0),this.preExecute("connection.create",i,!0),this.postExecuted("connection.delete",A,!0),this.postExecuted("connection.reconnect",o,!0),this.postExecuted("element.updateProperties",r,!0);function A(h){const D=h.source,y=h.target;iA(D)&&ni(y)&&B(y)}function i(h){const D=h.connection,y=h.source,C=h.target;iA(y)&&sr(C)&&(l(C),p(y,[D]))}function o(h){const D=h.newTarget,y=h.oldSource,C=h.oldTarget;if(C!==D){const m=y;ni(C)&&B(C),iA(m)&&sr(D)&&l(D)}}function r(h){const{element:D}=h;ni(D)?(g(D),E(D)):sr(D)&&d(D)}function a(h){const{newData:D,oldShape:y}=h;if(iA(h.oldShape)&&D.eventDefinitionType!=="bpmn:CompensateEventDefinition"||D.type!=="bpmn:BoundaryEvent"){const C=y.outgoing.find(({target:m})=>ni(m));C&&C.target&&(h._connectionTarget=C.target)}else if(!iA(h.oldShape)&&D.eventDefinitionType==="bpmn:CompensateEventDefinition"&&D.type==="bpmn:BoundaryEvent"){const C=y.outgoing.find(({target:m})=>sr(m));C&&C.target&&(h._connectionTarget=C.target),u(y)}}function c(h){const{_connectionTarget:D,newShape:y}=h;D&&t.connect(y,D)}function l(h){t.updateProperties(h,{isForCompensation:!0})}function B(h){t.updateProperties(h,{isForCompensation:void 0})}function g(h){for(const D of h.incoming)n.canConnect(D.source,h)||t.removeConnection(D);for(const D of h.outgoing)n.canConnect(h,D.target)||t.removeConnection(D)}function p(h,D){h.outgoing.filter(m=>f(m,"bpmn:Association")).filter(m=>ni(m.target)&&!D.includes(m)).forEach(m=>t.removeConnection(m))}function E(h){const D=h.attachers.slice();D.length&&t.removeElements(D)}function d(h){const D=h.incoming.filter(y=>iA(y.source));t.removeElements(D)}function u(h){const D=h.outgoing.filter(y=>f(y,"bpmn:SequenceFlow"));t.removeElements(D)}}W(ms,j),ms.$inject=["eventBus","modeling","bpmnRules"];function ni(e){const t=P(e);return t&&t.get("isForCompensation")}function iA(e){return e&&f(e,"bpmn:BoundaryEvent")&&jn(e,"bpmn:CompensateEventDefinition")}function sr(e){return e&&f(e,"bpmn:Activity")&&!h2(e)}function fs(e){e.invoke(j,this),this.preExecute("shape.create",1500,function(t){var n=t.context,A=n.parent,i=n.shape;f(A,"bpmn:Lane")&&!f(i,"bpmn:Lane")&&(n.parent=$n(A,"bpmn:Participant"))})}fs.$inject=["injector"],W(fs,j);function Cs(e,t){j.call(this,e),this.preExecute("shape.create",function(n){var A=n.context,i=A.shape;if(f(i,"bpmn:DataObjectReference")&&i.type!=="label"){var o=t.create("bpmn:DataObject");i.businessObject.dataObjectRef=o}})}Cs.$inject=["eventBus","bpmnFactory"],W(Cs,j);var Ms=20,Ds=20,S4=30,lr=2e3;function ys(e,t,n){j.call(this,t),t.on(["create.start","shape.move.start"],lr,function(i){var o=i.context,r=o.shape,a=e.getRootElement();if(!(!f(r,"bpmn:Participant")||!f(a,"bpmn:Process")||!a.children.length)){var c=a.children.filter(function(g){return!f(g,"bpmn:Group")&&!f0(g)&&!Y0(g)});if(c.length){var l=i2(c),B=AI(r,l);N(r,B),o.createConstraints=iI(r,l)}}}),t.on("create.start",lr,function(i){var o=i.context,r=o.shape,a=e.getRootElement(),c=e.getGraphics(a);function l(B){B.element=a,B.gfx=c}f(r,"bpmn:Participant")&&f(a,"bpmn:Process")&&(t.on("element.hover",lr,l),t.once("create.cleanup",function(){t.off("element.hover",l)}))});function A(){var i=e.getRootElement();return f(i,"bpmn:Collaboration")?i:n.makeCollaboration()}this.preExecute("elements.create",lr,function(i){var o=i.elements,r=i.parent,a=oI(o),c;a&&f(r,"bpmn:Process")&&(i.parent=A(),c=i.hints=i.hints||{},c.participant=a,c.process=r,c.processRef=P(a).get("processRef"))},!0),this.preExecute("shape.create",function(i){var o=i.parent,r=i.shape;f(r,"bpmn:Participant")&&f(o,"bpmn:Process")&&(i.parent=A(),i.process=o,i.processRef=P(r).get("processRef"))},!0),this.execute("shape.create",function(i){var o=i.hints||{},r=i.process||o.process,a=i.shape,c=o.participant;r&&(!c||a===c)&&P(a).set("processRef",P(r))},!0),this.revert("shape.create",function(i){var o=i.hints||{},r=i.process||o.process,a=i.processRef||o.processRef,c=i.shape,l=o.participant;r&&(!l||c===l)&&P(c).set("processRef",a)},!0),this.postExecute("shape.create",function(i){var o=i.hints||{},r=i.process||i.hints.process,a=i.shape,c=o.participant;if(r){var l=r.children.slice();c?a===c&&n.moveElements(l,{x:0,y:0},c):n.moveElements(l,{x:0,y:0},a)}},!0)}ys.$inject=["canvas","eventBus","modeling"],W(ys,j);function AI(e,t){t={width:t.width+Ms*2+S4,height:t.height+Ds*2};var n=Math.max(e.width,t.width),A=Math.max(e.height,t.height);return{x:-n/2,y:-A/2,width:n,height:A}}function iI(e,t){return t=e0(t),{bottom:t.top+e.height/2-Ds,left:t.right-e.width/2+Ms,top:t.bottom-e.height/2+Ds,right:t.left+e.width/2-Ms-S4}}function oI(e){return m0(e,function(t){return f(t,"bpmn:Participant")})}var T4="__targetRef_placeholder";function Is(e,t){j.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],k4(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],k4(o));function n(r,a,c){var l=r.get("dataInputAssociations");return m0(l,function(B){return B!==c&&B.targetRef===a})}function A(r,a){var c=r.get("properties"),l=m0(c,function(B){return B.name===T4});return!l&&a&&(l=t.create("bpmn:Property",{name:T4}),o2(c,l)),l}function i(r,a){var c=A(r);c&&(n(r,c,a)||X0(r.get("properties"),c))}function o(r){var a=r.context,c=a.connection,l=c.businessObject,B=c.target,g=B&&B.businessObject,p=a.newTarget,E=p&&p.businessObject,d=a.oldTarget||a.target,u=d&&d.businessObject,h=c.businessObject,D;u&&u!==g&&i(u,l),E&&E!==g&&i(E,l),g?(D=A(g,!0),h.targetRef=D):h.targetRef=null}}Is.$inject=["eventBus","bpmnFactory"],W(Is,j);function k4(e){return function(t){var n=t.context,A=n.connection;if(f(A,"bpmn:DataInputAssociation"))return e(t)}}function Br(e){this._bpmnUpdater=e}Br.$inject=["bpmnUpdater"],Br.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,A=e.newSemanticParent,i=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,A),this._bpmnUpdater.updateDiParent(n,i),[]},Br.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,A=e.oldSemanticParent,i=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,A),this._bpmnUpdater.updateDiParent(n,i),[]};function Fs(e,t,n,A){j.call(this,A),t.registerHandler("dataStore.updateContainment",Br);function i(){return n.filter(function(a){return f(a,"bpmn:Participant")&&P(a).processRef})[0]}function o(a){return a.children.filter(function(c){return f(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function r(a,c){var l=a.businessObject||a;if(c=c||i(),c){var B=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:l,dataStoreDi:Q0(a),newSemanticParent:B.processRef||B,newDiParent:Q0(c)})}}this.preExecute("shape.create",function(a){var c=a.context,l=c.shape;f(l,"bpmn:DataStoreReference")&&l.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(a){var c=a.context,l=c.shapes,B=l.filter(function(g){return f(g,"bpmn:DataStoreReference")});B.length&&(c.hints||(c.hints={}),c.hints.autoResize=l.filter(function(g){return!f(g,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(a){var c=a.context,l=c.shape,B=l.parent;f(l,"bpmn:DataStoreReference")&&l.type!=="label"&&f(B,"bpmn:Collaboration")&&r(l)}),this.postExecute("shape.move",function(a){var c=a.context,l=c.shape,B=c.oldParent,g=l.parent;if(!f(B,"bpmn:Collaboration")&&f(l,"bpmn:DataStoreReference")&&l.type!=="label"&&f(g,"bpmn:Collaboration")){var p=f(B,"bpmn:Participant")?B:aI(B,"bpmn:Participant");r(l,p)}}),this.postExecute("shape.delete",function(a){var c=a.context,l=c.shape,B=e.getRootElement();a0(l,["bpmn:Participant","bpmn:SubProcess"])&&f(B,"bpmn:Collaboration")&&o(B).filter(function(g){return rI(g,l)}).forEach(function(g){r(g)})}),this.postExecute("canvas.updateRoot",function(a){var c=a.context,l=c.oldRoot,B=c.newRoot,g=o(l);g.forEach(function(p){f(B,"bpmn:Process")&&r(p,B)})})}Fs.$inject=["canvas","commandStack","elementRegistry","eventBus"],W(Fs,j);function rI(e,t){for(var n=e.businessObject||e,A=t.businessObject||t;n.$parent;){if(n.$parent===A.processRef||A)return!0;n=n.$parent}return!1}function aI(e,t){for(;e.parent;){if(f(e.parent,t))return e.parent;e=e.parent}}var gr=Math.max,pr=Math.min,cI=20;function G4(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function sI(e,t,n){var A=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+A:t.indexOf("w")!==-1&&(o.x=e.x+A,o.width=e.width-A),o}function lI(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 Er(e,t,n){var A=t[e],i=n.min&&n.min[e],o=n.max&&n.max[e];return A0(i)&&(A=(/top|left/.test(e)?pr:gr)(A,i)),A0(o)&&(A=(/top|left/.test(e)?gr:pr)(A,o)),A}function BI(e,t){if(!t)return e;var n=e0(e);return Qo({top:Er("top",n,t),right:Er("right",n,t),bottom:Er("bottom",n,t),left:Er("left",n,t)})}function gI(e,t,n,A){var i=e0(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},r=A?e0(A):o,a={top:pr(o.top,r.top),left:pr(o.left,r.left),bottom:gr(o.bottom,r.bottom),right:gr(o.right,r.right)};return Qo(a)}function Ai(e,t){return typeof e<"u"?e:cI}function pI(e,t){var n,A,i,o;return typeof t=="object"?(n=Ai(t.left),A=Ai(t.right),i=Ai(t.top),o=Ai(t.bottom)):n=A=i=o=Ai(t),{x:e.x-n,y:e.y-i,width:e.width+n+A,height:e.height+i+o}}function EI(e){return!(e.waypoints||e.type==="label")}function H4(e,t){var n;if(e.length===void 0?n=l0(e.children,EI):n=e,n.length)return pI(i2(n),t)}var Yt=Math.abs;function dI(e,t){return G4(e0(t),e0(e))}var uI=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],oe=30;function dr(e,t){return t=t||[],e.children.filter(function(n){f(n,"bpmn:Lane")&&(dr(n,t),t.push(n))}),t}function it(e){return e.children.filter(function(t){return f(t,"bpmn:Lane")})}function re(e){return $n(e,uI)||e}function QI(e,t){var n=re(e),A=f(n,"bpmn:Process")?[]:[n],i=dr(n,A),o=e0(e),r=e0(t),a=dI(e,t),c=[],l=l2(e);return i.forEach(function(B){if(B!==e){var g=l?0:a.top,p=l?a.right:0,E=l?0:a.bottom,d=l?a.left:0,u=e0(B);a.top&&(Yt(u.bottom-o.top)<10&&(E=r.top-u.bottom),Yt(u.top-o.top)<5&&(g=r.top-u.top)),a.left&&(Yt(u.right-o.left)<10&&(p=r.left-u.right),Yt(u.left-o.left)<5&&(d=r.left-u.left)),a.bottom&&(Yt(u.top-o.bottom)<10&&(g=r.bottom-u.top),Yt(u.bottom-o.bottom)<5&&(E=r.bottom-u.bottom)),a.right&&(Yt(u.left-o.right)<10&&(d=r.right-u.left),Yt(u.right-o.right)<5&&(p=r.right-u.right)),(g||p||E||d)&&c.push({shape:B,newBounds:lI(B,{top:g,right:p,bottom:E,left:d})})}}),c}var hI=500;function vs(e,t){j.call(this,e);function n(A,i){var o=l2(A),r=it(i),a=[],c=[],l=[],B=[];if(nn(r,function(h){return o?h.y>A.y?c.push(h):a.push(h):h.x>A.x?B.push(h):l.push(h),h.children}),!!r.length){var g;o?c.length&&a.length?g=A.height/2:g=A.height:B.length&&l.length?g=A.width/2:g=A.width;var p,E,d,u;a.length&&(p=t.calculateAdjustments(a,"y",g,A.y-10),t.makeSpace(p.movingShapes,p.resizingShapes,{x:0,y:g},"s")),c.length&&(E=t.calculateAdjustments(c,"y",-g,A.y+A.height+10),t.makeSpace(E.movingShapes,E.resizingShapes,{x:0,y:-g},"n")),l.length&&(d=t.calculateAdjustments(l,"x",g,A.x-10),t.makeSpace(d.movingShapes,d.resizingShapes,{x:g,y:0},"e")),B.length&&(u=t.calculateAdjustments(B,"x",-g,A.x+A.width+10),t.makeSpace(u.movingShapes,u.resizingShapes,{x:-g,y:0},"w"))}}this.postExecuted("shape.delete",hI,function(A){var i=A.context,o=i.hints,r=i.shape,a=i.oldParent;f(r,"bpmn:Lane")&&(o&&o.nested||n(r,a))})}vs.$inject=["eventBus","spaceTool"],W(vs,j);var P4=500;function ur(e,t){t.invoke(j,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",P4,function(A){var i=A.elements;i.filter(function(o){var r=o.host;return J4(o,r)}).map(function(o){return i.indexOf(o)}).forEach(function(o){A.elements[o]=n._replaceShape(i[o])})},!0),this.preExecute("elements.move",P4,function(A){var i=A.shapes,o=A.newHost;i.forEach(function(r,a){var c=r.host;J4(r,mI(i,c)?c:o)&&(i[a]=n._replaceShape(r))})},!0)}ur.$inject=["bpmnReplace","injector"],W(ur,j),ur.prototype._replaceShape=function(e){var t=wI(e),n;return t?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function wI(e){var t=P(e),n=t.eventDefinitions;return n&&n[0]}function J4(e,t){return!f0(e)&&f(e,"bpmn:BoundaryEvent")&&!t}function mI(e,t){return e.indexOf(t)!==-1}function xs(e,t,n){j.call(this,e);function A(i,o,r){var a=o.waypoints,c,l,B,g,p,E,d,u=i.outgoing.slice(),h=i.incoming.slice(),D;A0(r.width)?D=i0(r):D=r;var y=os(a,D);if(y){if(c=a.slice(0,y.index),l=a.slice(y.index+(y.bendpoint?1:0)),!c.length||!l.length)return;B=y.bendpoint?a[y.index]:D,(c.length===1||!j4(i,c[c.length-1]))&&c.push(V4(B)),(l.length===1||!j4(i,l[0]))&&l.unshift(V4(B))}g=o.source,p=o.target,t.canConnect(g,i,o)&&(n.reconnectEnd(o,i,c||D),E=o),t.canConnect(i,p,o)&&(E?d=n.connect(i,p,{type:o.type,waypoints:l}):(n.reconnectStart(o,i,l||D),d=o));var C=[].concat(E&&l0(h,function(m){return m.source===E.source})||[],d&&l0(u,function(m){return m.target===d.target})||[]);C.length&&n.removeElements(C)}this.preExecute("elements.move",function(i){var o=i.newParent,r=i.shapes,a=i.delta,c=r[0];if(!(!c||!o)){o&&o.waypoints&&(i.newParent=o=o.parent);var l=i0(c),B={x:l.x+a.x,y:l.y+a.y},g=m0(o.children,function(p){var E=t.canInsert(r,p);return E&&os(p.waypoints,B)});g&&(i.targetFlow=g,i.position=B)}},!0),this.postExecuted("elements.move",function(i){var o=i.shapes,r=i.targetFlow,a=i.position;r&&A(o[0],r,a)},!0),this.preExecute("shape.create",function(i){var o=i.parent,r=i.shape;t.canInsert(r,o)&&(i.targetFlow=o,i.parent=o.parent)},!0),this.postExecuted("shape.create",function(i){var o=i.shape,r=i.targetFlow,a=i.position;r&&A(o,r,a)},!0)}W(xs,j),xs.$inject=["eventBus","bpmnRules","modeling"];function j4(e,t){var n=t.x,A=t.y;return n>=e.x&&n<=e.x+e.width&&A>=e.y&&A<=e.y+e.height}function V4(e){return N({},e)}function bs(e,t){j.call(this,e),this.preExecuted("connection.create",function(n){var A=n.context,i=A.connection,o=A.source,r=A.target,a=A.hints;if(!(a&&a.createElementsBehavior===!1)&&oA(i)){var c=[];f(o,"bpmn:EventBasedGateway")?c=r.incoming.filter(l=>l!==i&&oA(l)):c=r.incoming.filter(l=>l!==i&&oA(l)&&f(l.source,"bpmn:EventBasedGateway")),c.forEach(function(l){t.removeConnection(l)})}}),this.preExecuted("shape.replace",function(n){var A=n.context,i=A.newShape;if(f(i,"bpmn:EventBasedGateway")){var o=i.outgoing.filter(oA).reduce(function(r,a){return r.includes(a.target)?r:r.concat(a.target)},[]);o.forEach(function(r){r.incoming.filter(oA).forEach(function(a){const c=r.incoming.filter(oA).filter(function(l){return l.source===i});(a.source!==i||c.length>1)&&t.removeConnection(a)})})}})}bs.$inject=["eventBus","modeling"],W(bs,j);function oA(e){return f(e,"bpmn:SequenceFlow")}var Qr=1500,L4=2e3;function W4(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"],Qr,function(A){var i=A.context,o=i.shape||A.shape,r=A.hover;f(r,"bpmn:Lane")&&!a0(o,["bpmn:Lane","bpmn:Participant"])&&(A.hover=re(r),A.hoverGfx=e.getGraphics(A.hover));var a=n.getRootElement();r!==a&&(o.labelTarget||a0(o,["bpmn:Group","bpmn:TextAnnotation"]))&&(A.hover=a,A.hoverGfx=e.getGraphics(A.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],Qr,function(A){var i=A.hover;f(i,"bpmn:Lane")&&(A.hover=re(i)||i,A.hoverGfx=e.getGraphics(A.hover))}),t.on(["bendpoint.move.hover"],Qr,function(A){var i=A.context,o=A.hover,r=i.type;f(o,"bpmn:Lane")&&/reconnect/.test(r)&&(A.hover=re(o)||o,A.hoverGfx=e.getGraphics(A.hover))}),t.on(["connect.start"],Qr,function(A){var i=A.context,o=i.start;f(o,"bpmn:Lane")&&(i.start=re(o)||o)}),t.on("shape.move.start",L4,function(A){var i=A.shape;f(i,"bpmn:Lane")&&(A.shape=re(i)||i)}),t.on("spaceTool.move",L4,function(A){var i=A.hover;i&&f(i,"bpmn:Lane")&&(A.hover=re(i))})}W4.$inject=["elementRegistry","eventBus","canvas"];function fI(e){return e.create("bpmn:Category")}function CI(e){return e.create("bpmn:CategoryValue")}function MI(e,t,n){return o2(t.get("categoryValue"),e),e.$parent=t,o2(n.get("rootElements"),t),t.$parent=n,e}function DI(e){var t=e.$parent;return t&&(X0(t.get("categoryValue"),e),e.$parent=null),e}function yI(e){var t=e.$parent;return t&&(X0(t.get("rootElements"),e),e.$parent=null),e}var _4=770;function Ys(e,t,n,A,i,o){i.invoke(j,this);function r(){return n.filter(function(d){return f(d,"bpmn:Group")})}function a(d,u){return d.some(function(h){var D=P(h),y=D.categoryValueRef&&D.categoryValueRef.$parent;return y===u})}function c(d,u){return d.some(function(h){var D=P(h);return D.categoryValueRef===u})}function l(d,u,h){var D=r().filter(function(y){return y.businessObject!==h});u&&!a(D,u)&&yI(u),d&&!c(D,d)&&DI(d)}function B(d,u){return MI(d,u,t.getDefinitions())}function g(d,u){var h=P(d),D=h.categoryValueRef;D||(D=h.categoryValueRef=u.categoryValue=u.categoryValue||CI(e));var y=D.$parent;y||(y=D.$parent=u.category=u.category||fI(e)),B(D,y,t.getDefinitions())}function p(d,u){var h=u.category,D=u.categoryValue,y=P(d);D?(y.categoryValueRef=null,l(D,h,y)):l(null,y.categoryValueRef.$parent,y)}this.execute("label.create",function(d){var u=d.context,h=u.labelTarget;f(h,"bpmn:Group")&&g(h,u)}),this.revert("label.create",function(d){var u=d.context,h=u.labelTarget;f(h,"bpmn:Group")&&p(h,u)}),this.execute("shape.delete",function(d){var u=d.context,h=u.shape,D=P(h);if(!(!f(h,"bpmn:Group")||h.labelTarget)){var y=u.categoryValue=D.categoryValueRef,C;y&&(C=u.category=y.$parent,l(y,C,D),D.categoryValueRef=null)}}),this.reverted("shape.delete",function(d){var u=d.context,h=u.shape;if(!(!f(h,"bpmn:Group")||h.labelTarget)){var D=u.category,y=u.categoryValue,C=P(h);y&&(C.categoryValueRef=y,B(y,D))}}),this.execute("shape.create",function(d){var u=d.context,h=u.shape;!f(h,"bpmn:Group")||h.labelTarget||P(h).categoryValueRef&&g(h,u)}),this.reverted("shape.create",function(d){var u=d.context,h=u.shape;!f(h,"bpmn:Group")||h.labelTarget||P(h).categoryValueRef&&p(h,u)});function E(d,u){var h=e.create(d.$type);return o.copyElement(d,h,null,u)}A.on("copyPaste.copyElement",_4,function(d){var u=d.descriptor,h=d.element;if(!(!f(h,"bpmn:Group")||h.labelTarget)){var D=P(h);if(D.categoryValueRef){var y=D.categoryValueRef;u.categoryValue=E(y,!0),y.$parent&&(u.category=E(y.$parent,!0))}}}),A.on("copyPaste.pasteElement",_4,function(d){var u=d.descriptor,h=u.businessObject,D=u.categoryValue,y=u.category;D&&(D=h.categoryValueRef=E(D)),y&&(D.$parent=E(y)),delete u.category,delete u.categoryValue})}Ys.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],W(Ys,j);function Us(e,t,n,A){var i,o,r,a,c;return i=(A.y-n.y)*(t.x-e.x)-(A.x-n.x)*(t.y-e.y),i==0?null:(o=e.y-n.y,r=e.x-n.x,c=(A.x-n.x)*o-(A.y-n.y)*r,a=c/i,{x:Math.round(e.x+a*(t.x-e.x)),y:Math.round(e.y+a*(t.y-e.y))})}function O4(e){function t(A,i,o){var r={x:o.x,y:o.y-50},a={x:o.x-50,y:o.y},c=Us(A,i,o,r),l=Us(A,i,o,a),B;c&&l?X4(c,o)>X4(l,o)?B=l:B=c:B=c||l,A.original=B}function n(A){var i=A.waypoints;t(i[0],i[1],i0(A.source)),t(i[i.length-1],i[i.length-2],i0(A.target))}e.on("bpmnElement.added",function(A){var i=A.element;i.waypoints&&n(i)})}O4.$inject=["eventBus"];function X4(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ns(e){j.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var A=n.context.shape,i=P(A),o=Q0(A);if(a0(i,t)){var r=o.get("isHorizontal");r===void 0&&(r=!0),o.set("isHorizontal",r)}})}Ns.$inject=["eventBus"],W(Ns,j);var K4=Math.sqrt,Z4=Math.min,II=Math.max,q4=Math.abs;function $4(e){return Math.pow(e,2)}function ii(e,t){return K4($4(e.x-t.x)+$4(e.y-t.y))}function FI(e,t){var n=0,A,i,o,r,a,c,l,B,g,p,E;for(n=0;n<t.length-1;n++){if(A=t[n],i=t[n+1],tE(A,i)?l=[A]:(o=ii(e,A),r=ii(e,i),c=Z4(o,r),l=vI(A,i,e,c)),l.length<1)throw new Error("expected between [1, 2] circle -> line intersections");l.length===1&&(B={type:"bendpoint",position:l[0],segmentIndex:n,bendpointIndex:tE(A,l[0])?n:n+1}),l.length===2&&(a=bI(l[0],l[1]),B={type:"segment",position:a,segmentIndex:n,relativeLocation:ii(A,a)/ii(A,i)}),g=ii(B.position,e),(!E||p>g)&&(E=B,p=g)}return E}function vI(e,t,n,A){var i=t.x-e.x,o=t.y-e.y,r=n.x-e.x,a=n.y-e.y,c=i*i+o*o,l=i*r+o*a,B=r*r+a*a-A*A,g=l/c,p=B/c,E=g*g-p;if(E<0&&E>-1e-6&&(E=0),E<0)return[];var d=K4(E),u=-g+d,h=-g-d,D={x:e.x-i*u,y:e.y-o*u};if(E===0)return[D];var y={x:e.x-i*h,y:e.y-o*h};return[D,y].filter(function(C){return xI(C,e,t)})}function xI(e,t,n){return eE(e.x,t.x,n.x)&&eE(e.y,t.y,n.y)}function eE(e,t,n){return e>=Z4(t,n)-hr&&e<=II(t,n)+hr}function bI(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var hr=.1;function tE(e,t){return q4(e.x-t.x)<=hr&&q4(e.y-t.y)<=hr}function YI(e,t,n,A){var i=n.segmentIndex,o=t.length-e.length;if(A.segmentMove){var r=A.segmentMove.segmentStartIndex,a=A.segmentMove.newSegmentStartIndex;return i===r?a:i>=a?i+o<a?a:i+o:i}if(A.bendpointMove){var c=A.bendpointMove.insert,l=A.bendpointMove.bendpointIndex,B;if(o===0)return i;if(i>=l&&(B=c?i+1:i-1),i<l&&(B=i,c&&n.type!=="bendpoint"&&l-1===i)){var g=AE(t,l);g<n.relativeLocation&&B++}return B}return o===0?i:A.connectionStart&&i===0?0:A.connectionEnd&&i===e.length-2?t.length-2:Math.floor((t.length-2)/2)}function nE(e,t,n,A){var i=0,o=0,r={point:e,delta:{x:0,y:0}},a=FI(e,n),c=a.segmentIndex,l=YI(n,t,a,A);if(l<0||l>t.length-2||l===null)return r;var B=iE(n,c),g=iE(t,l),p=a.position,E=NI(B,p),d=UI(B,g);if(a.type==="bendpoint"){var u=t.length-n.length,h=a.bendpointIndex,D=n[h];if(t.indexOf(D)!==-1)return r;if(u===0){var y=t[h];return i=y.x-a.position.x,o=y.y-a.position.y,{delta:{x:i,y:o},point:{x:e.x+i,y:e.y+o}}}u<0&&h!==0&&h<n.length-1&&(E=AE(n,h))}var C={x:(g[1].x-g[0].x)*E+g[0].x,y:(g[1].y-g[0].y)*E+g[0].y},m=Cy({x:e.x-p.x,y:e.y-p.y},d);return i=C.x+m.x-e.x,o=C.y+m.y-e.y,{point:_e(C),delta:_e({x:i,y:o})}}function AE(e,t){var n=Ar(e[t-1],e[t]),A=Ar(e[t],e[t+1]),i=n/(n+A);return i}function UI(e,t){var n=A4(e),A=A4(t);return A-n}function iE(e,t){return[e[t],e[t+1]]}function NI(e,t){var n=Ar(e[0],e[1]),A=Ar(e[0],t);return n===0?0:A/n}function zI(e,t,n,A){var i=i0(e);return nE(i,t,n,A).delta}function oi(e,t,n){var A=WA(t),i=WA(n),o=Me(e,A),r={x:o.x*(n.width/t.width),y:o.y*(n.height/t.height)};return _e({x:i.x+r.x,y:i.y+r.y})}function oE(e,t,n){var A=WA(e),i=WA(t),o=WA(n),r=Me(e,A),a=Me(A,i),c=RI(A,t,n);if(c)return c;var l={x:a.x*(n.width/t.width),y:a.y*(n.height/t.height)},B={x:o.x+l.x,y:o.y+l.y};return _e({x:B.x+r.x-e.x,y:B.y+r.y-e.y})}function RI(e,t,n){var A=e0(t),i=e0(n);if(SI(A,i))return null;var o=f2(t,e),r,a,c;if(o==="top")r={x:0,y:i.bottom-A.bottom};else if(o==="bottom")r={x:0,y:i.top-A.top};else if(o==="right")r={x:i.left-A.left,y:0};else if(o==="left")r={x:i.right-A.right,y:0};else return null;return a={x:e.x+r.x,y:e.y+r.y},c=f2(n,a),c!==o?null:r}function SI(e,t){return TI(e,t)||kI(e,t)}function TI(e,t){return e.right!==t.right&&e.left!==t.left}function kI(e,t){return e.top!==t.top&&e.bottom!==t.bottom}var rE="name",aE="text";function zs(e,t,n,A){j.call(this,e),this.postExecute("element.updateProperties",i),this.postExecute("element.updateModdleProperties",r=>{P(r.context.element)===r.context.moddleElement&&i(r)});function i(r){var a=r.context,c=a.element,l=a.properties;if(rE in l&&t.updateLabel(c,l[rE]),aE in l&&f(c,"bpmn:TextAnnotation")){var B=A.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},l[aE]||"");t.updateLabel(c,l.text,B)}}this.postExecute(["shape.create","connection.create"],function(r){var a=r.context,c=a.hints||{};if(c.createElementsBehavior!==!1){var l=a.shape||a.connection;f0(l)||!an(l)||fe(l)&&t.updateLabel(l,fe(l))}}),this.postExecute("shape.delete",function(r){var a=r.context,c=a.labelTarget,l=a.hints||{};c&&l.unsetLabel!==!1&&t.updateLabel(c,null,null,{removeShape:!1})});function o(r){var a=r.context,c=a.connection,l=c.label,B=N({},a.hints),g=a.newWaypoints||c.waypoints,p=a.oldWaypoints;return typeof B.startChanged>"u"&&(B.startChanged=!!B.connectionStart),typeof B.endChanged>"u"&&(B.endChanged=!!B.connectionEnd),zI(l,g,p,B)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(r){var a=r.context,c=a.hints||{};if(c.labelBehavior!==!1){var l=a.connection,B=l.label,g;!B||!B.parent||(g=o(r),t.moveShape(B,g))}}),this.postExecute(["shape.replace"],function(r){var a=r.context,c=a.newShape,l=a.oldShape,B=P(c);B&&an(B)&&l.label&&c.label&&(c.label.x=l.label.x,c.label.y=l.label.y)}),this.postExecute("shape.resize",function(r){var a=r.context,c=a.shape,l=a.newBounds,B=a.oldBounds;if(Io(c)){var g=c.label,p=i0(g),E=PI(B),d=HI(p,E),u=GI(d,B,l);t.moveShape(g,u)}})}W(zs,j),zs.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function GI(e,t,n){var A=oi(e,t,n);return _e(Me(A,e))}function HI(e,t){if(t.length){var n=JI(e,t);return rs(e,n)}}function PI(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 JI(e,t){var n=t.map(function(i){return{line:i,distance:i4(e,i)}}),A=Qe(n,"distance");return A[0].line}function jI(e,t,n,A){return nE(e,t,n,A).point}function Rs(e,t){j.call(this,e);function n(A,i){var o=A.context,r=o.connection,a=N({},o.hints),c=o.newWaypoints||r.waypoints,l=o.oldWaypoints;return typeof a.startChanged>"u"&&(a.startChanged=!!a.connectionStart),typeof a.endChanged>"u"&&(a.endChanged=!!a.connectionEnd),jI(i,c,l,a)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(A){var i=A.context,o=i.connection,r=o.outgoing,a=o.incoming;a.forEach(function(c){var l=c.waypoints[c.waypoints.length-1],B=n(A,l),g=[].concat(c.waypoints.slice(0,-1),[B]);t.updateWaypoints(c,g)}),r.forEach(function(c){var l=c.waypoints[0],B=n(A,l),g=[].concat([B],c.waypoints.slice(1));t.updateWaypoints(c,g)})}),this.postExecute(["connection.move"],function(A){var i=A.context,o=i.connection,r=o.outgoing,a=o.incoming,c=i.delta;a.forEach(function(l){var B=l.waypoints[l.waypoints.length-1],g={x:B.x+c.x,y:B.y+c.y},p=[].concat(l.waypoints.slice(0,-1),[g]);t.updateWaypoints(l,p)}),r.forEach(function(l){var B=l.waypoints[0],g={x:B.x+c.x,y:B.y+c.y},p=[].concat([g],l.waypoints.slice(1));t.updateWaypoints(l,p)})})}W(Rs,j),Rs.$inject=["eventBus","modeling"];function wr(e,t,n){var A=fr(e),i=sE(A,t),o=A[0];return i.length?i[i.length-1]:oi(o.original||o,n,t)}function mr(e,t,n){var A=fr(e),i=sE(A,t),o=A[A.length-1];return i.length?i[0]:oi(o.original||o,n,t)}function Ss(e,t,n){var A=fr(e),i=cE(t,n),o=A[0];return oi(o.original||o,i,t)}function Ts(e,t,n){var A=fr(e),i=cE(t,n),o=A[A.length-1];return oi(o.original||o,i,t)}function cE(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function fr(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function sE(e,t){var n=B2(e,LI);return l0(n,function(A){return VI(A,t)})}function VI(e,t){return f2(t,e,1)==="intersect"}function LI(e){return e.original||e}function ks(e,t){j.call(this,e),this.postExecute("shape.replace",function(n){var A=n.oldShape,i=n.newShape;if(WI(A,i)){var o=_I(A);o.incoming.forEach(function(r){var a=mr(r,i,A);t.reconnectEnd(r,i,a)}),o.outgoing.forEach(function(r){var a=wr(r,i,A);t.reconnectStart(r,i,a)})}},!0)}ks.$inject=["eventBus","modeling"],W(ks,j);function WI(e,t){return f(e,"bpmn:Participant")&&E0(e)&&f(t,"bpmn:Participant")&&!E0(t)}function _I(e){var t=YA([e],!1),n=[],A=[];return t.forEach(function(i){i!==e&&(i.incoming.forEach(function(o){f(o,"bpmn:MessageFlow")&&n.push(o)}),i.outgoing.forEach(function(o){f(o,"bpmn:MessageFlow")&&A.push(o)}))},[]),{incoming:n,outgoing:A}}const OI=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function lE(e){const t=P(e);if(!f(t,"bpmn:BoundaryEvent")&&!(f(t,"bpmn:StartEvent")&&h2(t.$parent)))return!1;const n=t.get("eventDefinitions");return!n||!n.length?!1:OI.some(A=>f(n[0],A))}function BE(e){return f(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function Gs(e,t){e.invoke(j,this),this.postExecuted("shape.replace",function(n){const A=n.context.oldShape,i=n.context.newShape,o=n.context.hints;if(!lE(i))return;const r=BE(i);if(o.targetElement&&o.targetElement[r]!==void 0)return;const c=P(A).get(r),l=P(i).get(r);c!==l&&t.updateProperties(i,{[r]:c})})}Gs.$inject=["injector","modeling"],W(Gs,j);function Hs(e,t){j.call(this,e),this.preExecute("shape.resize",function(n){var A=n.shape,i=Q0(A),o=i&&i.get("label"),r=o&&o.get("bounds");r&&t.updateModdleProperties(A,o,{bounds:void 0})},!0)}W(Hs,j),Hs.$inject=["eventBus","modeling"];function Ps(e,t,n){j.call(this,e),this.preExecute("shape.delete",function(A){var i=A.context.shape;if(!(i.incoming.length!==1||i.outgoing.length!==1)){var o=i.incoming[0],r=i.outgoing[0];if(!(!f(o,"bpmn:SequenceFlow")||!f(r,"bpmn:SequenceFlow"))&&t.canConnect(o.source,r.target,o)){var a=XI(o.waypoints,r.waypoints);n.reconnectEnd(o,r.target,a)}}})}W(Ps,j),Ps.$inject=["eventBus","bpmnRules","modeling"];function rA(e){return e.original||e}function XI(e,t){var n=Us(rA(e[e.length-2]),rA(e[e.length-1]),rA(t[1]),rA(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[rA(e[0]),rA(t[t.length-1])]}function Js(e,t){j.call(this,e),this.preExecute("shape.delete",function(n){var A=n.shape,i=A.parent;f(A,"bpmn:Participant")&&(n.collaborationRoot=i)},!0),this.postExecute("shape.delete",function(n){var A=n.collaborationRoot;if(A&&!A.businessObject.participants.length){var i=t.makeProcess(),o=A.children.slice();t.moveElements(o,{x:0,y:0},i)}},!0)}Js.$inject=["eventBus","modeling"],W(Js,j);function js(e,t,n,A){j.call(this,e);var i=A.get("dragging",!1);function o(c){var l=c.source,B=c.target,g=c.parent;if(g){var p,E;f(c,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(l,B)||(E=!0),n.canConnectMessageFlow(l,B)&&(p="bpmn:MessageFlow")),f(c,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(l,B)||(E=!0),n.canConnectSequenceFlow(l,B)&&(p="bpmn:SequenceFlow")),E&&t.removeConnection(c),p&&t.connect(l,B,{type:p,waypoints:c.waypoints.slice()})}}function r(c){var l=c.context,B=l.connection,g=l.newSource||B.source,p=l.newTarget||B.target,E,d;E=n.canConnect(g,p),!(!E||E.type===B.type)&&(d=t.connect(g,p,{type:E.type,associationDirection:E.associationDirection,waypoints:B.waypoints.slice()}),B.parent&&t.removeConnection(B),l.connection=d,i&&a(B,d))}function a(c,l){var B=i.context(),g=B&&B.payload.previousSelection,p;!g||!g.length||(p=g.indexOf(c),p!==-1&&g.splice(p,1,l))}this.postExecuted("elements.move",function(c){var l=c.closure,B=l.allConnections;U(B,o)},!0),this.preExecute("connection.reconnect",r),this.postExecuted("element.updateProperties",function(c){var l=c.context,B=l.properties,g=l.element,p=g.businessObject,E;B.default&&(E=m0(g.outgoing,Z2({id:g.businessObject.default.id})),E&&t.updateProperties(E,{conditionExpression:void 0})),B.conditionExpression&&p.sourceRef.default===p&&t.updateProperties(g.source,{default:void 0})})}W(js,j),js.$inject=["eventBus","modeling","bpmnRules","injector"];function Cr(e,t,n,A,i,o){A.invoke(j,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(r){var a=r.context,c=a.parent,l=a.elements,B=F2(l,function(g,p){var E=t.canReplace([p],p.host||p.parent||c);return E?g.concat(E.replacements):g},[]);B.length&&this._replaceElements(l,B)},this),this.postExecuted(["elements.move"],500,function(r){var a=r.context,c=a.newParent,l=a.newHost,B=[];U(a.closure.topLevel,function(p){h2(p)?B=B.concat(p.children):B=B.concat(p)}),B.length===1&&l&&(c=l);var g=t.canReplace(B,c);g&&this._replaceElements(B,g.replacements,l)},this),this.postExecute(["shape.replace"],1500,function(r){var a=r.context,c=a.oldShape,l=a.newShape,B=c.attachers,g;B&&B.length&&(g=t.canReplace(B,l),this._replaceElements(B,g.replacements))},this),this.postExecuted(["shape.replace"],1500,function(r){var a=r.context,c=a.oldShape,l=a.newShape;i.unclaimId(c.businessObject.id,c.businessObject),i.updateProperties(l,{id:c.id})})}W(Cr,j),Cr.prototype._replaceElements=function(e,t){var n=this._elementRegistry,A=this._bpmnReplace,i=this._selection;U(t,function(o){var r={type:o.newElementType},a=n.get(o.oldElementId),c=e.indexOf(a);e[c]=A.replaceElement(a,r,{select:!1})}),t&&i.select(e)},Cr.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var KI=1500,ZI={width:140,height:120},Vs={width:300,height:60},Ls={width:60,height:300},Mr={width:300,height:150},Dr={width:150,height:300},gE={width:140,height:120},pE={width:50,height:30};function EE(e){e.on("resize.start",KI,function(t){var n=t.context,A=n.shape,i=n.direction,o=n.balanced;(f(A,"bpmn:Lane")||f(A,"bpmn:Participant"))&&(n.resizeConstraints=nF(A,i,o)),f(A,"bpmn:SubProcess")&&E0(A)&&(n.minDimensions=gE),f(A,"bpmn:TextAnnotation")&&(n.minDimensions=pE)})}EE.$inject=["eventBus"];var Ut=Math.abs,qI=Math.min,$I=Math.max;function dE(e,t,n,A){var i=e[t];e[t]=i===void 0?n:A(n,i)}function aA(e,t,n){return dE(e,t,n,qI)}function cA(e,t,n){return dE(e,t,n,$I)}var eF={top:20,left:50,right:20,bottom:20},tF={top:50,left:20,right:20,bottom:20};function nF(e,t,n){var A=re(e),i=!0,o=!0,r=dr(A,[A]),a=e0(e),c={},l={},B=l2(e),g=B?Vs:Ls;/n/.test(t)?l.top=a.bottom-g.height:/e/.test(t)?l.right=a.left+g.width:/s/.test(t)?l.bottom=a.top+g.height:/w/.test(t)&&(l.left=a.right-g.width),r.forEach(function(d){var u=e0(d);B?(u.top<a.top-10&&(i=!1),u.bottom>a.bottom+10&&(o=!1)):(u.left<a.left-10&&(i=!1),u.right>a.right+10&&(o=!1)),/n/.test(t)&&(n&&Ut(a.top-u.bottom)<10&&cA(c,"top",u.top+g.height),Ut(a.top-u.top)<5&&aA(l,"top",u.bottom-g.height)),/e/.test(t)&&(n&&Ut(a.right-u.left)<10&&aA(c,"right",u.right-g.width),Ut(a.right-u.right)<5&&cA(l,"right",u.left+g.width)),/s/.test(t)&&(n&&Ut(a.bottom-u.top)<10&&aA(c,"bottom",u.bottom-g.height),Ut(a.bottom-u.bottom)<5&&cA(l,"bottom",u.top+g.height)),/w/.test(t)&&(n&&Ut(a.left-u.right)<10&&cA(c,"left",u.left+g.width),Ut(a.left-u.left)<5&&aA(l,"left",u.right-g.width))});var p=A.children.filter(function(d){return!d.hidden&&!d.waypoints&&(f(d,"bpmn:FlowElement")||f(d,"bpmn:Artifact"))}),E=B?eF:tF;return p.forEach(function(d){var u=e0(d);/n/.test(t)&&(!B||i)&&aA(l,"top",u.top-E.top),/e/.test(t)&&(B||o)&&cA(l,"right",u.right+E.right),/s/.test(t)&&(!B||o)&&cA(l,"bottom",u.bottom+E.bottom),/w/.test(t)&&(B||i)&&aA(l,"left",u.left-E.left)}),{min:l,max:c}}var uE=1001;function QE(e,t){e.on("resize.start",uE+500,function(n){var A=n.context,i=A.shape;(f(i,"bpmn:Lane")||f(i,"bpmn:Participant"))&&(A.balanced=!Wn(n))}),e.on("resize.end",uE,function(n){var A=n.context,i=A.shape,o=A.canExecute,r=A.newBounds;if(f(i,"bpmn:Lane")||f(i,"bpmn:Participant"))return o&&(r=zB(r),t.resizeLane(i,r,A.balanced)),!1})}QE.$inject=["eventBus","modeling"];var AF=500;function Ws(e,t,n,A,i){n.invoke(j,this);function o(B){return a0(B,["bpmn:ReceiveTask","bpmn:SendTask"])||iF(B,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function r(B){var g=e.getDefinitions(),p=g.get("rootElements");return!!m0(p,Z2({id:B.id}))}function a(B){if(f(B,"bpmn:ErrorEventDefinition"))return"errorRef";if(f(B,"bpmn:EscalationEventDefinition"))return"escalationRef";if(f(B,"bpmn:MessageEventDefinition"))return"messageRef";if(f(B,"bpmn:SignalEventDefinition"))return"signalRef"}function c(B){if(a0(B,["bpmn:ReceiveTask","bpmn:SendTask"]))return B.get("messageRef");var g=B.get("eventDefinitions"),p=g[0];return p.get(a(p))}function l(B,g){if(a0(B,["bpmn:ReceiveTask","bpmn:SendTask"]))return B.set("messageRef",g);var p=B.get("eventDefinitions"),E=p[0];return E.set(a(E),g)}this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(B){var g=B.shape||B.element;if(o(g)){var p=P(g),E=c(p),d;E&&!r(E)&&(d=e.getDefinitions().get("rootElements"),o2(d,E),B.addedRootElement=E)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(B){var g=B.addedRootElement;if(g){var p=e.getDefinitions().get("rootElements");X0(p,g)}},!0),t.on("copyPaste.copyElement",function(B){var g=B.descriptor,p=B.element;if(!(p.labelTarget||!o(p))){var E=P(p),d=c(E);d&&(g.referencedRootElement=d)}}),t.on("copyPaste.pasteElement",AF,function(B){var g=B.descriptor,p=g.businessObject,E=g.referencedRootElement;E&&(r(E)||(E=A.copyElement(E,i.create(E.$type))),l(p,E),delete g.referencedRootElement)})}Ws.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],W(Ws,j);function iF(e,t){return n0(t)||(t=[t]),ue(t,function(n){return jn(e,n)})}var hE=Math.max;function wE(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,A=t.axis,i=t.start,o={};return U(n,function(r){var a=r.id;f(r,"bpmn:Participant")&&(o[a]=rF(r,A,i)),f(r,"bpmn:Lane")&&(o[a]=l2(r)?Vs:Ls),f(r,"bpmn:SubProcess")&&E0(r)&&(o[a]=gE),f(r,"bpmn:TextAnnotation")&&(o[a]=pE),f(r,"bpmn:Group")&&(o[a]=ZI)}),o})}wE.$inject=["eventBus"];function oF(e){return e==="x"}function rF(e,t,n){var A=l2(e);if(!sF(e))return A?Mr:Dr;var i=oF(t),o={};return i?A?o=Mr:o={width:cF(e,n,i),height:Dr.height}:A?o={width:Mr.width,height:aF(e,n,i)}:o=Dr,o}function aF(e,t,n){var A;return A=lF(e,t,n),hE(Mr.height,A)}function cF(e,t,n){var A;return A=BF(e,t,n),hE(Dr.width,A)}function sF(e){return!!it(e).length}function lF(e,t,n){var A=it(e),i;return i=_s(A,t,n),e.height-i.height+Vs.height}function BF(e,t,n){var A=it(e),i;return i=_s(A,t,n),e.width-i.width+Ls.width}function _s(e,t,n){var A,i,o;for(A=0;A<e.length;A++)if(i=e[A],!n&&t>=i.y&&t<=i.y+i.height||n&&t>=i.x&&t<=i.x+i.width)return o=it(i),o.length?_s(o,t,n):i}var mE=400,gF=600,fE={x:180,y:160};function Nt(e,t,n,A,i,o,r){j.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=A,this._bpmnFactory=i,this._bpmnjs=o,this._elementRegistry=r;var a=this;function c(g){return f(g,"bpmn:SubProcess")&&!E0(g)}function l(g){var p=g.shape,E=g.newRootElement,d=P(p);E=a._addDiagram(E||d),g.newRootElement=e.addRootElement(E)}function B(g){var p=g.shape,E=P(p);a._removeDiagram(E);var d=g.newRootElement=r.get($e(E));e.removeRootElement(d)}this.executed("shape.create",function(g){var p=g.shape;c(p)&&l(g)},!0),this.postExecuted("shape.create",function(g){var p=g.shape,E=g.newRootElement;!E||!p.children||(a._showRecursively(p.children),a._moveChildrenToShape(p,E))},!0),this.reverted("shape.create",function(g){var p=g.shape;c(p)&&B(g)},!0),this.preExecuted("shape.delete",function(g){var p=g.shape;if(c(p)){var E=r.get($e(p));E&&n.removeElements(E.children.slice())}},!0),this.executed("shape.delete",function(g){var p=g.shape;c(p)&&B(g)},!0),this.reverted("shape.delete",function(g){var p=g.shape;c(p)&&l(g)},!0),this.preExecuted("shape.replace",function(g){var p=g.oldShape,E=g.newShape;!c(p)||!c(E)||(g.oldRoot=e.removeRootElement($e(p)))},!0),this.postExecuted("shape.replace",function(g){var p=g.newShape,E=g.oldRoot,d=e.findRoot($e(p));if(!(!E||!d)){var u=E.children;n.moveElements(u,{x:0,y:0},d)}},!0),this.executed("element.updateProperties",function(g){var p=g.element;if(f(p,"bpmn:SubProcess")){var E=g.properties,d=g.oldProperties,u=d.id,h=E.id;if(u!==h){if(zo(p)){r.updateId(p,sn(h)),r.updateId(u,h);return}var D=r.get(sn(u));D&&r.updateId(sn(u),sn(h))}}},!0),this.reverted("element.updateProperties",function(g){var p=g.element;if(f(p,"bpmn:SubProcess")){var E=g.properties,d=g.oldProperties,u=d.id,h=E.id;if(u!==h){if(zo(p)){r.updateId(p,sn(u)),r.updateId(h,u);return}var D=r.get(sn(h));D&&r.updateId(D,sn(u))}}},!0),t.on("element.changed",function(g){var p=g.element;if(zo(p)){var E=p,d=r.get(bg(E));!d||d===E||t.fire("element.changed",{element:d})}}),this.executed("shape.toggleCollapse",mE,function(g){var p=g.shape;f(p,"bpmn:SubProcess")&&(E0(p)?B(g):(l(g),a._showRecursively(p.children)))},!0),this.reverted("shape.toggleCollapse",mE,function(g){var p=g.shape;f(p,"bpmn:SubProcess")&&(E0(p)?B(g):(l(g),a._showRecursively(p.children)))},!0),this.postExecuted("shape.toggleCollapse",gF,function(g){var p=g.shape;if(f(p,"bpmn:SubProcess")){var E=g.newRootElement;E&&(E0(p)?a._moveChildrenToShape(E,p):a._moveChildrenToShape(p,E))}},!0),t.on("copyPaste.createTree",function(g){var p=g.element,E=g.children;if(c(p)){var d=$e(p),u=r.get(d);u&&E.push.apply(E,u.children)}}),t.on("copyPaste.copyElement",function(g){var p=g.descriptor,E=g.element,d=g.elements,u=E.parent,h=f(Q0(u),"bpmndi:BPMNPlane");if(h){var D=bg(u),y=m0(d,function(C){return C.id===D});y&&(p.parent=y.id)}}),t.on("copyPaste.pasteElement",function(g){var p=g.descriptor;p.parent&&(c(p.parent)||p.parent.hidden)&&(p.hidden=!0)})}W(Nt,j),Nt.prototype._moveChildrenToShape=function(e,t){var n=this._modeling,A=e.children,i;if(A){A=A.concat(A.reduce(function(l,B){return B.label&&B.label.parent!==e?l.concat(B.label):l},[]));var o=A.filter(function(l){return!l.hidden});if(!o.length){n.moveElements(A,{x:0,y:0},t,{autoResize:!1});return}var r=i2(o);if(!t.x)i={x:fE.x-r.x,y:fE.y-r.y};else{var a=i0(t),c=i0(r);i={x:a.x-c.x,y:a.y-c.y}}n.moveElements(A,i,t,{autoResize:!1})}},Nt.prototype._showRecursively=function(e,t){var n=this,A=[];return e.forEach(function(i){i.hidden=!!t,A=A.concat(i),i.children&&(A=A.concat(n._showRecursively(i.children,i.collapsed||t)))}),A},Nt.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},Nt.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,A=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),i=t.create("bpmndi:BPMNDiagram",{plane:A});A.$parent=i;var o=n.createRoot({id:$e(e),type:e.$type,di:A,businessObject:e,collapsed:!0});return o},Nt.prototype._removeDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams,A=m0(n,function(i){return i.plane.bpmnElement.id===e.id});return n.splice(n.indexOf(A),1),A},Nt.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function Os(e,t){e.invoke(j,this),this.postExecuted("shape.replace",function(n){var A=n.context.oldShape,i=n.context.newShape;if(!(!f(i,"bpmn:SubProcess")||f(i,"bpmn:AdHocSubProcess")||!(f(A,"bpmn:Task")||f(A,"bpmn:CallActivity"))||!E0(i))){var o=pF(i);t.createShape({type:"bpmn:StartEvent"},o,i)}})}Os.$inject=["injector","modeling"],W(Os,j);function pF(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function Xs(e){j.call(this,e),this.preExecute("connection.create",function(t){const{target:n}=t;f(n,"bpmn:TextAnnotation")&&(t.parent=n.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(t){const n=t.shapes||[t.shape];n.length===1&&f(n[0],"bpmn:TextAnnotation")&&(t.hints=t.hints||{},t.hints.autoResize=!1)},!0)}W(Xs,j),Xs.$inject=["eventBus"];function Ks(e,t){j.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var A=n.shape;if(E0(A))return;var i=YA(A);i.forEach(function(r){var a=r.incoming.slice(),c=r.outgoing.slice();U(a,function(l){o(l,!0)}),U(c,function(l){o(l,!1)})});function o(r,a){i.indexOf(r.source)!==-1&&i.indexOf(r.target)!==-1||(a?t.reconnectEnd(r,A,i0(A)):t.reconnectStart(r,A,i0(A)))}},!0)}W(Ks,j),Ks.$inject=["eventBus","modeling"];var Zs=500;function qs(e,t,n){j.call(this,e);function A(r){r.length&&r.forEach(function(a){a.type==="label"&&!a.businessObject.name&&(a.hidden=!0)})}function i(r,a){var c=r.children,l=a,B,g;return B=EF(c).concat([r]),g=H4(B),g?(l.width=Math.max(g.width,l.width),l.height=Math.max(g.height,l.height),l.x=g.x+(g.width-l.width)/2,l.y=g.y+(g.height-l.height)/2):(l.x=r.x+(r.width-l.width)/2,l.y=r.y+(r.height-l.height)/2),l}function o(r,a){return{x:r.x+(r.width-a.width)/2,y:r.y+(r.height-a.height)/2,width:a.width,height:a.height}}this.executed(["shape.toggleCollapse"],Zs,function(r){var a=r.context,c=a.shape;f(c,"bpmn:SubProcess")&&(c.collapsed?Q0(c).isExpanded=!1:(A(c.children),Q0(c).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],Zs,function(r){var a=r.context,c=a.shape;c.collapsed?Q0(c).isExpanded=!1:Q0(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],Zs,function(r){var a=r.context.shape,c=t.getDefaultSize(a),l;a.collapsed?l=o(a,c):l=i(a,c),n.resizeShape(a,l,null,{autoResize:a.collapsed?!1:"nwse"})})}W(qs,j),qs.$inject=["eventBus","elementFactory","modeling"];function EF(e){return e.filter(function(t){return!t.hidden})}function $s(e,t,n,A){t.invoke(j,this),this.preExecute("shape.delete",function(i){var o=i.context,r=o.shape,a=r.businessObject;f0(r)||(f(r,"bpmn:Participant")&&E0(r)&&n.ids.unclaim(a.processRef.id),A.unclaimId(a.id,a))}),this.preExecute("connection.delete",function(i){var o=i.context,r=o.connection,a=r.businessObject;A.unclaimId(a.id,a)}),this.preExecute("canvas.updateRoot",function(){var i=e.getRootElement(),o=i.businessObject;f(i,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}W($s,j),$s.$inject=["canvas","injector","moddle","modeling"];function e1(e,t){j.call(this,e),this.preExecute("connection.delete",function(n){var A=n.context,i=A.connection,o=i.source;dF(i,o)&&t.updateProperties(o,{default:null})})}W(e1,j),e1.$inject=["eventBus","modeling"];function dF(e,t){if(!f(e,"bpmn:SequenceFlow"))return!1;var n=P(t),A=P(e);return n.get("default")===A}var uF=500,QF=5e3;function t1(e,t){j.call(this,e);var n;function A(){return n=n||new hF,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 a=n.leave();return a&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null),a}var r=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(r,QF,function(a){A()}),this.postExecuted(r,uF,function(a){o()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(a){var c=a.context,l=c.shape,B=i();l.labelTarget||(f(l,"bpmn:Lane")&&B.addLane(l),f(l,"bpmn:FlowNode")&&B.addFlowNode(l))})}t1.$inject=["eventBus","modeling"],W(t1,j);function hF(){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 n1(e,t){j.call(this,e),this.postExecuted("elements.create",function(n){const A=n.context,i=A.elements;for(const o of i)wF(o)&&!fF(o)&&t.updateProperties(o,{isForCompensation:void 0})})}W(n1,j),n1.$inject=["eventBus","modeling"];function wF(e){const t=P(e);return t&&t.isForCompensation}function mF(e){return e&&f(e,"bpmn:BoundaryEvent")&&jn(e,"bpmn:CompensateEventDefinition")}function fF(e){return e.incoming.filter(n=>mF(n.source)).length>0}const CF={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","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",us],appendBehavior:["type",Qs],associationBehavior:["type",hs],attachEventBehavior:["type",cr],boundaryEventBehavior:["type",ws],compensateBoundaryEventBehaviour:["type",ms],createBehavior:["type",fs],createDataObjectBehavior:["type",Cs],createParticipantBehavior:["type",ys],dataInputAssociationBehavior:["type",Is],dataStoreBehavior:["type",Fs],deleteLaneBehavior:["type",vs],detachEventBehavior:["type",ur],dropOnFlowBehavior:["type",xs],eventBasedGatewayBehavior:["type",bs],fixHoverBehavior:["type",W4],groupBehavior:["type",Ys],importDockingFix:["type",O4],isHorizontalFix:["type",Ns],labelBehavior:["type",zs],layoutConnectionBehavior:["type",Rs],messageFlowBehavior:["type",ks],nonInterruptingBehavior:["type",Gs],removeElementBehavior:["type",Ps],removeEmbeddedLabelBoundsBehavior:["type",Hs],removeParticipantBehavior:["type",Js],replaceConnectionBehavior:["type",js],replaceElementBehaviour:["type",Cr],resizeBehavior:["type",EE],resizeLaneBehavior:["type",QE],rootElementReferenceBehavior:["type",Ws],spaceToolBehavior:["type",wE],subProcessPlaneBehavior:["type",Nt],subProcessStartEventBehavior:["type",Os],textAnnotationBehavior:["type",Xs],toggleCollapseConnectionBehaviour:["type",Ks],toggleElementCollapseBehaviour:["type",qs],unclaimIdBehavior:["type",$s],unsetDefaultFlowBehavior:["type",e1],updateFlowNodeRefsBehavior:["type",t1],setCompensationActivityAfterPasteBehavior:["type",n1]};function CE(e,t){var n=f2(e,t,-15);return n!=="intersect"?n:null}function w2(e){Ae.call(this,e)}W(w2,Ae),w2.$inject=["eventBus"],w2.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return MF(t)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,A=e.hints||{},i=A.targetParent,o=A.targetAttach;if(o)return!1;i&&(n.parent=i);try{return Ir(t,n)}finally{i&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,A=e.target;return Ir(n,A,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){var t=e.shape,n=e.newBounds;return NE(t,n)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,A=e.target;return Y0(A)&&!Fr(t,A)?!1:je(t,function(i){return Y0(i)?Ir(i.source,i.target,i):i.host?ri(i,i.host,null,n):a1(i,A,null)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,A=e.position;return ri(n,t,null,A)||YE(n,t,A)||UE(n,t)||Fr(n,t)}),this.addRule("shape.create",function(e){return a1(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return ri(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element,n=e.elements;return kE(n,t)})},w2.prototype.canConnectMessageFlow=SE,w2.prototype.canConnectSequenceFlow=TE,w2.prototype.canConnectDataAssociation=c1,w2.prototype.canConnectAssociation=zE,w2.prototype.canConnectCompensationAssociation=RE,w2.prototype.canMove=UE,w2.prototype.canAttach=ri,w2.prototype.canReplace=YE,w2.prototype.canDrop=sA,w2.prototype.canInsert=Fr,w2.prototype.canCreate=a1,w2.prototype.canConnect=Ir,w2.prototype.canResize=NE,w2.prototype.canCopy=kE;function MF(e){return A1(e)?null:a0(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function A1(e){return!e||f0(e)}function DF(e,t){return e===t}function ME(e){do{if(f(e,"bpmn:Process"))return P(e);if(f(e,"bpmn:Participant"))return P(e).processRef||P(e)}while(e=e.parent)}function i1(e){return f(e,"bpmn:TextAnnotation")}function o1(e){return f(e,"bpmn:Group")&&!e.labelTarget}function DE(e){return f(e,"bpmn:BoundaryEvent")&&ke(e,"bpmn:CompensateEventDefinition")}function yr(e){return P(e).isForCompensation}function yF(e,t){var n=ME(e),A=ME(t);return n===A}function IF(e){return f(e,"bpmn:InteractionNode")&&!f(e,"bpmn:BoundaryEvent")&&(!f(e,"bpmn:Event")||f(e,"bpmn:ThrowEvent")&&FE(e,"bpmn:MessageEventDefinition"))}function FF(e){return f(e,"bpmn:InteractionNode")&&!yr(e)&&(!f(e,"bpmn:Event")||f(e,"bpmn:CatchEvent")&&FE(e,"bpmn:MessageEventDefinition"))&&!(f(e,"bpmn:BoundaryEvent")&&!ke(e,"bpmn:MessageEventDefinition"))}function yE(e){for(var t=e;t=t.parent;){if(f(t,"bpmn:FlowElementsContainer"))return P(t);if(f(t,"bpmn:Participant"))return P(t).processRef}return null}function IE(e,t){var n=yE(e),A=yE(t);return n===A}function ke(e,t){var n=P(e);return!!m0(n.eventDefinitions||[],function(A){return f(A,t)})}function FE(e,t){var n=P(e);return(n.eventDefinitions||[]).every(function(A){return f(A,t)})}function vF(e){return f(e,"bpmn:FlowNode")&&!f(e,"bpmn:EndEvent")&&!h2(e)&&!(f(e,"bpmn:IntermediateThrowEvent")&&ke(e,"bpmn:LinkEventDefinition"))&&!DE(e)&&!yr(e)}function xF(e){return f(e,"bpmn:FlowNode")&&!f(e,"bpmn:StartEvent")&&!f(e,"bpmn:BoundaryEvent")&&!h2(e)&&!(f(e,"bpmn:IntermediateCatchEvent")&&ke(e,"bpmn:LinkEventDefinition"))&&!yr(e)}function bF(e){return f(e,"bpmn:ReceiveTask")||f(e,"bpmn:IntermediateCatchEvent")&&(ke(e,"bpmn:MessageEventDefinition")||ke(e,"bpmn:TimerEventDefinition")||ke(e,"bpmn:ConditionalEventDefinition")||ke(e,"bpmn:SignalEventDefinition"))}function YF(e){for(var t=[];e;)e=e.parent,e&&t.push(e);return t}function r1(e,t){var n=YF(t);return n.indexOf(e)!==-1}function Ir(e,t,n){if(A1(e)||A1(t))return null;if(!f(n,"bpmn:DataAssociation")){if(SE(e,t))return{type:"bpmn:MessageFlow"};if(TE(e,t))return{type:"bpmn:SequenceFlow"}}var A=c1(e,t);return A||(RE(e,t)?{type:"bpmn:Association",associationDirection:"One"}:zE(e,t)?{type:"bpmn:Association",associationDirection:"None"}:!1)}function sA(e,t){return f0(e)||o1(e)?!0:f(t,"bpmn:Participant")&&!E0(t)?!1:f(e,"bpmn:Participant")?f(t,"bpmn:Process")||f(t,"bpmn:Collaboration"):a0(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:f(e,"bpmn:Lane")?f(t,"bpmn:Participant")||f(t,"bpmn:Lane"):f(e,"bpmn:BoundaryEvent")&&!UF(e)?!1:f(e,"bpmn:FlowElement")&&!f(e,"bpmn:DataStoreReference")?f(t,"bpmn:FlowElementsContainer")?E0(t):a0(t,["bpmn:Participant","bpmn:Lane"]):f(e,"bpmn:DataStoreReference")&&f(t,"bpmn:Collaboration")?ue(P(t).get("participants"),function(n){return!!n.get("processRef")}):a0(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?a0(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):f(e,"bpmn:MessageFlow")?f(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t:!1}function UF(e){return P(e).cancelActivity&&(vE(e)||xE(e))}function NF(e){return!f0(e)&&f(e,"bpmn:BoundaryEvent")}function zF(e){return f(e,"bpmn:Lane")}function RF(e){return NF(e)||f(e,"bpmn:IntermediateThrowEvent")&&vE(e)?!0:f(e,"bpmn:IntermediateCatchEvent")&&xE(e)}function vE(e){var t=P(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function xE(e){return bE(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function bE(e,t){return t.some(function(n){return ke(e,n)})}function SF(e){return f(e,"bpmn:ReceiveTask")&&m0(e.incoming,function(t){return f(t.source,"bpmn:EventBasedGateway")})}function ri(e,t,n,A){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var i=e[0];return f0(i)||!RF(i)||h2(t)||!f(t,"bpmn:Activity")||yr(t)||A&&!CE(A,t)||SF(t)?!1:"attach"}function YE(e,t,n){if(!t)return!1;var A={replacements:[]};return U(e,function(i){h2(t)||f(i,"bpmn:StartEvent")&&i.type!=="label"&&sA(i,t)&&(NM(i)||A.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"}),(zM(i)||RM(i)||SM(i))&&A.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"}),bE(i,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&f(t,"bpmn:SubProcess")&&A.replacements.push({oldElementId:i.id,newElementType:"bpmn:StartEvent"})),f(t,"bpmn:Transaction")||ke(i,"bpmn:CancelEventDefinition")&&i.type!=="label"&&(f(i,"bpmn:EndEvent")&&sA(i,t)&&A.replacements.push({oldElementId:i.id,newElementType:"bpmn:EndEvent"}),f(i,"bpmn:BoundaryEvent")&&ri(i,t,null,n)&&A.replacements.push({oldElementId:i.id,newElementType:"bpmn:BoundaryEvent"}))}),A.replacements.length?A:!1}function UE(e,t){return ue(e,zF)?!1:t?e.every(function(n){return sA(n,t)}):!0}function a1(e,t,n,A){return t?f0(e)||o1(e)?!0:DF(n,t)||n&&r1(n,t)?!1:sA(e,t)||Fr(e,t):!1}function NE(e,t){return f(e,"bpmn:SubProcess")?E0(e)&&(!t||t.width>=100&&t.height>=80):!!(f(e,"bpmn:Lane")||f(e,"bpmn:Participant")||i1(e)||o1(e))}function TF(e,t){var n=i1(e),A=i1(t);return(n||A)&&n!==A}function zE(e,t){return r1(t,e)||r1(e,t)?!1:TF(e,t)?!0:!!c1(e,t)}function RE(e,t){return IE(e,t)&&DE(e)&&f(t,"bpmn:Activity")&&!GF(t,e)&&!h2(t)}function SE(e,t){return GE(e)&&!GE(t)?!1:IF(e)&&FF(t)&&!yF(e,t)}function TE(e,t){return vF(e)&&xF(t)&&IE(e,t)&&!(f(e,"bpmn:EventBasedGateway")&&!bF(t))}function c1(e,t){return a0(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&a0(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:a0(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&a0(e,["bpmn:Activity","bpmn:CatchEvent"])?{type:"bpmn:DataOutputAssociation"}:!1}function Fr(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:a0(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!f0(t)&&f(e,"bpmn:FlowNode")&&!f(e,"bpmn:BoundaryEvent")&&sA(e,t.parent)}function kF(e,t){return e&&t&&e.indexOf(t)!==-1}function kE(e,t){return f0(t)?!0:!(f(t,"bpmn:Lane")&&!kF(e,t.parent))}function GE(e){return $n(e,"bpmn:Process")||$n(e,"bpmn:Collaboration")}function GF(e,t){return e.attachers.includes(t)}const HF={__depends__:[Te],__init__:["bpmnRules"],bpmnRules:["type",w2]};var PF=2e3;function HE(e,t){e.on("saveXML.start",PF,n);function n(){var A=t.getRootElements();U(A,function(i){var o=Q0(i),r,a;r=YA([i],!1),r=l0(r,function(c){return c!==i&&!c.labelTarget}),a=B2(r,Q0),o.set("planeElement",a)})}}HE.$inject=["eventBus","canvas"];const JF={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",HE]};function vr(e){j.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var A=n.context,i=A.shape||A.connection,o=A.parent,r=t.getOrdering(i,o);r&&(r.parent!==void 0&&(A.parent=r.parent),A.parentIndex=r.index)}),this.preExecute(["shape.move","connection.move"],function(n){var A=n.context,i=A.shape||A.connection,o=A.newParent||i.parent,r=t.getOrdering(i,o);r&&(r.parent!==void 0&&(A.newParent=r.parent),A.newParentIndex=r.index)})}vr.prototype.getOrdering=function(e,t){return null},W(vr,j);function s1(e,t){vr.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 A(r){if(r.labelTarget)return{level:10};var a=m0(n,function(c){return a0(r,[c.type])});return a&&a.order||{level:1}}function i(r){var a=r.order;if(a||(r.order=a=A(r)),!a)throw new Error(`no order for <${r.id}>`);return a}function o(r,a,c){for(var l=a;l&&!a0(l,c);)l=l.parent;if(!l)throw new Error(`no parent for <${r.id}> in <${a&&a.id}>`);return l}this.getOrdering=function(r,a){if(r.labelTarget||f(r,"bpmn:TextAnnotation"))return{parent:t.findRoot(a)||t.getRootElement(),index:-1};var c=i(r);c.containers&&(a=o(r,a,c.containers));var l=a.children.indexOf(r),B=qa(a.children,function(g){return!r.labelTarget&&g.labelTarget?!1:c.level<i(g).level});return B!==-1&&l!==-1&&l<B&&(B-=1),{index:B,parent:a}}}s1.$inject=["eventBus","canvas"],W(s1,vr);const jF={__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",s1]};function ai(){}ai.prototype.get=function(){return this._data},ai.prototype.set=function(e){this._data=e},ai.prototype.clear=function(){var e=this._data;return delete this._data,e},ai.prototype.isEmpty=function(){return!this._data};const VF={clipboard:["type",ai]};var LF="drop-ok",PE="drop-not-ok",JE="attach-ok",jE="new-parent",VE="create",WF=2e3;function LE(e,t,n,A,i){function o(c,l,B,g,p){if(!l)return!1;c=l0(c,function(y){var C=y.labelTarget;return!y.parent&&!(f0(y)&&c.indexOf(C)!==-1)});var E=m0(c,function(y){return!Y0(y)}),d=!1,u=!1,h=!1;_E(c)&&(d=i.allowed("shape.attach",{position:B,shape:E,target:l})),d||(_E(c)?h=i.allowed("shape.create",{position:B,shape:E,source:g,target:l}):h=i.allowed("elements.create",{elements:c,position:B,target:l}));var D=p.connectionTarget;return h||d?(E&&g&&(u=i.allowed("connection.create",{source:D===g?E:g,target:D===g?g:E,hints:{targetParent:l,targetAttach:d}})),{attach:d,connect:u}):h===null||d===null?null:!1}function r(c,l){[JE,LF,PE,jE].forEach(function(B){B===l?e.addMarker(c,B):e.removeMarker(c,B)})}n.on(["create.move","create.hover"],function(c){var l=c.context,B=l.elements,g=c.hover,p=l.source,E=l.hints||{};if(!g){l.canExecute=!1,l.target=null;return}WE(c);var d={x:c.x,y:c.y},u=l.canExecute=g&&o(B,g,d,p,E);g&&u!==null&&(l.target=g,u&&u.attach?r(g,JE):r(g,u?jE:PE))}),n.on(["create.end","create.out","create.cleanup"],function(c){var l=c.hover;l&&r(l,null)}),n.on("create.end",function(c){var l=c.context,B=l.source,g=l.shape,p=l.elements,E=l.target,d=l.canExecute,u=d&&d.attach,h=d&&d.connect,D=l.hints||{};if(d===!1||!E)return!1;WE(c);var y={x:c.x,y:c.y};h?g=A.appendShape(B,g,y,E,{attach:u,connection:h===!0?{}:h,connectionTarget:D.connectionTarget}):(p=A.createElements(p,y,E,N({},D,{attach:u})),g=m0(p,function(C){return!Y0(C)})),N(l,{elements:p,shape:g}),N(c,{elements:p,shape:g})});function a(){var c=t.context();c&&c.prefix===VE&&t.cancel()}n.on("create.init",function(){n.on("elements.changed",a),n.once(["create.cancel","create.end"],WF,function(){n.off("elements.changed",a)})}),this.start=function(c,l,B){n0(l)||(l=[l]);var g=m0(l,function(d){return!Y0(d)});if(g){B=N({elements:l,hints:{},shape:g},B||{}),U(l,function(d){A0(d.x)||(d.x=0),A0(d.y)||(d.y=0)});var p=l0(l,function(d){return!d.hidden}),E=i2(p);U(l,function(d){Y0(d)&&(d.waypoints=B2(d.waypoints,function(u){return{x:u.x-E.x-E.width/2,y:u.y-E.y-E.height/2}})),N(d,{x:d.x-E.x-E.width/2,y:d.y-E.y-E.height/2})}),t.init(c,VE,{cursor:"grabbing",autoActivate:!0,data:{shape:g,elements:l,context:B}})}}}LE.$inject=["canvas","dragging","eventBus","modeling","rules"];function WE(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 _E(e){return e&&e.length===1&&!Y0(e[0])}var _F=750;function OE(e,t,n,A,i){function o(r){var a=g0("g");q(a,i.cls("djs-drag-group",["no-events"]));var c=g0("g");return r.forEach(function(l){var B;l.hidden||(l.waypoints?(B=n._createContainer("connection",c),n.drawConnection(Mt(B),l)):(B=n._createContainer("shape",c),n.drawShape(Mt(B),l),Q2(B,l.x,l.y)),A.addDragger(l,a,B))}),a}t.on("create.move",_F,function(r){var a=r.hover,c=r.context,l=c.elements,B=c.dragGroup;B||(B=c.dragGroup=o(l));var g;a?(B.parentNode||(g=e.getActiveLayer(),h0(g,B)),Q2(B,r.x,r.y)):s2(B)}),t.on("create.cleanup",function(r){var a=r.context,c=a.dragGroup;c&&s2(c)})}OE.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const xr={__depends__:[nt,AA,Te,Ce],__init__:["create","createPreview"],create:["type",LE],createPreview:["type",OE]};function l1(e){var t=this;this._lastMoveEvent=null;function n(A){t._lastMoveEvent=A}e.on("canvas.init",function(A){var i=t._svg=A.svg;i.addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}l1.$inject=["eventBus"],l1.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||OF(0,0)};function OF(e,t){var n=document.createEvent("MouseEvent"),A=e,i=t,o=e,r=t;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,A,i,o,r,!1,!1,!1,!1,0,null),n}const ci={__init__:["mouse"],mouse:["type",l1]};function De(e,t,n,A,i,o,r,a){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=A,this._eventBus=i,this._modeling=o,this._mouse=r,this._rules=a,i.on("copyPaste.copyElement",function(c){var l=c.descriptor,B=c.element,g=c.elements;l.priority=1,l.id=B.id;var p=m0(g,function(E){return E===B.parent});p&&(l.parent=B.parent.id),XF(B)&&(l.priority=2,l.host=B.host.id),Y0(B)&&(l.priority=3,l.source=B.source.id,l.target=B.target.id,l.waypoints=KF(B)),f0(B)&&(l.priority=4,l.labelTarget=B.labelTarget.id),U(["x","y","width","height"],function(E){A0(B[E])&&(l[E]=B[E])}),l.hidden=B.hidden,l.collapsed=B.collapsed}),i.on("copyPaste.pasteElements",function(c){var l=c.hints;N(l,{createElementsBehavior:!1})})}De.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],De.prototype.copy=function(e){var t,n;return n0(e)||(e=e?[e]:[]),t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}),t===!1?n={}:n=this.createTree(n0(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},De.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var A=this._createElements(t);if(e&&e.element&&e.point)return this._paste(A,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),A,{hints:n||{}})}},De.prototype._paste=function(e,t,n,A){U(e,function(o){A0(o.x)||(o.x=0),A0(o.y)||(o.y=0)});var i=i2(e);return U(e,function(o){Y0(o)&&(o.waypoints=B2(o.waypoints,function(r){return{x:r.x-i.x-i.width/2,y:r.y-i.y-i.height/2}})),N(o,{x:o.x-i.x-i.width/2,y:o.y-i.y-i.height/2})}),this._modeling.createElements(e,n,t,N({},A))},De.prototype._createElements=function(e){var t=this,n=this._eventBus,A={},i=[];return U(e,function(o,r){o=Qe(o,"priority"),U(o,function(a){var c=N({},he(a,["priority"]));A[a.parent]?c.parent=A[a.parent]:delete c.parent,n.fire("copyPaste.pasteElement",{cache:A,descriptor:c});var l;if(Y0(c)){c.source=A[a.source],c.target=A[a.target],l=A[a.id]=t.createConnection(c),i.push(l);return}if(f0(c)){c.labelTarget=A[c.labelTarget],l=A[a.id]=t.createLabel(c),i.push(l);return}c.host&&(c.host=A[c.host]),l=A[a.id]=t.createShape(c),i.push(l)})}),i},De.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(he(e,["id"]));return t},De.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(he(e,["id"]));return t},De.prototype.createShape=function(e){var t=this._elementFactory.createShape(he(e,["id"]));return t},De.prototype.hasRelations=function(e,t){var n,A,i;return!(Y0(e)&&(A=m0(t,Z2({id:e.source.id})),i=m0(t,Z2({id:e.target.id})),!A||!i)||f0(e)&&(n=m0(t,Z2({id:e.labelTarget.id})),!n))},De.prototype.createTree=function(e){var t=this._rules,n=this,A={},i=[],o=Bo(e);function r(l,B){return t.allowed("element.copy",{element:l,elements:B})}function a(l,B){var g=m0(i,function(p){return l===p.element});if(!g){i.push({element:l,depth:B});return}g.depth<B&&(i=c(g,i),i.push({element:g.element,depth:B}))}function c(l,B){var g=B.indexOf(l);return g!==-1&&B.splice(g,1),B}return nn(o,function(l,B,g){if(f0(l))return;U(l.labels,function(d){a(d,g)});function p(d){d&&d.length&&U(d,function(u){U(u.labels,function(h){a(h,g)}),a(u,g)})}U([l.attachers,l.incoming,l.outgoing],p),a(l,g);var E=[];return l.children&&(E=l.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:l,children:E}),E}),e=B2(i,function(l){return l.element}),i=B2(i,function(l){return l.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:l.descriptor,element:l.element,elements:e}),l}),i=Qe(i,function(l){return l.descriptor.priority}),e=B2(i,function(l){return l.element}),U(i,function(l){var B=l.depth;if(!n.hasRelations(l.element,e)){KE(l.element,e);return}if(!r(l.element,e)){KE(l.element,e);return}A[B]||(A[B]=[]),A[B].push(l.descriptor)}),A};function XF(e){return!!e.host}function KF(e){return B2(e.waypoints,function(t){return t=XE(t),t.original&&(t.original=XE(t.original)),t})}function XE(e){return N({},e)}function KE(e,t){var n=t.indexOf(e);return n===-1?t:t.splice(n,1)}const ZF={__depends__:[VF,xr,ci,Te],__init__:["copyPaste"],copyPaste:["type",De]};function B1(e,t,n){n0(n)||(n=[n]),U(n,function(A){Je(e[A])||(t[A]=e[A])})}var g1=750;function ZE(e,t,n){function A(c,l){var B=e.create(c.$type);return n.copyElement(c,B,null,l)}t.on("copyPaste.copyElement",g1,function(c){var l=c.descriptor,B=c.element,g=P(B);if(f0(B))return l;var p=l.businessObject=A(g,!0),E=l.di=A(Q0(B),!0);E.bpmnElement=p,B1(p,l,"name"),B1(E,l,"isExpanded"),g.default&&(l.default=g.default.id)});var i="-bpmn-js-refs";function o(c){return c[i]=c[i]||{}}function r(c,l){c[i]=l}function a(c,l,B){var g=P(c);return c.default&&(B[c.default]={element:g,property:"default"}),c.host&&(P(c).attachedToRef=P(l[c.host])),he(B,F2(B,function(p,E,d){var u=E.element,h=E.property;return d===c.id&&(u.set(h,g),p.push(c.id)),p},[]))}t.on("copyPaste.pasteElement",function(c){var l=c.cache,B=c.descriptor,g=B.businessObject,p=B.di;if(f0(B)){B.businessObject=P(l[B.labelTarget]),B.di=Q0(l[B.labelTarget]);return}g=B.businessObject=A(g),p=B.di=A(p),p.bpmnElement=g,B1(B,g,["isExpanded","name"]),B.type=g.$type}),t.on("copyPaste.copyElement",g1,function(c){var l=c.descriptor,B=c.element;if(f(B,"bpmn:Participant")){var g=P(B);g.processRef&&(l.processRef=A(g.processRef,!0))}}),t.on("copyPaste.pasteElement",function(c){var l=c.descriptor,B=l.processRef;B&&(l.processRef=A(B))}),t.on("copyPaste.pasteElement",g1,function(c){var l=c.cache,B=c.descriptor;r(l,a(B,l,o(l)))})}ZE.$inject=["bpmnFactory","eventBus","moddleCopy"];const qF=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"],$F=["errorRef","escalationRef","messageRef","signalRef"];function si(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",A=>{const{propertyNames:i}=A;if(!(!i||!i.length))return Qe(i,o=>o==="extensionElements")}),e.on("moddleCopy.canCopyProperty",A=>{const{parent:i,property:o,propertyName:r}=A,a=V0(i)&&i.$descriptor;if(r&&$F.includes(r))return o;if(r&&qF.includes(r)||r&&a&&!m0(a.properties,Z2({name:r})))return!1}),e.on("moddleCopy.canSetCopiedProperty",A=>{const{property:i}=A;if(f(i,"bpmn:ExtensionElements")&&(!i.values||!i.values.length))return!1})}si.$inject=["eventBus","bpmnFactory","moddle"],si.prototype.copyElement=function(e,t,n,A=!1){n&&!n0(n)&&(n=[n]),n=n||p1(e.$descriptor);const i=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:A});return i===!1||(n0(i)&&(n=i),U(n,o=>{let r;I2(e,o)&&(r=e.get(o));const a=this.copyProperty(r,t,o,A);!a2(a)||this._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:a,propertyName:o})===!1||t.set(o,a)})),t},si.prototype.copyProperty=function(e,t,n,A=!1){let i=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:A});if(i===!1)return;if(i)return V0(i)&&i.$type&&!i.$parent&&(i.$parent=t),i;const o=this._moddle.getPropertyDescriptor(t,n);if(!o.isReference)return o.isId?e&&this._copyId(e,t,A):n0(e)?F2(e,(r,a)=>{const c=this.copyProperty(a,t,n,A);return c?r.concat(c):r},[]):V0(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,A),i):e},si.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 p1(e,t){return F2(e.properties,(n,A)=>t&&A.default?n:n.concat(A.name),[])}const qE={__depends__:[ZF],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",ZE],moddleCopy:["type",si]};var $E=Math.round;function E1(e,t){this._modeling=e,this._eventBus=t}E1.$inject=["modeling","eventBus"],E1.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var A=this._modeling,i=this._eventBus;i.fire("replace.start",{element:e,attrs:t,hints:n});var o=t.width||e.width,r=t.height||e.height,a=t.x||e.x,c=t.y||e.y,l=$E(a+o/2),B=$E(c+r/2),g=A.replaceShape(e,N({},t,{x:l,y:B,width:o,height:r}),n);return i.fire("replace.end",{element:e,newElement:g,hints:n}),g};function e3(e,t){t.on("replace.end",500,function(n){const{newElement:A,hints:i={}}=n;i.select!==!1&&e.select(A)})}e3.$inject=["selection","eventBus"];const e8={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",e3],replace:["type",E1]};function t8(e,t,n){n0(n)||(n=[n]),U(n,function(A){Je(e[A])||(t[A]=e[A])})}var n8=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function A8(e,t){var n=e&&I2(e,"collapsed")?e.collapsed:!E0(e),A;return t&&(I2(t,"collapsed")||I2(t,"isExpanded"))?A=I2(t,"collapsed")?t.collapsed:!t.isExpanded:A=n,n!==A}function t3(e,t,n,A,i,o){function r(a,c,l){l=l||{};var B=c.type,g=a.businessObject;if(br(g)&&(B==="bpmn:SubProcess"||B==="bpmn:AdHocSubProcess")&&A8(a,c))return A.toggleCollapse(a),a;var p=e.create(B),E={type:B,businessObject:p};E.di={},B==="bpmn:ExclusiveGateway"&&(E.di.isMarkerVisible=!0),t8(a.di,E.di,["fill","stroke","background-color","border-color","color"]);var d=p1(g.$descriptor),u=p1(p.$descriptor,!0),h=i8(d,u);N(p,q2(c,n8));var D=l0(h,function(m){return m==="eventDefinitions"?n3(a,c.eventDefinitionType):m==="loopCharacteristics"?!h2(p):I2(p,m)||m==="processRef"&&c.isExpanded===!1||m==="triggeredByEvent"?!1:m==="isForCompensation"?!h2(p):!0});if(p=n.copyElement(g,p,D),c.eventDefinitionType&&(n3(p,c.eventDefinitionType)||(E.eventDefinitionType=c.eventDefinitionType,E.eventDefinitionAttrs=c.eventDefinitionAttrs)),f(g,"bpmn:Activity")){if(br(g))E.isExpanded=E0(a);else if(c&&I2(c,"isExpanded")){E.isExpanded=c.isExpanded;var y=t.getDefaultSize(p,{isExpanded:E.isExpanded});E.width=y.width,E.height=y.height,E.x=a.x-(E.width-a.width)/2,E.y=a.y-(E.height-a.height)/2}E0(a)&&!f(g,"bpmn:Task")&&E.isExpanded&&(E.width=a.width,E.height=a.height)}if(br(g)&&!br(p)&&(l.moveChildren=!1),f(g,"bpmn:Participant")){c.isExpanded===!0?p.processRef=e.create("bpmn:Process"):l.moveChildren=!1;var C=l2(a);Q0(a).isHorizontal||(Q0(E).isHorizontal=C),E.width=C?a.width:t.getDefaultSize(E).width,E.height=C?t.getDefaultSize(E).height:a.height}return o.allowed("shape.resize",{shape:p})||(E.height=t.getDefaultSize(E).height,E.width=t.getDefaultSize(E).width),p.name=g.name,a0(g,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&a0(p,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(p.default=g.default),c.host&&!f(g,"bpmn:BoundaryEvent")&&f(p,"bpmn:BoundaryEvent")&&(E.host=c.host),(E.type==="bpmn:DataStoreReference"||E.type==="bpmn:DataObjectReference")&&(E.x=a.x+(a.width-E.width)/2),i.replaceElement(a,E,{...l,targetElement:c})}this.replaceElement=r}t3.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];function br(e){return f(e,"bpmn:SubProcess")}function n3(e,t){var n=P(e);return t&&n.get("eventDefinitions").some(function(A){return f(A,t)})}function i8(e,t){return e.filter(function(n){return t.includes(n)})}const A3={__depends__:[qE,e8,Ce],bpmnReplace:["type",t3]};var o8=250;function un(e){this._eventBus=e,this._tools=[],this._active=null}un.$inject=["eventBus"],un.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)},un.prototype.isActive=function(e){return e&&this._active===e},un.prototype.length=function(e){return this._tools.length},un.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},un.prototype.bindEvents=function(e,t){var n=this._eventBus,A=[];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),U(t,function(i){A.push(i+".ended"),A.push(i+".canceled")}),n.on(A,o8,function(i){this._active&&(r8(i)||this.setActive(null))},this)};function r8(e){var t=e.originalEvent&&e.originalEvent.target;return t&&Sn(t,'.group[data-group="tools"]')}const Yr={__depends__:[nt],__init__:["toolManager"],toolManager:["type",un]};function a8(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 c8(e,t){var n=[];return U(e.concat(t),function(A){var i=A.incoming,o=A.outgoing;U(i.concat(o),function(r){var a=r.source,c=r.target;(li(e,a)||li(e,c)||li(t,a)||li(t,c))&&(li(n,r)||n.push(r))})}),n}function li(e,t){return e.indexOf(t)!==-1}function s8(e,t,n){var A=e.x,i=e.y,o=e.width,r=e.height,a=n.x,c=n.y;switch(t){case"n":return{x:A,y:i+c,width:o,height:r-c};case"s":return{x:A,y:i,width:o,height:r+c};case"w":return{x:A+a,y:i,width:o-a,height:r};case"e":return{x:A,y:i,width:o+a,height:r};default:throw new Error("unknown direction: "+t)}}var d1=Math.abs,l8=Math.round,ot={x:"width",y:"height"},i3="crosshair",zt={n:"top",w:"left",s:"bottom",e:"right"},B8=1500,Ur={n:"s",w:"e",s:"n",e:"w"},Nr=20;function ae(e,t,n,A,i,o,r){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=A,this._rules=i,this._toolManager=o,this._mouse=r;var a=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(c){n.once("spaceTool.selection.ended",function(){a.activateMakeSpace(c.originalEvent)})}),n.on("spaceTool.move",B8,function(c){var l=c.context,B=l.initialized;B||(B=l.initialized=a.init(c,l)),B&&r3(c)}),n.on("spaceTool.end",function(c){var l=c.context,B=l.axis,g=l.direction,p=l.movingShapes,E=l.resizingShapes,d=l.start;if(l.initialized){r3(c);var u={x:0,y:0};u[B]=l8(c["d"+B]),a.makeSpace(p,E,u,g,d),n.once("spaceTool.ended",function(h){a.activateSelection(h.originalEvent,!0,!0)})}})}ae.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],ae.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:i3,data:{context:{reactivate:n}},trapClick:!1})},ae.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:i3,data:{context:{}}})},ae.prototype.makeSpace=function(e,t,n,A,i){return this._modeling.createSpace(e,t,n,A,i)},ae.prototype.init=function(e,t){var n=d1(e.dx)>d1(e.dy)?"x":"y",A=e["d"+n],i=e[n]-A;if(d1(A)<5)return!1;A<0&&(A*=-1),Wn(e)&&(A*=-1);var o=a8(n,A),r=this._canvas.getRootElement();!So(e)&&e.hover&&(r=e.hover);var a=[...YA(r,!0),...r.attachers||[]],c=this.calculateAdjustments(a,n,A,i),l=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:i}),B=g8(c,n,o,i,l);return N(t,c,{axis:n,direction:o,spaceToolConstraints:B,start:i}),Ho("resize-"+(n==="x"?"ew":"ns")),!0},ae.prototype.calculateAdjustments=function(e,t,n,A){var i=this._rules,o=[],r=[],a=[],c=[];function l(p){o.includes(p)||o.push(p);var E=p.label;E&&!o.includes(E)&&o.push(E)}function B(p){r.includes(p)||r.push(p)}U(e,function(p){if(!(!p.parent||f0(p))){if(Y0(p)){c.push(p);return}var E=p[t],d=E+p[ot[t]];if(p8(p)&&(n>0&&i0(p)[t]>A||n<0&&i0(p)[t]<A)){a.push(p);return}if(n>0&&E>A||n<0&&d<A){l(p);return}if(E<A&&d>A&&i.allowed("shape.resize",{shape:p})){B(p);return}}}),U(o,function(p){var E=p.attachers;E&&U(E,function(d){l(d)})});var g=o.concat(r);return U(a,function(p){var E=p.host;Qn(g,E)&&l(p)}),g=o.concat(r),U(c,function(p){var E=p.source,d=p.target,u=p.label;Qn(g,E)&&Qn(g,d)&&u&&l(u)}),{movingShapes:o,resizingShapes:r}},ae.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},ae.prototype.isActive=function(){var e=this._dragging.context();return e?/^spaceTool/.test(e.prefix):!1};function o3(e){return{top:e.top-Nr,right:e.right+Nr,bottom:e.bottom+Nr,left:e.left-Nr}}function r3(e){var t=e.context,n=t.spaceToolConstraints;if(n){var A,i;A0(n.left)&&(A=Math.max(e.x,n.left),e.dx=e.dx+A-e.x,e.x=A),A0(n.right)&&(A=Math.min(e.x,n.right),e.dx=e.dx+A-e.x,e.x=A),A0(n.top)&&(i=Math.max(e.y,n.top),e.dy=e.dy+i-e.y,e.y=i),A0(n.bottom)&&(i=Math.min(e.y,n.bottom),e.dy=e.dy+i-e.y,e.y=i)}}function g8(e,t,n,A,i){var o=e.movingShapes,r=e.resizingShapes;if(r.length){var a={},c,l;return U(r,function(B){var g=B.attachers,p=B.children,E=e0(B),d=l0(p,function(R){return!Y0(R)&&!f0(R)&&!Qn(o,R)&&!Qn(r,R)}),u=l0(p,function(R){return!Y0(R)&&!f0(R)&&Qn(o,R)}),h,D,y,C=[],m=[],I,x,v,F;d.length&&(D=o3(e0(i2(d))),h=A-E[zt[n]]+D[zt[n]],n==="n"?a.bottom=l=A0(l)?Math.min(l,h):h:n==="w"?a.right=l=A0(l)?Math.min(l,h):h:n==="s"?a.top=c=A0(c)?Math.max(c,h):h:n==="e"&&(a.left=c=A0(c)?Math.max(c,h):h)),u.length&&(y=o3(e0(i2(u))),h=A-y[zt[Ur[n]]]+E[zt[Ur[n]]],n==="n"?a.bottom=l=A0(l)?Math.min(l,h):h:n==="w"?a.right=l=A0(l)?Math.min(l,h):h:n==="s"?a.top=c=A0(c)?Math.max(c,h):h:n==="e"&&(a.left=c=A0(c)?Math.max(c,h):h)),g&&g.length&&(g.forEach(function(R){Qn(o,R)?C.push(R):m.push(R)}),C.length&&(I=e0(i2(C.map(i0))),x=E[zt[Ur[n]]]-(I[zt[Ur[n]]]-A)),m.length&&(v=e0(i2(m.map(i0))),F=v[zt[n]]-(E[zt[n]]-A)),n==="n"?(h=Math.min(x||1/0,F||1/0),a.bottom=l=A0(l)?Math.min(l,h):h):n==="w"?(h=Math.min(x||1/0,F||1/0),a.right=l=A0(l)?Math.min(l,h):h):n==="s"?(h=Math.max(x||-1/0,F||-1/0),a.top=c=A0(c)?Math.max(c,h):h):n==="e"&&(h=Math.max(x||-1/0,F||-1/0),a.left=c=A0(c)?Math.max(c,h):h));var z=i&&i[B.id];z&&(n==="n"?(h=A+B[ot[t]]-z[ot[t]],a.bottom=l=A0(l)?Math.min(l,h):h):n==="w"?(h=A+B[ot[t]]-z[ot[t]],a.right=l=A0(l)?Math.min(l,h):h):n==="s"?(h=A-B[ot[t]]+z[ot[t]],a.top=c=A0(c)?Math.max(c,h):h):n==="e"&&(h=A-B[ot[t]]+z[ot[t]],a.left=c=A0(c)?Math.max(c,h):h))}),a}}function Qn(e,t){return e.indexOf(t)!==-1}function p8(e){return!!e.host}var u1="djs-dragging",a3="djs-resizing",E8=250,zr=Math.max;function c3(e,t,n,A,i){function o(r,a){U(r,function(c){i.addDragger(c,a),n.addMarker(c,u1)})}e.on("spaceTool.selection.start",function(r){var a=n.getLayer("space"),c=r.context,l={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},B=g0("g");q(B,A.cls("djs-crosshair-group",["no-events"])),h0(a,B);var g=g0("path");q(g,"d",l.x),D0(g).add("djs-crosshair"),h0(B,g);var p=g0("path");q(p,"d",l.y),D0(p).add("djs-crosshair"),h0(B,p),c.crosshairGroup=B}),e.on("spaceTool.selection.move",function(r){var a=r.context.crosshairGroup;Q2(a,r.x,r.y)}),e.on("spaceTool.selection.cleanup",function(r){var a=r.context,c=a.crosshairGroup;c&&s2(c)}),e.on("spaceTool.move",E8,function(r){var a=r.context,c=a.line,l=a.axis,B=a.movingShapes,g=a.resizingShapes;if(a.initialized){if(!a.dragGroup){var p=n.getLayer("space");c=g0("path"),q(c,"d","M0,0 L0,0"),D0(c).add("djs-crosshair"),h0(p,c),a.line=c;var E=g0("g");q(E,A.cls("djs-drag-group",["no-events"])),h0(n.getActiveLayer(),E),o(B,E);var d=a.movingConnections=t.filter(function(m){var I=!1;U(B,function(z){U(z.outgoing,function(R){m===R&&(I=!0)})});var x=!1;U(B,function(z){U(z.incoming,function(R){m===R&&(x=!0)})});var v=!1;U(g,function(z){U(z.outgoing,function(R){m===R&&(v=!0)})});var F=!1;return U(g,function(z){U(z.incoming,function(R){m===R&&(F=!0)})}),Y0(m)&&(I||v)&&(x||F)});o(d,E),a.dragGroup=E}if(!a.frameGroup){var u=g0("g");q(u,A.cls("djs-frame-group",["no-events"])),h0(n.getActiveLayer(),u);var h=[];U(g,function(m){var I=i.addFrame(m,u),x=I.getBBox();h.push({element:I,initialBounds:x}),n.addMarker(m,a3)}),a.frameGroup=u,a.frames=h}var D={x:"M"+r.x+", -10000 L"+r.x+", 10000",y:"M -10000, "+r.y+" L 10000, "+r.y};q(c,{d:D[l]});var y={x:"y",y:"x"},C={x:r.dx,y:r.dy};C[y[a.axis]]=0,Q2(a.dragGroup,C.x,C.y),U(a.frames,function(m){var I=m.element,x=m.initialBounds,v,F;a.direction==="e"?q(I,{width:zr(x.width+C.x,5)}):(v=zr(x.width-C.x,5),q(I,{width:v,x:x.x+x.width-v})),a.direction==="s"?q(I,{height:zr(x.height+C.y,5)}):(F=zr(x.height-C.y,5),q(I,{height:F,y:x.y+x.height-F}))})}}),e.on("spaceTool.cleanup",function(r){var a=r.context,c=a.movingShapes,l=a.movingConnections,B=a.resizingShapes,g=a.line,p=a.dragGroup,E=a.frameGroup;U(c,function(d){n.removeMarker(d,u1)}),U(l,function(d){n.removeMarker(d,u1)}),p&&(s2(g),s2(p)),U(B,function(d){n.removeMarker(d,a3)}),E&&s2(E)})}c3.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const d8={__init__:["spaceToolPreview"],__depends__:[nt,Te,Yr,AA,ci],spaceTool:["type",ae],spaceToolPreview:["type",c3]};function Rr(e,t){e.invoke(ae,this),this._canvas=t}Rr.$inject=["injector","canvas"],W(Rr,ae),Rr.prototype.calculateAdjustments=function(e,t,n,A){var i=this._canvas.getRootElement(),o=e[0]===i?null:e[0],r=[];o&&(r=FA(hB(i.children.filter(l=>f(l,"bpmn:Artifact")),i2(o))));const a=[...e,...r];var c=ae.prototype.calculateAdjustments.call(this,a,t,n,A);return c.resizingShapes=c.resizingShapes.filter(function(l){return!(f(l,"bpmn:TextAnnotation")||u8(l)&&(t==="y"&&l2(l)||t==="x"&&!l2(l)))}),c};function u8(e){return f(e,"bpmn:Participant")&&!P(e).processRef}const s3={__depends__:[d8],spaceTool:["type",Rr]};function J0(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)}J0.$inject=["eventBus","injector"],J0.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},J0.prototype.canExecute=function(e,t){const n={command:e,context:t},A=this._getHandler(e);let i=this._fire(e,"canExecute",n);if(i===void 0){if(!A)return!1;A.canExecute&&(i=A.canExecute(t))}return i},J0.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},J0.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()}},J0.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()}},J0.prototype.register=function(e,t){this._setHandler(e,t)},J0.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},J0.prototype.canUndo=function(){return!!this._getUndoAction()},J0.prototype.canRedo=function(){return!!this._getRedoAction()},J0.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},J0.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},J0.prototype._internalUndo=function(e){const t=e.command,n=e.context,A=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),A.revert&&this._markDirty(A.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)})},J0.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const A=t?[e+"."+t,t]:[e];let i;n=this._eventBus.createEvent(n);for(const o of A)if(i=this._eventBus.fire("commandStack."+o,n),n.cancelBubble)break;return i},J0.prototype._createId=function(){return this._uid++},J0.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},J0.prototype._internalExecute=function(e,t){const n=e.command,A=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(A),this._fire(n,"preExecuted",e)),this._atomicDo(()=>{this._fire(n,"execute",e),i.execute&&this._markDirty(i.execute(A)),this._executedAction(e,t),this._fire(n,"executed",e)}),t||(this._fire(n,"postExecute",e),i.postExecute&&i.postExecute(A),this._fire(n,"postExecuted",e)),this._popAction()},J0.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,A=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=A&&A.id||this._createId()),n.push(e)},J0.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,A=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:$a("id",A.reverse())}),A.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},J0.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=n0(e)?e:[e],t.dirty=t.dirty.concat(e))},J0.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},J0.prototype._revertedAction=function(e){this._stackIdx--},J0.prototype._getHandler=function(e){return this._handlerMap[e]},J0.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const Q8={commandStack:["type",J0]};function Rt(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}var h8=250,l3=1400;function Q1(e,t,n){j.call(this,t);var A=e.get("movePreview",!1);t.on("shape.move.start",l3,function(i){var o=i.context,r=o.shapes,a=o.validatedShapes;o.shapes=B3(r),o.validatedShapes=B3(a)}),A&&t.on("shape.move.start",h8,function(i){var o=i.context,r=o.shapes,a=[];U(r,function(c){U(c.labels,function(l){!l.hidden&&o.shapes.indexOf(l)===-1&&a.push(l),c.labelTarget&&a.push(c)})}),U(a,function(c){A.makeDraggable(o,c,!0)})}),this.preExecuted("elements.move",l3,function(i){var o=i.context,r=o.closure,a=r.enclosedElements,c=[];U(a,function(l){U(l.labels,function(B){a[B.id]||c.push(B)})}),r.addAll(c)}),this.preExecute(["connection.delete","shape.delete"],function(i){var o=i.context,r=o.connection||o.shape;Rt(r.labels,function(a){n.removeShape(a,{nested:!0})})}),this.execute("shape.delete",function(i){var o=i.context,r=o.shape,a=r.labelTarget;a&&(o.labelTargetIndex=Ec(a.labels,r),o.labelTarget=a,r.labelTarget=null)}),this.revert("shape.delete",function(i){var o=i.context,r=o.shape,a=o.labelTarget,c=o.labelTargetIndex;a&&(o2(a.labels,r,c),r.labelTarget=a)})}W(Q1,j),Q1.$inject=["injector","eventBus","modeling"];function B3(e){return l0(e,function(t){return e.indexOf(t.labelTarget)===-1})}const w8={__init__:["labelSupport"],labelSupport:["type",Q1]};var m8=251,g3=1401,p3="attach-ok";function h1(e,t,n,A,i){j.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",g3,function(r){var a=r.context,c=a.shapes,l=a.validatedShapes;a.shapes=f8(c),a.validatedShapes=C8(l)}),o&&t.on("shape.move.start",m8,function(r){var a=r.context,c=a.shapes,l=w1(c);U(l,function(B){o.makeDraggable(a,B,!0),U(B.labels,function(g){o.makeDraggable(a,g,!0)})})}),o&&t.on("shape.move.start",function(r){var a=r.context,c=a.shapes;if(c.length===1){var l=c[0],B=l.host;B&&(n.addMarker(B,p3),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(B,p3)}))}}),this.preExecuted("elements.move",g3,function(r){var a=r.context,c=a.closure,l=a.shapes,B=w1(l);U(B,function(g){c.add(g,c.topLevel[g.host.id])})}),this.postExecuted("elements.move",function(r){var a=r.context,c=a.shapes,l=a.newHost,B;l&&c.length!==1||(l?B=c:B=l0(c,function(g){var p=g.host;return M8(g)&&!D8(c,p)}),U(B,function(g){i.updateAttachment(g,l)}))}),this.postExecuted("elements.move",function(r){var a=r.context.shapes;U(a,function(c){U(c.attachers,function(l){U(l.outgoing.slice(),function(B){var g=A.allowed("connection.reconnect",{connection:B,source:B.source,target:B.target});g||i.removeConnection(B)}),U(l.incoming.slice(),function(B){var g=A.allowed("connection.reconnect",{connection:B,source:B.source,target:B.target});g||i.removeConnection(B)})})})}),this.postExecute("shape.create",function(r){var a=r.context,c=a.shape,l=a.host;l&&i.updateAttachment(c,l)}),this.postExecute("shape.replace",function(r){var a=r.context,c=a.oldShape,l=a.newShape;Rt(c.attachers,function(B){var g=A.allowed("elements.move",{target:l,shapes:[B]});g==="attach"?i.updateAttachment(B,l):i.removeShape(B)}),l.attachers.length&&U(l.attachers,function(B){var g=oE(B,c,l);i.moveShape(B,g,B.parent)})}),this.postExecute("shape.resize",function(r){var a=r.context,c=a.shape,l=a.oldBounds,B=a.newBounds,g=c.attachers,p=a.hints||{};p.attachSupport!==!1&&U(g,function(E){var d=oE(E,l,B);i.moveShape(E,d,E.parent),U(E.labels,function(u){i.moveShape(u,d,u.parent)})})}),this.preExecute("shape.delete",function(r){var a=r.context.shape;Rt(a.attachers,function(c){i.removeShape(c)}),a.host&&i.updateAttachment(a,null)})}W(h1,j),h1.$inject=["injector","eventBus","canvas","rules","modeling"];function w1(e){return no(B2(e,function(t){return t.attachers||[]}))}function f8(e){var t=w1(e);return Ol("id",e,t)}function C8(e){var t=Ve(e,"id");return l0(e,function(n){for(;n;){if(n.host&&t[n.host.id])return!1;n=n.parent}return!0})}function M8(e){return!!e.host}function D8(e,t){return e.indexOf(t)!==-1}const y8={__depends__:[Te],__init__:["attachSupport"],attachSupport:["type",h1]};function ce(e){this._model=e}ce.$inject=["moddle"],ce.prototype._needsId=function(e){return a0(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"])},ce.prototype._ensureId=function(e){if(e.id){this._model.ids.claim(e.id,e);return}var t;f(e,"bpmn:Activity")?t="Activity":f(e,"bpmn:Event")?t="Event":f(e,"bpmn:Gateway")?t="Gateway":a0(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))},ce.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},ce.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},ce.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",N({bpmnElement:e,bounds:this.createDiBounds()},t))},ce.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},ce.prototype.createDiWaypoints=function(e){var t=this;return B2(e,function(n){return t.createDiWaypoint(n)})},ce.prototype.createDiWaypoint=function(e){return this.create("dc:Point",q2(e,["x","y"]))},ce.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",N({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},ce.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",N({bpmnElement:e},t))};function H2(e,t,n){j.call(this,e),this._bpmnFactory=t;var A=this;function i(E){var d=E.context,u=d.hints||{},h;!d.cropped&&u.createElementsBehavior!==!1&&(h=d.connection,h.waypoints=n.getCroppedWaypoints(h),d.cropped=!0)}this.executed(["connection.layout","connection.create"],i),this.reverted(["connection.layout"],function(E){delete E.context.cropped});function o(E){var d=E.context;A.updateParent(d.shape||d.connection,d.oldParent)}function r(E){var d=E.context,u=d.shape||d.connection,h=d.parent||d.newParent;A.updateParent(u,h)}this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],P2(o)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],P2(r));function a(E){var d=E.context,u=d.oldRoot,h=u.children;U(h,function(D){f(D,"bpmn:BaseElement")&&A.updateParent(D)})}this.executed(["canvas.updateRoot"],a),this.reverted(["canvas.updateRoot"],a);function c(E){var d=E.context.shape;f(d,"bpmn:BaseElement")&&A.updateBounds(d)}this.executed(["shape.move","shape.create","shape.resize"],P2(function(E){E.context.shape.type!=="label"&&c(E)})),this.reverted(["shape.move","shape.create","shape.resize"],P2(function(E){E.context.shape.type!=="label"&&c(E)})),e.on("shape.changed",function(E){E.element.type==="label"&&c({context:{shape:E.element}})});function l(E){A.updateConnection(E.context)}this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],P2(l)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],P2(l));function B(E){A.updateConnectionWaypoints(E.context.connection)}this.executed(["connection.layout","connection.move","connection.updateWaypoints"],P2(B)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],P2(B)),this.executed("connection.reconnect",P2(function(E){var d=E.context,u=d.connection,h=d.oldSource,D=d.newSource,y=P(u),C=P(h),m=P(D);y.conditionExpression&&!a0(m,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(d.oldConditionExpression=y.conditionExpression,delete y.conditionExpression),h!==D&&C.default===y&&(d.oldDefault=C.default,delete C.default)})),this.reverted("connection.reconnect",P2(function(E){var d=E.context,u=d.connection,h=d.oldSource,D=d.newSource,y=P(u),C=P(h),m=P(D);d.oldConditionExpression&&(y.conditionExpression=d.oldConditionExpression),d.oldDefault&&(C.default=d.oldDefault,delete m.default)}));function g(E){A.updateAttachment(E.context)}this.executed(["element.updateAttachment"],P2(g)),this.reverted(["element.updateAttachment"],P2(g)),this.executed("element.updateLabel",P2(p)),this.reverted("element.updateLabel",P2(p));function p(E){const{element:d}=E.context,u=fe(d),h=Q0(d),D=h&&h.get("label");an(d)||zo(d)||(u&&!D?h.set("label",t.create("bpmndi:BPMNLabel")):!u&&D&&h.set("label",void 0))}}W(H2,j),H2.$inject=["eventBus","bpmnFactory","connectionDocking"],H2.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,A=t.host;n.attachedToRef=A&&A.businessObject},H2.prototype.updateParent=function(e,t){if(!f0(e)&&!(f(e,"bpmn:DataStoreReference")&&e.parent&&f(e.parent,"bpmn:Collaboration"))){var n=e.parent,A=e.businessObject,i=Q0(e),o=n&&n.businessObject,r=Q0(n);f(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(A,o,t&&t.businessObject),f(e,"bpmn:DataOutputAssociation")&&(e.source?o=e.source.businessObject:o=null),f(e,"bpmn:DataInputAssociation")&&(e.target?o=e.target.businessObject:o=null),this.updateSemanticParent(A,o),f(e,"bpmn:DataObjectReference")&&A.dataObjectRef&&this.updateSemanticParent(A.dataObjectRef,o),this.updateDiParent(i,r)}},H2.prototype.updateBounds=function(e){var t=Q0(e),n=F8(e);if(n){var A=Me(n,t.get("bounds"));N(n,{x:e.x+A.x,y:e.y+A.y})}var i=f0(e)?this._getLabel(t):t,o=i.bounds;o||(o=this._bpmnFactory.createDiBounds(),i.set("bounds",o)),N(o,{x:e.x,y:e.y,width:e.width,height:e.height})},H2.prototype.updateFlowNodeRefs=function(e,t,n){if(n!==t){var A,i;f(n,"bpmn:Lane")&&(A=n.get("flowNodeRef"),X0(A,e)),f(t,"bpmn:Lane")&&(i=t.get("flowNodeRef"),o2(i,e))}},H2.prototype.updateDiConnection=function(e,t,n){var A=Q0(e),i=Q0(t),o=Q0(n);A.sourceElement&&A.sourceElement.bpmnElement!==P(t)&&(A.sourceElement=t&&i),A.targetElement&&A.targetElement.bpmnElement!==P(n)&&(A.targetElement=n&&o)},H2.prototype.updateDiParent=function(e,t){if(t&&!f(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(X0(n,e),e.$parent=null)}};function I8(e){for(;e&&!f(e,"bpmn:Definitions");)e=e.$parent;return e}H2.prototype.getLaneSet=function(e){var t,n;return f(e,"bpmn:Lane")?(t=e.childLaneSet,t||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(f(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)},H2.prototype.updateSemanticParent=function(e,t,n){var A;if(e.$parent!==t&&!((f(e,"bpmn:DataInput")||f(e,"bpmn:DataOutput"))&&(f(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),"ioSpecification"in t&&t.ioSpecification===e.$parent))){if(f(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),A="lanes";else if(f(e,"bpmn:FlowElement")){if(t){if(f(t,"bpmn:Participant"))t=t.processRef;else if(f(t,"bpmn:Lane"))do t=t.$parent.$parent;while(f(t,"bpmn:Lane"))}A="flowElements"}else if(f(e,"bpmn:Artifact")){for(;t&&!f(t,"bpmn:Process")&&!f(t,"bpmn:SubProcess")&&!f(t,"bpmn:Collaboration");)if(f(t,"bpmn:Participant")){t=t.processRef;break}else t=t.$parent;A="artifacts"}else if(f(e,"bpmn:MessageFlow"))A="messageFlows";else if(f(e,"bpmn:Participant")){A="participants";var i=e.processRef,o;i&&(o=I8(e.$parent||t),e.$parent&&(X0(o.get("rootElements"),i),i.$parent=null),t&&(o2(o.get("rootElements"),i),i.$parent=o))}else f(e,"bpmn:DataOutputAssociation")?A="dataOutputAssociations":f(e,"bpmn:DataInputAssociation")&&(A="dataInputAssociations");if(!A)throw new Error(`no parent for <${e.id}> in <${t.id}>`);var r;if(e.$parent&&(r=e.$parent.get(A),X0(r,e)),t?(r=t.get(A),r.push(e),e.$parent=t):e.$parent=null,n){var a=n.get(A);X0(r,e),t&&(a||(a=[],t.set(A,a)),a.push(e))}}},H2.prototype.updateConnectionWaypoints=function(e){var t=Q0(e);t.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},H2.prototype.updateConnection=function(e){var t=e.connection,n=P(t),A=t.source,i=P(A),o=t.target,r=P(t.target),a;if(f(n,"bpmn:DataAssociation"))f(n,"bpmn:DataInputAssociation")?(n.get("sourceRef")[0]=i,a=e.parent||e.newParent||r,this.updateSemanticParent(n,r,a)):f(n,"bpmn:DataOutputAssociation")&&(a=e.parent||e.newParent||i,this.updateSemanticParent(n,i,a),n.targetRef=r);else{var c=f(n,"bpmn:SequenceFlow");n.sourceRef!==i&&(c&&(X0(n.sourceRef&&n.sourceRef.get("outgoing"),n),i&&i.get("outgoing")&&i.get("outgoing").push(n)),n.sourceRef=i),n.targetRef!==r&&(c&&(X0(n.targetRef&&n.targetRef.get("incoming"),n),r&&r.get("incoming")&&r.get("incoming").push(n)),n.targetRef=r)}this.updateConnectionWaypoints(t),this.updateDiConnection(t,A,o)},H2.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};function P2(e){return function(t){var n=t.context,A=n.shape||n.connection||n.element;f(A,"bpmn:BaseElement")&&e(t)}}function F8(e){if(f(e,"bpmn:Activity")){var t=Q0(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}function St(e,t){Oe.call(this),this._bpmnFactory=e,this._moddle=t}W(St,Oe),St.$inject=["bpmnFactory","moddle"],St.prototype._baseCreate=Oe.prototype.create,St.prototype.create=function(e,t){if(e==="label"){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,N({type:"label",di:n},PA,t))}return this.createElement(e,t)},St.prototype.createElement=function(e,t){t=N({},t||{});var n,A=t.businessObject,i=t.di;if(!A){if(!t.type)throw new Error("no shape type specified");A=this._bpmnFactory.create(t.type),Eg(A)}if(!x8(i)){var o=N({},i||{},{id:A.id+"_di"});e==="root"?i=this._bpmnFactory.createDiPlane(A,o):e==="connection"?i=this._bpmnFactory.createDiEdge(A,o):i=this._bpmnFactory.createDiShape(A,o)}f(A,"bpmn:Group")&&(t=N({isFrame:!0},t)),t=v8(A,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=m1(i,t,"isExpanded")),a0(A,["bpmn:Lane","bpmn:Participant"])&&(t=m1(i,t,"isHorizontal")),f(A,"bpmn:SubProcess")&&(t.collapsed=!E0(A,i)),f(A,"bpmn:ExclusiveGateway")&&(I2(i,"isMarkerVisible")?i.isMarkerVisible===void 0&&(i.isMarkerVisible=!1):i.isMarkerVisible=!0),a2(t.triggeredByEvent)&&(A.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),a2(t.cancelActivity)&&(A.cancelActivity=t.cancelActivity,delete t.cancelActivity);var r,a;return t.eventDefinitionType&&(r=A.get("eventDefinitions")||[],a=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(a.condition=this._bpmnFactory.create("bpmn:FormalExpression")),r.push(a),a.$parent=A,A.eventDefinitions=r,delete t.eventDefinitionType),n=this.getDefaultSize(A,i),t=N({id:A.id},n,t,{businessObject:A,di:i}),this._baseCreate(e,t)},St.prototype.getDefaultSize=function(e,t){var n=P(e);if(t=t||Q0(e),f(n,"bpmn:SubProcess"))return E0(n,t)?{width:350,height:200}:{width:100,height:80};if(f(n,"bpmn:Task"))return{width:100,height:80};if(f(n,"bpmn:Gateway"))return{width:50,height:50};if(f(n,"bpmn:Event"))return{width:36,height:36};if(f(n,"bpmn:Participant")){var A=t.isHorizontal===void 0||t.isHorizontal===!0;return E0(n,t)?A?{width:600,height:250}:{width:250,height:600}:A?{width:400,height:60}:{width:60,height:400}}return f(n,"bpmn:Lane")?{width:400,height:100}:f(n,"bpmn:DataObjectReference")?{width:36,height:50}:f(n,"bpmn:DataStoreReference")?{width:50,height:50}:f(n,"bpmn:TextAnnotation")?{width:100,height:30}:f(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},St.prototype.createParticipantShape=function(e){return V0(e)||(e={isExpanded:e}),e=N({type:"bpmn:Participant"},e||{}),e.isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)};function v8(e,t,n){return U(n,function(A){t=m1(e,t,A)}),t}function m1(e,t,n){return t[n]===void 0?t:(e[n]=t[n],he(t,[n]))}function x8(e){return a0(e,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}function Sr(e,t){this._modeling=e,this._canvas=t}Sr.$inject=["modeling","canvas"],Sr.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,A=e.alignment;U(n,function(i){var o={x:0,y:0};a2(A.left)?o.x=A.left-i.x:a2(A.right)?o.x=A.right-i.width-i.x:a2(A.center)?o.x=A.center-Math.round(i.width/2)-i.x:a2(A.top)?o.y=A.top-i.y:a2(A.bottom)?o.y=A.bottom-i.height-i.y:a2(A.middle)&&(o.y=A.middle-Math.round(i.height/2)-i.y),t.moveElements([i],o,i.parent)})},Sr.prototype.postExecute=function(e){};function Tr(e){this._modeling=e}Tr.$inject=["modeling"],Tr.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,A=e.shape,i=e.hints||{};A=e.shape=this._modeling.createShape(A,e.position,n,{attach:i.attach}),e.shape=A},Tr.prototype.postExecute=function(e){var t=e.hints||{};b8(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 b8(e,t){return ue(e.outgoing,function(n){return n.target===t})}function kr(e,t){this._canvas=e,this._layouter=t}kr.$inject=["canvas","layouter"],kr.prototype.execute=function(e){var t=e.connection,n=e.source,A=e.target,i=e.parent,o=e.parentIndex,r=e.hints;if(!n||!A)throw new Error("source and target required");if(!i)throw new Error("parent required");return t.source=n,t.target=A,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,r)),this._canvas.addConnection(t,i,o),t},kr.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Gr=Math.round;function f1(e){this._modeling=e}f1.$inject=["modeling"],f1.prototype.preExecute=function(e){var t=e.elements,n=e.parent,A=e.parentIndex,i=e.position,o=e.hints,r=this._modeling;U(t,function(g){A0(g.x)||(g.x=0),A0(g.y)||(g.y=0)});var a=l0(t,function(g){return!g.hidden}),c=i2(a);U(t,function(g){Y0(g)&&(g.waypoints=B2(g.waypoints,function(p){return{x:Gr(p.x-c.x-c.width/2+i.x),y:Gr(p.y-c.y-c.height/2+i.y)}})),N(g,{x:Gr(g.x-c.x-c.width/2+i.x),y:Gr(g.y-c.y-c.height/2+i.y)})});var l=Bo(t),B={};U(t,function(g){if(Y0(g)){B[g.id]=A0(A)?r.createConnection(B[g.source.id],B[g.target.id],A,g,g.parent||n,o):r.createConnection(B[g.source.id],B[g.target.id],g,g.parent||n,o);return}var p=N({},o);l.indexOf(g)===-1&&(p.autoResize=!1),f0(g)&&(p=he(p,["attach"])),B[g.id]=A0(A)?r.createShape(g,q2(g,["x","y","width","height"]),g.parent||n,A,p):r.createShape(g,q2(g,["x","y","width","height"]),g.parent||n,p)}),e.elements=FA(B)};var E3=Math.round;function Tt(e){this._canvas=e}Tt.$inject=["canvas"],Tt.prototype.execute=function(e){var t=e.shape,n=e.position,A=e.parent,i=e.parentIndex;if(!A)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?N(t,n):N(t,{x:n.x-E3(t.width/2),y:n.y-E3(t.height/2)}),this._canvas.addShape(t,A,i),t},Tt.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function Bi(e){Tt.call(this,e)}W(Bi,Tt),Bi.$inject=["canvas"];var Y8=Tt.prototype.execute;Bi.prototype.execute=function(e){var t=e.shape;return N8(t),t.labelTarget=e.labelTarget,Y8.call(this,e)};var U8=Tt.prototype.revert;Bi.prototype.revert=function(e){return e.shape.labelTarget=null,U8.call(this,e)};function N8(e){["width","height"].forEach(function(t){typeof e[t]>"u"&&(e[t]=0)})}function gi(e,t){this._canvas=e,this._modeling=t}gi.$inject=["canvas","modeling"],gi.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;Rt(n.incoming,function(A){t.removeConnection(A,{nested:!0})}),Rt(n.outgoing,function(A){t.removeConnection(A,{nested:!0})})},gi.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Ec(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},gi.prototype.revert=function(e){var t=e.connection,n=e.parent,A=e.parentIndex;return t.source=e.source,t.target=e.target,o2(n.children,t,A),this._canvas.addConnection(t,n),t};function C1(e,t){this._modeling=e,this._elementRegistry=t}C1.$inject=["modeling","elementRegistry"],C1.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,A=e.elements;U(A,function(i){n.get(i.id)&&(i.waypoints?t.removeConnection(i):t.removeShape(i))})};function pi(e,t){this._canvas=e,this._modeling=t}pi.$inject=["canvas","modeling"],pi.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;Rt(n.incoming,function(A){t.removeConnection(A,{nested:!0})}),Rt(n.outgoing,function(A){t.removeConnection(A,{nested:!0})}),Rt(n.children,function(A){Y0(A)?t.removeConnection(A,{nested:!0}):t.removeShape(A,{nested:!0})})},pi.prototype.execute=function(e){var t=this._canvas,n=e.shape,A=n.parent;return e.oldParent=A,e.oldParentIndex=Ec(A.children,n),t.removeShape(n),n},pi.prototype.revert=function(e){var t=this._canvas,n=e.shape,A=e.oldParent,i=e.oldParentIndex;return o2(A.children,n,i),t.addShape(n,A),n};function Hr(e){this._modeling=e}Hr.$inject=["modeling"];var d3={x:"y",y:"x"};Hr.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,A=e.axis,i=e.dimension;function o(h,D){h.range.min=Math.min(D[A],h.range.min),h.range.max=Math.max(D[A]+D[i],h.range.max)}function r(h){return h[A]+h[i]/2}function a(h){return h.length-1}function c(h){return h.max-h.min}function l(h,D){var y={y:0};y[A]=h-r(D),y[A]&&(y[d3[A]]=0,t.moveElements([D],y,D.parent))}var B=n[0],g=a(n),p=n[g],E,d,u=0;U(n,function(h,D){var y,C,m;if(h.elements.length<2){D&&D!==n.length-1&&(o(h,h.elements[0]),u+=c(h.range));return}y=Qe(h.elements,A),C=y[0],D===g&&(C=y[a(y)]),m=r(C),h.range=null,U(y,function(I){if(l(m,I),h.range===null){h.range={min:I[A],max:I[A]+I[i]};return}o(h,I)}),D&&D!==n.length-1&&(u+=c(h.range))}),d=Math.abs(p.range.min-B.range.max),E=Math.round((d-u)/(n.length-1)),!(E<n.length-1)&&U(n,function(h,D){var y={},C;h===B||h===p||(C=n[D-1],h.range.max=0,U(h.elements,function(m,I){y[d3[A]]=0,y[A]=C.range.max-m[A]+E,h.range.min!==m[A]&&(y[A]+=m[A]-h.range.min),y[A]&&t.moveElements([m],y,m.parent),h.range.max=Math.max(m[A]+m[i],I?h.range.max:0)}))})},Hr.prototype.postExecute=function(e){};function Pr(e,t){this._layouter=e,this._canvas=t}Pr.$inject=["layouter","canvas"],Pr.prototype.execute=function(e){var t=e.connection,n=t.waypoints;return N(e,{oldWaypoints:n}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Pr.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};function M1(){}M1.prototype.execute=function(e){var t=e.connection,n=e.delta,A=e.newParent||t.parent,i=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=X0(o.children,t),o2(A.children,t,i),t.parent=A,U(t.waypoints,function(r){r.x+=n.x,r.y+=n.y,r.original&&(r.original.x+=n.x,r.original.y+=n.y)}),t},M1.prototype.revert=function(e){var t=e.connection,n=t.parent,A=e.oldParent,i=e.oldParentIndex,o=e.delta;return X0(n.children,t),o2(A.children,t,i),t.parent=A,U(t.waypoints,function(r){r.x-=o.x,r.y-=o.y,r.original&&(r.original.x-=o.x,r.original.y-=o.y)}),t};function D1(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}D1.prototype.add=function(e,t){return this.addAll([e],t)},D1.prototype.addAll=function(e,t){var n=cf(e,!!t,this);return N(this,n),this};function Ei(e){this._modeling=e}Ei.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},Ei.prototype.moveClosure=function(e,t,n,A,i){var o=this._modeling,r=e.allShapes,a=e.allConnections,c=e.enclosedConnections,l=e.topLevel,B=!1;i&&i.parent===n&&(B=!0),U(r,function(g){o.moveShape(g,t,l[g.id]&&!B&&n,{recurse:!1,layout:!1})}),U(a,function(g){var p=!!r[g.source.id],E=!!r[g.target.id];c[g.id]&&p&&E?o.moveConnection(g,t,l[g.id]&&!B&&n):o.layoutConnection(g,{connectionStart:p&&Ss(g,g.source,t),connectionEnd:E&&Ts(g,g.target,t)})})},Ei.prototype.getClosure=function(e){return new D1().addAll(e,!0)};function Jr(e){this._helper=new Ei(e)}Jr.$inject=["modeling"],Jr.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Jr.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)};function hn(e){this._modeling=e,this._helper=new Ei(e)}hn.$inject=["modeling"],hn.prototype.execute=function(e){var t=e.shape,n=e.delta,A=e.newParent||t.parent,i=e.newParentIndex,o=t.parent;return e.oldBounds=q2(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=X0(o.children,t),o2(A.children,t,i),N(t,{parent:A,x:t.x+n.x,y:t.y+n.y}),t},hn.prototype.postExecute=function(e){var t=e.shape,n=e.delta,A=e.hints,i=this._modeling;A.layout!==!1&&(U(t.incoming,function(o){i.layoutConnection(o,{connectionEnd:Ts(o,t,n)})}),U(t.outgoing,function(o){i.layoutConnection(o,{connectionStart:Ss(o,t,n)})})),A.recurse!==!1&&this.moveChildren(e)},hn.prototype.revert=function(e){var t=e.shape,n=e.oldParent,A=e.oldParentIndex,i=e.delta;return o2(n.children,t,A),N(t,{parent:n,x:t.x-i.x,y:t.y-i.y}),t},hn.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},hn.prototype.getNewParent=function(e){return e.newParent||e.shape.parent};function di(e){this._modeling=e}di.$inject=["modeling"],di.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,A=e.connection,i=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return n0(i)&&(e.oldWaypoints=A.waypoints,A.waypoints=i),t&&(e.oldSource=A.source,A.source=t),n&&(e.oldTarget=A.target,A.target=n),A},di.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,A=e.newTarget,i=e.dockingOrPoints,o=e.hints||{},r={};o.connectionStart&&(r.connectionStart=o.connectionStart),o.connectionEnd&&(r.connectionEnd=o.connectionEnd),o.layoutConnection!==!1&&(n&&(!A||o.docking==="source")&&(r.connectionStart=r.connectionStart||u3(n0(i)?i[0]:i)),A&&(!n||o.docking==="target")&&(r.connectionEnd=r.connectionEnd||u3(n0(i)?i[i.length-1]:i)),o.newWaypoints&&(r.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,r))},di.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,A=e.oldWaypoints,i=e.connection;return t&&(i.source=t),n&&(i.target=n),A&&(i.waypoints=A),i};function u3(e){return e.original||e}function rt(e,t){this._modeling=e,this._rules=t}rt.$inject=["modeling","rules"],rt.prototype.preExecute=function(e){var t=this,n=this._modeling,A=this._rules,i=e.oldShape,o=e.newData,r=e.hints||{},a;function c(d,u,h){return A.allowed("connection.reconnect",{connection:h,source:d,target:u})}var l={x:o.x,y:o.y},B={x:i.x,y:i.y,width:i.width,height:i.height};a=e.newShape=e.newShape||t.createShape(o,l,i.parent,r),i.host&&n.updateAttachment(a,i.host);var g;r.moveChildren!==!1&&(g=i.children.slice(),n.moveElements(g,{x:0,y:0},a,r));var p=i.incoming.slice(),E=i.outgoing.slice();U(p,function(d){var u=d.source,h=c(u,a,d);h&&t.reconnectEnd(d,a,mr(d,a,B),r)}),U(E,function(d){var u=d.target,h=c(a,u,d);h&&t.reconnectStart(d,a,wr(d,a,B),r)})},rt.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},rt.prototype.execute=function(e){},rt.prototype.revert=function(e){},rt.prototype.createShape=function(e,t,n,A){return this._modeling.createShape(e,t,n,A)},rt.prototype.reconnectStart=function(e,t,n,A){this._modeling.reconnectStart(e,t,n,A)},rt.prototype.reconnectEnd=function(e,t,n,A){this._modeling.reconnectEnd(e,t,n,A)};function ui(e){this._modeling=e}ui.$inject=["modeling"],ui.prototype.execute=function(e){var t=e.shape,n=e.newBounds,A=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(A&&(n.width<A.width||n.height<A.height))throw new Error("width and height cannot be less than minimum height and width");if(!A&&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},N(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},ui.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,A=e.oldBounds,i=e.hints||{};i.layout!==!1&&(U(n.incoming,function(o){t.layoutConnection(o,{connectionEnd:mr(o,n,A)})}),U(n.outgoing,function(o){t.layoutConnection(o,{connectionStart:wr(o,n,A)})}))},ui.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return N(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t};function kt(e){this._modeling=e}kt.$inject=["modeling"],kt.prototype.preExecute=function(e){var t=e.delta,n=e.direction,A=e.movingShapes,i=e.resizingShapes,o=e.start,r={};this.moveShapes(A,t),U(i,function(a){r[a.id]=R8(a)}),this.resizeShapes(i,t,n),this.updateConnectionWaypoints(c8(A,i),t,n,o,A,i,r)},kt.prototype.execute=function(){},kt.prototype.revert=function(){},kt.prototype.moveShapes=function(e,t){var n=this;U(e,function(A){n._modeling.moveShape(A,t,null,{autoResize:!1,layout:!1,recurse:!1})})},kt.prototype.resizeShapes=function(e,t,n){var A=this;U(e,function(i){var o=s8(i,n,t);A._modeling.resizeShape(i,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})},kt.prototype.updateConnectionWaypoints=function(e,t,n,A,i,o,r){var a=this,c=i.concat(o);U(e,function(l){var B=l.source,g=l.target,p=z8(l),E=h3(n),d={};Gt(c,B)&&Gt(c,g)?(p=B2(p,function(u){return w3(u,A,n)&&(u[E]=u[E]+t[E]),u.original&&w3(u.original,A,n)&&(u.original[E]=u.original[E]+t[E]),u}),a._modeling.updateWaypoints(l,p,{labelBehavior:!1})):(Gt(c,B)||Gt(c,g))&&(Gt(i,B)?d.connectionStart=Ss(l,B,t):Gt(i,g)?d.connectionEnd=Ts(l,g,t):Gt(o,B)?d.connectionStart=wr(l,B,r[B.id]):Gt(o,g)&&(d.connectionEnd=mr(l,g,r[g.id])),a._modeling.layoutConnection(l,d))})};function Q3(e){return N({},e)}function z8(e){return B2(e.waypoints,function(t){return t=Q3(t),t.original&&(t.original=Q3(t.original)),t})}function h3(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function w3(e,t,n){var A=h3(n);if(/e|s/.test(n))return e[A]>t;if(/n|w/.test(n))return e[A]<t}function Gt(e,t){return e.indexOf(t)!==-1}function R8(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}function jr(e){this._modeling=e}jr.$inject=["modeling"],jr.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=m3(n),t.collapsed=!t.collapsed;var A=f3(n,t.collapsed);return[t].concat(A)},jr.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,A=t.children,i=C3(A,n);return t.collapsed=!t.collapsed,[t].concat(i)};function m3(e){var t={};return U(e,function(n){t[n.id]=n.hidden,n.children&&(t=N({},t,m3(n.children)))}),t}function f3(e,t){var n=[];return U(e,function(A){A.hidden=t,n=n.concat(A),A.children&&(n=n.concat(f3(A.children,A.collapsed||t)))}),n}function C3(e,t){var n=[];return U(e,function(A){A.hidden=t[A.id],n=n.concat(A),A.children&&(n=n.concat(C3(A.children,t)))}),n}function Vr(e){this._modeling=e}Vr.$inject=["modeling"],Vr.prototype.execute=function(e){var t=e.shape,n=e.newHost,A=t.host;return e.oldHost=A,e.attacherIdx=M3(A,t),D3(n,t),t.host=n,t},Vr.prototype.revert=function(e){var t=e.shape,n=e.newHost,A=e.oldHost,i=e.attacherIdx;return t.host=A,M3(n,t),D3(A,t,i),t};function M3(e,t){return X0(e&&e.attachers,t)}function D3(e,t,n){if(e){var A=e.attachers;A||(e.attachers=A=[]),o2(A,t,n)}}function y1(){}y1.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},y1.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t};function U0(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var A=this;e.on("diagram.init",function(){A.registerHandlers(n)})}U0.$inject=["eventBus","elementFactory","commandStack"],U0.prototype.getHandlers=function(){return{"shape.append":Tr,"shape.create":Tt,"shape.delete":pi,"shape.move":hn,"shape.resize":ui,"shape.replace":rt,"shape.toggleCollapse":jr,spaceTool:kt,"label.create":Bi,"connection.create":kr,"connection.delete":gi,"connection.move":M1,"connection.layout":Pr,"connection.updateWaypoints":y1,"connection.reconnect":di,"elements.create":f1,"elements.move":Jr,"elements.delete":C1,"elements.distribute":Hr,"elements.align":Sr,"element.updateAttachment":Vr}},U0.prototype.registerHandlers=function(e){U(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},U0.prototype.moveShape=function(e,t,n,A,i){typeof A=="object"&&(i=A,A=null);var o={shape:e,delta:t,newParent:n,newParentIndex:A,hints:i||{}};this._commandStack.execute("shape.move",o)},U0.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},U0.prototype.moveElements=function(e,t,n,A){A=A||{};var i=A.attach,o=n,r;i===!0?(r=n,o=n.parent):i===!1&&(r=null);var a={shapes:e,delta:t,newParent:o,newHost:r,hints:A};this._commandStack.execute("elements.move",a)},U0.prototype.moveConnection=function(e,t,n,A,i){typeof A=="object"&&(i=A,A=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:A,hints:i||{}};this._commandStack.execute("connection.move",o)},U0.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},U0.prototype.createConnection=function(e,t,n,A,i,o){typeof n=="object"&&(o=i,i=A,A=n,n=void 0),A=this._create("connection",A);var r={source:e,target:t,parent:i,parentIndex:n,connection:A,hints:o};return this._commandStack.execute("connection.create",r),r.connection},U0.prototype.createShape=function(e,t,n,A,i){typeof A!="number"&&(i=A,A=void 0),i=i||{};var o=i.attach,r,a;e=this._create("shape",e),o?(r=n.parent,a=n):r=n;var c={position:t,shape:e,parent:r,parentIndex:A,host:a,hints:i};return this._commandStack.execute("shape.create",c),c.shape},U0.prototype.createElements=function(e,t,n,A,i){n0(e)||(e=[e]),typeof A!="number"&&(i=A,A=void 0),i=i||{};var o={position:t,elements:e,parent:n,parentIndex:A,hints:i};return this._commandStack.execute("elements.create",o),o.elements},U0.prototype.createLabel=function(e,t,n,A){n=this._create("label",n);var i={labelTarget:e,position:t,parent:A||e.parent,shape:n};return this._commandStack.execute("label.create",i),i.shape},U0.prototype.appendShape=function(e,t,n,A,i){i=i||{},t=this._create("shape",t);var o={source:e,position:n,target:A,shape:t,connection:i.connection,connectionParent:i.connectionParent,hints:i};return this._commandStack.execute("shape.append",o),o.shape},U0.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},U0.prototype.distributeElements=function(e,t,n){var A={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",A)},U0.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},U0.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},U0.prototype.replaceShape=function(e,t,n){var A={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",A),A.newShape},U0.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},U0.prototype.resizeShape=function(e,t,n,A){var i={shape:e,newBounds:t,minBounds:n,hints:A};this._commandStack.execute("shape.resize",i)},U0.prototype.createSpace=function(e,t,n,A,i){var o={delta:n,direction:A,movingShapes:e,resizingShapes:t,start:i};this._commandStack.execute("spaceTool",o)},U0.prototype.updateWaypoints=function(e,t,n){var A={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",A)},U0.prototype.reconnect=function(e,t,n,A,i){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:A,hints:i||{}};this._commandStack.execute("connection.reconnect",o)},U0.prototype.reconnectStart=function(e,t,n,A){A||(A={}),this.reconnect(e,t,e.target,n,N(A,{docking:"source"}))},U0.prototype.reconnectEnd=function(e,t,n,A){A||(A={}),this.reconnect(e,e.source,t,n,N(A,{docking:"target"}))},U0.prototype.connect=function(e,t,n,A){return this.createConnection(e,t,n||{},e.parent,A)},U0.prototype._create=function(e,t){return Pf(t)?t:this._elementFactory.create(e,t)},U0.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)};function Qi(e){this._elementRegistry=e}Qi.$inject=["elementRegistry"],Qi.prototype.execute=function(e){var t=e.element,n=e.moddleElement,A=e.properties;if(!n)throw new Error("<moddleElement> required");var i=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||S8(n,IA(A));return y3(n,A),e.oldProperties=o,e.changed=i,i},Qi.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,A=e.changed;return y3(n,t),A},Qi.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return f(e,"bpmn:DataObject")?T8(e,t):[]};function S8(e,t){return F2(t,function(n,A){return n[A]=e.get(A),n},{})}function y3(e,t){U(t,function(n,A){e.set(A,n)})}function T8(e,t){return t.filter(function(n){return f(n,"bpmn:DataObjectReference")&&P(n).dataObjectRef===e})}var hi="default",at="id",I3="di",k8={width:0,height:0};function wi(e,t,n,A){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=A}wi.$inject=["elementRegistry","moddle","modeling","textRenderer"],wi.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var A=this._elementRegistry,i=this._moddle.ids,o=t.businessObject,r=j8(e.properties),a=e.oldProperties||G8(t,r);return F3(r,o)&&(i.unclaim(o[at]),A.updateId(t,r[at]),i.claim(r[at],o)),hi in r&&(r[hi]&&n.push(A.get(r[hi].id)),o[hi]&&n.push(A.get(o[hi].id))),v3(t,r),e.oldProperties=a,e.changed=n,n},wi.prototype.postExecute=function(e){var t=e.element,n=t.label,A=n&&P(n).name;if(A){var i=this._textRenderer.getExternalLabelBounds(n,A);this._modeling.resizeShape(n,i,k8)}},wi.prototype.revert=function(e){var t=e.element,n=e.properties,A=e.oldProperties,i=t.businessObject,o=this._elementRegistry,r=this._moddle.ids;return v3(t,A),F3(n,i)&&(r.unclaim(n[at]),o.updateId(t,A[at]),r.claim(A[at],i)),e.changed};function F3(e,t){return at in e&&e[at]!==t[at]}function G8(e,t){var n=IA(t),A=e.businessObject,i=Q0(e);return F2(n,function(o,r){return r!==I3?o[r]=A.get(r):o[r]=H8(i,IA(t.di)),o},{})}function H8(e,t){return F2(t,function(n,A){return n[A]=e&&e.get(A),n},{})}function v3(e,t){var n=e.businessObject,A=Q0(e);U(t,function(i,o){o!==I3?n.set(o,i):A&&P8(A,i)})}function P8(e,t){U(t,function(n,A){e.set(A,n)})}var J8=["default"];function j8(e){var t=N({},e);return J8.forEach(function(n){n in e&&(t[n]=P(t[n]))}),t}function Lr(e,t){this._canvas=e,this._modeling=t}Lr.$inject=["canvas","modeling"],Lr.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,A=n.businessObject,i=t.getRootElement(),o=i.businessObject,r=o.$parent,a=Q0(i);return t.setRootElement(n),t.removeRootElement(i),o2(r.rootElements,A),A.$parent=r,X0(r.rootElements,o),o.$parent=null,i.di=null,a.bpmnElement=A,n.di=a,e.oldRoot=i,[]},Lr.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,A=n.businessObject,i=e.oldRoot,o=i.businessObject,r=A.$parent,a=Q0(n);return t.setRootElement(i),t.removeRootElement(n),X0(r.rootElements,A),A.$parent=null,o2(r.rootElements,o),o.$parent=r,n.di=null,a.bpmnElement=o,i.di=a,[]};function I1(e,t){this._modeling=e,this._spaceTool=t}I1.$inject=["modeling","spaceTool"],I1.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,A=e.shape,i=e.location,o=re(A),r=o===A,a=r?A:A.parent,c=it(a),l=l2(A);if(l?i==="left"?i="top":i==="right"&&(i="bottom"):i==="top"?i="left":i==="bottom"&&(i="right"),!c.length){var B=l?{x:A.x+oe,y:A.y,width:A.width-oe,height:A.height}:{x:A.x,y:A.y+oe,width:A.width,height:A.height-oe};n.createShape({type:"bpmn:Lane",isHorizontal:l},B,a)}var g=[];nn(o,function(m){return g.push(m),m.label&&g.push(m.label),m===A?[]:l0(m.children,function(I){return I!==A})});var p,E,d,u,h;i==="top"?(p=-120,E=A.y,d=E+10,u="n",h="y"):i==="left"?(p=-120,E=A.x,d=E+10,u="w",h="x"):i==="bottom"?(p=120,E=A.y+A.height,d=E-10,u="s",h="y"):i==="right"&&(p=120,E=A.x+A.width,d=E-10,u="e",h="x");var D=t.calculateAdjustments(g,h,p,d),y=l?{x:0,y:p}:{x:p,y:0};t.makeSpace(D.movingShapes,D.resizingShapes,y,u,d);var C=l?{x:A.x+(r?oe:0),y:E-(i==="top"?120:0),width:A.width-(r?oe:0),height:120}:{x:E-(i==="left"?120:0),y:A.y+(r?oe:0),width:120,height:A.height-(r?oe:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:l},C,a)};function F1(e){this._modeling=e}F1.$inject=["modeling"],F1.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,A=e.count,i=it(n),o=i.length;if(o>A)throw new Error(`more than <${A}> child lanes`);var r=l2(n),a=r?n.height:n.width,c=Math.round(a/A),l,B,g,p;for(p=0;p<A;p++)p===A-1?l=a-c*p:l=c,B=r?{x:n.x+oe,y:n.y+p*c,width:n.width-oe,height:l}:{x:n.x+p*c,y:n.y+oe,width:l,height:n.height-oe},p<o?t.resizeShape(i[p],B):(g={type:"bpmn:Lane",isHorizontal:r},t.createShape(g,B,n))};function mi(e,t){this._modeling=e,this._spaceTool=t}mi.$inject=["modeling","spaceTool"],mi.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds,A=e.balanced;A!==!1?this.resizeBalanced(t,n):this.resizeSpace(t,n)},mi.prototype.resizeBalanced=function(e,t){var n=this._modeling,A=QI(e,t);n.resizeShape(e,t),A.forEach(function(i){n.resizeShape(i.shape,i.newBounds)})},mi.prototype.resizeSpace=function(e,t){var n=this._spaceTool,A=e0(e),i=e0(t),o=G4(i,A),r=re(e),a=[],c=[];nn(r,function(d){return a.push(d),(f(d,"bpmn:Lane")||f(d,"bpmn:Participant"))&&c.push(d),d.children});var l,B,g,p,E;(o.bottom||o.top)&&(l=o.bottom||o.top,B=e.y+(o.bottom?e.height:0)+(o.bottom?-10:10),g=o.bottom?"s":"n",p=o.top>0||o.bottom<0?-l:l,E=n.calculateAdjustments(a,"y",p,B),n.makeSpace(E.movingShapes,E.resizingShapes,{x:0,y:l},g)),(o.left||o.right)&&(l=o.right||o.left,B=e.x+(o.right?e.width:0)+(o.right?-10:100),g=o.right?"e":"w",p=o.left>0||o.right<0?-l:l,E=n.calculateAdjustments(c,"x",p,B),n.makeSpace(E.movingShapes,E.resizingShapes,{x:l,y:0},g))};var fi="flowNodeRef",v1="lanes";function Ci(e){this._elementRegistry=e}Ci.$inject=["elementRegistry"],Ci.prototype._computeUpdates=function(e,t){var n=[],A=[],i={},o=[];function r(B,g){var p=e0(g),E={x:B.x+B.width/2,y:B.y+B.height/2};return E.x>p.left&&E.x<p.right&&E.y>p.top&&E.y<p.bottom}function a(B){n.indexOf(B)===-1&&(o.push(B),n.push(B))}function c(B){var g=re(B);return i[g.id]||(i[g.id]=dr(g)),i[g.id]}function l(B){if(!B.parent)return[];var g=c(B);return g.filter(function(p){return r(B,p)}).map(function(p){return p.businessObject})}return t.forEach(function(B){var g=re(B);if(!(!g||n.indexOf(g)!==-1)){var p=g.children.filter(function(E){return f(E,"bpmn:FlowNode")});p.forEach(a),n.push(g)}}),e.forEach(a),o.forEach(function(B){var g=B.businessObject,p=g.get(v1),E=p.slice(),d=l(B);A.push({flowNode:g,remove:E,add:d})}),t.forEach(function(B){var g=B.businessObject;B.parent||g.get(fi).forEach(function(p){A.push({flowNode:p,remove:[g],add:[]})})}),A},Ci.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach(function(n){var A=n.flowNode,i=A.get(v1);n.remove.forEach(function(o){X0(i,o),X0(o.get(fi),A)}),n.add.forEach(function(o){o2(i,o),o2(o.get(fi),A)})}),[]},Ci.prototype.revert=function(e){var t=e.updates;return t.forEach(function(n){var A=n.flowNode,i=A.get(v1);n.add.forEach(function(o){X0(i,o),X0(o.get(fi),A)}),n.remove.forEach(function(o){o2(i,o),o2(o.get(fi),A)})}),[]};function Wr(e){this._moddle=e}Wr.$inject=["moddle"],Wr.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,A=e.element,i=e.claiming;return i?t.claim(n,A):t.unclaim(n),[]},Wr.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,A=e.element,i=e.claiming;return i?t.unclaim(n):t.claim(n,A),[]};var V8={fill:void 0,stroke:void 0};function x1(e){this._commandStack=e,this._normalizeColor=function(t){if(t){if(U2(t)){var n=L8(t);if(n)return n}throw new Error(`invalid color value: ${t}`)}}}x1.$inject=["commandStack"],x1.prototype.postExecute=function(e){var t=e.elements,n=e.colors||V8,A=this,i={};"fill"in n&&N(i,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&N(i,{"border-color":this._normalizeColor(n.stroke)}),U(t,function(o){var r=Y0(o)?q2(i,["border-color"]):i,a=Q0(o);if(W8(r),f0(o))A._commandStack.execute("element.updateModdleProperties",{element:o,moddleElement:a.label,properties:{color:i["border-color"]}});else{if(!a0(a,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;A._commandStack.execute("element.updateProperties",{element:o,properties:{di:r}})}})};function L8(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 W8(e){"border-color"in e&&(e.stroke=e["border-color"]),"background-color"in e&&(e.fill=e["background-color"])}var _8={width:0,height:0};function x3(e,t,n){function A(c,l){var B=c.label||c,g=c.labelTarget||c;return PM(B,l),[B,g]}function i(c){var l=c.element,B=l.businessObject,g=c.newLabel;if(!f0(l)&&an(l)&&!Io(l)&&!b3(g)){var p=7,E=Nc(l);E={x:E.x,y:E.y+p},e.createLabel(l,E,{id:B.id+"_label",businessObject:B,di:l.di})}}function o(c){return c.oldLabel=fe(c.element),A(c.element,c.newLabel)}function r(c){return A(c.element,c.oldLabel)}function a(c){var l=c.element,B=l.label||l,g=c.newLabel,p=c.newBounds,E=c.hints||{};if(!(!f0(B)&&!f(B,"bpmn:TextAnnotation"))){if(f0(B)&&b3(g)){E.removeShape!==!1&&e.removeShape(B,{unsetLabel:!1});return}var d=fe(l);typeof p>"u"&&(p=t.getExternalLabelBounds(B,d)),p&&e.resizeShape(B,p,_8)}}this.preExecute=i,this.execute=o,this.revert=r,this.postExecute=a}x3.$inject=["modeling","textRenderer","bpmnFactory"];function b3(e){return!e||!e.trim()}function D2(e,t,n,A){U0.call(this,e,t,n),this._bpmnRules=A}W(D2,U0),D2.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],D2.prototype.getHandlers=function(){var e=U0.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=Qi,e["element.updateProperties"]=wi,e["canvas.updateRoot"]=Lr,e["lane.add"]=I1,e["lane.resize"]=mi,e["lane.split"]=F1,e["lane.updateRefs"]=Ci,e["id.updateClaim"]=Wr,e["element.setColor"]=x1,e["element.updateLabel"]=x3,e},D2.prototype.updateLabel=function(e,t,n,A){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:A||{}})},D2.prototype.connect=function(e,t,n,A){var i=this._bpmnRules;if(n||(n=i.canConnect(e,t)),!!n)return this.createConnection(e,t,n,e.parent,A)},D2.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},D2.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},D2.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},D2.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},D2.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},D2.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},D2.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},D2.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},D2.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},D2.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},D2.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})};function Y3(){}Y3.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||i0(t.source||e.source),t.connectionEnd||i0(t.target||e.target)]};var _r=20,O8=5,Or=Math.round,U3=20,X8={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function K8(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function Z8(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function N3(e,t,n){var A=f2(t,e,O8),i=n.split(":")[0],o=Or((t.x-e.x)/2+e.x),r=Or((t.y-e.y)/2+e.y),a,c,l=Z8(i,A),B=/h|r|l/.test(i),g=!1,p=!1;return l?(a=B?{x:o,y:e.y}:{x:e.x,y:r},c=B?"h:h":"v:v"):(g=K8(A,i),c=B?"h:v":"v:h",g?B?(p=r===e.y,a={x:e.x+_r*(/l/.test(i)?-1:1),y:p?r+_r:r}):(p=o===e.x,a={x:p?o+_r:o,y:e.y+_r*(/t/.test(i)?-1:1)}):a={x:o,y:r}),{waypoints:b1(e,a,c).concat(a),directions:c,turnNextDirections:p}}function q8(e,t,n){return N3(e,t,n)}function $8(e,t,n){var A=N3(t,e,z3(n));return{waypoints:A.waypoints.slice().reverse(),directions:z3(A.directions),turnNextDirections:A.turnNextDirections}}function ev(e,t){var n=e.directions.split(":")[1],A=t.directions.split(":")[0];e.turnNextDirections&&(n=n=="h"?"v":"h"),t.turnNextDirections&&(A=A=="h"?"v":"h");var i=n+":"+A,o=b1(e.waypoints[e.waypoints.length-1],t.waypoints[0],i);return{waypoints:o,directions:i}}function z3(e){return e.split(":").reverse().join(":")}function tv(e,t,n){var A=Or((t.x-e.x)/2+e.x),i=Or((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:A,y:e.y},{x:A,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 b1(e,t,n){if(n=n||"h:h",!lv(n))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(S3(n)){var A=q8(e,t,n),i=$8(e,t,n),o=ev(A,i);return[].concat(A.waypoints,o.waypoints,i.waypoints)}return tv(e,t,n)}function nv(e,t,n){var A=b1(e,t,n);return A.unshift(e),A.push(t),k3(A)}function Av(e,t,n,A,i){var o=i&&i.preferredLayouts||[],r=Wl(o,"straight")[0]||"h:h",a=X8[r]||0,c=f2(e,t,a),l=sv(c,r);n=n||i0(e),A=A||i0(t);var B=l.split(":"),g=T3(n,e,B[0],Bv(c)),p=T3(A,t,B[1],c);return nv(g,p,l)}function iv(e,t,n,A,i,o){n0(n)&&(i=n,o=A,n=i0(e),A=i0(t)),o=N({preferredLayouts:[]},o),i=i||[];var r=o.preferredLayouts,a=r.indexOf("straight")!==-1,c;return c=a&&rv(e,t,n,A,o),c||(c=o.connectionEnd&&cv(t,e,A,i),c)||(c=o.connectionStart&&av(e,t,n,i),c)?c:!o.connectionStart&&!o.connectionEnd&&i&&i.length?i:Av(e,t,n,A,o)}function ov(e,t,n){return e>=t&&e<=n}function R3(e,t,n){var A={x:"width",y:"height"};return ov(t[e],n[e],n[e]+n[A[e]])}function rv(e,t,n,A,i){var o={},r,a;return a=f2(e,t),/^(top|bottom|left|right)$/.test(a)?(/top|bottom/.test(a)&&(r="x"),/left|right/.test(a)&&(r="y"),i.preserveDocking==="target"?R3(r,A,e)?(o[r]=A[r],[{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:A.x,y:A.y}]):null:R3(r,n,t)?(o[r]=n[r],[{x:n.x,y:n.y},{x:o.x!==void 0?o.x:A.x,y:o.y!==void 0?o.y:A.y,original:{x:o.x!==void 0?o.x:A.x,y:o.y!==void 0?o.y:A.y}}]):null):null}function av(e,t,n,A){return Y1(e,t,n,A)}function cv(e,t,n,A){var i=A.slice().reverse();return i=Y1(e,t,n,i),i?i.reverse():null}function Y1(e,t,n,A){function i(B){return B.length<3?!0:B.length>4?!1:!!m0(B,function(g,p){var E=B[p-1];return E&&NA(g,E)<3})}function o(B,g,p){var E=We(g,B);switch(E){case"v":return{x:p.x,y:B.y};case"h":return{x:B.x,y:p.y}}return{x:B.x,y:B.y}}function r(B,g,p){var E;for(E=B.length-2;E!==0;E--)if(fB(B[E],g,U3)||fB(B[E],p,U3))return B.slice(E);return B}if(i(A))return null;var a=A[0],c=A.slice(),l;return c[0]=n,c[1]=o(c[1],a,n),l=r(c,e,t),l!==c&&(c=Y1(e,t,n,l)),c&&We(c)?null:c}function sv(e,t){if(S3(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 lv(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function S3(e){return e&&/t|r|b|l/.test(e)}function Bv(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 T3(e,t,n,A){if(n==="h"&&(n=/left/.test(A)?"l":"r"),n==="v"&&(n=/top/.test(A)?"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 k3(e){return e.reduce(function(t,n,A){var i=t[t.length-1],o=e[A+1];return dc(i,o,n,0)||t.push(n),t},[])}var gv=-10,pv=40,Ev={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},dv={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},U1={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},Mi={top:"t",right:"r",bottom:"b",left:"l"};function Xr(e){this._elementRegistry=e}W(Xr,Y3),Xr.prototype.layoutConnection=function(e,t){t||(t={});var n=t.source||e.source,A=t.target||e.target,i=t.waypoints||e.waypoints,o=t.connectionStart,r=t.connectionEnd,a=this._elementRegistry,c,l;if(o||(o=G3(i&&i[0],n)),r||(r=G3(i&&i[i.length-1],A)),(f(e,"bpmn:Association")||f(e,"bpmn:DataAssociation"))&&i&&!H3(n,A))return[].concat([o],i.slice(1,-1),[r]);var B=_p(n,a)?Ev:dv;return f(e,"bpmn:MessageFlow")?c=Qv(n,A,B):(f(e,"bpmn:SequenceFlow")||H3(n,A))&&(n===A?c={preferredLayouts:Mv(n,e,B)}:f(n,"bpmn:BoundaryEvent")?c={preferredLayouts:Dv(n,A,r,B)}:Di(n)||Di(A)?c={preferredLayouts:B.subProcess,preserveDocking:wv(n)}:f(n,"bpmn:Gateway")?c={preferredLayouts:B.fromGateway}:f(A,"bpmn:Gateway")?c={preferredLayouts:B.toGateway}:c={preferredLayouts:B.default}),c&&(c=N(c,t),l=k3(iv(n,A,o,r,i,c))),l||[o,r]};function uv(e){var t=e.host;return f2(i0(e),t,gv)}function Qv(e,t,n){return{preferredLayouts:n.messageFlow,preserveDocking:hv(e,t)}}function hv(e,t){return f(t,"bpmn:Participant")?"source":f(e,"bpmn:Participant")?"target":Di(t)?"source":Di(e)||f(t,"bpmn:Event")?"target":f(e,"bpmn:Event")?"source":null}function wv(e){return Di(e)?"target":"source"}function G3(e,t){return e?e.original||e:i0(t)}function H3(e,t){return f(t,"bpmn:Activity")&&f(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Di(e){return f(e,"bpmn:SubProcess")&&E0(e)}function wn(e,t){return e===t}function mv(e,t){return t.indexOf(e)!==-1}function lA(e){var t=/right|left/.exec(e);return t&&t[0]}function BA(e){var t=/top|bottom/.exec(e);return t&&t[0]}function P3(e,t){return U1[e]===t}function fv(e,t){var n=lA(e),A=U1[n];return t.indexOf(A)!==-1}function Cv(e,t){var n=BA(e),A=U1[n];return t.indexOf(A)!==-1}function J3(e){return e==="right"||e==="left"}function Mv(e,t,n){var A=t.waypoints,i=A&&A.length&&f2(A[0],e);return i==="top"?n.loop.fromTop:i==="right"?n.loop.fromRight:i==="left"?n.loop.fromLeft:n.loop.fromBottom}function Dv(e,t,n,A){var i=i0(e),o=i0(t),r=uv(e),a,c,l=wn(e.host,t),B=mv(r,["top","right","bottom","left"]),g=f2(o,i,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return l?yv(r,B,e,t,n,A):(a=Iv(r,g,B,A.isHorizontal),c=Fv(r,g,B,A.isHorizontal),[a+":"+c])}function yv(e,t,n,A,i,o){var r=t?e:o.isHorizontal?BA(e):lA(e),a=Mi[r],c;return t?J3(e)?c=j3("y",n,A,i)?"h":o.boundaryLoop.alternateHorizontalSide:c=j3("x",n,A,i)?"v":o.boundaryLoop.alternateVerticalSide:c=o.boundaryLoop.default,[a+":"+c]}function j3(e,t,n,A){var i=pv;return!(N1(e,A,n,i)||N1(e,A,{x:n.x+n.width,y:n.y+n.height},i)||N1(e,A,i0(t),i))}function N1(e,t,n,A){return Math.abs(t[e]-n[e])<A}function Iv(e,t,n,A){if(n)return Mi[e];var i=BA(e),o=lA(e),r=BA(t),a=lA(t);if(A){if(wn(i,r)||P3(o,a))return Mi[i]}else if(wn(o,a)||P3(i,r))return Mi[o];return Mi[A?o:i]}function Fv(e,t,n,A){return n?J3(e)?fv(e,t)||wn(e,t)?"h":"v":Cv(e,t)||wn(e,t)?"v":"h":A?wn(BA(e),BA(t))?"h":"v":wn(lA(e),lA(t))?"v":"h"}Xr.$inject=["elementRegistry"];function V3(e){return N({original:e.point.original||e.point},e.actual)}function Ht(e,t){this._elementRegistry=e,this._graphicsFactory=t}Ht.$inject=["elementRegistry","graphicsFactory"],Ht.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var A=this.getDockingPoint(e,t,!0),i=this.getDockingPoint(e,n),o=e.waypoints.slice(A.idx+1,i.idx);return o.unshift(V3(A)),o.push(V3(i)),o},Ht.prototype.getDockingPoint=function(e,t,n){var A=e.waypoints,i,o,r;return i=n?0:A.length-1,o=A[i],r=this._getIntersection(t,e,n),{point:o,actual:r||o,idx:i}},Ht.prototype._getIntersection=function(e,t,n){var A=this._getShapePath(e),i=this._getConnectionPath(t);return wc(A,i,n)},Ht.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},Ht.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},Ht.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};const L3={__init__:["modeling","bpmnUpdater"],__depends__:[CF,HF,JF,jF,A3,Q8,w8,y8,Ce,Rc,s3],bpmnFactory:["type",ce],bpmnUpdater:["type",H2],elementFactory:["type",St],modeling:["type",D2],layouter:["type",Xr],connectionDocking:["type",Ht]},W3=Math.round;function Kr(e,t,n,A,i,o){this._complexPreview=e,this._connectionDocking=t,this._elementFactory=n,this._eventBus=A,this._layouter=i,this._rules=o}Kr.prototype.create=function(e,t,n){const A=this._complexPreview,i=this._connectionDocking,o=this._elementFactory,r=this._eventBus,a=this._layouter,c=this._rules,l=o.createShape(N({type:t},n)),B=r.fire("autoPlace",{source:e,shape:l});if(!B)return;N(l,{x:B.x-W3(l.width/2),y:B.y-W3(l.height/2)});const g=c.allowed("connection.create",{source:e,target:l,hints:{targetParent:e.parent}});let p=null;g&&(p=o.createConnection(g),p.waypoints=a.layoutConnection(p,{source:e,target:l}),p.waypoints=i.getCroppedWaypoints(p,e,l)),A.create({created:[l,p].filter(E=>!en(E))})},Kr.prototype.cleanUp=function(){this._complexPreview.cleanUp()},Kr.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];const vv={__depends__:[As,Zy,L3],__init__:["appendPreview"],appendPreview:["type",Kr]};var _3=Math.min,O3=Math.max;function z1(e){e.preventDefault()}function yi(e){e.stopPropagation()}function xv(e){return e.nodeType===Node.TEXT_NODE}function bv(e){return[].slice.call(e)}function ye(e){this.container=e.container,this.parent=$('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=p0("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=v2(this.autoResize,this),this.handlePaste=v2(this.handlePaste,this)}ye.prototype.create=function(e,t,n,A){var i=this,o=this.parent,r=this.content,a=this.container;A=this.options=A||{},t=this.style=t||{};var c=q2(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);N(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var l=q2(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return N(r.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),A.centerVertically&&N(r.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),r.innerText=n,O.bind(r,"keydown",this.keyHandler),O.bind(r,"mousedown",yi),O.bind(r,"paste",i.handlePaste),A.autoResize&&O.bind(r,"input",this.autoResize),A.resizable&&this.resizable(t),a.appendChild(o),this.setSelection(r.lastChild,r.lastChild&&r.lastChild.length),o},ye.prototype.handlePaste=function(e){var t=this.options,n=this.style;e.preventDefault();var A;if(e.clipboardData?A=e.clipboardData.getData("text/plain"):A=window.clipboardData.getData("Text"),this.insertText(A),t.autoResize){var i=this.autoResize(n);i&&this.resizeHandler(i)}},ye.prototype.insertText=function(e){e=Yv(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)},ye.prototype._insertTextIE=function(e){var t=this.getSelection(),n=t.startContainer,A=t.endContainer,i=t.startOffset,o=t.endOffset,r=t.commonAncestorContainer,a=bv(r.childNodes),c,l;if(xv(r)){var B=n.textContent;n.textContent=B.substring(0,i)+e+B.substring(o),c=n,l=i+e.length}else if(n===this.content&&A===this.content){var g=document.createTextNode(e);this.content.insertBefore(g,a[i]),c=g,l=g.textContent.length}else{var p=a.indexOf(n),E=a.indexOf(A);a.forEach(function(d,u){u===p?d.textContent=n.textContent.substring(0,i)+e+A.textContent.substring(o):u>p&&u<=E&&xe(d)}),c=n,l=i+e.length}c&&l!==void 0&&setTimeout(function(){self.setSelection(c,l)})},ye.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 A=e.getBoundingClientRect(),i=t.scrollHeight;e.style.height=i+"px",this.resizeHandler({width:A.width,height:A.height,dx:0,dy:i-A.height})}},ye.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,A=parseInt(this.style.minWidth)||0,i=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,r=parseInt(this.style.maxHeight)||1/0;if(!n){n=this.resizeHandle=$('<div class="djs-direct-editing-resize-handle"></div>');var a,c,l,B,g=function(d){z1(d),yi(d),a=d.clientX,c=d.clientY;var u=t.getBoundingClientRect();l=u.width,B=u.height,O.bind(document,"mousemove",p),O.bind(document,"mouseup",E)},p=function(d){z1(d),yi(d);var u=_3(O3(l+d.clientX-a,A),o),h=_3(O3(B+d.clientY-c,i),r);t.style.width=u+"px",t.style.height=h+"px",e.resizeHandler({width:l,height:B,dx:d.clientX-a,dy:d.clientY-c})},E=function(d){z1(d),yi(d),O.unbind(document,"mousemove",p,!1),O.unbind(document,"mouseup",E,!1)};O.bind(n,"mousedown",g)}N(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},ye.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),O.unbind(t,"keydown",this.keyHandler),O.unbind(t,"mousedown",yi),O.unbind(t,"input",this.autoResize),O.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),xe(n)),xe(e)},ye.prototype.getValue=function(){return this.content.innerText.trim()},ye.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t},ye.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var A=window.getSelection();A.removeAllRanges(),A.addRange(n)};function Yv(e){return e.replace(/\r\n|\r|\n/g,`
248
248
  `)}function se(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._textbox=new ye({container:t.getContainer(),keyHandler:v2(this._handleKey,this),resizeHandler:v2(this._handleResize,this)})}se.$inject=["eventBus","canvas"],se.prototype.registerProvider=function(e){this._providers.push(e)},se.prototype.isActive=function(e){return!!(this._active&&(!e||this._active.element===e))},se.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},se.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},se.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0,this._canvas.restoreFocus&&this._canvas.restoreFocus()},se.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,A=this.$textbox.getBoundingClientRect(),i=this.getValue(),o=e.context.text;(i!==o||A.height!==n.height||A.width!==n.width)&&(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,i,e.context.text,{x:A.left-t.left,y:A.top-t.top,width:A.width,height:A.height})),this._fire("complete"),this.close()}},se.prototype.getValue=function(){return this._textbox.getValue()},se.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;if(t===27)return e.preventDefault(),this.cancel();if(t===13&&!e.shiftKey)return e.preventDefault(),this.complete()},se.prototype._handleResize=function(e){this._fire("resize",e)},se.prototype.activate=function(e){this.isActive()&&this.cancel();var t,n=m0(this._providers,function(A){return(t=A.activate(e))?A:null});return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};const X3={__depends__:[ko],__init__:["directEditing"],directEditing:["type",se]};function Uv(e){return function(t){var n=t.target,A=P(e),i=A.eventDefinitions&&A.eventDefinitions[0],o=A.$type===n.type,r=(i&&i.$type)===n.eventDefinitionType,a=!!n.triggeredByEvent==!!A.triggeredByEvent,c=n.isExpanded===void 0||n.isExpanded===E0(e);return!o||!r||!a||!c}}var Nv=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],zv=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],Rv=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link intermediate catch event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link intermediate throw event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Sv=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel end event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate end event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],Tv=[{label:"Exclusive gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event-based gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],kv=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],Gv=[{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}}],K3=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],Hv=K3,Z3=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"User task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Service task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Send task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"Manual task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business rule task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Script task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub-process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}},{label:"Ad-hoc sub-process (expanded)",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}}],Pv=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],Jv=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],jv=[{label:"Message boundary event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},{label:"Timer boundary event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},{label:"Escalation boundary event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},{label:"Conditional boundary event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},{label:"Error boundary event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},{label:"Cancel boundary event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},{label:"Signal boundary event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},{label:"Compensation boundary event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},{label:"Message boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],Vv=[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Message start event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer start event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional start event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal start event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation start event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],Lv=[{label:"Sequence flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],Wv=[{label:"Expanded pool/participant",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}],_v={"bpmn:MessageEventDefinition":[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}}],"bpmn:TimerEventDefinition":[{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}}],"bpmn:ConditionalEventDefinition":[{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}}],"bpmn:SignalEventDefinition":[{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],"bpmn:ErrorEventDefinition":[{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}}],"bpmn:EscalationEventDefinition":[{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}}],"bpmn:CompensateEventDefinition":[{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}}]};const q3={"start-event-non-interrupting":`
249
249
  <svg viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg">
250
250
  <g transform="translate(0 995.64)">
@@ -256,7 +256,7 @@
256
256
  <circle cx="1024" cy="28.357" r="875" stroke-dasharray="418.310422, 361.2328165" stroke-width="100"/>
257
257
  <circle cx="1024" cy="28.357" r="685" stroke-dasharray="348.31044857,261.23283643" stroke-dashoffset="500" stroke-width="100"/>
258
258
  </g>
259
- </svg>`};function le(e,t,n,A,i,o,r,a){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=A,this._bpmnReplace=i,this._rules=o,this._translate=r,this._moddleCopy=a,this._register()}le.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"],le.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},le.prototype.getPopupMenuEntries=function(e){var a;var t=e.businessObject,n=this._rules,A=[],i,o=[];if(n0(e)||!n.allowed("shape.replace",{element:e}))return{};var r=Uv(e);return f(t,"bpmn:DataObjectReference")?this._createEntries(e,Pv):f(t,"bpmn:DataStoreReference")&&!f(e.parent,"bpmn:Collaboration")?this._createEntries(e,Jv):(f(t,"bpmn:Event")&&!f(t,"bpmn:BoundaryEvent")&&(i=(a=t.get("eventDefinitions")[0])==null?void 0:a.$type,A=_v[i]||[],!h2(t.$parent)&&f(t.$parent,"bpmn:SubProcess")&&(A=l0(A,function(c){return c.target.type!=="bpmn:StartEvent"}))),f(t,"bpmn:StartEvent")&&!f(t.$parent,"bpmn:SubProcess")?(o=l0(Nv.concat(A),r),this._createEntries(e,o)):f(t,"bpmn:Participant")?(o=l0(Wv,function(c){return E0(e)!==c.target.isExpanded}),this._createEntries(e,o)):f(t,"bpmn:StartEvent")&&h2(t.$parent)?(o=l0(Vv.concat(A),function(c){var l=c.target,B=l.isInterrupting!==!1,g=t.isInterrupting===B;return r(c)||!r(c)&&!g}),this._createEntries(e,o)):f(t,"bpmn:StartEvent")&&!h2(t.$parent)&&f(t.$parent,"bpmn:SubProcess")?(o=l0(zv.concat(A),r),this._createEntries(e,o)):f(t,"bpmn:EndEvent")?(o=l0(Sv.concat(A),function(c){var l=c.target;return l.eventDefinitionType=="bpmn:CancelEventDefinition"&&!f(t.$parent,"bpmn:Transaction")?!1:r(c)}),this._createEntries(e,o)):f(t,"bpmn:BoundaryEvent")?(o=l0(jv,function(c){var l=c.target;if(l.eventDefinitionType=="bpmn:CancelEventDefinition"&&!f(t.attachedToRef,"bpmn:Transaction"))return!1;var B=l.cancelActivity!==!1,g=t.cancelActivity==B;return r(c)||!r(c)&&!g}),this._createEntries(e,o)):f(t,"bpmn:IntermediateCatchEvent")||f(t,"bpmn:IntermediateThrowEvent")?(o=l0(Rv.concat(A),r),this._createEntries(e,o)):f(t,"bpmn:Gateway")?(o=l0(Tv,r),this._createEntries(e,o)):f(t,"bpmn:Transaction")?(o=l0(K3,r),this._createEntries(e,o)):h2(t)&&E0(e)?(o=l0(Hv,r),this._createEntries(e,o)):f(t,"bpmn:AdHocSubProcess")&&E0(e)?(o=l0(Gv,r),this._createEntries(e,o)):f(t,"bpmn:SubProcess")&&E0(e)?(o=l0(kv,r),this._createEntries(e,o)):f(t,"bpmn:SubProcess")&&!E0(e)?(o=l0(Z3,function(c){var l=c.target.type===e.type,B=c.target.isExpanded===!0;return l===B}),this._createEntries(e,o)):f(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,Lv):f(t,"bpmn:FlowNode")?(o=l0(Z3,r),this._createEntries(e,o)):{})},le.prototype.getPopupMenuHeaderEntries=function(e){var t={};return f(e,"bpmn:Activity")&&!h2(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),f(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),f(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),lE(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t},le.prototype._createEntries=function(e,t){var n={},A=this;return U(t,function(i){n[i.actionName]=A._createEntry(i,e)}),n},le.prototype._createSequenceFlowEntries=function(e,t){var n=P(e),A={},i=this._modeling,o=this._moddle,r=this;return U(t,function(a){switch(a.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(f(n.sourceRef,"bpmn:ExclusiveGateway")||f(n.sourceRef,"bpmn:InclusiveGateway")||f(n.sourceRef,"bpmn:ComplexGateway")||f(n.sourceRef,"bpmn:Activity"))&&(A={...A,[a.actionName]:r._createEntry(a,e,function(){i.updateProperties(e.source,{default:n})})});break;case"replace-with-conditional-flow":!n.conditionExpression&&f(n.sourceRef,"bpmn:Activity")&&(A={...A,[a.actionName]:r._createEntry(a,e,function(){var c=o.create("bpmn:FormalExpression",{body:""});i.updateProperties(e,{conditionExpression:c})})});break;default:f(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(A={...A,[a.actionName]:r._createEntry(a,e,function(){i.updateProperties(e,{conditionExpression:void 0})})}),(f(n.sourceRef,"bpmn:ExclusiveGateway")||f(n.sourceRef,"bpmn:InclusiveGateway")||f(n.sourceRef,"bpmn:ComplexGateway")||f(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(A={...A,[a.actionName]:r._createEntry(a,e,function(){i.updateProperties(e.source,{default:void 0})})})}}),A},le.prototype._createEntry=function(e,t,n){var A=this._translate,i=this._bpmnReplace.replaceElement,o=function(){return i(t,e.target)},r=e.label;return r&&typeof r=="function"&&(r=r(t)),n=n||o,{label:A(r),className:e.className,action:n}},le.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function A(l,B){if(B.active){t._modeling.updateProperties(e,{loopCharacteristics:void 0});return}var g=e.businessObject.get("loopCharacteristics");g&&f(g,B.options.loopCharacteristics)?t._modeling.updateModdleProperties(e,g,{isSequential:B.options.isSequential}):(g=t._moddle.create(B.options.loopCharacteristics,{isSequential:B.options.isSequential}),t._modeling.updateProperties(e,{loopCharacteristics:g}))}var i=P(e),o=i.loopCharacteristics,r,a,c;return o&&(r=o.isSequential,a=o.isSequential===void 0,c=o.isSequential!==void 0&&!o.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:c,action:A,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:r,action:A,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:a,action:A,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}},le.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,A=e.businessObject.dataObjectRef;if(!A)return{};function i(r,a){t._modeling.updateModdleProperties(e,A,{isCollection:!a.active})}var o=A.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:o,action:i}}},le.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,A=this._translate;function i(r,a){var c=a.active,l;c||(l=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:l})}var o=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:A("Participant multiplicity"),active:!!o,action:i}}},le.prototype._getNonInterruptingHeaderEntries=function(e){const t=this._translate,n=P(e),A=this,i=BE(e),o=f(e,"bpmn:BoundaryEvent")?q3["intermediate-event-non-interrupting"]:q3["start-event-non-interrupting"],r=!n[i];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:r,action:function(){A._modeling.updateProperties(e,{[i]:!!r})}}}};const Ov={__depends__:[$c,A3,As],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",le]};function Ii(e,t,n,A,i,o,r,a,c,l,B,g,p){e=e||{},A.registerProvider(this),this._contextPad=A,this._modeling=i,this._elementFactory=o,this._connect=r,this._create=a,this._popupMenu=c,this._canvas=l,this._rules=B,this._translate=g,this._eventBus=n,this._appendPreview=p,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(E){var d=E.context,u=d.shape;if(!(!Wn(E)||!A.isOpen(u))){var h=A.getEntries(u);h.replace&&h.replace.action.click(E,u)}}),n.on("contextPad.close",function(){p.cleanUp()})}Ii.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"],Ii.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&N(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(A,i){t.removeElements(i.slice())}}}}),n},Ii.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return n0(t)?je(e,n=>t.includes(n)):t},Ii.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,A=this._elementFactory,i=this._connect,o=this._create,r=this._popupMenu,a=this._autoPlace,c=this._translate,l=this._appendPreview,B={};if(e.type==="label")return this._isDeleteAllowed([e])&&N(B,d()),B;var g=e.businessObject;function p(C,m){i.start(C,m)}function E(C,m){n.removeElements([m])}function d(){return{delete:{group:"edit",className:"bpmn-icon-trash",title:c("Delete"),action:{click:E}}}}function u(C){var m=5,I=t.getPad(C).html,x=I.getBoundingClientRect(),v={x:x.left,y:x.bottom+m};return v}function h(C,m,I,x){function v(R,k){var T=A.createShape(N({type:C},x));o.start(R,T,{source:k})}var F=a?function(R,k){var T=A.createShape(N({type:C},x));a.append(k,T)}:v,z=a?function(R,k){return l.create(k,C,x),()=>{l.cleanUp()}}:null;return{group:"model",className:m,title:I,action:{dragstart:v,click:F,hover:z}}}function D(C){return function(m,I){n.splitLane(I,C),t.open(I,!0)}}if(a0(g,["bpmn:Lane","bpmn:Participant"])&&E0(e)){var y=it(e);N(B,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:c("Add lane above"),action:{click:function(C,m){n.addLane(m,"top")}}}}),y.length<2&&((l2(e)?e.height>=120:e.width>=120)&&N(B,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:c("Divide into two lanes"),action:{click:D(2)}}}),(l2(e)?e.height>=180:e.width>=180)&&N(B,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:c("Divide into three lanes"),action:{click:D(3)}}})),N(B,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:c("Add lane below"),action:{click:function(C,m){n.addLane(m,"bottom")}}}})}return f(g,"bpmn:FlowNode")&&(f(g,"bpmn:EventBasedGateway")?N(B,{"append.receive-task":h("bpmn:ReceiveTask","bpmn-icon-receive-task",c("Append receive task")),"append.message-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",c("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",c("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",c("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",c("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):$3(g,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?N(B,{"append.compensation-activity":h("bpmn:Task","bpmn-icon-task",c("Append compensation activity"),{isForCompensation:!0})}):!f(g,"bpmn:EndEvent")&&!g.isForCompensation&&!$3(g,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!h2(g)&&N(B,{"append.end-event":h("bpmn:EndEvent","bpmn-icon-end-event-none",c("Append end event")),"append.gateway":h("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",c("Append gateway")),"append.append-task":h("bpmn:Task","bpmn-icon-task",c("Append task")),"append.intermediate-event":h("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",c("Append intermediate/boundary event"))})),r.isEmpty(e,"bpmn-replace")||N(B,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:c("Change element"),action:{click:function(C,m){var I=N(u(m),{cursor:{x:C.x,y:C.y}});r.open(m,"bpmn-replace",I,{title:c("Change element"),width:300,search:!0})}}}}),f(g,"bpmn:SequenceFlow")&&N(B,{"append.text-annotation":h("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),f(g,"bpmn:MessageFlow")&&N(B,{"append.text-annotation":h("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),a0(g,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(B,{"append.text-annotation":h("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect to other element"),action:{click:p,dragstart:p}}}),f(g,"bpmn:TextAnnotation")&&N(B,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using association"),action:{click:p,dragstart:p}}}),a0(g,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(B,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using data input association"),action:{click:p,dragstart:p}}}),f(g,"bpmn:Group")&&N(B,{"append.text-annotation":h("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),this._isDeleteAllowed([e])&&N(B,d()),B};function $3(e,t,n){var A=e.$instanceOf(t),i=!1,o=e.eventDefinitions||[];return U(o,function(r){r.$type===n&&(i=!0)}),A&&i}const Xv={__depends__:[vv,X3,Ap,Ce,Es,xr,Ov],__init__:["contextPadProvider"],contextPadProvider:["type",Ii]};var Kv={horizontal:["x","width"],vertical:["y","height"]},ed=5;function ct(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(n){var A=t.allowed("elements.distribute",{elements:n});return n0(A)?A:A?n:[]})}ct.$inject=["modeling","rules"],ct.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)},ct.prototype.trigger=function(e,t){var n=this._modeling,A,i;if(!(e.length<3)&&(this._setOrientation(t),i=this._filterElements(e),A=this._createGroups(i),!(A.length<=2)))return n.distributeElements(A,this._axis,this._dimension),A},ct.prototype._filterElements=function(e){var t=this._filters,n=this._axis,A=this._dimension,i=[].concat(e);return t.length?(U(t,function(o){i=o(i,n,A)}),i):e},ct.prototype._createGroups=function(e){var t=[],n=this,A=this._axis,i=this._dimension;if(!A)throw new Error('must have a defined "axis" and "dimension"');var o=he(e,A);return U(o,function(r,a){var c=n._findRange(r,A,i),l,B=t[t.length-1];B&&n._hasIntersection(B.range,c)?t[t.length-1].elements.push(r):(l={range:c,elements:[r]},t.push(l))}),t},ct.prototype._setOrientation=function(e){var t=Kv[e];this._axis=t[0],this._dimension=t[1]},ct.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},ct.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+ed,max:t+n-ed}};const Zv={__init__:["distributeElements"],distributeElements:["type",ct]};function Zr(e){Ae.call(this,e)}Zr.$inject=["eventBus"],W(Zr,Ae),Zr.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return t=l0(t,function(n){var A=a0(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||A)}),t=Bo(t),t.length<3?!1:t})};var td={horizontal:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
259
+ </svg>`};function le(e,t,n,A,i,o,r,a){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=A,this._bpmnReplace=i,this._rules=o,this._translate=r,this._moddleCopy=a,this._register()}le.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"],le.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},le.prototype.getPopupMenuEntries=function(e){var a;var t=e.businessObject,n=this._rules,A=[],i,o=[];if(n0(e)||!n.allowed("shape.replace",{element:e}))return{};var r=Uv(e);return f(t,"bpmn:DataObjectReference")?this._createEntries(e,Pv):f(t,"bpmn:DataStoreReference")&&!f(e.parent,"bpmn:Collaboration")?this._createEntries(e,Jv):(f(t,"bpmn:Event")&&!f(t,"bpmn:BoundaryEvent")&&(i=(a=t.get("eventDefinitions")[0])==null?void 0:a.$type,A=_v[i]||[],!h2(t.$parent)&&f(t.$parent,"bpmn:SubProcess")&&(A=l0(A,function(c){return c.target.type!=="bpmn:StartEvent"}))),f(t,"bpmn:StartEvent")&&!f(t.$parent,"bpmn:SubProcess")?(o=l0(Nv.concat(A),r),this._createEntries(e,o)):f(t,"bpmn:Participant")?(o=l0(Wv,function(c){return E0(e)!==c.target.isExpanded}),this._createEntries(e,o)):f(t,"bpmn:StartEvent")&&h2(t.$parent)?(o=l0(Vv.concat(A),function(c){var l=c.target,B=l.isInterrupting!==!1,g=t.isInterrupting===B;return r(c)||!r(c)&&!g}),this._createEntries(e,o)):f(t,"bpmn:StartEvent")&&!h2(t.$parent)&&f(t.$parent,"bpmn:SubProcess")?(o=l0(zv.concat(A),r),this._createEntries(e,o)):f(t,"bpmn:EndEvent")?(o=l0(Sv.concat(A),function(c){var l=c.target;return l.eventDefinitionType=="bpmn:CancelEventDefinition"&&!f(t.$parent,"bpmn:Transaction")?!1:r(c)}),this._createEntries(e,o)):f(t,"bpmn:BoundaryEvent")?(o=l0(jv,function(c){var l=c.target;if(l.eventDefinitionType=="bpmn:CancelEventDefinition"&&!f(t.attachedToRef,"bpmn:Transaction"))return!1;var B=l.cancelActivity!==!1,g=t.cancelActivity==B;return r(c)||!r(c)&&!g}),this._createEntries(e,o)):f(t,"bpmn:IntermediateCatchEvent")||f(t,"bpmn:IntermediateThrowEvent")?(o=l0(Rv.concat(A),r),this._createEntries(e,o)):f(t,"bpmn:Gateway")?(o=l0(Tv,r),this._createEntries(e,o)):f(t,"bpmn:Transaction")?(o=l0(K3,r),this._createEntries(e,o)):h2(t)&&E0(e)?(o=l0(Hv,r),this._createEntries(e,o)):f(t,"bpmn:AdHocSubProcess")&&E0(e)?(o=l0(Gv,r),this._createEntries(e,o)):f(t,"bpmn:SubProcess")&&E0(e)?(o=l0(kv,r),this._createEntries(e,o)):f(t,"bpmn:SubProcess")&&!E0(e)?(o=l0(Z3,function(c){var l=c.target.type===e.type,B=c.target.isExpanded===!0;return l===B}),this._createEntries(e,o)):f(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,Lv):f(t,"bpmn:FlowNode")?(o=l0(Z3,r),this._createEntries(e,o)):{})},le.prototype.getPopupMenuHeaderEntries=function(e){var t={};return f(e,"bpmn:Activity")&&!h2(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),f(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),f(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),lE(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t},le.prototype._createEntries=function(e,t){var n={},A=this;return U(t,function(i){n[i.actionName]=A._createEntry(i,e)}),n},le.prototype._createSequenceFlowEntries=function(e,t){var n=P(e),A={},i=this._modeling,o=this._moddle,r=this;return U(t,function(a){switch(a.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(f(n.sourceRef,"bpmn:ExclusiveGateway")||f(n.sourceRef,"bpmn:InclusiveGateway")||f(n.sourceRef,"bpmn:ComplexGateway")||f(n.sourceRef,"bpmn:Activity"))&&(A={...A,[a.actionName]:r._createEntry(a,e,function(){i.updateProperties(e.source,{default:n})})});break;case"replace-with-conditional-flow":!n.conditionExpression&&f(n.sourceRef,"bpmn:Activity")&&(A={...A,[a.actionName]:r._createEntry(a,e,function(){var c=o.create("bpmn:FormalExpression",{body:""});i.updateProperties(e,{conditionExpression:c})})});break;default:f(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(A={...A,[a.actionName]:r._createEntry(a,e,function(){i.updateProperties(e,{conditionExpression:void 0})})}),(f(n.sourceRef,"bpmn:ExclusiveGateway")||f(n.sourceRef,"bpmn:InclusiveGateway")||f(n.sourceRef,"bpmn:ComplexGateway")||f(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(A={...A,[a.actionName]:r._createEntry(a,e,function(){i.updateProperties(e.source,{default:void 0})})})}}),A},le.prototype._createEntry=function(e,t,n){var A=this._translate,i=this._bpmnReplace.replaceElement,o=function(){return i(t,e.target)},r=e.label;return r&&typeof r=="function"&&(r=r(t)),n=n||o,{label:A(r),className:e.className,action:n}},le.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function A(l,B){if(B.active){t._modeling.updateProperties(e,{loopCharacteristics:void 0});return}var g=e.businessObject.get("loopCharacteristics");g&&f(g,B.options.loopCharacteristics)?t._modeling.updateModdleProperties(e,g,{isSequential:B.options.isSequential}):(g=t._moddle.create(B.options.loopCharacteristics,{isSequential:B.options.isSequential}),t._modeling.updateProperties(e,{loopCharacteristics:g}))}var i=P(e),o=i.loopCharacteristics,r,a,c;return o&&(r=o.isSequential,a=o.isSequential===void 0,c=o.isSequential!==void 0&&!o.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:c,action:A,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:r,action:A,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:a,action:A,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}},le.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,A=e.businessObject.dataObjectRef;if(!A)return{};function i(r,a){t._modeling.updateModdleProperties(e,A,{isCollection:!a.active})}var o=A.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:o,action:i}}},le.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,A=this._translate;function i(r,a){var c=a.active,l;c||(l=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:l})}var o=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:A("Participant multiplicity"),active:!!o,action:i}}},le.prototype._getNonInterruptingHeaderEntries=function(e){const t=this._translate,n=P(e),A=this,i=BE(e),o=f(e,"bpmn:BoundaryEvent")?q3["intermediate-event-non-interrupting"]:q3["start-event-non-interrupting"],r=!n[i];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:r,action:function(){A._modeling.updateProperties(e,{[i]:!!r})}}}};const Ov={__depends__:[$c,A3,As],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",le]};function Ii(e,t,n,A,i,o,r,a,c,l,B,g,p){e=e||{},A.registerProvider(this),this._contextPad=A,this._modeling=i,this._elementFactory=o,this._connect=r,this._create=a,this._popupMenu=c,this._canvas=l,this._rules=B,this._translate=g,this._eventBus=n,this._appendPreview=p,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(E){var d=E.context,u=d.shape;if(!(!Wn(E)||!A.isOpen(u))){var h=A.getEntries(u);h.replace&&h.replace.action.click(E,u)}}),n.on("contextPad.close",function(){p.cleanUp()})}Ii.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"],Ii.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&N(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(A,i){t.removeElements(i.slice())}}}}),n},Ii.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return n0(t)?je(e,n=>t.includes(n)):t},Ii.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,A=this._elementFactory,i=this._connect,o=this._create,r=this._popupMenu,a=this._autoPlace,c=this._translate,l=this._appendPreview,B={};if(e.type==="label")return this._isDeleteAllowed([e])&&N(B,d()),B;var g=e.businessObject;function p(C,m){i.start(C,m)}function E(C,m){n.removeElements([m])}function d(){return{delete:{group:"edit",className:"bpmn-icon-trash",title:c("Delete"),action:{click:E}}}}function u(C){var m=5,I=t.getPad(C).html,x=I.getBoundingClientRect(),v={x:x.left,y:x.bottom+m};return v}function h(C,m,I,x){function v(R,k){var T=A.createShape(N({type:C},x));o.start(R,T,{source:k})}var F=a?function(R,k){var T=A.createShape(N({type:C},x));a.append(k,T)}:v,z=a?function(R,k){return l.create(k,C,x),()=>{l.cleanUp()}}:null;return{group:"model",className:m,title:I,action:{dragstart:v,click:F,hover:z}}}function D(C){return function(m,I){n.splitLane(I,C),t.open(I,!0)}}if(a0(g,["bpmn:Lane","bpmn:Participant"])&&E0(e)){var y=it(e);N(B,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:c("Add lane above"),action:{click:function(C,m){n.addLane(m,"top")}}}}),y.length<2&&((l2(e)?e.height>=120:e.width>=120)&&N(B,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:c("Divide into two lanes"),action:{click:D(2)}}}),(l2(e)?e.height>=180:e.width>=180)&&N(B,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:c("Divide into three lanes"),action:{click:D(3)}}})),N(B,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:c("Add lane below"),action:{click:function(C,m){n.addLane(m,"bottom")}}}})}return f(g,"bpmn:FlowNode")&&(f(g,"bpmn:EventBasedGateway")?N(B,{"append.receive-task":h("bpmn:ReceiveTask","bpmn-icon-receive-task",c("Append receive task")),"append.message-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",c("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",c("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",c("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",c("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):$3(g,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?N(B,{"append.compensation-activity":h("bpmn:Task","bpmn-icon-task",c("Append compensation activity"),{isForCompensation:!0})}):!f(g,"bpmn:EndEvent")&&!g.isForCompensation&&!$3(g,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!h2(g)&&N(B,{"append.end-event":h("bpmn:EndEvent","bpmn-icon-end-event-none",c("Append end event")),"append.gateway":h("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",c("Append gateway")),"append.append-task":h("bpmn:Task","bpmn-icon-task",c("Append task")),"append.intermediate-event":h("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",c("Append intermediate/boundary event"))})),r.isEmpty(e,"bpmn-replace")||N(B,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:c("Change element"),action:{click:function(C,m){var I=N(u(m),{cursor:{x:C.x,y:C.y}});r.open(m,"bpmn-replace",I,{title:c("Change element"),width:300,search:!0})}}}}),f(g,"bpmn:SequenceFlow")&&N(B,{"append.text-annotation":h("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),f(g,"bpmn:MessageFlow")&&N(B,{"append.text-annotation":h("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),a0(g,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(B,{"append.text-annotation":h("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect to other element"),action:{click:p,dragstart:p}}}),f(g,"bpmn:TextAnnotation")&&N(B,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using association"),action:{click:p,dragstart:p}}}),a0(g,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(B,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using data input association"),action:{click:p,dragstart:p}}}),f(g,"bpmn:Group")&&N(B,{"append.text-annotation":h("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),this._isDeleteAllowed([e])&&N(B,d()),B};function $3(e,t,n){var A=e.$instanceOf(t),i=!1,o=e.eventDefinitions||[];return U(o,function(r){r.$type===n&&(i=!0)}),A&&i}const Xv={__depends__:[vv,X3,Ap,Ce,Es,xr,Ov],__init__:["contextPadProvider"],contextPadProvider:["type",Ii]};var Kv={horizontal:["x","width"],vertical:["y","height"]},ed=5;function ct(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(n){var A=t.allowed("elements.distribute",{elements:n});return n0(A)?A:A?n:[]})}ct.$inject=["modeling","rules"],ct.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)},ct.prototype.trigger=function(e,t){var n=this._modeling,A,i;if(!(e.length<3)&&(this._setOrientation(t),i=this._filterElements(e),A=this._createGroups(i),!(A.length<=2)))return n.distributeElements(A,this._axis,this._dimension),A},ct.prototype._filterElements=function(e){var t=this._filters,n=this._axis,A=this._dimension,i=[].concat(e);return t.length?(U(t,function(o){i=o(i,n,A)}),i):e},ct.prototype._createGroups=function(e){var t=[],n=this,A=this._axis,i=this._dimension;if(!A)throw new Error('must have a defined "axis" and "dimension"');var o=Qe(e,A);return U(o,function(r,a){var c=n._findRange(r,A,i),l,B=t[t.length-1];B&&n._hasIntersection(B.range,c)?t[t.length-1].elements.push(r):(l={range:c,elements:[r]},t.push(l))}),t},ct.prototype._setOrientation=function(e){var t=Kv[e];this._axis=t[0],this._dimension=t[1]},ct.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},ct.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+ed,max:t+n-ed}};const Zv={__init__:["distributeElements"],distributeElements:["type",ct]};function Zr(e){Ae.call(this,e)}Zr.$inject=["eventBus"],W(Zr,Ae),Zr.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return t=l0(t,function(n){var A=a0(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||A)}),t=Bo(t),t.length<3?!1:t})};var td={horizontal:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
260
260
  <polyline points="450 400 450 150 1350 150 1350 400" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
261
261
  <rect x="150" y="450" width="600" height="1200" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
262
262
  <rect x="1050" y="450" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
@@ -264,7 +264,7 @@
264
264
  <polyline points="400 1350 150 1350 150 450 400 450" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
265
265
  <rect x="450" y="150" width="1200" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
266
266
  <rect x="450" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
267
- </svg>`},qv=900;function Fi(e,t,n,A){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=A,e.registerProvider("align-elements",qv,this)}Fi.$inject=["popupMenu","distributeElements","translate","rules"],Fi.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&N(t,this._getEntries(e)),t},Fi.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},Fi.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,A=this._popupMenu,i={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:td.horizontal,action:function(o,r){t.trigger(e,"horizontal"),A.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:td.vertical,action:function(o,r){t.trigger(e,"vertical"),A.close()}}};return i};const $v={__depends__:[$c,Zv],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",Zr],distributeElementsMenuProvider:["type",Fi]};var nd="is not a registered action",ex="is already registered";function Be(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Be.$inject=["eventBus","injector"],Be.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),A=e.get("selection",!1),i=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),r=e.get("canvas",!1),a=e.get("rules",!1),c=e.get("keyboardMove",!1),l=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&A&&this.register("copy",function(){var B=A.get();if(B.length)return o.copy(B)}),o&&this.register("paste",function(){o.paste()}),i&&this.register("stepZoom",function(B){i.stepZoom(B.value)}),r&&this.register("zoom",function(B){r.zoom(B.value)}),n&&A&&a&&this.register("removeSelection",function(){var B=A.get();if(B.length){var g=a.allowed("elements.delete",{elements:B}),p;g!==!1&&(n0(g)?p=g:p=B,p.length&&n.removeElements(p.slice()))}}),c&&this.register("moveCanvas",function(B){c.moveCanvas(B)}),l&&this.register("moveSelection",function(B){l.moveSelection(B.direction,B.accelerated)})},Be.prototype.trigger=function(e,t){if(!this._actions[e])throw R1(e,nd);return this._actions[e](t)},Be.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);U(e,function(A,i){n._registerAction(i,A)})},Be.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw R1(e,ex);this._actions[e]=t},Be.prototype.unregister=function(e){if(!this.isRegistered(e))throw R1(e,nd);this._actions[e]=void 0},Be.prototype.getActions=function(){return Object.keys(this._actions)},Be.prototype.isRegistered=function(e){return!!this._actions[e]};function R1(e,t){return new Error(e+" "+t)}const tx={__init__:["editorActions"],editorActions:["type",Be]};function qr(e){e.invoke(Be,this)}W(qr,Be),qr.$inject=["injector"],qr.prototype._registerDefaultActions=function(e){Be.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),A=e.get("selection",!1),i=e.get("spaceTool",!1),o=e.get("lassoTool",!1),r=e.get("handTool",!1),a=e.get("globalConnect",!1),c=e.get("distributeElements",!1),l=e.get("alignElements",!1),B=e.get("directEditing",!1),g=e.get("searchPad",!1),p=e.get("modeling",!1),E=e.get("contextPad",!1);t&&n&&A&&this._registerAction("selectElements",function(){var d=t.getRootElement(),u=n.filter(function(h){return h!==d});return A.select(u),u}),i&&this._registerAction("spaceTool",function(){i.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),r&&this._registerAction("handTool",function(){r.toggle()}),a&&this._registerAction("globalConnectTool",function(){a.toggle()}),A&&c&&this._registerAction("distributeElements",function(d){var u=A.get(),h=d.type;u.length&&c.trigger(u,h)}),A&&l&&this._registerAction("alignElements",function(d){var u=A.get(),h=[],D=d.type;u.length&&(h=l0(u,function(y){return!f(y,"bpmn:Lane")}),l.trigger(h,D))}),A&&p&&this._registerAction("setColor",function(d){var u=A.get();u.length&&p.setColor(u,d)}),A&&B&&this._registerAction("directEditing",function(){var d=A.get();d.length&&B.activate(d[0])}),g&&this._registerAction("find",function(){g.toggle()}),t&&p&&this._registerAction("moveToOrigin",function(){var d=t.getRootElement(),u,h;f(d,"bpmn:Collaboration")?h=n.filter(function(D){return f(D.parent,"bpmn:Collaboration")}):h=n.filter(function(D){return D!==d&&!f(D.parent,"bpmn:SubProcess")}),u=i2(h),p.moveElements(h,{x:-u.x,y:-u.y},d)}),A&&E&&this._registerAction("replaceElement",function(d){E.triggerEntry("replace","click",d)})};const nx={__depends__:[tx],editorActions:["type",qr]};function Ad(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,A=t.shape;a0(A,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}Ad.$inject=["eventBus"];var $r=10;function S1(e,t,n){return n||(n="round"),Math[n](e/t)*t}var Ax=1200,ix=800;function Pt(e,t,n){var A=!n||n.active!==!1;this._eventBus=t;var i=this;t.on("diagram.init",ix,function(){i.setActive(A)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],Ax,function(o){var r=o.originalEvent;if(!(!i.active||r&&ne(r))){var a=o.context,c=a.gridSnappingContext;c||(c=a.gridSnappingContext={}),["x","y"].forEach(function(l){var B={},g=rx(o,l,e);g&&(B.offset=g);var p=ox(o,l);p&&N(B,p),nA(o,l)||i.snapEvent(o,l,B)})}})}Pt.prototype.snapEvent=function(e,t,n){var A=this.snapValue(e[t],n);$0(e,t,A)},Pt.prototype.getGridSpacing=function(){return $r},Pt.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=S1(e,$r);var A,i;return t&&t.min&&(A=t.min,A0(A)&&(A=S1(A+n,$r,"ceil"),e=Math.max(e,A))),t&&t.max&&(i=t.max,A0(i)&&(i=S1(i+n,$r,"floor"),e=Math.min(e,i))),e-=n,e},Pt.prototype.isActive=function(){return this.active},Pt.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},Pt.prototype.toggleActive=function(){this.setActive(!this.active)},Pt.$inject=["elementRegistry","eventBus","config.gridSnapping"];function ox(e,t){var n=e.context,A=n.createConstraints,i=n.resizeConstraints||{},o=n.gridSnappingContext,r=o.snapConstraints;if(r&&r[t])return r[t];r||(r=o.snapConstraints={}),r[t]||(r[t]={});var a=n.direction;A&&(ea(t)?(r.x.min=A.left,r.x.max=A.right):(r.y.min=A.top,r.y.max=A.bottom));var c=i.min,l=i.max;return c&&(ea(t)?od(a)?r.x.max=c.left:r.x.min=c.right:id(a)?r.y.max=c.top:r.y.min=c.bottom),l&&(ea(t)?od(a)?r.x.min=l.left:r.x.max=l.right:id(a)?r.y.min=l.top:r.y.max=l.bottom),r[t]}function rx(e,t,n){var A=e.context,i=e.shape,o=A.gridSnappingContext,r=o.snapLocation,a=o.snapOffset;return a&&A0(a[t])||(a||(a=o.snapOffset={}),A0(a[t])||(a[t]=0),!i)||(n.get(i.id)||(ea(t)?a[t]+=i[t]+i.width/2:a[t]+=i[t]+i.height/2),!r)||(t==="x"?/left/.test(r)?a[t]-=i.width/2:/right/.test(r)&&(a[t]+=i.width/2):/top/.test(r)?a[t]-=i.height/2:/bottom/.test(r)&&(a[t]+=i.height/2)),a[t]}function ea(e){return e==="x"}function id(e){return e.indexOf("n")!==-1}function od(e){return e.indexOf("w")!==-1}function mn(e,t){j.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(A){var i=A.context,o=i.hints||{},r=o.autoResize;if(r){var a=i.shape,c=i.newBounds;U2(r)?i.newBounds=n.snapComplex(c,r):i.newBounds=n.snapSimple(a,c)}})}mn.$inject=["eventBus","gridSnapping","modeling"],W(mn,j),mn.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},mn.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},mn.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,A=/w/.test(t),i=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),i&&(A?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),N(e,o),e},mn.prototype.snapVertically=function(e,t){var n=this._gridSnapping,A=/n/.test(t),i=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),A&&(i?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),N(e,o),e};var ax=2e3;function rd(e,t){e.on(["spaceTool.move","spaceTool.end"],ax,function(n){var A=n.context;if(A.initialized){var i=A.axis,o;i==="x"?(o=t.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=t.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}rd.$inject=["eventBus","gridSnapping"];const cx={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",mn],gridSnappingSpaceToolBehavior:["type",rd]}],__init__:["gridSnapping"],gridSnapping:["type",Pt]};var sx=2e3;function ad(e,t,n){e.on("autoPlace",sx,function(A){var i=A.source,o=i0(i),r=A.shape,a=Op(i,r,n);return["x","y"].forEach(function(c){var l={};a[c]!==o[c]&&(a[c]>o[c]?l.min=a[c]:l.max=a[c],f(r,"bpmn:TextAnnotation")&&(lx(c)?l.offset=-r.width/2:l.offset=-r.height/2),a[c]=t.snapValue(a[c],l))}),a})}ad.$inject=["eventBus","gridSnapping","elementRegistry"];function lx(e){return e==="x"}var Bx=1750;function cd(e,t,n){t.on(["create.start","shape.move.start"],Bx,function(A){var i=A.context,o=i.shape,r=e.getRootElement();if(!(!f(o,"bpmn:Participant")||!f(r,"bpmn:Process")||!r.children.length)){var a=i.createConstraints;a&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}cd.$inject=["canvas","eventBus","gridSnapping"];var gx=3e3;function ta(e,t,n){j.call(this,e),this._gridSnapping=t;var A=this;this.postExecuted(["connection.create","connection.layout"],gx,function(i){var o=i.context,r=o.connection,a=o.hints||{},c=r.waypoints;a.connectionStart||a.connectionEnd||a.createElementsBehavior===!1||px(c)&&n.updateWaypoints(r,A.snapMiddleSegments(c))})}ta.$inject=["eventBus","gridSnapping","modeling"],W(ta,j),ta.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var A=1;A<e.length-2;A++)n=ux(t,e[A],e[A+1]),e[A]=n[0],e[A+1]=n[1];return e};function px(e){return e.length>3}function Ex(e){return e==="h"}function dx(e){return e==="v"}function ux(e,t,n){var A=We(t,n),i={};return Ex(A)&&(i.y=e.snapValue(t.y)),dx(A)&&(i.x=e.snapValue(t.x)),("x"in i||"y"in i)&&(t=N({},t,i),n=N({},n,i)),[t,n]}const Qx={__depends__:[cx,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",ad],gridSnappingParticipantBehavior:["type",cd],gridSnappingLayoutConnectionBehavior:["type",ta]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",Ad]};var hx=30,sd=30;function vi(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(A){var i=A.element,o=A.gfx;if(f(i,"bpmn:Lane"))return n._createParticipantHit(i,o);if(f(i,"bpmn:Participant"))return E0(i)?n._createParticipantHit(i,o):n._createDefaultHit(i,o);if(f(i,"bpmn:SubProcess"))return E0(i)?n._createSubProcessHit(i,o):n._createDefaultHit(i,o)})}vi.$inject=["eventBus","interactionEvents"],vi.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},vi.prototype._createParticipantHit=function(e,t){this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height});var n=l2(e)?{width:hx,height:e.height}:{width:e.width,height:sd};return this._interactionEvents.createBoxHit(t,"all",n),!0},vi.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:sd}),!0};const wx={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",vi]};function na(e){e.invoke(On,this)}W(na,On),na.$inject=["injector"],na.prototype.registerBindings=function(e,t){On.prototype.registerBindings.call(this,e,t);function n(A,i){t.isRegistered(A)&&e.addListener(i)}n("selectElements",function(A){var i=A.keyEvent;if(e.isKey(["a","A"],i)&&e.isCmd(i))return t.trigger("selectElements"),!0}),n("find",function(A){var i=A.keyEvent;if(e.isKey(["f","F"],i)&&e.isCmd(i))return t.trigger("find"),!0}),n("spaceTool",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["s","S"],i))return t.trigger("spaceTool"),!0}),n("lassoTool",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["l","L"],i))return t.trigger("lassoTool"),!0}),n("handTool",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["h","H"],i))return t.trigger("handTool"),!0}),n("globalConnectTool",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["c","C"],i))return t.trigger("globalConnectTool"),!0}),n("directEditing",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["e","E"],i))return t.trigger("directEditing"),!0}),n("replaceElement",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["r","R"],i))return t.trigger("replaceElement",i),!0})};const mx={__depends__:[Gc],__init__:["keyboardBindings"],keyboardBindings:["type",na]};var fx={moveSpeed:1,moveSpeedAccelerated:10},Cx=1500,ld="left",Bd="up",gd="right",pd="down",Mx={ArrowLeft:ld,Left:ld,ArrowUp:Bd,Up:Bd,ArrowRight:gd,Right:gd,ArrowDown:pd,Down:pd},Dx={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function Ed(e,t,n,A,i){var o=this;this._config=N({},fx,e||{}),t.addListener(Cx,function(r){var a=r.keyEvent,c=Mx[a.key];if(c&&!t.isCmd(a)){var l=t.isShift(a);return o.moveSelection(c,l),!0}}),this.moveSelection=function(r,a){var c=i.get();if(c.length){var l=this._config[a?"moveSpeedAccelerated":"moveSpeed"],B=Dx[r](l),g=A.allowed("elements.move",{shapes:c});g&&n.moveElements(c,B)}}}Ed.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const yx={__depends__:[Gc,Ce],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",Ed]};var dd=10;function xi(e,t,n,A){this._dragging=A,this._rules=t;var i=this;function o(c,l){var B=c.shape,g=c.direction,p=c.resizeConstraints,E;c.delta=l,E=sI(B,g,l),c.newBounds=BI(E,p),c.canExecute=i.canResize(c)}function r(c){var l=c.resizeConstraints,B=c.minBounds;l===void 0&&(B===void 0&&(B=i.computeMinResizeBox(c)),c.resizeConstraints={min:e0(B)})}function a(c){var l=c.shape,B=c.canExecute,g=c.newBounds;if(B){if(g=zB(g),!Ix(l,g))return;n.resizeShape(l,g)}}e.on("resize.start",function(c){r(c.context)}),e.on("resize.move",function(c){var l={x:c.dx,y:c.dy};o(c.context,l)}),e.on("resize.end",function(c){a(c.context)})}xi.prototype.canResize=function(e){var t=this._rules,n=q2(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},xi.prototype.activate=function(e,t,n){var A=this._dragging,i,o;if(typeof n=="string"&&(n={direction:n}),i=N({shape:t},n),o=i.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");A.init(e,ud(t,o),"resize",{autoActivate:!0,cursor:Fx(o),data:{shape:t,context:i}})},xi.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,A,i;return A=e.minDimensions||{width:dd,height:dd},i=H4(t,e.childrenBoxPadding),gI(n,t,A,i)},xi.$inject=["eventBus","rules","modeling","dragging"];function Ix(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function ud(e,t){var n=i0(e),A=e0(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=A.top:t.indexOf("s")!==-1&&(i.y=A.bottom),t.indexOf("e")!==-1?i.x=A.right:t.indexOf("w")!==-1&&(i.x=A.left),i}function Fx(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var Qd="djs-resizing",hd="resize-not-ok",vx=500;function wd(e,t,n){function A(o){var r=o.shape,a=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(r,t.getActiveLayer()),t.addMarker(r,Qd)),a.width>5&&q(c,{x:a.x,width:a.width}),a.height>5&&q(c,{y:a.y,height:a.height}),o.canExecute?D0(c).remove(hd):D0(c).add(hd)}function i(o){var r=o.shape,a=o.frame;a&&s2(o.frame),t.removeMarker(r,Qd)}e.on("resize.move",vx,function(o){A(o.context)}),e.on("resize.cleanup",function(o){i(o.context)})}wd.$inject=["eventBus","canvas","previewSupport"];var Aa=-6,ia=8,oa=20,bi="djs-resizer",xx=["n","w","s","e","nw","ne","se","sw"];function Jt(e,t,n,A){this._resize=A,this._canvas=t;var i=this;e.on("selection.changed",function(o){var r=o.newSelection;i.removeResizers(),r.length===1&&U(r,v2(i.addResizer,i))}),e.on("shape.changed",function(o){var r=o.element;n.isSelected(r)&&(i.removeResizers(),i.addResizer(r))})}Jt.prototype.makeDraggable=function(e,t,n){var A=this._resize;function i(o){vt(o)&&A.activate(o,e,n)}O.bind(t,"mousedown",i),O.bind(t,"touchstart",i)},Jt.prototype._createResizer=function(e,t,n,A){var i=this._getResizersParent(),o=bx(A),r=g0("g");D0(r).add(bi),D0(r).add(bi+"-"+e.id),D0(r).add(bi+"-"+A),Q0(i,r);var a=g0("rect");q(a,{x:-ia/2+o.x,y:-ia/2+o.y,width:ia,height:ia}),D0(a).add(bi+"-visual"),Q0(r,a);var c=g0("rect");return q(c,{x:-oa/2+o.x,y:-oa/2+o.y,width:oa,height:oa}),D0(c).add(bi+"-hit"),Q0(r,c),mo(r,t,n),r},Jt.prototype.createResizer=function(e,t){var n=ud(e,t),A=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,A,t)},Jt.prototype.addResizer=function(e){var t=this;Y0(e)||!this._resize.canResize({shape:e})||U(xx,function(n){t.createResizer(e,n)})},Jt.prototype.removeResizers=function(){var e=this._getResizersParent();co(e)},Jt.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Jt.$inject=["eventBus","canvas","selection","resize"];function bx(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-Aa:e.indexOf("w")!==-1&&(t.x=Aa),e.indexOf("s")!==-1?t.y=-Aa:e.indexOf("n")!==-1&&(t.y=Aa),t}const md={__depends__:[Te,nt,AA],__init__:["resize","resizePreview","resizeHandles"],resize:["type",xi],resizePreview:["type",wd],resizeHandles:["type",Jt]};var Yx=2e3;function Yi(e,t,n,A,i,o,r){this._bpmnFactory=t,this._canvas=n,this._modeling=i,this._textRenderer=r,A.registerProvider(this),e.on("element.dblclick",function(c){a(c.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){A.isActive()&&A.complete()}),e.on(["shape.remove","connection.remove"],Yx,function(c){A.isActive(c.element)&&A.cancel()}),e.on(["commandStack.changed"],function(c){A.isActive()&&A.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var l=c.context,B=l.shape,g=c.context.canExecute,p=c.isTouch;p||g&&(l.hints&&l.hints.createElementsBehavior===!1||a(B))}),e.on("autoPlace.end",500,function(c){a(c.shape)});function a(c,l){(l||a0(c,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||T1(c))&&A.activate(c)}}Yi.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Yi.prototype.activate=function(e){var t=fe(e);if(t!==void 0){var n={text:t},A=this.getEditingBBox(e);N(n,A);var i={},o=n.style||{};return N(o,{backgroundColor:null,border:null}),(a0(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||T1(e))&&N(i,{centerVertically:!0}),an(e)&&(N(i,{autoResize:!0}),N(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),f(e,"bpmn:TextAnnotation")&&(N(i,{resizable:!0,autoResize:!0}),N(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),N(n,{options:i,style:o}),n}},Yi.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,A=t.getAbsoluteBBox(n),i={x:A.x+A.width/2,y:A.y+A.height/2},o={x:A.x,y:A.y},r=t.zoom(),a=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),l=c.fontSize*r,B=c.lineHeight,g=a.fontSize*r,p=a.lineHeight,E={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(f(e,"bpmn:Lane")||zx(e)){var d=l2(e),u=d?{width:A.height,height:30*r,x:A.x-A.height/2+15*r,y:i.y-30*r/2}:{width:A.width,height:30*r};N(o,u),N(E,{fontSize:g+"px",lineHeight:p,paddingTop:7*r+"px",paddingBottom:7*r+"px",paddingLeft:5*r+"px",paddingRight:5*r+"px",transform:d?"rotate(-90deg)":null})}if(Nx(e)){var h=l2(e),D=h?{width:A.width,height:A.height}:{width:A.height,height:A.width,x:i.x-A.height/2,y:i.y-A.width/2};N(o,D),N(E,{fontSize:g+"px",lineHeight:p,paddingTop:7*r+"px",paddingBottom:7*r+"px",paddingLeft:5*r+"px",paddingRight:5*r+"px",transform:h?null:"rotate(-90deg)"})}(a0(e,["bpmn:Task","bpmn:CallActivity"])||T1(e))&&(N(o,{width:A.width,height:A.height}),N(E,{fontSize:g+"px",lineHeight:p,paddingTop:7*r+"px",paddingBottom:7*r+"px",paddingLeft:5*r+"px",paddingRight:5*r+"px"})),Ux(e)&&(N(o,{width:A.width,x:A.x}),N(E,{fontSize:g+"px",lineHeight:p,paddingTop:7*r+"px",paddingBottom:7*r+"px",paddingLeft:5*r+"px",paddingRight:5*r+"px"}));var y=90*r,C=7*r,m=4*r;if(n.labelTarget&&(N(o,{width:y,height:A.height+C+m,x:i.x-y/2,y:A.y-C}),N(E,{fontSize:l+"px",lineHeight:B,paddingTop:C+"px",paddingBottom:m+"px"})),an(n)&&!Io(n)&&!f0(n)){var I=Nc(e),x=t.getAbsoluteBBox({x:I.x,y:I.y,width:0,height:0}),v=l+C+m;N(o,{width:y,height:v,x:x.x-y/2,y:x.y-v/2}),N(E,{fontSize:l+"px",lineHeight:B,paddingTop:C+"px",paddingBottom:m+"px"})}return f(e,"bpmn:TextAnnotation")&&(N(o,{width:A.width,height:A.height,minWidth:30*r,minHeight:10*r}),N(E,{textAlign:"left",paddingTop:5*r+"px",paddingBottom:7*r+"px",paddingLeft:7*r+"px",paddingRight:5*r+"px",fontSize:g+"px",lineHeight:p})),{bounds:o,style:E}},Yi.prototype.update=function(e,t,n,A){var i,o;f(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),i={x:e.x,y:e.y,width:e.width/o.width*A.width,height:e.height/o.height*A.height}),Rx(t)&&(t=null),this._modeling.updateLabel(e,t,i)};function T1(e){return f(e,"bpmn:SubProcess")&&!E0(e)}function Ux(e){return f(e,"bpmn:SubProcess")&&E0(e)}function Nx(e){return f(e,"bpmn:Participant")&&!E0(e)}function zx(e){return f(e,"bpmn:Participant")&&E0(e)}function Rx(e){return!e||!e.trim()}var fd="djs-element-hidden",Cd="djs-label-hidden";function Md(e,t,n){var A=this,i=t.getDefaultLayer(),o,r,a;e.on("directEditing.activate",function(c){var l=c.active;if(o=l.element.label||l.element,f(o,"bpmn:TextAnnotation")){r=t.getAbsoluteBBox(o),a=c2("g");var B=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),g=A.path=c2("path");N2(g,{d:B,strokeWidth:2,stroke:Sx(o)}),me(a,g),me(i,a),Q2(a,o.x,o.y)}f(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,fd):(f(o,"bpmn:Task")||f(o,"bpmn:CallActivity")||f(o,"bpmn:SubProcess")||f(o,"bpmn:Participant")||f(o,"bpmn:Lane"))&&t.addMarker(o,Cd)}),e.on("directEditing.resize",function(c){if(f(o,"bpmn:TextAnnotation")){var l=c.height,B=c.dy,g=Math.max(o.height/r.height*(l+B),0),p=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:g,position:{mx:0,my:0}});N2(A.path,{d:p})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var l=c.active;l&&(t.removeMarker(l.element.label||l.element,fd),t.removeMarker(o,Cd)),o=void 0,r=void 0,a&&(km(a),a=void 0)})}Md.$inject=["eventBus","canvas","pathMap"];function Sx(e,t){var n=h0(e);return n.get("stroke")||t||"black"}const Tx={__depends__:[Rc,md,X3],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Yi],labelEditingPreview:["type",Md]};var kx=new VA("tt");function Gx(e){var t=$('<div class="djs-tooltip-container" />');return m2(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function Hx(e,t,n){m2(e,{left:t+"px",top:n+"px"})}function k1(e,t){e.style.display=t===!1?"none":""}var Dd="djs-tooltip",G1="."+Dd;function R2(e,t){this._eventBus=e,this._canvas=t,this._ids=kx,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=Gx(t.getContainer());var n=this;x2.bind(this._tooltipRoot,G1,"mousedown",function(A){A.stopPropagation()}),x2.bind(this._tooltipRoot,G1,"mouseover",function(A){n.trigger("mouseover",A)}),x2.bind(this._tooltipRoot,G1,"mouseout",function(A){n.trigger("mouseout",A)}),this._init()}R2.$inject=["eventBus","canvas"],R2.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=N({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},R2.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,A=this.get(g2(n,"data-tooltip-id"));A&&(e==="mouseover"&&A.timeout&&this.clearTimeout(A),e==="mouseout"&&A.timeout&&(A.timeout=1e3,this.setTimeout(A)))},R2.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]},R2.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},R2.prototype.setTimeout=function(e){if(e=this.get(e),!!e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},R2.prototype.remove=function(e){var t=this.get(e);t&&(xe(t.html),xe(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},R2.prototype.show=function(){k1(this._tooltipRoot)},R2.prototype.hide=function(){k1(this._tooltipRoot,!1)},R2.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,A="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=A,this._tooltipRoot.style["-ms-transform"]=A},R2.prototype._addTooltip=function(e){var t=e.id,n=e.html,A,i=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),U2(n)&&(n=$(n)),A=$('<div data-tooltip-id="'+t+'" class="'+Dd+'">'),m2(A,{position:"absolute"}),A.appendChild(n),e.type&&X(A).add("djs-tooltip-"+e.type),e.className&&X(A).add(e.className),e.htmlContainer=A,i.appendChild(A),this._tooltips[t]=e,this._updateTooltip(e)},R2.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;Hx(n,t.x,t.y)},R2.prototype._updateTooltipVisibilty=function(e){U(this._tooltips,function(t){var n=t.show,A=t.htmlContainer,i=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(i=!1),k1(A,i))})},R2.prototype._init=function(){var e=this;function t(n){e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()}this._eventBus.on("canvas.viewbox.changing",function(n){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(n){t(n.viewbox)})};const yd={__init__:["tooltips"],tooltips:["type",R2]};var Px="flow elements must be children of pools/participants",Jx="Data object must be placed within a pool/participant.";function Id(e,t,n){function A(i,o,r){t.add({position:{x:i.x+5,y:i.y+5},type:"error",timeout:2e3,html:"<div>"+o+"</div>"})}e.on(["shape.move.rejected","create.rejected"],function(i){var o=i.context,r=o.shape,a=o.target;f(a,"bpmn:Collaboration")&&(f(r,"bpmn:FlowNode")?A(i,n(Px)):f(r,"bpmn:DataObjectReference")&&A(i,n(Jx)))})}Id.$inject=["eventBus","tooltips","translate"];const jx={__depends__:[yd],__init__:["modelingFeedback"],modelingFeedback:["type",Id]};var Vx=500,Lx=1e3;function fn(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),A=this;function i(o){var r=g0("rect");return q(r,N({x:0,y:0,rx:4,width:100,height:100},n)),r}e.on(["shape.added","shape.changed"],Vx,function(o){var r=o.element,a=o.gfx,c=p0(".djs-outline",a);c||(c=A.getOutline(r)||i(),Q0(a,c)),A.updateShapeOutline(c,r)}),e.on(["connection.added","connection.changed"],function(o){var r=o.element,a=o.gfx,c=p0(".djs-outline",a);c||(c=i(),Q0(a,c)),A.updateConnectionOutline(c,r)})}fn.prototype.updateShapeOutline=function(e,t){var n=!1,A=this._getProviders();A.length&&U(A,function(i){n=n||i.updateOutline(t,e)}),n||q(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})},fn.prototype.updateConnectionOutline=function(e,t){var n=i2(t);q(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})},fn.prototype.registerProvider=function(e,t){t||(t=e,e=Lx),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})},fn.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},fn.prototype.getOutline=function(e){var t,n=this._getProviders();return U(n,function(A){n2(A.getOutline)&&(t=t||A.getOutline(e))}),t},fn.$inject=["eventBus","styles","elementRegistry"];var ra=6;function H1(e,t,n){this._canvas=t;var A=this;e.on("element.changed",function(i){n.isSelected(i.element)&&A._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(i){var o=i.newSelection;A._updateMultiSelectionOutline(o)})}H1.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");co(t);var n=e.length>1,A=this._canvas.getContainer();if(D0(A)[n?"add":"remove"]("djs-multi-select"),!!n){var i=Wx(i2(e)),o=g0("rect");q(o,N({rx:3},i)),D0(o).add("djs-selection-outline"),Q0(t,o)}},H1.$inject=["eventBus","canvas","selection"];function Wx(e){return{x:e.x-ra,y:e.y-ra,width:e.width+ra*2,height:e.height+ra*2}}const Fd={__depends__:[Ce],__init__:["outline","multiSelectionOutline"],outline:["type",fn],multiSelectionOutline:["type",H1]};var _x=500,Ox=1250,Xx=1500,aa=Math.round;function Kx(e){return{x:e.x+aa(e.width/2),y:e.y+aa(e.height/2)}}function vd(e,t,n,A,i){function o(a,c,l,B){return i.allowed("elements.move",{shapes:a,delta:c,position:l,target:B})}e.on("shape.move.start",Xx,function(a){var c=a.context,l=a.shape,B=A.get().slice();B.indexOf(l)===-1&&(B=[l]),B=Zx(B),N(c,{shapes:B,validatedShapes:B,shape:l})}),e.on("shape.move.start",Ox,function(a){var c=a.context,l=c.validatedShapes,B;if(B=c.canExecute=o(l),!B)return!1}),e.on("shape.move.move",_x,function(a){var c=a.context,l=c.validatedShapes,B=a.hover,g={x:a.dx,y:a.dy},p={x:a.x,y:a.y},E;if(E=o(l,g,p,B),c.delta=g,c.canExecute=E,E===null){c.target=null;return}c.target=B}),e.on("shape.move.end",function(a){var c=a.context,l=c.delta,B=c.canExecute,g=B==="attach",p=c.shapes;if(B===!1)return!1;l.x=aa(l.x),l.y=aa(l.y),!(l.x===0&&l.y===0)&&n.moveElements(p,l,c.target,{primaryShape:c.shape,attach:g})}),e.on("element.mousedown",function(a){if(vt(a)){var c=Ln(a);if(!c)throw new Error("must supply DOM mousedown event");return r(c,a.element)}});function r(a,c,l,B){if(V0(l)&&(B=l,l=!1),!(c.waypoints||!c.parent)&&!D0(a.target).has("djs-hit-no-move")){var g=Kx(c);return t.init(a,g,"shape.move",{cursor:"grabbing",autoActivate:l,data:{shape:c,context:B||{}}}),!0}}this.start=r}vd.$inject=["eventBus","dragging","modeling","selection","rules"];function Zx(e){var t=Ve(e,"id");return l0(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}var xd=499,P1="djs-dragging",bd="drop-ok",Yd="drop-not-ok",Ud="new-parent",Nd="attach-ok";function zd(e,t,n,A){function i(c){var l=o(c),B=qx(l);return B}function o(c){var l=YA(c,!0),B=l.flatMap(E=>(E.incoming||[]).concat(E.outgoing||[])),g=l.concat(B),p=[...new Set(g)];return p}function r(c,l){[Nd,bd,Yd,Ud].forEach(function(B){B===l?t.addMarker(c,B):t.removeMarker(c,B)})}function a(c,l,B){A.addDragger(l,c.dragGroup),B&&t.addMarker(l,P1),c.allDraggedElements?c.allDraggedElements.push(l):c.allDraggedElements=[l]}e.on("shape.move.start",xd,function(c){var l=c.context,B=l.shapes,g=l.allDraggedElements,p=i(B);if(!l.dragGroup){var E=g0("g");q(E,n.cls("djs-drag-group",["no-events"]));var d=t.getActiveLayer();Q0(d,E),l.dragGroup=E}p.forEach(function(u){A.addDragger(u,l.dragGroup)}),g?g=no([g,o(B)]):g=o(B),U(g,function(u){t.addMarker(u,P1)}),l.allDraggedElements=g,l.differentParents=$x(B)}),e.on("shape.move.move",xd,function(c){var l=c.context,B=l.dragGroup,g=l.target,p=l.shape.parent,E=l.canExecute;g&&(E==="attach"?r(g,Nd):l.canExecute&&p&&g.id!==p.id?r(g,Ud):r(g,l.canExecute?bd:Yd)),Q2(B,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var l=c.context,B=l.target;B&&r(B,null)}),e.on("shape.move.cleanup",function(c){var l=c.context,B=l.allDraggedElements,g=l.dragGroup;U(B,function(p){t.removeMarker(p,P1)}),g&&s2(g)}),this.makeDraggable=a}zd.$inject=["eventBus","canvas","styles","previewSupport"];function qx(e){var t=l0(e,function(n){return Y0(n)?m0(e,Z2({id:n.source.id}))&&m0(e,Z2({id:n.target.id})):!0});return t}function $x(e){return Ol(Ve(e,function(t){return t.parent&&t.parent.id}))!==1}const eb={__depends__:[ko,Ce,Fd,Te,nt,AA],__init__:["move","movePreview"],move:["type",vd],movePreview:["type",zd]};var Rd=".djs-palette-toggle",Sd=".entry",tb=Rd+", "+Sd,J1="djs-palette-",nb="shown",j1="open",Td="two-column",Ab=1e3;function e2(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(A){var i=A.tool;n.updateToolHighlight(i)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}e2.$inject=["eventBus","canvas"],e2.prototype.registerProvider=function(e,t){t||(t=e,e=Ab),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()},e2.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(ob,{})},e2.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}},e2.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),A=this._container=$(e2.HTML_MARKUP);n.appendChild(A),X(n).add(J1+nb),x2.bind(A,tb,"click",function(i){var o=i.delegateTarget;if(nB(o,Rd))return e.toggle();e.trigger("click",i)}),O.bind(A,"mousedown",function(i){i.stopPropagation()}),x2.bind(A,Sd,"dragstart",function(i){e.trigger("dragstart",i)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:A})},e2.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},e2.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,A=this._eventBus,i,o=X(n),r=X(t);"twoColumn"in e?i=e.twoColumn:i=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(Td,i),r.toggle(J1+Td,i),"open"in e&&(o.toggle(j1,e.open),r.toggle(J1+j1,e.open)),A.fire("palette.changed",{twoColumn:i,open:this.isOpen()})},e2.prototype._update=function(){var e=p0(".djs-palette-entries",this._container),t=this._entries=this.getEntries();vA(e),U(t,function(n,A){var i=n.group||"default",o=p0("[data-group="+LA(i)+"]",e);o||(o=$('<div class="group"></div>'),g2(o,"data-group",i),e.appendChild(o));var r=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),a=$(r);if(o.appendChild(a),!n.separator&&(g2(a,"data-action",A),n.title&&g2(a,"title",n.title),n.className&&ib(a,n.className),n.imageUrl)){var c=$("<img>");g2(c,"src",n.imageUrl),a.appendChild(c)}}),this.open()},e2.prototype.trigger=function(e,t,n){var A,i,o=t.delegateTarget||t.target;return o?(A=g2(o,"data-action"),i=t.originalEvent||t,this.triggerEntry(A,e,i,n)):t.preventDefault()},e2.prototype.triggerEntry=function(e,t,n,A){var i=this._entries,o,r;if(o=i[e],!!o&&(r=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(n2(r)){if(t==="click")return r(n,A)}else if(r[t])return r[t](n,A);n.preventDefault()}},e2.prototype._layoutChanged=function(){this._toggleState({})},e2.prototype._needsCollapse=function(e,t){var n=50,A=Object.keys(t).length*46;return e<A+n},e2.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},e2.prototype.open=function(){this._toggleState({open:!0})},e2.prototype.toggle=function(){this.isOpen()?this.close():this.open()},e2.prototype.isActiveTool=function(e){return e&&this._activeTool===e},e2.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=p0(".djs-palette-entries",this._container),this._toolsContainer=p0("[data-group=tools]",t)),n=this._toolsContainer,U(n.children,function(A){var i=A.getAttribute("data-action");if(i){var o=X(A);i=i.replace("-tool",""),o.contains("entry")&&i===e?o.add("highlighted-entry"):o.remove("highlighted-entry")}})},e2.prototype.isOpen=function(){return X(this._container).has(j1)},e2.prototype._getParentContainer=function(){return this._canvas.getContainer()},e2.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function ib(e,t){var n=X(e),A=n0(t)?t:t.split(/\s+/g);A.forEach(function(i){n.add(i)})}function ob(e,t){var n=t.getPaletteEntries();return n2(n)?n(e):(U(n,function(A,i){e[i]=A}),e)}const rb={__init__:["palette"],palette:["type",e2]};var kd="crosshair";function Cn(e,t,n,A,i,o,r){this._selection=i,this._dragging=n,this._mouse=r;var a=this,c={create:function(l){var B=t.getActiveLayer(),g;g=l.frame=g0("rect"),q(g,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),Q0(B,g)},update:function(l){var B=l.frame,g=l.bbox;q(B,{x:g.x,y:g.y,width:g.width,height:g.height})},remove:function(l){l.frame&&s2(l.frame)}};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(l){var B=l.originalEvent.target;!l.hover&&!(B instanceof SVGElement)||e.once("lasso.selection.ended",function(){a.activateLasso(l.originalEvent,!0)})}),e.on("lasso.end",0,function(l){var B=l.context,g=V1(l),p=A.filter(function(d){return d}),E=So(l);a.select(p,g,E?B.selection:[])}),e.on("lasso.start",function(l){var B=l.context;B.bbox=V1(l),c.create(B),B.selection=i.get()}),e.on("lasso.move",function(l){var B=l.context;B.bbox=V1(l),c.update(B)}),e.on("lasso.cleanup",function(l){var B=l.context;c.remove(B)}),e.on("element.mousedown",1500,function(l){if(So(l))return a.activateLasso(l.originalEvent),!0})}Cn.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Cn.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:kd,data:{context:{}}})},Cn.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:kd,data:{context:{}},keepSelection:!0})},Cn.prototype.select=function(e,t,n=[]){var A=hB(e,t);this._selection.select([...n,...FA(A)])},Cn.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Cn.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};function V1(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y},A;return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?A={x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?A={x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?A={x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?A={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:A={x:n.x,y:n.y,width:0,height:0},A}const ab={__depends__:[Yr,ci],__init__:["lassoTool"],lassoTool:["type",Cn]};var L1=1500,Gd="grab";function gA(e,t,n,A,i,o){this._dragging=n,this._mouse=o;var r=this,a=A.get("keyboard",!1);i.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",L1,function(c){if(Wn(c))return r.activateMove(c.originalEvent,!0),!1}),a&&a.addListener(L1,function(c){if(!(!Hd(c.keyEvent)||r.isActive())){var l=r._mouse.getLastMoveEvent();r.activateMove(l,!!l)}},"keyboard.keydown"),a&&a.addListener(L1,function(c){!Hd(c.keyEvent)||!r.isActive()||r.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var l=c.originalEvent.target;if(!c.hover&&!(l instanceof SVGElement))return!1;e.once("hand.ended",function(){r.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var l=t.viewbox().scale;t.scroll({dx:c.dx*l,dy:c.dy*l})}),e.on("hand.move.end",function(c){var l=c.context,B=l.reactivate;return!Wn(c)&&B&&e.once("hand.move.ended",function(g){r.activateHand(g.originalEvent,!0,!0)}),!1})}gA.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],gA.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Gd,data:{context:n||{}}})},gA.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Gd,data:{context:{reactivate:n}}})},gA.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},gA.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function Hd(e){return E2("Space",e)}const cb={__depends__:[Yr,ci],__init__:["handTool"],handTool:["type",gA]};var Pd="connect-ok",Jd="connect-not-ok";function pA(e,t,n,A,i,o,r){var a=this;this._dragging=t,this._rules=o,this._mouse=r,i.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var l=c.context,B=c.hover,g=l.canStartConnect=a.canStartConnect(B);g!==null&&(l.startTarget=B,A.addMarker(B,g?Pd:Jd))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var l=c.context.startTarget,B=c.context.canStartConnect;l&&A.removeMarker(l,B?Pd:Jd)}),e.on(["global-connect.ended"],function(c){var l=c.context,B=l.startTarget,g={x:c.x,y:c.y},p=a.canStartConnect(B);if(p)return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,B,g)}),!1})}pA.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],pA.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},pA.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},pA.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},pA.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};const sb={__depends__:[Es,Te,nt,Yr,ci],globalConnect:["type",pA]};function W1(e,t,n,A,i,o,r,a){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=A,this._lassoTool=i,this._handTool=o,this._globalConnect=r,this._translate=a,e.registerProvider(this)}W1.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],W1.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,A=this._spaceTool,i=this._lassoTool,o=this._handTool,r=this._globalConnect,a=this._translate;function c(g,p,E,d,u){function h(D){var y=n.createShape(N({type:g},u));t.start(D,y)}return{group:p,className:E,title:d,action:{dragstart:h,click:h}}}function l(g){var p=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),E=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:p});t.start(g,[p,E],{hints:{autoSelect:[p]}})}function B(g){t.start(g,n.createParticipantShape())}return N(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:a("Activate hand tool"),action:{click:function(g){o.activateHand(g)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:a("Activate lasso tool"),action:{click:function(g){i.activateSelection(g)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:a("Activate create/remove space tool"),action:{click:function(g){A.activateSelection(g)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:a("Activate global connect tool"),action:{click:function(g){r.start(g)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",a("Create start event")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",a("Create intermediate/boundary event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",a("Create end event")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",a("Create gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",a("Create task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",a("Create data object reference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",a("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:a("Create expanded sub-process"),action:{dragstart:l,click:l}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:a("Create pool/participant"),action:{dragstart:B,click:B}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",a("Create group"))}),e};const lb={__depends__:[rb,xr,s3,ab,cb,sb,bo],__init__:["paletteProvider"],paletteProvider:["type",W1]};var Bb=250;function _1(e,t,n,A,i){j.call(this,e);function o(a){var c=a.canExecute.replacements;U(c,function(l){var B=l.oldElementId,g={type:l.newElementType};if(!a.visualReplacements[B]){var p=t.get(B);N(g,{x:p.x,y:p.y});var E=n.createShape(g);A.addShape(E,p.parent);var d=p0('[data-element-id="'+LA(p.id)+'"]',a.dragGroup);d&&N2(d,{display:"none"});var u=i.addDragger(E,a.dragGroup);a.visualReplacements[B]=u,A.removeShape(E)}})}function r(a){var c=a.visualReplacements;U(c,function(l,B){var g=p0('[data-element-id="'+LA(B)+'"]',a.dragGroup);g&&N2(g,{display:"inline"}),l.remove(),c[B]&&delete c[B]})}e.on("shape.move.move",Bb,function(a){var c=a.context,l=c.canExecute;c.visualReplacements||(c.visualReplacements={}),l&&l.replacements?o(c):r(c)})}_1.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],W(_1,j);const gb={__depends__:[AA],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",_1]};var pb=1250,O1=40,Eb=20,db=10,jd=20,Vd=["x","y"],ub=Math.abs;function Ld(e){e.on(["connect.hover","connect.move","connect.end"],pb,function(t){var n=t.context,A=n.canExecute,i=n.start,o=n.hover,r=n.source,a=n.target;t.originalEvent&&ne(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),A&&o&&Qb(t,o,fb(o)),o&&mb(A,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=ie(i),a0(o,["bpmn:Event","bpmn:Gateway"])&&Wd(t,ie(o)),a0(o,["bpmn:Task","bpmn:SubProcess"])&&hb(t,o),f(r,"bpmn:BoundaryEvent")&&a===r.host&&wb(t)):_d(A,"bpmn:MessageFlow")?(f(i,"bpmn:Event")&&(n.connectionStart=ie(i)),f(o,"bpmn:Event")&&Wd(t,ie(o))):n.connectionStart=n.initialConnectionStart)})}Ld.$inject=["eventBus"];function Qb(e,t,n){Vd.forEach(function(A){var i=Od(A,t);e[A]<t[A]+n?$0(e,A,t[A]+n):e[A]>t[A]+i-n&&$0(e,A,t[A]+i-n)})}function hb(e,t){var n=ie(t);Vd.forEach(function(A){Cb(e,t,A)&&$0(e,A,n[A])})}function wb(e){var t=e.context,n=t.source,A=t.target;if(!Mb(t)){var i=ie(n),o=f2(i,A,-10),r=[];/top|bottom/.test(o)&&r.push("x"),/left|right/.test(o)&&r.push("y"),r.forEach(function(a){var c=e[a],l;ub(c-i[a])<O1&&(c>i[a]?l=i[a]+O1:l=i[a]-O1,$0(e,a,l))})}}function Wd(e,t){$0(e,"x",t.x),$0(e,"y",t.y)}function _d(e,t){return e&&e.type===t}function mb(e,t){return Qe(t,function(n){return _d(e,n)})}function Od(e,t){return e==="x"?t.width:t.height}function fb(e){return f(e,"bpmn:Task")?db:Eb}function Cb(e,t,n){return e[n]>t[n]+jd&&e[n]<t[n]+Od(n,t)-jd}function Mb(e){var t=e.hover,n=e.source;return t&&n&&t===n}function jt(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}jt.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},jt.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},jt.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},jt.prototype.getSnapLocations=function(){return this._snapLocations},jt.prototype.setSnapLocations=function(e){this._snapLocations=e},jt.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new ca,n.initDefaults(this._defaultSnaps)),n};function ca(){this._snapValues={}}ca.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)},ca.prototype.snap=function(e,t,n,A){var i=this._snapValues[t];return i&&zy(e[n],i[n],A)},ca.prototype.initDefaults=function(e){var t=this;U(e||{},function(n,A){U(n,function(i){t.add(A,i)})})};var Db=1250;function Ge(e,t,n){var A=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(i){A.initSnap(i)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],Db,function(i){var o=i.context,r=o.shape,a=o.snapContext,c=o.target;if(!(i.originalEvent&&ne(i.originalEvent))&&!(nA(i)||!c)){var l=a.pointsForTarget(c);l.initialized||(l=A.addSnapTargetPoints(l,r,c),l.initialized=!0),n.snap(i,l)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}Ge.$inject=["elementRegistry","eventBus","snapping"],Ge.prototype.initSnap=function(e){var t=this._elementRegistry,n=e.context,A=n.shape,i=n.snapContext;i||(i=n.snapContext=new jt);var o;t.get(A.id)?o=ie(A,e):o={x:e.x+ie(A).x,y:e.y+ie(A).y};var r={x:o.x-A.width/2,y:o.y-A.height/2},a={x:o.x+A.width/2,y:o.y+A.height/2};return i.setSnapOrigin("mid",{x:o.x-e.x,y:o.y-e.y}),f0(A)||(i.setSnapOrigin("top-left",{x:r.x-e.x,y:r.y-e.y}),i.setSnapOrigin("bottom-right",{x:a.x-e.x,y:a.y-e.y})),i},Ge.prototype.addSnapTargetPoints=function(e,t,n){var A=this.getSnapTargets(t,n);return U(A,function(i){if(f0(i)){f0(t)&&e.add("mid",ie(i));return}if(Y0(i)){if(i.waypoints.length<3)return;var o=i.waypoints.slice(1,-1);U(o,function(r){e.add("mid",r)});return}e.add("mid",ie(i))}),!A0(t.x)||!A0(t.y)||this._elementRegistry.get(t.id)&&e.add("mid",ie(t)),e},Ge.prototype.getSnapTargets=function(e,t){return y4(t).filter(function(n){return!yb(n)})};function yb(e){return!!e.hidden}var Xd=1500;function EA(e,t){t.invoke(Ge,this),e.on(["create.move","create.end"],Xd,xb),e.on(["create.move","create.end","shape.move.move","shape.move.end"],Xd,function(n){var A=n.context,i=A.canExecute,o=A.target,r=i&&(i==="attach"||i.attach);r&&!nA(n)&&Ib(n,o)})}W(EA,Ge),EA.$inject=["eventBus","injector"],EA.prototype.initSnap=function(e){var t=Ge.prototype.initSnap.call(this,e),n=e.shape,A=!!this._elementRegistry.get(n.id);return U(n.outgoing,function(i){var o=i.waypoints[0];o=o.original||o,t.setSnapOrigin(i.id+"-docking",Zd(o,A,e))}),U(n.incoming,function(i){var o=i.waypoints[i.waypoints.length-1];o=o.original||o,t.setSnapOrigin(i.id+"-docking",Zd(o,A,e))}),f(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},EA.prototype.addSnapTargetPoints=function(e,t,n){Ge.prototype.addSnapTargetPoints.call(this,e,t,n);var A=this.getSnapTargets(t,n);U(A,function(o){(vb(o)||Fb([t,o],"bpmn:TextAnnotation"))&&(e.add("top-left",M4(o)),e.add("bottom-right",D4(o)))});var i=this._elementRegistry;return U(t.incoming,function(o){if(i.get(t.id)){Kd(A,o.source)||e.add("mid",i0(o.source));var r=o.waypoints[0];e.add(o.id+"-docking",r.original||r)}}),U(t.outgoing,function(o){if(i.get(t.id)){Kd(A,o.target)||e.add("mid",i0(o.target));var r=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",r.original||r)}}),f(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},EA.prototype.getSnapTargets=function(e,t){return Ge.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!f(n,"bpmn:Lane")})};function Ib(e,t){var n=e0(t),A=CE(e,t),i=e.context,o=i.shape,r;o.parent?r={x:0,y:0}:r=i0(o),/top/.test(A)?$0(e,"y",n.top-r.y):/bottom/.test(A)&&$0(e,"y",n.bottom-r.y),/left/.test(A)?$0(e,"x",n.left-r.x):/right/.test(A)&&$0(e,"x",n.right-r.x)}function Fb(e,t){return e.every(function(n){return f(n,t)})}function vb(e){return f(e,"bpmn:SubProcess")&&E0(e)?!0:f(e,"bpmn:Participant")}function xb(e){var t=e.context,n=t.createConstraints;if(n){var A=n.top,i=n.right,o=n.bottom,r=n.left;(r&&r>=e.x||i&&i<=e.x)&&$0(e,"x",e.x),(A&&A>=e.y||o&&o<=e.y)&&$0(e,"y",e.y)}}function Kd(e,t){return e.indexOf(t)!==-1}function Zd(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}var bb=1250;function Ui(e,t){var n=this;e.on(["resize.start"],function(A){n.initSnap(A)}),e.on(["resize.move","resize.end"],bb,function(A){var i=A.context,o=i.shape,r=o.parent,a=i.direction,c=i.snapContext;if(!(A.originalEvent&&ne(A.originalEvent))&&!nA(A)){var l=c.pointsForTarget(r);l.initialized||(l=n.addSnapTargetPoints(l,o,r,a),l.initialized=!0),Nb(a)&&$0(A,"x",A.x),zb(a)&&$0(A,"y",A.y),t.snap(A,l)}}),e.on(["resize.cleanup"],function(){t.hide()})}Ui.prototype.initSnap=function(e){var t=e.context,n=t.shape,A=t.direction,i=t.snapContext;i||(i=t.snapContext=new jt);var o=qd(n,A);return i.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),i},Ui.prototype.addSnapTargetPoints=function(e,t,n,A){var i=this.getSnapTargets(t,n);return U(i,function(o){e.add("corner",D4(o)),e.add("corner",M4(o))}),e.add("corner",qd(t,A)),e},Ui.$inject=["eventBus","snapping"],Ui.prototype.getSnapTargets=function(e,t){return y4(t).filter(function(n){return!Yb(n,e)&&!Y0(n)&&!Ub(n)&&!f0(n)})};function qd(e,t){var n=i0(e),A=e0(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=A.top:t.indexOf("s")!==-1&&(i.y=A.bottom),t.indexOf("e")!==-1?i.x=A.right:t.indexOf("w")!==-1&&(i.x=A.left),i}function Yb(e,t){return e.host===t}function Ub(e){return!!e.hidden}function Nb(e){return e==="n"||e==="s"}function zb(e){return e==="e"||e==="w"}var Rb=7,Sb=1e3;function Vt(e){this._canvas=e,this._asyncHide=tc(v2(this.hide,this),Sb)}Vt.$inject=["canvas"],Vt.prototype.snap=function(e,t){var n=e.context,A=n.snapContext,i=A.getSnapLocations(),o={x:nA(e,"x"),y:nA(e,"y")};U(i,function(r){var a=A.getSnapOrigin(r),c={x:e.x+a.x,y:e.y+a.y};if(U(["x","y"],function(l){var B;o[l]||(B=t.snap(c,r,l,Rb),B!==void 0&&(o[l]={value:B,originValue:B-a[l]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),U(["x","y"],function(r){var a=o[r];V0(a)&&$0(e,r,a.originValue)})},Vt.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=g0("path");return q(n,{d:"M0,0 L0,0"}),D0(n).add("djs-snap-line"),Q0(t,n),{update:function(A){A0(A)?e==="horizontal"?q(n,{d:"M-100000,"+A+" L+100000,"+A,display:""}):q(n,{d:"M "+A+",-100000 L "+A+", +100000",display:""}):q(n,{display:"none"})}}},Vt.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Vt.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},Vt.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},Vt.prototype.hide=function(){U(this._snapLines,function(e){e.update()})};const Tb={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Ge],resizeSnapping:["type",Ui],snapping:["type",Vt]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Ld],createMoveSnapping:["type",EA]};var $d=300;function r0(e,t,n,A){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=e,this._eventBus=t,this._selection=n,this._translate=A,this._container=this._getBoxHtml(),this._searchInput=p0(r0.INPUT_SELECTOR,this._container),this._resultsContainer=p0(r0.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}r0.$inject=["canvas","eventBus","selection","translate"],r0.prototype._bindEvents=function(){var e=this;function t(n,A,i,o){e._eventMaps.push({el:n,type:i,listener:x2.bind(n,A,i,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,r0.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,r0.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,r0.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,r0.INPUT_SELECTOR,"keydown",function(n){E2("ArrowUp",n)&&n.preventDefault(),E2("ArrowDown",n)&&n.preventDefault()}),t(this._container,r0.INPUT_SELECTOR,"keyup",function(n){if(E2("Escape",n))return e.close();if(E2("Enter",n)){var A=e._getCurrentResult();return A?e._select(A):e.close(!1)}if(E2("ArrowUp",n))return e._scrollToDirection(!0);if(E2("ArrowDown",n))return e._scrollToDirection();E2(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})},r0.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){x2.unbind(e.el,e.type,e.listener)})},r0.prototype._search=function(e){var t=this;if(this._clearResults(),!!e.trim()){var n=this._searchProvider.find(e);if(n=n.filter(function(i){return!t._canvas.getRootElements().includes(i.element)}),!n.length){this._selection.select(null);return}n.forEach(function(i){var o=i.element.id,r=t._createResultNode(i,o);t._results[o]={element:i.element,node:r}});var A=p0(r0.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(A),this._preselect(A)}},r0.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},r0.prototype._scrollToNode=function(e){if(!(!e||e===this._getCurrentResult())){var t=e.offsetTop,n=this._resultsContainer.scrollTop,A=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<A&&(this._resultsContainer.scrollTop=A)}},r0.prototype._clearResults=function(){vA(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")},r0.prototype._getCurrentResult=function(){return p0(r0.RESULT_SELECTED_SELECTOR,this._resultsContainer)},r0.prototype._createResultNode=function(e,t){var n=$(r0.RESULT_HTML);return e.primaryTokens.length>0&&eu(n,e.primaryTokens,r0.RESULT_PRIMARY_HTML),eu(n,e.secondaryTokens,r0.RESULT_SECONDARY_HTML),g2(n,r0.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},r0.prototype.registerProvider=function(e){this._searchProvider=e},r0.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,X(this._canvas.getContainer()).add("djs-search-open"),X(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},r0.prototype.close=function(e=!0){this.isOpen()&&(e&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,X(this._canvas.getContainer()).remove("djs-search-open"),X(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())},r0.prototype.toggle=function(){this.isOpen()?this.close():this.open()},r0.prototype.isOpen=function(){return this._open},r0.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&X(t).remove(r0.RESULT_SELECTED_CLASS);var n=g2(e,r0.RESULT_ID_ATTRIBUTE),A=this._results[n].element;X(e).add(r0.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(A,{top:$d}),this._selection.select(A),this._eventBus.fire("searchPad.preselected",A)}},r0.prototype._select=function(e){var t=g2(e,r0.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:$d}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},r0.prototype._getBoxHtml=function(){const e=$(r0.BOX_HTML),t=p0(r0.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function eu(e,t,n){var A=kb(t),i=$(n);i.innerHTML=A,e.appendChild(i)}function kb(e){var t="";return e.forEach(function(n){var A=qe(n.value||n.matched||n.normal),i=n.match||n.matched;i?t+='<b class="'+r0.RESULT_HIGHLIGHT_CLASS+'">'+A+"</b>":t+=A}),t!==""?t:null}r0.CONTAINER_SELECTOR=".djs-search-container",r0.INPUT_SELECTOR=".djs-search-input input",r0.RESULTS_CONTAINER_SELECTOR=".djs-search-results",r0.RESULT_SELECTOR=".djs-search-result",r0.RESULT_SELECTED_CLASS="djs-search-result-selected",r0.RESULT_SELECTED_SELECTOR="."+r0.RESULT_SELECTED_CLASS,r0.RESULT_ID_ATTRIBUTE="data-result-id",r0.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",r0.BOX_HTML=`<div class="djs-search-container djs-scrollable">
267
+ </svg>`},qv=900;function Fi(e,t,n,A){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=A,e.registerProvider("align-elements",qv,this)}Fi.$inject=["popupMenu","distributeElements","translate","rules"],Fi.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&N(t,this._getEntries(e)),t},Fi.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},Fi.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,A=this._popupMenu,i={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:td.horizontal,action:function(o,r){t.trigger(e,"horizontal"),A.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:td.vertical,action:function(o,r){t.trigger(e,"vertical"),A.close()}}};return i};const $v={__depends__:[$c,Zv],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",Zr],distributeElementsMenuProvider:["type",Fi]};var nd="is not a registered action",ex="is already registered";function Be(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Be.$inject=["eventBus","injector"],Be.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),A=e.get("selection",!1),i=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),r=e.get("canvas",!1),a=e.get("rules",!1),c=e.get("keyboardMove",!1),l=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&A&&this.register("copy",function(){var B=A.get();if(B.length)return o.copy(B)}),o&&this.register("paste",function(){o.paste()}),i&&this.register("stepZoom",function(B){i.stepZoom(B.value)}),r&&this.register("zoom",function(B){r.zoom(B.value)}),n&&A&&a&&this.register("removeSelection",function(){var B=A.get();if(B.length){var g=a.allowed("elements.delete",{elements:B}),p;g!==!1&&(n0(g)?p=g:p=B,p.length&&n.removeElements(p.slice()))}}),c&&this.register("moveCanvas",function(B){c.moveCanvas(B)}),l&&this.register("moveSelection",function(B){l.moveSelection(B.direction,B.accelerated)})},Be.prototype.trigger=function(e,t){if(!this._actions[e])throw R1(e,nd);return this._actions[e](t)},Be.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);U(e,function(A,i){n._registerAction(i,A)})},Be.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw R1(e,ex);this._actions[e]=t},Be.prototype.unregister=function(e){if(!this.isRegistered(e))throw R1(e,nd);this._actions[e]=void 0},Be.prototype.getActions=function(){return Object.keys(this._actions)},Be.prototype.isRegistered=function(e){return!!this._actions[e]};function R1(e,t){return new Error(e+" "+t)}const tx={__init__:["editorActions"],editorActions:["type",Be]};function qr(e){e.invoke(Be,this)}W(qr,Be),qr.$inject=["injector"],qr.prototype._registerDefaultActions=function(e){Be.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),A=e.get("selection",!1),i=e.get("spaceTool",!1),o=e.get("lassoTool",!1),r=e.get("handTool",!1),a=e.get("globalConnect",!1),c=e.get("distributeElements",!1),l=e.get("alignElements",!1),B=e.get("directEditing",!1),g=e.get("searchPad",!1),p=e.get("modeling",!1),E=e.get("contextPad",!1);t&&n&&A&&this._registerAction("selectElements",function(){var d=t.getRootElement(),u=n.filter(function(h){return h!==d});return A.select(u),u}),i&&this._registerAction("spaceTool",function(){i.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),r&&this._registerAction("handTool",function(){r.toggle()}),a&&this._registerAction("globalConnectTool",function(){a.toggle()}),A&&c&&this._registerAction("distributeElements",function(d){var u=A.get(),h=d.type;u.length&&c.trigger(u,h)}),A&&l&&this._registerAction("alignElements",function(d){var u=A.get(),h=[],D=d.type;u.length&&(h=l0(u,function(y){return!f(y,"bpmn:Lane")}),l.trigger(h,D))}),A&&p&&this._registerAction("setColor",function(d){var u=A.get();u.length&&p.setColor(u,d)}),A&&B&&this._registerAction("directEditing",function(){var d=A.get();d.length&&B.activate(d[0])}),g&&this._registerAction("find",function(){g.toggle()}),t&&p&&this._registerAction("moveToOrigin",function(){var d=t.getRootElement(),u,h;f(d,"bpmn:Collaboration")?h=n.filter(function(D){return f(D.parent,"bpmn:Collaboration")}):h=n.filter(function(D){return D!==d&&!f(D.parent,"bpmn:SubProcess")}),u=i2(h),p.moveElements(h,{x:-u.x,y:-u.y},d)}),A&&E&&this._registerAction("replaceElement",function(d){E.triggerEntry("replace","click",d)})};const nx={__depends__:[tx],editorActions:["type",qr]};function Ad(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,A=t.shape;a0(A,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}Ad.$inject=["eventBus"];var $r=10;function S1(e,t,n){return n||(n="round"),Math[n](e/t)*t}var Ax=1200,ix=800;function Pt(e,t,n){var A=!n||n.active!==!1;this._eventBus=t;var i=this;t.on("diagram.init",ix,function(){i.setActive(A)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],Ax,function(o){var r=o.originalEvent;if(!(!i.active||r&&ne(r))){var a=o.context,c=a.gridSnappingContext;c||(c=a.gridSnappingContext={}),["x","y"].forEach(function(l){var B={},g=rx(o,l,e);g&&(B.offset=g);var p=ox(o,l);p&&N(B,p),nA(o,l)||i.snapEvent(o,l,B)})}})}Pt.prototype.snapEvent=function(e,t,n){var A=this.snapValue(e[t],n);$0(e,t,A)},Pt.prototype.getGridSpacing=function(){return $r},Pt.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=S1(e,$r);var A,i;return t&&t.min&&(A=t.min,A0(A)&&(A=S1(A+n,$r,"ceil"),e=Math.max(e,A))),t&&t.max&&(i=t.max,A0(i)&&(i=S1(i+n,$r,"floor"),e=Math.min(e,i))),e-=n,e},Pt.prototype.isActive=function(){return this.active},Pt.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},Pt.prototype.toggleActive=function(){this.setActive(!this.active)},Pt.$inject=["elementRegistry","eventBus","config.gridSnapping"];function ox(e,t){var n=e.context,A=n.createConstraints,i=n.resizeConstraints||{},o=n.gridSnappingContext,r=o.snapConstraints;if(r&&r[t])return r[t];r||(r=o.snapConstraints={}),r[t]||(r[t]={});var a=n.direction;A&&(ea(t)?(r.x.min=A.left,r.x.max=A.right):(r.y.min=A.top,r.y.max=A.bottom));var c=i.min,l=i.max;return c&&(ea(t)?od(a)?r.x.max=c.left:r.x.min=c.right:id(a)?r.y.max=c.top:r.y.min=c.bottom),l&&(ea(t)?od(a)?r.x.min=l.left:r.x.max=l.right:id(a)?r.y.min=l.top:r.y.max=l.bottom),r[t]}function rx(e,t,n){var A=e.context,i=e.shape,o=A.gridSnappingContext,r=o.snapLocation,a=o.snapOffset;return a&&A0(a[t])||(a||(a=o.snapOffset={}),A0(a[t])||(a[t]=0),!i)||(n.get(i.id)||(ea(t)?a[t]+=i[t]+i.width/2:a[t]+=i[t]+i.height/2),!r)||(t==="x"?/left/.test(r)?a[t]-=i.width/2:/right/.test(r)&&(a[t]+=i.width/2):/top/.test(r)?a[t]-=i.height/2:/bottom/.test(r)&&(a[t]+=i.height/2)),a[t]}function ea(e){return e==="x"}function id(e){return e.indexOf("n")!==-1}function od(e){return e.indexOf("w")!==-1}function mn(e,t){j.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(A){var i=A.context,o=i.hints||{},r=o.autoResize;if(r){var a=i.shape,c=i.newBounds;U2(r)?i.newBounds=n.snapComplex(c,r):i.newBounds=n.snapSimple(a,c)}})}mn.$inject=["eventBus","gridSnapping","modeling"],W(mn,j),mn.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},mn.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},mn.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,A=/w/.test(t),i=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),i&&(A?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),N(e,o),e},mn.prototype.snapVertically=function(e,t){var n=this._gridSnapping,A=/n/.test(t),i=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),A&&(i?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),N(e,o),e};var ax=2e3;function rd(e,t){e.on(["spaceTool.move","spaceTool.end"],ax,function(n){var A=n.context;if(A.initialized){var i=A.axis,o;i==="x"?(o=t.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=t.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}rd.$inject=["eventBus","gridSnapping"];const cx={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",mn],gridSnappingSpaceToolBehavior:["type",rd]}],__init__:["gridSnapping"],gridSnapping:["type",Pt]};var sx=2e3;function ad(e,t,n){e.on("autoPlace",sx,function(A){var i=A.source,o=i0(i),r=A.shape,a=Op(i,r,n);return["x","y"].forEach(function(c){var l={};a[c]!==o[c]&&(a[c]>o[c]?l.min=a[c]:l.max=a[c],f(r,"bpmn:TextAnnotation")&&(lx(c)?l.offset=-r.width/2:l.offset=-r.height/2),a[c]=t.snapValue(a[c],l))}),a})}ad.$inject=["eventBus","gridSnapping","elementRegistry"];function lx(e){return e==="x"}var Bx=1750;function cd(e,t,n){t.on(["create.start","shape.move.start"],Bx,function(A){var i=A.context,o=i.shape,r=e.getRootElement();if(!(!f(o,"bpmn:Participant")||!f(r,"bpmn:Process")||!r.children.length)){var a=i.createConstraints;a&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}cd.$inject=["canvas","eventBus","gridSnapping"];var gx=3e3;function ta(e,t,n){j.call(this,e),this._gridSnapping=t;var A=this;this.postExecuted(["connection.create","connection.layout"],gx,function(i){var o=i.context,r=o.connection,a=o.hints||{},c=r.waypoints;a.connectionStart||a.connectionEnd||a.createElementsBehavior===!1||px(c)&&n.updateWaypoints(r,A.snapMiddleSegments(c))})}ta.$inject=["eventBus","gridSnapping","modeling"],W(ta,j),ta.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var A=1;A<e.length-2;A++)n=ux(t,e[A],e[A+1]),e[A]=n[0],e[A+1]=n[1];return e};function px(e){return e.length>3}function Ex(e){return e==="h"}function dx(e){return e==="v"}function ux(e,t,n){var A=We(t,n),i={};return Ex(A)&&(i.y=e.snapValue(t.y)),dx(A)&&(i.x=e.snapValue(t.x)),("x"in i||"y"in i)&&(t=N({},t,i),n=N({},n,i)),[t,n]}const Qx={__depends__:[cx,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",ad],gridSnappingParticipantBehavior:["type",cd],gridSnappingLayoutConnectionBehavior:["type",ta]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",Ad]};var hx=30,sd=30;function vi(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(A){var i=A.element,o=A.gfx;if(f(i,"bpmn:Lane"))return n._createParticipantHit(i,o);if(f(i,"bpmn:Participant"))return E0(i)?n._createParticipantHit(i,o):n._createDefaultHit(i,o);if(f(i,"bpmn:SubProcess"))return E0(i)?n._createSubProcessHit(i,o):n._createDefaultHit(i,o)})}vi.$inject=["eventBus","interactionEvents"],vi.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},vi.prototype._createParticipantHit=function(e,t){this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height});var n=l2(e)?{width:hx,height:e.height}:{width:e.width,height:sd};return this._interactionEvents.createBoxHit(t,"all",n),!0},vi.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:sd}),!0};const wx={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",vi]};function na(e){e.invoke(On,this)}W(na,On),na.$inject=["injector"],na.prototype.registerBindings=function(e,t){On.prototype.registerBindings.call(this,e,t);function n(A,i){t.isRegistered(A)&&e.addListener(i)}n("selectElements",function(A){var i=A.keyEvent;if(e.isKey(["a","A"],i)&&e.isCmd(i))return t.trigger("selectElements"),!0}),n("find",function(A){var i=A.keyEvent;if(e.isKey(["f","F"],i)&&e.isCmd(i))return t.trigger("find"),!0}),n("spaceTool",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["s","S"],i))return t.trigger("spaceTool"),!0}),n("lassoTool",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["l","L"],i))return t.trigger("lassoTool"),!0}),n("handTool",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["h","H"],i))return t.trigger("handTool"),!0}),n("globalConnectTool",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["c","C"],i))return t.trigger("globalConnectTool"),!0}),n("directEditing",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["e","E"],i))return t.trigger("directEditing"),!0}),n("replaceElement",function(A){var i=A.keyEvent;if(!e.hasModifier(i)&&e.isKey(["r","R"],i))return t.trigger("replaceElement",i),!0})};const mx={__depends__:[Gc],__init__:["keyboardBindings"],keyboardBindings:["type",na]};var fx={moveSpeed:1,moveSpeedAccelerated:10},Cx=1500,ld="left",Bd="up",gd="right",pd="down",Mx={ArrowLeft:ld,Left:ld,ArrowUp:Bd,Up:Bd,ArrowRight:gd,Right:gd,ArrowDown:pd,Down:pd},Dx={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function Ed(e,t,n,A,i){var o=this;this._config=N({},fx,e||{}),t.addListener(Cx,function(r){var a=r.keyEvent,c=Mx[a.key];if(c&&!t.isCmd(a)){var l=t.isShift(a);return o.moveSelection(c,l),!0}}),this.moveSelection=function(r,a){var c=i.get();if(c.length){var l=this._config[a?"moveSpeedAccelerated":"moveSpeed"],B=Dx[r](l),g=A.allowed("elements.move",{shapes:c});g&&n.moveElements(c,B)}}}Ed.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const yx={__depends__:[Gc,Ce],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",Ed]};var dd=10;function xi(e,t,n,A){this._dragging=A,this._rules=t;var i=this;function o(c,l){var B=c.shape,g=c.direction,p=c.resizeConstraints,E;c.delta=l,E=sI(B,g,l),c.newBounds=BI(E,p),c.canExecute=i.canResize(c)}function r(c){var l=c.resizeConstraints,B=c.minBounds;l===void 0&&(B===void 0&&(B=i.computeMinResizeBox(c)),c.resizeConstraints={min:e0(B)})}function a(c){var l=c.shape,B=c.canExecute,g=c.newBounds;if(B){if(g=zB(g),!Ix(l,g))return;n.resizeShape(l,g)}}e.on("resize.start",function(c){r(c.context)}),e.on("resize.move",function(c){var l={x:c.dx,y:c.dy};o(c.context,l)}),e.on("resize.end",function(c){a(c.context)})}xi.prototype.canResize=function(e){var t=this._rules,n=q2(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},xi.prototype.activate=function(e,t,n){var A=this._dragging,i,o;if(typeof n=="string"&&(n={direction:n}),i=N({shape:t},n),o=i.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");A.init(e,ud(t,o),"resize",{autoActivate:!0,cursor:Fx(o),data:{shape:t,context:i}})},xi.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,A,i;return A=e.minDimensions||{width:dd,height:dd},i=H4(t,e.childrenBoxPadding),gI(n,t,A,i)},xi.$inject=["eventBus","rules","modeling","dragging"];function Ix(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function ud(e,t){var n=i0(e),A=e0(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=A.top:t.indexOf("s")!==-1&&(i.y=A.bottom),t.indexOf("e")!==-1?i.x=A.right:t.indexOf("w")!==-1&&(i.x=A.left),i}function Fx(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var Qd="djs-resizing",hd="resize-not-ok",vx=500;function wd(e,t,n){function A(o){var r=o.shape,a=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(r,t.getActiveLayer()),t.addMarker(r,Qd)),a.width>5&&q(c,{x:a.x,width:a.width}),a.height>5&&q(c,{y:a.y,height:a.height}),o.canExecute?D0(c).remove(hd):D0(c).add(hd)}function i(o){var r=o.shape,a=o.frame;a&&s2(o.frame),t.removeMarker(r,Qd)}e.on("resize.move",vx,function(o){A(o.context)}),e.on("resize.cleanup",function(o){i(o.context)})}wd.$inject=["eventBus","canvas","previewSupport"];var Aa=-6,ia=8,oa=20,bi="djs-resizer",xx=["n","w","s","e","nw","ne","se","sw"];function Jt(e,t,n,A){this._resize=A,this._canvas=t;var i=this;e.on("selection.changed",function(o){var r=o.newSelection;i.removeResizers(),r.length===1&&U(r,v2(i.addResizer,i))}),e.on("shape.changed",function(o){var r=o.element;n.isSelected(r)&&(i.removeResizers(),i.addResizer(r))})}Jt.prototype.makeDraggable=function(e,t,n){var A=this._resize;function i(o){vt(o)&&A.activate(o,e,n)}O.bind(t,"mousedown",i),O.bind(t,"touchstart",i)},Jt.prototype._createResizer=function(e,t,n,A){var i=this._getResizersParent(),o=bx(A),r=g0("g");D0(r).add(bi),D0(r).add(bi+"-"+e.id),D0(r).add(bi+"-"+A),h0(i,r);var a=g0("rect");q(a,{x:-ia/2+o.x,y:-ia/2+o.y,width:ia,height:ia}),D0(a).add(bi+"-visual"),h0(r,a);var c=g0("rect");return q(c,{x:-oa/2+o.x,y:-oa/2+o.y,width:oa,height:oa}),D0(c).add(bi+"-hit"),h0(r,c),mo(r,t,n),r},Jt.prototype.createResizer=function(e,t){var n=ud(e,t),A=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,A,t)},Jt.prototype.addResizer=function(e){var t=this;Y0(e)||!this._resize.canResize({shape:e})||U(xx,function(n){t.createResizer(e,n)})},Jt.prototype.removeResizers=function(){var e=this._getResizersParent();co(e)},Jt.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Jt.$inject=["eventBus","canvas","selection","resize"];function bx(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-Aa:e.indexOf("w")!==-1&&(t.x=Aa),e.indexOf("s")!==-1?t.y=-Aa:e.indexOf("n")!==-1&&(t.y=Aa),t}const md={__depends__:[Te,nt,AA],__init__:["resize","resizePreview","resizeHandles"],resize:["type",xi],resizePreview:["type",wd],resizeHandles:["type",Jt]};var Yx=2e3;function Yi(e,t,n,A,i,o,r){this._bpmnFactory=t,this._canvas=n,this._modeling=i,this._textRenderer=r,A.registerProvider(this),e.on("element.dblclick",function(c){a(c.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){A.isActive()&&A.complete()}),e.on(["shape.remove","connection.remove"],Yx,function(c){A.isActive(c.element)&&A.cancel()}),e.on(["commandStack.changed"],function(c){A.isActive()&&A.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var l=c.context,B=l.shape,g=c.context.canExecute,p=c.isTouch;p||g&&(l.hints&&l.hints.createElementsBehavior===!1||a(B))}),e.on("autoPlace.end",500,function(c){a(c.shape)});function a(c,l){(l||a0(c,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||T1(c))&&A.activate(c)}}Yi.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Yi.prototype.activate=function(e){var t=fe(e);if(t!==void 0){var n={text:t},A=this.getEditingBBox(e);N(n,A);var i={},o=n.style||{};return N(o,{backgroundColor:null,border:null}),(a0(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||T1(e))&&N(i,{centerVertically:!0}),an(e)&&(N(i,{autoResize:!0}),N(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),f(e,"bpmn:TextAnnotation")&&(N(i,{resizable:!0,autoResize:!0}),N(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),N(n,{options:i,style:o}),n}},Yi.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,A=t.getAbsoluteBBox(n),i={x:A.x+A.width/2,y:A.y+A.height/2},o={x:A.x,y:A.y},r=t.zoom(),a=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),l=c.fontSize*r,B=c.lineHeight,g=a.fontSize*r,p=a.lineHeight,E={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(f(e,"bpmn:Lane")||zx(e)){var d=l2(e),u=d?{width:A.height,height:30*r,x:A.x-A.height/2+15*r,y:i.y-30*r/2}:{width:A.width,height:30*r};N(o,u),N(E,{fontSize:g+"px",lineHeight:p,paddingTop:7*r+"px",paddingBottom:7*r+"px",paddingLeft:5*r+"px",paddingRight:5*r+"px",transform:d?"rotate(-90deg)":null})}if(Nx(e)){var h=l2(e),D=h?{width:A.width,height:A.height}:{width:A.height,height:A.width,x:i.x-A.height/2,y:i.y-A.width/2};N(o,D),N(E,{fontSize:g+"px",lineHeight:p,paddingTop:7*r+"px",paddingBottom:7*r+"px",paddingLeft:5*r+"px",paddingRight:5*r+"px",transform:h?null:"rotate(-90deg)"})}(a0(e,["bpmn:Task","bpmn:CallActivity"])||T1(e))&&(N(o,{width:A.width,height:A.height}),N(E,{fontSize:g+"px",lineHeight:p,paddingTop:7*r+"px",paddingBottom:7*r+"px",paddingLeft:5*r+"px",paddingRight:5*r+"px"})),Ux(e)&&(N(o,{width:A.width,x:A.x}),N(E,{fontSize:g+"px",lineHeight:p,paddingTop:7*r+"px",paddingBottom:7*r+"px",paddingLeft:5*r+"px",paddingRight:5*r+"px"}));var y=90*r,C=7*r,m=4*r;if(n.labelTarget&&(N(o,{width:y,height:A.height+C+m,x:i.x-y/2,y:A.y-C}),N(E,{fontSize:l+"px",lineHeight:B,paddingTop:C+"px",paddingBottom:m+"px"})),an(n)&&!Io(n)&&!f0(n)){var I=Nc(e),x=t.getAbsoluteBBox({x:I.x,y:I.y,width:0,height:0}),v=l+C+m;N(o,{width:y,height:v,x:x.x-y/2,y:x.y-v/2}),N(E,{fontSize:l+"px",lineHeight:B,paddingTop:C+"px",paddingBottom:m+"px"})}return f(e,"bpmn:TextAnnotation")&&(N(o,{width:A.width,height:A.height,minWidth:30*r,minHeight:10*r}),N(E,{textAlign:"left",paddingTop:5*r+"px",paddingBottom:7*r+"px",paddingLeft:7*r+"px",paddingRight:5*r+"px",fontSize:g+"px",lineHeight:p})),{bounds:o,style:E}},Yi.prototype.update=function(e,t,n,A){var i,o;f(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),i={x:e.x,y:e.y,width:e.width/o.width*A.width,height:e.height/o.height*A.height}),Rx(t)&&(t=null),this._modeling.updateLabel(e,t,i)};function T1(e){return f(e,"bpmn:SubProcess")&&!E0(e)}function Ux(e){return f(e,"bpmn:SubProcess")&&E0(e)}function Nx(e){return f(e,"bpmn:Participant")&&!E0(e)}function zx(e){return f(e,"bpmn:Participant")&&E0(e)}function Rx(e){return!e||!e.trim()}var fd="djs-element-hidden",Cd="djs-label-hidden";function Md(e,t,n){var A=this,i=t.getDefaultLayer(),o,r,a;e.on("directEditing.activate",function(c){var l=c.active;if(o=l.element.label||l.element,f(o,"bpmn:TextAnnotation")){r=t.getAbsoluteBBox(o),a=c2("g");var B=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),g=A.path=c2("path");N2(g,{d:B,strokeWidth:2,stroke:Sx(o)}),me(a,g),me(i,a),Q2(a,o.x,o.y)}f(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,fd):(f(o,"bpmn:Task")||f(o,"bpmn:CallActivity")||f(o,"bpmn:SubProcess")||f(o,"bpmn:Participant")||f(o,"bpmn:Lane"))&&t.addMarker(o,Cd)}),e.on("directEditing.resize",function(c){if(f(o,"bpmn:TextAnnotation")){var l=c.height,B=c.dy,g=Math.max(o.height/r.height*(l+B),0),p=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:g,position:{mx:0,my:0}});N2(A.path,{d:p})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var l=c.active;l&&(t.removeMarker(l.element.label||l.element,fd),t.removeMarker(o,Cd)),o=void 0,r=void 0,a&&(km(a),a=void 0)})}Md.$inject=["eventBus","canvas","pathMap"];function Sx(e,t){var n=Q0(e);return n.get("stroke")||t||"black"}const Tx={__depends__:[Rc,md,X3],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Yi],labelEditingPreview:["type",Md]};var kx=new VA("tt");function Gx(e){var t=$('<div class="djs-tooltip-container" />');return m2(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function Hx(e,t,n){m2(e,{left:t+"px",top:n+"px"})}function k1(e,t){e.style.display=t===!1?"none":""}var Dd="djs-tooltip",G1="."+Dd;function R2(e,t){this._eventBus=e,this._canvas=t,this._ids=kx,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=Gx(t.getContainer());var n=this;x2.bind(this._tooltipRoot,G1,"mousedown",function(A){A.stopPropagation()}),x2.bind(this._tooltipRoot,G1,"mouseover",function(A){n.trigger("mouseover",A)}),x2.bind(this._tooltipRoot,G1,"mouseout",function(A){n.trigger("mouseout",A)}),this._init()}R2.$inject=["eventBus","canvas"],R2.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=N({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},R2.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,A=this.get(g2(n,"data-tooltip-id"));A&&(e==="mouseover"&&A.timeout&&this.clearTimeout(A),e==="mouseout"&&A.timeout&&(A.timeout=1e3,this.setTimeout(A)))},R2.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]},R2.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},R2.prototype.setTimeout=function(e){if(e=this.get(e),!!e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},R2.prototype.remove=function(e){var t=this.get(e);t&&(xe(t.html),xe(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},R2.prototype.show=function(){k1(this._tooltipRoot)},R2.prototype.hide=function(){k1(this._tooltipRoot,!1)},R2.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,A="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=A,this._tooltipRoot.style["-ms-transform"]=A},R2.prototype._addTooltip=function(e){var t=e.id,n=e.html,A,i=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),U2(n)&&(n=$(n)),A=$('<div data-tooltip-id="'+t+'" class="'+Dd+'">'),m2(A,{position:"absolute"}),A.appendChild(n),e.type&&X(A).add("djs-tooltip-"+e.type),e.className&&X(A).add(e.className),e.htmlContainer=A,i.appendChild(A),this._tooltips[t]=e,this._updateTooltip(e)},R2.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;Hx(n,t.x,t.y)},R2.prototype._updateTooltipVisibilty=function(e){U(this._tooltips,function(t){var n=t.show,A=t.htmlContainer,i=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(i=!1),k1(A,i))})},R2.prototype._init=function(){var e=this;function t(n){e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()}this._eventBus.on("canvas.viewbox.changing",function(n){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(n){t(n.viewbox)})};const yd={__init__:["tooltips"],tooltips:["type",R2]};var Px="flow elements must be children of pools/participants",Jx="Data object must be placed within a pool/participant.";function Id(e,t,n){function A(i,o,r){t.add({position:{x:i.x+5,y:i.y+5},type:"error",timeout:2e3,html:"<div>"+o+"</div>"})}e.on(["shape.move.rejected","create.rejected"],function(i){var o=i.context,r=o.shape,a=o.target;f(a,"bpmn:Collaboration")&&(f(r,"bpmn:FlowNode")?A(i,n(Px)):f(r,"bpmn:DataObjectReference")&&A(i,n(Jx)))})}Id.$inject=["eventBus","tooltips","translate"];const jx={__depends__:[yd],__init__:["modelingFeedback"],modelingFeedback:["type",Id]};var Vx=500,Lx=1e3;function fn(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),A=this;function i(o){var r=g0("rect");return q(r,N({x:0,y:0,rx:4,width:100,height:100},n)),r}e.on(["shape.added","shape.changed"],Vx,function(o){var r=o.element,a=o.gfx,c=p0(".djs-outline",a);c||(c=A.getOutline(r)||i(),h0(a,c)),A.updateShapeOutline(c,r)}),e.on(["connection.added","connection.changed"],function(o){var r=o.element,a=o.gfx,c=p0(".djs-outline",a);c||(c=i(),h0(a,c)),A.updateConnectionOutline(c,r)})}fn.prototype.updateShapeOutline=function(e,t){var n=!1,A=this._getProviders();A.length&&U(A,function(i){n=n||i.updateOutline(t,e)}),n||q(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})},fn.prototype.updateConnectionOutline=function(e,t){var n=i2(t);q(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})},fn.prototype.registerProvider=function(e,t){t||(t=e,e=Lx),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})},fn.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},fn.prototype.getOutline=function(e){var t,n=this._getProviders();return U(n,function(A){n2(A.getOutline)&&(t=t||A.getOutline(e))}),t},fn.$inject=["eventBus","styles","elementRegistry"];var ra=6;function H1(e,t,n){this._canvas=t;var A=this;e.on("element.changed",function(i){n.isSelected(i.element)&&A._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(i){var o=i.newSelection;A._updateMultiSelectionOutline(o)})}H1.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");co(t);var n=e.length>1,A=this._canvas.getContainer();if(D0(A)[n?"add":"remove"]("djs-multi-select"),!!n){var i=Wx(i2(e)),o=g0("rect");q(o,N({rx:3},i)),D0(o).add("djs-selection-outline"),h0(t,o)}},H1.$inject=["eventBus","canvas","selection"];function Wx(e){return{x:e.x-ra,y:e.y-ra,width:e.width+ra*2,height:e.height+ra*2}}const Fd={__depends__:[Ce],__init__:["outline","multiSelectionOutline"],outline:["type",fn],multiSelectionOutline:["type",H1]};var _x=500,Ox=1250,Xx=1500,aa=Math.round;function Kx(e){return{x:e.x+aa(e.width/2),y:e.y+aa(e.height/2)}}function vd(e,t,n,A,i){function o(a,c,l,B){return i.allowed("elements.move",{shapes:a,delta:c,position:l,target:B})}e.on("shape.move.start",Xx,function(a){var c=a.context,l=a.shape,B=A.get().slice();B.indexOf(l)===-1&&(B=[l]),B=Zx(B),N(c,{shapes:B,validatedShapes:B,shape:l})}),e.on("shape.move.start",Ox,function(a){var c=a.context,l=c.validatedShapes,B;if(B=c.canExecute=o(l),!B)return!1}),e.on("shape.move.move",_x,function(a){var c=a.context,l=c.validatedShapes,B=a.hover,g={x:a.dx,y:a.dy},p={x:a.x,y:a.y},E;if(E=o(l,g,p,B),c.delta=g,c.canExecute=E,E===null){c.target=null;return}c.target=B}),e.on("shape.move.end",function(a){var c=a.context,l=c.delta,B=c.canExecute,g=B==="attach",p=c.shapes;if(B===!1)return!1;l.x=aa(l.x),l.y=aa(l.y),!(l.x===0&&l.y===0)&&n.moveElements(p,l,c.target,{primaryShape:c.shape,attach:g})}),e.on("element.mousedown",function(a){if(vt(a)){var c=Ln(a);if(!c)throw new Error("must supply DOM mousedown event");return r(c,a.element)}});function r(a,c,l,B){if(V0(l)&&(B=l,l=!1),!(c.waypoints||!c.parent)&&!D0(a.target).has("djs-hit-no-move")){var g=Kx(c);return t.init(a,g,"shape.move",{cursor:"grabbing",autoActivate:l,data:{shape:c,context:B||{}}}),!0}}this.start=r}vd.$inject=["eventBus","dragging","modeling","selection","rules"];function Zx(e){var t=Ve(e,"id");return l0(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}var xd=499,P1="djs-dragging",bd="drop-ok",Yd="drop-not-ok",Ud="new-parent",Nd="attach-ok";function zd(e,t,n,A){function i(c){var l=o(c),B=qx(l);return B}function o(c){var l=YA(c,!0),B=l.flatMap(E=>(E.incoming||[]).concat(E.outgoing||[])),g=l.concat(B),p=[...new Set(g)];return p}function r(c,l){[Nd,bd,Yd,Ud].forEach(function(B){B===l?t.addMarker(c,B):t.removeMarker(c,B)})}function a(c,l,B){A.addDragger(l,c.dragGroup),B&&t.addMarker(l,P1),c.allDraggedElements?c.allDraggedElements.push(l):c.allDraggedElements=[l]}e.on("shape.move.start",xd,function(c){var l=c.context,B=l.shapes,g=l.allDraggedElements,p=i(B);if(!l.dragGroup){var E=g0("g");q(E,n.cls("djs-drag-group",["no-events"]));var d=t.getActiveLayer();h0(d,E),l.dragGroup=E}p.forEach(function(u){A.addDragger(u,l.dragGroup)}),g?g=no([g,o(B)]):g=o(B),U(g,function(u){t.addMarker(u,P1)}),l.allDraggedElements=g,l.differentParents=$x(B)}),e.on("shape.move.move",xd,function(c){var l=c.context,B=l.dragGroup,g=l.target,p=l.shape.parent,E=l.canExecute;g&&(E==="attach"?r(g,Nd):l.canExecute&&p&&g.id!==p.id?r(g,Ud):r(g,l.canExecute?bd:Yd)),Q2(B,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var l=c.context,B=l.target;B&&r(B,null)}),e.on("shape.move.cleanup",function(c){var l=c.context,B=l.allDraggedElements,g=l.dragGroup;U(B,function(p){t.removeMarker(p,P1)}),g&&s2(g)}),this.makeDraggable=a}zd.$inject=["eventBus","canvas","styles","previewSupport"];function qx(e){var t=l0(e,function(n){return Y0(n)?m0(e,Z2({id:n.source.id}))&&m0(e,Z2({id:n.target.id})):!0});return t}function $x(e){return _l(Ve(e,function(t){return t.parent&&t.parent.id}))!==1}const eb={__depends__:[ko,Ce,Fd,Te,nt,AA],__init__:["move","movePreview"],move:["type",vd],movePreview:["type",zd]};var Rd=".djs-palette-toggle",Sd=".entry",tb=Rd+", "+Sd,J1="djs-palette-",nb="shown",j1="open",Td="two-column",Ab=1e3;function e2(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(A){var i=A.tool;n.updateToolHighlight(i)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}e2.$inject=["eventBus","canvas"],e2.prototype.registerProvider=function(e,t){t||(t=e,e=Ab),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()},e2.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(ob,{})},e2.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}},e2.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),A=this._container=$(e2.HTML_MARKUP);n.appendChild(A),X(n).add(J1+nb),x2.bind(A,tb,"click",function(i){var o=i.delegateTarget;if(nB(o,Rd))return e.toggle();e.trigger("click",i)}),O.bind(A,"mousedown",function(i){i.stopPropagation()}),x2.bind(A,Sd,"dragstart",function(i){e.trigger("dragstart",i)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:A})},e2.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},e2.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,A=this._eventBus,i,o=X(n),r=X(t);"twoColumn"in e?i=e.twoColumn:i=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(Td,i),r.toggle(J1+Td,i),"open"in e&&(o.toggle(j1,e.open),r.toggle(J1+j1,e.open)),A.fire("palette.changed",{twoColumn:i,open:this.isOpen()})},e2.prototype._update=function(){var e=p0(".djs-palette-entries",this._container),t=this._entries=this.getEntries();vA(e),U(t,function(n,A){var i=n.group||"default",o=p0("[data-group="+LA(i)+"]",e);o||(o=$('<div class="group"></div>'),g2(o,"data-group",i),e.appendChild(o));var r=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),a=$(r);if(o.appendChild(a),!n.separator&&(g2(a,"data-action",A),n.title&&g2(a,"title",n.title),n.className&&ib(a,n.className),n.imageUrl)){var c=$("<img>");g2(c,"src",n.imageUrl),a.appendChild(c)}}),this.open()},e2.prototype.trigger=function(e,t,n){var A,i,o=t.delegateTarget||t.target;return o?(A=g2(o,"data-action"),i=t.originalEvent||t,this.triggerEntry(A,e,i,n)):t.preventDefault()},e2.prototype.triggerEntry=function(e,t,n,A){var i=this._entries,o,r;if(o=i[e],!!o&&(r=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(n2(r)){if(t==="click")return r(n,A)}else if(r[t])return r[t](n,A);n.preventDefault()}},e2.prototype._layoutChanged=function(){this._toggleState({})},e2.prototype._needsCollapse=function(e,t){var n=50,A=Object.keys(t).length*46;return e<A+n},e2.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},e2.prototype.open=function(){this._toggleState({open:!0})},e2.prototype.toggle=function(){this.isOpen()?this.close():this.open()},e2.prototype.isActiveTool=function(e){return e&&this._activeTool===e},e2.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=p0(".djs-palette-entries",this._container),this._toolsContainer=p0("[data-group=tools]",t)),n=this._toolsContainer,U(n.children,function(A){var i=A.getAttribute("data-action");if(i){var o=X(A);i=i.replace("-tool",""),o.contains("entry")&&i===e?o.add("highlighted-entry"):o.remove("highlighted-entry")}})},e2.prototype.isOpen=function(){return X(this._container).has(j1)},e2.prototype._getParentContainer=function(){return this._canvas.getContainer()},e2.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function ib(e,t){var n=X(e),A=n0(t)?t:t.split(/\s+/g);A.forEach(function(i){n.add(i)})}function ob(e,t){var n=t.getPaletteEntries();return n2(n)?n(e):(U(n,function(A,i){e[i]=A}),e)}const rb={__init__:["palette"],palette:["type",e2]};var kd="crosshair";function Cn(e,t,n,A,i,o,r){this._selection=i,this._dragging=n,this._mouse=r;var a=this,c={create:function(l){var B=t.getActiveLayer(),g;g=l.frame=g0("rect"),q(g,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),h0(B,g)},update:function(l){var B=l.frame,g=l.bbox;q(B,{x:g.x,y:g.y,width:g.width,height:g.height})},remove:function(l){l.frame&&s2(l.frame)}};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(l){var B=l.originalEvent.target;!l.hover&&!(B instanceof SVGElement)||e.once("lasso.selection.ended",function(){a.activateLasso(l.originalEvent,!0)})}),e.on("lasso.end",0,function(l){var B=l.context,g=V1(l),p=A.filter(function(d){return d}),E=So(l);a.select(p,g,E?B.selection:[])}),e.on("lasso.start",function(l){var B=l.context;B.bbox=V1(l),c.create(B),B.selection=i.get()}),e.on("lasso.move",function(l){var B=l.context;B.bbox=V1(l),c.update(B)}),e.on("lasso.cleanup",function(l){var B=l.context;c.remove(B)}),e.on("element.mousedown",1500,function(l){if(So(l))return a.activateLasso(l.originalEvent),!0})}Cn.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Cn.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:kd,data:{context:{}}})},Cn.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:kd,data:{context:{}},keepSelection:!0})},Cn.prototype.select=function(e,t,n=[]){var A=hB(e,t);this._selection.select([...n,...FA(A)])},Cn.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Cn.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};function V1(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y},A;return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?A={x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?A={x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?A={x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?A={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:A={x:n.x,y:n.y,width:0,height:0},A}const ab={__depends__:[Yr,ci],__init__:["lassoTool"],lassoTool:["type",Cn]};var L1=1500,Gd="grab";function gA(e,t,n,A,i,o){this._dragging=n,this._mouse=o;var r=this,a=A.get("keyboard",!1);i.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",L1,function(c){if(Wn(c))return r.activateMove(c.originalEvent,!0),!1}),a&&a.addListener(L1,function(c){if(!(!Hd(c.keyEvent)||r.isActive())){var l=r._mouse.getLastMoveEvent();r.activateMove(l,!!l)}},"keyboard.keydown"),a&&a.addListener(L1,function(c){!Hd(c.keyEvent)||!r.isActive()||r.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var l=c.originalEvent.target;if(!c.hover&&!(l instanceof SVGElement))return!1;e.once("hand.ended",function(){r.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var l=t.viewbox().scale;t.scroll({dx:c.dx*l,dy:c.dy*l})}),e.on("hand.move.end",function(c){var l=c.context,B=l.reactivate;return!Wn(c)&&B&&e.once("hand.move.ended",function(g){r.activateHand(g.originalEvent,!0,!0)}),!1})}gA.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],gA.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Gd,data:{context:n||{}}})},gA.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Gd,data:{context:{reactivate:n}}})},gA.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},gA.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function Hd(e){return E2("Space",e)}const cb={__depends__:[Yr,ci],__init__:["handTool"],handTool:["type",gA]};var Pd="connect-ok",Jd="connect-not-ok";function pA(e,t,n,A,i,o,r){var a=this;this._dragging=t,this._rules=o,this._mouse=r,i.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var l=c.context,B=c.hover,g=l.canStartConnect=a.canStartConnect(B);g!==null&&(l.startTarget=B,A.addMarker(B,g?Pd:Jd))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var l=c.context.startTarget,B=c.context.canStartConnect;l&&A.removeMarker(l,B?Pd:Jd)}),e.on(["global-connect.ended"],function(c){var l=c.context,B=l.startTarget,g={x:c.x,y:c.y},p=a.canStartConnect(B);if(p)return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,B,g)}),!1})}pA.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],pA.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},pA.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},pA.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},pA.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};const sb={__depends__:[Es,Te,nt,Yr,ci],globalConnect:["type",pA]};function W1(e,t,n,A,i,o,r,a){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=A,this._lassoTool=i,this._handTool=o,this._globalConnect=r,this._translate=a,e.registerProvider(this)}W1.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],W1.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,A=this._spaceTool,i=this._lassoTool,o=this._handTool,r=this._globalConnect,a=this._translate;function c(g,p,E,d,u){function h(D){var y=n.createShape(N({type:g},u));t.start(D,y)}return{group:p,className:E,title:d,action:{dragstart:h,click:h}}}function l(g){var p=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),E=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:p});t.start(g,[p,E],{hints:{autoSelect:[p]}})}function B(g){t.start(g,n.createParticipantShape())}return N(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:a("Activate hand tool"),action:{click:function(g){o.activateHand(g)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:a("Activate lasso tool"),action:{click:function(g){i.activateSelection(g)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:a("Activate create/remove space tool"),action:{click:function(g){A.activateSelection(g)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:a("Activate global connect tool"),action:{click:function(g){r.start(g)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",a("Create start event")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",a("Create intermediate/boundary event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",a("Create end event")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",a("Create gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",a("Create task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",a("Create data object reference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",a("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:a("Create expanded sub-process"),action:{dragstart:l,click:l}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:a("Create pool/participant"),action:{dragstart:B,click:B}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",a("Create group"))}),e};const lb={__depends__:[rb,xr,s3,ab,cb,sb,bo],__init__:["paletteProvider"],paletteProvider:["type",W1]};var Bb=250;function _1(e,t,n,A,i){j.call(this,e);function o(a){var c=a.canExecute.replacements;U(c,function(l){var B=l.oldElementId,g={type:l.newElementType};if(!a.visualReplacements[B]){var p=t.get(B);N(g,{x:p.x,y:p.y});var E=n.createShape(g);A.addShape(E,p.parent);var d=p0('[data-element-id="'+LA(p.id)+'"]',a.dragGroup);d&&N2(d,{display:"none"});var u=i.addDragger(E,a.dragGroup);a.visualReplacements[B]=u,A.removeShape(E)}})}function r(a){var c=a.visualReplacements;U(c,function(l,B){var g=p0('[data-element-id="'+LA(B)+'"]',a.dragGroup);g&&N2(g,{display:"inline"}),l.remove(),c[B]&&delete c[B]})}e.on("shape.move.move",Bb,function(a){var c=a.context,l=c.canExecute;c.visualReplacements||(c.visualReplacements={}),l&&l.replacements?o(c):r(c)})}_1.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],W(_1,j);const gb={__depends__:[AA],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",_1]};var pb=1250,O1=40,Eb=20,db=10,jd=20,Vd=["x","y"],ub=Math.abs;function Ld(e){e.on(["connect.hover","connect.move","connect.end"],pb,function(t){var n=t.context,A=n.canExecute,i=n.start,o=n.hover,r=n.source,a=n.target;t.originalEvent&&ne(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),A&&o&&Qb(t,o,fb(o)),o&&mb(A,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=ie(i),a0(o,["bpmn:Event","bpmn:Gateway"])&&Wd(t,ie(o)),a0(o,["bpmn:Task","bpmn:SubProcess"])&&hb(t,o),f(r,"bpmn:BoundaryEvent")&&a===r.host&&wb(t)):_d(A,"bpmn:MessageFlow")?(f(i,"bpmn:Event")&&(n.connectionStart=ie(i)),f(o,"bpmn:Event")&&Wd(t,ie(o))):n.connectionStart=n.initialConnectionStart)})}Ld.$inject=["eventBus"];function Qb(e,t,n){Vd.forEach(function(A){var i=Od(A,t);e[A]<t[A]+n?$0(e,A,t[A]+n):e[A]>t[A]+i-n&&$0(e,A,t[A]+i-n)})}function hb(e,t){var n=ie(t);Vd.forEach(function(A){Cb(e,t,A)&&$0(e,A,n[A])})}function wb(e){var t=e.context,n=t.source,A=t.target;if(!Mb(t)){var i=ie(n),o=f2(i,A,-10),r=[];/top|bottom/.test(o)&&r.push("x"),/left|right/.test(o)&&r.push("y"),r.forEach(function(a){var c=e[a],l;ub(c-i[a])<O1&&(c>i[a]?l=i[a]+O1:l=i[a]-O1,$0(e,a,l))})}}function Wd(e,t){$0(e,"x",t.x),$0(e,"y",t.y)}function _d(e,t){return e&&e.type===t}function mb(e,t){return ue(t,function(n){return _d(e,n)})}function Od(e,t){return e==="x"?t.width:t.height}function fb(e){return f(e,"bpmn:Task")?db:Eb}function Cb(e,t,n){return e[n]>t[n]+jd&&e[n]<t[n]+Od(n,t)-jd}function Mb(e){var t=e.hover,n=e.source;return t&&n&&t===n}function jt(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}jt.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},jt.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},jt.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},jt.prototype.getSnapLocations=function(){return this._snapLocations},jt.prototype.setSnapLocations=function(e){this._snapLocations=e},jt.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new ca,n.initDefaults(this._defaultSnaps)),n};function ca(){this._snapValues={}}ca.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)},ca.prototype.snap=function(e,t,n,A){var i=this._snapValues[t];return i&&zy(e[n],i[n],A)},ca.prototype.initDefaults=function(e){var t=this;U(e||{},function(n,A){U(n,function(i){t.add(A,i)})})};var Db=1250;function Ge(e,t,n){var A=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(i){A.initSnap(i)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],Db,function(i){var o=i.context,r=o.shape,a=o.snapContext,c=o.target;if(!(i.originalEvent&&ne(i.originalEvent))&&!(nA(i)||!c)){var l=a.pointsForTarget(c);l.initialized||(l=A.addSnapTargetPoints(l,r,c),l.initialized=!0),n.snap(i,l)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}Ge.$inject=["elementRegistry","eventBus","snapping"],Ge.prototype.initSnap=function(e){var t=this._elementRegistry,n=e.context,A=n.shape,i=n.snapContext;i||(i=n.snapContext=new jt);var o;t.get(A.id)?o=ie(A,e):o={x:e.x+ie(A).x,y:e.y+ie(A).y};var r={x:o.x-A.width/2,y:o.y-A.height/2},a={x:o.x+A.width/2,y:o.y+A.height/2};return i.setSnapOrigin("mid",{x:o.x-e.x,y:o.y-e.y}),f0(A)||(i.setSnapOrigin("top-left",{x:r.x-e.x,y:r.y-e.y}),i.setSnapOrigin("bottom-right",{x:a.x-e.x,y:a.y-e.y})),i},Ge.prototype.addSnapTargetPoints=function(e,t,n){var A=this.getSnapTargets(t,n);return U(A,function(i){if(f0(i)){f0(t)&&e.add("mid",ie(i));return}if(Y0(i)){if(i.waypoints.length<3)return;var o=i.waypoints.slice(1,-1);U(o,function(r){e.add("mid",r)});return}e.add("mid",ie(i))}),!A0(t.x)||!A0(t.y)||this._elementRegistry.get(t.id)&&e.add("mid",ie(t)),e},Ge.prototype.getSnapTargets=function(e,t){return y4(t).filter(function(n){return!yb(n)})};function yb(e){return!!e.hidden}var Xd=1500;function EA(e,t){t.invoke(Ge,this),e.on(["create.move","create.end"],Xd,xb),e.on(["create.move","create.end","shape.move.move","shape.move.end"],Xd,function(n){var A=n.context,i=A.canExecute,o=A.target,r=i&&(i==="attach"||i.attach);r&&!nA(n)&&Ib(n,o)})}W(EA,Ge),EA.$inject=["eventBus","injector"],EA.prototype.initSnap=function(e){var t=Ge.prototype.initSnap.call(this,e),n=e.shape,A=!!this._elementRegistry.get(n.id);return U(n.outgoing,function(i){var o=i.waypoints[0];o=o.original||o,t.setSnapOrigin(i.id+"-docking",Zd(o,A,e))}),U(n.incoming,function(i){var o=i.waypoints[i.waypoints.length-1];o=o.original||o,t.setSnapOrigin(i.id+"-docking",Zd(o,A,e))}),f(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},EA.prototype.addSnapTargetPoints=function(e,t,n){Ge.prototype.addSnapTargetPoints.call(this,e,t,n);var A=this.getSnapTargets(t,n);U(A,function(o){(vb(o)||Fb([t,o],"bpmn:TextAnnotation"))&&(e.add("top-left",M4(o)),e.add("bottom-right",D4(o)))});var i=this._elementRegistry;return U(t.incoming,function(o){if(i.get(t.id)){Kd(A,o.source)||e.add("mid",i0(o.source));var r=o.waypoints[0];e.add(o.id+"-docking",r.original||r)}}),U(t.outgoing,function(o){if(i.get(t.id)){Kd(A,o.target)||e.add("mid",i0(o.target));var r=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",r.original||r)}}),f(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},EA.prototype.getSnapTargets=function(e,t){return Ge.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!f(n,"bpmn:Lane")})};function Ib(e,t){var n=e0(t),A=CE(e,t),i=e.context,o=i.shape,r;o.parent?r={x:0,y:0}:r=i0(o),/top/.test(A)?$0(e,"y",n.top-r.y):/bottom/.test(A)&&$0(e,"y",n.bottom-r.y),/left/.test(A)?$0(e,"x",n.left-r.x):/right/.test(A)&&$0(e,"x",n.right-r.x)}function Fb(e,t){return e.every(function(n){return f(n,t)})}function vb(e){return f(e,"bpmn:SubProcess")&&E0(e)?!0:f(e,"bpmn:Participant")}function xb(e){var t=e.context,n=t.createConstraints;if(n){var A=n.top,i=n.right,o=n.bottom,r=n.left;(r&&r>=e.x||i&&i<=e.x)&&$0(e,"x",e.x),(A&&A>=e.y||o&&o<=e.y)&&$0(e,"y",e.y)}}function Kd(e,t){return e.indexOf(t)!==-1}function Zd(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}var bb=1250;function Ui(e,t){var n=this;e.on(["resize.start"],function(A){n.initSnap(A)}),e.on(["resize.move","resize.end"],bb,function(A){var i=A.context,o=i.shape,r=o.parent,a=i.direction,c=i.snapContext;if(!(A.originalEvent&&ne(A.originalEvent))&&!nA(A)){var l=c.pointsForTarget(r);l.initialized||(l=n.addSnapTargetPoints(l,o,r,a),l.initialized=!0),Nb(a)&&$0(A,"x",A.x),zb(a)&&$0(A,"y",A.y),t.snap(A,l)}}),e.on(["resize.cleanup"],function(){t.hide()})}Ui.prototype.initSnap=function(e){var t=e.context,n=t.shape,A=t.direction,i=t.snapContext;i||(i=t.snapContext=new jt);var o=qd(n,A);return i.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),i},Ui.prototype.addSnapTargetPoints=function(e,t,n,A){var i=this.getSnapTargets(t,n);return U(i,function(o){e.add("corner",D4(o)),e.add("corner",M4(o))}),e.add("corner",qd(t,A)),e},Ui.$inject=["eventBus","snapping"],Ui.prototype.getSnapTargets=function(e,t){return y4(t).filter(function(n){return!Yb(n,e)&&!Y0(n)&&!Ub(n)&&!f0(n)})};function qd(e,t){var n=i0(e),A=e0(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=A.top:t.indexOf("s")!==-1&&(i.y=A.bottom),t.indexOf("e")!==-1?i.x=A.right:t.indexOf("w")!==-1&&(i.x=A.left),i}function Yb(e,t){return e.host===t}function Ub(e){return!!e.hidden}function Nb(e){return e==="n"||e==="s"}function zb(e){return e==="e"||e==="w"}var Rb=7,Sb=1e3;function Vt(e){this._canvas=e,this._asyncHide=tc(v2(this.hide,this),Sb)}Vt.$inject=["canvas"],Vt.prototype.snap=function(e,t){var n=e.context,A=n.snapContext,i=A.getSnapLocations(),o={x:nA(e,"x"),y:nA(e,"y")};U(i,function(r){var a=A.getSnapOrigin(r),c={x:e.x+a.x,y:e.y+a.y};if(U(["x","y"],function(l){var B;o[l]||(B=t.snap(c,r,l,Rb),B!==void 0&&(o[l]={value:B,originValue:B-a[l]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),U(["x","y"],function(r){var a=o[r];V0(a)&&$0(e,r,a.originValue)})},Vt.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=g0("path");return q(n,{d:"M0,0 L0,0"}),D0(n).add("djs-snap-line"),h0(t,n),{update:function(A){A0(A)?e==="horizontal"?q(n,{d:"M-100000,"+A+" L+100000,"+A,display:""}):q(n,{d:"M "+A+",-100000 L "+A+", +100000",display:""}):q(n,{display:"none"})}}},Vt.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Vt.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},Vt.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},Vt.prototype.hide=function(){U(this._snapLines,function(e){e.update()})};const Tb={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Ge],resizeSnapping:["type",Ui],snapping:["type",Vt]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Ld],createMoveSnapping:["type",EA]};var $d=300;function r0(e,t,n,A){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=e,this._eventBus=t,this._selection=n,this._translate=A,this._container=this._getBoxHtml(),this._searchInput=p0(r0.INPUT_SELECTOR,this._container),this._resultsContainer=p0(r0.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}r0.$inject=["canvas","eventBus","selection","translate"],r0.prototype._bindEvents=function(){var e=this;function t(n,A,i,o){e._eventMaps.push({el:n,type:i,listener:x2.bind(n,A,i,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,r0.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,r0.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,r0.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,r0.INPUT_SELECTOR,"keydown",function(n){E2("ArrowUp",n)&&n.preventDefault(),E2("ArrowDown",n)&&n.preventDefault()}),t(this._container,r0.INPUT_SELECTOR,"keyup",function(n){if(E2("Escape",n))return e.close();if(E2("Enter",n)){var A=e._getCurrentResult();return A?e._select(A):e.close(!1)}if(E2("ArrowUp",n))return e._scrollToDirection(!0);if(E2("ArrowDown",n))return e._scrollToDirection();E2(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})},r0.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){x2.unbind(e.el,e.type,e.listener)})},r0.prototype._search=function(e){var t=this;if(this._clearResults(),!!e.trim()){var n=this._searchProvider.find(e);if(n=n.filter(function(i){return!t._canvas.getRootElements().includes(i.element)}),!n.length){this._selection.select(null);return}n.forEach(function(i){var o=i.element.id,r=t._createResultNode(i,o);t._results[o]={element:i.element,node:r}});var A=p0(r0.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(A),this._preselect(A)}},r0.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},r0.prototype._scrollToNode=function(e){if(!(!e||e===this._getCurrentResult())){var t=e.offsetTop,n=this._resultsContainer.scrollTop,A=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<A&&(this._resultsContainer.scrollTop=A)}},r0.prototype._clearResults=function(){vA(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")},r0.prototype._getCurrentResult=function(){return p0(r0.RESULT_SELECTED_SELECTOR,this._resultsContainer)},r0.prototype._createResultNode=function(e,t){var n=$(r0.RESULT_HTML);return e.primaryTokens.length>0&&eu(n,e.primaryTokens,r0.RESULT_PRIMARY_HTML),eu(n,e.secondaryTokens,r0.RESULT_SECONDARY_HTML),g2(n,r0.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},r0.prototype.registerProvider=function(e){this._searchProvider=e},r0.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,X(this._canvas.getContainer()).add("djs-search-open"),X(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},r0.prototype.close=function(e=!0){this.isOpen()&&(e&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,X(this._canvas.getContainer()).remove("djs-search-open"),X(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())},r0.prototype.toggle=function(){this.isOpen()?this.close():this.open()},r0.prototype.isOpen=function(){return this._open},r0.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&X(t).remove(r0.RESULT_SELECTED_CLASS);var n=g2(e,r0.RESULT_ID_ATTRIBUTE),A=this._results[n].element;X(e).add(r0.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(A,{top:$d}),this._selection.select(A),this._eventBus.fire("searchPad.preselected",A)}},r0.prototype._select=function(e){var t=g2(e,r0.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:$d}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},r0.prototype._getBoxHtml=function(){const e=$(r0.BOX_HTML),t=p0(r0.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function eu(e,t,n){var A=kb(t),i=$(n);i.innerHTML=A,e.appendChild(i)}function kb(e){var t="";return e.forEach(function(n){var A=qe(n.value||n.matched||n.normal),i=n.match||n.matched;i?t+='<b class="'+r0.RESULT_HIGHLIGHT_CLASS+'">'+A+"</b>":t+=A}),t!==""?t:null}r0.CONTAINER_SELECTOR=".djs-search-container",r0.INPUT_SELECTOR=".djs-search-input input",r0.RESULTS_CONTAINER_SELECTOR=".djs-search-results",r0.RESULT_SELECTOR=".djs-search-result",r0.RESULT_SELECTED_CLASS="djs-search-result-selected",r0.RESULT_SELECTED_SELECTOR="."+r0.RESULT_SELECTED_CLASS,r0.RESULT_ID_ATTRIBUTE="data-result-id",r0.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",r0.BOX_HTML=`<div class="djs-search-container djs-scrollable">
268
268
  <div class="djs-search-input">
269
269
  <svg class="djs-search-icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
270
270
  <path fill-rule="evenodd" clip-rule="evenodd" d="M9.0325 8.5H9.625L13.3675 12.25L12.25 13.3675L8.5 9.625V9.0325L8.2975 8.8225C7.4425 9.5575 6.3325 10 5.125 10C2.4325 10 0.25 7.8175 0.25 5.125C0.25 2.4325 2.4325 0.25 5.125 0.25C7.8175 0.25 10 2.4325 10 5.125C10 6.3325 9.5575 7.4425 8.8225 8.2975L9.0325 8.5ZM1.75 5.125C1.75 6.9925 3.2575 8.5 5.125 8.5C6.9925 8.5 8.5 6.9925 8.5 5.125C8.5 3.2575 6.9925 1.75 5.125 1.75C3.2575 1.75 1.75 3.2575 1.75 5.125Z" fill="#22242A"/>
@@ -272,9 +272,9 @@
272
272
  <input type="text" spellcheck="false" />
273
273
  </div>
274
274
  <div class="djs-search-results" />
275
- </div>`,r0.RESULT_HTML='<div class="djs-search-result"></div>',r0.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',r0.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';const Gb={__depends__:[bo,No,Ce],searchPad:["type",r0]};function X1(e,t,n,A){this._elementRegistry=e,this._canvas=n,this._search=A,t.registerProvider(this)}X1.$inject=["elementRegistry","searchPad","canvas","search"],X1.prototype.find=function(e){var t=this._canvas.getRootElements(),n=this._elementRegistry.filter(function(A){return!f0(A)&&!t.includes(A)});return this._search(n.map(A=>({element:A,label:fe(A),id:A.id})),e,{keys:["label","id"]}).map(Hb)};function Hb(e){const{item:{element:t},tokens:n}=e;return{element:t,primaryTokens:n.label,secondaryTokens:n.id}}const Pb={__depends__:[Gb,Jp],__init__:["bpmnSearch"],bpmnSearch:["type",X1]},Jb="M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",jb="M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",Vb={width:36,height:50},Lb={width:50,height:50};function tu(e,t,n){return c2("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}const Lt=5;function sa(e,t){this._styles=t,e.registerProvider(this)}sa.$inject=["outline","styles"],sa.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!f0(e))return f(e,"bpmn:Gateway")?(n=c2("rect"),N(n.style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),N2(n,N({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):a0(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?(n=c2("rect"),N2(n,N({x:-Lt,y:-Lt,rx:14,width:e.width+Lt*2,height:e.height+Lt*2},t))):f(e,"bpmn:EndEvent")?(n=c2("circle"),N2(n,N({cx:e.width/2,cy:e.height/2,r:e.width/2+Lt+1},t))):f(e,"bpmn:Event")?(n=c2("circle"),N2(n,N({cx:e.width/2,cy:e.height/2,r:e.width/2+Lt},t))):f(e,"bpmn:DataObjectReference")&&nu(e,"bpmn:DataObjectReference")?n=tu(Jb,{x:-6,y:-6},t):f(e,"bpmn:DataStoreReference")&&nu(e,"bpmn:DataStoreReference")&&(n=tu(jb,{x:-6,y:-6},t)),n},sa.prototype.updateOutline=function(e,t){if(!f0(e))return a0(e,["bpmn:SubProcess","bpmn:Group"])?(N2(t,{width:e.width+Lt*2,height:e.height+Lt*2}),!0):!!a0(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};function nu(e,t){var n;return t==="bpmn:DataObjectReference"?n=Vb:t==="bpmn:DataStoreReference"&&(n=Lb),e.width===n.width&&e.height===n.height}const Wb={__depends__:[Fd],__init__:["outlineProvider"],outlineProvider:["type",sa]};var _b='<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>';function Ie(e){HA.call(this,e)}W(Ie,HA),Ie.Viewer=et,Ie.NavigatedViewer=_A,Ie.prototype.createDiagram=function(){return this.importXML(_b)},Ie.prototype._interactionModules=[Og,Hc,jc],Ie.prototype._modelingModules=[_D,As,uy,ly,Sy,Es,Jy,Xv,qE,xr,$v,nx,Qx,wx,mx,yx,Tx,L3,jx,eb,lb,gb,md,Tb,Pb,Wb],Ie.prototype._modules=[].concat(et.prototype._modules,Ie.prototype._interactionModules,Ie.prototype._modelingModules);function K1(e,t,n,A,i,o,r,a,c){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=A,this._lassoTool=i,this._handTool=o,this._globalConnect=r,this._translate=a,this._bpmnFactory=c,e.registerProvider(this)}K1.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate","bpmnFactory"],K1.prototype.getPaletteEntries=function(e){const t={},n=this._create,A=this._elementFactory,i=this._spaceTool,o=this._lassoTool,r=this._handTool,a=this._globalConnect,c=this._translate,l=this._bpmnFactory;function B(d,u,h,D,y){function C(I){const x=A.createShape(N({type:d},y));n.start(I,x)}const m=d.replace(/^bpmn:/,"");return{group:u,className:h,title:D||c("Create {type}",{type:m}),action:{dragstart:C,click:C}}}function g(d){const u=A.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),h=A.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:u});n.start(d,[u,h],{hints:{autoSelect:[h]}})}function p(d){n.start(d,A.createParticipantShape())}function E(d){const u=l.create("bpmn:Task",{name:"抄送任务",customType:"抄送任务","flowable:customType":"flowable抄送任务"}),h=A.createShape({type:"bpmn:Task",businessObject:u});h.di.isExpanded=!0,n.start(d,h)}return N(t,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:c("Activate the hand tool"),action:{click:function(d){r.activateHand(d)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:c("Activate the lasso tool"),action:{click:function(d){o.activateSelection(d)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:c("Activate the create/remove space tool"),action:{click:function(d){i.activateSelection(d)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:c("Activate the global connect tool"),action:{click:function(d){a.toggle(d)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":B("bpmn:StartEvent","event","bpmn-icon-start-event-none",c("Create StartEvent")),"create.intermediate-event":B("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",c("Create Intermediate/Boundary Event")),"create.end-event":B("bpmn:EndEvent","event","bpmn-icon-end-event-none",c("Create EndEvent")),"create.exclusive-gateway":B("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-xor",c("Create Exclusive Gateway")),"create.inclusive-gateway":B("bpmn:InclusiveGateway","gateway","bpmn-icon-gateway-or",c("Create Inclusive Gateway")),"create.parallel-gateway":B("bpmn:ParallelGateway","gateway","bpmn-icon-gateway-parallel",c("Create Parallel Gateway")),"create.UserTask":B("bpmn:UserTask","activity","bpmn-icon-user-task",c("Create UserTask")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:c("Create expanded SubProcess"),action:{dragstart:g,click:g}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:c("Create Pool/Participant"),action:{dragstart:p,click:p}},"create.cc-task":{group:"model",className:"bpmn-icon-task CC-task",title:c("抄送任务"),action:{dragstart:E,click:E}}}),t};function Z1(e,t,n,A,i,o,r,a,c,l,B,g){e=e||{},A.registerProvider(this),this._contextPad=A,this._modeling=i,this._elementFactory=o,this._connect=r,this._create=a,this._popupMenu=c,this._canvas=l,this._rules=B,this._translate=g,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(p){const E=p.context,d=E.shape;if(!(!Wn(p)||!A.isOpen(d))){var u=A.getEntries(d);u.replace&&u.replace.action.click(p,d)}})}Z1.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate"],Z1.prototype.getContextPadEntries=function(e){const t=this._contextPad,n=this._modeling,A=this._elementFactory,i=this._connect,o=this._create,r=this._popupMenu,a=this._canvas,c=this._rules,l=this._autoPlace,B=this._translate,g={};if(e.type==="label")return g;const p=e.businessObject;function E(m,I){i.start(m,I)}function d(){n.removeElements([e])}function u(m){const x=a.getContainer(),v=x.querySelector(".djs-context-pad"),F=x.getBoundingClientRect(),z=v.getBoundingClientRect(),R=z.top-F.top;return{x:z.left-F.left,y:R+z.height+5}}function h(m,I,x,v){typeof x!="string"&&(v=x,x=B("Append {type}",{type:m.replace(/^bpmn:/,"")}));function F(R,k){const T=A.createShape(N({type:m},v));o.start(R,T,{source:k})}return{group:"model",className:I,title:x,action:{dragstart:F,click:l?function(R,k){const T=A.createShape(N({type:m},v));l.append(k,T)}:F}}}function D(m){return function(I,x){n.splitLane(x,m),t.open(x,!0)}}if(a0(p,["bpmn:Lane","bpmn:Participant"])&&E0(p)){const m=it(e);N(g,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:B("Add Lane above"),action:{click:function(I,x){n.addLane(x,"top")}}}}),m.length<2&&(e.height>=120&&N(g,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:B("Divide into two Lanes"),action:{click:D(2)}}}),e.height>=180&&N(g,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:B("Divide into three Lanes"),action:{click:D(3)}}})),N(g,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:B("Add Lane below"),action:{click:function(I,x){n.addLane(x,"bottom")}}}})}if(f(p,"bpmn:FlowNode"))if(f(p,"bpmn:EventBasedGateway")){var y="0d9a60fe0131dff70d665020f5b0cdee";N(g,{"append.receive-task":h("bpmn:ReceiveTask","bpmn-icon-receive-task"),"append.message-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",B("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",B("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",B("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",B("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}),y.trim()}else Au(p,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?N(g,{"append.compensation-activity":h("bpmn:Task","bpmn-icon-task",B("Append compensation activity"),{isForCompensation:!0})}):!f(p,"bpmn:EndEvent")&&!p.isForCompensation&&!Au(p,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!h2(p)&&N(g,{"append.end-event":h("bpmn:EndEvent","bpmn-icon-end-event-none",B("Append EndEvent")),"append.gateway":h("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",B("Append Gateway")),"append.user-task":h("bpmn:UserTask","bpmn-icon-user-task",B("Append UserTask")),"append.intermediate-event":h("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",B("Append Intermediate/Boundary Event")),"append.timer-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",B("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"})});r.isEmpty(e,"bpmn-replace")||N(g,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:B("Change type"),action:{click:function(m,I){var x=N(u(),{cursor:{x:m.x,y:m.y}});r.open(I,"bpmn-replace",x)}}}}),a0(p,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(g,{"append.text-annotation":h("bpmn:TextAnnotation","bpmn-icon-text-annotation",B("Append TextAnnotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:B("Connect using "+(p.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:E,dragstart:E}}}),a0(p,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(g,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:B("Connect using DataInputAssociation"),action:{click:E,dragstart:E}}});let C=c.allowed("elements.delete",{elements:[e]});return n0(C)&&(C=C[0]===e),C&&N(g,{delete:{group:"edit",className:"bpmn-icon-trash",title:B("Remove"),action:{click:d}}}),g};function Au(e,t,n){const A=e.$instanceOf(t);let i=!1;const o=e.eventDefinitions||[];return U(o,function(r){r.$type===n&&(i=!0)}),A&&i}function Ob(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function la(e,t){return t.appendChild(Ob(e,t))}function Ni(e,t){return la(t,e),e}var q1=2,iu={"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":q1,"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":q1,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Xb(e,t){return iu[t]?e.style[t]:e.getAttributeNS(null,t)}function ou(e,t,n){var A=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=iu[A];i?(i===q1&&typeof n=="number"&&(n=String(n)+"px"),e.style[A]=n):e.setAttributeNS(null,t,n)}function Kb(e,t){var n=Object.keys(t),A,i;for(A=0,i;i=n[A];A++)ou(e,i,t[i])}function He(e,t,n){if(typeof t=="string")if(n!==void 0)ou(e,t,n);else return Xb(e,t);else Kb(e,t);return e}const Zb=Object.prototype.toString;function $1(e){return new Wt(e)}function Wt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Wt.prototype.add=function(e){return this.list.add(e),this},Wt.prototype.remove=function(e){return Zb.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Wt.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Wt.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Wt.prototype.array=function(){return Array.from(this.list)},Wt.prototype.has=Wt.prototype.contains=function(e){return this.list.contains(e)};function qb(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function $b(e){return e.cloneNode(!0)}var el={svg:"http://www.w3.org/2000/svg"},ru='<svg xmlns="'+el.svg+'"';function au(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(el.svg)===-1&&(e=ru+e.substring(4)):(e=ru+">"+e+"</svg>",t=!0);var n=eY(e);if(!t)return n;for(var A=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)A.appendChild(i.firstChild);return A}function eY(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function _t(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=au(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(el.svg,e),n}var cu=/([&<>]{1})/g,tY=/([&<>\n\r"]{1})/g,nY={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function tl(e,t){function n(A,i){return nY[i]||i}return e.replace(t,n)}function su(e,t){var n,A,i,o,r;switch(e.nodeType){case 3:t.push(tl(e.textContent,cu));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,A=i.length;n<A;++n)o=i.item(n),t.push(" ",o.name,'="',tl(o.value,tY),'"');if(e.hasChildNodes()){for(t.push(">"),r=e.childNodes,n=0,A=r.length;n<A;++n)su(r.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",tl(e.nodeValue,cu),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function AY(e,t){var n=au(t);if(qb(e),!!t){oY(n)||(n=n.documentElement);for(var A=aY(n.childNodes),i=0;i<A.length;i++)la(A[i],e)}}function iY(e){for(var t=e.firstChild,n=[];t;)su(t,n),t=t.nextSibling;return n.join("")}function oY(e){return e.nodeName==="#document-fragment"}function rY(e,t){if(t!==void 0){try{AY(e,t)}catch(n){throw new Error("error parsing SVG: "+n.message)}return e}else return iY(e)}function aY(e){return Array.prototype.slice.call(e)}function lu(e){var t=e.parentNode;return t&&t.removeChild(e),e}const cY=1500,sY=2,lY="#52B415",BY="#ffc800",gY="#cc0000";class Bu extends be{constructor(t,n){super(t,cY),this.bpmnRenderer=n}canRender(t){return!t.labelTarget}drawShape(t,n){const A=this.bpmnRenderer.drawShape(t,n),i=this.getSuitabilityScore(n),o=P(n);if(console.error(i,"suitabilityScore 评分得分"),o.$attrs.customType==="抄送任务"){var a=`
275
+ </div>`,r0.RESULT_HTML='<div class="djs-search-result"></div>',r0.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',r0.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';const Gb={__depends__:[bo,No,Ce],searchPad:["type",r0]};function X1(e,t,n,A){this._elementRegistry=e,this._canvas=n,this._search=A,t.registerProvider(this)}X1.$inject=["elementRegistry","searchPad","canvas","search"],X1.prototype.find=function(e){var t=this._canvas.getRootElements(),n=this._elementRegistry.filter(function(A){return!f0(A)&&!t.includes(A)});return this._search(n.map(A=>({element:A,label:fe(A),id:A.id})),e,{keys:["label","id"]}).map(Hb)};function Hb(e){const{item:{element:t},tokens:n}=e;return{element:t,primaryTokens:n.label,secondaryTokens:n.id}}const Pb={__depends__:[Gb,Jp],__init__:["bpmnSearch"],bpmnSearch:["type",X1]},Jb="M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",jb="M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",Vb={width:36,height:50},Lb={width:50,height:50};function tu(e,t,n){return c2("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}const Lt=5;function sa(e,t){this._styles=t,e.registerProvider(this)}sa.$inject=["outline","styles"],sa.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!f0(e))return f(e,"bpmn:Gateway")?(n=c2("rect"),N(n.style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),N2(n,N({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):a0(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?(n=c2("rect"),N2(n,N({x:-Lt,y:-Lt,rx:14,width:e.width+Lt*2,height:e.height+Lt*2},t))):f(e,"bpmn:EndEvent")?(n=c2("circle"),N2(n,N({cx:e.width/2,cy:e.height/2,r:e.width/2+Lt+1},t))):f(e,"bpmn:Event")?(n=c2("circle"),N2(n,N({cx:e.width/2,cy:e.height/2,r:e.width/2+Lt},t))):f(e,"bpmn:DataObjectReference")&&nu(e,"bpmn:DataObjectReference")?n=tu(Jb,{x:-6,y:-6},t):f(e,"bpmn:DataStoreReference")&&nu(e,"bpmn:DataStoreReference")&&(n=tu(jb,{x:-6,y:-6},t)),n},sa.prototype.updateOutline=function(e,t){if(!f0(e))return a0(e,["bpmn:SubProcess","bpmn:Group"])?(N2(t,{width:e.width+Lt*2,height:e.height+Lt*2}),!0):!!a0(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};function nu(e,t){var n;return t==="bpmn:DataObjectReference"?n=Vb:t==="bpmn:DataStoreReference"&&(n=Lb),e.width===n.width&&e.height===n.height}const Wb={__depends__:[Fd],__init__:["outlineProvider"],outlineProvider:["type",sa]};var _b='<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>';function Ie(e){HA.call(this,e)}W(Ie,HA),Ie.Viewer=et,Ie.NavigatedViewer=_A,Ie.prototype.createDiagram=function(){return this.importXML(_b)},Ie.prototype._interactionModules=[Og,Hc,jc],Ie.prototype._modelingModules=[_D,As,uy,ly,Sy,Es,Jy,Xv,qE,xr,$v,nx,Qx,wx,mx,yx,Tx,L3,jx,eb,lb,gb,md,Tb,Pb,Wb],Ie.prototype._modules=[].concat(et.prototype._modules,Ie.prototype._interactionModules,Ie.prototype._modelingModules);function K1(e,t,n,A,i,o,r,a,c){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=A,this._lassoTool=i,this._handTool=o,this._globalConnect=r,this._translate=a,this._bpmnFactory=c,e.registerProvider(this)}K1.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate","bpmnFactory"],K1.prototype.getPaletteEntries=function(e){const t={},n=this._create,A=this._elementFactory,i=this._spaceTool,o=this._lassoTool,r=this._handTool,a=this._globalConnect,c=this._translate,l=this._bpmnFactory;function B(d,u,h,D,y){function C(I){const x=A.createShape(N({type:d},y));n.start(I,x)}const m=d.replace(/^bpmn:/,"");return{group:u,className:h,title:D||c("Create {type}",{type:m}),action:{dragstart:C,click:C}}}function g(d){const u=A.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),h=A.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:u});n.start(d,[u,h],{hints:{autoSelect:[h]}})}function p(d){n.start(d,A.createParticipantShape())}function E(d){const u=l.create("bpmn:ServiceTask",{name:"抄送任务",customType:"抄送任务","flowable:customType":"flowable抄送任务","flowable:delegateExpression":"${myCopyService}",delegateExpression:"${myCopyService}"}),h=A.createShape({type:"bpmn:Task",businessObject:u});h.di.isExpanded=!0,n.start(d,h)}return N(t,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:c("Activate the hand tool"),action:{click:function(d){r.activateHand(d)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:c("Activate the lasso tool"),action:{click:function(d){o.activateSelection(d)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:c("Activate the create/remove space tool"),action:{click:function(d){i.activateSelection(d)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:c("Activate the global connect tool"),action:{click:function(d){a.toggle(d)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":B("bpmn:StartEvent","event","bpmn-icon-start-event-none",c("Create StartEvent")),"create.intermediate-event":B("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",c("Create Intermediate/Boundary Event")),"create.end-event":B("bpmn:EndEvent","event","bpmn-icon-end-event-none",c("Create EndEvent")),"create.exclusive-gateway":B("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-xor",c("Create Exclusive Gateway")),"create.inclusive-gateway":B("bpmn:InclusiveGateway","gateway","bpmn-icon-gateway-or",c("Create Inclusive Gateway")),"create.parallel-gateway":B("bpmn:ParallelGateway","gateway","bpmn-icon-gateway-parallel",c("Create Parallel Gateway")),"create.UserTask":B("bpmn:UserTask","activity","bpmn-icon-user-task",c("Create UserTask")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:c("Create expanded SubProcess"),action:{dragstart:g,click:g}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:c("Create Pool/Participant"),action:{dragstart:p,click:p}},"create.cc-task":{group:"model",className:"bpmn-icon-task CC-task",title:c("抄送任务"),action:{dragstart:E,click:E}}}),t};function Z1(e,t,n,A,i,o,r,a,c,l,B,g){e=e||{},A.registerProvider(this),this._contextPad=A,this._modeling=i,this._elementFactory=o,this._connect=r,this._create=a,this._popupMenu=c,this._canvas=l,this._rules=B,this._translate=g,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(p){const E=p.context,d=E.shape;if(!(!Wn(p)||!A.isOpen(d))){var u=A.getEntries(d);u.replace&&u.replace.action.click(p,d)}})}Z1.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate"],Z1.prototype.getContextPadEntries=function(e){const t=this._contextPad,n=this._modeling,A=this._elementFactory,i=this._connect,o=this._create,r=this._popupMenu,a=this._canvas,c=this._rules,l=this._autoPlace,B=this._translate,g={};if(e.type==="label")return g;const p=e.businessObject;function E(m,I){i.start(m,I)}function d(){n.removeElements([e])}function u(m){const x=a.getContainer(),v=x.querySelector(".djs-context-pad"),F=x.getBoundingClientRect(),z=v.getBoundingClientRect(),R=z.top-F.top;return{x:z.left-F.left,y:R+z.height+5}}function h(m,I,x,v){typeof x!="string"&&(v=x,x=B("Append {type}",{type:m.replace(/^bpmn:/,"")}));function F(R,k){const T=A.createShape(N({type:m},v));o.start(R,T,{source:k})}return{group:"model",className:I,title:x,action:{dragstart:F,click:l?function(R,k){const T=A.createShape(N({type:m},v));l.append(k,T)}:F}}}function D(m){return function(I,x){n.splitLane(x,m),t.open(x,!0)}}if(a0(p,["bpmn:Lane","bpmn:Participant"])&&E0(p)){const m=it(e);N(g,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:B("Add Lane above"),action:{click:function(I,x){n.addLane(x,"top")}}}}),m.length<2&&(e.height>=120&&N(g,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:B("Divide into two Lanes"),action:{click:D(2)}}}),e.height>=180&&N(g,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:B("Divide into three Lanes"),action:{click:D(3)}}})),N(g,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:B("Add Lane below"),action:{click:function(I,x){n.addLane(x,"bottom")}}}})}if(f(p,"bpmn:FlowNode"))if(f(p,"bpmn:EventBasedGateway")){var y="0d9a60fe0131dff70d665020f5b0cdee";N(g,{"append.receive-task":h("bpmn:ReceiveTask","bpmn-icon-receive-task"),"append.message-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",B("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",B("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",B("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",B("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}),y.trim()}else Au(p,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?N(g,{"append.compensation-activity":h("bpmn:Task","bpmn-icon-task",B("Append compensation activity"),{isForCompensation:!0})}):!f(p,"bpmn:EndEvent")&&!p.isForCompensation&&!Au(p,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!h2(p)&&N(g,{"append.end-event":h("bpmn:EndEvent","bpmn-icon-end-event-none",B("Append EndEvent")),"append.gateway":h("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",B("Append Gateway")),"append.user-task":h("bpmn:UserTask","bpmn-icon-user-task",B("Append UserTask")),"append.intermediate-event":h("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",B("Append Intermediate/Boundary Event")),"append.timer-intermediate-event":h("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",B("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"})});r.isEmpty(e,"bpmn-replace")||N(g,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:B("Change type"),action:{click:function(m,I){var x=N(u(),{cursor:{x:m.x,y:m.y}});r.open(I,"bpmn-replace",x)}}}}),a0(p,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(g,{"append.text-annotation":h("bpmn:TextAnnotation","bpmn-icon-text-annotation",B("Append TextAnnotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:B("Connect using "+(p.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:E,dragstart:E}}}),a0(p,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(g,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:B("Connect using DataInputAssociation"),action:{click:E,dragstart:E}}});let C=c.allowed("elements.delete",{elements:[e]});return n0(C)&&(C=C[0]===e),C&&N(g,{delete:{group:"edit",className:"bpmn-icon-trash",title:B("Remove"),action:{click:d}}}),g};function Au(e,t,n){const A=e.$instanceOf(t);let i=!1;const o=e.eventDefinitions||[];return U(o,function(r){r.$type===n&&(i=!0)}),A&&i}function Ob(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function la(e,t){return t.appendChild(Ob(e,t))}function Ni(e,t){return la(t,e),e}var q1=2,iu={"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":q1,"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":q1,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Xb(e,t){return iu[t]?e.style[t]:e.getAttributeNS(null,t)}function ou(e,t,n){var A=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=iu[A];i?(i===q1&&typeof n=="number"&&(n=String(n)+"px"),e.style[A]=n):e.setAttributeNS(null,t,n)}function Kb(e,t){var n=Object.keys(t),A,i;for(A=0,i;i=n[A];A++)ou(e,i,t[i])}function He(e,t,n){if(typeof t=="string")if(n!==void 0)ou(e,t,n);else return Xb(e,t);else Kb(e,t);return e}const Zb=Object.prototype.toString;function $1(e){return new Wt(e)}function Wt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Wt.prototype.add=function(e){return this.list.add(e),this},Wt.prototype.remove=function(e){return Zb.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Wt.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Wt.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Wt.prototype.array=function(){return Array.from(this.list)},Wt.prototype.has=Wt.prototype.contains=function(e){return this.list.contains(e)};function qb(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function $b(e){return e.cloneNode(!0)}var el={svg:"http://www.w3.org/2000/svg"},ru='<svg xmlns="'+el.svg+'"';function au(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(el.svg)===-1&&(e=ru+e.substring(4)):(e=ru+">"+e+"</svg>",t=!0);var n=eY(e);if(!t)return n;for(var A=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)A.appendChild(i.firstChild);return A}function eY(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function _t(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=au(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(el.svg,e),n}var cu=/([&<>]{1})/g,tY=/([&<>\n\r"]{1})/g,nY={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function tl(e,t){function n(A,i){return nY[i]||i}return e.replace(t,n)}function su(e,t){var n,A,i,o,r;switch(e.nodeType){case 3:t.push(tl(e.textContent,cu));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,A=i.length;n<A;++n)o=i.item(n),t.push(" ",o.name,'="',tl(o.value,tY),'"');if(e.hasChildNodes()){for(t.push(">"),r=e.childNodes,n=0,A=r.length;n<A;++n)su(r.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",tl(e.nodeValue,cu),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function AY(e,t){var n=au(t);if(qb(e),!!t){oY(n)||(n=n.documentElement);for(var A=aY(n.childNodes),i=0;i<A.length;i++)la(A[i],e)}}function iY(e){for(var t=e.firstChild,n=[];t;)su(t,n),t=t.nextSibling;return n.join("")}function oY(e){return e.nodeName==="#document-fragment"}function rY(e,t){if(t!==void 0){try{AY(e,t)}catch(n){throw new Error("error parsing SVG: "+n.message)}return e}else return iY(e)}function aY(e){return Array.prototype.slice.call(e)}function lu(e){var t=e.parentNode;return t&&t.removeChild(e),e}const cY=1500,sY=2,lY="#52B415",BY="#ffc800",gY="#cc0000";class Bu extends be{constructor(t,n){super(t,cY),this.bpmnRenderer=n}canRender(t){return!t.labelTarget}drawShape(t,n){const A=this.bpmnRenderer.drawShape(t,n);if(this.getSuitabilityScore(n),P(n).$attrs.customType==="抄送任务"){var r=`
276
276
  <svg t="1766124506574" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7318"><path d="M96 938.666667c-17.066667 0-32-14.933333-32-32 0-232.533333 187.733333-418.133333 420.266667-418.133334 83.2 0 164.266667 25.6 234.666666 72.533334 14.933333 8.533333 23.466667 27.733333 14.933334 42.666666-8.533333 14.933333-27.733333 23.466667-42.666667 14.933334-2.133333-2.133333-4.266667-2.133333-6.4-4.266667-162.133333-110.933333-384-68.266667-492.8 93.866667-42.666667 57.6-64 128-64 198.4 0 17.066667-14.933333 32-32 32z" p-id="7319"></path><path d="M484.266667 552.533333c-140.8 0-253.866667-113.066667-253.866667-253.866666S343.466667 42.666667 484.266667 42.666667s253.866667 113.066667 253.866666 253.866666c0 140.8-115.2 253.866667-253.866666 256z m0-445.866666c-104.533333 0-189.866667 85.333333-189.866667 189.866666s85.333333 189.866667 189.866667 189.866667 189.866667-85.333333 189.866666-189.866667-85.333333-189.866667-189.866666-189.866666zM763.733333 981.333333c-17.066667 0-32-14.933333-32-32v-70.4c0-29.866667 23.466667-53.333333 53.333334-53.333333 8.533333 0 19.2 2.133333 27.733333 6.4l57.6 34.133333 25.6-147.2-172.8 64 4.266667 2.133334c14.933333 8.533333 23.466667 27.733333 14.933333 42.666666-8.533333 14.933333-27.733333 23.466667-42.666667 14.933334-2.133333 0-2.133333-2.133333-4.266666-2.133334l-23.466667-12.8c-25.6-14.933333-34.133333-46.933333-19.2-72.533333 6.4-10.666667 17.066667-19.2 27.733333-23.466667l211.2-76.8c27.733333-10.666667 57.6 4.266667 68.266667 32 4.266667 8.533333 4.266667 17.066667 2.133333 27.733334L932.266667 896c-4.266667 29.866667-32 49.066667-61.866667 42.666667-6.4-2.133333-12.8-4.266667-17.066667-6.4l-53.333333-32v51.2c-4.266667 14.933333-19.2 29.866667-36.266667 29.866666z" p-id="7320"></path><path d="M765.866667 898.133333c-8.533333 0-14.933333-2.133333-21.333334-6.4-12.8-10.666667-14.933333-32-4.266666-44.8l147.2-174.933333c10.666667-12.8 32-14.933333 44.8-4.266667s14.933333 32 4.266666 44.8L789.333333 887.466667c-6.4 6.4-14.933333 10.666667-23.466666 10.666666z" p-id="7321"></path></svg>
277
- `,a=`
277
+ `,r=`
278
278
  <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
279
279
  <title>编组 2</title>
280
280
  <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -284,7 +284,7 @@
284
284
  </g>
285
285
  </g>
286
286
  </svg>
287
- `,c=_t("svg");$1(c).add("qq-icon"),rY(c,a),He(c,{fill:"#161616ff",transform:"translate(5, 5)",width:"20",height:20}),$1(c).add("qq-icons"),Ni(t,c)}return A}getShapePath(t){return f(t,"bpmn:Task")?Cg(t,sY):this.bpmnRenderer.getShapePath(t)}getSuitabilityScore(t){const n=P(t),{suitable:A}=n;return Number.isFinite(A)?A:null}getColor(t){return t>75?lY:t>25?BY:gY}}Bu.$inject=["eventBus","bpmnRenderer"];const pY={__init__:["paletteProvider","contextPadProvider","rendererProvider"],rendererProvider:["type",Bu],paletteProvider:["type",K1],contextPadProvider:["type",Z1]};function Ba(e){Ie.call(this,e),this._customElements=[]}W(Ba,Ie),Ba.prototype._modules=[].concat(Ba.prototype._modules,[pY]);const EY={"Create {type}":"创建 {type}","Create StartEvent":"开始节点","Create EndEvent":"结束节点","Create Task":"任务节点","Create UserTask":"用户任务节点","Create expanded SubProcess":"扩展子过程","Create IntermediateThrowEvent/BoundaryEvent":"中间抛出事件/边界事件","Create Pool/Participant":"池/参与者","Create Gateway":"网关","Create Exclusive Gateway":"互斥网关","Create Parallel Gateway":"并行网关","Create Inclusive Gateway":"相容网关","Create Group":"创建组","Create DataObjectReference":"数据对象引用","Create DataStoreReference":"数据存储引用","Create Intermediate/Boundary Event":"中间/边界事件","Activate the global connect tool":"激活全局连接工具","Append {type}":"追加 {type}","Add Lane above":"在上面添加道","Divide into two Lanes":"分割成两个道","Divide into three Lanes":"分割成三个道","Add Lane below":"在下面添加道","Append compensation activity":"追加补偿活动","Change type":"修改类型","Append element":"添加元素","Create element":"创建元素","Connect using Association":"使用关联连接","Connect using Sequence/MessageFlow or Association":"使用顺序/消息流或者关联连接","Connect using DataInputAssociation":"使用数据输入关联连接",Remove:"移除","Activate the hand tool":"激活抓手工具","Activate the lasso tool":"激活套索工具","Activate the create/remove space tool":"激活创建/删除空间工具","Parallel multi-instance":"并行多重事件","Sequential multi-instance":"时序多重事件",DataObjectReference:"数据对象参考",DataStoreReference:"数据存储参考",Loop:"循环","Ad-hoc":"即席",Task:"任务","Send task":"发送任务","Receive task":"接收任务","User task":"用户任务","Manual task":"手工任务","Business rule task":"业务规则任务","Service task":"服务任务","Script task":"脚本任务","Call activity":"调用活动","Sub-process (collapsed)":"子流程(折叠的)","Sub-process (expanded)":"子流程(展开的)","Ad-hoc sub-process (collapsed)":"临时子流程(折叠的)","Ad-hoc sub-process (expanded)":"临时子流程(展开的)","Start event":"开始事件",StartEvent:"开始事件","Intermediate throw event":"中间事件","End event":"结束事件",EndEvent:"结束事件","Message start event":"消息开始事件","Timer start event":"定时开始事件","Conditional start event":"条件开始事件","Signal start event":"信号开始事件","Error start event":"错误开始事件","Escalation start event":"升级开始事件","Compensation start event":"补偿开始事件","Message start event (non-interrupting)":"消息开始事件(非中断)","Timer start event (non-interrupting)":"定时开始事件(非中断)","Conditional start event (non-interrupting)":"条件开始事件(非中断)","Signal start event (non-interrupting)":"信号开始事件(非中断)","Escalation start event (non-interrupting)":"升级开始事件(非中断)","Message intermediate catch event":"消息中间捕获事件","Message intermediate throw event":"消息中间抛出事件","Timer intermediate catch event":"定时中间捕获事件","Escalation intermediate throw event":"升级中间抛出事件","Conditional intermediate catch event":"条件中间捕获事件","Link intermediate catch event":"链接中间捕获事件","Link intermediate throw event":"链接中间抛出事件","Compensation intermediate throw event":"补偿中间抛出事件","Signal intermediate catch event":"信号中间捕获事件","Signal intermediate throw event":"信号中间抛出事件","Message end event":"消息结束事件","Escalation end event":"定时结束事件","Error end event":"错误结束事件","Cancel end event":"取消结束事件","Compensation end event":"补偿结束事件","Signal end event":"信号结束事件","Terminate end event":"终止结束事件","Message boundary event":"消息边界事件","Message boundary event (non-interrupting)":"消息边界事件(非中断)","Timer boundary event":"定时边界事件","Timer boundary event (non-interrupting)":"定时边界事件(非中断)","Escalation boundary event":"升级边界事件","Escalation boundary event (non-interrupting)":"升级边界事件(非中断)","Conditional boundary event":"条件边界事件","Conditional boundary event (non-interrupting)":"条件边界事件(非中断)","Error boundary event":"错误边界事件","Cancel boundary event":"取消边界事件","Signal boundary event":"信号边界事件","Signal boundary event (non-interrupting)":"信号边界事件(非中断)","Compensation boundary event":"补偿边界事件","Toggle non-interrupting":"切换中断","Boundary event":"边界事件","Exclusive gateway":"互斥网关","Parallel gateway":"并行网关","Inclusive gateway":"相容网关","Complex gateway":"复杂网关","Event-based gateway":"事件网关",Transaction:"事务子流程","Sub Process":"子流程","Event sub-process":"事件子流程","Collapsed pool":"折叠池","Expanded pool":"展开池",Gateways:"网关",Tasks:"任务",Events:"事件","Sub-processes":"子流程",Data:"数据",Participants:"参与者","Data store reference":"数据存储参考","Data object reference":"数据对象参考","Default flow":"默认流转","Conditional flow":"条件流转","Sequence flow":"顺序流转","Expanded pool/participant":"展开池/参与者","Empty pool/participant":"折叠池/参与者","no parent for {element} in {parent}":"在{parent}里,{element}没有父类","no shape type specified":"没有指定的形状类型","flow elements must be children of pools/participants":"元素必须是池/参与者的子级","out of bounds release":"越界释放","more than {count} child lanes":"超过 {count} 条通道","element required":"元素不能为空","diagram not part of bpmn:Definitions":"流程图不符合bpmn规范","no diagram to display":"没有可展示的流程图","no process or collaboration to display":"没有可展示的流程/协作","element {element} referenced by {referenced}#{property} not yet drawn":"由{referenced}#{property}引用的{element}元素仍未绘制","already rendered {element}":"{element} 已呈现","failed to import {element}":"导入{element}失败","correcting missing bpmnElement on {plane} to {rootElement}":"在 {plane} 上更正缺失的 bpmnElement 为 {rootElement}","missing {semantic}#attachedToRef":"在 {element} 中缺少 {semantic}#attachedToRef","multiple DI elements defined for {element}":"为 {element} 定义了多个 DI 元素","no bpmnElement referenced in {element}":"{element} 中没有引用 bpmnElement","Sub process is missing start event":"子流程缺少开始事件","Sub process is missing end event":"子流程缺少结束事件","Element is an implicit start":"节点无法作为开始,缺少前置节点","Element is an implicit end":"节点无法作为结束,缺少后置节点","Element overlaps with other element":"节点重叠","Gateway is superfluous. It only has one source and target.":"网关是多余的,只有一个来源和目标","Append EndEvent":"追加结束事件节点","Append Gateway":"追加网关节点","Append UserTask":"追加用户任务节点","Append Intermediate/Boundary Event":"追加中间或边界事件","Append TimerIntermediateCatchEvent":"追加定时中间捕获事件","Append TextAnnotation":"追加文本批注","No Issues":"校验成功","Toggle linting overlays":"点击可关闭校验","{errors} Errors, {warnings} Warnings":"{errors} 错误,{warnings} 警告","Process is missing end event":"流程缺少结束节点","Process is missing start event":"流程缺少开始节点","Element is not connected":"节点缺少连接","Start event is missing event definition":"缺少事件定义","Event has multiple event definitions":"多个事件定义","Sequence flow is missing condition":"缺少流转条件","Flow splits implicitly":"流转方向未知","Incoming flows do not join":"使用网关确定统一的入口","SequenceFlow is a duplicate":"重复的连线","Duplicate incoming sequence flows":"入口连线重复","Duplicate outgoing sequence flows":"出口连线重复","Gateway forks and joins":"允许一进多出、多进一出。禁止多进多出","Element is missing label/name":"节点缺少名称","Open minimap":"小地图","Close minimap":"关闭小地图","Token Simulation":"流程模拟","Play/Pause Simulation":"开始/暂停","Pause Simulation":"暂停","Play Simulation":"开始","Set animation speed":"设置速度",Slow:"慢",Normal:"正常",Fast:"快",Finished:"结束","Reset Simulation":"重置","Toggle Simulation Log":"显示日志","Simulation Log":"日志","No Entries":"暂无日志",Process:"流程",SubProcess:"子流程",started:"启动",finished:"结束",canceled:"取消"};function gu(e,t){return t=t||{},e=EY[e]||e,e.replace(/{([^}]+)}/g,function(n,A){return t[A]||"{"+A+"}"})}function pu(e,t){var n=e.get("editorActions",!1);n&&n.register({toggleLinting:function(){t.toggle()}})}pu.$inject=["injector","linting"];var dY=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function uY(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function QY(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function A(){return this instanceof A?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(A){var i=Object.getOwnPropertyDescriptor(e,A);Object.defineProperty(n,A,i.get?i:{enumerable:!0,get:function(){return e[A]}})}),n}var hY=function e(t,n){const A=n.enter,i=n.leave,o=A&&A(t),r=t.$descriptor;o!==!1&&!r.isGeneric&&r.properties.filter(c=>!c.isAttr&&!c.isReference&&c.type!=="String").forEach(c=>{if(c.name in t){const l=t[c.name];c.isMany?l.forEach(B=>{e(B,n)}):e(l,n)}}),i&&i(t)};const wY=QY(lm),mY=hY,{isArray:fY,isObject:CY,isFunction:MY}=wY;class DY{constructor({moddleRoot:t,rule:n}){this.rule=n,this.moddleRoot=t,this.messages=[],this.report=this.report.bind(this)}report(t,n,A){let i={id:t,message:n};A&&fY(A)&&(i={...i,path:A}),A&&CY(A)&&(i={...i,...A}),this.messages.push(i)}}var yY=function({moddleRoot:t,rule:n}){const A=new DY({rule:n,moddleRoot:t}),i=n.check||{},o="leave"in i?i.leave:void 0,r="enter"in i?i.enter:MY(i)?i:void 0;if(!r&&!o)throw new Error("no check implemented");return mY(t,{enter:r?a=>r(a,A):void 0,leave:o?a=>o(a,A):void 0}),A.messages};const IY=yY,FY=(e,t)=>e,vY={0:"off",1:"warn",2:"error",3:"info"},xY="rule-error";function ge(e){const{config:t={},resolver:n,transformRule:A=FY}=e||{};if(typeof n>"u")throw new Error("must provide <options.resolver>");this.config=t,this.resolver=n,this.transformRule=A,this.cachedRules={},this.cachedConfigs={}}var bY=ge;ge.prototype.applyRule=function(t,n){const{config:A,rule:i,category:o,name:r}=n;try{return IY({moddleRoot:t,rule:i,config:A}).map(function(c){return{...c,meta:i.meta,category:o}})}catch(a){return console.error("rule <"+r+"> failed with error: ",a),[{message:a.message,category:xY}]}},ge.prototype.resolveRule=function(e,t){const{pkg:n,ruleName:A}=this.parseRuleName(e),i=`${n}-${A}`,o=this.cachedRules[i];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,A)).then(r=>{if(!r)throw new Error(`unknown rule <${e}>`);return this.cachedRules[i]=this.transformRule(r(t),{pkg:n,ruleName:A})})},ge.prototype.resolveConfig=function(e){const{pkg:t,configName:n}=this.parseConfigName(e),A=`${t}-${n}`,i=this.cachedConfigs[A];return i?Promise.resolve(i):Promise.resolve(this.resolver.resolveConfig(t,n)).then(o=>{if(!o)throw new Error(`unknown config <${e}>`);return this.cachedConfigs[A]=this.normalizeConfig(o,t)})},ge.prototype.resolveRules=function(e){return this.resolveConfiguredRules(e).then(t=>{const i=Object.entries(t).map(([o,r])=>{const{category:a,config:c}=this.parseRuleValue(r);return{name:o,category:a,config:c}}).filter(o=>o.category!=="off").map(o=>{const{name:r,config:a}=o;return this.resolveRule(r,a).then(function(c){return{...o,rule:c}})});return Promise.all(i)})},ge.prototype.resolveConfiguredRules=function(e){let t=e.extends;return typeof t=="string"&&(t=[t]),typeof t>"u"&&(t=[]),Promise.all(t.map(n=>this.resolveConfig(n).then(A=>this.resolveConfiguredRules(A)))).then(n=>{const A=this.normalizeConfig(e,"bpmnlint").rules;return[...n,A].reduce((o,r)=>({...o,...r}),{})})},ge.prototype.lint=function(e,t){return t=t||this.config,this.resolveRules(t).then(n=>{const A={};return n.forEach(i=>{const{name:o}=i,r=this.applyRule(e,i);r.length&&(A[o]=r)}),A})},ge.prototype.parseRuleValue=function(e){let t,n;return Array.isArray(e)?(t=e[0],n=e[1]):(t=e,n={}),typeof t=="string"&&(t=t.toLowerCase()),t=vY[t]||t,{config:n,category:t}},ge.prototype.parseRuleName=function(e,t="bpmnlint"){const n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(e);if(!n)throw new Error(`unparseable rule name <${e}>`);const[A,i,o,r]=n;return o?{pkg:`${i?i+"/":""}${Eu(o)}`,ruleName:r}:{pkg:t,ruleName:r}},ge.prototype.parseConfigName=function(e){const t=/^(?:(?:plugin:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)|bpmnlint:)([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable config name <${e}>`);const[n,A,i,o]=t;return i?{pkg:`${A?A+"/":""}${Eu(i)}`,configName:o}:{pkg:"bpmnlint",configName:o}},ge.prototype.getSimplePackageName=function(e){const t=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable package name <${e}>`);const[n,A,i]=t;return`${A?A+"/":""}${YY(i)}`},ge.prototype.normalizeConfig=function(e,t){const n=e.rules||{},A=Object.keys(n).reduce((i,o)=>{const r=n[o],{pkg:a,ruleName:c}=this.parseRuleName(o,t),l=a==="bpmnlint"?c:`${this.getSimplePackageName(a)}/${c}`;return i[l]=r,i},{});return{...e,rules:A}};function Eu(e){return e==="bpmnlint"?"bpmnlint":e.startsWith("bpmnlint-plugin-")?e:`bpmnlint-plugin-${e}`}function YY(e){return e.startsWith("bpmnlint-plugin-")?e.substring(16):e}var UY={Linter:bY},du='<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>',uu='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 512 512"><path fill="currentColor" d="M288 328.83c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zM207.439 57.034l11.61 204.348c.544 9.334 8.78 16.64 18.755 16.64h100.392c9.975 0 18.211-7.306 18.754-16.64l11.611-204.348c.587-10.082-7.98-18.56-18.754-18.56H226.192c-10.775 0-19.34 8.478-18.753 18.56z"/></svg>',Qu='<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>',hu='<svg width="12" height="12" viewBox="3.5 3.5 9 9" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"/></svg>',NY=-7,zY=-7,RY=500,wu={resolver:{resolveRule:function(){return null}},config:{}},mu={error:du,warning:uu,success:Qu,info:hu,inactive:Qu};function O0(e,t,n,A,i,o,r){this._bpmnjs=e,this._canvas=t,this._elementRegistry=A,this._eventBus=i,this._overlays=o,this._translate=r,this._issues={},this._active=n&&n.active||!1,this._linterConfig=wu,this._overlayIds={};var a=this;i.on(["import.done","elements.changed","linting.configChanged","linting.toggle"],RY,function(l){a.update()}),i.on("linting.toggle",function(l){l.active||(a._clearIssues(),a._updateButton())}),i.on("diagram.clear",function(){a._clearIssues()});var c=n&&n.bpmnlint;c&&i.once("diagram.init",function(){if(a.getLinterConfig()===wu)try{a.setLinterConfig(c)}catch{console.error("[bpmn-js-bpmnlint] Invalid lint rules configured. Please doublecheck your linting.bpmnlint configuration, cf. https://github.com/bpmn-io/bpmn-js-bpmnlint#configure-lint-rules")}}),this._init()}O0.prototype.setLinterConfig=function(e){if(!e.config||!e.resolver)throw new Error("Expected linterConfig = { config, resolver }");this._linterConfig=e,this._eventBus.fire("linting.configChanged")},O0.prototype.getLinterConfig=function(){return this._linterConfig},O0.prototype._init=function(){this._createButton(),this._updateButton()},O0.prototype.isActive=function(){return this._active},O0.prototype._formatIssues=function(e){let t=this,n=F2(e,function(o,r,a){return o.concat(r.map(function(c){return c.rule=a,c}))},[]);const A=t._elementRegistry.filter(o=>f(o,"bpmn:Participant")),i=A.map(o=>o.businessObject);return n=B2(n,function(o){if(!t._elementRegistry.get(o.id)){o.isChildIssue=!0,o.actualElementId=o.id;const a=i.filter(c=>c.processRef&&c.processRef.id&&c.processRef.id===o.id);a.length?o.id=a[0].id:o.id=t._canvas.getRootElement().id}return o}),n=Ve(n,function(o){return o.id}),n},O0.prototype.toggle=function(e){return e=typeof e>"u"?!this.isActive():e,this._setActive(e),e},O0.prototype._setActive=function(e){this._active!==e&&(this._active=e,this._eventBus.fire("linting.toggle",{active:e}))},O0.prototype.update=function(){var e=this,t=this._bpmnjs.getDefinitions();if(t){var n=this._lintStart=Math.random();this.lint().then(function(A){if(e._lintStart===n){A=e._formatIssues(A);var i={},o={},r={};for(var a in e._issues)A[a]||(i[a]=e._issues[a]);for(var c in A)e._issues[c]?A[c]!==e._issues[c]&&(o[c]=A[c]):r[c]=A[c];i=N(i,o),r=N(r,o),e._clearOverlays(),e.isActive()&&e._createIssues(r),e._issues=A,e._updateButton(),e._fireComplete(A)}})}},O0.prototype._fireComplete=function(e){this._eventBus.fire("linting.completed",{issues:e})},O0.prototype._createIssues=function(e){for(var t in e)this._createElementIssues(t,e[t])},O0.prototype._createElementIssues=function(e,t){var n=this._elementRegistry.get(e);if(n){var A=this._elementRegistry.get(e+"_plane");A&&this._createElementIssues(A.id,t);var i,o,r=!n.parent;r&&f(n,"bpmn:Process")?(i="bottom-right",o={top:20,left:150}):r&&f(n,"bpmn:SubProcess")?(i="bottom-right",o={top:50,left:150}):(i="top-right",o={top:NY,left:zY});var a=Ve(t,function(R){return(R.isChildIssue?"child":"")+R.category}),c=a.error,l=a.warn,B=a.info,g=a.childerror,p=a.childwarn,E=a.childinfo;if(!(!B&&!c&&!l&&!g&&!p&&!E)){var d=$('<div class="bjsl-overlay bjsl-issues-'+i+'"></div>'),u=$(c||g?'<div class="bjsl-icon bjsl-icon-error">'+du+"</div>":l||p?'<div class="bjsl-icon bjsl-icon-warning">'+uu+"</div>":'<div class="bjsl-icon bjsl-icon-info">'+hu+"</div>"),h=$('<div class="bjsl-dropdown"></div>'),D=$('<div class="bjsl-dropdown-content"></div>'),y=$('<div class="bjsl-issues"></div>'),C=$('<div class="bjsl-current-element-issues"></div>'),m=$("<ul></ul>");if(d.appendChild(u),d.appendChild(h),h.appendChild(D),D.appendChild(y),y.appendChild(C),C.appendChild(m),c&&this._addErrors(m,c),l&&this._addWarnings(m,l),B&&this._addInfos(m,B),g||p||E){var I=$('<div class="bjsl-child-issues"></div>'),x=$("<ul></ul>"),v=this._translate("Issues for child elements"),F=$('<a class="bjsl-issue-heading">'+v+":</a>");if(g&&this._addErrors(x,g),p&&this._addWarnings(x,p),E&&this._addInfos(x,E),c||l){var z=$("<hr/>");I.appendChild(z)}I.appendChild(F),I.appendChild(x),y.appendChild(I)}this._overlayIds[e]=this._overlays.add(n,"linting",{position:o,html:d,scale:{min:.7}})}}},O0.prototype._addErrors=function(e,t){var n=this;t.forEach(function(A){n._addEntry(e,"error",A)})},O0.prototype._addWarnings=function(e,t){var n=this;t.forEach(function(A){n._addEntry(e,"warning",A)})},O0.prototype._addInfos=function(e,t){var n=this;t.forEach(function(A){n._addEntry(e,"info",A)})},O0.prototype._addEntry=function(e,t,n){var l;var A=n.rule,i=(l=n.meta)==null?void 0:l.documentation.url,o=this._translate(n.message),r=n.actualElementId,a=mu[t],c=$(`
287
+ `,a=_t("svg");$1(a).add("qq-icon"),rY(a,r),He(a,{fill:"#161616ff",transform:"translate(5, 5)",width:"20",height:20}),$1(a).add("qq-icons"),Ni(t,a)}return A}getShapePath(t){return f(t,"bpmn:Task")?Cg(t,sY):this.bpmnRenderer.getShapePath(t)}getSuitabilityScore(t){const n=P(t),{suitable:A}=n;return Number.isFinite(A)?A:null}getColor(t){return t>75?lY:t>25?BY:gY}}Bu.$inject=["eventBus","bpmnRenderer"];const pY={__init__:["paletteProvider","contextPadProvider","rendererProvider"],rendererProvider:["type",Bu],paletteProvider:["type",K1],contextPadProvider:["type",Z1]};function Ba(e){Ie.call(this,e),this._customElements=[]}W(Ba,Ie),Ba.prototype._modules=[].concat(Ba.prototype._modules,[pY]);const EY={"Create {type}":"创建 {type}","Create StartEvent":"开始节点","Create EndEvent":"结束节点","Create Task":"任务节点","Create UserTask":"用户任务节点","Create expanded SubProcess":"扩展子过程","Create IntermediateThrowEvent/BoundaryEvent":"中间抛出事件/边界事件","Create Pool/Participant":"池/参与者","Create Gateway":"网关","Create Exclusive Gateway":"互斥网关","Create Parallel Gateway":"并行网关","Create Inclusive Gateway":"相容网关","Create Group":"创建组","Create DataObjectReference":"数据对象引用","Create DataStoreReference":"数据存储引用","Create Intermediate/Boundary Event":"中间/边界事件","Activate the global connect tool":"激活全局连接工具","Append {type}":"追加 {type}","Add Lane above":"在上面添加道","Divide into two Lanes":"分割成两个道","Divide into three Lanes":"分割成三个道","Add Lane below":"在下面添加道","Append compensation activity":"追加补偿活动","Change type":"修改类型","Append element":"添加元素","Create element":"创建元素","Connect using Association":"使用关联连接","Connect using Sequence/MessageFlow or Association":"使用顺序/消息流或者关联连接","Connect using DataInputAssociation":"使用数据输入关联连接",Remove:"移除","Activate the hand tool":"激活抓手工具","Activate the lasso tool":"激活套索工具","Activate the create/remove space tool":"激活创建/删除空间工具","Parallel multi-instance":"并行多重事件","Sequential multi-instance":"时序多重事件",DataObjectReference:"数据对象参考",DataStoreReference:"数据存储参考",Loop:"循环","Ad-hoc":"即席",Task:"任务","Send task":"发送任务","Receive task":"接收任务","User task":"用户任务","Manual task":"手工任务","Business rule task":"业务规则任务","Service task":"服务任务","Script task":"脚本任务","Call activity":"调用活动","Sub-process (collapsed)":"子流程(折叠的)","Sub-process (expanded)":"子流程(展开的)","Ad-hoc sub-process (collapsed)":"临时子流程(折叠的)","Ad-hoc sub-process (expanded)":"临时子流程(展开的)","Start event":"开始事件",StartEvent:"开始事件","Intermediate throw event":"中间事件","End event":"结束事件",EndEvent:"结束事件","Message start event":"消息开始事件","Timer start event":"定时开始事件","Conditional start event":"条件开始事件","Signal start event":"信号开始事件","Error start event":"错误开始事件","Escalation start event":"升级开始事件","Compensation start event":"补偿开始事件","Message start event (non-interrupting)":"消息开始事件(非中断)","Timer start event (non-interrupting)":"定时开始事件(非中断)","Conditional start event (non-interrupting)":"条件开始事件(非中断)","Signal start event (non-interrupting)":"信号开始事件(非中断)","Escalation start event (non-interrupting)":"升级开始事件(非中断)","Message intermediate catch event":"消息中间捕获事件","Message intermediate throw event":"消息中间抛出事件","Timer intermediate catch event":"定时中间捕获事件","Escalation intermediate throw event":"升级中间抛出事件","Conditional intermediate catch event":"条件中间捕获事件","Link intermediate catch event":"链接中间捕获事件","Link intermediate throw event":"链接中间抛出事件","Compensation intermediate throw event":"补偿中间抛出事件","Signal intermediate catch event":"信号中间捕获事件","Signal intermediate throw event":"信号中间抛出事件","Message end event":"消息结束事件","Escalation end event":"定时结束事件","Error end event":"错误结束事件","Cancel end event":"取消结束事件","Compensation end event":"补偿结束事件","Signal end event":"信号结束事件","Terminate end event":"终止结束事件","Message boundary event":"消息边界事件","Message boundary event (non-interrupting)":"消息边界事件(非中断)","Timer boundary event":"定时边界事件","Timer boundary event (non-interrupting)":"定时边界事件(非中断)","Escalation boundary event":"升级边界事件","Escalation boundary event (non-interrupting)":"升级边界事件(非中断)","Conditional boundary event":"条件边界事件","Conditional boundary event (non-interrupting)":"条件边界事件(非中断)","Error boundary event":"错误边界事件","Cancel boundary event":"取消边界事件","Signal boundary event":"信号边界事件","Signal boundary event (non-interrupting)":"信号边界事件(非中断)","Compensation boundary event":"补偿边界事件","Toggle non-interrupting":"切换中断","Boundary event":"边界事件","Exclusive gateway":"互斥网关","Parallel gateway":"并行网关","Inclusive gateway":"相容网关","Complex gateway":"复杂网关","Event-based gateway":"事件网关",Transaction:"事务子流程","Sub Process":"子流程","Event sub-process":"事件子流程","Collapsed pool":"折叠池","Expanded pool":"展开池",Gateways:"网关",Tasks:"任务",Events:"事件","Sub-processes":"子流程",Data:"数据",Participants:"参与者","Data store reference":"数据存储参考","Data object reference":"数据对象参考","Default flow":"默认流转","Conditional flow":"条件流转","Sequence flow":"顺序流转","Expanded pool/participant":"展开池/参与者","Empty pool/participant":"折叠池/参与者","no parent for {element} in {parent}":"在{parent}里,{element}没有父类","no shape type specified":"没有指定的形状类型","flow elements must be children of pools/participants":"元素必须是池/参与者的子级","out of bounds release":"越界释放","more than {count} child lanes":"超过 {count} 条通道","element required":"元素不能为空","diagram not part of bpmn:Definitions":"流程图不符合bpmn规范","no diagram to display":"没有可展示的流程图","no process or collaboration to display":"没有可展示的流程/协作","element {element} referenced by {referenced}#{property} not yet drawn":"由{referenced}#{property}引用的{element}元素仍未绘制","already rendered {element}":"{element} 已呈现","failed to import {element}":"导入{element}失败","correcting missing bpmnElement on {plane} to {rootElement}":"在 {plane} 上更正缺失的 bpmnElement 为 {rootElement}","missing {semantic}#attachedToRef":"在 {element} 中缺少 {semantic}#attachedToRef","multiple DI elements defined for {element}":"为 {element} 定义了多个 DI 元素","no bpmnElement referenced in {element}":"{element} 中没有引用 bpmnElement","Sub process is missing start event":"子流程缺少开始事件","Sub process is missing end event":"子流程缺少结束事件","Element is an implicit start":"节点无法作为开始,缺少前置节点","Element is an implicit end":"节点无法作为结束,缺少后置节点","Element overlaps with other element":"节点重叠","Gateway is superfluous. It only has one source and target.":"网关是多余的,只有一个来源和目标","Append EndEvent":"追加结束事件节点","Append Gateway":"追加网关节点","Append UserTask":"追加用户任务节点","Append Intermediate/Boundary Event":"追加中间或边界事件","Append TimerIntermediateCatchEvent":"追加定时中间捕获事件","Append TextAnnotation":"追加文本批注","No Issues":"校验成功","Toggle linting overlays":"点击可关闭校验","{errors} Errors, {warnings} Warnings":"{errors} 错误,{warnings} 警告","Process is missing end event":"流程缺少结束节点","Process is missing start event":"流程缺少开始节点","Element is not connected":"节点缺少连接","Start event is missing event definition":"缺少事件定义","Event has multiple event definitions":"多个事件定义","Sequence flow is missing condition":"缺少流转条件","Flow splits implicitly":"流转方向未知","Incoming flows do not join":"使用网关确定统一的入口","SequenceFlow is a duplicate":"重复的连线","Duplicate incoming sequence flows":"入口连线重复","Duplicate outgoing sequence flows":"出口连线重复","Gateway forks and joins":"允许一进多出、多进一出。禁止多进多出","Element is missing label/name":"节点缺少名称","Open minimap":"小地图","Close minimap":"关闭小地图","Token Simulation":"流程模拟","Play/Pause Simulation":"开始/暂停","Pause Simulation":"暂停","Play Simulation":"开始","Set animation speed":"设置速度",Slow:"慢",Normal:"正常",Fast:"快",Finished:"结束","Reset Simulation":"重置","Toggle Simulation Log":"显示日志","Simulation Log":"日志","No Entries":"暂无日志",Process:"流程",SubProcess:"子流程",started:"启动",finished:"结束",canceled:"取消"};function gu(e,t){return t=t||{},e=EY[e]||e,e.replace(/{([^}]+)}/g,function(n,A){return t[A]||"{"+A+"}"})}function pu(e,t){var n=e.get("editorActions",!1);n&&n.register({toggleLinting:function(){t.toggle()}})}pu.$inject=["injector","linting"];var dY=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function uY(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function QY(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function A(){return this instanceof A?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(A){var i=Object.getOwnPropertyDescriptor(e,A);Object.defineProperty(n,A,i.get?i:{enumerable:!0,get:function(){return e[A]}})}),n}var hY=function e(t,n){const A=n.enter,i=n.leave,o=A&&A(t),r=t.$descriptor;o!==!1&&!r.isGeneric&&r.properties.filter(c=>!c.isAttr&&!c.isReference&&c.type!=="String").forEach(c=>{if(c.name in t){const l=t[c.name];c.isMany?l.forEach(B=>{e(B,n)}):e(l,n)}}),i&&i(t)};const wY=QY(dh),mY=hY,{isArray:fY,isObject:CY,isFunction:MY}=wY;class DY{constructor({moddleRoot:t,rule:n}){this.rule=n,this.moddleRoot=t,this.messages=[],this.report=this.report.bind(this)}report(t,n,A){let i={id:t,message:n};A&&fY(A)&&(i={...i,path:A}),A&&CY(A)&&(i={...i,...A}),this.messages.push(i)}}var yY=function({moddleRoot:t,rule:n}){const A=new DY({rule:n,moddleRoot:t}),i=n.check||{},o="leave"in i?i.leave:void 0,r="enter"in i?i.enter:MY(i)?i:void 0;if(!r&&!o)throw new Error("no check implemented");return mY(t,{enter:r?a=>r(a,A):void 0,leave:o?a=>o(a,A):void 0}),A.messages};const IY=yY,FY=(e,t)=>e,vY={0:"off",1:"warn",2:"error",3:"info"},xY="rule-error";function ge(e){const{config:t={},resolver:n,transformRule:A=FY}=e||{};if(typeof n>"u")throw new Error("must provide <options.resolver>");this.config=t,this.resolver=n,this.transformRule=A,this.cachedRules={},this.cachedConfigs={}}var bY=ge;ge.prototype.applyRule=function(t,n){const{config:A,rule:i,category:o,name:r}=n;try{return IY({moddleRoot:t,rule:i,config:A}).map(function(c){return{...c,meta:i.meta,category:o}})}catch(a){return console.error("rule <"+r+"> failed with error: ",a),[{message:a.message,category:xY}]}},ge.prototype.resolveRule=function(e,t){const{pkg:n,ruleName:A}=this.parseRuleName(e),i=`${n}-${A}`,o=this.cachedRules[i];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,A)).then(r=>{if(!r)throw new Error(`unknown rule <${e}>`);return this.cachedRules[i]=this.transformRule(r(t),{pkg:n,ruleName:A})})},ge.prototype.resolveConfig=function(e){const{pkg:t,configName:n}=this.parseConfigName(e),A=`${t}-${n}`,i=this.cachedConfigs[A];return i?Promise.resolve(i):Promise.resolve(this.resolver.resolveConfig(t,n)).then(o=>{if(!o)throw new Error(`unknown config <${e}>`);return this.cachedConfigs[A]=this.normalizeConfig(o,t)})},ge.prototype.resolveRules=function(e){return this.resolveConfiguredRules(e).then(t=>{const i=Object.entries(t).map(([o,r])=>{const{category:a,config:c}=this.parseRuleValue(r);return{name:o,category:a,config:c}}).filter(o=>o.category!=="off").map(o=>{const{name:r,config:a}=o;return this.resolveRule(r,a).then(function(c){return{...o,rule:c}})});return Promise.all(i)})},ge.prototype.resolveConfiguredRules=function(e){let t=e.extends;return typeof t=="string"&&(t=[t]),typeof t>"u"&&(t=[]),Promise.all(t.map(n=>this.resolveConfig(n).then(A=>this.resolveConfiguredRules(A)))).then(n=>{const A=this.normalizeConfig(e,"bpmnlint").rules;return[...n,A].reduce((o,r)=>({...o,...r}),{})})},ge.prototype.lint=function(e,t){return t=t||this.config,this.resolveRules(t).then(n=>{const A={};return n.forEach(i=>{const{name:o}=i,r=this.applyRule(e,i);r.length&&(A[o]=r)}),A})},ge.prototype.parseRuleValue=function(e){let t,n;return Array.isArray(e)?(t=e[0],n=e[1]):(t=e,n={}),typeof t=="string"&&(t=t.toLowerCase()),t=vY[t]||t,{config:n,category:t}},ge.prototype.parseRuleName=function(e,t="bpmnlint"){const n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(e);if(!n)throw new Error(`unparseable rule name <${e}>`);const[A,i,o,r]=n;return o?{pkg:`${i?i+"/":""}${Eu(o)}`,ruleName:r}:{pkg:t,ruleName:r}},ge.prototype.parseConfigName=function(e){const t=/^(?:(?:plugin:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)|bpmnlint:)([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable config name <${e}>`);const[n,A,i,o]=t;return i?{pkg:`${A?A+"/":""}${Eu(i)}`,configName:o}:{pkg:"bpmnlint",configName:o}},ge.prototype.getSimplePackageName=function(e){const t=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable package name <${e}>`);const[n,A,i]=t;return`${A?A+"/":""}${YY(i)}`},ge.prototype.normalizeConfig=function(e,t){const n=e.rules||{},A=Object.keys(n).reduce((i,o)=>{const r=n[o],{pkg:a,ruleName:c}=this.parseRuleName(o,t),l=a==="bpmnlint"?c:`${this.getSimplePackageName(a)}/${c}`;return i[l]=r,i},{});return{...e,rules:A}};function Eu(e){return e==="bpmnlint"?"bpmnlint":e.startsWith("bpmnlint-plugin-")?e:`bpmnlint-plugin-${e}`}function YY(e){return e.startsWith("bpmnlint-plugin-")?e.substring(16):e}var UY={Linter:bY},du='<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>',uu='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 512 512"><path fill="currentColor" d="M288 328.83c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zM207.439 57.034l11.61 204.348c.544 9.334 8.78 16.64 18.755 16.64h100.392c9.975 0 18.211-7.306 18.754-16.64l11.611-204.348c.587-10.082-7.98-18.56-18.754-18.56H226.192c-10.775 0-19.34 8.478-18.753 18.56z"/></svg>',Qu='<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>',hu='<svg width="12" height="12" viewBox="3.5 3.5 9 9" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"/></svg>',NY=-7,zY=-7,RY=500,wu={resolver:{resolveRule:function(){return null}},config:{}},mu={error:du,warning:uu,success:Qu,info:hu,inactive:Qu};function O0(e,t,n,A,i,o,r){this._bpmnjs=e,this._canvas=t,this._elementRegistry=A,this._eventBus=i,this._overlays=o,this._translate=r,this._issues={},this._active=n&&n.active||!1,this._linterConfig=wu,this._overlayIds={};var a=this;i.on(["import.done","elements.changed","linting.configChanged","linting.toggle"],RY,function(l){a.update()}),i.on("linting.toggle",function(l){l.active||(a._clearIssues(),a._updateButton())}),i.on("diagram.clear",function(){a._clearIssues()});var c=n&&n.bpmnlint;c&&i.once("diagram.init",function(){if(a.getLinterConfig()===wu)try{a.setLinterConfig(c)}catch{console.error("[bpmn-js-bpmnlint] Invalid lint rules configured. Please doublecheck your linting.bpmnlint configuration, cf. https://github.com/bpmn-io/bpmn-js-bpmnlint#configure-lint-rules")}}),this._init()}O0.prototype.setLinterConfig=function(e){if(!e.config||!e.resolver)throw new Error("Expected linterConfig = { config, resolver }");this._linterConfig=e,this._eventBus.fire("linting.configChanged")},O0.prototype.getLinterConfig=function(){return this._linterConfig},O0.prototype._init=function(){this._createButton(),this._updateButton()},O0.prototype.isActive=function(){return this._active},O0.prototype._formatIssues=function(e){let t=this,n=F2(e,function(o,r,a){return o.concat(r.map(function(c){return c.rule=a,c}))},[]);const A=t._elementRegistry.filter(o=>f(o,"bpmn:Participant")),i=A.map(o=>o.businessObject);return n=B2(n,function(o){if(!t._elementRegistry.get(o.id)){o.isChildIssue=!0,o.actualElementId=o.id;const a=i.filter(c=>c.processRef&&c.processRef.id&&c.processRef.id===o.id);a.length?o.id=a[0].id:o.id=t._canvas.getRootElement().id}return o}),n=Ve(n,function(o){return o.id}),n},O0.prototype.toggle=function(e){return e=typeof e>"u"?!this.isActive():e,this._setActive(e),e},O0.prototype._setActive=function(e){this._active!==e&&(this._active=e,this._eventBus.fire("linting.toggle",{active:e}))},O0.prototype.update=function(){var e=this,t=this._bpmnjs.getDefinitions();if(t){var n=this._lintStart=Math.random();this.lint().then(function(A){if(e._lintStart===n){A=e._formatIssues(A);var i={},o={},r={};for(var a in e._issues)A[a]||(i[a]=e._issues[a]);for(var c in A)e._issues[c]?A[c]!==e._issues[c]&&(o[c]=A[c]):r[c]=A[c];i=N(i,o),r=N(r,o),e._clearOverlays(),e.isActive()&&e._createIssues(r),e._issues=A,e._updateButton(),e._fireComplete(A)}})}},O0.prototype._fireComplete=function(e){this._eventBus.fire("linting.completed",{issues:e})},O0.prototype._createIssues=function(e){for(var t in e)this._createElementIssues(t,e[t])},O0.prototype._createElementIssues=function(e,t){var n=this._elementRegistry.get(e);if(n){var A=this._elementRegistry.get(e+"_plane");A&&this._createElementIssues(A.id,t);var i,o,r=!n.parent;r&&f(n,"bpmn:Process")?(i="bottom-right",o={top:20,left:150}):r&&f(n,"bpmn:SubProcess")?(i="bottom-right",o={top:50,left:150}):(i="top-right",o={top:NY,left:zY});var a=Ve(t,function(R){return(R.isChildIssue?"child":"")+R.category}),c=a.error,l=a.warn,B=a.info,g=a.childerror,p=a.childwarn,E=a.childinfo;if(!(!B&&!c&&!l&&!g&&!p&&!E)){var d=$('<div class="bjsl-overlay bjsl-issues-'+i+'"></div>'),u=$(c||g?'<div class="bjsl-icon bjsl-icon-error">'+du+"</div>":l||p?'<div class="bjsl-icon bjsl-icon-warning">'+uu+"</div>":'<div class="bjsl-icon bjsl-icon-info">'+hu+"</div>"),h=$('<div class="bjsl-dropdown"></div>'),D=$('<div class="bjsl-dropdown-content"></div>'),y=$('<div class="bjsl-issues"></div>'),C=$('<div class="bjsl-current-element-issues"></div>'),m=$("<ul></ul>");if(d.appendChild(u),d.appendChild(h),h.appendChild(D),D.appendChild(y),y.appendChild(C),C.appendChild(m),c&&this._addErrors(m,c),l&&this._addWarnings(m,l),B&&this._addInfos(m,B),g||p||E){var I=$('<div class="bjsl-child-issues"></div>'),x=$("<ul></ul>"),v=this._translate("Issues for child elements"),F=$('<a class="bjsl-issue-heading">'+v+":</a>");if(g&&this._addErrors(x,g),p&&this._addWarnings(x,p),E&&this._addInfos(x,E),c||l){var z=$("<hr/>");I.appendChild(z)}I.appendChild(F),I.appendChild(x),y.appendChild(I)}this._overlayIds[e]=this._overlays.add(n,"linting",{position:o,html:d,scale:{min:.7}})}}},O0.prototype._addErrors=function(e,t){var n=this;t.forEach(function(A){n._addEntry(e,"error",A)})},O0.prototype._addWarnings=function(e,t){var n=this;t.forEach(function(A){n._addEntry(e,"warning",A)})},O0.prototype._addInfos=function(e,t){var n=this;t.forEach(function(A){n._addEntry(e,"info",A)})},O0.prototype._addEntry=function(e,t,n){var l;var A=n.rule,i=(l=n.meta)==null?void 0:l.documentation.url,o=this._translate(n.message),r=n.actualElementId,a=mu[t],c=$(`
288
288
  <li class="${t}" data-rule="${qe(A)}">
289
289
  <span class="icon">${a}</span>
290
290
  <span class="message">${qe(o)}</span>
@@ -293,7 +293,7 @@
293
293
  </li>
294
294
  `);e.appendChild(c)},O0.prototype._clearOverlays=function(){this._overlays.remove({type:"linting"}),this._overlayIds={}},O0.prototype._clearIssues=function(){this._issues={},this._clearOverlays()},O0.prototype._setButtonState=function(e){var{errors:t,warnings:n,infos:A}=e,i=this._button,o=t&&"error"||n&&"warning"||"success",r=mu[o],a=this._translate("{errors} Errors, {warnings} Warnings",{errors:String(t),warnings:String(n),infos:String(A)}),c=`
295
295
  <span class="icon">${r}</span>
296
- <span class="label">${a}</span>`;o=this.isActive()?o:"inactive",["error","inactive","success","warning"].forEach(function(l){o===l?i.classList.add("bjsl-button-"+l):i.classList.remove("bjsl-button-"+l)}),i.innerHTML=c},O0.prototype._updateButton=function(){var e=0,t=0,n=0;for(var A in this._issues)this._issues[A].forEach(function(i){i.category==="error"?e++:i.category==="warn"?t++:i.category==="info"&&n++});this._setButtonState({errors:e,warnings:t,infos:n})},O0.prototype._createButton=function(){var e=this;this._button=$('<button class="bjsl-button bjsl-button-inactive" title="'+this._translate("Toggle linting overlays")+'"></button>'),this._button.addEventListener("click",function(){e.toggle()}),this._canvas.getContainer().appendChild(this._button)},O0.prototype.lint=function(){var e=this._bpmnjs.getDefinitions(),t=new UY.Linter(this._linterConfig);return t.lint(e)},O0.$inject=["bpmnjs","canvas","config.linting","elementRegistry","eventBus","overlays","translate"];const SY={__init__:["linting","lintingEditorActions"],linting:["type",O0],lintingEditorActions:["type",pu]};function TY(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(A){var i=Object.getOwnPropertyDescriptor(e,A);Object.defineProperty(n,A,i.get?i:{enumerable:!0,get:function(){return e[A]}})}),n}function fu(e,t){return t.indexOf(":")===-1&&(t="bpmn:"+t),typeof e.$instanceOf=="function"?e.$instanceOf(t):e.$type===t}function kY(e,t){return t.some(function(n){return fu(e,n)})}var GY=Object.freeze({__proto__:null,is:fu,isAny:kY}),t2=TY(GY),k0={};const{is:Cu}=t2;function HY(e,t){return function(){function n(A,i){Cu(A,e)&&i.report(A.id,"Element type <"+e+"> is discouraged")}return Du(t,{check:n})}}k0.checkDiscouragedNodeType=HY;function Mu(e,t){if(!e)return null;const n=e.$parent;return n?Cu(n,t)?n:Mu(n,t):e}k0.findParent=Mu;const PY="https://github.com/bpmn-io/bpmnlint/blob/main/docs/rules";function Du(e,t){const{meta:{documentation:n={},...A}={},...i}=t;return{meta:{documentation:{url:`${PY}/${e}.md`,...n},...A},...i}}k0.annotateRule=Du;const{is:ga}=t2,{annotateRule:JY}=k0;var jY=function(){function e(t,n){if(!ga(t,"bpmn:AdHocSubProcess"))return;(t.flowElements||[]).forEach(function(i){ga(i,"bpmn:StartEvent")&&n.report(i.id,"A <Start Event> is not allowed in <Ad Hoc Sub Process>"),ga(i,"bpmn:EndEvent")&&n.report(i.id,"An <End Event> is not allowed in <Ad Hoc Sub Process>"),ga(i,"bpmn:IntermediateCatchEvent")&&(!i.outgoing||i.outgoing.length===0)&&n.report(i.id,"An intermediate catch event inside <Ad Hoc Sub Process> must have an outgoing sequence flow")})}return JY("ad-hoc-sub-process",{check:e})};const{annotateRule:VY}=k0;var LY=function(){function e(t,n){if(!WY(t))return;(t.outgoing||[]).forEach(i=>{!yu(i)&&!_Y(t,i)&&n.report(i.id,"Sequence flow is missing condition",["conditionExpression"])})}return VY("conditional-flows",{check:e})};function WY(e){const t=e.default,n=e.outgoing||[];return t||n.find(yu)}function yu(e){return!!e.conditionExpression}function _Y(e,t){return e.default===t}const{is:nl,isAny:OY}=t2,{annotateRule:XY}=k0;var KY=function(){function e(n){return(n.flowElements||[]).some(i=>nl(i,"bpmn:EndEvent"))}function t(n,A){if(!(!OY(n,["bpmn:Process","bpmn:SubProcess"])||nl(n,"bpmn:AdHocSubProcess"))&&!e(n)){const i=nl(n,"bpmn:SubProcess")?"Sub process":"Process";A.report(n.id,i+" is missing end event")}}return XY("end-event-required",{check:t})};const{is:Iu}=t2,{annotateRule:ZY}=k0;var qY=function(){function e(t,n){if(!Iu(t,"bpmn:SubProcess")||!t.triggeredByEvent)return;(t.flowElements||[]).forEach(function(i){if(!Iu(i,"bpmn:StartEvent"))return!1;(i.eventDefinitions||[]).length===0&&n.report(i.id,"Start event is missing event definition",["eventDefinitions"])})}return ZY("event-sub-process-typed-start-event",{check:e})};const{isAny:$Y}=t2,{annotateRule:eU}=k0;var tU=function(){function e(t,n){if(!$Y(t,["bpmn:Activity","bpmn:Event"]))return;(t.incoming||[]).length>1&&n.report(t.id,"Incoming flows do not join")}return eU("fake-join",{check:e})};const{is:L2,isAny:Al}=t2,{annotateRule:nU}=k0;var AU=function(){function e(r,a){if(!L2(r,"bpmn:Definitions"))return!1;const c=t(r),l=n(r);c.forEach(B=>{A(B)||a.report(B.id,"Element is missing name"),i(B,l)||a.report(B.id,"Element is unused"),o(B,c)||a.report(B.id,"Element name is not unique")})}return nU("global",{check:e});function t(r){return r.rootElements.filter(a=>Al(a,["bpmn:Error","bpmn:Escalation","bpmn:Message","bpmn:Signal"]))}function n(r){const a=[];function c(l){L2(l,"bpmn:Definitions")&&l.get("rootElements").length&&l.get("rootElements").forEach(c),L2(l,"bpmn:FlowElementsContainer")&&l.get("flowElements").length&&l.get("flowElements").forEach(c),L2(l,"bpmn:Event")&&l.get("eventDefinitions").length&&l.get("eventDefinitions").forEach(B=>a.push(B)),L2(l,"bpmn:Collaboration")&&l.get("messageFlows").length&&l.get("messageFlows").forEach(c),Al(l,["bpmn:MessageFlow","bpmn:ReceiveTask","bpmn:SendTask"])&&a.push(l)}return c(r),a}function A(r){var a;return((a=r.name)==null?void 0:a.trim())!==""}function i(r,a){if(L2(r,"bpmn:Error"))return a.some(c=>{var l;return L2(c,"bpmn:ErrorEventDefinition")&&r.get("id")===((l=c.get("errorRef"))==null?void 0:l.get("id"))});if(L2(r,"bpmn:Escalation"))return a.some(c=>{var l;return L2(c,"bpmn:EscalationEventDefinition")&&r.get("id")===((l=c.get("escalationRef"))==null?void 0:l.get("id"))});if(L2(r,"bpmn:Message"))return a.some(c=>{var l;return Al(c,["bpmn:MessageEventDefinition","bpmn:MessageFlow","bpmn:ReceiveTask","bpmn:SendTask"])&&r.get("id")===((l=c.get("messageRef"))==null?void 0:l.get("id"))});if(L2(r,"bpmn:Signal"))return a.some(c=>{var l;return L2(c,"bpmn:SignalEventDefinition")&&r.get("id")===((l=c.get("signalRef"))==null?void 0:l.get("id"))})}function o(r,a){return a.filter(c=>L2(c,r.$type)&&r.name===c.name).length===1}};const{is:il,isAny:Fu}=t2,{annotateRule:iU}=k0;var oU=function(){function e(t,n){Fu(t,["bpmn:ParallelGateway","bpmn:EventBasedGateway"])||il(t,"bpmn:Gateway")&&!rU(t)||il(t,"bpmn:SubProcess")||il(t,"bpmn:SequenceFlow")&&!aU(t)||Fu(t,["bpmn:FlowNode","bpmn:SequenceFlow","bpmn:Participant","bpmn:Lane"])&&(t.name||"").trim().length===0&&n.report(t.id,"Element is missing label/name",["name"])}return iU("label-required",{check:e})};function rU(e){return(e.outgoing||[]).length>1}function aU(e){return e.conditionExpression}var M0={};function cU(e){return Array.prototype.concat.apply([],e)}const zi=Object.prototype.toString,sU=Object.prototype.hasOwnProperty;function dA(e){return e===void 0}function vu(e){return e!==void 0}function pa(e){return e==null}function Ea(e){return zi.call(e)==="[object Array]"}function da(e){return zi.call(e)==="[object Object]"}function lU(e){return zi.call(e)==="[object Number]"}function ol(e){const t=zi.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function BU(e){return zi.call(e)==="[object String]"}function xu(e){if(!Ea(e))throw new Error("must supply array")}function bu(e,t){return!pa(e)&&sU.call(e,t)}function Yu(e,t){const n=Qa(t);let A;return S2(e,function(i,o){if(n(i,o))return A=i,!1}),A}function gU(e,t){const n=Qa(t);let A=Ea(e)?-1:void 0;return S2(e,function(i,o){if(n(i,o))return A=o,!1}),A}function pU(e,t){const n=Qa(t);let A=[];return S2(e,function(i,o){n(i,o)&&A.push(i)}),A}function S2(e,t){let n,A;if(dA(e))return;const i=Ea(e)?CU:fU;for(let o in e)if(bu(e,o)&&(n=e[o],A=t(n,i(o)),A===!1))return n}function EU(e,t){if(dA(e))return[];xu(e);const n=Qa(t);return e.filter(function(A,i){return!n(A,i)})}function Uu(e,t,n){return S2(e,function(A,i){n=t(n,A,i)}),n}function Nu(e,t){return!!Uu(e,function(n,A,i){return n&&t(A,i)},!0)}function dU(e,t){return!!Yu(e,t)}function ua(e,t){let n=[];return S2(e,function(A,i){n.push(t(A,i))}),n}function zu(e){return e&&Object.keys(e)||[]}function uU(e){return zu(e).length}function QU(e){return ua(e,t=>t)}function Ru(e,t,n={}){return t=rl(t),S2(e,function(A){let i=t(A)||"_",o=n[i];o||(o=n[i]=[]),o.push(A)}),n}function Su(e,...t){e=rl(e);let n={};return S2(t,i=>Ru(i,e,n)),ua(n,function(i,o){return i[0]})}const hU=Su;function wU(e,t){t=rl(t);let n=[];return S2(e,function(A,i){let o=t(A,i),r={d:o,v:A};for(var a=0;a<n.length;a++){let{d:c}=n[a];if(o<c){n.splice(a,0,r);return}}n.push(r)}),ua(n,A=>A.v)}function mU(e){return function(t){return Nu(e,function(n,A){return t[A]===n})}}function rl(e){return ol(e)?e:t=>t[e]}function Qa(e){return ol(e)?e:t=>t===e}function fU(e){return e}function CU(e){return Number(e)}function MU(e,t){let n,A,i,o;function r(g){let p=Date.now(),E=g?0:o+t-p;if(E>0)return a(E);e.apply(i,A),c()}function a(g){n=setTimeout(r,g)}function c(){n&&clearTimeout(n),n=o=A=i=void 0}function l(){n&&r(!0),c()}function B(...g){o=Date.now(),A=g,i=this,n||a(t)}return B.flush=l,B.cancel=c,B}function DU(e,t){let n=!1;return function(...A){n||(e(...A),n=!0,setTimeout(()=>{n=!1},t))}}function yU(e,t){return e.bind(t)}function IU(e,...t){return Object.assign(e,...t)}function FU(e,t,n){let A=e;return S2(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let r=t[o+1],a=A[i];vu(r)&&pa(a)&&(a=A[i]=isNaN(+r)?{}:[]),dA(r)?dA(n)?delete A[i]:A[i]=n:A=a}),e}function vU(e,t,n){let A=e;return S2(t,function(i){if(pa(A))return A=void 0,!1;A=A[i]}),dA(A)?n:A}function xU(e,t){let n={},A=Object(e);return S2(t,function(i){i in A&&(n[i]=e[i])}),n}function bU(e,t){let n={},A=Object(e);return S2(A,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Tu(e,...t){return t.length&&S2(t,function(n){!n||!da(n)||S2(n,function(A,i){if(i==="__proto__")return;let o=e[i];da(A)?(da(o)||(o={}),e[i]=Tu(o,A)):e[i]=A})}),e}M0.assign=IU,M0.bind=yU,M0.debounce=MU,M0.ensureArray=xu,M0.every=Nu,M0.filter=pU,M0.find=Yu,M0.findIndex=gU,M0.flatten=cU,M0.forEach=S2,M0.get=vU,M0.groupBy=Ru,M0.has=bu,M0.isArray=Ea,M0.isDefined=vu,M0.isFunction=ol,M0.isNil=pa,M0.isNumber=lU,M0.isObject=da,M0.isString=BU,M0.isUndefined=dA,M0.keys=zu,M0.map=ua,M0.matchPattern=mU,M0.merge=Tu,M0.omit=bU,M0.pick=xU,M0.reduce=Uu,M0.set=FU,M0.size=uU,M0.some=dU,M0.sortBy=wU,M0.throttle=DU,M0.unionBy=hU,M0.uniqueBy=Su,M0.values=QU,M0.without=EU;const{groupBy:YU}=M0,{is:uA}=t2,{annotateRule:UU}=k0;var NU=function(){function e(t,n){if(!uA(t,"bpmn:FlowElementsContainer"))return;const A=(t.flowElements||[]).filter(zU);for(const o of A)ku(o)||n.report(o.id,"Link event is missing link name");const i=YU(A,o=>ku(o));for(const[o,r]of Object.entries(i)){if(!o)continue;if(r.length===1){const c=r[0];n.report(c.id,`Link ${RU(c)?"catch":"throw"} event with link name <${o}> missing in scope`);continue}const a=r.filter(SU);if(a.length>1)for(const c of a)n.report(c.id,`Duplicate link catch event with link name <${o}> in scope`);else if(a.length===0)for(const c of r)n.report(c.id,`Link catch event with link name <${o}> missing in scope`)}}return UU("link-event",{check:e})};function zU(e){var t=e.eventDefinitions||[];return uA(e,"bpmn:Event")?t.some(n=>uA(n,"bpmn:LinkEventDefinition")):!1}function ku(e){return e.get("eventDefinitions").find(t=>uA(t,"bpmn:LinkEventDefinition")).name}function RU(e){return uA(e,"bpmn:ThrowEvent")}function SU(e){return uA(e,"bpmn:CatchEvent")}const{is:TU}=t2,{flatten:al}=M0,{annotateRule:kU}=k0;var GU=function(){function e(t,n){if(!TU(t,"bpmn:Definitions"))return!1;const i=cl(t.rootElements).filter(PU),o=HU(t);i.forEach(r=>{o.indexOf(r.id)===-1&&n.report(r.id,"Element is missing bpmndi")})}return kU("no-bpmndi",{check:e})};function cl(e){return al(e.map(t=>{const n=t.laneSets&&t.laneSets[0]||t.childLaneSet,A=al([t.flowElements||[],t.flowElements&&cl(t.flowElements.filter(JU))||[],t.participants||[],t.artifacts||[],n&&n.lanes||[],n&&n.lanes&&cl(n.lanes.filter(jU))||[],t.messageFlows||[]]);return A.length>0?A.map(i=>({id:i.id,$type:i.$type})):[]}))}function HU(e){return al(e.get("diagrams").map(t=>(t.plane.planeElement||[]).map(A=>{var i;return(i=A.bpmnElement)==null?void 0:i.id})))}function PU(e){return!["bpmn:DataObject"].includes(e.$type)}function JU(e){return!!e.flowElements}function jU(e){return!!e.childLaneSet}const VU=k0.checkDiscouragedNodeType;var LU=VU("bpmn:ComplexGateway","no-complex-gateway");const{isAny:WU,is:sl}=t2,{annotateRule:_U}=k0;var OU=function(){function e(t,n){if(!WU(t,["bpmn:Task","bpmn:Gateway","bpmn:SubProcess","bpmn:Event"])||t.triggeredByEvent||ZU(t)||sl(t.$parent,"bpmn:AdHocSubProcess"))return;const A=t.incoming||[],i=t.outgoing||[];!A.length&&!i.length&&n.report(t.id,"Element is not connected")}return _U("no-disconnected",{check:e})};function XU(e){var t=e.eventDefinitions;return!sl(e,"bpmn:BoundaryEvent")||!t||t.length!==1?!1:sl(t[0],"bpmn:CompensateEventDefinition")}function KU(e){return e.isForCompensation}function ZU(e){var t=XU(e),n=KU(e);return t||n}const{is:qU}=t2,{annotateRule:$U}=k0;var e6=function(){const e={},t={},n={};function A(i,o){if(!qU(i,"bpmn:SequenceFlow"))return;const r=t6(i);if(r in e){o.report(i.id,"SequenceFlow is a duplicate");const a=i.sourceRef.id,c=i.targetRef.id;t[a]||(o.report(a,"Duplicate outgoing sequence flows"),t[a]=!0),n[c]||(o.report(c,"Duplicate incoming sequence flows"),n[c]=!0)}else e[r]=i}return $U("no-duplicate-sequence-flows",{check:A})};function t6(e){const t=e.conditionExpression,n=t?t.body:"",A=e.sourceRef?e.sourceRef.id:e.id,i=e.targetRef?e.targetRef.id:e.id;return A+"#"+i+"#"+n}const{is:n6}=t2,{annotateRule:A6}=k0;var i6=function(){function e(t,n){if(!n6(t,"bpmn:Gateway"))return;const A=t.incoming||[],i=t.outgoing||[];A.length>1&&i.length>1&&n.report(t.id,"Gateway forks and joins")}return A6("no-gateway-fork-join",{check:e})};const{isAny:o6}=t2,{annotateRule:r6}=k0;var a6=function(){function e(t,n){if(!o6(t,["bpmn:Activity","bpmn:Event"]))return;(t.outgoing||[]).filter(o=>!c6(o)&&!s6(t,o)).length>1&&n.report(t.id,"Flow splits implicitly")}return r6("no-implicit-split",{check:e})};function c6(e){return!!e.conditionExpression}function s6(e,t){return e.default===t}const{is:st,isAny:l6}=t2,{findParent:B6,annotateRule:g6}=k0;var p6=function(){function e(r){const a=r.eventDefinitions||[];return a.length&&a.every(c=>st(c,"bpmn:LinkEventDefinition"))}function t(r){const a=r.eventDefinitions||[];return a.length&&a.every(c=>st(c,"bpmn:CompensateEventDefinition"))}function n(r){return(B6(r,"bpmn:Process").artifacts||[]).some(l=>st(l,"bpmn:Association")?l.sourceRef.id===r.id:!1)}function A(r){return r.isForCompensation}function i(r){const a=r.outgoing||[];return st(r,"bpmn:SubProcess")&&r.triggeredByEvent||st(r,"bpmn:IntermediateThrowEvent")&&e(r)||st(r.$parent,"bpmn:AdHocSubProcess")||st(r,"bpmn:EndEvent")||st(r,"bpmn:BoundaryEvent")&&t(r)&&n(r)||st(r,"bpmn:Task")&&A(r)?!1:a.length===0}function o(r,a){l6(r,["bpmn:Event","bpmn:Activity","bpmn:Gateway"])&&i(r)&&a.report(r.id,"Element is an implicit end")}return g6("no-implicit-end",{check:o})};const{is:Ri,isAny:Gu}=t2,{annotateRule:E6}=k0;var d6=function(){function e(A){const i=A.eventDefinitions||[];return i.length&&i.every(o=>Ri(o,"bpmn:LinkEventDefinition"))}function t(A){const i=A.incoming||[];return Ri(A,"bpmn:Activity")&&A.isForCompensation||Ri(A.$parent,"bpmn:AdHocSubProcess")||Ri(A,"bpmn:SubProcess")&&A.triggeredByEvent||Ri(A,"bpmn:IntermediateCatchEvent")&&e(A)||Gu(A,["bpmn:StartEvent","bpmn:BoundaryEvent"])?!1:i.length===0}function n(A,i){Gu(A,["bpmn:Event","bpmn:Activity","bpmn:Gateway"])&&t(A)&&i.report(A.id,"Element is an implicit start")}return E6("no-implicit-start",{check:n})};const{is:QA}=t2,{annotateRule:u6}=k0;var Q6=function(){function e(t,n){if(!QA(t,"bpmn:Definitions"))return;const A=t.rootElements||[],i=new Set,o=new Set,r=m6(t),a=new Map;A.filter(c=>QA(c,"bpmn:Collaboration")).forEach(c=>{const l=c.participants||[];Pu(l,i,r),l.forEach(B=>{a.set(B.processRef,r.get(B))})}),A.filter(c=>QA(c,"bpmn:Process")).forEach(c=>{const l=a.get(c)||{};Hu(c,i,o,r,l)}),i.forEach(c=>n.report(c.id,"Element overlaps with other element")),o.forEach(c=>n.report(c.id,"Element is outside of parent boundary"))}return u6("no-overlapping-elements",{check:e})};function Hu(e,t,n,A,i){const o=e.flowElements||[],r=o.filter(c=>A.has(c));Pu(r,t,A),r.forEach(c=>{!QA(c,"bpmn:DataStoreReference")&&h6(A.get(c).bounds,i.bounds)&&n.add(c)}),o.filter(c=>QA(c,"bpmn:SubProcess")).forEach(c=>{const l=A.get(c)||{},B=l.isExpanded?l:{};Hu(c,t,n,A,B)})}function Pu(e,t,n){var A,i;for(let o=0;o<e.length-1;o++){const r=e[o];for(let a=o+1;a<e.length;a++){const c=e[a];if(r.attachedToRef===c||c.attachedToRef===r)continue;const l=(A=n.get(r))==null?void 0:A.bounds,B=(i=n.get(c))==null?void 0:i.bounds;!l||!B||w6(l,B)&&(t.add(r),t.add(c))}}}function h6(e,t){if(!ha(e)||!ha(t))return!1;const n=e.x>=t.x&&e.y>=t.y,A=e.x+e.width<=t.x+t.width&&e.y+e.height<=t.y+t.height;return!(n&&A)}function w6(e,t){if(!ha(e)||!ha(t))return!1;const n=e.x+e.width>=t.x&&t.x+t.width>=e.x,A=e.y+e.height>=t.y&&t.y+t.height>=e.y;return n&&A}function ha(e){return!!e&&QA(e,"dc:Bounds")&&typeof e.x=="number"&&typeof e.y=="number"&&typeof e.width=="number"&&typeof e.height=="number"}function m6(e){const t=new Map;return(e.diagrams||[]).filter(A=>!!A.plane).forEach(A=>{(A.plane.planeElement||[]).filter(o=>!!o.bpmnElement).forEach(o=>{t.set(o.bpmnElement,o)})}),t}const{is:ll}=t2,{annotateRule:f6}=k0;var C6=function(){function e(t,n){if(!ll(t,"bpmn:FlowElementsContainer"))return;if((t.flowElements||[]).filter(function(o){return ll(o,"bpmn:StartEvent")?(o.eventDefinitions||[]).length===0:!1}).length>1){const o=ll(t,"bpmn:SubProcess")?"Sub process":"Process";n.report(t.id,o+" has multiple blank start events")}}return f6("single-blank-start-event",{check:e})};const{is:M6}=t2,{annotateRule:D6}=k0;var y6=function(){function e(t,n){if(!M6(t,"bpmn:Event"))return;(t.eventDefinitions||[]).length>1&&n.report(t.id,"Event has multiple event definitions",["eventDefinitions"])}return D6("single-event-definition",{check:e})};const{is:Bl,isAny:I6}=t2,{annotateRule:F6}=k0;var v6=function(){function e(n){return(n.flowElements||[]).some(i=>Bl(i,"bpmn:StartEvent"))}function t(n,A){if(!(!I6(n,["bpmn:Process","bpmn:SubProcess"])||Bl(n,"bpmn:AdHocSubProcess"))&&!e(n)){const i=Bl(n,"bpmn:SubProcess")?"Sub process":"Process";A.report(n.id,i+" is missing start event")}}return F6("start-event-required",{check:t})};const{is:Ju}=t2,{annotateRule:x6}=k0;var b6=function(){function e(t,n){if(!Ju(t,"bpmn:SubProcess")||t.triggeredByEvent)return;(t.flowElements||[]).forEach(function(i){if(!Ju(i,"bpmn:StartEvent"))return!1;(i.eventDefinitions||[]).length>0&&n.report(i.id,"Start event must be blank",["eventDefinitions"])})}return x6("sub-process-blank-start-event",{check:e})};const{is:Y6}=t2,{annotateRule:U6}=k0;var N6=function(){function e(t,n){if(!Y6(t,"bpmn:Gateway"))return;const A=t.incoming||[],i=t.outgoing||[];A.length===1&&i.length===1&&n.report(t.id,"Gateway is superfluous. It only has one source and target.")}return U6("superfluous-gateway",{check:e})};const{is:Si,isAny:z6}=t2,{annotateRule:R6}=k0;var S6=function(){function e(t,n){if(!z6(t,["bpmn:Process","bpmn:SubProcess"]))return;const i=(t.flowElements||[]).filter(a=>Si(a,"bpmn:FlowNode")&&(a.outgoing||[]).length===0),o=i.filter(ju);if(o.length!==1)return;if(i.every(a=>T6(a)||ju(a)))for(const a of o)n.report(a.id,"Termination is superfluous.")}return R6("superfluous-termination",{check:e})};function ju(e){return Si(e,"bpmn:EndEvent")&&(e.eventDefinitions||[]).some(t=>Si(t,"bpmn:TerminateEventDefinition"))}function T6(e){return Si(e,"bpmn:SubProcess")&&e.triggeredByEvent&&(e.flowElements||[]).some(n=>Si(n,"bpmn:StartEvent")&&n.isInterrupting)}const L0={};function gl(){}gl.prototype.resolveRule=function(e,t){const n=L0[e+"/"+t];if(!n)throw new Error("cannot resolve rule <"+e+"/"+t+">: not bundled");return n},gl.prototype.resolveConfig=function(e,t){throw new Error("cannot resolve config <"+t+"> in <"+e+">: not bundled")};const k6={resolver:new gl,config:{rules:{"ad-hoc-sub-process":"error","conditional-flows":"error","end-event-required":"error","event-sub-process-typed-start-event":"error","fake-join":"warn",global:"warn","label-required":"info","link-event":"error","no-bpmndi":"error","no-complex-gateway":"error","no-disconnected":"error","no-duplicate-sequence-flows":"error","no-gateway-join-fork":"error","no-implicit-split":"error","no-implicit-end":"error","no-implicit-start":"error","no-inclusive-gateway":"off","no-overlapping-elements":"warn","single-blank-start-event":"error","single-event-definition":"error","start-event-required":"error","sub-process-blank-start-event":"error","superfluous-gateway":"info","superfluous-termination":"warn"}}};L0["bpmnlint/ad-hoc-sub-process"]=jY,L0["bpmnlint/conditional-flows"]=LY,L0["bpmnlint/end-event-required"]=KY,L0["bpmnlint/event-sub-process-typed-start-event"]=qY,L0["bpmnlint/fake-join"]=tU,L0["bpmnlint/global"]=AU,L0["bpmnlint/label-required"]=oU,L0["bpmnlint/link-event"]=NU,L0["bpmnlint/no-bpmndi"]=GU,L0["bpmnlint/no-complex-gateway"]=LU,L0["bpmnlint/no-disconnected"]=OU,L0["bpmnlint/no-duplicate-sequence-flows"]=e6,L0["bpmnlint/no-gateway-join-fork"]=i6,L0["bpmnlint/no-implicit-split"]=a6,L0["bpmnlint/no-implicit-end"]=p6,L0["bpmnlint/no-implicit-start"]=d6,L0["bpmnlint/no-overlapping-elements"]=Q6,L0["bpmnlint/single-blank-start-event"]=C6,L0["bpmnlint/single-event-definition"]=y6,L0["bpmnlint/start-event-required"]=v6,L0["bpmnlint/sub-process-blank-start-event"]=b6,L0["bpmnlint/superfluous-gateway"]=N6,L0["bpmnlint/superfluous-termination"]=S6;var wa=50,Vu={min:.2,max:4},G6=10,H6=.1,P6=250;function W2(e,t,n,A,i){var o=this;this._canvas=A,this._elementRegistry=i,this._eventBus=n,this._injector=t,this._state={isOpen:void 0,isDragging:!1,initialDragPosition:null,offsetViewport:null,cachedViewbox:null,dragger:null,svgClientRect:null,parentClientRect:null,zoomDelta:0},this._init(),this.toggle(e&&e.open||!0);function r(B){(!o._state._svgClientRect||fa(o._state._svgClientRect))&&(o._state._svgClientRect=o._svg.getBoundingClientRect());var g=ma({x:B.clientX-o._state._svgClientRect.left,y:B.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox);pl(g,o._canvas),o._update()}O.bind(this._svg,"click",function(B){B.preventDefault(),B.stopPropagation(),r(B)});function a(B){return function(p){(!o._state._svgClientRect||fa(o._state._svgClientRect))&&(o._state._svgClientRect=o._svg.getBoundingClientRect()),B&&r(p);var E=ma({x:p.clientX-o._state._svgClientRect.left,y:p.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox),d=A.viewbox(),u=j6(E,d),h=o._viewportDom.getBoundingClientRect(),D={x:p.clientX-h.left+1,y:p.clientY-h.top+1};N(o._state,{cachedViewbox:d,initialDragPosition:{x:p.clientX,y:p.clientY},isDragging:!0,offsetViewport:u,offsetViewportDom:D,viewportClientRect:o._viewport.getBoundingClientRect(),parentClientRect:o._parent.getBoundingClientRect()}),O.bind(document,"mousemove",c),O.bind(document,"mouseup",l)}}function c(B){if(o._state.isDragging){(!o._state._svgClientRect||fa(o._state._svgClientRect))&&(o._state._svgClientRect=o._svg.getBoundingClientRect());var g=o._state.offsetViewportDom,p=o._state.viewportClientRect,E=o._state.parentClientRect;N(o._viewportDom.style,{top:B.clientY-g.y-E.top+"px",left:B.clientX-g.x-E.left+"px"});var d=_u(E,{top:B.clientY-g.y-E.top,left:B.clientX-g.x-E.left,width:p.width,height:p.height});N(o._overlay.style,{clipPath:d});var u=ma({x:B.clientX-o._state._svgClientRect.left,y:B.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox);pl({x:u.x-o._state.offsetViewport.x,y:u.y-o._state.offsetViewport.y},o._canvas)}}function l(B){o._state.isDragging&&(o._state.initialDragPosition.x===B.clientX&&o._state.initialDragPosition.y===B.clientY&&r(B),o._update(),N(o._state,{cachedViewbox:null,initialDragPosition:null,isDragging:!1,offsetViewport:null,offsetViewportDom:null}),O.unbind(document,"mousemove",c),O.unbind(document,"mouseup",l))}O.bind(this._viewportDom,"mousedown",a(!1)),O.bind(this._svg,"mousedown",a(!0)),O.bind(this._parent,"wheel",function(B){if(B.preventDefault(),B.stopPropagation(),!!B.ctrlKey&&((!o._state._svgClientRect||fa(o._state._svgClientRect))&&(o._state._svgClientRect=o._svg.getBoundingClientRect()),!!W6(B,o._state._svgClientRect))){var g=B.deltaMode===0?.02:.32,p=Math.sqrt(Math.pow(B.deltaY,2)+Math.pow(B.deltaX,2))*_6(B.deltaY)*-g;if(o._state.zoomDelta+=p,Math.abs(o._state.zoomDelta)>H6){var E=p>0?1:-1,d=Math.log(A.zoom())/Math.log(10),u=O6(Vu,G6*2),h=Math.round(d/u)*u;h+=u*E;var D=Math.pow(10,h);A.zoom(X6(Vu,D),y),o._state.zoomDelta=0;var y=ma({x:B.clientX-o._state._svgClientRect.left,y:B.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox);pl(y,o._canvas),o._update()}}}),O.bind(this._toggle,"click",function(B){B.preventDefault(),B.stopPropagation(),o.toggle()}),n.on(["shape.added","connection.added"],function(B){var g=B.element;o._addElement(g),o._update()}),n.on(["shape.removed","connection.removed"],function(B){var g=B.element;o._removeElement(g),o._update()}),n.on("elements.changed",P6,function(B){var g=B.elements;g.forEach(function(p){o._updateElement(p)}),o._update()}),n.on("element.updateId",function(B){var g=B.element,p=B.newId;o._updateElementId(g,p)}),n.on("canvas.viewbox.changed",function(){o._state.isDragging||o._update()}),n.on("canvas.resized",function(){document.body.contains(o._parent)&&(o._state.isDragging||o._update(),o._state._svgClientRect=o._svg.getBoundingClientRect())})}W2.$inject=["config.minimap","injector","eventBus","canvas","elementRegistry"],W2.prototype._init=function(){var e=this._canvas,t=e.getContainer(),n=this._parent=document.createElement("div");X(n).add("djs-minimap"),t.appendChild(n),this._injector.get("translate",!1);var A=this._toggle=document.createElement("div");X(A).add("toggle"),n.appendChild(A);var i=this._map=document.createElement("div");X(i).add("map"),n.appendChild(i);var o=this._svg=_t("svg");He(o,{width:"100%",height:"100%"}),Ni(i,o);var r=this._elementsGroup=_t("g");Ni(o,r);var a=this._viewportGroup=_t("g");Ni(o,a);var c=this._viewport=_t("rect");$1(c).add("viewport"),Ni(a,c),O.bind(n,"mousedown",function(g){g.stopPropagation()});var l=this._viewportDom=document.createElement("div");X(l).add("viewport-dom"),this._parent.appendChild(l);var B=this._overlay=document.createElement("div");X(B).add("overlay"),this._parent.appendChild(B)},W2.prototype._update=function(){var e=this._canvas.viewbox(),t=e.inner,n=e.outer;if(Ou(e)){var A,i,o,r,a=n.width-t.width,c=n.height-t.height;t.width<n.width?(A=t.x-a/2,o=n.width,t.x+t.width<n.width&&(A=Math.min(0,t.x))):(A=t.x,o=t.width),t.height<n.height?(i=t.y-c/2,r=n.height,t.y+t.height<n.height&&(i=Math.min(0,t.y))):(i=t.y,r=t.height),A=A-wa,i=i-wa,o=o+wa*2,r=r+wa*2,this._lastViewbox={x:A,y:i,width:o,height:r},He(this._svg,{viewBox:A+", "+i+", "+o+", "+r}),He(this._viewport,{x:e.x,y:e.y,width:e.width,height:e.height});var l=this._state._parentClientRect=this._parent.getBoundingClientRect(),B=this._viewport.getBoundingClientRect(),g={top:B.top-l.top,left:B.left-l.left,width:B.width,height:B.height};N(this._viewportDom.style,{top:g.top+"px",left:g.left+"px",width:g.width+"px",height:g.height+"px"});var p=_u(l,g);N(this._overlay.style,{clipPath:p})}},W2.prototype.open=function(){N(this._state,{isOpen:!0}),X(this._parent).add("open");var e=this._injector.get("translate",!1)||function(t){return t};g2(this._toggle,"title",e("Close minimap")),this._update(),this._eventBus.fire("minimap.toggle",{open:!0})},W2.prototype.close=function(){N(this._state,{isOpen:!1}),X(this._parent).remove("open");var e=this._injector.get("translate",!1)||function(t){return t};g2(this._toggle,"title",e("Open minimap")),this._eventBus.fire("minimap.toggle",{open:!1})},W2.prototype.toggle=function(e){var t=this.isOpen();typeof e>"u"&&(e=!t),e!=t&&(e?this.open():this.close())},W2.prototype.isOpen=function(){return this._state.isOpen},W2.prototype._updateElement=function(e){try{e.parent!==void 0&&e.parent!==null&&(this._removeElement(e),this._addElement(e))}catch(t){console.warn("Minimap#_updateElement errored",t)}},W2.prototype._updateElementId=function(e,t){try{var n=p0("#"+CSS.escape(e.id),this._elementsGroup);n&&(n.id=t)}catch(A){console.warn("Minimap#_updateElementId errored",A)}},W2.prototype._addElement=function(e){var t=this;this._removeElement(e);var n,A,i,o=this._createElement(e),r=p0("#"+CSS.escape(e.parent.id),this._elementsGroup);if(o){var a=this._elementRegistry.getGraphics(e),c=this._elementRegistry.getGraphics(e.parent),l=L6(a,c);return l!=="undefined"?r?r.childNodes.length>l?Wu(o,r,l):Wu(o,r,r.childNodes.length-1):this._elementsGroup.appendChild(o):this._elementsGroup.appendChild(o),J6(e)?(n=e.parent,A=0,i=0,typeof n.x<"u"&&typeof n.y<"u"&&(A=-n.x,i=-n.y),He(o,{transform:"translate("+A+" "+i+")"})):(A=e.x,i=e.y,r&&(n=e.parent,A-=n.x,i-=n.y),He(o,{transform:"translate("+A+" "+i+")"})),e.children&&e.children.length&&e.children.forEach(function(B){t._addElement(B)}),o}},W2.prototype._removeElement=function(e){var t=this._svg.getElementById(e.id);t&&lu(t)},W2.prototype._createElement=function(e){var t=this._elementRegistry.getGraphics(e),n;if(t&&(n=Mt(t),n)){var A=$b(n);return He(A,{id:e.id}),A}};function J6(e){return e.waypoints}function j6(e,t){var n={x:t.x+t.width/2,y:t.y+t.height/2};return{x:e.x-n.x,y:e.y-n.y}}function ma(e,t,n){var A=t.getBoundingClientRect(),i=V6(n,A.width/A.height),o=Lu(e.x,0,A.width,i.x,i.x+i.width),r=Lu(e.y,0,A.height,i.y,i.y+i.height);return{x:o,y:r}}function pl(e,t){var n=t.viewbox(),A=n.width,i=n.height;t.viewbox({x:e.x-A/2,y:e.y-i/2,width:A,height:i})}function V6(e,t){var n=e.width/e.height,A=N({},{x:e.x,y:e.y,width:e.width,height:e.height});if(n>t){var i=A.width*(1/t),o=A.y-(i-A.height)/2;N(A,{y:o,height:i})}else if(n<t){var r=A.height*t,a=A.x-(r-A.width)/2;N(A,{x:a,width:r})}return A}function Lu(e,t,n,A,i){var o=n-t,r=i-A;return(e-t)*r/o+A}function L6(e,t){var n=p0(".djs-children",t.parentNode);if(n){var A=[].slice.call(n.childNodes),i=-1;return A.forEach(function(o,r){p0(".djs-element",o)===e&&(i=r)}),i}}function Wu(e,t,n){var A=[].slice.call(t.childNodes),i=A[n];t.insertBefore(e,i.nextSibling)}function fa(e){return e.width===0&&e.height===0}function W6(e,t){return e.x>t.left&&e.x<t.left+t.width&&e.y>t.top&&e.y<t.top+t.height}var _6=Math.sign||function(e){return e>=0?1:-1};function O6(e,t){var n=Math.log(e.min)/Math.log(10),A=Math.log(e.max)/Math.log(10),i=Math.abs(n)+Math.abs(A);return i/t}function X6(e,t){return Math.max(e.min,Math.min(e.max,t))}function _u(e,t){var n=[Pe(t.left,t.top),Pe(t.left+t.width,t.top),Pe(t.left+t.width,t.top+t.height),Pe(t.left,t.top+t.height),Pe(t.left,e.height),Pe(e.width,e.height),Pe(e.width,0),Pe(0,0),Pe(0,e.height),Pe(t.left,e.height)].join(", ");return"polygon("+n+")"}function Pe(e,t){return e+"px "+t+"px"}function Ou(e){return je(e,function(t){return V0(t)?Ou(t):A0(t)&&isFinite(t)})}const Xu={__init__:["minimap"],minimap:["type",W2]},El=1,Ku=2,Zu=4,qu=8,K6=16,Z6=32,q6=64,$6=128,eN=256,tN=512,nN=El|Ku|Zu,AN=El|qu,y0=Object.freeze({ACTIVATED:El,RUNNING:Ku,ENDING:Zu,ENDED:qu,DESTROYED:K6,FAILED:Z6,TERMINATED:q6,CANCELED:$6,COMPLETED:eN,COMPENSABLE:tN,ACTIVE:nN,NOT_DEAD:AN}),hA={};function Mn(e,t){throw new Error(`illegal transition: ${e.name} -> ${t}`)}function Dn(e,t){return e===hA?t:e}class _2{constructor(t,n,{start:A,cancel:i,complete:o,destroy:r,fail:a,terminate:c,compensable:l}={}){this.name=t,this.traits=n,this._start=Dn(A,this),this._compensable=Dn(l,this),this._cancel=Dn(i,this),this._complete=Dn(o,this),this._destroy=Dn(r,this),this._fail=Dn(a,this),this._terminate=Dn(c,this)}hasTrait(t){return(this.traits&t)!==0}complete(){return this._complete||Mn(this,"complete")}destroy(){return this._destroy||Mn(this,"destroy")}cancel(){return this._cancel||Mn(this,"cancel")}fail(){return this._fail||Mn(this,"fail")}terminate(){return this._terminate||Mn(this,"terminate")}compensable(){return this._compensable||Mn(this,"compensable")}start(){return this._start||Mn(this,"start")}}const Ca=new _2("failed",y0.DESTROYED|y0.FAILED),Ma=new _2("terminated",y0.DESTROYED|y0.TERMINATED),dl=new _2("completed",y0.DESTROYED|y0.COMPLETED),Ot=new _2("terminating",y0.ENDING|y0.TERMINATED,{destroy:Ma}),wA=new _2("canceling",y0.ENDING|y0.FAILED|y0.CANCELED,{destroy:Ca,complete:hA,terminate:Ot}),ul=new _2("completing",y0.ENDING|y0.COMPLETED,{destroy:dl,cancel:wA,terminate:Ot}),Ql=new _2("failing",y0.ENDING|y0.FAILED,{cancel:wA,complete:ul,destroy:Ca,terminate:Ot}),iN=new _2("compensable:failing",y0.ENDING|y0.FAILED,{complete:hA,terminate:Ot,destroy:Ca}),$u=new _2("compensable:completed",y0.ENDED|y0.COMPLETED,{cancel:wA,fail:iN,destroy:dl,compensable:hA}),oN=new _2("compensable:completing",y0.ENDING|y0.COMPLETED,{destroy:$u,terminate:Ot,compensable:hA}),rN=new _2("compensable:running",y0.RUNNING|y0.COMPENSABLE,{cancel:wA,complete:oN,compensable:hA,destroy:$u,fail:Ql,terminate:Ot}),eQ=new _2("running",y0.RUNNING,{cancel:wA,complete:ul,compensable:rN,destroy:Ma,fail:Ql,terminate:Ot}),aN=new _2("activated",y0.ACTIVATED,{start:eQ,destroy:Ma}),cN=Object.freeze({ACTIVATED:aN,RUNNING:eQ,CANCELING:wA,COMPLETING:ul,COMPLETED:dl,FAILING:Ql,FAILED:Ca,TERMINATING:Ot,TERMINATED:Ma});class sN{constructor(t,n,A=null,i=null){this.id=t,this.element=n,this.parent=A,this.initiator=i,this.subscriptions=new Set,this.children=[],this.state=cN.ACTIVATED}get running(){return this.hasTrait(y0.RUNNING)}get destroyed(){return this.hasTrait(y0.DESTROYED)}get completed(){return this.hasTrait(y0.COMPLETED)}get canceled(){return this.hasTrait(y0.CANCELED)}get failed(){return this.hasTrait(y0.FAILED)}hasTrait(t){return this.state.hasTrait(t)}start(){return this.state=this.state.start(),this}compensable(){return this.state=this.state.compensable(),this}fail(t){return this.failed||(this.state=this.state.fail(),this.failInitiator=t),this}cancel(t){return this.canceled||(this.state=this.state.cancel(),this.cancelInitiator=t),this}terminate(t){return this.state=this.state.terminate(),this.terminateInitiator=t,this}complete(){return this.state=this.state.complete(),this}destroy(t){return this.state=this.state.destroy(),this.destroyInitiator=t,this}getTokens(){return this.children.filter(t=>!t.destroyed).length}getTokensByElement(t){return this.children.filter(n=>!n.destroyed&&n.element===t).length}}function Ti(e,t){const n=[];for(const A of e)t(A)&&n.push(A);return n}function tQ(e,t){for(const n of e)if(t(n))return n;return null}function hl(e,t){return["type","name","ref","iref"].every(n=>!(n in e)||e[n]===t[n])}function nQ(e){return e.filter(t=>f(t,"bpmn:SequenceFlow"))}function wl(e){return f(e,"bpmn:MessageFlow")}function lN(e){return f(e,"bpmn:SequenceFlow")}function BN(e){return ml(e)&&oQ(e,"bpmn:LinkEventDefinition")}function Da(e){return ml(e)&&oQ(e,"bpmn:CompensateEventDefinition")}function AQ(e){return f(e,"bpmn:Activity")&&e.businessObject.isForCompensation}function ml(e){return(f(e,"bpmn:CatchEvent")||f(e,"bpmn:ReceiveTask"))&&!Fa(e)}function ya(e){return f(e,"bpmn:BoundaryEvent")&&!Fa(e)}function Ia(e){return f(e,"bpmn:StartEvent")&&!Fa(e)}function Fa(e){return!!e.labelTarget}function Xt(e){return P(e).triggeredByEvent}function iQ(e){return f(e,"bpmn:StartEvent")&&P(e).isInterrupting||f(e,"bpmn:BoundaryEvent")&&P(e).cancelActivity}function ki(e,t){return t.some(n=>f(e,n))}function oQ(e,t){return Qe(P(e).eventDefinitions,n=>f(n,t))}function rQ(e,t,n){const A=e.get("scopeIds",!1)||new ue([32,36]),i={},o={},r=new gN,a=new Set,c=[],l=new Set,B=new Set;G0("tick",function(){for(const M of a)t0("elementChanged",{element:M});a.clear()});function g(M,w){if(c.push([w,M]),c.length!==1)return;let Q;for(;Q=c[0];){const[b,Y]=Q;Y.destroyed||b(),c.shift()}t0("tick")}function p(M){return o[M.type]||r}function E(M){const{element:w,parentScope:Q,initiator:b=null}=M,Y=M.scope||J({element:w,parent:Q,initiator:b});return g(Y,function(){Y.running||Y.start(),K("signal",{...M,scope:Y}),p(w).signal({...M,scope:Y}),Y.parent&&d0(Y.parent)}),Y}function d(M){const{element:w,scope:Q,initiator:b=Q}=M,Y=J({element:w,parent:Q,initiator:b});return g(Y,function(){Y.running||Y.start(),K("enter",M),p(w).enter({...M,initiator:b,scope:Y}),d0(Q)}),Y}function u(M){const{element:w,scope:Q,initiator:b=Q}=M;g(Q,function(){K("exit",M),p(w).exit({...M,initiator:b}),Q.running&&Q.complete(),H(Q,b),Q.parent&&d0(Q.parent)})}function h(M){const{event:w,initiator:Q,scope:b}=M,Y=m(w),S=b.subscriptions,G=Ti(S,I0=>hl(Y,I0.event)),_=G.filter(I0=>!I0.event.interrupting),s0=G.filter(I0=>I0.event.interrupting);if(!s0.length)return _.map(I0=>I0.triggerFn(Q)).flat();const W0=s0.find(I0=>!I0.event.boundary)||s0[0],j0=Ti(S,I0=>I0.event.persistent||pN(I0.event,W0.event));return S.forEach(I0=>{j0.includes(I0)||I0.remove()}),[W0.triggerFn(Q)].flat().filter(I0=>I0)}function D(M,w,Q){w=m(w);const b=w.element,Y={scope:M,event:w,element:b,triggerFn:Q,remove(){y(Y)}};return B.add(Y),M.subscriptions.add(Y),b&&x0(b),Y}function y(M){const{scope:w,event:Q}=M;B.delete(M),w.subscriptions.delete(M),Q.element&&x0(Q.element)}function C(M){return f(M,"bpmn:StartEvent")||f(M,"bpmn:IntermediateCatchEvent")||f(M,"bpmn:ReceiveTask")||dN(M)?P(M).name||M.id:null}function m(M){if(!M.businessObject)return M;const w=iQ(M),Q=ya(M),b=C(M),Y={element:M,interrupting:w,boundary:Q,...b?{iref:b}:{}},S=aQ(M)[0];if(!S)return{...Y,type:EN(M)?"message":"none"};if(f(S,"bpmn:LinkEventDefinition"))return{...Y,type:"link",name:S.name};if(f(S,"bpmn:SignalEventDefinition"))return{...Y,type:"signal",ref:S.signalRef};if(f(S,"bpmn:TimerEventDefinition"))return{...Y,type:"timer"};if(f(S,"bpmn:ConditionalEventDefinition"))return{...Y,type:"condition"};if(f(S,"bpmn:EscalationEventDefinition"))return{...Y,type:"escalation",ref:S.escalationRef};if(f(S,"bpmn:CancelEventDefinition"))return{...Y,type:"cancel"};if(f(S,"bpmn:ErrorEventDefinition"))return{...Y,type:"error",ref:S.errorRef};if(f(S,"bpmn:MessageEventDefinition"))return{...Y,type:"message",ref:S.messageRef};if(f(S,"bpmn:CompensateEventDefinition")){let G=S.activityRef&&n.get(S.activityRef.id);return G||(Ia(M)&&Xt(M.parent)?G=M.parent.parent:ya(M)?G=M.host:G=M.parent),{...Y,type:"compensate",ref:G,persistent:!0}}throw new Error("unknown event definition",S)}function I(M,w=!0){const{element:Q,parent:b,initiator:Y}=M;w&&K("createScope",{element:Q,scope:b});const S=new sN(A.next(),Q,b,Y);return b&&b.children.push(S),l.add(S),w&&t0("createScope",{scope:S}),x0(Q),b&&x0(b.element),S}function x(M){if(typeof M=="function")return M;const{event:w,element:Q,scope:b}=M,Y=M.elements||Q&&[Q],S=w&&m(w);return G=>(!S||hl(S,G.event))&&(!Y||Y.includes(G.element))&&(!b||b===G.scope)}function v(M){const w=M==="function"?M:x(M);return Q=>Array.from(Q.subscriptions).some(w)}function F(M){if(typeof M=="function")return M;const{element:w,waitsOnElement:Q,parent:b,trait:Y=y0.RUNNING,subscribedTo:S}=M,G=S?v(S):()=>!0;return _=>(!w||_.element===w)&&(!b||_.parent===b)&&(!Q||_.getTokensByElement(Q)>0)&&_.hasTrait(Y)&&G(_)}function z(M){return Ti(B,x(M))}function R(M){return tQ(B,x(M))}function k(M){return Ti(l,F(M))}function T(M){return tQ(l,F(M))}function H(M,w=null){if(!M.destroyed){M.destroy(w);for(const Q of M.subscriptions){const b=Q.event.traits||y0.ACTIVE;M.hasTrait(b)||y(Q)}if(M.destroyed){for(const Q of M.children)Q.destroyed||H(Q,w);K("destroyScope",{element:M.element,scope:M}),l.delete(M),t0("destroyScope",{scope:M})}x0(M.element),M.parent&&x0(M.parent.element)}}function K(M,w){t0("trace",{...w,action:M})}function x0(M){a.add(M),c.length||t0("tick")}function d0(M){t0("scopeChanged",{scope:M})}function t0(M,w={}){return t.fire(`tokenSimulation.simulator.${M}`,w)}function G0(M,w){t.on("tokenSimulation.simulator."+M,w)}function u2(M,w){t.off("tokenSimulation.simulator."+M,w)}function R0(M,w){const Q=V(M);i[M.id||M]={...Q,...w},x0(M)}function r2(){const M=[];return n.forEach(w=>{if(!ki(w,["bpmn:Process","bpmn:Participant"]))return;const Q=I({element:w},!1);M.push(Q);const b=w.children.filter(Ia);for(const Y of b){const S={...m(Y),interrupting:!1};D(Q,S,G=>E({element:w,startEvent:Y,initiator:G}))}}),M}function J(M){const{element:w}=M,Q=I(M),{children:b=[],attachers:Y=[]}=w;for(const S of b)if(Xt(S)){const G=S.children.filter(_=>Ia(_)&&!Da(_));for(const _ of G)D(Q,_,s0=>E({element:S,parentScope:Q,startEvent:_,initiator:s0}))}for(const S of Y)ya(S)&&!Da(S)&&D(Q,S,G=>E({element:S,parentScope:Q.parent,hostScope:Q,initiator:G}));return Q}function V(M){return i[M.id||M]||{}}function Z(M,w){if(!w.length)return;const Q={type:"all-completed",persistent:!1},b=new Set(w),Y=S=>{b.delete(S.scope),b.size===0&&(u2("destroyScope",Y),h({scope:M,event:Q}))};return G0("destroyScope",Y),Q}function u0(M,w=!0){R0(M,{wait:w})}function y2(){for(const M of l)H(M);for(const M of r2())l.add(M);t0("tick"),t0("reset")}this.createScope=I,this.destroyScope=H,this.findScope=T,this.findScopes=k,this.findSubscription=R,this.findSubscriptions=z,this.waitAtElement=u0,this.waitForScopes=Z,this.setConfig=R0,this.getConfig=V,this.signal=E,this.enter=d,this.exit=u,this.subscribe=D,this.trigger=h,this.reset=y2,this.on=G0,this.off=u2,this.registerBehavior=function(M,w){o[M]=w}}rQ.$inject=["injector","eventBus","elementRegistry"];function gN(){this.signal=function(e){},this.exit=function(e){},this.enter=function(e){}}function pN(e,t){return e.type===t.type&&e.boundary&&!t.boundary}function EN(e){return f(e,"bpmn:ReceiveTask")||e.incoming.some(t=>f(t,"bpmn:MessageFlow"))}function dN(e){if(!ya(e))return!1;const t=aQ(e);return!t[0]||ki(t[0],["bpmn:ConditionalEventDefinition","bpmn:TimerEventDefinition"])}function aQ(e){return e.businessObject.get("eventDefinitions")||[]}function va(e,t){this._simulator=e,this._activityBehavior=t,e.registerBehavior("bpmn:StartEvent",this)}va.prototype.signal=function(e){this._simulator.exit(e)},va.prototype.exit=function(e){this._activityBehavior.exit(e)},va.$inject=["simulator","activityBehavior"];function Gi(e,t,n){this._intermediateThrowEventBehavior=n,this._scopeBehavior=t,e.registerBehavior("bpmn:EndEvent",this)}Gi.$inject=["simulator","scopeBehavior","intermediateThrowEventBehavior"],Gi.prototype.enter=function(e){this._intermediateThrowEventBehavior.enter(e)},Gi.prototype.signal=function(e){this._intermediateThrowEventBehavior.signal(e)},Gi.prototype.exit=function(e){const{scope:t}=e;this._scopeBehavior.tryExit(t.parent,t)};function xa(e,t,n){this._simulator=e,this._activityBehavior=t,this._scopeBehavior=n,e.registerBehavior("bpmn:BoundaryEvent",this)}xa.prototype.signal=function(e){const{element:t,scope:n,hostScope:A=this._simulator.findScope({parent:n.parent,element:t.host})}=e;if(!A)throw new Error("host scope not found");if(P(t).cancelActivity){this._scopeBehavior.interrupt(A,n);const o=this._scopeBehavior.tryExit(A,n);if(o){const r=this._simulator.subscribe(A,o,a=>(r.remove(),this._simulator.exit(e)));return}}this._simulator.exit(e)},xa.prototype.exit=function(e){this._activityBehavior.exit(e)},xa.$inject=["simulator","activityBehavior","scopeBehavior"];function Hi(e,t){this._activityBehavior=t,this._simulator=e,e.registerBehavior("bpmn:IntermediateCatchEvent",this),e.registerBehavior("bpmn:ReceiveTask",this)}Hi.$inject=["simulator","activityBehavior"],Hi.prototype.signal=function(e){return this._simulator.exit(e)},Hi.prototype.enter=function(e){const{element:t}=e;return this._activityBehavior.signalOnEvent(e,t)},Hi.prototype.exit=function(e){this._activityBehavior.exit(e)};function Pi(e,t,n){this._simulator=e,this._activityBehavior=t,this._eventBehaviors=n,e.registerBehavior("bpmn:IntermediateThrowEvent",this),e.registerBehavior("bpmn:SendTask",this)}Pi.prototype.enter=function(e){const{element:t}=e,n=this._eventBehaviors.get(t);if(n){const A=n(e);if(A)return this._activityBehavior.signalOnEvent(e,A)}this._activityBehavior.enter(e)},Pi.prototype.signal=function(e){this._activityBehavior.signal(e)},Pi.prototype.exit=function(e){this._activityBehavior.exit(e)},Pi.$inject=["simulator","activityBehavior","eventBehaviors"];function ba(e){this._simulator=e,e.registerBehavior("bpmn:ExclusiveGateway",this)}ba.prototype.enter=function(e){this._simulator.exit(e)},ba.prototype.exit=function(e){const{element:t,scope:n}=e,A=nQ(t.outgoing);if(A.length===1)return this._simulator.enter({element:A[0],scope:n.parent});const{activeOutgoing:i}=this._simulator.getConfig(t),o=A.find(r=>r===i);if(!o)throw new Error("no outgoing configured");return this._simulator.enter({element:o,scope:n.parent})},ba.$inject=["simulator"];function Ya(e,t){this._simulator=e,this._activityBehavior=t,e.registerBehavior("bpmn:ParallelGateway",this)}Ya.prototype.enter=function(e){const{scope:t,element:n}=e,A=nQ(n.incoming),{parent:i}=t,o=this._simulator.findScopes({parent:i,element:n});if(o.length===A.length){for(const r of o)r!==t&&this._simulator.destroyScope(r.complete(),t);this._simulator.exit(e)}},Ya.prototype.exit=function(e){this._activityBehavior.exit(e)},Ya.$inject=["simulator","activityBehavior"];function fl(e){this._simulator=e,e.registerBehavior("bpmn:EventBasedGateway",this)}fl.$inject=["simulator"],fl.prototype.enter=function(e){const{element:t,scope:n}=e,A=n.parent,o=uN(t).map(r=>this._simulator.subscribe(A,r,a=>(o.forEach(c=>c.remove()),this._simulator.destroyScope(n,a),this._simulator.signal({element:r,parentScope:A,initiator:a}))))};function uN(e){return e.outgoing.map(t=>t.target).filter(t=>ki(t,["bpmn:IntermediateCatchEvent","bpmn:ReceiveTask"]))}function lt(e,t,n){this._simulator=e,this._scopeBehavior=t,this._transactionBehavior=n;const A=["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"];for(const i of A)e.registerBehavior(i,this)}lt.$inject=["simulator","scopeBehavior","transactionBehavior"],lt.prototype.signal=function(e){const t=this._triggerMessages(e);if(t)return this.signalOnEvent(e,t);this._simulator.exit(e)},lt.prototype.enter=function(e){const{element:t}=e,n=this.waitAtElement(t);if(n)return this.signalOnEvent(e,n);const A=this._triggerMessages(e);if(A)return this.signalOnEvent(e,A);this._simulator.exit(e)},lt.prototype.exit=function(e){const{element:t,scope:n}=e,A=n.parent,i=!n.failed;i&&!Xt(t)&&this._transactionBehavior.registerCompensation(n);const o=i?t.outgoing.filter(lN):[];o.forEach(r=>this._simulator.enter({element:r,scope:A})),o.length===0&&this._scopeBehavior.tryExit(A,n)},lt.prototype.signalOnEvent=function(e,t){const{scope:n,element:A}=e,i=this._simulator.subscribe(n,t,o=>(i.remove(),this._simulator.signal({scope:n,element:A,initiator:o})))},lt.prototype.waitAtElement=function(e){return this._simulator.getConfig(e).wait&&{element:e,type:"continue",interrupting:!1,boundary:!1}},lt.prototype._getMessageContexts=function(e,t=null){const n=t?i=>i.referencePoint.x>t.x:()=>!0,A=(i,o)=>i.referencePoint.x-o.referencePoint.x;return[...e.incoming.filter(wl).map(i=>({incoming:i,referencePoint:hN(i.waypoints)})),...e.outgoing.filter(wl).map(i=>({outgoing:i,referencePoint:QN(i.waypoints)}))].sort(A).filter(n)},lt.prototype._triggerMessages=function(e){const{element:t,initiator:n,scope:A}=e;let i=A.messageContexts;i||(i=A.messageContexts=this._getMessageContexts(t));const o=n&&n.element;if(wl(o)&&A.expectedIncoming!==o){console.debug("Simulator :: ActivityBehavior :: ignoring out-of-bounds message");return}for(;i.length;){const{incoming:r,outgoing:a}=i.shift();if(r){if(!n)continue;return A.expectedIncoming=r,{element:t,type:"message",name:r.id,interrupting:!1,boundary:!1}}this._simulator.signal({element:a})}};function QN(e){return e&&e[0]}function hN(e){return e&&e[e.length-1]}function yn(e,t,n,A,i){this._simulator=e,this._activityBehavior=t,this._scopeBehavior=n,this._transactionBehavior=A,this._elementRegistry=i,e.registerBehavior("bpmn:SubProcess",this),e.registerBehavior("bpmn:Transaction",this),e.registerBehavior("bpmn:AdHocSubProcess",this)}yn.$inject=["simulator","activityBehavior","scopeBehavior","transactionBehavior","elementRegistry"],yn.prototype.signal=function(e){this._start(e)},yn.prototype.enter=function(e){const{element:t}=e,n=this._activityBehavior.waitAtElement(t);if(n)return this._activityBehavior.signalOnEvent(e,n);this._start(e)},yn.prototype.exit=function(e){const{scope:t}=e,n=t.parent;n.failInitiator===t&&n.complete(),this._activityBehavior.exit(e)},yn.prototype._start=function(e){const{element:t,startEvent:n,scope:A}=e,i=A.parent;if(Xt(t)){if(!n)throw new Error("missing <startEvent>: required for event sub-process")}else if(n)throw new Error("unexpected <startEvent>: not allowed for sub-process");if(i.destroyed)throw new Error(`target scope <${i.id}> destroyed`);wN(t)&&this._transactionBehavior.setup(e),n&&iQ(n)&&this._scopeBehavior.interrupt(i,A);const o=n?[n]:this._findStarts(t);for(const r of o)this._simulator.signal({element:r,parentScope:A,initiator:A})},yn.prototype._findStarts=function(e){return e=this._elementRegistry.get(e.id+"_plane")||e,e.children.filter(t=>Fa(t)||t.incoming.find(A=>f(A,"bpmn:SequenceFlow"))||AQ(t)||Xt(t)?!1:ki(t,["bpmn:Activity","bpmn:StartEvent","bpmn:EndEvent"]))};function wN(e){return f(e,"bpmn:Transaction")}const Cl={type:"cancel",interrupting:!0,boundary:!1,persistent:!0};function Kt(e,t){this._simulator=e,this._scopeBehavior=t}Kt.$inject=["simulator","scopeBehavior"],Kt.prototype.setup=function(e){const{scope:t}=e,n=this._simulator.subscribe(t,Cl,o=>(n.remove(),this.cancel({scope:t,initiator:o}))),A={type:"compensate",ref:t.element,persistent:!0,traits:y0.NOT_DEAD},i=this._simulator.subscribe(t,A,o=>t.canceled?(i.remove(),this.compensate({scope:t,element:t.element,initiator:o})):this._simulator.trigger({event:Cl,scope:t}))},Kt.prototype.cancel=function(e){const{scope:t,initiator:n}=e;if(!t.destroyed)return t.cancel(n),this._simulator.trigger({event:{type:"compensate",ref:t.element},initiator:n,scope:t}),this._simulator.trigger({scope:t,initiator:n,event:Cl})},Kt.prototype.registerCompensation=function(e){const{element:t}=e,n=t.children.filter(Xt).map(o=>o.children.find(r=>Ia(r)&&Da(r))).filter(o=>o),A=t.attachers.filter(Da);if(!n.length&&!A.length)return;const i=this.findTransactionScope(e.parent);f(i.element,"bpmn:Transaction")||this.makeCompensable(i);for(const o of n){const r={element:o,type:"compensate",persistent:!0,interrupting:!0,ref:t,traits:y0.NOT_DEAD},a=o.parent,c=this._simulator.subscribe(e,r,l=>(c.remove(),this._simulator.signal({initiator:l,element:a,startEvent:o,parentScope:e})))}for(const o of A){const r={element:o,type:"compensate",persistent:!0,ref:t,traits:y0.NOT_DEAD},a=o.outgoing.map(l=>l.target).find(AQ);if(!a)continue;const c=this._simulator.subscribe(i,r,l=>(c.remove(),this._simulator.enter({initiator:l,element:a,scope:i})))}},Kt.prototype.makeCompensable=function(e){if(e.hasTrait(y0.COMPENSABLE)||!e.parent)return;const t={type:"compensate",ref:e.element,interrupting:!0,persistent:!0,traits:y0.NOT_DEAD};e.compensable();const n=this._simulator.subscribe(e,t,o=>(n.remove(),e.fail(o),this.compensate({scope:e,element:e.element,initiator:o}),this._scopeBehavior.tryExit(e,o),e)),A=e.parent;if(!A)return;const i=this._simulator.subscribe(A,t,o=>(i.remove(),this._simulator.trigger({scope:e,event:t,initiator:o})));this.makeCompensable(A)},Kt.prototype.findTransactionScope=function(e){let t=e;for(;t;){const n=t.element;if(f(n,"bpmn:SubProcess")&&!Xt(n)||ki(n,["bpmn:Transaction","bpmn:Process","bpmn:Participant"]))return t;t=t.parent}throw mN(e)},Kt.prototype.compensate=function(e){const{scope:t,element:n}=e,A=Ti(t.subscriptions,r=>hl({type:"compensate"},r.event)),i=A.filter(r=>r.event.ref===n),o=A.filter(r=>r.event.ref!==n);for(const r of i)this._scopeBehavior.preExit(t,a=>this._simulator.trigger(r));for(const r of o.reverse())this._scopeBehavior.preExit(t,a=>this._simulator.trigger(r))};function mN(e){throw new Error(`no transaction context for <${e.id}>`)}function In(e,t){this._simulator=e,this._scopeBehavior=t,e.registerBehavior("bpmn:SequenceFlow",this)}In.prototype.enter=function(e){this._simulator.exit(e)},In.prototype.exit=function(e){const{element:t,scope:n}=e;this._simulator.enter({element:t.target,scope:n.parent})},In.$inject=["simulator","scopeBehavior"];function Fn(e){this._simulator=e,e.registerBehavior("bpmn:MessageFlow",this)}Fn.$inject=["simulator"],Fn.prototype.signal=function(e){this._simulator.exit(e)},Fn.prototype.exit=function(e){const{element:t,scope:n}=e,A=t.target,i=ml(A)?A:{type:"message",element:t,name:t.id},o=this._simulator.findSubscription({event:i,elements:[A,A.parent]});o&&this._simulator.trigger({event:i,initiator:n,scope:o.scope})};function S0(e,t){return e.type==="label"?!1:(Array.isArray(t)||(t=[t]),t.some(function(n){return f(e,n)}))}function fN(e,t){return m0(P(e).eventDefinitions,n=>S0(n,t))}function cQ(e,t){return Qe(P(e).eventDefinitions,n=>S0(n,t))}function Ml(e,t,n){this._simulator=e,this._elementRegistry=t,this._scopeBehavior=n}Ml.$inject=["simulator","elementRegistry","scopeBehavior"],Ml.prototype.get=function(e){const n=Object.entries({"bpmn:LinkEventDefinition":A=>{const{element:i,scope:o}=A,r=sQ(i),a=o.parent,l=a.element.children.filter(B=>BN(B)&&sQ(B).name===r.name);for(const B of l)this._simulator.signal({element:B,parentScope:a,initiator:o})},"bpmn:SignalEventDefinition":A=>{const{element:i,scope:o}=A,r=this._simulator.findSubscriptions({event:i}),a=new Set;for(const c of r){const l=c.scope;a.has(l)||(a.add(l),this._simulator.trigger({event:i,scope:l,initiator:o}))}},"bpmn:EscalationEventDefinition":A=>{const{element:i,scope:o}=A,r=this._simulator.findScopes({subscribedTo:{event:i},trait:y0.ACTIVE});let a=o;for(;a=a.parent;)if(r.includes(a)){this._simulator.trigger({event:i,scope:a,initiator:o});break}},"bpmn:ErrorEventDefinition":A=>{const{element:i,scope:o}=A;this._simulator.trigger({event:i,initiator:o,scope:Dl(o)})},"bpmn:TerminateEventDefinition":A=>{const{scope:i}=A;this._scopeBehavior.terminate(i.parent,i)},"bpmn:CancelEventDefinition":A=>{const{scope:i,element:o}=A;this._simulator.trigger({event:o,initiator:i,scope:Dl(i)})},"bpmn:CompensateEventDefinition":A=>{const{scope:i,element:o}=A;return this._simulator.waitForScopes(i,this._simulator.trigger({event:o,scope:Dl(i)}))}}).find(A=>cQ(e,A[0]));return n&&n[1]};function sQ(e){return fN(e,"bpmn:LinkEventDefinition")}function Dl(e){for(;Xt(e.parent.element);)e=e.parent;return e.parent}const lQ={type:"pre-exit",persistent:!0,interrupting:!0,boundary:!1},yl={type:"exit",interrupting:!0,boundary:!1,persistent:!0};function Bt(e){this._simulator=e}Bt.$inject=["simulator"],Bt.prototype.isFinished=function(e,t=null){return t=BQ(t),e.children.every(n=>n.destroyed||n.completed||t(n))},Bt.prototype.destroyChildren=function(e,t,n=null){n=BQ(n),e.children.filter(A=>!A.destroyed&&!n(A)).map(A=>{this._simulator.destroyScope(A,t)})},Bt.prototype.terminate=function(e,t){this.destroyChildren(e,t),e.terminate(t),this.tryExit(e,t)},Bt.prototype.interrupt=function(e,t){this.destroyChildren(e,t,t),e.fail(t)},Bt.prototype.tryExit=function(e,t){if(!e)throw new Error("missing <scope>");if(t||(t=e),!this.isFinished(e,t))return yl;const n=this._simulator.findSubscriptions({event:lQ,scope:e});for(const A of n){const{event:i,scope:o}=A;if(this._simulator.trigger({event:i,scope:o,initiator:t}).length)return yl}this._simulator.trigger({event:yl,scope:e,initiator:t}),this.exit({scope:e,initiator:t})},Bt.prototype.exit=function(e){const{scope:t,initiator:n}=e;if(!n)throw new Error("missing <initiator>");this._simulator.exit({element:t.element,scope:t,initiator:n})},Bt.prototype.preExit=function(e,t){const n=this._simulator.subscribe(e,lQ,A=>(n.remove(),t(A)));return n};function BQ(e){return typeof e=="function"?e:t=>t===e}function Ua(e,t){this._simulator=e,this._scopeBehavior=t,e.registerBehavior("bpmn:Process",this),e.registerBehavior("bpmn:Participant",this)}Ua.prototype.signal=function(e){const{startEvent:t,scope:n}=e;if(!t)throw new Error("missing <startEvent>");this._simulator.signal({element:t,parentScope:n})},Ua.prototype.exit=function(e){const{scope:t,initiator:n}=e;this._scopeBehavior.destroyChildren(t,n)},Ua.$inject=["simulator","scopeBehavior"];const CN={__init__:["startEventBehavior","endEventBehavior","boundaryEventBehavior","intermediateCatchEventBehavior","intermediateThrowEventBehavior","exclusiveGatewayBehavior","parallelGatewayBehavior","eventBasedGatewayBehavior","subProcessBehavior","sequenceFlowBehavior","messageFlowBehavior","processBehavior"],startEventBehavior:["type",va],endEventBehavior:["type",Gi],boundaryEventBehavior:["type",xa],intermediateCatchEventBehavior:["type",Hi],intermediateThrowEventBehavior:["type",Pi],exclusiveGatewayBehavior:["type",ba],parallelGatewayBehavior:["type",Ya],eventBasedGatewayBehavior:["type",fl],activityBehavior:["type",lt],subProcessBehavior:["type",yn],sequenceFlowBehavior:["type",In],messageFlowBehavior:["type",Fn],eventBehaviors:["type",Ml],scopeBehavior:["type",Bt],processBehavior:["type",Ua],transactionBehavior:["type",Kt]},MN=5e3,gQ={__depends__:[CN],__init__:[["eventBus","simulator",function(e,t){e.on(["tokenSimulation.toggleMode","tokenSimulation.resetSimulation"],MN,n=>{t.reset()})}]],simulator:["type",rQ]};function Na(e,t){e.invoke(Fn,this),this._animation=t}W(Na,Fn),Na.$inject=["injector","animation"],Na.prototype.signal=function(e){const{element:t,scope:n}=e;this._animation.animate(t,n,()=>{Fn.prototype.signal.call(this,e)})};function za(e,t){e.invoke(In,this),this._animation=t}W(za,In),za.$inject=["injector","animation"],za.prototype.enter=function(e){const{element:t,scope:n}=e;this._animation.animate(t,n,()=>{In.prototype.enter.call(this,e)})};const DN={sequenceFlowBehavior:["type",za],messageFlowBehavior:["type",Na]},d2="tokenSimulation.toggleMode",pQ="tokenSimulation.playSimulation",EQ="tokenSimulation.pauseSimulation",gt="tokenSimulation.resetSimulation",yN="tokenSimulation.animationCreated",dQ="tokenSimulation.animationSpeedChanged",uQ="tokenSimulation.simulator.elementChanged",Ji="tokenSimulation.simulator.destroyScope",IN="tokenSimulation.simulator.scopeChanged",vn="tokenSimulation.simulator.createScope",mA="tokenSimulation.scopeFilterChanged",QQ="tokenSimulation.simulator.trace",hQ=e=>!0;function ji(e,t){this._eventBus=e,this._simulator=t,this._filter=hQ,e.on([d2,gt],()=>{this._filter=hQ}),e.on(Ji,n=>{const{scope:A}=n;this._scope===A&&A.parent&&this.toggle(A.parent)}),e.on(vn,n=>{const{scope:A}=n;!A.parent&&this._scope&&!wQ(this._scope,A)&&this.toggle(null)})}ji.prototype.toggle=function(e){const t=this._scope!==e;this._scope=t?e:null,this._filter=this._scope?n=>wQ(this._scope,n):n=>!0,this._eventBus.fire(mA,{filter:this._filter,scope:this._scope})},ji.prototype.isShown=function(e){return typeof e=="string"&&(e=this._simulator.findScope(t=>t.id===e)),e&&this._filter(e)},ji.prototype.findScope=function(e){return this._simulator.findScopes(e).filter(t=>this.isShown(t))[0]},ji.$inject=["eventBus","simulator"];function wQ(e,t){do if(e===t)return!0;while(t=t.parent);return!1}const fA={scopeFilter:["type",ji]},mQ=getComputedStyle(document.documentElement),FN=mQ.getPropertyValue("--token-simulation-green-base-44"),vN=mQ.getPropertyValue("--token-simulation-white");function xN(){}function bN(e,t){return t.length===2?zN:e===1?UN:e===t.length-1?NN:YN}const YN=function(e){return e},UN=function(e){return-Math.cos(e*Math.PI/2)+1},NN=function(e){return Math.sin(e*Math.PI/2)},zN=function(e){return-Math.cos(e*Math.PI)/2+.5},Vi=20;function O2(e,t,n){this._eventBus=t,this._scopeFilter=n,this._canvas=e,this._animations=new Set,this._speed=1,t.on(gt,()=>{this.clearAnimations()}),t.on(EQ,()=>{this.pause()}),t.on(pQ,()=>{this.play()}),t.on(mA,A=>{this.each(i=>{this._scopeFilter.isShown(i.scope)?i.show():i.hide()})}),t.on(Ji,A=>{const{scope:i}=A;this.clearAnimations(i)})}O2.prototype.animate=function(e,t,n){this.createAnimation(e,t,n)},O2.prototype.pause=function(){this.each(e=>e.pause())},O2.prototype.play=function(){this.each(e=>e.play())},O2.prototype.each=function(e){this._animations.forEach(e)},O2.prototype.createAnimation=function(e,t,n=xN){const A=this._getGroup(t);if(!A)return;const i=this._createTokenGfx(A,t),o=new Fe(i,e.waypoints,()=>{this._animations.delete(o),n()});return o.setSpeed(this.getAnimationSpeed()),this._scopeFilter.isShown(t)||o.hide(),o.scope=t,o.element=e,this._animations.add(o),this._eventBus.fire(yN,{animation:o}),o.play(),o},O2.prototype.setAnimationSpeed=function(e){this._speed=e,this.each(t=>t.setSpeed(e)),this._eventBus.fire(dQ,{speed:e})},O2.prototype.getAnimationSpeed=function(){return this._speed},O2.prototype.clearAnimations=function(e){this.each(t=>{(!e||t.scope===e)&&t.remove()})},O2.prototype._createTokenGfx=function(e,t){const n=_t(this._getTokenSVG(t).trim());return la(n,e)},O2.prototype._getTokenSVG=function(e){const t=e.colors||{primary:FN,auxiliary:vN};return`
296
+ <span class="label">${a}</span>`;o=this.isActive()?o:"inactive",["error","inactive","success","warning"].forEach(function(l){o===l?i.classList.add("bjsl-button-"+l):i.classList.remove("bjsl-button-"+l)}),i.innerHTML=c},O0.prototype._updateButton=function(){var e=0,t=0,n=0;for(var A in this._issues)this._issues[A].forEach(function(i){i.category==="error"?e++:i.category==="warn"?t++:i.category==="info"&&n++});this._setButtonState({errors:e,warnings:t,infos:n})},O0.prototype._createButton=function(){var e=this;this._button=$('<button class="bjsl-button bjsl-button-inactive" title="'+this._translate("Toggle linting overlays")+'"></button>'),this._button.addEventListener("click",function(){e.toggle()}),this._canvas.getContainer().appendChild(this._button)},O0.prototype.lint=function(){var e=this._bpmnjs.getDefinitions(),t=new UY.Linter(this._linterConfig);return t.lint(e)},O0.$inject=["bpmnjs","canvas","config.linting","elementRegistry","eventBus","overlays","translate"];const SY={__init__:["linting","lintingEditorActions"],linting:["type",O0],lintingEditorActions:["type",pu]};function TY(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(A){var i=Object.getOwnPropertyDescriptor(e,A);Object.defineProperty(n,A,i.get?i:{enumerable:!0,get:function(){return e[A]}})}),n}function fu(e,t){return t.indexOf(":")===-1&&(t="bpmn:"+t),typeof e.$instanceOf=="function"?e.$instanceOf(t):e.$type===t}function kY(e,t){return t.some(function(n){return fu(e,n)})}var GY=Object.freeze({__proto__:null,is:fu,isAny:kY}),t2=TY(GY),k0={};const{is:Cu}=t2;function HY(e,t){return function(){function n(A,i){Cu(A,e)&&i.report(A.id,"Element type <"+e+"> is discouraged")}return Du(t,{check:n})}}k0.checkDiscouragedNodeType=HY;function Mu(e,t){if(!e)return null;const n=e.$parent;return n?Cu(n,t)?n:Mu(n,t):e}k0.findParent=Mu;const PY="https://github.com/bpmn-io/bpmnlint/blob/main/docs/rules";function Du(e,t){const{meta:{documentation:n={},...A}={},...i}=t;return{meta:{documentation:{url:`${PY}/${e}.md`,...n},...A},...i}}k0.annotateRule=Du;const{is:ga}=t2,{annotateRule:JY}=k0;var jY=function(){function e(t,n){if(!ga(t,"bpmn:AdHocSubProcess"))return;(t.flowElements||[]).forEach(function(i){ga(i,"bpmn:StartEvent")&&n.report(i.id,"A <Start Event> is not allowed in <Ad Hoc Sub Process>"),ga(i,"bpmn:EndEvent")&&n.report(i.id,"An <End Event> is not allowed in <Ad Hoc Sub Process>"),ga(i,"bpmn:IntermediateCatchEvent")&&(!i.outgoing||i.outgoing.length===0)&&n.report(i.id,"An intermediate catch event inside <Ad Hoc Sub Process> must have an outgoing sequence flow")})}return JY("ad-hoc-sub-process",{check:e})};const{annotateRule:VY}=k0;var LY=function(){function e(t,n){if(!WY(t))return;(t.outgoing||[]).forEach(i=>{!yu(i)&&!_Y(t,i)&&n.report(i.id,"Sequence flow is missing condition",["conditionExpression"])})}return VY("conditional-flows",{check:e})};function WY(e){const t=e.default,n=e.outgoing||[];return t||n.find(yu)}function yu(e){return!!e.conditionExpression}function _Y(e,t){return e.default===t}const{is:nl,isAny:OY}=t2,{annotateRule:XY}=k0;var KY=function(){function e(n){return(n.flowElements||[]).some(i=>nl(i,"bpmn:EndEvent"))}function t(n,A){if(!(!OY(n,["bpmn:Process","bpmn:SubProcess"])||nl(n,"bpmn:AdHocSubProcess"))&&!e(n)){const i=nl(n,"bpmn:SubProcess")?"Sub process":"Process";A.report(n.id,i+" is missing end event")}}return XY("end-event-required",{check:t})};const{is:Iu}=t2,{annotateRule:ZY}=k0;var qY=function(){function e(t,n){if(!Iu(t,"bpmn:SubProcess")||!t.triggeredByEvent)return;(t.flowElements||[]).forEach(function(i){if(!Iu(i,"bpmn:StartEvent"))return!1;(i.eventDefinitions||[]).length===0&&n.report(i.id,"Start event is missing event definition",["eventDefinitions"])})}return ZY("event-sub-process-typed-start-event",{check:e})};const{isAny:$Y}=t2,{annotateRule:eU}=k0;var tU=function(){function e(t,n){if(!$Y(t,["bpmn:Activity","bpmn:Event"]))return;(t.incoming||[]).length>1&&n.report(t.id,"Incoming flows do not join")}return eU("fake-join",{check:e})};const{is:L2,isAny:Al}=t2,{annotateRule:nU}=k0;var AU=function(){function e(r,a){if(!L2(r,"bpmn:Definitions"))return!1;const c=t(r),l=n(r);c.forEach(B=>{A(B)||a.report(B.id,"Element is missing name"),i(B,l)||a.report(B.id,"Element is unused"),o(B,c)||a.report(B.id,"Element name is not unique")})}return nU("global",{check:e});function t(r){return r.rootElements.filter(a=>Al(a,["bpmn:Error","bpmn:Escalation","bpmn:Message","bpmn:Signal"]))}function n(r){const a=[];function c(l){L2(l,"bpmn:Definitions")&&l.get("rootElements").length&&l.get("rootElements").forEach(c),L2(l,"bpmn:FlowElementsContainer")&&l.get("flowElements").length&&l.get("flowElements").forEach(c),L2(l,"bpmn:Event")&&l.get("eventDefinitions").length&&l.get("eventDefinitions").forEach(B=>a.push(B)),L2(l,"bpmn:Collaboration")&&l.get("messageFlows").length&&l.get("messageFlows").forEach(c),Al(l,["bpmn:MessageFlow","bpmn:ReceiveTask","bpmn:SendTask"])&&a.push(l)}return c(r),a}function A(r){var a;return((a=r.name)==null?void 0:a.trim())!==""}function i(r,a){if(L2(r,"bpmn:Error"))return a.some(c=>{var l;return L2(c,"bpmn:ErrorEventDefinition")&&r.get("id")===((l=c.get("errorRef"))==null?void 0:l.get("id"))});if(L2(r,"bpmn:Escalation"))return a.some(c=>{var l;return L2(c,"bpmn:EscalationEventDefinition")&&r.get("id")===((l=c.get("escalationRef"))==null?void 0:l.get("id"))});if(L2(r,"bpmn:Message"))return a.some(c=>{var l;return Al(c,["bpmn:MessageEventDefinition","bpmn:MessageFlow","bpmn:ReceiveTask","bpmn:SendTask"])&&r.get("id")===((l=c.get("messageRef"))==null?void 0:l.get("id"))});if(L2(r,"bpmn:Signal"))return a.some(c=>{var l;return L2(c,"bpmn:SignalEventDefinition")&&r.get("id")===((l=c.get("signalRef"))==null?void 0:l.get("id"))})}function o(r,a){return a.filter(c=>L2(c,r.$type)&&r.name===c.name).length===1}};const{is:il,isAny:Fu}=t2,{annotateRule:iU}=k0;var oU=function(){function e(t,n){Fu(t,["bpmn:ParallelGateway","bpmn:EventBasedGateway"])||il(t,"bpmn:Gateway")&&!rU(t)||il(t,"bpmn:SubProcess")||il(t,"bpmn:SequenceFlow")&&!aU(t)||Fu(t,["bpmn:FlowNode","bpmn:SequenceFlow","bpmn:Participant","bpmn:Lane"])&&(t.name||"").trim().length===0&&n.report(t.id,"Element is missing label/name",["name"])}return iU("label-required",{check:e})};function rU(e){return(e.outgoing||[]).length>1}function aU(e){return e.conditionExpression}var M0={};function cU(e){return Array.prototype.concat.apply([],e)}const zi=Object.prototype.toString,sU=Object.prototype.hasOwnProperty;function dA(e){return e===void 0}function vu(e){return e!==void 0}function pa(e){return e==null}function Ea(e){return zi.call(e)==="[object Array]"}function da(e){return zi.call(e)==="[object Object]"}function lU(e){return zi.call(e)==="[object Number]"}function ol(e){const t=zi.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function BU(e){return zi.call(e)==="[object String]"}function xu(e){if(!Ea(e))throw new Error("must supply array")}function bu(e,t){return!pa(e)&&sU.call(e,t)}function Yu(e,t){const n=Qa(t);let A;return S2(e,function(i,o){if(n(i,o))return A=i,!1}),A}function gU(e,t){const n=Qa(t);let A=Ea(e)?-1:void 0;return S2(e,function(i,o){if(n(i,o))return A=o,!1}),A}function pU(e,t){const n=Qa(t);let A=[];return S2(e,function(i,o){n(i,o)&&A.push(i)}),A}function S2(e,t){let n,A;if(dA(e))return;const i=Ea(e)?CU:fU;for(let o in e)if(bu(e,o)&&(n=e[o],A=t(n,i(o)),A===!1))return n}function EU(e,t){if(dA(e))return[];xu(e);const n=Qa(t);return e.filter(function(A,i){return!n(A,i)})}function Uu(e,t,n){return S2(e,function(A,i){n=t(n,A,i)}),n}function Nu(e,t){return!!Uu(e,function(n,A,i){return n&&t(A,i)},!0)}function dU(e,t){return!!Yu(e,t)}function ua(e,t){let n=[];return S2(e,function(A,i){n.push(t(A,i))}),n}function zu(e){return e&&Object.keys(e)||[]}function uU(e){return zu(e).length}function QU(e){return ua(e,t=>t)}function Ru(e,t,n={}){return t=rl(t),S2(e,function(A){let i=t(A)||"_",o=n[i];o||(o=n[i]=[]),o.push(A)}),n}function Su(e,...t){e=rl(e);let n={};return S2(t,i=>Ru(i,e,n)),ua(n,function(i,o){return i[0]})}const hU=Su;function wU(e,t){t=rl(t);let n=[];return S2(e,function(A,i){let o=t(A,i),r={d:o,v:A};for(var a=0;a<n.length;a++){let{d:c}=n[a];if(o<c){n.splice(a,0,r);return}}n.push(r)}),ua(n,A=>A.v)}function mU(e){return function(t){return Nu(e,function(n,A){return t[A]===n})}}function rl(e){return ol(e)?e:t=>t[e]}function Qa(e){return ol(e)?e:t=>t===e}function fU(e){return e}function CU(e){return Number(e)}function MU(e,t){let n,A,i,o;function r(g){let p=Date.now(),E=g?0:o+t-p;if(E>0)return a(E);e.apply(i,A),c()}function a(g){n=setTimeout(r,g)}function c(){n&&clearTimeout(n),n=o=A=i=void 0}function l(){n&&r(!0),c()}function B(...g){o=Date.now(),A=g,i=this,n||a(t)}return B.flush=l,B.cancel=c,B}function DU(e,t){let n=!1;return function(...A){n||(e(...A),n=!0,setTimeout(()=>{n=!1},t))}}function yU(e,t){return e.bind(t)}function IU(e,...t){return Object.assign(e,...t)}function FU(e,t,n){let A=e;return S2(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let r=t[o+1],a=A[i];vu(r)&&pa(a)&&(a=A[i]=isNaN(+r)?{}:[]),dA(r)?dA(n)?delete A[i]:A[i]=n:A=a}),e}function vU(e,t,n){let A=e;return S2(t,function(i){if(pa(A))return A=void 0,!1;A=A[i]}),dA(A)?n:A}function xU(e,t){let n={},A=Object(e);return S2(t,function(i){i in A&&(n[i]=e[i])}),n}function bU(e,t){let n={},A=Object(e);return S2(A,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Tu(e,...t){return t.length&&S2(t,function(n){!n||!da(n)||S2(n,function(A,i){if(i==="__proto__")return;let o=e[i];da(A)?(da(o)||(o={}),e[i]=Tu(o,A)):e[i]=A})}),e}M0.assign=IU,M0.bind=yU,M0.debounce=MU,M0.ensureArray=xu,M0.every=Nu,M0.filter=pU,M0.find=Yu,M0.findIndex=gU,M0.flatten=cU,M0.forEach=S2,M0.get=vU,M0.groupBy=Ru,M0.has=bu,M0.isArray=Ea,M0.isDefined=vu,M0.isFunction=ol,M0.isNil=pa,M0.isNumber=lU,M0.isObject=da,M0.isString=BU,M0.isUndefined=dA,M0.keys=zu,M0.map=ua,M0.matchPattern=mU,M0.merge=Tu,M0.omit=bU,M0.pick=xU,M0.reduce=Uu,M0.set=FU,M0.size=uU,M0.some=dU,M0.sortBy=wU,M0.throttle=DU,M0.unionBy=hU,M0.uniqueBy=Su,M0.values=QU,M0.without=EU;const{groupBy:YU}=M0,{is:uA}=t2,{annotateRule:UU}=k0;var NU=function(){function e(t,n){if(!uA(t,"bpmn:FlowElementsContainer"))return;const A=(t.flowElements||[]).filter(zU);for(const o of A)ku(o)||n.report(o.id,"Link event is missing link name");const i=YU(A,o=>ku(o));for(const[o,r]of Object.entries(i)){if(!o)continue;if(r.length===1){const c=r[0];n.report(c.id,`Link ${RU(c)?"catch":"throw"} event with link name <${o}> missing in scope`);continue}const a=r.filter(SU);if(a.length>1)for(const c of a)n.report(c.id,`Duplicate link catch event with link name <${o}> in scope`);else if(a.length===0)for(const c of r)n.report(c.id,`Link catch event with link name <${o}> missing in scope`)}}return UU("link-event",{check:e})};function zU(e){var t=e.eventDefinitions||[];return uA(e,"bpmn:Event")?t.some(n=>uA(n,"bpmn:LinkEventDefinition")):!1}function ku(e){return e.get("eventDefinitions").find(t=>uA(t,"bpmn:LinkEventDefinition")).name}function RU(e){return uA(e,"bpmn:ThrowEvent")}function SU(e){return uA(e,"bpmn:CatchEvent")}const{is:TU}=t2,{flatten:al}=M0,{annotateRule:kU}=k0;var GU=function(){function e(t,n){if(!TU(t,"bpmn:Definitions"))return!1;const i=cl(t.rootElements).filter(PU),o=HU(t);i.forEach(r=>{o.indexOf(r.id)===-1&&n.report(r.id,"Element is missing bpmndi")})}return kU("no-bpmndi",{check:e})};function cl(e){return al(e.map(t=>{const n=t.laneSets&&t.laneSets[0]||t.childLaneSet,A=al([t.flowElements||[],t.flowElements&&cl(t.flowElements.filter(JU))||[],t.participants||[],t.artifacts||[],n&&n.lanes||[],n&&n.lanes&&cl(n.lanes.filter(jU))||[],t.messageFlows||[]]);return A.length>0?A.map(i=>({id:i.id,$type:i.$type})):[]}))}function HU(e){return al(e.get("diagrams").map(t=>(t.plane.planeElement||[]).map(A=>{var i;return(i=A.bpmnElement)==null?void 0:i.id})))}function PU(e){return!["bpmn:DataObject"].includes(e.$type)}function JU(e){return!!e.flowElements}function jU(e){return!!e.childLaneSet}const VU=k0.checkDiscouragedNodeType;var LU=VU("bpmn:ComplexGateway","no-complex-gateway");const{isAny:WU,is:sl}=t2,{annotateRule:_U}=k0;var OU=function(){function e(t,n){if(!WU(t,["bpmn:Task","bpmn:Gateway","bpmn:SubProcess","bpmn:Event"])||t.triggeredByEvent||ZU(t)||sl(t.$parent,"bpmn:AdHocSubProcess"))return;const A=t.incoming||[],i=t.outgoing||[];!A.length&&!i.length&&n.report(t.id,"Element is not connected")}return _U("no-disconnected",{check:e})};function XU(e){var t=e.eventDefinitions;return!sl(e,"bpmn:BoundaryEvent")||!t||t.length!==1?!1:sl(t[0],"bpmn:CompensateEventDefinition")}function KU(e){return e.isForCompensation}function ZU(e){var t=XU(e),n=KU(e);return t||n}const{is:qU}=t2,{annotateRule:$U}=k0;var e6=function(){const e={},t={},n={};function A(i,o){if(!qU(i,"bpmn:SequenceFlow"))return;const r=t6(i);if(r in e){o.report(i.id,"SequenceFlow is a duplicate");const a=i.sourceRef.id,c=i.targetRef.id;t[a]||(o.report(a,"Duplicate outgoing sequence flows"),t[a]=!0),n[c]||(o.report(c,"Duplicate incoming sequence flows"),n[c]=!0)}else e[r]=i}return $U("no-duplicate-sequence-flows",{check:A})};function t6(e){const t=e.conditionExpression,n=t?t.body:"",A=e.sourceRef?e.sourceRef.id:e.id,i=e.targetRef?e.targetRef.id:e.id;return A+"#"+i+"#"+n}const{is:n6}=t2,{annotateRule:A6}=k0;var i6=function(){function e(t,n){if(!n6(t,"bpmn:Gateway"))return;const A=t.incoming||[],i=t.outgoing||[];A.length>1&&i.length>1&&n.report(t.id,"Gateway forks and joins")}return A6("no-gateway-fork-join",{check:e})};const{isAny:o6}=t2,{annotateRule:r6}=k0;var a6=function(){function e(t,n){if(!o6(t,["bpmn:Activity","bpmn:Event"]))return;(t.outgoing||[]).filter(o=>!c6(o)&&!s6(t,o)).length>1&&n.report(t.id,"Flow splits implicitly")}return r6("no-implicit-split",{check:e})};function c6(e){return!!e.conditionExpression}function s6(e,t){return e.default===t}const{is:st,isAny:l6}=t2,{findParent:B6,annotateRule:g6}=k0;var p6=function(){function e(r){const a=r.eventDefinitions||[];return a.length&&a.every(c=>st(c,"bpmn:LinkEventDefinition"))}function t(r){const a=r.eventDefinitions||[];return a.length&&a.every(c=>st(c,"bpmn:CompensateEventDefinition"))}function n(r){return(B6(r,"bpmn:Process").artifacts||[]).some(l=>st(l,"bpmn:Association")?l.sourceRef.id===r.id:!1)}function A(r){return r.isForCompensation}function i(r){const a=r.outgoing||[];return st(r,"bpmn:SubProcess")&&r.triggeredByEvent||st(r,"bpmn:IntermediateThrowEvent")&&e(r)||st(r.$parent,"bpmn:AdHocSubProcess")||st(r,"bpmn:EndEvent")||st(r,"bpmn:BoundaryEvent")&&t(r)&&n(r)||st(r,"bpmn:Task")&&A(r)?!1:a.length===0}function o(r,a){l6(r,["bpmn:Event","bpmn:Activity","bpmn:Gateway"])&&i(r)&&a.report(r.id,"Element is an implicit end")}return g6("no-implicit-end",{check:o})};const{is:Ri,isAny:Gu}=t2,{annotateRule:E6}=k0;var d6=function(){function e(A){const i=A.eventDefinitions||[];return i.length&&i.every(o=>Ri(o,"bpmn:LinkEventDefinition"))}function t(A){const i=A.incoming||[];return Ri(A,"bpmn:Activity")&&A.isForCompensation||Ri(A.$parent,"bpmn:AdHocSubProcess")||Ri(A,"bpmn:SubProcess")&&A.triggeredByEvent||Ri(A,"bpmn:IntermediateCatchEvent")&&e(A)||Gu(A,["bpmn:StartEvent","bpmn:BoundaryEvent"])?!1:i.length===0}function n(A,i){Gu(A,["bpmn:Event","bpmn:Activity","bpmn:Gateway"])&&t(A)&&i.report(A.id,"Element is an implicit start")}return E6("no-implicit-start",{check:n})};const{is:QA}=t2,{annotateRule:u6}=k0;var Q6=function(){function e(t,n){if(!QA(t,"bpmn:Definitions"))return;const A=t.rootElements||[],i=new Set,o=new Set,r=m6(t),a=new Map;A.filter(c=>QA(c,"bpmn:Collaboration")).forEach(c=>{const l=c.participants||[];Pu(l,i,r),l.forEach(B=>{a.set(B.processRef,r.get(B))})}),A.filter(c=>QA(c,"bpmn:Process")).forEach(c=>{const l=a.get(c)||{};Hu(c,i,o,r,l)}),i.forEach(c=>n.report(c.id,"Element overlaps with other element")),o.forEach(c=>n.report(c.id,"Element is outside of parent boundary"))}return u6("no-overlapping-elements",{check:e})};function Hu(e,t,n,A,i){const o=e.flowElements||[],r=o.filter(c=>A.has(c));Pu(r,t,A),r.forEach(c=>{!QA(c,"bpmn:DataStoreReference")&&h6(A.get(c).bounds,i.bounds)&&n.add(c)}),o.filter(c=>QA(c,"bpmn:SubProcess")).forEach(c=>{const l=A.get(c)||{},B=l.isExpanded?l:{};Hu(c,t,n,A,B)})}function Pu(e,t,n){var A,i;for(let o=0;o<e.length-1;o++){const r=e[o];for(let a=o+1;a<e.length;a++){const c=e[a];if(r.attachedToRef===c||c.attachedToRef===r)continue;const l=(A=n.get(r))==null?void 0:A.bounds,B=(i=n.get(c))==null?void 0:i.bounds;!l||!B||w6(l,B)&&(t.add(r),t.add(c))}}}function h6(e,t){if(!ha(e)||!ha(t))return!1;const n=e.x>=t.x&&e.y>=t.y,A=e.x+e.width<=t.x+t.width&&e.y+e.height<=t.y+t.height;return!(n&&A)}function w6(e,t){if(!ha(e)||!ha(t))return!1;const n=e.x+e.width>=t.x&&t.x+t.width>=e.x,A=e.y+e.height>=t.y&&t.y+t.height>=e.y;return n&&A}function ha(e){return!!e&&QA(e,"dc:Bounds")&&typeof e.x=="number"&&typeof e.y=="number"&&typeof e.width=="number"&&typeof e.height=="number"}function m6(e){const t=new Map;return(e.diagrams||[]).filter(A=>!!A.plane).forEach(A=>{(A.plane.planeElement||[]).filter(o=>!!o.bpmnElement).forEach(o=>{t.set(o.bpmnElement,o)})}),t}const{is:ll}=t2,{annotateRule:f6}=k0;var C6=function(){function e(t,n){if(!ll(t,"bpmn:FlowElementsContainer"))return;if((t.flowElements||[]).filter(function(o){return ll(o,"bpmn:StartEvent")?(o.eventDefinitions||[]).length===0:!1}).length>1){const o=ll(t,"bpmn:SubProcess")?"Sub process":"Process";n.report(t.id,o+" has multiple blank start events")}}return f6("single-blank-start-event",{check:e})};const{is:M6}=t2,{annotateRule:D6}=k0;var y6=function(){function e(t,n){if(!M6(t,"bpmn:Event"))return;(t.eventDefinitions||[]).length>1&&n.report(t.id,"Event has multiple event definitions",["eventDefinitions"])}return D6("single-event-definition",{check:e})};const{is:Bl,isAny:I6}=t2,{annotateRule:F6}=k0;var v6=function(){function e(n){return(n.flowElements||[]).some(i=>Bl(i,"bpmn:StartEvent"))}function t(n,A){if(!(!I6(n,["bpmn:Process","bpmn:SubProcess"])||Bl(n,"bpmn:AdHocSubProcess"))&&!e(n)){const i=Bl(n,"bpmn:SubProcess")?"Sub process":"Process";A.report(n.id,i+" is missing start event")}}return F6("start-event-required",{check:t})};const{is:Ju}=t2,{annotateRule:x6}=k0;var b6=function(){function e(t,n){if(!Ju(t,"bpmn:SubProcess")||t.triggeredByEvent)return;(t.flowElements||[]).forEach(function(i){if(!Ju(i,"bpmn:StartEvent"))return!1;(i.eventDefinitions||[]).length>0&&n.report(i.id,"Start event must be blank",["eventDefinitions"])})}return x6("sub-process-blank-start-event",{check:e})};const{is:Y6}=t2,{annotateRule:U6}=k0;var N6=function(){function e(t,n){if(!Y6(t,"bpmn:Gateway"))return;const A=t.incoming||[],i=t.outgoing||[];A.length===1&&i.length===1&&n.report(t.id,"Gateway is superfluous. It only has one source and target.")}return U6("superfluous-gateway",{check:e})};const{is:Si,isAny:z6}=t2,{annotateRule:R6}=k0;var S6=function(){function e(t,n){if(!z6(t,["bpmn:Process","bpmn:SubProcess"]))return;const i=(t.flowElements||[]).filter(a=>Si(a,"bpmn:FlowNode")&&(a.outgoing||[]).length===0),o=i.filter(ju);if(o.length!==1)return;if(i.every(a=>T6(a)||ju(a)))for(const a of o)n.report(a.id,"Termination is superfluous.")}return R6("superfluous-termination",{check:e})};function ju(e){return Si(e,"bpmn:EndEvent")&&(e.eventDefinitions||[]).some(t=>Si(t,"bpmn:TerminateEventDefinition"))}function T6(e){return Si(e,"bpmn:SubProcess")&&e.triggeredByEvent&&(e.flowElements||[]).some(n=>Si(n,"bpmn:StartEvent")&&n.isInterrupting)}const L0={};function gl(){}gl.prototype.resolveRule=function(e,t){const n=L0[e+"/"+t];if(!n)throw new Error("cannot resolve rule <"+e+"/"+t+">: not bundled");return n},gl.prototype.resolveConfig=function(e,t){throw new Error("cannot resolve config <"+t+"> in <"+e+">: not bundled")};const k6={resolver:new gl,config:{rules:{"ad-hoc-sub-process":"error","conditional-flows":"error","end-event-required":"error","event-sub-process-typed-start-event":"error","fake-join":"warn",global:"warn","label-required":"info","link-event":"error","no-bpmndi":"error","no-complex-gateway":"error","no-disconnected":"error","no-duplicate-sequence-flows":"error","no-gateway-join-fork":"error","no-implicit-split":"error","no-implicit-end":"error","no-implicit-start":"error","no-inclusive-gateway":"off","no-overlapping-elements":"warn","single-blank-start-event":"error","single-event-definition":"error","start-event-required":"error","sub-process-blank-start-event":"error","superfluous-gateway":"info","superfluous-termination":"warn"}}};L0["bpmnlint/ad-hoc-sub-process"]=jY,L0["bpmnlint/conditional-flows"]=LY,L0["bpmnlint/end-event-required"]=KY,L0["bpmnlint/event-sub-process-typed-start-event"]=qY,L0["bpmnlint/fake-join"]=tU,L0["bpmnlint/global"]=AU,L0["bpmnlint/label-required"]=oU,L0["bpmnlint/link-event"]=NU,L0["bpmnlint/no-bpmndi"]=GU,L0["bpmnlint/no-complex-gateway"]=LU,L0["bpmnlint/no-disconnected"]=OU,L0["bpmnlint/no-duplicate-sequence-flows"]=e6,L0["bpmnlint/no-gateway-join-fork"]=i6,L0["bpmnlint/no-implicit-split"]=a6,L0["bpmnlint/no-implicit-end"]=p6,L0["bpmnlint/no-implicit-start"]=d6,L0["bpmnlint/no-overlapping-elements"]=Q6,L0["bpmnlint/single-blank-start-event"]=C6,L0["bpmnlint/single-event-definition"]=y6,L0["bpmnlint/start-event-required"]=v6,L0["bpmnlint/sub-process-blank-start-event"]=b6,L0["bpmnlint/superfluous-gateway"]=N6,L0["bpmnlint/superfluous-termination"]=S6;var wa=50,Vu={min:.2,max:4},G6=10,H6=.1,P6=250;function W2(e,t,n,A,i){var o=this;this._canvas=A,this._elementRegistry=i,this._eventBus=n,this._injector=t,this._state={isOpen:void 0,isDragging:!1,initialDragPosition:null,offsetViewport:null,cachedViewbox:null,dragger:null,svgClientRect:null,parentClientRect:null,zoomDelta:0},this._init(),this.toggle(e&&e.open||!0);function r(B){(!o._state._svgClientRect||fa(o._state._svgClientRect))&&(o._state._svgClientRect=o._svg.getBoundingClientRect());var g=ma({x:B.clientX-o._state._svgClientRect.left,y:B.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox);pl(g,o._canvas),o._update()}O.bind(this._svg,"click",function(B){B.preventDefault(),B.stopPropagation(),r(B)});function a(B){return function(p){(!o._state._svgClientRect||fa(o._state._svgClientRect))&&(o._state._svgClientRect=o._svg.getBoundingClientRect()),B&&r(p);var E=ma({x:p.clientX-o._state._svgClientRect.left,y:p.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox),d=A.viewbox(),u=j6(E,d),h=o._viewportDom.getBoundingClientRect(),D={x:p.clientX-h.left+1,y:p.clientY-h.top+1};N(o._state,{cachedViewbox:d,initialDragPosition:{x:p.clientX,y:p.clientY},isDragging:!0,offsetViewport:u,offsetViewportDom:D,viewportClientRect:o._viewport.getBoundingClientRect(),parentClientRect:o._parent.getBoundingClientRect()}),O.bind(document,"mousemove",c),O.bind(document,"mouseup",l)}}function c(B){if(o._state.isDragging){(!o._state._svgClientRect||fa(o._state._svgClientRect))&&(o._state._svgClientRect=o._svg.getBoundingClientRect());var g=o._state.offsetViewportDom,p=o._state.viewportClientRect,E=o._state.parentClientRect;N(o._viewportDom.style,{top:B.clientY-g.y-E.top+"px",left:B.clientX-g.x-E.left+"px"});var d=_u(E,{top:B.clientY-g.y-E.top,left:B.clientX-g.x-E.left,width:p.width,height:p.height});N(o._overlay.style,{clipPath:d});var u=ma({x:B.clientX-o._state._svgClientRect.left,y:B.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox);pl({x:u.x-o._state.offsetViewport.x,y:u.y-o._state.offsetViewport.y},o._canvas)}}function l(B){o._state.isDragging&&(o._state.initialDragPosition.x===B.clientX&&o._state.initialDragPosition.y===B.clientY&&r(B),o._update(),N(o._state,{cachedViewbox:null,initialDragPosition:null,isDragging:!1,offsetViewport:null,offsetViewportDom:null}),O.unbind(document,"mousemove",c),O.unbind(document,"mouseup",l))}O.bind(this._viewportDom,"mousedown",a(!1)),O.bind(this._svg,"mousedown",a(!0)),O.bind(this._parent,"wheel",function(B){if(B.preventDefault(),B.stopPropagation(),!!B.ctrlKey&&((!o._state._svgClientRect||fa(o._state._svgClientRect))&&(o._state._svgClientRect=o._svg.getBoundingClientRect()),!!W6(B,o._state._svgClientRect))){var g=B.deltaMode===0?.02:.32,p=Math.sqrt(Math.pow(B.deltaY,2)+Math.pow(B.deltaX,2))*_6(B.deltaY)*-g;if(o._state.zoomDelta+=p,Math.abs(o._state.zoomDelta)>H6){var E=p>0?1:-1,d=Math.log(A.zoom())/Math.log(10),u=O6(Vu,G6*2),h=Math.round(d/u)*u;h+=u*E;var D=Math.pow(10,h);A.zoom(X6(Vu,D),y),o._state.zoomDelta=0;var y=ma({x:B.clientX-o._state._svgClientRect.left,y:B.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox);pl(y,o._canvas),o._update()}}}),O.bind(this._toggle,"click",function(B){B.preventDefault(),B.stopPropagation(),o.toggle()}),n.on(["shape.added","connection.added"],function(B){var g=B.element;o._addElement(g),o._update()}),n.on(["shape.removed","connection.removed"],function(B){var g=B.element;o._removeElement(g),o._update()}),n.on("elements.changed",P6,function(B){var g=B.elements;g.forEach(function(p){o._updateElement(p)}),o._update()}),n.on("element.updateId",function(B){var g=B.element,p=B.newId;o._updateElementId(g,p)}),n.on("canvas.viewbox.changed",function(){o._state.isDragging||o._update()}),n.on("canvas.resized",function(){document.body.contains(o._parent)&&(o._state.isDragging||o._update(),o._state._svgClientRect=o._svg.getBoundingClientRect())})}W2.$inject=["config.minimap","injector","eventBus","canvas","elementRegistry"],W2.prototype._init=function(){var e=this._canvas,t=e.getContainer(),n=this._parent=document.createElement("div");X(n).add("djs-minimap"),t.appendChild(n),this._injector.get("translate",!1);var A=this._toggle=document.createElement("div");X(A).add("toggle"),n.appendChild(A);var i=this._map=document.createElement("div");X(i).add("map"),n.appendChild(i);var o=this._svg=_t("svg");He(o,{width:"100%",height:"100%"}),Ni(i,o);var r=this._elementsGroup=_t("g");Ni(o,r);var a=this._viewportGroup=_t("g");Ni(o,a);var c=this._viewport=_t("rect");$1(c).add("viewport"),Ni(a,c),O.bind(n,"mousedown",function(g){g.stopPropagation()});var l=this._viewportDom=document.createElement("div");X(l).add("viewport-dom"),this._parent.appendChild(l);var B=this._overlay=document.createElement("div");X(B).add("overlay"),this._parent.appendChild(B)},W2.prototype._update=function(){var e=this._canvas.viewbox(),t=e.inner,n=e.outer;if(Ou(e)){var A,i,o,r,a=n.width-t.width,c=n.height-t.height;t.width<n.width?(A=t.x-a/2,o=n.width,t.x+t.width<n.width&&(A=Math.min(0,t.x))):(A=t.x,o=t.width),t.height<n.height?(i=t.y-c/2,r=n.height,t.y+t.height<n.height&&(i=Math.min(0,t.y))):(i=t.y,r=t.height),A=A-wa,i=i-wa,o=o+wa*2,r=r+wa*2,this._lastViewbox={x:A,y:i,width:o,height:r},He(this._svg,{viewBox:A+", "+i+", "+o+", "+r}),He(this._viewport,{x:e.x,y:e.y,width:e.width,height:e.height});var l=this._state._parentClientRect=this._parent.getBoundingClientRect(),B=this._viewport.getBoundingClientRect(),g={top:B.top-l.top,left:B.left-l.left,width:B.width,height:B.height};N(this._viewportDom.style,{top:g.top+"px",left:g.left+"px",width:g.width+"px",height:g.height+"px"});var p=_u(l,g);N(this._overlay.style,{clipPath:p})}},W2.prototype.open=function(){N(this._state,{isOpen:!0}),X(this._parent).add("open");var e=this._injector.get("translate",!1)||function(t){return t};g2(this._toggle,"title",e("Close minimap")),this._update(),this._eventBus.fire("minimap.toggle",{open:!0})},W2.prototype.close=function(){N(this._state,{isOpen:!1}),X(this._parent).remove("open");var e=this._injector.get("translate",!1)||function(t){return t};g2(this._toggle,"title",e("Open minimap")),this._eventBus.fire("minimap.toggle",{open:!1})},W2.prototype.toggle=function(e){var t=this.isOpen();typeof e>"u"&&(e=!t),e!=t&&(e?this.open():this.close())},W2.prototype.isOpen=function(){return this._state.isOpen},W2.prototype._updateElement=function(e){try{e.parent!==void 0&&e.parent!==null&&(this._removeElement(e),this._addElement(e))}catch(t){console.warn("Minimap#_updateElement errored",t)}},W2.prototype._updateElementId=function(e,t){try{var n=p0("#"+CSS.escape(e.id),this._elementsGroup);n&&(n.id=t)}catch(A){console.warn("Minimap#_updateElementId errored",A)}},W2.prototype._addElement=function(e){var t=this;this._removeElement(e);var n,A,i,o=this._createElement(e),r=p0("#"+CSS.escape(e.parent.id),this._elementsGroup);if(o){var a=this._elementRegistry.getGraphics(e),c=this._elementRegistry.getGraphics(e.parent),l=L6(a,c);return l!=="undefined"?r?r.childNodes.length>l?Wu(o,r,l):Wu(o,r,r.childNodes.length-1):this._elementsGroup.appendChild(o):this._elementsGroup.appendChild(o),J6(e)?(n=e.parent,A=0,i=0,typeof n.x<"u"&&typeof n.y<"u"&&(A=-n.x,i=-n.y),He(o,{transform:"translate("+A+" "+i+")"})):(A=e.x,i=e.y,r&&(n=e.parent,A-=n.x,i-=n.y),He(o,{transform:"translate("+A+" "+i+")"})),e.children&&e.children.length&&e.children.forEach(function(B){t._addElement(B)}),o}},W2.prototype._removeElement=function(e){var t=this._svg.getElementById(e.id);t&&lu(t)},W2.prototype._createElement=function(e){var t=this._elementRegistry.getGraphics(e),n;if(t&&(n=Mt(t),n)){var A=$b(n);return He(A,{id:e.id}),A}};function J6(e){return e.waypoints}function j6(e,t){var n={x:t.x+t.width/2,y:t.y+t.height/2};return{x:e.x-n.x,y:e.y-n.y}}function ma(e,t,n){var A=t.getBoundingClientRect(),i=V6(n,A.width/A.height),o=Lu(e.x,0,A.width,i.x,i.x+i.width),r=Lu(e.y,0,A.height,i.y,i.y+i.height);return{x:o,y:r}}function pl(e,t){var n=t.viewbox(),A=n.width,i=n.height;t.viewbox({x:e.x-A/2,y:e.y-i/2,width:A,height:i})}function V6(e,t){var n=e.width/e.height,A=N({},{x:e.x,y:e.y,width:e.width,height:e.height});if(n>t){var i=A.width*(1/t),o=A.y-(i-A.height)/2;N(A,{y:o,height:i})}else if(n<t){var r=A.height*t,a=A.x-(r-A.width)/2;N(A,{x:a,width:r})}return A}function Lu(e,t,n,A,i){var o=n-t,r=i-A;return(e-t)*r/o+A}function L6(e,t){var n=p0(".djs-children",t.parentNode);if(n){var A=[].slice.call(n.childNodes),i=-1;return A.forEach(function(o,r){p0(".djs-element",o)===e&&(i=r)}),i}}function Wu(e,t,n){var A=[].slice.call(t.childNodes),i=A[n];t.insertBefore(e,i.nextSibling)}function fa(e){return e.width===0&&e.height===0}function W6(e,t){return e.x>t.left&&e.x<t.left+t.width&&e.y>t.top&&e.y<t.top+t.height}var _6=Math.sign||function(e){return e>=0?1:-1};function O6(e,t){var n=Math.log(e.min)/Math.log(10),A=Math.log(e.max)/Math.log(10),i=Math.abs(n)+Math.abs(A);return i/t}function X6(e,t){return Math.max(e.min,Math.min(e.max,t))}function _u(e,t){var n=[Pe(t.left,t.top),Pe(t.left+t.width,t.top),Pe(t.left+t.width,t.top+t.height),Pe(t.left,t.top+t.height),Pe(t.left,e.height),Pe(e.width,e.height),Pe(e.width,0),Pe(0,0),Pe(0,e.height),Pe(t.left,e.height)].join(", ");return"polygon("+n+")"}function Pe(e,t){return e+"px "+t+"px"}function Ou(e){return je(e,function(t){return V0(t)?Ou(t):A0(t)&&isFinite(t)})}const Xu={__init__:["minimap"],minimap:["type",W2]},El=1,Ku=2,Zu=4,qu=8,K6=16,Z6=32,q6=64,$6=128,eN=256,tN=512,nN=El|Ku|Zu,AN=El|qu,y0=Object.freeze({ACTIVATED:El,RUNNING:Ku,ENDING:Zu,ENDED:qu,DESTROYED:K6,FAILED:Z6,TERMINATED:q6,CANCELED:$6,COMPLETED:eN,COMPENSABLE:tN,ACTIVE:nN,NOT_DEAD:AN}),hA={};function Mn(e,t){throw new Error(`illegal transition: ${e.name} -> ${t}`)}function Dn(e,t){return e===hA?t:e}class _2{constructor(t,n,{start:A,cancel:i,complete:o,destroy:r,fail:a,terminate:c,compensable:l}={}){this.name=t,this.traits=n,this._start=Dn(A,this),this._compensable=Dn(l,this),this._cancel=Dn(i,this),this._complete=Dn(o,this),this._destroy=Dn(r,this),this._fail=Dn(a,this),this._terminate=Dn(c,this)}hasTrait(t){return(this.traits&t)!==0}complete(){return this._complete||Mn(this,"complete")}destroy(){return this._destroy||Mn(this,"destroy")}cancel(){return this._cancel||Mn(this,"cancel")}fail(){return this._fail||Mn(this,"fail")}terminate(){return this._terminate||Mn(this,"terminate")}compensable(){return this._compensable||Mn(this,"compensable")}start(){return this._start||Mn(this,"start")}}const Ca=new _2("failed",y0.DESTROYED|y0.FAILED),Ma=new _2("terminated",y0.DESTROYED|y0.TERMINATED),dl=new _2("completed",y0.DESTROYED|y0.COMPLETED),Ot=new _2("terminating",y0.ENDING|y0.TERMINATED,{destroy:Ma}),wA=new _2("canceling",y0.ENDING|y0.FAILED|y0.CANCELED,{destroy:Ca,complete:hA,terminate:Ot}),ul=new _2("completing",y0.ENDING|y0.COMPLETED,{destroy:dl,cancel:wA,terminate:Ot}),Ql=new _2("failing",y0.ENDING|y0.FAILED,{cancel:wA,complete:ul,destroy:Ca,terminate:Ot}),iN=new _2("compensable:failing",y0.ENDING|y0.FAILED,{complete:hA,terminate:Ot,destroy:Ca}),$u=new _2("compensable:completed",y0.ENDED|y0.COMPLETED,{cancel:wA,fail:iN,destroy:dl,compensable:hA}),oN=new _2("compensable:completing",y0.ENDING|y0.COMPLETED,{destroy:$u,terminate:Ot,compensable:hA}),rN=new _2("compensable:running",y0.RUNNING|y0.COMPENSABLE,{cancel:wA,complete:oN,compensable:hA,destroy:$u,fail:Ql,terminate:Ot}),eQ=new _2("running",y0.RUNNING,{cancel:wA,complete:ul,compensable:rN,destroy:Ma,fail:Ql,terminate:Ot}),aN=new _2("activated",y0.ACTIVATED,{start:eQ,destroy:Ma}),cN=Object.freeze({ACTIVATED:aN,RUNNING:eQ,CANCELING:wA,COMPLETING:ul,COMPLETED:dl,FAILING:Ql,FAILED:Ca,TERMINATING:Ot,TERMINATED:Ma});class sN{constructor(t,n,A=null,i=null){this.id=t,this.element=n,this.parent=A,this.initiator=i,this.subscriptions=new Set,this.children=[],this.state=cN.ACTIVATED}get running(){return this.hasTrait(y0.RUNNING)}get destroyed(){return this.hasTrait(y0.DESTROYED)}get completed(){return this.hasTrait(y0.COMPLETED)}get canceled(){return this.hasTrait(y0.CANCELED)}get failed(){return this.hasTrait(y0.FAILED)}hasTrait(t){return this.state.hasTrait(t)}start(){return this.state=this.state.start(),this}compensable(){return this.state=this.state.compensable(),this}fail(t){return this.failed||(this.state=this.state.fail(),this.failInitiator=t),this}cancel(t){return this.canceled||(this.state=this.state.cancel(),this.cancelInitiator=t),this}terminate(t){return this.state=this.state.terminate(),this.terminateInitiator=t,this}complete(){return this.state=this.state.complete(),this}destroy(t){return this.state=this.state.destroy(),this.destroyInitiator=t,this}getTokens(){return this.children.filter(t=>!t.destroyed).length}getTokensByElement(t){return this.children.filter(n=>!n.destroyed&&n.element===t).length}}function Ti(e,t){const n=[];for(const A of e)t(A)&&n.push(A);return n}function tQ(e,t){for(const n of e)if(t(n))return n;return null}function hl(e,t){return["type","name","ref","iref"].every(n=>!(n in e)||e[n]===t[n])}function nQ(e){return e.filter(t=>f(t,"bpmn:SequenceFlow"))}function wl(e){return f(e,"bpmn:MessageFlow")}function lN(e){return f(e,"bpmn:SequenceFlow")}function BN(e){return ml(e)&&oQ(e,"bpmn:LinkEventDefinition")}function Da(e){return ml(e)&&oQ(e,"bpmn:CompensateEventDefinition")}function AQ(e){return f(e,"bpmn:Activity")&&e.businessObject.isForCompensation}function ml(e){return(f(e,"bpmn:CatchEvent")||f(e,"bpmn:ReceiveTask"))&&!Fa(e)}function ya(e){return f(e,"bpmn:BoundaryEvent")&&!Fa(e)}function Ia(e){return f(e,"bpmn:StartEvent")&&!Fa(e)}function Fa(e){return!!e.labelTarget}function Xt(e){return P(e).triggeredByEvent}function iQ(e){return f(e,"bpmn:StartEvent")&&P(e).isInterrupting||f(e,"bpmn:BoundaryEvent")&&P(e).cancelActivity}function ki(e,t){return t.some(n=>f(e,n))}function oQ(e,t){return ue(P(e).eventDefinitions,n=>f(n,t))}function rQ(e,t,n){const A=e.get("scopeIds",!1)||new we([32,36]),i={},o={},r=new gN,a=new Set,c=[],l=new Set,B=new Set;G0("tick",function(){for(const M of a)t0("elementChanged",{element:M});a.clear()});function g(M,w){if(c.push([w,M]),c.length!==1)return;let Q;for(;Q=c[0];){const[b,Y]=Q;Y.destroyed||b(),c.shift()}t0("tick")}function p(M){return o[M.type]||r}function E(M){const{element:w,parentScope:Q,initiator:b=null}=M,Y=M.scope||J({element:w,parent:Q,initiator:b});return g(Y,function(){Y.running||Y.start(),K("signal",{...M,scope:Y}),p(w).signal({...M,scope:Y}),Y.parent&&d0(Y.parent)}),Y}function d(M){const{element:w,scope:Q,initiator:b=Q}=M,Y=J({element:w,parent:Q,initiator:b});return g(Y,function(){Y.running||Y.start(),K("enter",M),p(w).enter({...M,initiator:b,scope:Y}),d0(Q)}),Y}function u(M){const{element:w,scope:Q,initiator:b=Q}=M;g(Q,function(){K("exit",M),p(w).exit({...M,initiator:b}),Q.running&&Q.complete(),H(Q,b),Q.parent&&d0(Q.parent)})}function h(M){const{event:w,initiator:Q,scope:b}=M,Y=m(w),S=b.subscriptions,G=Ti(S,I0=>hl(Y,I0.event)),_=G.filter(I0=>!I0.event.interrupting),s0=G.filter(I0=>I0.event.interrupting);if(!s0.length)return _.map(I0=>I0.triggerFn(Q)).flat();const W0=s0.find(I0=>!I0.event.boundary)||s0[0],j0=Ti(S,I0=>I0.event.persistent||pN(I0.event,W0.event));return S.forEach(I0=>{j0.includes(I0)||I0.remove()}),[W0.triggerFn(Q)].flat().filter(I0=>I0)}function D(M,w,Q){w=m(w);const b=w.element,Y={scope:M,event:w,element:b,triggerFn:Q,remove(){y(Y)}};return B.add(Y),M.subscriptions.add(Y),b&&x0(b),Y}function y(M){const{scope:w,event:Q}=M;B.delete(M),w.subscriptions.delete(M),Q.element&&x0(Q.element)}function C(M){return f(M,"bpmn:StartEvent")||f(M,"bpmn:IntermediateCatchEvent")||f(M,"bpmn:ReceiveTask")||dN(M)?P(M).name||M.id:null}function m(M){if(!M.businessObject)return M;const w=iQ(M),Q=ya(M),b=C(M),Y={element:M,interrupting:w,boundary:Q,...b?{iref:b}:{}},S=aQ(M)[0];if(!S)return{...Y,type:EN(M)?"message":"none"};if(f(S,"bpmn:LinkEventDefinition"))return{...Y,type:"link",name:S.name};if(f(S,"bpmn:SignalEventDefinition"))return{...Y,type:"signal",ref:S.signalRef};if(f(S,"bpmn:TimerEventDefinition"))return{...Y,type:"timer"};if(f(S,"bpmn:ConditionalEventDefinition"))return{...Y,type:"condition"};if(f(S,"bpmn:EscalationEventDefinition"))return{...Y,type:"escalation",ref:S.escalationRef};if(f(S,"bpmn:CancelEventDefinition"))return{...Y,type:"cancel"};if(f(S,"bpmn:ErrorEventDefinition"))return{...Y,type:"error",ref:S.errorRef};if(f(S,"bpmn:MessageEventDefinition"))return{...Y,type:"message",ref:S.messageRef};if(f(S,"bpmn:CompensateEventDefinition")){let G=S.activityRef&&n.get(S.activityRef.id);return G||(Ia(M)&&Xt(M.parent)?G=M.parent.parent:ya(M)?G=M.host:G=M.parent),{...Y,type:"compensate",ref:G,persistent:!0}}throw new Error("unknown event definition",S)}function I(M,w=!0){const{element:Q,parent:b,initiator:Y}=M;w&&K("createScope",{element:Q,scope:b});const S=new sN(A.next(),Q,b,Y);return b&&b.children.push(S),l.add(S),w&&t0("createScope",{scope:S}),x0(Q),b&&x0(b.element),S}function x(M){if(typeof M=="function")return M;const{event:w,element:Q,scope:b}=M,Y=M.elements||Q&&[Q],S=w&&m(w);return G=>(!S||hl(S,G.event))&&(!Y||Y.includes(G.element))&&(!b||b===G.scope)}function v(M){const w=M==="function"?M:x(M);return Q=>Array.from(Q.subscriptions).some(w)}function F(M){if(typeof M=="function")return M;const{element:w,waitsOnElement:Q,parent:b,trait:Y=y0.RUNNING,subscribedTo:S}=M,G=S?v(S):()=>!0;return _=>(!w||_.element===w)&&(!b||_.parent===b)&&(!Q||_.getTokensByElement(Q)>0)&&_.hasTrait(Y)&&G(_)}function z(M){return Ti(B,x(M))}function R(M){return tQ(B,x(M))}function k(M){return Ti(l,F(M))}function T(M){return tQ(l,F(M))}function H(M,w=null){if(!M.destroyed){M.destroy(w);for(const Q of M.subscriptions){const b=Q.event.traits||y0.ACTIVE;M.hasTrait(b)||y(Q)}if(M.destroyed){for(const Q of M.children)Q.destroyed||H(Q,w);K("destroyScope",{element:M.element,scope:M}),l.delete(M),t0("destroyScope",{scope:M})}x0(M.element),M.parent&&x0(M.parent.element)}}function K(M,w){t0("trace",{...w,action:M})}function x0(M){a.add(M),c.length||t0("tick")}function d0(M){t0("scopeChanged",{scope:M})}function t0(M,w={}){return t.fire(`tokenSimulation.simulator.${M}`,w)}function G0(M,w){t.on("tokenSimulation.simulator."+M,w)}function u2(M,w){t.off("tokenSimulation.simulator."+M,w)}function R0(M,w){const Q=V(M);i[M.id||M]={...Q,...w},x0(M)}function r2(){const M=[];return n.forEach(w=>{if(!ki(w,["bpmn:Process","bpmn:Participant"]))return;const Q=I({element:w},!1);M.push(Q);const b=w.children.filter(Ia);for(const Y of b){const S={...m(Y),interrupting:!1};D(Q,S,G=>E({element:w,startEvent:Y,initiator:G}))}}),M}function J(M){const{element:w}=M,Q=I(M),{children:b=[],attachers:Y=[]}=w;for(const S of b)if(Xt(S)){const G=S.children.filter(_=>Ia(_)&&!Da(_));for(const _ of G)D(Q,_,s0=>E({element:S,parentScope:Q,startEvent:_,initiator:s0}))}for(const S of Y)ya(S)&&!Da(S)&&D(Q,S,G=>E({element:S,parentScope:Q.parent,hostScope:Q,initiator:G}));return Q}function V(M){return i[M.id||M]||{}}function Z(M,w){if(!w.length)return;const Q={type:"all-completed",persistent:!1},b=new Set(w),Y=S=>{b.delete(S.scope),b.size===0&&(u2("destroyScope",Y),h({scope:M,event:Q}))};return G0("destroyScope",Y),Q}function u0(M,w=!0){R0(M,{wait:w})}function y2(){for(const M of l)H(M);for(const M of r2())l.add(M);t0("tick"),t0("reset")}this.createScope=I,this.destroyScope=H,this.findScope=T,this.findScopes=k,this.findSubscription=R,this.findSubscriptions=z,this.waitAtElement=u0,this.waitForScopes=Z,this.setConfig=R0,this.getConfig=V,this.signal=E,this.enter=d,this.exit=u,this.subscribe=D,this.trigger=h,this.reset=y2,this.on=G0,this.off=u2,this.registerBehavior=function(M,w){o[M]=w}}rQ.$inject=["injector","eventBus","elementRegistry"];function gN(){this.signal=function(e){},this.exit=function(e){},this.enter=function(e){}}function pN(e,t){return e.type===t.type&&e.boundary&&!t.boundary}function EN(e){return f(e,"bpmn:ReceiveTask")||e.incoming.some(t=>f(t,"bpmn:MessageFlow"))}function dN(e){if(!ya(e))return!1;const t=aQ(e);return!t[0]||ki(t[0],["bpmn:ConditionalEventDefinition","bpmn:TimerEventDefinition"])}function aQ(e){return e.businessObject.get("eventDefinitions")||[]}function va(e,t){this._simulator=e,this._activityBehavior=t,e.registerBehavior("bpmn:StartEvent",this)}va.prototype.signal=function(e){this._simulator.exit(e)},va.prototype.exit=function(e){this._activityBehavior.exit(e)},va.$inject=["simulator","activityBehavior"];function Gi(e,t,n){this._intermediateThrowEventBehavior=n,this._scopeBehavior=t,e.registerBehavior("bpmn:EndEvent",this)}Gi.$inject=["simulator","scopeBehavior","intermediateThrowEventBehavior"],Gi.prototype.enter=function(e){this._intermediateThrowEventBehavior.enter(e)},Gi.prototype.signal=function(e){this._intermediateThrowEventBehavior.signal(e)},Gi.prototype.exit=function(e){const{scope:t}=e;this._scopeBehavior.tryExit(t.parent,t)};function xa(e,t,n){this._simulator=e,this._activityBehavior=t,this._scopeBehavior=n,e.registerBehavior("bpmn:BoundaryEvent",this)}xa.prototype.signal=function(e){const{element:t,scope:n,hostScope:A=this._simulator.findScope({parent:n.parent,element:t.host})}=e;if(!A)throw new Error("host scope not found");if(P(t).cancelActivity){this._scopeBehavior.interrupt(A,n);const o=this._scopeBehavior.tryExit(A,n);if(o){const r=this._simulator.subscribe(A,o,a=>(r.remove(),this._simulator.exit(e)));return}}this._simulator.exit(e)},xa.prototype.exit=function(e){this._activityBehavior.exit(e)},xa.$inject=["simulator","activityBehavior","scopeBehavior"];function Hi(e,t){this._activityBehavior=t,this._simulator=e,e.registerBehavior("bpmn:IntermediateCatchEvent",this),e.registerBehavior("bpmn:ReceiveTask",this)}Hi.$inject=["simulator","activityBehavior"],Hi.prototype.signal=function(e){return this._simulator.exit(e)},Hi.prototype.enter=function(e){const{element:t}=e;return this._activityBehavior.signalOnEvent(e,t)},Hi.prototype.exit=function(e){this._activityBehavior.exit(e)};function Pi(e,t,n){this._simulator=e,this._activityBehavior=t,this._eventBehaviors=n,e.registerBehavior("bpmn:IntermediateThrowEvent",this),e.registerBehavior("bpmn:SendTask",this)}Pi.prototype.enter=function(e){const{element:t}=e,n=this._eventBehaviors.get(t);if(n){const A=n(e);if(A)return this._activityBehavior.signalOnEvent(e,A)}this._activityBehavior.enter(e)},Pi.prototype.signal=function(e){this._activityBehavior.signal(e)},Pi.prototype.exit=function(e){this._activityBehavior.exit(e)},Pi.$inject=["simulator","activityBehavior","eventBehaviors"];function ba(e){this._simulator=e,e.registerBehavior("bpmn:ExclusiveGateway",this)}ba.prototype.enter=function(e){this._simulator.exit(e)},ba.prototype.exit=function(e){const{element:t,scope:n}=e,A=nQ(t.outgoing);if(A.length===1)return this._simulator.enter({element:A[0],scope:n.parent});const{activeOutgoing:i}=this._simulator.getConfig(t),o=A.find(r=>r===i);if(!o)throw new Error("no outgoing configured");return this._simulator.enter({element:o,scope:n.parent})},ba.$inject=["simulator"];function Ya(e,t){this._simulator=e,this._activityBehavior=t,e.registerBehavior("bpmn:ParallelGateway",this)}Ya.prototype.enter=function(e){const{scope:t,element:n}=e,A=nQ(n.incoming),{parent:i}=t,o=this._simulator.findScopes({parent:i,element:n});if(o.length===A.length){for(const r of o)r!==t&&this._simulator.destroyScope(r.complete(),t);this._simulator.exit(e)}},Ya.prototype.exit=function(e){this._activityBehavior.exit(e)},Ya.$inject=["simulator","activityBehavior"];function fl(e){this._simulator=e,e.registerBehavior("bpmn:EventBasedGateway",this)}fl.$inject=["simulator"],fl.prototype.enter=function(e){const{element:t,scope:n}=e,A=n.parent,o=uN(t).map(r=>this._simulator.subscribe(A,r,a=>(o.forEach(c=>c.remove()),this._simulator.destroyScope(n,a),this._simulator.signal({element:r,parentScope:A,initiator:a}))))};function uN(e){return e.outgoing.map(t=>t.target).filter(t=>ki(t,["bpmn:IntermediateCatchEvent","bpmn:ReceiveTask"]))}function lt(e,t,n){this._simulator=e,this._scopeBehavior=t,this._transactionBehavior=n;const A=["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"];for(const i of A)e.registerBehavior(i,this)}lt.$inject=["simulator","scopeBehavior","transactionBehavior"],lt.prototype.signal=function(e){const t=this._triggerMessages(e);if(t)return this.signalOnEvent(e,t);this._simulator.exit(e)},lt.prototype.enter=function(e){const{element:t}=e,n=this.waitAtElement(t);if(n)return this.signalOnEvent(e,n);const A=this._triggerMessages(e);if(A)return this.signalOnEvent(e,A);this._simulator.exit(e)},lt.prototype.exit=function(e){const{element:t,scope:n}=e,A=n.parent,i=!n.failed;i&&!Xt(t)&&this._transactionBehavior.registerCompensation(n);const o=i?t.outgoing.filter(lN):[];o.forEach(r=>this._simulator.enter({element:r,scope:A})),o.length===0&&this._scopeBehavior.tryExit(A,n)},lt.prototype.signalOnEvent=function(e,t){const{scope:n,element:A}=e,i=this._simulator.subscribe(n,t,o=>(i.remove(),this._simulator.signal({scope:n,element:A,initiator:o})))},lt.prototype.waitAtElement=function(e){return this._simulator.getConfig(e).wait&&{element:e,type:"continue",interrupting:!1,boundary:!1}},lt.prototype._getMessageContexts=function(e,t=null){const n=t?i=>i.referencePoint.x>t.x:()=>!0,A=(i,o)=>i.referencePoint.x-o.referencePoint.x;return[...e.incoming.filter(wl).map(i=>({incoming:i,referencePoint:hN(i.waypoints)})),...e.outgoing.filter(wl).map(i=>({outgoing:i,referencePoint:QN(i.waypoints)}))].sort(A).filter(n)},lt.prototype._triggerMessages=function(e){const{element:t,initiator:n,scope:A}=e;let i=A.messageContexts;i||(i=A.messageContexts=this._getMessageContexts(t));const o=n&&n.element;if(wl(o)&&A.expectedIncoming!==o){console.debug("Simulator :: ActivityBehavior :: ignoring out-of-bounds message");return}for(;i.length;){const{incoming:r,outgoing:a}=i.shift();if(r){if(!n)continue;return A.expectedIncoming=r,{element:t,type:"message",name:r.id,interrupting:!1,boundary:!1}}this._simulator.signal({element:a})}};function QN(e){return e&&e[0]}function hN(e){return e&&e[e.length-1]}function yn(e,t,n,A,i){this._simulator=e,this._activityBehavior=t,this._scopeBehavior=n,this._transactionBehavior=A,this._elementRegistry=i,e.registerBehavior("bpmn:SubProcess",this),e.registerBehavior("bpmn:Transaction",this),e.registerBehavior("bpmn:AdHocSubProcess",this)}yn.$inject=["simulator","activityBehavior","scopeBehavior","transactionBehavior","elementRegistry"],yn.prototype.signal=function(e){this._start(e)},yn.prototype.enter=function(e){const{element:t}=e,n=this._activityBehavior.waitAtElement(t);if(n)return this._activityBehavior.signalOnEvent(e,n);this._start(e)},yn.prototype.exit=function(e){const{scope:t}=e,n=t.parent;n.failInitiator===t&&n.complete(),this._activityBehavior.exit(e)},yn.prototype._start=function(e){const{element:t,startEvent:n,scope:A}=e,i=A.parent;if(Xt(t)){if(!n)throw new Error("missing <startEvent>: required for event sub-process")}else if(n)throw new Error("unexpected <startEvent>: not allowed for sub-process");if(i.destroyed)throw new Error(`target scope <${i.id}> destroyed`);wN(t)&&this._transactionBehavior.setup(e),n&&iQ(n)&&this._scopeBehavior.interrupt(i,A);const o=n?[n]:this._findStarts(t);for(const r of o)this._simulator.signal({element:r,parentScope:A,initiator:A})},yn.prototype._findStarts=function(e){return e=this._elementRegistry.get(e.id+"_plane")||e,e.children.filter(t=>Fa(t)||t.incoming.find(A=>f(A,"bpmn:SequenceFlow"))||AQ(t)||Xt(t)?!1:ki(t,["bpmn:Activity","bpmn:StartEvent","bpmn:EndEvent"]))};function wN(e){return f(e,"bpmn:Transaction")}const Cl={type:"cancel",interrupting:!0,boundary:!1,persistent:!0};function Kt(e,t){this._simulator=e,this._scopeBehavior=t}Kt.$inject=["simulator","scopeBehavior"],Kt.prototype.setup=function(e){const{scope:t}=e,n=this._simulator.subscribe(t,Cl,o=>(n.remove(),this.cancel({scope:t,initiator:o}))),A={type:"compensate",ref:t.element,persistent:!0,traits:y0.NOT_DEAD},i=this._simulator.subscribe(t,A,o=>t.canceled?(i.remove(),this.compensate({scope:t,element:t.element,initiator:o})):this._simulator.trigger({event:Cl,scope:t}))},Kt.prototype.cancel=function(e){const{scope:t,initiator:n}=e;if(!t.destroyed)return t.cancel(n),this._simulator.trigger({event:{type:"compensate",ref:t.element},initiator:n,scope:t}),this._simulator.trigger({scope:t,initiator:n,event:Cl})},Kt.prototype.registerCompensation=function(e){const{element:t}=e,n=t.children.filter(Xt).map(o=>o.children.find(r=>Ia(r)&&Da(r))).filter(o=>o),A=t.attachers.filter(Da);if(!n.length&&!A.length)return;const i=this.findTransactionScope(e.parent);f(i.element,"bpmn:Transaction")||this.makeCompensable(i);for(const o of n){const r={element:o,type:"compensate",persistent:!0,interrupting:!0,ref:t,traits:y0.NOT_DEAD},a=o.parent,c=this._simulator.subscribe(e,r,l=>(c.remove(),this._simulator.signal({initiator:l,element:a,startEvent:o,parentScope:e})))}for(const o of A){const r={element:o,type:"compensate",persistent:!0,ref:t,traits:y0.NOT_DEAD},a=o.outgoing.map(l=>l.target).find(AQ);if(!a)continue;const c=this._simulator.subscribe(i,r,l=>(c.remove(),this._simulator.enter({initiator:l,element:a,scope:i})))}},Kt.prototype.makeCompensable=function(e){if(e.hasTrait(y0.COMPENSABLE)||!e.parent)return;const t={type:"compensate",ref:e.element,interrupting:!0,persistent:!0,traits:y0.NOT_DEAD};e.compensable();const n=this._simulator.subscribe(e,t,o=>(n.remove(),e.fail(o),this.compensate({scope:e,element:e.element,initiator:o}),this._scopeBehavior.tryExit(e,o),e)),A=e.parent;if(!A)return;const i=this._simulator.subscribe(A,t,o=>(i.remove(),this._simulator.trigger({scope:e,event:t,initiator:o})));this.makeCompensable(A)},Kt.prototype.findTransactionScope=function(e){let t=e;for(;t;){const n=t.element;if(f(n,"bpmn:SubProcess")&&!Xt(n)||ki(n,["bpmn:Transaction","bpmn:Process","bpmn:Participant"]))return t;t=t.parent}throw mN(e)},Kt.prototype.compensate=function(e){const{scope:t,element:n}=e,A=Ti(t.subscriptions,r=>hl({type:"compensate"},r.event)),i=A.filter(r=>r.event.ref===n),o=A.filter(r=>r.event.ref!==n);for(const r of i)this._scopeBehavior.preExit(t,a=>this._simulator.trigger(r));for(const r of o.reverse())this._scopeBehavior.preExit(t,a=>this._simulator.trigger(r))};function mN(e){throw new Error(`no transaction context for <${e.id}>`)}function In(e,t){this._simulator=e,this._scopeBehavior=t,e.registerBehavior("bpmn:SequenceFlow",this)}In.prototype.enter=function(e){this._simulator.exit(e)},In.prototype.exit=function(e){const{element:t,scope:n}=e;this._simulator.enter({element:t.target,scope:n.parent})},In.$inject=["simulator","scopeBehavior"];function Fn(e){this._simulator=e,e.registerBehavior("bpmn:MessageFlow",this)}Fn.$inject=["simulator"],Fn.prototype.signal=function(e){this._simulator.exit(e)},Fn.prototype.exit=function(e){const{element:t,scope:n}=e,A=t.target,i=ml(A)?A:{type:"message",element:t,name:t.id},o=this._simulator.findSubscription({event:i,elements:[A,A.parent]});o&&this._simulator.trigger({event:i,initiator:n,scope:o.scope})};function S0(e,t){return e.type==="label"?!1:(Array.isArray(t)||(t=[t]),t.some(function(n){return f(e,n)}))}function fN(e,t){return m0(P(e).eventDefinitions,n=>S0(n,t))}function cQ(e,t){return ue(P(e).eventDefinitions,n=>S0(n,t))}function Ml(e,t,n){this._simulator=e,this._elementRegistry=t,this._scopeBehavior=n}Ml.$inject=["simulator","elementRegistry","scopeBehavior"],Ml.prototype.get=function(e){const n=Object.entries({"bpmn:LinkEventDefinition":A=>{const{element:i,scope:o}=A,r=sQ(i),a=o.parent,l=a.element.children.filter(B=>BN(B)&&sQ(B).name===r.name);for(const B of l)this._simulator.signal({element:B,parentScope:a,initiator:o})},"bpmn:SignalEventDefinition":A=>{const{element:i,scope:o}=A,r=this._simulator.findSubscriptions({event:i}),a=new Set;for(const c of r){const l=c.scope;a.has(l)||(a.add(l),this._simulator.trigger({event:i,scope:l,initiator:o}))}},"bpmn:EscalationEventDefinition":A=>{const{element:i,scope:o}=A,r=this._simulator.findScopes({subscribedTo:{event:i},trait:y0.ACTIVE});let a=o;for(;a=a.parent;)if(r.includes(a)){this._simulator.trigger({event:i,scope:a,initiator:o});break}},"bpmn:ErrorEventDefinition":A=>{const{element:i,scope:o}=A;this._simulator.trigger({event:i,initiator:o,scope:Dl(o)})},"bpmn:TerminateEventDefinition":A=>{const{scope:i}=A;this._scopeBehavior.terminate(i.parent,i)},"bpmn:CancelEventDefinition":A=>{const{scope:i,element:o}=A;this._simulator.trigger({event:o,initiator:i,scope:Dl(i)})},"bpmn:CompensateEventDefinition":A=>{const{scope:i,element:o}=A;return this._simulator.waitForScopes(i,this._simulator.trigger({event:o,scope:Dl(i)}))}}).find(A=>cQ(e,A[0]));return n&&n[1]};function sQ(e){return fN(e,"bpmn:LinkEventDefinition")}function Dl(e){for(;Xt(e.parent.element);)e=e.parent;return e.parent}const lQ={type:"pre-exit",persistent:!0,interrupting:!0,boundary:!1},yl={type:"exit",interrupting:!0,boundary:!1,persistent:!0};function Bt(e){this._simulator=e}Bt.$inject=["simulator"],Bt.prototype.isFinished=function(e,t=null){return t=BQ(t),e.children.every(n=>n.destroyed||n.completed||t(n))},Bt.prototype.destroyChildren=function(e,t,n=null){n=BQ(n),e.children.filter(A=>!A.destroyed&&!n(A)).map(A=>{this._simulator.destroyScope(A,t)})},Bt.prototype.terminate=function(e,t){this.destroyChildren(e,t),e.terminate(t),this.tryExit(e,t)},Bt.prototype.interrupt=function(e,t){this.destroyChildren(e,t,t),e.fail(t)},Bt.prototype.tryExit=function(e,t){if(!e)throw new Error("missing <scope>");if(t||(t=e),!this.isFinished(e,t))return yl;const n=this._simulator.findSubscriptions({event:lQ,scope:e});for(const A of n){const{event:i,scope:o}=A;if(this._simulator.trigger({event:i,scope:o,initiator:t}).length)return yl}this._simulator.trigger({event:yl,scope:e,initiator:t}),this.exit({scope:e,initiator:t})},Bt.prototype.exit=function(e){const{scope:t,initiator:n}=e;if(!n)throw new Error("missing <initiator>");this._simulator.exit({element:t.element,scope:t,initiator:n})},Bt.prototype.preExit=function(e,t){const n=this._simulator.subscribe(e,lQ,A=>(n.remove(),t(A)));return n};function BQ(e){return typeof e=="function"?e:t=>t===e}function Ua(e,t){this._simulator=e,this._scopeBehavior=t,e.registerBehavior("bpmn:Process",this),e.registerBehavior("bpmn:Participant",this)}Ua.prototype.signal=function(e){const{startEvent:t,scope:n}=e;if(!t)throw new Error("missing <startEvent>");this._simulator.signal({element:t,parentScope:n})},Ua.prototype.exit=function(e){const{scope:t,initiator:n}=e;this._scopeBehavior.destroyChildren(t,n)},Ua.$inject=["simulator","scopeBehavior"];const CN={__init__:["startEventBehavior","endEventBehavior","boundaryEventBehavior","intermediateCatchEventBehavior","intermediateThrowEventBehavior","exclusiveGatewayBehavior","parallelGatewayBehavior","eventBasedGatewayBehavior","subProcessBehavior","sequenceFlowBehavior","messageFlowBehavior","processBehavior"],startEventBehavior:["type",va],endEventBehavior:["type",Gi],boundaryEventBehavior:["type",xa],intermediateCatchEventBehavior:["type",Hi],intermediateThrowEventBehavior:["type",Pi],exclusiveGatewayBehavior:["type",ba],parallelGatewayBehavior:["type",Ya],eventBasedGatewayBehavior:["type",fl],activityBehavior:["type",lt],subProcessBehavior:["type",yn],sequenceFlowBehavior:["type",In],messageFlowBehavior:["type",Fn],eventBehaviors:["type",Ml],scopeBehavior:["type",Bt],processBehavior:["type",Ua],transactionBehavior:["type",Kt]},MN=5e3,gQ={__depends__:[CN],__init__:[["eventBus","simulator",function(e,t){e.on(["tokenSimulation.toggleMode","tokenSimulation.resetSimulation"],MN,n=>{t.reset()})}]],simulator:["type",rQ]};function Na(e,t){e.invoke(Fn,this),this._animation=t}W(Na,Fn),Na.$inject=["injector","animation"],Na.prototype.signal=function(e){const{element:t,scope:n}=e;this._animation.animate(t,n,()=>{Fn.prototype.signal.call(this,e)})};function za(e,t){e.invoke(In,this),this._animation=t}W(za,In),za.$inject=["injector","animation"],za.prototype.enter=function(e){const{element:t,scope:n}=e;this._animation.animate(t,n,()=>{In.prototype.enter.call(this,e)})};const DN={sequenceFlowBehavior:["type",za],messageFlowBehavior:["type",Na]},d2="tokenSimulation.toggleMode",pQ="tokenSimulation.playSimulation",EQ="tokenSimulation.pauseSimulation",gt="tokenSimulation.resetSimulation",yN="tokenSimulation.animationCreated",dQ="tokenSimulation.animationSpeedChanged",uQ="tokenSimulation.simulator.elementChanged",Ji="tokenSimulation.simulator.destroyScope",IN="tokenSimulation.simulator.scopeChanged",vn="tokenSimulation.simulator.createScope",mA="tokenSimulation.scopeFilterChanged",QQ="tokenSimulation.simulator.trace",hQ=e=>!0;function ji(e,t){this._eventBus=e,this._simulator=t,this._filter=hQ,e.on([d2,gt],()=>{this._filter=hQ}),e.on(Ji,n=>{const{scope:A}=n;this._scope===A&&A.parent&&this.toggle(A.parent)}),e.on(vn,n=>{const{scope:A}=n;!A.parent&&this._scope&&!wQ(this._scope,A)&&this.toggle(null)})}ji.prototype.toggle=function(e){const t=this._scope!==e;this._scope=t?e:null,this._filter=this._scope?n=>wQ(this._scope,n):n=>!0,this._eventBus.fire(mA,{filter:this._filter,scope:this._scope})},ji.prototype.isShown=function(e){return typeof e=="string"&&(e=this._simulator.findScope(t=>t.id===e)),e&&this._filter(e)},ji.prototype.findScope=function(e){return this._simulator.findScopes(e).filter(t=>this.isShown(t))[0]},ji.$inject=["eventBus","simulator"];function wQ(e,t){do if(e===t)return!0;while(t=t.parent);return!1}const fA={scopeFilter:["type",ji]},mQ=getComputedStyle(document.documentElement),FN=mQ.getPropertyValue("--token-simulation-green-base-44"),vN=mQ.getPropertyValue("--token-simulation-white");function xN(){}function bN(e,t){return t.length===2?zN:e===1?UN:e===t.length-1?NN:YN}const YN=function(e){return e},UN=function(e){return-Math.cos(e*Math.PI/2)+1},NN=function(e){return Math.sin(e*Math.PI/2)},zN=function(e){return-Math.cos(e*Math.PI)/2+.5},Vi=20;function O2(e,t,n){this._eventBus=t,this._scopeFilter=n,this._canvas=e,this._animations=new Set,this._speed=1,t.on(gt,()=>{this.clearAnimations()}),t.on(EQ,()=>{this.pause()}),t.on(pQ,()=>{this.play()}),t.on(mA,A=>{this.each(i=>{this._scopeFilter.isShown(i.scope)?i.show():i.hide()})}),t.on(Ji,A=>{const{scope:i}=A;this.clearAnimations(i)})}O2.prototype.animate=function(e,t,n){this.createAnimation(e,t,n)},O2.prototype.pause=function(){this.each(e=>e.pause())},O2.prototype.play=function(){this.each(e=>e.play())},O2.prototype.each=function(e){this._animations.forEach(e)},O2.prototype.createAnimation=function(e,t,n=xN){const A=this._getGroup(t);if(!A)return;const i=this._createTokenGfx(A,t),o=new Fe(i,e.waypoints,()=>{this._animations.delete(o),n()});return o.setSpeed(this.getAnimationSpeed()),this._scopeFilter.isShown(t)||o.hide(),o.scope=t,o.element=e,this._animations.add(o),this._eventBus.fire(yN,{animation:o}),o.play(),o},O2.prototype.setAnimationSpeed=function(e){this._speed=e,this.each(t=>t.setSpeed(e)),this._eventBus.fire(dQ,{speed:e})},O2.prototype.getAnimationSpeed=function(){return this._speed},O2.prototype.clearAnimations=function(e){this.each(t=>{(!e||t.scope===e)&&t.remove()})},O2.prototype._createTokenGfx=function(e,t){const n=_t(this._getTokenSVG(t).trim());return la(n,e)},O2.prototype._getTokenSVG=function(e){const t=e.colors||{primary:FN,auxiliary:vN};return`
297
297
  <g class="bts-token">
298
298
  <circle
299
299
  class="bts-circle"
@@ -393,7 +393,7 @@
393
393
  `).join("")}
394
394
  </div>
395
395
  </div>
396
- `),x2.bind(this._container,"[data-speed]","click",t=>{const n=t.delegateTarget,A=this.getToggleSpeed(n);this._animation.setAnimationSpeed(A)}),this._canvas.getContainer().appendChild(this._container)},Oi.prototype.setActive=function(e){Le("[data-speed]",this._container).forEach(t=>{const n=this.getToggleSpeed(t)===e;X(t)[n?"add":"remove"]("active")})},Oi.$inject=["canvas","animation","eventBus","translate"];const G9={__init__:["setAnimationSpeed"],setAnimationSpeed:["type",Oi]},H9="--token-simulation-grey-darken-30",P9="--token-simulation-grey-lighten-56";function J9(e,t){var n=e.outgoing.filter(Ul),A=n.indexOf(t||e.sequenceFlow);return n[A+1]?n[A+1]:n[0]}function Ul(e){return S0(e,"bpmn:SequenceFlow")}const j9="exclusive-gateway-settings",V9=2e3;function MA(e,t,n,A,i){this._elementRegistry=t,this._elementColors=n,this._simulator=A,this._simulationStyles=i,e.on(d2,o=>{o.active?this.setSequenceFlowsDefault():this.resetSequenceFlows()})}MA.prototype.setSequenceFlowsDefault=function(){const e=this._elementRegistry.filter(t=>S0(t,"bpmn:ExclusiveGateway"));for(const t of e)this.setSequenceFlow(t)},MA.prototype.resetSequenceFlows=function(){this._elementRegistry.filter(t=>S0(t,"bpmn:ExclusiveGateway")).forEach(t=>{t.outgoing.filter(Ul).length&&this.resetSequenceFlow(t)})},MA.prototype.resetSequenceFlow=function(e){this._simulator.setConfig(e,{activeOutgoing:void 0})},MA.prototype.setSequenceFlow=function(e){const t=e.outgoing.filter(Ul);if(t.length<2)return;const{activeOutgoing:n}=this._simulator.getConfig(e);let A;n?A=J9(e,n):A=t[0],this._simulator.setConfig(e,{activeOutgoing:A}),e.outgoing.forEach(i=>{const o=i===A?H9:P9,r=this._simulationStyles.get(o);this._elementColors.add(i,j9,{stroke:r},V9)})},MA.$inject=["eventBus","elementRegistry","elementColors","simulator","simulationStyles"];const NQ=5e4;function ve(e,t,n){this._elementRegistry=e,this._eventBus=t,this._graphicsFactory=n,this._originalColors={},this._customColors={},t.on(d2,NQ,A=>{A.active?this._saveOriginalColors():(this._applyOriginalColors(),this._originalColors={},this._customColors={})}),t.on("saveXML.start",NQ,()=>{this._applyOriginalColors(),t.once("saveXML.done",()=>this._applyCustomColors())})}ve.$inject=["elementRegistry","eventBus","graphicsFactory"],ve.prototype.add=function(e,t,n,A=1e3){let i=this._customColors[e.id];i||(i=this._customColors[e.id]={}),i[t]={...n,priority:A},this._applyHighestPriorityColor(e)},ve.prototype.remove=function(e,t){const n=this._customColors[e.id];n&&(delete n[t],Object.keys(n)||delete this._customColors[e.id]),this._applyHighestPriorityColor(e)},ve.prototype._get=function(e){const t=h0(e);if(t){if(zQ(e))return{stroke:t.label&&t.label.get("color")};if(a0(t,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return{fill:t.get("background-color"),stroke:t.get("border-color")}}},ve.prototype._set=function(e,t={}){const{fill:n,stroke:A}=t,i=h0(e);i&&(zQ(e)?i.label&&i.label.set("color",A):a0(i,["bpmndi:BPMNEdge","bpmndi:BPMNShape"])&&(i.set("background-color",n),i.set("border-color",A)),this._forceRedraw(e))},ve.prototype._saveOriginalColors=function(){this._originalColors={},this._elementRegistry.forEach(e=>{this._originalColors[e.id]=this._get(e)})},ve.prototype._applyOriginalColors=function(){this._elementRegistry.forEach(e=>{const t=this._originalColors[e.id];t&&this._set(e,t)})},ve.prototype._applyCustomColors=function(){this._elementRegistry.forEach(e=>{const t=this._customColors[e.id];t&&this._set(e,RQ(t))})},ve.prototype._applyHighestPriorityColor=function(e){const t=this._customColors[e.id];if(!t){this._set(e,this._originalColors[e.id]);return}this._set(e,RQ(t))},ve.prototype._forceRedraw=function(e){const t=this._elementRegistry.getGraphics(e),n=e.waypoints?"connection":"shape";this._graphicsFactory.update(n,e,t)};function zQ(e){return"labelTarget"in e}function RQ(e={}){const t=Object.values(e).reduce((n,A)=>{const{priority:i=1e3}=A;return!n||i>n.priority?A:n},void 0);if(t){const{priority:n,...A}=t;return A}}const SQ={elementColors:["type",ve]},L9={__depends__:[SQ,Yl],exclusiveGatewaySettings:["type",MA]},W9="neutral-element-colors";function Nl(e,t,n){this._elementRegistry=t,this._elementColors=n,e.on(d2,A=>{const{active:i}=A;i&&this._setNeutralColors()})}Nl.prototype._setNeutralColors=function(){this._elementRegistry.forEach(e=>{this._elementColors.add(e,W9,{stroke:"#212121",fill:"#fff"})})},Nl.$inject=["eventBus","elementRegistry","elementColors"];const _9={__depends__:[SQ],__init__:["neutralElementColors"],neutralElementColors:["type",Nl]};function Ga(e,t){var n=this;this._canvas=t,this.entries=[],this._init(),e.on(d2,function(A){var i=A.active;i?X(n.container).remove("hidden"):X(n.container).add("hidden")})}Ga.prototype._init=function(){this.container=$('<div class="bts-palette hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},Ga.prototype.addEntry=function(e,t){var n=0;this.entries.forEach(function(A){t>=A.index&&n++}),this.container.insertBefore(e,this.container.childNodes[n]),this.entries.push({entry:e,index:t})},Ga.$inject=["eventBus","canvas"];const TQ={__depends__:[gQ,kN,JN,p9,h9,M9,y9,v9,b9,Y9,T9,G9,L9,_9,{__init__:["tokenSimulationPalette"],tokenSimulationPalette:["type",Ga]}]},O9=10001;function kQ(e,t,n,A,i,o,r,a){let c=!1;e.on(d2,O9,p=>{c=p.active,c&&(A.cancel(),t.close(),n.cancel()),r._update()});function l(p,E,d){const u=p[E];p[E]=function(){return d.call(this,u,arguments)}}function B(p,E){l(p,E,function(d,u){if(!c)return d.apply(this,u)})}function g(p,E){l(p,E,function(d,u){if(c)throw new Error("model is read-only");return d.apply(this,u)})}B(t,"open"),B(n,"init"),B(A,"activate"),B(n,"init"),B(A,"activate"),g(o,"moveShape"),g(o,"updateAttachment"),g(o,"moveElements"),g(o,"moveConnection"),g(o,"layoutConnection"),g(o,"createConnection"),g(o,"createShape"),g(o,"createLabel"),g(o,"appendShape"),g(o,"removeElements"),g(o,"distributeElements"),g(o,"removeShape"),g(o,"removeConnection"),g(o,"replaceShape"),g(o,"pasteElements"),g(o,"alignElements"),g(o,"resizeShape"),g(o,"createSpace"),g(o,"updateWaypoints"),g(o,"reconnectStart"),g(o,"reconnectEnd"),l(i,"trigger",function(p,E){const d=E[0];if(!(c&&X9(["undo","redo","copy","paste","removeSelection","spaceTool","lassoTool","globalConnectTool","distributeElements","alignElements","directEditing"],d)))return p.apply(this,E)})}kQ.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"];function X9(e,t){return e.indexOf(t)>-1}const K9={__init__:["disableModeling"],disableModeling:["type",kQ]};function Ha(e,t,n,A,i){this._eventBus=e,this._canvas=t,this._selection=n,this._contextPad=A,this._translate=i,this._active=!1,e.on("import.parse.start",()=>{this._active&&(this.toggleMode(!1),e.once("import.done",()=>{this.toggleMode(!0)}))}),e.on("diagram.init",()=>{this._canvasParent=this._canvas.getContainer().parentNode,this._palette=p0(".djs-palette",this._canvas.getContainer()),this._init()})}Ha.prototype._init=function(){this._container=$(`
396
+ `),x2.bind(this._container,"[data-speed]","click",t=>{const n=t.delegateTarget,A=this.getToggleSpeed(n);this._animation.setAnimationSpeed(A)}),this._canvas.getContainer().appendChild(this._container)},Oi.prototype.setActive=function(e){Le("[data-speed]",this._container).forEach(t=>{const n=this.getToggleSpeed(t)===e;X(t)[n?"add":"remove"]("active")})},Oi.$inject=["canvas","animation","eventBus","translate"];const G9={__init__:["setAnimationSpeed"],setAnimationSpeed:["type",Oi]},H9="--token-simulation-grey-darken-30",P9="--token-simulation-grey-lighten-56";function J9(e,t){var n=e.outgoing.filter(Ul),A=n.indexOf(t||e.sequenceFlow);return n[A+1]?n[A+1]:n[0]}function Ul(e){return S0(e,"bpmn:SequenceFlow")}const j9="exclusive-gateway-settings",V9=2e3;function MA(e,t,n,A,i){this._elementRegistry=t,this._elementColors=n,this._simulator=A,this._simulationStyles=i,e.on(d2,o=>{o.active?this.setSequenceFlowsDefault():this.resetSequenceFlows()})}MA.prototype.setSequenceFlowsDefault=function(){const e=this._elementRegistry.filter(t=>S0(t,"bpmn:ExclusiveGateway"));for(const t of e)this.setSequenceFlow(t)},MA.prototype.resetSequenceFlows=function(){this._elementRegistry.filter(t=>S0(t,"bpmn:ExclusiveGateway")).forEach(t=>{t.outgoing.filter(Ul).length&&this.resetSequenceFlow(t)})},MA.prototype.resetSequenceFlow=function(e){this._simulator.setConfig(e,{activeOutgoing:void 0})},MA.prototype.setSequenceFlow=function(e){const t=e.outgoing.filter(Ul);if(t.length<2)return;const{activeOutgoing:n}=this._simulator.getConfig(e);let A;n?A=J9(e,n):A=t[0],this._simulator.setConfig(e,{activeOutgoing:A}),e.outgoing.forEach(i=>{const o=i===A?H9:P9,r=this._simulationStyles.get(o);this._elementColors.add(i,j9,{stroke:r},V9)})},MA.$inject=["eventBus","elementRegistry","elementColors","simulator","simulationStyles"];const NQ=5e4;function ve(e,t,n){this._elementRegistry=e,this._eventBus=t,this._graphicsFactory=n,this._originalColors={},this._customColors={},t.on(d2,NQ,A=>{A.active?this._saveOriginalColors():(this._applyOriginalColors(),this._originalColors={},this._customColors={})}),t.on("saveXML.start",NQ,()=>{this._applyOriginalColors(),t.once("saveXML.done",()=>this._applyCustomColors())})}ve.$inject=["elementRegistry","eventBus","graphicsFactory"],ve.prototype.add=function(e,t,n,A=1e3){let i=this._customColors[e.id];i||(i=this._customColors[e.id]={}),i[t]={...n,priority:A},this._applyHighestPriorityColor(e)},ve.prototype.remove=function(e,t){const n=this._customColors[e.id];n&&(delete n[t],Object.keys(n)||delete this._customColors[e.id]),this._applyHighestPriorityColor(e)},ve.prototype._get=function(e){const t=Q0(e);if(t){if(zQ(e))return{stroke:t.label&&t.label.get("color")};if(a0(t,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return{fill:t.get("background-color"),stroke:t.get("border-color")}}},ve.prototype._set=function(e,t={}){const{fill:n,stroke:A}=t,i=Q0(e);i&&(zQ(e)?i.label&&i.label.set("color",A):a0(i,["bpmndi:BPMNEdge","bpmndi:BPMNShape"])&&(i.set("background-color",n),i.set("border-color",A)),this._forceRedraw(e))},ve.prototype._saveOriginalColors=function(){this._originalColors={},this._elementRegistry.forEach(e=>{this._originalColors[e.id]=this._get(e)})},ve.prototype._applyOriginalColors=function(){this._elementRegistry.forEach(e=>{const t=this._originalColors[e.id];t&&this._set(e,t)})},ve.prototype._applyCustomColors=function(){this._elementRegistry.forEach(e=>{const t=this._customColors[e.id];t&&this._set(e,RQ(t))})},ve.prototype._applyHighestPriorityColor=function(e){const t=this._customColors[e.id];if(!t){this._set(e,this._originalColors[e.id]);return}this._set(e,RQ(t))},ve.prototype._forceRedraw=function(e){const t=this._elementRegistry.getGraphics(e),n=e.waypoints?"connection":"shape";this._graphicsFactory.update(n,e,t)};function zQ(e){return"labelTarget"in e}function RQ(e={}){const t=Object.values(e).reduce((n,A)=>{const{priority:i=1e3}=A;return!n||i>n.priority?A:n},void 0);if(t){const{priority:n,...A}=t;return A}}const SQ={elementColors:["type",ve]},L9={__depends__:[SQ,Yl],exclusiveGatewaySettings:["type",MA]},W9="neutral-element-colors";function Nl(e,t,n){this._elementRegistry=t,this._elementColors=n,e.on(d2,A=>{const{active:i}=A;i&&this._setNeutralColors()})}Nl.prototype._setNeutralColors=function(){this._elementRegistry.forEach(e=>{this._elementColors.add(e,W9,{stroke:"#212121",fill:"#fff"})})},Nl.$inject=["eventBus","elementRegistry","elementColors"];const _9={__depends__:[SQ],__init__:["neutralElementColors"],neutralElementColors:["type",Nl]};function Ga(e,t){var n=this;this._canvas=t,this.entries=[],this._init(),e.on(d2,function(A){var i=A.active;i?X(n.container).remove("hidden"):X(n.container).add("hidden")})}Ga.prototype._init=function(){this.container=$('<div class="bts-palette hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},Ga.prototype.addEntry=function(e,t){var n=0;this.entries.forEach(function(A){t>=A.index&&n++}),this.container.insertBefore(e,this.container.childNodes[n]),this.entries.push({entry:e,index:t})},Ga.$inject=["eventBus","canvas"];const TQ={__depends__:[gQ,kN,JN,p9,h9,M9,y9,v9,b9,Y9,T9,G9,L9,_9,{__init__:["tokenSimulationPalette"],tokenSimulationPalette:["type",Ga]}]},O9=10001;function kQ(e,t,n,A,i,o,r,a){let c=!1;e.on(d2,O9,p=>{c=p.active,c&&(A.cancel(),t.close(),n.cancel()),r._update()});function l(p,E,d){const u=p[E];p[E]=function(){return d.call(this,u,arguments)}}function B(p,E){l(p,E,function(d,u){if(!c)return d.apply(this,u)})}function g(p,E){l(p,E,function(d,u){if(c)throw new Error("model is read-only");return d.apply(this,u)})}B(t,"open"),B(n,"init"),B(A,"activate"),B(n,"init"),B(A,"activate"),g(o,"moveShape"),g(o,"updateAttachment"),g(o,"moveElements"),g(o,"moveConnection"),g(o,"layoutConnection"),g(o,"createConnection"),g(o,"createShape"),g(o,"createLabel"),g(o,"appendShape"),g(o,"removeElements"),g(o,"distributeElements"),g(o,"removeShape"),g(o,"removeConnection"),g(o,"replaceShape"),g(o,"pasteElements"),g(o,"alignElements"),g(o,"resizeShape"),g(o,"createSpace"),g(o,"updateWaypoints"),g(o,"reconnectStart"),g(o,"reconnectEnd"),l(i,"trigger",function(p,E){const d=E[0];if(!(c&&X9(["undo","redo","copy","paste","removeSelection","spaceTool","lassoTool","globalConnectTool","distributeElements","alignElements","directEditing"],d)))return p.apply(this,E)})}kQ.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"];function X9(e,t){return e.indexOf(t)>-1}const K9={__init__:["disableModeling"],disableModeling:["type",kQ]};function Ha(e,t,n,A,i){this._eventBus=e,this._canvas=t,this._selection=n,this._contextPad=A,this._translate=i,this._active=!1,e.on("import.parse.start",()=>{this._active&&(this.toggleMode(!1),e.once("import.done",()=>{this.toggleMode(!0)}))}),e.on("diagram.init",()=>{this._canvasParent=this._canvas.getContainer().parentNode,this._palette=p0(".djs-palette",this._canvas.getContainer()),this._init()})}Ha.prototype._init=function(){this._container=$(`
397
397
  <div class="bts-toggle-mode">
398
398
  ${this._translate("Token Simulation")} <span class="bts-toggle">${Ra()}</span>
399
399
  </div>
@@ -405,4 +405,4 @@
405
405
  <path d="M1.3 3.4c.3 0 .5-.2.5-.5s-.2-.4-.5-.4c-.2 0-.4.1-.4.4 0 .3.2.5.4.5zM3 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5zM4.6 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5z"/>
406
406
  </svg>`,Dz=`<svg width="46" height="46" viewBox="-2 -2 9.82 9.82" xmlns="http://www.w3.org/2000/svg" fill="currentColor">
407
407
  <path d="M1.3 3.4c.3 0 .5-.2.5-.5s-.2-.4-.5-.4c-.2 0-.4.1-.4.4 0 .3.2.5.4.5zM3 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5zM4.6 3.4c.2 0 .4-.2.4-.5s-.2-.4-.4-.4c-.3 0-.5.1-.5.4 0 .3.2.5.5.5z"/>
408
- </svg>`;function Zi(e,t,n,A,i){this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=A,this._rules=i,this.register()}Zi.$inject=["contextPad","popupMenu","translate","canvas","rules"],Zi.prototype.register=function(){this._contextPad.registerProvider(this)},Zi.prototype.getContextPadEntries=function(e){const t=this._popupMenu,n=this._translate,A=this._rules,i=this._getAppendMenuPosition.bind(this);if(A.allowed("shape.append",{element:e}))return{append:{group:"model",html:`<div class="entry">${Mz}</div>`,title:n("Append element"),action:{click:function(o,r){const a=Rl(i(r),{cursor:{x:o.x,y:o.y}});t.open(r,"bpmn-append",a,{title:n("Append element"),width:300,search:!0})}}}}},Zi.prototype._getAppendMenuPosition=function(e){const A=this._canvas.getContainer().querySelector(".djs-context-pad").getBoundingClientRect();return{x:A.right+5,y:A.top}};function Sl(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function Va(e,t){var n=Tl(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function yz(e,t){return iz(t,function(n){return Va(e,n)})}function Tl(e){return e&&e.businessObject||e}function Iz(e){return JQ(e)&&VQ(e,"labelTarget")}var Fz=1e3;function X2(e){this._eventBus=e}X2.$inject=["eventBus"];function vz(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}X2.prototype.on=function(e,t,n,A,i,o){if((Xi(t)||jQ(t))&&(o=i,i=A,A=n,n=t,t=null),Xi(n)&&(o=i,i=A,A=n,n=Fz),JQ(i)&&(o=i,i=!1),!Xi(A))throw new Error("handlerFn must be a function");zl(e)||(e=[e]);var r=this._eventBus;WQ(e,function(a){var c=["commandStack",a,t].filter(function(l){return l}).join(".");r.on(c,n,i?vz(A,o):A,o)})},X2.prototype.canExecute=pt("canExecute"),X2.prototype.preExecute=pt("preExecute"),X2.prototype.preExecuted=pt("preExecuted"),X2.prototype.execute=pt("execute"),X2.prototype.executed=pt("executed"),X2.prototype.postExecute=pt("postExecute"),X2.prototype.postExecuted=pt("postExecuted"),X2.prototype.revert=pt("revert"),X2.prototype.reverted=pt("reverted");function pt(e){return function(n,A,i,o,r){(Xi(n)||jQ(n))&&(r=o,o=i,i=A,A=n,n=null),this.on(n,e,A,i,o,r)}}function DA(e){X2.call(this,e),this.init()}DA.$inject=["eventBus"],Sl(DA,X2),DA.prototype.addRule=function(e,t,n){var A=this;typeof e=="string"&&(e=[e]),e.forEach(function(i){A.canExecute(i,t,function(o,r,a){return n(o)},!0)})},DA.prototype.init=function(){};function La(e){DA.call(this,e)}Sl(La,DA),La.$inject=["eventBus"],La.prototype.init=function(){this.addRule("shape.append",function(e){const t=e.element,n=Tl(t);if(Iz(t)||yz(t,["bpmn:EndEvent","bpmn:Group","bpmn:TextAnnotation","bpmn:Lane","bpmn:Participant","bpmn:DataStoreReference","bpmn:DataObjectReference"])||bz(t)||Va(t,"bpmn:IntermediateThrowEvent")&&xz(t,"bpmn:LinkEventDefinition")||Va(t,"bpmn:SubProcess")&&n.triggeredByEvent)return!1})};function xz(e,t){const n=Tl(e);return!!LQ(n.eventDefinitions||[],function(A){return Va(A,t)})}function bz(e){return e.waypoints}var kl={__init__:["appendMenuProvider","appendContextPadProvider","appendRules"],appendMenuProvider:["type",Yn],appendContextPadProvider:["type",Zi],appendRules:["type",La]};function qi(e,t,n,A,i,o){this._elementFactory=e,this._popupMenu=t,this._create=n,this._autoPlace=A,this._mouse=i,this._translate=o,this.register()}qi.$inject=["elementFactory","popupMenu","create","autoPlace","mouse","translate"],qi.prototype.register=function(){this._popupMenu.registerProvider("bpmn-create",this)},qi.prototype.getPopupMenuEntries=function(){const e={};return _Q.forEach(t=>{const{actionName:n,className:A,label:i,target:o,description:r,group:a,search:c,rank:l}=t,B=this._createEntryAction(o);e[`create-${n}`]={label:i&&this._translate(i),className:A,description:r,group:a&&{...a,name:this._translate(a.name)},search:c,rank:l,action:{click:B,dragstart:B}}}),e},qi.prototype._createEntryAction=function(e){const t=this._create,n=this._mouse,A=this._popupMenu,i=this._elementFactory;let o;return r=>(A.close(),e.type==="bpmn:Participant"?o=i.createParticipantShape(e):o=i.create("shape",e),r instanceof KeyboardEvent&&(r=n.getLastMoveEvent()),t.start(r,o))};var Wa;typeof document<"u"&&(Wa=document.createElement("div"),Wa.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Wa.getElementsByTagName("link").length,Wa=void 0);function Yz(e,t){return t=t||document,t.querySelector(e)}const Uz=900;function _a(e,t,n,A,i){this._palette=e,this._translate=t,this._popupMenu=n,this._canvas=A,this._mouse=i,this.register()}_a.$inject=["palette","translate","popupMenu","canvas","mouse"],_a.prototype.register=function(){this._palette.registerProvider(Uz,this)},_a.prototype.getPaletteEntries=function(e){const t=this._translate,n=this._popupMenu,A=this._canvas,i=this._mouse,o=r=>{if(r instanceof KeyboardEvent)return r=i.getLastMoveEvent(),{x:r.x,y:r.y};const l=r&&r.target||Yz('.djs-palette [data-action="create"]'),B=l.getBoundingClientRect();return l&&{x:B.left+B.width/2+35,y:B.top+B.height/2+10}};return{create:{group:"create",html:`<div class="entry"> ${Dz}</div>`,title:t("Create element"),action:{click:function(r){const a=o(r),c=A.getRootElement();n.open(c,"bpmn-create",a,{title:t("Create element"),width:300,search:!0})}}}}};var Gl={__init__:["createMenuProvider","createPaletteProvider"],createMenuProvider:["type",qi],createPaletteProvider:["type",_a]};function Hl(e){this._injector=e,this.registerActions()}Hl.$inject=["injector"],Hl.prototype.registerActions=function(){const e=this._injector.get("editorActions",!1),t=this._injector.get("selection",!1),n=this._injector.get("contextPad",!1),A=this._injector.get("palette",!1),i=this._injector.get("popupMenu",!1),o={};t&&n&&A&&i&&A&&Rl(o,{appendElement:function(r){const a=t&&t.get();a.length==1&&!i.isEmpty(a[0],"bpmn-append")?n.triggerEntry("append","click",r):A.triggerEntry("create","click",r)}}),A&&Rl(o,{createElement:function(r){A.triggerEntry("create","click",r)}}),e&&e.register(o)};var Nz={__depends__:[kl,Gl],__init__:["createAppendEditorActions"],createAppendEditorActions:["type",Hl]},zz=["c","C"],Rz=["v","V"],Sz=["y","Y"],OQ=["z","Z"];function Un(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function Et(e,t){return e=zl(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function XQ(e){return e.shiftKey}function Tz(e){return Un(e)&&Et(zz,e)}function kz(e){return Un(e)&&Et(Rz,e)}function Gz(e){return Un(e)&&!XQ(e)&&Et(OQ,e)}function Hz(e){return Un(e)&&(Et(Sz,e)||Et(OQ,e)&&XQ(e))}var Pz=500;function $i(e,t){var n=this;e.on("editorActions.init",Pz,function(A){var i=A.editorActions;n.registerBindings(t,i)})}$i.$inject=["eventBus","keyboard"],$i.prototype.registerBindings=function(e,t){function n(A,i){t.isRegistered(A)&&e.addListener(i)}n("undo",function(A){var i=A.keyEvent;if(Gz(i))return t.trigger("undo"),!0}),n("redo",function(A){var i=A.keyEvent;if(Hz(i))return t.trigger("redo"),!0}),n("copy",function(A){var i=A.keyEvent;if(Tz(i))return t.trigger("copy"),!0}),n("paste",function(A){var i=A.keyEvent;if(kz(i))return t.trigger("paste"),!0}),n("stepZoom",function(A){var i=A.keyEvent;if(Et(["+","Add","="],i)&&Un(i))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(A){var i=A.keyEvent;if(Et(["-","Subtract"],i)&&Un(i))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(A){var i=A.keyEvent;if(Et("0",i)&&Un(i))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(A){var i=A.keyEvent;if(Et(["Backspace","Delete","Del"],i))return t.trigger("removeSelection"),!0})};function Oa(e){this._injector=e,this._keyboard=this._injector.get("keyboard",!1),this._editorActions=this._injector.get("editorActions",!1),this._keyboard&&this._injector.invoke($i,this)}Sl(Oa,$i),Oa.$inject=["injector"],Oa.prototype.registerBindings=function(){const e=this._keyboard,t=this._editorActions;$i.prototype.registerBindings.call(this,e,t);function n(A,i){t&&t.isRegistered(A)&&e&&e.addListener(i)}n("appendElement",function(A){const i=A.keyEvent;if(!(e&&e.hasModifier(i))&&e&&e.isKey(["a","A"],i))return t&&t.trigger("appendElement",i),!0}),n("createElement",function(A){const i=A.keyEvent;if(!(e&&e.hasModifier(i))&&e&&e.isKey(["n","N"],i))return t&&t.trigger("createElement",i),!0})};var Jz={__depends__:[kl,Gl],__init__:["createAppendKeyboardBindings"],createAppendKeyboardBindings:["type",Oa]},jz={__depends__:[kl,Gl,Nz,Jz]},Vz=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Lz=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],Wz=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link intermediate catch event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link intermediate throw event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],_z=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel end event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate end event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],Oz=[{label:"Exclusive gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event-based gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],Xz=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],Kz=[{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}}],KQ=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],Zz=KQ,qz=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"User task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Service task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Send task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"Manual task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business rule task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Script task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub-process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}},{label:"Ad-hoc sub-process (expanded)",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}}],$z=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],eR=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],tR=[{label:"Message boundary event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},{label:"Timer boundary event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},{label:"Escalation boundary event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},{label:"Conditional boundary event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},{label:"Error boundary event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},{label:"Cancel boundary event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},{label:"Signal boundary event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},{label:"Compensation boundary event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},{label:"Message boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],nR=[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Message start event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer start event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional start event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal start event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation start event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],AR=[{label:"Sequence flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],iR=[{label:"Expanded pool/participant",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}],oR={"bpmn:MessageEventDefinition":[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}}],"bpmn:TimerEventDefinition":[{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}}],"bpmn:ConditionalEventDefinition":[{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}}],"bpmn:SignalEventDefinition":[{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],"bpmn:ErrorEventDefinition":[{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}}],"bpmn:EscalationEventDefinition":[{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}}],"bpmn:CompensateEventDefinition":[{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}}]},rR=Object.freeze({__proto__:null,AD_HOC_SUBPROCESS_EXPANDED:Kz,BOUNDARY_EVENT:tR,DATA_OBJECT_REFERENCE:$z,DATA_STORE_REFERENCE:eR,END_EVENT:_z,EVENT_SUB_PROCESS:Zz,EVENT_SUB_PROCESS_START_EVENT:nR,GATEWAY:Oz,INTERMEDIATE_EVENT:Wz,PARTICIPANT:iR,SEQUENCE_FLOW:AR,START_EVENT:Vz,START_EVENT_SUB_PROCESS:Lz,SUBPROCESS_EXPANDED:Xz,TASK:qz,TRANSACTION:KQ,TYPED_EVENT:oR});Object.values(rR);const aR={name:"Flowable",uri:"http://flowable.org/bpmn",prefix:"flowable",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","flowable:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"flowable:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"},{name:"formType",isAttr:!0,type:"String"},{name:"formReadOnly",isAttr:!0,type:"String"},{name:"indepFormKey",isAttr:!0,type:"String"},{name:"indepFormSummary",isAttr:!0,type:"String"},{name:"indepSummaryNode",isAttr:!0,type:"String"},{name:"exFormKey",isAttr:!0,type:"String"},{name:"exFormUrl",isAttr:!0,type:"String"},{name:"exAppFormUrl",isAttr:!0,type:"String"},{name:"backToRejecter",isAttr:!0,type:"String"},{name:"skipExpression",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"skipFirstNode",isAttr:!0,type:"Boolean"},{name:"skipWhenStartUser",isAttr:!0,type:"Boolean"},{name:"skipWhenAssignee",isAttr:!0,type:"Boolean"},{name:"rollbackNode",isAttr:!0,type:"String"},{name:"title",isAttr:!0,type:"String"},{name:"callBack",isAttr:!0,type:"String"},{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0},{name:"executionListener",isAbstract:!0,type:"Expression"}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"multiinstance_type",superClass:["Element"]},{name:"multiinstance_condition",superClass:["Element"]},{name:"Assignable",extends:["bpmn:Task","bpmn:UserTask"],properties:[{name:"flow:ccTask",isAttr:!0,type:"String"},{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"multiinstance_condition",isAttr:!0,type:"String"},{name:"rollbackNode",isAttr:!0,type:"String"},{name:"assigneeRetain",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"},{name:"calledElementType",isAttr:!0,type:"String"},{name:"inheritVariables",isAttr:!0,type:"String"},{name:"sameDeployment",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["flowable:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","flowable:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","flowable:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike","flowable:ExecutionListener","flowable:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["flowable:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["flowable:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"ExtendedProperty",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isAttr:!0,type:"String"},{name:"remark",isAttr:!0,type:"String"}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormProp",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"Button",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"label",type:"String",isAttr:!0},{name:"prop",type:"String",isAttr:!0},{name:"display",type:"String",isAttr:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]},{name:"Serial",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"prefix",isAttr:!0,type:"String"},{name:"dateFormat",isAttr:!0,type:"String"},{name:"suffixLength",isAttr:!0,type:"Number"},{name:"startSequence",isAttr:!0,type:"Number"},{name:"connector",isAttr:!0,type:"String"},{name:"cycle",isAttr:!0,type:"String"},{name:"useExistSN",isAttr:!0,type:"Boolean"}]},{name:"Assignee",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"type",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"text",type:"String",isAttr:!0}]},{name:"HideCopy",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"HideExamine",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"HideAttachment",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"ExFormKey",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"ExFormUrl",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"ExAppFormUrl",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"IndepFormKey",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"IndepFormSummary",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"AssigneeRetain",superClass:["Element"],meta:{allowedIn:["bpmn:SubProcess","bpmn:CallActivity"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"CopyUser",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask","bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0},{name:"text",type:"String",isAttr:!0}]},{name:"ExamineSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"hideCopy",isAttr:!0,type:"String"},{name:"hideExamine",isAttr:!0,type:"String"},{name:"hideAttachment",isAttr:!0,type:"String"}]}],emumerations:[]},eo={name:"@ui-ddy-process/design",version:"1.6.27",author:"ssc <273702440@qq.com>",type:"module",description:"ddy process design",main:"lib/nf-design-elp.js",files:["lib"],publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},engines:{node:"^18.0.0 || >=20.0.0"},scripts:{build:"vite build",dev:"vite --host",lib:"vite build --mode lib",prettier:"prettier ./packages/**/*.vue --write"},dependencies:{"bpmn-js":"^18.6.2","bpmn-js-create-append-anything":"^1.0.0",bpmnlint:"^11.4.4",randomcolor:"^0.6.2","tiny-svg":"^4.1.4"},devDependencies:{"@nutflow/nf-form-elp":"^1.5.6","@so1ve/prettier-config":"^3.1.0","@vitejs/plugin-vue":"^5.2.4",axios:"^1.10.0","element-plus":"^2.10.2",prettier:"^3.5.3","rollup-plugin-visualizer":"^5.14.0",sass:"^1.89.2",vite:"^5.4.18","vite-plugin-remove-console":"^2.2.0","vite-plugin-static-copy":"^1.0.6",vue:"^3.5.16"}},cR={name:"nf-design",components:{NfToolbar:sh,NfPanel:nm},props:{options:{type:Object,default:()=>({})},storage:{type:Boolean,default:!1},accessKey:String},computed:{isEditMode(){return this.option.mode!="view"}},watch:{options:{handler(e){this.$nextTick(()=>{if(this.debounce){if(this.debounce=!1,this.storage){const t=localStorage[eo.name];t?this.option=JSON.parse(t):this.option=JSON.parse(JSON.stringify({...Pl,...e}))}else this.option=JSON.parse(JSON.stringify({...Pl,...e})),delete localStorage[eo.name];this.init(!0),setTimeout(()=>{this.debounce=!0},1e3)}})},deep:!0,immediate:!0}},data(){return{option:{},activeTab:"process",modeler:null,zoom:1,previewXML:"",previewVisible:!1,importXML:"",importVisible:!1,debounce:!0}},methods:{INIT_XML:Ka,init(e=!1){this.storage&&(localStorage[eo.name]=JSON.stringify(this.option)),e&&(this.isEditMode?this.initModeler():this.initViewer())},async initModeler(){this.modeler&&this.modeler.destroy(),this.modeler=s.markRaw(new Ba({container:this.$refs.modeler,additionalModules:[jz,this.$nfDesign.lang=="zh"?{translate:["value",gu]}:"",this.option.simulation?ez:"",this.option.minimap?Xu:"",this.option.lint?SY:""],linting:{bpmnlint:k6,active:this.isEditMode},moddleExtensions:{flowable:aR}})),await this.createNewDiagram(this.option.xml||Ka(this.option.process)),this.storage&&this.modeler.on("element.changed",()=>{this.getData("xml",!1,!1).then(e=>{this.option.xml=e,localStorage[eo.name]=JSON.stringify(this.option)})})},async initViewer(){this.modeler&&this.modeler.destroy(),this.modeler=s.markRaw(new et({container:this.$refs.modeler,additionalModules:[{translate:["value",gu]},yd,this.option.simulation?tz:"",this.option.minimap?Xu:"",Hc,jc]})),await this.createNewDiagram(this.option.xml||Ka(this.option.process)),this.option.flows&&this.option.flows.length>0&&this.setNodeColor(this.option.flows)},setNodeColor(e){const t=this.modeler.get("canvas"),n=this.modeler.get("elementRegistry"),A=this.modeler.get("tooltips");e.forEach(i=>{if(i.id&&i.class&&t.addMarker(i.id,i.class),i.id&&i.tooltip){const o=n.get(i.id);if(o){let{x:r,y:a,type:c}=o;["bpmn:StartEvent","bpmn:EndEvent"].includes(c)?(r=r-45,a=a+65):["bpmn:UserTask"].includes(c)&&(r=r-10,a=a+90),A.add({position:{x:r,y:a},html:i.tooltip})}}})},async createNewDiagram(e,t=!1){try{e=e.replace(/camunda:/g,"flowable:"),e=e.replace(/activiti:/g,"flowable:"),await this.modeler.importXML(e),this.isEditMode?this.fitViewport("init"):this.fitViewport("auto"),t&&this.$refs.panel.handleInitNodes(!0)}catch(n){console.error(n)}},fitViewport(e){const t=this.modeler.get("canvas");typeof e=="string"?e=="init"?t.zoom("fit-viewport"):e=="auto"&&t.zoom("fit-viewport","auto"):(this.zoom+=e?.1:-.1,t.zoom(this.zoom))},async getData(e,t=!1,n=!0,A=!0){if(n){const i=document.querySelector(".bjsl-button-error .label"),o=i==null?null:i.innerHTML;if(o&&!o.includes("0 错误")&&!o.includes("0 Errors"))throw this.$message.error("模型存在错误,请处理"),new Error("模型存在错误,请处理")}if(e=="xml")try{let{xml:i}=await this.modeler.saveXML({format:A});return this.option.engine!="flowable"&&(i=i.replace(/flowable:/g,this.option.engine+":")),t&&this.downloadFile(`${this.modeler.getDefinitions().rootElements[0].name}.bpmn20.xml`,i,"application/xml"),i}catch{}else try{const{svg:i}=await this.modeler.saveSVG({format:A});return t&&this.downloadFile(this.modeler.getDefinitions().rootElements[0].name,i,"image/svg+xml"),i}catch{}},downloadFile(e,t,n){let A=document.createElement("a"),i=window.URL.createObjectURL(new Blob([t],{type:n}));A.href=i,A.download=e,A.click(),window.URL.revokeObjectURL(i)},async handlePreview(e){const t=await this.getData("xml");e=="preview"?(this.previewXML=t,this.previewVisible=!0):e=="get"&&this.$emit("get",t)},handleImport(){this.option.exForm&&(delete this.option.exForm.column,delete this.option.exForm.exFormKey,delete this.option.exForm.exFormUrl,delete this.option.exForm.exAppFormUrl),this.createNewDiagram(this.importXML,!0),this.importVisible=!1},getElementRegistry(){const e=this.modeler.get("elementRegistry").getAll();return e.length==0?[]:(e[0].type!="bpmn:Process"&&e.unshift({businessObject:this.modeler.getDefinitions().rootElements.find(t=>t.$type=="bpmn:Process")}),{getAll(){return e}})}}},sR={class:"nf-design"},lR={class:"modeler",ref:"modeler"},BR={class:"nf-drawer__foot"};function gR(e,t,n,A,i,o){const r=s.resolveComponent("nf-toolbar"),a=s.resolveComponent("el-header"),c=s.resolveComponent("el-main"),l=s.resolveComponent("el-container"),B=s.resolveComponent("nf-panel"),g=s.resolveComponent("el-aside"),p=s.resolveComponent("nf-codemirror"),E=s.resolveComponent("el-drawer"),d=s.resolveComponent("el-button");return s.openBlock(),s.createElementBlock("div",sR,[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(l,null,{default:s.withCtx(()=>[s.withDirectives(s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r,{toolbar:i.option.toolbar,onOpen:t[0]||(t[0]=u=>o.createNewDiagram(u,!0)),onCreate:t[1]||(t[1]=u=>o.createNewDiagram(o.INIT_XML(),!0)),onFit:o.fitViewport,onUndo:t[2]||(t[2]=u=>i.modeler.get("commandStack").undo()),onRedo:t[3]||(t[3]=u=>i.modeler.get("commandStack").redo()),onDownload:o.getData,onImport:t[4]||(t[4]=u=>i.importVisible=!0),onPreview:o.handlePreview},{toolbar:s.withCtx(()=>[s.renderSlot(e.$slots,"toolbar")]),_:3},8,["toolbar","onFit","onDownload","onPreview"])]),_:3},512),[[s.vShow,o.isEditMode&&i.option.toolbar&&i.option.toolbar.length>0]]),s.createVNode(c,null,{default:s.withCtx(()=>[s.createElementVNode("div",lR,null,512)]),_:1})]),_:3}),o.isEditMode?(s.openBlock(),s.createBlock(g,{key:0,width:"380px"},{default:s.withCtx(()=>[i.modeler?(s.openBlock(),s.createBlock(B,{key:0,ref:"panel",modeler:i.modeler,"auto-init":i.option.autoInit,"form-option":i.option.form,"ex-form-option":i.option.exForm,"indep-form-option":i.option.indepForm,"user-option":i.option.user,"group-option":i.option.group,"button-option":i.option.button,"script-option":i.option.script,"condition-option":i.option.condition,"listener-option":i.option.listener,"extended-properties-option":i.option.extendedProperty},null,8,["modeler","auto-init","form-option","ex-form-option","indep-form-option","user-option","group-option","button-option","script-option","condition-option","listener-option","extended-properties-option"])):s.createCommentVNode("",!0)]),_:1})):s.createCommentVNode("",!0)]),_:3}),s.createVNode(E,{title:"查看",modelValue:i.previewVisible,"onUpdate:modelValue":t[6]||(t[6]=u=>i.previewVisible=u),"append-to-body":"","destroy-on-close":"",class:"nf-drawer",size:"60%"},{default:s.withCtx(()=>[s.createVNode(p,{modelValue:i.previewXML,"onUpdate:modelValue":t[5]||(t[5]=u=>i.previewXML=u),language:"xml"},null,8,["modelValue"])]),_:1},8,["modelValue"]),s.createVNode(E,{title:"导入",modelValue:i.importVisible,"onUpdate:modelValue":t[9]||(t[9]=u=>i.importVisible=u),"append-to-body":"","destroy-on-close":"",class:"nf-drawer",size:"60%"},{default:s.withCtx(()=>[s.createVNode(p,{modelValue:i.importXML,"onUpdate:modelValue":t[7]||(t[7]=u=>i.importXML=u),language:"xml",style:{height:"94%"}},null,8,["modelValue"]),s.createElementVNode("div",BR,[s.createVNode(d,{type:"primary",size:"default",onClick:o.handleImport},{default:s.withCtx(()=>t[10]||(t[10]=[s.createTextVNode(" 确定 ")])),_:1,__:[10]},8,["onClick"]),s.createVNode(d,{type:"danger",size:"default",onClick:t[8]||(t[8]=u=>i.importVisible=!1)},{default:s.withCtx(()=>t[11]||(t[11]=[s.createTextVNode(" 取消 ")])),_:1,__:[11]})])]),_:1},8,["modelValue"])])}const pR=F0(cR,[["render",gR]]),ZQ=(e,t={})=>{Vl.use(t.locale),Vl.i18n(t.i18n),e.config.globalProperties.$axios=t.axios||window.axios;let n="zh";t.locale&&(n=t.locale.nf.lang),e.config.globalProperties.$nfDesign={...t,lang:n},e.component("nf-design",pR)};return typeof window<"u"&&window.Vue&&ZQ(window.Vue),{author:"ssc",email:"273702440@qq.com",version:eo.version,install:ZQ}});
408
+ </svg>`;function Zi(e,t,n,A,i){this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=A,this._rules=i,this.register()}Zi.$inject=["contextPad","popupMenu","translate","canvas","rules"],Zi.prototype.register=function(){this._contextPad.registerProvider(this)},Zi.prototype.getContextPadEntries=function(e){const t=this._popupMenu,n=this._translate,A=this._rules,i=this._getAppendMenuPosition.bind(this);if(A.allowed("shape.append",{element:e}))return{append:{group:"model",html:`<div class="entry">${Mz}</div>`,title:n("Append element"),action:{click:function(o,r){const a=Rl(i(r),{cursor:{x:o.x,y:o.y}});t.open(r,"bpmn-append",a,{title:n("Append element"),width:300,search:!0})}}}}},Zi.prototype._getAppendMenuPosition=function(e){const A=this._canvas.getContainer().querySelector(".djs-context-pad").getBoundingClientRect();return{x:A.right+5,y:A.top}};function Sl(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function Va(e,t){var n=Tl(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function yz(e,t){return iz(t,function(n){return Va(e,n)})}function Tl(e){return e&&e.businessObject||e}function Iz(e){return JQ(e)&&VQ(e,"labelTarget")}var Fz=1e3;function X2(e){this._eventBus=e}X2.$inject=["eventBus"];function vz(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}X2.prototype.on=function(e,t,n,A,i,o){if((Xi(t)||jQ(t))&&(o=i,i=A,A=n,n=t,t=null),Xi(n)&&(o=i,i=A,A=n,n=Fz),JQ(i)&&(o=i,i=!1),!Xi(A))throw new Error("handlerFn must be a function");zl(e)||(e=[e]);var r=this._eventBus;WQ(e,function(a){var c=["commandStack",a,t].filter(function(l){return l}).join(".");r.on(c,n,i?vz(A,o):A,o)})},X2.prototype.canExecute=pt("canExecute"),X2.prototype.preExecute=pt("preExecute"),X2.prototype.preExecuted=pt("preExecuted"),X2.prototype.execute=pt("execute"),X2.prototype.executed=pt("executed"),X2.prototype.postExecute=pt("postExecute"),X2.prototype.postExecuted=pt("postExecuted"),X2.prototype.revert=pt("revert"),X2.prototype.reverted=pt("reverted");function pt(e){return function(n,A,i,o,r){(Xi(n)||jQ(n))&&(r=o,o=i,i=A,A=n,n=null),this.on(n,e,A,i,o,r)}}function DA(e){X2.call(this,e),this.init()}DA.$inject=["eventBus"],Sl(DA,X2),DA.prototype.addRule=function(e,t,n){var A=this;typeof e=="string"&&(e=[e]),e.forEach(function(i){A.canExecute(i,t,function(o,r,a){return n(o)},!0)})},DA.prototype.init=function(){};function La(e){DA.call(this,e)}Sl(La,DA),La.$inject=["eventBus"],La.prototype.init=function(){this.addRule("shape.append",function(e){const t=e.element,n=Tl(t);if(Iz(t)||yz(t,["bpmn:EndEvent","bpmn:Group","bpmn:TextAnnotation","bpmn:Lane","bpmn:Participant","bpmn:DataStoreReference","bpmn:DataObjectReference"])||bz(t)||Va(t,"bpmn:IntermediateThrowEvent")&&xz(t,"bpmn:LinkEventDefinition")||Va(t,"bpmn:SubProcess")&&n.triggeredByEvent)return!1})};function xz(e,t){const n=Tl(e);return!!LQ(n.eventDefinitions||[],function(A){return Va(A,t)})}function bz(e){return e.waypoints}var kl={__init__:["appendMenuProvider","appendContextPadProvider","appendRules"],appendMenuProvider:["type",Yn],appendContextPadProvider:["type",Zi],appendRules:["type",La]};function qi(e,t,n,A,i,o){this._elementFactory=e,this._popupMenu=t,this._create=n,this._autoPlace=A,this._mouse=i,this._translate=o,this.register()}qi.$inject=["elementFactory","popupMenu","create","autoPlace","mouse","translate"],qi.prototype.register=function(){this._popupMenu.registerProvider("bpmn-create",this)},qi.prototype.getPopupMenuEntries=function(){const e={};return _Q.forEach(t=>{const{actionName:n,className:A,label:i,target:o,description:r,group:a,search:c,rank:l}=t,B=this._createEntryAction(o);e[`create-${n}`]={label:i&&this._translate(i),className:A,description:r,group:a&&{...a,name:this._translate(a.name)},search:c,rank:l,action:{click:B,dragstart:B}}}),e},qi.prototype._createEntryAction=function(e){const t=this._create,n=this._mouse,A=this._popupMenu,i=this._elementFactory;let o;return r=>(A.close(),e.type==="bpmn:Participant"?o=i.createParticipantShape(e):o=i.create("shape",e),r instanceof KeyboardEvent&&(r=n.getLastMoveEvent()),t.start(r,o))};var Wa;typeof document<"u"&&(Wa=document.createElement("div"),Wa.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Wa.getElementsByTagName("link").length,Wa=void 0);function Yz(e,t){return t=t||document,t.querySelector(e)}const Uz=900;function _a(e,t,n,A,i){this._palette=e,this._translate=t,this._popupMenu=n,this._canvas=A,this._mouse=i,this.register()}_a.$inject=["palette","translate","popupMenu","canvas","mouse"],_a.prototype.register=function(){this._palette.registerProvider(Uz,this)},_a.prototype.getPaletteEntries=function(e){const t=this._translate,n=this._popupMenu,A=this._canvas,i=this._mouse,o=r=>{if(r instanceof KeyboardEvent)return r=i.getLastMoveEvent(),{x:r.x,y:r.y};const l=r&&r.target||Yz('.djs-palette [data-action="create"]'),B=l.getBoundingClientRect();return l&&{x:B.left+B.width/2+35,y:B.top+B.height/2+10}};return{create:{group:"create",html:`<div class="entry"> ${Dz}</div>`,title:t("Create element"),action:{click:function(r){const a=o(r),c=A.getRootElement();n.open(c,"bpmn-create",a,{title:t("Create element"),width:300,search:!0})}}}}};var Gl={__init__:["createMenuProvider","createPaletteProvider"],createMenuProvider:["type",qi],createPaletteProvider:["type",_a]};function Hl(e){this._injector=e,this.registerActions()}Hl.$inject=["injector"],Hl.prototype.registerActions=function(){const e=this._injector.get("editorActions",!1),t=this._injector.get("selection",!1),n=this._injector.get("contextPad",!1),A=this._injector.get("palette",!1),i=this._injector.get("popupMenu",!1),o={};t&&n&&A&&i&&A&&Rl(o,{appendElement:function(r){const a=t&&t.get();a.length==1&&!i.isEmpty(a[0],"bpmn-append")?n.triggerEntry("append","click",r):A.triggerEntry("create","click",r)}}),A&&Rl(o,{createElement:function(r){A.triggerEntry("create","click",r)}}),e&&e.register(o)};var Nz={__depends__:[kl,Gl],__init__:["createAppendEditorActions"],createAppendEditorActions:["type",Hl]},zz=["c","C"],Rz=["v","V"],Sz=["y","Y"],OQ=["z","Z"];function Un(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function Et(e,t){return e=zl(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function XQ(e){return e.shiftKey}function Tz(e){return Un(e)&&Et(zz,e)}function kz(e){return Un(e)&&Et(Rz,e)}function Gz(e){return Un(e)&&!XQ(e)&&Et(OQ,e)}function Hz(e){return Un(e)&&(Et(Sz,e)||Et(OQ,e)&&XQ(e))}var Pz=500;function $i(e,t){var n=this;e.on("editorActions.init",Pz,function(A){var i=A.editorActions;n.registerBindings(t,i)})}$i.$inject=["eventBus","keyboard"],$i.prototype.registerBindings=function(e,t){function n(A,i){t.isRegistered(A)&&e.addListener(i)}n("undo",function(A){var i=A.keyEvent;if(Gz(i))return t.trigger("undo"),!0}),n("redo",function(A){var i=A.keyEvent;if(Hz(i))return t.trigger("redo"),!0}),n("copy",function(A){var i=A.keyEvent;if(Tz(i))return t.trigger("copy"),!0}),n("paste",function(A){var i=A.keyEvent;if(kz(i))return t.trigger("paste"),!0}),n("stepZoom",function(A){var i=A.keyEvent;if(Et(["+","Add","="],i)&&Un(i))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(A){var i=A.keyEvent;if(Et(["-","Subtract"],i)&&Un(i))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(A){var i=A.keyEvent;if(Et("0",i)&&Un(i))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(A){var i=A.keyEvent;if(Et(["Backspace","Delete","Del"],i))return t.trigger("removeSelection"),!0})};function Oa(e){this._injector=e,this._keyboard=this._injector.get("keyboard",!1),this._editorActions=this._injector.get("editorActions",!1),this._keyboard&&this._injector.invoke($i,this)}Sl(Oa,$i),Oa.$inject=["injector"],Oa.prototype.registerBindings=function(){const e=this._keyboard,t=this._editorActions;$i.prototype.registerBindings.call(this,e,t);function n(A,i){t&&t.isRegistered(A)&&e&&e.addListener(i)}n("appendElement",function(A){const i=A.keyEvent;if(!(e&&e.hasModifier(i))&&e&&e.isKey(["a","A"],i))return t&&t.trigger("appendElement",i),!0}),n("createElement",function(A){const i=A.keyEvent;if(!(e&&e.hasModifier(i))&&e&&e.isKey(["n","N"],i))return t&&t.trigger("createElement",i),!0})};var Jz={__depends__:[kl,Gl],__init__:["createAppendKeyboardBindings"],createAppendKeyboardBindings:["type",Oa]},jz={__depends__:[kl,Gl,Nz,Jz]},Vz=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Lz=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],Wz=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link intermediate catch event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link intermediate throw event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],_z=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel end event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate end event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],Oz=[{label:"Exclusive gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event-based gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],Xz=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],Kz=[{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}}],KQ=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],Zz=KQ,qz=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"User task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Service task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Send task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"Manual task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business rule task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Script task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub-process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}},{label:"Ad-hoc sub-process (expanded)",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}}],$z=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],eR=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],tR=[{label:"Message boundary event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},{label:"Timer boundary event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},{label:"Escalation boundary event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},{label:"Conditional boundary event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},{label:"Error boundary event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},{label:"Cancel boundary event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},{label:"Signal boundary event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},{label:"Compensation boundary event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},{label:"Message boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],nR=[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Message start event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer start event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional start event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal start event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation start event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],AR=[{label:"Sequence flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],iR=[{label:"Expanded pool/participant",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}],oR={"bpmn:MessageEventDefinition":[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}}],"bpmn:TimerEventDefinition":[{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}}],"bpmn:ConditionalEventDefinition":[{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}}],"bpmn:SignalEventDefinition":[{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],"bpmn:ErrorEventDefinition":[{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}}],"bpmn:EscalationEventDefinition":[{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}}],"bpmn:CompensateEventDefinition":[{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}}]},rR=Object.freeze({__proto__:null,AD_HOC_SUBPROCESS_EXPANDED:Kz,BOUNDARY_EVENT:tR,DATA_OBJECT_REFERENCE:$z,DATA_STORE_REFERENCE:eR,END_EVENT:_z,EVENT_SUB_PROCESS:Zz,EVENT_SUB_PROCESS_START_EVENT:nR,GATEWAY:Oz,INTERMEDIATE_EVENT:Wz,PARTICIPANT:iR,SEQUENCE_FLOW:AR,START_EVENT:Vz,START_EVENT_SUB_PROCESS:Lz,SUBPROCESS_EXPANDED:Xz,TASK:qz,TRANSACTION:KQ,TYPED_EVENT:oR});Object.values(rR);const aR={name:"Flowable",uri:"http://flowable.org/bpmn",prefix:"flowable",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","flowable:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"flowable:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"},{name:"formType",isAttr:!0,type:"String"},{name:"formReadOnly",isAttr:!0,type:"String"},{name:"indepFormKey",isAttr:!0,type:"String"},{name:"indepFormSummary",isAttr:!0,type:"String"},{name:"indepSummaryNode",isAttr:!0,type:"String"},{name:"exFormKey",isAttr:!0,type:"String"},{name:"exFormUrl",isAttr:!0,type:"String"},{name:"exAppFormUrl",isAttr:!0,type:"String"},{name:"backToRejecter",isAttr:!0,type:"String"},{name:"skipExpression",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"skipFirstNode",isAttr:!0,type:"Boolean"},{name:"skipWhenStartUser",isAttr:!0,type:"Boolean"},{name:"skipWhenAssignee",isAttr:!0,type:"Boolean"},{name:"rollbackNode",isAttr:!0,type:"String"},{name:"title",isAttr:!0,type:"String"},{name:"callBack",isAttr:!0,type:"String"},{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0},{name:"executionListener",isAbstract:!0,type:"Expression"}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"multiinstance_type",superClass:["Element"]},{name:"multiinstance_condition",superClass:["Element"]},{name:"Assignable",extends:["bpmn:Task","bpmn:UserTask"],properties:[{name:"flow:ccTask",isAttr:!0,type:"String"},{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"multiinstance_condition",isAttr:!0,type:"String"},{name:"rollbackNode",isAttr:!0,type:"String"},{name:"assigneeRetain",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"},{name:"calledElementType",isAttr:!0,type:"String"},{name:"inheritVariables",isAttr:!0,type:"String"},{name:"sameDeployment",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["flowable:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","flowable:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","flowable:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike","flowable:ExecutionListener","flowable:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["flowable:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["flowable:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"ExtendedProperty",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isAttr:!0,type:"String"},{name:"remark",isAttr:!0,type:"String"}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormProp",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"Button",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"label",type:"String",isAttr:!0},{name:"prop",type:"String",isAttr:!0},{name:"display",type:"String",isAttr:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]},{name:"Serial",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"prefix",isAttr:!0,type:"String"},{name:"dateFormat",isAttr:!0,type:"String"},{name:"suffixLength",isAttr:!0,type:"Number"},{name:"startSequence",isAttr:!0,type:"Number"},{name:"connector",isAttr:!0,type:"String"},{name:"cycle",isAttr:!0,type:"String"},{name:"useExistSN",isAttr:!0,type:"Boolean"}]},{name:"Assignee",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"type",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"text",type:"String",isAttr:!0}]},{name:"HideCopy",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"HideExamine",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"HideAttachment",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"ExFormKey",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"ExFormUrl",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"ExAppFormUrl",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"IndepFormKey",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"IndepFormSummary",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"AssigneeRetain",superClass:["Element"],meta:{allowedIn:["bpmn:SubProcess","bpmn:CallActivity"]},properties:[{name:"value",type:"String",isAttr:!0}]},{name:"CopyUser",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask","bpmn:StartEvent"]},properties:[{name:"value",type:"String",isAttr:!0},{name:"text",type:"String",isAttr:!0}]},{name:"ExamineSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"hideCopy",isAttr:!0,type:"String"},{name:"hideExamine",isAttr:!0,type:"String"},{name:"hideAttachment",isAttr:!0,type:"String"}]}],emumerations:[]},eo={name:"@ui-ddy-process/design",version:"1.6.31",author:"ssc <273702440@qq.com>",type:"module",description:"ddy process design",main:"lib/nf-design-elp.js",files:["lib"],publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},engines:{node:"^18.0.0 || >=20.0.0"},scripts:{build:"vite build",dev:"vite --host",lib:"vite build --mode lib",prettier:"prettier ./packages/**/*.vue --write"},dependencies:{"bpmn-js":"^18.6.2","bpmn-js-create-append-anything":"^1.0.0",bpmnlint:"^11.4.4",randomcolor:"^0.6.2","tiny-svg":"^4.1.4"},devDependencies:{"@nutflow/nf-form-elp":"^1.5.6","@so1ve/prettier-config":"^3.1.0","@vitejs/plugin-vue":"^5.2.4",axios:"^1.10.0","element-plus":"^2.10.2",prettier:"^3.5.3","rollup-plugin-visualizer":"^5.14.0",sass:"^1.89.2",vite:"^5.4.18","vite-plugin-remove-console":"^2.2.0","vite-plugin-static-copy":"^1.0.6",vue:"^3.5.16"}},cR={name:"nf-design",components:{NfToolbar:sh,NfPanel:cm},props:{options:{type:Object,default:()=>({})},storage:{type:Boolean,default:!1},accessKey:String},computed:{isEditMode(){return this.option.mode!="view"}},watch:{options:{handler(e){this.$nextTick(()=>{if(this.debounce){if(this.debounce=!1,this.storage){const t=localStorage[eo.name];t?this.option=JSON.parse(t):this.option=JSON.parse(JSON.stringify({...Pl,...e}))}else this.option=JSON.parse(JSON.stringify({...Pl,...e})),delete localStorage[eo.name];this.init(!0),setTimeout(()=>{this.debounce=!0},1e3)}})},deep:!0,immediate:!0}},data(){return{option:{},activeTab:"process",modeler:null,zoom:1,previewXML:"",previewVisible:!1,importXML:"",importVisible:!1,debounce:!0}},methods:{INIT_XML:Ka,init(e=!1){this.storage&&(localStorage[eo.name]=JSON.stringify(this.option)),e&&(this.isEditMode?this.initModeler():this.initViewer())},async initModeler(){this.modeler&&this.modeler.destroy(),this.modeler=s.markRaw(new Ba({container:this.$refs.modeler,additionalModules:[jz,this.$nfDesign.lang=="zh"?{translate:["value",gu]}:"",this.option.simulation?ez:"",this.option.minimap?Xu:"",this.option.lint?SY:""],linting:{bpmnlint:k6,active:this.isEditMode},moddleExtensions:{flowable:aR}})),await this.createNewDiagram(this.option.xml||Ka(this.option.process)),this.storage&&this.modeler.on("element.changed",()=>{this.getData("xml",!1,!1).then(e=>{this.option.xml=e,localStorage[eo.name]=JSON.stringify(this.option)})})},async initViewer(){this.modeler&&this.modeler.destroy(),this.modeler=s.markRaw(new et({container:this.$refs.modeler,additionalModules:[{translate:["value",gu]},yd,this.option.simulation?tz:"",this.option.minimap?Xu:"",Hc,jc]})),await this.createNewDiagram(this.option.xml||Ka(this.option.process)),this.option.flows&&this.option.flows.length>0&&this.setNodeColor(this.option.flows)},setNodeColor(e){const t=this.modeler.get("canvas"),n=this.modeler.get("elementRegistry"),A=this.modeler.get("tooltips");e.forEach(i=>{if(i.id&&i.class&&t.addMarker(i.id,i.class),i.id&&i.tooltip){const o=n.get(i.id);if(o){let{x:r,y:a,type:c}=o;["bpmn:StartEvent","bpmn:EndEvent"].includes(c)?(r=r-45,a=a+65):["bpmn:UserTask"].includes(c)&&(r=r-10,a=a+90),A.add({position:{x:r,y:a},html:i.tooltip})}}})},async createNewDiagram(e,t=!1){try{e=e.replace(/camunda:/g,"flowable:"),e=e.replace(/activiti:/g,"flowable:"),await this.modeler.importXML(e),this.isEditMode?this.fitViewport("init"):this.fitViewport("auto"),t&&this.$refs.panel.handleInitNodes(!0)}catch(n){console.error(n)}},fitViewport(e){const t=this.modeler.get("canvas");typeof e=="string"?e=="init"?t.zoom("fit-viewport"):e=="auto"&&t.zoom("fit-viewport","auto"):(this.zoom+=e?.1:-.1,t.zoom(this.zoom))},async getData(e,t=!1,n=!0,A=!0){if(n){const i=document.querySelector(".bjsl-button-error .label"),o=i==null?null:i.innerHTML;if(o&&!o.includes("0 错误")&&!o.includes("0 Errors"))throw this.$message.error("模型存在错误,请处理"),new Error("模型存在错误,请处理")}if(e=="xml")try{let{xml:i}=await this.modeler.saveXML({format:A});return this.option.engine!="flowable"&&(i=i.replace(/flowable:/g,this.option.engine+":")),t&&this.downloadFile(`${this.modeler.getDefinitions().rootElements[0].name}.bpmn20.xml`,i,"application/xml"),i}catch{}else try{const{svg:i}=await this.modeler.saveSVG({format:A});return t&&this.downloadFile(this.modeler.getDefinitions().rootElements[0].name,i,"image/svg+xml"),i}catch{}},downloadFile(e,t,n){let A=document.createElement("a"),i=window.URL.createObjectURL(new Blob([t],{type:n}));A.href=i,A.download=e,A.click(),window.URL.revokeObjectURL(i)},async handlePreview(e){const t=await this.getData("xml");e=="preview"?(this.previewXML=t,this.previewVisible=!0):e=="get"&&this.$emit("get",t)},handleImport(){this.option.exForm&&(delete this.option.exForm.column,delete this.option.exForm.exFormKey,delete this.option.exForm.exFormUrl,delete this.option.exForm.exAppFormUrl),this.createNewDiagram(this.importXML,!0),this.importVisible=!1},getElementRegistry(){const e=this.modeler.get("elementRegistry").getAll();return e.length==0?[]:(e[0].type!="bpmn:Process"&&e.unshift({businessObject:this.modeler.getDefinitions().rootElements.find(t=>t.$type=="bpmn:Process")}),{getAll(){return e}})}}},sR={class:"nf-design"},lR={class:"modeler",ref:"modeler"},BR={class:"nf-drawer__foot"};function gR(e,t,n,A,i,o){const r=s.resolveComponent("nf-toolbar"),a=s.resolveComponent("el-header"),c=s.resolveComponent("el-main"),l=s.resolveComponent("el-container"),B=s.resolveComponent("nf-panel"),g=s.resolveComponent("el-aside"),p=s.resolveComponent("nf-codemirror"),E=s.resolveComponent("el-drawer"),d=s.resolveComponent("el-button");return s.openBlock(),s.createElementBlock("div",sR,[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(l,null,{default:s.withCtx(()=>[s.withDirectives(s.createVNode(a,null,{default:s.withCtx(()=>[s.createVNode(r,{toolbar:i.option.toolbar,onOpen:t[0]||(t[0]=u=>o.createNewDiagram(u,!0)),onCreate:t[1]||(t[1]=u=>o.createNewDiagram(o.INIT_XML(),!0)),onFit:o.fitViewport,onUndo:t[2]||(t[2]=u=>i.modeler.get("commandStack").undo()),onRedo:t[3]||(t[3]=u=>i.modeler.get("commandStack").redo()),onDownload:o.getData,onImport:t[4]||(t[4]=u=>i.importVisible=!0),onPreview:o.handlePreview},{toolbar:s.withCtx(()=>[s.renderSlot(e.$slots,"toolbar")]),_:3},8,["toolbar","onFit","onDownload","onPreview"])]),_:3},512),[[s.vShow,o.isEditMode&&i.option.toolbar&&i.option.toolbar.length>0]]),s.createVNode(c,null,{default:s.withCtx(()=>[s.createElementVNode("div",lR,null,512)]),_:1})]),_:3}),o.isEditMode?(s.openBlock(),s.createBlock(g,{key:0,width:"380px"},{default:s.withCtx(()=>[i.modeler?(s.openBlock(),s.createBlock(B,{key:0,ref:"panel",modeler:i.modeler,"auto-init":i.option.autoInit,"form-option":i.option.form,"ex-form-option":i.option.exForm,"indep-form-option":i.option.indepForm,"user-option":i.option.user,"group-option":i.option.group,"button-option":i.option.button,"script-option":i.option.script,"condition-option":i.option.condition,"listener-option":i.option.listener,"extended-properties-option":i.option.extendedProperty},null,8,["modeler","auto-init","form-option","ex-form-option","indep-form-option","user-option","group-option","button-option","script-option","condition-option","listener-option","extended-properties-option"])):s.createCommentVNode("",!0)]),_:1})):s.createCommentVNode("",!0)]),_:3}),s.createVNode(E,{title:"查看",modelValue:i.previewVisible,"onUpdate:modelValue":t[6]||(t[6]=u=>i.previewVisible=u),"append-to-body":"","destroy-on-close":"",class:"nf-drawer",size:"60%"},{default:s.withCtx(()=>[s.createVNode(p,{modelValue:i.previewXML,"onUpdate:modelValue":t[5]||(t[5]=u=>i.previewXML=u),language:"xml"},null,8,["modelValue"])]),_:1},8,["modelValue"]),s.createVNode(E,{title:"导入",modelValue:i.importVisible,"onUpdate:modelValue":t[9]||(t[9]=u=>i.importVisible=u),"append-to-body":"","destroy-on-close":"",class:"nf-drawer",size:"60%"},{default:s.withCtx(()=>[s.createVNode(p,{modelValue:i.importXML,"onUpdate:modelValue":t[7]||(t[7]=u=>i.importXML=u),language:"xml",style:{height:"94%"}},null,8,["modelValue"]),s.createElementVNode("div",BR,[s.createVNode(d,{type:"primary",size:"default",onClick:o.handleImport},{default:s.withCtx(()=>t[10]||(t[10]=[s.createTextVNode(" 确定 ")])),_:1,__:[10]},8,["onClick"]),s.createVNode(d,{type:"danger",size:"default",onClick:t[8]||(t[8]=u=>i.importVisible=!1)},{default:s.withCtx(()=>t[11]||(t[11]=[s.createTextVNode(" 取消 ")])),_:1,__:[11]})])]),_:1},8,["modelValue"])])}const pR=F0(cR,[["render",gR]]),ZQ=(e,t={})=>{Vl.use(t.locale),Vl.i18n(t.i18n),e.config.globalProperties.$axios=t.axios||window.axios;let n="zh";t.locale&&(n=t.locale.nf.lang),e.config.globalProperties.$nfDesign={...t,lang:n},e.component("nf-design",pR)};return typeof window<"u"&&window.Vue&&ZQ(window.Vue),{author:"ssc",email:"273702440@qq.com",version:eo.version,install:ZQ}});