bpmn-visualization
Version:
A TypeScript library for visualizing process execution data on BPMN diagrams
1 lines • 95 kB
JavaScript
import e from"mxgraph";import t from"lodash.debounce";import n from"lodash.throttle";import{XMLParser as i}from"fast-xml-parser";import{decodeXML as s}from"entities";var o,r,a,l,c,u,h,d;function T(e,t=!1){return null==e?[]:(Array.isArray(e)?e:[e]).map((e=>function(e,t){return""===e?t?{}:void 0:e}(e,t))).filter(Boolean)}!function(e){e.None="None",e.HorizontalVertical="HorizontalVertical",e.Horizontal="Horizontal",e.Vertical="Vertical",e.Center="Center"}(o||(o={})),function(e){e.In="in",e.Out="out"}(r||(r={})),function(e){e.LANE="lane",e.POOL="pool",e.CALL_ACTIVITY="callActivity",e.SUB_PROCESS="subProcess",e.TASK="task",e.TASK_USER="userTask",e.TASK_SERVICE="serviceTask",e.TASK_RECEIVE="receiveTask",e.TASK_SEND="sendTask",e.TASK_MANUAL="manualTask",e.TASK_SCRIPT="scriptTask",e.TASK_BUSINESS_RULE="businessRuleTask",e.GLOBAL_TASK="globalTask",e.GLOBAL_TASK_USER="globalUserTask",e.GLOBAL_TASK_MANUAL="globalManualTask",e.GLOBAL_TASK_SCRIPT="globalScriptTask",e.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",e.GROUP="group",e.TEXT_ANNOTATION="textAnnotation",e.GATEWAY_PARALLEL="parallelGateway",e.GATEWAY_EXCLUSIVE="exclusiveGateway",e.GATEWAY_INCLUSIVE="inclusiveGateway",e.GATEWAY_EVENT_BASED="eventBasedGateway",e.EVENT_START="startEvent",e.EVENT_END="endEvent",e.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",e.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",e.EVENT_BOUNDARY="boundaryEvent"}(a||(a={})),function(e){e.CALLING_PROCESS="process",e.CALLING_GLOBAL_TASK="global task"}(l||(l={})),function(e){e.Exclusive="Exclusive",e.None="None",e.Parallel="Parallel"}(c||(c={})),function(e){e.NONE="none",e.TERMINATE="terminate",e.CANCEL="cancel",e.COMPENSATION="compensate",e.CONDITIONAL="conditional",e.ERROR="error",e.ESCALATION="escalation",e.LINK="link",e.MESSAGE="message",e.SIGNAL="signal",e.TIMER="timer"}(u||(u={})),function(e){e.ADHOC="adhoc",e.COMPENSATION="compensation",e.EXPAND="expand",e.LOOP="loop",e.MULTI_INSTANCE_PARALLEL="parallel multi instance",e.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance"}(h||(h={})),function(e){e.EMBEDDED="embedded",e.EVENT="event"}(d||(d={}));class g{static isEvent(e){return m(b,e)}static eventKinds(){return[...b]}static isBoundaryEvent(e){return a.EVENT_BOUNDARY===e}static isStartEvent(e){return a.EVENT_START===e}static isCallActivity(e){return a.CALL_ACTIVITY===e}static isSubProcess(e){return a.SUB_PROCESS===e}static canHaveNoneEvent(e){return a.EVENT_INTERMEDIATE_THROW===e||a.EVENT_END===e||a.EVENT_START===e}static isActivity(e){return m(O,e)}static activityKinds(){return[...O]}static isWithDefaultSequenceFlow(e){return S.includes(e)}static isTask(e){return m(f,e)}static taskKinds(){return[...f]}static gatewayKinds(){return[...E]}static isGateway(e){return m(E,e)}static flowNodeKinds(){return Object.values(a).filter((e=>!g.isPoolOrLane(e)))}static isPoolOrLane(e){return e==a.POOL||e==a.LANE}}function p(e,t){return function(e,t,n){let i="";return(null==n?void 0:n.startingWith)?i=i.concat(`^(${n.startingWith}).*`):(null==n?void 0:n.notStartingWith)&&(i=i.concat(`^(?!(${n.notStartingWith})).*`)),i=i.concat(`${t}$`),e.filter((e=>(null==n?void 0:n.ignoreCase)?new RegExp(i,"i").test(e):new RegExp(i).test(e)))}(Object.values(a),e,t)}function m(e,t){return Object.values(e).map((e=>e)).includes(t)}const b=p("Event"),E=p("Gateway"),f=p("Task",{ignoreCase:!0,notStartingWith:"global"}),O=[...f,a.CALL_ACTIVITY,a.SUB_PROCESS],S=[...O,a.GATEWAY_EXCLUSIVE,a.GATEWAY_INCLUSIVE],v=Object.values(u).filter((e=>e!=u.NONE));var I,A,C,L;!function(e){e.NONE="None",e.ONE="One",e.BOTH="Both"}(I||(I={})),function(e){e.SEQUENCE_FLOW="sequenceFlow",e.MESSAGE_FLOW="messageFlow",e.ASSOCIATION_FLOW="association"}(A||(A={})),function(e){e.NONE="none",e.INITIATING="initiating",e.NON_INITIATING="non_initiating"}(C||(C={})),function(e){e.NORMAL="normal",e.DEFAULT="default",e.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",e.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway"}(L||(L={}));const _=(window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",e({}));class y{}Object.defineProperty(y,"EDGE",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.edge"}),Object.defineProperty(y,"EDGE_START_FILL_COLOR",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.edge.startFillColor"}),Object.defineProperty(y,"EDGE_END_FILL_COLOR",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.edge.endFillColor"}),Object.defineProperty(y,"EVENT_BASED_GATEWAY_KIND",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.gatewayKind"}),Object.defineProperty(y,"EVENT_DEFINITION_KIND",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.eventDefinitionKind"}),Object.defineProperty(y,"GLOBAL_TASK_KIND",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.globalTaskKind"}),Object.defineProperty(y,"SUB_PROCESS_KIND",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.subProcessKind"}),Object.defineProperty(y,"IS_INITIATING",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.isInitiating"}),Object.defineProperty(y,"IS_INSTANTIATING",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.isInstantiating"}),Object.defineProperty(y,"IS_INTERRUPTING",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.isInterrupting"}),Object.defineProperty(y,"EXTRA_CSS_CLASSES",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.extra.css.classes"}),Object.defineProperty(y,"MARKERS",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.markers"}),Object.defineProperty(y,"MESSAGE_FLOW_ICON",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.messageFlowIcon"});class w{}var N;Object.defineProperty(w,"ARROW_DASH",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.dash"}),function(e){e[e.STROKE_WIDTH_THIN=2]="STROKE_WIDTH_THIN",e[e.STROKE_WIDTH_THICK=5]="STROKE_WIDTH_THICK",e[e.SHAPE_ACTIVITY_BOTTOM_MARGIN=7]="SHAPE_ACTIVITY_BOTTOM_MARGIN",e[e.SHAPE_ACTIVITY_TOP_MARGIN=7]="SHAPE_ACTIVITY_TOP_MARGIN",e[e.SHAPE_ACTIVITY_LEFT_MARGIN=7]="SHAPE_ACTIVITY_LEFT_MARGIN",e[e.SHAPE_ACTIVITY_FROM_CENTER_MARGIN=7]="SHAPE_ACTIVITY_FROM_CENTER_MARGIN",e[e.SHAPE_ACTIVITY_MARKER_ICON_MARGIN=5]="SHAPE_ACTIVITY_MARKER_ICON_MARGIN",e[e.SHAPE_ACTIVITY_MARKER_ICON_SIZE=20]="SHAPE_ACTIVITY_MARKER_ICON_SIZE",e[e.POOL_LABEL_SIZE=30]="POOL_LABEL_SIZE",e.POOL_LABEL_FILL_COLOR="none",e[e.LANE_LABEL_SIZE=30]="LANE_LABEL_SIZE",e.LANE_LABEL_FILL_COLOR="none",e[e.TEXT_ANNOTATION_BORDER_LENGTH=10]="TEXT_ANNOTATION_BORDER_LENGTH",e.TEXT_ANNOTATION_FILL_COLOR="none",e.GROUP_FILL_COLOR="none",e.DEFAULT_FILL_COLOR="White",e.DEFAULT_STROKE_COLOR="Black",e.DEFAULT_FONT_FAMILY="Arial, Helvetica, sans-serif",e[e.DEFAULT_FONT_SIZE=11]="DEFAULT_FONT_SIZE",e.DEFAULT_FONT_COLOR="Black",e[e.DEFAULT_MARGIN=0]="DEFAULT_MARGIN",e[e.SHAPE_ARC_SIZE=20]="SHAPE_ARC_SIZE",e.DEFAULT_OVERLAY_FILL_COLOR="White",e[e.DEFAULT_OVERLAY_FILL_OPACITY=100]="DEFAULT_OVERLAY_FILL_OPACITY",e.DEFAULT_OVERLAY_STROKE_COLOR="Black",e[e.DEFAULT_OVERLAY_STROKE_WIDTH=1]="DEFAULT_OVERLAY_STROKE_WIDTH",e[e.DEFAULT_OVERLAY_FONT_SIZE=11]="DEFAULT_OVERLAY_FONT_SIZE",e.DEFAULT_OVERLAY_FONT_COLOR="Black",e.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR="White",e.MESSAGE_FLOW_MARKER_START_FILL_COLOR="White",e.MESSAGE_FLOW_MARKER_END_FILL_COLOR="White"}(N||(N={}));class P{static getFillColor(e){return _.mxUtils.getValue(e,_.mxConstants.STYLE_FILLCOLOR,N.DEFAULT_FILL_COLOR)}static getStrokeColor(e){return _.mxUtils.getValue(e,_.mxConstants.STYLE_STROKECOLOR,N.DEFAULT_STROKE_COLOR)}static getStrokeWidth(e){return _.mxUtils.getValue(e,_.mxConstants.STYLE_STROKEWIDTH,N.STROKE_WIDTH_THIN)}static getMargin(e){return _.mxUtils.getValue(e,_.mxConstants.STYLE_MARGIN,N.DEFAULT_MARGIN)}static getBpmnEventDefinitionKind(e){return _.mxUtils.getValue(e,y.EVENT_DEFINITION_KIND,u.NONE)}static getBpmnSubProcessKind(e){return _.mxUtils.getValue(e,y.SUB_PROCESS_KIND,void 0)}static getBpmnIsInterrupting(e){return _.mxUtils.getValue(e,y.IS_INTERRUPTING,void 0)}static getBpmnMarkers(e){return _.mxUtils.getValue(e,y.MARKERS,void 0)}static getBpmnIsInstantiating(e){return JSON.parse(_.mxUtils.getValue(e,y.IS_INSTANTIATING,!1))}static getBpmnIsInitiating(e){return _.mxUtils.getValue(e,y.IS_INITIATING,void 0)}static getBpmnIsParallelEventBasedGateway(e){return _.mxUtils.getValue(e,y.EVENT_BASED_GATEWAY_KIND,c.Exclusive)==c.Parallel}static getBpmnGlobalTaskKind(e){return _.mxUtils.getValue(e,y.GLOBAL_TASK_KIND,void 0)}}class R{constructor(e){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"specificFlowStyles",{enumerable:!0,configurable:!0,writable:!0,value:new F([[A.SEQUENCE_FLOW,e=>{e[_.mxConstants.STYLE_ENDARROW]=_.mxConstants.ARROW_BLOCK_THIN}],[A.MESSAGE_FLOW,e=>{e[_.mxConstants.STYLE_DASHED]=!0,e[_.mxConstants.STYLE_DASH_PATTERN]="8 5",e[_.mxConstants.STYLE_STARTARROW]=_.mxConstants.ARROW_OVAL,e[_.mxConstants.STYLE_STARTSIZE]=8,e[_.mxConstants.STYLE_STARTFILL]=!0,e[y.EDGE_START_FILL_COLOR]=N.MESSAGE_FLOW_MARKER_START_FILL_COLOR,e[_.mxConstants.STYLE_ENDARROW]=_.mxConstants.ARROW_BLOCK_THIN,e[_.mxConstants.STYLE_ENDFILL]=!0,e[y.EDGE_END_FILL_COLOR]=N.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[A.ASSOCIATION_FLOW,e=>{e[_.mxConstants.STYLE_DASHED]=!0,e[_.mxConstants.STYLE_DASH_PATTERN]="1 2",e[_.mxConstants.STYLE_ENDARROW]=_.mxConstants.ARROW_OPEN_THIN,e[_.mxConstants.STYLE_STARTARROW]=_.mxConstants.ARROW_OPEN_THIN,e[_.mxConstants.STYLE_STARTSIZE]=12}]])}),Object.defineProperty(this,"specificSequenceFlowStyles",{enumerable:!0,configurable:!0,writable:!0,value:new F([[L.DEFAULT,e=>{e[_.mxConstants.STYLE_STARTARROW]=w.ARROW_DASH}],[L.CONDITIONAL_FROM_ACTIVITY,e=>{e[_.mxConstants.STYLE_STARTARROW]=_.mxConstants.ARROW_DIAMOND_THIN,e[_.mxConstants.STYLE_STARTSIZE]=18,e[_.mxConstants.STYLE_STARTFILL]=!0,e[y.EDGE_START_FILL_COLOR]=N.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]])}),Object.defineProperty(this,"specificAssociationFlowStyles",{enumerable:!0,configurable:!0,writable:!0,value:new F([[I.NONE,e=>{e[_.mxConstants.STYLE_STARTARROW]=void 0,e[_.mxConstants.STYLE_ENDARROW]=void 0}],[I.ONE,e=>{e[_.mxConstants.STYLE_STARTARROW]=void 0}],[I.BOTH,e=>{}]])})}configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(e,t){this.getStylesheet().putCellStyle(e,t)}configureDefaultVertexStyle(){R.configureCommonDefaultStyle(this.getStylesheet().getDefaultVertexStyle())}configurePoolStyle(){const e={};e[_.mxConstants.STYLE_SHAPE]=_.mxConstants.SHAPE_SWIMLANE,e[_.mxConstants.STYLE_VERTICAL_ALIGN]=_.mxConstants.ALIGN_MIDDLE,e[_.mxConstants.STYLE_ALIGN]=_.mxConstants.ALIGN_CENTER,e[_.mxConstants.STYLE_STARTSIZE]=N.POOL_LABEL_SIZE,e[_.mxConstants.STYLE_FILLCOLOR]=N.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(a.POOL,e)}configureLaneStyle(){const e={};e[_.mxConstants.STYLE_SHAPE]=_.mxConstants.SHAPE_SWIMLANE,e[_.mxConstants.STYLE_VERTICAL_ALIGN]=_.mxConstants.ALIGN_MIDDLE,e[_.mxConstants.STYLE_ALIGN]=_.mxConstants.ALIGN_CENTER,e[_.mxConstants.STYLE_SWIMLANE_LINE]=0,e[_.mxConstants.STYLE_STARTSIZE]=N.LANE_LABEL_SIZE,e[_.mxConstants.STYLE_FILLCOLOR]=N.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(a.LANE,e)}configureEventStyles(){g.eventKinds().forEach((e=>{const t={};t[_.mxConstants.STYLE_SHAPE]=e,t[_.mxConstants.STYLE_PERIMETER]=_.mxPerimeter.EllipsePerimeter,t[_.mxConstants.STYLE_STROKEWIDTH]=e==a.EVENT_END?N.STROKE_WIDTH_THICK:N.STROKE_WIDTH_THIN,t[_.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=_.mxConstants.ALIGN_BOTTOM,this.putCellStyle(e,t)}))}configureTextAnnotationStyle(){const e={};e[_.mxConstants.STYLE_SHAPE]=a.TEXT_ANNOTATION,e[_.mxConstants.STYLE_VERTICAL_ALIGN]=_.mxConstants.ALIGN_MIDDLE,e[_.mxConstants.STYLE_ALIGN]=_.mxConstants.ALIGN_LEFT,e[_.mxConstants.STYLE_SPACING_LEFT]=5,e[_.mxConstants.STYLE_FILLCOLOR]=N.TEXT_ANNOTATION_FILL_COLOR,e[_.mxConstants.STYLE_STROKEWIDTH]=N.STROKE_WIDTH_THIN,this.putCellStyle(a.TEXT_ANNOTATION,e)}configureGroupStyle(){const e={};e[_.mxConstants.STYLE_ROUNDED]=!0,e[_.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,e[_.mxConstants.STYLE_ARCSIZE]=N.SHAPE_ARC_SIZE,e[_.mxConstants.STYLE_DASHED]=!0,e[_.mxConstants.STYLE_DASH_PATTERN]="7 4 1 4",e[_.mxConstants.STYLE_STROKEWIDTH]=N.STROKE_WIDTH_THIN,e[_.mxConstants.STYLE_FILLCOLOR]=N.GROUP_FILL_COLOR,e[_.mxConstants.STYLE_ALIGN]=_.mxConstants.ALIGN_CENTER,e[_.mxConstants.STYLE_VERTICAL_ALIGN]=_.mxConstants.ALIGN_TOP,this.putCellStyle(a.GROUP,e)}configureActivityStyles(){g.activityKinds().forEach((e=>{const t={};t[_.mxConstants.STYLE_SHAPE]=e,t[_.mxConstants.STYLE_VERTICAL_ALIGN]=_.mxConstants.ALIGN_MIDDLE,t[_.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,t[_.mxConstants.STYLE_ARCSIZE]=N.SHAPE_ARC_SIZE,t[_.mxConstants.STYLE_STROKEWIDTH]=e==a.CALL_ACTIVITY?N.STROKE_WIDTH_THICK:N.STROKE_WIDTH_THIN,this.putCellStyle(e,t)}))}configureGatewayStyles(){g.gatewayKinds().forEach((e=>{const t={};t[_.mxConstants.STYLE_SHAPE]=e,t[_.mxConstants.STYLE_PERIMETER]=_.mxPerimeter.RhombusPerimeter,t[_.mxConstants.STYLE_STROKEWIDTH]=N.STROKE_WIDTH_THIN,t[_.mxConstants.STYLE_VERTICAL_ALIGN]=_.mxConstants.ALIGN_TOP,t[_.mxConstants.STYLE_LABEL_POSITION]=_.mxConstants.ALIGN_LEFT,t[_.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=_.mxConstants.ALIGN_TOP,this.putCellStyle(e,t)}))}configureDefaultEdgeStyle(){const e=this.getStylesheet().getDefaultEdgeStyle();e[_.mxConstants.STYLE_SHAPE]=y.EDGE,e[_.mxConstants.STYLE_ENDSIZE]=12,e[_.mxConstants.STYLE_STROKEWIDTH]=1.5,e[_.mxConstants.STYLE_ROUNDED]=1,e[_.mxConstants.STYLE_ARCSIZE]=5,e[_.mxConstants.STYLE_VERTICAL_ALIGN]=_.mxConstants.ALIGN_BOTTOM,delete e[_.mxConstants.STYLE_ENDARROW],R.configureCommonDefaultStyle(e)}static configureCommonDefaultStyle(e){e[_.mxConstants.STYLE_FONTFAMILY]=N.DEFAULT_FONT_FAMILY,e[_.mxConstants.STYLE_FONTSIZE]=N.DEFAULT_FONT_SIZE,e[_.mxConstants.STYLE_FONTCOLOR]=N.DEFAULT_FONT_COLOR,e[_.mxConstants.STYLE_FILLCOLOR]=N.DEFAULT_FILL_COLOR,e[_.mxConstants.STYLE_STROKECOLOR]=N.DEFAULT_STROKE_COLOR,e[_.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=_.mxConstants.NONE,e[_.mxConstants.STYLE_WHITE_SPACE]="wrap"}configureEdgeStyles(e,t){e.forEach((e=>{const n={};t.get(e)(n),this.graph.getStylesheet().putCellStyle(e.toString(),n)}))}configureFlowStyles(){this.configureEdgeStyles(Object.values(A),this.specificFlowStyles),this.configureEdgeStyles(Object.values(L),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(I),this.specificAssociationFlowStyles)}}class F extends Map{get(e){var t;return null!==(t=super.get(e))&&void 0!==t?t:()=>{}}}class x{constructor({canvas:e,shapeConfig:t,iconConfig:n}){Object.defineProperty(this,"canvas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"iconOriginalSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scaleX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scaleY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"iconPaintingOriginX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"iconPaintingOriginY",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"shapeConfiguration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.canvas=e,this.shapeConfiguration=t,this.iconOriginalSize=n.originalSize;const i=n.ratioFromParent;if(i){const e=function(e,t,n,i){let s,o;e.height<e.width||e.height==e.width&&n.width<=n.height?(s=n.width,o=n.width*e.height/e.width):(s=n.height*e.width/e.height,o=n.height);const r=t.strokeWidth?2*(t.strokeWidth-1):0;return{width:s*i-r,height:o*i-r}}(this.iconOriginalSize,n.styleConfig,this.shapeConfiguration,i);this.scaleX=e.width/this.iconOriginalSize.width,this.scaleY=e.height/this.iconOriginalSize.height}else this.scaleX=1,this.scaleY=1;this.updateCanvasStyle(n.styleConfig),n.setIconOriginFunct(this)}setIconOriginToShapeTopLeftProportionally(e){const t=this.shapeConfiguration;this.iconPaintingOriginX=t.x+t.width/e,this.iconPaintingOriginY=t.y+t.height/e}setIconOriginToShapeTopLeft(e=N.SHAPE_ACTIVITY_TOP_MARGIN,t=N.SHAPE_ACTIVITY_LEFT_MARGIN){const n=this.shapeConfiguration;this.iconPaintingOriginX=n.x+t,this.iconPaintingOriginY=n.y+e}setIconOriginForIconCentered(){const e=this.shapeConfiguration;this.iconPaintingOriginX=e.x+(e.width-this.iconOriginalSize.width*this.scaleX)/2,this.iconPaintingOriginY=e.y+(e.height-this.iconOriginalSize.height*this.scaleY)/2}setIconOriginForIconBottomCentered(e=N.SHAPE_ACTIVITY_BOTTOM_MARGIN){const t=this.shapeConfiguration;this.iconPaintingOriginX=t.x+(t.width-this.iconOriginalSize.width*this.scaleX)/2,this.iconPaintingOriginY=t.y+(t.height-this.iconOriginalSize.height*this.scaleY-e)}setIconOriginForIconOnBottomLeft(e=N.SHAPE_ACTIVITY_BOTTOM_MARGIN,t=N.SHAPE_ACTIVITY_FROM_CENTER_MARGIN){const n=this.shapeConfiguration;this.iconPaintingOriginX=n.x+(n.width-this.iconOriginalSize.width*this.scaleX)/3-t,this.iconPaintingOriginY=n.y+(n.height-this.iconOriginalSize.height*this.scaleY-e)}translateIconOrigin(e,t){this.iconPaintingOriginX+=this.scaleX*e,this.iconPaintingOriginY+=this.scaleY*t}computeScaleFromOriginX(e){return this.iconPaintingOriginX+e*this.scaleX}computeScaleFromOriginY(e){return this.iconPaintingOriginY+e*this.scaleY}updateCanvasStyle({isFilled:e,strokeColor:t,fillColor:n,strokeWidth:i}){e?this.canvas.setFillColor(t):this.canvas.setFillColor(n),this.canvas.setStrokeWidth(i)}arcTo(e,t,n,i,s,o,r){this.canvas.arcTo(e*this.scaleX,t*this.scaleY,n,i,s,this.computeScaleFromOriginX(o),this.computeScaleFromOriginY(r))}begin(){this.canvas.begin()}close(){this.canvas.close()}curveTo(e,t,n,i,s,o){this.canvas.curveTo(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t),this.computeScaleFromOriginX(n),this.computeScaleFromOriginY(i),this.computeScaleFromOriginX(s),this.computeScaleFromOriginY(o))}fill(){this.canvas.fill()}fillAndStroke(){this.canvas.fillAndStroke()}setFillColor(e){this.canvas.setFillColor(e)}stroke(){this.canvas.stroke()}setStrokeColor(e){this.canvas.setStrokeColor(e)}setRoundLineJoin(){this.canvas.setLineJoin("round")}lineTo(e,t){this.canvas.lineTo(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t))}moveTo(e,t){this.canvas.moveTo(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t))}rect(e,t,n,i){this.canvas.rect(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t),n*this.scaleX,i*this.scaleY)}roundrect(e,t,n,i,s,o){this.canvas.roundrect(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t),n*this.scaleX,i*this.scaleY,s,o)}ellipse(e,t,n,i){this.canvas.ellipse(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t),n*this.scaleX,i*this.scaleY)}rotateOnIconCenter(e){const t=this.iconPaintingOriginX+this.iconOriginalSize.width/2*this.scaleX,n=this.iconPaintingOriginY+this.iconOriginalSize.height/2*this.scaleY;this.canvas.rotate(e,!1,!1,t,n)}}function D({canvas:e,x:t,y:n,width:i,height:s,shape:o,ratioFromParent:r,isFilled:a,iconStrokeWidth:l}){return null!=r||(r=.25),null!=a||(a=!1),null!=l||(l=0),{canvas:e,ratioFromParent:r,setIconOriginFunct:e=>e.setIconOriginForIconCentered(),shapeConfig:{x:t,y:n,width:i,height:s,strokeWidth:o.strokewidth||P.getStrokeWidth(o.style)},iconStyleConfig:{isFilled:a,fillColor:o.fill||P.getFillColor(o.style),strokeColor:o.stroke||P.getStrokeColor(o.style),strokeWidth:l,margin:P.getMargin(o.style)}}}class j{paintEmptyIcon(){}newBpmnCanvas({canvas:e,ratioFromParent:t,setIconOriginFunct:n,shapeConfig:i,iconStyleConfig:s},o){return new x({canvas:e,shapeConfig:i,iconConfig:{originalSize:o,styleConfig:s,ratioFromParent:t,setIconOriginFunct:n}})}paintEnvelopeIcon(e){const t={width:485.41,height:321.76},n=this.newBpmnCanvas(e,t),i=t.width,s=t.height;n.rect(0,0,i,s),n.fillAndStroke();const{iconStyleConfig:o}=e;o.isFilled&&n.setStrokeColor(o.fillColor),n.begin(),n.moveTo(0,0),n.lineTo(.5*i,.6*s),n.lineTo(i,0),n.moveTo(0,s),n.lineTo(i/3,.45*s),n.moveTo(i,s),n.lineTo(2*i/3,.45*s),n.stroke()}paintCircleIcon(e){const t={width:e.shapeConfig.width,height:e.shapeConfig.height},n=this.newBpmnCanvas(e,t),i=t.width,s=t.height;i>0&&s>0&&n.ellipse(0,0,i,s),e.iconStyleConfig.isFilled?n.fillAndStroke():n.stroke()}paintClockIcon(e){const t=this.newBpmnCanvas(e,{height:152,width:152});t.begin(),t.moveTo(184,60),t.curveTo(188.4,60,192,56.4,192,52),t.lineTo(192,48),t.curveTo(192,40,188.4,40,184,40),t.curveTo(179.6,40,176,43.6,176,48),t.lineTo(176,52),t.curveTo(176,56.4,179.6,60,184,60),t.close(),t.moveTo(184,308),t.curveTo(179.6,308,176,311.6,176,316),t.lineTo(176,320),t.curveTo(176,324.4,179.6,328,184,328),t.curveTo(188.4,328,192,324.4,192,320),t.lineTo(192,316),t.curveTo(192,311.6,188.4,308,184,308),t.close(),t.moveTo(52,176),t.lineTo(48,176),t.curveTo(43.6,176,40,179.6,40,184),t.curveTo(40,188.4,43.6,192,48,192),t.lineTo(52,192),t.curveTo(56.4,192,69,188.4,60,184),t.curveTo(60,179.6,56.4,176,52,176),t.close(),t.moveTo(320,176),t.lineTo(316,176),t.curveTo(311.6,176,308,179.6,308,184),t.curveTo(308,188.4,311.6,192,316,192),t.lineTo(320,192),t.curveTo(324.4,192,328,188.4,328,184),t.curveTo(328,179.6,324.4,176,320,176),t.moveTo(93.6,82.4),t.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),t.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),t.lineTo(85.2,96.4),t.curveTo(86.8,98,88.8,98.8,90.8,98.8),t.curveTo(92.8,98.8,94.4,98,96.4,96.4),t.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),t.lineTo(93.6,82.4),t.moveTo(85.2,271.6),t.lineTo(82.4,274.4),t.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),t.curveTo(84,287.2,86,288,88,288),t.curveTo(90,288,92,287.2,93.6,285.6),t.lineTo(96.4,282.8),t.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),t.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),t.moveTo(274.4,82.4),t.lineTo(271.6,85.2),t.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),t.curveTo(273.298,98,275.2,98.8,277.2,98.8),t.curveTo(279.2,98.8,281.2,98,282.8,96.4),t.lineTo(285.6,93.6),t.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),t.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),t.moveTo(192,180.8),t.lineTo(192,108),t.curveTo(192,103.6,188.4,100,184,100),t.curveTo(179.6,100,176,103.6,176,108),t.lineTo(176,184),t.curveTo(176,186,176.8,188,178.4,189.6),t.lineTo(266,277.2),t.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),t.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),t.curveTo(280.4,274,280.4,269.2,277.2,266),t.lineTo(192,180.8),t.moveTo(184,0),t.curveTo(82.4,0,0,82.4,0,184),t.curveTo(0,285.6,82.4,368,184,368),t.curveTo(285.6,368,368,285.6,368,184),t.curveTo(368,82.4,285.6,0,184,0),t.moveTo(184,352),t.curveTo(91.2,352,16,276.8,16,184),t.curveTo(16,91.2,91.2,16,184,16),t.curveTo(276.8,16,352,91.2,352,184),t.curveTo(352,276.8,276.8,352,184,352),t.fillAndStroke()}paintTriangleIcon(e){const t=this.newBpmnCanvas(e,{height:735,width:849});t.begin(),t.moveTo(497,55),t.lineTo(817,609),t.curveTo(849,665,808,735,744,735),t.lineTo(105,735),t.curveTo(40,735,0,665,32,609),t.lineTo(352,55),t.curveTo(384,0,465,0,497,55),t.close(),t.fillAndStroke()}paintUpArrowheadIcon(e){const t=this.newBpmnCanvas(e,{height:50,width:40});t.begin(),t.moveTo(0,49.5),t.lineTo(19.5,1),t.curveTo(19.75,.25,20,0,20.25,.25),t.lineTo(40,49.5),t.curveTo(40,49.5,39.75,50,39.6,49.75),t.lineTo(20,30),t.lineTo(.4,49.75),t.curveTo(.4,49.75,.25,50,0,49.5),t.close(),t.fillAndStroke()}paintDoubleLeftArrowheadsIcon(e){const t=this.newBpmnCanvas(e,{height:53.5,width:105});t.begin(),t.moveTo(91.4,0),t.curveTo(91.4,0,91.2,0,91,.2),t.lineTo(50,25),t.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),t.lineTo(46.4,0),t.curveTo(46.4,0,46.2,0,46,.2),t.lineTo(4.9,25),t.curveTo(2,26.2,0,27.3,4.9,28.5),t.lineTo(45.8,53),t.curveTo(46,53.3,46.2,53.5,46.4,53.5),t.lineTo(46.4,27),t.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),t.lineTo(90.8,53.3),t.curveTo(91,53.3,91.2,53.5,91.4,53.5),t.lineTo(91.4,0),t.close(),t.fillAndStroke()}drawCrossIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});return t.begin(),t.moveTo(.38,0),t.lineTo(.62,0),t.lineTo(.62,.38),t.lineTo(1,.38),t.lineTo(1,.62),t.lineTo(.62,.62),t.lineTo(.62,1),t.lineTo(.38,1),t.lineTo(.38,.62),t.lineTo(0,.62),t.lineTo(0,.38),t.lineTo(.38,.38),t.close(),t}paintListIcon(e){const t=this.newBpmnCanvas(e,{height:60,width:60});t.begin(),t.moveTo(0,0),t.lineTo(60,0),t.lineTo(60,60),t.lineTo(0,60),t.lineTo(0,0),t.close(),t.moveTo(5,5),t.lineTo(55,5),t.close(),t.moveTo(5,21.6),t.lineTo(55,21.6),t.close(),t.moveTo(5,38.3),t.lineTo(55,38.3),t.close(),t.moveTo(5,55),t.lineTo(55,55),t.close(),t.fillAndStroke()}paintXCrossIcon(e){const t=this.drawCrossIcon(e);t.rotateOnIconCenter(45),t.fillAndStroke()}paintPlusCrossIcon(e){this.drawCrossIcon(e).fillAndStroke()}paintPersonIcon(e){const t=this.newBpmnCanvas(Object.assign(Object.assign({},e),{iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:!0})}),{height:239.68,width:143.61});t.begin(),t.moveTo(124.31,150.29),t.lineTo(99.66,141.03),t.arcTo(6.43,6.43,0,0,1,95.51,135.03),t.lineTo(95.51,130.66),t.arcTo(47.75,47.75,0,0,0,119.51,89.25),t.lineTo(119.51,71.25),t.arcTo(47.62,47.62,0,0,0,101.18,33.64),t.arcTo(29.35,29.35,0,0,0,101.52,29.14),t.arcTo(29.68,29.68,0,0,0,42.17,29.14),t.arcTo(29.24,29.24,0,0,0,42.53,33.63),t.arcTo(47.65,47.65,0,0,0,24.14,71.23),t.lineTo(24.14,89.23),t.arcTo(47.7,47.7,0,0,0,48.19,130.63),t.lineTo(48.19,135.03),t.arcTo(6.43,6.43,0,0,1,44.03,141.03),t.lineTo(19.31,150.29),t.arcTo(29.81,29.81,0,0,0,.09,178.03),t.lineTo(.09,233.51),t.arcTo(5.63,5.63,0,1,0,11.34,233.51),t.lineTo(11.34,178.03),t.arcTo(18.19,18.19,0,0,1,11.57,175.17),t.lineTo(20.5,184.11),t.arcTo(12.32,12.32,0,0,1,24.14,192.89),t.lineTo(24.14,233.51),t.arcTo(5.63,5.63,0,1,0,35.39,233.51),t.lineTo(35.39,192.93),t.arcTo(23.5,23.5,0,0,0,28.46,176.2),t.lineTo(17.04,164.78),t.arcTo(18.34,18.34,0,0,1,23.29,160.78),t.lineTo(43.65,153.15),t.lineTo(66.22,175.72),t.lineTo(66.22,233.51),t.arcTo(5.63,5.63,0,1,0,77.47,233.51),t.lineTo(77.47,175.76),t.lineTo(100.04,153.19),t.lineTo(120.4,160.82),t.arcTo(18.39,18.39,0,0,1,126.65,164.82),t.lineTo(115.24,176.24),t.arcTo(23.5,23.5,0,0,0,108.31,192.93),t.lineTo(108.31,233.55),t.arcTo(5.63,5.63,0,1,0,119.56,233.55),t.lineTo(119.56,192.93),t.arcTo(12.35,12.35,0,0,1,123.19,184.15),t.lineTo(132.13,175.22),t.arcTo(18,18,0,0,1,132.36,178.08),t.lineTo(132.36,233.56),t.arcTo(5.63,5.63,0,0,0,143.61,233.56),t.lineTo(143.61,178.03),t.arcTo(29.81,29.81,0,0,0,124.31,150.29),t.close(),t.moveTo(71.85,10.72),t.arcTo(18.46,18.46,0,0,1,90.17,27.18),t.arcTo(47.68,47.68,0,0,0,53.53,27.18),t.arcTo(18.44,18.44,0,0,1,71.85,10.72),t.close(),t.moveTo(35.39,71.23),t.arcTo(36.46,36.46,0,0,1,108.31,71.23),t.lineTo(108.31,77.4),t.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),t.arcTo(5.62,5.62,0,0,0,48.78,62.71),t.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),t.close(),t.moveTo(35.39,89.23),t.lineTo(35.39,87.08),t.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),t.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),t.lineTo(108.31,89.24),t.arcTo(36.46,36.46,0,1,1,35.39,89.24),t.close(),t.moveTo(71.85,165.45),t.lineTo(54.06,147.69),t.arcTo(17.7,17.7,0,0,0,59.43,135.32),t.arcTo(47.57,47.57,0,0,0,84.27,135.32),t.arcTo(17.7,17.7,0,0,0,89.64,147.69),t.close(),t.fill()}paintGearIcon(e){const t=this.newBpmnCanvas(e,{height:100,width:100});j.paintGearIconBackground(t),t.translateIconOrigin(14,14),j.paintGearIconForeground(t)}static paintGearIconBackground(e){e.begin(),e.moveTo(2.06,24.62),e.lineTo(10.17,30.95),e.lineTo(9.29,37.73),e.lineTo(0,41.42),e.lineTo(2.95,54.24),e.lineTo(13.41,52.92),e.lineTo(17.39,58.52),e.lineTo(13.56,67.66),e.lineTo(24.47,74.44),e.lineTo(30.81,66.33),e.lineTo(37.88,67.21),e.lineTo(41.57,76.5),e.lineTo(54.24,73.55),e.lineTo(53.06,62.94),e.lineTo(58.52,58.52),e.lineTo(67.21,63.09),e.lineTo(74.58,51.88),e.lineTo(66.03,45.25),e.lineTo(66.92,38.62),e.lineTo(76.5,34.93),e.lineTo(73.7,22.26),e.lineTo(62.64,23.44),e.lineTo(58.81,18.42),e.lineTo(62.79,8.7),e.lineTo(51.74,2.21),e.lineTo(44.81,10.47),e.lineTo(38.03,9.43),e.lineTo(33.75,0),e.lineTo(21.52,3.24),e.lineTo(22.7,13.56),e.lineTo(18.13,17.54),e.lineTo(8.7,13.56),e.close();j.paintGearInnerCircle(e,24.8,39)}static paintGearIconForeground(e){e.begin(),e.moveTo(16.46,41.42),e.lineTo(24.57,47.75),e.lineTo(23.69,54.53),e.lineTo(14.4,58.22),e.lineTo(17.35,71.04),e.lineTo(27.81,69.72),e.lineTo(31.79,75.32),e.lineTo(27.96,84.46),e.lineTo(38.87,91.24),e.lineTo(45.21,83.13),e.lineTo(52.28,84.01),e.lineTo(55.97,93.3),e.lineTo(68.64,90.35),e.lineTo(67.46,79.74),e.lineTo(72.92,75.32),e.lineTo(81.61,79.89),e.lineTo(88.98,68.68),e.lineTo(80.43,62.05),e.lineTo(81.32,55.42),e.lineTo(90.9,51.73),e.lineTo(88.1,39.06),e.lineTo(77.04,40.24),e.lineTo(73.21,35.22),e.lineTo(77.19,25.5),e.lineTo(66.14,19.01),e.lineTo(59.21,27.27),e.lineTo(52.43,26.23),e.lineTo(48.15,16.8),e.lineTo(35.92,20.04),e.lineTo(37.1,30.36),e.lineTo(32.53,34.34),e.lineTo(23.1,30.36),e.close();j.paintGearInnerCircle(e,39.2,55.8),e.begin(),j.paintGearInnerCircle(e,39.2,55.8)}static paintGearInnerCircle(e,t,n){const i=13.5;e.moveTo(t,n),e.arcTo(i,i,0,1,1,t+27,n),e.arcTo(i,i,0,0,1,t,n),e.close(),e.fillAndStroke()}paintExpandIcon(e){const t={width:16,height:16},n=this.newBpmnCanvas(e,t),i=t.width,s=t.height;n.roundrect(0,0,i,s,2,2),n.stroke(),n.begin(),n.moveTo(i/2,s/4),n.lineTo(i/2,3*s/4),n.close(),n.moveTo(i/4,s/2),n.lineTo(3*i/4,s/2),n.close(),n.fillAndStroke()}paintLoopIcon(e){const{iconStyleConfig:t}=e;t.fillColor=t.strokeColor;const n=this.newBpmnCanvas(e,{width:22.49,height:21.62});n.begin(),n.moveTo(5.5,19.08),n.arcTo(8,8,0,1,1,10.5,21.08),n.stroke(),n.begin(),n.moveTo(7.5,14.08),n.lineTo(5.75,19.08),n.lineTo(0,17.08),n.close(),n.fillAndStroke()}paintSequentialMultiInstanceIcon(e){const t={width:16,height:16},n=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:s}=e;i.setFillColor(s.strokeColor);const o=t.width,r=t.height/5;n.rect(0,0,o,r),n.fill(),n.rect(0,2*r,o,r),n.fill(),n.rect(0,4*r,o,r),n.fill()}paintParallelMultiInstanceIcon(e){const t={width:16,height:16},n=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:s}=e;i.setFillColor(s.strokeColor);const o=t.width/5,r=t.height;n.begin(),n.rect(0,0,o,r),n.fill(),n.rect(2*o,0,o,r),n.fill(),n.rect(4*o,0,o,r),n.fill()}paintRightArrowIcon(e){const t=this.newBpmnCanvas(e,{width:512,height:415.23});t.setRoundLineJoin(),t.begin(),t.moveTo(512,207.61),t.lineTo(304.38,0),t.lineTo(304.38,135.39),t.lineTo(0,135.39),t.lineTo(0,279.84),t.lineTo(304.38,279.84),t.lineTo(304.38,415.23),t.lineTo(512,207.61),t.close(),t.fillAndStroke()}paintErrorIcon(e){const t=this.newBpmnCanvas(e,{width:72.44,height:71.82});t.begin(),t.moveTo(0,53.32),t.lineTo(19.48,0),t.lineTo(19.48,0),t.lineTo(50.85,40.07),t.lineTo(72.44,18.21),t.lineTo(53.12,71.82),t.lineTo(22.5,31.37),t.close(),t.fillAndStroke()}paintHandIcon(e){const t=this.newBpmnCanvas(e,{width:343.65,height:354.12});t.begin(),t.moveTo(231.66,336.39),t.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),t.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),t.lineTo(146.33,248.39),t.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),t.curveTo(275.75,283.38,297.25,288,301.42,267.77),t.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),t.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),t.lineTo(165.2,194.8),t.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),t.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),t.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),t.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),t.lineTo(169.35,138.97),t.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),t.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),t.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),t.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),t.lineTo(127.61,81.87),t.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),t.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),t.curveTo(143.83,0,124.08,14.49,124.08,14.49),t.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),t.lineTo(0,251.94),t.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),t.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),t.fillAndStroke()}paintScriptIcon(e){e.iconStyleConfig.fillColor=e.iconStyleConfig.strokeColor;const t=this.newBpmnCanvas(e,{width:458.75,height:461.64});t.begin(),t.moveTo(67.85,.57),t.curveTo(50.73,0,33.26,8.86,22.35,18.84),t.curveTo(8.11,32.15,0,50.77,0,70.26),t.curveTo(0,73.15,0,87.59,0,113.6),t.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),t.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),t.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),t.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),t.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),t.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),t.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),t.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),t.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),t.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),t.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),t.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),t.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),t.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),t.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),t.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),t.curveTo(389.09,14.11,366.95,.59,341.75,.59),t.curveTo(286.97,.59,122.63,.57,67.85,.57),t.close(),t.moveTo(85.04,72.68),t.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),t.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),t.curveTo(55.8,44.28,59.84,41,73.82,41),t.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),t.close(),t.moveTo(364.94,52.9),t.curveTo(370,61.11,373.9,76.44,377.38,93.51),t.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),t.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),t.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),t.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),t.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),t.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),t.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),t.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),t.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),t.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),t.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),t.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),t.close(),t.moveTo(409.96,399.48),t.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),t.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),t.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),t.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),t.close(),t.fill(),t.begin(),t.moveTo(182.1,131.2),t.lineTo(182.1,151.68),t.lineTo(321.89,151.68),t.lineTo(321.89,131.2),t.lineTo(182.1,131.2),t.close(),t.moveTo(162.25,251.09),t.lineTo(162.25,271.49),t.lineTo(301.96,271.49),t.lineTo(301.96,251.09),t.lineTo(162.25,251.09),t.close(),t.fill()}paintTableIcon(e){const t=this.newBpmnCanvas(e,{width:640,height:640});t.begin(),t.moveTo(.19,.1),t.lineTo(298.78,.1),t.lineTo(298.78,198.88),t.lineTo(.19,198.88),t.lineTo(.19,.1),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,48.88),t.lineTo(98.78,48.88),t.lineTo(98.78,198.88),t.lineTo(0,198.88),t.lineTo(0,48.88),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(1.09,122.69),t.lineTo(298.78,122.69),t.close(),t.fillAndStroke(),t.setFillColor(e.iconStyleConfig.strokeColor),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke()}paintPentagon(e){const t=this.newBpmnCanvas(e,{width:16,height:16});t.begin(),t.moveTo(16,6.5),t.lineTo(8,0),t.lineTo(0,6.5),t.lineTo(3,16),t.lineTo(13,16),t.lineTo(16,6.5),t.lineTo(8,0),t.stroke()}}class M{static get(){return this.instance}static set(e){this.instance=e}}Object.defineProperty(M,"instance",{enumerable:!0,configurable:!0,writable:!0,value:new j});class B extends _.mxEllipse{constructor(){super(void 0,void 0,void 0),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:M.get()}),Object.defineProperty(this,"iconPainters",{enumerable:!0,configurable:!0,writable:!0,value:new Map([[u.MESSAGE,e=>this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},e),{ratioFromParent:.5}))],[u.TERMINATE,e=>this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},e),{ratioFromParent:.6}))],[u.TIMER,e=>this.iconPainter.paintClockIcon(Object.assign(Object.assign({},e),{setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(5)}))],[u.SIGNAL,e=>this.iconPainter.paintTriangleIcon(Object.assign(Object.assign({},e),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:N.STROKE_WIDTH_THIN.valueOf()}),setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(4)}))],[u.LINK,e=>this.iconPainter.paintRightArrowIcon(Object.assign(Object.assign({},e),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:1.5})}))],[u.ERROR,e=>this.iconPainter.paintErrorIcon(Object.assign(Object.assign({},e),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:1.5})}))],[u.COMPENSATION,e=>this.iconPainter.paintDoubleLeftArrowheadsIcon(Object.assign(Object.assign({},e),{ratioFromParent:.7,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:1.5})}))],[u.CANCEL,e=>this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},e),{ratioFromParent:.78}))],[u.ESCALATION,e=>this.iconPainter.paintUpArrowheadIcon(Object.assign(Object.assign({},e),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:N.STROKE_WIDTH_THIN.valueOf()})}))],[u.CONDITIONAL,e=>this.iconPainter.paintListIcon(Object.assign(Object.assign({},e),{ratioFromParent:.6,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:1.5})}))]])}),Object.defineProperty(this,"withFilledIcon",{enumerable:!0,configurable:!0,writable:!0,value:!1})}paintVertexShape(e,t,n,i,s){const o=D({canvas:e,x:t,y:n,width:i,height:s,shape:this,isFilled:this.withFilledIcon});B.setDashedOuterShapePattern(o,P.getBpmnIsInterrupting(this.style)),this.paintOuterShape(o),B.restoreOriginalOuterShapePattern(o),this.paintInnerShape(o)}paintOuterShape({canvas:e,shapeConfig:{x:t,y:n,width:i,height:s}}){super.paintVertexShape(e,t,n,i,s)}paintInnerShape(e){(this.iconPainters.get(P.getBpmnEventDefinitionKind(this.style))||(()=>this.iconPainter.paintEmptyIcon()))(e)}static setDashedOuterShapePattern(e,t){e.canvas.save(),"false"===t&&(e.canvas.setDashed(!0,!1),e.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(e){e.canvas.restore()}}class k extends B{constructor(){super(),this.withFilledIcon=!0}}class G extends B{paintOuterShape({canvas:e,shapeConfig:{x:t,y:n,width:i,height:s,strokeWidth:o}}){e.ellipse(t,n,i,s),e.fillAndStroke();const r=1.5*o;e.ellipse(.02*i+r+t,.02*s+r+n,.96*i-2*r,.96*s-2*r),e.stroke()}}class Y extends G{constructor(){super(),this.withFilledIcon=!0}}class V extends _.mxRhombus{constructor(){super(...arguments),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:M.get()})}paintVertexShape(e,t,n,i,s){const o=D({canvas:e,x:t,y:n,width:i,height:s,shape:this});this.paintOuterShape(o),this.paintInnerShape(o)}paintOuterShape({canvas:e,shapeConfig:{x:t,y:n,width:i,height:s}}){super.paintVertexShape(e,t,n,i,s)}}class K extends V{paintInnerShape(e){this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},e),{iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:!0}),ratioFromParent:.5}))}}class H extends V{paintInnerShape(e){this.iconPainter.paintPlusCrossIcon(Object.assign(Object.assign({},e),{iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:!0}),ratioFromParent:.5}))}}class U extends V{paintInnerShape(e){this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},e),{ratioFromParent:.62,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:!1,strokeWidth:N.STROKE_WIDTH_THICK.valueOf()})}))}}class W extends V{paintInnerShape(e){e=Object.assign(Object.assign({},e),{iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:1})}),this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},e),{ratioFromParent:.55})),P.getBpmnIsInstantiating(this.style)||this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},e),{ratioFromParent:.45}));const t=Object.assign(Object.assign({},e),{ratioFromParent:.3});P.getBpmnIsParallelEventBasedGateway(this.style)?this.iconPainter.paintPlusCrossIcon(t):this.iconPainter.paintPentagon(t)}}const z=[h.LOOP,h.MULTI_INSTANCE_PARALLEL,h.MULTI_INSTANCE_SEQUENTIAL,h.COMPENSATION,h.EXPAND,h.ADHOC];function X(e,t){M.get().paintEnvelopeIcon(Object.assign(Object.assign({},e),{setIconOriginFunct:e=>e.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:t})}))}class Z extends _.mxRectangleShape{constructor(){super(void 0,void 0,void 0),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:M.get()}),this.isRounded=!0}paintForeground(e,t,n,i,s){super.paintForeground(e,t,n,i,s),this.paintMarkerIcons(D({canvas:e,x:t,y:n,width:i,height:s,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(e){const t=P.getBpmnMarkers(this.style);t&&function(e){const t=z.filter((t=>e.includes(t)));return e.filter((e=>!t.includes(e))).forEach((e=>t.push(e))),t}(t.split(",")).forEach(((t,n,i)=>{switch((e=Object.assign(Object.assign({},e),{setIconOriginFunct:this.getMarkerIconOriginFunction(i.length,n+1)})).canvas.save(),t){case h.LOOP:this.iconPainter.paintLoopIcon(e);break;case h.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(e);break;case h.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(e);break;case h.EXPAND:this.iconPainter.paintExpandIcon(e)}e.canvas.restore()}))}getMarkerIconOriginFunction(e,t){let n;return n=1===e?e=>e.setIconOriginForIconBottomCentered():e=>{e.setIconOriginForIconBottomCentered();const n=Math.pow(-1,t)*(N.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+N.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);e.translateIconOrigin(n,0)},n}}class q extends Z{paintForeground(e,t,n,i,s){super.paintForeground(e,t,n,i,s),this.paintTaskIcon(D({canvas:e,x:t,y:n,width:i,height:s,shape:this}))}}class $ extends q{paintTaskIcon(e){this.iconPainter.paintEmptyIcon()}}class Q extends q{paintTaskIcon(e){this.iconPainter.paintGearIcon(Object.assign(Object.assign({},e),{setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}))}}class J extends q{paintTaskIcon(e){this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},e),{setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}))}}class ee extends q{paintTaskIcon(e){if(!P.getBpmnIsInstantiating(this.style))return void X(e,!1);const t=Object.assign(Object.assign({},e.shapeConfig),{width:20,height:20});this.iconPainter.paintCircleIcon({canvas:e.canvas,shapeConfig:t,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:!1}),ratioFromParent:void 0,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeft(4,4)}),t.x+=4,t.y+=4,this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},e),{shapeConfig:t,ratioFromParent:.65,setIconOriginFunct:e=>e.setIconOriginForIconCentered()}))}}class te extends q{paintTaskIcon(e){X(e,!0)}}class ne extends q{paintTaskIcon(e){this.iconPainter.paintHandIcon(Object.assign(Object.assign({},e),{ratioFromParent:.18,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}))}}class ie extends q{paintTaskIcon(e){this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},e),{ratioFromParent:.22,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}))}}class se extends Z{paintForeground(e,t,n,i,s){super.paintForeground(e,t,n,i,s);const o=D({canvas:e,x:t,y:n,width:i,height:s,shape:this});switch(P.getBpmnGlobalTaskKind(this.style)){case a.GLOBAL_TASK_MANUAL:this.iconPainter.paintHandIcon(Object.assign(Object.assign({},o),{ratioFromParent:.18,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}));break;case a.GLOBAL_TASK_SCRIPT:this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},o),{ratioFromParent:.22,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}));break;case a.GLOBAL_TASK_USER:this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},o),{setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}));break;case a.GLOBAL_TASK_BUSINESS_RULE:this.iconPainter.paintTableIcon(Object.assign(Object.assign({},o),{ratioFromParent:.6,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(15)}));break;case a.GLOBAL_TASK:default:this.iconPainter.paintEmptyIcon()}}}class oe extends Z{paintBackground(e,t,n,i,s){const o=P.getBpmnSubProcessKind(this.style);e.save(),o===d.EVENT&&(e.setDashed(!0,!1),e.setDashPattern("1 2")),super.paintBackground(e,t,n,i,s),e.restore()}}class re extends q{paintTaskIcon(e){this.iconPainter.paintTableIcon(Object.assign(Object.assign({},e),{ratioFromParent:.6,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(15)}))}}class ae extends _.mxRectangleShape{paintForeground(e,t,n,i,s){e.begin(),e.moveTo(t+N.TEXT_ANNOTATION_BORDER_LENGTH,n),e.lineTo(t,n),e.lineTo(t,n+s),e.lineTo(t+N.TEXT_ANNOTATION_BORDER_LENGTH,n+s),e.stroke()}paintBackground(e,t,n,i,s){e.save(),e.setStrokeColor("none"),super.paintBackground(e,t,n,i,s),e.restore()}}class le extends _.mxRectangleShape{constructor(e,t,n,i){super(e,t,n,i),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:M.get()})}paintVertexShape(e,t,n,i,s){const o=D({canvas:e,x:t,y:n,width:i,height:s,shape:this,ratioFromParent:1,isFilled:P.getBpmnIsInitiating(this.style)===C.NON_INITIATING});this.iconPainter.paintEnvelopeIcon(o)}}function ce(e,t){return function(e,t){const n=[],i=e.split(";"),s=i[0].replace(/shape=bpmn./g,""),o=new Map;o.set("bpmn-type-activity",g.isActivity(s)),o.set("bpmn-type-container",g.isPoolOrLane(s)),o.set("bpmn-type-event",g.isEvent(s)),o.set("bpmn-type-flow",function(e){return Object.values(A).map((e=>e)).includes(e)}(s)),o.set("bpmn-type-gateway",g.isGateway(s)),o.set("bpmn-type-task",g.isTask(s)),[...o].filter((([,e])=>e)).forEach((([e])=>n.push(e))),n.push(ue(s)),i.map((e=>{const t=e.split("=");return[t[0],t[1]]})).forEach((([e,t])=>{switch(e){case y.EVENT_DEFINITION_KIND:n.push(`bpmn-event-def-${t}`);break;case y.EVENT_BASED_GATEWAY_KIND:n.push(`bpmn-gateway-kind-${t.toLowerCase()}`);break;case y.IS_INITIATING:n.push(t==C.NON_INITIATING?"bpmn-icon-non-initiating":"bpmn-icon-initiating");break;case y.SUB_PROCESS_KIND:n.push(`bpmn-sub-process-${t.toLowerCase()}`);break;case y.GLOBAL_TASK_KIND:n.push(ue(t))}})),t&&n.push("bpmn-label");return n}(e.style,t)}function ue(e){return e?"bpmn-"+e.replace(/([A-Z])/g,(e=>"-"+e[0].toLowerCase())):""}class he extends _.mxCellOverlay{constructor(e,t){super(null,"",t.position.horizontalAlign,t.position.verticalAlign,null,"default"),Object.defineProperty(this,"label",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.style=t.style}getBounds(e){const t=e.view.graph.getModel().isEdge(e.cell),n=e.view.scale;let i;return t?i=this.computeEdgeBounds(e):(i=new _.mxPoint,this.align==_.mxConstants.ALIGN_LEFT?i.x=e.x:this.align==_.mxConstants.ALIGN_CENTER?i.x=e.x+e.width/2:i.x=e.x+e.width,this.verticalAlign==_.mxConstants.ALIGN_TOP?i.y=e.y:this.verticalAlign==_.mxConstants.ALIGN_MIDDLE?i.y=e.y+e.height/2:i.y=e.y+e.height),new _.mxRectangle(Math.round(i.x-(0*this.defaultOverlap-this.offset.x)*n),Math.round(i.y-(0*this.defaultOverlap-this.offset.y)*n),0*n,0*n)}computeEdgeBounds(e){const t=e.absolutePoints;if(this.align==_.mxConstants.ALIGN_LEFT)return t[0];if(this.align==_.mxConstants.ALIGN_CENTER){if(t.length%2==1)return t[Math.floor(t.length/2)];{const e=t.length/2,n=t[e-1],i=t[e];return new _.mxPoint(n.x+(i.x-n.x)/2,n.y+(i.y-n.y)/2)}}return t[t.length-1]}}class de extends _.mxText{constructor(e,t,n){super(e,t,void 0,void 0,n.font.color,void 0,n.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,n.fill.color,n.stroke.color),this.fillOpacity=n.fill.opacity,this.strokewidth=n.stroke.width}}class Te extends _.mxConnector{constructor(e,t,n){super(e,t,n)}paintEdgeShape(e,t){const n=this.createMarker(e,t,!0),i=this.createMarker(e,t,!1);this.paintEdgeLine(e,t),e.setShadow(!1),e.setDashed(!1,!1),null!=n&&(e.setFillColor(_.mxUtils.getValue(this.style,y.EDGE_START_FILL_COLOR,this.stroke)),n()),null!=i&&(e.setFillColor(_.mxUtils.getValue(this.style,y.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(e,t){const n=function(e){return e instanceof _.mxSvgCanvas2D?e.pointerEventsValue:null}(e);ge(e,"stroke"),this.paintLine(e,t,this.isRounded),ge(e,n)}}function ge(e,t){e instanceof _.mxSvgCanvas2D&&(e.pointerEventsValue=t)}class pe{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes(),this.initMxCellRendererCreateCellOverlays()}registerShapes(){_.mxCellRenderer.registerShape(a.EVENT_END,k),_.mxCellRenderer.registerShape(a.EVENT_START,B),_.mxCellRenderer.registerShape(a.EVENT_INTERMEDIATE_THROW,Y),_.mxCellRenderer.registerShape(a.EVENT_INTERMEDIATE_CATCH,G),_.mxCellRenderer.registerShape(a.EVENT_BOUNDARY,G),_.mxCellRenderer.registerShape(a.GATEWAY_EVENT_BASED,W),_.mxCellRenderer.registerShape(a.GATEWAY_EXCLUSIVE,K),_.mxCellRenderer.registerShape(a.GATEWAY_INCLUSIVE,U),_.mxCellRenderer.registerShape(a.GATEWAY_PARALLEL,H),_.mxCellRenderer.registerShape(a.SUB_PROCESS,oe),_.mxCellRenderer.registerShape(a.CALL_ACTIVITY,se),_.mxCellRenderer.registerShape(a.TASK,$),_.mxCellRenderer.registerShape(a.TASK_SERVICE,Q),_.mxCellRenderer.registerShape(a.TASK_USER,J),_.mxCellRenderer.registerShape(a.TASK_RECEIVE,ee),_.mxCellRenderer.registerShape(a.TASK_SEND,te),_.mxCellRenderer.regis