From 67209f999a0c55553671bd547801c7f71a4f1310 Mon Sep 17 00:00:00 2001 From: process-analytics-bot <62586190+process-analytics-bot@users.noreply.github.com> Date: Mon, 22 Mar 2021 17:11:07 +0100 Subject: [PATCH] [INFRA] Update BPMN Visualization version to 0.13.0 (#155) --- demo/index.es.js | 2 +- demo/overlays.html | 25 +++++++ demo/static/css/tailwind.css | 2 +- demo/static/js/elements-identification.js | 75 ++++++++++++++----- demo/static/js/overlays.js | 47 ++++++++++++ .../growing-sequence-flow/index.html | 2 +- .../running-dashed-message-flow/index.html | 2 +- .../custom-colors/index.html | 2 +- .../custom-bpmn-theme/custom-fonts/index.html | 2 +- .../custom-user-task-icon/index.html | 2 +- .../hacktoberfest-diagram/index.html | 2 +- .../apply-css-classes/index.html | 2 +- .../javascript-tooltip-and-popover/index.html | 2 +- .../popover-static/index.html | 2 +- .../select-elements-by-bpmn-kind/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../diagram-fit-after-load/index.html | 2 +- .../diagram-fit-on-load/index.html | 2 +- .../diagram-navigation/index.html | 2 +- .../01-getting-started/README.md | 4 +- .../01-getting-started/index.html | 4 +- .../load-local-bpmn-diagrams/index.html | 2 +- .../load-remote-bpmn-diagrams/index.html | 2 +- examples/misc/compare-with-bpmn-js/index.html | 2 +- .../index.html | 2 +- .../package.json | 2 +- 28 files changed, 155 insertions(+), 46 deletions(-) create mode 100644 demo/overlays.html create mode 100644 demo/static/js/overlays.js diff --git a/demo/index.es.js b/demo/index.es.js index 9feaa869..fcc22327 100644 --- a/demo/index.es.js +++ b/demo/index.es.js @@ -1 +1 @@ -var ShapeBpmnCallActivityKind,ShapeBpmnElementKind,ShapeBpmnEventBasedGatewayKind,ShapeBpmnEventKind;!function(t){t.CALLING_PROCESS="process"}(ShapeBpmnCallActivityKind||(ShapeBpmnCallActivityKind={})),function(t){t.LANE="lane",t.POOL="pool",t.CALL_ACTIVITY="callActivity",t.SUB_PROCESS="subProcess",t.TASK="task",t.TASK_USER="userTask",t.TASK_SERVICE="serviceTask",t.TASK_RECEIVE="receiveTask",t.TASK_SEND="sendTask",t.TASK_MANUAL="manualTask",t.TASK_SCRIPT="scriptTask",t.TASK_BUSINESS_RULE="businessRuleTask",t.TEXT_ANNOTATION="textAnnotation",t.GATEWAY_PARALLEL="parallelGateway",t.GATEWAY_EXCLUSIVE="exclusiveGateway",t.GATEWAY_INCLUSIVE="inclusiveGateway",t.GATEWAY_EVENT_BASED="eventBasedGateway",t.EVENT_START="startEvent",t.EVENT_END="endEvent",t.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",t.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",t.EVENT_BOUNDARY="boundaryEvent"}(ShapeBpmnElementKind||(ShapeBpmnElementKind={})),function(t){t.Exclusive="Exclusive",t.None="None",t.Parallel="Parallel"}(ShapeBpmnEventBasedGatewayKind||(ShapeBpmnEventBasedGatewayKind={})),function(t){t.NONE="none",t.TERMINATE="terminate",t.CANCEL="cancel",t.COMPENSATION="compensate",t.CONDITIONAL="conditional",t.ERROR="error",t.ESCALATION="escalation",t.LINK="link",t.MESSAGE="message",t.SIGNAL="signal",t.TIMER="timer"}(ShapeBpmnEventKind||(ShapeBpmnEventKind={}));const bpmnEventKinds=Object.values(ShapeBpmnEventKind).filter(t=>t!=ShapeBpmnEventKind.NONE),supportedBpmnEventKinds=[ShapeBpmnEventKind.TERMINATE,ShapeBpmnEventKind.TIMER,ShapeBpmnEventKind.MESSAGE,ShapeBpmnEventKind.SIGNAL,ShapeBpmnEventKind.LINK,ShapeBpmnEventKind.ERROR,ShapeBpmnEventKind.COMPENSATION,ShapeBpmnEventKind.CANCEL,ShapeBpmnEventKind.CONDITIONAL,ShapeBpmnEventKind.ESCALATION];var ShapeBpmnMarkerKind,ShapeBpmnSubProcessKind,SequenceFlowKind;!function(t){t.ADHOC="adhoc",t.COMPENSATION="compensation",t.EXPAND="expand",t.LOOP="loop",t.MULTI_INSTANCE_PARALLEL="parallel multi instance",t.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance"}(ShapeBpmnMarkerKind||(ShapeBpmnMarkerKind={})),function(t){t.EMBEDDED="embedded",t.EVENT="event"}(ShapeBpmnSubProcessKind||(ShapeBpmnSubProcessKind={}));class ShapeUtil{static filterKind(t,e=!1){return Object.values(ShapeBpmnElementKind).filter(i=>e?i.endsWith(t)||i.toLowerCase().endsWith(t.toLowerCase()):i.endsWith(t))}static isEvent(t){return this.EVENT_KINDS.includes(t)}static isCallActivity(t){return ShapeBpmnElementKind.CALL_ACTIVITY===t}static isSubProcess(t){return ShapeBpmnElementKind.SUB_PROCESS===t}static isBoundaryEvent(t){return ShapeBpmnElementKind.EVENT_BOUNDARY===t}static isStartEvent(t){return ShapeBpmnElementKind.EVENT_START===t}static canHaveNoneEvent(t){return ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW===t||ShapeBpmnElementKind.EVENT_END===t||ShapeBpmnElementKind.EVENT_START===t}static isActivity(t){return this.ACTIVITY_KINDS.includes(t)}static isWithDefaultSequenceFlow(t){return this.FLOWNODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS.includes(t)}static topLevelBpmnEventKinds(){return this.EVENT_KINDS}static activityKinds(){return this.ACTIVITY_KINDS}static taskKinds(){return this.TASK_KINDS}static gatewayKinds(){return this.GATEWAY_KINDS}static flowNodeKinds(){return Object.values(ShapeBpmnElementKind).filter(t=>!ShapeUtil.isPoolOrLane(t))}static isPoolOrLane(t){return t==ShapeBpmnElementKind.POOL||t==ShapeBpmnElementKind.LANE}}ShapeUtil.EVENT_KINDS=ShapeUtil.filterKind("Event"),ShapeUtil.GATEWAY_KINDS=ShapeUtil.filterKind("Gateway"),ShapeUtil.TASK_KINDS=ShapeUtil.filterKind("Task",!0),ShapeUtil.ACTIVITY_KINDS=[...ShapeUtil.TASK_KINDS,ShapeBpmnElementKind.CALL_ACTIVITY,ShapeBpmnElementKind.SUB_PROCESS],ShapeUtil.FLOWNODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS=[...ShapeUtil.ACTIVITY_KINDS,ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,ShapeBpmnElementKind.GATEWAY_INCLUSIVE],function(t){t.NORMAL="normal",t.DEFAULT="default",t.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",t.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway"}(SequenceFlowKind||(SequenceFlowKind={}));var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t,e){return t(e={exports:{}},e.exports),e.exports}function getCjsExportFromNamespace(t){return t&&t.default||t}var build=createCommonjsModule((function(module){!function(t,e){module.exports?module.exports=e():t.mxgraph=e()}(commonjsGlobal,(function(){return function(opts){for(var name in opts)this[name]=opts[name];var __mxOutput={},mxClient={VERSION:"4.1.0",IS_IE:navigator.userAgent.indexOf("MSIE")>=0,IS_IE6:navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:navigator.userAgent.indexOf("MSIE")>=0&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0,IS_OT:navigator.userAgent.indexOf("Presto/")>=0&&navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:navigator.userAgent.indexOf("AppleWebKit/")>=0&&navigator.userAgent.indexOf("Chrome/")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_ANDROID:navigator.userAgent.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IOS_VERSION:function(){if(/iP(hone|od|ad)/.test(navigator.platform)){var t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);if(null!=t&&t.length>0)return parseInt(t[1])}return 0}(),IS_GC:navigator.userAgent.indexOf("Chrome/")>=0&&navigator.userAgent.indexOf("Edge/")<0,IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:navigator.userAgent.indexOf("Firefox/")>=0,IS_MT:navigator.userAgent.indexOf("Firefox/")>=0&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||navigator.userAgent.indexOf("Iceweasel/")>=0&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||navigator.userAgent.indexOf("SeaMonkey/")>=0&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||navigator.userAgent.indexOf("Iceape/")>=0&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||navigator.userAgent.indexOf("Opera/")>=0,IS_WIN:navigator.appVersion.indexOf("Win")>0,IS_MAC:navigator.appVersion.indexOf("Mac")>0,IS_CHROMEOS:/\bCrOS\b/.test(navigator.userAgent),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(navigator.appVersion.indexOf("Mac")>0),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,i,n){if(i=i||document,mxClient.IS_IE6)i.write('');else{var r=i.createElement("link");r.setAttribute("rel",t),r.setAttribute("href",e),r.setAttribute("charset","UTF-8"),r.setAttribute("type","text/css"),n&&r.setAttribute("id",n),i.getElementsByTagName("head")[0].appendChild(r)}},loadResources:function(t,e){var i=mxClient.defaultBundles.length;function n(){0==--i&&t()}for(var r=0;r<\/script>')}},node;mxClient.IS_SF&&mxClient.IS_TOUCH&&!mxClient.IS_IOS&&(mxClient.IOS_VERSION=13,mxClient.IOS=!0),"undefined"==typeof mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),"undefined"!=typeof mxBasePath&&mxBasePath.length>0?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&mxImageBasePath.length>0?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images","undefined"!=typeof mxLanguage&&null!=mxLanguage?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,"undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(null!=document.namespaces&&(8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"))),mxClient.IS_QUIRKS&&document.styleSheets.length>=30?(node=document.createElement("style"),node.type="text/css",node.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(node)):document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"))),(mxForceIncludes||null==module.exports)&&(mxClient.include(mxClient.basePath+"/js/util/mxLog.js"),mxClient.include(mxClient.basePath+"/js/util/mxObjectIdentity.js"),mxClient.include(mxClient.basePath+"/js/util/mxDictionary.js"),mxClient.include(mxClient.basePath+"/js/util/mxResources.js"),mxClient.include(mxClient.basePath+"/js/util/mxPoint.js"),mxClient.include(mxClient.basePath+"/js/util/mxRectangle.js"),mxClient.include(mxClient.basePath+"/js/util/mxEffects.js"),mxClient.include(mxClient.basePath+"/js/util/mxUtils.js"),mxClient.include(mxClient.basePath+"/js/util/mxConstants.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventObject.js"),mxClient.include(mxClient.basePath+"/js/util/mxMouseEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlRequest.js"),mxClient.include(mxClient.basePath+"/js/util/mxClipboard.js"),mxClient.include(mxClient.basePath+"/js/util/mxWindow.js"),mxClient.include(mxClient.basePath+"/js/util/mxForm.js"),mxClient.include(mxClient.basePath+"/js/util/mxImage.js"),mxClient.include(mxClient.basePath+"/js/util/mxDivResizer.js"),mxClient.include(mxClient.basePath+"/js/util/mxDragSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxToolbar.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoableEdit.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxUrlConverter.js"),mxClient.include(mxClient.basePath+"/js/util/mxPanningManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/util/mxAutoSaveManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxAnimation.js"),mxClient.include(mxClient.basePath+"/js/util/mxMorphing.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageBundle.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageExport.js"),mxClient.include(mxClient.basePath+"/js/util/mxAbstractCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxSvgCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxVmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxGuide.js"),mxClient.include(mxClient.basePath+"/js/shape/mxShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencil.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencilRegistry.js"),mxClient.include(mxClient.basePath+"/js/shape/mxMarker.js"),mxClient.include(mxClient.basePath+"/js/shape/mxActor.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCloud.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRectangleShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxDoubleEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRhombus.js"),mxClient.include(mxClient.basePath+"/js/shape/mxPolyline.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrow.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrowConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxText.js"),mxClient.include(mxClient.basePath+"/js/shape/mxTriangle.js"),mxClient.include(mxClient.basePath+"/js/shape/mxHexagon.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLine.js"),mxClient.include(mxClient.basePath+"/js/shape/mxImageShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLabel.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCylinder.js"),mxClient.include(mxClient.basePath+"/js/shape/mxConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxSwimlane.js"),mxClient.include(mxClient.basePath+"/js/layout/mxGraphLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxStackLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxPartitionLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompactTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxRadialTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxFastOrganicLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCircleLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxParallelEdgeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompositeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxEdgeLabelLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyNode.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyEdge.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxSwimlaneModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMinimumCycleRemover.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxCoordinateAssignment.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxSwimlaneOrdering.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxHierarchicalLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxSwimlaneLayout.js"),mxClient.include(mxClient.basePath+"/js/model/mxGraphModel.js"),mxClient.include(mxClient.basePath+"/js/model/mxCell.js"),mxClient.include(mxClient.basePath+"/js/model/mxGeometry.js"),mxClient.include(mxClient.basePath+"/js/model/mxCellPath.js"),mxClient.include(mxClient.basePath+"/js/view/mxPerimeter.js"),mxClient.include(mxClient.basePath+"/js/view/mxPrintPreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxStylesheet.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellState.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphSelectionModel.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellEditor.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellRenderer.js"),mxClient.include(mxClient.basePath+"/js/view/mxEdgeStyle.js"),mxClient.include(mxClient.basePath+"/js/view/mxStyleRegistry.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphView.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraph.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellOverlay.js"),mxClient.include(mxClient.basePath+"/js/view/mxOutline.js"),mxClient.include(mxClient.basePath+"/js/view/mxMultiplicity.js"),mxClient.include(mxClient.basePath+"/js/view/mxLayoutManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxSwimlaneManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxTemporaryCellStates.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellStatePreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxConnectionConstraint.js"),mxClient.include(mxClient.basePath+"/js/handler/mxGraphHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPanningHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPopupMenuHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellMarker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxSelectionCellsHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConnectionHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConstraintHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxRubberband.js"),mxClient.include(mxClient.basePath+"/js/handler/mxHandle.js"),mxClient.include(mxClient.basePath+"/js/handler/mxVertexHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxElbowEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeSegmentHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxTooltipHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellTracker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellHighlight.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultToolbar.js"),mxClient.include(mxClient.basePath+"/js/editor/mxEditor.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodecRegistry.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxObjectCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxCellCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxModelCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxRootChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxChildChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxTerminalChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGenericChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphViewCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxStylesheetCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultKeyHandlerCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultToolbarCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultPopupMenuCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxEditorCodec.js")),__mxOutput.mxClient=void 0!==mxClient?mxClient:void 0;var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var i=document.createElement("tbody"),n=document.createElement("tr"),r=document.createElement("td");r.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&"BackCompat"!=document.compatMode?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",r.appendChild(mxLog.textarea),n.appendChild(r),i.appendChild(n),n=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),n.appendChild(mxLog.td),i.appendChild(n),e.appendChild(i),mxLog.addButton("Info",(function(t){mxLog.info()})),mxLog.addButton("DOM",(function(t){var e=mxUtils.getInnerHtml(document.body);mxLog.debug(e)})),mxLog.addButton("Trace",(function(t){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")})),mxLog.addButton("Copy",(function(t){try{mxUtils.copy(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Show",(function(t){try{mxUtils.popup(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Clear",(function(t){mxLog.textarea.value=""}));var s=0,o=0;if("number"==typeof window.innerWidth?(s=window.innerHeight,o=window.innerWidth):(s=document.documentElement.clientHeight||document.body.clientHeight,o=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,o-320),Math.max(0,s-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode||11==document.documentMode){var l=mxLog.window.getElement(),a=function(t,e){mxLog.textarea.style.height=Math.max(0,l.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,a),mxLog.window.addListener(mxEvent.MAXIMIZE,a),mxLog.window.addListener(mxEvent.NORMALIZE,a),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var i=document.createElement("button");mxUtils.write(i,t),mxEvent.addListener(i,"click",e),mxLog.td.appendChild(i)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(t){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),(new Date).getTime()},leave:function(t,e){if(mxLog.TRACE){var i=0!=e?" ("+((new Date).getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+i)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e=0&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e=0},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(null==mxClient.languages||!this.isLanguageSupported(e)){var i=e.indexOf("-");i>0&&(e=e.substring(0,i))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,i){if((e=null!=e?e:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE)!=mxConstants.NONE){var n=mxResources.getDefaultBundle(t,e),r=mxResources.getSpecialBundle(t,e),s=function(){if(null!=r)if(i)mxUtils.get(r,(function(t){mxResources.parse(t.getText()),i()}),(function(){i()}));else try{var t=mxUtils.load(r);t.isReady()&&mxResources.parse(t.getText())}catch(t){}else null!=i&&i()};if(null!=n)if(i)mxUtils.get(n,(function(t){mxResources.parse(t.getText()),s()}),(function(){s()}));else try{var o=mxUtils.load(n);o.isReady()&&mxResources.parse(o.getText()),s()}catch(t){}else s()}},parse:function(t){if(null!=t)for(var e=t.split("\n"),i=0;i0){var r=e[i].substring(0,n),s=e[i].length;13==e[i].charCodeAt(s-1)&&s--;var o=e[i].substring(n+1,s);this.resourcesEncoded?(o=o.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[r]=unescape(o)):mxResources.resources[r]=o}}},get:function(t,e,i){var n=mxResources.resources[t];return null==n&&(n=i),null!=n&&null!=e&&(n=mxResources.replacePlaceholders(n,e)),n},replacePlaceholders:function(t,e){for(var i=[],n=null,r=0;r=0&&n0?window.setTimeout(l,r):(t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(l,r)}else t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t)}};__mxOutput.mxEffects=void 0!==mxEffects?mxEffects:void 0;var mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){null!=t.style&&(t.style.cursor="");var e=t.childNodes;if(null!=e)for(var i=e.length,n=0;n=9&&document.documentMode<10&&(prefix="ms"),function(t,e,i){t[e]=i,null!=prefix&&e.length>0&&(t[e=prefix+e.substring(0,1).toUpperCase()+e.substring(1)]=i)}),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return null!=e&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(expr.indexOf("function")>=0)try{eval("var _mxJavaScriptExpression="+expr),result=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}return result},findNode:function(t,e,i){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=t.getAttribute(e);if(null!=n&&n==i)return t}for(t=t.firstChild;null!=t;){var r=mxUtils.findNode(t,e,i);if(null!=r)return r;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(null!=t)if(null!=t.name)e=t.name;else if(e=mxUtils.trim(t.toString()),/^function\s/.test(e)){var i=(e=mxUtils.ltrim(e.substring(9))).indexOf("(");i>0&&(e=e.substring(0,i))}return e},indexOf:function(t,e){if(null!=t&&null!=e)for(var i=0;i=0;)e.splice(n,1),i=t,n=mxUtils.indexOf(e,t);for(var r in e)e[r]==t&&(delete e[r],i=t);return i},isNode:function(t,e,i,n){return!(null==t||isNaN(t.nodeType)||null!=e&&t.nodeName.toLowerCase()!=e.toLowerCase())&&(null==i||t.getAttribute(i)==n)},isAncestorNode:function(t,e){for(var i=e;null!=i;){if(i==t)return!0;i=i.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var i=[],n=t.firstChild;null!=n;)n.nodeType==e&&i.push(n),n=n.nextSibling;return i},importNode:function(t,e,i){return mxClient.IS_IE&&(null==document.documentMode||document.documentMode<10)?mxUtils.importNodeImplementation(t,e,i):t.importNode(e,i)},importNodeImplementation:function(t,e,i){switch(e.nodeType){case 1:var n=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0)for(var r=0;r0)for(r=0;r/g,">"),(null==e||e)&&(t=t.replace(/\n/g," ")),t},isVml:function(t){return null!=t&&"urn:schemas-microsoft-com:vml"==t.tagUrn},getXml:function(t,e){var i="";if(mxClient.IS_IE||mxClient.IS_IE11)i=mxUtils.getPrettyXml(t,"","","");else if(null!=window.XMLSerializer){i=(new XMLSerializer).serializeToString(t)}else null!=t.xml&&(i=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n"));return e=e||" ",i=i.replace(/\n/g,e)},getPrettyXml:function(t,e,i,n,r){var s=[];if(null!=t)if(e=null!=e?e:" ",i=null!=i?i:"",n=null!=n?n:"\n",null!=t.namespaceURI&&t.namespaceURI!=r&&(r=t.namespaceURI,null==t.getAttribute("xmlns")&&t.setAttribute("xmlns",t.namespaceURI)),t.nodeType==mxConstants.NODETYPE_TEXT){var o=mxUtils.getTextContent(t);o.length>0&&s.push(i+mxUtils.htmlEntities(mxUtils.trim(o),!1))}else{s.push(i+"<"+t.nodeName);var l=t.attributes;if(null!=l)for(var a=0;a"+n);null!=u;)s.push(mxUtils.getPrettyXml(u,e,i+e,n,r)),u=u.nextSibling;s.push(i+""+n)}else s.push("/>"+n)}return s.join("")},extractTextWithWhitespace:function(t){var e=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"],i=[];return function t(n){if(1!=n.length||"BR"!=n[0].nodeName&&"\n"!=n[0].innerHTML)for(var r=0;r"==s.innerHTML.toLowerCase()?i.push("\n"):(3===s.nodeType||4===s.nodeType?s.nodeValue.length>0&&i.push(s.nodeValue):8!==s.nodeType&&s.childNodes.length>0&&t(s.childNodes),r=0&&i.push("\n"))}}(t),i.join("")},replaceTrailingNewlines:function(t,e){for(var i="";t.length>0&&"\n"==t.charAt(t.length-1);)t=t.substring(0,t.length-1),i+=e;return t+i},getTextContent:function(t){return mxClient.IS_IE&&void 0!==t.innerText?t.innerText:null!=t?t[void 0===t.textContent?"text":"textContent"]:""},setTextContent:function(t,e){void 0!==t.innerText?t.innerText=e:t[void 0===t.textContent?"text":"textContent"]=e},getInnerHtml:mxClient.IS_IE?function(t){return null!=t?t.innerHTML:""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},getOuterHtml:mxClient.IS_IE?function(t){if(null!=t){if(null!=t.outerHTML)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var i=t.attributes;if(null!=i)for(var n=0;n0&&(e.push(" "),e.push(i[n].nodeName),e.push('="'),e.push(r),e.push('"'))}return 0==t.innerHTML.length?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("")),e.join("")}return""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},write:function(t,e){var i=t.ownerDocument.createTextNode(e);return null!=t&&t.appendChild(i),i},writeln:function(t,e){var i=t.ownerDocument.createTextNode(e);return null!=t&&(t.appendChild(i),t.appendChild(document.createElement("br"))),i},br:function(t,e){e=e||1;for(var i=null,n=0;nl&&(t.style.left=Math.max(s,l-n)+"px");var a=parseInt(t.offsetTop),h=parseInt(t.offsetHeight),u=o+e.height;a+h>u&&(t.style.top=Math.max(o,u-h)+"px")},load:function(t){var e=new mxXmlRequest(t,null,"GET",!1);return e.send(),e},get:function(t,e,i,n,r,s){var o=new mxXmlRequest(t,null,"GET");return null!=n&&o.setBinary(n),o.send(e,i,r,s),o},getAll:function(t,e,i){for(var n=t.length,r=[],s=0,o=function(){0==s&&null!=i&&i(),s++},l=0;l299?o():(r[i]=t,0==--n&&e(r))}),o)}(t[l],l);0==n&&e(r)},post:function(t,e,i,n){return new mxXmlRequest(t,e).send(i,n)},submit:function(t,e,i,n){return new mxXmlRequest(t,e).simulate(i,n)},loadInto:function(t,e,i){mxClient.IS_IE?e.onreadystatechange=function(){4==e.readyState&&i()}:e.addEventListener("load",i,!1),e.load(t)},getValue:function(t,e,i){var n=null!=t?t[e]:null;return null==n&&(n=i),n},getNumber:function(t,e,i){var n=null!=t?t[e]:null;return null==n&&(n=i||0),Number(n)},getColor:function(t,e,i){var n=null!=t?t[e]:null;return null==n?n=i:n==mxConstants.NONE&&(n=null),n},clone:function(t,e,i){i=null!=i&&i;var n=null;if(null!=t&&"function"==typeof t.constructor)for(var r in n=new t.constructor,t)r!=mxObjectIdentity.FIELD_NAME&&(null==e||mxUtils.indexOf(e,r)<0)&&(i||"object"!=typeof t[r]?n[r]=t[r]:n[r]=mxUtils.clone(t[r]));return n},equalPoints:function(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e)for(var i=0;i [Function]\n";else if("object"==typeof t[i]){e+=i+" => ["+mxUtils.getFunctionName(t[i].constructor)+"]\n"}else e+=i+" = "+t[i]+"\n"}catch(t){e+=i+"="+t.message}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return 180*t/Math.PI},arcToCurves:function(t,e,i,n,r,s,o,l,a){if(l-=t,a-=e,0===i||0===n)return z;var h=o,u=r;i=Math.abs(i),n=Math.abs(n);var p,d=-l/2,c=-a/2,m=Math.cos(u*Math.PI/180),g=Math.sin(u*Math.PI/180),x=m*d+g*c,f=-1*g*d+m*c,y=x*x,v=f*f,C=i*i,E=n*n,S=y/C+v/E;if(S>1)i=Math.sqrt(S)*i,n=Math.sqrt(S)*n,p=0;else{var b=1;s===h&&(b=-1),p=b*Math.sqrt((C*E-C*v-E*y)/(C*v+E*y))}var T=p*i*f/n,w=-1*p*n*x/i,L=m*T-g*w+l/2,A=g*T+m*w+a/2,I=Math.atan2((f-w)/n,(x-T)/i)-Math.atan2(0,1),O=I>=0?I:2*Math.PI+I,R=(I=Math.atan2((-f-w)/n,(-x-T)/i)-Math.atan2((f-w)/n,(x-T)/i))>=0?I:2*Math.PI+I;0==h&&R>0?R-=2*Math.PI:0!=h&&R<0&&(R+=2*Math.PI);for(var M=2*R/Math.PI,P=Math.ceil(M<0?-1*M:M),N=R/P,_=8/3*Math.sin(N/4)*Math.sin(N/4)/Math.sin(N/2),D=m*i,H=m*n,G=g*i,U=g*n,V=Math.cos(O),k=Math.sin(O),B=-_*(D*k+U*V),F=-_*(G*k-H*V),q=0,Y=0,z=[],j=0;j45?(a=1,l>=135&&(a=2)):l<-45&&(a=3,l<=-135&&(a=2)),s.indexOf(mxConstants.DIRECTION_NORTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:o|=mxConstants.DIRECTION_MASK_EAST;break;case 2:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:o|=mxConstants.DIRECTION_MASK_WEST}if(s.indexOf(mxConstants.DIRECTION_WEST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_WEST;break;case 1:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:o|=mxConstants.DIRECTION_MASK_EAST;break;case 3:o|=mxConstants.DIRECTION_MASK_SOUTH}if(s.indexOf(mxConstants.DIRECTION_SOUTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:o|=mxConstants.DIRECTION_MASK_WEST;break;case 2:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:o|=mxConstants.DIRECTION_MASK_EAST}if(s.indexOf(mxConstants.DIRECTION_EAST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_EAST;break;case 1:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:o|=mxConstants.DIRECTION_MASK_WEST;break;case 3:o|=mxConstants.DIRECTION_MASK_NORTH}return o},reversePortConstraints:function(t){var e=0;return e=(t&mxConstants.DIRECTION_MASK_WEST)<<3,e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1,e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1,e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(t,e,i){var n=-1;if(t.absolutePoints.length>0)for(var r=t.absolutePoints[0],s=null,o=1;oa.distSq)&&(n=a)}}return null!=n?n.p:null},rectangleIntersectsSegment:function(t,e,i){var n=t.y,r=t.x,s=n+t.height,o=r+t.width,l=e.x,a=i.x;if(e.x>i.x&&(l=i.x,a=e.x),a>o&&(a=o),la)return!1;var h=e.y,u=i.y,p=i.x-e.x;if(Math.abs(p)>1e-7){var d=(i.y-e.y)/p,c=e.y-d*e.x;h=d*l+c,u=d*a+c}if(h>u){var m=u;u=h,h=m}return u>s&&(u=s),hu)},contains:function(t,e,i){return t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i},intersects:function(t,e){var i=t.width,n=t.height,r=e.width,s=e.height;if(r<=0||s<=0||i<=0||n<=0)return!1;var o=t.x,l=t.y,a=e.x,h=e.y;return s+=h,i+=o,n+=l,((r+=a)o)&&(sl)&&(ia)&&(nh)},intersectsHotspot:function(t,e,i,n,r,s){if(r=null!=r?r:0,s=null!=s?s:0,(n=null!=n?n:1)>0){var o=t.getCenterX(),l=t.getCenterY(),a=t.width,h=t.height,u=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;u>0&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(l=t.y+u/2,h=u):(o=t.x+u/2,a=u)),a=Math.max(r,a*n),h=Math.max(r,h*n),s>0&&(a=Math.min(a,s),h=Math.min(h,s));var p=new mxRectangle(o-a/2,l-h/2,a,h),d=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){var c=Math.cos(-d),m=Math.sin(-d),g=(o=new mxPoint(t.getCenterX(),t.getCenterY()),mxUtils.getRotatedPoint(new mxPoint(e,i),c,m,o));e=g.x,i=g.y}return mxUtils.contains(p,e,i)}return!0},getOffset:function(t,e){for(var i=0,n=0,r=!1,s=t,o=document.body,l=document.documentElement;null!=s&&s!=o&&s!=l&&!r;){var a=mxUtils.getCurrentStyle(s);null!=a&&(r=r||"fixed"==a.position),s=s.parentNode}if(!e&&!r){var h=mxUtils.getDocumentScrollOrigin(t.ownerDocument);i+=h.x,n+=h.y}var u=t.getBoundingClientRect();return null!=u&&(i+=u.left,n+=u.top),new mxPoint(i,n)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);var e=t.defaultView||t.parentWindow;return new mxPoint(null!=e&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=e&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(t,e,i){e=null!=e&&e,i=null==i||i;for(var n=null!=t?t.ownerDocument:document,r=n.body,s=n.documentElement,o=new mxPoint,l=!1;null!=t&&t!=r&&t!=s;){isNaN(t.scrollLeft)||isNaN(t.scrollTop)||(o.x+=t.scrollLeft,o.y+=t.scrollTop);var a=mxUtils.getCurrentStyle(t);null!=a&&(l=l||"fixed"==a.position),t=e?t.parentNode:null}if(!l&&i){var h=mxUtils.getDocumentScrollOrigin(n);o.x+=h.x,o.y+=h.y}return o},convertPoint:function(t,e,i){var n=mxUtils.getScrollOrigin(t,!1),r=mxUtils.getOffset(t);return r.x-=n.x,r.y-=n.y,new mxPoint(e-r.x,i-r.y)},ltrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("["+e+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&("string"!=typeof t||t.toLowerCase().indexOf("0x")<0)},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,i,n,r,s,o,l){var a=(l-s)*(i-t)-(o-r)*(n-e),h=((o-r)*(e-s)-(l-s)*(t-r))/a,u=((i-t)*(e-s)-(n-e)*(t-r))/a;return h>=0&&h<=1&&u>=0&&u<=1?new mxPoint(t+h*(i-t),e+h*(n-e)):null},ptSegDistSq:function(t,e,i,n,r,s){var o,l=(r-=t)*(i-=t)+(s-=e)*(n-=e);o=l<=0||(l=(r=i-r)*i+(s=n-s)*n)<=0?0:l*l/(i*i+n*n);var a=r*r+s*s-o;return a<0&&(a=0),a},ptLineDist:function(t,e,i,n,r,s){return Math.abs((n-e)*r-(i-t)*s+i*e-n*t)/Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))},relativeCcw:function(t,e,i,n,r,s){var o=(r-=t)*(n-=e)-(s-=e)*(i-=t);return 0==o&&(o=r*i+s*n)>0&&(o=(r-=i)*i+(s-=n)*n)<0&&(o=0),o<0?-1:o>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,i){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,i,n,r,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?t.style.filter=e>=100?"":"alpha(opacity="+e/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?t.style.filter=e>=100?"":"alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((e=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t),e.style.borderStyle="none"):((e=document.createElement("img")).setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,e){e=null==e||e;var i=new mxDictionary;return t.sort((function(t,n){var r=i.get(t);null==r&&(r=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),i.put(t,r));var s=i.get(n);null==s&&(s=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),i.put(n,s));var o=mxCellPath.compare(r,s);return 0==o?0:o>0==e?1:-1})),t},getStylename:function(t){if(null!=t){var e=t.split(";")[0];if(e.indexOf("=")<0)return e}return""},getStylenames:function(t){var e=[];if(null!=t)for(var i=t.split(";"),n=0;n0&&";"!=t.charAt(t.length-1)&&(t+=";"),t+=e),t},removeStylename:function(t,e){var i=[];if(null!=t)for(var n=t.split(";"),r=0;r=0&&e.push(i[n]);return e.join(";")},setCellStyles:function(t,e,i,n){if(null!=e&&e.length>0){t.beginUpdate();try{for(var r=0;r0);if(null==t||0==t.length)n&&(t=e+"="+i+";");else if(t.substring(0,e.length+1)==e+"="){var r=t.indexOf(";");t=n?e+"="+i+(r<0?";":t.substring(r)):r<0||r==t.length-1?"":t.substring(r+1)}else{var s=t.indexOf(";"+e+"=");if(s<0){if(n){var o=";"==t.charAt(t.length-1)?"":";";t=t+o+e+"="+i+";"}}else{r=t.indexOf(";",s+1);t=n?t.substring(0,s+1)+e+"="+i+(r<0?";":t.substring(r)):t.substring(0,s)+(r<0?";":t.substring(r))}}return t},setCellStyleFlags:function(t,e,i,n,r){if(null!=e&&e.length>0){t.beginUpdate();try{for(var s=0;s=0?t.substring(o):"")}}return t},getAlignmentAsPoint:function(t,e){var i=-.5,n=-.5;return t==mxConstants.ALIGN_LEFT?i=0:t==mxConstants.ALIGN_RIGHT&&(i=-1),e==mxConstants.ALIGN_TOP?n=0:e==mxConstants.ALIGN_BOTTOM&&(n=-1),new mxPoint(i,n)},getSizeForString:function(t,e,i,n,r){e=null!=e?e:mxConstants.DEFAULT_FONTSIZE,i=null!=i?i:mxConstants.DEFAULT_FONTFAMILY;var s=document.createElement("div");if(s.style.fontFamily=i,s.style.fontSize=Math.round(e)+"px",s.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",null!=r){(r&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(s.style.fontWeight="bold"),(r&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(s.style.fontStyle="italic");var o=[];(r&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&o.push("underline"),(r&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&o.push("line-through"),o.length>0&&(s.style.textDecoration=o.join(" "))}s.style.position="absolute",s.style.visibility="hidden",s.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",s.style.zoom="1",null!=n?(s.style.width=n+"px",s.style.whiteSpace="normal"):s.style.whiteSpace="nowrap",s.innerHTML=t,document.body.appendChild(s);var l=new mxRectangle(0,0,s.offsetWidth,s.offsetHeight);return document.body.removeChild(s),l},getViewXml:function(t,e,i,n,r){(n=null!=n?n:0,r=null!=r?r:0,e=null!=e?e:1,null==i)&&(i=[t.getModel().getRoot()]);var s=t.getView(),o=null,l=s.isEventsEnabled();s.setEventsEnabled(!1);var a=s.drawPane,h=s.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(s.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.drawPane),s.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.overlayPane)):(s.drawPane=s.drawPane.cloneNode(!1),s.canvas.appendChild(s.drawPane),s.overlayPane=s.overlayPane.cloneNode(!1),s.canvas.appendChild(s.overlayPane));var u=s.getTranslate();s.translate=new mxPoint(n,r);var p=new mxTemporaryCellStates(t.getView(),e,i);try{o=(new mxCodec).encode(t.getView())}finally{p.destroy(),s.translate=u,s.canvas.removeChild(s.drawPane),s.canvas.removeChild(s.overlayPane),s.drawPane=a,s.overlayPane=h,s.setEventsEnabled(l)}return o},getScaleForPageCount:function(t,e,i,n){if(t<1)return 1;n=null!=n?n:0;var r=(i=null!=i?i:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*n,s=i.height-2*n,o=e.getGraphBounds().clone(),l=e.getView().getScale();o.width/=l,o.height/=l;var a=o.width,h=a/o.height/(r/s),u=Math.sqrt(t),p=Math.sqrt(h),d=u*p,c=u/p;if(d<1&&c>t){var m=c/t;c=t,d/=m}if(c<1&&d>t){m=d/t;d=t,c/=m}for(var g=Math.ceil(d)*Math.ceil(c),x=0;g>t;){var f=Math.floor(d)/d,y=Math.floor(c)/c;1==f&&(f=Math.floor(d-1)/d),1==y&&(y=Math.floor(c-1)/c);m=1;if(d*=m=f>y?f:y,c*=m,g=Math.ceil(d)*Math.ceil(c),++x>10)break}return.99999*(r*d/a)},show:function(t,e,i,n,r,s){(i=null!=i?i:0,n=null!=n?n:0,null==e)?e=window.open().document:e.open();9==document.documentMode&&e.writeln('\x3c!--[if IE]>",u=document.getElementsByTagName("base"),p=0;p";for(p=0;p',h+='
',h+=t.container.innerHTML,h+="
",e.writeln(h),e.close()}else{e.writeln("");for(u=document.getElementsByTagName("base"),p=0;p'),e.close();var m=e.createElement("div");m.position="absolute",m.overflow="hidden",m.style.width=r+"px",m.style.height=s+"px";var g=e.createElement("div");g.style.position="absolute",g.style.left=l+"px",g.style.top=a+"px";for(var x=t.container.firstChild,f=null;null!=x;){var y=x.cloneNode(!0);x==t.view.drawPane.ownerSVGElement?(m.appendChild(y),f=y):g.appendChild(y),x=x.nextSibling}e.body.appendChild(m),null!=g.firstChild&&e.body.appendChild(g),null!=f&&(f.style.minWidth="",f.style.minHeight="",f.firstChild.setAttribute("transform","translate("+l+","+a+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds(),mxUtils.show(t,e.document);var i=function(){e.focus(),e.print(),e.close()};mxClient.IS_GC?e.setTimeout(i,500):i()},popup:function(t,e){if(e){var i=document.createElement("div");i.style.overflow="scroll",i.style.width="636px",i.style.height="460px",(r=document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"
").replace(/ /g," "),i.appendChild(r),(n=new mxWindow("Popup Window",i,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),n.setVisible(!0)}else{var n,r;if(mxClient.IS_NS)(n=window.open()).document.writeln("
"+mxUtils.htmlEntities(t)+"").replace(/ /g," "),n.document.body.appendChild(r)}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,null!=e?e:"")},confirm:function(t){return confirm(t)},error:function(t,e,i,n){var r=document.createElement("div");r.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",n||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",r.appendChild(s),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),mxUtils.write(r,t);var o=document.body.clientWidth,l=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,r,(o-e)/2,l/4,e,null,!1,!0);if(i){mxUtils.br(r);var h=document.createElement("p"),u=document.createElement("button");mxClient.IS_IE?u.style.cssText="float:right":u.setAttribute("style","float:right"),mxEvent.addListener(u,"click",(function(t){a.destroy()})),mxUtils.write(u,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),h.appendChild(u),r.appendChild(h),mxUtils.br(r),a.setClosable(!0)}return a.setVisible(!0),a},makeDraggable:function(t,e,i,n,r,s,o,l,a,h){var u=new mxDragSource(t,i);return u.dragOffset=new mxPoint(null!=r?r:0,null!=s?s:mxConstants.TOOLTIP_VERTICAL_OFFSET),u.autoscroll=o,u.setGuidesEnabled(!1),null!=a&&(u.highlightDropTargets=a),null!=h&&(u.getDropTarget=h),u.getGraphForEvent=function(t){return"function"==typeof e?e(t):e},null!=n&&(u.createDragElement=function(){return n.cloneNode(!0)},l&&(u.createPreviewElement=function(t){var e=n.cloneNode(!0),i=parseInt(e.style.width),r=parseInt(e.style.height);return e.style.width=Math.round(i*t.view.scale)+"px",e.style.height=Math.round(r*t.view.scale)+"px",e})),u}},prefix;__mxOutput.mxUtils=void 0!==mxUtils?mxUtils:void 0;var mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(t){this.name=t,this.properties=[];for(var e=1;e0;){var i=e[0];mxEvent.removeListener(t,i.name,i.f)}},addGestureListeners:function(t,e,i,n){null!=e&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=i&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),null!=n&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.addListener(t,"touchstart",e),null!=i&&mxEvent.addListener(t,"touchmove",i),null!=n&&mxEvent.addListener(t,"touchend",n))},removeGestureListeners:function(t,e,i,n){null!=e&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=i&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),null!=n&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.removeListener(t,"touchstart",e),null!=i&&mxEvent.removeListener(t,"touchmove",i),null!=n&&mxEvent.removeListener(t,"touchend",n))},redirectMouseEvents:function(t,e,i,n,r,s,o){var l=function(t){return"function"==typeof i?i(t):i};mxEvent.addGestureListeners(t,(function(t){null!=n?n(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,l(t)))}),(function(t){null!=r?r(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,l(t)))}),(function(t){null!=s?s(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,l(t)))})),mxEvent.addListener(t,"dblclick",(function(t){if(null!=o)o(t);else if(!mxEvent.isConsumed(t)){var i=l(t);e.dblClick(t,null!=i?i.cell:null)}}))},release:function(t){try{if(null!=t){mxEvent.removeAllListeners(t);var e=t.childNodes;if(null!=e)for(var i=e.length,n=0;n.2&&(t(e,n<0,!0),i=e.scale)})),mxEvent.addListener(e,"gestureend",(function(t){mxEvent.consume(t)}))}mxEvent.addListener(e,"wheel",(function(e){null==e&&(e=window.event),e.ctrlKey&&e.preventDefault(),e.deltaY,(Math.abs(e.deltaX)>.5||Math.abs(e.deltaY)>.5)&&t(e,0==e.deltaY?-e.deltaX>0:-e.deltaY>0)}))}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",(function(t){return t.preventDefault&&t.preventDefault(),!1}))},getSource:function(t){return null!=t.srcElement?t.srcElement:t.target},isConsumed:function(t){return null!=t.isConsumed&&t.isConsumed},isTouchEvent:function(t){return null!=t.pointerType?"touch"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_TOUCH:null!=t.mozInputSource?5==t.mozInputSource:0==t.type.indexOf("touch")},isPenEvent:function(t){return null!=t.pointerType?"pen"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_PEN:null!=t.mozInputSource?2==t.mozInputSource:0==t.type.indexOf("pen")},isMultiTouchEvent:function(t){return null!=t.type&&0==t.type.indexOf("touch")&&null!=t.touches&&t.touches.length>1},isMouseEvent:function(t){return null!=t.pointerType?"mouse"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE:null!=t.mozInputSource?1==t.mozInputSource:0==t.type.indexOf("mouse")},isLeftMouseButton:function(t){return!("buttons"in t)||"mousedown"!=t.type&&"mousemove"!=t.type?"which"in t?1===t.which:1===t.button:1==t.buttons},isMiddleMouseButton:function(t){return"which"in t?2===t.which:4===t.button},isRightMouseButton:function(t){return"which"in t?3===t.which:2===t.button},isPopupTrigger:function(t){return mxEvent.isRightMouseButton(t)||mxClient.IS_MAC&&mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)&&!mxEvent.isMetaDown(t)&&!mxEvent.isAltDown(t)},isShiftDown:function(t){return null!=t&&t.shiftKey},isAltDown:function(t){return null!=t&&t.altKey},isControlDown:function(t){return null!=t&&t.ctrlKey},isMetaDown:function(t){return null!=t&&t.metaKey},getMainEvent:function(t){return"touchstart"!=t.type&&"touchmove"!=t.type||null==t.touches||null==t.touches[0]?"touchend"==t.type&&null!=t.changedTouches&&null!=t.changedTouches[0]&&(t=t.changedTouches[0]):t=t.touches[0],t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,i){i=null==i||i,(e=null==e||e)&&(t.preventDefault?(i&&t.stopPropagation(),t.preventDefault()):i&&(t.cancelBubble=!0)),t.isConsumed=!0,t.preventDefault||(t.returnValue=!1)},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1e5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset"},updateListener,updateListenerList;function mxXmlRequest(t,e,i,n,r,s){this.url=t,this.params=e,this.method=i||"POST",this.async=null==n||n,this.username=r,this.password=s}__mxOutput.mxEvent=void 0!==mxEvent?mxEvent:void 0,mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.withCredentials=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.decodeSimulateValues=!1,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(t){this.binary=t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return null!=t?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(document.documentMode>=9||null==t||null==t.documentElement)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return null!=this.request?this.request.status:null},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(t,e,i,n){this.request=this.create(),null!=this.request&&(null!=t&&(this.request.onreadystatechange=mxUtils.bind(this,(function(){this.isReady()&&(t(this),this.request.onreadystatechaange=null)}))),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),!mxClient.IS_QUIRKS&&(null==document.documentMode||document.documentMode>9)&&window.XMLHttpRequest&&null!=i&&null!=n&&(this.request.timeout=i,this.request.ontimeout=n),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){null!=e&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(t,e){var i=null;(t=t||document)==document&&(i=window.onbeforeunload,window.onbeforeunload=null);var n=t.createElement("form");n.setAttribute("method",this.method),n.setAttribute("action",this.url),null!=e&&n.setAttribute("target",e),n.style.display="none",n.style.visibility="hidden";for(var r=this.params.indexOf("&")>0?this.params.split("&"):this.params.split(),s=0;s0){var l=r[s].substring(0,o),a=r[s].substring(o+1);this.decodeSimulateValues&&(a=decodeURIComponent(a));var h=t.createElement("textarea");h.setAttribute("wrap","off"),h.setAttribute("name",l),mxUtils.write(h,a),n.appendChild(h)}}t.body.appendChild(n),n.submit(),null!=n.parentNode&&n.parentNode.removeChild(n),null!=i&&(window.onbeforeunload=i)},__mxOutput.mxXmlRequest=void 0!==mxXmlRequest?mxXmlRequest:void 0;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(t,e){return e=mxClipboard.copy(t,e),mxClipboard.insertCount=0,mxClipboard.removeCells(t,e),e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var i=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(i)),i},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var i=mxClipboard.insertCount*mxClipboard.STEPSIZE,n=t.getDefaultParent();e=t.importCells(e,i,i,n),mxClipboard.insertCount++,t.setSelectionCells(e)}return e}};function mxWindow(t,e,i,n,r,s,o,l,a,h){null!=e&&(o=null==o||o,this.content=e,this.init(i,n,r,s,h),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(t),(null==l||l)&&this.installMoveHandler(),null!=a&&null!=a.parentNode?a.parentNode.replaceChild(this.div,a):document.body.appendChild(this.div))}function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(t,e,i){this.src=t,this.width=e,this.height=i}function mxDivResizer(t,e){if("div"==t.nodeName.toLowerCase()){null==e&&(e=window),this.div=t;var i=mxUtils.getCurrentStyle(t);null!=i&&(this.resizeWidth="auto"==i.width,this.resizeHeight="auto"==i.height),mxEvent.addListener(e,"resize",mxUtils.bind(this,(function(t){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)}))),this.resize()}}function mxDragSource(t,e){this.element=t,this.dropHandler=e,mxEvent.addGestureListeners(t,mxUtils.bind(this,(function(t){this.mouseDown(t)}))),mxEvent.addListener(t,"dragstart",(function(t){mxEvent.consume(t)})),this.eventConsumer=function(t,e){var i=e.getProperty("eventName"),n=e.getProperty("event");i!=mxEvent.MOUSE_DOWN&&n.consume()}}function mxToolbar(t){this.container=t}function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=null==e||e}function mxUndoManager(t){this.size=null!=t?t:100,this.clear()}__mxOutput.mxClipboard=void 0!==mxClipboard?mxClipboard:void 0,mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,i,n,r){r=null!=r?r:"mxWindow",this.div=document.createElement("div"),this.div.className=r,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=r,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),null!=i&&(mxClient.IS_QUIRKS||(this.div.style.width=i+"px"),this.table.style.width=i+"px"),null!=n&&(mxClient.IS_QUIRKS||(this.div.style.height=n+"px"),this.table.style.height=n+"px");var s=document.createElement("tbody"),o=document.createElement("tr");this.title=document.createElement("td"),this.title.className=r+"Title",this.buttons=document.createElement("div"),this.buttons.style.position="absolute",this.buttons.style.display="inline-block",this.buttons.style.right="4px",this.buttons.style.top="5px",this.title.appendChild(this.buttons),o.appendChild(this.title),s.appendChild(o),o=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=r+"Pane",7==document.documentMode&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=r+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_QUIRKS||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),o.appendChild(this.td),s.appendChild(o),this.table.appendChild(s),this.div.appendChild(this.table);var l=mxUtils.bind(this,(function(t){this.activate()}));mxEvent.addGestureListeners(this.title,l),mxEvent.addGestureListeners(this.table,l),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;null!=e;){var i=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=i}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=t?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement()),e=null!=t?t.zIndex:3;if(mxWindow.activeWindow){var i=mxWindow.activeWindow.getElement();null!=i&&null!=i.style&&(i.style.zIndex=e)}var n=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1,mxWindow.activeWindow=this,this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(t){if(t)if(null==this.resize){this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",this.resizeImage),this.resize.style.cursor="nw-resize";var e=null,i=null,n=null,r=null,s=mxUtils.bind(this,(function(t){this.activate(),e=mxEvent.getClientX(t),i=mxEvent.getClientY(t),n=this.div.offsetWidth,r=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){if(null!=e&&null!=i){var s=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-i;this.setSize(n+s,r+o),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",t)),mxEvent.consume(t)}})),l=mxUtils.bind(this,(function(t){null!=e&&null!=i&&(e=null,i=null,mxEvent.removeGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",t)),mxEvent.consume(t))}));mxEvent.addGestureListeners(this.resize,s,o,l),this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(t,e){t=Math.max(this.minimumSize.width,t),e=Math.max(this.minimumSize.height,e),mxClient.IS_QUIRKS||(this.div.style.width=t+"px",this.div.style.height=e+"px"),this.table.style.width=t+"px",this.table.style.height=e+"px",mxClient.IS_QUIRKS||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")},mxWindow.prototype.setMinimizable=function(t){this.minimize.style.display=t?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginLeft="2px",this.minimize.style.display="none",this.buttons.appendChild(this.minimize);var t=!1,e=null,i=null,n=mxUtils.bind(this,(function(n){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=e,mxClient.IS_QUIRKS||(this.div.style.height=i),this.table.style.height=i,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",n));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",e=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var r=this.getMinimumSize();r.height>0&&(mxClient.IS_QUIRKS||(this.div.style.height=r.height+"px"),this.table.style.height=r.height+"px"),r.width>0&&(mxClient.IS_QUIRKS||(this.div.style.width=r.width+"px"),this.table.style.width=r.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",n))}mxEvent.consume(n)}));mxEvent.addGestureListeners(this.minimize,n)},mxWindow.prototype.setMaximizable=function(t){this.maximize.style.display=t?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="2px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.buttons.appendChild(this.maximize);var t=!1,e=null,i=null,n=null,r=null,s=null,o=mxUtils.bind(this,(function(o){if(this.activate(),"none"!=this.maximize.style.display){if(t){if(t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=s,this.div.style.left=e+"px",this.div.style.top=i+"px",!mxClient.IS_QUIRKS)this.div.style.height=n,this.div.style.width=r,"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.table.style.height=n,this.table.style.width=r,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",o))}else{t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",s=this.minimize.style.display,this.minimize.style.display="none",e=parseInt(this.div.style.left),i=parseInt(this.div.style.top),n=this.table.style.height,r=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px";var l=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);if(mxClient.IS_QUIRKS||(this.div.style.width=document.body.clientWidth-2+"px",this.div.style.height=l-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=l-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_QUIRKS)"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",o))}mxEvent.consume(o)}}));mxEvent.addGestureListeners(this.maximize,o),mxEvent.addListener(this.title,"dblclick",o)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,(function(t){var e=mxEvent.getClientX(t),i=mxEvent.getClientY(t),n=this.getX(),r=this.getY(),s=mxUtils.bind(this,(function(t){var s=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-i;this.setLocation(n+s,r+o),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(document,null,s,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",t)),mxEvent.consume(t)}));mxEvent.addGestureListeners(document,null,s,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t)),mxEvent.consume(t)}))),mxClient.IS_POINTER&&(this.title.style.touchAction="none")},mxWindow.prototype.setLocation=function(t,e){this.div.style.left=t+"px",this.div.style.top=e+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.buttons.appendChild(this.closeImg),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,(function(t){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",t)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(t)})))},mxWindow.prototype.setImage=function(t){this.image=document.createElement("img"),this.image.setAttribute("src",t),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(t){this.closeImg.style.display=t?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"none"!=this.div.style.display},mxWindow.prototype.setVisible=function(t){null!=this.div&&this.isVisible()!=t&&(t?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.display="",this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_QUIRKS||"auto"!=t.overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.display="none",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},__mxOutput.mxWindow=void 0!==mxWindow?mxWindow:void 0,mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");i.appendChild(n),n=document.createElement("td");var r=document.createElement("button");mxUtils.write(r,mxResources.get("ok")||"OK"),n.appendChild(r),mxEvent.addListener(r,"click",(function(){t()})),r=document.createElement("button"),mxUtils.write(r,mxResources.get("cancel")||"Cancel"),n.appendChild(r),mxEvent.addListener(r,"click",(function(){e()})),i.appendChild(n),this.body.appendChild(i)},mxForm.prototype.addText=function(t,e,i){var n=document.createElement("input");return n.setAttribute("type",i||"text"),n.value=e,this.addField(t,n)},mxForm.prototype.addCheckbox=function(t,e){var i=document.createElement("input");return i.setAttribute("type","checkbox"),this.addField(t,i),e&&(i.checked=!0),i},mxForm.prototype.addTextarea=function(t,e,i){var n=document.createElement("textarea");return mxClient.IS_NS&&i--,n.setAttribute("rows",i||2),n.value=e,this.addField(t,n)},mxForm.prototype.addCombo=function(t,e,i){var n=document.createElement("select");return null!=i&&n.setAttribute("size",i),e&&n.setAttribute("multiple","true"),this.addField(t,n)},mxForm.prototype.addOption=function(t,e,i,n){var r=document.createElement("option");mxUtils.writeln(r,e),r.setAttribute("value",i),n&&r.setAttribute("selected",n),t.appendChild(r)},mxForm.prototype.addField=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");return mxUtils.write(n,t),i.appendChild(n),(n=document.createElement("td")).appendChild(e),i.appendChild(n),this.body.appendChild(i),e},__mxOutput.mxForm=void 0!==mxForm?mxForm:void 0,mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,__mxOutput.mxImage=void 0!==mxImage?mxImage:void 0,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),i=parseInt(this.div.style.left),n=parseInt(this.div.style.right),r=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(i)&&!isNaN(n)&&i>=0&&n>=0&&t-n-i>0&&(this.div.style.width=t-n-i+"px"),this.resizeHeight&&!isNaN(r)&&!isNaN(s)&&r>=0&&s>=0&&e-r-s>0&&(this.div.style.height=e-r-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},__mxOutput.mxDivResizer=void 0!==mxDivResizer?mxDivResizer:void 0,mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.checkEventSource=!0,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(t){this.enabled=t},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(t){this.guidesEnabled=t},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxDragSource.prototype.getGraphForEvent=function(t){return null},mxDragSource.prototype.getDropTarget=function(t,e,i,n){return t.getCellAt(e,i)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler},mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){this.enabled&&!mxEvent.isConsumed(t)&&null==this.mouseMoveHandler&&(this.startDrag(t),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(t)&&(this.eventSource=mxEvent.getSource(t),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)))},mxDragSource.prototype.startDrag=function(t){this.dragElement=this.createDragElement(t),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity),this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")},mxDragSource.prototype.stopDrag=function(){this.removeDragElement()},mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.getElementForEvent=function(t){return mxEvent.isTouchEvent(t)||mxEvent.isPenEvent(t)?document.elementFromPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)):mxEvent.getSource(t)},mxDragSource.prototype.graphContainsEvent=function(t,e){var i=mxEvent.getClientX(e),n=mxEvent.getClientY(e),r=mxUtils.getOffset(t.container),s=mxUtils.getScrollOrigin(),o=this.getElementForEvent(e);if(this.checkEventSource)for(;null!=o&&o!=t.container;)o=o.parentNode;return null!=o&&i>=r.x-s.x&&n>=r.y-s.y&&i<=r.x-s.x+t.container.offsetWidth&&n<=r.y-s.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(null==e||this.graphContainsEvent(e,t)||(e=null),e!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,t),this.currentGraph=e,null!=this.currentGraph&&this.dragEnter(this.currentGraph,t)),null!=this.currentGraph&&this.dragOver(this.currentGraph,t),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var i=mxEvent.getClientX(t),n=mxEvent.getClientY(t);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(i+=this.dragOffset.x,n+=this.dragOffset.y);var r=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=i+r.x+"px",this.dragElement.style.top=n+r.y+"px"}mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var e=this.currentGraph.view.scale,i=this.currentGraph.view.translate,n=this.currentPoint.x/e-i.x,r=this.currentPoint.y/e-i.y;this.drop(this.currentGraph,t,this.currentDropTarget,n,r)}this.dragExit(this.currentGraph),this.currentGraph=null}this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.mouseMoveHandler=null,this.mouseUpHandler=null},mxDragSource.prototype.dragEnter=function(t,e){t.isMouseDown=!0,t.isMouseTrigger=mxEvent.isMouseEvent(e),this.previewElement=this.createPreviewElement(t),null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(t,mxConstants.DROP_TARGET_COLOR)),t.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)},mxDragSource.prototype.dragExit=function(t,e){this.currentDropTarget=null,this.currentPoint=null,t.isMouseDown=!1,t.removeListener(this.eventConsumer),null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var i=mxUtils.getOffset(t.container),n=mxUtils.getScrollOrigin(t.container),r=mxEvent.getClientX(e)-i.x+n.x-t.panDx,s=mxEvent.getClientY(e)-i.y+n.y-t.panDy;if(t.autoScroll&&(null==this.autoscroll||this.autoscroll)&&t.scrollPointToVisible(r,s,t.autoExtend),null!=this.currentHighlight&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,r,s,e);var o=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(o)}if(null!=this.previewElement){null==this.previewElement.parentNode&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var l=this.isGridEnabled()&&t.isGridEnabledEvent(e),a=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(e)){var h=new mxRectangle(0,0,parseInt(this.previewElement.style.width),parseInt(this.previewElement.style.height)),u=new mxPoint(r,s);a=!1,r=(u=this.currentGuide.move(h,u,l,!0)).x,s=u.y}else if(l){var p=t.view.scale,d=t.view.translate,c=t.gridSize/2;r=(t.snap(r/p-d.x-c)+d.x)*p,s=(t.snap(s/p-d.y-c)+d.y)*p}null!=this.currentGuide&&a&&this.currentGuide.hide(),null!=this.previewOffset&&(r+=this.previewOffset.x,s+=this.previewOffset.y),this.previewElement.style.left=Math.round(r)+"px",this.previewElement.style.top=Math.round(s)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(r,s)},mxDragSource.prototype.drop=function(t,e,i,n,r){this.dropHandler.apply(this,arguments),"hidden"!=t.container.style.visibility&&t.container.focus()},__mxOutput.mxDragSource=void 0!==mxDragSource?mxDragSource:void 0,mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(t,e,i,n,r,s){var o=document.createElement(null!=e?"img":"button"),l=r||(null!=s?"mxToolbarMode":"mxToolbarItem");o.className=l,o.setAttribute("src",e),null!=t&&(null!=e?o.setAttribute("title",t):mxUtils.write(o,t)),this.container.appendChild(o),null!=i&&(mxEvent.addListener(o,"click",i),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",i));var a=mxUtils.bind(this,(function(t){null!=n?o.setAttribute("src",e):o.style.backgroundColor=""}));return mxEvent.addGestureListeners(o,mxUtils.bind(this,(function(t){if(null!=n?o.setAttribute("src",n):o.style.backgroundColor="gray",null!=s){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var e=this.currentImg;if(this.menu.isMenuShowing()&&this.menu.hideMenu(),e!=o){this.currentImg=o,this.menu.factoryMethod=s;var i=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight);this.menu.popup(i.x,i.y,null,t),this.menu.isMenuShowing()&&(o.className=l+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=l,this.currentImg=null})}}})),null,a),mxEvent.addListener(o,"mouseout",a),o},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var i=document.createElement("select");return i.className=t||"mxToolbarCombo",e.appendChild(i),this.container.appendChild(e),i},mxToolbar.prototype.addActionCombo=function(t,e){var i=document.createElement("select");return i.className=e||"mxToolbarCombo",this.addOption(i,t,null),mxEvent.addListener(i,"change",(function(t){var e=i.options[i.selectedIndex];i.selectedIndex=0,null!=e.funct&&e.funct(t)})),this.container.appendChild(i),i},mxToolbar.prototype.addOption=function(t,e,i){var n=document.createElement("option");return mxUtils.writeln(n,e),"function"==typeof i?n.funct=i:n.setAttribute("value",i),t.appendChild(n),n},mxToolbar.prototype.addSwitchMode=function(t,e,i,n,r){var s=document.createElement("img");return s.initialClassName=r||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",e),s.altIcon=n,null!=t&&s.setAttribute("title",t),mxEvent.addListener(s,"click",mxUtils.bind(this,(function(t){var e;null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),this.selectedMode=s,null!=(e=s.altIcon)?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",e)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),i()}))),this.container.appendChild(s),null==this.defaultMode&&(this.defaultMode=s,this.selectMode(s),i()),s},mxToolbar.prototype.addMode=function(t,e,i,n,r,s){s=null==s||s;var o=document.createElement(null!=e?"img":"button");return o.initialClassName=r||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",e),o.altIcon=n,null!=t&&o.setAttribute("title",t),this.enabled&&s&&(mxEvent.addListener(o,"click",mxUtils.bind(this,(function(t){this.selectMode(o,i),this.noReset=!1}))),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,(function(t){this.selectMode(o,i),this.noReset=!0}))),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=i,this.selectMode(o,i))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){var i;if(null!=this.selectedMode)null!=(i=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):this.selectedMode.className=this.selectedMode.initialClassName;this.selectedMode=t,null!=(i=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}},mxToolbar.prototype.resetMode=function(t){!t&&this.noReset||this.selectedMode==this.defaultMode||this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(t){return this.addItem(null,t,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var t=document.createElement("hr");t.style.marginRight="6px",t.setAttribute("size","1"),this.container.appendChild(t)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.container=null,this.defaultMode=null,this.defaultFunction=null,this.selectedMode=null,null!=this.menu&&this.menu.destroy()},__mxOutput.mxToolbar=void 0!==mxToolbar?mxToolbar:void 0,mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(t){this.changes.push(t)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length-1;t>=0;t--){var e=this.changes[t];null!=e.execute?e.execute():null!=e.undo&&e.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length,e=0;e0},mxUndoManager.prototype.undo=function(){for(;this.indexOfNextAdd>0;){var t=this.history[--this.indexOfNextAdd];if(t.undo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd0&&this.size==this.history.length&&this.history.shift(),this.history.push(t),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",t))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),e=0;e0&&this.dx0&&this.dy0&&(this.defs=i.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=i.firstChild?i.insertBefore(this.defs,i.firstChild):i.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUrlConverter.prototype.enabled=!0,mxUrlConverter.prototype.baseUrl=null,mxUrlConverter.prototype.baseDomain=null,mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host,this.baseUrl=this.baseDomain+location.pathname;var t=this.baseUrl.lastIndexOf("/");t>0&&(this.baseUrl=this.baseUrl.substring(0,t+1))},mxUrlConverter.prototype.isEnabled=function(){return this.enabled},mxUrlConverter.prototype.setEnabled=function(t){this.enabled=t},mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl},mxUrlConverter.prototype.setBaseUrl=function(t){this.baseUrl=t},mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain},mxUrlConverter.prototype.setBaseDomain=function(t){this.baseDomain=t},mxUrlConverter.prototype.isRelativeUrl=function(t){return null!=t&&"//"!=t.substring(0,2)&&"http://"!=t.substring(0,7)&&"https://"!=t.substring(0,8)&&"data:image"!=t.substring(0,10)&&"file://"!=t.substring(0,7)},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),t="/"==t.charAt(0)?this.getBaseDomain()+t:this.getBaseUrl()+t),t},__mxOutput.mxUrlConverter=void 0!==mxUrlConverter?mxUrlConverter:void 0,mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,__mxOutput.mxPanningManager=void 0!==mxPanningManager?mxPanningManager:void 0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(t){this.enabled=t},mxPopupMenu.prototype.isPopupTrigger=function(t){return t.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(t.getEvent())},mxPopupMenu.prototype.addItem=function(t,e,i,n,r,s,o){n=n||this,this.itemCount++,n.willAddSeparator&&(n.containsItems&&this.addSeparator(n,!0),n.willAddSeparator=!1),n.containsItems=!0;var l=document.createElement("tr");l.className="mxPopupMenuItem";var a=document.createElement("td");if(a.className="mxPopupMenuIcon",null!=e){var h=document.createElement("img");h.src=e,a.appendChild(h)}else if(null!=r){var u=document.createElement("div");u.className=r,a.appendChild(u)}if(l.appendChild(a),this.labels){var p=document.createElement("td");p.className="mxPopupMenuItem"+(null==s||s?"":" mxDisabled"),mxUtils.write(p,t),p.align="left",l.appendChild(p);var d=document.createElement("td");d.className="mxPopupMenuItem"+(null==s||s?"":" mxDisabled"),d.style.paddingRight="6px",d.style.textAlign="right",l.appendChild(d),null==n.div&&this.createSubmenu(n)}if(n.tbody.appendChild(l),0!=o&&0!=s){var c=null;mxEvent.addGestureListeners(l,mxUtils.bind(this,(function(t){this.eventReceiver=l,n.activeRow!=l&&n.activeRow!=n&&(null!=n.activeRow&&null!=n.activeRow.div.parentNode&&this.hideSubmenu(n),null!=l.div&&(this.showSubmenu(n,l),n.activeRow=l)),null==document.selection||!mxClient.IS_QUIRKS&&8!=document.documentMode||(c=document.selection.createRange()),mxEvent.consume(t)})),mxUtils.bind(this,(function(t){n.activeRow!=l&&n.activeRow!=n&&(null!=n.activeRow&&null!=n.activeRow.div.parentNode&&this.hideSubmenu(n),this.autoExpand&&null!=l.div&&(this.showSubmenu(n,l),n.activeRow=l)),l.className="mxPopupMenuItemHover"})),mxUtils.bind(this,(function(t){if(this.eventReceiver==l){if(n.activeRow!=l&&this.hideMenu(),null!=c){try{c.select()}catch(t){}c=null}null!=i&&i(t)}this.eventReceiver=null,mxEvent.consume(t)}))),mxEvent.addListener(l,"mouseout",mxUtils.bind(this,(function(t){l.className="mxPopupMenuItem"})))}return l},mxPopupMenu.prototype.addCheckmark=function(t,e){var i=t.firstChild.nextSibling;i.style.backgroundImage="url('"+e+"')",i.style.backgroundRepeat="no-repeat",i.style.backgroundPosition="2px 50%"},mxPopupMenu.prototype.createSubmenu=function(t){t.table=document.createElement("table"),t.table.className="mxPopupMenu",t.tbody=document.createElement("tbody"),t.table.appendChild(t.tbody),t.div=document.createElement("div"),t.div.className="mxPopupMenu",t.div.style.position="absolute",t.div.style.display="inline",t.div.style.zIndex=this.zIndex,t.div.appendChild(t.table);var e=document.createElement("img");e.setAttribute("src",this.submenuImage),td=t.firstChild.nextSibling.nextSibling,td.appendChild(e)},mxPopupMenu.prototype.showSubmenu=function(t,e){if(null!=e.div){e.div.style.left=t.div.offsetLeft+e.offsetLeft+e.offsetWidth-1+"px",e.div.style.top=t.div.offsetTop+e.offsetTop+"px",document.body.appendChild(e.div);var i=parseInt(e.div.offsetLeft),n=parseInt(e.div.offsetWidth),r=mxUtils.getDocumentScrollOrigin(document),s=document.body,o=document.documentElement;i+n>r.x+(s.clientWidth||o.clientWidth)&&(e.div.style.left=Math.max(0,t.div.offsetLeft-n+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div)}},mxPopupMenu.prototype.addSeparator=function(t,e){if(t=t||this,this.smartSeparators&&!e)t.willAddSeparator=!0;else if(null!=t.tbody){t.willAddSeparator=!1;var i=document.createElement("tr"),n=document.createElement("td");n.className="mxPopupMenuIcon",n.style.padding="0 0 0 0px",i.appendChild(n);var r=document.createElement("td");r.style.padding="0 0 0 0px",r.setAttribute("colSpan","2");var s=document.createElement("hr");s.setAttribute("size","1"),r.appendChild(s),i.appendChild(r),t.tbody.appendChild(i)}},mxPopupMenu.prototype.popup=function(t,e,i,n){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=t+"px",this.div.style.top=e+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,i,n),this.itemCount>0&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){document.documentMode>=9&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))},mxPopupMenu.prototype.hideSubmenu=function(t){null!=t.activeRow&&(this.hideSubmenu(t.activeRow),null!=t.activeRow.div.parentNode&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},__mxOutput.mxPopupMenu=void 0!==mxPopupMenu?mxPopupMenu:void 0,mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t},mxAutoSaveManager.prototype.setGraph=function(t){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=((new Date).getTime()-this.lastSnapshot)/1e3;e>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxAutoSaveManager=void 0!==mxAutoSaveManager?mxAutoSaveManager:void 0,mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return null!=this.thread},mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},__mxOutput.mxAnimation=void 0!==mxAnimation?mxAnimation:void 0,mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var t=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var e=0;e=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,i){var n=this.graph.getView().getState(t),r=null;if(null!=n&&(r=this.getDelta(n),this.graph.getModel().isVertex(t)&&(0!=r.x||0!=r.y))){var s=this.graph.view.getTranslate(),o=this.graph.view.getScale();r.x+=s.x*o,r.y+=s.y*o,e.moveState(n,-r.x/this.ease,-r.y/this.ease)}if(i&&!this.stopRecursion(n,r))for(var l=this.graph.getModel().getChildCount(t),a=0;a2))for(var t=this.state,e=2;e0&&(this.state=this.states.pop())},mxAbstractCanvas2D.prototype.setLink=function(t){},mxAbstractCanvas2D.prototype.scale=function(t){this.state.scale*=t,this.state.strokeWidth*=t},mxAbstractCanvas2D.prototype.translate=function(t,e){this.state.dx+=t,this.state.dy+=e},mxAbstractCanvas2D.prototype.rotate=function(t,e,i,n,r){},mxAbstractCanvas2D.prototype.setAlpha=function(t){this.state.alpha=t},mxAbstractCanvas2D.prototype.setFillAlpha=function(t){this.state.fillAlpha=t},mxAbstractCanvas2D.prototype.setStrokeAlpha=function(t){this.state.strokeAlpha=t},mxAbstractCanvas2D.prototype.setFillColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fillColor=t,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(t,e,i,n,r,s,o,l,a){var h=this.state;h.fillColor=t,h.gradientFillAlpha=null!=l?l:1,h.gradientColor=e,h.gradientAlpha=null!=a?a:1,h.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(t){t==mxConstants.NONE&&(t=null),this.state.strokeColor=t},mxAbstractCanvas2D.prototype.setStrokeWidth=function(t){this.state.strokeWidth=t},mxAbstractCanvas2D.prototype.setDashed=function(t,e){this.state.dashed=t,this.state.fixDash=e},mxAbstractCanvas2D.prototype.setDashPattern=function(t){this.state.dashPattern=t},mxAbstractCanvas2D.prototype.setLineCap=function(t){this.state.lineCap=t},mxAbstractCanvas2D.prototype.setLineJoin=function(t){this.state.lineJoin=t},mxAbstractCanvas2D.prototype.setMiterLimit=function(t){this.state.miterLimit=t},mxAbstractCanvas2D.prototype.setFontColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontColor=t},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBackgroundColor=t},mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBorderColor=t},mxAbstractCanvas2D.prototype.setFontSize=function(t){this.state.fontSize=parseFloat(t)},mxAbstractCanvas2D.prototype.setFontFamily=function(t){this.state.fontFamily=t},mxAbstractCanvas2D.prototype.setFontStyle=function(t){null==t&&(t=0),this.state.fontStyle=t},mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t},mxAbstractCanvas2D.prototype.setShadowColor=function(t){t==mxConstants.NONE&&(t=null),this.state.shadowColor=t},mxAbstractCanvas2D.prototype.setShadowAlpha=function(t){this.state.shadowAlpha=t},mxAbstractCanvas2D.prototype.setShadowOffset=function(t,e){this.state.shadowDx=t,this.state.shadowDy=e},mxAbstractCanvas2D.prototype.begin=function(){this.lastX=0,this.lastY=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(t,e){this.addOp(this.moveOp,t,e)},mxAbstractCanvas2D.prototype.lineTo=function(t,e){this.addOp(this.lineOp,t,e)},mxAbstractCanvas2D.prototype.quadTo=function(t,e,i,n){this.addOp(this.quadOp,t,e,i,n)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,i,n,r,s){this.addOp(this.curveOp,t,e,i,n,r,s)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,i,n,r,s,o){var l=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,i,n,r,s,o);if(null!=l)for(var a=0;a0&&(t=t.substring(0,e)),t},mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");return e.setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(t,e){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);var i=this.root.ownerDocument.createElement(t);return null!=e&&i.setAttribute("xmlns",e),i},mxSvgCanvas2D.prototype.getAlternateText=function(t,e,i,n,r,s,o,l,a,h,u,p,d){return null!=s?this.foAltText:null},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,i,n,r,s,o,l,a,h,u,p,d){var c=this.getAlternateText(t,e,i,n,r,s,o,l,a,h,u,p,d),m=this.state;if(null!=c&&m.fontSize>0){var g=l==mxConstants.ALIGN_TOP?1:l==mxConstants.ALIGN_BOTTOM?0:.3,x=o==mxConstants.ALIGN_RIGHT?"end":o==mxConstants.ALIGN_LEFT?"start":"middle",f=this.createElement("text");f.setAttribute("x",Math.round(e+m.dx)),f.setAttribute("y",Math.round(i+m.dy+g*m.fontSize)),f.setAttribute("fill",m.fontColor||"black"),f.setAttribute("font-family",m.fontFamily),f.setAttribute("font-size",Math.round(m.fontSize)+"px"),"start"!=x&&f.setAttribute("text-anchor",x),(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&f.setAttribute("font-weight","bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&f.setAttribute("font-style","italic");var y=[];return(m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.push("underline"),(m.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&y.push("line-through"),y.length>0&&f.setAttribute("text-decoration",y.join(" ")),mxUtils.write(f,c),f}return null},mxSvgCanvas2D.prototype.createGradientId=function(t,e,i,n,r){"#"==t.charAt(0)&&(t=t.substring(1)),"#"==e.charAt(0)&&(e=e.substring(1)),t=t.toLowerCase()+"-"+i,e=e.toLowerCase()+"-"+n;var s=null;if(null==r||r==mxConstants.DIRECTION_SOUTH)s="s";else if(r==mxConstants.DIRECTION_EAST)s="e";else{var o=t;t=e,e=o,r==mxConstants.DIRECTION_NORTH?s="s":r==mxConstants.DIRECTION_WEST&&(s="e")}return"mx-gradient-"+t+"-"+e+"-"+s},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,i,n,r){var s=this.createGradientId(t,e,i,n,r),o=this.gradients[s];if(null==o){var l=this.root.ownerSVGElement,a=0,h=s+"-"+a;if(null!=l)for(o=l.ownerDocument.getElementById(h);null!=o&&o.ownerSVGElement!=l;)h=s+"-"+a++,o=l.ownerDocument.getElementById(h);else h="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(t,e,i,n,r)).setAttribute("id",h),null!=this.defs?this.defs.appendChild(o):l.appendChild(o)),this.gradients[s]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,i,n,r){var s=this.createElement("linearGradient");s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),null==r||r==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):r==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):r==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):r==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%");var o=i<1?";stop-opacity:"+i:"",l=this.createElement("stop");return l.setAttribute("offset","0%"),l.setAttribute("style","stop-color:"+t+o),s.appendChild(l),o=n<1?";stop-opacity:"+n:"",(l=this.createElement("stop")).setAttribute("offset","100%"),l.setAttribute("style","stop-color:"+e+o),s.appendChild(l),s},mxSvgCanvas2D.prototype.addNode=function(t,e){var i=this.node,n=this.state;if(null!=i){if("path"==i.nodeName){if(!(null!=this.path&&this.path.length>0))return;i.setAttribute("d",this.path.join(" "))}t&&null!=n.fillColor?this.updateFill():this.styleEnabled||("ellipse"==i.nodeName&&mxClient.IS_FF?i.setAttribute("fill","transparent"):i.setAttribute("fill","none"),t=!1),e&&null!=n.strokeColor?this.updateStroke():this.styleEnabled||i.setAttribute("stroke","none"),null!=n.transform&&n.transform.length>0&&i.setAttribute("transform",n.transform),n.shadow&&this.root.appendChild(this.createShadow(i)),this.strokeTolerance>0&&!t&&this.root.appendChild(this.createTolerance(i)),this.pointerEvents?i.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||i.setAttribute("pointer-events","none"),("rect"!=i.nodeName&&"path"!=i.nodeName&&"ellipse"!=i.nodeName||"none"!=i.getAttribute("fill")&&"transparent"!=i.getAttribute("fill")||"none"!=i.getAttribute("stroke")||"none"!=i.getAttribute("pointer-events"))&&this.root.appendChild(i),this.node=null}},mxSvgCanvas2D.prototype.updateFill=function(){var t=this.state;if((t.alpha<1||t.fillAlpha<1)&&this.node.setAttribute("fill-opacity",t.alpha*t.fillAlpha),null!=t.fillColor)if(null!=t.gradientColor){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(mxClient.IS_CHROMEAPP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)this.node.setAttribute("fill","url(#"+e+")");else{var i=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+i+"#"+e+")")}}else this.node.setAttribute("fill",String(t.fillColor).toLowerCase())},mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))},mxSvgCanvas2D.prototype.updateStroke=function(){var t=this.state;this.node.setAttribute("stroke",String(t.strokeColor).toLowerCase()),(t.alpha<1||t.strokeAlpha<1)&&this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha);var e=this.getCurrentStrokeWidth();1!=e&&this.node.setAttribute("stroke-width",e),"path"==this.node.nodeName&&this.updateStrokeAttributes(),t.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t=this.state;if(null!=t.lineJoin&&"miter"!=t.lineJoin&&this.node.setAttribute("stroke-linejoin",t.lineJoin),null!=t.lineCap){var e=t.lineCap;"flat"==e&&(e="butt"),"butt"!=e&&this.node.setAttribute("stroke-linecap",e)}null==t.miterLimit||this.styleEnabled&&10==t.miterLimit||this.node.setAttribute("stroke-miterlimit",t.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if("string"==typeof this.state.dashPattern){var i=this.state.dashPattern.split(" ");if(i.length>0)for(var n=0;n0&&this.node.setAttribute("rx",this.format(r*this.state.scale)),s>0&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,i,n){var r=this.state,s=this.createElement("ellipse");s.setAttribute("cx",this.format((t+i/2+r.dx)*r.scale)),s.setAttribute("cy",this.format((e+n/2+r.dy)*r.scale)),s.setAttribute("rx",i/2*r.scale),s.setAttribute("ry",n/2*r.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(t,e,i,n,r,s,o,l){r=this.converter.convert(r),s=null==s||s,o=null!=o&&o,l=null!=l&&l;var a=this.state;t+=a.dx,e+=a.dy;var h=this.createElement("image");h.setAttribute("x",this.format(t*a.scale)+this.imageOffset),h.setAttribute("y",this.format(e*a.scale)+this.imageOffset),h.setAttribute("width",this.format(i*a.scale)),h.setAttribute("height",this.format(n*a.scale)),null==h.setAttributeNS?h.setAttribute("xlink:href",r):h.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",r),s||h.setAttribute("preserveAspectRatio","none"),(a.alpha<1||a.fillAlpha<1)&&h.setAttribute("opacity",a.alpha*a.fillAlpha);var u=this.state.transform||"";if(o||l){var p=1,d=1,c=0,m=0;o&&(p=-1,c=-i-2*t),l&&(d=-1,m=-n-2*e),u+="scale("+p+","+d+")translate("+c*a.scale+","+m*a.scale+")"}u.length>0&&h.setAttribute("transform",u),this.pointerEvents||h.setAttribute("pointer-events","none"),this.root.appendChild(h),this.blockImagePointerEvents&&(h.setAttribute("style","pointer-events:none"),(h=this.createElement("rect")).setAttribute("visibility","hidden"),h.setAttribute("pointer-events","fill"),h.setAttribute("x",this.format(t*a.scale)),h.setAttribute("y",this.format(e*a.scale)),h.setAttribute("width",this.format(i*a.scale)),h.setAttribute("height",this.format(n*a.scale)),this.root.appendChild(h))},mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=(new DOMParser).parseFromString(t,"text/html");null!=e&&("",5)+1)),""==t.substring(t.length-7,t.length)&&(t=t.substring(0,t.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){var i=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),n=i.createElement("body");i.documentElement.appendChild(n);var r=document.createElement("div");r.innerHTML=t;for(var s=r.firstChild;null!=s;){var o=s.nextSibling;n.appendChild(i.adoptNode(s)),s=o}return n.innerHTML}var l=document.createElement("textarea");l.innerHTML=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(//g,">"),t=l.value.replace(/&/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/
/g,"
").replace(/
/g,"
").replace(/(]+)>/gm,"$1 />")}return t},mxSvgCanvas2D.prototype.createDiv=function(t){var e=t;if(mxUtils.isNode(e)||(e="
"+this.convertHtml(e)+"
"),mxClient.IS_IE||mxClient.IS_IE11||!document.createElementNS)return mxUtils.isNode(e)&&(e="
"+mxUtils.getXml(e)+"
"),e='
'+e+"
",mxUtils.parseXml(e).documentElement;var i=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var n=document.createElement("div"),r=n.cloneNode(!1);this.root.ownerDocument!=document?n.appendChild(e.cloneNode(!0)):n.appendChild(e),r.appendChild(n),i.appendChild(r)}else i.innerHTML=e;return i},mxSvgCanvas2D.prototype.updateText=function(t,e,i,n,r,s,o,l,a,h,u){null!=u&&null!=u.firstChild&&null!=u.firstChild.firstChild&&this.updateTextNodes(t,e,i,n,r,s,o,l,a,h,u.firstChild)},mxSvgCanvas2D.prototype.addForeignObject=function(t,e,i,n,r,s,o,l,a,h,u,p,d,c,m){var g=this.createElement("g"),x=this.createElement("foreignObject");if(x.setAttribute("style","overflow: visible; text-align: left;"),x.setAttribute("pointer-events","none"),c.ownerDocument!=document&&(c=mxUtils.importNodeImplementation(x.ownerDocument,c,!0)),x.appendChild(c),g.appendChild(x),this.updateTextNodes(t,e,i,n,s,o,l,h,u,p,g),this.root.ownerDocument!=document){var f=this.createAlternateContent(x,t,e,i,n,r,s,o,l,a,h,u,p);if(null!=f){x.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var y=this.createElement("switch");y.appendChild(x),y.appendChild(f),g.appendChild(y)}}m.appendChild(g)},mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,i,n,r,s,o,l,a,h,u){var p=this.state.scale;mxSvgCanvas2D.createCss(i,n,r,s,o,l,a,null!=this.state.fontBackgroundColor?this.state.fontBackgroundColor:null,null!=this.state.fontBorderColor?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(s==mxConstants.ALIGN_TOP?"flex-start":s==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(r==mxConstants.ALIGN_LEFT?"flex-start":r==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),p,mxUtils.bind(this,(function(i,n,r,s,o){t+=this.state.dx,e+=this.state.dy;var l=u.firstChild,a=l.firstChild,d=a.firstChild,c=d.firstChild,m=(this.rotateHtml?this.state.rotation:0)+(null!=h?h:0),g=(0!=this.foOffset?"translate("+this.foOffset+" "+this.foOffset+")":"")+(1!=p?"scale("+p+")":"");c.setAttribute("style",o),d.setAttribute("style",s),l.setAttribute("width",Math.ceil(1/Math.min(1,p)*100)+"%"),l.setAttribute("height",Math.ceil(1/Math.min(1,p)*100)+"%");var x=Math.round(e+n);x<0?l.setAttribute("y",x):(l.removeAttribute("y"),r+="padding-top: "+x+"px; "),a.setAttribute("style",r+"margin-left: "+Math.round(t+i)+"px;"),""!=(g+=0!=m?"rotate("+m+" "+t+" "+e+")":"")?u.setAttribute("transform",g):u.removeAttribute("transform"),1!=this.state.alpha?u.setAttribute("opacity",this.state.alpha):u.removeAttribute("opacity")})))},mxSvgCanvas2D.createCss=function(t,e,i,n,r,s,o,l,a,h,u,p,d){var c="box-sizing: border-box; font-size: 0; text-align: "+(i==mxConstants.ALIGN_LEFT?"left":i==mxConstants.ALIGN_RIGHT?"right":"center")+"; ",m=mxUtils.getAlignmentAsPoint(i,n),g="overflow: hidden; ",x="width: 1px; ",f="height: 1px; ",y=m.x*t,v=m.y*e;o?(x="width: "+Math.round(t)+"px; ",c+="max-height: "+Math.round(e)+"px; ",v=0):"fill"==s?(u+="width: 100%; height: 100%; ",c+=(x="width: "+Math.round(t)+"px; ")+(f="height: "+Math.round(e)+"px; ")):"width"==s?(u+="width: 100%; ",c+=x="width: "+Math.round(t)+"px; ",v=0,e>0&&(c+="max-height: "+Math.round(e)+"px; ")):(g="",v=0);var C="";null!=l&&(C+="background-color: "+l+"; "),null!=a&&(C+="border: 1px solid "+a+"; "),""==g||o?u+=C:c+=C,r&&t>0?(u+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",x="width: "+Math.round(t+2)+"px; ",""!=g&&"fill"!=s&&(v=0)):(u+="white-space: nowrap; ",""==g&&(y=0)),d(y,v,h+x+f,c+g,u,g)},mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state,e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection,i="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: "+(this.pointerEvents?this.pointerEventsValue:"none")+"; ";(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(i+="font-weight: bold; "),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(i+="font-style: italic; ");var n=[];return(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&(i+="text-decoration: "+n.join(" ")+"; "),i},mxSvgCanvas2D.prototype.text=function(t,e,i,n,r,s,o,l,a,h,u,p,d){if(this.textEnabled&&null!=r)if(p=null!=p?p:0,this.foEnabled&&"html"==a){var c=this.createDiv(r);null!=c&&(null!=d&&c.setAttribute("dir",d),this.addForeignObject(t,e,i,n,r,s,o,l,a,h,u,p,d,c,this.root))}else this.plainText(t+this.state.dx,e+this.state.dy,i,n,r,s,o,l,h,u,p,d)},mxSvgCanvas2D.prototype.createClip=function(t,e,i,n){for(var r="mx-clip-"+(t=Math.round(t))+"-"+(e=Math.round(e))+"-"+(i=Math.round(i))+"-"+(n=Math.round(n)),s=0,o=r+"-"+s;null!=document.getElementById(o);)o=r+"-"+ ++s;clip=this.createElement("clipPath"),clip.setAttribute("id",o);var l=this.createElement("rect");return l.setAttribute("x",t),l.setAttribute("y",e),l.setAttribute("width",i),l.setAttribute("height",n),clip.appendChild(l),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,i,n,r,s,o,l,a,h,u,p){u=null!=u?u:0;var d=this.state,c=d.fontSize,m=this.createElement("g"),g=d.transform||"";if(this.updateFont(m),0!=u&&(g+="rotate("+u+","+this.format(t*d.scale)+","+this.format(e*d.scale)+")"),null!=p&&m.setAttribute("direction",p),h&&i>0&&n>0){var x=t,f=e;s==mxConstants.ALIGN_CENTER?x-=i/2:s==mxConstants.ALIGN_RIGHT&&(x-=i),"fill"!=a&&(o==mxConstants.ALIGN_MIDDLE?f-=n/2:o==mxConstants.ALIGN_BOTTOM&&(f-=n));var y=this.createClip(x*d.scale-2,f*d.scale-2,i*d.scale+4,n*d.scale+4);if(null!=this.defs?this.defs.appendChild(y):this.root.appendChild(y),mxClient.IS_CHROMEAPP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)m.setAttribute("clip-path","url(#"+y.getAttribute("id")+")");else{var v=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");m.setAttribute("clip-path","url("+v+"#"+y.getAttribute("id")+")")}}var C=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=C&&m.setAttribute("text-anchor",C),this.styleEnabled&&c==mxConstants.DEFAULT_FONTSIZE||m.setAttribute("font-size",c*d.scale+"px"),g.length>0&&m.setAttribute("transform",g),d.alpha<1&&m.setAttribute("opacity",d.alpha);var E=r.split("\n"),S=Math.round(c*mxConstants.LINE_HEIGHT),b=c+(E.length-1)*S;f=e+c-1;if(o==mxConstants.ALIGN_MIDDLE)f-="fill"==a?n/2:(this.matchHtmlAlignment&&h&&n>0?Math.min(b,n):b)/2;else if(o==mxConstants.ALIGN_BOTTOM){if("fill"==a)f-=n;else f-=(this.matchHtmlAlignment&&h&&n>0?Math.min(b,n):b)+1}for(var T=0;T0&&mxUtils.trim(E[T]).length>0){var w=this.createElement("text");w.setAttribute("x",this.format(t*d.scale)+this.textOffset),w.setAttribute("y",this.format(f*d.scale)+this.textOffset),mxUtils.write(w,E[T]),m.appendChild(w)}f+=S}this.root.appendChild(m),this.addTextBackground(m,r,t,e,i,"fill"==a?n:b,s,o,a)},mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor),this.styleEnabled&&e.fontFamily==mxConstants.DEFAULT_FONTFAMILY||t.setAttribute("font-family",e.fontFamily),(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&t.setAttribute("font-weight","bold"),(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&t.setAttribute("font-style","italic");var i=[];(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&t.setAttribute("text-decoration",i.join(" "))},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,i,n,r,s,o,l,a){var h=this.state;if(null!=h.fontBackgroundColor||null!=h.fontBorderColor){var u=null;if("fill"==a||"width"==a)o==mxConstants.ALIGN_CENTER?i-=r/2:o==mxConstants.ALIGN_RIGHT&&(i-=r),l==mxConstants.ALIGN_MIDDLE?n-=s/2:l==mxConstants.ALIGN_BOTTOM&&(n-=s),u=new mxRectangle((i+1)*h.scale,n*h.scale,(r-2)*h.scale,(s+2)*h.scale);else if(null!=t.getBBox&&this.root.ownerDocument==document)try{u=t.getBBox();var p=mxClient.IS_IE&&mxClient.IS_SVG;u=new mxRectangle(u.x,u.y+(p?0:1),u.width,u.height+(p?1:0))}catch(t){}else{var d=document.createElement("div");d.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?h.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,d.style.fontSize=h.fontSize+"px",d.style.fontFamily=h.fontFamily,d.style.whiteSpace="nowrap",d.style.position="absolute",d.style.visibility="hidden",d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",d.style.zoom="1",(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),d.innerHTML=e.replace(/\n/g,"
"),document.body.appendChild(d);r=d.offsetWidth,s=d.offsetHeight;d.parentNode.removeChild(d),o==mxConstants.ALIGN_CENTER?i-=r/2:o==mxConstants.ALIGN_RIGHT&&(i-=r),l==mxConstants.ALIGN_MIDDLE?n-=s/2:l==mxConstants.ALIGN_BOTTOM&&(n-=s),u=new mxRectangle((i+1)*h.scale,(n+2)*h.scale,r*h.scale,(s+1)*h.scale)}if(null!=u){var c=this.createElement("rect");c.setAttribute("fill",h.fontBackgroundColor||"none"),c.setAttribute("stroke",h.fontBorderColor||"none"),c.setAttribute("x",Math.floor(u.x-1)),c.setAttribute("y",Math.floor(u.y-1)),c.setAttribute("width",Math.ceil(u.width+2)),c.setAttribute("height",Math.ceil(u.height));var m=null!=h.fontBorderColor?Math.max(1,this.format(h.scale)):0;c.setAttribute("stroke-width",m),this.root.ownerDocument==document&&1==mxUtils.mod(m,2)&&c.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(c,t.firstChild)}}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxSvgCanvas2D=void 0!==mxSvgCanvas2D?mxSvgCanvas2D:void 0;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this),this.root=t};function mxGuide(t,e){this.graph=t,this.setStates(e)}function mxShape(t){this.stencil=t,this.initStyles()}function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.createElement=function(t){return document.createElement(t)},mxVmlCanvas2D.prototype.createVmlElement=function(t){return this.createElement(mxClient.VML_PREFIX+":"+t)},mxVmlCanvas2D.prototype.addNode=function(t,e){var i=this.node,n=this.state;if(null!=i){if("shape"==i.nodeName){if(!(null!=this.path&&this.path.length>0))return;i.path=this.path.join(" ")+" e",i.style.width=this.root.style.width,i.style.height=this.root.style.height,i.coordsize=parseInt(i.style.width)+" "+parseInt(i.style.height)}i.strokeweight=this.format(Math.max(1,n.strokeWidth*n.scale/this.vmlScale))+"px",n.shadow&&this.root.appendChild(this.createShadow(i,t&&null!=n.fillColor,e&&null!=n.strokeColor)),e&&null!=n.strokeColor?(i.stroked="true",i.strokecolor=n.strokeColor):i.stroked="false",i.appendChild(this.createStroke()),t&&null!=n.fillColor?i.appendChild(this.createFill()):!this.pointerEvents||"shape"==i.nodeName&&this.path[this.path.length-1]!=this.closeOp?i.filled="false":i.appendChild(this.createTransparentFill()),this.root.appendChild(i)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");return t.src=mxClient.imageBasePath+"/transparent.gif",t.type="tile",t},mxVmlCanvas2D.prototype.createFill=function(){var t=this.state,e=this.createVmlElement("fill");if(e.color=t.fillColor,null!=t.gradientColor){e.type="gradient",e.method="none",e.color2=t.gradientColor;var i=180-t.rotation;t.gradientDirection==mxConstants.DIRECTION_WEST?i-=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_EAST?i+=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_NORTH?i-=180+("y"==this.root.style.flip?-180:0):i+="y"==this.root.style.flip?-180:0,"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(i*=-1),e.angle=mxUtils.mod(i,360),e.opacity=t.alpha*t.gradientFillAlpha*100+"%",e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else(t.alpha<1||t.fillAlpha<1)&&(e.opacity=t.alpha*t.fillAlpha*100+"%");return e},mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state,e=this.createVmlElement("stroke");return e.endcap=t.lineCap||"flat",e.joinstyle=t.lineJoin||"miter",e.miterlimit=t.miterLimit||"10",(t.alpha<1||t.strokeAlpha<1)&&(e.opacity=t.alpha*t.strokeAlpha*100+"%"),t.dashed&&(e.dashstyle=this.getVmlDashStyle()),e},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if("string"==typeof this.state.dashPattern){var e=this.state.dashPattern.split(" ");e.length>0&&1==e[0]&&(t="0 2")}return t},mxVmlCanvas2D.prototype.createShadow=function(t,e,i){var n=this.state,r=-n.rotation*(Math.PI/180),s=Math.cos(r),o=Math.sin(r),l=n.shadowDx*n.scale,a=n.shadowDy*n.scale;"x"==this.root.style.flip?l*=-1:"y"==this.root.style.flip&&(a*=-1);var h=t.cloneNode(!0);return h.style.marginLeft=Math.round(l*s-a*o)+"px",h.style.marginTop=Math.round(l*o+a*s)+"px",8==document.documentMode&&(h.strokeweight=t.strokeweight,"shape"==t.nodeName&&(h.path=this.path.join(" ")+" e",h.style.width=this.root.style.width,h.style.height=this.root.style.height,h.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height))),i?(h.strokecolor=n.shadowColor,h.appendChild(this.createShadowStroke())):h.stroked="false",e?h.appendChild(this.createShadowFill()):h.filled="false",h},mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");return t.color=this.state.shadowColor,t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();return t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.rotate=function(t,e,i,n,r){e&&i?t+=180:e?this.root.style.flip="x":i&&(this.root.style.flip="y"),(e?!i:i)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=n,this.state.rotationCy=r},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createVmlElement("shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(t,e,i,n){var r=this.state,s=(this.lastX+r.dx)*r.scale,o=(this.lastY+r.dy)*r.scale,l=(t+r.dx)*r.scale,a=(e+r.dy)*r.scale,h=(i+r.dx)*r.scale,u=(n+r.dy)*r.scale,p=s+2/3*(l-s),d=o+2/3*(a-o),c=h+2/3*(l-h),m=u+2/3*(a-u);this.path.push("c "+this.format(p)+" "+this.format(d)+" "+this.format(c)+" "+this.format(m)+" "+this.format(h)+" "+this.format(u)),this.lastX=h/r.scale-r.dx,this.lastY=u/r.scale-r.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,i,n,r){var s=this.state,o=this.createVmlElement(t);return o.style.position="absolute",o.style.left=this.format((e+s.dx)*s.scale)+"px",o.style.top=this.format((i+s.dy)*s.scale)+"px",o.style.width=this.format(n*s.scale)+"px",o.style.height=this.format(r*s.scale)+"px",o},mxVmlCanvas2D.prototype.rect=function(t,e,i,n){this.node=this.createRect("rect",t,e,i,n)},mxVmlCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){this.node=this.createRect("roundrect",t,e,i,n),this.node.setAttribute("arcsize",Math.max(100*r/i,100*s/n)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,i,n){this.node=this.createRect("oval",t,e,i,n)},mxVmlCanvas2D.prototype.image=function(t,e,i,n,r,s,o,l){var a=null;if(s){(a=this.createRect("rect",t,e,i,n)).stroked="false";var h=this.createVmlElement("fill");h.aspect=s?"atmost":"ignore",h.rotate="true",h.type="frame",h.src=r,a.appendChild(h)}else(a=this.createRect("image",t,e,i,n)).src=r;o&&l?a.style.rotation="180":o?a.style.flip="x":l&&(a.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(a.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(a)},mxVmlCanvas2D.prototype.createDiv=function(t,e,i,n){var r=this.createElement("div"),s=this.state,o="";if(null!=s.fontBackgroundColor&&(o+="background-color:"+mxUtils.htmlEntities(s.fontBackgroundColor)+";"),null!=s.fontBorderColor&&(o+="border:1px solid "+mxUtils.htmlEntities(s.fontBorderColor)+";"),mxUtils.isNode(t))r.appendChild(t);else if("fill"!=n&&"width"!=n){var l=this.createElement("div");l.style.cssText=o,l.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",l.style.zoom="1",l.style.textDecoration="inherit",l.innerHTML=t,r.appendChild(l)}else r.style.cssText=o,r.innerHTML=t;var a=r.style;return a.fontSize=s.fontSize/this.vmlScale+"px",a.fontFamily=s.fontFamily,a.color=s.fontColor,a.verticalAlign="top",a.textAlign=e||"left",a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?s.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(s.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a.fontWeight="bold"),(s.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a.fontStyle="italic"),(s.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a.textDecoration="underline"),r},mxVmlCanvas2D.prototype.text=function(t,e,i,n,r,s,o,l,a,h,u,p,d){if(this.textEnabled&&null!=r){var c=this.state;if("html"==a){if(null!=c.rotation){var m=this.rotatePoint(t,e,c.rotation,c.rotationCx,c.rotationCy);t=m.x,e=m.y}8!=document.documentMode||mxClient.IS_EM?(t*=c.scale,e*=c.scale):(t+=c.dx,e+=c.dy,"fill"!=h&&o==mxConstants.ALIGN_TOP&&(e-=1));var g=8!=document.documentMode||mxClient.IS_EM?this.createElement("div"):this.createVmlElement("group");g.style.position="absolute",g.style.display="inline",g.style.left=this.format(t)+"px",g.style.top=this.format(e)+"px",g.style.zoom=c.scale;var x=this.createElement("div");x.style.position="relative",x.style.display="inline";var f=mxUtils.getAlignmentAsPoint(s,o),y=f.x,v=f.y,C=this.createDiv(r,s,o,h),E=this.createElement("div");if(null!=d&&C.setAttribute("dir",d),l&&i>0){if(u||(C.style.width=Math.round(i)+"px"),C.style.wordWrap=mxConstants.WORD_WRAP,C.style.whiteSpace="normal","break-word"==C.style.wordWrap)null!=(R=C).firstChild&&"DIV"==R.firstChild.nodeName&&(R.firstChild.style.width="100%")}else C.style.whiteSpace="nowrap";var S=c.rotation+(p||0);if(this.rotateHtml&&0!=S?(E.style.display="inline",E.style.zoom="1",E.appendChild(C),8!=document.documentMode||mxClient.IS_EM||"DIV"==this.root.nodeName?g.appendChild(E):(x.appendChild(E),g.appendChild(x))):8!=document.documentMode||mxClient.IS_EM?(C.style.display="inline",g.appendChild(C)):(x.appendChild(C),g.appendChild(x)),"DIV"!=this.root.nodeName){var b=this.createVmlElement("rect");b.stroked="false",b.filled="false",b.appendChild(g),this.root.appendChild(b)}else this.root.appendChild(g);if(u?(C.style.overflow="hidden",C.style.width=Math.round(i)+"px",mxClient.IS_QUIRKS||(C.style.maxHeight=Math.round(n)+"px")):"fill"==h?(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.height=Math.max(0,n)+1+"px"):"width"==h&&(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.maxHeight=Math.max(0,n)+1+"px"),this.rotateHtml&&0!=S){var T=S*(Math.PI/180),w=parseFloat(parseFloat(Math.cos(T)).toFixed(8)),L=parseFloat(parseFloat(Math.sin(-T)).toFixed(8));(T%=2*Math.PI)<0&&(T+=2*Math.PI),(T%=Math.PI)>Math.PI/2&&(T=Math.PI-T);var A=Math.cos(T),I=Math.sin(T);8!=document.documentMode||mxClient.IS_EM||(C.style.display="inline-block",E.style.display="inline-block",x.style.display="inline-block"),C.style.visibility="hidden",C.style.position="absolute",document.body.appendChild(C);var O=C;null!=O.firstChild&&"DIV"==O.firstChild.nodeName&&(O=O.firstChild);var R=O.offsetWidth+3,M=O.offsetHeight;u?(i=Math.min(i,R),M=Math.min(M,n)):i=R,l&&(C.style.width=i+"px"),mxClient.IS_QUIRKS&&(u||"width"==h)&&M>n&&(M=n,C.style.height=M+"px");var P=((n=M)-n*A+i*-I)/2-L*i*(y+.5)+w*n*(v+.5),N=(i-i*A+n*-I)/2+w*i*(y+.5)+L*n*(v+.5);if("group"==g.nodeName&&"DIV"==this.root.nodeName){var _=this.createElement("div");_.style.display="inline-block",_.style.position="absolute",_.style.left=this.format(t+(N-i/2)*c.scale)+"px",_.style.top=this.format(e+(P-n/2)*c.scale)+"px",g.parentNode.appendChild(_),_.appendChild(g)}else{var D=8!=document.documentMode||mxClient.IS_EM?c.scale:1;g.style.left=this.format(t+(N-i/2)*D)+"px",g.style.top=this.format(e+(P-n/2)*D)+"px"}E.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+w+", M12="+L+", M21="+-L+", M22="+w+", sizingMethod='auto expand')",E.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(E.style.filter+="alpha(opacity="+100*this.state.alpha+")"),E.appendChild(C),C.style.position="",C.style.visibility=""}else if(8!=document.documentMode||mxClient.IS_EM){C.style.verticalAlign="top",this.state.alpha<1&&(g.style.filter="alpha(opacity="+100*this.state.alpha+")");var H=C.parentNode;C.style.visibility="hidden",document.body.appendChild(C),i=C.offsetWidth;M=C.offsetHeight;mxClient.IS_QUIRKS&&u&&M>n&&(M=n,C.style.height=M+"px"),n=M,C.style.visibility="",H.appendChild(C),g.style.left=this.format(t+i*y*this.state.scale)+"px",g.style.top=this.format(e+n*v*this.state.scale)+"px"}else this.state.alpha<1&&(C.style.filter="alpha(opacity="+100*this.state.alpha+")"),x.style.left=100*y+"%",x.style.top=100*v+"%"}else this.plainText(t,e,i,n,mxUtils.htmlEntities(r,!1),s,o,l,a,h,u,p,d)}},mxVmlCanvas2D.prototype.plainText=function(t,e,i,n,r,s,o,l,a,h,u,p,d){var c=this.state;t=(t+c.dx)*c.scale,e=(e+c.dy)*c.scale;var m=this.createVmlElement("shape");m.style.width="1px",m.style.height="1px",m.stroked="false";var g=this.createVmlElement("fill");g.color=c.fontColor,g.opacity=100*c.alpha+"%",m.appendChild(g);var x=this.createVmlElement("path");x.textpathok="true",x.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),m.appendChild(x);var f=this.createVmlElement("textpath");f.style.cssText="v-text-align:"+s,f.style.align=s,f.style.fontFamily=c.fontFamily,f.string=r,f.on="true";var y=c.fontSize*c.scale/this.vmlScale;f.style.fontSize=y+"px",(c.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(c.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),(c.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(f.style.textDecoration="underline");var v=y+(r.split("\n").length-1)*y*mxConstants.LINE_HEIGHT,C=0,E=0;if(o==mxConstants.ALIGN_BOTTOM?E=-v/2:o!=mxConstants.ALIGN_MIDDLE&&(E=v/2),null!=p){m.style.rotation=p;var S=p*(Math.PI/180);C=Math.sin(S)*E,E=Math.cos(S)*E}m.appendChild(f),m.style.left=this.format(t-C)+"px",m.style.top=this.format(e+E)+"px",this.root.appendChild(m)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxVmlCanvas2D=void 0!==mxVmlCanvas2D?mxVmlCanvas2D:void 0,mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.rounded=!1,mxGuide.prototype.tolerance=2,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},mxGuide.prototype.getGuideTolerance=function(t){return t&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance},mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);return e.isDashed=!0,e},mxGuide.prototype.isStateIgnored=function(t){return!1},mxGuide.prototype.move=function(t,e,i,n){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=t&&null!=e){this.graph.getView().translate;var r=this.graph.getView().scale,s=this.getGuideTolerance(i)*r,o=t.clone();o.x+=e.x,o.y+=e.y;var l=!1,a=null,h=null,u=!1,p=null,d=null,c=s,m=s,g=o.x,x=o.x+o.width,f=o.getCenterX(),y=o.y,v=o.y+o.height,C=o.getCenterY();function E(i,n,r){i+=this.graph.panDx;var s=!1;r&&Math.abs(i-f)<=c?(e.x=i-t.getCenterX(),c=Math.abs(i-f),s=!0):r||(Math.abs(i-g)<=c?(e.x=i-t.x,c=Math.abs(i-g),s=!0):Math.abs(i-x)<=c&&(e.x=i-t.x-t.width,c=Math.abs(i-x),s=!0)),s&&(a=n,h=Math.round(i-this.graph.panDx),null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()))),l=l||s}function S(i,n,r){i+=this.graph.panDy;var s=!1;r&&Math.abs(i-C)<=m?(e.y=i-t.getCenterY(),m=Math.abs(i-C),s=!0):r||(Math.abs(i-y)<=m?(e.y=i-t.y,m=Math.abs(i-y),s=!0):Math.abs(i-v)<=m&&(e.y=i-t.y-t.height,m=Math.abs(i-v),s=!0)),s&&(p=n,d=Math.round(i-this.graph.panDy),null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()))),u=u||s}for(var b=0;b0&&null!=t[0]){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e0&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&this.bounds.width>0&&this.bounds.height>0},mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();null!=t&&(t.pointerEvents=this.pointerEvents,this.paint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return null!=this.node.ownerSVGElement?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),null!=t&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),null!=this.isDashed&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents,t.blockImagePointerEvents=mxClient.IS_FF;var e=this.getSvgScreenOffset();return 0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t},mxShape.prototype.createVmlCanvas=function(){var t=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t,!1);if(""!=t.tagUrn){var i=Math.max(1,Math.round(this.bounds.width)),n=Math.max(1,Math.round(this.bounds.height));t.coordsize=i*this.vmlScale+","+n*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var r=this.scale;return e.translate(-Math.round(this.bounds.x/r),-Math.round(this.bounds.y/r)),e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var t=Math.max(1,Math.round(this.bounds.width)),e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px",this.node.style.height=e+"px",this.node.style.overflow="visible"},mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxShape.prototype.updateHtmlFilters=function(t){var e="";if(this.opacity<100&&(e+="alpha(opacity="+this.opacity+")"),this.isShadow&&(e+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')"),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var i=this.fill,n=this.gradient,r="0",s={east:0,south:1,west:2,north:3},o=null!=this.direction?s[this.direction]:0;if(null!=this.gradientDirection&&(o=mxUtils.mod(o+s[this.gradientDirection]-1,4)),1==o){r="1";var l=i;i=n,n=l}else if(2==o){l=i;i=n,n=l}else 3==o&&(r="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+i+"', endColorStr='"+n+"', gradientType='"+r+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;null!=e&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":this.strokewidth>0&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",null!=(e=this.outline?null:this.fill)&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(t):this.setTransparentBackgroundImage(t)},mxShape.prototype.updateHtmlBounds=function(t){var e=document.documentMode>=9?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px",t.style.overflow="hidden",t.style.left=Math.round(this.bounds.x-e/2)+"px",t.style.top=Math.round(this.bounds.y-e/2)+"px","CSS1Compat"==document.compatMode&&(e=-e),t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px",t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"},mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var i=t.gradients[e];null!=i&&(i.mxRefCount=(i.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients),this.oldGradients=t.gradients}},mxShape.prototype.paint=function(t){var e=!1;if(null!=t&&this.outline){var i=t.stroke;t.stroke=function(){e=!0,i.apply(this,arguments)};var n=t.fillAndStroke;t.fillAndStroke=function(){e=!0,n.apply(this,arguments)}}var r=this.scale,s=this.bounds.x/r,o=this.bounds.y/r,l=this.bounds.width/r,a=this.bounds.height/r;if(this.isPaintBoundsInverted()){var h=(l-a)/2;s+=h,o-=h;var u=l;l=a,a=u}this.updateTransform(t,s,o,l,a),this.configureCanvas(t,s,o,l,a);var p=null;if(null==this.stencil&&null==this.points&&this.shapePointerEvents||null!=this.stencil&&this.stencilPointerEvents){var d=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG)p=this.createTransparentSvgRectangle(d.x,d.y,d.width,d.height),this.node.appendChild(p);else{var c=t.createRect("rect",d.x/r,d.y/r,d.width/r,d.height/r);c.appendChild(t.createTransparentFill()),c.stroked="false",t.root.appendChild(c)}}if(null!=this.stencil)this.stencil.drawShape(t,this,s,o,l,a);else if(t.setStrokeWidth(this.strokewidth),null!=this.points){for(var m=[],g=0;g0){o=null==o||o;var l=e[e.length-1];if(r&&i){var a=(e=e.slice())[0],h=new mxPoint(l.x+(a.x-l.x)/2,l.y+(a.y-l.y)/2);e.splice(0,0,h)}var u=e[0],p=1;for(o?t.moveTo(u.x,u.y):t.lineTo(u.x,u.y);p<(r?e.length:e.length-1);){var d=e[mxUtils.mod(p,e.length)],c=u.x-d.x,m=u.y-d.y;if(i&&(0!=c||0!=m)&&(null==s||mxUtils.indexOf(s,p-1)<0)){var g=Math.sqrt(c*c+m*m),x=c*Math.min(n,g/2)/g,f=m*Math.min(n,g/2)/g,y=d.x+x,v=d.y+f;t.lineTo(y,v);for(var C=e[mxUtils.mod(p+1,e.length)];p0&&t.height>0)return this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),void this.boundingBox.grow(this.strokewidth*this.scale/2)}catch(t){}if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var i=this.getShapeRotation();0!=i&&(e=mxUtils.getBoundingBox(e,i))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){this.isShadow&&(t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)),t.grow(this.strokewidth*this.scale/2)},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,i,n){var r=document.createElementNS(mxConstants.NS_SVG,"rect");return r.setAttribute("x",t),r.setAttribute("y",e),r.setAttribute("width",i),r.setAttribute("height",n),r.setAttribute("fill","none"),r.setAttribute("stroke","none"),r.setAttribute("pointer-events","all"),r},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(null!=t)for(var e in t){var i=t[e];null!=i&&(i.mxRefCount=(i.mxRefCount||0)-1,0==i.mxRefCount&&null!=i.parentNode&&i.parentNode.removeChild(i))}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},__mxOutput.mxShape=void 0!==mxShape?mxShape:void 0,mxUtils.extend(mxStencil,mxShape),mxStencil.defaultLocalized=!1,mxStencil.allowEval=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var t=this.desc.getAttribute("aspect");this.aspect=null!=t?t:"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(null!=t){var e=mxUtils.getChildNodes(t);if(null!=e&&e.length>0){this.constraints=[];for(var i=0;i0&&s>0)for(var u=o.firstChild;null!=u;)u.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,u,l,a,h),u=u.nextSibling},mxStencil.prototype.computeAspect=function(t,e,i,n,r,s){var o=e,l=i,a=n/this.w0,h=r/this.h0,u=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH;if(u){h=n/this.h0,a=r/this.w0;var p=(n-r)/2;o+=p,l-=p}return"fixed"==this.aspect&&(a=h=Math.min(a,h),u?(o+=(r-this.w0*a)/2,l+=(n-this.h0*h)/2):(o+=(n-this.w0*a)/2,l+=(r-this.h0*h)/2)),new mxRectangle(o,l,a,h)},mxStencil.prototype.drawNode=function(t,e,i,n,r,s){var o=i.nodeName,l=n.x,a=n.y,h=n.width,u=n.height,p=Math.min(h,u);if("save"==o)t.save();else if("restore"==o)t.restore();else if(s){if("path"==o){t.begin();var d=!0;if("1"==i.getAttribute("rounded")){d=!1;for(var c=Number(i.getAttribute("arcSize")),m=0,g=[],x=i.firstChild;null!=x;){if(x.nodeType==mxConstants.NODETYPE_ELEMENT){var f=x.nodeName;if("move"!=f&&"line"!=f){d=!0;break}"move"!=f&&0!=g.length||g.push([]),g[g.length-1].push(new mxPoint(l+Number(x.getAttribute("x"))*h,a+Number(x.getAttribute("y"))*u)),m++}x=x.nextSibling}if(!d&&m>0)for(var y=0;y0&&V.push(Number(U[y])*p);G=V.join(" "),t.setDashPattern(G)}}else"strokecolor"==o?t.setStrokeColor(i.getAttribute("color")):"linecap"==o?t.setLineCap(i.getAttribute("cap")):"linejoin"==o?t.setLineJoin(i.getAttribute("join")):"miterlimit"==o?t.setMiterLimit(Number(i.getAttribute("limit"))):"fillcolor"==o?t.setFillColor(i.getAttribute("color")):"alpha"==o||"fillalpha"==o||"strokealpha"==o?t.setAlpha(i.getAttribute("alpha")):"fontcolor"==o?t.setFontColor(i.getAttribute("color")):"fontstyle"==o?t.setFontStyle(i.getAttribute("style")):"fontfamily"==o?t.setFontFamily(i.getAttribute("family")):"fontsize"==o&&t.setFontSize(Number(i.getAttribute("size"))*p);!r||"fillstroke"!=o&&"fill"!=o&&"stroke"!=o||(r=!1,t.setShadow(!1))}},__mxOutput.mxStencil=void 0!==mxStencil?mxStencil:void 0;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=void 0!==mxStencilRegistry?mxStencilRegistry:void 0;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,i,n,r,s,o,l,a,h){var u=mxMarker.markers[i];return null!=u?u(t,e,i,n,r,s,o,l,a,h):null}};function mxActor(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxCloud(t,e,i,n){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxRectangleShape(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxDoubleEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxRhombus(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxPolyline(t,e,i){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=null!=i?i:1}function mxArrow(t,e,i,n,r,s,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1,this.arrowWidth=null!=r?r:mxConstants.ARROW_WIDTH,this.spacing=null!=s?s:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxArrowConnector(t,e,i,n,r,s,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1,this.arrowWidth=null!=r?r:mxConstants.ARROW_WIDTH,this.arrowSpacing=null!=s?s:mxConstants.ARROW_SPACING,this.startSize=mxConstants.ARROW_SIZE/5,this.endSize=mxConstants.ARROW_SIZE/5}function mxText(t,e,i,n,r,s,o,l,a,h,u,p,d,c,m,g,x,f,y,v,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=null!=r?r:"black",this.align=null!=i?i:mxConstants.ALIGN_CENTER,this.valign=null!=n?n:mxConstants.ALIGN_MIDDLE,this.family=null!=s?s:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=l?l:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(a||2),this.spacingTop=this.spacing+parseInt(h||0),this.spacingRight=this.spacing+parseInt(u||0),this.spacingBottom=this.spacing+parseInt(p||0),this.spacingLeft=this.spacing+parseInt(d||0),this.horizontal=null==c||c,this.background=m,this.border=g,this.wrap=null!=x&&x,this.clipped=null!=f&&f,this.overflow=null!=y?y:"visible",this.labelPadding=null!=v?v:0,this.textDirection=C,this.rotation=0,this.updateMargin()}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(t,e,i){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=null!=i?i:1}function mxImageShape(t,e,i,n,r){mxShape.call(this),this.bounds=t,this.image=e,this.fill=i,this.stroke=n,this.strokewidth=null!=r?r:1,this.shadow=!1}function mxLabel(t,e,i,n){mxRectangleShape.call(this,t,e,i,n)}function mxCylinder(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxConnector(t,e,i){mxPolyline.call(this,t,e,i)}function mxSwimlane(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxGraphLayout(t){this.graph=t}function WeightedCellSorter(t,e){this.cell=t,this.weightedValue=e}function mxStackLayout(t,e,i,n,r,s){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=null!=i?i:0,this.x0=null!=n?n:0,this.y0=null!=r?r:0,this.border=null!=s?s:0}function mxPartitionLayout(t,e,i,n){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=i||0,this.border=n||0}function mxCompactTreeLayout(t,e,i){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.invert=null!=i&&i}function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}function mxFastOrganicLayout(t){mxGraphLayout.call(this,t)}function mxCircleLayout(t,e){mxGraphLayout.call(this,t),this.radius=null!=e?e:100}function mxParallelEdgeLayout(t){mxGraphLayout.call(this,t)}function mxCompositeLayout(t,e,i){mxGraphLayout.call(this,t),this.layouts=e,this.master=i}function mxEdgeLabelLayout(t,e){mxGraphLayout.call(this,t)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=t,this.id=mxObjectIdentity.get(t),this.connectsAsTarget=[],this.connectsAsSource=[]}function mxGraphHierarchyEdge(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=t,this.ids=[];for(var e=0;e0){var p=u[0],d=t.getVisibleTerminal(p,!1),c=this.vertexMapper.get(d);s[o]==c&&(d=t.getVisibleTerminal(p,!0),c=this.vertexMapper.get(d)),null!=c&&s[o]!=c&&(h.target=c,0==c.connectsAsTarget.length&&(c.connectsAsTarget=[]),mxUtils.indexOf(c.connectsAsTarget,h)<0&&c.connectsAsTarget.push(h))}}s[o].temp[0]=1}}function mxSwimlaneModel(t,e,i,n,r){t.getGraph(),this.tightenToSource=r,this.roots=i,this.parent=n,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var s=[];null==e&&(e=this.graph.getChildVertices(n)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,s);for(var o=0;o0){var p=u[0],d=t.getVisibleTerminal(p,!1),c=this.vertexMapper.get(d);s[o]==c&&(d=t.getVisibleTerminal(p,!0),c=this.vertexMapper.get(d)),null!=c&&s[o]!=c&&(h.target=c,0==c.connectsAsTarget.length&&(c.connectsAsTarget=[]),mxUtils.indexOf(c.connectsAsTarget,h)<0&&c.connectsAsTarget.push(h))}}s[o].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(t){this.layout=t}function MedianCellSorter(){}function mxMinimumCycleRemover(t){this.layout=t}function mxCoordinateAssignment(t,e,i,n,r,s){this.layout=t,this.intraCellSpacing=e,this.interRankCellSpacing=i,this.orientation=n,this.initialX=r,this.parallelEdgeSpacing=s}function mxSwimlaneOrdering(t){this.layout=t}function mxHierarchicalLayout(t,e,i){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==i||i}!function(){function t(t){return t=null!=t?t:2,function(e,i,n,r,s,o,l,a,h,u){var p=s*h*1.118,d=o*h*1.118;s*=l+h,o*=l+h;var c=r.clone();c.x-=p,c.y-=d;var m=n!=mxConstants.ARROW_CLASSIC&&n!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;return r.x+=-s*m-p,r.y+=-o*m-d,function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-s-o/t,c.y-o+s/t),n!=mxConstants.ARROW_CLASSIC&&n!=mxConstants.ARROW_CLASSIC_THIN||e.lineTo(c.x-3*s/4,c.y-3*o/4),e.lineTo(c.x+o/t-s,c.y-o-s/t),e.close(),u?e.fillAndStroke():e.stroke()}}}function e(t){return t=null!=t?t:2,function(e,i,n,r,s,o,l,a,h,u){var p=s*h*1.118,d=o*h*1.118;s*=l+h,o*=l+h;var c=r.clone();return c.x-=p,c.y-=d,r.x+=2*-p,r.y+=2*-d,function(){e.begin(),e.moveTo(c.x-s-o/t,c.y-o+s/t),e.lineTo(c.x,c.y),e.lineTo(c.x+o/t-s,c.y-o-s/t),e.stroke()}}}function i(t,e,i,n,r,s,o,l,a,h){var u=i==mxConstants.ARROW_DIAMOND?.7071:.9862,p=r*a*u,d=s*a*u;r*=o+a,s*=o+a;var c=n.clone();c.x-=p,c.y-=d,n.x+=-r-p,n.y+=-s-d;var m=i==mxConstants.ARROW_DIAMOND?2:3.4;return function(){t.begin(),t.moveTo(c.x,c.y),t.lineTo(c.x-r/2-s/m,c.y+r/m-s/2),t.lineTo(c.x-r,c.y-s),t.lineTo(c.x-r/2+s/m,c.y-s/2-r/m),t.close(),h?t.fillAndStroke():t.stroke()}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3)),mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",(function(t,e,i,n,r,s,o,l,a,h){var u=o/2,p=n.clone();return n.x-=r*u,n.y-=s*u,function(){t.ellipse(p.x-u,p.y-u,o,o),h?t.fillAndStroke():t.stroke()}})),mxMarker.addMarker("diamond",i),mxMarker.addMarker("diamondThin",i)}(),__mxOutput.mxMarker=void 0!==mxMarker?mxMarker:void 0,mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,i,n,r){var s=n/3;t.moveTo(0,r),t.curveTo(0,3*r/5,0,2*r/5,n/2,2*r/5),t.curveTo(n/2-s,2*r/5,n/2-s,0,n/2,0),t.curveTo(n/2+s,0,n/2+s,2*r/5,n/2,2*r/5),t.curveTo(n,2*r/5,n,3*r/5,n,r),t.close()},__mxOutput.mxActor=void 0!==mxActor?mxActor:void 0,mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,i,n,r){t.moveTo(.25*n,.25*r),t.curveTo(.05*n,.25*r,0,.5*r,.16*n,.55*r),t.curveTo(0,.66*r,.18*n,.9*r,.31*n,.8*r),t.curveTo(.4*n,r,.7*n,r,.8*n,.8*r),t.curveTo(n,.8*r,n,.6*r,.875*n,.5*r),t.curveTo(n,.3*r,.8*n,.1*r,.625*n,.2*r),t.curveTo(.5*n,.05*r,.3*n,.05*r,.25*n,.25*r),t.close()},__mxOutput.mxCloud=void 0!==mxCloud?mxCloud:void 0,mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return null!=this.style&&(t="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),!this.isRounded&&!this.glass&&0==this.rotation&&(t||null!=this.fill&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,i,n,r){var s=!0;if(null!=this.style&&(s="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),s||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE){if(s||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isRounded){var o=0;if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))o=Math.min(n/2,Math.min(r/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;o=Math.min(n*l,r*l)}t.roundrect(e,i,n,r,o,o)}else t.rect(e,i,n,r);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,i,n,r){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,i,n,r){this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,i,n,r,this.getArcSize(n+this.strokewidth,r+this.strokewidth))},__mxOutput.mxRectangleShape=void 0!==mxRectangleShape?mxRectangleShape:void 0,mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},__mxOutput.mxEllipse=void 0!==mxEllipse?mxEllipse:void 0,mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,i,n,r){if(!this.outline){var s=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(n/5,r/5)));e+=s,i+=s,r-=2*s,(n-=2*s)>0&&r>0&&t.ellipse(e,i,n,r),t.stroke()}},mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},__mxOutput.mxDoubleEllipse=void 0!==mxDoubleEllipse?mxDoubleEllipse:void 0,mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,i,n,r){var s=n/2,o=r/2,l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+s,i),new mxPoint(e+n,i+o),new mxPoint(e+s,i+r),new mxPoint(e,i+o)],this.isRounded,l,!0),t.fillAndStroke()},__mxOutput.mxRhombus=void 0!==mxRhombus?mxRhombus:void 0,mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.getShapeRotation=function(){return 0},mxPolyline.prototype.isPaintBoundsInverted=function(){return!1},mxPolyline.prototype.paintEdgeShape=function(t,e){var i=t.pointerEventsValue;t.pointerEventsValue="stroke",null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=i},mxPolyline.prototype.paintLine=function(t,e,i){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,i,n,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var i=e[0],n=e.length;t.moveTo(i.x,i.y);for(var r=1;r2&&t.setMiterLimit(1.42),t.begin();var A=C,I=S;if(l&&!o)this.paintMarker(t,e[0].x,e[0].y,C,S,u,n,s,h,!0);else{var O=e[0].x+T/2+h*C,R=e[0].y+w/2+h*S,M=e[0].x-T/2+h*C,P=e[0].y-w/2+h*S;o?(t.moveTo(O,R),L.push((function(){t.lineTo(M,P)}))):(t.moveTo(M,P),t.lineTo(O,R))}for(var N=0,_=0,D=0,H=0;H=0;H--)L[H]();o?(t.end(),t.stroke()):(t.close(),t.fillAndStroke()),t.setShadow(!1),t.setMiterLimit(4),d&&t.setLineJoin("flat"),e.length>2&&(t.setMiterLimit(4),l&&!o&&(t.begin(),this.paintMarker(t,e[0].x,e[0].y,A,I,u,n,s,h,!0),t.stroke(),t.end()),a&&!o&&(t.begin(),this.paintMarker(t,c.x,c.y,-C,-S,p,r,s,h,!0),t.stroke(),t.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,i,n,r,s,o,l,a,h){var u=l/o,p=l*r/2,d=-l*n/2,c=(a+s)*n,m=(a+s)*r;h?t.moveTo(e-p+c,i-d+m):t.lineTo(e-p+c,i-d+m),t.lineTo(e-p/u+c,i-d/u+m),t.lineTo(e+a*n,i+a*r),t.lineTo(e+p/u+c,i+d/u+m),t.lineTo(e+p+c,i+d+m)},mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded},mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3},mxArrowConnector.prototype.isOpenEnded=function(){return!1},mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE},mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE},__mxOutput.mxArrowConnector=void 0!==mxArrowConnector?mxArrowConnector:void 0,mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=8!=document.documentMode||mxClient.IS_EM?3:4,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var i=this.scale,n=this.bounds.x/i,r=this.bounds.y/i,s=this.bounds.width/i,o=this.bounds.height/i;if(this.updateTransform(t,n,r,s,o),this.configureCanvas(t,n,r,s,o),e)t.updateText(n,r,s,o,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var l=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,a=l||t instanceof mxVmlCanvas2D?"html":"",h=this.value;l||"html"!=a||(h=mxUtils.htmlEntities(h,!1)),"html"!=a||mxUtils.isNode(this.value)||(h=mxUtils.replaceTrailingNewlines(h,"

")),h=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==a?h.replace(/\n/g,"
"):h;var u=this.textDirection;u!=mxConstants.TEXT_DIRECTION_AUTO||l||(u=this.getAutoDirection()),u!=mxConstants.TEXT_DIRECTION_LTR&&u!=mxConstants.TEXT_DIRECTION_RTL&&(u=null),t.text(n,r,s,o,h,this.align,this.valign,this.wrap,a,this.overflow,this.clipped,this.getTextRotation(),u)}},mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML))if("DIV"!=this.node.nodeName||!this.isHtmlAllowed()&&mxClient.IS_VML){var t=this.createCanvas();null!=t&&null!=t.updateText?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null},mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments),this.color="black",this.align=mxConstants.ALIGN_CENTER,this.valign=mxConstants.ALIGN_MIDDLE,this.family=mxConstants.DEFAULT_FONTFAMILY,this.size=mxConstants.DEFAULT_FONTSIZE,this.fontStyle=mxConstants.DEFAULT_FONTSTYLE,this.spacing=2,this.spacingTop=2,this.spacingRight=2,this.spacingBottom=2,this.spacingLeft=2,this.horizontal=!0,delete this.background,delete this.border,this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION,delete this.margin},mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments),null!=this.style&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin()),this.flipV=null,this.flipH=null},mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=t&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return null!=t&&(t=null==t.ownerSVGElement?this.node.firstChild.firstChild:t.firstChild.firstChild.firstChild.firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),i=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,n=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!(this.ignoreStringSize||null==t||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize&&i==mxConstants.ALIGN_CENTER&&n==mxConstants.ALIGN_MIDDLE)){var r=null,s=null;if(null!=t.ownerSVGElement)if(null!=t.firstChild&&null!=t.firstChild.firstChild&&"foreignObject"==t.firstChild.firstChild.nodeName)s=(t=t.firstChild.firstChild.firstChild.firstChild).offsetHeight*this.scale,r="width"==this.overflow?this.boundingBox.width:t.offsetWidth*this.scale;else try{var o=t.getBBox();return void("string"==typeof this.value&&0==mxUtils.trim(this.value)||0==o.width&&0==o.height?this.boundingBox=null:this.boundingBox=new mxRectangle(o.x,o.y,o.width,o.height))}catch(t){}else{var l=null!=this.state?this.state.view.textDiv:null;if(null!=this.offsetWidth&&null!=this.offsetHeight)r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale;else{null!=l&&(this.updateFont(l),this.updateSize(l,!1),this.updateInnerHtml(l),t=l);var a=t;if(8!=document.documentMode||mxClient.IS_EM)null!=a.firstChild&&"DIV"==a.firstChild.nodeName&&(a=a.firstChild);else{var h=Math.round(this.bounds.width/this.scale);if(this.wrap&&h>0){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal","break-word"!=t.style.wordWrap){var u=a.getElementsByTagName("div");u.length>0&&(a=u[u.length-1]),r=a.offsetWidth+2,u=this.node.getElementsByTagName("div"),this.clipped&&(r=Math.min(h,r)),u.length>1&&(u[u.length-2].style.width=r+"px")}}else t.style.whiteSpace="nowrap"}this.offsetWidth=a.offsetWidth+this.textWidthPadding,this.offsetHeight=a.offsetHeight,r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale}}null!=r&&null!=s&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,r,s))}if(null!=this.boundingBox)if(0!=e){var p=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0));this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=p.x,this.boundingBox.y+=p.y,this.boundingBox.width=p.width,this.boundingBox.height=p.height}else this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,i,n,r){mxShape.prototype.configureCanvas.apply(this,arguments),t.setFontColor(this.color),t.setFontBackgroundColor(this.background),t.setFontBorderColor(this.border),t.setFontFamily(this.family),t.setFontSize(this.size),t.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.getHtmlValue=function(){var t=this.value;return this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t},mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e="display: inline-block; font-size: "+this.size+"px; font-family: "+this.family+"; color: "+this.color+"; line-height: "+t+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e+="font-weight: bold; "),(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e+="font-style: italic; ");var i=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(e+="text-decoration: "+i.join(" ")+"; "),e},mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var t=this.node.style;t.whiteSpace="normal",t.overflow="",t.width="",t.height="",this.updateValue(),this.updateFont(this.node),this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()}},mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale)),e=Math.max(0,Math.round(this.bounds.height/this.scale)),i="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",n=this.getTextCss()+(this.pointerEvents?"pointer-events: all; ":"");mxSvgCanvas2D.createCss(t,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,null!=this.background?mxUtils.htmlEntities(this.background):null,null!=this.border?mxUtils.htmlEntities(this.border):null,i,n,this.scale,mxUtils.bind(this,(function(t,e,i,n,r,s){var o=this.getTextRotation(),l=(1!=this.scale?"scale("+this.scale+") ":"")+(0!=o?"rotate("+o+"deg) ":"")+(0!=this.margin.x||0!=this.margin.y?"translate("+100*this.margin.x+"%,"+100*this.margin.y+"%)":"");""!=l&&(l="transform-origin: 0 0; transform: "+l+"; "),""==s?(i+=n,n="display:inline-block; min-width: 100%; "+l):n+=l,this.opacity<100&&(r+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",i);var a=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();null==this.node.firstChild&&(this.node.innerHTML="
"+a+"
"),this.node.firstChild.firstChild.setAttribute("style",r),this.node.firstChild.setAttribute("style",n)})))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,i=this.margin.x,n=this.margin.y;0!=t?(mxUtils.setPrefixedStyle(e,"transformOrigin",100*-i+"% "+100*-n+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+100*i+"%,"+100*n+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+100*i+"%,"+100*n+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(i*("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px",e.top=Math.round(this.bounds.y-n*("fill"!=this.overflow?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"
 
"),e='
'+(e=this.replaceLinefeeds?e.replace(/\n/g,"
"):e)+"
",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,i=this.margin.y,n=this.scale;mxUtils.setOpacity(this.node,this.opacity);var r=0,s=0,o=null!=this.state?this.state.view.textDiv:null,l=this.node;if(null!=o){o.style.overflow="",o.style.height="",o.style.width="",this.updateFont(o),this.updateSize(o,!1),this.updateInnerHtml(o);var a=Math.round(this.bounds.width/this.scale);this.wrap&&a>0?(o.style.whiteSpace="normal",o.style.wordWrap=mxConstants.WORD_WRAP,r=a,this.clipped&&(r=Math.min(r,this.bounds.width)),o.style.width=r+"px"):o.style.whiteSpace="nowrap",null!=(l=o).firstChild&&"DIV"==l.firstChild.nodeName&&(l=l.firstChild,this.wrap&&"break-word"==o.style.wordWrap&&(l.style.width="100%")),!this.clipped&&this.wrap&&a>0&&(r=l.offsetWidth+this.textWidthPadding,o.style.width=r+"px"),s=l.offsetHeight+2,mxClient.IS_QUIRKS&&null!=this.border&&this.border!=mxConstants.NONE&&(s+=3)}else null!=l.firstChild&&"DIV"==l.firstChild.nodeName&&(s=(l=l.firstChild).offsetHeight);r=l.offsetWidth+this.textWidthPadding,this.clipped&&(s=Math.min(s,this.bounds.height));a=this.bounds.width/n;var h=this.bounds.height/n;"fill"==this.overflow?(s=h,r=a):"width"==this.overflow&&(s=l.scrollHeight,r=a),this.offsetWidth=r,this.offsetHeight=s,mxClient.IS_QUIRKS&&(this.clipped||"width"==this.overflow&&h>0)?(h=Math.min(h,s),t.height=Math.round(h)+"px"):h=s,"fill"!=this.overflow&&"width"!=this.overflow&&(this.clipped&&(r=Math.min(a,r)),a=r,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),h*=n,a*=n;var u=this.getTextRotation()*(Math.PI/180),p=parseFloat(parseFloat(Math.cos(u)).toFixed(8)),d=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));(u%=2*Math.PI)<0&&(u+=2*Math.PI),(u%=Math.PI)>Math.PI/2&&(u=Math.PI-u);var c=Math.cos(u),m=Math.sin(-u),g=a*-(e+.5),x=h*-(i+.5),f=(h-h*c+a*m)/2+d*g-p*x,y=(a-a*c+h*m)/2-p*g-d*x;if(0!=u){var v="progid:DXImageTransform.Microsoft.Matrix(M11="+p+", M12="+d+", M21="+-d+", M22="+p+", sizingMethod='auto expand')";null!=t.filter&&t.filter.length>0?t.filter+=" "+v:t.filter=v}i=0;"fill"!=this.overflow&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?i-=1:this.valign==mxConstants.ALIGN_BOTTOM?i+=2:i+=1),t.zoom=n,t.left=Math.round(this.bounds.x+y-a/2)+"px",t.top=Math.round(this.bounds.y+f-h/2+i)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var t=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t;var e=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,i=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if("fill"==this.overflow||"width"==this.overflow)null!=e&&(this.node.style.backgroundColor=e),null!=i&&(this.node.style.border="1px solid "+i);else{var n="";null!=e&&(n+="background-color:"+mxUtils.htmlEntities(e)+";"),null!=i&&(n+="border:1px solid "+mxUtils.htmlEntities(i)+";"),t='
'+t+"
"}this.node.innerHTML=t;var r=this.node.getElementsByTagName("div");if(r.length>0){var s=this.textDirection;s==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(s=this.getAutoDirection()),s==mxConstants.TEXT_DIRECTION_LTR||s==mxConstants.TEXT_DIRECTION_RTL?r[r.length-1].setAttribute("dir",s):r[r.length-1].removeAttribute("dir")}}},mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e.fontSize=this.size+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="";var i=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),e.textDecoration=i.join(" "),this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var i=Math.max(0,Math.round(this.bounds.width/this.scale)),n=Math.max(0,Math.round(this.bounds.height/this.scale)),r=t.style;if(this.clipped?(r.overflow="hidden",mxClient.IS_QUIRKS?r.width=i+"px":(r.maxHeight=n+"px",r.maxWidth=i+"px")):"fill"==this.overflow?(r.width=i+1+"px",r.height=n+1+"px",r.overflow="hidden"):"width"==this.overflow&&(r.width=i+1+"px",r.maxHeight=n+1+"px",r.overflow="hidden"),this.wrap&&i>0){if(r.wordWrap=mxConstants.WORD_WRAP,r.whiteSpace="normal",r.width=i+"px",e&&"fill"!=this.overflow&&"width"!=this.overflow){var s=t;null!=s.firstChild&&"DIV"==s.firstChild.nodeName&&(s=s.firstChild,"break-word"==t.style.wordWrap&&(s.style.width="100%"));var o=s.offsetWidth;if(0==o){var l=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),o=s.offsetWidth,t.style.visibility="",l.appendChild(t)}o+=3,this.clipped&&(o=Math.min(o,i)),r.width=o+"px"}}else r.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},__mxOutput.mxText=void 0!==mxText?mxText:void 0,mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(n,.5*r),new mxPoint(0,r)],this.isRounded,s,!0)},__mxOutput.mxTriangle=void 0!==mxTriangle?mxTriangle:void 0,mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*n,0),new mxPoint(.75*n,0),new mxPoint(n,.5*r),new mxPoint(.75*n,r),new mxPoint(.25*n,r),new mxPoint(0,.5*r)],this.isRounded,s,!0)},__mxOutput.mxHexagon=void 0!==mxHexagon?mxHexagon:void 0,mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(t,e,i,n,r){var s=i+r/2;t.begin(),t.moveTo(e,s),t.lineTo(e+n,s),t.stroke()},__mxOutput.mxLine=void 0!==mxLine?mxLine:void 0,mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return 0},mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments),this.fill=null,this.stroke=null,this.gradient=null,null!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,i,n,r){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,i,n,r){if(null!=this.image){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null!=s&&(t.setFillColor(s),t.setStrokeColor(o),t.rect(e,i,n,r),t.fillAndStroke()),t.image(e,i,n,r,this.image,this.preserveImageAspect,!1,!1),null!=(o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null))&&(t.setShadow(!1),t.setStrokeColor(o),t.rect(e,i,n,r),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.innerHTML="",null!=this.image){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var i=mxClient.IS_IE6||(null==document.documentMode||document.documentMode<=8)&&0!=this.rotation,n=document.createElement(i?mxClient.VML_PREFIX+":image":"img");n.setAttribute("border","0"),n.style.position="absolute",n.src=this.image;var r=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=r,this.flipH&&this.flipV?r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?r+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),n.style.filter!=r&&(n.style.filter=r),"image"==n.nodeName?n.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(n.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(n.style,"transform",""),n.style.width=this.node.style.width,n.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(n)}else this.setTransparentBackgroundImage(this.node)},__mxOutput.mxImageShape=void 0!==mxImageShape?mxImageShape:void 0,mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(t){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(t,e,i,n,r){this.paintImage(t,e,i,n,r),this.paintIndicator(t,e,i,n,r),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,i,n,r){if(null!=this.image){var s=this.getImageBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return r==mxConstants.ALIGN_CENTER?t+=(i-o)/2:r==mxConstants.ALIGN_RIGHT?t+=i-o-a:t+=a,s==mxConstants.ALIGN_TOP?e+=a:s==mxConstants.ALIGN_BOTTOM?e+=n-l-a:e+=(n-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.paintIndicator=function(t,e,i,n,r){if(null!=this.indicator)this.indicator.bounds=this.getIndicatorBounds(e,i,n,r),this.indicator.paint(t);else if(null!=this.indicatorImage){var s=this.getIndicatorBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),a=this.spacing+5;return r==mxConstants.ALIGN_RIGHT?t+=i-o-a:r==mxConstants.ALIGN_CENTER?t+=(i-o)/2:t+=a,s==mxConstants.ALIGN_BOTTOM?e+=n-l-a:s==mxConstants.ALIGN_TOP?e+=a:e+=(n-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var t=document.createElement("img");t.style.position="relative",t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.x-=this.bounds.x,e.y-=this.bounds.y,t.style.left=Math.round(e.x)+"px",t.style.top=Math.round(e.y)+"px",t.style.width=Math.round(e.width)+"px",t.style.height=Math.round(e.height)+"px",t.src=this.image,this.node.appendChild(t)}},__mxOutput.mxLabel=void 0!==mxLabel?mxLabel:void 0,mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r,!1),t.fillAndStroke(),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),t.begin(),this.redrawPath(t,e,i,n,r,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,i,n){return Math.min(this.maxHeight,Math.round(n/5))},mxCylinder.prototype.redrawPath=function(t,e,i,n,r,s){var o=this.getCylinderSize(e,i,n,r);(s&&null!=this.fill||!s&&null==this.fill)&&(t.moveTo(0,o),t.curveTo(0,2*o,n,2*o,n,o),s||(t.stroke(),t.begin())),s||(t.moveTo(0,o),t.curveTo(0,-o/3,n,-o/3,n,o),t.lineTo(n,r-o),t.curveTo(n,r+o/3,0,r+o/3,0,r-o),t.close())},__mxOutput.mxCylinder=void 0!==mxCylinder?mxCylinder:void 0,mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED],mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var i=this.createMarker(t,e,!0),n=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),null!=i&&i(),null!=n&&n()},mxConnector.prototype.createMarker=function(t,e,i){var n=null,r=e.length,s=mxUtils.getValue(this.style,i?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),o=i?e[1]:e[r-2],l=i?e[0]:e[r-1];if(null!=s&&null!=o&&null!=l){for(var a=1;a0)for(var l=0;lt.weightedValue?-1:e.weightedValueh)break;l=c}}}var m=r.getIndex(t);m=Math.max(0,o-(o>m?1:0)),n.add(r,t,m)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),i=e.getGeometry(t);null!=this.graph.container&&(null==i&&e.isLayer(t)||t==this.graph.getView().currentRoot)&&(i=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));return i},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),i=e.getChildCount(t),n=[],r=0;rn.y>0?1:-1}))),n},mxStackLayout.prototype.snap=function(t){if(null!=this.gridSize&&this.gridSize>0&&(t=Math.max(t,this.gridSize))/this.gridSize>1){var e=t%this.gridSize;t+=e>this.gridSize/2?this.gridSize-e:-e}return t},mxStackLayout.prototype.execute=function(t){if(null!=t){var e=this.getParentSize(t),i=this.isHorizontal(),n=this.graph.getModel(),r=null;null!=e&&(r=i?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),r-=2*this.border;var s=this.x0+this.border+this.marginLeft,o=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var l=this.graph.getCellStyle(t),a=mxUtils.getNumber(l,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),h=1==mxUtils.getValue(l,mxConstants.STYLE_HORIZONTAL,!0);null!=e&&(a=h?Math.min(a,e.height):Math.min(a,e.width)),i==h&&(r-=a),h?o+=a:s+=a}n.beginUpdate();try{for(var u=0,p=null,d=0,c=null,m=this.getLayoutCells(t),g=0;gthis.wrap||!i&&p.y+p.height+f.height+2*this.spacing>this.wrap)&&(p=null,i?o+=u+this.spacing:s+=u+this.spacing,u=0),u=Math.max(u,i?f.height:f.width);var y=0;if(!this.borderCollapse){var v=this.graph.getCellStyle(x);y=mxUtils.getNumber(v,mxConstants.STYLE_STROKEWIDTH,1)}if(null!=p){var C=d+this.spacing+Math.floor(y/2);i?f.x=this.snap((this.allowGaps?Math.max(C,f.x):C)-this.marginLeft)+this.marginLeft:f.y=this.snap((this.allowGaps?Math.max(C,f.y):C)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(i?f.x=this.allowGaps&&f.x>s?Math.max(this.snap(f.x-this.marginLeft)+this.marginLeft,s):s:f.y=this.allowGaps&&f.y>o?Math.max(this.snap(f.y-this.marginTop)+this.marginTop,o):o);i?f.y=o:f.x=s,this.fill&&null!=r&&(i?f.height=r:f.width=r),i?f.width=this.snap(f.width):f.height=this.snap(f.height),this.setChildGeometry(x,f),c=x,p=f,d=i?p.x+p.width+Math.floor(y/2):p.y+p.height+Math.floor(y/2)}}this.resizeParent&&null!=e&&null!=p&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,p):this.resizeLast&&null!=e&&null!=p&&null!=c&&(i?p.width=e.width-p.x-this.spacing-this.marginRight-this.marginLeft:p.height=e.height-p.y-this.spacing-this.marginBottom,this.setChildGeometry(c,p))}finally{n.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var i=this.graph.getCellGeometry(t);null!=i&&e.x==i.x&&e.y==i.y&&e.width==i.width&&e.height==i.height||this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,i){var n=this.isHorizontal(),r=this.graph.getModel(),s=e.clone();if(n){var o=i.x+i.width+this.marginRight+this.border;this.resizeParentMax?s.width=Math.max(s.width,o):s.width=o}else{o=i.y+i.height+this.marginBottom+this.border;this.resizeParentMax?s.height=Math.max(s.height,o):s.height=o}e.x==s.x&&e.y==s.y&&e.width==s.width&&e.height==s.height||r.setGeometry(t,s)},__mxOutput.mxStackLayout=void 0!==mxStackLayout?mxStackLayout:void 0,mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(t,e,i){var n=this.graph.getModel(),r=n.getParent(t);if(null!=t&&null!=r){var s=0,o=0,l=n.getChildCount(r);for(s=0;se)break;o=u}}var p=r.getIndex(t);p=Math.max(0,s-(s>p?1:0)),n.add(r,t,p)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),i=this.graph.getModel(),n=i.getGeometry(t);null!=this.graph.container&&(null==n&&i.isLayer(t)||t==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));if(null!=n){for(var r=[],s=i.getChildCount(t),o=0;o0){var h=this.border,u=this.border,p=e?n.height:n.width;p-=2*this.border;var d=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;p-=e?d.height:d.width,h+=d.width,u+=d.height;var c=this.border+(a-1)*this.spacing,m=e?(n.width-h-c)/a:(n.height-u-c)/a;if(m>0){i.beginUpdate();try{for(o=0;o0)this.root=t;else{var n=this.graph.findTreeRoots(t,!0,this.invert);if(n.length>0)for(var r=0;r0){this.root=n[r];break}}else this.root=e;if(null!=this.root){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&null!=i.isVertex(t)&&this.maintainParentLocation)null!=(a=this.graph.getCellGeometry(t))&&(this.parentX=a.x,this.parentY=a.y);i.beginUpdate();try{if(this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node){this.layout(this.node);var s=this.graph.gridSize,o=s;if(!this.moveTree){var l=this.getVertexBounds(this.root);null!=l&&(s=l.x,o=l.y)}var a,h=null;if(null!=(h=this.isHorizontal()?this.horizontalLayout(this.node,s,o):this.verticalLayout(this.node,null,s,o))){var u=0,p=0;h.x<0&&(u=Math.abs(s-h.x)),h.y<0&&(p=Math.abs(o-h.y)),0==u&&0==p||this.moveNode(this.node,u,p),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(null!=this.parentX&&null!=this.parentY)null!=(a=this.graph.getCellGeometry(t))&&((a=a.clone()).x=this.parentX,a.y=this.parentY,i.setGeometry(t,a))}}finally{i.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,i){t.x+=e,t.y+=i,this.apply(t);for(var n=t.child;null!=n;)this.moveNode(n,e,i),n=n.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var i=new mxDictionary;e.sort((function(e,n){var r=e.getTerminal(e.getTerminal(!1)==t),s=i.get(r);null==s&&(s=mxCellPath.create(r).split(mxCellPath.PATH_SEPARATOR),i.put(r,s));var o=n.getTerminal(n.getTerminal(!1)==t),l=i.get(o);return null==l&&(l=mxCellPath.create(o).split(mxCellPath.PATH_SEPARATOR),i.put(o,l)),mxCellPath.compare(s,l)}))},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(null==this.maxRankHeight[e]||this.maxRankHeight[e]t.height&&(t.height=this.maxRankHeight[e]);for(var i=t.child;null!=i;)this.setCellHeights(i,e+1),i=i.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var i=mxCellPath.create(t),n=null;if(null!=t&&null==this.visited[i]&&!this.isVertexIgnored(t)){this.visited[i]=t,n=this.createNode(t);var r=this.graph.getModel(),s=null,o=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),l=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,o);for(var a=0;a0)if(t<0)o=t*n/i-e;else if(t>0){o=t*s/r-e}else o=-e;else if(rt+i){o=(i+t)*s/r-(e+n)}else o=s-(e+n);return o>0?o:0},mxCompactTreeLayout.prototype.bridge=function(t,e,i,n,r,s){var o=r+n.dx-e,l=0;l=0==n.dx?n.dy:o*n.dy/n.dx;var a=this.createLine(o,l,n.next);return t.next=this.createLine(0,s+n.dy-l-i,a),a},mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t,e.x=0,e.y=0,e.width=0,e.height=0;var i=this.getVertexBounds(t);return null!=i&&(this.isHorizontal()?(e.width=i.height,e.height=i.width):(e.width=i.width,e.height=i.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var i=this.graph.getModel(),n=t.cell,r=i.getGeometry(n);if(null!=n&&null!=r){if(this.isVertexMovable(n)&&(r=this.setVertexLocation(n,t.x,t.y),this.resizeParent)){var s=i.getParent(n),o=mxCellPath.create(s);null==this.parentsChanged[o]&&(this.parentsChanged[o]=s)}e=null==e?new mxRectangle(r.x,r.y,r.width,r.height):new mxRectangle(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x+e.width,r.x+r.width),Math.max(e.y+e.height,r.y+r.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,i){var n=new Object;return n.dx=t,n.dy=e,n.next=i,n},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,i=t.cell,n=0,r=[];null!=e;){n++;var s=e.x;this.horizontal&&(s=e.y),r.push(new WeightedCellSorter(e,s)),e=e.next}r.sort(WeightedCellSorter.prototype.compare);var o=t.width,l=(n+1)*this.prefHozEdgeSep;o>l+2*this.prefHozEdgeSep&&(o-=2*this.prefHozEdgeSep);var a=o/n,h=a/2;o>l+2*this.prefHozEdgeSep&&(h+=this.prefHozEdgeSep);var u=this.minEdgeJetty-this.prefVertEdgeOff,p=this.getVertexBounds(i);e=t.child;for(var d=0;dn/2&&(u-=this.prefVertEdgeOff),h+=a}},__mxOutput.mxCompactTreeLayout=void 0!==mxCompactTreeLayout?mxCompactTreeLayout:void 0,mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout),mxRadialTreeLayout.prototype.angleOffset=.5,mxRadialTreeLayout.prototype.rootx=0,mxRadialTreeLayout.prototype.rooty=0,mxRadialTreeLayout.prototype.levelDistance=120,mxRadialTreeLayout.prototype.nodeDistance=10,mxRadialTreeLayout.prototype.autoRadius=!1,mxRadialTreeLayout.prototype.sortEdges=!1,mxRadialTreeLayout.prototype.rowMinX=[],mxRadialTreeLayout.prototype.rowMaxX=[],mxRadialTreeLayout.prototype.rowMinCenX=[],mxRadialTreeLayout.prototype.rowMaxCenX=[],mxRadialTreeLayout.prototype.rowRadi=[],mxRadialTreeLayout.prototype.row=[],mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var i=null,n=this.getVertexBounds(this.root);for(var r in this.centerX=n.x+n.width/2,this.centerY=n.y+n.height/2,this.visited){var s=this.getVertexBounds(this.visited[r]);(i=null!=i?i:s.clone()).add(s)}this.calcRowDims([this.node],0);for(var o=0,l=0,a=0;a=0;a--){var y=this.row[a];for(m=0;m0){var S=E/C;if(S>g.theta&&m0){var T=y[m-1].theta;g.theta=Math.max(S,T+Math.PI/10)}}}}for(a=0;athis.maxDistanceLimit)continue;o1&&this.layout(n)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t){for(var e=this.graph.getModel(),i=[],n=e.getChildCount(t),r=0;r(n=mxObjectIdentity.get(n))?n+"-"+i:i+"-"+n:null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],i=this.graph.getView(),n=this.graph.getModel(),r=n.getGeometry(i.getVisibleTerminal(e,!0)),s=n.getGeometry(i.getVisibleTerminal(e,!1));if(r==s)for(var o=r.x+r.width+this.spacing,l=r.y+r.height/2,a=0;a0){o=h+p/2,l=u+d/2;var m=d*this.spacing/c,g=p*this.spacing/c;o+=m*(t.length-1)/2,l-=g*(t.length-1)/2;for(a=0;a0?this.edges[0]:null},__mxOutput.mxGraphHierarchyEdge=void 0!==mxGraphHierarchyEdge?mxGraphHierarchyEdge:void 0,mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,i){for(var n=t.getGraph(),r=0;r0&&null==this.edgeMapper.get(a[0])&&2*h.length>=a.length){for(var u=new mxGraphHierarchyEdge(a),p=0;p0;){var r;p=(h=t[0]).connectsAsTarget,r=h.connectsAsSource;var s=!0,o=this.SOURCESCANSTARTRANK;for(e=0;e1){n.maxRank=e.maxRank,n.minRank=i.maxRank,n.temp=[],n.x=[],n.y=[];for(var o=n.minRank+1;o0&&null==this.edgeMapper.get(u[0])&&2*p.length>=u.length){for(var d=new mxGraphHierarchyEdge(u),c=0;c=0;i--)i==this.ranksPerGroup.length-1?r[i]=0:r[i]=s[i+1]+1,s[i]=r[i]+this.ranksPerGroup[i];this.maxRank=s[0];var o=this.vertexMapper.getValues();for(i=0;i0;){var l,a;l=(n=t[0]).connectsAsTarget,a=n.connectsAsSource;var h=!0,u=s[0];for(i=0;is[n.swimlaneIndex]&&(u=s[n.swimlaneIndex]),n.temp[0]=u,null!=a)for(i=0;i1){n.maxRank=e.maxRank,n.minRank=i.maxRank,n.temp=[],n.x=[],n.y=[];for(var o=n.minRank+1;o0;)f%2&&(i+=x[f+1]),++x[f=f-1>>1]}return i},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var i=!0,n=0;i&&n++<10;){var r=t%2==1&&n%2==1;i=!1;for(var s=0;sf[T]&&S++,g[E]y[T]&&S++,x[E]=0;n--)this.medianRank(n,i);else for(n=1;nt.medianValue?-1:e.medianValue0&&h<=a;){var u=e.shift(),p=u.cell,d=u.weightedValue,c=parseInt(u.rankIndex),m=p.getNextLayerConnectedCells(d),g=p.getPreviousLayerConnectedCells(d),x=m.length,f=g.length,y=this.medianXValue(m,d+1),v=this.medianXValue(g,d-1),C=x+f,E=p.getGeneralPurposeVariable(d),S=E;C>0&&(S=(y*x+v*f)/C);var b=!1;if(SE+1){if(c==n[d].length-1)p.setGeneralPurposeVariable(d,S),b=!0;else{var L=n[d][c+1],A=L.getGeneralPurposeVariable(d);(A=A-L.width/2-this.intraCellSpacing-p.width/2)>S?(p.setGeneralPurposeVariable(d,S),b=!0):A>p.getGeneralPurposeVariable(d)+1&&(p.setGeneralPurposeVariable(d,A),b=!0)}}if(b){for(r=0;r0;i--)this.rankMedianPosition(i-1,e,i);else for(i=0;i0?this.medianXValue(a,i):h.getGeneralPurposeVariable(t));for(var p=0,d=-1e8,c=r[o].rankIndex-1;c>=0;){if(null!=(f=s[n[c].id])){var m=f.cell;f.visited?(d=m.getGeneralPurposeVariable(t)+m.width/2+this.intraCellSpacing+p+h.width/2,c=-1):(p+=m.width+this.intraCellSpacing,c--)}}var g=0,x=1e8;for(c=r[o].rankIndex+1;c=d&&u<=x?h.setGeneralPurposeVariable(t,u):ux&&(h.setGeneralPurposeVariable(t,x),this.currentXDelta+=u-x),r[o].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var i=0,n=0;n=0;i--)i0&&this.rankCoordinates(i,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,i){for(var n=i.ranks[t],r=0,s=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,o=!1,l=0;l=0;r--){for(var s=0,o=e.ranks[r],l=this.initialX,a=!1,h=0;hthis.widestRankValue&&(this.widestRankValue=l,this.widestRank=r),this.rankWidths[r]=l}1==a&&mxLog.warn("At least one cell has no bounds"),this.rankY[r]=i;var c=s/2+n/2+this.interRankCellSpacing;n=s,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?i+=c:i-=c;for(h=0;hr.minRank+1;a--){var g;m==(g=r.getX(a-1))||this.repositionValid(e,r,a-1,m)?(c[a-r.minRank-2]=m,p++):(c[a-r.minRank-2]=r.getX(a-1),m=g)}if(p>l||u>l)if(p>=u)for(a=r.maxRank-2;a>r.minRank;a--)r.setX(a,c[a-r.minRank-1]);else if(u>p)for(a=r.minRank+2;al){if(s==r.length-1)return!0;var u=r[s+1],p=u.getGeneralPurposeVariable(i);return(p=p-u.width/2-this.intraCellSpacing-e.width/2)>=n}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var i=0;i-1&&o0){for(var a=[],h=0;hy+2*this.prefHozEdgeSep&&(p+=this.prefHozEdgeSep,d-=this.prefHozEdgeSep);var v=(d-p)/c,C=p+v/2,E=this.minEdgeJetty-this.prefVertEdgeOff;for(h=0;hc/2&&(E-=this.prefVertEdgeOff);for(var T=0;T0?-e:-e+this.parallelEdgeSpacing,r++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,i=t.x[0]-t.width/2,n=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],n),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],n+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,i,n):this.layout.setVertexLocation(e,n,i),this.limitX=Math.max(this.limitX,i+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},__mxOutput.mxCoordinateAssignment=void 0!==mxCoordinateAssignment?mxCoordinateAssignment:void 0,mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),i=new Object,n=mxUtils.clone(e.vertexMapper,null,!0),r=null;if(null!=e.roots){var s=e.roots;r=[];for(var o=0;o0&&i.push(l);var d=h-u;d>s&&(s=d,r=l)}}0==i.length&&null!=r&&i.push(r)}return i},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),o=0;o=0&&(r=this.traverse(c,e,u[d],n,r,s,o))}}}return r},mxHierarchicalLayout.prototype.cycleStage=function(t){new mxMinimumCycleRemover(this).execute(t)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxHierarchicalLayout.prototype.placementStage=function(t,e){var i=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return i.fineTuning=this.fineTuning,i.execute(e),i.limitX+this.interHierarchySpacing},__mxOutput.mxHierarchicalLayout=void 0!==mxHierarchicalLayout?mxHierarchicalLayout:void 0,mxSwimlaneLayout.prototype=new mxGraphLayout,mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout,mxSwimlaneLayout.prototype.roots=null,mxSwimlaneLayout.prototype.swimlanes=null,mxSwimlaneLayout.prototype.dummyVertexWidth=50,mxSwimlaneLayout.prototype.resizeParent=!1,mxSwimlaneLayout.prototype.maintainParentLocation=!1,mxSwimlaneLayout.prototype.moveParent=!1,mxSwimlaneLayout.prototype.parentBorder=30,mxSwimlaneLayout.prototype.intraCellSpacing=30,mxSwimlaneLayout.prototype.interRankCellSpacing=100,mxSwimlaneLayout.prototype.interHierarchySpacing=60,mxSwimlaneLayout.prototype.parallelEdgeSpacing=10,mxSwimlaneLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxSwimlaneLayout.prototype.fineTuning=!0,mxSwimlaneLayout.prototype.tightenToSource=!0,mxSwimlaneLayout.prototype.disableEdgeStyle=!0,mxSwimlaneLayout.prototype.traverseAncestors=!0,mxSwimlaneLayout.prototype.model=null,mxSwimlaneLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.edgeSourceTermCache=null,mxHierarchicalLayout.prototype.edgesTargetTermCache=null,mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxSwimlaneLayout.prototype.getModel=function(){return this.model},mxSwimlaneLayout.prototype.execute=function(t,e){this.parent=t;var i=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,!(null==e||e.length<1)){if(null==t&&(t=i.getParent(e[0])),this.parentX=null,this.parentY=null,t!=this.root&&null!=i.isVertex(t)&&this.maintainParentLocation)null!=(l=this.graph.getCellGeometry(t))&&(this.parentX=l.x,this.parentY=l.y);this.swimlanes=e;for(var n=[],r=0;r0&&i.push(l);var m=h-u;m>s&&(s=m,r=l)}}0==i.length&&null!=r&&i.push(r)}return i},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),o=0;o0&&null!=t){for(var n=Object(),r=0;r=this.swimlanes.length||(x>l||(!e||g)&&x==l)&&(r=this.traverse(m,e,p[c],n,r,s,o,x))}}}return r},mxSwimlaneLayout.prototype.cycleStage=function(t){new mxSwimlaneOrdering(this).execute(t)},mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxSwimlaneLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxSwimlaneLayout.prototype.placementStage=function(t,e){var i=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return i.fineTuning=this.fineTuning,i.execute(e),i.limitX+this.interHierarchySpacing},__mxOutput.mxSwimlaneLayout=void 0!==mxSwimlaneLayout?mxSwimlaneLayout:void 0,mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.ignoreRelativeEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(t){this.createIds=t},mxGraphModel.prototype.createRoot=function(){var t=new mxCell;return t.insert(new mxCell),t},mxGraphModel.prototype.getCell=function(t){return null!=this.cells?this.cells[t]:null},mxGraphModel.prototype.filterCells=function(t,e){var i=null;if(null!=t){i=[];for(var n=0;n0){var n=t,r=mxCellPath.create(n);if(i.length=0;e--)this.cellRemoved(this.getChildAt(t,e));null!=this.cells&&null!=t.getId()&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,i){var n=this.getParent(t);if(null!=e)e==n&&n.getIndex(t)==i||e.insert(t,i);else if(null!=n){var r=n.getIndex(t);n.remove(r)}var s=this.contains(e),o=this.contains(n);return s&&!o?this.cellAdded(t):o&&!s&&this.cellRemoved(t),n},mxGraphModel.prototype.getChildCount=function(t){return null!=t?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return null!=t?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return null!=t?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,i){e=null!=e&&e,i=null!=i&&i;for(var n=this.getChildCount(t),r=[],s=0;s=0&&null!=(e=this.getChildAt(t))&&(this.children.splice(t,1),e.setParent(null)),e},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return null==this.edges?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return null!=t&&(t.removeFromTerminal(e),t.setTerminal(this,e),(null==this.edges||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(null!=t){if(t.getTerminal(!e)!=this&&null!=this.edges){var i=this.getEdgeIndex(t);i>=0&&this.edges.splice(i,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);null!=e&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):null!=e.getAttribute(t)},mxCell.prototype.getAttribute=function(t,e){var i=this.getValue(),n=null!=i&&i.nodeType==mxConstants.NODETYPE_ELEMENT?i.getAttribute(t):null;return null!=n?n:e},mxCell.prototype.setAttribute=function(t,e){var i=this.getValue();null!=i&&i.nodeType==mxConstants.NODETYPE_ELEMENT&&i.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return null!=t&&("function"==typeof t.clone?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},__mxOutput.mxCell=void 0!==mxCell?mxCell:void 0,mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var t=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=t}},mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(t,e){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var i=mxUtils.toRadians(t),n=Math.cos(i),r=Math.sin(i);if(!this.relative){var s=new mxPoint(this.getCenterX(),this.getCenterY()),o=mxUtils.getRotatedPoint(s,n,r,e);this.x=Math.round(o.x-this.width/2),this.y=Math.round(o.y-this.height/2)}if(null!=this.sourcePoint){o=mxUtils.getRotatedPoint(this.sourcePoint,n,r,e);this.sourcePoint.x=Math.round(o.x),this.sourcePoint.y=Math.round(o.y)}if(null!=this.targetPoint){o=mxUtils.getRotatedPoint(this.targetPoint,n,r,e);this.targetPoint.x=Math.round(o.x),this.targetPoint.y=Math.round(o.y)}if(null!=this.points)for(var l=0;l1&&(e=e.substring(0,n-1)),e},getParentPath:function(t){if(null!=t){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0)return t.substring(0,e);if(t.length>0)return""}return null},resolve:function(t,e){var i=t;if(null!=e)for(var n=e.split(mxCellPath.PATH_SEPARATOR),r=0;re[r]?1:-1;else n=(s=parseInt(t[r]))==(o=parseInt(e[r]))?0:s>o?1:-1;break}0==n&&((s=t.length)!=(o=e.length)&&(n=s>o?1:-1));return n}};__mxOutput.mxCellPath=void 0!==mxCellPath?mxCellPath:void 0;var mxPerimeter={RectanglePerimeter:function(t,e,i,n){var r=t.getCenterX(),s=t.getCenterY(),o=i.x-r,l=i.y-s,a=Math.atan2(l,o),h=new mxPoint(0,0),u=Math.PI,p=Math.PI/2-a,d=Math.atan2(t.height,t.width);return a<-u+d||a>u-d?(h.x=t.x,h.y=s-t.width*Math.tan(a)/2):a<-d?(h.y=t.y,h.x=r-t.height*Math.tan(p)/2):a=t.x&&i.x<=t.x+t.width?h.x=i.x:i.y>=t.y&&i.y<=t.y+t.height&&(h.y=i.y),i.xt.x+t.width&&(h.x=t.x+t.width),i.yt.y+t.height&&(h.y=t.y+t.height)),h},EllipsePerimeter:function(t,e,i,n){var r=t.x,s=t.y,o=t.width/2,l=t.height/2,a=r+o,h=s+l,u=i.x,p=i.y,d=parseInt(u-a),c=parseInt(p-h);if(0==d&&0!=c)return new mxPoint(a,h+l*c/Math.abs(c));if(0==d&&0==c)return new mxPoint(u,p);if(n){if(p>=s&&p<=s+t.height){var m=p-h,g=Math.sqrt(o*o*(1-m*m/(l*l)))||0;return u<=r&&(g=-g),new mxPoint(a+g,p)}if(u>=r&&u<=r+t.width){g=u-a,m=Math.sqrt(l*l*(1-g*g/(o*o)))||0;return p<=s&&(m=-m),new mxPoint(u,h+m)}}var x=c/d,f=h-x*a,y=o*o*x*x+l*l,v=-2*a*y,C=o*o*x*x*a*a+l*l*a*a-o*o*l*l,E=Math.sqrt(v*v-4*y*C),S=(-v+E)/(2*y),b=(-v-E)/(2*y),T=x*S+f,w=x*b+f,L=0,A=0;return Math.sqrt(Math.pow(S-u,2)+Math.pow(T-p,2))p?s:s+l);if(h==p)return new mxPoint(a>u?r:r+o,h);var d=a,c=h;return n&&(u>=r&&u<=r+o?d=u:p>=s&&p<=s+l&&(c=p)),u-y&&fMath.PI-y)v=n&&(s&&i.x>=d.x&&i.x<=m.x||!s&&i.y>=d.y&&i.y<=m.y)?s?new mxPoint(i.x,d.y):new mxPoint(d.x,i.y):r==mxConstants.DIRECTION_NORTH?new mxPoint(o+a/2+h*Math.tan(f)/2,l+h):r==mxConstants.DIRECTION_SOUTH?new mxPoint(o+a/2-h*Math.tan(f)/2,l):r==mxConstants.DIRECTION_WEST?new mxPoint(o+a,l+h/2+a*Math.tan(f)/2):new mxPoint(o,l+h/2-a*Math.tan(f)/2);else{if(n){var C=new mxPoint(u,p);i.y>=l&&i.y<=l+h?(C.x=s?u:r==mxConstants.DIRECTION_WEST?o+a:o,C.y=i.y):i.x>=o&&i.x<=o+a&&(C.x=i.x,C.y=s?r==mxConstants.DIRECTION_NORTH?l+h:l:p),g=i.x-C.x,x=i.y-C.y,u=C.x,p=C.y}v=s&&i.x<=o+a/2||!s&&i.y<=l+h/2?mxUtils.intersection(i.x,i.y,u,p,d.x,d.y,c.x,c.y):mxUtils.intersection(i.x,i.y,u,p,c.x,c.y,m.x,m.y)}return null==v&&(v=new mxPoint(u,p)),v},HexagonPerimeter:function(t,e,i,n){var r=t.x,s=t.y,o=t.width,l=t.height,a=t.getCenterX(),h=t.getCenterY(),u=i.x,p=i.y,d=u-a,c=p-h,m=-Math.atan2(c,d),g=Math.PI,x=Math.PI/2,f=new mxPoint(a,h),y=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,v=y==mxConstants.DIRECTION_NORTH||y==mxConstants.DIRECTION_SOUTH,C=new mxPoint,E=new mxPoint;if((us+l||u>r+o&&pr+o&&p>s+l)&&(n=!1),n){if(v){if(u==a){if(p<=s)return new mxPoint(a,s);if(p>=s+l)return new mxPoint(a,s+l)}else if(ur+o){if(p==s+l/4)return new mxPoint(r+o,s+l/4);if(p==s+3*l/4)return new mxPoint(r+o,s+3*l/4)}else if(u==r){if(ph)return new mxPoint(r,s+3*l/4)}else if(u==r+o){if(ph)return new mxPoint(r+o,s+3*l/4)}if(p==s)return new mxPoint(a,s);if(p==s+l)return new mxPoint(a,s+l);us+l/4&&ps+3*l/4&&(C=new mxPoint(r-Math.floor(.5*o),s+Math.floor(.5*l)),E=new mxPoint(r+o,s+Math.floor(1.25*l))):u>a&&(p>s+l/4&&ps+3*l/4&&(C=new mxPoint(r+Math.floor(1.5*o),s+Math.floor(.5*l)),E=new mxPoint(r,s+Math.floor(1.25*l))))}else{if(p==h){if(u<=r)return new mxPoint(r,s+l/2);if(u>=r+o)return new mxPoint(r+o,s+l/2)}else if(ps+l){if(u==r+o/4)return new mxPoint(r+o/4,s+l);if(u==r+3*o/4)return new mxPoint(r+3*o/4,s+l)}else if(p==s){if(ua)return new mxPoint(r+3*o/4,s)}else if(p==s+l){if(uh)return new mxPoint(r+3*o/4,s+l)}if(u==r)return new mxPoint(r,h);if(u==r+o)return new mxPoint(r+o,h);pr+o/4&&ur+3*o/4&&(C=new mxPoint(r+Math.floor(.5*o),s-Math.floor(.5*l)),E=new mxPoint(r+Math.floor(1.25*o),s+l)):p>h&&(u>r+o/4&&ur+3*o/4&&(C=new mxPoint(r+Math.floor(.5*o),s+Math.floor(1.5*l)),E=new mxPoint(r+Math.floor(1.25*o),s)))}var S=a,b=h;u>=r&&u<=r+o?(S=u,b=p=s&&p<=s+l&&(b=p,S=u-T?(C=new mxPoint(r+o,s),E=new mxPoint(r+o,s+l)):m>T&&mx&&mg-T&&m<=g||m<-g+T&&m>=-g?(C=new mxPoint(r,s),E=new mxPoint(r,s+l)):m<-T&&m>-x?(C=new mxPoint(r+Math.floor(1.5*o),s+Math.floor(.5*l)),E=new mxPoint(r,s+Math.floor(1.25*l))):m<-x&&m>-g+T&&(C=new mxPoint(r-Math.floor(.5*o),s+Math.floor(.5*l)),E=new mxPoint(r+o,s+Math.floor(1.25*l)))}else{var T;if(m==(T=Math.atan2(l/2,o/4)))return new mxPoint(r+Math.floor(.75*o),s);if(m==g-T)return new mxPoint(r+Math.floor(.25*o),s);if(m==g||m==-g)return new mxPoint(r,s+Math.floor(.5*l));if(0==m)return new mxPoint(r+o,s+Math.floor(.5*l));if(m==-T)return new mxPoint(r+Math.floor(.75*o),s+l);if(m==-g+T)return new mxPoint(r+Math.floor(.25*o),s+l);m>0&&mT&&mg-T&&m-T?(C=new mxPoint(r+Math.floor(.5*o),s+Math.floor(1.5*l)),E=new mxPoint(r+Math.floor(1.25*o),s)):m<-T&&m>-g+T?(C=new mxPoint(r,s+l),E=new mxPoint(r+o,s+l)):m<-g+T&&m>-g&&(C=new mxPoint(r-Math.floor(.25*o),s),E=new mxPoint(r+Math.floor(.5*o),s+Math.floor(1.5*l)))}f=mxUtils.intersection(a,h,i.x,i.y,C.x,C.y,E.x,E.y)}return null==f?new mxPoint(a,h):f}};function mxPrintPreview(t,e,i,n,r,s,o,l,a){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.border=null!=n?n:0,this.pageFormat=mxRectangle.fromRectangle(null!=i?i:t.pageFormat),this.title=null!=l?l:"Printer-friendly version",this.x0=null!=r?r:0,this.y0=null!=s?s:0,this.borderColor=o,this.pageSelector=null==a||a}function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(t,e,i){this.view=t,this.cell=e,this.style=null!=i?i:{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(t){this.graph=t,this.cells=[]}function mxSelectionChange(t,e,i){this.selectionModel=t,this.added=null!=e?e.slice():null,this.removed=null!=i?i.slice():null}function mxCellEditor(t){this.graph=t,this.zoomHandler=mxUtils.bind(this,(function(){this.graph.isEditing()&&this.resize()})),this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler),this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler),this.changeHandler=mxUtils.bind(this,(function(t){null!=this.editingCell&&null==this.graph.getView().getState(this.editingCell)&&this.stopEditing(!0)})),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}function mxCellRenderer(){}__mxOutput.mxPerimeter=void 0!==mxPerimeter?mxPerimeter:void 0,mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.marginTop=0,mxPrintPreview.prototype.marginBottom=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,mxPrintPreview.prototype.backgroundColor="#ffffff",mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.targetWindow=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.clipping=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return 5==document.documentMode?t='':8==document.documentMode?t='':document.documentMode>8&&(t='\x3c!--[if IE]>0&&l.writeln(a),mxClient.IS_VML?l.writeln(''):("CSS1Compat"===document.compatMode&&l.writeln(""),l.writeln("")),l.writeln(""),this.writeHead(l,t),l.writeln(""),l.writeln('')}var h=this.graph.getGraphBounds().clone(),u=this.graph.getView().getScale(),p=u/this.scale,d=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=d.x*this.scale,this.y0-=d.y*this.scale,h.width+=h.x,h.height+=h.y,h.x=0,h.y=0,this.border=0);var c=this.pageFormat.width-2*this.border,m=this.pageFormat.height-2*this.border;this.pageFormat.height+=this.marginTop+this.marginBottom,h.width/=p,h.height/=p;var g=Math.max(1,Math.ceil((h.width+this.x0)/c)),x=Math.max(1,Math.ceil((h.height+this.y0)/m));this.pageCount=g*x;var f=mxUtils.bind(this,(function(){if(this.pageSelector&&(x>1||g>1)){var t=this.createPageSelector(x,g);if(l.body.appendChild(t),mxClient.IS_IE&&null==l.documentMode||5==l.documentMode||8==l.documentMode||7==l.documentMode){t.style.position="absolute";var e=function(){t.style.top=(l.body.scrollTop||l.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",(function(t){e()})),mxEvent.addListener(this.wnd,"resize",(function(t){e()}))}}})),y=mxUtils.bind(this,(function(t,e){if(null!=this.borderColor&&(t.style.borderColor=this.borderColor,t.style.borderStyle="solid",t.style.borderWidth="1px"),t.style.background=this.backgroundColor,(i||e)&&(t.style.pageBreakAfter="always"),o&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE))l.writeln(t.outerHTML),t.parentNode.removeChild(t);else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var n=l.createElement("div");n.innerHTML=t.outerHTML,n=n.getElementsByTagName("div")[0],l.body.appendChild(n),t.parentNode.removeChild(t)}else t.parentNode.removeChild(t),l.body.appendChild(t);(i||e)&&this.addPageBreak(l)})),v=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(null!=v)for(var C=0;C"),t.writeln(""),t.close(),mxEvent.release(t.body)}}catch(t){}},mxPrintPreview.prototype.writeHead=function(t,e){null!=this.title&&t.writeln(""+this.title+""),mxClient.IS_VML&&t.writeln(''),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t),t.writeln('")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var i=this.wnd.document,n=i.createElement("table");n.className="mxPageSelector",n.setAttribute("border","0");for(var r=i.createElement("tbody"),s=0;s0&&(L[0].style.position="absolute")}o.overlayPane.parentNode.removeChild(o.overlayPane),this.graph.setEnabled(g),this.graph.container=l,this.graph.cellRenderer.redraw=f,o.canvas=a,o.backgroundPane=h,o.drawPane=u,o.overlayPane=p,o.translate=x,E.destroy(),o.setEventsEnabled(m)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,i){var n=this.graph.backgroundImage;if(null!=n){var r=document.createElement("img");r.style.position="absolute",r.style.marginLeft=Math.round(e*this.scale)+"px",r.style.marginTop=Math.round(i*this.scale)+"px",r.setAttribute("width",Math.round(this.scale*n.width)),r.setAttribute("height",Math.round(this.scale*n.height)),r.src=n.src,t.insertBefore(r,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},__mxOutput.mxPrintPreview=void 0!==mxPrintPreview?mxPrintPreview:void 0,mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#774400",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#446299",t},mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)},mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e},mxStylesheet.prototype.getCellStyle=function(t,e){var i=e;if(null!=t&&t.length>0){var n=t.split(";");i=null!=i&&";"!=t.charAt(0)?mxUtils.clone(i):new Object;for(var r=0;r=0){var l=s.substring(0,o),a=s.substring(o+1);a==mxConstants.NONE?delete i[l]:mxUtils.isNumeric(a)?i[l]=parseFloat(a):i[l]=a}else{var h=this.styles[s];if(null!=h)for(var l in h)i[l]=h[l]}}}return i},__mxOutput.mxStylesheet=void 0!==mxStylesheet?mxStylesheet:void 0,mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalidStyle=!1,mxCellState.prototype.invalid=!0,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.unscaledWidth=null,mxCellState.prototype.unscaledHeight=null,mxCellState.prototype.getPerimeterBounds=function(t,e){if(t=t||0,e=null!=e?e:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var i=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=i.x,e.y=i.y,e.width=this.shape.stencil.w0*i.width,e.height=this.shape.stencil.h0*i.height}return 0!=t&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[0]=t):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):1==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){null!=this.shape&&this.shape.setCursor(t),null!=this.text&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return null!=e?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t:this.visibleTargetState=t},mxCellState.prototype.getCellBounds=function(){return this.cellBounds},mxCellState.prototype.getPaintBounds=function(){return this.paintBounds},mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate,e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e),this.paintBounds=mxRectangle.fromRectangle(this.cellBounds),null!=this.shape&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()},mxCellState.prototype.setState=function(t){this.view=t.view,this.cell=t.cell,this.style=t.style,this.absolutePoints=t.absolutePoints,this.origin=t.origin,this.absoluteOffset=t.absoluteOffset,this.boundingBox=t.boundingBox,this.terminalDistance=t.terminalDistance,this.segments=t.segments,this.length=t.length,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.unscaledWidth=t.unscaledWidth,this.unscaledHeight=t.unscaledHeight},mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){t.absolutePoints=[];for(var e=0;e=0},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){null!=t&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(null!=t){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],i=0;i0&&null!=t[0]||null!=e&&e.length>0&&null!=e[0]){var i=new mxSelectionChange(this,t,e);i.execute();var n=new mxUndoableEdit(this,!1);n.add(i),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n))}},mxGraphSelectionModel.prototype.cellAdded=function(t){null==t||this.isSelected(t)||this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(null!=t){var e=mxUtils.indexOf(this.cells,t);e>=0&&this.cells.splice(e,1)}},mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var e=0;e":"",mxCellEditor.prototype.escapeCancelsEditing=!0,mxCellEditor.prototype.textNode="",mxCellEditor.prototype.zIndex=5,mxCellEditor.prototype.minResize=new mxRectangle(0,20),mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:mxClient.IS_IE11?0:1,mxCellEditor.prototype.blurEnabled=!1,mxCellEditor.prototype.initialValue=null,mxCellEditor.prototype.align=null,mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div"),this.textarea.className="mxCellEditor mxPlainTextEditor",this.textarea.contentEditable=!0,mxClient.IS_GC&&(this.textarea.style.minHeight="1em"),this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative",this.installListeners(this.textarea)},mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)},mxCellEditor.prototype.setAlign=function(t){null!=this.textarea&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){var i=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return mxClient.IS_QUIRKS||8==document.documentMode||9==document.documentMode||10==document.documentMode||(i=mxUtils.replaceTrailingNewlines(i,"

")),i.replace(/\n/g,"
")},mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)},mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)},mxCellEditor.prototype.installListeners=function(t){mxEvent.addListener(t,"dragstart",mxUtils.bind(this,(function(t){this.graph.stopEditing(!1),mxEvent.consume(t)}))),mxEvent.addListener(t,"blur",mxUtils.bind(this,(function(t){this.blurEnabled&&this.focusLost(t)}))),mxEvent.addListener(t,"keydown",mxUtils.bind(this,(function(t){mxEvent.isConsumed(t)||(this.isStopEditingEvent(t)?(this.graph.stopEditing(!1),mxEvent.consume(t)):27==t.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(t)),mxEvent.consume(t)))})));var e=mxUtils.bind(this,(function(e){null!=this.editingCell&&this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=e.keyCode&&46!=e.keyCode)&&(this.clearOnChange=!1,t.innerHTML="")}));mxEvent.addListener(t,"keypress",e),mxEvent.addListener(t,"paste",e);var i=mxUtils.bind(this,(function(t){null!=this.editingCell&&(0==this.textarea.innerHTML.length||"
"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=this.textarea.innerHTML.length>0):this.clearOnChange=!1)}));mxEvent.addListener(t,mxClient.IS_IE11||mxClient.IS_IE?"keyup":"input",i),mxEvent.addListener(t,"cut",i),mxEvent.addListener(t,"paste",i);var n=mxClient.IS_IE11||mxClient.IS_IE?"keydown":"input",r=mxUtils.bind(this,(function(t){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(t)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,(function(){this.resizeThread=null,this.resize()})),0))}));mxEvent.addListener(t,n,r),mxEvent.addListener(window,"resize",r),document.documentMode>=9?(mxEvent.addListener(t,"DOMNodeRemoved",r),mxEvent.addListener(t,"DOMNodeInserted",r)):(mxEvent.addListener(t,"cut",r),mxEvent.addListener(t,"paste",r))},mxCellEditor.prototype.isStopEditingEvent=function(t){return 113==t.keyCode||this.graph.isEnterStopsCellEditing()&&13==t.keyCode&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)},mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea},mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(null==t)this.stopEditing(!0);else if(null!=this.textarea){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=null;if(this.autoSize&&"fill"!=t.style[mxConstants.STYLE_OVERFLOW]){var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(null==(n=null!=t.text&&null==this.align?t.text.margin:null)&&(n=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),null!=r){var s=(parseFloat(r)+2)*i;this.bounds.width=s,this.bounds.x+=n.x*s}}else{var o=mxRectangle.fromRectangle(t),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&l==mxConstants.ALIGN_CENTER&&a==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,null!=r&&(o.width=parseFloat(r)*i),!t.view.graph.cellRenderer.legacySpacing||"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var h=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*i,u=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+h,p=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+h,d=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+h,c=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+h;l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);o=new mxRectangle(o.x+c,o.y+u,o.width-(l==mxConstants.ALIGN_CENTER&&null==r?c+p:0),o.height-(a==mxConstants.ALIGN_MIDDLE?u+d:0))}this.bounds=new mxRectangle(o.x+t.absoluteOffset.x,o.y+t.absoluteOffset.y,o.width,o.height)}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal";s=Math.round(this.bounds.width/(document.documentMode,i))+this.wordWrapPadding;"relative"!=this.textarea.style.position?(this.textarea.style.width=s+"px",this.textarea.scrollWidth>s&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=s+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";8==document.documentMode&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var m=this.textarea.scrollWidth,g=this.textarea.scrollHeight;8==document.documentMode?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-n.x*(this.bounds.width-(m+1)*i)+m*(i-1)*0+2*(n.x+.5))/i))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+1*Math.abs(n.y+.5))/i))+"px",this.textarea.style.width=Math.round(m*i)+"px",this.textarea.style.height=Math.round(g*i)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-n.x*(this.bounds.width-(m+1)*i)+m*(i-1)*0+2*(n.x+.5)))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+1*Math.abs(n.y+.5)))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-n.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-n.y*(this.bounds.height-4)+(-1==n.y?3:0))+1)+"px")}else this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/i)+"px",this.textarea.style.height=Math.round(this.bounds.height/i)+"px",8==document.documentMode||mxClient.IS_QUIRKS?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"),this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/i)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=""));mxClient.IS_VML?this.textarea.style.zoom=i:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+i+","+i+")"+(null==n?"":" translate("+100*n.x+"%,"+100*n.y+"%)")))}},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.getBackgroundColor=function(t){return null},mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML)return!0;var t=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(null!=e){var i=mxUtils.getCurrentStyle(e);null!=i&&(t="absolute"==i.position)}}return!t},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),this.align=null,null==this.textarea&&this.init(),null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var i=this.graph.getView().getState(t);if(null!=i){this.graph.getView().scale;var n=mxUtils.getValue(i.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),r=mxUtils.getValue(i.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),s=mxUtils.getValue(i.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(i.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),l=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,a=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,h=[];(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&h.push("underline"),(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&h.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(n*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(i),this.textarea.style.textDecoration=h.join(" "),this.textarea.style.fontWeight=l?"bold":"normal",this.textarea.style.fontStyle=a?"italic":"",this.textarea.style.fontSize=Math.round(n)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=r,this.textarea.style.textAlign=o,this.textarea.style.outline="none",this.textarea.style.color=s;var u=this.textDirection=mxUtils.getValue(i.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);u==mxConstants.TEXT_DIRECTION_AUTO&&(null==i||null==i.text||i.text.dialect==mxConstants.DIALECT_STRICTHTML||mxUtils.isNode(i.text.value)||(u=i.text.getAutoDirection())),u==mxConstants.TEXT_DIRECTION_LTR||u==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",u):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(i,e)||"",this.initialValue=this.textarea.innerHTML,0==this.textarea.innerHTML.length||"
"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.graph.container.appendChild(this.textarea),this.editingCell=t,this.trigger=e,this.textNode=null,null!=i.text&&this.isHideLabel(i)&&(this.textNode=i.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(i.cell)||"fill"!=i.style[mxConstants.STYLE_OVERFLOW])&&window.setTimeout(mxUtils.bind(this,(function(){this.resize()})),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch(t){}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),null!=t&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),i=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),null!=e&&(this.textarea.innerHTML!=i||null!=this.align)){this.prepareTextarea();var n=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{null!=n&&this.applyValue(e,n),null!=this.align&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[e.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea),this.textarea=null,this.align=null}},mxCellEditor.prototype.prepareTextarea=function(){null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*e+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=this.getMinimumSize(t),r=n.width,s=n.height,o=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&"fill"==t.style[mxConstants.STYLE_OVERFLOW])o=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var l=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*i,a=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+l,h=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+l,u=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+l,p=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+l;o=new mxRectangle(t.x,t.y,Math.max(r,t.width-p-h),Math.max(s,t.height-a-u));var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),c=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&d==mxConstants.ALIGN_CENTER&&c==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,e?(o.x=t.absoluteOffset.x,o.y=t.absoluteOffset.y,null!=t.text&&null!=t.text.boundingBox&&(t.text.boundingBox.x>0&&(o.x=t.text.boundingBox.x),t.text.boundingBox.y>0&&(o.y=t.text.boundingBox.y))):null!=t.text&&null!=t.text.boundingBox&&(o.x=Math.min(o.x,t.text.boundingBox.x),o.y=Math.min(o.y,t.text.boundingBox.y)),o.x+=p,o.y+=a,null!=t.text&&null!=t.text.boundingBox&&(e?(o.width=Math.max(r,t.text.boundingBox.width),o.height=Math.max(s,t.text.boundingBox.height)):(o.width=Math.max(o.width,t.text.boundingBox.width),o.height=Math.max(o.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var m=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);m==mxConstants.ALIGN_LEFT?o.x-=t.width:m==mxConstants.ALIGN_RIGHT&&(o.x+=t.width);var g=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);g==mxConstants.ALIGN_TOP?o.y-=t.height:g==mxConstants.ALIGN_BOTTOM&&(o.y+=t.height)}}return new mxRectangle(Math.round(o.x),Math.round(o.y),Math.round(o.width),Math.round(o.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},__mxOutput.mxCellEditor=void 0!==mxCellEditor?mxCellEditor:void 0,mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initializeShape=function(t){t.shape.dialect=t.view.graph.dialect,this.configureShape(t),t.shape.init(t.view.getDrawPane())},mxCellRenderer.prototype.createShape=function(t){var e=null;if(null!=t.style){var i=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(null!=i)e=new mxShape(i);else e=new(this.getShapeConstructor(t))}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return null!=t?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return null==e&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),e},mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t),t.shape.image=t.view.graph.getImage(t),t.shape.indicatorColor=t.view.graph.getIndicatorColor(t),t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR],t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t),t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION],t.shape.indicatorImage=t.view.graph.getIndicatorImage(t),this.postConfigureShape(t)},mxCellRenderer.prototype.postConfigureShape=function(t){null!=t.shape&&(this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(null!=t.style)for(var e=["inherit","swimlane","indicated"],i=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR],n=0;n=0)return!0;return!1},mxCellRenderer.prototype.resolveColor=function(t,e,i){var n=t.shape[e],r=t.view.graph,s=null;if("inherit"==n?s=r.model.getParent(t.cell):"swimlane"==n?(t.shape[e]=i==mxConstants.STYLE_STROKECOLOR?"#000000":"#ffffff",s=null!=r.model.getTerminal(t.cell,!1)?r.model.getTerminal(t.cell,!1):t.cell,s=r.getSwimlane(s),i=r.swimlaneIndicatorColorAttribute):"indicated"==n&&(t.shape[e]=t.shape.indicatorColor),null!=s){var o=r.getView().getState(s);t.shape[e]=null,null!=o&&(null!=o.shape&&"indicatorColor"!=e?t.shape[e]=o.shape[e]:t.shape[e]=o.style[i])}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var i=t.view.graph;if(i.getModel().isEdge(t.cell),t.style[mxConstants.STYLE_FONTSIZE]>0||null==t.style[mxConstants.STYLE_FONTSIZE]){var n=i.isHtmlLabel(t.cell)||null!=e&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,i.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],i.isWrapping(t.cell)&&i.isHtmlLabel(t.cell),i.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=n?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.style=t.style,t.text.state=t,this.initializeLabel(t,t.text);var r=!1,s=function(e){var n=t;if(mxClient.IS_TOUCH||r){var s=mxEvent.getClientX(e),o=mxEvent.getClientY(e),l=mxUtils.convertPoint(i.container,s,o);n=i.view.getState(i.getCellAt(l.x,l.y))}return n};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),r=i.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,s(e)))})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(i.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,s(e))),r=!1)}))),i.nativeDblClickEnabled&&mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(i.dblClick(e,t.cell),mxEvent.consume(e))})))}},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph.getCellOverlays(t.cell),i=null;if(null!=e){i=new mxDictionary;for(var n=0;n0)?this.createLabel(t,n):null==t.text||null!=n&&0!=n.length||(t.text.destroy(),t.text=null),null!=t.text){e&&(null!=t.text.lastValue&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=i.getVerticalAlign(t));var a=this.getLabelBounds(t),h=this.getTextScale(t);if(e||t.text.value!=n||t.text.isWrapping!=r||t.text.overflow!=l||t.text.isClipping!=s||t.text.scale!=h||t.text.dialect!=o||null==t.text.bounds||!t.text.bounds.equals(a)){t.text.dialect=o,t.text.value=n,t.text.bounds=a,t.text.scale=h,t.text.wrap=r,t.text.clipped=s,t.text.overflow=l;var u=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=u}}},mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function i(i,n,r){return"spacingTop"==n||"spacingRight"==n||"spacingBottom"==n||"spacingLeft"==n?parseFloat(e[i])-parseFloat(e.spacing)!=(t.style[n]||r):e[i]!=(t.style[n]||r)}return i("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||i("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||i("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||i("color",mxConstants.STYLE_FONTCOLOR,"black")||i("align",mxConstants.STYLE_ALIGN,"")||i("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||i("spacing",mxConstants.STYLE_SPACING,2)||i("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||i("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||i("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||i("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||i("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||i("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||i("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||i("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||i("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)},mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()},mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale},mxCellRenderer.prototype.getLabelBounds=function(t){var e=t.view.graph,i=t.view.scale,n=e.getModel().isEdge(t.cell),r=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(n){var s=t.text.getSpacing();r.x+=s.x*i,r.y+=s.y*i;var o=e.getCellGeometry(t.cell);null!=o&&(r.width=Math.max(0,o.width*i),r.height=Math.max(0,o.height*i))}else{if(t.text.isPaintBoundsInverted()){var l=r.x;r.x=r.y,r.y=l}r.x+=t.x,r.y+=t.y,r.width=Math.max(1,t.width),r.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var a=(t.width-t.height)/2;r.x+=a,r.y-=a;l=r.width;r.width=r.height,r.height=l}if(null!=t.shape){var h=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),u=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);h==mxConstants.ALIGN_CENTER&&u==mxConstants.ALIGN_MIDDLE&&(r=t.shape.getLabelBounds(r))}var p=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return null!=p&&(r.width=parseFloat(p)*i),n||this.rotateLabelBounds(t,r),r},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||"fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var i=t.view.scale,n=t.text.getSpacing();e.x+=n.x*i,e.y+=n.y*i;var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),o=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(r==mxConstants.ALIGN_CENTER&&null==o?t.text.spacingLeft*i+t.text.spacingRight*i:0)),e.height=Math.max(0,e.height-(s==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*i+t.text.spacingBottom*i:0))}var l=t.text.getTextRotation();if(0!=l&&null!=t&&t.view.graph.model.isVertex(t.cell)){var a=t.getCenterX(),h=t.getCenterY();if(e.x!=a||e.y!=h){var u=l*(Math.PI/180),p=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(u),Math.sin(u),new mxPoint(a,h));e.x=p.x,e.y=p.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(t,e){if(this.createCellOverlays(t),null!=t.overlays){var i=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90),n=mxUtils.toRadians(i),r=Math.cos(n),s=Math.sin(n);t.overlays.visit((function(n,o){var l=o.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)&&null!=t.shape&&0!=i){var a=l.getCenterX(),h=l.getCenterY(),u=mxUtils.getRotatedPoint(new mxPoint(a,h),r,s,new mxPoint(t.getCenterX(),t.getCenterY()));a=u.x,h=u.y,l.x=Math.round(a-l.width/2),l.y=Math.round(h-l.height/2)}!e&&null!=o.bounds&&o.scale==t.view.scale&&o.bounds.equals(l)||(o.bounds=l,o.scale=t.view.scale,o.redraw())}))}},mxCellRenderer.prototype.redrawControl=function(t,e){var i=t.view.graph.getFoldingImage(t);if(null!=t.control&&null!=i){var n=this.getControlBounds(t,i.width,i.height),r=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),s=t.view.scale;!e&&t.control.scale==s&&t.control.bounds.equals(n)&&t.control.rotation==r||(t.control.rotation=r,t.control.bounds=n,t.control.scale=s,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,i){if(null!=t.control){var n=t.view.scale,r=t.getCenterX(),s=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(r=t.x+e*n,s=t.y+i*n,null!=t.shape)){var o=t.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var l=(t.width-t.height)/2;r+=l,s-=l}if(0!=o){var a=mxUtils.toRadians(o),h=Math.cos(a),u=Math.sin(a),p=mxUtils.getRotatedPoint(new mxPoint(r,s),h,u,new mxPoint(t.getCenterX(),t.getCenterY()));r=p.x,s=p.y}}return t.view.graph.getModel().isEdge(t.cell),new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n))}return null},mxCellRenderer.prototype.insertStateAfter=function(t,e,i){for(var n=this.getShapesForState(t),r=0;r0?n[0]:null)&&(f=a.transformControlPoint(t,f),mxUtils.contains(e,f.x,f.y)&&(f=null));var u=0,p=0,d=0,c=0,m=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,h.gridSize)*a.scale,g=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_SOUTH?(u=a.getRoutingCenterX(e),p=m):(d=a.getRoutingCenterY(e),c=m),null==f||f.xe.x+e.width?null!=f?(u=f.x,c=Math.max(Math.abs(d-f.y),c)):g==mxConstants.DIRECTION_NORTH?d=e.y-2*p:g==mxConstants.DIRECTION_SOUTH?d=e.y+e.height+2*p:u=g==mxConstants.DIRECTION_EAST?e.x-2*c:e.x+e.width+2*c:null!=f&&(u=a.getRoutingCenterX(e),p=Math.max(Math.abs(u-f.x),c),d=f.y,c=0),r.push(new mxPoint(u-p,d-c)),r.push(new mxPoint(u+p,d+c))}}else if(null!=n&&n.length>0)for(var x=0;x0?n[0]:null,o=!1,l=!1;if(null!=e&&null!=i)if(null!=s){var a=Math.min(e.x,i.x),h=Math.max(e.x+e.width,i.x+i.width),u=Math.min(e.y,i.y),p=Math.max(e.y+e.height,i.y+i.height);o=(s=t.view.transformControlPoint(t,s)).yp,l=s.xh}else{if(!(o=(a=Math.max(e.x,i.x))==(h=Math.min(e.x+e.width,i.x+i.width))))l=(u=Math.max(e.y,i.y))==(p=Math.min(e.y+e.height,i.y+i.height))}l||!o&&t.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(t,e,i,n,r):mxEdgeStyle.TopToBottom(t,e,i,n,r)},SideToSide:function(t,e,i,n,r){var s=t.view,o=null!=n&&n.length>0?n[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=s.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((i=new mxCellState).x=h.x,i.y=h.y),null!=e&&null!=i){var u=Math.max(e.x,i.x),p=Math.min(e.x+e.width,i.x+i.width),d=null!=o?o.x:Math.round(p+(u-p)/2),c=s.getRoutingCenterY(e),m=s.getRoutingCenterY(i);if(null!=o&&(o.y>=e.y&&o.y<=e.y+e.height&&(c=o.y),o.y>=i.y&&o.y<=i.y+i.height&&(m=o.y)),mxUtils.contains(i,d,c)||mxUtils.contains(e,d,c)||r.push(new mxPoint(d,c)),mxUtils.contains(i,d,m)||mxUtils.contains(e,d,m)||r.push(new mxPoint(d,m)),1==r.length)if(null!=o)mxUtils.contains(i,d,o.y)||mxUtils.contains(e,d,o.y)||r.push(new mxPoint(d,o.y));else{var g=Math.max(e.y,i.y),x=Math.min(e.y+e.height,i.y+i.height);r.push(new mxPoint(d,g+(x-g)/2))}}},TopToBottom:function(t,e,i,n,r){var s=t.view,o=null!=n&&n.length>0?n[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=s.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((i=new mxCellState).x=h.x,i.y=h.y),null!=e&&null!=i){var u=Math.max(e.y,i.y),p=Math.min(e.y+e.height,i.y+i.height),d=s.getRoutingCenterX(e);null!=o&&o.x>=e.x&&o.x<=e.x+e.width&&(d=o.x);var c=null!=o?o.y:Math.round(p+(u-p)/2);if(mxUtils.contains(i,d,c)||mxUtils.contains(e,d,c)||r.push(new mxPoint(d,c)),d=null!=o&&o.x>=i.x&&o.x<=i.x+i.width?o.x:s.getRoutingCenterX(i),mxUtils.contains(i,d,c)||mxUtils.contains(e,d,c)||r.push(new mxPoint(d,c)),1==r.length)if(null!=o&&1==r.length)mxUtils.contains(i,o.x,c)||mxUtils.contains(e,o.x,c)||r.push(new mxPoint(o.x,c));else{var m=Math.max(e.x,i.x),g=Math.min(e.x+e.width,i.x+i.width);r.push(new mxPoint(m+(g-m)/2,c))}}},SegmentConnector:function(t,e,i,n,r){var s=t.absolutePoints,o=Math.max(1,t.view.scale),l=r.length>0?r[0]:null,a=!0,h=null;function u(t){return(null==l||Math.abs(l.x-t.x)>=o||Math.abs(l.y-t.y)>=o)&&(r.push(t),l=t),l}var p=s[0];null==p&&null!=e?p=new mxPoint(t.view.getRoutingCenterX(e),t.view.getRoutingCenterY(e)):null!=p&&(p=p.clone()),p.x=Math.round(p.x),p.y=Math.round(p.y);var d=s.length-1;if(null!=n&&n.length>0){for(var c=[],m=0;m=f.y&&E.y<=f.y+f.height,w=null!=f&&E.x>=f.x&&E.x<=f.x+f.width;if(v=b||null==y&&T,C=S||null==y&&w,0==m&&(v&&C||S&&b));else{if(null!=y&&!b&&!S&&(T||w)){a=!T;break}if(C||v){a=v,1==m&&(a=n.length%2==0?v:C);break}}f=i,null!=(y=s[d])&&(y.x=Math.round(y.x),y.y=Math.round(y.y),f=null),E=n[n.length-1],S&&b&&(n=n.slice(1))}a&&(null!=s[0]&&s[0].y!=h.y||null==s[0]&&null!=e&&(h.ye.y+e.height))?u(new mxPoint(p.x,h.y)):!a&&(null!=s[0]&&s[0].x!=h.x||null==s[0]&&null!=e&&(h.xe.x+e.width))&&u(new mxPoint(h.x,p.y)),a?p.y=h.y:p.x=h.x;for(m=0;mi.y+i.height))?u(new mxPoint(p.x,h.y)):!a&&(null!=s[d]&&s[d].x!=h.x||null==s[d]&&null!=i&&(h.xi.x+i.width))&&u(new mxPoint(h.x,p.y)))),null==s[0]&&null!=e)for(;r.length>1&&null!=r[1]&&mxUtils.contains(e,r[1].x,r[1].y);)r.splice(1,1);if(null==s[d]&&null!=i)for(;r.length>1&&null!=r[r.length-1]&&mxUtils.contains(i,r[r.length-1].x,r[r.length-1].y);)r.splice(r.length-1,1);null!=x&&null!=r[r.length-1]&&Math.abs(x.x-r[r.length-1].x)<=o&&Math.abs(x.y-r[r.length-1].y)<=o&&(r.splice(r.length-1,1),null!=r[r.length-1]&&(Math.abs(r[r.length-1].x-x.x)0||o||l)mxEdgeStyle.SegmentConnector(t,e,i,n,r);else{var b,T=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],w=0;if(null!=e)if(T[0]=mxUtils.getPortConstraints(e,t,!0,mxConstants.DIRECTION_MASK_ALL),0!=(w=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0)))p=(b=mxUtils.getBoundingBox(new mxRectangle(p,d,c,m),w)).x,d=b.y,c=b.width,m=b.height;if(null!=i)if(T[1]=mxUtils.getPortConstraints(i,t,!1,mxConstants.DIRECTION_MASK_ALL),0!=(w=mxUtils.getValue(i.style,mxConstants.STYLE_ROTATION,0)))g=(b=mxUtils.getBoundingBox(new mxRectangle(g,x,f,y),w)).x,x=b.y,f=b.width,y=b.height;for(var L=[0,0],A=[[p=Math.round(10*p)/10,d=Math.round(10*d)/10,c=Math.round(10*c)/10,m=Math.round(10*m)/10],[g=Math.round(10*g)/10,x=Math.round(10*x)/10,f=Math.round(10*f)/10,y=Math.round(10*y)/10]],I=[v,C],O=0;O<2;O++)mxEdgeStyle.limits[O][1]=A[O][0]-I[O],mxEdgeStyle.limits[O][2]=A[O][1]-I[O],mxEdgeStyle.limits[O][4]=A[O][0]+A[O][2]+I[O],mxEdgeStyle.limits[O][8]=A[O][1]+A[O][3]+I[O];var R,M=A[0][0]+A[0][2]/2,P=A[0][1]+A[0][3]/2,N=A[1][0]+A[1][2]/2,_=P-(A[1][1]+A[1][3]/2),D=0;(R=M-N)<0?D=_<0?2:1:_<=0&&(D=3,0==R&&(D=2));var H=null;null!=e&&(H=h);var G=[[.5,.5],[.5,.5]];for(O=0;O<2;O++)null!=H&&(G[O][0]=(H.x-A[O][0])/A[O][2],Math.abs(H.x-A[O][0])<=1?L[O]=mxConstants.DIRECTION_MASK_WEST:Math.abs(H.x-A[O][0]-A[O][2])<=1&&(L[O]=mxConstants.DIRECTION_MASK_EAST),G[O][1]=(H.y-A[O][1])/A[O][3],Math.abs(H.y-A[O][1])<=1?L[O]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(H.y-A[O][1]-A[O][3])<=1&&(L[O]=mxConstants.DIRECTION_MASK_SOUTH)),H=null,null!=i&&(H=u);var U=A[0][1]-(A[1][1]+A[1][3]),V=A[0][0]-(A[1][0]+A[1][2]),k=A[1][1]-(A[0][1]+A[0][3]),B=A[1][0]-(A[0][0]+A[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(V-E,0),mxEdgeStyle.vertexSeperations[2]=Math.max(U-E,0),mxEdgeStyle.vertexSeperations[4]=Math.max(k-E,0),mxEdgeStyle.vertexSeperations[3]=Math.max(B-E,0);var F=[],q=[],Y=[];q[0]=V>=B?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,Y[0]=U>=k?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,q[1]=mxUtils.reversePortConstraints(q[0]),Y[1]=mxUtils.reversePortConstraints(Y[0]);var z=V>=B?V:B,j=U>=k?U:k,X=[[0,0],[0,0]],W=!1;for(O=0;O<2;O++)0==L[O]&&(0==(q[O]&T[O])&&(q[O]=mxUtils.reversePortConstraints(q[O])),0==(Y[O]&T[O])&&(Y[O]=mxUtils.reversePortConstraints(Y[O])),X[O][0]=Y[O],X[O][1]=q[O]);j>0&&z>0&&((q[0]&T[0])>0&&(Y[1]&T[1])>0?(X[0][0]=q[0],X[0][1]=Y[0],X[1][0]=Y[1],X[1][1]=q[1],W=!0):(Y[0]&T[0])>0&&(q[1]&T[1])>0&&(X[0][0]=Y[0],X[0][1]=q[0],X[1][0]=q[1],X[1][1]=Y[1],W=!0)),j>0&&!W&&(X[0][0]=Y[0],X[0][1]=q[0],X[1][0]=Y[1],X[1][1]=q[1],W=!0),z>0&&!W&&(X[0][0]=q[0],X[0][1]=Y[0],X[1][0]=q[1],X[1][1]=Y[1],W=!0);for(O=0;O<2;O++)0==L[O]&&(0==(X[O][0]&T[O])&&(X[O][0]=X[O][1]),F[O]=X[O][0]&T[O],F[O]|=(X[O][1]&T[O])<<8,F[O]|=(X[1-O][O]&T[O])<<16,F[O]|=(X[1-O][1-O]&T[O])<<24,0==(15&F[O])&&(F[O]=F[O]<<8),0==(3840&F[O])&&(F[O]=15&F[O]|F[O]>>8),0==(983040&F[O])&&(F[O]=65535&F[O]|(251658240&F[O])>>8),L[O]=15&F[O],T[O]!=mxConstants.DIRECTION_MASK_WEST&&T[O]!=mxConstants.DIRECTION_MASK_NORTH&&T[O]!=mxConstants.DIRECTION_MASK_EAST&&T[O]!=mxConstants.DIRECTION_MASK_SOUTH||(L[O]=T[O]));var K=L[0]==mxConstants.DIRECTION_MASK_EAST?3:L[0],$=L[1]==mxConstants.DIRECTION_MASK_EAST?3:L[1];(K-=D)<1&&(K+=4),($-=D)<1&&($+=4);var Z=mxEdgeStyle.routePatterns[K-1][$-1];switch(mxEdgeStyle.wayPoints1[0][0]=A[0][0],mxEdgeStyle.wayPoints1[0][1]=A[0][1],L[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=v,mxEdgeStyle.wayPoints1[0][1]+=G[0][1]*A[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=G[0][0]*A[0][2],mxEdgeStyle.wayPoints1[0][1]+=A[0][3]+v;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=A[0][2]+v,mxEdgeStyle.wayPoints1[0][1]+=G[0][1]*A[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=G[0][0]*A[0][2],mxEdgeStyle.wayPoints1[0][1]-=v}var J=0,Q=(L[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,tt=Q,et=0;for(O=0;O4&&(nt-=4);var rt=mxEdgeStyle.dirVectors[nt-1];(et=nt%2>0?0:1)!=Q&&(J++,mxEdgeStyle.wayPoints1[J][0]=mxEdgeStyle.wayPoints1[J-1][0],mxEdgeStyle.wayPoints1[J][1]=mxEdgeStyle.wayPoints1[J-1][1]);var st=(Z[O]&mxEdgeStyle.TARGET_MASK)>0,ot=(Z[O]&mxEdgeStyle.SOURCE_MASK)>0,lt=(Z[O]&mxEdgeStyle.SIDE_MASK)>>5;(lt<<=D)>15&&(lt>>=4);var at=(Z[O]&mxEdgeStyle.CENTER_MASK)>0;if((ot||st)&<<9){var ht=0,ut=ot?0:1;if(ht=at&&0==et?A[ut][0]+G[ut][0]*A[ut][2]:at?A[ut][1]+G[ut][1]*A[ut][3]:mxEdgeStyle.limits[ut][lt],0==et){var pt=(ht-mxEdgeStyle.wayPoints1[J][0])*rt[0];pt>0&&(mxEdgeStyle.wayPoints1[J][0]+=rt[0]*pt)}else{var dt=(ht-mxEdgeStyle.wayPoints1[J][1])*rt[1];dt>0&&(mxEdgeStyle.wayPoints1[J][1]+=rt[1]*dt)}}else at&&(mxEdgeStyle.wayPoints1[J][0]+=rt[0]*Math.abs(mxEdgeStyle.vertexSeperations[nt]/2),mxEdgeStyle.wayPoints1[J][1]+=rt[1]*Math.abs(mxEdgeStyle.vertexSeperations[nt]/2));J>0&&mxEdgeStyle.wayPoints1[J][et]==mxEdgeStyle.wayPoints1[J-1][et]?J--:Q=et}for(O=0;O<=J;O++){if(O==J)if((((L[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1)==tt?0:1)!=(J+1)%2)break;r.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[O][0]),Math.round(mxEdgeStyle.wayPoints1[O][1])))}for(var ct=1;ct0)for(var i=this.graph.getModel(),n=0;n0||o.height>0){r=new mxPoint(e.x,e.y);var l=!1,a=!1;this.graph.model.isVertex(t.cell)&&(l=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0),a=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),null!=t.shape&&null!=t.shape.stencil&&(l=1==mxUtils.getValue(t.style,"stencilFlipH",0)||l,a=1==mxUtils.getValue(t.style,"stencilFlipV",0)||a),l&&(r.x=2*o.getCenterX()-r.x),a&&(r.y=2*o.getCenterY()-r.y)),null!=(r=s(o,t,r,i))&&(l&&(r.x=2*o.getCenterX()-r.x),a&&(r.y=2*o.getCenterY()-r.y))}}null==r&&(r=this.getPoint(t))}return r},mxGraphView.prototype.getRoutingCenterX=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=null!=e?e:0,null!=t&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if("string"==typeof e){var i=mxStyleRegistry.getValue(e);null==i&&this.isAllowEval()&&(i=mxUtils.eval(e)),e=i}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(t,e,i){var n=t.absolutePoints,r=null;if(null!=n&&n.length>=2){var s=n.length;r=n[i?Math.min(1,s-1):Math.max(0,s-2)]}return null==r&&null!=e&&(r=new mxPoint(e.getCenterX(),e.getCenterY())),r},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var i=this.graph.getModel(),n=i.getTerminal(t,e),r=n;null!=n&&n!=this.currentRoot;)this.graph.isCellVisible(r)&&!this.isCellCollapsed(n)||(r=n),n=i.getParent(n);return null==r||i.contains(r)&&i.getParent(r)!=i.getRoot()&&r!=this.currentRoot||(r=null),r},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,i=e[0],n=e[e.length-1];if(i.x!=n.x||i.y!=n.y){var r=n.x-i.x,s=n.y-i.y;t.terminalDistance=Math.sqrt(r*r+s*s)}else t.terminalDistance=0;var o=0,l=[],a=i;if(null!=a){for(var h=a.x,u=a.y,p=h,d=u,c=1;c=Math.round(a+l)&&h1){for(var s=t.length,o=t.segments,l=t.absolutePoints[0],a=t.absolutePoints[1],h=mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,i),u=0,p=0,d=0,c=2;cg&&(L=g);var A=Math.sqrt(mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,i));return-1==mxUtils.relativeCcw(l.x,l.y,a.x,a.y,e,i)&&(A=-A),new mxPoint((s/2-d-L)/s*-2,A/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),null!=e&&e.length>0&&null!=t.segments){var i=this.graph.getCellGeometry(t.cell);if(i.relative){var n=this.getPoint(t,i);null!=n&&(t.absoluteOffset=n)}else{var r=e[0],s=e[e.length-1];if(null!=r&&null!=s){var o=s.x-r.x,l=s.y-r.y,a=0,h=0,u=i.offset;null!=u&&(a=u.x,h=u.y);var p=r.x+o/2+a*this.scale,d=r.y+l/2+h*this.scale;t.absoluteOffset.x=p,t.absoluteOffset.y=d}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var i=null;return null!=t&&(i=this.states.get(t),e&&(null==i||this.updateStyle)&&this.graph.isCellVisible(t)&&(null==i?(i=this.createState(t),this.states.put(t,i)):i.style=this.graph.getCellStyle(t))),i},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(t){this.rendering=t},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(t){this.states=t},mxGraphView.prototype.getCellStates=function(t){if(null==t)return this.states;for(var e=[],i=0;ir&&i.x>r+2&&i.x<=n)return!0;var s=this.graph.container.offsetHeight,o=this.graph.container.clientHeight;return s>o&&i.y>o+2&&i.y<=s},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var t=this.graph,e=t.container;if(null!=e){mxClient.IS_TOUCH&&(mxEvent.addListener(e,"gesturestart",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)}))),mxEvent.addListener(e,"gesturechange",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)}))),mxEvent.addListener(e,"gestureend",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)})))),mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(e){!this.isContainerEvent(e)||(mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_GC||mxClient.IS_OP||mxClient.IS_SF)&&this.isScrollEvent(e)||t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))})),mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))})),mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))),mxEvent.addListener(e,"dblclick",mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.dblClick(e)})));t.addMouseListener({mouseDown:function(e,i){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,(function(i){null!=t.tooltipHandler&&t.tooltipHandler.isHideOnHover()&&t.tooltipHandler.hide(),this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(i)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&!mxEvent.isConsumed(i)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(i,function(i){var n=null;if(mxClient.IS_TOUCH){var r=mxEvent.getClientX(i),s=mxEvent.getClientY(i),o=mxUtils.convertPoint(e,r,s);n=t.view.getState(t.getCellAt(o.x,o.y))}return n}(i)))})),this.endHandler=mxUtils.bind(this,(function(e){this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(e)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(null!=t&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),t.appendChild(this.canvas),this.updateContainerStyle(t),mxClient.IS_QUIRKS)){var e=mxUtils.bind(this,(function(t){var e=this.getGraphBounds(),i=e.x+e.width+this.graph.border,n=e.y+e.height+this.graph.border;this.updateHtmlCanvasSize(i,n)}));mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(null!=this.graph.container){var i=this.graph.container.offsetWidth,n=this.graph.container.offsetHeight;this.canvas.style.width=i")},mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler(),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=this.createSelectionCellsHandler(),this.connectionHandler=this.createConnectionHandler(),this.connectionHandler.setEnabled(!1),this.graphHandler=this.createGraphHandler(),this.panningHandler=this.createPanningHandler(),this.panningHandler.panningEnabled=!1,this.popupMenuHandler=this.createPopupMenuHandler()},mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)},mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)},mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)},mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)},mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)},mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(t){this.stylesheet=t},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t},mxGraph.prototype.getSelectionCellsForChanges=function(t){for(var e=new mxDictionary,i=[],n=mxUtils.bind(this,(function(t){if(!e.get(t)&&this.model.contains(t))if(this.model.isEdge(t)||this.model.isVertex(t))e.put(t,!0),i.push(t);else for(var r=this.model.getChildCount(t),s=0;s=0){t.overlays.splice(i,1),0==t.overlays.length&&(t.overlays=null);var n=this.view.getState(t);null!=n&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else e=null}return e},mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(null!=e){t.overlays=null;var i=this.view.getState(t);null!=i&&this.cellRenderer.redraw(i);for(var n=0;n0){var r=new mxCellOverlay(i=null!=i?i:this.warningImage,""+e+"");return n&&r.addListener(mxEvent.CLICK,mxUtils.bind(this,(function(e,i){this.isEnabled()&&this.setSelectionCell(t)}))),this.addCellOverlay(t,r)}return this.removeCellOverlays(t),null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){null!=e&&mxEvent.isMultiTouchEvent(e)||(null==t&&(null==(t=this.getSelectionCell())||this.isCellEditable(t)||(t=null)),null!=t&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e)),this.cellEditor.startEditing(t,e),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))))},mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)},mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t),this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))},mxGraph.prototype.labelChanged=function(t,e,i){this.model.beginUpdate();try{var n=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",n,"event",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,i){this.model.beginUpdate();try{this.model.setValue(t,e),i&&this.cellSizeUpdated(t,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))},mxGraph.prototype.click=function(t){var e=t.getEvent(),i=t.getCell(),n=new mxEventObject(mxEvent.CLICK,"event",e,"cell",i);if(t.isConsumed()&&n.consume(),this.fireEvent(n),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed())if(null!=i){if(this.isTransparentClickEvent(e)){var r=!1,s=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,(function(t){var e=this.isCellSelected(t.cell);return!(r=r||e)||e})));null!=s&&(i=s)}this.selectCellForEvent(i,e)}else{var o=null;this.isSwimlaneSelectionEnabled()&&(o=this.getSwimlaneAt(t.getGraphX(),t.getGraphY())),null!=o?this.selectCellForEvent(o,e):this.isToggleEvent(e)||this.clearSelection()}},mxGraph.prototype.dblClick=function(t,e){var i=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",t,"cell",e);this.fireEvent(i),!this.isEnabled()||mxEvent.isConsumed(t)||i.isConsumed()||null==e||!this.isCellEditable(e)||this.isEditing(e)||(this.startEditingAtCell(e,t),mxEvent.consume(t))},mxGraph.prototype.tapAndHold=function(t){var e=t.getEvent(),i=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",e,"cell",t.getCell());if(this.fireEvent(i),i.isConsumed()&&(this.panningHandler.panningTrigger=!1),this.isEnabled()&&!mxEvent.isConsumed(e)&&!i.isConsumed()&&this.connectionHandler.isEnabled()){var n=this.view.getState(this.connectionHandler.marker.getCell(t));null!=n&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=n,this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(t.getGraphX(),t.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(t),this.connectionHandler.previous=n,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous)))}},mxGraph.prototype.scrollPointToVisible=function(t,e,i,n){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(t+this.panDx,e+this.panDy));else{var r=this.container;if(n=null!=n?n:20,t>=r.scrollLeft&&e>=r.scrollTop&&t<=r.scrollLeft+r.clientWidth&&e<=r.scrollTop+r.clientHeight){var s=r.scrollLeft+r.clientWidth-t;if(s0&&u.height>0){e&&null!=u.x&&null!=u.y&&((u=u.clone()).width+=u.x,u.height+=u.y,u.x=0,u.y=0);var p=this.view.scale,d=u.width/p,c=u.height/p;null!=this.backgroundImage&&(d=Math.max(d,this.backgroundImage.width-u.x/p),c=Math.max(c,this.backgroundImage.height-u.y/p));var m=(e?t:2*t)+i+1;a-=m,h-=m;var g=r?h/c:s?a/d:Math.min(a/d,h/c);if(null!=this.minFitScale&&(g=Math.max(g,this.minFitScale)),null!=this.maxFitScale&&(g=Math.min(g,this.maxFitScale)),!n)return g;if(e)this.view.scale!=g&&this.view.setScale(g);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(g);var x=this.getGraphBounds();null!=x.x&&(this.container.scrollLeft=x.x),null!=x.y&&(this.container.scrollTop=x.y)}else{var f=null!=u.x?Math.floor(this.view.translate.x-u.x/p+t/g+i/2):t,y=null!=u.y?Math.floor(this.view.translate.y-u.y/p+t/g+i/2):t;this.view.scaleAndTranslate(g,f,y)}}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(null!=this.container){var e=this.getBorder(),i=Math.max(0,t.x)+t.width+2*e,n=Math.max(0,t.y)+t.height+2*e;if(null!=this.minimumContainerSize&&(i=Math.max(i,this.minimumContainerSize.width),n=Math.max(n,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(i,n),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var r=this.getPreferredPageSize(t,Math.max(1,i),Math.max(1,n));null!=r&&(i=r.width*this.view.scale,n=r.height*this.view.scale)}if(null!=this.minimumGraphSize&&(i=Math.max(i,this.minimumGraphSize.width*this.view.scale),n=Math.max(n,this.minimumGraphSize.height*this.view.scale)),i=Math.ceil(i),n=Math.ceil(n),this.dialect==mxConstants.DIALECT_SVG){var s=this.view.getDrawPane().ownerSVGElement;null!=s&&(s.style.minWidth=Math.max(1,i)+"px",s.style.minHeight=Math.max(1,n)+"px",s.style.width="100%",s.style.height="100%")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,i),Math.max(1,n)):(this.view.canvas.style.minWidth=Math.max(1,i)+"px",this.view.canvas.style.minHeight=Math.max(1,n)+"px");this.updatePageBreaks(this.pageBreaksVisible,i,n)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))},mxGraph.prototype.doResizeContainer=function(t,e){null!=this.maximumContainerSize&&(t=Math.min(this.maximumContainerSize.width,t),e=Math.min(this.maximumContainerSize.height,e)),this.container.style.width=Math.ceil(t)+"px",this.container.style.height=Math.ceil(e)+"px"},mxGraph.prototype.updatePageBreaks=function(t,e,i){var n=this.view.scale,r=this.view.translate,s=this.pageFormat,o=n*this.pageScale,l=new mxRectangle(0,0,s.width*o,s.height*o),a=mxRectangle.fromRectangle(this.getGraphBounds());a.width=Math.max(1,a.width),a.height=Math.max(1,a.height),l.x=Math.floor((a.x-r.x*n)/l.width)*l.width+r.x*n,l.y=Math.floor((a.y-r.y*n)/l.height)*l.height+r.y*n,a.width=Math.ceil((a.width+(a.x-l.x))/l.width)*l.width,a.height=Math.ceil((a.height+(a.y-l.y))/l.height)*l.height;var h=(t=t&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(a.height/l.height)+1:0,u=t?Math.ceil(a.width/l.width)+1:0,p=(u-1)*l.width,d=(h-1)*l.height;null==this.horizontalPageBreaks&&h>0&&(this.horizontalPageBreaks=[]),null==this.verticalPageBreaks&&u>0&&(this.verticalPageBreaks=[]);var c=mxUtils.bind(this,(function(t){if(null!=t){for(var e=t==this.horizontalPageBreaks?h:u,i=0;i<=e;i++){var n=t==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+i*l.height)),new mxPoint(Math.round(l.x+p),Math.round(l.y+i*l.height))]:[new mxPoint(Math.round(l.x+i*l.width),Math.round(l.y)),new mxPoint(Math.round(l.x+i*l.width),Math.round(l.y+d))];if(null!=t[i])t[i].points=n,t[i].redraw();else{var r=new mxPolyline(n,this.pageBreakColor);r.dialect=this.dialect,r.pointerEvents=!1,r.isDashed=this.pageBreakDashed,r.init(this.view.backgroundPane),r.redraw(),t[i]=r}}for(i=e;i0&&";base64,"!=i.substring(n-7,n+1)&&(i=i.substring(0,n)+";base64,"+i.substring(n+1))}t[mxConstants.STYLE_IMAGE]=i}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(null!=(e=e||this.getSelectionCells())){this.model.beginUpdate();try{for(var i=0;i0){var r=this.view.getState(i[0]),s=null!=r?r.style:this.getCellStyle(i[0]);null!=s&&(n=mxUtils.getValue(s,t,e)?0:1,this.setCellStyles(t,n,i))}return n},mxGraph.prototype.setCellStyles=function(t,e,i){i=i||this.getSelectionCells(),mxUtils.setCellStyles(this.model,i,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,i){this.setCellStyleFlags(t,e,null,i)},mxGraph.prototype.setCellStyleFlags=function(t,e,i,n){if(null!=(n=n||this.getSelectionCells())&&n.length>0){if(null==i){var r=this.view.getState(n[0]),s=null!=r?r.style:this.getCellStyle(n[0]);if(null!=s)i=!((parseInt(s[t]||0)&e)==e)}mxUtils.setCellStyleFlags(this.model,n,t,e,i)}},mxGraph.prototype.alignCells=function(t,e,i){if(null==e&&(e=this.getSelectionCells()),null!=e&&e.length>1){if(null==i)for(var n=0;n0&&null!=n){var r=this.model.getParent(t);null==r&&(r=this.model.getParent(i[0])),this.model.beginUpdate();try{null==this.getCellGeometry(t)&&this.model.setGeometry(t,new mxGeometry);var s=this.model.getChildCount(r);this.cellsAdded([t],r,s,null,null,!1,!1,!1),s=this.model.getChildCount(t),this.cellsAdded(i,t,s,null,null,!1,!1,!1),this.cellsMoved(i,-n.x,-n.y,!1,!1,!1),this.cellsResized([t],[n],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",i))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(null!=t&&t.length>0){var i=this.model.getParent(t[0]);e.push(t[0]);for(var n=1;n0&&i.push(t[n]);t=i}if(null!=t&&t.length>0){this.model.beginUpdate();try{for(n=0;n0){r=r.slice();var s=this.model.getParent(t[n]),o=this.model.getChildCount(s);this.cellsAdded(r,s,o,null,null,!0),e=e.concat(r)}}this.removeCellsAfterUngroup(t),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",t))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){null==t&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),i=this.model.getChildCount(e);this.cellsAdded(t,e,i,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,i,n,r,s,o){null==t&&(t=this.getSelectionCells()),e=null!=e?e:0,i=null!=i&&i,n=null!=n?n:0,r=null!=r?r:0,s=null!=s?s:0,o=null!=o?o:0,this.model.beginUpdate();try{for(var l=t.length-1;l>=0;l--){var a=this.getCellGeometry(t[l]);if(null!=a){var h=this.getChildCells(t[l]);if(null!=h&&h.length>0){var u=this.getBoundingBoxFromGeometry(h,!0);if(null!=u&&u.width>0&&u.height>0){var p=0,d=0;if(this.isSwimlane(t[l])){var c=this.getStartSize(t[l]);p=c.width,d=c.height}a=a.clone(),i&&(a.x=Math.round(a.x+u.x-e-p-o),a.y=Math.round(a.y+u.y-e-d-n)),a.width=Math.round(u.width+2*e+p+o+r),a.height=Math.round(u.height+2*e+d+n+s),this.model.setGeometry(t[l],a),this.moveCells(h,e+p-u.x+o,e+d-u.y+n)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(null!=t&&t.length>0)for(var i=0;i0){var a=this.view.scale,h=this.view.translate;r=this.model.cloneCells(t,!0,i);for(l=0;lthis.model.getChildCount(e)&&i--,this.model.add(e,t[p],i+p),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[p],!0),(null==l||l)&&this.isExtendParentsOnAdd(t[p])&&this.isExtendParent(t[p])&&this.extendParent(t[p]),(null==o||o)&&this.constrainChild(t[p]),null!=n&&this.cellConnected(t[p],n,!0),null!=r&&this.cellConnected(t[p],r,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",i,"source",n,"target",r,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=null==e||e)for(var i=this.model.getChildCount(t),n=0;n0){var e=this.view.scale,i=this.view.translate;this.model.beginUpdate();try{for(var n=new mxDictionary,r=0;r0){this.model.beginUpdate();try{for(var i=0;i0){this.model.beginUpdate();try{for(var r=0;r0&&(s.height=Math.max(s.height,l))}}e.alternateBounds=new mxRectangle(0,0,s.width,s.height)}if(null!=e.alternateBounds){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var a=mxUtils.toRadians(r[mxConstants.STYLE_ROTATION]||0);if(0!=a){var h=e.alternateBounds.getCenterX()-e.getCenterX(),u=e.alternateBounds.getCenterY()-e.getCenterY(),p=Math.cos(a),d=Math.sin(a),c=p*h-d*u,m=d*h+p*u;e.alternateBounds.x+=c-h,e.alternateBounds.y+=m-u}}}},mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))},mxGraph.prototype.getAllEdges=function(t){var e=[];if(null!=t)for(var i=0;i0){this.isHtmlLabel(i.cell)||(a=mxUtils.htmlEntities(a,!1)),a=a.replace(/\n/g,"
");var h=mxUtils.getSizeForString(a,r,n[mxConstants.STYLE_FONTFAMILY],null,n[mxConstants.STYLE_FONTSTYLE]),u=h.width+s,p=h.height+o;if(!mxUtils.getValue(n,mxConstants.STYLE_HORIZONTAL,!0)){var d=p;p=u,u=d}this.gridEnabled&&(u=this.snap(u+this.gridSize/2),p=this.snap(p+this.gridSize/2)),e=new mxRectangle(0,0,u,p)}else{var c=4*this.gridSize;e=new mxRectangle(0,0,c,c)}}}return e},mxGraph.prototype.resizeCell=function(t,e,i){return this.resizeCells([t],[e],i)[0]},mxGraph.prototype.resizeCells=function(t,e,i){i=null!=i?i:this.isRecursiveResize(),this.model.beginUpdate();try{this.cellsResized(t,e,i),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,i){if(i=null!=i&&i,null!=t&&null!=e&&t.length==e.length){this.model.beginUpdate();try{for(var n=0;n0&&((o=mxRectangle.fromRectangle(o)).x-=o.width*l,o.y-=o.height*l,o.width+=2*o.width*l,o.height+=2*o.height*l),null==r?r=o:(r=mxRectangle.fromRectangle(r)).intersect(o)}}if(null!=r){var a=[t];if(!this.isCellCollapsed(t))for(var h=this.model.getDescendants(t),u=0;ur.width&&(d=i.width-r.width,i.width-=d),p.x+p.width>r.x+r.width&&(d-=p.x+p.width-r.x-r.width-d);var c=0;i.height>r.height&&(c=i.height-r.height,i.height-=c),p.y+p.height>r.y+r.height&&(c-=p.y+p.height-r.y-r.height-c),p.x0&&((e=e.clone()).points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,i){if(null!=e.shape){var n=this.view.getPerimeterBounds(e),r=e.style[mxConstants.STYLE_DIRECTION];if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){n.x+=n.width/2-n.height/2,n.y+=n.height/2-n.width/2;var s=n.width;n.width=n.height,n.height=s}var o=mxUtils.toRadians(e.shape.getShapeRotation());if(0!=o){var l=Math.cos(-o),a=Math.sin(-o),h=new mxPoint(n.getCenterX(),n.getCenterY());t=mxUtils.getRotatedPoint(t,l,a,h)}var u=1,p=1,d=0,c=0;if(this.getModel().isVertex(e.cell)){var m=e.style[mxConstants.STYLE_FLIPH],g=e.style[mxConstants.STYLE_FLIPV];if(null!=e.shape&&null!=e.shape.stencil&&(m=1==mxUtils.getValue(e.style,"stencilFlipH",0)||m,g=1==mxUtils.getValue(e.style,"stencilFlipV",0)||g),r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){s=m;m=g,g=s}m&&(u=-1,d=-n.width),g&&(p=-1,c=-n.height)}return t=new mxPoint((t.x-n.x)*u-d+n.x,(t.y-n.y)*p-c+n.y),new mxConnectionConstraint(new mxPoint(0==n.width?0:Math.round(1e3*(t.x-n.x)/n.width)/1e3,0==n.height?0:Math.round(1e3*(t.y-n.y)/n.height)/1e3),!1)}return null},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return null!=t&&null!=t.shape&&null!=t.shape.stencil?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,i){var n=null,r=t.style[i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=r){var s=t.style[i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=s&&(n=new mxPoint(parseFloat(r),parseFloat(s)))}var o=!1,l=0,a=0;return null!=n&&(o=mxUtils.getValue(t.style,i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),l=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),a=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),l=isFinite(l)?l:0,a=isFinite(a)?a:0),new mxConnectionConstraint(n,o,null,l,a)},mxGraph.prototype.setConnectionConstraint=function(t,e,i,n){if(null!=n){this.model.beginUpdate();try{null==n||null==n.point?(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):null!=n.point&&(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,n.point.x,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,n.point.y,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,n.dx,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,n.dy,[t]),n.perimeter?this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,i){i=null==i||i;var n=null;if(null!=t&&null!=e.point){var r=this.view.getPerimeterBounds(t),s=new mxPoint(r.getCenterX(),r.getCenterY()),o=t.style[mxConstants.STYLE_DIRECTION],l=0;null!=o&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(o==mxConstants.DIRECTION_NORTH?l+=270:o==mxConstants.DIRECTION_WEST?l+=180:o==mxConstants.DIRECTION_SOUTH&&(l+=90),o!=mxConstants.DIRECTION_NORTH&&o!=mxConstants.DIRECTION_SOUTH||r.rotate90());var a=this.view.scale;n=new mxPoint(r.x+e.point.x*r.width+e.dx*a,r.y+e.point.y*r.height+e.dy*a);var h=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(0!=l){var u=0,p=0;90==l?p=1:180==l?u=-1:270==l&&(p=-1),n=mxUtils.getRotatedPoint(n,u,p,s)}n=this.view.getPerimeterPoint(t,n,!1)}else if(h+=l,this.getModel().isVertex(t.cell)){var d=1==t.style[mxConstants.STYLE_FLIPH],c=1==t.style[mxConstants.STYLE_FLIPV];if(null!=t.shape&&null!=t.shape.stencil&&(d=1==mxUtils.getValue(t.style,"stencilFlipH",0)||d,c=1==mxUtils.getValue(t.style,"stencilFlipV",0)||c),o==mxConstants.DIRECTION_NORTH||o==mxConstants.DIRECTION_SOUTH){var m=d;d=c,c=m}d&&(n.x=2*r.getCenterX()-n.x),c&&(n.y=2*r.getCenterY()-n.y)}if(0!=h&&null!=n){var g=mxUtils.toRadians(h);u=Math.cos(g),p=Math.sin(g);n=mxUtils.getRotatedPoint(n,u,p,s)}}return i&&null!=n&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),n},mxGraph.prototype.connectCell=function(t,e,i,n){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);this.cellConnected(t,e,i,n),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,i,n){if(null!=t){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);if(this.setConnectionConstraint(t,e,i,n),this.isPortsEnabled()){var s=null;this.isPort(e)&&(s=e.getId(),e=this.getTerminalForPort(e,i));var o=i?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(o,s,[t])}this.model.setTerminal(t,e,i),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(null!=t){this.model.beginUpdate();try{for(var e=this.view.scale,i=this.view.translate,n=new mxDictionary,r=0;r0)for(var a=new mxRectangle(l[0].x,l[0].y,0,0),h=1;h=0&&(s.x+=a.x,s.y+=a.y))}else if(s=mxRectangle.fromRectangle(r),this.model.isVertex(u)&&mxUtils.indexOf(t,u)>=0)null!=(a=this.getBoundingBoxFromGeometry([u],!1))&&(s.x+=a.x,s.y+=a.y);null!=s&&null!=r.offset&&(s.x+=r.offset.x,s.y+=r.offset.y)}null!=s&&(null==i?i=mxRectangle.fromRectangle(s):i.add(s))}}return i},mxGraph.prototype.refresh=function(t){this.view.clear(t,null==t),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.snapDelta=function(t,e,i,n,r){var s=this.view.translate,o=this.view.scale;if(!i&&this.gridEnabled){var l=this.gridSize*o*.5;if(!n){var a=e.x-(this.snap(e.x/o-s.x)+s.x)*o;Math.abs(t.x-a)o&&(p=0),m>l&&(d=0),this.view.setTranslate(Math.floor(p/2-a.x),Math.floor(d/2-a.y)),this.container.scrollLeft=(c-o)/2,this.container.scrollTop=(m-l)/2}else this.view.setTranslate(t?Math.floor(h.x-a.x*u+p*i/u):h.x,e?Math.floor(h.y-a.y*u+d*n/u):h.y)},mxGraph.prototype.zoom=function(t,e){e=null!=e?e:this.centerZoom;var i=Math.round(this.view.scale*t*100)/100,n=this.view.getState(this.getSelectionCell());if(t=i/this.view.scale,this.keepSelectionVisibleOnZoom&&null!=n){var r=new mxRectangle(n.x*t,n.y*t,n.width*t,n.height*t);this.view.scale=i,this.scrollRectToVisible(r)||(this.view.revalidate(),this.view.setScale(i))}else{var s=mxUtils.hasScrollbars(this.container);if(e&&!s){var o,l=this.container.offsetWidth,a=this.container.offsetHeight;if(t>1)l*=-(o=(t-1)/(2*i)),a*=-o;else l*=o=(1/t-1)/(2*this.view.scale),a*=o;this.view.scaleAndTranslate(i,this.view.translate.x+l,this.view.translate.y+a)}else{var h=this.view.translate.x,u=this.view.translate.y,p=this.container.scrollLeft,d=this.container.scrollTop;if(this.view.setScale(i),s){l=0,a=0;e&&(l=this.container.offsetWidth*(t-1)/2,a=this.container.offsetHeight*(t-1)/2),this.container.scrollLeft=(this.view.translate.x-h)*this.view.scale+Math.round(p*t+l),this.container.scrollTop=(this.view.translate.y-u)*this.view.scale+Math.round(d*t+a)}}}},mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width/(this.container.clientHeight/t.height);t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var i=Math.min(this.container.scrollWidth,t.x+t.width),n=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=i-t.x,t.height=n-t.y,e<1){var r=t.height/e,s=(r-t.height)/2;t.height=r;var o=Math.min(t.y,s);t.y=t.y-o,n=Math.min(this.container.scrollHeight,t.y+t.height),t.height=n-t.y}else{var l=t.width*e,a=(l-t.width)/2;t.width=l;var h=Math.min(t.x,a);t.x=t.x-h,i=Math.min(this.container.scrollWidth,t.x+t.width),t.width=i-t.x}var u=this.container.clientWidth/t.width,p=this.view.scale*u;mxUtils.hasScrollbars(this.container)?(this.view.setScale(p),this.container.scrollLeft=Math.round(t.x*u),this.container.scrollTop=Math.round(t.y*u)):this.view.scaleAndTranslate(p,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var i=-this.view.translate.x,n=-this.view.translate.y,r=this.view.getState(t);if(null!=r){var s=new mxRectangle(i+r.x,n+r.y,r.width,r.height);if(e&&null!=this.container){var o=this.container.clientWidth,l=this.container.clientHeight;s.x=s.getCenterX()-o/2,s.width=o,s.y=s.getCenterY()-l/2,s.height=l}var a=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(s)){var h=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=a.x,this.view.translate.y=a.y,this.view.setTranslate(h.x,h.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(null!=t){var i=this.container.offsetWidth,n=this.container.offsetHeight,r=Math.min(i,t.width),s=Math.min(n,t.height);if(mxUtils.hasScrollbars(this.container)){var o=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var l=o.scrollLeft-t.x,a=Math.max(l-o.scrollLeft,0);l>0?o.scrollLeft-=l+2:(l=t.x+r-o.scrollLeft-o.clientWidth)>0&&(o.scrollLeft+=l+2);var h=o.scrollTop-t.y,u=Math.max(0,h-o.scrollTop);h>0?o.scrollTop-=h+2:(h=t.y+s-o.scrollTop-o.clientHeight)>0&&(o.scrollTop+=h+2),this.useScrollbarsForPanning||0==a&&0==u||this.view.setTranslate(a,u)}else{var p=-this.view.translate.x,d=-this.view.translate.y,c=this.view.scale;t.x+r>p+i&&(this.view.translate.x-=(t.x+r-i-p)/c,e=!0),t.y+s>d+n&&(this.view.translate.y-=(t.y+s-n-d)/c,e=!0),t.x1||1==r.length&&r[0]!=t)&&(n+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n")}var s=this.model.getDirectedEdgeCount(e,!0,t),o=this.model.getDirectedEdgeCount(i,!1,t);if(null!=this.multiplicities)for(var l=0;l0?n:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(t,e,i){return null},mxGraph.prototype.validateGraph=function(t,e){t=null!=t?t:this.model.getRoot(),e=null!=e?e:new Object;for(var i=!0,n=this.model.getChildCount(t),r=0;r")):this.setCellWarning(s,null),i=i&&null==l}var a="";this.isCellCollapsed(t)&&!i&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),this.model.isEdge(t)?a+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":a+=this.getCellValidationError(t)||"";var h=this.validateCell(t,e);return null!=h&&(a+=h),null==this.model.getParent(t)&&this.view.validate(),a.length>0||!i?a:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),i=this.model.getDirectedEdgeCount(t,!1),n=this.model.getValue(t),r="";if(null!=this.multiplicities)for(var s=0;so.max||eo.max||i0?r:null},mxGraph.prototype.validateCell=function(t,e){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(t){this.backgroundImage=t},mxGraph.prototype.getFoldingImage=function(t){if(null!=t&&this.foldingEnabled&&!this.getModel().isEdge(t.cell)){var e=this.isCellCollapsed(t.cell);if(this.isCellFoldable(t.cell,!e))return e?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(t){var e=this.model.getValue(t);if(null!=e){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&null!=t){var i=this.view.getState(t),n=null!=i?i.style:this.getCellStyle(t);mxUtils.getValue(n,mxConstants.STYLE_NOLABEL,!1)||(e=this.convertValueToString(t))}return e},mxGraph.prototype.isHtmlLabel=function(t){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(t){this.htmlLabels=t},mxGraph.prototype.isWrapping=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return null!=i&&"wrap"==i[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return null!=i&&"hidden"==i[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(t,e,i,n){var r=null;if(null!=t){if(null==t.control||e!=t.control.node&&e.parentNode!=t.control.node||(r=this.collapseExpandResource,r=mxUtils.htmlEntities(mxResources.get(r)||r).replace(/\\n/g,"
")),null==r&&null!=t.overlays&&t.overlays.visit((function(t,i){null!=r||e!=i.node&&e.parentNode!=i.node||(r=i.overlay.toString())})),null==r){var s=this.selectionCellsHandler.getHandler(t.cell);null!=s&&"function"==typeof s.getTooltipForNode&&(r=s.getTooltipForNode(e))}null==r&&(r=this.getTooltipForCell(t.cell))}return r},mxGraph.prototype.getTooltipForCell=function(t){return null!=t&&null!=t.getTooltip?t.getTooltip():this.convertValueToString(t)},mxGraph.prototype.getLinkForCell=function(t){return null},mxGraph.prototype.getCursorForMouseEvent=function(t){return this.getCursorForCell(t.getCell())},mxGraph.prototype.getCursorForCell=function(t){return null},mxGraph.prototype.getStartSize=function(t){var e=new mxRectangle,i=this.view.getState(t),n=null!=i?i.style:this.getCellStyle(t);if(null!=n){var r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));mxUtils.getValue(n,mxConstants.STYLE_HORIZONTAL,!0)?e.height=r:e.width=r}return e},mxGraph.prototype.getImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.isTransparentState=function(t){var e=!1;if(null!=t){var i=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),n=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=i==mxConstants.NONE&&n==mxConstants.NONE&&null==this.getImage(t)}return e},mxGraph.prototype.getVerticalAlign=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(t){this.border=t},mxGraph.prototype.isSwimlane=function(t){if(null!=t&&this.model.getParent(t)!=this.model.getRoot()){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);if(null!=i&&!this.model.isEdge(t))return i[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE}return!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(t){this.resizeContainer=t},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(t){this.enabled=t},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(t){this.escapeEnabled=t},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(t){this.invokesStopCellEditing=t},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(t){this.enterStopsCellEditing=t},mxGraph.prototype.isCellLocked=function(t){var e=this.model.getGeometry(t);return this.isCellsLocked()||null!=e&&this.model.isVertex(t)&&e.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(t){this.cellsLocked=t},mxGraph.prototype.getCloneableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellCloneable(t)})))},mxGraph.prototype.isCellCloneable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsCloneable()&&0!=i[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(t){this.cellsCloneable=t},mxGraph.prototype.getExportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canExportCell(t)})))},mxGraph.prototype.canExportCell=function(t){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canImportCell(t)})))},mxGraph.prototype.canImportCell=function(t){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(t){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(t){this.cellsSelectable=t},mxGraph.prototype.getDeletableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellDeletable(t)})))},mxGraph.prototype.isCellDeletable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsDeletable()&&0!=i[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(t){this.cellsDeletable=t},mxGraph.prototype.isLabelMovable=function(t){return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&this.vertexLabelsMovable)},mxGraph.prototype.isCellRotatable=function(t){var e=this.view.getState(t);return 0!=(null!=e?e.style:this.getCellStyle(t))[mxConstants.STYLE_ROTATABLE]},mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellMovable(t)})))},mxGraph.prototype.isCellMovable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&0!=i[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(t){this.cellsMovable=t},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(t){this.portsEnabled=t},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(t){this.gridSize=t},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(t){this.tolerance=t},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(t){this.vertexLabelsMovable=t},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(t){this.edgeLabelsMovable=t},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(t){this.swimlaneNesting=t},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(t){this.swimlaneSelectionEnabled=t},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(t){this.multigraph=t},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(t){this.allowDanglingEdges=t},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(t){this.connectableEdges=t},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(t){this.cloneInvalidEdges=t},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(t){this.allowLoops=t},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(t){this.disconnectOnMove=t},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(t){this.dropEnabled=t},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(t){this.splitEnabled=t},mxGraph.prototype.isCellResizable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&"0"!=mxUtils.getValue(i,mxConstants.STYLE_RESIZABLE,"1")},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t},mxGraph.prototype.isTerminalPointMovable=function(t,e){return!0},mxGraph.prototype.isCellBendable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&0!=i[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t},mxGraph.prototype.isCellEditable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&0!=i[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,i){return this.isCellsDisconnectable()&&!this.isCellLocked(t)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(t){this.cellsDisconnectable=t},mxGraph.prototype.isValidSource=function(t){return null==t&&this.allowDanglingEdges||null!=t&&(!this.model.isEdge(t)||this.connectableEdges)&&this.isCellConnectable(t)},mxGraph.prototype.isValidTarget=function(t){return this.isValidSource(t)},mxGraph.prototype.isValidConnection=function(t,e){return this.isValidSource(t)&&this.isValidTarget(e)},mxGraph.prototype.setConnectable=function(t){this.connectionHandler.setEnabled(t)},mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(t){this.tooltipHandler.setEnabled(t)},mxGraph.prototype.setPanning=function(t){this.panningHandler.panningEnabled=t},mxGraph.prototype.isEditing=function(t){if(null!=this.cellEditor){var e=this.cellEditor.getEditingCell();return null==t?null!=e:t==e}return!1},mxGraph.prototype.isAutoSizeCell=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isAutoSizeCells()||1==i[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(t){this.autoSizeCells=t},mxGraph.prototype.isExtendParent=function(t){return!this.getModel().isEdge(t)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(t){this.extendParents=t},mxGraph.prototype.isExtendParentsOnAdd=function(t){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(t){this.extendParentsOnAdd=t},mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove},mxGraph.prototype.setExtendParentsOnMove=function(t){this.extendParentsOnMove=t},mxGraph.prototype.isRecursiveResize=function(t){return this.recursiveResize},mxGraph.prototype.setRecursiveResize=function(t){this.recursiveResize=t},mxGraph.prototype.isConstrainChild=function(t){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(t))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(t){this.constrainChildren=t},mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren},mxGraph.prototype.setConstrainRelativeChildren=function(t){this.constrainRelativeChildren=t},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(t){this.allowNegativeCoordinates=t},mxGraph.prototype.getOverlap=function(t){return this.isAllowOverlapParent(t)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(t){return!1},mxGraph.prototype.getFoldableCells=function(t,e){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellFoldable(t,e)})))},mxGraph.prototype.isCellFoldable=function(t,e){var i=this.view.getState(t),n=null!=i?i.style:this.getCellStyle(t);return this.model.getChildCount(t)>0&&0!=n[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(t,e,i){return null!=t&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,i)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,i){if(this.model.isEdge(t)&&null!=e&&1==e.length&&this.isCellConnectable(e[0])&&null==this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])){var n=this.model.getTerminal(t,!0),r=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],n)&&!this.model.isAncestor(e[0],r)}return!1},mxGraph.prototype.getDropTarget=function(t,e,i,n){if(!this.isSwimlaneNesting())for(var r=0;r=0;o--){var l=this.model.getChildAt(i,o),a=this.getCellAt(t,e,l,n,r,s);if(null!=a)return a;if(this.isCellVisible(l)&&(r&&this.model.isEdge(l)||n&&this.model.isVertex(l))){var h=this.view.getState(l);if(null!=h&&(null==s||!s(h,t,e))&&this.intersects(h,t,e))return l}}return null},mxGraph.prototype.intersects=function(t,e,i){if(null!=t){var n=t.absolutePoints;if(null!=n)for(var r=this.tolerance*this.tolerance,s=n[0],o=1;o0&&e>0&&e>r.width*s)return!0;if(r.height>0&&i>0&&i>r.height*s)return!0}return!1},mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraph.prototype.getChildCells=function(t,e,i){t=null!=t?t:this.getDefaultParent(),e=null!=e&&e,i=null!=i&&i;for(var n=this.model.getChildCells(t,e,i),r=[],s=0;s0||n>0){var o=this.getModel(),l=t+i,a=e+n;if(null==r&&null==(r=this.getCurrentRoot())&&(r=o.getRoot()),null!=r)for(var h=o.getChildCount(r),u=0;u=t&&m.y+m.height<=a&&m.y>=e&&m.x+m.width<=l?s.push(p):this.getCells(t,e,i,n,p,s)}}}return s},mxGraph.prototype.getCellsBeyond=function(t,e,i,n,r){var s=[];if((n||r)&&(null==i&&(i=this.getDefaultParent()),null!=i))for(var o=this.model.getChildCount(i),l=0;l=t)&&(!r||h.y>=e)&&s.push(a)}return s},mxGraph.prototype.findTreeRoots=function(t,e,i){e=null!=e&&e,i=null!=i&&i;var n=[];if(null!=t){for(var r=this.getModel(),s=r.getChildCount(t),o=null,l=0,a=0;a0||!i&&0==d&&p>0)&&n.push(h);var m=i?d-p:p-d;m>l&&(l=m,o=h)}}0==n.length&&null!=o&&n.push(o)}return n},mxGraph.prototype.traverse=function(t,e,i,n,r,s){if(null!=i&&null!=t&&(e=null==e||e,s=null!=s&&s,!(r=r||new mxDictionary).get(t))){r.put(t,!0);var o=i(t,n);if(null==o||o){var l=this.model.getEdgeCount(t);if(l>0)for(var a=0;a0?n.cells[0]:null;n.cells.length>1&&n.clear();var s=null!=r?this.model.getParent(r):this.getDefaultParent(),o=this.model.getChildCount(s);if(null==r&&o>0){var l=this.model.getChildAt(s,0);this.setSelectionCell(l)}else if(null!=r&&!e||null==this.view.getState(s)||null==this.model.getGeometry(s)){if(null!=r&&i){if(this.model.getChildCount(r)>0){l=this.model.getChildAt(r,0);this.setSelectionCell(l)}}else if(o>0){var a=s.getIndex(r);if(t){a++;l=this.model.getChildAt(s,a%o);this.setSelectionCell(l)}else{var h=--a<0?o-1:a;l=this.model.getChildAt(s,h);this.setSelectionCell(l)}}}else this.getCurrentRoot()!=s&&this.setSelectionCell(s)},mxGraph.prototype.selectAll=function(t,e){t=t||this.getDefaultParent();var i=e?this.model.filterDescendants(mxUtils.bind(this,(function(e){return e!=t&&null!=this.view.getState(e)})),t):this.model.getChildren(t);null!=i&&this.setSelectionCells(i)},mxGraph.prototype.selectVertices=function(t,e){this.selectCells(!0,!1,t,e)},mxGraph.prototype.selectEdges=function(t){this.selectCells(!1,!0,t)},mxGraph.prototype.selectCells=function(t,e,i,n){i=i||this.getDefaultParent();var r=mxUtils.bind(this,(function(i){return null!=this.view.getState(i)&&((n||0==this.model.getChildCount(i))&&this.model.isVertex(i)&&t&&!this.model.isEdge(this.model.getParent(i))||this.model.isEdge(i)&&e)})),s=this.model.filterDescendants(r,i);null!=s&&this.setSelectionCells(s)},mxGraph.prototype.selectCellForEvent=function(t,e){var i=this.isCellSelected(t);this.isToggleEvent(e)?i?this.removeSelectionCell(t):this.addSelectionCell(t):i&&1==this.getSelectionCount()||this.setSelectionCell(t)},mxGraph.prototype.selectCellsForEvent=function(t,e){this.isToggleEvent(e)?this.addSelectionCells(t):this.setSelectionCells(t)},mxGraph.prototype.createHandler=function(t){var e=null;if(null!=t)if(this.model.isEdge(t.cell)){var i=t.getVisibleTerminalState(!0),n=t.getVisibleTerminalState(!1),r=this.getCellGeometry(t.cell),s=this.view.getEdgeStyle(t,null!=r?r.points:null,i,n);e=this.createEdgeHandler(t,s)}else e=this.createVertexHandler(t);return e},mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)},mxGraph.prototype.createEdgeHandler=function(t,e){return e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(t):e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(t):new mxEdgeHandler(t)},mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)},mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)},mxGraph.prototype.addMouseListener=function(t){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(t)},mxGraph.prototype.removeMouseListener=function(t){if(null!=this.mouseListeners)for(var e=0;e0){this.outline.getView().scale!=d&&(this.outline.getView().scale=d,t=!0);var c=this.outline.getView();c.currentRoot!=this.source.getView().currentRoot&&c.setCurrentRoot(this.source.getView().currentRoot);var m=this.source.view.translate,g=m.x+this.source.panDx,x=m.y+this.source.panDy,f=this.getOutlineOffset(d);null!=f&&(g+=f.x,x+=f.y),n.x<0&&(g-=n.x),n.y<0&&(x-=n.y),c.translate.x==g&&c.translate.y==x||(c.translate.x=g,c.translate.y=x,t=!0);var y=c.translate,v=(d=this.source.getView().scale)/c.scale,C=1/c.scale,E=this.source.container;this.bounds=new mxRectangle((y.x-m.x-this.source.panDx)/C,(y.y-m.y-this.source.panDy)/C,E.clientWidth/v,E.clientHeight/v),this.bounds.x+=this.source.container.scrollLeft*c.scale/d,this.bounds.y+=this.source.container.scrollTop*c.scale/d,(S=this.selectionBorder.bounds).x==this.bounds.x&&S.y==this.bounds.y&&S.width==this.bounds.width&&S.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw());var S=this.sizer.bounds,b=new mxRectangle(this.bounds.x+this.bounds.width-S.width/2,this.bounds.y+this.bounds.height-S.height/2,S.width,S.height);S.x==b.x&&S.y==b.y&&S.width==b.width&&S.height==b.height||(this.sizer.bounds=b,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),t&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var i=mxEvent.isMouseEvent(e.getEvent())?0:this.source.tolerance,n=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||i>0)?new mxRectangle(e.getGraphX()-i,e.getGraphY()-i,2*i,2*i):null;this.zoom=e.isSource(this.sizer)||null!=n&&mxUtils.intersects(shape.bounds,n),this.startX=e.getX(),this.startY=e.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):(this.dx0=0,this.dy0=0)}e.consume()},mxOutline.prototype.mouseMove=function(t,e){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var i=this.getTranslateForEvent(e),n=i.x,r=i.y,s=null;if(this.zoom){var o=this.source.container;r=n/(o.clientWidth/o.clientHeight),s=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+r)),this.selectionBorder.bounds=s,this.selectionBorder.redraw()}else{var l=this.outline.getView().scale;s=new mxRectangle(this.bounds.x+n,this.bounds.y+r,this.bounds.width,this.bounds.height),this.selectionBorder.bounds=s,this.selectionBorder.redraw(),n/=l,n*=this.source.getView().scale,r/=l,r*=this.source.getView().scale,this.source.panGraph(-n-this.dx0,-r-this.dy0)}var a=this.sizer.bounds;this.sizer.bounds=new mxRectangle(s.x+s.width-a.width/2,s.y+s.height-a.height/2,a.width,a.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),e.consume()}},mxOutline.prototype.getTranslateForEvent=function(t){return new mxPoint(t.getX()-this.startX,t.getY()-this.startY)},mxOutline.prototype.mouseUp=function(t,e){if(this.active){var i=this.getTranslateForEvent(e),n=i.x,r=i.y;if(Math.abs(n)>0||Math.abs(r)>0){if(this.zoom){var s=this.selectionBorder.bounds.width,o=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,o-n*o/s),!1)}else if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0),n/=this.outline.getView().scale,r/=this.outline.getView().scale;var l=this.source.getView().translate;this.source.getView().setTranslate(l.x-n,l.y-r)}this.update(),e.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.removeListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},__mxOutput.mxOutline=void 0!==mxOutline?mxOutline:void 0,mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(t,e,i,n,r,s){var o="";(this.source&&this.checkTerminal(t,i,e)||!this.source&&this.checkTerminal(t,n,e))&&(null!=this.countError&&(this.source&&(0==this.max||r>=this.max)||!this.source&&(0==this.max||s>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&this.validNeighbors.length>0&&(this.checkNeighbors(t,e,i,n)||(o+=this.typeError+"\n")));return o.length>0?o:null},mxMultiplicity.prototype.checkNeighbors=function(t,e,i,n){for(var r=t.model.getValue(i),s=t.model.getValue(n),o=!this.validNeighborsAllowed,l=this.validNeighbors,a=0;a0;)e=e.concat(n),n=i.getParents(n);this.executeLayoutForCells(e)},mxLayoutManager.prototype.executeLayoutForCells=function(t){var e=mxUtils.sortCells(t,!0);e=e.concat(e.slice().reverse()),this.layoutCells(e)},mxLayoutManager.prototype.cellsMoved=function(t,e){if(null!=t&&null!=e)for(var i=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(e),mxEvent.getClientY(e)),n=this.getGraph().getModel(),r=0;r0){var e=this.getGraph().getModel();e.beginUpdate();try{for(var i=null,n=0;n1||null!=r.points&&r.points.length>0||null==n.getTerminal(i,!0)||null==n.getTerminal(i,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())?this.start(i,e.getX(),e.getY()):this.delayedSelection&&(this.cell=i),this.cellWasClicked=!0,this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}},mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent(),e=this.graph.getModel(),i=mxUtils.bind(this,(function(t){return null!=this.graph.view.getState(t)&&e.isVertex(t)&&null!=e.getGeometry(t)&&!e.getGeometry(t).relative}));return this.graph.view.getCellStates(e.filterDescendants(i,t))},mxGraphHandler.prototype.getCells=function(t){return!this.delayedSelection&&this.graph.isCellMovable(t)?[t]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(t){var e=this.getBoundingBox(t);if(null!=e){if(e.width=Math.max(0,e.width-1),e.height=Math.max(0,e.height-1),e.width0)for(var i=this.graph.getModel(),n=0;n=2)&&e!=(this.target||s))}))}},mxGraphHandler.prototype.addStates=function(t,e){var i=this.graph.view.getState(t),n=0;if(null!=i&&null==e.get(t)){e.put(t,i),n++;for(var r=this.graph.model.getChildCount(t),s=0;ss||Math.abs(r.y)>s){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var o=i.isCloneEvent(e.getEvent())&&i.isCellsCloneable()&&this.isCloneEnabled(),l=i.isGridEnabledEvent(e.getEvent()),a=e.getCell(),h=!0,u=null;this.cloning=o,i.isDropEnabled()&&this.highlightEnabled&&(u=i.getDropTarget(this.cells,e.getEvent(),a,o));var p=i.getView().getState(u),d=!1;if(null==p||i.model.getParent(this.cell)==u&&!o){if(this.target=null,this.connectOnDrop&&null!=a&&1==this.cells.length&&i.getModel().isVertex(a)&&i.isCellConnectable(a)&&null!=(p=i.getView().getState(a))){var c=null==i.getEdgeValidationError(null,this.cell,a)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(c),d=!0}}else this.target!=u&&(this.target=u,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),d=!0;null!=p&&d?this.highlight.highlight(p):this.highlight.hide(),this.livePreviewActive&&o?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?o&&this.livePreviewActive||(this.setHandlesVisibleForCells(this.graph.getSelectionCells(),!1),this.livePreviewActive=!0,this.livePreviewUsed=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds)),null!=this.guide&&this.useGuidesForEvent(e)?(r=this.guide.move(this.bounds,r,l,o),h=!1):r=this.graph.snapDelta(r,this.bounds,!l,!1,!1),null!=this.guide&&h&&this.guide.hide(),i.isConstrainedEvent(e.getEvent())&&(Math.abs(r.x)>Math.abs(r.y)?r.y=0:r.x=0),this.currentDx==r.x&&this.currentDy==r.y||(this.currentDx=r.x,this.currentDy=r.y,this.updatePreview())}this.updateHint(e),this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e),mxEvent.consume(e.getEvent())}},mxGraphHandler.prototype.updatePreview=function(t){this.livePreviewUsed&&!t?null!=this.cells&&this.updateLivePreview(this.currentDx,this.currentDy):this.updatePreviewShape()},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.updateLivePreview=function(t,e){if(!this.suspended){var i=[];null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,(function(n,r){var s=r.clone();i.push([r,s]),null!=r.shape&&(null==r.shape.originalPointerEvents&&(r.shape.originalPointerEvents=r.shape.pointerEvents),r.shape.pointerEvents=!1,null!=r.text&&(null==r.text.originalPointerEvents&&(r.text.originalPointerEvents=r.text.pointerEvents),r.text.pointerEvents=!1)),this.graph.model.isVertex(r.cell)&&(r.x+=t,r.y+=e,this.cloning||(r.view.graph.cellRenderer.redraw(r,!0),r.view.invalidate(r.cell),r.invalid=!1,null!=r.control&&null!=r.control.node&&(r.control.node.style.visibility="hidden")))})));for(var n=this.graph.view.scale,r=0;rthis.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}(this.active||this.panningTrigger)&&e.consume()},mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(null!=this.dx&&null!=this.dy){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var i=this.graph.getView().scale,n=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(n.x+this.dx/i,n.y+this.dy/i)}e.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",e))}this.reset()},mxPanningHandler.prototype.zoomGraph=function(t){var e=Math.round(this.initialScale*t.scale*100)/100;null!=this.minScale&&(e=Math.max(this.minScale,e)),null!=this.maxScale&&(e=Math.min(this.maxScale,e)),this.graph.view.scale!=e&&(this.graph.zoomTo(e),mxEvent.consume(t))},mxPanningHandler.prototype.reset=function(){this.panningTrigger=!1,this.mouseDownEvent=null,this.active=!1,this.dx=null,this.dy=null},mxPanningHandler.prototype.panGraph=function(t,e){this.graph.getView().setTranslate(t,e)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.forcePanningHandler),this.graph.removeListener(this.gestureHandler),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)},__mxOutput.mxPanningHandler=void 0!==mxPanningHandler?mxPanningHandler:void 0,mxPopupMenuHandler.prototype=new mxPopupMenu,mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler,mxPopupMenuHandler.prototype.graph=null,mxPopupMenuHandler.prototype.selectOnPopup=!0,mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0,mxPopupMenuHandler.prototype.triggerX=null,mxPopupMenuHandler.prototype.triggerY=null,mxPopupMenuHandler.prototype.screenX=null,mxPopupMenuHandler.prototype.screenY=null,mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,(function(t){this.graph.tooltipHandler.hide()})))},mxPopupMenuHandler.prototype.isSelectOnPopup=function(t){return this.selectOnPopup},mxPopupMenuHandler.prototype.mouseDown=function(t,e){this.isEnabled()&&!mxEvent.isMultiTouchEvent(e.getEvent())&&(this.hideMenu(),this.triggerX=e.getGraphX(),this.triggerY=e.getGraphY(),this.screenX=mxEvent.getMainEvent(e.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(e.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(e),this.inTolerance=!0)},mxPopupMenuHandler.prototype.mouseMove=function(t,e){this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(Math.abs(mxEvent.getMainEvent(e.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(e.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxPopupMenuHandler.prototype.mouseUp=function(t,e){if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var i=this.getCellForPopupEvent(e);this.graph.isEnabled()&&this.isSelectOnPopup(e)&&null!=i&&!this.graph.isCellSelected(i)?this.graph.setSelectionCell(i):this.clearSelectionOnBackground&&null==i&&this.graph.clearSelection(),this.graph.tooltipHandler.hide();var n=mxUtils.getScrollOrigin();this.popup(e.getX()+n.x+1,e.getY()+n.y+1,i,e.getEvent()),e.consume()}this.popupTrigger=!1,this.inTolerance=!1},mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){return t.getCell()},mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.gestureHandler),mxPopupMenu.prototype.destroy.apply(this)},__mxOutput.mxPopupMenuHandler=void 0!==mxPopupMenuHandler?mxPopupMenuHandler:void 0,mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(t){this.enabled=t},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(t){this.hotspot=t},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(t){this.hotspotEnabled=t},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){this.validState=null,null!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(t){var e=null;return this.isEnabled()&&(e=this.getState(t),this.setCurrentState(e,t)),e},mxCellMarker.prototype.setCurrentState=function(t,e,i){var n=null!=t&&this.isValidState(t);i=null!=i?i:this.getMarkerColor(e.getEvent(),t,n),this.validState=n?t:null,t==this.markedState&&i==this.currentColor||(this.currentColor=i,null!=t&&null!=this.currentColor?(this.markedState=t,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))},mxCellMarker.prototype.markCell=function(t,e){var i=this.graph.getView().getState(t);null!=i&&(this.currentColor=null!=e?e:this.validColor,this.markedState=i,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(t){return!0},mxCellMarker.prototype.getMarkerColor=function(t,e,i){return i?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(t){var e=this.graph.getView(),i=this.getCell(t),n=this.getStateToMark(e.getState(i));return null!=n&&this.intersects(n,t)?n:null},mxCellMarker.prototype.getCell=function(t){return t.getCell()},mxCellMarker.prototype.getStateToMark=function(t){return t},mxCellMarker.prototype.intersects=function(t,e){return!this.hotspotEnabled||mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},__mxOutput.mxCellMarker=void 0!==mxCellMarker?mxCellMarker:void 0,mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(t){this.enabled=t},mxSelectionCellsHandler.prototype.getHandler=function(t){return this.handlers.get(t)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit((function(t,e){e.reset.apply(e)}))},mxSelectionCellsHandler.prototype.refresh=function(){var t=this.handlers;this.handlers=new mxDictionary;for(var e=this.graph.getSelectionCells(),i=0;ithis.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(e,s),null!=this.first){var o=null,l=s;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(o=this.constraintHandler.currentConstraint,l=this.constraintHandler.currentPoint.clone()):null!=this.previous&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&(Math.abs(this.previous.getCenterX()-s.x)0?this.waypoints[0]:l;null!=(m=this.getSourcePerimeterPoint(this.previous,c,e))&&(a=m)}}if(null==this.currentState&&this.movePreviewAway){var m=a;if(null!=this.edgeState&&this.edgeState.absolutePoints.length>=2){var g=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];null!=g&&(m=g)}var x=l.x-m.x,f=l.y-m.y,y=Math.sqrt(x*x+f*f);if(0==y)return;this.originalPoint=l.clone(),l.x-=4*x/y,l.y-=4*f/y}else this.originalPoint=null;if(null==this.shape){x=Math.abs(e.getGraphX()-this.first.x),f=Math.abs(e.getGraphY()-this.first.y);(x>this.graph.tolerance||f>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(e,s))}if(null!=this.shape){if(null!=this.edgeState)this.shape.points=this.edgeState.absolutePoints;else{var v=[a];null!=this.waypoints&&(v=v.concat(this.waypoints)),v.push(l),this.shape.points=v}this.drawPreview()}null!=this.cursor&&(this.graph.container.style.cursor=this.cursor),mxEvent.consume(e.getEvent()),e.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),e.consume())),this.previous=this.currentState):this.previous!=this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||e.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(var C=!1,E=e.getSource(),S=0;S0?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),o=r(n.getPerimeterBounds(t),this.edgeState,s,!1);null!=o&&(i=o)}else i=new mxPoint(t.getCenterX(),t.getCenterY());return i},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,i){var n=null,r=t.view,s=r.getPerimeterFunction(t),o=new mxPoint(t.getCenterX(),t.getCenterY());if(null!=s){var l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),a=-l*(Math.PI/180);0!=l&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(a),Math.sin(a),o));var h=s(r.getPerimeterBounds(t),t,e,!1);null!=h&&(0!=l&&(h=mxUtils.getRotatedPoint(new mxPoint(h.x,h.y),Math.cos(-a),Math.sin(-a),o)),n=h)}else n=o;return n},mxConnectionHandler.prototype.updateIcons=function(t,e,i){},mxConnectionHandler.prototype.isStopEvent=function(t){return null!=t.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),i=Math.abs(e.x-this.first.x),n=Math.abs(e.y-this.first.y);if(null!=this.waypoints||this.mouseDownCounter>1&&(i>this.graph.tolerance||n>this.graph.tolerance)){null==this.waypoints&&(this.waypoints=[]);var r=this.graph.view.scale;e=new mxPoint(this.graph.snap(t.getGraphX()/r)*r,this.graph.snap(t.getGraphY()/r)*r);this.waypoints.push(e)}},mxConnectionHandler.prototype.checkConstraints=function(t,e){return null==t||null==e||null==t.point||null==e.point||!t.point.equals(e.point)||t.dx!=e.dx||t.dy!=e.dy||t.perimeter!=e.perimeter},mxConnectionHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(e))return this.addWaypointForEvent(e),void e.consume();var i=this.sourceConstraint,n=this.constraintHandler.currentConstraint,r=null!=this.previous?this.previous.cell:null,s=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(s=this.constraintHandler.currentFocus.cell),null==s&&null!=this.currentState&&(s=this.currentState.cell),null!=this.error||null!=r&&null!=s&&r==s&&!this.checkConstraints(i,n)?(null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,e.getEvent()),null!=this.error&&this.error.length>0&&this.graph.validationAlert(this.error)):this.connect(r,s,e.getEvent(),e.getCell()),this.destroyIcons(),e.consume()}null!=this.first&&this.reset()},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.cursor&&null!=this.graph.container&&(this.graph.container.style.cursor=""),this.destroyIcons(),this.marker.reset(),this.constraintHandler.reset(),this.originalPoint=null,this.currentPoint=null,this.edgeState=null,this.previous=null,this.error=null,this.sourceConstraint=null,this.mouseDownCounter=0,this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(null==this.error),this.shape.redraw()},mxConnectionHandler.prototype.updatePreview=function(t){this.shape.strokewidth=this.getEdgeWidth(t),this.shape.stroke=this.getEdgeColor(t)},mxConnectionHandler.prototype.getEdgeColor=function(t){return t?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(t){return t?3:1},mxConnectionHandler.prototype.connect=function(t,e,i,n){if(null!=e||this.isCreateTarget(i)||this.graph.allowDanglingEdges){var r=this.graph.getModel(),s=!1,o=null;r.beginUpdate();try{if(null!=t&&null==e&&!this.graph.isIgnoreTerminalEvent(i)&&this.isCreateTarget(i)&&null!=(e=this.createTargetVertex(i,t))){if(n=this.graph.getDropTarget([e],i,n),s=!0,null!=n&&this.graph.getModel().isEdge(n))n=this.graph.getDefaultParent();else{var l=this.graph.getView().getState(n);if(null!=l)(p=r.getGeometry(e)).x-=l.origin.x,p.y-=l.origin.y}this.graph.addCell(e,n)}var a=this.graph.getDefaultParent();null!=t&&null!=e&&r.getParent(t)==r.getParent(e)&&r.getParent(r.getParent(t))!=r.getRoot()&&(a=r.getParent(t),null!=t.geometry&&t.geometry.relative&&null!=e.geometry&&e.geometry.relative&&(a=r.getParent(a)));var h=null,u=null;if(null!=this.edgeState&&(h=this.edgeState.cell.value,u=this.edgeState.cell.style),null!=(o=this.insertEdge(a,null,h,t,e,u))){this.graph.setConnectionConstraint(o,t,!0,this.sourceConstraint),this.graph.setConnectionConstraint(o,e,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&r.setGeometry(o,this.edgeState.cell.geometry);a=r.getParent(t);if(this.isInsertBefore(o,t,e,i,n)){for(var p=t;null!=p.parent&&null!=p.geometry&&p.geometry.relative&&p.parent!=o.parent;)p=this.graph.model.getParent(p);null!=p&&null!=p.parent&&p.parent==o.parent&&r.add(a,o,p.parent.getIndex(p))}var d=r.getGeometry(o);if(null==d&&((d=new mxGeometry).relative=!0,r.setGeometry(o,d)),null!=this.waypoints&&this.waypoints.length>0){var c=this.graph.view.scale,m=this.graph.view.translate;d.points=[];for(var g=0;g0){var a=this.graph.view.getState(e);if(null!=a){var h=a.x/s-r.x,u=a.y/s-r.y;Math.abs(h-i.x)<=l&&(i.x=Math.round(h)),Math.abs(u-i.y)<=l&&(i.y=Math.round(u))}}}return n},mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(t,e,i,n){var r=null;if(null!=this.factoryMethod&&(r=this.factoryMethod(e,i,n)),null==r){(r=new mxCell(t||"")).setEdge(!0),r.setStyle(n);var s=new mxGeometry;s.relative=!0,r.setGeometry(s)}return r},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null),null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)},__mxOutput.mxConnectionHandler=void 0!==mxConnectionHandler?mxConnectionHandler:void 0,mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(t){this.enabled=t},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var t=0;ta||Math.abs(l)>a)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(r,s),e.consume())}},mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv);var t=this.sharedDiv;return mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut&&(this.sharedDiv=null),t},mxRubberband.prototype.isActive=function(t,e){return null!=this.div&&"none"!=this.div.style.display},mxRubberband.prototype.mouseUp=function(t,e){var i=this.isActive();this.reset(),i&&(this.execute(e.getEvent()),e.consume())},mxRubberband.prototype.execute=function(t){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(e,t)},mxRubberband.prototype.reset=function(){if(null!=this.div)if(mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut){var t=this.div;mxUtils.setPrefixedStyle(t.style,"transition","all 0.2s linear"),t.style.pointerEvents="none",t.style.opacity=0,window.setTimeout((function(){t.parentNode.removeChild(t)}),200)}else this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler),this.dragHandler=null,this.dropHandler=null,this.currentX=0,this.currentY=0,this.first=null,this.div=null},mxRubberband.prototype.update=function(t,e){this.currentX=t,this.currentY=e,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var t=this.currentX-this.graph.panDx,e=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,t),this.y=Math.min(this.first.y,e),this.width=Math.max(this.first.x,t)-this.x,this.height=Math.max(this.first.y,e)-this.y;var i=mxClient.IS_VML?this.graph.panDx:0,n=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+i+"px",this.div.style.top=this.y+n+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},__mxOutput.mxRubberband=void 0!==mxRubberband?mxRubberband:void 0,mxHandle.prototype.cursor="default",mxHandle.prototype.image=null,mxHandle.prototype.ignoreGrid=!1,mxHandle.prototype.getPosition=function(t){},mxHandle.prototype.setPosition=function(t,e,i){},mxHandle.prototype.execute=function(){},mxHandle.prototype.copyStyle=function(t){this.graph.setCellStyles(t,this.state.style[t],[this.state.cell])},mxHandle.prototype.processEvent=function(t){var e=this.graph.view.scale,i=this.graph.view.translate,n=new mxPoint(t.getGraphX()/e-i.x,t.getGraphY()/e-i.y);null!=this.shape&&null!=this.shape.bounds&&(n.x-=this.shape.bounds.width/e/4,n.y-=this.shape.bounds.height/e/4);var r=-mxUtils.toRadians(this.getRotation()),s=-mxUtils.toRadians(this.getTotalRotation())-r;n=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(n,r),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),s)),this.setPosition(this.state.getPaintBounds(),n,t),this.positionChanged(),this.redraw()},mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state),null!=this.state.shape&&this.state.shape.apply(this.state),this.graph.cellRenderer.redraw(this.state,!0)},mxHandle.prototype.getRotation=function(){return null!=this.state.shape?this.state.shape.getRotation():0},mxHandle.prototype.getTotalRotation=function(){return null!=this.state.shape?this.state.shape.getShapeRotation():0},mxHandle.prototype.init=function(){var t=this.isHtmlRequired();null!=this.image?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):this.shape=this.createShape(t),this.initShape(t)},mxHandle.prototype.createShape=function(t){return new mxRectangleShape(new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxHandle.prototype.initShape=function(t){t&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,null!=this.cursor&&this.shape.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state),this.shape.node.style.cursor=this.cursor},mxHandle.prototype.redraw=function(){if(null!=this.shape&&null!=this.state.shape){var t=this.getPosition(this.state.getPaintBounds());if(null!=t){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var i=this.graph.view.scale,n=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+n.x)*i-this.shape.bounds.width/2),this.shape.bounds.y=Math.floor((t.y+n.y)*i-this.shape.bounds.height/2),this.shape.redraw()}}},mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container},mxHandle.prototype.rotatePoint=function(t,e){var i=this.state.getCellBounds(),n=new mxPoint(i.getCenterX(),i.getCenterY()),r=Math.cos(e),s=Math.sin(e);return mxUtils.getRotatedPoint(t,r,s,n)},mxHandle.prototype.flipPoint=function(t){if(null!=this.state.shape){var e=this.state.getCellBounds();this.state.shape.flipH&&(t.x=2*e.x+e.width-t.x),this.state.shape.flipV&&(t.y=2*e.y+e.height-t.y)}return t},mxHandle.prototype.snapPoint=function(t,e){return e||(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t},mxHandle.prototype.setVisible=function(t){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=t?"":"none")},mxHandle.prototype.reset=function(){this.setVisible(!0),this.state.style=this.graph.getCellStyle(this.state.cell),this.positionChanged()},mxHandle.prototype.destroy=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxHandle=void 0!==mxHandle?mxHandle:void 0,mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.parentHighlightEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.rotationCursor="crosshair",mxVertexHandler.prototype.livePreview=!1,mxVertexHandler.prototype.manageSizers=!1,mxVertexHandler.prototype.constrainGroupByChildren=!1,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxVertexHandler.prototype.horizontalOffset=0,mxVertexHandler.prototype.verticalOffset=0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.selectionBorder.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),this.graph.isCellMovable(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()=2&&this.state.height>=2){var e=0;t&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",e++)),this.sizers.push(this.createSizer("n-resize",e++)),this.sizers.push(this.createSizer("ne-resize",e++)),this.sizers.push(this.createSizer("w-resize",e++)),this.sizers.push(this.createSizer("e-resize",e++)),this.sizers.push(this.createSizer("sw-resize",e++)),this.sizers.push(this.createSizer("s-resize",e++))),this.sizers.push(this.createSizer("se-resize",e++)));var i=this.graph.model.getGeometry(this.state.cell);null==i||i.relative||this.graph.isSwimlane(this.state.cell)||!this.graph.isLabelMovable(this.state.cell)||(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.isRotationHandleVisible()&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.customHandles=this.createCustomHandles(),this.redraw(),this.constrainGroupByChildren&&this.updateMinBounds()},mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()=2&&this.state.height>=2},mxVertexHandler.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t.getEvent())||"fixed"==this.state.style[mxConstants.STYLE_ASPECT]},mxVertexHandler.prototype.isCenteredEvent=function(t,e){return!1},mxVertexHandler.prototype.createCustomHandles=function(){return null},mxVertexHandler.prototype.updateMinBounds=function(){var t=this.graph.getChildCells(this.state.cell);if(t.length>0&&(this.minBounds=this.graph.view.getBounds(t),null!=this.minBounds)){var e=this.state.view.scale,i=this.state.view.translate;this.minBounds.x-=this.state.x,this.minBounds.y-=this.state.y,this.minBounds.x/=e,this.minBounds.y/=e,this.minBounds.width/=e,this.minBounds.height/=e,this.x0=this.state.x/e-i.x,this.y0=this.state.y/e-i.y}},mxVertexHandler.prototype.getSelectionBounds=function(t){return new mxRectangle(Math.round(t.x),Math.round(t.y),Math.round(t.width),Math.round(t.height))},mxVertexHandler.prototype.createParentHighlightShape=function(t){return this.createSelectionShape(t)},mxVertexHandler.prototype.createSelectionShape=function(t){var e=new mxRectangleShape(t,null,this.getSelectionColor());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(t,e,i,n){var r=new mxRectangle(0,0,i=i||mxConstants.HANDLE_SIZE,i),s=this.createSizerShape(r,e,n);return s.isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(s.bounds.height-=1,s.bounds.width-=1,s.dialect=mxConstants.DIALECT_STRICTHTML,s.init(this.graph.container)):(s.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(s.node,this.graph,this.state),this.graph.isEnabled()&&s.setCursor(t),this.isSizerVisible(e)||(s.visible=!1),s},mxVertexHandler.prototype.isSizerVisible=function(t){return!0},mxVertexHandler.prototype.createSizerShape=function(t,e,i){if(null!=this.handleImage){var n=new mxImageShape(t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height),this.handleImage.src);return n.preserveImageAspect=!1,n}return e==mxEvent.ROTATION_HANDLE?new mxEllipse(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(t,e,i){null!=t&&(t.bounds.x=Math.floor(e-t.bounds.width/2),t.bounds.y=Math.floor(i-t.bounds.height/2),null!=t.node&&"none"!=t.node.style.display&&t.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(t){var e=mxEvent.isMouseEvent(t.getEvent())?1:this.tolerance,i=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null;function n(e){return null!=e&&(t.isSource(e)||null!=i&&mxUtils.intersects(e.bounds,i)&&"none"!=e.node.style.display&&"hidden"!=e.node.style.visibility)}if(null!=this.customHandles&&this.isCustomHandleEvent(t))for(var r=this.customHandles.length-1;r>=0;r--)if(n(this.customHandles[r].shape))return mxEvent.CUSTOM_HANDLE-r;if(n(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(n(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(r=0;r0||e.getState()==this.state)){var n=this.getHandleForEvent(e);null!=n&&(this.start(e.getGraphX(),e.getGraphY(),n),e.consume())}},mxVertexHandler.prototype.isLivePreviewBorder=function(){return null!=this.state.shape&&null==this.state.shape.fill&&null==this.state.shape.stroke},mxVertexHandler.prototype.start=function(t,e,i){if(null!=this.selectionBorder){this.livePreviewActive=this.livePreview&&0==this.graph.model.getChildCount(this.state.cell),this.inTolerance=!0,this.childOffsetX=0,this.childOffsetY=0,this.index=i,this.startX=t,this.startY=e;var n=this.state.view.graph.model,r=n.getParent(this.state.cell);if(this.state.view.currentRoot!=r&&(n.isVertex(r)||n.isEdge(r))&&(this.parentState=this.state.view.graph.view.getState(r)),this.selectionBorder.node.style.display=i==mxEvent.ROTATION_HANDLE?"inline":"none",this.livePreviewActive&&!this.isLivePreviewBorder()||(this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))),i==mxEvent.ROTATION_HANDLE){var s=this.getRotationHandlePosition(),o=s.x-this.state.getCenterX(),l=s.y-this.state.getCenterY();this.startAngle=0!=o?180*Math.atan(l/o)/Math.PI+90:l<0?180:0,this.startDist=Math.sqrt(o*o+l*l)}if(this.livePreviewActive){this.hideSizers(),i==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":i==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":null!=this.sizers&&null!=this.sizers[i]?this.sizers[i].node.style.display="":i<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-i].setVisible(!0);var a=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var h=0;hthis.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxVertexHandler.prototype.updateHint=function(t){},mxVertexHandler.prototype.removeHint=function(){},mxVertexHandler.prototype.roundAngle=function(t){return Math.round(10*t)/10},mxVertexHandler.prototype.roundLength=function(t){return Math.round(100*t)/100},mxVertexHandler.prototype.mouseMove=function(t,e){e.isConsumed()||null==this.index?this.graph.isMouseDown||null==this.getHandleForEvent(e)||e.consume(!1):(this.checkTolerance(e),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(e):this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(e):this.resizeVertex(e),this.updateHint(e)),e.consume())},mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.graph.view.translate,n=this.graph.view.scale;this.graph.isGridEnabledEvent(t.getEvent())&&(e.x=(this.graph.snap(e.x/n-i.x)+i.x)*n,e.y=(this.graph.snap(e.y/n-i.y)+i.y)*n);var r=null!=this.rotationShape?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[r],e.x,e.y)},mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.state.x+this.state.width/2-e.x,n=this.state.y+this.state.height/2-e.y;if(this.currentAlpha=0!=i?180*Math.atan(n/i)/Math.PI+90:n<0?180:0,i>0&&(this.currentAlpha-=180),this.currentAlpha-=this.startAngle,this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){i=e.x-this.state.getCenterX(),n=e.y-this.state.getCenterY();var r=Math.sqrt(i*i+n*n);r-this.startDist<2?raster=15:r-this.startDist<25?raster=5:raster=1,this.currentAlpha=Math.round(this.currentAlpha/raster)*raster}else this.currentAlpha=this.roundAngle(this.currentAlpha);this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw(),this.livePreviewActive&&this.redrawHandles()},mxVertexHandler.prototype.resizeVertex=function(t){var e=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),n=new mxPoint(t.getGraphX(),t.getGraphY()),r=this.graph.view.translate,s=this.graph.view.scale,o=Math.cos(-i),l=Math.sin(-i),a=l*(m=n.x-this.startX)+o*(g=n.y-this.startY);m=o*m-l*g,g=a;var h=this.graph.getCellGeometry(this.state.cell);if(this.unscaledBounds=this.union(h,m/s,g/s,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t)),!h.relative){var u=this.graph.getMaximumGraphBounds();if(null!=u&&null!=this.parentState&&((u=mxRectangle.fromRectangle(u)).x-=(this.parentState.x-r.x*s)/s,u.y-=(this.parentState.y-r.y*s)/s),this.graph.isConstrainChild(this.state.cell)){var p=this.graph.getCellContainmentArea(this.state.cell);if(null!=p){var d=this.graph.getOverlap(this.state.cell);d>0&&((p=mxRectangle.fromRectangle(p)).x-=p.width*d,p.y-=p.height*d,p.width+=2*p.width*d,p.height+=2*p.height*d),null==u?u=p:(u=mxRectangle.fromRectangle(u)).intersect(p)}}null!=u&&(this.unscaledBounds.xu.x+u.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-u.x-u.width),this.unscaledBounds.y+this.unscaledBounds.height>u.y+u.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-u.y-u.height))}var c=this.bounds;this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:r.x*s)+this.unscaledBounds.x*s,(null!=this.parentState?this.parentState.y:r.y*s)+this.unscaledBounds.y*s,this.unscaledBounds.width*s,this.unscaledBounds.height*s),h.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y),o=Math.cos(i),l=Math.sin(i);var m,g,x=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY()),f=o*(m=x.x-e.x)-l*(g=x.y-e.y)-m,y=l*m+o*g-g,v=this.bounds.x-this.state.x,C=this.bounds.y-this.state.y,E=o*v-l*C,S=l*v+o*C;this.bounds.x+=f,this.bounds.y+=y,this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+f/s),this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+y/s),this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width),this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height),this.graph.isCellCollapsed(this.state.cell)||0==f&&0==y?(this.childOffsetX=0,this.childOffsetY=0):(this.childOffsetX=this.state.x-this.bounds.x+E,this.childOffsetY=this.state.y-this.bounds.y+S),c.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(t),null!=this.preview&&this.drawPreview())},mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale,i=this.graph.view.translate,n=this.state.clone();this.state.x=this.bounds.x,this.state.y=this.bounds.y,this.state.origin=new mxPoint(this.state.x/e-i.x,this.state.y/e-i.y),this.state.width=this.bounds.width,this.state.height=this.bounds.height;var r=this.state.absoluteOffset;r=new mxPoint(r.x,r.y),this.state.absoluteOffset.x=0,this.state.absoluteOffset.y=0;var s=this.graph.getCellGeometry(this.state.cell);if(null!=s){var o=s.offset||this.EMPTY_POINT;null==o||s.relative||(this.state.absoluteOffset.x=this.state.view.scale*o.x,this.state.absoluteOffset.y=this.state.view.scale*o.y),this.state.view.updateVertexLabelOffset(this.state)}this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate(),this.redrawHandles(),null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="hidden"),this.state.setState(n)},mxVertexHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.state){var i=new mxPoint(e.getGraphX(),e.getGraphY()),n=this.index;this.index=null,this.graph.getModel().beginUpdate();try{if(n<=mxEvent.CUSTOM_HANDLE)null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-n].active=!1,this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute());else if(n==mxEvent.ROTATION_HANDLE)if(null!=this.currentAlpha){var r=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);0!=r&&this.rotateCell(this.state.cell,r)}else this.rotateClick();else{var s=this.graph.isGridEnabledEvent(e.getEvent()),o=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-o),a=Math.sin(-o),h=i.x-this.startX,u=i.y-this.startY,p=a*h+l*u;h=l*h-a*u,u=p;var d=this.graph.view.scale,c=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(h/d),this.roundLength(u/d),n,s,this.isConstrainedEvent(e),c)}}finally{this.graph.getModel().endUpdate()}e.consume(),this.reset()}},mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveResize(this.state)},mxVertexHandler.prototype.rotateClick=function(){},mxVertexHandler.prototype.rotateCell=function(t,e,i){if(0!=e){var n=this.graph.getModel();if(n.isVertex(t)||n.isEdge(t)){if(!n.isEdge(t)){var r=this.graph.view.getState(t),s=null!=r?r.style:this.graph.getCellStyle(t);if(null!=s){var o=(s[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,o,[t])}}var l=this.graph.getCellGeometry(t);if(null!=l){var a=this.graph.getCellGeometry(i);if(null==a||n.isEdge(i)||((l=l.clone()).rotate(e,new mxPoint(a.width/2,a.height/2)),n.setGeometry(t,l)),n.isVertex(t)&&!l.relative||n.isEdge(t))for(var h=n.getChildCount(t),u=0;u4?(f+=i,f=r?this.graph.snap(f/s)*s:Math.round(f/s)*s):n<3&&(x+=i,x=r?this.graph.snap(x/s)*s:Math.round(x/s)*s),0==n||3==n||5==n?(m+=e,m=r?this.graph.snap(m/s)*s:Math.round(m/s)*s):2!=n&&4!=n&&7!=n||(g+=e,g=r?this.graph.snap(g/s)*s:Math.round(g/s)*s);var C=g-m,E=f-x;if(l){var S=this.graph.getCellGeometry(this.state.cell);if(null!=S){var b=S.width/S.height;1==n||2==n||7==n||6==n?C=E*b:E=C/b,0==n&&(m=g-C,x=f-E)}}if(a){var T=y-(m+(C+=C-d)/2),w=v-(x+(E+=E-c)/2);m+=T,x+=w,g+=T,f+=w}C<0&&(m+=C,C=Math.abs(C)),E<0&&(x+=E,E=Math.abs(E));var L=new mxRectangle(m+o.x*s,x+o.y*s,C,E);return null!=this.minBounds&&(L.width=Math.max(L.width,this.minBounds.x*s+this.minBounds.width*s+Math.max(0,this.x0*s-L.x)),L.height=Math.max(L.height,this.minBounds.y*s+this.minBounds.height*s+Math.max(0,this.y0*s-L.y))),L},mxVertexHandler.prototype.redraw=function(t){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview(),t||this.redrawHandles()},mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance;return null!=this.sizers&&this.sizers.length>0&&null!=this.sizers[0]&&(this.bounds.width<2*this.sizers[0].bounds.width+2*e||this.bounds.height<2*this.sizers[0].bounds.height+2*e)&&(e/=2,t.x=this.sizers[0].bounds.width+e,t.y=this.sizers[0].bounds.height+e),t},mxVertexHandler.prototype.redrawHandles=function(){var t=this.tolerance;this.horizontalOffset=0,this.verticalOffset=0;var e=this.bounds;if(null!=this.sizers&&this.sizers.length>0&&null!=this.sizers[0]){if(null==this.index&&this.manageSizers&&this.sizers.length>=8){var i=this.getHandlePadding();this.horizontalOffset=i.x,this.verticalOffset=i.y,0==this.horizontalOffset&&0==this.verticalOffset||((e=new mxRectangle(e.x,e.y,e.width,e.height)).x-=this.horizontalOffset/2,e.width+=this.horizontalOffset,e.y-=this.verticalOffset/2,e.height+=this.verticalOffset),this.sizers.length>=8&&(e.width<2*this.sizers[0].bounds.width+2*t||e.height<2*this.sizers[0].bounds.height+2*t?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))}var n=e.x+e.width,r=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],n,r);else{var s=e.x+e.width/2,o=e.y+e.height/2;if(this.sizers.length>=8){var l=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"],a=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),h=Math.cos(a),u=Math.sin(a),p=Math.round(4*a/Math.PI),d=new mxPoint(e.getCenterX(),e.getCenterY()),c=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),h,u,d);this.moveSizerTo(this.sizers[0],c.x,c.y),this.sizers[0].setCursor(l[mxUtils.mod(0+p,l.length)]),c.x=s,c.y=e.y,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[1],c.x,c.y),this.sizers[1].setCursor(l[mxUtils.mod(1+p,l.length)]),c.x=n,c.y=e.y,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[2],c.x,c.y),this.sizers[2].setCursor(l[mxUtils.mod(2+p,l.length)]),c.x=e.x,c.y=o,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[3],c.x,c.y),this.sizers[3].setCursor(l[mxUtils.mod(7+p,l.length)]),c.x=n,c.y=o,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[4],c.x,c.y),this.sizers[4].setCursor(l[mxUtils.mod(3+p,l.length)]),c.x=e.x,c.y=r,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[5],c.x,c.y),this.sizers[5].setCursor(l[mxUtils.mod(6+p,l.length)]),c.x=s,c.y=r,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[6],c.x,c.y),this.sizers[6].setCursor(l[mxUtils.mod(5+p,l.length)]),c.x=n,c.y=r,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[7],c.x,c.y),this.sizers[7].setCursor(l[mxUtils.mod(4+p,l.length)]),c.x=s+this.state.absoluteOffset.x,c.y=o+this.state.absoluteOffset.y,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[8],c.x,c.y)}else this.state.width>=2&&this.state.height>=2?this.moveSizerTo(this.sizers[0],s+this.state.absoluteOffset.x,o+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}if(null!=this.rotationShape){a=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),h=Math.cos(a),u=Math.sin(a),d=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),c=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),h,u,d);null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,c.x,c.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()?"hidden":"")}if(null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.edgeHandlers)for(var m=0;m0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null,n=null,r=null;function s(e){if(null!=e&&null!=e.node&&"none"!=e.node.style.display&&"hidden"!=e.node.style.visibility&&(t.isSource(e)||null!=i&&mxUtils.intersects(e.bounds,i))){var r=t.getGraphX()-e.bounds.getCenterX(),s=t.getGraphY()-e.bounds.getCenterY(),o=r*r+s*s;if(null==n||o<=n)return n=o,!0}return!1}if(null!=this.customHandles&&this.isCustomHandleEvent(t))for(var o=this.customHandles.length-1;o>=0;o--)if(s(this.customHandles[o].shape))return mxEvent.CUSTOM_HANDLE-o;if((t.isSource(this.state.text)||s(this.labelShape))&&(r=mxEvent.LABEL_HANDLE),null!=this.bends)for(o=0;omxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(var s=0;s0&&this.isSnapToTerminalsEvent(t)){function l(t){if(null!=t){var e=t.x;Math.abs(n.x-e)0&&imxEvent.VIRTUAL_HANDLE&&(s[this.index-1]=o)}return null!=l?l:s},mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),i=t.getEvent(),n=mxEvent.getClientX(i),r=mxEvent.getClientY(i),s=document.documentElement,o=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),l=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),a=this.currentPoint.x-this.graph.container.scrollLeft+e.x-o,h=this.currentPoint.y-this.graph.container.scrollTop+e.y-l;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&null!=t.getState()||this.marker.highlight.isHighlightAt(n,r)||(a!=n||h!=r)&&null==t.getState()&&this.marker.highlight.isHighlightAt(a,h))},mxEdgeHandler.prototype.updatePreviewState=function(t,e,i,n,r){var s=this.isSource?i:this.state.getVisibleTerminalState(!0),o=this.isTarget?i:this.state.getVisibleTerminalState(!1),l=this.graph.getConnectionConstraint(t,s,!0),a=this.graph.getConnectionConstraint(t,o,!1),h=this.constraintHandler.currentConstraint;if(null==h&&r&&(null!=i?(n.isSource(this.marker.highlight.shape)&&(e=new mxPoint(n.getGraphX(),n.getGraphY())),h=this.graph.getOutlineConstraint(e,i,n),this.constraintHandler.setFocus(n,i,this.isSource),this.constraintHandler.currentConstraint=h,this.constraintHandler.currentPoint=e):h=new mxConnectionConstraint),this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var u=this.graph.view.scale;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=r?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/u/u,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.marker.getValidState()==n.getState()?mxConstants.DEFAULT_VALID_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/u/u,this.marker.highlight.repaint())}this.isSource?l=h:this.isTarget&&(a=h),(this.isSource||this.isTarget)&&(null!=h&&null!=h.point?(t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=h.point.x,t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=h.point.y):(delete t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y])),t.setVisibleTerminalState(s,!0),t.setVisibleTerminalState(o,!1),this.isSource&&null==s||t.view.updateFixedTerminalPoint(t,s,!0,l),this.isTarget&&null==o||t.view.updateFixedTerminalPoint(t,o,!1,a),(this.isSource||this.isTarget)&&null==i&&(t.setAbsoluteTerminalPoint(e,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),t.view.updatePoints(t,this.points,s,o),t.view.updateFloatingTerminalPoints(t,s,o)},mxEdgeHandler.prototype.mouseMove=function(t,e){if(null!=this.index&&null!=this.marker){if(this.currentPoint=this.getPointForEvent(e),this.error=null,!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&null!=this.snapPoint&&(Math.abs(this.snapPoint.x-this.currentPoint.x)mxEvent.VIRTUAL_HANDLE)null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e);else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,e);var i=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint)this.currentPoint=this.constraintHandler.currentPoint.clone();else if(this.outlineConnect){var n=!(!this.isSource&&!this.isTarget)&&this.isOutlineConnectEvent(e);n?i=this.marker.highlight.state:null!=i&&i!=e.getState()&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),i=null)}null==i||this.isCellEnabled(i.cell)||(i=null,this.marker.reset());var r=this.clonePreviewState(this.currentPoint,null!=i?i.cell:null);this.updatePreviewState(r,this.currentPoint,i,e,n);var s=null==this.error?this.marker.validColor:this.marker.invalidColor;this.setPreviewColor(s),this.abspoints=r.absolutePoints,this.active=!0}this.updateHint(e,this.currentPoint),this.drawPreview(),mxEvent.consume(e.getEvent()),e.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(e)&&e.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.marker){var i=this.state.cell,n=this.index;if(this.index=null,e.getX()!=this.startX||e.getY()!=this.startY){var r=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(null!=this.error)this.error.length>0&&this.graph.validationAlert(this.error);else if(n<=mxEvent.CUSTOM_HANDLE&&n>mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){(o=this.graph.getModel()).beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute()}finally{o.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var s=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(s=this.constraintHandler.currentFocus.cell),null==s&&this.marker.hasValidState()&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&&"white"!=this.marker.highlight.shape.stroke&&(s=this.marker.validState.cell),null!=s){var o,l=(o=this.graph.getModel()).getParent(i);o.beginUpdate();try{if(r){var a=o.getGeometry(i);r=this.graph.cloneCell(i);o.add(l,r,o.getChildCount(l)),null!=a&&(a=a.clone(),o.setGeometry(r,a));var h=o.getTerminal(i,!this.isSource);this.graph.connectCell(r,h,!this.isSource),i=r}i=this.connect(i,s,this.isSource,r,e)}finally{o.endUpdate()}}else if(this.graph.isAllowDanglingEdges()){var u=this.abspoints[this.isSource?0:this.abspoints.length-1];u.x=this.roundLength(u.x/this.graph.view.scale-this.graph.view.translate.x),u.y=this.roundLength(u.y/this.graph.view.scale-this.graph.view.translate.y);var p=this.graph.getView().getState(this.graph.getModel().getParent(i));null!=p&&(u.x-=p.origin.x,u.y-=p.origin.y),u.x-=this.graph.panDx/this.graph.view.scale,u.y-=this.graph.panDy/this.graph.view.scale,i=this.changeTerminalPoint(i,u,this.isSource,r)}}else this.active?i=this.changePoints(i,this.points,r):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}null!=this.marker&&(this.reset(),i!=this.state.cell&&this.graph.setSelectionCell(i)),e.consume()}},mxEdgeHandler.prototype.reset=function(){if(this.active&&this.refresh(),this.error=null,this.index=null,this.label=null,this.points=null,this.snapPoint=null,this.isLabel=!1,this.isSource=!1,this.isTarget=!1,this.active=!1,this.livePreview&&null!=this.sizers)for(var t=0;t0&&e0&&null!=i){null==this.points&&(this.points=[]);for(var n=1;n0&&this.graph.isLabelMovable(t),null!=this.bends&&this.bends.length>0){var n=this.abspoints.length-1,r=this.abspoints[0],s=r.x,o=r.y;e=this.bends[0].bounds,this.bends[0].bounds=new mxRectangle(Math.floor(s-e.width/2),Math.floor(o-e.height/2),e.width,e.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);var l=this.abspoints[n],a=l.x,h=l.y,u=this.bends.length-1;e=this.bends[u].bounds,this.bends[u].bounds=new mxRectangle(Math.floor(a-e.width/2),Math.floor(h-e.height/2),e.width,e.height),this.bends[u].fill=this.getHandleFillColor(u),this.bends[u].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[u].bounds),this.redrawInnerBends(r,l)}if(null!=this.abspoints&&null!=this.virtualBends&&this.virtualBends.length>0)for(var p=this.abspoints[0],d=0;d1?(t=n[1],e=n[n.length-2]):null!=i.points&&i.points.length>0&&(r=n[0]),r=null==r?new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2):new mxPoint(this.graph.getView().scale*(r.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(r.y+this.graph.getView().translate.y+this.state.origin.y));var s=this.bends[1].bounds,o=s.width,l=s.height,a=new mxRectangle(Math.round(r.x-o/2),Math.round(r.y-l/2),o,l);this.manageLabelHandle?this.checkLabelHandle(a):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(a,this.labelShape.bounds)&&(o=mxConstants.HANDLE_SIZE+3,l=mxConstants.HANDLE_SIZE+3,a=new mxRectangle(Math.floor(r.x-o/2),Math.floor(r.y-l/2),o,l)),this.bends[1].bounds=a,this.bends[1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)},__mxOutput.mxElbowEdgeHandler=void 0!==mxElbowEdgeHandler?mxElbowEdgeHandler:void 0,mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler),mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(null!=t){var e=Math.max(1,this.graph.view.scale);if(2==t.length||3==t.length&&(Math.abs(t[0].x-t[1].x)0){var l=this.abspoints,a=l[0],h=l[1];o=[];for(var u=2;u1){var n=!1;if(4==i.length&&0==Math.round(i[1].x-i[2].x)&&0==Math.round(i[1].y-i[2].y))if(n=!0,0==Math.round(i[0].y-i[i.length-1].y)){var r=i[0].x+(i[i.length-1].x-i[0].x)/2;i[1]=new mxPoint(r,i[1].y),i[2]=new mxPoint(r,i[2].y)}else{var s=i[0].y+(i[i.length-1].y-i[0].y)/2;i[1]=new mxPoint(i[1].x,s),i[2]=new mxPoint(i[2].x,s)}for(var o=0;o0){null==this.div&&this.init();var n=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex,this.div.style.left=e+n.x+"px",this.div.style.top=i+mxConstants.TOOLTIP_VERTICAL_OFFSET+n.y+"px",mxUtils.isNode(t)?(this.div.innerHTML="",this.div.appendChild(t)):this.div.innerHTML=t.replace(/\n/g,"
"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)},__mxOutput.mxTooltipHandler=void 0!==mxTooltipHandler?mxTooltipHandler:void 0,mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(t,e){},mxCellTracker.prototype.mouseMove=function(t,e){this.isEnabled()&&this.process(e)},mxCellTracker.prototype.mouseUp=function(t,e){},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},__mxOutput.mxCellTracker=void 0!==mxCellTracker?mxCellTracker:void 0,mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t,null!=this.shape&&(this.shape.stroke=t)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),this.keepOnTop||this.shape.node.parentNode.firstChild==this.shape.node||this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var t=this.graph.cellRenderer.createShape(this.state);return t.svgStrokeTolerance=this.graph.tolerance,t.points=this.state.absolutePoints,t.apply(this.state),t.stroke=this.highlightColor,t.opacity=this.opacity,t.isDashed=this.dashed,t.isShadow=!1,t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,this.state),this.graph.dialect!=mxConstants.DIALECT_SVG?t.pointerEvents=!1:t.svgPointerEvents="stroke",t},mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth},mxCellHighlight.prototype.repaint=function(){null!=this.state&&null!=this.shape&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),(mxClient.IS_QUIRKS||8==document.documentMode)&&("transparent"==this.shape.stroke?(this.shape.stroke="white",this.shape.opacity=1):this.shape.opacity=this.opacity),this.shape.redraw())},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(t){this.state!=t&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=t,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.isHighlightAt=function(t,e){var i=!1;if(null!=this.shape&&null!=document.elementFromPoint&&!mxClient.IS_QUIRKS)for(var n=document.elementFromPoint(t,e);null!=n;){if(n==this.shape.node){i=!0;break}n=n.parentNode}return i},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxCellHighlight=void 0!==mxCellHighlight?mxCellHighlight:void 0,mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(t,e,i){var n=mxUtils.bind(this,(function(){this.editor.execute(e)}));i?this.handler.bindControlKey(t,n):this.handler.bindKey(t,n)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},__mxOutput.mxDefaultKeyHandler=void 0!==mxDefaultKeyHandler?mxDefaultKeyHandler:void 0,mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(t,e,i,n){if(null!=this.config){var r=this.createConditions(t,i,n),s=this.config.firstChild;this.addItems(t,e,i,n,r,s,null)}},mxDefaultPopupMenu.prototype.addItems=function(t,e,i,n,r,s,o){for(var l=!1;null!=s;){if("add"==s.nodeName){var a=s.getAttribute("if");if(null==a||r[a]){var h=s.getAttribute("as");h=mxResources.get(h)||h;var u=mxUtils.eval(mxUtils.getTextContent(s)),p=s.getAttribute("action"),d=s.getAttribute("icon"),c=s.getAttribute("iconCls"),m=s.getAttribute("enabled-if"),g=null==m||r[m];l&&(e.addSeparator(o),l=!1),null!=d&&this.imageBasePath&&(d=this.imageBasePath+d);var x=this.addAction(e,t,h,d,u,p,i,o,c,g);this.addItems(t,e,i,n,r,s.firstChild,x)}}else"separator"==s.nodeName&&(l=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(t,e,i,n,r,s,o,l,a,h){return t.addItem(i,n,(function(t){"function"==typeof r&&r.call(e,e,o,t),null!=s&&e.execute(s,o,t)}),l,a,h)},mxDefaultPopupMenu.prototype.createConditions=function(t,e,i){var n=t.graph.getModel(),r=n.getChildCount(e),s=[];s.nocell=null==e,s.ncells=t.graph.getSelectionCount()>1,s.notRoot=n.getRoot()!=n.getParent(t.graph.getDefaultParent()),s.cell=null!=e;var o=null!=e&&1==t.graph.getSelectionCount();s.nonEmpty=o&&r>0,s.expandable=o&&t.graph.isCellFoldable(e,!1),s.collapsable=o&&t.graph.isCellFoldable(e,!0),s.validRoot=o&&t.graph.isValidRoot(e),s.emptyValidRoot=s.validRoot&&0==r,s.swimlane=o&&t.graph.isSwimlane(e);for(var l=this.config.getElementsByTagName("condition"),a=0;a0&&this.editor.execute(i)}));return this.toolbar.addItem(t,e,r,n)},mxDefaultToolbar.prototype.addSeparator=function(t){t=t||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(t)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(t){return this.toolbar.addActionCombo(t)},mxDefaultToolbar.prototype.addActionOption=function(t,e,i){var n=mxUtils.bind(this,(function(){this.editor.execute(i)}));this.addOption(t,e,n)},mxDefaultToolbar.prototype.addOption=function(t,e,i){return this.toolbar.addOption(t,e,i)},mxDefaultToolbar.prototype.addMode=function(t,e,i,n,r){var s=mxUtils.bind(this,(function(){this.editor.setMode(i),null!=r&&r(this.editor)}));return this.toolbar.addSwitchMode(t,e,s,n)},mxDefaultToolbar.prototype.addPrototype=function(t,e,i,n,r,s){var o=mxUtils.bind(this,(function(){return"function"==typeof i?i():null!=i?this.editor.graph.cloneCell(i):null})),l=mxUtils.bind(this,(function(t,e){"function"==typeof r?r(this.editor,o(),t,e):this.drop(o(),t,e),this.toolbar.resetMode(),mxEvent.consume(t)})),a=this.toolbar.addMode(t,e,l,n,null,s);return this.installDropHandler(a,(function(t,e,i){l(e,i)})),a},mxDefaultToolbar.prototype.drop=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(null!=i&&!r.isEdge(i)&&this.connectOnDrop&&n.isCellConnectable(i))this.connect(t,e,i);else{for(;null!=i&&!n.isValidDropTarget(i,[t],e);)i=r.getParent(i);this.insert(t,e,i)}},mxDefaultToolbar.prototype.insert=function(t,e,i){var n=this.editor.graph;if(n.canImportCell(t)){var r=mxEvent.getClientX(e),s=mxEvent.getClientY(e),o=mxUtils.convertPoint(n.container,r,s);return n.isSplitEnabled()&&n.isSplitTarget(i,[t],e)?n.splitEdge(i,[t],null,o.x,o.y):this.editor.addVertex(i,t,o.x,o.y)}return null},mxDefaultToolbar.prototype.connect=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(null!=i&&n.isCellConnectable(t)&&n.isEdgeValid(null,i,t)){var s=null;r.beginUpdate();try{var o=r.getGeometry(i),l=r.getGeometry(t).clone();l.x=o.x+(o.width-l.width)/2,l.y=o.y+(o.height-l.height)/2;var a=this.spacing*n.gridSize,h=20*r.getDirectedEdgeCount(i,!0);this.editor.horizontalFlow?l.x+=(l.width+o.width)/2+a+h:l.y+=(l.height+o.height)/2+a+h,t.setGeometry(l);var u=r.getParent(i);if(n.addCell(t,u),n.constrainChild(t),s=this.editor.createEdge(i,t),null==r.getGeometry(s)){var p=new mxGeometry;p.relative=!0,r.setGeometry(s,p)}n.addEdge(s,u,i,t)}finally{r.endUpdate()}n.setSelectionCells([t,s]),n.scrollCellToVisible(t)}},mxDefaultToolbar.prototype.installDropHandler=function(t,e){var i=document.createElement("img");i.setAttribute("src",t.getAttribute("src"));var n=mxUtils.bind(this,(function(r){i.style.width=2*t.offsetWidth+"px",i.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,e,i),mxEvent.removeListener(i,"load",n)}));mxClient.IS_IE?n():mxEvent.addListener(i,"load",n)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},__mxOutput.mxDefaultToolbar=void 0!==mxDefaultToolbar?mxDefaultToolbar:void 0,mxLoadResources?mxResources.add(mxClient.basePath+"/resources/editor"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed=" ",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(t){this.modified=t},mxEditor.prototype.addActions=function(){this.addAction("save",(function(t){t.save()})),this.addAction("print",(function(t){new mxPrintPreview(t.graph,1).open()})),this.addAction("show",(function(t){mxUtils.show(t.graph,null,10,10)})),this.addAction("exportImage",(function(t){var e=t.getUrlImage();if(null==e||mxClient.IS_LOCAL)t.execute("show");else{var i=mxUtils.getViewXml(t.graph,1),n=mxUtils.getXml(i,"\n");mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(n),document,"_blank")}})),this.addAction("refresh",(function(t){t.graph.refresh()})),this.addAction("cut",(function(t){t.graph.isEnabled()&&mxClipboard.cut(t.graph)})),this.addAction("copy",(function(t){t.graph.isEnabled()&&mxClipboard.copy(t.graph)})),this.addAction("paste",(function(t){t.graph.isEnabled()&&mxClipboard.paste(t.graph)})),this.addAction("delete",(function(t){t.graph.isEnabled()&&t.graph.removeCells()})),this.addAction("group",(function(t){t.graph.isEnabled()&&t.graph.setSelectionCell(t.groupCells())})),this.addAction("ungroup",(function(t){t.graph.isEnabled()&&t.graph.setSelectionCells(t.graph.ungroupCells())})),this.addAction("removeFromParent",(function(t){t.graph.isEnabled()&&t.graph.removeCellsFromParent()})),this.addAction("undo",(function(t){t.graph.isEnabled()&&t.undo()})),this.addAction("redo",(function(t){t.graph.isEnabled()&&t.redo()})),this.addAction("zoomIn",(function(t){t.graph.zoomIn()})),this.addAction("zoomOut",(function(t){t.graph.zoomOut()})),this.addAction("actualSize",(function(t){t.graph.zoomActual()})),this.addAction("fit",(function(t){t.graph.fit()})),this.addAction("showProperties",(function(t,e){t.showProperties(e)})),this.addAction("selectAll",(function(t){t.graph.isEnabled()&&t.graph.selectAll()})),this.addAction("selectNone",(function(t){t.graph.isEnabled()&&t.graph.clearSelection()})),this.addAction("selectVertices",(function(t){t.graph.isEnabled()&&t.graph.selectVertices()})),this.addAction("selectEdges",(function(t){t.graph.isEnabled()&&t.graph.selectEdges()})),this.addAction("edit",(function(t,e){t.graph.isEnabled()&&t.graph.isCellEditable(e)&&t.graph.startEditingAtCell(e)})),this.addAction("toBack",(function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!0)})),this.addAction("toFront",(function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!1)})),this.addAction("enterGroup",(function(t,e){t.graph.enterGroup(e)})),this.addAction("exitGroup",(function(t){t.graph.exitGroup()})),this.addAction("home",(function(t){t.graph.home()})),this.addAction("selectPrevious",(function(t){t.graph.isEnabled()&&t.graph.selectPreviousCell()})),this.addAction("selectNext",(function(t){t.graph.isEnabled()&&t.graph.selectNextCell()})),this.addAction("selectParent",(function(t){t.graph.isEnabled()&&t.graph.selectParentCell()})),this.addAction("selectChild",(function(t){t.graph.isEnabled()&&t.graph.selectChildCell()})),this.addAction("collapse",(function(t){t.graph.isEnabled()&&t.graph.foldCells(!0)})),this.addAction("collapseAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!0,!1,e)}})),this.addAction("expand",(function(t){t.graph.isEnabled()&&t.graph.foldCells(!1)})),this.addAction("expandAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!1,!1,e)}})),this.addAction("bold",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)})),this.addAction("italic",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)})),this.addAction("underline",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)})),this.addAction("alignCellsLeft",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_LEFT)})),this.addAction("alignCellsCenter",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_CENTER)})),this.addAction("alignCellsRight",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_RIGHT)})),this.addAction("alignCellsTop",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_TOP)})),this.addAction("alignCellsMiddle",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_MIDDLE)})),this.addAction("alignCellsBottom",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_BOTTOM)})),this.addAction("alignFontLeft",(function(t){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)})),this.addAction("alignFontCenter",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)})),this.addAction("alignFontRight",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)})),this.addAction("alignFontTop",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)})),this.addAction("alignFontMiddle",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)})),this.addAction("alignFontBottom",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)})),this.addAction("zoom",(function(t){var e=100*t.graph.getView().scale,i=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;isNaN(i)||t.graph.getView().setScale(i)})),this.addAction("toggleTasks",(function(t){null!=t.tasks?t.tasks.setVisible(!t.tasks.isVisible()):t.showTasks()})),this.addAction("toggleHelp",(function(t){null!=t.help?t.help.setVisible(!t.help.isVisible()):t.showHelp()})),this.addAction("toggleOutline",(function(t){null==t.outline?t.showOutline():t.outline.setVisible(!t.outline.isVisible())})),this.addAction("toggleConsole",(function(t){mxLog.setVisible(!mxLog.isVisible())}))},mxEditor.prototype.configure=function(t){null!=t&&(new mxCodec(t.ownerDocument).decode(t,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(t,e){this.actions[t]=e},mxEditor.prototype.execute=function(t,e,i){var n=this.actions[t];if(null!=n)try{var r=arguments;r[0]=this,n.apply(this,r)}catch(e){throw mxUtils.error("Cannot execute "+t+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+t,280,!0)},mxEditor.prototype.addTemplate=function(t,e){this.templates[t]=e},mxEditor.prototype.getTemplate=function(t){return this.templates[t]},mxEditor.prototype.createGraph=function(){var t=new mxGraph(null,null,this.graphRenderHint);return t.setTooltips(!0),t.setPanning(!0),this.installDblClickHandler(t),this.installUndoHandler(t),this.installDrillHandler(t),this.installChangeHandler(t),this.installInsertHandler(t),t.popupMenuHandler.factoryMethod=mxUtils.bind(this,(function(t,e,i){return this.createPopupMenu(t,e,i)})),t.connectionHandler.factoryMethod=mxUtils.bind(this,(function(t,e){return this.createEdge(t,e)})),this.createSwimlaneManager(t),this.createLayoutManager(t),t},mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,!1);return e.isHorizontal=mxUtils.bind(this,(function(){return this.horizontalFlow})),e.isEnabled=mxUtils.bind(this,(function(){return this.maintainSwimlanes})),e},mxEditor.prototype.createLayoutManager=function(t){var e=new mxLayoutManager(t),i=this;return e.getLayout=function(e){var n=null,r=i.graph.getModel();return null!=r.getParent(e)&&(i.layoutSwimlanes&&t.isSwimlane(e)?(null==i.swimlaneLayout&&(i.swimlaneLayout=i.createSwimlaneLayout()),n=i.swimlaneLayout):i.layoutDiagram&&(t.isValidRoot(e)||null==r.getParent(r.getParent(e)))&&(null==i.diagramLayout&&(i.diagramLayout=i.createDiagramLayout()),n=i.diagramLayout)),n},e},mxEditor.prototype.setGraphContainer=function(t){null==this.graph.container&&(this.graph.init(t),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(t),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.installDblClickHandler=function(t){t.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,(function(e,i){var n=i.getProperty("cell");null!=n&&t.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,n),i.consume())})))},mxEditor.prototype.installUndoHandler=function(t){var e=mxUtils.bind(this,(function(t,e){var i=e.getProperty("edit");this.undoManager.undoableEditHappened(i)}));t.getModel().addListener(mxEvent.UNDO,e),t.getView().addListener(mxEvent.UNDO,e);var i=function(e,i){var n=i.getProperty("edit").changes;t.setSelectionCells(t.getSelectionCellsForChanges(n))};this.undoManager.addListener(mxEvent.UNDO,i),this.undoManager.addListener(mxEvent.REDO,i)},mxEditor.prototype.installDrillHandler=function(t){var e=mxUtils.bind(this,(function(t){this.fireEvent(new mxEventObject(mxEvent.ROOT))}));t.getView().addListener(mxEvent.DOWN,e),t.getView().addListener(mxEvent.UP,e)},mxEditor.prototype.installChangeHandler=function(t){var e=mxUtils.bind(this,(function(e,i){this.setModified(!0),1==this.validating&&t.validateGraph();for(var n=i.getProperty("edit").changes,r=0;r "+e.convertValueToString(i)+t),i=e.getModel().getParent(i);return this.getRootTitle()+t},mxEditor.prototype.getRootTitle=function(){var t=this.graph.getModel().getRoot();return this.graph.convertValueToString(t)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var t=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){if(null!=t){var e=mxUtils.load(t).getXml();this.readGraphModel(e.documentElement),this.filename=t,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",t))}},mxEditor.prototype.readGraphModel=function(t){new mxCodec(t.ownerDocument).decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){if(null!=(t=t||this.getUrlPost())&&t.length>0){var i=this.writeGraphModel(e);this.postDiagram(t,i),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(t,e){this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,(function(i){this.fireEvent(new mxEventObject(mxEvent.POST,"request",i,"url",t,"data",e))})))},mxEditor.prototype.writeGraphModel=function(t){t=null!=t?t:this.linefeed;var e=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(e,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var i=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,i),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){if(null==(t=t||this.graph.getSelectionCell())&&null==(t=this.graph.getCurrentRoot())&&(t=this.graph.getModel().getRoot()),null!=t){this.graph.stopEditing(!0);var e=mxUtils.getOffset(this.graph.container),i=e.x+10,n=e.y;if(null==this.properties||this.movePropertiesDialog){var r=this.graph.getCellBounds(t);null!=r&&(i+=r.x+Math.min(200,r.width),n+=r.y)}else i=this.properties.getX(),n=this.properties.getY();this.hideProperties();var s=this.createProperties(t);null!=s&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,s,i,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel(),i=e.getValue(t);if(mxUtils.isNode(i)){var n=new mxForm("properties");n.addText("ID",t.getId()).setAttribute("readonly","true");var r=null,s=null,o=null,l=null,a=null;e.isVertex(t)&&null!=(r=e.getGeometry(t))&&(s=n.addText("top",r.y),o=n.addText("left",r.x),l=n.addText("width",r.width),a=n.addText("height",r.height));for(var h=e.getStyle(t),u=n.addText("Style",h||""),p=i.attributes,d=[],c=0;c0?e.setStyle(t,u.value):e.setStyle(t,null);for(var i=0;i0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){if(null!=this.cycleAttributeName){var e=this.consumeCycleAttribute(t);null!=e&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}},mxEditor.prototype.addVertex=function(t,e,i,n){for(var r=this.graph.getModel();null!=t&&!this.graph.isValidDropTarget(t);)t=r.getParent(t);t=null!=t?t:this.graph.getSwimlaneAt(i,n);var s=this.graph.getView().scale,o=r.getGeometry(e),l=r.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(null==t&&this.swimlaneRequired)return null;if(null!=t&&null!=l){var a=this.graph.getView().getState(t);if(null!=a){if(i-=a.origin.x*s,n-=a.origin.y*s,this.graph.isConstrainedMoving){var h=o.width,u=o.height,p=a.x+a.width;i+h>p&&(i-=i+h-p),n+u>(p=a.y+a.height)&&(n-=n+u-p)}}else null!=l&&(i-=l.x*s,n-=l.y*s)}}(o=o.clone()).x=this.graph.snap(i/s-this.graph.getView().translate.x-this.graph.gridSize/2),o.y=this.graph.snap(n/s-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(o),null==t&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),r.beginUpdate();try{null!=(e=this.graph.addCell(e,t))&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{r.endUpdate()}return null!=e&&(this.graph.setSelectionCell(e),this.graph.scrollCellToVisible(e),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))),e},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.status=null,this.templates=null)},__mxOutput.mxEditor=void 0!==mxEditor?mxEditor:void 0;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(null!=t){var e=t.getName();mxCodecRegistry.codecs[e]=t;var i=mxUtils.getFunctionName(t.template.constructor);i!=e&&mxCodecRegistry.addAlias(i,e)}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(null!=t){var i=mxUtils.getFunctionName(t),n=mxCodecRegistry.aliases[i];if(null!=n&&(i=n),null==(e=mxCodecRegistry.codecs[i]))try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch(t){}}return e}},codec;function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(t,e,i,n){for(var r in this.template=t,this.exclude=null!=e?e:[],this.idrefs=null!=i?i:[],this.mapping=null!=n?n:[],this.reverse=new Object,this.mapping)this.reverse[this.mapping[r]]=r}__mxOutput.mxCodecRegistry=void 0!==mxCodecRegistry?mxCodecRegistry:void 0,mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.elements=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(t,e){return this.objects[t]=e,e},mxCodec.prototype.getObject=function(t){var e=null;if(null!=t&&null==(e=this.objects[t])&&null==(e=this.lookup(t))){var i=this.getElementById(t);null!=i&&(e=this.decode(i))}return e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){return this.updateElements(),this.elements[t]},mxCodec.prototype.updateElements=function(){null==this.elements&&(this.elements=new Object,null!=this.document.documentElement&&this.addElement(this.document.documentElement))},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(null!=e)if(null==this.elements[e])this.elements[e]=t;else if(this.elements[e]!=t)throw new Error(e+": Duplicate ID")}for(t=t.firstChild;null!=t;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return null!=t&&null==(e=this.reference(t))&&t instanceof mxCell&&null==(e=t.getId())&&0==(e=mxCellPath.create(t)).length&&(e="root"),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e=null;if(null!=t&&null!=t.constructor){var i=mxCodecRegistry.getCodec(t.constructor);null!=i?e=i.encode(this,t):mxUtils.isNode(t)?e=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}return e},mxCodec.prototype.decode=function(t,e){this.updateElements();var i=null;if(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=null;try{n=window[t.nodeName]}catch(t){}var r=mxCodecRegistry.getCodec(n);null!=r?i=r.decode(this,t,e):(i=t.cloneNode(!0)).removeAttribute("as")}return i},mxCodec.prototype.encodeCell=function(t,e,i){if(e.appendChild(this.encode(t)),null==i||i)for(var n=t.getChildCount(),r=0;r=0},mxObjectCodec.prototype.isReference=function(t,e,i,n){return mxUtils.indexOf(this.idrefs,e)>=0},mxObjectCodec.prototype.encode=function(t,e){var i=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,i),this.encodeObject(t,e,i),this.afterEncode(t,e,i)},mxObjectCodec.prototype.encodeObject=function(t,e,i){for(var n in t.setAttribute(i,"id",t.getId(e)),e){var r=n,s=e[r];null==s||this.isExcluded(e,r,s,!0)||(mxUtils.isInteger(r)&&(r=null),this.encodeValue(t,e,r,s,i))}},mxObjectCodec.prototype.encodeValue=function(t,e,i,n,r){if(null!=n){if(this.isReference(e,i,n,!0)){var s=t.getId(n);if(null==s)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+i+"="+n);n=s}var o=this.template[i];(null==i||t.encodeDefaults||o!=n)&&(i=this.getAttributeName(i),this.writeAttribute(t,e,i,n,r))}},mxObjectCodec.prototype.writeAttribute=function(t,e,i,n,r){"object"!=typeof n?this.writePrimitiveAttribute(t,e,i,n,r):this.writeComplexAttribute(t,e,i,n,r)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,i,n,r){if(n=this.convertAttributeToXml(t,e,i,n,r),null==i){var s=t.document.createElement("add");"function"==typeof n?s.appendChild(t.document.createTextNode(n)):t.setAttribute(s,"value",n),r.appendChild(s)}else"function"!=typeof n&&t.setAttribute(r,i,n)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,i,n,r){var s=t.encode(n);null!=s?(null!=i&&s.setAttribute("as",i),r.appendChild(s)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+i+": "+n)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,i,n){return this.isBooleanAttribute(t,e,i,n)&&(n=1==n?"1":"0"),n},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,i,n){return void 0===n.length&&(1==n||0==n)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,i){var n=e.value;return this.isNumericAttribute(t,e,i)&&(n=parseFloat(n),!isNaN(n)&&isFinite(n)||(n=0)),n},mxObjectCodec.prototype.isNumericAttribute=function(t,e,i){return i.constructor==mxGeometry&&("x"==e.name||"y"==e.name||"width"==e.name||"height"==e.name)||i.constructor==mxPoint&&("x"==e.name||"y"==e.name)||mxUtils.isNumeric(e.value)},mxObjectCodec.prototype.beforeEncode=function(t,e,i){return e},mxObjectCodec.prototype.afterEncode=function(t,e,i){return i},mxObjectCodec.prototype.decode=function(t,e,i){var n=e.getAttribute("id"),r=t.objects[n];return null==r&&(r=i||this.cloneTemplate(),null!=n&&t.putObject(n,r)),e=this.beforeDecode(t,e,r),this.decodeNode(t,e,r),this.afterDecode(t,e,r)},mxObjectCodec.prototype.decodeNode=function(t,e,i){null!=e&&(this.decodeAttributes(t,e,i),this.decodeChildren(t,e,i))},mxObjectCodec.prototype.decodeAttributes=function(t,e,i){var n=e.attributes;if(null!=n)for(var r=0;r0&&(n=null),n},mxObjectCodec.prototype.addObjectValue=function(t,e,i,n){null!=i&&i!=n&&(null!=e&&e.length>0?t[e]=i:t.push(i))},mxObjectCodec.prototype.processInclude=function(t,e,i){if("include"==e.nodeName){var n=e.getAttribute("name");if(null!=n)try{var r=mxUtils.load(n).getDocumentElement();null!=r&&t.decode(r,i)}catch(t){}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(t,e,i){return e},mxObjectCodec.prototype.afterDecode=function(t,e,i){return i},__mxOutput.mxObjectCodec=void 0!==mxObjectCodec?mxObjectCodec:void 0,mxCodecRegistry.register((codec=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]),codec.isCellCodec=function(){return!0},codec.isNumericAttribute=function(t,e,i){return"value"!==e.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},codec.isExcluded=function(t,e,i,n){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||n&&"value"==e&&i.nodeType==mxConstants.NODETYPE_ELEMENT},codec.afterEncode=function(t,e,i){if(null!=e.value&&e.value.nodeType==mxConstants.NODETYPE_ELEMENT){var n=i;(i=mxUtils.importNode(t.document,e.value,!0)).appendChild(n);var r=n.getAttribute("id");i.setAttribute("id",r),n.removeAttribute("id")}return i},codec.beforeDecode=function(t,e,i){var n=e.cloneNode(!0),r=this.getName();if(e.nodeName!=r){var s=e.getElementsByTagName(r)[0];null!=s&&s.parentNode==e?(mxUtils.removeWhitespace(s,!0),mxUtils.removeWhitespace(s,!1),s.parentNode.removeChild(s),n=s):n=null,i.value=e.cloneNode(!0);var o=i.value.getAttribute("id");null!=o&&(i.setId(o),i.value.removeAttribute("id"))}else i.setId(e.getAttribute("id"));if(null!=n)for(var l=0;l=0},t.isExcluded=function(t,e,i,n){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||n&&null!=i&&("previous"==e||"parent"==e)&&!t.model.contains(i)},t.afterEncode=function(t,e,i){return this.isReference(e,"child",e.child,!0)?i.setAttribute("child",t.getId(e.child)):t.encodeCell(e.child,i),i},t.beforeDecode=function(t,e,i){if(null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var n=(e=e.cloneNode(!0)).firstChild;i.child=t.decodeCell(n,!1);var r=n.nextSibling;for(n.parentNode.removeChild(n),n=r;null!=n;){if(r=n.nextSibling,n.nodeType==mxConstants.NODETYPE_ELEMENT){var s=n.getAttribute("id");null==t.lookup(s)&&t.decodeCell(n)}n.parentNode.removeChild(n),n=r}}else{var o=e.getAttribute("child");i.child=t.getObject(o)}return e},t.afterDecode=function(t,e,i){return null!=i.child&&(null!=i.child.parent&&null!=i.previous&&i.child.parent!=i.previous&&(i.previous=i.child.parent),i.child.parent=i.previous,i.previous=i.parent,i.previousIndex=i.index),i},t}()),__mxOutput.mxChildChangeCodec="undefined"!=typeof mxChildChangeCodec?mxChildChangeCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(t,e,i){return i.previous=i.terminal,i},t}()),__mxOutput.mxTerminalChangeCodec="undefined"!=typeof mxTerminalChangeCodec?mxTerminalChangeCodec:void 0;var mxGenericChangeCodec=function(t,e){var i=new mxObjectCodec(t,["model","previous"],["cell"]);return i.afterDecode=function(t,i,n){return mxUtils.isNode(n.cell)&&(n.cell=t.decodeCell(n.cell,!1)),n.previous=n[e],n},i};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),__mxOutput.mxGenericChangeCodec=void 0!==mxGenericChangeCodec?mxGenericChangeCodec:void 0,mxCodecRegistry.register(new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])),__mxOutput.mxGraphCodec="undefined"!=typeof mxGraphCodec?mxGraphCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(t,e){return this.encodeCell(t,e,e.graph.getModel().getRoot())},t.encodeCell=function(t,e,i){var n=e.graph.getModel(),r=e.getState(i),s=n.getParent(i);if(null==s||null!=r){var o=n.getChildCount(i),l=e.graph.getCellGeometry(i),a=null;if(s==n.getRoot()?a="layer":null==s?a="graph":n.isEdge(i)?a="edge":o>0&&null!=l?a="group":n.isVertex(i)&&(a="vertex"),null!=a){var h=t.document.createElement(a);if(null!=e.graph.getLabel(i)&&(h.setAttribute("label",e.graph.getLabel(i)),e.graph.isHtmlLabel(i)&&h.setAttribute("html",!0)),null==s){var u=e.getGraphBounds();null!=u&&(h.setAttribute("x",Math.round(u.x)),h.setAttribute("y",Math.round(u.y)),h.setAttribute("width",Math.round(u.width)),h.setAttribute("height",Math.round(u.height))),h.setAttribute("scale",e.scale)}else if(null!=r&&null!=l){for(var p in r.style){var d=r.style[p];"function"==typeof d&&"object"==typeof d&&(d=mxStyleRegistry.getName(d)),null!=d&&"function"!=typeof d&&"object"!=typeof d&&h.setAttribute(p,d)}var c=r.absolutePoints;if(null!=c&&c.length>0){var m=Math.round(c[0].x)+","+Math.round(c[0].y);for(p=1;p0&&i.appendChild(s)}}return i},t.getStringValue=function(t,e){var i=typeof e;return"function"==i?e=mxStyleRegistry.getName(e):"object"==i&&(e=null),e},t.decode=function(t,e,i){var n=i||new this.template.constructor,r=e.getAttribute("id");for(null!=r&&(t.objects[r]=n),e=e.firstChild;null!=e;){if(!this.processInclude(t,e,n)&&"add"==e.nodeName){var s=e.getAttribute("as");if(null!=s){var o=e.getAttribute("extend"),l=null!=o?mxUtils.clone(n.styles[o]):null;null==l&&(null!=o&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+o+" not found to extend"),l=new Object);for(var a=e.firstChild;null!=a;){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var h=a.getAttribute("as");if("add"==a.nodeName){var u=mxUtils.getTextContent(a),p=null;null!=u&&u.length>0&&mxStylesheetCodec.allowEval?p=mxUtils.eval(u):(p=a.getAttribute("value"),mxUtils.isNumeric(p)&&(p=parseFloat(p))),null!=p&&(l[h]=p)}else"remove"==a.nodeName&&delete l[h]}a=a.nextSibling}n.putCellStyle(s,l)}}e=e.nextSibling}return n},t}());mxStylesheetCodec.allowEval=!0,__mxOutput.mxStylesheetCodec=void 0!==mxStylesheetCodec?mxStylesheetCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(t,e){return null},t.decode=function(t,e,i){if(null!=i)for(i.editor,e=e.firstChild;null!=e;){if(!this.processInclude(t,e,i)&&"add"==e.nodeName){var n=e.getAttribute("as"),r=e.getAttribute("action"),s=e.getAttribute("control");i.bindAction(n,r,s)}e=e.nextSibling}return i},t}()),__mxOutput.mxDefaultKeyHandlerCodec="undefined"!=typeof mxDefaultKeyHandlerCodec?mxDefaultKeyHandlerCodec:void 0;var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(t,e){return null},t.decode=function(t,e,i){if(null!=i){var n=i.editor;for(e=e.firstChild;null!=e;){if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(t,e,i))if("separator"==e.nodeName)i.addSeparator();else if("br"==e.nodeName)i.toolbar.addBreak();else if("hr"==e.nodeName)i.toolbar.addLine();else if("add"==e.nodeName){var r=e.getAttribute("as");r=mxResources.get(r)||r;var s=e.getAttribute("icon"),o=e.getAttribute("pressedIcon"),l=e.getAttribute("action"),a=e.getAttribute("mode"),h=e.getAttribute("template"),u="0"!=e.getAttribute("toggle"),p=mxUtils.getTextContent(e),d=null;if(null!=l)d=i.addItem(r,s,l,o);else if(null!=a){var c=mxDefaultToolbarCodec.allowEval?mxUtils.eval(p):null;d=i.addMode(r,s,a,o,c)}else if(null!=h||null!=p&&p.length>0){var m=n.templates[h],g=e.getAttribute("style");null!=m&&null!=g&&(m=n.graph.cloneCell(m)).setStyle(g);var x=null;null!=p&&p.length>0&&mxDefaultToolbarCodec.allowEval&&(x=mxUtils.eval(p)),d=i.addPrototype(r,s,m,o,x,u)}else{var f=mxUtils.getChildNodes(e);if(f.length>0)if(null==s)for(var y=i.addActionCombo(r),v=0;v0&&d.setAttribute("id",L)}}e=e.nextSibling}}return i},t}());return mxDefaultToolbarCodec.allowEval=!0,__mxOutput.mxDefaultToolbarCodec=void 0!==mxDefaultToolbarCodec?mxDefaultToolbarCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(t,e){return null},t.decode=function(t,e,i){var n=e.getElementsByTagName("include")[0];return null!=n?this.processInclude(t,n,i):null!=i&&(i.config=e),i},t}()),__mxOutput.mxDefaultPopupMenuCodec="undefined"!=typeof mxDefaultPopupMenuCodec?mxDefaultPopupMenuCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(t,e,i){var n=e.getAttribute("defaultEdge");null!=n&&(e.removeAttribute("defaultEdge"),i.defaultEdge=i.templates[n]);var r=e.getAttribute("defaultGroup");return null!=r&&(e.removeAttribute("defaultGroup"),i.defaultGroup=i.templates[r]),i},t.decodeChild=function(t,e,i){if("Array"==e.nodeName){var n=e.getAttribute("as");if("templates"==n)return void this.decodeTemplates(t,e,i)}else if("ui"==e.nodeName)return void this.decodeUi(t,e,i);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(t,e,i){for(var n=e.firstChild;null!=n;){if("add"==n.nodeName){var r=n.getAttribute("as"),s=n.getAttribute("element"),o=n.getAttribute("style"),l=null;if(null!=s)null!=(l=document.getElementById(s))&&null!=o&&(l.style.cssText+=";"+o);else{var a=parseInt(n.getAttribute("x")),h=parseInt(n.getAttribute("y")),u=n.getAttribute("width"),p=n.getAttribute("height");(l=document.createElement("div")).style.cssText=o,new mxWindow(mxResources.get(r)||r,l,a,h,u,p,!1,!0).setVisible(!0)}"graph"==r?i.setGraphContainer(l):"toolbar"==r?i.setToolbarContainer(l):"title"==r?i.setTitleContainer(l):"status"==r?i.setStatusContainer(l):"map"==r&&i.setMapContainer(l)}else"resource"==n.nodeName?mxResources.add(n.getAttribute("basename")):"stylesheet"==n.nodeName&&mxClient.link("stylesheet",n.getAttribute("name"));n=n.nextSibling}},t.decodeTemplates=function(t,e,i){null==i.templates&&(i.templates=[]);for(var n=mxUtils.getChildNodes(e),r=0;r{t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_BLOCK_THIN}],[FlowKind.MESSAGE_FLOW,t=>{t[mxgraph.mxConstants.STYLE_DASHED]=!0,t[mxgraph.mxConstants.STYLE_DASH_PATTERN]="8 5",t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_OVAL,t[mxgraph.mxConstants.STYLE_STARTSIZE]=8,t[mxgraph.mxConstants.STYLE_STARTFILL]=!1,t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_BLOCK_THIN,t[mxgraph.mxConstants.STYLE_ENDFILL]=!1}],[FlowKind.ASSOCIATION_FLOW,t=>{t[mxgraph.mxConstants.STYLE_DASHED]=!0,t[mxgraph.mxConstants.STYLE_DASH_PATTERN]="1 2",t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_OPEN_THIN,t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_OPEN_THIN,t[mxgraph.mxConstants.STYLE_STARTSIZE]=12}]]),this.specificSequenceFlowStyles=new Map([[SequenceFlowKind.DEFAULT,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=MarkerIdentifier.ARROW_DASH}],[SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_DIAMOND_THIN,t[mxgraph.mxConstants.STYLE_STARTSIZE]=18,t[mxgraph.mxConstants.STYLE_STARTFILL]=!1}]]),this.specificAssociationFlowStyles=new Map([[AssociationDirectionKind.NONE,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=void 0,t[mxgraph.mxConstants.STYLE_ENDARROW]=void 0,t[mxgraph.mxConstants.STYLE_EDGE]=void 0}],[AssociationDirectionKind.ONE,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=void 0,t[mxgraph.mxConstants.STYLE_EDGE]=void 0}],[AssociationDirectionKind.BOTH,t=>{t[mxgraph.mxConstants.STYLE_EDGE]=void 0}]])}configureStyles(){mxgraph.mxConstants.RECTANGLE_ROUNDING_FACTOR=.1,this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}getDefaultVertexStyle(){return this.getStylesheet().getDefaultVertexStyle()}getDefaultEdgeStyle(){return this.getStylesheet().getDefaultEdgeStyle()}cloneDefaultVertexStyle(){const t=this.getDefaultVertexStyle();return mxgraph.mxUtils.clone(t)}cloneDefaultEdgeStyle(){const t=this.getDefaultEdgeStyle();return mxgraph.mxUtils.clone(t)}putCellStyle(t,e){this.getStylesheet().putCellStyle(t,e)}configureDefaultVertexStyle(){const t=this.getDefaultVertexStyle();this.configureCommonDefaultStyle(t)}configurePoolStyle(){const t=this.cloneDefaultVertexStyle();t[mxgraph.mxConstants.STYLE_SHAPE]=mxgraph.mxConstants.SHAPE_SWIMLANE,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_CENTER,t[mxgraph.mxConstants.STYLE_STARTSIZE]=StyleDefault.POOL_LABEL_SIZE,this.graph.getStylesheet().putCellStyle(ShapeBpmnElementKind.POOL,t)}configureLaneStyle(){const t=this.cloneDefaultVertexStyle();t[mxgraph.mxConstants.STYLE_SHAPE]=mxgraph.mxConstants.SHAPE_SWIMLANE,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_CENTER,t[mxgraph.mxConstants.STYLE_SWIMLANE_LINE]=0,t[mxgraph.mxConstants.STYLE_STARTSIZE]=StyleDefault.LANE_LABEL_SIZE,this.graph.getStylesheet().putCellStyle(ShapeBpmnElementKind.LANE,t)}configureEventStyles(){ShapeUtil.topLevelBpmnEventKinds().forEach(t=>{const e=this.cloneDefaultVertexStyle();e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_PERIMETER]=mxgraph.mxPerimeter.EllipsePerimeter,e[mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_BOTTOM,this.putCellStyle(t,e)})}configureTextAnnotationStyle(){const t=this.cloneDefaultVertexStyle();t[mxgraph.mxConstants.STYLE_SHAPE]=ShapeBpmnElementKind.TEXT_ANNOTATION,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_LEFT,t[mxgraph.mxConstants.STYLE_SPACING_LEFT]=5,this.putCellStyle(ShapeBpmnElementKind.TEXT_ANNOTATION,t)}configureActivityStyles(){ShapeUtil.activityKinds().forEach(t=>{const e=this.cloneDefaultVertexStyle();e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,this.putCellStyle(t,e)})}configureGatewayStyles(){ShapeUtil.gatewayKinds().forEach(t=>{const e=this.cloneDefaultVertexStyle();e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_PERIMETER]=mxgraph.mxPerimeter.RhombusPerimeter,e[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_TOP,e[mxgraph.mxConstants.STYLE_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_LEFT,e[mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_TOP,this.putCellStyle(t,e)})}configureDefaultEdgeStyle(){const t=this.getDefaultEdgeStyle();t[mxgraph.mxConstants.STYLE_EDGE]=mxgraph.mxConstants.EDGESTYLE_SEGMENT,t[mxgraph.mxConstants.STYLE_ENDSIZE]=12,t[mxgraph.mxConstants.STYLE_STROKEWIDTH]=1.5,t[mxgraph.mxConstants.STYLE_ROUNDED]=1,t[mxgraph.mxConstants.STYLE_ARCSIZE]=5,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_BOTTOM,delete t[mxgraph.mxConstants.STYLE_ENDARROW],this.configureCommonDefaultStyle(t)}configureCommonDefaultStyle(t){t[mxgraph.mxConstants.STYLE_FONTFAMILY]=StyleDefault.DEFAULT_FONT_FAMILY,t[mxgraph.mxConstants.STYLE_FONTSIZE]=StyleDefault.DEFAULT_FONT_SIZE,t[mxgraph.mxConstants.STYLE_FONTCOLOR]=StyleDefault.DEFAULT_FONT_COLOR,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=StyleDefault.DEFAULT_FILL_COLOR,t[mxgraph.mxConstants.STYLE_STROKECOLOR]=StyleDefault.DEFAULT_STROKE_COLOR,t[mxgraph.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=mxgraph.mxConstants.NONE,t[mxgraph.mxConstants.STYLE_WHITE_SPACE]="wrap"}configureEdgeStyles(t,e){t.forEach(t=>{const i=this.cloneDefaultEdgeStyle();(e.get(t)||(()=>{}))(i),this.graph.getStylesheet().putCellStyle(t.toString(),i)})}configureSequenceFlowStyles(){this.configureEdgeStyles(Object.values(SequenceFlowKind),this.specificSequenceFlowStyles)}configureAssociationFlowStyles(){this.configureEdgeStyles(Object.values(AssociationDirectionKind),this.specificAssociationFlowStyles)}configureFlowStyles(){this.configureEdgeStyles(Object.values(FlowKind),this.specificFlowStyles),this.configureSequenceFlowStyles(),this.configureAssociationFlowStyles()}computeStyle(t,e){const i=[t.bpmnElement.kind];let n;t instanceof Shape?n=this.computeShapeStyle(t):(i.push(...this.computeEdgeStyle(t)),n=new Map);const r=this.computeFontStyleValues(t),s=this.computeLabelStyleValues(t,e);return[].concat([...i]).concat([...n,...r,...s].filter(([,t])=>t&&"undefined"!=t).map(([t,e])=>t+"="+e)).join(";")}computeShapeStyle(t){const e=new Map,i=t.bpmnElement;if(i instanceof ShapeBpmnEvent)e.set(StyleIdentifier.BPMN_STYLE_EVENT_KIND,i.eventKind),(i instanceof ShapeBpmnBoundaryEvent||i instanceof ShapeBpmnStartEvent&&void 0!==i.isInterrupting)&&e.set(StyleIdentifier.BPMN_STYLE_IS_INTERRUPTING,String(i.isInterrupting));else if(i instanceof ShapeBpmnActivity){i instanceof ShapeBpmnSubProcess?e.set(StyleIdentifier.BPMN_STYLE_SUB_PROCESS_KIND,i.subProcessKind):i.kind===ShapeBpmnElementKind.TASK_RECEIVE&&e.set(StyleIdentifier.BPMN_STYLE_INSTANTIATING,String(i.instantiate));const t=i.markers;t.length>0&&e.set(StyleIdentifier.BPMN_STYLE_MARKERS,t.join(","))}else ShapeUtil.isPoolOrLane(i.kind)?e.set(mxgraph.mxConstants.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):i instanceof ShapeBpmnEventBasedGateway&&(e.set(StyleIdentifier.BPMN_STYLE_INSTANTIATING,String(i.instantiate)),e.set(StyleIdentifier.BPMN_STYLE_EVENT_BASED_GATEWAY_KIND,String(i.gatewayKind)));return e}computeEdgeStyle(t){const e=[],i=t.bpmnElement;return i instanceof SequenceFlow&&e.push(i.sequenceFlowKind),i instanceof AssociationFlow&&e.push(i.associationDirectionKind),e}computeFontStyleValues(t){var e;const i=new Map,n=null===(e=t.label)||void 0===e?void 0:e.font;return n&&(i.set(mxgraph.mxConstants.STYLE_FONTFAMILY,n.name),i.set(mxgraph.mxConstants.STYLE_FONTSIZE,n.size),i.set(mxgraph.mxConstants.STYLE_FONTSTYLE,StyleConfigurator.getFontStyleValue(n))),i}computeLabelStyleValues(t,e){const i=new Map,n=t.bpmnElement;return e?(i.set(mxgraph.mxConstants.STYLE_VERTICAL_ALIGN,mxgraph.mxConstants.ALIGN_TOP),t.bpmnElement.kind!=ShapeBpmnElementKind.TEXT_ANNOTATION&&i.set(mxgraph.mxConstants.STYLE_ALIGN,mxgraph.mxConstants.ALIGN_CENTER),t instanceof Shape&&(i.set(mxgraph.mxConstants.STYLE_LABEL_WIDTH,e.width+1),i.set(mxgraph.mxConstants.STYLE_LABEL_POSITION,mxgraph.mxConstants.ALIGN_TOP),i.set(mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxgraph.mxConstants.ALIGN_LEFT))):t instanceof Shape&&(n instanceof ShapeBpmnSubProcess||n instanceof ShapeBpmnCallActivity)&&!n.markers.includes(ShapeBpmnMarkerKind.EXPAND)&&i.set(mxgraph.mxConstants.STYLE_VERTICAL_ALIGN,mxgraph.mxConstants.ALIGN_TOP),i}computeMessageFlowIconStyle(t){return`shape=${StyleIdentifier.BPMN_STYLE_MESSAGE_FLOW_ICON};${StyleIdentifier.BPMN_STYLE_IS_INITIATING}=${t.messageVisibleKind}`}static getFontStyleValue(t){let e=0;return t.isBold&&(e+=mxgraph.mxConstants.FONT_BOLD),t.isItalic&&(e+=mxgraph.mxConstants.FONT_ITALIC),t.isStrikeThrough&&(e+=mxgraph.mxConstants.FONT_STRIKETHROUGH),t.isUnderline&&(e+=mxgraph.mxConstants.FONT_UNDERLINE),e}}function computeScaledIconSize(t,e,i,n){let r,s;t.heightt.setIconOriginForIconCentered(),shape:{x:e,y:i,w:n,h:r,strokeWidth:s.strokewidth||StyleUtils.getStrokeWidth(s.style)},icon:{isFilled:l,fillColor:s.fill||StyleUtils.getFillColor(s.style),strokeColor:s.stroke||StyleUtils.getStrokeColor(s.style),strokeWidth:a,margin:StyleUtils.getMargin(s.style)}}}class IconPainter{paintEmptyIcon(){}newBpmnCanvas({c:t,ratioFromParent:e,setIconOrigin:i,shape:n,icon:r},s){return new BpmnCanvas({mxCanvas:t,shapeConfiguration:n,iconConfiguration:{originalSize:s,style:r,ratioFromShape:e,setIconOrigin:i}})}paintEnvelopeIcon(t){const e={width:485.41,height:321.76},i=this.newBpmnCanvas(t,e),n=e.width,r=e.height;i.rect(0,0,n,r),i.fillAndStroke();const{icon:s}=t;s.isFilled&&i.setStrokeColor(s.fillColor),i.begin(),i.moveTo(0,0),i.lineTo(.5*n,.6*r),i.lineTo(n,0),i.moveTo(0,r),i.lineTo(n/3,.45*r),i.moveTo(n,r),i.lineTo(2*n/3,.45*r),i.stroke()}paintCircleIcon(t){const e={width:t.shape.w,height:t.shape.h},i=this.newBpmnCanvas(t,e),n=e.width,r=e.height;n>0&&r>0&&i.ellipse(0,0,n,r),t.icon.isFilled?i.fillAndStroke():i.stroke()}paintClockIcon(t){const e=this.newBpmnCanvas(t,{height:152,width:152});e.begin(),e.moveTo(184,60),e.curveTo(188.4,60,192,56.4,192,52),e.lineTo(192,48),e.curveTo(192,40,188.4,40,184,40),e.curveTo(179.6,40,176,43.6,176,48),e.lineTo(176,52),e.curveTo(176,56.4,179.6,60,184,60),e.close(),e.moveTo(184,308),e.curveTo(179.6,308,176,311.6,176,316),e.lineTo(176,320),e.curveTo(176,324.4,179.6,328,184,328),e.curveTo(188.4,328,192,324.4,192,320),e.lineTo(192,316),e.curveTo(192,311.6,188.4,308,184,308),e.close(),e.moveTo(52,176),e.lineTo(48,176),e.curveTo(43.6,176,40,179.6,40,184),e.curveTo(40,188.4,43.6,192,48,192),e.lineTo(52,192),e.curveTo(56.4,192,69,188.4,60,184),e.curveTo(60,179.6,56.4,176,52,176),e.close(),e.moveTo(320,176),e.lineTo(316,176),e.curveTo(311.6,176,308,179.6,308,184),e.curveTo(308,188.4,311.6,192,316,192),e.lineTo(320,192),e.curveTo(324.4,192,328,188.4,328,184),e.curveTo(328,179.6,324.4,176,320,176),e.moveTo(93.6,82.4),e.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),e.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),e.lineTo(85.2,96.4),e.curveTo(86.8,98,88.8,98.8,90.8,98.8),e.curveTo(92.8,98.8,94.4,98,96.4,96.4),e.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),e.lineTo(93.6,82.4),e.moveTo(85.2,271.6),e.lineTo(82.4,274.4),e.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),e.curveTo(84,287.2,86,288,88,288),e.curveTo(90,288,92,287.2,93.6,285.6),e.lineTo(96.4,282.8),e.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),e.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),e.moveTo(274.4,82.4),e.lineTo(271.6,85.2),e.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),e.curveTo(273.298,98,275.2,98.8,277.2,98.8),e.curveTo(279.2,98.8,281.2,98,282.8,96.4),e.lineTo(285.6,93.6),e.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),e.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),e.moveTo(192,180.8),e.lineTo(192,108),e.curveTo(192,103.6,188.4,100,184,100),e.curveTo(179.6,100,176,103.6,176,108),e.lineTo(176,184),e.curveTo(176,186,176.8,188,178.4,189.6),e.lineTo(266,277.2),e.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),e.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),e.curveTo(280.4,274,280.4,269.2,277.2,266),e.lineTo(192,180.8),e.moveTo(184,0),e.curveTo(82.4,0,0,82.4,0,184),e.curveTo(0,285.6,82.4,368,184,368),e.curveTo(285.6,368,368,285.6,368,184),e.curveTo(368,82.4,285.6,0,184,0),e.moveTo(184,352),e.curveTo(91.2,352,16,276.8,16,184),e.curveTo(16,91.2,91.2,16,184,16),e.curveTo(276.8,16,352,91.2,352,184),e.curveTo(352,276.8,276.8,352,184,352),e.fillAndStroke()}paintTriangleIcon(t){const e=this.newBpmnCanvas(t,{height:735,width:849});e.begin(),e.moveTo(497,55),e.lineTo(817,609),e.curveTo(849,665,808,735,744,735),e.lineTo(105,735),e.curveTo(40,735,0,665,32,609),e.lineTo(352,55),e.curveTo(384,0,465,0,497,55),e.close(),e.fillAndStroke()}paintUpArrowheadIcon(t){const e=this.newBpmnCanvas(t,{height:50,width:40});e.begin(),e.moveTo(0,49.5),e.lineTo(19.5,1),e.curveTo(19.75,.25,20,0,20.25,.25),e.lineTo(40,49.5),e.curveTo(40,49.5,39.75,50,39.6,49.75),e.lineTo(20,30),e.lineTo(.4,49.75),e.curveTo(.4,49.75,.25,50,0,49.5),e.close(),e.fillAndStroke()}paintDoubleLeftArrowheadsIcon(t){const e=this.newBpmnCanvas(t,{height:53.5,width:105});e.begin(),e.moveTo(91.4,0),e.curveTo(91.4,0,91.2,0,91,.2),e.lineTo(50,25),e.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),e.lineTo(46.4,0),e.curveTo(46.4,0,46.2,0,46,.2),e.lineTo(4.9,25),e.curveTo(2,26.2,0,27.3,4.9,28.5),e.lineTo(45.8,53),e.curveTo(46,53.3,46.2,53.5,46.4,53.5),e.lineTo(46.4,27),e.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),e.lineTo(90.8,53.3),e.curveTo(91,53.3,91.2,53.5,91.4,53.5),e.lineTo(91.4,0),e.close(),e.fillAndStroke()}drawCrossIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});return e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,.38),e.lineTo(1,.38),e.lineTo(1,.62),e.lineTo(.62,.62),e.lineTo(.62,1),e.lineTo(.38,1),e.lineTo(.38,.62),e.lineTo(0,.62),e.lineTo(0,.38),e.lineTo(.38,.38),e.close(),e}paintListIcon(t){const e=this.newBpmnCanvas(t,{height:60,width:60});e.begin(),e.moveTo(0,0),e.lineTo(60,0),e.lineTo(60,60),e.lineTo(0,60),e.lineTo(0,0),e.close(),e.moveTo(5,5),e.lineTo(55,5),e.close(),e.moveTo(5,21.6),e.lineTo(55,21.6),e.close(),e.moveTo(5,38.3),e.lineTo(55,38.3),e.close(),e.moveTo(5,55),e.lineTo(55,55),e.close(),e.fillAndStroke()}paintXCrossIcon(t){const e=this.drawCrossIcon(t);e.rotateOnIconCenter(45),e.fillAndStroke()}paintPlusCrossIcon(t){this.drawCrossIcon(t).fillAndStroke()}paintPersonIcon(t){const e=this.newBpmnCanvas(Object.assign(Object.assign({},t),{icon:Object.assign(Object.assign({},t.icon),{isFilled:!0})}),{height:239.68,width:143.61});e.begin(),e.moveTo(124.31,150.29),e.lineTo(99.66,141.03),e.arcTo(6.43,6.43,0,0,1,95.51,135.03),e.lineTo(95.51,130.66),e.arcTo(47.75,47.75,0,0,0,119.51,89.25),e.lineTo(119.51,71.25),e.arcTo(47.62,47.62,0,0,0,101.18,33.64),e.arcTo(29.35,29.35,0,0,0,101.52,29.14),e.arcTo(29.68,29.68,0,0,0,42.17,29.14),e.arcTo(29.24,29.24,0,0,0,42.53,33.63),e.arcTo(47.65,47.65,0,0,0,24.14,71.23),e.lineTo(24.14,89.23),e.arcTo(47.7,47.7,0,0,0,48.19,130.63),e.lineTo(48.19,135.03),e.arcTo(6.43,6.43,0,0,1,44.03,141.03),e.lineTo(19.31,150.29),e.arcTo(29.81,29.81,0,0,0,.09,178.03),e.lineTo(.09,233.51),e.arcTo(5.63,5.63,0,1,0,11.34,233.51),e.lineTo(11.34,178.03),e.arcTo(18.19,18.19,0,0,1,11.57,175.17),e.lineTo(20.5,184.11),e.arcTo(12.32,12.32,0,0,1,24.14,192.89),e.lineTo(24.14,233.51),e.arcTo(5.63,5.63,0,1,0,35.39,233.51),e.lineTo(35.39,192.93),e.arcTo(23.5,23.5,0,0,0,28.46,176.2),e.lineTo(17.04,164.78),e.arcTo(18.34,18.34,0,0,1,23.29,160.78),e.lineTo(43.65,153.15),e.lineTo(66.22,175.72),e.lineTo(66.22,233.51),e.arcTo(5.63,5.63,0,1,0,77.47,233.51),e.lineTo(77.47,175.76),e.lineTo(100.04,153.19),e.lineTo(120.4,160.82),e.arcTo(18.39,18.39,0,0,1,126.65,164.82),e.lineTo(115.24,176.24),e.arcTo(23.5,23.5,0,0,0,108.31,192.93),e.lineTo(108.31,233.55),e.arcTo(5.63,5.63,0,1,0,119.56,233.55),e.lineTo(119.56,192.93),e.arcTo(12.35,12.35,0,0,1,123.19,184.15),e.lineTo(132.13,175.22),e.arcTo(18,18,0,0,1,132.36,178.08),e.lineTo(132.36,233.56),e.arcTo(5.63,5.63,0,0,0,143.61,233.56),e.lineTo(143.61,178.03),e.arcTo(29.81,29.81,0,0,0,124.31,150.29),e.close(),e.moveTo(71.85,10.72),e.arcTo(18.46,18.46,0,0,1,90.17,27.18),e.arcTo(47.68,47.68,0,0,0,53.53,27.18),e.arcTo(18.44,18.44,0,0,1,71.85,10.72),e.close(),e.moveTo(35.39,71.23),e.arcTo(36.46,36.46,0,0,1,108.31,71.23),e.lineTo(108.31,77.4),e.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),e.arcTo(5.62,5.62,0,0,0,48.78,62.71),e.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),e.close(),e.moveTo(35.39,89.23),e.lineTo(35.39,87.08),e.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),e.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),e.lineTo(108.31,89.24),e.arcTo(36.46,36.46,0,1,1,35.39,89.24),e.close(),e.moveTo(71.85,165.45),e.lineTo(54.06,147.69),e.arcTo(17.7,17.7,0,0,0,59.43,135.32),e.arcTo(47.57,47.57,0,0,0,84.27,135.32),e.arcTo(17.7,17.7,0,0,0,89.64,147.69),e.close(),e.fill()}paintGearIcon(t){const e=this.newBpmnCanvas(t,{height:100,width:100});IconPainter.paintGearIconBackground(e),e.translateIconOrigin(14,14),IconPainter.paintGearIconForeground(e)}static paintGearIconBackground(t){t.begin(),t.moveTo(2.06,24.62),t.lineTo(10.17,30.95),t.lineTo(9.29,37.73),t.lineTo(0,41.42),t.lineTo(2.95,54.24),t.lineTo(13.41,52.92),t.lineTo(17.39,58.52),t.lineTo(13.56,67.66),t.lineTo(24.47,74.44),t.lineTo(30.81,66.33),t.lineTo(37.88,67.21),t.lineTo(41.57,76.5),t.lineTo(54.24,73.55),t.lineTo(53.06,62.94),t.lineTo(58.52,58.52),t.lineTo(67.21,63.09),t.lineTo(74.58,51.88),t.lineTo(66.03,45.25),t.lineTo(66.92,38.62),t.lineTo(76.5,34.93),t.lineTo(73.7,22.26),t.lineTo(62.64,23.44),t.lineTo(58.81,18.42),t.lineTo(62.79,8.7),t.lineTo(51.74,2.21),t.lineTo(44.81,10.47),t.lineTo(38.03,9.43),t.lineTo(33.75,0),t.lineTo(21.52,3.24),t.lineTo(22.7,13.56),t.lineTo(18.13,17.54),t.lineTo(8.7,13.56),t.close();IconPainter.paintGearInnerCircle(t,24.8,39)}static paintGearIconForeground(t){t.begin(),t.moveTo(16.46,41.42),t.lineTo(24.57,47.75),t.lineTo(23.69,54.53),t.lineTo(14.4,58.22),t.lineTo(17.35,71.04),t.lineTo(27.81,69.72),t.lineTo(31.79,75.32),t.lineTo(27.96,84.46),t.lineTo(38.87,91.24),t.lineTo(45.21,83.13),t.lineTo(52.28,84.01),t.lineTo(55.97,93.3),t.lineTo(68.64,90.35),t.lineTo(67.46,79.74),t.lineTo(72.92,75.32),t.lineTo(81.61,79.89),t.lineTo(88.98,68.68),t.lineTo(80.43,62.05),t.lineTo(81.32,55.42),t.lineTo(90.9,51.73),t.lineTo(88.1,39.06),t.lineTo(77.04,40.24),t.lineTo(73.21,35.22),t.lineTo(77.19,25.5),t.lineTo(66.14,19.01),t.lineTo(59.21,27.27),t.lineTo(52.43,26.23),t.lineTo(48.15,16.8),t.lineTo(35.92,20.04),t.lineTo(37.1,30.36),t.lineTo(32.53,34.34),t.lineTo(23.1,30.36),t.close();IconPainter.paintGearInnerCircle(t,39.2,55.8),t.begin(),IconPainter.paintGearInnerCircle(t,39.2,55.8)}static paintGearInnerCircle(t,e,i){const n=13.5;t.moveTo(e,i),t.arcTo(n,n,0,1,1,e+27,i),t.arcTo(n,n,0,0,1,e,i),t.close(),t.fillAndStroke()}paintExpandIcon(t){const e={width:16,height:16},i=this.newBpmnCanvas(t,e),n=e.width,r=e.height;i.roundrect(0,0,n,r,2,2),i.stroke(),i.begin(),i.moveTo(n/2,r/4),i.lineTo(n/2,3*r/4),i.close(),i.moveTo(n/4,r/2),i.lineTo(3*n/4,r/2),i.close(),i.fillAndStroke()}paintLoopIcon(t){const{icon:e}=t;e.fillColor=e.strokeColor;const i=this.newBpmnCanvas(t,{width:22.49,height:21.62});i.begin(),i.moveTo(5.5,19.08),i.arcTo(8,8,0,1,1,10.5,21.08),i.stroke(),i.begin(),i.moveTo(7.5,14.08),i.lineTo(5.75,19.08),i.lineTo(0,17.08),i.close(),i.fillAndStroke()}paintSequentialMultiInstanceIcon(t){const e={width:16,height:16},i=this.newBpmnCanvas(t,e),{c:n,icon:r}=t;n.setFillColor(r.strokeColor);const s=e.width,o=e.height/5;i.rect(0,0,s,o),i.fill(),i.rect(0,2*o,s,o),i.fill(),i.rect(0,4*o,s,o),i.fill()}paintParallelMultiInstanceIcon(t){const e={width:16,height:16},i=this.newBpmnCanvas(t,e),{c:n,icon:r}=t;n.setFillColor(r.strokeColor);const s=e.width/5,o=e.height;i.begin(),i.rect(0,0,s,o),i.fill(),i.rect(2*s,0,s,o),i.fill(),i.rect(4*s,0,s,o),i.fill()}paintRightArrowIcon(t){const e=this.newBpmnCanvas(t,{width:512,height:415.23});e.setRoundLineJoin(),e.begin(),e.moveTo(512,207.61),e.lineTo(304.38,0),e.lineTo(304.38,135.39),e.lineTo(0,135.39),e.lineTo(0,279.84),e.lineTo(304.38,279.84),e.lineTo(304.38,415.23),e.lineTo(512,207.61),e.close(),e.fillAndStroke()}paintErrorIcon(t){const e=this.newBpmnCanvas(t,{width:72.44,height:71.82});e.begin(),e.moveTo(0,53.32),e.lineTo(19.48,0),e.lineTo(19.48,0),e.lineTo(50.85,40.07),e.lineTo(72.44,18.21),e.lineTo(53.12,71.82),e.lineTo(22.5,31.37),e.close(),e.fillAndStroke()}paintHandIcon(t){const e=this.newBpmnCanvas(t,{width:343.65,height:354.12});e.begin(),e.moveTo(231.66,336.39),e.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),e.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),e.lineTo(146.33,248.39),e.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),e.curveTo(275.75,283.38,297.25,288,301.42,267.77),e.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),e.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),e.lineTo(165.2,194.8),e.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),e.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),e.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),e.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),e.lineTo(169.35,138.97),e.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),e.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),e.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),e.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),e.lineTo(127.61,81.87),e.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),e.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),e.curveTo(143.83,0,124.08,14.49,124.08,14.49),e.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),e.lineTo(0,251.94),e.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),e.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),e.fillAndStroke()}paintScriptIcon(t){t.icon.fillColor=t.icon.strokeColor;const e=this.newBpmnCanvas(t,{width:458.75,height:461.64});e.begin(),e.moveTo(67.85,.57),e.curveTo(50.73,0,33.26,8.86,22.35,18.84),e.curveTo(8.11,32.15,0,50.77,0,70.26),e.curveTo(0,73.15,0,87.59,0,113.6),e.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),e.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),e.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),e.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),e.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),e.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),e.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),e.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),e.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),e.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),e.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),e.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),e.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),e.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),e.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),e.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),e.curveTo(389.09,14.11,366.95,.59,341.75,.59),e.curveTo(286.97,.59,122.63,.57,67.85,.57),e.close(),e.moveTo(85.04,72.68),e.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),e.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),e.curveTo(55.8,44.28,59.84,41,73.82,41),e.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),e.close(),e.moveTo(364.94,52.9),e.curveTo(370,61.11,373.9,76.44,377.38,93.51),e.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),e.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),e.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),e.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),e.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),e.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),e.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),e.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),e.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),e.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),e.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),e.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),e.close(),e.moveTo(409.96,399.48),e.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),e.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),e.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),e.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),e.close(),e.fill(),e.begin(),e.moveTo(182.1,131.2),e.lineTo(182.1,151.68),e.lineTo(321.89,151.68),e.lineTo(321.89,131.2),e.lineTo(182.1,131.2),e.close(),e.moveTo(162.25,251.09),e.lineTo(162.25,271.49),e.lineTo(301.96,271.49),e.lineTo(301.96,251.09),e.lineTo(162.25,251.09),e.close(),e.fill()}paintTableIcon(t){const e=this.newBpmnCanvas(t,{width:640,height:640});e.begin(),e.moveTo(.19,.1),e.lineTo(298.78,.1),e.lineTo(298.78,198.88),e.lineTo(.19,198.88),e.lineTo(.19,.1),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,48.88),e.lineTo(98.78,48.88),e.lineTo(98.78,198.88),e.lineTo(0,198.88),e.lineTo(0,48.88),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(1.09,122.69),e.lineTo(298.78,122.69),e.close(),e.fillAndStroke(),e.setFillColor(t.icon.strokeColor),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke()}paintPentagon(t){const e=this.newBpmnCanvas(t,{width:16,height:16});e.begin(),e.moveTo(16,6.5),e.lineTo(8,0),e.lineTo(0,6.5),e.lineTo(3,16),e.lineTo(13,16),e.lineTo(16,6.5),e.lineTo(8,0),e.stroke()}}class IconPainterProvider{static get(){return this.instance}static set(t){this.instance=t}}IconPainterProvider.instance=new IconPainter;class EventShape extends mxgraph.mxEllipse{constructor(t,e,i,n){super(t,e,i,n),this.iconPainter=IconPainterProvider.get(),this.iconPainters=new Map([[ShapeBpmnEventKind.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},t),{ratioFromParent:.5}))],[ShapeBpmnEventKind.TERMINATE,t=>this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6}))],[ShapeBpmnEventKind.TIMER,t=>this.iconPainter.paintClockIcon(Object.assign(Object.assign({},t),{setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(5)}))],[ShapeBpmnEventKind.SIGNAL,t=>this.iconPainter.paintTriangleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:StyleDefault.STROKE_WIDTH_THIN.valueOf()}),setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(4)}))],[ShapeBpmnEventKind.LINK,t=>this.iconPainter.paintRightArrowIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:1.5})}))],[ShapeBpmnEventKind.ERROR,t=>this.iconPainter.paintErrorIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:1.5})}))],[ShapeBpmnEventKind.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon(Object.assign(Object.assign({},t),{ratioFromParent:.7,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:1.5})}))],[ShapeBpmnEventKind.CANCEL,t=>this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},t),{ratioFromParent:.78}))],[ShapeBpmnEventKind.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:StyleDefault.STROKE_WIDTH_THIN.valueOf()})}))],[ShapeBpmnEventKind.CONDITIONAL,t=>this.iconPainter.paintListIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:1.5})}))]]),this.withFilledIcon=!1}paintVertexShape(t,e,i,n,r){this.markNonFullyRenderedEvents(t);const s=buildPaintParameter(t,e,i,n,r,this,.25,this.withFilledIcon);EventShape.setDashedOuterShapePattern(s,StyleUtils.getBpmnIsInterrupting(this.style)),this.paintOuterShape(s),EventShape.restoreOriginalOuterShapePattern(s),this.paintInnerShape(s)}markNonFullyRenderedEvents(t){}paintOuterShape({c:t,shape:{x:e,y:i,w:n,h:r}}){super.paintVertexShape(t,e,i,n,r)}paintInnerShape(t){(this.iconPainters.get(StyleUtils.getBpmnEventKind(this.style))||(()=>this.iconPainter.paintEmptyIcon()))(t)}static setDashedOuterShapePattern(t,e){t.c.save(),"false"===e&&(t.c.setDashed(!0,!1),t.c.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.c.restore()}}class StartEventShape extends EventShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}}class EndEventShape extends EventShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THICK){super(t,e,i,n),this.withFilledIcon=!0}}class IntermediateEventShape extends EventShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}paintOuterShape({c:t,shape:{x:e,y:i,w:n,h:r,strokeWidth:s}}){t.ellipse(e,i,n,r),t.fillAndStroke();const o=1.5*s;t.ellipse(.02*n+o+e,.02*r+o+i,.96*n-2*o,.96*r-2*o),t.stroke()}}class CatchIntermediateEventShape extends IntermediateEventShape{constructor(t,e,i,n){super(t,e,i,n)}}class ThrowIntermediateEventShape extends IntermediateEventShape{constructor(t,e,i,n){super(t,e,i,n),this.withFilledIcon=!0}}class BoundaryEventShape extends IntermediateEventShape{constructor(t,e,i,n){super(t,e,i,n)}}class GatewayShape extends mxgraph.mxRhombus{constructor(t,e,i,n){super(t,e,i,n),this.iconPainter=IconPainterProvider.get()}paintVertexShape(t,e,i,n,r){const s=buildPaintParameter(t,e,i,n,r,this);this.paintOuterShape(s),this.paintInnerShape(s)}paintOuterShape({c:t,shape:{x:e,y:i,w:n,h:r}}){super.paintVertexShape(t,e,i,n,r)}}class ExclusiveGatewayShape extends GatewayShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}paintInnerShape(t){this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},t),{icon:Object.assign(Object.assign({},t.icon),{isFilled:!0}),ratioFromParent:.5}))}}class ParallelGatewayShape extends GatewayShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}paintInnerShape(t){this.iconPainter.paintPlusCrossIcon(Object.assign(Object.assign({},t),{icon:Object.assign(Object.assign({},t.icon),{isFilled:!0}),ratioFromParent:.5}))}}class InclusiveGatewayShape extends GatewayShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}paintInnerShape(t){this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.62,icon:Object.assign(Object.assign({},t.icon),{isFilled:!1,strokeWidth:StyleDefault.STROKE_WIDTH_THICK.valueOf()})}))}}class EventBasedGatewayShape extends GatewayShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}paintInnerShape(t){t=Object.assign(Object.assign({},t),{icon:Object.assign(Object.assign({},t.icon),{strokeWidth:1})}),this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55})),StyleUtils.getBpmnIsInstantiating(this.style)||this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.45}));const e=Object.assign(Object.assign({},t),{ratioFromParent:.3});StyleUtils.getBpmnIsParallelEventBasedGateway(this.style)?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}const referenceOrderedMarkers=[ShapeBpmnMarkerKind.LOOP,ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL,ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL,ShapeBpmnMarkerKind.COMPENSATION,ShapeBpmnMarkerKind.EXPAND,ShapeBpmnMarkerKind.ADHOC];function orderActivityMarkers(t){const e=[];return referenceOrderedMarkers.forEach(i=>{t.includes(i)&&e.push(i)}),t.filter(t=>!e.includes(t)).forEach(t=>{e.push(t)}),e}function paintEnvelopeIcon(t,e){IconPainterProvider.get().paintEnvelopeIcon(Object.assign(Object.assign({},t),{setIconOrigin:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,icon:Object.assign(Object.assign({},t.icon),{isFilled:e})}))}class BaseActivityShape extends mxgraph.mxRectangleShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n),this.iconPainter=IconPainterProvider.get(),this.isRounded=!0}paintForeground(t,e,i,n,r){super.paintForeground(t,e,i,n,r),this.paintMarkerIcons(buildPaintParameter(t,e,i,n,r,this,0,!1,1.5))}paintMarkerIcons(t){const e=StyleUtils.getBpmnMarkers(this.style);e&&orderActivityMarkers(e.split(",")).forEach((e,i,n)=>{switch((t=Object.assign(Object.assign({},t),{setIconOrigin:this.getIconOriginForMarkerIcon(n.length,i+1)})).c.save(),e){case ShapeBpmnMarkerKind.LOOP:this.iconPainter.paintLoopIcon(t);break;case ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(t);break;case ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(t);break;case ShapeBpmnMarkerKind.EXPAND:this.iconPainter.paintExpandIcon(t)}t.c.restore()})}getIconOriginForMarkerIcon(t,e){let i;if(1===t)i=t=>t.setIconOriginForIconBottomCentered();else{if(2!==t)throw new Error("NOT_IMPLEMENTED - to have a group of >2 markers in a row, centered in the task, implement this piece of code");i=t=>{t.setIconOriginForIconBottomCentered();const i=Math.pow(-1,e)*(StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);t.translateIconOrigin(i,0)}}return i}}class BaseTaskShape extends BaseActivityShape{constructor(t,e,i,n){super(t,e,i,n)}paintForeground(t,e,i,n,r){super.paintForeground(t,e,i,n,r),this.paintTaskIcon(buildPaintParameter(t,e,i,n,r,this))}}class TaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintEmptyIcon()}}class ServiceTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintGearIcon(Object.assign(Object.assign({},t),{setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class UserTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},t),{setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class ReceiveTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){if(!StyleUtils.getBpmnIsInstantiating(this.style))return void paintEnvelopeIcon(t,!1);const e=Object.assign(Object.assign({},t.shape),{w:20,h:20});this.iconPainter.paintCircleIcon({c:t.c,shape:e,icon:Object.assign(Object.assign({},t.icon),{isFilled:!1}),ratioFromParent:void 0,setIconOrigin:t=>t.setIconOriginToShapeTopLeft(4,4)}),e.x+=4,e.y+=4,this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},t),{shape:e,ratioFromParent:.65,setIconOrigin:t=>t.setIconOriginForIconCentered()}))}}class SendTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){paintEnvelopeIcon(t,!0)}}class ManualTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintHandIcon(Object.assign(Object.assign({},t),{ratioFromParent:.18,setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class ScriptTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},t),{ratioFromParent:.22,setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class CallActivityShape extends BaseActivityShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THICK){super(t,e,i,n)}}class SubProcessShape extends BaseActivityShape{constructor(t,e,i,n){super(t,e,i,n)}paintBackground(t,e,i,n,r){const s=StyleUtils.getBpmnSubProcessKind(this.style);t.save(),s===ShapeBpmnSubProcessKind.EVENT&&(t.setDashed(!0,!1),t.setDashPattern("1 2")),super.paintBackground(t,e,i,n,r),t.restore()}}class BusinessRuleTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintTableIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6,setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(15)}))}}class TextAnnotationShape extends mxgraph.mxRectangleShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n),this.TEXT_ANNOTATION_BORDER_LENGTH=10}paintBackground(t,e,i,n,r){t.begin(),t.moveTo(e+this.TEXT_ANNOTATION_BORDER_LENGTH,i),t.lineTo(e,i),t.lineTo(e,i+r),t.lineTo(e+this.TEXT_ANNOTATION_BORDER_LENGTH,i+r),t.fillAndStroke()}}var MessageVisibleKind,FitType;!function(t){t.NONE="none",t.INITIATING="initiating",t.NON_INITIATING="non_initiating"}(MessageVisibleKind||(MessageVisibleKind={}));class MessageFlowIconShape extends mxgraph.mxRectangleShape{constructor(t,e,i,n){super(t,e,i,n),this.iconPainter=IconPainterProvider.get()}paintVertexShape(t,e,i,n,r){const s=buildPaintParameter(t,e,i,n,r,this,1,StyleUtils.getBpmnIsInitiating(this.style)===MessageVisibleKind.NON_INITIATING);this.iconPainter.paintEnvelopeIcon(s)}}function computeAllBpmnClassNames(t,e){const i=[];return i.push(computeBpmnBaseClassName(t)),e&&i.push("bpmn-label"),i}function computeBpmnBaseClassName(t){return t?"bpmn-"+t.replace(/([A-Z])/g,t=>"-"+t[0].toLowerCase()):""}function extractBpmnKindFromStyle(t){return t.style.split(";")[0]}class ShapeConfigurator{configureShapes(){this.initMxShapePrototype(),this.registerShapes()}registerShapes(){mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.EVENT_END,EndEventShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.EVENT_START,StartEventShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW,ThrowIntermediateEventShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH,CatchIntermediateEventShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.EVENT_BOUNDARY,BoundaryEventShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.GATEWAY_EVENT_BASED,EventBasedGatewayShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,ExclusiveGatewayShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.GATEWAY_INCLUSIVE,InclusiveGatewayShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.GATEWAY_PARALLEL,ParallelGatewayShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.SUB_PROCESS,SubProcessShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.CALL_ACTIVITY,CallActivityShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK,TaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_SERVICE,ServiceTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_USER,UserTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_RECEIVE,ReceiveTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_SEND,SendTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_MANUAL,ManualTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_SCRIPT,ScriptTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_BUSINESS_RULE,BusinessRuleTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TEXT_ANNOTATION,TextAnnotationShape),mxgraph.mxCellRenderer.registerShape(StyleIdentifier.BPMN_STYLE_MESSAGE_FLOW_ICON,MessageFlowIconShape)}initMxShapePrototype(){mxgraph.mxShape.prototype.createSvgCanvas=function(){const t=new mxgraph.mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;const e=this.getSvgScreenOffset();if(0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),this.state&&this.state.cell){let t=computeAllBpmnClassNames(extractBpmnKindFromStyle(this.state.cell),this.dialect===mxgraph.mxConstants.DIALECT_STRICTHTML);const e=this.state.style[StyleIdentifier.BPMN_STYLE_EXTRA_CSS_CLASSES];e&&(t=t.concat(e)),this.node.setAttribute("class",t.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t}}}class MarkerConfigurator{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){mxgraph.mxMarker.addMarker(MarkerIdentifier.ARROW_DASH,(t,e,i,n,r,s,o,l,a)=>{const h=r*(o+a+4),u=s*(o+a+4);return function(){t.begin(),t.moveTo(n.x-h/2-u/2,n.y-u/2+h/2),t.lineTo(n.x+u/2-3*h/2,n.y-3*u/2-h/2),t.stroke()}})}}function ensureInRange(t,e,i,n){let r=null==t?n:t;return r=Math.min(Math.max(r,e),i),r}function ensurePositiveValue(t){return Math.max(t||0,0)}function ensureValidZoomConfiguration(t){const e=null!=t?t:{};return e.debounceDelay=ensureInRange(e.debounceDelay,0,100,50),e.throttleDelay=ensureInRange(e.throttleDelay,0,100,50),e}!function(t){t.None="None",t.HorizontalVertical="HorizontalVertical",t.Horizontal="Horizontal",t.Vertical="Vertical",t.Center="Center"}(FitType||(FitType={}));var FUNC_ERROR_TEXT$1="Expected a function",NAN$1=NaN,symbolTag$1="[object Symbol]",reTrim$1=/^\s+|\s+$/g,reIsBadHex$1=/^[-+]0x[0-9a-f]+$/i,reIsBinary$1=/^0b[01]+$/i,reIsOctal$1=/^0o[0-7]+$/i,freeParseInt$1=parseInt,freeGlobal$1="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf$1="object"==typeof self&&self&&self.Object===Object&&self,root$1=freeGlobal$1||freeSelf$1||Function("return this")(),objectProto$1=Object.prototype,objectToString$1=objectProto$1.toString,nativeMax$1=Math.max,nativeMin$1=Math.min,now$1=function(){return root$1.Date.now()};function debounce$1(t,e,i){var n,r,s,o,l,a,h=0,u=!1,p=!1,d=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT$1);function c(e){var i=n,s=r;return n=r=void 0,h=e,o=t.apply(s,i)}function m(t){return h=t,l=setTimeout(x,e),u?c(t):o}function g(t){var i=t-a;return void 0===a||i>=e||i<0||p&&t-h>=s}function x(){var t=now$1();if(g(t))return f(t);l=setTimeout(x,function(t){var i=e-(t-a);return p?nativeMin$1(i,s-(t-h)):i}(t))}function f(t){return l=void 0,d&&n?c(t):(n=r=void 0,o)}function y(){var t=now$1(),i=g(t);if(n=arguments,r=this,a=t,i){if(void 0===l)return m(a);if(p)return l=setTimeout(x,e),c(a)}return void 0===l&&(l=setTimeout(x,e)),o}return e=toNumber$1(e)||0,isObject$1(i)&&(u=!!i.leading,s=(p="maxWait"in i)?nativeMax$1(toNumber$1(i.maxWait)||0,e):s,d="trailing"in i?!!i.trailing:d),y.cancel=function(){void 0!==l&&clearTimeout(l),h=0,n=a=r=l=void 0},y.flush=function(){return void 0===l?o:f(now$1())},y}function isObject$1(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function isObjectLike$1(t){return!!t&&"object"==typeof t}function isSymbol$1(t){return"symbol"==typeof t||isObjectLike$1(t)&&objectToString$1.call(t)==symbolTag$1}function toNumber$1(t){if("number"==typeof t)return t;if(isSymbol$1(t))return NAN$1;if(isObject$1(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=isObject$1(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(reTrim$1,"");var i=reIsBinary$1.test(t);return i||reIsOctal$1.test(t)?freeParseInt$1(t.slice(2),i?2:8):reIsBadHex$1.test(t)?NAN$1:+t}var lodash_debounce=debounce$1,FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};function debounce(t,e,i){var n,r,s,o,l,a,h=0,u=!1,p=!1,d=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);function c(e){var i=n,s=r;return n=r=void 0,h=e,o=t.apply(s,i)}function m(t){return h=t,l=setTimeout(x,e),u?c(t):o}function g(t){var i=t-a;return void 0===a||i>=e||i<0||p&&t-h>=s}function x(){var t=now();if(g(t))return f(t);l=setTimeout(x,function(t){var i=e-(t-a);return p?nativeMin(i,s-(t-h)):i}(t))}function f(t){return l=void 0,d&&n?c(t):(n=r=void 0,o)}function y(){var t=now(),i=g(t);if(n=arguments,r=this,a=t,i){if(void 0===l)return m(a);if(p)return l=setTimeout(x,e),c(a)}return void 0===l&&(l=setTimeout(x,e)),o}return e=toNumber(e)||0,isObject(i)&&(u=!!i.leading,s=(p="maxWait"in i)?nativeMax(toNumber(i.maxWait)||0,e):s,d="trailing"in i?!!i.trailing:d),y.cancel=function(){void 0!==l&&clearTimeout(l),h=0,n=a=r=l=void 0},y.flush=function(){return void 0===l?o:f(now())},y}function throttle(t,e,i){var n=!0,r=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);return isObject(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),debounce(t,e,{leading:n,maxWait:e,trailing:r})}function isObject(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function isObjectLike(t){return!!t&&"object"==typeof t}function isSymbol(t){return"symbol"==typeof t||isObjectLike(t)&&objectToString.call(t)==symbolTag}function toNumber(t){if("number"==typeof t)return t;if(isSymbol(t))return NAN;if(isObject(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=isObject(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(reTrim,"");var i=reIsBinary.test(t);return i||reIsOctal.test(t)?freeParseInt(t.slice(2),i?2:8):reIsBadHex.test(t)?NAN:+t}var lodash_throttle=throttle;class BpmnMxGraph extends mxgraph.mxGraph{constructor(t){super(t),this.container=t,this.cumulativeZoomFactor=1}fit(t,e,i,n,r,s,o){const l=super.fit(t,e,i,n,r,s,o);return this.cumulativeZoomFactor=l,l}zoomActual(){super.zoomActual(),this.cumulativeZoomFactor=this.view.scale}customFit(t){this.zoomActual();const e=null==t?void 0:t.type;if(null==e||e==FitType.None)return;const i=ensurePositiveValue(null==t?void 0:t.margin);if(e!=FitType.Center){let t=!1,n=!1;switch(e){case FitType.Horizontal:n=!0;break;case FitType.Vertical:t=!0}this.fit(this.border,!1,i,!0,t,n)}else{const t=3,e=this.getGraphBounds(),n=this.container.clientWidth-i,r=this.container.clientHeight-i,s=e.width/this.view.scale,o=e.height/this.view.scale,l=Math.min(t,Math.min(n/s,r/o));this.cumulativeZoomFactor=l,this.view.scaleAndTranslate(l,(i+n-s*l)/(2*l)-e.x/this.view.scale,(i+r-o*l)/(2*l)-e.y/this.view.scale)}}static enforcePositiveValue(t){return Math.max(t||0,0)}zoomTo(t,e,i,n,r,s){if(null===t){const[t,e,o]=this.getScaleAndTranslationDeltas(i,n,r);s&&this.view.scaleAndTranslate(t,this.view.translate.x+e,this.view.translate.y+o)}else super.zoomTo(t,e)}createMouseWheelZoomExperience(t){t=ensureValidZoomConfiguration(t),mxgraph.mxEvent.addMouseWheelListener(lodash_debounce(this.getZoomHandler(!0),t.debounceDelay),this.container),mxgraph.mxEvent.addMouseWheelListener(lodash_throttle(this.getZoomHandler(!1),t.throttleDelay),this.container)}performZoom(t,e,i){const[n,r]=this.getRelativeEventCoordinates(e);this.zoomTo(null,null,t,n,r,i),i&&mxgraph.mxEvent.consume(e)}getZoomHandler(t){return(e,i)=>{const n=e;if(mxgraph.mxEvent.isConsumed(n))return;(n.ctrlKey||mxgraph.mxClient.IS_MAC&&n.metaKey)&&!n.altKey&&!n.shiftKey&&this.performZoom(i,n,t)}}getRelativeEventCoordinates(t){const e=this.container.getBoundingClientRect();return[t.clientX-e.left,t.clientY-e.top]}getScaleAndTranslationDeltas(t,e,i){let n=2*e,r=2*i;const[s,o]=this.calculateFactorAndScale(t);return[n,r]=this.calculateTranslationDeltas(s,o,n,r),[o,n,r]}calculateTranslationDeltas(t,e,i,n){if(t>1){const r=(t-1)/(2*e);i*=-r,n*=-r}else{const e=(1/t-1)/(2*this.view.scale);i*=e,n*=e}return[i,n]}calculateFactorAndScale(t){this.cumulativeZoomFactor*=t?Math.sqrt(1.25):Math.sqrt(.8);let e=this.cumulativeZoomFactor/this.view.scale;const i=Math.round(this.view.scale*e*100)/100;return e=i/this.view.scale,[e,i]}}class MxGraphConfigurator{constructor(t){this.container=t,this.graph=new BpmnMxGraph(t)}configure(t){return this.configureGraph(),this.configureNavigationSupport(t),new StyleConfigurator(this.graph).configureStyles(),(new ShapeConfigurator).configureShapes(),(new MarkerConfigurator).configureMarkers(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}configureNavigationSupport(t){var e,i;const n=this.graph.panningHandler;(null===(e=null==t?void 0:t.navigation)||void 0===e?void 0:e.enabled)?(n.addListener(mxgraph.mxEvent.PAN_START,this.getPanningHandler("grab")),n.addListener(mxgraph.mxEvent.PAN_END,this.getPanningHandler("default")),this.graph.panningHandler.usePopupTrigger=!1,n.isForcePanningEvent=t=>mxgraph.mxEvent.isLeftMouseButton(t.getEvent())||mxgraph.mxEvent.isMultiTouchEvent(t.getEvent()),this.graph.setPanning(!0),this.graph.createMouseWheelZoomExperience(null===(i=null==t?void 0:t.navigation)||void 0===i?void 0:i.zoom)):(this.graph.setPanning(!1),n.setPinchEnabled(!1),n.isForcePanningEvent=t=>!1)}getPanningHandler(t){return this.getPanningHandlerCallback(t).bind(this.graph)}getPanningHandlerCallback(t){return function(){this.isEnabled()&&(this.container.style.cursor=t)}}}class CoordinatesTranslator{constructor(t){this.graph=t}computeRelativeCoordinates(t,e){const i=this.getTranslateForRoot(t),n=e.x+i.x,r=e.y+i.y;return new mxgraph.mxPoint(n,r)}getTranslateForRoot(t){const e=this.graph.getModel(),i=new mxgraph.mxPoint(0,0);for(;null!=t;){const n=e.getGeometry(t);null!=n&&(i.x-=n.x,i.y-=n.y),t=e.getParent(t)}return i}computeEdgeCenter(t){const e=t.geometry.points,i=e[0],n=e[e.length-1];if(null!=i&&null!=n){const t=n.x-i.x,e=n.y-i.y;return new mxgraph.mxPoint(i.x+t/2,i.y+e/2)}}}class MxGraphRenderer{constructor(t,e,i){this.graph=t,this.coordinatesTranslator=e,this.styleConfigurator=i}render(t,e){this.insertShapesAndEdges(t),this.graph.customFit(null==e?void 0:e.fit)}insertShapesAndEdges({pools:t,lanes:e,subprocesses:i,otherFlowNodes:n,boundaryEvents:r,edges:s}){const o=this.graph.getModel();o.clear(),o.beginUpdate();try{this.insertShapes(t),this.insertShapes(e),this.insertShapes(i),this.insertShapes(n),this.insertShapes(r),this.insertEdges(s)}finally{o.endUpdate()}}insertShapes(t){t.forEach(t=>{this.insertShape(t)})}getParent(t){const e=this.getCell(t.parentId);return e||(ShapeUtil.isBoundaryEvent(t.kind)?void 0:this.graph.getDefaultParent())}insertShape(t){var e;const i=t.bpmnElement;if(i){const n=this.getParent(i);if(!n)return void console.warn("Not possible to insert shape %s: parent cell %s is not found",i.id,i.parentId);const r=t.bounds;let s=null===(e=t.label)||void 0===e?void 0:e.bounds;s=ShapeUtil.isPoolOrLane(i.kind)?void 0:s;const o=this.styleConfigurator.computeStyle(t,s);this.insertVertex(n,i.id,i.name,r,s,o)}}insertEdges(t){t.forEach(t=>{var e;const i=t.bpmnElement;if(i){const n=this.graph.getDefaultParent(),r=this.getCell(i.sourceRefId),s=this.getCell(i.targetRefId),o=null===(e=t.label)||void 0===e?void 0:e.bounds,l=this.styleConfigurator.computeStyle(t,o),a=this.graph.insertEdge(n,i.id,i.name,r,s,l);if(this.insertWaypoints(t.waypoints,a),o){a.geometry.width=o.width,a.geometry.height=o.height;const t=this.coordinatesTranslator.computeEdgeCenter(a);if(t){a.geometry.relative=!1;const e=this.coordinatesTranslator.computeRelativeCoordinates(a.parent,new mxgraph.mxPoint(o.x,o.y)),i=e.x+o.width/2-t.x,n=e.y-t.y;a.geometry.offset=new mxgraph.mxPoint(i,n)}}this.insertMessageFlowIconIfNeeded(t,a)}})}insertMessageFlowIconIfNeeded(t,e){if(t.bpmnElement instanceof MessageFlow&&t.messageVisibleKind!==MessageVisibleKind.NONE){const i=this.graph.insertVertex(e,"messageFlowIcon_of_"+e.id,void 0,0,0,20,14,this.styleConfigurator.computeMessageFlowIconStyle(t));i.geometry.relative=!0,i.geometry.offset=new mxgraph.mxPoint(-10,-7)}}insertWaypoints(t,e){t&&(e.geometry.points=t.map(t=>this.coordinatesTranslator.computeRelativeCoordinates(e.parent,new mxgraph.mxPoint(t.x,t.y))))}getCell(t){return this.graph.getModel().getCell(t)}insertVertex(t,e,i,n,r,s){const o=this.coordinatesTranslator.computeRelativeCoordinates(t,new mxgraph.mxPoint(n.x,n.y)),l=this.graph.insertVertex(t,e,i,o.x,o.y,n.width,n.height,s);if(r){const t=r.x-n.x,e=r.y-n.y;l.geometry.offset=new mxgraph.mxPoint(t,e)}return l}}function newMxGraphRenderer(t){return new MxGraphRenderer(t,new CoordinatesTranslator(t),new StyleConfigurator(t))}var util=createCommonjsModule((function(t,e){const i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+i+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",r=new RegExp("^"+n+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,i){if(e){const n=Object.keys(e),r=n.length;for(let s=0;s1){n[o]=[];for(let i in t.child[o])t.child[o].hasOwnProperty(i)&&n[o].push(convertToJson(t.child[o][i],e,o))}else{const r=convertToJson(t.child[o][0],e,o),s=!0===e.arrayMode&&"object"==typeof r||util.isTagNameInArrayMode(o,e.arrayMode,i);n[o]=s?[r]:r}}return n};var convertToJson_1=convertToJson,node2json={convertToJson:convertToJson_1},xmlNode=function(t,e,i){this.tagname=t,this.parent=e,this.child={},this.attrsMap={},this.val=i,this.addChild=function(t){Array.isArray(this.child[t.tagname])?this.child[t.tagname].push(t):this.child[t.tagname]=[t]}};const buildOptions$3=util.buildOptions;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,util.nameRegexp),!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const defaultOptions$2={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",tagValueProcessor:function(t,e){return t},attrValueProcessor:function(t,e){return t},stopNodes:[]};var defaultOptions_1=defaultOptions$2;const props$2=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","stopNodes"];var props_1=props$2;function processTagValue(t,e,i){return e&&(i.trimValues&&(e=e.trim()),e=parseValue(e=i.tagValueProcessor(e,t),i.parseNodeValue,i.parseTrueNumberOnly)),e}function resolveNameSpace(t,e){if(e.ignoreNameSpace){const e=t.split(":"),i="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=i+e[1])}return t}function parseValue(t,e,i){if(e&&"string"==typeof t){let e;return""===t.trim()||isNaN(t)?e="true"===t||"false"!==t&&t:(-1!==t.indexOf("0x")?e=Number.parseInt(t,16):-1!==t.indexOf(".")?(e=Number.parseFloat(t),t=t.replace(/\.?0+$/,"")):e=Number.parseInt(t,10),i&&(e=String(e)===t?e:t)),e}return util.isExist(t)?t:""}const attrsRegx=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function buildAttributesMap(t,e){if(!e.ignoreAttributes&&"string"==typeof t){t=t.replace(/\r?\n/g," ");const i=util.getAllMatches(t,attrsRegx),n=i.length,r={};for(let t=0;t",i,"Closing Tag is not closed.");let o=t.substring(i+2,s).trim();if(e.ignoreNameSpace){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}n&&(n.val?n.val=util.getValue(n.val)+""+processTagValue(o,r,e):n.val=processTagValue(o,r,e)),e.stopNodes.length&&e.stopNodes.includes(n.tagname)&&(n.child=[],null==n.attrsMap&&(n.attrsMap={}),n.val=t.substr(n.startIndex+1,i-n.startIndex-1)),n=n.parent,r="",i=s}else if("?"===t[i+1])i=findClosingIndex(t,"?>",i,"Pi Tag is not closed.");else if("!--"===t.substr(i+1,3))i=findClosingIndex(t,"--\x3e",i,"Comment is not closed.");else if("!D"===t.substr(i+1,2)){const e=findClosingIndex(t,">",i,"DOCTYPE is not closed.");i=t.substring(i,e).indexOf("[")>=0?t.indexOf("]>",i)+1:e}else if("!["===t.substr(i+1,2)){const s=findClosingIndex(t,"]]>",i,"CDATA is not closed.")-2,o=t.substring(i+9,s);if(r&&(n.val=util.getValue(n.val)+""+processTagValue(n.tagname,r,e),r=""),e.cdataTagName){const t=new xmlNode(e.cdataTagName,n,o);n.addChild(t),n.val=util.getValue(n.val)+e.cdataPositionChar,o&&(t.val=o)}else n.val=(n.val||"")+(o||"");i=s+2}else{const s=closingIndexForOpeningTag(t,i+1);let o=s.data;const l=s.index,a=o.indexOf(" ");let h=o;if(-1!==a&&(h=o.substr(0,a).replace(/\s\s*$/,""),o=o.substr(a+1)),e.ignoreNameSpace){const t=h.indexOf(":");-1!==t&&(h=h.substr(t+1))}if(n&&r&&"!xml"!==n.tagname&&(n.val=util.getValue(n.val)+""+processTagValue(n.tagname,r,e)),o.length>0&&o.lastIndexOf("/")===o.length-1){"/"===h[h.length-1]?(h=h.substr(0,h.length-1),o=h):o=o.substr(0,o.length-1);const t=new xmlNode(h,n,"");h!==o&&(t.attrsMap=buildAttributesMap(o,e)),n.addChild(t)}else{const t=new xmlNode(h,n);e.stopNodes.length&&e.stopNodes.includes(t.tagname)&&(t.startIndex=l),h!==o&&(t.attrsMap=buildAttributesMap(o,e)),n.addChild(t),n=t}r="",i=l}else r+=t[i]}return i};function closingIndexForOpeningTag(t,e){let i,n="";for(let r=e;r"===e)return{data:n,index:r};"\t"===e&&(e=" ")}n+=e}}function findClosingIndex(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}var getTraversalObj_1=getTraversalObj,xmlstr2xmlnode={defaultOptions:defaultOptions_1,props:props_1,getTraversalObj:getTraversalObj_1};const defaultOptions$1={allowBooleanAttributes:!1},props$1=["allowBooleanAttributes"];var validate=function(t,e){e=util.buildOptions(e,defaultOptions$1,props$1);const i=[];let n=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let s=0;s"!==t[s]&&" "!==t[s]&&"\t"!==t[s]&&"\n"!==t[s]&&"\r"!==t[s];s++)l+=t[s];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),s--),!validateTagName(l)){let e;return e=0===l.trim().length?"There is an unnecessary space between tag name and backward slash '0)return getErrorObject("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",getLineNumberForPosition(t,s));{const e=i.pop();if(l!==e)return getErrorObject("InvalidTag","Closing tag '"+e+"' is expected inplace of '"+l+"'.",getLineNumberForPosition(t,s));0==i.length&&(r=!0)}}else{const o=validateAttributeString(h,e);if(!0!==o)return getErrorObject(o.err.code,o.err.msg,getLineNumberForPosition(t,s-h.length+o.err.line));if(!0===r)return getErrorObject("InvalidXml","Multiple possible root nodes found.",getLineNumberForPosition(t,s));i.push(l),n=!0}for(s++;s0)||getErrorObject("InvalidXml","Invalid '"+JSON.stringify(i,null,4).replace(/\r?\n/g,"")+"' found.",1):getErrorObject("InvalidXml","Start tag expected.",1)};function readPI(t,e){for(var i=e;e5&&"xml"===n)return getErrorObject("InvalidXml","XML declaration allowed only at the start of the document.",getLineNumberForPosition(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function readCommentAndCDATA(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let i=1;for(e+=8;e"===t[e]&&(i--,0===i))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}var doubleQuote='"',singleQuote="'";function readAttributeStr(t,e){let i="",n="",r=!1;for(;e"===t[e]&&""===n){r=!0;break}i+=t[e]}return""===n&&{value:i,index:e,tagClosed:r}}const validAttrStrRegxp=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function validateAttributeString(t,e){const i=util.getAllMatches(t,validAttrStrRegxp),n={};for(let r=0;r1){for(var o in n+='"'+s+'" : [ ',t.child[s])n+=_cToJsonStr(t.child[s][o],e)+" , ";n=n.substr(0,n.length-1)+" ] "}else n+='"'+s+'" : '+_cToJsonStr(t.child[s][0],e)+" ,"}return util.merge(n,t.attrsMap),util.isEmptyObject(n)?util.isExist(t.val)?t.val:"":(util.isExist(t.val)&&("string"!=typeof t.val||""!==t.val&&t.val!==e.cdataPositionChar)&&(n+='"'+e.textNodeName+'" : '+stringval(t.val)),","===n[n.length-1]&&(n=n.substr(0,n.length-2)),n+"}")};function stringval(t){return!0!==t&&!1!==t&&isNaN(t)?'"'+t+'"':t}var convertToJsonString_1=convertToJsonString,node2json_str={convertToJsonString:convertToJsonString_1};const buildOptions=util.buildOptions,defaultOptions={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataTagName:!1,cdataPositionChar:"\\c",format:!1,indentBy:" ",supressEmptyNode:!1,tagValueProcessor:function(t){return t},attrValueProcessor:function(t){return t}},props=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","cdataTagName","cdataPositionChar","format","indentBy","supressEmptyNode","tagValueProcessor","attrValueProcessor"];function Parser(t){this.options=buildOptions(t,defaultOptions,props),this.options.ignoreAttributes||this.options.attrNodeName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=isAttribute),this.options.cdataTagName?this.isCDATA=isCDATA:this.isCDATA=function(){return!1},this.replaceCDATAstr=replaceCDATAstr,this.replaceCDATAarr=replaceCDATAarr,this.options.format?(this.indentate=indentate,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.supressEmptyNode?(this.buildTextNode=buildEmptyTextNode,this.buildObjNode=buildEmptyObjNode):(this.buildTextNode=buildTextValNode,this.buildObjNode=buildObjectNode),this.buildTextValNode=buildTextValNode,this.buildObjectNode=buildObjectNode}function replaceCDATAstr(t,e){return t=this.options.tagValueProcessor(""+t),""===this.options.cdataPositionChar||""===t?t+"");return t+this.newLine}function buildObjectNode(t,e,i,n){return i&&!t.includes("<")?this.indentate(n)+"<"+e+i+">"+t+""+this.options.tagValueProcessor(t)+"",GT$1=">",Gt="≫",gtdot="⋗",gtlPar="⦕",gtquest="⩼",gtrapprox="⪆",gtrarr="⥸",gtrdot="⋗",gtreqless="⋛",gtreqqless="⪌",gtrless="≷",gtrsim="≳",gvertneqq="≩︀",gvnE="≩︀",Hacek="ˇ",hairsp=" ",half="½",hamilt="ℋ",HARDcy="Ъ",hardcy="ъ",harrcir="⥈",harr="↔",hArr="⇔",harrw="↭",Hat="^",hbar="ℏ",Hcirc="Ĥ",hcirc="ĥ",hearts="♥",heartsuit="♥",hellip="…",hercon="⊹",hfr="𝔥",Hfr="ℌ",HilbertSpace="ℋ",hksearow="⤥",hkswarow="⤦",hoarr="⇿",homtht="∻",hookleftarrow="↩",hookrightarrow="↪",hopf="𝕙",Hopf="ℍ",horbar="―",HorizontalLine="─",hscr="𝒽",Hscr="ℋ",hslash="ℏ",Hstrok="Ħ",hstrok="ħ",HumpDownHump="≎",HumpEqual="≏",hybull="⁃",hyphen="‐",Iacute$1="Í",iacute$1="í",ic="⁣",Icirc$1="Î",icirc$1="î",Icy="И",icy="и",Idot="İ",IEcy="Е",iecy="е",iexcl$1="¡",iff="⇔",ifr="𝔦",Ifr="ℑ",Igrave$1="Ì",igrave$1="ì",ii="ⅈ",iiiint="⨌",iiint="∭",iinfin="⧜",iiota="℩",IJlig="IJ",ijlig="ij",Imacr="Ī",imacr="ī",image="ℑ",ImaginaryI="ⅈ",imagline="ℐ",imagpart="ℑ",imath="ı",Im="ℑ",imof="⊷",imped="Ƶ",Implies="⇒",incare="℅",infin="∞",infintie="⧝",inodot="ı",intcal="⊺",int="∫",Int="∬",integers="ℤ",Integral="∫",intercal="⊺",Intersection="⋂",intlarhk="⨗",intprod="⨼",InvisibleComma="⁣",InvisibleTimes="⁢",IOcy="Ё",iocy="ё",Iogon="Į",iogon="į",Iopf="𝕀",iopf="𝕚",Iota="Ι",iota="ι",iprod="⨼",iquest$1="¿",iscr="𝒾",Iscr="ℐ",isin="∈",isindot="⋵",isinE="⋹",isins="⋴",isinsv="⋳",isinv="∈",it="⁢",Itilde="Ĩ",itilde="ĩ",Iukcy="І",iukcy="і",Iuml$1="Ï",iuml$1="ï",Jcirc="Ĵ",jcirc="ĵ",Jcy="Й",jcy="й",Jfr="𝔍",jfr="𝔧",jmath="ȷ",Jopf="𝕁",jopf="𝕛",Jscr="𝒥",jscr="𝒿",Jsercy="Ј",jsercy="ј",Jukcy="Є",jukcy="є",Kappa="Κ",kappa="κ",kappav="ϰ",Kcedil="Ķ",kcedil="ķ",Kcy="К",kcy="к",Kfr="𝔎",kfr="𝔨",kgreen="ĸ",KHcy="Х",khcy="х",KJcy="Ќ",kjcy="ќ",Kopf="𝕂",kopf="𝕜",Kscr="𝒦",kscr="𝓀",lAarr="⇚",Lacute="Ĺ",lacute="ĺ",laemptyv="⦴",lagran="ℒ",Lambda="Λ",lambda="λ",lang="⟨",Lang="⟪",langd="⦑",langle="⟨",lap="⪅",Laplacetrf="ℒ",laquo$1="«",larrb="⇤",larrbfs="⤟",larr="←",Larr="↞",lArr="⇐",larrfs="⤝",larrhk="↩",larrlp="↫",larrpl="⤹",larrsim="⥳",larrtl="↢",latail="⤙",lAtail="⤛",lat="⪫",late="⪭",lates="⪭︀",lbarr="⤌",lBarr="⤎",lbbrk="❲",lbrace="{",lbrack="[",lbrke="⦋",lbrksld="⦏",lbrkslu="⦍",Lcaron="Ľ",lcaron="ľ",Lcedil="Ļ",lcedil="ļ",lceil="⌈",lcub="{",Lcy="Л",lcy="л",ldca="⤶",ldquo="“",ldquor="„",ldrdhar="⥧",ldrushar="⥋",ldsh="↲",le="≤",lE="≦",LeftAngleBracket="⟨",LeftArrowBar="⇤",leftarrow="←",LeftArrow="←",Leftarrow="⇐",LeftArrowRightArrow="⇆",leftarrowtail="↢",LeftCeiling="⌈",LeftDoubleBracket="⟦",LeftDownTeeVector="⥡",LeftDownVectorBar="⥙",LeftDownVector="⇃",LeftFloor="⌊",leftharpoondown="↽",leftharpoonup="↼",leftleftarrows="⇇",leftrightarrow="↔",LeftRightArrow="↔",Leftrightarrow="⇔",leftrightarrows="⇆",leftrightharpoons="⇋",leftrightsquigarrow="↭",LeftRightVector="⥎",LeftTeeArrow="↤",LeftTee="⊣",LeftTeeVector="⥚",leftthreetimes="⋋",LeftTriangleBar="⧏",LeftTriangle="⊲",LeftTriangleEqual="⊴",LeftUpDownVector="⥑",LeftUpTeeVector="⥠",LeftUpVectorBar="⥘",LeftUpVector="↿",LeftVectorBar="⥒",LeftVector="↼",lEg="⪋",leg="⋚",leq="≤",leqq="≦",leqslant="⩽",lescc="⪨",les="⩽",lesdot="⩿",lesdoto="⪁",lesdotor="⪃",lesg="⋚︀",lesges="⪓",lessapprox="⪅",lessdot="⋖",lesseqgtr="⋚",lesseqqgtr="⪋",LessEqualGreater="⋚",LessFullEqual="≦",LessGreater="≶",lessgtr="≶",LessLess="⪡",lesssim="≲",LessSlantEqual="⩽",LessTilde="≲",lfisht="⥼",lfloor="⌊",Lfr="𝔏",lfr="𝔩",lg="≶",lgE="⪑",lHar="⥢",lhard="↽",lharu="↼",lharul="⥪",lhblk="▄",LJcy="Љ",ljcy="љ",llarr="⇇",ll="≪",Ll="⋘",llcorner="⌞",Lleftarrow="⇚",llhard="⥫",lltri="◺",Lmidot="Ŀ",lmidot="ŀ",lmoustache="⎰",lmoust="⎰",lnap="⪉",lnapprox="⪉",lne="⪇",lnE="≨",lneq="⪇",lneqq="≨",lnsim="⋦",loang="⟬",loarr="⇽",lobrk="⟦",longleftarrow="⟵",LongLeftArrow="⟵",Longleftarrow="⟸",longleftrightarrow="⟷",LongLeftRightArrow="⟷",Longleftrightarrow="⟺",longmapsto="⟼",longrightarrow="⟶",LongRightArrow="⟶",Longrightarrow="⟹",looparrowleft="↫",looparrowright="↬",lopar="⦅",Lopf="𝕃",lopf="𝕝",loplus="⨭",lotimes="⨴",lowast="∗",lowbar="_",LowerLeftArrow="↙",LowerRightArrow="↘",loz="◊",lozenge="◊",lozf="⧫",lpar="(",lparlt="⦓",lrarr="⇆",lrcorner="⌟",lrhar="⇋",lrhard="⥭",lrm="‎",lrtri="⊿",lsaquo="‹",lscr="𝓁",Lscr="ℒ",lsh="↰",Lsh="↰",lsim="≲",lsime="⪍",lsimg="⪏",lsqb="[",lsquo="‘",lsquor="‚",Lstrok="Ł",lstrok="ł",ltcc="⪦",ltcir="⩹",lt$2="<",LT$1="<",Lt="≪",ltdot="⋖",lthree="⋋",ltimes="⋉",ltlarr="⥶",ltquest="⩻",ltri="◃",ltrie="⊴",ltrif="◂",ltrPar="⦖",lurdshar="⥊",luruhar="⥦",lvertneqq="≨︀",lvnE="≨︀",macr$1="¯",male="♂",malt="✠",maltese="✠",map="↦",mapsto="↦",mapstodown="↧",mapstoleft="↤",mapstoup="↥",marker="▮",mcomma="⨩",Mcy="М",mcy="м",mdash="—",mDDot="∺",measuredangle="∡",MediumSpace=" ",Mellintrf="ℳ",Mfr="𝔐",mfr="𝔪",mho="℧",micro$1="µ",midast="*",midcir="⫰",mid="∣",middot$1="·",minusb="⊟",minus="−",minusd="∸",minusdu="⨪",MinusPlus="∓",mlcp="⫛",mldr="…",mnplus="∓",models="⊧",Mopf="𝕄",mopf="𝕞",mp="∓",mscr="𝓂",Mscr="ℳ",mstpos="∾",Mu="Μ",mu="μ",multimap="⊸",mumap="⊸",nabla="∇",Nacute="Ń",nacute="ń",nang="∠⃒",nap="≉",napE="⩰̸",napid="≋̸",napos="ʼn",napprox="≉",natural="♮",naturals="ℕ",natur="♮",nbsp$1=" ",nbump="≎̸",nbumpe="≏̸",ncap="⩃",Ncaron="Ň",ncaron="ň",Ncedil="Ņ",ncedil="ņ",ncong="≇",ncongdot="⩭̸",ncup="⩂",Ncy="Н",ncy="н",ndash="–",nearhk="⤤",nearr="↗",neArr="⇗",nearrow="↗",ne="≠",nedot="≐̸",NegativeMediumSpace="​",NegativeThickSpace="​",NegativeThinSpace="​",NegativeVeryThinSpace="​",nequiv="≢",nesear="⤨",nesim="≂̸",NestedGreaterGreater="≫",NestedLessLess="≪",NewLine="\n",nexist="∄",nexists="∄",Nfr="𝔑",nfr="𝔫",ngE="≧̸",nge="≱",ngeq="≱",ngeqq="≧̸",ngeqslant="⩾̸",nges="⩾̸",nGg="⋙̸",ngsim="≵",nGt="≫⃒",ngt="≯",ngtr="≯",nGtv="≫̸",nharr="↮",nhArr="⇎",nhpar="⫲",ni="∋",nis="⋼",nisd="⋺",niv="∋",NJcy="Њ",njcy="њ",nlarr="↚",nlArr="⇍",nldr="‥",nlE="≦̸",nle="≰",nleftarrow="↚",nLeftarrow="⇍",nleftrightarrow="↮",nLeftrightarrow="⇎",nleq="≰",nleqq="≦̸",nleqslant="⩽̸",nles="⩽̸",nless="≮",nLl="⋘̸",nlsim="≴",nLt="≪⃒",nlt="≮",nltri="⋪",nltrie="⋬",nLtv="≪̸",nmid="∤",NoBreak="⁠",NonBreakingSpace=" ",nopf="𝕟",Nopf="ℕ",Not="⫬",not$1="¬",NotCongruent="≢",NotCupCap="≭",NotDoubleVerticalBar="∦",NotElement="∉",NotEqual="≠",NotEqualTilde="≂̸",NotExists="∄",NotGreater="≯",NotGreaterEqual="≱",NotGreaterFullEqual="≧̸",NotGreaterGreater="≫̸",NotGreaterLess="≹",NotGreaterSlantEqual="⩾̸",NotGreaterTilde="≵",NotHumpDownHump="≎̸",NotHumpEqual="≏̸",notin="∉",notindot="⋵̸",notinE="⋹̸",notinva="∉",notinvb="⋷",notinvc="⋶",NotLeftTriangleBar="⧏̸",NotLeftTriangle="⋪",NotLeftTriangleEqual="⋬",NotLess="≮",NotLessEqual="≰",NotLessGreater="≸",NotLessLess="≪̸",NotLessSlantEqual="⩽̸",NotLessTilde="≴",NotNestedGreaterGreater="⪢̸",NotNestedLessLess="⪡̸",notni="∌",notniva="∌",notnivb="⋾",notnivc="⋽",NotPrecedes="⊀",NotPrecedesEqual="⪯̸",NotPrecedesSlantEqual="⋠",NotReverseElement="∌",NotRightTriangleBar="⧐̸",NotRightTriangle="⋫",NotRightTriangleEqual="⋭",NotSquareSubset="⊏̸",NotSquareSubsetEqual="⋢",NotSquareSuperset="⊐̸",NotSquareSupersetEqual="⋣",NotSubset="⊂⃒",NotSubsetEqual="⊈",NotSucceeds="⊁",NotSucceedsEqual="⪰̸",NotSucceedsSlantEqual="⋡",NotSucceedsTilde="≿̸",NotSuperset="⊃⃒",NotSupersetEqual="⊉",NotTilde="≁",NotTildeEqual="≄",NotTildeFullEqual="≇",NotTildeTilde="≉",NotVerticalBar="∤",nparallel="∦",npar="∦",nparsl="⫽⃥",npart="∂̸",npolint="⨔",npr="⊀",nprcue="⋠",nprec="⊀",npreceq="⪯̸",npre="⪯̸",nrarrc="⤳̸",nrarr="↛",nrArr="⇏",nrarrw="↝̸",nrightarrow="↛",nRightarrow="⇏",nrtri="⋫",nrtrie="⋭",nsc="⊁",nsccue="⋡",nsce="⪰̸",Nscr="𝒩",nscr="𝓃",nshortmid="∤",nshortparallel="∦",nsim="≁",nsime="≄",nsimeq="≄",nsmid="∤",nspar="∦",nsqsube="⋢",nsqsupe="⋣",nsub="⊄",nsubE="⫅̸",nsube="⊈",nsubset="⊂⃒",nsubseteq="⊈",nsubseteqq="⫅̸",nsucc="⊁",nsucceq="⪰̸",nsup="⊅",nsupE="⫆̸",nsupe="⊉",nsupset="⊃⃒",nsupseteq="⊉",nsupseteqq="⫆̸",ntgl="≹",Ntilde$1="Ñ",ntilde$1="ñ",ntlg="≸",ntriangleleft="⋪",ntrianglelefteq="⋬",ntriangleright="⋫",ntrianglerighteq="⋭",Nu="Ν",nu="ν",num="#",numero="№",numsp=" ",nvap="≍⃒",nvdash="⊬",nvDash="⊭",nVdash="⊮",nVDash="⊯",nvge="≥⃒",nvgt=">⃒",nvHarr="⤄",nvinfin="⧞",nvlArr="⤂",nvle="≤⃒",nvlt="<⃒",nvltrie="⊴⃒",nvrArr="⤃",nvrtrie="⊵⃒",nvsim="∼⃒",nwarhk="⤣",nwarr="↖",nwArr="⇖",nwarrow="↖",nwnear="⤧",Oacute$1="Ó",oacute$1="ó",oast="⊛",Ocirc$1="Ô",ocirc$1="ô",ocir="⊚",Ocy="О",ocy="о",odash="⊝",Odblac="Ő",odblac="ő",odiv="⨸",odot="⊙",odsold="⦼",OElig="Œ",oelig="œ",ofcir="⦿",Ofr="𝔒",ofr="𝔬",ogon="˛",Ograve$1="Ò",ograve$1="ò",ogt="⧁",ohbar="⦵",ohm="Ω",oint="∮",olarr="↺",olcir="⦾",olcross="⦻",oline="‾",olt="⧀",Omacr="Ō",omacr="ō",Omega="Ω",omega="ω",Omicron="Ο",omicron="ο",omid="⦶",ominus="⊖",Oopf="𝕆",oopf="𝕠",opar="⦷",OpenCurlyDoubleQuote="“",OpenCurlyQuote="‘",operp="⦹",oplus="⊕",orarr="↻",Or="⩔",or="∨",ord="⩝",order="ℴ",orderof="ℴ",ordf$1="ª",ordm$1="º",origof="⊶",oror="⩖",orslope="⩗",orv="⩛",oS="Ⓢ",Oscr="𝒪",oscr="ℴ",Oslash$1="Ø",oslash$1="ø",osol="⊘",Otilde$1="Õ",otilde$1="õ",otimesas="⨶",Otimes="⨷",otimes="⊗",Ouml$1="Ö",ouml$1="ö",ovbar="⌽",OverBar="‾",OverBrace="⏞",OverBracket="⎴",OverParenthesis="⏜",para$1="¶",parallel="∥",par="∥",parsim="⫳",parsl="⫽",part="∂",PartialD="∂",Pcy="П",pcy="п",percnt="%",period=".",permil="‰",perp="⊥",pertenk="‱",Pfr="𝔓",pfr="𝔭",Phi="Φ",phi="φ",phiv="ϕ",phmmat="ℳ",phone="☎",Pi="Π",pi="π",pitchfork="⋔",piv="ϖ",planck="ℏ",planckh="ℎ",plankv="ℏ",plusacir="⨣",plusb="⊞",pluscir="⨢",plus="+",plusdo="∔",plusdu="⨥",pluse="⩲",PlusMinus="±",plusmn$1="±",plussim="⨦",plustwo="⨧",pm="±",Poincareplane="ℌ",pointint="⨕",popf="𝕡",Popf="ℙ",pound$1="£",prap="⪷",Pr="⪻",pr="≺",prcue="≼",precapprox="⪷",prec="≺",preccurlyeq="≼",Precedes="≺",PrecedesEqual="⪯",PrecedesSlantEqual="≼",PrecedesTilde="≾",preceq="⪯",precnapprox="⪹",precneqq="⪵",precnsim="⋨",pre="⪯",prE="⪳",precsim="≾",prime="′",Prime="″",primes="ℙ",prnap="⪹",prnE="⪵",prnsim="⋨",prod="∏",Product="∏",profalar="⌮",profline="⌒",profsurf="⌓",prop="∝",Proportional="∝",Proportion="∷",propto="∝",prsim="≾",prurel="⊰",Pscr="𝒫",pscr="𝓅",Psi="Ψ",psi="ψ",puncsp=" ",Qfr="𝔔",qfr="𝔮",qint="⨌",qopf="𝕢",Qopf="ℚ",qprime="⁗",Qscr="𝒬",qscr="𝓆",quaternions="ℍ",quatint="⨖",quest="?",questeq="≟",quot$2='"',QUOT$1='"',rAarr="⇛",race="∽̱",Racute="Ŕ",racute="ŕ",radic="√",raemptyv="⦳",rang="⟩",Rang="⟫",rangd="⦒",range="⦥",rangle="⟩",raquo$1="»",rarrap="⥵",rarrb="⇥",rarrbfs="⤠",rarrc="⤳",rarr="→",Rarr="↠",rArr="⇒",rarrfs="⤞",rarrhk="↪",rarrlp="↬",rarrpl="⥅",rarrsim="⥴",Rarrtl="⤖",rarrtl="↣",rarrw="↝",ratail="⤚",rAtail="⤜",ratio="∶",rationals="ℚ",rbarr="⤍",rBarr="⤏",RBarr="⤐",rbbrk="❳",rbrace="}",rbrack="]",rbrke="⦌",rbrksld="⦎",rbrkslu="⦐",Rcaron="Ř",rcaron="ř",Rcedil="Ŗ",rcedil="ŗ",rceil="⌉",rcub="}",Rcy="Р",rcy="р",rdca="⤷",rdldhar="⥩",rdquo="”",rdquor="”",rdsh="↳",real="ℜ",realine="ℛ",realpart="ℜ",reals="ℝ",Re="ℜ",rect="▭",reg$1="®",REG$1="®",ReverseElement="∋",ReverseEquilibrium="⇋",ReverseUpEquilibrium="⥯",rfisht="⥽",rfloor="⌋",rfr="𝔯",Rfr="ℜ",rHar="⥤",rhard="⇁",rharu="⇀",rharul="⥬",Rho="Ρ",rho="ρ",rhov="ϱ",RightAngleBracket="⟩",RightArrowBar="⇥",rightarrow="→",RightArrow="→",Rightarrow="⇒",RightArrowLeftArrow="⇄",rightarrowtail="↣",RightCeiling="⌉",RightDoubleBracket="⟧",RightDownTeeVector="⥝",RightDownVectorBar="⥕",RightDownVector="⇂",RightFloor="⌋",rightharpoondown="⇁",rightharpoonup="⇀",rightleftarrows="⇄",rightleftharpoons="⇌",rightrightarrows="⇉",rightsquigarrow="↝",RightTeeArrow="↦",RightTee="⊢",RightTeeVector="⥛",rightthreetimes="⋌",RightTriangleBar="⧐",RightTriangle="⊳",RightTriangleEqual="⊵",RightUpDownVector="⥏",RightUpTeeVector="⥜",RightUpVectorBar="⥔",RightUpVector="↾",RightVectorBar="⥓",RightVector="⇀",ring="˚",risingdotseq="≓",rlarr="⇄",rlhar="⇌",rlm="‏",rmoustache="⎱",rmoust="⎱",rnmid="⫮",roang="⟭",roarr="⇾",robrk="⟧",ropar="⦆",ropf="𝕣",Ropf="ℝ",roplus="⨮",rotimes="⨵",RoundImplies="⥰",rpar=")",rpargt="⦔",rppolint="⨒",rrarr="⇉",Rrightarrow="⇛",rsaquo="›",rscr="𝓇",Rscr="ℛ",rsh="↱",Rsh="↱",rsqb="]",rsquo="’",rsquor="’",rthree="⋌",rtimes="⋊",rtri="▹",rtrie="⊵",rtrif="▸",rtriltri="⧎",RuleDelayed="⧴",ruluhar="⥨",rx="℞",Sacute="Ś",sacute="ś",sbquo="‚",scap="⪸",Scaron="Š",scaron="š",Sc="⪼",sc="≻",sccue="≽",sce="⪰",scE="⪴",Scedil="Ş",scedil="ş",Scirc="Ŝ",scirc="ŝ",scnap="⪺",scnE="⪶",scnsim="⋩",scpolint="⨓",scsim="≿",Scy="С",scy="с",sdotb="⊡",sdot="⋅",sdote="⩦",searhk="⤥",searr="↘",seArr="⇘",searrow="↘",sect$1="§",semi=";",seswar="⤩",setminus="∖",setmn="∖",sext="✶",Sfr="𝔖",sfr="𝔰",sfrown="⌢",sharp="♯",SHCHcy="Щ",shchcy="щ",SHcy="Ш",shcy="ш",ShortDownArrow="↓",ShortLeftArrow="←",shortmid="∣",shortparallel="∥",ShortRightArrow="→",ShortUpArrow="↑",shy$1="­",Sigma="Σ",sigma="σ",sigmaf="ς",sigmav="ς",sim="∼",simdot="⩪",sime="≃",simeq="≃",simg="⪞",simgE="⪠",siml="⪝",simlE="⪟",simne="≆",simplus="⨤",simrarr="⥲",slarr="←",SmallCircle="∘",smallsetminus="∖",smashp="⨳",smeparsl="⧤",smid="∣",smile="⌣",smt="⪪",smte="⪬",smtes="⪬︀",SOFTcy="Ь",softcy="ь",solbar="⌿",solb="⧄",sol="/",Sopf="𝕊",sopf="𝕤",spades="♠",spadesuit="♠",spar="∥",sqcap="⊓",sqcaps="⊓︀",sqcup="⊔",sqcups="⊔︀",Sqrt="√",sqsub="⊏",sqsube="⊑",sqsubset="⊏",sqsubseteq="⊑",sqsup="⊐",sqsupe="⊒",sqsupset="⊐",sqsupseteq="⊒",square="□",Square="□",SquareIntersection="⊓",SquareSubset="⊏",SquareSubsetEqual="⊑",SquareSuperset="⊐",SquareSupersetEqual="⊒",SquareUnion="⊔",squarf="▪",squ="□",squf="▪",srarr="→",Sscr="𝒮",sscr="𝓈",ssetmn="∖",ssmile="⌣",sstarf="⋆",Star="⋆",star="☆",starf="★",straightepsilon="ϵ",straightphi="ϕ",strns="¯",sub="⊂",Sub="⋐",subdot="⪽",subE="⫅",sube="⊆",subedot="⫃",submult="⫁",subnE="⫋",subne="⊊",subplus="⪿",subrarr="⥹",subset="⊂",Subset="⋐",subseteq="⊆",subseteqq="⫅",SubsetEqual="⊆",subsetneq="⊊",subsetneqq="⫋",subsim="⫇",subsub="⫕",subsup="⫓",succapprox="⪸",succ="≻",succcurlyeq="≽",Succeeds="≻",SucceedsEqual="⪰",SucceedsSlantEqual="≽",SucceedsTilde="≿",succeq="⪰",succnapprox="⪺",succneqq="⪶",succnsim="⋩",succsim="≿",SuchThat="∋",sum="∑",Sum="∑",sung="♪",sup1$1="¹",sup2$1="²",sup3$1="³",sup="⊃",Sup="⋑",supdot="⪾",supdsub="⫘",supE="⫆",supe="⊇",supedot="⫄",Superset="⊃",SupersetEqual="⊇",suphsol="⟉",suphsub="⫗",suplarr="⥻",supmult="⫂",supnE="⫌",supne="⊋",supplus="⫀",supset="⊃",Supset="⋑",supseteq="⊇",supseteqq="⫆",supsetneq="⊋",supsetneqq="⫌",supsim="⫈",supsub="⫔",supsup="⫖",swarhk="⤦",swarr="↙",swArr="⇙",swarrow="↙",swnwar="⤪",szlig$1="ß",Tab="\t",target="⌖",Tau="Τ",tau="τ",tbrk="⎴",Tcaron="Ť",tcaron="ť",Tcedil="Ţ",tcedil="ţ",Tcy="Т",tcy="т",tdot="⃛",telrec="⌕",Tfr="𝔗",tfr="𝔱",there4="∴",therefore="∴",Therefore="∴",Theta="Θ",theta="θ",thetasym="ϑ",thetav="ϑ",thickapprox="≈",thicksim="∼",ThickSpace="  ",ThinSpace=" ",thinsp=" ",thkap="≈",thksim="∼",THORN$1="Þ",thorn$1="þ",tilde="˜",Tilde="∼",TildeEqual="≃",TildeFullEqual="≅",TildeTilde="≈",timesbar="⨱",timesb="⊠",times$1="×",timesd="⨰",tint="∭",toea="⤨",topbot="⌶",topcir="⫱",top="⊤",Topf="𝕋",topf="𝕥",topfork="⫚",tosa="⤩",tprime="‴",trade="™",TRADE="™",triangle="▵",triangledown="▿",triangleleft="◃",trianglelefteq="⊴",triangleq="≜",triangleright="▹",trianglerighteq="⊵",tridot="◬",trie="≜",triminus="⨺",TripleDot="⃛",triplus="⨹",trisb="⧍",tritime="⨻",trpezium="⏢",Tscr="𝒯",tscr="𝓉",TScy="Ц",tscy="ц",TSHcy="Ћ",tshcy="ћ",Tstrok="Ŧ",tstrok="ŧ",twixt="≬",twoheadleftarrow="↞",twoheadrightarrow="↠",Uacute$1="Ú",uacute$1="ú",uarr="↑",Uarr="↟",uArr="⇑",Uarrocir="⥉",Ubrcy="Ў",ubrcy="ў",Ubreve="Ŭ",ubreve="ŭ",Ucirc$1="Û",ucirc$1="û",Ucy="У",ucy="у",udarr="⇅",Udblac="Ű",udblac="ű",udhar="⥮",ufisht="⥾",Ufr="𝔘",ufr="𝔲",Ugrave$1="Ù",ugrave$1="ù",uHar="⥣",uharl="↿",uharr="↾",uhblk="▀",ulcorn="⌜",ulcorner="⌜",ulcrop="⌏",ultri="◸",Umacr="Ū",umacr="ū",uml$1="¨",UnderBar="_",UnderBrace="⏟",UnderBracket="⎵",UnderParenthesis="⏝",Union="⋃",UnionPlus="⊎",Uogon="Ų",uogon="ų",Uopf="𝕌",uopf="𝕦",UpArrowBar="⤒",uparrow="↑",UpArrow="↑",Uparrow="⇑",UpArrowDownArrow="⇅",updownarrow="↕",UpDownArrow="↕",Updownarrow="⇕",UpEquilibrium="⥮",upharpoonleft="↿",upharpoonright="↾",uplus="⊎",UpperLeftArrow="↖",UpperRightArrow="↗",upsi="υ",Upsi="ϒ",upsih="ϒ",Upsilon="Υ",upsilon="υ",UpTeeArrow="↥",UpTee="⊥",upuparrows="⇈",urcorn="⌝",urcorner="⌝",urcrop="⌎",Uring="Ů",uring="ů",urtri="◹",Uscr="𝒰",uscr="𝓊",utdot="⋰",Utilde="Ũ",utilde="ũ",utri="▵",utrif="▴",uuarr="⇈",Uuml$1="Ü",uuml$1="ü",uwangle="⦧",vangrt="⦜",varepsilon="ϵ",varkappa="ϰ",varnothing="∅",varphi="ϕ",varpi="ϖ",varpropto="∝",varr="↕",vArr="⇕",varrho="ϱ",varsigma="ς",varsubsetneq="⊊︀",varsubsetneqq="⫋︀",varsupsetneq="⊋︀",varsupsetneqq="⫌︀",vartheta="ϑ",vartriangleleft="⊲",vartriangleright="⊳",vBar="⫨",Vbar="⫫",vBarv="⫩",Vcy="В",vcy="в",vdash="⊢",vDash="⊨",Vdash="⊩",VDash="⊫",Vdashl="⫦",veebar="⊻",vee="∨",Vee="⋁",veeeq="≚",vellip="⋮",verbar="|",Verbar="‖",vert="|",Vert="‖",VerticalBar="∣",VerticalLine="|",VerticalSeparator="❘",VerticalTilde="≀",VeryThinSpace=" ",Vfr="𝔙",vfr="𝔳",vltri="⊲",vnsub="⊂⃒",vnsup="⊃⃒",Vopf="𝕍",vopf="𝕧",vprop="∝",vrtri="⊳",Vscr="𝒱",vscr="𝓋",vsubnE="⫋︀",vsubne="⊊︀",vsupnE="⫌︀",vsupne="⊋︀",Vvdash="⊪",vzigzag="⦚",Wcirc="Ŵ",wcirc="ŵ",wedbar="⩟",wedge="∧",Wedge="⋀",wedgeq="≙",weierp="℘",Wfr="𝔚",wfr="𝔴",Wopf="𝕎",wopf="𝕨",wp="℘",wr="≀",wreath="≀",Wscr="𝒲",wscr="𝓌",xcap="⋂",xcirc="◯",xcup="⋃",xdtri="▽",Xfr="𝔛",xfr="𝔵",xharr="⟷",xhArr="⟺",Xi="Ξ",xi="ξ",xlarr="⟵",xlArr="⟸",xmap="⟼",xnis="⋻",xodot="⨀",Xopf="𝕏",xopf="𝕩",xoplus="⨁",xotime="⨂",xrarr="⟶",xrArr="⟹",Xscr="𝒳",xscr="𝓍",xsqcup="⨆",xuplus="⨄",xutri="△",xvee="⋁",xwedge="⋀",Yacute$1="Ý",yacute$1="ý",YAcy="Я",yacy="я",Ycirc="Ŷ",ycirc="ŷ",Ycy="Ы",ycy="ы",yen$1="¥",Yfr="𝔜",yfr="𝔶",YIcy="Ї",yicy="ї",Yopf="𝕐",yopf="𝕪",Yscr="𝒴",yscr="𝓎",YUcy="Ю",yucy="ю",yuml$1="ÿ",Yuml="Ÿ",Zacute="Ź",zacute="ź",Zcaron="Ž",zcaron="ž",Zcy="З",zcy="з",Zdot="Ż",zdot="ż",zeetrf="ℨ",ZeroWidthSpace="​",Zeta="Ζ",zeta="ζ",zfr="𝔷",Zfr="ℨ",ZHcy="Ж",zhcy="ж",zigrarr="⇝",zopf="𝕫",Zopf="ℤ",Zscr="𝒵",zscr="𝓏",zwj="‍",zwnj="‌",entities={Aacute:Aacute$1,aacute:aacute$1,Abreve,abreve,ac,acd,acE,Acirc:Acirc$1,acirc:acirc$1,acute:acute$1,Acy,acy,AElig:AElig$1,aelig:aelig$1,af,Afr,afr,Agrave:Agrave$1,agrave:agrave$1,alefsym,aleph,Alpha,alpha,Amacr,amacr,amalg,amp:amp$2,AMP:AMP$1,andand,And,and,andd,andslope,andv,ang,ange,angle,angmsdaa,angmsdab,angmsdac,angmsdad,angmsdae,angmsdaf,angmsdag,angmsdah,angmsd,angrt,angrtvb,angrtvbd,angsph,angst,angzarr,Aogon,aogon,Aopf,aopf,apacir,ap,apE,ape,apid,apos:apos$1,ApplyFunction,approx,approxeq,Aring:Aring$1,aring:aring$1,Ascr,ascr,Assign,ast,asymp,asympeq,Atilde:Atilde$1,atilde:atilde$1,Auml:Auml$1,auml:auml$1,awconint,awint,backcong,backepsilon,backprime,backsim,backsimeq,Backslash,Barv,barvee,barwed,Barwed,barwedge,bbrk,bbrktbrk,bcong,Bcy,bcy,bdquo,becaus,because,Because,bemptyv,bepsi,bernou,Bernoullis,Beta,beta,beth,between,Bfr,bfr,bigcap,bigcirc,bigcup,bigodot,bigoplus,bigotimes,bigsqcup,bigstar,bigtriangledown,bigtriangleup,biguplus,bigvee,bigwedge,bkarow,blacklozenge,blacksquare,blacktriangle,blacktriangledown,blacktriangleleft,blacktriangleright,blank,blk12,blk14,blk34,block,bne,bnequiv,bNot,bnot,Bopf,bopf,bot,bottom,bowtie,boxbox,boxdl,boxdL,boxDl,boxDL,boxdr,boxdR,boxDr,boxDR,boxh,boxH,boxhd,boxHd,boxhD,boxHD,boxhu,boxHu,boxhU,boxHU,boxminus,boxplus,boxtimes,boxul,boxuL,boxUl,boxUL,boxur,boxuR,boxUr,boxUR,boxv,boxV,boxvh,boxvH,boxVh,boxVH,boxvl,boxvL,boxVl,boxVL,boxvr,boxvR,boxVr,boxVR,bprime,breve,Breve,brvbar:brvbar$1,bscr,Bscr,bsemi,bsim,bsime,bsolb,bsol,bsolhsub,bull,bullet,bump,bumpE,bumpe,Bumpeq,bumpeq,Cacute,cacute,capand,capbrcup,capcap,cap,Cap,capcup,capdot,CapitalDifferentialD,caps,caret,caron,Cayleys,ccaps,Ccaron,ccaron,Ccedil:Ccedil$1,ccedil:ccedil$1,Ccirc,ccirc,Cconint,ccups,ccupssm,Cdot,cdot,cedil:cedil$1,Cedilla,cemptyv,cent:cent$1,centerdot,CenterDot,cfr,Cfr,CHcy,chcy,check,checkmark,Chi,chi,circ,circeq,circlearrowleft,circlearrowright,circledast,circledcirc,circleddash,CircleDot,circledR,circledS,CircleMinus,CirclePlus,CircleTimes,cir,cirE,cire,cirfnint,cirmid,cirscir,ClockwiseContourIntegral,CloseCurlyDoubleQuote,CloseCurlyQuote,clubs,clubsuit,colon,Colon,Colone,colone,coloneq,comma,commat,comp,compfn,complement,complexes,cong,congdot,Congruent,conint,Conint,ContourIntegral,copf,Copf,coprod,Coproduct,copy:copy$1,COPY:COPY$1,copysr,CounterClockwiseContourIntegral,crarr,cross,Cross,Cscr,cscr,csub,csube,csup,csupe,ctdot,cudarrl,cudarrr,cuepr,cuesc,cularr,cularrp,cupbrcap,cupcap,CupCap,cup,Cup,cupcup,cupdot,cupor,cups,curarr,curarrm,curlyeqprec,curlyeqsucc,curlyvee,curlywedge,curren:curren$1,curvearrowleft,curvearrowright,cuvee,cuwed,cwconint,cwint,cylcty,dagger,Dagger,daleth,darr,Darr,dArr,dash,Dashv,dashv,dbkarow,dblac,Dcaron,dcaron,Dcy,dcy,ddagger,ddarr,DD,dd,DDotrahd,ddotseq,deg:deg$1,Del,Delta,delta,demptyv,dfisht,Dfr,dfr,dHar,dharl,dharr,DiacriticalAcute,DiacriticalDot,DiacriticalDoubleAcute,DiacriticalGrave,DiacriticalTilde,diam,diamond,Diamond,diamondsuit,diams,die,DifferentialD,digamma,disin,div,divide:divide$1,divideontimes,divonx,DJcy,djcy,dlcorn,dlcrop,dollar,Dopf,dopf,Dot,dot,DotDot,doteq,doteqdot,DotEqual,dotminus,dotplus,dotsquare,doublebarwedge,DoubleContourIntegral,DoubleDot,DoubleDownArrow,DoubleLeftArrow,DoubleLeftRightArrow,DoubleLeftTee,DoubleLongLeftArrow,DoubleLongLeftRightArrow,DoubleLongRightArrow,DoubleRightArrow,DoubleRightTee,DoubleUpArrow,DoubleUpDownArrow,DoubleVerticalBar,DownArrowBar,downarrow,DownArrow,Downarrow,DownArrowUpArrow,DownBreve,downdownarrows,downharpoonleft,downharpoonright,DownLeftRightVector,DownLeftTeeVector,DownLeftVectorBar,DownLeftVector,DownRightTeeVector,DownRightVectorBar,DownRightVector,DownTeeArrow,DownTee,drbkarow,drcorn,drcrop,Dscr,dscr,DScy,dscy,dsol,Dstrok,dstrok,dtdot,dtri,dtrif,duarr,duhar,dwangle,DZcy,dzcy,dzigrarr,Eacute:Eacute$1,eacute:eacute$1,easter,Ecaron,ecaron,Ecirc:Ecirc$1,ecirc:ecirc$1,ecir,ecolon,Ecy,ecy,eDDot,Edot,edot,eDot,ee,efDot,Efr,efr,eg,Egrave:Egrave$1,egrave:egrave$1,egs,egsdot,el,Element,elinters,ell,els,elsdot,Emacr,emacr,empty,emptyset,EmptySmallSquare,emptyv,EmptyVerySmallSquare,emsp13,emsp14,emsp,ENG,eng,ensp,Eogon,eogon,Eopf,eopf,epar,eparsl,eplus,epsi,Epsilon,epsilon,epsiv,eqcirc,eqcolon,eqsim,eqslantgtr,eqslantless,Equal,equals,EqualTilde,equest,Equilibrium,equiv,equivDD,eqvparsl,erarr,erDot,escr,Escr,esdot,Esim,esim,Eta,eta,ETH:ETH$1,eth:eth$1,Euml:Euml$1,euml:euml$1,euro,excl,exist,Exists,expectation,exponentiale,ExponentialE,fallingdotseq,Fcy,fcy,female,ffilig,fflig,ffllig,Ffr,ffr,filig,FilledSmallSquare,FilledVerySmallSquare,fjlig,flat,fllig,fltns,fnof,Fopf,fopf,forall,ForAll,fork,forkv,Fouriertrf,fpartint,frac12:frac12$1,frac13,frac14:frac14$1,frac15,frac16,frac18,frac23,frac25,frac34:frac34$1,frac35,frac38,frac45,frac56,frac58,frac78,frasl,frown,fscr,Fscr,gacute,Gamma,gamma,Gammad,gammad,gap,Gbreve,gbreve,Gcedil,Gcirc,gcirc,Gcy,gcy,Gdot,gdot,ge,gE,gEl,gel,geq,geqq,geqslant,gescc,ges,gesdot,gesdoto,gesdotol,gesl,gesles,Gfr,gfr,gg,Gg,ggg,gimel,GJcy,gjcy,gla,gl,glE,glj,gnap,gnapprox,gne,gnE,gneq,gneqq,gnsim,Gopf,gopf,grave,GreaterEqual,GreaterEqualLess,GreaterFullEqual,GreaterGreater,GreaterLess,GreaterSlantEqual,GreaterTilde,Gscr,gscr,gsim,gsime,gsiml,gtcc,gtcir,gt:gt$2,GT:GT$1,Gt,gtdot,gtlPar,gtquest,gtrapprox,gtrarr,gtrdot,gtreqless,gtreqqless,gtrless,gtrsim,gvertneqq,gvnE,Hacek,hairsp,half,hamilt,HARDcy,hardcy,harrcir,harr,hArr,harrw,Hat,hbar,Hcirc,hcirc,hearts,heartsuit,hellip,hercon,hfr,Hfr,HilbertSpace,hksearow,hkswarow,hoarr,homtht,hookleftarrow,hookrightarrow,hopf,Hopf,horbar,HorizontalLine,hscr,Hscr,hslash,Hstrok,hstrok,HumpDownHump,HumpEqual,hybull,hyphen,Iacute:Iacute$1,iacute:iacute$1,ic,Icirc:Icirc$1,icirc:icirc$1,Icy,icy,Idot,IEcy,iecy,iexcl:iexcl$1,iff,ifr,Ifr,Igrave:Igrave$1,igrave:igrave$1,ii,iiiint,iiint,iinfin,iiota,IJlig,ijlig,Imacr,imacr,image,ImaginaryI,imagline,imagpart,imath,Im,imof,imped,Implies,incare,in:"∈",infin,infintie,inodot,intcal,int,Int,integers,Integral,intercal,Intersection,intlarhk,intprod,InvisibleComma,InvisibleTimes,IOcy,iocy,Iogon,iogon,Iopf,iopf,Iota,iota,iprod,iquest:iquest$1,iscr,Iscr,isin,isindot,isinE,isins,isinsv,isinv,it,Itilde,itilde,Iukcy,iukcy,Iuml:Iuml$1,iuml:iuml$1,Jcirc,jcirc,Jcy,jcy,Jfr,jfr,jmath,Jopf,jopf,Jscr,jscr,Jsercy,jsercy,Jukcy,jukcy,Kappa,kappa,kappav,Kcedil,kcedil,Kcy,kcy,Kfr,kfr,kgreen,KHcy,khcy,KJcy,kjcy,Kopf,kopf,Kscr,kscr,lAarr,Lacute,lacute,laemptyv,lagran,Lambda,lambda,lang,Lang,langd,langle,lap,Laplacetrf,laquo:laquo$1,larrb,larrbfs,larr,Larr,lArr,larrfs,larrhk,larrlp,larrpl,larrsim,larrtl,latail,lAtail,lat,late,lates,lbarr,lBarr,lbbrk,lbrace,lbrack,lbrke,lbrksld,lbrkslu,Lcaron,lcaron,Lcedil,lcedil,lceil,lcub,Lcy,lcy,ldca,ldquo,ldquor,ldrdhar,ldrushar,ldsh,le,lE,LeftAngleBracket,LeftArrowBar,leftarrow,LeftArrow,Leftarrow,LeftArrowRightArrow,leftarrowtail,LeftCeiling,LeftDoubleBracket,LeftDownTeeVector,LeftDownVectorBar,LeftDownVector,LeftFloor,leftharpoondown,leftharpoonup,leftleftarrows,leftrightarrow,LeftRightArrow,Leftrightarrow,leftrightarrows,leftrightharpoons,leftrightsquigarrow,LeftRightVector,LeftTeeArrow,LeftTee,LeftTeeVector,leftthreetimes,LeftTriangleBar,LeftTriangle,LeftTriangleEqual,LeftUpDownVector,LeftUpTeeVector,LeftUpVectorBar,LeftUpVector,LeftVectorBar,LeftVector,lEg,leg,leq,leqq,leqslant,lescc,les,lesdot,lesdoto,lesdotor,lesg,lesges,lessapprox,lessdot,lesseqgtr,lesseqqgtr,LessEqualGreater,LessFullEqual,LessGreater,lessgtr,LessLess,lesssim,LessSlantEqual,LessTilde,lfisht,lfloor,Lfr,lfr,lg,lgE,lHar,lhard,lharu,lharul,lhblk,LJcy,ljcy,llarr,ll,Ll,llcorner,Lleftarrow,llhard,lltri,Lmidot,lmidot,lmoustache,lmoust,lnap,lnapprox,lne,lnE,lneq,lneqq,lnsim,loang,loarr,lobrk,longleftarrow,LongLeftArrow,Longleftarrow,longleftrightarrow,LongLeftRightArrow,Longleftrightarrow,longmapsto,longrightarrow,LongRightArrow,Longrightarrow,looparrowleft,looparrowright,lopar,Lopf,lopf,loplus,lotimes,lowast,lowbar,LowerLeftArrow,LowerRightArrow,loz,lozenge,lozf,lpar,lparlt,lrarr,lrcorner,lrhar,lrhard,lrm,lrtri,lsaquo,lscr,Lscr,lsh,Lsh,lsim,lsime,lsimg,lsqb,lsquo,lsquor,Lstrok,lstrok,ltcc,ltcir,lt:lt$2,LT:LT$1,Lt,ltdot,lthree,ltimes,ltlarr,ltquest,ltri,ltrie,ltrif,ltrPar,lurdshar,luruhar,lvertneqq,lvnE,macr:macr$1,male,malt,maltese,Map:"⤅",map,mapsto,mapstodown,mapstoleft,mapstoup,marker,mcomma,Mcy,mcy,mdash,mDDot,measuredangle,MediumSpace,Mellintrf,Mfr,mfr,mho,micro:micro$1,midast,midcir,mid,middot:middot$1,minusb,minus,minusd,minusdu,MinusPlus,mlcp,mldr,mnplus,models,Mopf,mopf,mp,mscr,Mscr,mstpos,Mu,mu,multimap,mumap,nabla,Nacute,nacute,nang,nap,napE,napid,napos,napprox,natural,naturals,natur,nbsp:nbsp$1,nbump,nbumpe,ncap,Ncaron,ncaron,Ncedil,ncedil,ncong,ncongdot,ncup,Ncy,ncy,ndash,nearhk,nearr,neArr,nearrow,ne,nedot,NegativeMediumSpace,NegativeThickSpace,NegativeThinSpace,NegativeVeryThinSpace,nequiv,nesear,nesim,NestedGreaterGreater,NestedLessLess,NewLine,nexist,nexists,Nfr,nfr,ngE,nge,ngeq,ngeqq,ngeqslant,nges,nGg,ngsim,nGt,ngt,ngtr,nGtv,nharr,nhArr,nhpar,ni,nis,nisd,niv,NJcy,njcy,nlarr,nlArr,nldr,nlE,nle,nleftarrow,nLeftarrow,nleftrightarrow,nLeftrightarrow,nleq,nleqq,nleqslant,nles,nless,nLl,nlsim,nLt,nlt,nltri,nltrie,nLtv,nmid,NoBreak,NonBreakingSpace,nopf,Nopf,Not,not:not$1,NotCongruent,NotCupCap,NotDoubleVerticalBar,NotElement,NotEqual,NotEqualTilde,NotExists,NotGreater,NotGreaterEqual,NotGreaterFullEqual,NotGreaterGreater,NotGreaterLess,NotGreaterSlantEqual,NotGreaterTilde,NotHumpDownHump,NotHumpEqual,notin,notindot,notinE,notinva,notinvb,notinvc,NotLeftTriangleBar,NotLeftTriangle,NotLeftTriangleEqual,NotLess,NotLessEqual,NotLessGreater,NotLessLess,NotLessSlantEqual,NotLessTilde,NotNestedGreaterGreater,NotNestedLessLess,notni,notniva,notnivb,notnivc,NotPrecedes,NotPrecedesEqual,NotPrecedesSlantEqual,NotReverseElement,NotRightTriangleBar,NotRightTriangle,NotRightTriangleEqual,NotSquareSubset,NotSquareSubsetEqual,NotSquareSuperset,NotSquareSupersetEqual,NotSubset,NotSubsetEqual,NotSucceeds,NotSucceedsEqual,NotSucceedsSlantEqual,NotSucceedsTilde,NotSuperset,NotSupersetEqual,NotTilde,NotTildeEqual,NotTildeFullEqual,NotTildeTilde,NotVerticalBar,nparallel,npar,nparsl,npart,npolint,npr,nprcue,nprec,npreceq,npre,nrarrc,nrarr,nrArr,nrarrw,nrightarrow,nRightarrow,nrtri,nrtrie,nsc,nsccue,nsce,Nscr,nscr,nshortmid,nshortparallel,nsim,nsime,nsimeq,nsmid,nspar,nsqsube,nsqsupe,nsub,nsubE,nsube,nsubset,nsubseteq,nsubseteqq,nsucc,nsucceq,nsup,nsupE,nsupe,nsupset,nsupseteq,nsupseteqq,ntgl,Ntilde:Ntilde$1,ntilde:ntilde$1,ntlg,ntriangleleft,ntrianglelefteq,ntriangleright,ntrianglerighteq,Nu,nu,num,numero,numsp,nvap,nvdash,nvDash,nVdash,nVDash,nvge,nvgt,nvHarr,nvinfin,nvlArr,nvle,nvlt,nvltrie,nvrArr,nvrtrie,nvsim,nwarhk,nwarr,nwArr,nwarrow,nwnear,Oacute:Oacute$1,oacute:oacute$1,oast,Ocirc:Ocirc$1,ocirc:ocirc$1,ocir,Ocy,ocy,odash,Odblac,odblac,odiv,odot,odsold,OElig,oelig,ofcir,Ofr,ofr,ogon,Ograve:Ograve$1,ograve:ograve$1,ogt,ohbar,ohm,oint,olarr,olcir,olcross,oline,olt,Omacr,omacr,Omega,omega,Omicron,omicron,omid,ominus,Oopf,oopf,opar,OpenCurlyDoubleQuote,OpenCurlyQuote,operp,oplus,orarr,Or,or,ord,order,orderof,ordf:ordf$1,ordm:ordm$1,origof,oror,orslope,orv,oS,Oscr,oscr,Oslash:Oslash$1,oslash:oslash$1,osol,Otilde:Otilde$1,otilde:otilde$1,otimesas,Otimes,otimes,Ouml:Ouml$1,ouml:ouml$1,ovbar,OverBar,OverBrace,OverBracket,OverParenthesis,para:para$1,parallel,par,parsim,parsl,part,PartialD,Pcy,pcy,percnt,period,permil,perp,pertenk,Pfr,pfr,Phi,phi,phiv,phmmat,phone,Pi,pi,pitchfork,piv,planck,planckh,plankv,plusacir,plusb,pluscir,plus,plusdo,plusdu,pluse,PlusMinus,plusmn:plusmn$1,plussim,plustwo,pm,Poincareplane,pointint,popf,Popf,pound:pound$1,prap,Pr,pr,prcue,precapprox,prec,preccurlyeq,Precedes,PrecedesEqual,PrecedesSlantEqual,PrecedesTilde,preceq,precnapprox,precneqq,precnsim,pre,prE,precsim,prime,Prime,primes,prnap,prnE,prnsim,prod,Product,profalar,profline,profsurf,prop,Proportional,Proportion,propto,prsim,prurel,Pscr,pscr,Psi,psi,puncsp,Qfr,qfr,qint,qopf,Qopf,qprime,Qscr,qscr,quaternions,quatint,quest,questeq,quot:quot$2,QUOT:QUOT$1,rAarr,race,Racute,racute,radic,raemptyv,rang,Rang,rangd,range,rangle,raquo:raquo$1,rarrap,rarrb,rarrbfs,rarrc,rarr,Rarr,rArr,rarrfs,rarrhk,rarrlp,rarrpl,rarrsim,Rarrtl,rarrtl,rarrw,ratail,rAtail,ratio,rationals,rbarr,rBarr,RBarr,rbbrk,rbrace,rbrack,rbrke,rbrksld,rbrkslu,Rcaron,rcaron,Rcedil,rcedil,rceil,rcub,Rcy,rcy,rdca,rdldhar,rdquo,rdquor,rdsh,real,realine,realpart,reals,Re,rect,reg:reg$1,REG:REG$1,ReverseElement,ReverseEquilibrium,ReverseUpEquilibrium,rfisht,rfloor,rfr,Rfr,rHar,rhard,rharu,rharul,Rho,rho,rhov,RightAngleBracket,RightArrowBar,rightarrow,RightArrow,Rightarrow,RightArrowLeftArrow,rightarrowtail,RightCeiling,RightDoubleBracket,RightDownTeeVector,RightDownVectorBar,RightDownVector,RightFloor,rightharpoondown,rightharpoonup,rightleftarrows,rightleftharpoons,rightrightarrows,rightsquigarrow,RightTeeArrow,RightTee,RightTeeVector,rightthreetimes,RightTriangleBar,RightTriangle,RightTriangleEqual,RightUpDownVector,RightUpTeeVector,RightUpVectorBar,RightUpVector,RightVectorBar,RightVector,ring,risingdotseq,rlarr,rlhar,rlm,rmoustache,rmoust,rnmid,roang,roarr,robrk,ropar,ropf,Ropf,roplus,rotimes,RoundImplies,rpar,rpargt,rppolint,rrarr,Rrightarrow,rsaquo,rscr,Rscr,rsh,Rsh,rsqb,rsquo,rsquor,rthree,rtimes,rtri,rtrie,rtrif,rtriltri,RuleDelayed,ruluhar,rx,Sacute,sacute,sbquo,scap,Scaron,scaron,Sc,sc,sccue,sce,scE,Scedil,scedil,Scirc,scirc,scnap,scnE,scnsim,scpolint,scsim,Scy,scy,sdotb,sdot,sdote,searhk,searr,seArr,searrow,sect:sect$1,semi,seswar,setminus,setmn,sext,Sfr,sfr,sfrown,sharp,SHCHcy,shchcy,SHcy,shcy,ShortDownArrow,ShortLeftArrow,shortmid,shortparallel,ShortRightArrow,ShortUpArrow,shy:shy$1,Sigma,sigma,sigmaf,sigmav,sim,simdot,sime,simeq,simg,simgE,siml,simlE,simne,simplus,simrarr,slarr,SmallCircle,smallsetminus,smashp,smeparsl,smid,smile,smt,smte,smtes,SOFTcy,softcy,solbar,solb,sol,Sopf,sopf,spades,spadesuit,spar,sqcap,sqcaps,sqcup,sqcups,Sqrt,sqsub,sqsube,sqsubset,sqsubseteq,sqsup,sqsupe,sqsupset,sqsupseteq,square,Square,SquareIntersection,SquareSubset,SquareSubsetEqual,SquareSuperset,SquareSupersetEqual,SquareUnion,squarf,squ,squf,srarr,Sscr,sscr,ssetmn,ssmile,sstarf,Star,star,starf,straightepsilon,straightphi,strns,sub,Sub,subdot,subE,sube,subedot,submult,subnE,subne,subplus,subrarr,subset,Subset,subseteq,subseteqq,SubsetEqual,subsetneq,subsetneqq,subsim,subsub,subsup,succapprox,succ,succcurlyeq,Succeeds,SucceedsEqual,SucceedsSlantEqual,SucceedsTilde,succeq,succnapprox,succneqq,succnsim,succsim,SuchThat,sum,Sum,sung,sup1:sup1$1,sup2:sup2$1,sup3:sup3$1,sup,Sup,supdot,supdsub,supE,supe,supedot,Superset,SupersetEqual,suphsol,suphsub,suplarr,supmult,supnE,supne,supplus,supset,Supset,supseteq,supseteqq,supsetneq,supsetneqq,supsim,supsub,supsup,swarhk,swarr,swArr,swarrow,swnwar,szlig:szlig$1,Tab,target,Tau,tau,tbrk,Tcaron,tcaron,Tcedil,tcedil,Tcy,tcy,tdot,telrec,Tfr,tfr,there4,therefore,Therefore,Theta,theta,thetasym,thetav,thickapprox,thicksim,ThickSpace,ThinSpace,thinsp,thkap,thksim,THORN:THORN$1,thorn:thorn$1,tilde,Tilde,TildeEqual,TildeFullEqual,TildeTilde,timesbar,timesb,times:times$1,timesd,tint,toea,topbot,topcir,top,Topf,topf,topfork,tosa,tprime,trade,TRADE,triangle,triangledown,triangleleft,trianglelefteq,triangleq,triangleright,trianglerighteq,tridot,trie,triminus,TripleDot,triplus,trisb,tritime,trpezium,Tscr,tscr,TScy,tscy,TSHcy,tshcy,Tstrok,tstrok,twixt,twoheadleftarrow,twoheadrightarrow,Uacute:Uacute$1,uacute:uacute$1,uarr,Uarr,uArr,Uarrocir,Ubrcy,ubrcy,Ubreve,ubreve,Ucirc:Ucirc$1,ucirc:ucirc$1,Ucy,ucy,udarr,Udblac,udblac,udhar,ufisht,Ufr,ufr,Ugrave:Ugrave$1,ugrave:ugrave$1,uHar,uharl,uharr,uhblk,ulcorn,ulcorner,ulcrop,ultri,Umacr,umacr,uml:uml$1,UnderBar,UnderBrace,UnderBracket,UnderParenthesis,Union,UnionPlus,Uogon,uogon,Uopf,uopf,UpArrowBar,uparrow,UpArrow,Uparrow,UpArrowDownArrow,updownarrow,UpDownArrow,Updownarrow,UpEquilibrium,upharpoonleft,upharpoonright,uplus,UpperLeftArrow,UpperRightArrow,upsi,Upsi,upsih,Upsilon,upsilon,UpTeeArrow,UpTee,upuparrows,urcorn,urcorner,urcrop,Uring,uring,urtri,Uscr,uscr,utdot,Utilde,utilde,utri,utrif,uuarr,Uuml:Uuml$1,uuml:uuml$1,uwangle,vangrt,varepsilon,varkappa,varnothing,varphi,varpi,varpropto,varr,vArr,varrho,varsigma,varsubsetneq,varsubsetneqq,varsupsetneq,varsupsetneqq,vartheta,vartriangleleft,vartriangleright,vBar,Vbar,vBarv,Vcy,vcy,vdash,vDash,Vdash,VDash,Vdashl,veebar,vee,Vee,veeeq,vellip,verbar,Verbar,vert,Vert,VerticalBar,VerticalLine,VerticalSeparator,VerticalTilde,VeryThinSpace,Vfr,vfr,vltri,vnsub,vnsup,Vopf,vopf,vprop,vrtri,Vscr,vscr,vsubnE,vsubne,vsupnE,vsupne,Vvdash,vzigzag,Wcirc,wcirc,wedbar,wedge,Wedge,wedgeq,weierp,Wfr,wfr,Wopf,wopf,wp,wr,wreath,Wscr,wscr,xcap,xcirc,xcup,xdtri,Xfr,xfr,xharr,xhArr,Xi,xi,xlarr,xlArr,xmap,xnis,xodot,Xopf,xopf,xoplus,xotime,xrarr,xrArr,Xscr,xscr,xsqcup,xuplus,xutri,xvee,xwedge,Yacute:Yacute$1,yacute:yacute$1,YAcy,yacy,Ycirc,ycirc,Ycy,ycy,yen:yen$1,Yfr,yfr,YIcy,yicy,Yopf,yopf,Yscr,yscr,YUcy,yucy,yuml:yuml$1,Yuml,Zacute,zacute,Zcaron,zcaron,Zcy,zcy,Zdot,zdot,zeetrf,ZeroWidthSpace,Zeta,zeta,zfr,Zfr,ZHcy,zhcy,zigrarr,zopf,Zopf,Zscr,zscr,zwj,zwnj},entities$1=Object.freeze({__proto__:null,Aacute:Aacute$1,aacute:aacute$1,Abreve,abreve,ac,acd,acE,Acirc:Acirc$1,acirc:acirc$1,acute:acute$1,Acy,acy,AElig:AElig$1,aelig:aelig$1,af,Afr,afr,Agrave:Agrave$1,agrave:agrave$1,alefsym,aleph,Alpha,alpha,Amacr,amacr,amalg,amp:amp$2,AMP:AMP$1,andand,And,and,andd,andslope,andv,ang,ange,angle,angmsdaa,angmsdab,angmsdac,angmsdad,angmsdae,angmsdaf,angmsdag,angmsdah,angmsd,angrt,angrtvb,angrtvbd,angsph,angst,angzarr,Aogon,aogon,Aopf,aopf,apacir,ap,apE,ape,apid,apos:apos$1,ApplyFunction,approx,approxeq,Aring:Aring$1,aring:aring$1,Ascr,ascr,Assign,ast,asymp,asympeq,Atilde:Atilde$1,atilde:atilde$1,Auml:Auml$1,auml:auml$1,awconint,awint,backcong,backepsilon,backprime,backsim,backsimeq,Backslash,Barv,barvee,barwed,Barwed,barwedge,bbrk,bbrktbrk,bcong,Bcy,bcy,bdquo,becaus,because,Because,bemptyv,bepsi,bernou,Bernoullis,Beta,beta,beth,between,Bfr,bfr,bigcap,bigcirc,bigcup,bigodot,bigoplus,bigotimes,bigsqcup,bigstar,bigtriangledown,bigtriangleup,biguplus,bigvee,bigwedge,bkarow,blacklozenge,blacksquare,blacktriangle,blacktriangledown,blacktriangleleft,blacktriangleright,blank,blk12,blk14,blk34,block,bne,bnequiv,bNot,bnot,Bopf,bopf,bot,bottom,bowtie,boxbox,boxdl,boxdL,boxDl,boxDL,boxdr,boxdR,boxDr,boxDR,boxh,boxH,boxhd,boxHd,boxhD,boxHD,boxhu,boxHu,boxhU,boxHU,boxminus,boxplus,boxtimes,boxul,boxuL,boxUl,boxUL,boxur,boxuR,boxUr,boxUR,boxv,boxV,boxvh,boxvH,boxVh,boxVH,boxvl,boxvL,boxVl,boxVL,boxvr,boxvR,boxVr,boxVR,bprime,breve,Breve,brvbar:brvbar$1,bscr,Bscr,bsemi,bsim,bsime,bsolb,bsol,bsolhsub,bull,bullet,bump,bumpE,bumpe,Bumpeq,bumpeq,Cacute,cacute,capand,capbrcup,capcap,cap,Cap,capcup,capdot,CapitalDifferentialD,caps,caret,caron,Cayleys,ccaps,Ccaron,ccaron,Ccedil:Ccedil$1,ccedil:ccedil$1,Ccirc,ccirc,Cconint,ccups,ccupssm,Cdot,cdot,cedil:cedil$1,Cedilla,cemptyv,cent:cent$1,centerdot,CenterDot,cfr,Cfr,CHcy,chcy,check,checkmark,Chi,chi,circ,circeq,circlearrowleft,circlearrowright,circledast,circledcirc,circleddash,CircleDot,circledR,circledS,CircleMinus,CirclePlus,CircleTimes,cir,cirE,cire,cirfnint,cirmid,cirscir,ClockwiseContourIntegral,CloseCurlyDoubleQuote,CloseCurlyQuote,clubs,clubsuit,colon,Colon,Colone,colone,coloneq,comma,commat,comp,compfn,complement,complexes,cong,congdot,Congruent,conint,Conint,ContourIntegral,copf,Copf,coprod,Coproduct,copy:copy$1,COPY:COPY$1,copysr,CounterClockwiseContourIntegral,crarr,cross,Cross,Cscr,cscr,csub,csube,csup,csupe,ctdot,cudarrl,cudarrr,cuepr,cuesc,cularr,cularrp,cupbrcap,cupcap,CupCap,cup,Cup,cupcup,cupdot,cupor,cups,curarr,curarrm,curlyeqprec,curlyeqsucc,curlyvee,curlywedge,curren:curren$1,curvearrowleft,curvearrowright,cuvee,cuwed,cwconint,cwint,cylcty,dagger,Dagger,daleth,darr,Darr,dArr,dash,Dashv,dashv,dbkarow,dblac,Dcaron,dcaron,Dcy,dcy,ddagger,ddarr,DD,dd,DDotrahd,ddotseq,deg:deg$1,Del,Delta,delta,demptyv,dfisht,Dfr,dfr,dHar,dharl,dharr,DiacriticalAcute,DiacriticalDot,DiacriticalDoubleAcute,DiacriticalGrave,DiacriticalTilde,diam,diamond,Diamond,diamondsuit,diams,die,DifferentialD,digamma,disin,div,divide:divide$1,divideontimes,divonx,DJcy,djcy,dlcorn,dlcrop,dollar,Dopf,dopf,Dot,dot,DotDot,doteq,doteqdot,DotEqual,dotminus,dotplus,dotsquare,doublebarwedge,DoubleContourIntegral,DoubleDot,DoubleDownArrow,DoubleLeftArrow,DoubleLeftRightArrow,DoubleLeftTee,DoubleLongLeftArrow,DoubleLongLeftRightArrow,DoubleLongRightArrow,DoubleRightArrow,DoubleRightTee,DoubleUpArrow,DoubleUpDownArrow,DoubleVerticalBar,DownArrowBar,downarrow,DownArrow,Downarrow,DownArrowUpArrow,DownBreve,downdownarrows,downharpoonleft,downharpoonright,DownLeftRightVector,DownLeftTeeVector,DownLeftVectorBar,DownLeftVector,DownRightTeeVector,DownRightVectorBar,DownRightVector,DownTeeArrow,DownTee,drbkarow,drcorn,drcrop,Dscr,dscr,DScy,dscy,dsol,Dstrok,dstrok,dtdot,dtri,dtrif,duarr,duhar,dwangle,DZcy,dzcy,dzigrarr,Eacute:Eacute$1,eacute:eacute$1,easter,Ecaron,ecaron,Ecirc:Ecirc$1,ecirc:ecirc$1,ecir,ecolon,Ecy,ecy,eDDot,Edot,edot,eDot,ee,efDot,Efr,efr,eg,Egrave:Egrave$1,egrave:egrave$1,egs,egsdot,el,Element,elinters,ell,els,elsdot,Emacr,emacr,empty,emptyset,EmptySmallSquare,emptyv,EmptyVerySmallSquare,emsp13,emsp14,emsp,ENG,eng,ensp,Eogon,eogon,Eopf,eopf,epar,eparsl,eplus,epsi,Epsilon,epsilon,epsiv,eqcirc,eqcolon,eqsim,eqslantgtr,eqslantless,Equal,equals,EqualTilde,equest,Equilibrium,equiv,equivDD,eqvparsl,erarr,erDot,escr,Escr,esdot,Esim,esim,Eta,eta,ETH:ETH$1,eth:eth$1,Euml:Euml$1,euml:euml$1,euro,excl,exist,Exists,expectation,exponentiale,ExponentialE,fallingdotseq,Fcy,fcy,female,ffilig,fflig,ffllig,Ffr,ffr,filig,FilledSmallSquare,FilledVerySmallSquare,fjlig,flat,fllig,fltns,fnof,Fopf,fopf,forall,ForAll,fork,forkv,Fouriertrf,fpartint,frac12:frac12$1,frac13,frac14:frac14$1,frac15,frac16,frac18,frac23,frac25,frac34:frac34$1,frac35,frac38,frac45,frac56,frac58,frac78,frasl,frown,fscr,Fscr,gacute,Gamma,gamma,Gammad,gammad,gap,Gbreve,gbreve,Gcedil,Gcirc,gcirc,Gcy,gcy,Gdot,gdot,ge,gE,gEl,gel,geq,geqq,geqslant,gescc,ges,gesdot,gesdoto,gesdotol,gesl,gesles,Gfr,gfr,gg,Gg,ggg,gimel,GJcy,gjcy,gla,gl,glE,glj,gnap,gnapprox,gne,gnE,gneq,gneqq,gnsim,Gopf,gopf,grave,GreaterEqual,GreaterEqualLess,GreaterFullEqual,GreaterGreater,GreaterLess,GreaterSlantEqual,GreaterTilde,Gscr,gscr,gsim,gsime,gsiml,gtcc,gtcir,gt:gt$2,GT:GT$1,Gt,gtdot,gtlPar,gtquest,gtrapprox,gtrarr,gtrdot,gtreqless,gtreqqless,gtrless,gtrsim,gvertneqq,gvnE,Hacek,hairsp,half,hamilt,HARDcy,hardcy,harrcir,harr,hArr,harrw,Hat,hbar,Hcirc,hcirc,hearts,heartsuit,hellip,hercon,hfr,Hfr,HilbertSpace,hksearow,hkswarow,hoarr,homtht,hookleftarrow,hookrightarrow,hopf,Hopf,horbar,HorizontalLine,hscr,Hscr,hslash,Hstrok,hstrok,HumpDownHump,HumpEqual,hybull,hyphen,Iacute:Iacute$1,iacute:iacute$1,ic,Icirc:Icirc$1,icirc:icirc$1,Icy,icy,Idot,IEcy,iecy,iexcl:iexcl$1,iff,ifr,Ifr,Igrave:Igrave$1,igrave:igrave$1,ii,iiiint,iiint,iinfin,iiota,IJlig,ijlig,Imacr,imacr,image,ImaginaryI,imagline,imagpart,imath,Im,imof,imped,Implies,incare,infin,infintie,inodot,intcal,int,Int,integers,Integral,intercal,Intersection,intlarhk,intprod,InvisibleComma,InvisibleTimes,IOcy,iocy,Iogon,iogon,Iopf,iopf,Iota,iota,iprod,iquest:iquest$1,iscr,Iscr,isin,isindot,isinE,isins,isinsv,isinv,it,Itilde,itilde,Iukcy,iukcy,Iuml:Iuml$1,iuml:iuml$1,Jcirc,jcirc,Jcy,jcy,Jfr,jfr,jmath,Jopf,jopf,Jscr,jscr,Jsercy,jsercy,Jukcy,jukcy,Kappa,kappa,kappav,Kcedil,kcedil,Kcy,kcy,Kfr,kfr,kgreen,KHcy,khcy,KJcy,kjcy,Kopf,kopf,Kscr,kscr,lAarr,Lacute,lacute,laemptyv,lagran,Lambda,lambda,lang,Lang,langd,langle,lap,Laplacetrf,laquo:laquo$1,larrb,larrbfs,larr,Larr,lArr,larrfs,larrhk,larrlp,larrpl,larrsim,larrtl,latail,lAtail,lat,late,lates,lbarr,lBarr,lbbrk,lbrace,lbrack,lbrke,lbrksld,lbrkslu,Lcaron,lcaron,Lcedil,lcedil,lceil,lcub,Lcy,lcy,ldca,ldquo,ldquor,ldrdhar,ldrushar,ldsh,le,lE,LeftAngleBracket,LeftArrowBar,leftarrow,LeftArrow,Leftarrow,LeftArrowRightArrow,leftarrowtail,LeftCeiling,LeftDoubleBracket,LeftDownTeeVector,LeftDownVectorBar,LeftDownVector,LeftFloor,leftharpoondown,leftharpoonup,leftleftarrows,leftrightarrow,LeftRightArrow,Leftrightarrow,leftrightarrows,leftrightharpoons,leftrightsquigarrow,LeftRightVector,LeftTeeArrow,LeftTee,LeftTeeVector,leftthreetimes,LeftTriangleBar,LeftTriangle,LeftTriangleEqual,LeftUpDownVector,LeftUpTeeVector,LeftUpVectorBar,LeftUpVector,LeftVectorBar,LeftVector,lEg,leg,leq,leqq,leqslant,lescc,les,lesdot,lesdoto,lesdotor,lesg,lesges,lessapprox,lessdot,lesseqgtr,lesseqqgtr,LessEqualGreater,LessFullEqual,LessGreater,lessgtr,LessLess,lesssim,LessSlantEqual,LessTilde,lfisht,lfloor,Lfr,lfr,lg,lgE,lHar,lhard,lharu,lharul,lhblk,LJcy,ljcy,llarr,ll,Ll,llcorner,Lleftarrow,llhard,lltri,Lmidot,lmidot,lmoustache,lmoust,lnap,lnapprox,lne,lnE,lneq,lneqq,lnsim,loang,loarr,lobrk,longleftarrow,LongLeftArrow,Longleftarrow,longleftrightarrow,LongLeftRightArrow,Longleftrightarrow,longmapsto,longrightarrow,LongRightArrow,Longrightarrow,looparrowleft,looparrowright,lopar,Lopf,lopf,loplus,lotimes,lowast,lowbar,LowerLeftArrow,LowerRightArrow,loz,lozenge,lozf,lpar,lparlt,lrarr,lrcorner,lrhar,lrhard,lrm,lrtri,lsaquo,lscr,Lscr,lsh,Lsh,lsim,lsime,lsimg,lsqb,lsquo,lsquor,Lstrok,lstrok,ltcc,ltcir,lt:lt$2,LT:LT$1,Lt,ltdot,lthree,ltimes,ltlarr,ltquest,ltri,ltrie,ltrif,ltrPar,lurdshar,luruhar,lvertneqq,lvnE,macr:macr$1,male,malt,maltese,map,mapsto,mapstodown,mapstoleft,mapstoup,marker,mcomma,Mcy,mcy,mdash,mDDot,measuredangle,MediumSpace,Mellintrf,Mfr,mfr,mho,micro:micro$1,midast,midcir,mid,middot:middot$1,minusb,minus,minusd,minusdu,MinusPlus,mlcp,mldr,mnplus,models,Mopf,mopf,mp,mscr,Mscr,mstpos,Mu,mu,multimap,mumap,nabla,Nacute,nacute,nang,nap,napE,napid,napos,napprox,natural,naturals,natur,nbsp:nbsp$1,nbump,nbumpe,ncap,Ncaron,ncaron,Ncedil,ncedil,ncong,ncongdot,ncup,Ncy,ncy,ndash,nearhk,nearr,neArr,nearrow,ne,nedot,NegativeMediumSpace,NegativeThickSpace,NegativeThinSpace,NegativeVeryThinSpace,nequiv,nesear,nesim,NestedGreaterGreater,NestedLessLess,NewLine,nexist,nexists,Nfr,nfr,ngE,nge,ngeq,ngeqq,ngeqslant,nges,nGg,ngsim,nGt,ngt,ngtr,nGtv,nharr,nhArr,nhpar,ni,nis,nisd,niv,NJcy,njcy,nlarr,nlArr,nldr,nlE,nle,nleftarrow,nLeftarrow,nleftrightarrow,nLeftrightarrow,nleq,nleqq,nleqslant,nles,nless,nLl,nlsim,nLt,nlt,nltri,nltrie,nLtv,nmid,NoBreak,NonBreakingSpace,nopf,Nopf,Not,not:not$1,NotCongruent,NotCupCap,NotDoubleVerticalBar,NotElement,NotEqual,NotEqualTilde,NotExists,NotGreater,NotGreaterEqual,NotGreaterFullEqual,NotGreaterGreater,NotGreaterLess,NotGreaterSlantEqual,NotGreaterTilde,NotHumpDownHump,NotHumpEqual,notin,notindot,notinE,notinva,notinvb,notinvc,NotLeftTriangleBar,NotLeftTriangle,NotLeftTriangleEqual,NotLess,NotLessEqual,NotLessGreater,NotLessLess,NotLessSlantEqual,NotLessTilde,NotNestedGreaterGreater,NotNestedLessLess,notni,notniva,notnivb,notnivc,NotPrecedes,NotPrecedesEqual,NotPrecedesSlantEqual,NotReverseElement,NotRightTriangleBar,NotRightTriangle,NotRightTriangleEqual,NotSquareSubset,NotSquareSubsetEqual,NotSquareSuperset,NotSquareSupersetEqual,NotSubset,NotSubsetEqual,NotSucceeds,NotSucceedsEqual,NotSucceedsSlantEqual,NotSucceedsTilde,NotSuperset,NotSupersetEqual,NotTilde,NotTildeEqual,NotTildeFullEqual,NotTildeTilde,NotVerticalBar,nparallel,npar,nparsl,npart,npolint,npr,nprcue,nprec,npreceq,npre,nrarrc,nrarr,nrArr,nrarrw,nrightarrow,nRightarrow,nrtri,nrtrie,nsc,nsccue,nsce,Nscr,nscr,nshortmid,nshortparallel,nsim,nsime,nsimeq,nsmid,nspar,nsqsube,nsqsupe,nsub,nsubE,nsube,nsubset,nsubseteq,nsubseteqq,nsucc,nsucceq,nsup,nsupE,nsupe,nsupset,nsupseteq,nsupseteqq,ntgl,Ntilde:Ntilde$1,ntilde:ntilde$1,ntlg,ntriangleleft,ntrianglelefteq,ntriangleright,ntrianglerighteq,Nu,nu,num,numero,numsp,nvap,nvdash,nvDash,nVdash,nVDash,nvge,nvgt,nvHarr,nvinfin,nvlArr,nvle,nvlt,nvltrie,nvrArr,nvrtrie,nvsim,nwarhk,nwarr,nwArr,nwarrow,nwnear,Oacute:Oacute$1,oacute:oacute$1,oast,Ocirc:Ocirc$1,ocirc:ocirc$1,ocir,Ocy,ocy,odash,Odblac,odblac,odiv,odot,odsold,OElig,oelig,ofcir,Ofr,ofr,ogon,Ograve:Ograve$1,ograve:ograve$1,ogt,ohbar,ohm,oint,olarr,olcir,olcross,oline,olt,Omacr,omacr,Omega,omega,Omicron,omicron,omid,ominus,Oopf,oopf,opar,OpenCurlyDoubleQuote,OpenCurlyQuote,operp,oplus,orarr,Or,or,ord,order,orderof,ordf:ordf$1,ordm:ordm$1,origof,oror,orslope,orv,oS,Oscr,oscr,Oslash:Oslash$1,oslash:oslash$1,osol,Otilde:Otilde$1,otilde:otilde$1,otimesas,Otimes,otimes,Ouml:Ouml$1,ouml:ouml$1,ovbar,OverBar,OverBrace,OverBracket,OverParenthesis,para:para$1,parallel,par,parsim,parsl,part,PartialD,Pcy,pcy,percnt,period,permil,perp,pertenk,Pfr,pfr,Phi,phi,phiv,phmmat,phone,Pi,pi,pitchfork,piv,planck,planckh,plankv,plusacir,plusb,pluscir,plus,plusdo,plusdu,pluse,PlusMinus,plusmn:plusmn$1,plussim,plustwo,pm,Poincareplane,pointint,popf,Popf,pound:pound$1,prap,Pr,pr,prcue,precapprox,prec,preccurlyeq,Precedes,PrecedesEqual,PrecedesSlantEqual,PrecedesTilde,preceq,precnapprox,precneqq,precnsim,pre,prE,precsim,prime,Prime,primes,prnap,prnE,prnsim,prod,Product,profalar,profline,profsurf,prop,Proportional,Proportion,propto,prsim,prurel,Pscr,pscr,Psi,psi,puncsp,Qfr,qfr,qint,qopf,Qopf,qprime,Qscr,qscr,quaternions,quatint,quest,questeq,quot:quot$2,QUOT:QUOT$1,rAarr,race,Racute,racute,radic,raemptyv,rang,Rang,rangd,range,rangle,raquo:raquo$1,rarrap,rarrb,rarrbfs,rarrc,rarr,Rarr,rArr,rarrfs,rarrhk,rarrlp,rarrpl,rarrsim,Rarrtl,rarrtl,rarrw,ratail,rAtail,ratio,rationals,rbarr,rBarr,RBarr,rbbrk,rbrace,rbrack,rbrke,rbrksld,rbrkslu,Rcaron,rcaron,Rcedil,rcedil,rceil,rcub,Rcy,rcy,rdca,rdldhar,rdquo,rdquor,rdsh,real,realine,realpart,reals,Re,rect,reg:reg$1,REG:REG$1,ReverseElement,ReverseEquilibrium,ReverseUpEquilibrium,rfisht,rfloor,rfr,Rfr,rHar,rhard,rharu,rharul,Rho,rho,rhov,RightAngleBracket,RightArrowBar,rightarrow,RightArrow,Rightarrow,RightArrowLeftArrow,rightarrowtail,RightCeiling,RightDoubleBracket,RightDownTeeVector,RightDownVectorBar,RightDownVector,RightFloor,rightharpoondown,rightharpoonup,rightleftarrows,rightleftharpoons,rightrightarrows,rightsquigarrow,RightTeeArrow,RightTee,RightTeeVector,rightthreetimes,RightTriangleBar,RightTriangle,RightTriangleEqual,RightUpDownVector,RightUpTeeVector,RightUpVectorBar,RightUpVector,RightVectorBar,RightVector,ring,risingdotseq,rlarr,rlhar,rlm,rmoustache,rmoust,rnmid,roang,roarr,robrk,ropar,ropf,Ropf,roplus,rotimes,RoundImplies,rpar,rpargt,rppolint,rrarr,Rrightarrow,rsaquo,rscr,Rscr,rsh,Rsh,rsqb,rsquo,rsquor,rthree,rtimes,rtri,rtrie,rtrif,rtriltri,RuleDelayed,ruluhar,rx,Sacute,sacute,sbquo,scap,Scaron,scaron,Sc,sc,sccue,sce,scE,Scedil,scedil,Scirc,scirc,scnap,scnE,scnsim,scpolint,scsim,Scy,scy,sdotb,sdot,sdote,searhk,searr,seArr,searrow,sect:sect$1,semi,seswar,setminus,setmn,sext,Sfr,sfr,sfrown,sharp,SHCHcy,shchcy,SHcy,shcy,ShortDownArrow,ShortLeftArrow,shortmid,shortparallel,ShortRightArrow,ShortUpArrow,shy:shy$1,Sigma,sigma,sigmaf,sigmav,sim,simdot,sime,simeq,simg,simgE,siml,simlE,simne,simplus,simrarr,slarr,SmallCircle,smallsetminus,smashp,smeparsl,smid,smile,smt,smte,smtes,SOFTcy,softcy,solbar,solb,sol,Sopf,sopf,spades,spadesuit,spar,sqcap,sqcaps,sqcup,sqcups,Sqrt,sqsub,sqsube,sqsubset,sqsubseteq,sqsup,sqsupe,sqsupset,sqsupseteq,square,Square,SquareIntersection,SquareSubset,SquareSubsetEqual,SquareSuperset,SquareSupersetEqual,SquareUnion,squarf,squ,squf,srarr,Sscr,sscr,ssetmn,ssmile,sstarf,Star,star,starf,straightepsilon,straightphi,strns,sub,Sub,subdot,subE,sube,subedot,submult,subnE,subne,subplus,subrarr,subset,Subset,subseteq,subseteqq,SubsetEqual,subsetneq,subsetneqq,subsim,subsub,subsup,succapprox,succ,succcurlyeq,Succeeds,SucceedsEqual,SucceedsSlantEqual,SucceedsTilde,succeq,succnapprox,succneqq,succnsim,succsim,SuchThat,sum,Sum,sung,sup1:sup1$1,sup2:sup2$1,sup3:sup3$1,sup,Sup,supdot,supdsub,supE,supe,supedot,Superset,SupersetEqual,suphsol,suphsub,suplarr,supmult,supnE,supne,supplus,supset,Supset,supseteq,supseteqq,supsetneq,supsetneqq,supsim,supsub,supsup,swarhk,swarr,swArr,swarrow,swnwar,szlig:szlig$1,Tab,target,Tau,tau,tbrk,Tcaron,tcaron,Tcedil,tcedil,Tcy,tcy,tdot,telrec,Tfr,tfr,there4,therefore,Therefore,Theta,theta,thetasym,thetav,thickapprox,thicksim,ThickSpace,ThinSpace,thinsp,thkap,thksim,THORN:THORN$1,thorn:thorn$1,tilde,Tilde,TildeEqual,TildeFullEqual,TildeTilde,timesbar,timesb,times:times$1,timesd,tint,toea,topbot,topcir,top,Topf,topf,topfork,tosa,tprime,trade,TRADE,triangle,triangledown,triangleleft,trianglelefteq,triangleq,triangleright,trianglerighteq,tridot,trie,triminus,TripleDot,triplus,trisb,tritime,trpezium,Tscr,tscr,TScy,tscy,TSHcy,tshcy,Tstrok,tstrok,twixt,twoheadleftarrow,twoheadrightarrow,Uacute:Uacute$1,uacute:uacute$1,uarr,Uarr,uArr,Uarrocir,Ubrcy,ubrcy,Ubreve,ubreve,Ucirc:Ucirc$1,ucirc:ucirc$1,Ucy,ucy,udarr,Udblac,udblac,udhar,ufisht,Ufr,ufr,Ugrave:Ugrave$1,ugrave:ugrave$1,uHar,uharl,uharr,uhblk,ulcorn,ulcorner,ulcrop,ultri,Umacr,umacr,uml:uml$1,UnderBar,UnderBrace,UnderBracket,UnderParenthesis,Union,UnionPlus,Uogon,uogon,Uopf,uopf,UpArrowBar,uparrow,UpArrow,Uparrow,UpArrowDownArrow,updownarrow,UpDownArrow,Updownarrow,UpEquilibrium,upharpoonleft,upharpoonright,uplus,UpperLeftArrow,UpperRightArrow,upsi,Upsi,upsih,Upsilon,upsilon,UpTeeArrow,UpTee,upuparrows,urcorn,urcorner,urcrop,Uring,uring,urtri,Uscr,uscr,utdot,Utilde,utilde,utri,utrif,uuarr,Uuml:Uuml$1,uuml:uuml$1,uwangle,vangrt,varepsilon,varkappa,varnothing,varphi,varpi,varpropto,varr,vArr,varrho,varsigma,varsubsetneq,varsubsetneqq,varsupsetneq,varsupsetneqq,vartheta,vartriangleleft,vartriangleright,vBar,Vbar,vBarv,Vcy,vcy,vdash,vDash,Vdash,VDash,Vdashl,veebar,vee,Vee,veeeq,vellip,verbar,Verbar,vert,Vert,VerticalBar,VerticalLine,VerticalSeparator,VerticalTilde,VeryThinSpace,Vfr,vfr,vltri,vnsub,vnsup,Vopf,vopf,vprop,vrtri,Vscr,vscr,vsubnE,vsubne,vsupnE,vsupne,Vvdash,vzigzag,Wcirc,wcirc,wedbar,wedge,Wedge,wedgeq,weierp,Wfr,wfr,Wopf,wopf,wp,wr,wreath,Wscr,wscr,xcap,xcirc,xcup,xdtri,Xfr,xfr,xharr,xhArr,Xi,xi,xlarr,xlArr,xmap,xnis,xodot,Xopf,xopf,xoplus,xotime,xrarr,xrArr,Xscr,xscr,xsqcup,xuplus,xutri,xvee,xwedge,Yacute:Yacute$1,yacute:yacute$1,YAcy,yacy,Ycirc,ycirc,Ycy,ycy,yen:yen$1,Yfr,yfr,YIcy,yicy,Yopf,yopf,Yscr,yscr,YUcy,yucy,yuml:yuml$1,Yuml,Zacute,zacute,Zcaron,zcaron,Zcy,zcy,Zdot,zdot,zeetrf,ZeroWidthSpace,Zeta,zeta,zfr,Zfr,ZHcy,zhcy,zigrarr,zopf,Zopf,Zscr,zscr,zwj,zwnj,default:entities}),Aacute="Á",aacute="á",Acirc="Â",acirc="â",acute="´",AElig="Æ",aelig="æ",Agrave="À",agrave="à",amp$1="&",AMP="&",Aring="Å",aring="å",Atilde="Ã",atilde="ã",Auml="Ä",auml="ä",brvbar="¦",Ccedil="Ç",ccedil="ç",cedil="¸",cent="¢",copy="©",COPY="©",curren="¤",deg="°",divide="÷",Eacute="É",eacute="é",Ecirc="Ê",ecirc="ê",Egrave="È",egrave="è",ETH="Ð",eth="ð",Euml="Ë",euml="ë",frac12="½",frac14="¼",frac34="¾",gt$1=">",GT=">",Iacute="Í",iacute="í",Icirc="Î",icirc="î",iexcl="¡",Igrave="Ì",igrave="ì",iquest="¿",Iuml="Ï",iuml="ï",laquo="«",lt$1="<",LT="<",macr="¯",micro="µ",middot="·",nbsp=" ",not="¬",Ntilde="Ñ",ntilde="ñ",Oacute="Ó",oacute="ó",Ocirc="Ô",ocirc="ô",Ograve="Ò",ograve="ò",ordf="ª",ordm="º",Oslash="Ø",oslash="ø",Otilde="Õ",otilde="õ",Ouml="Ö",ouml="ö",para="¶",plusmn="±",pound="£",quot$1='"',QUOT='"',raquo="»",reg="®",REG="®",sect="§",shy="­",sup1="¹",sup2="²",sup3="³",szlig="ß",THORN="Þ",thorn="þ",times="×",Uacute="Ú",uacute="ú",Ucirc="Û",ucirc="û",Ugrave="Ù",ugrave="ù",uml="¨",Uuml="Ü",uuml="ü",Yacute="Ý",yacute="ý",yen="¥",yuml="ÿ",legacy={Aacute,aacute,Acirc,acirc,acute,AElig,aelig,Agrave,agrave,amp:amp$1,AMP,Aring,aring,Atilde,atilde,Auml,auml,brvbar,Ccedil,ccedil,cedil,cent,copy,COPY,curren,deg,divide,Eacute,eacute,Ecirc,ecirc,Egrave,egrave,ETH,eth,Euml,euml,frac12,frac14,frac34,gt:gt$1,GT,Iacute,iacute,Icirc,icirc,iexcl,Igrave,igrave,iquest,Iuml,iuml,laquo,lt:lt$1,LT,macr,micro,middot,nbsp,not,Ntilde,ntilde,Oacute,oacute,Ocirc,ocirc,Ograve,ograve,ordf,ordm,Oslash,oslash,Otilde,otilde,Ouml,ouml,para,plusmn,pound,quot:quot$1,QUOT,raquo,reg,REG,sect,shy,sup1,sup2,sup3,szlig,THORN,thorn,times,Uacute,uacute,Ucirc,ucirc,Ugrave,ugrave,uml,Uuml,uuml,Yacute,yacute,yen,yuml},legacy$1=Object.freeze({__proto__:null,Aacute,aacute,Acirc,acirc,acute,AElig,aelig,Agrave,agrave,amp:amp$1,AMP,Aring,aring,Atilde,atilde,Auml,auml,brvbar,Ccedil,ccedil,cedil,cent,copy,COPY,curren,deg,divide,Eacute,eacute,Ecirc,ecirc,Egrave,egrave,ETH,eth,Euml,euml,frac12,frac14,frac34,gt:gt$1,GT,Iacute,iacute,Icirc,icirc,iexcl,Igrave,igrave,iquest,Iuml,iuml,laquo,lt:lt$1,LT,macr,micro,middot,nbsp,not,Ntilde,ntilde,Oacute,oacute,Ocirc,ocirc,Ograve,ograve,ordf,ordm,Oslash,oslash,Otilde,otilde,Ouml,ouml,para,plusmn,pound,quot:quot$1,QUOT,raquo,reg,REG,sect,shy,sup1,sup2,sup3,szlig,THORN,thorn,times,Uacute,uacute,Ucirc,ucirc,Ugrave,ugrave,uml,Uuml,uuml,Yacute,yacute,yen,yuml,default:legacy}),amp="&",apos="'",gt=">",lt="<",quot='"',xml={amp,apos,gt,lt,quot},xml$1=Object.freeze({__proto__:null,amp,apos,gt,lt,quot,default:xml}),decode$1={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},decode$2=Object.freeze({__proto__:null,default:decode$1}),require$$0$1=getCjsExportFromNamespace(decode$2),decode_codepoint=createCommonjsModule((function(t,e){var i=commonjsGlobal&&commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(require$$0$1),r=String.fromCodePoint||function(t){var e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e+=String.fromCharCode(t)};e.default=function(t){return t>=55296&&t<=57343||t>1114111?"�":(t in n.default&&(t=n.default[t]),r(t))}}));unwrapExports(decode_codepoint);var require$$0=getCjsExportFromNamespace(entities$1),require$$1=getCjsExportFromNamespace(legacy$1),require$$2=getCjsExportFromNamespace(xml$1),decode=createCommonjsModule((function(t,e){var i=commonjsGlobal&&commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHTML=e.decodeHTMLStrict=e.decodeXML=void 0;var n=i(require$$0),r=i(require$$1),s=i(require$$2),o=i(decode_codepoint),l=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;function a(t){var e=u(t);return function(t){return String(t).replace(l,e)}}e.decodeXML=a(s.default),e.decodeHTMLStrict=a(n.default);var h=function(t,e){return tdecode_3(t)}}parse(t){return parser_1(t,this.options)}}function convertEmptyStringAndObject(t,e){return""===t?e?{}:void 0:t}function ensureIsArray(t,e=!1){if(null==t)return[];let i;return i=Array.isArray(t)?t.map(t=>convertEmptyStringAndObject(t,e)):[convertEmptyStringAndObject(t,e)],i.filter(t=>t)}class CollaborationConverter{constructor(t){this.convertedElements=t}deserialize(t){ensureIsArray(t).forEach(t=>this.parseCollaboration(t))}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow)}buildParticipant(t){ensureIsArray(t).forEach(t=>{this.convertedElements.registerParticipant(new Participant(t.id,t.name,t.processRef))})}buildMessageFlows(t){ensureIsArray(t).forEach(t=>{this.convertedElements.registerMessageFlow(new MessageFlow(t.id,t.name,t.sourceRef,t.targetRef))})}}class ProcessConverter{constructor(t){this.convertedElements=t,this.defaultSequenceFlowIds=[]}deserialize(t){ensureIsArray(t).forEach(t=>this.parseProcess(t))}parseProcess(t){this.convertedElements.registerProcess(new ShapeBpmnElement(t.id,t.name,ShapeBpmnElementKind.POOL)),this.buildProcessInnerElements(t)}buildProcessInnerElements(t){const e=t.id;ShapeUtil.flowNodeKinds().filter(t=>t!=ShapeBpmnElementKind.EVENT_BOUNDARY).forEach(i=>this.buildFlowNodeBpmnElements(e,t[i],i)),this.buildFlowNodeBpmnElements(e,t.boundaryEvent,ShapeBpmnElementKind.EVENT_BOUNDARY),this.buildLaneBpmnElements(e,t[ShapeBpmnElementKind.LANE]),this.buildLaneSetBpmnElements(e,t.laneSet),this.buildSequenceFlows(t[FlowKind.SEQUENCE_FLOW]),this.buildAssociationFlows(t[FlowKind.ASSOCIATION_FLOW])}buildFlowNodeBpmnElements(t,e,i){ensureIsArray(e).forEach(e=>{let n;if(ShapeUtil.isEvent(i))n=this.buildShapeBpmnEvent(e,i,t);else if(ShapeUtil.isActivity(i))n=this.buildShapeBpmnActivity(e,i,t);else if(i==ShapeBpmnElementKind.GATEWAY_EVENT_BASED){const i=e;n=new ShapeBpmnEventBasedGateway(e.id,i.name,t,i.instantiate,ShapeBpmnEventBasedGatewayKind[i.eventGatewayType])}else{const r=i===ShapeBpmnElementKind.TEXT_ANNOTATION?e.text:e.name;n=new ShapeBpmnElement(e.id,r,i,t,e.instantiate)}const r=e.default;ShapeUtil.isWithDefaultSequenceFlow(i)&&r&&this.defaultSequenceFlowIds.push(r),n&&this.convertedElements.registerFlowNode(n)})}buildShapeBpmnActivity(t,e,i){const n=this.buildMarkers(t);return ShapeUtil.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,i,n):ShapeUtil.isCallActivity(e)?this.convertedElements.isGlobalTask(t.calledElement)?void 0:new ShapeBpmnCallActivity(t.id,t.name,ShapeBpmnCallActivityKind.CALLING_PROCESS,i,n):new ShapeBpmnActivity(t.id,t.name,e,i,t.instantiate,n)}buildMarkers(t){const e=[],i=t.standardLoopCharacteristics,n=ensureIsArray(t.multiInstanceLoopCharacteristics,!0)[0];return i||""===i?e.push(ShapeBpmnMarkerKind.LOOP):n&&n.isSequential?e.push(ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL):(n&&!n.isSequential||""===n)&&e.push(ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL),e}buildShapeBpmnEvent(t,e,i){const n=this.getEventDefinitions(t),r=n.map(t=>t.counter).reduce((t,e)=>t+e,0);if(0==r&&ShapeUtil.canHaveNoneEvent(e))return new ShapeBpmnEvent(t.id,t.name,e,ShapeBpmnEventKind.NONE,i);if(1==r){const r=n[0].kind;if(supportedBpmnEventKinds.includes(r))return ShapeUtil.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,r):ShapeUtil.isStartEvent(e)?new ShapeBpmnStartEvent(t.id,t.name,r,i,t.isInterrupting):new ShapeBpmnEvent(t.id,t.name,e,r,i)}}buildShapeBpmnBoundaryEvent(t,e){const i=this.convertedElements.findFlowNode(t.attachedToRef);if(ShapeUtil.isActivity(null==i?void 0:i.kind))return new ShapeBpmnBoundaryEvent(t.id,t.name,e,t.attachedToRef,t.cancelActivity);console.warn("The boundary event %s must be attach to an activity, and not to %s",t.id,null==i?void 0:i.kind)}getEventDefinitions(t){const e=new Map;return bpmnEventKinds.forEach(i=>{const n=ensureIsArray(t[i+"EventDefinition"],!0).length;e.set(i,n)}),ensureIsArray(t.eventDefinitionRef).forEach(t=>{const i=this.convertedElements.findEventDefinitionOfDefinitions(t);e.set(i,e.get(i)+1)}),Array.from(e.keys()).map(t=>({kind:t,counter:e.get(t)})).filter(t=>t.counter>0)}buildShapeBpmnSubProcess(t,e,i){return this.buildSubProcessInnerElements(t),t.triggeredByEvent?new ShapeBpmnSubProcess(t.id,t.name,ShapeBpmnSubProcessKind.EVENT,e,i):new ShapeBpmnSubProcess(t.id,t.name,ShapeBpmnSubProcessKind.EMBEDDED,e,i)}buildSubProcessInnerElements(t){this.buildProcessInnerElements(t)}buildLaneSetBpmnElements(t,e){ensureIsArray(e).forEach(e=>{this.buildLaneBpmnElements(t,e.lane)})}buildLaneBpmnElements(t,e){ensureIsArray(e).forEach(e=>{var i;this.convertedElements.registerLane(new ShapeBpmnElement(e.id,e.name,ShapeBpmnElementKind.LANE,t)),this.assignParentOfLaneFlowNodes(e),(null===(i=e.childLaneSet)||void 0===i?void 0:i.lane)&&this.buildLaneBpmnElements(e.id,e.childLaneSet.lane)})}assignParentOfLaneFlowNodes(t){ensureIsArray(t.flowNodeRef).forEach(e=>{const i=this.convertedElements.findFlowNode(e),n=t.id;i?ShapeUtil.isBoundaryEvent(i.kind)||(i.parentId=n):console.warn("Unable to assign lane %s as parent: flow node %s is not found",n,e)})}buildSequenceFlows(t){ensureIsArray(t).forEach(t=>{const e=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new SequenceFlow(t.id,t.name,t.sourceRef,t.targetRef,e))})}buildAssociationFlows(t){ensureIsArray(t).forEach(t=>{const e=t.associationDirection;this.convertedElements.registerAssociationFlow(new AssociationFlow(t.id,void 0,t.sourceRef,t.targetRef,e))})}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return SequenceFlowKind.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&ShapeUtil.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return ShapeUtil.isActivity(e.kind)?SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY:SequenceFlowKind.CONDITIONAL_FROM_GATEWAY}return SequenceFlowKind.NORMAL}}class Bounds{constructor(t,e,i,n){this.x=t,this.y=e,this.width=i,this.height=n}}class Edge{constructor(t,e,i,n,r=MessageVisibleKind.NONE){this.id=t,this.bpmnElement=e,this.waypoints=i,this.label=n,this.messageVisibleKind=r}}class Waypoint{constructor(t,e){this.x=t,this.y=e}}class Label{constructor(t,e){this.font=t,this.bounds=e}}class Font{constructor(t,e,i,n,r,s){this.name=t,this.size=e,this.isBold=i,this.isItalic=n,this.isUnderline=r,this.isStrikeThrough=s}}class DiagramConverter{constructor(t){this.convertedElements=t,this.convertedFonts=new Map}deserialize(t){const e=[],i=[],n=[],r=[],s=ensureIsArray(t)[0];if(s){this.deserializeFonts(s.BPMNLabelStyle);const t=s.BPMNPlane,o=this.deserializeEdges(t.BPMNEdge),l=this.deserializeShapes(t.BPMNShape);e.push(...l.flowNodes),i.push(...l.lanes),n.push(...l.pools),r.push(...o)}return{flowNodes:e,lanes:i,pools:n,edges:r}}deserializeFonts(t){this.convertedFonts=new Map,ensureIsArray(t).forEach(t=>{ensureIsArray(t.Font).forEach(e=>{this.convertedFonts.set(t.id,new Font(e.name,e.size,e.isBold,e.isItalic,e.isUnderline,e.isStrikeThrough))})})}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};return ensureIsArray(t).forEach(t=>{const i=this.deserializeShape(t,t=>this.convertedElements.findFlowNode(t));if(i)return void e.flowNodes.push(i);const n=this.deserializeShape(t,t=>this.convertedElements.findLane(t));if(n)return void e.lanes.push(n);const r=this.deserializeShape(t,t=>this.convertedElements.findProcess(t));r?e.pools.push(r):console.warn("Shape json deserialization: unable to find bpmn element with id %s",t.bpmnElement)}),e}deserializeShape(t,e){const i=e(t.bpmnElement);if(i){const e=this.deserializeBounds(t);if(i.parentId){const t=this.convertedElements.findParticipantByProcessRef(i.parentId);t&&(i.parentId=t.id)}let n;(i instanceof ShapeBpmnSubProcess||i instanceof ShapeBpmnCallActivity)&&!t.isExpanded&&i.markers.push(ShapeBpmnMarkerKind.EXPAND),ShapeUtil.isPoolOrLane(i.kind)&&(n=void 0===t.isHorizontal||t.isHorizontal);const r=this.deserializeLabel(t.BPMNLabel,t.id);return new Shape(t.id,i,e,r,n)}}deserializeBounds(t){const e=t.Bounds;if(e)return new Bounds(e.x,e.y,e.width,e.height)}deserializeEdges(t){return ensureIsArray(t).map(t=>{const e=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!e)return void console.warn("Edge json deserialization: unable to find bpmn element with id %s",t.bpmnElement);const i=this.deserializeWaypoints(t.waypoint),n=this.deserializeLabel(t.BPMNLabel,t.id),r=t.messageVisibleKind?t.messageVisibleKind:MessageVisibleKind.NONE;return new Edge(t.id,e,i,n,r)}).filter(t=>t)}deserializeWaypoints(t){return ensureIsArray(t).map(t=>new Waypoint(t.x,t.y))}deserializeLabel(t,e){if(t&&"object"==typeof t){const i=this.findFont(t.labelStyle,e),n=this.deserializeBounds(t);if(i||n)return new Label(i,n)}}findFont(t,e){let i;return t&&(i=this.convertedFonts.get(t),i||console.warn("Unable to assign font from style %s to shape/edge %s",t,e)),i}}class EventDefinitionConverter{constructor(t){this.convertedElements=t}deserialize(t){bpmnEventKinds.forEach(e=>{ensureIsArray(t[e+"EventDefinition"],!0).forEach(t=>{this.convertedElements.registerEventDefinitionsOfDefinitions(t.id,e)})})}}class GlobalTaskConverter{constructor(t){this.convertedElements=t}deserialize(t){this.parseGlobalTasks(t.globalTask),this.parseGlobalTasks(t.globalBusinessRuleTask),this.parseGlobalTasks(t.globalManualTask),this.parseGlobalTasks(t.globalScriptTask),this.parseGlobalTasks(t.globalUserTask)}parseGlobalTasks(t){ensureIsArray(t).forEach(t=>{this.convertedElements.registerGlobalTask(t.id)})}}class ConvertedElements{constructor(){this.participantsById=new Map,this.participantsByProcessRef=new Map,this.processes=new Map,this.messageFlows=new Map,this.flowNodes=new Map,this.lanes=new Map,this.sequenceFlows=new Map,this.associationFlows=new Map,this.eventDefinitionsOfDefinitions=new Map,this.globalTaskIds=[]}findParticipantById(t){return this.participantsById.get(t)}findParticipantByProcessRef(t){return this.participantsByProcessRef.get(t)}registerParticipant(t){this.participantsById.set(t.id,t),t.processRef&&this.participantsByProcessRef.set(t.processRef,t)}_findProcess(t){return this.processes.get(t)}registerProcess(t){this.processes.set(t.id,t)}findProcess(t){const e=this.findParticipantById(t);if(e){const t=this._findProcess(e.processRef);if(t){const i=e.name||t.name;return new ShapeBpmnElement(e.id,i,t.kind,t.parentId)}return new ShapeBpmnElement(e.id,e.name,ShapeBpmnElementKind.POOL)}}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinitions(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinitions(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}isGlobalTask(t){return this.globalTaskIds.includes(t)}registerGlobalTask(t){this.globalTaskIds.push(t)}}class BpmnJsonParser{constructor(t,e,i,n,r){this.collaborationConverter=t,this.eventDefinitionConverter=e,this.globalTaskConverter=i,this.processConverter=n,this.diagramConverter=r}parse(t){const e=t.definitions;return this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function newBpmnJsonParser(){const t=new ConvertedElements;return new BpmnJsonParser(new CollaborationConverter(t),new EventDefinitionConverter(t),new GlobalTaskConverter(t),new ProcessConverter(t),new DiagramConverter(t))}class BpmnParser{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function newBpmnParser(){return new BpmnParser(newBpmnJsonParser(),new BpmnXmlParser)}class CssRegistry{constructor(){this.classNamesByBPMNId=new Map}getClassNames(t){return Array.from(this.classNamesByBPMNId.get(t)||[])}addClassNames(t,e){return this.updateClassNames(t,e,(t,e)=>e.add(t))}removeClassNames(t,e){return this.updateClassNames(t,e,(t,e)=>e.delete(t))}toggleClassNames(t,e){return this.updateClassNames(t,e,(t,e)=>e.has(t)?e.delete(t):e.add(t)),e&&e.length>0}updateClassNames(t,e,i){const n=this.getOrInitializeClassNames(t),r=n.size;return ensureIsArray(e).forEach(t=>i(t,n)),n.size!=r}getOrInitializeClassNames(t){let e=this.classNamesByBPMNId.get(t);return null==e&&(e=new Set,this.classNamesByBPMNId.set(t,e)),e}}class MxGraphCellUpdater{constructor(t){this.graph=t}updateAndRefreshCssClassesOfCell(t,e){const i=this.graph.getModel().getCell(t);if(!i)return;const n=this.graph.getView().getState(i);n.style[StyleIdentifier.BPMN_STYLE_EXTRA_CSS_CLASSES]=e,n.shape.apply(n),n.shape.redraw()}}class BpmnQuerySelectors{constructor(t){this.containerId=t}existingElement(){return`#${this.containerId} > svg > g > g > g[data-bpmn-id]`}element(t){return`#${this.containerId} svg g g[data-bpmn-id="${t}"]`}labelOfElement(t){return`#${this.containerId} > svg > g > g > g[data-bpmn-id="${t}"].bpmn-label > g > foreignObject`}elementsOfKind(t){return`#${this.containerId} > svg > g > g > g.${t}:not(.bpmn-label)`}}function newBpmnElementsRegistry(t,e){var i;return new BpmnElementsRegistry(t,new HtmlElementRegistry(new BpmnQuerySelectors(null===(i=e.container)||void 0===i?void 0:i.id)),new CssRegistry,new MxGraphCellUpdater(e))}class BpmnElementsRegistry{constructor(t,e,i,n){this.bpmnModelRegistry=t,this.htmlElementRegistry=e,this.cssRegistry=i,this.mxGraphCellUpdater=n}getElementsByIds(t){return ensureIsArray(t).map(t=>this.bpmnModelRegistry.getBpmnSemantic(t)).filter(t=>t).map(t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)}))}getElementsByKinds(t){const e=[];return ensureIsArray(t).map(t=>this.htmlElementRegistry.getBpmnHtmlElements(t).map(t=>({htmlElement:t,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(t.getAttribute("data-bpmn-id"))}))).forEach(t=>e.push(...t)),e}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.addClassNames.bind(this.cssRegistry))}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.removeClassNames.bind(this.cssRegistry))}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.toggleClassNames.bind(this.cssRegistry))}updateCssClasses(t,e,i){const n=ensureIsArray(e);ensureIsArray(t).forEach(t=>this.updateCellIfChanged(i(t,n),t))}updateCellIfChanged(t,e){if(t){const t=this.cssRegistry.getClassNames(e);this.mxGraphCellUpdater.updateAndRefreshCssClassesOfCell(e,t)}}}class HtmlElementRegistry{constructor(t){this.selectors=t}getBpmnHtmlElement(t){return document.querySelector(this.selectors.element(t))}getBpmnHtmlElements(t){const e=this.selectors.elementsOfKind(computeBpmnBaseClassName(t));return[...document.querySelectorAll(e)]}}class BpmnModelRegistry{computeRenderedModel(t){return this.searchableModel=new SearchableModel(t),toRenderedModel(t)}getBpmnSemantic(t){const e=this.searchableModel.elementById(t);if(!e)return;const i=e.bpmnElement,n=i instanceof ShapeBpmnElement;return{id:t,name:i.name,isShape:n,kind:i.kind}}}function toRenderedModel(t){const e=t.flowNodes.filter(t=>{const e=t.bpmnElement;return ShapeUtil.isSubProcess(e.kind)&&e.markers.includes(ShapeBpmnMarkerKind.EXPAND)}).map(t=>t.bpmnElement.id),i=[],n=[],r=[];return t.flowNodes.forEach(t=>{const s=t.bpmnElement.kind;ShapeUtil.isSubProcess(s)?i.push(t):ShapeUtil.isBoundaryEvent(s)?n.push(t):e.includes(t.bpmnElement.parentId)||r.push(t)}),{boundaryEvents:n,edges:t.edges,lanes:t.lanes,otherFlowNodes:r,pools:t.pools,subprocesses:i}}class SearchableModel{constructor(t){this.elements=new Map,[].concat(t.pools,t.lanes,t.flowNodes,t.edges).forEach(t=>{this.elements.set(t.bpmnElement.id,t)})}elementById(t){return this.elements.get(t)}}function htmlElement(t){return t instanceof HTMLElement?t:document.getElementById(t)}class BpmnVisualization{constructor(t){const e=new MxGraphConfigurator(htmlElement(null==t?void 0:t.container));this.graph=e.configure(t),this._bpmnModelRegistry=new BpmnModelRegistry,this.bpmnElementsRegistry=newBpmnElementsRegistry(this._bpmnModelRegistry,this.graph)}load(t,e){try{const i=newBpmnParser().parse(t),n=this._bpmnModelRegistry.computeRenderedModel(i);newMxGraphRenderer(this.graph).render(n,e)}catch(t){throw window.alert("Cannot load bpmn diagram: "+t.message),t}}fit(t){this.graph.customFit(t)}}function documentReady(t){"complete"===document.readyState||"interactive"===document.readyState?setTimeout(t,1):document.addEventListener("DOMContentLoaded",t)}function _log(t,e,...i){console.info(t+" "+e,...i)}function logStartup(t,...e){_log("[DEMO STARTUP]",t,...e)}function log(t,...e){_log("[DEMO]",t,...e)}class DropFileUserInterface{constructor(t,e,i,n){this.window=t,this.outerContainerId=e,this.containerToFadeId=i,this.dropCallback=n,this.document=t.document,this.head=document.head,this.body=document.body,this.initializeDragAndDrop()}initializeDragAndDrop(){const t=document.getElementById(this.containerToFadeId);this.addDomElements(t),this.addStyle();const e=document.getElementById(this.outerContainerId);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],e),this.addEventsOnDropContainer(e,t),this.addEventsOnDocument(this.outerContainerId,t)}preventDefaults(t){t.preventDefault(),t.stopPropagation()}preventDefaultsOnEvents(t,e){t.forEach(t=>{e.addEventListener(t,this.preventDefaults,!1)})}addDomElements(t){const e=this.document.createElement("p");e.textContent="open BPMN diagram";const i=this.document.createElement("div");i.classList.add("drop-here-text"),i.appendChild(e);const n=this.document.createElement("div");n.id=this.outerContainerId,n.appendChild(i),t.parentNode.prepend(n)}addStyle(){const t=`\n#${this.containerToFadeId} {\n opacity: 1;\n}\n#${this.containerToFadeId}.faded {\n opacity: 0.1;\n}\n#${this.outerContainerId} {\n overflow: hidden;\n position: absolute;\n top: 10px;\n right: 10px;\n bottom: 10px;\n left: 10px;\n font-weight: bold;\n text-align: center;\n color: #555;\n padding: 10px;\n}\n#${this.outerContainerId} .drop-here-text {\n display: none;\n border: 2px solid transparent;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n#${this.outerContainerId} .drop-here-text p {\n margin-top: 45%;\n font-style: normal;\n font-family: monospace;\n font-size: 40px;\n color: rgba(1,1,1,.2);\n}\n#${this.outerContainerId}.dragging .drop-here-text {\n cursor: default;\n display: block;\n border: 2px dashed rgba(0,0,0,.2);\n border-radius: 7px;\n}`,e=document.createElement("style");e.appendChild(document.createTextNode(t)),this.head.appendChild(e)}addEventsOnDropContainer(t,e){t.addEventListener("dragover",this.getAddClassCallback(e,!1),!1),t.addEventListener("mousedown",this.getRemoveClassCallback(e,!1),!1),t.addEventListener("drop",this.getDropCallbackForElement(e,!1,this.dropCallback),!1)}addEventsOnDocument(t,e){this.document.addEventListener("dragover",this.getAddClassCallback(e,!0,t),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(e,!0,t),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(e,!0,this.dropCallback,t),!1)}getAddClassCallback(t,e,i){return function(){e?this.querySelector("#"+i).classList.add("dragging"):this.classList.add("dragging"),t.classList.add("faded")}}getRemoveClassCallback(t,e,i){return function(){e?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}getDropCallbackForElement(t,e,i,n){return function(r){try{const s=r.dataTransfer.files;i(s[0])}catch(t){console.error(t)}finally{e?this.querySelector("#"+n).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}}}let bpmnVisualization,loadOptions={};function updateLoadOptions(t){log("Updating load options",t),loadOptions.fit=t,log("Load options updated!",stringify(loadOptions))}function getCurrentLoadOptions(){return Object.assign({},loadOptions)}function stringify(t){return JSON.stringify(t,void 0,2)}function loadBpmn(t){log("Loading bpmn...."),bpmnVisualization.load(t,loadOptions),log("BPMN loaded with configuration",stringify(loadOptions))}function fit(t){log("Fitting...."),bpmnVisualization.fit(t),log("Fit done with configuration",stringify(t))}function getElementsByKinds(t){return bpmnVisualization.bpmnElementsRegistry.getElementsByKinds(t)}function addCssClasses(t,e){return bpmnVisualization.bpmnElementsRegistry.addCssClasses(t,e)}function removeCssClasses(t,e){return bpmnVisualization.bpmnElementsRegistry.removeCssClasses(t,e)}function readAndLoadFile(t){const e=new FileReader;e.onload=()=>{loadBpmn(e.result)},e.readAsText(t)}function handleFileSelect(t){readAndLoadFile(t.target.files[0])}function fetchBpmnContent(t){return log("Fetching BPMN content from url "+t),fetch(t).then(t=>{if(!t.ok)throw Error(String(t.status));return t.text()})}function loadBpmnFromUrl(t,e){fetchBpmnContent(t).catch(i=>{const n=`Unable to fetch ${t}. ${i}`;throw e(n),new Error(n)}).then(t=>(log("BPMN content fetched"),t)).then(e=>{loadBpmn(e),log("Bpmn loaded from url "+t)})}function defaultStatusFetchKoNotifier(t){console.error(t)}function getFitOptionsFromParameters(t,e){var i;const n=(null===(i=t.loadOptions)||void 0===i?void 0:i.fit)||{},r=e.get("fitTypeOnLoad");r&&(n.type=r);const s=e.get("fitMargin");return s&&(n.margin=Number(s)),n}function startBpmnVisualization(t){const e=logStartup,i=t.globalOptions.container;e(`Initializing BpmnVisualization with container '${i}'...`),bpmnVisualization=new BpmnVisualization(t.globalOptions),e("Initialization completed"),new DropFileUserInterface(window,"drop-container",i,readAndLoadFile),e("Drag&Drop support initialized");const n=new URLSearchParams(window.location.search);e("Configuring Load Options"),loadOptions=t.loadOptions||{},loadOptions.fit=getFitOptionsFromParameters(t,n),e("Checking if 'BPMN content' is provided as query parameter");const r=n.get("bpmn");if(r){const t=decodeURIComponent(r);return e("Received bpmn length: "+t.length),e("Received bpmn content: "+t),e("BPMN auto loading"),loadBpmn(t),void e("BPMN content loading completed")}e("No 'BPMN content' provided"),e("Checking if an 'url to fetch BPMN content' is provided as query parameter");const s=n.get("url");if(s){loadBpmnFromUrl(decodeURIComponent(s),t.statusFetchKoNotifier||defaultStatusFetchKoNotifier)}else e("No 'url to fetch BPMN content' provided")}const mxConstants=mxgraph.mxConstants;export{BpmnElementsRegistry,BpmnVisualization,FitType,IconPainter,IconPainterProvider,MarkerIdentifier,ShapeBpmnCallActivityKind,ShapeBpmnElementKind,ShapeBpmnEventBasedGatewayKind,ShapeBpmnEventKind,ShapeBpmnMarkerKind,ShapeBpmnSubProcessKind,ShapeUtil,StyleConfigurator,StyleDefault,StyleIdentifier,addCssClasses,bpmnEventKinds,buildPaintParameter,computeScaledIconSize,documentReady,fit,getCurrentLoadOptions,getElementsByKinds,handleFileSelect,log,logStartup,mxConstants,removeCssClasses,startBpmnVisualization,supportedBpmnEventKinds,updateLoadOptions}; +var ShapeBpmnCallActivityKind,ShapeBpmnElementKind,ShapeBpmnEventBasedGatewayKind,ShapeBpmnEventKind;!function(t){t.CALLING_PROCESS="process"}(ShapeBpmnCallActivityKind||(ShapeBpmnCallActivityKind={})),function(t){t.LANE="lane",t.POOL="pool",t.CALL_ACTIVITY="callActivity",t.SUB_PROCESS="subProcess",t.TASK="task",t.TASK_USER="userTask",t.TASK_SERVICE="serviceTask",t.TASK_RECEIVE="receiveTask",t.TASK_SEND="sendTask",t.TASK_MANUAL="manualTask",t.TASK_SCRIPT="scriptTask",t.TASK_BUSINESS_RULE="businessRuleTask",t.TEXT_ANNOTATION="textAnnotation",t.GATEWAY_PARALLEL="parallelGateway",t.GATEWAY_EXCLUSIVE="exclusiveGateway",t.GATEWAY_INCLUSIVE="inclusiveGateway",t.GATEWAY_EVENT_BASED="eventBasedGateway",t.EVENT_START="startEvent",t.EVENT_END="endEvent",t.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",t.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",t.EVENT_BOUNDARY="boundaryEvent"}(ShapeBpmnElementKind||(ShapeBpmnElementKind={})),function(t){t.Exclusive="Exclusive",t.None="None",t.Parallel="Parallel"}(ShapeBpmnEventBasedGatewayKind||(ShapeBpmnEventBasedGatewayKind={})),function(t){t.NONE="none",t.TERMINATE="terminate",t.CANCEL="cancel",t.COMPENSATION="compensate",t.CONDITIONAL="conditional",t.ERROR="error",t.ESCALATION="escalation",t.LINK="link",t.MESSAGE="message",t.SIGNAL="signal",t.TIMER="timer"}(ShapeBpmnEventKind||(ShapeBpmnEventKind={}));const bpmnEventKinds=Object.values(ShapeBpmnEventKind).filter(t=>t!=ShapeBpmnEventKind.NONE),supportedBpmnEventKinds=[ShapeBpmnEventKind.TERMINATE,ShapeBpmnEventKind.TIMER,ShapeBpmnEventKind.MESSAGE,ShapeBpmnEventKind.SIGNAL,ShapeBpmnEventKind.LINK,ShapeBpmnEventKind.ERROR,ShapeBpmnEventKind.COMPENSATION,ShapeBpmnEventKind.CANCEL,ShapeBpmnEventKind.CONDITIONAL,ShapeBpmnEventKind.ESCALATION];var ShapeBpmnMarkerKind,ShapeBpmnSubProcessKind,SequenceFlowKind;!function(t){t.ADHOC="adhoc",t.COMPENSATION="compensation",t.EXPAND="expand",t.LOOP="loop",t.MULTI_INSTANCE_PARALLEL="parallel multi instance",t.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance"}(ShapeBpmnMarkerKind||(ShapeBpmnMarkerKind={})),function(t){t.EMBEDDED="embedded",t.EVENT="event"}(ShapeBpmnSubProcessKind||(ShapeBpmnSubProcessKind={}));class ShapeUtil{static filterKind(t,e=!1){return Object.values(ShapeBpmnElementKind).filter(i=>e?i.endsWith(t)||i.toLowerCase().endsWith(t.toLowerCase()):i.endsWith(t))}static isEvent(t){return this.EVENT_KINDS.includes(t)}static isCallActivity(t){return ShapeBpmnElementKind.CALL_ACTIVITY===t}static isSubProcess(t){return ShapeBpmnElementKind.SUB_PROCESS===t}static isBoundaryEvent(t){return ShapeBpmnElementKind.EVENT_BOUNDARY===t}static isStartEvent(t){return ShapeBpmnElementKind.EVENT_START===t}static canHaveNoneEvent(t){return ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW===t||ShapeBpmnElementKind.EVENT_END===t||ShapeBpmnElementKind.EVENT_START===t}static isActivity(t){return this.ACTIVITY_KINDS.includes(t)}static isWithDefaultSequenceFlow(t){return this.FLOWNODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS.includes(t)}static topLevelBpmnEventKinds(){return this.EVENT_KINDS}static activityKinds(){return this.ACTIVITY_KINDS}static taskKinds(){return this.TASK_KINDS}static gatewayKinds(){return this.GATEWAY_KINDS}static flowNodeKinds(){return Object.values(ShapeBpmnElementKind).filter(t=>!ShapeUtil.isPoolOrLane(t))}static isPoolOrLane(t){return t==ShapeBpmnElementKind.POOL||t==ShapeBpmnElementKind.LANE}}ShapeUtil.EVENT_KINDS=ShapeUtil.filterKind("Event"),ShapeUtil.GATEWAY_KINDS=ShapeUtil.filterKind("Gateway"),ShapeUtil.TASK_KINDS=ShapeUtil.filterKind("Task",!0),ShapeUtil.ACTIVITY_KINDS=[...ShapeUtil.TASK_KINDS,ShapeBpmnElementKind.CALL_ACTIVITY,ShapeBpmnElementKind.SUB_PROCESS],ShapeUtil.FLOWNODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS=[...ShapeUtil.ACTIVITY_KINDS,ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,ShapeBpmnElementKind.GATEWAY_INCLUSIVE],function(t){t.NORMAL="normal",t.DEFAULT="default",t.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",t.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway"}(SequenceFlowKind||(SequenceFlowKind={}));var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t,e){return t(e={exports:{}},e.exports),e.exports}function getCjsExportFromNamespace(t){return t&&t.default||t}var build=createCommonjsModule((function(module){!function(t,e){module.exports?module.exports=e():t.mxgraph=e()}(commonjsGlobal,(function(){return function(opts){for(var name in opts)this[name]=opts[name];var __mxOutput={},mxClient={VERSION:"4.1.0",IS_IE:navigator.userAgent.indexOf("MSIE")>=0,IS_IE6:navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:navigator.userAgent.indexOf("MSIE")>=0&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0,IS_OT:navigator.userAgent.indexOf("Presto/")>=0&&navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:navigator.userAgent.indexOf("AppleWebKit/")>=0&&navigator.userAgent.indexOf("Chrome/")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_ANDROID:navigator.userAgent.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IOS_VERSION:function(){if(/iP(hone|od|ad)/.test(navigator.platform)){var t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);if(null!=t&&t.length>0)return parseInt(t[1])}return 0}(),IS_GC:navigator.userAgent.indexOf("Chrome/")>=0&&navigator.userAgent.indexOf("Edge/")<0,IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:navigator.userAgent.indexOf("Firefox/")>=0,IS_MT:navigator.userAgent.indexOf("Firefox/")>=0&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||navigator.userAgent.indexOf("Iceweasel/")>=0&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||navigator.userAgent.indexOf("SeaMonkey/")>=0&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||navigator.userAgent.indexOf("Iceape/")>=0&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||navigator.userAgent.indexOf("Opera/")>=0,IS_WIN:navigator.appVersion.indexOf("Win")>0,IS_MAC:navigator.appVersion.indexOf("Mac")>0,IS_CHROMEOS:/\bCrOS\b/.test(navigator.userAgent),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(navigator.appVersion.indexOf("Mac")>0),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,i,n){if(i=i||document,mxClient.IS_IE6)i.write('');else{var r=i.createElement("link");r.setAttribute("rel",t),r.setAttribute("href",e),r.setAttribute("charset","UTF-8"),r.setAttribute("type","text/css"),n&&r.setAttribute("id",n),i.getElementsByTagName("head")[0].appendChild(r)}},loadResources:function(t,e){var i=mxClient.defaultBundles.length;function n(){0==--i&&t()}for(var r=0;r<\/script>')}},node;mxClient.IS_SF&&mxClient.IS_TOUCH&&!mxClient.IS_IOS&&(mxClient.IOS_VERSION=13,mxClient.IOS=!0),"undefined"==typeof mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),"undefined"!=typeof mxBasePath&&mxBasePath.length>0?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&mxImageBasePath.length>0?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images","undefined"!=typeof mxLanguage&&null!=mxLanguage?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,"undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(null!=document.namespaces&&(8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"))),mxClient.IS_QUIRKS&&document.styleSheets.length>=30?(node=document.createElement("style"),node.type="text/css",node.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(node)):document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"))),(mxForceIncludes||null==module.exports)&&(mxClient.include(mxClient.basePath+"/js/util/mxLog.js"),mxClient.include(mxClient.basePath+"/js/util/mxObjectIdentity.js"),mxClient.include(mxClient.basePath+"/js/util/mxDictionary.js"),mxClient.include(mxClient.basePath+"/js/util/mxResources.js"),mxClient.include(mxClient.basePath+"/js/util/mxPoint.js"),mxClient.include(mxClient.basePath+"/js/util/mxRectangle.js"),mxClient.include(mxClient.basePath+"/js/util/mxEffects.js"),mxClient.include(mxClient.basePath+"/js/util/mxUtils.js"),mxClient.include(mxClient.basePath+"/js/util/mxConstants.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventObject.js"),mxClient.include(mxClient.basePath+"/js/util/mxMouseEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlRequest.js"),mxClient.include(mxClient.basePath+"/js/util/mxClipboard.js"),mxClient.include(mxClient.basePath+"/js/util/mxWindow.js"),mxClient.include(mxClient.basePath+"/js/util/mxForm.js"),mxClient.include(mxClient.basePath+"/js/util/mxImage.js"),mxClient.include(mxClient.basePath+"/js/util/mxDivResizer.js"),mxClient.include(mxClient.basePath+"/js/util/mxDragSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxToolbar.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoableEdit.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxUrlConverter.js"),mxClient.include(mxClient.basePath+"/js/util/mxPanningManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/util/mxAutoSaveManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxAnimation.js"),mxClient.include(mxClient.basePath+"/js/util/mxMorphing.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageBundle.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageExport.js"),mxClient.include(mxClient.basePath+"/js/util/mxAbstractCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxSvgCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxVmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxGuide.js"),mxClient.include(mxClient.basePath+"/js/shape/mxShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencil.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencilRegistry.js"),mxClient.include(mxClient.basePath+"/js/shape/mxMarker.js"),mxClient.include(mxClient.basePath+"/js/shape/mxActor.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCloud.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRectangleShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxDoubleEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRhombus.js"),mxClient.include(mxClient.basePath+"/js/shape/mxPolyline.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrow.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrowConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxText.js"),mxClient.include(mxClient.basePath+"/js/shape/mxTriangle.js"),mxClient.include(mxClient.basePath+"/js/shape/mxHexagon.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLine.js"),mxClient.include(mxClient.basePath+"/js/shape/mxImageShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLabel.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCylinder.js"),mxClient.include(mxClient.basePath+"/js/shape/mxConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxSwimlane.js"),mxClient.include(mxClient.basePath+"/js/layout/mxGraphLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxStackLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxPartitionLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompactTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxRadialTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxFastOrganicLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCircleLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxParallelEdgeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompositeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxEdgeLabelLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyNode.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyEdge.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxSwimlaneModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMinimumCycleRemover.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxCoordinateAssignment.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxSwimlaneOrdering.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxHierarchicalLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxSwimlaneLayout.js"),mxClient.include(mxClient.basePath+"/js/model/mxGraphModel.js"),mxClient.include(mxClient.basePath+"/js/model/mxCell.js"),mxClient.include(mxClient.basePath+"/js/model/mxGeometry.js"),mxClient.include(mxClient.basePath+"/js/model/mxCellPath.js"),mxClient.include(mxClient.basePath+"/js/view/mxPerimeter.js"),mxClient.include(mxClient.basePath+"/js/view/mxPrintPreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxStylesheet.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellState.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphSelectionModel.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellEditor.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellRenderer.js"),mxClient.include(mxClient.basePath+"/js/view/mxEdgeStyle.js"),mxClient.include(mxClient.basePath+"/js/view/mxStyleRegistry.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphView.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraph.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellOverlay.js"),mxClient.include(mxClient.basePath+"/js/view/mxOutline.js"),mxClient.include(mxClient.basePath+"/js/view/mxMultiplicity.js"),mxClient.include(mxClient.basePath+"/js/view/mxLayoutManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxSwimlaneManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxTemporaryCellStates.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellStatePreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxConnectionConstraint.js"),mxClient.include(mxClient.basePath+"/js/handler/mxGraphHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPanningHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPopupMenuHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellMarker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxSelectionCellsHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConnectionHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConstraintHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxRubberband.js"),mxClient.include(mxClient.basePath+"/js/handler/mxHandle.js"),mxClient.include(mxClient.basePath+"/js/handler/mxVertexHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxElbowEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeSegmentHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxTooltipHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellTracker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellHighlight.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultToolbar.js"),mxClient.include(mxClient.basePath+"/js/editor/mxEditor.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodecRegistry.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxObjectCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxCellCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxModelCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxRootChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxChildChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxTerminalChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGenericChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphViewCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxStylesheetCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultKeyHandlerCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultToolbarCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultPopupMenuCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxEditorCodec.js")),__mxOutput.mxClient=void 0!==mxClient?mxClient:void 0;var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var i=document.createElement("tbody"),n=document.createElement("tr"),r=document.createElement("td");r.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&"BackCompat"!=document.compatMode?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",r.appendChild(mxLog.textarea),n.appendChild(r),i.appendChild(n),n=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),n.appendChild(mxLog.td),i.appendChild(n),e.appendChild(i),mxLog.addButton("Info",(function(t){mxLog.info()})),mxLog.addButton("DOM",(function(t){var e=mxUtils.getInnerHtml(document.body);mxLog.debug(e)})),mxLog.addButton("Trace",(function(t){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")})),mxLog.addButton("Copy",(function(t){try{mxUtils.copy(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Show",(function(t){try{mxUtils.popup(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Clear",(function(t){mxLog.textarea.value=""}));var s=0,o=0;if("number"==typeof window.innerWidth?(s=window.innerHeight,o=window.innerWidth):(s=document.documentElement.clientHeight||document.body.clientHeight,o=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,o-320),Math.max(0,s-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode||11==document.documentMode){var l=mxLog.window.getElement(),a=function(t,e){mxLog.textarea.style.height=Math.max(0,l.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,a),mxLog.window.addListener(mxEvent.MAXIMIZE,a),mxLog.window.addListener(mxEvent.NORMALIZE,a),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var i=document.createElement("button");mxUtils.write(i,t),mxEvent.addListener(i,"click",e),mxLog.td.appendChild(i)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(t){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),(new Date).getTime()},leave:function(t,e){if(mxLog.TRACE){var i=0!=e?" ("+((new Date).getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+i)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e=0&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e=0},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(null==mxClient.languages||!this.isLanguageSupported(e)){var i=e.indexOf("-");i>0&&(e=e.substring(0,i))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,i){if((e=null!=e?e:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE)!=mxConstants.NONE){var n=mxResources.getDefaultBundle(t,e),r=mxResources.getSpecialBundle(t,e),s=function(){if(null!=r)if(i)mxUtils.get(r,(function(t){mxResources.parse(t.getText()),i()}),(function(){i()}));else try{var t=mxUtils.load(r);t.isReady()&&mxResources.parse(t.getText())}catch(t){}else null!=i&&i()};if(null!=n)if(i)mxUtils.get(n,(function(t){mxResources.parse(t.getText()),s()}),(function(){s()}));else try{var o=mxUtils.load(n);o.isReady()&&mxResources.parse(o.getText()),s()}catch(t){}else s()}},parse:function(t){if(null!=t)for(var e=t.split("\n"),i=0;i0){var r=e[i].substring(0,n),s=e[i].length;13==e[i].charCodeAt(s-1)&&s--;var o=e[i].substring(n+1,s);this.resourcesEncoded?(o=o.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[r]=unescape(o)):mxResources.resources[r]=o}}},get:function(t,e,i){var n=mxResources.resources[t];return null==n&&(n=i),null!=n&&null!=e&&(n=mxResources.replacePlaceholders(n,e)),n},replacePlaceholders:function(t,e){for(var i=[],n=null,r=0;r=0&&n0?window.setTimeout(l,r):(t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(l,r)}else t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t)}};__mxOutput.mxEffects=void 0!==mxEffects?mxEffects:void 0;var mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){null!=t.style&&(t.style.cursor="");var e=t.childNodes;if(null!=e)for(var i=e.length,n=0;n=9&&document.documentMode<10&&(prefix="ms"),function(t,e,i){t[e]=i,null!=prefix&&e.length>0&&(t[e=prefix+e.substring(0,1).toUpperCase()+e.substring(1)]=i)}),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return null!=e&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(expr.indexOf("function")>=0)try{eval("var _mxJavaScriptExpression="+expr),result=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}return result},findNode:function(t,e,i){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=t.getAttribute(e);if(null!=n&&n==i)return t}for(t=t.firstChild;null!=t;){var r=mxUtils.findNode(t,e,i);if(null!=r)return r;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(null!=t)if(null!=t.name)e=t.name;else if(e=mxUtils.trim(t.toString()),/^function\s/.test(e)){var i=(e=mxUtils.ltrim(e.substring(9))).indexOf("(");i>0&&(e=e.substring(0,i))}return e},indexOf:function(t,e){if(null!=t&&null!=e)for(var i=0;i=0;)e.splice(n,1),i=t,n=mxUtils.indexOf(e,t);for(var r in e)e[r]==t&&(delete e[r],i=t);return i},isNode:function(t,e,i,n){return!(null==t||isNaN(t.nodeType)||null!=e&&t.nodeName.toLowerCase()!=e.toLowerCase())&&(null==i||t.getAttribute(i)==n)},isAncestorNode:function(t,e){for(var i=e;null!=i;){if(i==t)return!0;i=i.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var i=[],n=t.firstChild;null!=n;)n.nodeType==e&&i.push(n),n=n.nextSibling;return i},importNode:function(t,e,i){return mxClient.IS_IE&&(null==document.documentMode||document.documentMode<10)?mxUtils.importNodeImplementation(t,e,i):t.importNode(e,i)},importNodeImplementation:function(t,e,i){switch(e.nodeType){case 1:var n=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0)for(var r=0;r0)for(r=0;r/g,">"),(null==e||e)&&(t=t.replace(/\n/g," ")),t},isVml:function(t){return null!=t&&"urn:schemas-microsoft-com:vml"==t.tagUrn},getXml:function(t,e){var i="";if(mxClient.IS_IE||mxClient.IS_IE11)i=mxUtils.getPrettyXml(t,"","","");else if(null!=window.XMLSerializer){i=(new XMLSerializer).serializeToString(t)}else null!=t.xml&&(i=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n"));return e=e||" ",i=i.replace(/\n/g,e)},getPrettyXml:function(t,e,i,n,r){var s=[];if(null!=t)if(e=null!=e?e:" ",i=null!=i?i:"",n=null!=n?n:"\n",null!=t.namespaceURI&&t.namespaceURI!=r&&(r=t.namespaceURI,null==t.getAttribute("xmlns")&&t.setAttribute("xmlns",t.namespaceURI)),t.nodeType==mxConstants.NODETYPE_TEXT){var o=mxUtils.getTextContent(t);o.length>0&&s.push(i+mxUtils.htmlEntities(mxUtils.trim(o),!1))}else{s.push(i+"<"+t.nodeName);var l=t.attributes;if(null!=l)for(var a=0;a"+n);null!=u;)s.push(mxUtils.getPrettyXml(u,e,i+e,n,r)),u=u.nextSibling;s.push(i+""+n)}else s.push("/>"+n)}return s.join("")},extractTextWithWhitespace:function(t){var e=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"],i=[];return function t(n){if(1!=n.length||"BR"!=n[0].nodeName&&"\n"!=n[0].innerHTML)for(var r=0;r"==s.innerHTML.toLowerCase()?i.push("\n"):(3===s.nodeType||4===s.nodeType?s.nodeValue.length>0&&i.push(s.nodeValue):8!==s.nodeType&&s.childNodes.length>0&&t(s.childNodes),r=0&&i.push("\n"))}}(t),i.join("")},replaceTrailingNewlines:function(t,e){for(var i="";t.length>0&&"\n"==t.charAt(t.length-1);)t=t.substring(0,t.length-1),i+=e;return t+i},getTextContent:function(t){return mxClient.IS_IE&&void 0!==t.innerText?t.innerText:null!=t?t[void 0===t.textContent?"text":"textContent"]:""},setTextContent:function(t,e){void 0!==t.innerText?t.innerText=e:t[void 0===t.textContent?"text":"textContent"]=e},getInnerHtml:mxClient.IS_IE?function(t){return null!=t?t.innerHTML:""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},getOuterHtml:mxClient.IS_IE?function(t){if(null!=t){if(null!=t.outerHTML)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var i=t.attributes;if(null!=i)for(var n=0;n0&&(e.push(" "),e.push(i[n].nodeName),e.push('="'),e.push(r),e.push('"'))}return 0==t.innerHTML.length?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("")),e.join("")}return""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},write:function(t,e){var i=t.ownerDocument.createTextNode(e);return null!=t&&t.appendChild(i),i},writeln:function(t,e){var i=t.ownerDocument.createTextNode(e);return null!=t&&(t.appendChild(i),t.appendChild(document.createElement("br"))),i},br:function(t,e){e=e||1;for(var i=null,n=0;nl&&(t.style.left=Math.max(s,l-n)+"px");var a=parseInt(t.offsetTop),h=parseInt(t.offsetHeight),u=o+e.height;a+h>u&&(t.style.top=Math.max(o,u-h)+"px")},load:function(t){var e=new mxXmlRequest(t,null,"GET",!1);return e.send(),e},get:function(t,e,i,n,r,s){var o=new mxXmlRequest(t,null,"GET");return null!=n&&o.setBinary(n),o.send(e,i,r,s),o},getAll:function(t,e,i){for(var n=t.length,r=[],s=0,o=function(){0==s&&null!=i&&i(),s++},l=0;l299?o():(r[i]=t,0==--n&&e(r))}),o)}(t[l],l);0==n&&e(r)},post:function(t,e,i,n){return new mxXmlRequest(t,e).send(i,n)},submit:function(t,e,i,n){return new mxXmlRequest(t,e).simulate(i,n)},loadInto:function(t,e,i){mxClient.IS_IE?e.onreadystatechange=function(){4==e.readyState&&i()}:e.addEventListener("load",i,!1),e.load(t)},getValue:function(t,e,i){var n=null!=t?t[e]:null;return null==n&&(n=i),n},getNumber:function(t,e,i){var n=null!=t?t[e]:null;return null==n&&(n=i||0),Number(n)},getColor:function(t,e,i){var n=null!=t?t[e]:null;return null==n?n=i:n==mxConstants.NONE&&(n=null),n},clone:function(t,e,i){i=null!=i&&i;var n=null;if(null!=t&&"function"==typeof t.constructor)for(var r in n=new t.constructor,t)r!=mxObjectIdentity.FIELD_NAME&&(null==e||mxUtils.indexOf(e,r)<0)&&(i||"object"!=typeof t[r]?n[r]=t[r]:n[r]=mxUtils.clone(t[r]));return n},equalPoints:function(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e)for(var i=0;i [Function]\n";else if("object"==typeof t[i]){e+=i+" => ["+mxUtils.getFunctionName(t[i].constructor)+"]\n"}else e+=i+" = "+t[i]+"\n"}catch(t){e+=i+"="+t.message}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return 180*t/Math.PI},arcToCurves:function(t,e,i,n,r,s,o,l,a){if(l-=t,a-=e,0===i||0===n)return z;var h=o,u=r;i=Math.abs(i),n=Math.abs(n);var p,d=-l/2,c=-a/2,m=Math.cos(u*Math.PI/180),g=Math.sin(u*Math.PI/180),x=m*d+g*c,f=-1*g*d+m*c,y=x*x,v=f*f,C=i*i,E=n*n,S=y/C+v/E;if(S>1)i=Math.sqrt(S)*i,n=Math.sqrt(S)*n,p=0;else{var b=1;s===h&&(b=-1),p=b*Math.sqrt((C*E-C*v-E*y)/(C*v+E*y))}var T=p*i*f/n,w=-1*p*n*x/i,L=m*T-g*w+l/2,A=g*T+m*w+a/2,I=Math.atan2((f-w)/n,(x-T)/i)-Math.atan2(0,1),O=I>=0?I:2*Math.PI+I,R=(I=Math.atan2((-f-w)/n,(-x-T)/i)-Math.atan2((f-w)/n,(x-T)/i))>=0?I:2*Math.PI+I;0==h&&R>0?R-=2*Math.PI:0!=h&&R<0&&(R+=2*Math.PI);for(var M=2*R/Math.PI,P=Math.ceil(M<0?-1*M:M),N=R/P,_=8/3*Math.sin(N/4)*Math.sin(N/4)/Math.sin(N/2),D=m*i,H=m*n,G=g*i,U=g*n,V=Math.cos(O),k=Math.sin(O),B=-_*(D*k+U*V),F=-_*(G*k-H*V),q=0,Y=0,z=[],j=0;j45?(a=1,l>=135&&(a=2)):l<-45&&(a=3,l<=-135&&(a=2)),s.indexOf(mxConstants.DIRECTION_NORTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:o|=mxConstants.DIRECTION_MASK_EAST;break;case 2:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:o|=mxConstants.DIRECTION_MASK_WEST}if(s.indexOf(mxConstants.DIRECTION_WEST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_WEST;break;case 1:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:o|=mxConstants.DIRECTION_MASK_EAST;break;case 3:o|=mxConstants.DIRECTION_MASK_SOUTH}if(s.indexOf(mxConstants.DIRECTION_SOUTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:o|=mxConstants.DIRECTION_MASK_WEST;break;case 2:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:o|=mxConstants.DIRECTION_MASK_EAST}if(s.indexOf(mxConstants.DIRECTION_EAST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_EAST;break;case 1:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:o|=mxConstants.DIRECTION_MASK_WEST;break;case 3:o|=mxConstants.DIRECTION_MASK_NORTH}return o},reversePortConstraints:function(t){var e=0;return e=(t&mxConstants.DIRECTION_MASK_WEST)<<3,e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1,e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1,e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(t,e,i){var n=-1;if(t.absolutePoints.length>0)for(var r=t.absolutePoints[0],s=null,o=1;oa.distSq)&&(n=a)}}return null!=n?n.p:null},rectangleIntersectsSegment:function(t,e,i){var n=t.y,r=t.x,s=n+t.height,o=r+t.width,l=e.x,a=i.x;if(e.x>i.x&&(l=i.x,a=e.x),a>o&&(a=o),la)return!1;var h=e.y,u=i.y,p=i.x-e.x;if(Math.abs(p)>1e-7){var d=(i.y-e.y)/p,c=e.y-d*e.x;h=d*l+c,u=d*a+c}if(h>u){var m=u;u=h,h=m}return u>s&&(u=s),hu)},contains:function(t,e,i){return t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i},intersects:function(t,e){var i=t.width,n=t.height,r=e.width,s=e.height;if(r<=0||s<=0||i<=0||n<=0)return!1;var o=t.x,l=t.y,a=e.x,h=e.y;return s+=h,i+=o,n+=l,((r+=a)o)&&(sl)&&(ia)&&(nh)},intersectsHotspot:function(t,e,i,n,r,s){if(r=null!=r?r:0,s=null!=s?s:0,(n=null!=n?n:1)>0){var o=t.getCenterX(),l=t.getCenterY(),a=t.width,h=t.height,u=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;u>0&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(l=t.y+u/2,h=u):(o=t.x+u/2,a=u)),a=Math.max(r,a*n),h=Math.max(r,h*n),s>0&&(a=Math.min(a,s),h=Math.min(h,s));var p=new mxRectangle(o-a/2,l-h/2,a,h),d=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){var c=Math.cos(-d),m=Math.sin(-d),g=(o=new mxPoint(t.getCenterX(),t.getCenterY()),mxUtils.getRotatedPoint(new mxPoint(e,i),c,m,o));e=g.x,i=g.y}return mxUtils.contains(p,e,i)}return!0},getOffset:function(t,e){for(var i=0,n=0,r=!1,s=t,o=document.body,l=document.documentElement;null!=s&&s!=o&&s!=l&&!r;){var a=mxUtils.getCurrentStyle(s);null!=a&&(r=r||"fixed"==a.position),s=s.parentNode}if(!e&&!r){var h=mxUtils.getDocumentScrollOrigin(t.ownerDocument);i+=h.x,n+=h.y}var u=t.getBoundingClientRect();return null!=u&&(i+=u.left,n+=u.top),new mxPoint(i,n)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);var e=t.defaultView||t.parentWindow;return new mxPoint(null!=e&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=e&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(t,e,i){e=null!=e&&e,i=null==i||i;for(var n=null!=t?t.ownerDocument:document,r=n.body,s=n.documentElement,o=new mxPoint,l=!1;null!=t&&t!=r&&t!=s;){isNaN(t.scrollLeft)||isNaN(t.scrollTop)||(o.x+=t.scrollLeft,o.y+=t.scrollTop);var a=mxUtils.getCurrentStyle(t);null!=a&&(l=l||"fixed"==a.position),t=e?t.parentNode:null}if(!l&&i){var h=mxUtils.getDocumentScrollOrigin(n);o.x+=h.x,o.y+=h.y}return o},convertPoint:function(t,e,i){var n=mxUtils.getScrollOrigin(t,!1),r=mxUtils.getOffset(t);return r.x-=n.x,r.y-=n.y,new mxPoint(e-r.x,i-r.y)},ltrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("["+e+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&("string"!=typeof t||t.toLowerCase().indexOf("0x")<0)},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,i,n,r,s,o,l){var a=(l-s)*(i-t)-(o-r)*(n-e),h=((o-r)*(e-s)-(l-s)*(t-r))/a,u=((i-t)*(e-s)-(n-e)*(t-r))/a;return h>=0&&h<=1&&u>=0&&u<=1?new mxPoint(t+h*(i-t),e+h*(n-e)):null},ptSegDistSq:function(t,e,i,n,r,s){var o,l=(r-=t)*(i-=t)+(s-=e)*(n-=e);o=l<=0||(l=(r=i-r)*i+(s=n-s)*n)<=0?0:l*l/(i*i+n*n);var a=r*r+s*s-o;return a<0&&(a=0),a},ptLineDist:function(t,e,i,n,r,s){return Math.abs((n-e)*r-(i-t)*s+i*e-n*t)/Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))},relativeCcw:function(t,e,i,n,r,s){var o=(r-=t)*(n-=e)-(s-=e)*(i-=t);return 0==o&&(o=r*i+s*n)>0&&(o=(r-=i)*i+(s-=n)*n)<0&&(o=0),o<0?-1:o>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,i){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,i,n,r,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?t.style.filter=e>=100?"":"alpha(opacity="+e/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?t.style.filter=e>=100?"":"alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((e=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t),e.style.borderStyle="none"):((e=document.createElement("img")).setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,e){e=null==e||e;var i=new mxDictionary;return t.sort((function(t,n){var r=i.get(t);null==r&&(r=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),i.put(t,r));var s=i.get(n);null==s&&(s=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),i.put(n,s));var o=mxCellPath.compare(r,s);return 0==o?0:o>0==e?1:-1})),t},getStylename:function(t){if(null!=t){var e=t.split(";")[0];if(e.indexOf("=")<0)return e}return""},getStylenames:function(t){var e=[];if(null!=t)for(var i=t.split(";"),n=0;n0&&";"!=t.charAt(t.length-1)&&(t+=";"),t+=e),t},removeStylename:function(t,e){var i=[];if(null!=t)for(var n=t.split(";"),r=0;r=0&&e.push(i[n]);return e.join(";")},setCellStyles:function(t,e,i,n){if(null!=e&&e.length>0){t.beginUpdate();try{for(var r=0;r0);if(null==t||0==t.length)n&&(t=e+"="+i+";");else if(t.substring(0,e.length+1)==e+"="){var r=t.indexOf(";");t=n?e+"="+i+(r<0?";":t.substring(r)):r<0||r==t.length-1?"":t.substring(r+1)}else{var s=t.indexOf(";"+e+"=");if(s<0){if(n){var o=";"==t.charAt(t.length-1)?"":";";t=t+o+e+"="+i+";"}}else{r=t.indexOf(";",s+1);t=n?t.substring(0,s+1)+e+"="+i+(r<0?";":t.substring(r)):t.substring(0,s)+(r<0?";":t.substring(r))}}return t},setCellStyleFlags:function(t,e,i,n,r){if(null!=e&&e.length>0){t.beginUpdate();try{for(var s=0;s=0?t.substring(o):"")}}return t},getAlignmentAsPoint:function(t,e){var i=-.5,n=-.5;return t==mxConstants.ALIGN_LEFT?i=0:t==mxConstants.ALIGN_RIGHT&&(i=-1),e==mxConstants.ALIGN_TOP?n=0:e==mxConstants.ALIGN_BOTTOM&&(n=-1),new mxPoint(i,n)},getSizeForString:function(t,e,i,n,r){e=null!=e?e:mxConstants.DEFAULT_FONTSIZE,i=null!=i?i:mxConstants.DEFAULT_FONTFAMILY;var s=document.createElement("div");if(s.style.fontFamily=i,s.style.fontSize=Math.round(e)+"px",s.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",null!=r){(r&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(s.style.fontWeight="bold"),(r&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(s.style.fontStyle="italic");var o=[];(r&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&o.push("underline"),(r&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&o.push("line-through"),o.length>0&&(s.style.textDecoration=o.join(" "))}s.style.position="absolute",s.style.visibility="hidden",s.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",s.style.zoom="1",null!=n?(s.style.width=n+"px",s.style.whiteSpace="normal"):s.style.whiteSpace="nowrap",s.innerHTML=t,document.body.appendChild(s);var l=new mxRectangle(0,0,s.offsetWidth,s.offsetHeight);return document.body.removeChild(s),l},getViewXml:function(t,e,i,n,r){(n=null!=n?n:0,r=null!=r?r:0,e=null!=e?e:1,null==i)&&(i=[t.getModel().getRoot()]);var s=t.getView(),o=null,l=s.isEventsEnabled();s.setEventsEnabled(!1);var a=s.drawPane,h=s.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(s.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.drawPane),s.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.overlayPane)):(s.drawPane=s.drawPane.cloneNode(!1),s.canvas.appendChild(s.drawPane),s.overlayPane=s.overlayPane.cloneNode(!1),s.canvas.appendChild(s.overlayPane));var u=s.getTranslate();s.translate=new mxPoint(n,r);var p=new mxTemporaryCellStates(t.getView(),e,i);try{o=(new mxCodec).encode(t.getView())}finally{p.destroy(),s.translate=u,s.canvas.removeChild(s.drawPane),s.canvas.removeChild(s.overlayPane),s.drawPane=a,s.overlayPane=h,s.setEventsEnabled(l)}return o},getScaleForPageCount:function(t,e,i,n){if(t<1)return 1;n=null!=n?n:0;var r=(i=null!=i?i:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*n,s=i.height-2*n,o=e.getGraphBounds().clone(),l=e.getView().getScale();o.width/=l,o.height/=l;var a=o.width,h=a/o.height/(r/s),u=Math.sqrt(t),p=Math.sqrt(h),d=u*p,c=u/p;if(d<1&&c>t){var m=c/t;c=t,d/=m}if(c<1&&d>t){m=d/t;d=t,c/=m}for(var g=Math.ceil(d)*Math.ceil(c),x=0;g>t;){var f=Math.floor(d)/d,y=Math.floor(c)/c;1==f&&(f=Math.floor(d-1)/d),1==y&&(y=Math.floor(c-1)/c);m=1;if(d*=m=f>y?f:y,c*=m,g=Math.ceil(d)*Math.ceil(c),++x>10)break}return.99999*(r*d/a)},show:function(t,e,i,n,r,s){(i=null!=i?i:0,n=null!=n?n:0,null==e)?e=window.open().document:e.open();9==document.documentMode&&e.writeln('\x3c!--[if IE]>",u=document.getElementsByTagName("base"),p=0;p";for(p=0;p',h+='
',h+=t.container.innerHTML,h+="
",e.writeln(h),e.close()}else{e.writeln("");for(u=document.getElementsByTagName("base"),p=0;p'),e.close();var m=e.createElement("div");m.position="absolute",m.overflow="hidden",m.style.width=r+"px",m.style.height=s+"px";var g=e.createElement("div");g.style.position="absolute",g.style.left=l+"px",g.style.top=a+"px";for(var x=t.container.firstChild,f=null;null!=x;){var y=x.cloneNode(!0);x==t.view.drawPane.ownerSVGElement?(m.appendChild(y),f=y):g.appendChild(y),x=x.nextSibling}e.body.appendChild(m),null!=g.firstChild&&e.body.appendChild(g),null!=f&&(f.style.minWidth="",f.style.minHeight="",f.firstChild.setAttribute("transform","translate("+l+","+a+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds(),mxUtils.show(t,e.document);var i=function(){e.focus(),e.print(),e.close()};mxClient.IS_GC?e.setTimeout(i,500):i()},popup:function(t,e){if(e){var i=document.createElement("div");i.style.overflow="scroll",i.style.width="636px",i.style.height="460px",(r=document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"
").replace(/ /g," "),i.appendChild(r),(n=new mxWindow("Popup Window",i,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),n.setVisible(!0)}else{var n,r;if(mxClient.IS_NS)(n=window.open()).document.writeln("
"+mxUtils.htmlEntities(t)+"").replace(/ /g," "),n.document.body.appendChild(r)}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,null!=e?e:"")},confirm:function(t){return confirm(t)},error:function(t,e,i,n){var r=document.createElement("div");r.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",n||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",r.appendChild(s),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),mxUtils.write(r,t);var o=document.body.clientWidth,l=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,r,(o-e)/2,l/4,e,null,!1,!0);if(i){mxUtils.br(r);var h=document.createElement("p"),u=document.createElement("button");mxClient.IS_IE?u.style.cssText="float:right":u.setAttribute("style","float:right"),mxEvent.addListener(u,"click",(function(t){a.destroy()})),mxUtils.write(u,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),h.appendChild(u),r.appendChild(h),mxUtils.br(r),a.setClosable(!0)}return a.setVisible(!0),a},makeDraggable:function(t,e,i,n,r,s,o,l,a,h){var u=new mxDragSource(t,i);return u.dragOffset=new mxPoint(null!=r?r:0,null!=s?s:mxConstants.TOOLTIP_VERTICAL_OFFSET),u.autoscroll=o,u.setGuidesEnabled(!1),null!=a&&(u.highlightDropTargets=a),null!=h&&(u.getDropTarget=h),u.getGraphForEvent=function(t){return"function"==typeof e?e(t):e},null!=n&&(u.createDragElement=function(){return n.cloneNode(!0)},l&&(u.createPreviewElement=function(t){var e=n.cloneNode(!0),i=parseInt(e.style.width),r=parseInt(e.style.height);return e.style.width=Math.round(i*t.view.scale)+"px",e.style.height=Math.round(r*t.view.scale)+"px",e})),u}},prefix;__mxOutput.mxUtils=void 0!==mxUtils?mxUtils:void 0;var mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(t){this.name=t,this.properties=[];for(var e=1;e0;){var i=e[0];mxEvent.removeListener(t,i.name,i.f)}},addGestureListeners:function(t,e,i,n){null!=e&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=i&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),null!=n&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.addListener(t,"touchstart",e),null!=i&&mxEvent.addListener(t,"touchmove",i),null!=n&&mxEvent.addListener(t,"touchend",n))},removeGestureListeners:function(t,e,i,n){null!=e&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=i&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),null!=n&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.removeListener(t,"touchstart",e),null!=i&&mxEvent.removeListener(t,"touchmove",i),null!=n&&mxEvent.removeListener(t,"touchend",n))},redirectMouseEvents:function(t,e,i,n,r,s,o){var l=function(t){return"function"==typeof i?i(t):i};mxEvent.addGestureListeners(t,(function(t){null!=n?n(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,l(t)))}),(function(t){null!=r?r(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,l(t)))}),(function(t){null!=s?s(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,l(t)))})),mxEvent.addListener(t,"dblclick",(function(t){if(null!=o)o(t);else if(!mxEvent.isConsumed(t)){var i=l(t);e.dblClick(t,null!=i?i.cell:null)}}))},release:function(t){try{if(null!=t){mxEvent.removeAllListeners(t);var e=t.childNodes;if(null!=e)for(var i=e.length,n=0;n.2&&(t(e,n<0,!0),i=e.scale)})),mxEvent.addListener(e,"gestureend",(function(t){mxEvent.consume(t)}))}mxEvent.addListener(e,"wheel",(function(e){null==e&&(e=window.event),e.ctrlKey&&e.preventDefault(),e.deltaY,(Math.abs(e.deltaX)>.5||Math.abs(e.deltaY)>.5)&&t(e,0==e.deltaY?-e.deltaX>0:-e.deltaY>0)}))}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",(function(t){return t.preventDefault&&t.preventDefault(),!1}))},getSource:function(t){return null!=t.srcElement?t.srcElement:t.target},isConsumed:function(t){return null!=t.isConsumed&&t.isConsumed},isTouchEvent:function(t){return null!=t.pointerType?"touch"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_TOUCH:null!=t.mozInputSource?5==t.mozInputSource:0==t.type.indexOf("touch")},isPenEvent:function(t){return null!=t.pointerType?"pen"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_PEN:null!=t.mozInputSource?2==t.mozInputSource:0==t.type.indexOf("pen")},isMultiTouchEvent:function(t){return null!=t.type&&0==t.type.indexOf("touch")&&null!=t.touches&&t.touches.length>1},isMouseEvent:function(t){return null!=t.pointerType?"mouse"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE:null!=t.mozInputSource?1==t.mozInputSource:0==t.type.indexOf("mouse")},isLeftMouseButton:function(t){return!("buttons"in t)||"mousedown"!=t.type&&"mousemove"!=t.type?"which"in t?1===t.which:1===t.button:1==t.buttons},isMiddleMouseButton:function(t){return"which"in t?2===t.which:4===t.button},isRightMouseButton:function(t){return"which"in t?3===t.which:2===t.button},isPopupTrigger:function(t){return mxEvent.isRightMouseButton(t)||mxClient.IS_MAC&&mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)&&!mxEvent.isMetaDown(t)&&!mxEvent.isAltDown(t)},isShiftDown:function(t){return null!=t&&t.shiftKey},isAltDown:function(t){return null!=t&&t.altKey},isControlDown:function(t){return null!=t&&t.ctrlKey},isMetaDown:function(t){return null!=t&&t.metaKey},getMainEvent:function(t){return"touchstart"!=t.type&&"touchmove"!=t.type||null==t.touches||null==t.touches[0]?"touchend"==t.type&&null!=t.changedTouches&&null!=t.changedTouches[0]&&(t=t.changedTouches[0]):t=t.touches[0],t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,i){i=null==i||i,(e=null==e||e)&&(t.preventDefault?(i&&t.stopPropagation(),t.preventDefault()):i&&(t.cancelBubble=!0)),t.isConsumed=!0,t.preventDefault||(t.returnValue=!1)},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1e5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset"},updateListener,updateListenerList;function mxXmlRequest(t,e,i,n,r,s){this.url=t,this.params=e,this.method=i||"POST",this.async=null==n||n,this.username=r,this.password=s}__mxOutput.mxEvent=void 0!==mxEvent?mxEvent:void 0,mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.withCredentials=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.decodeSimulateValues=!1,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(t){this.binary=t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return null!=t?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(document.documentMode>=9||null==t||null==t.documentElement)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return null!=this.request?this.request.status:null},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(t,e,i,n){this.request=this.create(),null!=this.request&&(null!=t&&(this.request.onreadystatechange=mxUtils.bind(this,(function(){this.isReady()&&(t(this),this.request.onreadystatechaange=null)}))),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),!mxClient.IS_QUIRKS&&(null==document.documentMode||document.documentMode>9)&&window.XMLHttpRequest&&null!=i&&null!=n&&(this.request.timeout=i,this.request.ontimeout=n),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){null!=e&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(t,e){var i=null;(t=t||document)==document&&(i=window.onbeforeunload,window.onbeforeunload=null);var n=t.createElement("form");n.setAttribute("method",this.method),n.setAttribute("action",this.url),null!=e&&n.setAttribute("target",e),n.style.display="none",n.style.visibility="hidden";for(var r=this.params.indexOf("&")>0?this.params.split("&"):this.params.split(),s=0;s0){var l=r[s].substring(0,o),a=r[s].substring(o+1);this.decodeSimulateValues&&(a=decodeURIComponent(a));var h=t.createElement("textarea");h.setAttribute("wrap","off"),h.setAttribute("name",l),mxUtils.write(h,a),n.appendChild(h)}}t.body.appendChild(n),n.submit(),null!=n.parentNode&&n.parentNode.removeChild(n),null!=i&&(window.onbeforeunload=i)},__mxOutput.mxXmlRequest=void 0!==mxXmlRequest?mxXmlRequest:void 0;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(t,e){return e=mxClipboard.copy(t,e),mxClipboard.insertCount=0,mxClipboard.removeCells(t,e),e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var i=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(i)),i},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var i=mxClipboard.insertCount*mxClipboard.STEPSIZE,n=t.getDefaultParent();e=t.importCells(e,i,i,n),mxClipboard.insertCount++,t.setSelectionCells(e)}return e}};function mxWindow(t,e,i,n,r,s,o,l,a,h){null!=e&&(o=null==o||o,this.content=e,this.init(i,n,r,s,h),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(t),(null==l||l)&&this.installMoveHandler(),null!=a&&null!=a.parentNode?a.parentNode.replaceChild(this.div,a):document.body.appendChild(this.div))}function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(t,e,i){this.src=t,this.width=e,this.height=i}function mxDivResizer(t,e){if("div"==t.nodeName.toLowerCase()){null==e&&(e=window),this.div=t;var i=mxUtils.getCurrentStyle(t);null!=i&&(this.resizeWidth="auto"==i.width,this.resizeHeight="auto"==i.height),mxEvent.addListener(e,"resize",mxUtils.bind(this,(function(t){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)}))),this.resize()}}function mxDragSource(t,e){this.element=t,this.dropHandler=e,mxEvent.addGestureListeners(t,mxUtils.bind(this,(function(t){this.mouseDown(t)}))),mxEvent.addListener(t,"dragstart",(function(t){mxEvent.consume(t)})),this.eventConsumer=function(t,e){var i=e.getProperty("eventName"),n=e.getProperty("event");i!=mxEvent.MOUSE_DOWN&&n.consume()}}function mxToolbar(t){this.container=t}function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=null==e||e}function mxUndoManager(t){this.size=null!=t?t:100,this.clear()}__mxOutput.mxClipboard=void 0!==mxClipboard?mxClipboard:void 0,mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,i,n,r){r=null!=r?r:"mxWindow",this.div=document.createElement("div"),this.div.className=r,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=r,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),null!=i&&(mxClient.IS_QUIRKS||(this.div.style.width=i+"px"),this.table.style.width=i+"px"),null!=n&&(mxClient.IS_QUIRKS||(this.div.style.height=n+"px"),this.table.style.height=n+"px");var s=document.createElement("tbody"),o=document.createElement("tr");this.title=document.createElement("td"),this.title.className=r+"Title",this.buttons=document.createElement("div"),this.buttons.style.position="absolute",this.buttons.style.display="inline-block",this.buttons.style.right="4px",this.buttons.style.top="5px",this.title.appendChild(this.buttons),o.appendChild(this.title),s.appendChild(o),o=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=r+"Pane",7==document.documentMode&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=r+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_QUIRKS||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),o.appendChild(this.td),s.appendChild(o),this.table.appendChild(s),this.div.appendChild(this.table);var l=mxUtils.bind(this,(function(t){this.activate()}));mxEvent.addGestureListeners(this.title,l),mxEvent.addGestureListeners(this.table,l),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;null!=e;){var i=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=i}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=t?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement()),e=null!=t?t.zIndex:3;if(mxWindow.activeWindow){var i=mxWindow.activeWindow.getElement();null!=i&&null!=i.style&&(i.style.zIndex=e)}var n=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1,mxWindow.activeWindow=this,this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(t){if(t)if(null==this.resize){this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",this.resizeImage),this.resize.style.cursor="nw-resize";var e=null,i=null,n=null,r=null,s=mxUtils.bind(this,(function(t){this.activate(),e=mxEvent.getClientX(t),i=mxEvent.getClientY(t),n=this.div.offsetWidth,r=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){if(null!=e&&null!=i){var s=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-i;this.setSize(n+s,r+o),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",t)),mxEvent.consume(t)}})),l=mxUtils.bind(this,(function(t){null!=e&&null!=i&&(e=null,i=null,mxEvent.removeGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",t)),mxEvent.consume(t))}));mxEvent.addGestureListeners(this.resize,s,o,l),this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(t,e){t=Math.max(this.minimumSize.width,t),e=Math.max(this.minimumSize.height,e),mxClient.IS_QUIRKS||(this.div.style.width=t+"px",this.div.style.height=e+"px"),this.table.style.width=t+"px",this.table.style.height=e+"px",mxClient.IS_QUIRKS||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")},mxWindow.prototype.setMinimizable=function(t){this.minimize.style.display=t?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginLeft="2px",this.minimize.style.display="none",this.buttons.appendChild(this.minimize);var t=!1,e=null,i=null,n=mxUtils.bind(this,(function(n){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=e,mxClient.IS_QUIRKS||(this.div.style.height=i),this.table.style.height=i,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",n));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",e=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var r=this.getMinimumSize();r.height>0&&(mxClient.IS_QUIRKS||(this.div.style.height=r.height+"px"),this.table.style.height=r.height+"px"),r.width>0&&(mxClient.IS_QUIRKS||(this.div.style.width=r.width+"px"),this.table.style.width=r.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",n))}mxEvent.consume(n)}));mxEvent.addGestureListeners(this.minimize,n)},mxWindow.prototype.setMaximizable=function(t){this.maximize.style.display=t?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="2px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.buttons.appendChild(this.maximize);var t=!1,e=null,i=null,n=null,r=null,s=null,o=mxUtils.bind(this,(function(o){if(this.activate(),"none"!=this.maximize.style.display){if(t){if(t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=s,this.div.style.left=e+"px",this.div.style.top=i+"px",!mxClient.IS_QUIRKS)this.div.style.height=n,this.div.style.width=r,"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.table.style.height=n,this.table.style.width=r,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",o))}else{t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",s=this.minimize.style.display,this.minimize.style.display="none",e=parseInt(this.div.style.left),i=parseInt(this.div.style.top),n=this.table.style.height,r=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px";var l=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);if(mxClient.IS_QUIRKS||(this.div.style.width=document.body.clientWidth-2+"px",this.div.style.height=l-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=l-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_QUIRKS)"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",o))}mxEvent.consume(o)}}));mxEvent.addGestureListeners(this.maximize,o),mxEvent.addListener(this.title,"dblclick",o)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,(function(t){var e=mxEvent.getClientX(t),i=mxEvent.getClientY(t),n=this.getX(),r=this.getY(),s=mxUtils.bind(this,(function(t){var s=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-i;this.setLocation(n+s,r+o),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(document,null,s,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",t)),mxEvent.consume(t)}));mxEvent.addGestureListeners(document,null,s,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t)),mxEvent.consume(t)}))),mxClient.IS_POINTER&&(this.title.style.touchAction="none")},mxWindow.prototype.setLocation=function(t,e){this.div.style.left=t+"px",this.div.style.top=e+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.buttons.appendChild(this.closeImg),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,(function(t){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",t)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(t)})))},mxWindow.prototype.setImage=function(t){this.image=document.createElement("img"),this.image.setAttribute("src",t),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(t){this.closeImg.style.display=t?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"none"!=this.div.style.display},mxWindow.prototype.setVisible=function(t){null!=this.div&&this.isVisible()!=t&&(t?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.display="",this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_QUIRKS||"auto"!=t.overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.display="none",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},__mxOutput.mxWindow=void 0!==mxWindow?mxWindow:void 0,mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");i.appendChild(n),n=document.createElement("td");var r=document.createElement("button");mxUtils.write(r,mxResources.get("ok")||"OK"),n.appendChild(r),mxEvent.addListener(r,"click",(function(){t()})),r=document.createElement("button"),mxUtils.write(r,mxResources.get("cancel")||"Cancel"),n.appendChild(r),mxEvent.addListener(r,"click",(function(){e()})),i.appendChild(n),this.body.appendChild(i)},mxForm.prototype.addText=function(t,e,i){var n=document.createElement("input");return n.setAttribute("type",i||"text"),n.value=e,this.addField(t,n)},mxForm.prototype.addCheckbox=function(t,e){var i=document.createElement("input");return i.setAttribute("type","checkbox"),this.addField(t,i),e&&(i.checked=!0),i},mxForm.prototype.addTextarea=function(t,e,i){var n=document.createElement("textarea");return mxClient.IS_NS&&i--,n.setAttribute("rows",i||2),n.value=e,this.addField(t,n)},mxForm.prototype.addCombo=function(t,e,i){var n=document.createElement("select");return null!=i&&n.setAttribute("size",i),e&&n.setAttribute("multiple","true"),this.addField(t,n)},mxForm.prototype.addOption=function(t,e,i,n){var r=document.createElement("option");mxUtils.writeln(r,e),r.setAttribute("value",i),n&&r.setAttribute("selected",n),t.appendChild(r)},mxForm.prototype.addField=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");return mxUtils.write(n,t),i.appendChild(n),(n=document.createElement("td")).appendChild(e),i.appendChild(n),this.body.appendChild(i),e},__mxOutput.mxForm=void 0!==mxForm?mxForm:void 0,mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,__mxOutput.mxImage=void 0!==mxImage?mxImage:void 0,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),i=parseInt(this.div.style.left),n=parseInt(this.div.style.right),r=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(i)&&!isNaN(n)&&i>=0&&n>=0&&t-n-i>0&&(this.div.style.width=t-n-i+"px"),this.resizeHeight&&!isNaN(r)&&!isNaN(s)&&r>=0&&s>=0&&e-r-s>0&&(this.div.style.height=e-r-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},__mxOutput.mxDivResizer=void 0!==mxDivResizer?mxDivResizer:void 0,mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.checkEventSource=!0,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(t){this.enabled=t},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(t){this.guidesEnabled=t},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxDragSource.prototype.getGraphForEvent=function(t){return null},mxDragSource.prototype.getDropTarget=function(t,e,i,n){return t.getCellAt(e,i)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler},mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){this.enabled&&!mxEvent.isConsumed(t)&&null==this.mouseMoveHandler&&(this.startDrag(t),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(t)&&(this.eventSource=mxEvent.getSource(t),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)))},mxDragSource.prototype.startDrag=function(t){this.dragElement=this.createDragElement(t),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity),this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")},mxDragSource.prototype.stopDrag=function(){this.removeDragElement()},mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.getElementForEvent=function(t){return mxEvent.isTouchEvent(t)||mxEvent.isPenEvent(t)?document.elementFromPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)):mxEvent.getSource(t)},mxDragSource.prototype.graphContainsEvent=function(t,e){var i=mxEvent.getClientX(e),n=mxEvent.getClientY(e),r=mxUtils.getOffset(t.container),s=mxUtils.getScrollOrigin(),o=this.getElementForEvent(e);if(this.checkEventSource)for(;null!=o&&o!=t.container;)o=o.parentNode;return null!=o&&i>=r.x-s.x&&n>=r.y-s.y&&i<=r.x-s.x+t.container.offsetWidth&&n<=r.y-s.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(null==e||this.graphContainsEvent(e,t)||(e=null),e!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,t),this.currentGraph=e,null!=this.currentGraph&&this.dragEnter(this.currentGraph,t)),null!=this.currentGraph&&this.dragOver(this.currentGraph,t),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var i=mxEvent.getClientX(t),n=mxEvent.getClientY(t);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(i+=this.dragOffset.x,n+=this.dragOffset.y);var r=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=i+r.x+"px",this.dragElement.style.top=n+r.y+"px"}mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var e=this.currentGraph.view.scale,i=this.currentGraph.view.translate,n=this.currentPoint.x/e-i.x,r=this.currentPoint.y/e-i.y;this.drop(this.currentGraph,t,this.currentDropTarget,n,r)}this.dragExit(this.currentGraph),this.currentGraph=null}this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.mouseMoveHandler=null,this.mouseUpHandler=null},mxDragSource.prototype.dragEnter=function(t,e){t.isMouseDown=!0,t.isMouseTrigger=mxEvent.isMouseEvent(e),this.previewElement=this.createPreviewElement(t),null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(t,mxConstants.DROP_TARGET_COLOR)),t.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)},mxDragSource.prototype.dragExit=function(t,e){this.currentDropTarget=null,this.currentPoint=null,t.isMouseDown=!1,t.removeListener(this.eventConsumer),null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var i=mxUtils.getOffset(t.container),n=mxUtils.getScrollOrigin(t.container),r=mxEvent.getClientX(e)-i.x+n.x-t.panDx,s=mxEvent.getClientY(e)-i.y+n.y-t.panDy;if(t.autoScroll&&(null==this.autoscroll||this.autoscroll)&&t.scrollPointToVisible(r,s,t.autoExtend),null!=this.currentHighlight&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,r,s,e);var o=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(o)}if(null!=this.previewElement){null==this.previewElement.parentNode&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var l=this.isGridEnabled()&&t.isGridEnabledEvent(e),a=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(e)){var h=new mxRectangle(0,0,parseInt(this.previewElement.style.width),parseInt(this.previewElement.style.height)),u=new mxPoint(r,s);a=!1,r=(u=this.currentGuide.move(h,u,l,!0)).x,s=u.y}else if(l){var p=t.view.scale,d=t.view.translate,c=t.gridSize/2;r=(t.snap(r/p-d.x-c)+d.x)*p,s=(t.snap(s/p-d.y-c)+d.y)*p}null!=this.currentGuide&&a&&this.currentGuide.hide(),null!=this.previewOffset&&(r+=this.previewOffset.x,s+=this.previewOffset.y),this.previewElement.style.left=Math.round(r)+"px",this.previewElement.style.top=Math.round(s)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(r,s)},mxDragSource.prototype.drop=function(t,e,i,n,r){this.dropHandler.apply(this,arguments),"hidden"!=t.container.style.visibility&&t.container.focus()},__mxOutput.mxDragSource=void 0!==mxDragSource?mxDragSource:void 0,mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(t,e,i,n,r,s){var o=document.createElement(null!=e?"img":"button"),l=r||(null!=s?"mxToolbarMode":"mxToolbarItem");o.className=l,o.setAttribute("src",e),null!=t&&(null!=e?o.setAttribute("title",t):mxUtils.write(o,t)),this.container.appendChild(o),null!=i&&(mxEvent.addListener(o,"click",i),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",i));var a=mxUtils.bind(this,(function(t){null!=n?o.setAttribute("src",e):o.style.backgroundColor=""}));return mxEvent.addGestureListeners(o,mxUtils.bind(this,(function(t){if(null!=n?o.setAttribute("src",n):o.style.backgroundColor="gray",null!=s){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var e=this.currentImg;if(this.menu.isMenuShowing()&&this.menu.hideMenu(),e!=o){this.currentImg=o,this.menu.factoryMethod=s;var i=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight);this.menu.popup(i.x,i.y,null,t),this.menu.isMenuShowing()&&(o.className=l+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=l,this.currentImg=null})}}})),null,a),mxEvent.addListener(o,"mouseout",a),o},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var i=document.createElement("select");return i.className=t||"mxToolbarCombo",e.appendChild(i),this.container.appendChild(e),i},mxToolbar.prototype.addActionCombo=function(t,e){var i=document.createElement("select");return i.className=e||"mxToolbarCombo",this.addOption(i,t,null),mxEvent.addListener(i,"change",(function(t){var e=i.options[i.selectedIndex];i.selectedIndex=0,null!=e.funct&&e.funct(t)})),this.container.appendChild(i),i},mxToolbar.prototype.addOption=function(t,e,i){var n=document.createElement("option");return mxUtils.writeln(n,e),"function"==typeof i?n.funct=i:n.setAttribute("value",i),t.appendChild(n),n},mxToolbar.prototype.addSwitchMode=function(t,e,i,n,r){var s=document.createElement("img");return s.initialClassName=r||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",e),s.altIcon=n,null!=t&&s.setAttribute("title",t),mxEvent.addListener(s,"click",mxUtils.bind(this,(function(t){var e;null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),this.selectedMode=s,null!=(e=s.altIcon)?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",e)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),i()}))),this.container.appendChild(s),null==this.defaultMode&&(this.defaultMode=s,this.selectMode(s),i()),s},mxToolbar.prototype.addMode=function(t,e,i,n,r,s){s=null==s||s;var o=document.createElement(null!=e?"img":"button");return o.initialClassName=r||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",e),o.altIcon=n,null!=t&&o.setAttribute("title",t),this.enabled&&s&&(mxEvent.addListener(o,"click",mxUtils.bind(this,(function(t){this.selectMode(o,i),this.noReset=!1}))),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,(function(t){this.selectMode(o,i),this.noReset=!0}))),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=i,this.selectMode(o,i))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){var i;if(null!=this.selectedMode)null!=(i=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):this.selectedMode.className=this.selectedMode.initialClassName;this.selectedMode=t,null!=(i=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}},mxToolbar.prototype.resetMode=function(t){!t&&this.noReset||this.selectedMode==this.defaultMode||this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(t){return this.addItem(null,t,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var t=document.createElement("hr");t.style.marginRight="6px",t.setAttribute("size","1"),this.container.appendChild(t)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.container=null,this.defaultMode=null,this.defaultFunction=null,this.selectedMode=null,null!=this.menu&&this.menu.destroy()},__mxOutput.mxToolbar=void 0!==mxToolbar?mxToolbar:void 0,mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(t){this.changes.push(t)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length-1;t>=0;t--){var e=this.changes[t];null!=e.execute?e.execute():null!=e.undo&&e.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length,e=0;e0},mxUndoManager.prototype.undo=function(){for(;this.indexOfNextAdd>0;){var t=this.history[--this.indexOfNextAdd];if(t.undo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd0&&this.size==this.history.length&&this.history.shift(),this.history.push(t),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",t))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),e=0;e0&&this.dx0&&this.dy0&&(this.defs=i.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=i.firstChild?i.insertBefore(this.defs,i.firstChild):i.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUrlConverter.prototype.enabled=!0,mxUrlConverter.prototype.baseUrl=null,mxUrlConverter.prototype.baseDomain=null,mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host,this.baseUrl=this.baseDomain+location.pathname;var t=this.baseUrl.lastIndexOf("/");t>0&&(this.baseUrl=this.baseUrl.substring(0,t+1))},mxUrlConverter.prototype.isEnabled=function(){return this.enabled},mxUrlConverter.prototype.setEnabled=function(t){this.enabled=t},mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl},mxUrlConverter.prototype.setBaseUrl=function(t){this.baseUrl=t},mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain},mxUrlConverter.prototype.setBaseDomain=function(t){this.baseDomain=t},mxUrlConverter.prototype.isRelativeUrl=function(t){return null!=t&&"//"!=t.substring(0,2)&&"http://"!=t.substring(0,7)&&"https://"!=t.substring(0,8)&&"data:image"!=t.substring(0,10)&&"file://"!=t.substring(0,7)},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),t="/"==t.charAt(0)?this.getBaseDomain()+t:this.getBaseUrl()+t),t},__mxOutput.mxUrlConverter=void 0!==mxUrlConverter?mxUrlConverter:void 0,mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,__mxOutput.mxPanningManager=void 0!==mxPanningManager?mxPanningManager:void 0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(t){this.enabled=t},mxPopupMenu.prototype.isPopupTrigger=function(t){return t.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(t.getEvent())},mxPopupMenu.prototype.addItem=function(t,e,i,n,r,s,o){n=n||this,this.itemCount++,n.willAddSeparator&&(n.containsItems&&this.addSeparator(n,!0),n.willAddSeparator=!1),n.containsItems=!0;var l=document.createElement("tr");l.className="mxPopupMenuItem";var a=document.createElement("td");if(a.className="mxPopupMenuIcon",null!=e){var h=document.createElement("img");h.src=e,a.appendChild(h)}else if(null!=r){var u=document.createElement("div");u.className=r,a.appendChild(u)}if(l.appendChild(a),this.labels){var p=document.createElement("td");p.className="mxPopupMenuItem"+(null==s||s?"":" mxDisabled"),mxUtils.write(p,t),p.align="left",l.appendChild(p);var d=document.createElement("td");d.className="mxPopupMenuItem"+(null==s||s?"":" mxDisabled"),d.style.paddingRight="6px",d.style.textAlign="right",l.appendChild(d),null==n.div&&this.createSubmenu(n)}if(n.tbody.appendChild(l),0!=o&&0!=s){var c=null;mxEvent.addGestureListeners(l,mxUtils.bind(this,(function(t){this.eventReceiver=l,n.activeRow!=l&&n.activeRow!=n&&(null!=n.activeRow&&null!=n.activeRow.div.parentNode&&this.hideSubmenu(n),null!=l.div&&(this.showSubmenu(n,l),n.activeRow=l)),null==document.selection||!mxClient.IS_QUIRKS&&8!=document.documentMode||(c=document.selection.createRange()),mxEvent.consume(t)})),mxUtils.bind(this,(function(t){n.activeRow!=l&&n.activeRow!=n&&(null!=n.activeRow&&null!=n.activeRow.div.parentNode&&this.hideSubmenu(n),this.autoExpand&&null!=l.div&&(this.showSubmenu(n,l),n.activeRow=l)),l.className="mxPopupMenuItemHover"})),mxUtils.bind(this,(function(t){if(this.eventReceiver==l){if(n.activeRow!=l&&this.hideMenu(),null!=c){try{c.select()}catch(t){}c=null}null!=i&&i(t)}this.eventReceiver=null,mxEvent.consume(t)}))),mxEvent.addListener(l,"mouseout",mxUtils.bind(this,(function(t){l.className="mxPopupMenuItem"})))}return l},mxPopupMenu.prototype.addCheckmark=function(t,e){var i=t.firstChild.nextSibling;i.style.backgroundImage="url('"+e+"')",i.style.backgroundRepeat="no-repeat",i.style.backgroundPosition="2px 50%"},mxPopupMenu.prototype.createSubmenu=function(t){t.table=document.createElement("table"),t.table.className="mxPopupMenu",t.tbody=document.createElement("tbody"),t.table.appendChild(t.tbody),t.div=document.createElement("div"),t.div.className="mxPopupMenu",t.div.style.position="absolute",t.div.style.display="inline",t.div.style.zIndex=this.zIndex,t.div.appendChild(t.table);var e=document.createElement("img");e.setAttribute("src",this.submenuImage),td=t.firstChild.nextSibling.nextSibling,td.appendChild(e)},mxPopupMenu.prototype.showSubmenu=function(t,e){if(null!=e.div){e.div.style.left=t.div.offsetLeft+e.offsetLeft+e.offsetWidth-1+"px",e.div.style.top=t.div.offsetTop+e.offsetTop+"px",document.body.appendChild(e.div);var i=parseInt(e.div.offsetLeft),n=parseInt(e.div.offsetWidth),r=mxUtils.getDocumentScrollOrigin(document),s=document.body,o=document.documentElement;i+n>r.x+(s.clientWidth||o.clientWidth)&&(e.div.style.left=Math.max(0,t.div.offsetLeft-n+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div)}},mxPopupMenu.prototype.addSeparator=function(t,e){if(t=t||this,this.smartSeparators&&!e)t.willAddSeparator=!0;else if(null!=t.tbody){t.willAddSeparator=!1;var i=document.createElement("tr"),n=document.createElement("td");n.className="mxPopupMenuIcon",n.style.padding="0 0 0 0px",i.appendChild(n);var r=document.createElement("td");r.style.padding="0 0 0 0px",r.setAttribute("colSpan","2");var s=document.createElement("hr");s.setAttribute("size","1"),r.appendChild(s),i.appendChild(r),t.tbody.appendChild(i)}},mxPopupMenu.prototype.popup=function(t,e,i,n){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=t+"px",this.div.style.top=e+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,i,n),this.itemCount>0&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){document.documentMode>=9&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))},mxPopupMenu.prototype.hideSubmenu=function(t){null!=t.activeRow&&(this.hideSubmenu(t.activeRow),null!=t.activeRow.div.parentNode&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},__mxOutput.mxPopupMenu=void 0!==mxPopupMenu?mxPopupMenu:void 0,mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t},mxAutoSaveManager.prototype.setGraph=function(t){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=((new Date).getTime()-this.lastSnapshot)/1e3;e>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxAutoSaveManager=void 0!==mxAutoSaveManager?mxAutoSaveManager:void 0,mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return null!=this.thread},mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},__mxOutput.mxAnimation=void 0!==mxAnimation?mxAnimation:void 0,mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var t=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var e=0;e=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,i){var n=this.graph.getView().getState(t),r=null;if(null!=n&&(r=this.getDelta(n),this.graph.getModel().isVertex(t)&&(0!=r.x||0!=r.y))){var s=this.graph.view.getTranslate(),o=this.graph.view.getScale();r.x+=s.x*o,r.y+=s.y*o,e.moveState(n,-r.x/this.ease,-r.y/this.ease)}if(i&&!this.stopRecursion(n,r))for(var l=this.graph.getModel().getChildCount(t),a=0;a2))for(var t=this.state,e=2;e0&&(this.state=this.states.pop())},mxAbstractCanvas2D.prototype.setLink=function(t){},mxAbstractCanvas2D.prototype.scale=function(t){this.state.scale*=t,this.state.strokeWidth*=t},mxAbstractCanvas2D.prototype.translate=function(t,e){this.state.dx+=t,this.state.dy+=e},mxAbstractCanvas2D.prototype.rotate=function(t,e,i,n,r){},mxAbstractCanvas2D.prototype.setAlpha=function(t){this.state.alpha=t},mxAbstractCanvas2D.prototype.setFillAlpha=function(t){this.state.fillAlpha=t},mxAbstractCanvas2D.prototype.setStrokeAlpha=function(t){this.state.strokeAlpha=t},mxAbstractCanvas2D.prototype.setFillColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fillColor=t,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(t,e,i,n,r,s,o,l,a){var h=this.state;h.fillColor=t,h.gradientFillAlpha=null!=l?l:1,h.gradientColor=e,h.gradientAlpha=null!=a?a:1,h.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(t){t==mxConstants.NONE&&(t=null),this.state.strokeColor=t},mxAbstractCanvas2D.prototype.setStrokeWidth=function(t){this.state.strokeWidth=t},mxAbstractCanvas2D.prototype.setDashed=function(t,e){this.state.dashed=t,this.state.fixDash=e},mxAbstractCanvas2D.prototype.setDashPattern=function(t){this.state.dashPattern=t},mxAbstractCanvas2D.prototype.setLineCap=function(t){this.state.lineCap=t},mxAbstractCanvas2D.prototype.setLineJoin=function(t){this.state.lineJoin=t},mxAbstractCanvas2D.prototype.setMiterLimit=function(t){this.state.miterLimit=t},mxAbstractCanvas2D.prototype.setFontColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontColor=t},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBackgroundColor=t},mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBorderColor=t},mxAbstractCanvas2D.prototype.setFontSize=function(t){this.state.fontSize=parseFloat(t)},mxAbstractCanvas2D.prototype.setFontFamily=function(t){this.state.fontFamily=t},mxAbstractCanvas2D.prototype.setFontStyle=function(t){null==t&&(t=0),this.state.fontStyle=t},mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t},mxAbstractCanvas2D.prototype.setShadowColor=function(t){t==mxConstants.NONE&&(t=null),this.state.shadowColor=t},mxAbstractCanvas2D.prototype.setShadowAlpha=function(t){this.state.shadowAlpha=t},mxAbstractCanvas2D.prototype.setShadowOffset=function(t,e){this.state.shadowDx=t,this.state.shadowDy=e},mxAbstractCanvas2D.prototype.begin=function(){this.lastX=0,this.lastY=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(t,e){this.addOp(this.moveOp,t,e)},mxAbstractCanvas2D.prototype.lineTo=function(t,e){this.addOp(this.lineOp,t,e)},mxAbstractCanvas2D.prototype.quadTo=function(t,e,i,n){this.addOp(this.quadOp,t,e,i,n)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,i,n,r,s){this.addOp(this.curveOp,t,e,i,n,r,s)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,i,n,r,s,o){var l=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,i,n,r,s,o);if(null!=l)for(var a=0;a0&&(t=t.substring(0,e)),t},mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");return e.setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(t,e){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);var i=this.root.ownerDocument.createElement(t);return null!=e&&i.setAttribute("xmlns",e),i},mxSvgCanvas2D.prototype.getAlternateText=function(t,e,i,n,r,s,o,l,a,h,u,p,d){return null!=s?this.foAltText:null},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,i,n,r,s,o,l,a,h,u,p,d){var c=this.getAlternateText(t,e,i,n,r,s,o,l,a,h,u,p,d),m=this.state;if(null!=c&&m.fontSize>0){var g=l==mxConstants.ALIGN_TOP?1:l==mxConstants.ALIGN_BOTTOM?0:.3,x=o==mxConstants.ALIGN_RIGHT?"end":o==mxConstants.ALIGN_LEFT?"start":"middle",f=this.createElement("text");f.setAttribute("x",Math.round(e+m.dx)),f.setAttribute("y",Math.round(i+m.dy+g*m.fontSize)),f.setAttribute("fill",m.fontColor||"black"),f.setAttribute("font-family",m.fontFamily),f.setAttribute("font-size",Math.round(m.fontSize)+"px"),"start"!=x&&f.setAttribute("text-anchor",x),(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&f.setAttribute("font-weight","bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&f.setAttribute("font-style","italic");var y=[];return(m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.push("underline"),(m.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&y.push("line-through"),y.length>0&&f.setAttribute("text-decoration",y.join(" ")),mxUtils.write(f,c),f}return null},mxSvgCanvas2D.prototype.createGradientId=function(t,e,i,n,r){"#"==t.charAt(0)&&(t=t.substring(1)),"#"==e.charAt(0)&&(e=e.substring(1)),t=t.toLowerCase()+"-"+i,e=e.toLowerCase()+"-"+n;var s=null;if(null==r||r==mxConstants.DIRECTION_SOUTH)s="s";else if(r==mxConstants.DIRECTION_EAST)s="e";else{var o=t;t=e,e=o,r==mxConstants.DIRECTION_NORTH?s="s":r==mxConstants.DIRECTION_WEST&&(s="e")}return"mx-gradient-"+t+"-"+e+"-"+s},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,i,n,r){var s=this.createGradientId(t,e,i,n,r),o=this.gradients[s];if(null==o){var l=this.root.ownerSVGElement,a=0,h=s+"-"+a;if(null!=l)for(o=l.ownerDocument.getElementById(h);null!=o&&o.ownerSVGElement!=l;)h=s+"-"+a++,o=l.ownerDocument.getElementById(h);else h="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(t,e,i,n,r)).setAttribute("id",h),null!=this.defs?this.defs.appendChild(o):l.appendChild(o)),this.gradients[s]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,i,n,r){var s=this.createElement("linearGradient");s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),null==r||r==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):r==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):r==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):r==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%");var o=i<1?";stop-opacity:"+i:"",l=this.createElement("stop");return l.setAttribute("offset","0%"),l.setAttribute("style","stop-color:"+t+o),s.appendChild(l),o=n<1?";stop-opacity:"+n:"",(l=this.createElement("stop")).setAttribute("offset","100%"),l.setAttribute("style","stop-color:"+e+o),s.appendChild(l),s},mxSvgCanvas2D.prototype.addNode=function(t,e){var i=this.node,n=this.state;if(null!=i){if("path"==i.nodeName){if(!(null!=this.path&&this.path.length>0))return;i.setAttribute("d",this.path.join(" "))}t&&null!=n.fillColor?this.updateFill():this.styleEnabled||("ellipse"==i.nodeName&&mxClient.IS_FF?i.setAttribute("fill","transparent"):i.setAttribute("fill","none"),t=!1),e&&null!=n.strokeColor?this.updateStroke():this.styleEnabled||i.setAttribute("stroke","none"),null!=n.transform&&n.transform.length>0&&i.setAttribute("transform",n.transform),n.shadow&&this.root.appendChild(this.createShadow(i)),this.strokeTolerance>0&&!t&&this.root.appendChild(this.createTolerance(i)),this.pointerEvents?i.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||i.setAttribute("pointer-events","none"),("rect"!=i.nodeName&&"path"!=i.nodeName&&"ellipse"!=i.nodeName||"none"!=i.getAttribute("fill")&&"transparent"!=i.getAttribute("fill")||"none"!=i.getAttribute("stroke")||"none"!=i.getAttribute("pointer-events"))&&this.root.appendChild(i),this.node=null}},mxSvgCanvas2D.prototype.updateFill=function(){var t=this.state;if((t.alpha<1||t.fillAlpha<1)&&this.node.setAttribute("fill-opacity",t.alpha*t.fillAlpha),null!=t.fillColor)if(null!=t.gradientColor){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(mxClient.IS_CHROMEAPP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)this.node.setAttribute("fill","url(#"+e+")");else{var i=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+i+"#"+e+")")}}else this.node.setAttribute("fill",String(t.fillColor).toLowerCase())},mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))},mxSvgCanvas2D.prototype.updateStroke=function(){var t=this.state;this.node.setAttribute("stroke",String(t.strokeColor).toLowerCase()),(t.alpha<1||t.strokeAlpha<1)&&this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha);var e=this.getCurrentStrokeWidth();1!=e&&this.node.setAttribute("stroke-width",e),"path"==this.node.nodeName&&this.updateStrokeAttributes(),t.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t=this.state;if(null!=t.lineJoin&&"miter"!=t.lineJoin&&this.node.setAttribute("stroke-linejoin",t.lineJoin),null!=t.lineCap){var e=t.lineCap;"flat"==e&&(e="butt"),"butt"!=e&&this.node.setAttribute("stroke-linecap",e)}null==t.miterLimit||this.styleEnabled&&10==t.miterLimit||this.node.setAttribute("stroke-miterlimit",t.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if("string"==typeof this.state.dashPattern){var i=this.state.dashPattern.split(" ");if(i.length>0)for(var n=0;n0&&this.node.setAttribute("rx",this.format(r*this.state.scale)),s>0&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,i,n){var r=this.state,s=this.createElement("ellipse");s.setAttribute("cx",this.format((t+i/2+r.dx)*r.scale)),s.setAttribute("cy",this.format((e+n/2+r.dy)*r.scale)),s.setAttribute("rx",i/2*r.scale),s.setAttribute("ry",n/2*r.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(t,e,i,n,r,s,o,l){r=this.converter.convert(r),s=null==s||s,o=null!=o&&o,l=null!=l&&l;var a=this.state;t+=a.dx,e+=a.dy;var h=this.createElement("image");h.setAttribute("x",this.format(t*a.scale)+this.imageOffset),h.setAttribute("y",this.format(e*a.scale)+this.imageOffset),h.setAttribute("width",this.format(i*a.scale)),h.setAttribute("height",this.format(n*a.scale)),null==h.setAttributeNS?h.setAttribute("xlink:href",r):h.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",r),s||h.setAttribute("preserveAspectRatio","none"),(a.alpha<1||a.fillAlpha<1)&&h.setAttribute("opacity",a.alpha*a.fillAlpha);var u=this.state.transform||"";if(o||l){var p=1,d=1,c=0,m=0;o&&(p=-1,c=-i-2*t),l&&(d=-1,m=-n-2*e),u+="scale("+p+","+d+")translate("+c*a.scale+","+m*a.scale+")"}u.length>0&&h.setAttribute("transform",u),this.pointerEvents||h.setAttribute("pointer-events","none"),this.root.appendChild(h),this.blockImagePointerEvents&&(h.setAttribute("style","pointer-events:none"),(h=this.createElement("rect")).setAttribute("visibility","hidden"),h.setAttribute("pointer-events","fill"),h.setAttribute("x",this.format(t*a.scale)),h.setAttribute("y",this.format(e*a.scale)),h.setAttribute("width",this.format(i*a.scale)),h.setAttribute("height",this.format(n*a.scale)),this.root.appendChild(h))},mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=(new DOMParser).parseFromString(t,"text/html");null!=e&&("",5)+1)),""==t.substring(t.length-7,t.length)&&(t=t.substring(0,t.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){var i=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),n=i.createElement("body");i.documentElement.appendChild(n);var r=document.createElement("div");r.innerHTML=t;for(var s=r.firstChild;null!=s;){var o=s.nextSibling;n.appendChild(i.adoptNode(s)),s=o}return n.innerHTML}var l=document.createElement("textarea");l.innerHTML=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(//g,">"),t=l.value.replace(/&/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/
/g,"
").replace(/
/g,"
").replace(/(]+)>/gm,"$1 />")}return t},mxSvgCanvas2D.prototype.createDiv=function(t){var e=t;if(mxUtils.isNode(e)||(e="
"+this.convertHtml(e)+"
"),mxClient.IS_IE||mxClient.IS_IE11||!document.createElementNS)return mxUtils.isNode(e)&&(e="
"+mxUtils.getXml(e)+"
"),e='
'+e+"
",mxUtils.parseXml(e).documentElement;var i=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var n=document.createElement("div"),r=n.cloneNode(!1);this.root.ownerDocument!=document?n.appendChild(e.cloneNode(!0)):n.appendChild(e),r.appendChild(n),i.appendChild(r)}else i.innerHTML=e;return i},mxSvgCanvas2D.prototype.updateText=function(t,e,i,n,r,s,o,l,a,h,u){null!=u&&null!=u.firstChild&&null!=u.firstChild.firstChild&&this.updateTextNodes(t,e,i,n,r,s,o,l,a,h,u.firstChild)},mxSvgCanvas2D.prototype.addForeignObject=function(t,e,i,n,r,s,o,l,a,h,u,p,d,c,m){var g=this.createElement("g"),x=this.createElement("foreignObject");if(x.setAttribute("style","overflow: visible; text-align: left;"),x.setAttribute("pointer-events","none"),c.ownerDocument!=document&&(c=mxUtils.importNodeImplementation(x.ownerDocument,c,!0)),x.appendChild(c),g.appendChild(x),this.updateTextNodes(t,e,i,n,s,o,l,h,u,p,g),this.root.ownerDocument!=document){var f=this.createAlternateContent(x,t,e,i,n,r,s,o,l,a,h,u,p);if(null!=f){x.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var y=this.createElement("switch");y.appendChild(x),y.appendChild(f),g.appendChild(y)}}m.appendChild(g)},mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,i,n,r,s,o,l,a,h,u){var p=this.state.scale;mxSvgCanvas2D.createCss(i,n,r,s,o,l,a,null!=this.state.fontBackgroundColor?this.state.fontBackgroundColor:null,null!=this.state.fontBorderColor?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(s==mxConstants.ALIGN_TOP?"flex-start":s==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(r==mxConstants.ALIGN_LEFT?"flex-start":r==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),p,mxUtils.bind(this,(function(i,n,r,s,o){t+=this.state.dx,e+=this.state.dy;var l=u.firstChild,a=l.firstChild,d=a.firstChild,c=d.firstChild,m=(this.rotateHtml?this.state.rotation:0)+(null!=h?h:0),g=(0!=this.foOffset?"translate("+this.foOffset+" "+this.foOffset+")":"")+(1!=p?"scale("+p+")":"");c.setAttribute("style",o),d.setAttribute("style",s),l.setAttribute("width",Math.ceil(1/Math.min(1,p)*100)+"%"),l.setAttribute("height",Math.ceil(1/Math.min(1,p)*100)+"%");var x=Math.round(e+n);x<0?l.setAttribute("y",x):(l.removeAttribute("y"),r+="padding-top: "+x+"px; "),a.setAttribute("style",r+"margin-left: "+Math.round(t+i)+"px;"),""!=(g+=0!=m?"rotate("+m+" "+t+" "+e+")":"")?u.setAttribute("transform",g):u.removeAttribute("transform"),1!=this.state.alpha?u.setAttribute("opacity",this.state.alpha):u.removeAttribute("opacity")})))},mxSvgCanvas2D.createCss=function(t,e,i,n,r,s,o,l,a,h,u,p,d){var c="box-sizing: border-box; font-size: 0; text-align: "+(i==mxConstants.ALIGN_LEFT?"left":i==mxConstants.ALIGN_RIGHT?"right":"center")+"; ",m=mxUtils.getAlignmentAsPoint(i,n),g="overflow: hidden; ",x="width: 1px; ",f="height: 1px; ",y=m.x*t,v=m.y*e;o?(x="width: "+Math.round(t)+"px; ",c+="max-height: "+Math.round(e)+"px; ",v=0):"fill"==s?(u+="width: 100%; height: 100%; ",c+=(x="width: "+Math.round(t)+"px; ")+(f="height: "+Math.round(e)+"px; ")):"width"==s?(u+="width: 100%; ",c+=x="width: "+Math.round(t)+"px; ",v=0,e>0&&(c+="max-height: "+Math.round(e)+"px; ")):(g="",v=0);var C="";null!=l&&(C+="background-color: "+l+"; "),null!=a&&(C+="border: 1px solid "+a+"; "),""==g||o?u+=C:c+=C,r&&t>0?(u+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",x="width: "+Math.round(t+2)+"px; ",""!=g&&"fill"!=s&&(v=0)):(u+="white-space: nowrap; ",""==g&&(y=0)),d(y,v,h+x+f,c+g,u,g)},mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state,e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection,i="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: "+(this.pointerEvents?this.pointerEventsValue:"none")+"; ";(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(i+="font-weight: bold; "),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(i+="font-style: italic; ");var n=[];return(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&(i+="text-decoration: "+n.join(" ")+"; "),i},mxSvgCanvas2D.prototype.text=function(t,e,i,n,r,s,o,l,a,h,u,p,d){if(this.textEnabled&&null!=r)if(p=null!=p?p:0,this.foEnabled&&"html"==a){var c=this.createDiv(r);null!=c&&(null!=d&&c.setAttribute("dir",d),this.addForeignObject(t,e,i,n,r,s,o,l,a,h,u,p,d,c,this.root))}else this.plainText(t+this.state.dx,e+this.state.dy,i,n,r,s,o,l,h,u,p,d)},mxSvgCanvas2D.prototype.createClip=function(t,e,i,n){for(var r="mx-clip-"+(t=Math.round(t))+"-"+(e=Math.round(e))+"-"+(i=Math.round(i))+"-"+(n=Math.round(n)),s=0,o=r+"-"+s;null!=document.getElementById(o);)o=r+"-"+ ++s;clip=this.createElement("clipPath"),clip.setAttribute("id",o);var l=this.createElement("rect");return l.setAttribute("x",t),l.setAttribute("y",e),l.setAttribute("width",i),l.setAttribute("height",n),clip.appendChild(l),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,i,n,r,s,o,l,a,h,u,p){u=null!=u?u:0;var d=this.state,c=d.fontSize,m=this.createElement("g"),g=d.transform||"";if(this.updateFont(m),0!=u&&(g+="rotate("+u+","+this.format(t*d.scale)+","+this.format(e*d.scale)+")"),null!=p&&m.setAttribute("direction",p),h&&i>0&&n>0){var x=t,f=e;s==mxConstants.ALIGN_CENTER?x-=i/2:s==mxConstants.ALIGN_RIGHT&&(x-=i),"fill"!=a&&(o==mxConstants.ALIGN_MIDDLE?f-=n/2:o==mxConstants.ALIGN_BOTTOM&&(f-=n));var y=this.createClip(x*d.scale-2,f*d.scale-2,i*d.scale+4,n*d.scale+4);if(null!=this.defs?this.defs.appendChild(y):this.root.appendChild(y),mxClient.IS_CHROMEAPP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)m.setAttribute("clip-path","url(#"+y.getAttribute("id")+")");else{var v=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");m.setAttribute("clip-path","url("+v+"#"+y.getAttribute("id")+")")}}var C=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=C&&m.setAttribute("text-anchor",C),this.styleEnabled&&c==mxConstants.DEFAULT_FONTSIZE||m.setAttribute("font-size",c*d.scale+"px"),g.length>0&&m.setAttribute("transform",g),d.alpha<1&&m.setAttribute("opacity",d.alpha);var E=r.split("\n"),S=Math.round(c*mxConstants.LINE_HEIGHT),b=c+(E.length-1)*S;f=e+c-1;if(o==mxConstants.ALIGN_MIDDLE)f-="fill"==a?n/2:(this.matchHtmlAlignment&&h&&n>0?Math.min(b,n):b)/2;else if(o==mxConstants.ALIGN_BOTTOM){if("fill"==a)f-=n;else f-=(this.matchHtmlAlignment&&h&&n>0?Math.min(b,n):b)+1}for(var T=0;T0&&mxUtils.trim(E[T]).length>0){var w=this.createElement("text");w.setAttribute("x",this.format(t*d.scale)+this.textOffset),w.setAttribute("y",this.format(f*d.scale)+this.textOffset),mxUtils.write(w,E[T]),m.appendChild(w)}f+=S}this.root.appendChild(m),this.addTextBackground(m,r,t,e,i,"fill"==a?n:b,s,o,a)},mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor),this.styleEnabled&&e.fontFamily==mxConstants.DEFAULT_FONTFAMILY||t.setAttribute("font-family",e.fontFamily),(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&t.setAttribute("font-weight","bold"),(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&t.setAttribute("font-style","italic");var i=[];(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&t.setAttribute("text-decoration",i.join(" "))},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,i,n,r,s,o,l,a){var h=this.state;if(null!=h.fontBackgroundColor||null!=h.fontBorderColor){var u=null;if("fill"==a||"width"==a)o==mxConstants.ALIGN_CENTER?i-=r/2:o==mxConstants.ALIGN_RIGHT&&(i-=r),l==mxConstants.ALIGN_MIDDLE?n-=s/2:l==mxConstants.ALIGN_BOTTOM&&(n-=s),u=new mxRectangle((i+1)*h.scale,n*h.scale,(r-2)*h.scale,(s+2)*h.scale);else if(null!=t.getBBox&&this.root.ownerDocument==document)try{u=t.getBBox();var p=mxClient.IS_IE&&mxClient.IS_SVG;u=new mxRectangle(u.x,u.y+(p?0:1),u.width,u.height+(p?1:0))}catch(t){}else{var d=document.createElement("div");d.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?h.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,d.style.fontSize=h.fontSize+"px",d.style.fontFamily=h.fontFamily,d.style.whiteSpace="nowrap",d.style.position="absolute",d.style.visibility="hidden",d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",d.style.zoom="1",(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),d.innerHTML=e.replace(/\n/g,"
"),document.body.appendChild(d);r=d.offsetWidth,s=d.offsetHeight;d.parentNode.removeChild(d),o==mxConstants.ALIGN_CENTER?i-=r/2:o==mxConstants.ALIGN_RIGHT&&(i-=r),l==mxConstants.ALIGN_MIDDLE?n-=s/2:l==mxConstants.ALIGN_BOTTOM&&(n-=s),u=new mxRectangle((i+1)*h.scale,(n+2)*h.scale,r*h.scale,(s+1)*h.scale)}if(null!=u){var c=this.createElement("rect");c.setAttribute("fill",h.fontBackgroundColor||"none"),c.setAttribute("stroke",h.fontBorderColor||"none"),c.setAttribute("x",Math.floor(u.x-1)),c.setAttribute("y",Math.floor(u.y-1)),c.setAttribute("width",Math.ceil(u.width+2)),c.setAttribute("height",Math.ceil(u.height));var m=null!=h.fontBorderColor?Math.max(1,this.format(h.scale)):0;c.setAttribute("stroke-width",m),this.root.ownerDocument==document&&1==mxUtils.mod(m,2)&&c.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(c,t.firstChild)}}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxSvgCanvas2D=void 0!==mxSvgCanvas2D?mxSvgCanvas2D:void 0;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this),this.root=t};function mxGuide(t,e){this.graph=t,this.setStates(e)}function mxShape(t){this.stencil=t,this.initStyles()}function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.createElement=function(t){return document.createElement(t)},mxVmlCanvas2D.prototype.createVmlElement=function(t){return this.createElement(mxClient.VML_PREFIX+":"+t)},mxVmlCanvas2D.prototype.addNode=function(t,e){var i=this.node,n=this.state;if(null!=i){if("shape"==i.nodeName){if(!(null!=this.path&&this.path.length>0))return;i.path=this.path.join(" ")+" e",i.style.width=this.root.style.width,i.style.height=this.root.style.height,i.coordsize=parseInt(i.style.width)+" "+parseInt(i.style.height)}i.strokeweight=this.format(Math.max(1,n.strokeWidth*n.scale/this.vmlScale))+"px",n.shadow&&this.root.appendChild(this.createShadow(i,t&&null!=n.fillColor,e&&null!=n.strokeColor)),e&&null!=n.strokeColor?(i.stroked="true",i.strokecolor=n.strokeColor):i.stroked="false",i.appendChild(this.createStroke()),t&&null!=n.fillColor?i.appendChild(this.createFill()):!this.pointerEvents||"shape"==i.nodeName&&this.path[this.path.length-1]!=this.closeOp?i.filled="false":i.appendChild(this.createTransparentFill()),this.root.appendChild(i)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");return t.src=mxClient.imageBasePath+"/transparent.gif",t.type="tile",t},mxVmlCanvas2D.prototype.createFill=function(){var t=this.state,e=this.createVmlElement("fill");if(e.color=t.fillColor,null!=t.gradientColor){e.type="gradient",e.method="none",e.color2=t.gradientColor;var i=180-t.rotation;t.gradientDirection==mxConstants.DIRECTION_WEST?i-=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_EAST?i+=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_NORTH?i-=180+("y"==this.root.style.flip?-180:0):i+="y"==this.root.style.flip?-180:0,"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(i*=-1),e.angle=mxUtils.mod(i,360),e.opacity=t.alpha*t.gradientFillAlpha*100+"%",e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else(t.alpha<1||t.fillAlpha<1)&&(e.opacity=t.alpha*t.fillAlpha*100+"%");return e},mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state,e=this.createVmlElement("stroke");return e.endcap=t.lineCap||"flat",e.joinstyle=t.lineJoin||"miter",e.miterlimit=t.miterLimit||"10",(t.alpha<1||t.strokeAlpha<1)&&(e.opacity=t.alpha*t.strokeAlpha*100+"%"),t.dashed&&(e.dashstyle=this.getVmlDashStyle()),e},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if("string"==typeof this.state.dashPattern){var e=this.state.dashPattern.split(" ");e.length>0&&1==e[0]&&(t="0 2")}return t},mxVmlCanvas2D.prototype.createShadow=function(t,e,i){var n=this.state,r=-n.rotation*(Math.PI/180),s=Math.cos(r),o=Math.sin(r),l=n.shadowDx*n.scale,a=n.shadowDy*n.scale;"x"==this.root.style.flip?l*=-1:"y"==this.root.style.flip&&(a*=-1);var h=t.cloneNode(!0);return h.style.marginLeft=Math.round(l*s-a*o)+"px",h.style.marginTop=Math.round(l*o+a*s)+"px",8==document.documentMode&&(h.strokeweight=t.strokeweight,"shape"==t.nodeName&&(h.path=this.path.join(" ")+" e",h.style.width=this.root.style.width,h.style.height=this.root.style.height,h.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height))),i?(h.strokecolor=n.shadowColor,h.appendChild(this.createShadowStroke())):h.stroked="false",e?h.appendChild(this.createShadowFill()):h.filled="false",h},mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");return t.color=this.state.shadowColor,t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();return t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.rotate=function(t,e,i,n,r){e&&i?t+=180:e?this.root.style.flip="x":i&&(this.root.style.flip="y"),(e?!i:i)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=n,this.state.rotationCy=r},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createVmlElement("shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(t,e,i,n){var r=this.state,s=(this.lastX+r.dx)*r.scale,o=(this.lastY+r.dy)*r.scale,l=(t+r.dx)*r.scale,a=(e+r.dy)*r.scale,h=(i+r.dx)*r.scale,u=(n+r.dy)*r.scale,p=s+2/3*(l-s),d=o+2/3*(a-o),c=h+2/3*(l-h),m=u+2/3*(a-u);this.path.push("c "+this.format(p)+" "+this.format(d)+" "+this.format(c)+" "+this.format(m)+" "+this.format(h)+" "+this.format(u)),this.lastX=h/r.scale-r.dx,this.lastY=u/r.scale-r.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,i,n,r){var s=this.state,o=this.createVmlElement(t);return o.style.position="absolute",o.style.left=this.format((e+s.dx)*s.scale)+"px",o.style.top=this.format((i+s.dy)*s.scale)+"px",o.style.width=this.format(n*s.scale)+"px",o.style.height=this.format(r*s.scale)+"px",o},mxVmlCanvas2D.prototype.rect=function(t,e,i,n){this.node=this.createRect("rect",t,e,i,n)},mxVmlCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){this.node=this.createRect("roundrect",t,e,i,n),this.node.setAttribute("arcsize",Math.max(100*r/i,100*s/n)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,i,n){this.node=this.createRect("oval",t,e,i,n)},mxVmlCanvas2D.prototype.image=function(t,e,i,n,r,s,o,l){var a=null;if(s){(a=this.createRect("rect",t,e,i,n)).stroked="false";var h=this.createVmlElement("fill");h.aspect=s?"atmost":"ignore",h.rotate="true",h.type="frame",h.src=r,a.appendChild(h)}else(a=this.createRect("image",t,e,i,n)).src=r;o&&l?a.style.rotation="180":o?a.style.flip="x":l&&(a.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(a.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(a)},mxVmlCanvas2D.prototype.createDiv=function(t,e,i,n){var r=this.createElement("div"),s=this.state,o="";if(null!=s.fontBackgroundColor&&(o+="background-color:"+mxUtils.htmlEntities(s.fontBackgroundColor)+";"),null!=s.fontBorderColor&&(o+="border:1px solid "+mxUtils.htmlEntities(s.fontBorderColor)+";"),mxUtils.isNode(t))r.appendChild(t);else if("fill"!=n&&"width"!=n){var l=this.createElement("div");l.style.cssText=o,l.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",l.style.zoom="1",l.style.textDecoration="inherit",l.innerHTML=t,r.appendChild(l)}else r.style.cssText=o,r.innerHTML=t;var a=r.style;return a.fontSize=s.fontSize/this.vmlScale+"px",a.fontFamily=s.fontFamily,a.color=s.fontColor,a.verticalAlign="top",a.textAlign=e||"left",a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?s.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(s.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a.fontWeight="bold"),(s.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a.fontStyle="italic"),(s.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a.textDecoration="underline"),r},mxVmlCanvas2D.prototype.text=function(t,e,i,n,r,s,o,l,a,h,u,p,d){if(this.textEnabled&&null!=r){var c=this.state;if("html"==a){if(null!=c.rotation){var m=this.rotatePoint(t,e,c.rotation,c.rotationCx,c.rotationCy);t=m.x,e=m.y}8!=document.documentMode||mxClient.IS_EM?(t*=c.scale,e*=c.scale):(t+=c.dx,e+=c.dy,"fill"!=h&&o==mxConstants.ALIGN_TOP&&(e-=1));var g=8!=document.documentMode||mxClient.IS_EM?this.createElement("div"):this.createVmlElement("group");g.style.position="absolute",g.style.display="inline",g.style.left=this.format(t)+"px",g.style.top=this.format(e)+"px",g.style.zoom=c.scale;var x=this.createElement("div");x.style.position="relative",x.style.display="inline";var f=mxUtils.getAlignmentAsPoint(s,o),y=f.x,v=f.y,C=this.createDiv(r,s,o,h),E=this.createElement("div");if(null!=d&&C.setAttribute("dir",d),l&&i>0){if(u||(C.style.width=Math.round(i)+"px"),C.style.wordWrap=mxConstants.WORD_WRAP,C.style.whiteSpace="normal","break-word"==C.style.wordWrap)null!=(R=C).firstChild&&"DIV"==R.firstChild.nodeName&&(R.firstChild.style.width="100%")}else C.style.whiteSpace="nowrap";var S=c.rotation+(p||0);if(this.rotateHtml&&0!=S?(E.style.display="inline",E.style.zoom="1",E.appendChild(C),8!=document.documentMode||mxClient.IS_EM||"DIV"==this.root.nodeName?g.appendChild(E):(x.appendChild(E),g.appendChild(x))):8!=document.documentMode||mxClient.IS_EM?(C.style.display="inline",g.appendChild(C)):(x.appendChild(C),g.appendChild(x)),"DIV"!=this.root.nodeName){var b=this.createVmlElement("rect");b.stroked="false",b.filled="false",b.appendChild(g),this.root.appendChild(b)}else this.root.appendChild(g);if(u?(C.style.overflow="hidden",C.style.width=Math.round(i)+"px",mxClient.IS_QUIRKS||(C.style.maxHeight=Math.round(n)+"px")):"fill"==h?(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.height=Math.max(0,n)+1+"px"):"width"==h&&(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.maxHeight=Math.max(0,n)+1+"px"),this.rotateHtml&&0!=S){var T=S*(Math.PI/180),w=parseFloat(parseFloat(Math.cos(T)).toFixed(8)),L=parseFloat(parseFloat(Math.sin(-T)).toFixed(8));(T%=2*Math.PI)<0&&(T+=2*Math.PI),(T%=Math.PI)>Math.PI/2&&(T=Math.PI-T);var A=Math.cos(T),I=Math.sin(T);8!=document.documentMode||mxClient.IS_EM||(C.style.display="inline-block",E.style.display="inline-block",x.style.display="inline-block"),C.style.visibility="hidden",C.style.position="absolute",document.body.appendChild(C);var O=C;null!=O.firstChild&&"DIV"==O.firstChild.nodeName&&(O=O.firstChild);var R=O.offsetWidth+3,M=O.offsetHeight;u?(i=Math.min(i,R),M=Math.min(M,n)):i=R,l&&(C.style.width=i+"px"),mxClient.IS_QUIRKS&&(u||"width"==h)&&M>n&&(M=n,C.style.height=M+"px");var P=((n=M)-n*A+i*-I)/2-L*i*(y+.5)+w*n*(v+.5),N=(i-i*A+n*-I)/2+w*i*(y+.5)+L*n*(v+.5);if("group"==g.nodeName&&"DIV"==this.root.nodeName){var _=this.createElement("div");_.style.display="inline-block",_.style.position="absolute",_.style.left=this.format(t+(N-i/2)*c.scale)+"px",_.style.top=this.format(e+(P-n/2)*c.scale)+"px",g.parentNode.appendChild(_),_.appendChild(g)}else{var D=8!=document.documentMode||mxClient.IS_EM?c.scale:1;g.style.left=this.format(t+(N-i/2)*D)+"px",g.style.top=this.format(e+(P-n/2)*D)+"px"}E.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+w+", M12="+L+", M21="+-L+", M22="+w+", sizingMethod='auto expand')",E.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(E.style.filter+="alpha(opacity="+100*this.state.alpha+")"),E.appendChild(C),C.style.position="",C.style.visibility=""}else if(8!=document.documentMode||mxClient.IS_EM){C.style.verticalAlign="top",this.state.alpha<1&&(g.style.filter="alpha(opacity="+100*this.state.alpha+")");var H=C.parentNode;C.style.visibility="hidden",document.body.appendChild(C),i=C.offsetWidth;M=C.offsetHeight;mxClient.IS_QUIRKS&&u&&M>n&&(M=n,C.style.height=M+"px"),n=M,C.style.visibility="",H.appendChild(C),g.style.left=this.format(t+i*y*this.state.scale)+"px",g.style.top=this.format(e+n*v*this.state.scale)+"px"}else this.state.alpha<1&&(C.style.filter="alpha(opacity="+100*this.state.alpha+")"),x.style.left=100*y+"%",x.style.top=100*v+"%"}else this.plainText(t,e,i,n,mxUtils.htmlEntities(r,!1),s,o,l,a,h,u,p,d)}},mxVmlCanvas2D.prototype.plainText=function(t,e,i,n,r,s,o,l,a,h,u,p,d){var c=this.state;t=(t+c.dx)*c.scale,e=(e+c.dy)*c.scale;var m=this.createVmlElement("shape");m.style.width="1px",m.style.height="1px",m.stroked="false";var g=this.createVmlElement("fill");g.color=c.fontColor,g.opacity=100*c.alpha+"%",m.appendChild(g);var x=this.createVmlElement("path");x.textpathok="true",x.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),m.appendChild(x);var f=this.createVmlElement("textpath");f.style.cssText="v-text-align:"+s,f.style.align=s,f.style.fontFamily=c.fontFamily,f.string=r,f.on="true";var y=c.fontSize*c.scale/this.vmlScale;f.style.fontSize=y+"px",(c.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(c.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),(c.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(f.style.textDecoration="underline");var v=y+(r.split("\n").length-1)*y*mxConstants.LINE_HEIGHT,C=0,E=0;if(o==mxConstants.ALIGN_BOTTOM?E=-v/2:o!=mxConstants.ALIGN_MIDDLE&&(E=v/2),null!=p){m.style.rotation=p;var S=p*(Math.PI/180);C=Math.sin(S)*E,E=Math.cos(S)*E}m.appendChild(f),m.style.left=this.format(t-C)+"px",m.style.top=this.format(e+E)+"px",this.root.appendChild(m)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxVmlCanvas2D=void 0!==mxVmlCanvas2D?mxVmlCanvas2D:void 0,mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.rounded=!1,mxGuide.prototype.tolerance=2,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},mxGuide.prototype.getGuideTolerance=function(t){return t&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance},mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);return e.isDashed=!0,e},mxGuide.prototype.isStateIgnored=function(t){return!1},mxGuide.prototype.move=function(t,e,i,n){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=t&&null!=e){this.graph.getView().translate;var r=this.graph.getView().scale,s=this.getGuideTolerance(i)*r,o=t.clone();o.x+=e.x,o.y+=e.y;var l=!1,a=null,h=null,u=!1,p=null,d=null,c=s,m=s,g=o.x,x=o.x+o.width,f=o.getCenterX(),y=o.y,v=o.y+o.height,C=o.getCenterY();function E(i,n,r){i+=this.graph.panDx;var s=!1;r&&Math.abs(i-f)<=c?(e.x=i-t.getCenterX(),c=Math.abs(i-f),s=!0):r||(Math.abs(i-g)<=c?(e.x=i-t.x,c=Math.abs(i-g),s=!0):Math.abs(i-x)<=c&&(e.x=i-t.x-t.width,c=Math.abs(i-x),s=!0)),s&&(a=n,h=Math.round(i-this.graph.panDx),null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()))),l=l||s}function S(i,n,r){i+=this.graph.panDy;var s=!1;r&&Math.abs(i-C)<=m?(e.y=i-t.getCenterY(),m=Math.abs(i-C),s=!0):r||(Math.abs(i-y)<=m?(e.y=i-t.y,m=Math.abs(i-y),s=!0):Math.abs(i-v)<=m&&(e.y=i-t.y-t.height,m=Math.abs(i-v),s=!0)),s&&(p=n,d=Math.round(i-this.graph.panDy),null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()))),u=u||s}for(var b=0;b0&&null!=t[0]){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e0&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&this.bounds.width>0&&this.bounds.height>0},mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();null!=t&&(t.pointerEvents=this.pointerEvents,this.paint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return null!=this.node.ownerSVGElement?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),null!=t&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),null!=this.isDashed&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents,t.blockImagePointerEvents=mxClient.IS_FF;var e=this.getSvgScreenOffset();return 0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t},mxShape.prototype.createVmlCanvas=function(){var t=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t,!1);if(""!=t.tagUrn){var i=Math.max(1,Math.round(this.bounds.width)),n=Math.max(1,Math.round(this.bounds.height));t.coordsize=i*this.vmlScale+","+n*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var r=this.scale;return e.translate(-Math.round(this.bounds.x/r),-Math.round(this.bounds.y/r)),e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var t=Math.max(1,Math.round(this.bounds.width)),e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px",this.node.style.height=e+"px",this.node.style.overflow="visible"},mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxShape.prototype.updateHtmlFilters=function(t){var e="";if(this.opacity<100&&(e+="alpha(opacity="+this.opacity+")"),this.isShadow&&(e+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')"),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var i=this.fill,n=this.gradient,r="0",s={east:0,south:1,west:2,north:3},o=null!=this.direction?s[this.direction]:0;if(null!=this.gradientDirection&&(o=mxUtils.mod(o+s[this.gradientDirection]-1,4)),1==o){r="1";var l=i;i=n,n=l}else if(2==o){l=i;i=n,n=l}else 3==o&&(r="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+i+"', endColorStr='"+n+"', gradientType='"+r+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;null!=e&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":this.strokewidth>0&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",null!=(e=this.outline?null:this.fill)&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(t):this.setTransparentBackgroundImage(t)},mxShape.prototype.updateHtmlBounds=function(t){var e=document.documentMode>=9?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px",t.style.overflow="hidden",t.style.left=Math.round(this.bounds.x-e/2)+"px",t.style.top=Math.round(this.bounds.y-e/2)+"px","CSS1Compat"==document.compatMode&&(e=-e),t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px",t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"},mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var i=t.gradients[e];null!=i&&(i.mxRefCount=(i.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients),this.oldGradients=t.gradients}},mxShape.prototype.paint=function(t){var e=!1;if(null!=t&&this.outline){var i=t.stroke;t.stroke=function(){e=!0,i.apply(this,arguments)};var n=t.fillAndStroke;t.fillAndStroke=function(){e=!0,n.apply(this,arguments)}}var r=this.scale,s=this.bounds.x/r,o=this.bounds.y/r,l=this.bounds.width/r,a=this.bounds.height/r;if(this.isPaintBoundsInverted()){var h=(l-a)/2;s+=h,o-=h;var u=l;l=a,a=u}this.updateTransform(t,s,o,l,a),this.configureCanvas(t,s,o,l,a);var p=null;if(null==this.stencil&&null==this.points&&this.shapePointerEvents||null!=this.stencil&&this.stencilPointerEvents){var d=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG)p=this.createTransparentSvgRectangle(d.x,d.y,d.width,d.height),this.node.appendChild(p);else{var c=t.createRect("rect",d.x/r,d.y/r,d.width/r,d.height/r);c.appendChild(t.createTransparentFill()),c.stroked="false",t.root.appendChild(c)}}if(null!=this.stencil)this.stencil.drawShape(t,this,s,o,l,a);else if(t.setStrokeWidth(this.strokewidth),null!=this.points){for(var m=[],g=0;g0){o=null==o||o;var l=e[e.length-1];if(r&&i){var a=(e=e.slice())[0],h=new mxPoint(l.x+(a.x-l.x)/2,l.y+(a.y-l.y)/2);e.splice(0,0,h)}var u=e[0],p=1;for(o?t.moveTo(u.x,u.y):t.lineTo(u.x,u.y);p<(r?e.length:e.length-1);){var d=e[mxUtils.mod(p,e.length)],c=u.x-d.x,m=u.y-d.y;if(i&&(0!=c||0!=m)&&(null==s||mxUtils.indexOf(s,p-1)<0)){var g=Math.sqrt(c*c+m*m),x=c*Math.min(n,g/2)/g,f=m*Math.min(n,g/2)/g,y=d.x+x,v=d.y+f;t.lineTo(y,v);for(var C=e[mxUtils.mod(p+1,e.length)];p0&&t.height>0)return this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),void this.boundingBox.grow(this.strokewidth*this.scale/2)}catch(t){}if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var i=this.getShapeRotation();0!=i&&(e=mxUtils.getBoundingBox(e,i))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){this.isShadow&&(t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)),t.grow(this.strokewidth*this.scale/2)},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,i,n){var r=document.createElementNS(mxConstants.NS_SVG,"rect");return r.setAttribute("x",t),r.setAttribute("y",e),r.setAttribute("width",i),r.setAttribute("height",n),r.setAttribute("fill","none"),r.setAttribute("stroke","none"),r.setAttribute("pointer-events","all"),r},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(null!=t)for(var e in t){var i=t[e];null!=i&&(i.mxRefCount=(i.mxRefCount||0)-1,0==i.mxRefCount&&null!=i.parentNode&&i.parentNode.removeChild(i))}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},__mxOutput.mxShape=void 0!==mxShape?mxShape:void 0,mxUtils.extend(mxStencil,mxShape),mxStencil.defaultLocalized=!1,mxStencil.allowEval=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var t=this.desc.getAttribute("aspect");this.aspect=null!=t?t:"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(null!=t){var e=mxUtils.getChildNodes(t);if(null!=e&&e.length>0){this.constraints=[];for(var i=0;i0&&s>0)for(var u=o.firstChild;null!=u;)u.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,u,l,a,h),u=u.nextSibling},mxStencil.prototype.computeAspect=function(t,e,i,n,r,s){var o=e,l=i,a=n/this.w0,h=r/this.h0,u=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH;if(u){h=n/this.h0,a=r/this.w0;var p=(n-r)/2;o+=p,l-=p}return"fixed"==this.aspect&&(a=h=Math.min(a,h),u?(o+=(r-this.w0*a)/2,l+=(n-this.h0*h)/2):(o+=(n-this.w0*a)/2,l+=(r-this.h0*h)/2)),new mxRectangle(o,l,a,h)},mxStencil.prototype.drawNode=function(t,e,i,n,r,s){var o=i.nodeName,l=n.x,a=n.y,h=n.width,u=n.height,p=Math.min(h,u);if("save"==o)t.save();else if("restore"==o)t.restore();else if(s){if("path"==o){t.begin();var d=!0;if("1"==i.getAttribute("rounded")){d=!1;for(var c=Number(i.getAttribute("arcSize")),m=0,g=[],x=i.firstChild;null!=x;){if(x.nodeType==mxConstants.NODETYPE_ELEMENT){var f=x.nodeName;if("move"!=f&&"line"!=f){d=!0;break}"move"!=f&&0!=g.length||g.push([]),g[g.length-1].push(new mxPoint(l+Number(x.getAttribute("x"))*h,a+Number(x.getAttribute("y"))*u)),m++}x=x.nextSibling}if(!d&&m>0)for(var y=0;y0&&V.push(Number(U[y])*p);G=V.join(" "),t.setDashPattern(G)}}else"strokecolor"==o?t.setStrokeColor(i.getAttribute("color")):"linecap"==o?t.setLineCap(i.getAttribute("cap")):"linejoin"==o?t.setLineJoin(i.getAttribute("join")):"miterlimit"==o?t.setMiterLimit(Number(i.getAttribute("limit"))):"fillcolor"==o?t.setFillColor(i.getAttribute("color")):"alpha"==o||"fillalpha"==o||"strokealpha"==o?t.setAlpha(i.getAttribute("alpha")):"fontcolor"==o?t.setFontColor(i.getAttribute("color")):"fontstyle"==o?t.setFontStyle(i.getAttribute("style")):"fontfamily"==o?t.setFontFamily(i.getAttribute("family")):"fontsize"==o&&t.setFontSize(Number(i.getAttribute("size"))*p);!r||"fillstroke"!=o&&"fill"!=o&&"stroke"!=o||(r=!1,t.setShadow(!1))}},__mxOutput.mxStencil=void 0!==mxStencil?mxStencil:void 0;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=void 0!==mxStencilRegistry?mxStencilRegistry:void 0;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,i,n,r,s,o,l,a,h){var u=mxMarker.markers[i];return null!=u?u(t,e,i,n,r,s,o,l,a,h):null}};function mxActor(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxCloud(t,e,i,n){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxRectangleShape(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxDoubleEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxRhombus(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxPolyline(t,e,i){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=null!=i?i:1}function mxArrow(t,e,i,n,r,s,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1,this.arrowWidth=null!=r?r:mxConstants.ARROW_WIDTH,this.spacing=null!=s?s:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxArrowConnector(t,e,i,n,r,s,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1,this.arrowWidth=null!=r?r:mxConstants.ARROW_WIDTH,this.arrowSpacing=null!=s?s:mxConstants.ARROW_SPACING,this.startSize=mxConstants.ARROW_SIZE/5,this.endSize=mxConstants.ARROW_SIZE/5}function mxText(t,e,i,n,r,s,o,l,a,h,u,p,d,c,m,g,x,f,y,v,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=null!=r?r:"black",this.align=null!=i?i:mxConstants.ALIGN_CENTER,this.valign=null!=n?n:mxConstants.ALIGN_MIDDLE,this.family=null!=s?s:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=l?l:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(a||2),this.spacingTop=this.spacing+parseInt(h||0),this.spacingRight=this.spacing+parseInt(u||0),this.spacingBottom=this.spacing+parseInt(p||0),this.spacingLeft=this.spacing+parseInt(d||0),this.horizontal=null==c||c,this.background=m,this.border=g,this.wrap=null!=x&&x,this.clipped=null!=f&&f,this.overflow=null!=y?y:"visible",this.labelPadding=null!=v?v:0,this.textDirection=C,this.rotation=0,this.updateMargin()}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(t,e,i){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=null!=i?i:1}function mxImageShape(t,e,i,n,r){mxShape.call(this),this.bounds=t,this.image=e,this.fill=i,this.stroke=n,this.strokewidth=null!=r?r:1,this.shadow=!1}function mxLabel(t,e,i,n){mxRectangleShape.call(this,t,e,i,n)}function mxCylinder(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxConnector(t,e,i){mxPolyline.call(this,t,e,i)}function mxSwimlane(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=null!=n?n:1}function mxGraphLayout(t){this.graph=t}function WeightedCellSorter(t,e){this.cell=t,this.weightedValue=e}function mxStackLayout(t,e,i,n,r,s){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=null!=i?i:0,this.x0=null!=n?n:0,this.y0=null!=r?r:0,this.border=null!=s?s:0}function mxPartitionLayout(t,e,i,n){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=i||0,this.border=n||0}function mxCompactTreeLayout(t,e,i){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.invert=null!=i&&i}function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}function mxFastOrganicLayout(t){mxGraphLayout.call(this,t)}function mxCircleLayout(t,e){mxGraphLayout.call(this,t),this.radius=null!=e?e:100}function mxParallelEdgeLayout(t){mxGraphLayout.call(this,t)}function mxCompositeLayout(t,e,i){mxGraphLayout.call(this,t),this.layouts=e,this.master=i}function mxEdgeLabelLayout(t,e){mxGraphLayout.call(this,t)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=t,this.id=mxObjectIdentity.get(t),this.connectsAsTarget=[],this.connectsAsSource=[]}function mxGraphHierarchyEdge(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=t,this.ids=[];for(var e=0;e0){var p=u[0],d=t.getVisibleTerminal(p,!1),c=this.vertexMapper.get(d);s[o]==c&&(d=t.getVisibleTerminal(p,!0),c=this.vertexMapper.get(d)),null!=c&&s[o]!=c&&(h.target=c,0==c.connectsAsTarget.length&&(c.connectsAsTarget=[]),mxUtils.indexOf(c.connectsAsTarget,h)<0&&c.connectsAsTarget.push(h))}}s[o].temp[0]=1}}function mxSwimlaneModel(t,e,i,n,r){t.getGraph(),this.tightenToSource=r,this.roots=i,this.parent=n,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var s=[];null==e&&(e=this.graph.getChildVertices(n)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,s);for(var o=0;o0){var p=u[0],d=t.getVisibleTerminal(p,!1),c=this.vertexMapper.get(d);s[o]==c&&(d=t.getVisibleTerminal(p,!0),c=this.vertexMapper.get(d)),null!=c&&s[o]!=c&&(h.target=c,0==c.connectsAsTarget.length&&(c.connectsAsTarget=[]),mxUtils.indexOf(c.connectsAsTarget,h)<0&&c.connectsAsTarget.push(h))}}s[o].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(t){this.layout=t}function MedianCellSorter(){}function mxMinimumCycleRemover(t){this.layout=t}function mxCoordinateAssignment(t,e,i,n,r,s){this.layout=t,this.intraCellSpacing=e,this.interRankCellSpacing=i,this.orientation=n,this.initialX=r,this.parallelEdgeSpacing=s}function mxSwimlaneOrdering(t){this.layout=t}function mxHierarchicalLayout(t,e,i){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==i||i}!function(){function t(t){return t=null!=t?t:2,function(e,i,n,r,s,o,l,a,h,u){var p=s*h*1.118,d=o*h*1.118;s*=l+h,o*=l+h;var c=r.clone();c.x-=p,c.y-=d;var m=n!=mxConstants.ARROW_CLASSIC&&n!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;return r.x+=-s*m-p,r.y+=-o*m-d,function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-s-o/t,c.y-o+s/t),n!=mxConstants.ARROW_CLASSIC&&n!=mxConstants.ARROW_CLASSIC_THIN||e.lineTo(c.x-3*s/4,c.y-3*o/4),e.lineTo(c.x+o/t-s,c.y-o-s/t),e.close(),u?e.fillAndStroke():e.stroke()}}}function e(t){return t=null!=t?t:2,function(e,i,n,r,s,o,l,a,h,u){var p=s*h*1.118,d=o*h*1.118;s*=l+h,o*=l+h;var c=r.clone();return c.x-=p,c.y-=d,r.x+=2*-p,r.y+=2*-d,function(){e.begin(),e.moveTo(c.x-s-o/t,c.y-o+s/t),e.lineTo(c.x,c.y),e.lineTo(c.x+o/t-s,c.y-o-s/t),e.stroke()}}}function i(t,e,i,n,r,s,o,l,a,h){var u=i==mxConstants.ARROW_DIAMOND?.7071:.9862,p=r*a*u,d=s*a*u;r*=o+a,s*=o+a;var c=n.clone();c.x-=p,c.y-=d,n.x+=-r-p,n.y+=-s-d;var m=i==mxConstants.ARROW_DIAMOND?2:3.4;return function(){t.begin(),t.moveTo(c.x,c.y),t.lineTo(c.x-r/2-s/m,c.y+r/m-s/2),t.lineTo(c.x-r,c.y-s),t.lineTo(c.x-r/2+s/m,c.y-s/2-r/m),t.close(),h?t.fillAndStroke():t.stroke()}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3)),mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",(function(t,e,i,n,r,s,o,l,a,h){var u=o/2,p=n.clone();return n.x-=r*u,n.y-=s*u,function(){t.ellipse(p.x-u,p.y-u,o,o),h?t.fillAndStroke():t.stroke()}})),mxMarker.addMarker("diamond",i),mxMarker.addMarker("diamondThin",i)}(),__mxOutput.mxMarker=void 0!==mxMarker?mxMarker:void 0,mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,i,n,r){var s=n/3;t.moveTo(0,r),t.curveTo(0,3*r/5,0,2*r/5,n/2,2*r/5),t.curveTo(n/2-s,2*r/5,n/2-s,0,n/2,0),t.curveTo(n/2+s,0,n/2+s,2*r/5,n/2,2*r/5),t.curveTo(n,2*r/5,n,3*r/5,n,r),t.close()},__mxOutput.mxActor=void 0!==mxActor?mxActor:void 0,mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,i,n,r){t.moveTo(.25*n,.25*r),t.curveTo(.05*n,.25*r,0,.5*r,.16*n,.55*r),t.curveTo(0,.66*r,.18*n,.9*r,.31*n,.8*r),t.curveTo(.4*n,r,.7*n,r,.8*n,.8*r),t.curveTo(n,.8*r,n,.6*r,.875*n,.5*r),t.curveTo(n,.3*r,.8*n,.1*r,.625*n,.2*r),t.curveTo(.5*n,.05*r,.3*n,.05*r,.25*n,.25*r),t.close()},__mxOutput.mxCloud=void 0!==mxCloud?mxCloud:void 0,mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return null!=this.style&&(t="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),!this.isRounded&&!this.glass&&0==this.rotation&&(t||null!=this.fill&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,i,n,r){var s=!0;if(null!=this.style&&(s="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),s||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE){if(s||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isRounded){var o=0;if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))o=Math.min(n/2,Math.min(r/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;o=Math.min(n*l,r*l)}t.roundrect(e,i,n,r,o,o)}else t.rect(e,i,n,r);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,i,n,r){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,i,n,r){this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,i,n,r,this.getArcSize(n+this.strokewidth,r+this.strokewidth))},__mxOutput.mxRectangleShape=void 0!==mxRectangleShape?mxRectangleShape:void 0,mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},__mxOutput.mxEllipse=void 0!==mxEllipse?mxEllipse:void 0,mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,i,n,r){if(!this.outline){var s=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(n/5,r/5)));e+=s,i+=s,r-=2*s,(n-=2*s)>0&&r>0&&t.ellipse(e,i,n,r),t.stroke()}},mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},__mxOutput.mxDoubleEllipse=void 0!==mxDoubleEllipse?mxDoubleEllipse:void 0,mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,i,n,r){var s=n/2,o=r/2,l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+s,i),new mxPoint(e+n,i+o),new mxPoint(e+s,i+r),new mxPoint(e,i+o)],this.isRounded,l,!0),t.fillAndStroke()},__mxOutput.mxRhombus=void 0!==mxRhombus?mxRhombus:void 0,mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.getShapeRotation=function(){return 0},mxPolyline.prototype.isPaintBoundsInverted=function(){return!1},mxPolyline.prototype.paintEdgeShape=function(t,e){var i=t.pointerEventsValue;t.pointerEventsValue="stroke",null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=i},mxPolyline.prototype.paintLine=function(t,e,i){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,i,n,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var i=e[0],n=e.length;t.moveTo(i.x,i.y);for(var r=1;r2&&t.setMiterLimit(1.42),t.begin();var A=C,I=S;if(l&&!o)this.paintMarker(t,e[0].x,e[0].y,C,S,u,n,s,h,!0);else{var O=e[0].x+T/2+h*C,R=e[0].y+w/2+h*S,M=e[0].x-T/2+h*C,P=e[0].y-w/2+h*S;o?(t.moveTo(O,R),L.push((function(){t.lineTo(M,P)}))):(t.moveTo(M,P),t.lineTo(O,R))}for(var N=0,_=0,D=0,H=0;H=0;H--)L[H]();o?(t.end(),t.stroke()):(t.close(),t.fillAndStroke()),t.setShadow(!1),t.setMiterLimit(4),d&&t.setLineJoin("flat"),e.length>2&&(t.setMiterLimit(4),l&&!o&&(t.begin(),this.paintMarker(t,e[0].x,e[0].y,A,I,u,n,s,h,!0),t.stroke(),t.end()),a&&!o&&(t.begin(),this.paintMarker(t,c.x,c.y,-C,-S,p,r,s,h,!0),t.stroke(),t.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,i,n,r,s,o,l,a,h){var u=l/o,p=l*r/2,d=-l*n/2,c=(a+s)*n,m=(a+s)*r;h?t.moveTo(e-p+c,i-d+m):t.lineTo(e-p+c,i-d+m),t.lineTo(e-p/u+c,i-d/u+m),t.lineTo(e+a*n,i+a*r),t.lineTo(e+p/u+c,i+d/u+m),t.lineTo(e+p+c,i+d+m)},mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded},mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3},mxArrowConnector.prototype.isOpenEnded=function(){return!1},mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE},mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE},__mxOutput.mxArrowConnector=void 0!==mxArrowConnector?mxArrowConnector:void 0,mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=8!=document.documentMode||mxClient.IS_EM?3:4,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var i=this.scale,n=this.bounds.x/i,r=this.bounds.y/i,s=this.bounds.width/i,o=this.bounds.height/i;if(this.updateTransform(t,n,r,s,o),this.configureCanvas(t,n,r,s,o),e)t.updateText(n,r,s,o,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var l=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,a=l||t instanceof mxVmlCanvas2D?"html":"",h=this.value;l||"html"!=a||(h=mxUtils.htmlEntities(h,!1)),"html"!=a||mxUtils.isNode(this.value)||(h=mxUtils.replaceTrailingNewlines(h,"

")),h=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==a?h.replace(/\n/g,"
"):h;var u=this.textDirection;u!=mxConstants.TEXT_DIRECTION_AUTO||l||(u=this.getAutoDirection()),u!=mxConstants.TEXT_DIRECTION_LTR&&u!=mxConstants.TEXT_DIRECTION_RTL&&(u=null),t.text(n,r,s,o,h,this.align,this.valign,this.wrap,a,this.overflow,this.clipped,this.getTextRotation(),u)}},mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML))if("DIV"!=this.node.nodeName||!this.isHtmlAllowed()&&mxClient.IS_VML){var t=this.createCanvas();null!=t&&null!=t.updateText?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null},mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments),this.color="black",this.align=mxConstants.ALIGN_CENTER,this.valign=mxConstants.ALIGN_MIDDLE,this.family=mxConstants.DEFAULT_FONTFAMILY,this.size=mxConstants.DEFAULT_FONTSIZE,this.fontStyle=mxConstants.DEFAULT_FONTSTYLE,this.spacing=2,this.spacingTop=2,this.spacingRight=2,this.spacingBottom=2,this.spacingLeft=2,this.horizontal=!0,delete this.background,delete this.border,this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION,delete this.margin},mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments),null!=this.style&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin()),this.flipV=null,this.flipH=null},mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=t&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return null!=t&&(t=null==t.ownerSVGElement?this.node.firstChild.firstChild:t.firstChild.firstChild.firstChild.firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),i=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,n=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!(this.ignoreStringSize||null==t||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize&&i==mxConstants.ALIGN_CENTER&&n==mxConstants.ALIGN_MIDDLE)){var r=null,s=null;if(null!=t.ownerSVGElement)if(null!=t.firstChild&&null!=t.firstChild.firstChild&&"foreignObject"==t.firstChild.firstChild.nodeName)s=(t=t.firstChild.firstChild.firstChild.firstChild).offsetHeight*this.scale,r="width"==this.overflow?this.boundingBox.width:t.offsetWidth*this.scale;else try{var o=t.getBBox();return void("string"==typeof this.value&&0==mxUtils.trim(this.value)||0==o.width&&0==o.height?this.boundingBox=null:this.boundingBox=new mxRectangle(o.x,o.y,o.width,o.height))}catch(t){}else{var l=null!=this.state?this.state.view.textDiv:null;if(null!=this.offsetWidth&&null!=this.offsetHeight)r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale;else{null!=l&&(this.updateFont(l),this.updateSize(l,!1),this.updateInnerHtml(l),t=l);var a=t;if(8!=document.documentMode||mxClient.IS_EM)null!=a.firstChild&&"DIV"==a.firstChild.nodeName&&(a=a.firstChild);else{var h=Math.round(this.bounds.width/this.scale);if(this.wrap&&h>0){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal","break-word"!=t.style.wordWrap){var u=a.getElementsByTagName("div");u.length>0&&(a=u[u.length-1]),r=a.offsetWidth+2,u=this.node.getElementsByTagName("div"),this.clipped&&(r=Math.min(h,r)),u.length>1&&(u[u.length-2].style.width=r+"px")}}else t.style.whiteSpace="nowrap"}this.offsetWidth=a.offsetWidth+this.textWidthPadding,this.offsetHeight=a.offsetHeight,r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale}}null!=r&&null!=s&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,r,s))}if(null!=this.boundingBox)if(0!=e){var p=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0));this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=p.x,this.boundingBox.y+=p.y,this.boundingBox.width=p.width,this.boundingBox.height=p.height}else this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,i,n,r){mxShape.prototype.configureCanvas.apply(this,arguments),t.setFontColor(this.color),t.setFontBackgroundColor(this.background),t.setFontBorderColor(this.border),t.setFontFamily(this.family),t.setFontSize(this.size),t.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.getHtmlValue=function(){var t=this.value;return this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t},mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e="display: inline-block; font-size: "+this.size+"px; font-family: "+this.family+"; color: "+this.color+"; line-height: "+t+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e+="font-weight: bold; "),(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e+="font-style: italic; ");var i=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(e+="text-decoration: "+i.join(" ")+"; "),e},mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var t=this.node.style;t.whiteSpace="normal",t.overflow="",t.width="",t.height="",this.updateValue(),this.updateFont(this.node),this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()}},mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale)),e=Math.max(0,Math.round(this.bounds.height/this.scale)),i="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",n=this.getTextCss()+(this.pointerEvents?"pointer-events: all; ":"");mxSvgCanvas2D.createCss(t,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,null!=this.background?mxUtils.htmlEntities(this.background):null,null!=this.border?mxUtils.htmlEntities(this.border):null,i,n,this.scale,mxUtils.bind(this,(function(t,e,i,n,r,s){var o=this.getTextRotation(),l=(1!=this.scale?"scale("+this.scale+") ":"")+(0!=o?"rotate("+o+"deg) ":"")+(0!=this.margin.x||0!=this.margin.y?"translate("+100*this.margin.x+"%,"+100*this.margin.y+"%)":"");""!=l&&(l="transform-origin: 0 0; transform: "+l+"; "),""==s?(i+=n,n="display:inline-block; min-width: 100%; "+l):n+=l,this.opacity<100&&(r+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",i);var a=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();null==this.node.firstChild&&(this.node.innerHTML="
"+a+"
"),this.node.firstChild.firstChild.setAttribute("style",r),this.node.firstChild.setAttribute("style",n)})))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,i=this.margin.x,n=this.margin.y;0!=t?(mxUtils.setPrefixedStyle(e,"transformOrigin",100*-i+"% "+100*-n+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+100*i+"%,"+100*n+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+100*i+"%,"+100*n+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(i*("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px",e.top=Math.round(this.bounds.y-n*("fill"!=this.overflow?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"
 
"),e='
'+(e=this.replaceLinefeeds?e.replace(/\n/g,"
"):e)+"
",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,i=this.margin.y,n=this.scale;mxUtils.setOpacity(this.node,this.opacity);var r=0,s=0,o=null!=this.state?this.state.view.textDiv:null,l=this.node;if(null!=o){o.style.overflow="",o.style.height="",o.style.width="",this.updateFont(o),this.updateSize(o,!1),this.updateInnerHtml(o);var a=Math.round(this.bounds.width/this.scale);this.wrap&&a>0?(o.style.whiteSpace="normal",o.style.wordWrap=mxConstants.WORD_WRAP,r=a,this.clipped&&(r=Math.min(r,this.bounds.width)),o.style.width=r+"px"):o.style.whiteSpace="nowrap",null!=(l=o).firstChild&&"DIV"==l.firstChild.nodeName&&(l=l.firstChild,this.wrap&&"break-word"==o.style.wordWrap&&(l.style.width="100%")),!this.clipped&&this.wrap&&a>0&&(r=l.offsetWidth+this.textWidthPadding,o.style.width=r+"px"),s=l.offsetHeight+2,mxClient.IS_QUIRKS&&null!=this.border&&this.border!=mxConstants.NONE&&(s+=3)}else null!=l.firstChild&&"DIV"==l.firstChild.nodeName&&(s=(l=l.firstChild).offsetHeight);r=l.offsetWidth+this.textWidthPadding,this.clipped&&(s=Math.min(s,this.bounds.height));a=this.bounds.width/n;var h=this.bounds.height/n;"fill"==this.overflow?(s=h,r=a):"width"==this.overflow&&(s=l.scrollHeight,r=a),this.offsetWidth=r,this.offsetHeight=s,mxClient.IS_QUIRKS&&(this.clipped||"width"==this.overflow&&h>0)?(h=Math.min(h,s),t.height=Math.round(h)+"px"):h=s,"fill"!=this.overflow&&"width"!=this.overflow&&(this.clipped&&(r=Math.min(a,r)),a=r,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),h*=n,a*=n;var u=this.getTextRotation()*(Math.PI/180),p=parseFloat(parseFloat(Math.cos(u)).toFixed(8)),d=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));(u%=2*Math.PI)<0&&(u+=2*Math.PI),(u%=Math.PI)>Math.PI/2&&(u=Math.PI-u);var c=Math.cos(u),m=Math.sin(-u),g=a*-(e+.5),x=h*-(i+.5),f=(h-h*c+a*m)/2+d*g-p*x,y=(a-a*c+h*m)/2-p*g-d*x;if(0!=u){var v="progid:DXImageTransform.Microsoft.Matrix(M11="+p+", M12="+d+", M21="+-d+", M22="+p+", sizingMethod='auto expand')";null!=t.filter&&t.filter.length>0?t.filter+=" "+v:t.filter=v}i=0;"fill"!=this.overflow&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?i-=1:this.valign==mxConstants.ALIGN_BOTTOM?i+=2:i+=1),t.zoom=n,t.left=Math.round(this.bounds.x+y-a/2)+"px",t.top=Math.round(this.bounds.y+f-h/2+i)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var t=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t;var e=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,i=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if("fill"==this.overflow||"width"==this.overflow)null!=e&&(this.node.style.backgroundColor=e),null!=i&&(this.node.style.border="1px solid "+i);else{var n="";null!=e&&(n+="background-color:"+mxUtils.htmlEntities(e)+";"),null!=i&&(n+="border:1px solid "+mxUtils.htmlEntities(i)+";"),t='
'+t+"
"}this.node.innerHTML=t;var r=this.node.getElementsByTagName("div");if(r.length>0){var s=this.textDirection;s==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(s=this.getAutoDirection()),s==mxConstants.TEXT_DIRECTION_LTR||s==mxConstants.TEXT_DIRECTION_RTL?r[r.length-1].setAttribute("dir",s):r[r.length-1].removeAttribute("dir")}}},mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e.fontSize=this.size+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="";var i=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),e.textDecoration=i.join(" "),this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var i=Math.max(0,Math.round(this.bounds.width/this.scale)),n=Math.max(0,Math.round(this.bounds.height/this.scale)),r=t.style;if(this.clipped?(r.overflow="hidden",mxClient.IS_QUIRKS?r.width=i+"px":(r.maxHeight=n+"px",r.maxWidth=i+"px")):"fill"==this.overflow?(r.width=i+1+"px",r.height=n+1+"px",r.overflow="hidden"):"width"==this.overflow&&(r.width=i+1+"px",r.maxHeight=n+1+"px",r.overflow="hidden"),this.wrap&&i>0){if(r.wordWrap=mxConstants.WORD_WRAP,r.whiteSpace="normal",r.width=i+"px",e&&"fill"!=this.overflow&&"width"!=this.overflow){var s=t;null!=s.firstChild&&"DIV"==s.firstChild.nodeName&&(s=s.firstChild,"break-word"==t.style.wordWrap&&(s.style.width="100%"));var o=s.offsetWidth;if(0==o){var l=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),o=s.offsetWidth,t.style.visibility="",l.appendChild(t)}o+=3,this.clipped&&(o=Math.min(o,i)),r.width=o+"px"}}else r.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},__mxOutput.mxText=void 0!==mxText?mxText:void 0,mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(n,.5*r),new mxPoint(0,r)],this.isRounded,s,!0)},__mxOutput.mxTriangle=void 0!==mxTriangle?mxTriangle:void 0,mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*n,0),new mxPoint(.75*n,0),new mxPoint(n,.5*r),new mxPoint(.75*n,r),new mxPoint(.25*n,r),new mxPoint(0,.5*r)],this.isRounded,s,!0)},__mxOutput.mxHexagon=void 0!==mxHexagon?mxHexagon:void 0,mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(t,e,i,n,r){var s=i+r/2;t.begin(),t.moveTo(e,s),t.lineTo(e+n,s),t.stroke()},__mxOutput.mxLine=void 0!==mxLine?mxLine:void 0,mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return 0},mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments),this.fill=null,this.stroke=null,this.gradient=null,null!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,i,n,r){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,i,n,r){if(null!=this.image){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null!=s&&(t.setFillColor(s),t.setStrokeColor(o),t.rect(e,i,n,r),t.fillAndStroke()),t.image(e,i,n,r,this.image,this.preserveImageAspect,!1,!1),null!=(o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null))&&(t.setShadow(!1),t.setStrokeColor(o),t.rect(e,i,n,r),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.innerHTML="",null!=this.image){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var i=mxClient.IS_IE6||(null==document.documentMode||document.documentMode<=8)&&0!=this.rotation,n=document.createElement(i?mxClient.VML_PREFIX+":image":"img");n.setAttribute("border","0"),n.style.position="absolute",n.src=this.image;var r=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=r,this.flipH&&this.flipV?r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?r+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),n.style.filter!=r&&(n.style.filter=r),"image"==n.nodeName?n.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(n.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(n.style,"transform",""),n.style.width=this.node.style.width,n.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(n)}else this.setTransparentBackgroundImage(this.node)},__mxOutput.mxImageShape=void 0!==mxImageShape?mxImageShape:void 0,mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(t){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(t,e,i,n,r){this.paintImage(t,e,i,n,r),this.paintIndicator(t,e,i,n,r),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,i,n,r){if(null!=this.image){var s=this.getImageBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return r==mxConstants.ALIGN_CENTER?t+=(i-o)/2:r==mxConstants.ALIGN_RIGHT?t+=i-o-a:t+=a,s==mxConstants.ALIGN_TOP?e+=a:s==mxConstants.ALIGN_BOTTOM?e+=n-l-a:e+=(n-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.paintIndicator=function(t,e,i,n,r){if(null!=this.indicator)this.indicator.bounds=this.getIndicatorBounds(e,i,n,r),this.indicator.paint(t);else if(null!=this.indicatorImage){var s=this.getIndicatorBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),a=this.spacing+5;return r==mxConstants.ALIGN_RIGHT?t+=i-o-a:r==mxConstants.ALIGN_CENTER?t+=(i-o)/2:t+=a,s==mxConstants.ALIGN_BOTTOM?e+=n-l-a:s==mxConstants.ALIGN_TOP?e+=a:e+=(n-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var t=document.createElement("img");t.style.position="relative",t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.x-=this.bounds.x,e.y-=this.bounds.y,t.style.left=Math.round(e.x)+"px",t.style.top=Math.round(e.y)+"px",t.style.width=Math.round(e.width)+"px",t.style.height=Math.round(e.height)+"px",t.src=this.image,this.node.appendChild(t)}},__mxOutput.mxLabel=void 0!==mxLabel?mxLabel:void 0,mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r,!1),t.fillAndStroke(),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),t.begin(),this.redrawPath(t,e,i,n,r,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,i,n){return Math.min(this.maxHeight,Math.round(n/5))},mxCylinder.prototype.redrawPath=function(t,e,i,n,r,s){var o=this.getCylinderSize(e,i,n,r);(s&&null!=this.fill||!s&&null==this.fill)&&(t.moveTo(0,o),t.curveTo(0,2*o,n,2*o,n,o),s||(t.stroke(),t.begin())),s||(t.moveTo(0,o),t.curveTo(0,-o/3,n,-o/3,n,o),t.lineTo(n,r-o),t.curveTo(n,r+o/3,0,r+o/3,0,r-o),t.close())},__mxOutput.mxCylinder=void 0!==mxCylinder?mxCylinder:void 0,mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED],mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var i=this.createMarker(t,e,!0),n=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),null!=i&&i(),null!=n&&n()},mxConnector.prototype.createMarker=function(t,e,i){var n=null,r=e.length,s=mxUtils.getValue(this.style,i?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),o=i?e[1]:e[r-2],l=i?e[0]:e[r-1];if(null!=s&&null!=o&&null!=l){for(var a=1;a0)for(var l=0;lt.weightedValue?-1:e.weightedValueh)break;l=c}}}var m=r.getIndex(t);m=Math.max(0,o-(o>m?1:0)),n.add(r,t,m)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),i=e.getGeometry(t);null!=this.graph.container&&(null==i&&e.isLayer(t)||t==this.graph.getView().currentRoot)&&(i=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));return i},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),i=e.getChildCount(t),n=[],r=0;rn.y>0?1:-1}))),n},mxStackLayout.prototype.snap=function(t){if(null!=this.gridSize&&this.gridSize>0&&(t=Math.max(t,this.gridSize))/this.gridSize>1){var e=t%this.gridSize;t+=e>this.gridSize/2?this.gridSize-e:-e}return t},mxStackLayout.prototype.execute=function(t){if(null!=t){var e=this.getParentSize(t),i=this.isHorizontal(),n=this.graph.getModel(),r=null;null!=e&&(r=i?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),r-=2*this.border;var s=this.x0+this.border+this.marginLeft,o=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var l=this.graph.getCellStyle(t),a=mxUtils.getNumber(l,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),h=1==mxUtils.getValue(l,mxConstants.STYLE_HORIZONTAL,!0);null!=e&&(a=h?Math.min(a,e.height):Math.min(a,e.width)),i==h&&(r-=a),h?o+=a:s+=a}n.beginUpdate();try{for(var u=0,p=null,d=0,c=null,m=this.getLayoutCells(t),g=0;gthis.wrap||!i&&p.y+p.height+f.height+2*this.spacing>this.wrap)&&(p=null,i?o+=u+this.spacing:s+=u+this.spacing,u=0),u=Math.max(u,i?f.height:f.width);var y=0;if(!this.borderCollapse){var v=this.graph.getCellStyle(x);y=mxUtils.getNumber(v,mxConstants.STYLE_STROKEWIDTH,1)}if(null!=p){var C=d+this.spacing+Math.floor(y/2);i?f.x=this.snap((this.allowGaps?Math.max(C,f.x):C)-this.marginLeft)+this.marginLeft:f.y=this.snap((this.allowGaps?Math.max(C,f.y):C)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(i?f.x=this.allowGaps&&f.x>s?Math.max(this.snap(f.x-this.marginLeft)+this.marginLeft,s):s:f.y=this.allowGaps&&f.y>o?Math.max(this.snap(f.y-this.marginTop)+this.marginTop,o):o);i?f.y=o:f.x=s,this.fill&&null!=r&&(i?f.height=r:f.width=r),i?f.width=this.snap(f.width):f.height=this.snap(f.height),this.setChildGeometry(x,f),c=x,p=f,d=i?p.x+p.width+Math.floor(y/2):p.y+p.height+Math.floor(y/2)}}this.resizeParent&&null!=e&&null!=p&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,p):this.resizeLast&&null!=e&&null!=p&&null!=c&&(i?p.width=e.width-p.x-this.spacing-this.marginRight-this.marginLeft:p.height=e.height-p.y-this.spacing-this.marginBottom,this.setChildGeometry(c,p))}finally{n.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var i=this.graph.getCellGeometry(t);null!=i&&e.x==i.x&&e.y==i.y&&e.width==i.width&&e.height==i.height||this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,i){var n=this.isHorizontal(),r=this.graph.getModel(),s=e.clone();if(n){var o=i.x+i.width+this.marginRight+this.border;this.resizeParentMax?s.width=Math.max(s.width,o):s.width=o}else{o=i.y+i.height+this.marginBottom+this.border;this.resizeParentMax?s.height=Math.max(s.height,o):s.height=o}e.x==s.x&&e.y==s.y&&e.width==s.width&&e.height==s.height||r.setGeometry(t,s)},__mxOutput.mxStackLayout=void 0!==mxStackLayout?mxStackLayout:void 0,mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(t,e,i){var n=this.graph.getModel(),r=n.getParent(t);if(null!=t&&null!=r){var s=0,o=0,l=n.getChildCount(r);for(s=0;se)break;o=u}}var p=r.getIndex(t);p=Math.max(0,s-(s>p?1:0)),n.add(r,t,p)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),i=this.graph.getModel(),n=i.getGeometry(t);null!=this.graph.container&&(null==n&&i.isLayer(t)||t==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));if(null!=n){for(var r=[],s=i.getChildCount(t),o=0;o0){var h=this.border,u=this.border,p=e?n.height:n.width;p-=2*this.border;var d=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;p-=e?d.height:d.width,h+=d.width,u+=d.height;var c=this.border+(a-1)*this.spacing,m=e?(n.width-h-c)/a:(n.height-u-c)/a;if(m>0){i.beginUpdate();try{for(o=0;o0)this.root=t;else{var n=this.graph.findTreeRoots(t,!0,this.invert);if(n.length>0)for(var r=0;r0){this.root=n[r];break}}else this.root=e;if(null!=this.root){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&null!=i.isVertex(t)&&this.maintainParentLocation)null!=(a=this.graph.getCellGeometry(t))&&(this.parentX=a.x,this.parentY=a.y);i.beginUpdate();try{if(this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node){this.layout(this.node);var s=this.graph.gridSize,o=s;if(!this.moveTree){var l=this.getVertexBounds(this.root);null!=l&&(s=l.x,o=l.y)}var a,h=null;if(null!=(h=this.isHorizontal()?this.horizontalLayout(this.node,s,o):this.verticalLayout(this.node,null,s,o))){var u=0,p=0;h.x<0&&(u=Math.abs(s-h.x)),h.y<0&&(p=Math.abs(o-h.y)),0==u&&0==p||this.moveNode(this.node,u,p),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(null!=this.parentX&&null!=this.parentY)null!=(a=this.graph.getCellGeometry(t))&&((a=a.clone()).x=this.parentX,a.y=this.parentY,i.setGeometry(t,a))}}finally{i.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,i){t.x+=e,t.y+=i,this.apply(t);for(var n=t.child;null!=n;)this.moveNode(n,e,i),n=n.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var i=new mxDictionary;e.sort((function(e,n){var r=e.getTerminal(e.getTerminal(!1)==t),s=i.get(r);null==s&&(s=mxCellPath.create(r).split(mxCellPath.PATH_SEPARATOR),i.put(r,s));var o=n.getTerminal(n.getTerminal(!1)==t),l=i.get(o);return null==l&&(l=mxCellPath.create(o).split(mxCellPath.PATH_SEPARATOR),i.put(o,l)),mxCellPath.compare(s,l)}))},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(null==this.maxRankHeight[e]||this.maxRankHeight[e]t.height&&(t.height=this.maxRankHeight[e]);for(var i=t.child;null!=i;)this.setCellHeights(i,e+1),i=i.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var i=mxCellPath.create(t),n=null;if(null!=t&&null==this.visited[i]&&!this.isVertexIgnored(t)){this.visited[i]=t,n=this.createNode(t);var r=this.graph.getModel(),s=null,o=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),l=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,o);for(var a=0;a0)if(t<0)o=t*n/i-e;else if(t>0){o=t*s/r-e}else o=-e;else if(rt+i){o=(i+t)*s/r-(e+n)}else o=s-(e+n);return o>0?o:0},mxCompactTreeLayout.prototype.bridge=function(t,e,i,n,r,s){var o=r+n.dx-e,l=0;l=0==n.dx?n.dy:o*n.dy/n.dx;var a=this.createLine(o,l,n.next);return t.next=this.createLine(0,s+n.dy-l-i,a),a},mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t,e.x=0,e.y=0,e.width=0,e.height=0;var i=this.getVertexBounds(t);return null!=i&&(this.isHorizontal()?(e.width=i.height,e.height=i.width):(e.width=i.width,e.height=i.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var i=this.graph.getModel(),n=t.cell,r=i.getGeometry(n);if(null!=n&&null!=r){if(this.isVertexMovable(n)&&(r=this.setVertexLocation(n,t.x,t.y),this.resizeParent)){var s=i.getParent(n),o=mxCellPath.create(s);null==this.parentsChanged[o]&&(this.parentsChanged[o]=s)}e=null==e?new mxRectangle(r.x,r.y,r.width,r.height):new mxRectangle(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x+e.width,r.x+r.width),Math.max(e.y+e.height,r.y+r.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,i){var n=new Object;return n.dx=t,n.dy=e,n.next=i,n},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,i=t.cell,n=0,r=[];null!=e;){n++;var s=e.x;this.horizontal&&(s=e.y),r.push(new WeightedCellSorter(e,s)),e=e.next}r.sort(WeightedCellSorter.prototype.compare);var o=t.width,l=(n+1)*this.prefHozEdgeSep;o>l+2*this.prefHozEdgeSep&&(o-=2*this.prefHozEdgeSep);var a=o/n,h=a/2;o>l+2*this.prefHozEdgeSep&&(h+=this.prefHozEdgeSep);var u=this.minEdgeJetty-this.prefVertEdgeOff,p=this.getVertexBounds(i);e=t.child;for(var d=0;dn/2&&(u-=this.prefVertEdgeOff),h+=a}},__mxOutput.mxCompactTreeLayout=void 0!==mxCompactTreeLayout?mxCompactTreeLayout:void 0,mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout),mxRadialTreeLayout.prototype.angleOffset=.5,mxRadialTreeLayout.prototype.rootx=0,mxRadialTreeLayout.prototype.rooty=0,mxRadialTreeLayout.prototype.levelDistance=120,mxRadialTreeLayout.prototype.nodeDistance=10,mxRadialTreeLayout.prototype.autoRadius=!1,mxRadialTreeLayout.prototype.sortEdges=!1,mxRadialTreeLayout.prototype.rowMinX=[],mxRadialTreeLayout.prototype.rowMaxX=[],mxRadialTreeLayout.prototype.rowMinCenX=[],mxRadialTreeLayout.prototype.rowMaxCenX=[],mxRadialTreeLayout.prototype.rowRadi=[],mxRadialTreeLayout.prototype.row=[],mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var i=null,n=this.getVertexBounds(this.root);for(var r in this.centerX=n.x+n.width/2,this.centerY=n.y+n.height/2,this.visited){var s=this.getVertexBounds(this.visited[r]);(i=null!=i?i:s.clone()).add(s)}this.calcRowDims([this.node],0);for(var o=0,l=0,a=0;a=0;a--){var y=this.row[a];for(m=0;m0){var S=E/C;if(S>g.theta&&m0){var T=y[m-1].theta;g.theta=Math.max(S,T+Math.PI/10)}}}}for(a=0;athis.maxDistanceLimit)continue;o1&&this.layout(n)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t){for(var e=this.graph.getModel(),i=[],n=e.getChildCount(t),r=0;r(n=mxObjectIdentity.get(n))?n+"-"+i:i+"-"+n:null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],i=this.graph.getView(),n=this.graph.getModel(),r=n.getGeometry(i.getVisibleTerminal(e,!0)),s=n.getGeometry(i.getVisibleTerminal(e,!1));if(r==s)for(var o=r.x+r.width+this.spacing,l=r.y+r.height/2,a=0;a0){o=h+p/2,l=u+d/2;var m=d*this.spacing/c,g=p*this.spacing/c;o+=m*(t.length-1)/2,l-=g*(t.length-1)/2;for(a=0;a0?this.edges[0]:null},__mxOutput.mxGraphHierarchyEdge=void 0!==mxGraphHierarchyEdge?mxGraphHierarchyEdge:void 0,mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,i){for(var n=t.getGraph(),r=0;r0&&null==this.edgeMapper.get(a[0])&&2*h.length>=a.length){for(var u=new mxGraphHierarchyEdge(a),p=0;p0;){var r;p=(h=t[0]).connectsAsTarget,r=h.connectsAsSource;var s=!0,o=this.SOURCESCANSTARTRANK;for(e=0;e1){n.maxRank=e.maxRank,n.minRank=i.maxRank,n.temp=[],n.x=[],n.y=[];for(var o=n.minRank+1;o0&&null==this.edgeMapper.get(u[0])&&2*p.length>=u.length){for(var d=new mxGraphHierarchyEdge(u),c=0;c=0;i--)i==this.ranksPerGroup.length-1?r[i]=0:r[i]=s[i+1]+1,s[i]=r[i]+this.ranksPerGroup[i];this.maxRank=s[0];var o=this.vertexMapper.getValues();for(i=0;i0;){var l,a;l=(n=t[0]).connectsAsTarget,a=n.connectsAsSource;var h=!0,u=s[0];for(i=0;is[n.swimlaneIndex]&&(u=s[n.swimlaneIndex]),n.temp[0]=u,null!=a)for(i=0;i1){n.maxRank=e.maxRank,n.minRank=i.maxRank,n.temp=[],n.x=[],n.y=[];for(var o=n.minRank+1;o0;)f%2&&(i+=x[f+1]),++x[f=f-1>>1]}return i},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var i=!0,n=0;i&&n++<10;){var r=t%2==1&&n%2==1;i=!1;for(var s=0;sf[T]&&S++,g[E]y[T]&&S++,x[E]=0;n--)this.medianRank(n,i);else for(n=1;nt.medianValue?-1:e.medianValue0&&h<=a;){var u=e.shift(),p=u.cell,d=u.weightedValue,c=parseInt(u.rankIndex),m=p.getNextLayerConnectedCells(d),g=p.getPreviousLayerConnectedCells(d),x=m.length,f=g.length,y=this.medianXValue(m,d+1),v=this.medianXValue(g,d-1),C=x+f,E=p.getGeneralPurposeVariable(d),S=E;C>0&&(S=(y*x+v*f)/C);var b=!1;if(SE+1){if(c==n[d].length-1)p.setGeneralPurposeVariable(d,S),b=!0;else{var L=n[d][c+1],A=L.getGeneralPurposeVariable(d);(A=A-L.width/2-this.intraCellSpacing-p.width/2)>S?(p.setGeneralPurposeVariable(d,S),b=!0):A>p.getGeneralPurposeVariable(d)+1&&(p.setGeneralPurposeVariable(d,A),b=!0)}}if(b){for(r=0;r0;i--)this.rankMedianPosition(i-1,e,i);else for(i=0;i0?this.medianXValue(a,i):h.getGeneralPurposeVariable(t));for(var p=0,d=-1e8,c=r[o].rankIndex-1;c>=0;){if(null!=(f=s[n[c].id])){var m=f.cell;f.visited?(d=m.getGeneralPurposeVariable(t)+m.width/2+this.intraCellSpacing+p+h.width/2,c=-1):(p+=m.width+this.intraCellSpacing,c--)}}var g=0,x=1e8;for(c=r[o].rankIndex+1;c=d&&u<=x?h.setGeneralPurposeVariable(t,u):ux&&(h.setGeneralPurposeVariable(t,x),this.currentXDelta+=u-x),r[o].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var i=0,n=0;n=0;i--)i0&&this.rankCoordinates(i,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,i){for(var n=i.ranks[t],r=0,s=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,o=!1,l=0;l=0;r--){for(var s=0,o=e.ranks[r],l=this.initialX,a=!1,h=0;hthis.widestRankValue&&(this.widestRankValue=l,this.widestRank=r),this.rankWidths[r]=l}1==a&&mxLog.warn("At least one cell has no bounds"),this.rankY[r]=i;var c=s/2+n/2+this.interRankCellSpacing;n=s,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?i+=c:i-=c;for(h=0;hr.minRank+1;a--){var g;m==(g=r.getX(a-1))||this.repositionValid(e,r,a-1,m)?(c[a-r.minRank-2]=m,p++):(c[a-r.minRank-2]=r.getX(a-1),m=g)}if(p>l||u>l)if(p>=u)for(a=r.maxRank-2;a>r.minRank;a--)r.setX(a,c[a-r.minRank-1]);else if(u>p)for(a=r.minRank+2;al){if(s==r.length-1)return!0;var u=r[s+1],p=u.getGeneralPurposeVariable(i);return(p=p-u.width/2-this.intraCellSpacing-e.width/2)>=n}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var i=0;i-1&&o0){for(var a=[],h=0;hy+2*this.prefHozEdgeSep&&(p+=this.prefHozEdgeSep,d-=this.prefHozEdgeSep);var v=(d-p)/c,C=p+v/2,E=this.minEdgeJetty-this.prefVertEdgeOff;for(h=0;hc/2&&(E-=this.prefVertEdgeOff);for(var T=0;T0?-e:-e+this.parallelEdgeSpacing,r++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,i=t.x[0]-t.width/2,n=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],n),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],n+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,i,n):this.layout.setVertexLocation(e,n,i),this.limitX=Math.max(this.limitX,i+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},__mxOutput.mxCoordinateAssignment=void 0!==mxCoordinateAssignment?mxCoordinateAssignment:void 0,mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),i=new Object,n=mxUtils.clone(e.vertexMapper,null,!0),r=null;if(null!=e.roots){var s=e.roots;r=[];for(var o=0;o0&&i.push(l);var d=h-u;d>s&&(s=d,r=l)}}0==i.length&&null!=r&&i.push(r)}return i},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),o=0;o=0&&(r=this.traverse(c,e,u[d],n,r,s,o))}}}return r},mxHierarchicalLayout.prototype.cycleStage=function(t){new mxMinimumCycleRemover(this).execute(t)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxHierarchicalLayout.prototype.placementStage=function(t,e){var i=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return i.fineTuning=this.fineTuning,i.execute(e),i.limitX+this.interHierarchySpacing},__mxOutput.mxHierarchicalLayout=void 0!==mxHierarchicalLayout?mxHierarchicalLayout:void 0,mxSwimlaneLayout.prototype=new mxGraphLayout,mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout,mxSwimlaneLayout.prototype.roots=null,mxSwimlaneLayout.prototype.swimlanes=null,mxSwimlaneLayout.prototype.dummyVertexWidth=50,mxSwimlaneLayout.prototype.resizeParent=!1,mxSwimlaneLayout.prototype.maintainParentLocation=!1,mxSwimlaneLayout.prototype.moveParent=!1,mxSwimlaneLayout.prototype.parentBorder=30,mxSwimlaneLayout.prototype.intraCellSpacing=30,mxSwimlaneLayout.prototype.interRankCellSpacing=100,mxSwimlaneLayout.prototype.interHierarchySpacing=60,mxSwimlaneLayout.prototype.parallelEdgeSpacing=10,mxSwimlaneLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxSwimlaneLayout.prototype.fineTuning=!0,mxSwimlaneLayout.prototype.tightenToSource=!0,mxSwimlaneLayout.prototype.disableEdgeStyle=!0,mxSwimlaneLayout.prototype.traverseAncestors=!0,mxSwimlaneLayout.prototype.model=null,mxSwimlaneLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.edgeSourceTermCache=null,mxHierarchicalLayout.prototype.edgesTargetTermCache=null,mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxSwimlaneLayout.prototype.getModel=function(){return this.model},mxSwimlaneLayout.prototype.execute=function(t,e){this.parent=t;var i=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,!(null==e||e.length<1)){if(null==t&&(t=i.getParent(e[0])),this.parentX=null,this.parentY=null,t!=this.root&&null!=i.isVertex(t)&&this.maintainParentLocation)null!=(l=this.graph.getCellGeometry(t))&&(this.parentX=l.x,this.parentY=l.y);this.swimlanes=e;for(var n=[],r=0;r0&&i.push(l);var m=h-u;m>s&&(s=m,r=l)}}0==i.length&&null!=r&&i.push(r)}return i},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),o=0;o0&&null!=t){for(var n=Object(),r=0;r=this.swimlanes.length||(x>l||(!e||g)&&x==l)&&(r=this.traverse(m,e,p[c],n,r,s,o,x))}}}return r},mxSwimlaneLayout.prototype.cycleStage=function(t){new mxSwimlaneOrdering(this).execute(t)},mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxSwimlaneLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxSwimlaneLayout.prototype.placementStage=function(t,e){var i=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return i.fineTuning=this.fineTuning,i.execute(e),i.limitX+this.interHierarchySpacing},__mxOutput.mxSwimlaneLayout=void 0!==mxSwimlaneLayout?mxSwimlaneLayout:void 0,mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.ignoreRelativeEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(t){this.createIds=t},mxGraphModel.prototype.createRoot=function(){var t=new mxCell;return t.insert(new mxCell),t},mxGraphModel.prototype.getCell=function(t){return null!=this.cells?this.cells[t]:null},mxGraphModel.prototype.filterCells=function(t,e){var i=null;if(null!=t){i=[];for(var n=0;n0){var n=t,r=mxCellPath.create(n);if(i.length=0;e--)this.cellRemoved(this.getChildAt(t,e));null!=this.cells&&null!=t.getId()&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,i){var n=this.getParent(t);if(null!=e)e==n&&n.getIndex(t)==i||e.insert(t,i);else if(null!=n){var r=n.getIndex(t);n.remove(r)}var s=this.contains(e),o=this.contains(n);return s&&!o?this.cellAdded(t):o&&!s&&this.cellRemoved(t),n},mxGraphModel.prototype.getChildCount=function(t){return null!=t?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return null!=t?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return null!=t?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,i){e=null!=e&&e,i=null!=i&&i;for(var n=this.getChildCount(t),r=[],s=0;s=0&&null!=(e=this.getChildAt(t))&&(this.children.splice(t,1),e.setParent(null)),e},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return null==this.edges?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return null!=t&&(t.removeFromTerminal(e),t.setTerminal(this,e),(null==this.edges||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(null!=t){if(t.getTerminal(!e)!=this&&null!=this.edges){var i=this.getEdgeIndex(t);i>=0&&this.edges.splice(i,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);null!=e&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):null!=e.getAttribute(t)},mxCell.prototype.getAttribute=function(t,e){var i=this.getValue(),n=null!=i&&i.nodeType==mxConstants.NODETYPE_ELEMENT?i.getAttribute(t):null;return null!=n?n:e},mxCell.prototype.setAttribute=function(t,e){var i=this.getValue();null!=i&&i.nodeType==mxConstants.NODETYPE_ELEMENT&&i.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return null!=t&&("function"==typeof t.clone?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},__mxOutput.mxCell=void 0!==mxCell?mxCell:void 0,mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var t=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=t}},mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(t,e){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var i=mxUtils.toRadians(t),n=Math.cos(i),r=Math.sin(i);if(!this.relative){var s=new mxPoint(this.getCenterX(),this.getCenterY()),o=mxUtils.getRotatedPoint(s,n,r,e);this.x=Math.round(o.x-this.width/2),this.y=Math.round(o.y-this.height/2)}if(null!=this.sourcePoint){o=mxUtils.getRotatedPoint(this.sourcePoint,n,r,e);this.sourcePoint.x=Math.round(o.x),this.sourcePoint.y=Math.round(o.y)}if(null!=this.targetPoint){o=mxUtils.getRotatedPoint(this.targetPoint,n,r,e);this.targetPoint.x=Math.round(o.x),this.targetPoint.y=Math.round(o.y)}if(null!=this.points)for(var l=0;l1&&(e=e.substring(0,n-1)),e},getParentPath:function(t){if(null!=t){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0)return t.substring(0,e);if(t.length>0)return""}return null},resolve:function(t,e){var i=t;if(null!=e)for(var n=e.split(mxCellPath.PATH_SEPARATOR),r=0;re[r]?1:-1;else n=(s=parseInt(t[r]))==(o=parseInt(e[r]))?0:s>o?1:-1;break}0==n&&((s=t.length)!=(o=e.length)&&(n=s>o?1:-1));return n}};__mxOutput.mxCellPath=void 0!==mxCellPath?mxCellPath:void 0;var mxPerimeter={RectanglePerimeter:function(t,e,i,n){var r=t.getCenterX(),s=t.getCenterY(),o=i.x-r,l=i.y-s,a=Math.atan2(l,o),h=new mxPoint(0,0),u=Math.PI,p=Math.PI/2-a,d=Math.atan2(t.height,t.width);return a<-u+d||a>u-d?(h.x=t.x,h.y=s-t.width*Math.tan(a)/2):a<-d?(h.y=t.y,h.x=r-t.height*Math.tan(p)/2):a=t.x&&i.x<=t.x+t.width?h.x=i.x:i.y>=t.y&&i.y<=t.y+t.height&&(h.y=i.y),i.xt.x+t.width&&(h.x=t.x+t.width),i.yt.y+t.height&&(h.y=t.y+t.height)),h},EllipsePerimeter:function(t,e,i,n){var r=t.x,s=t.y,o=t.width/2,l=t.height/2,a=r+o,h=s+l,u=i.x,p=i.y,d=parseInt(u-a),c=parseInt(p-h);if(0==d&&0!=c)return new mxPoint(a,h+l*c/Math.abs(c));if(0==d&&0==c)return new mxPoint(u,p);if(n){if(p>=s&&p<=s+t.height){var m=p-h,g=Math.sqrt(o*o*(1-m*m/(l*l)))||0;return u<=r&&(g=-g),new mxPoint(a+g,p)}if(u>=r&&u<=r+t.width){g=u-a,m=Math.sqrt(l*l*(1-g*g/(o*o)))||0;return p<=s&&(m=-m),new mxPoint(u,h+m)}}var x=c/d,f=h-x*a,y=o*o*x*x+l*l,v=-2*a*y,C=o*o*x*x*a*a+l*l*a*a-o*o*l*l,E=Math.sqrt(v*v-4*y*C),S=(-v+E)/(2*y),b=(-v-E)/(2*y),T=x*S+f,w=x*b+f,L=0,A=0;return Math.sqrt(Math.pow(S-u,2)+Math.pow(T-p,2))p?s:s+l);if(h==p)return new mxPoint(a>u?r:r+o,h);var d=a,c=h;return n&&(u>=r&&u<=r+o?d=u:p>=s&&p<=s+l&&(c=p)),u-y&&fMath.PI-y)v=n&&(s&&i.x>=d.x&&i.x<=m.x||!s&&i.y>=d.y&&i.y<=m.y)?s?new mxPoint(i.x,d.y):new mxPoint(d.x,i.y):r==mxConstants.DIRECTION_NORTH?new mxPoint(o+a/2+h*Math.tan(f)/2,l+h):r==mxConstants.DIRECTION_SOUTH?new mxPoint(o+a/2-h*Math.tan(f)/2,l):r==mxConstants.DIRECTION_WEST?new mxPoint(o+a,l+h/2+a*Math.tan(f)/2):new mxPoint(o,l+h/2-a*Math.tan(f)/2);else{if(n){var C=new mxPoint(u,p);i.y>=l&&i.y<=l+h?(C.x=s?u:r==mxConstants.DIRECTION_WEST?o+a:o,C.y=i.y):i.x>=o&&i.x<=o+a&&(C.x=i.x,C.y=s?r==mxConstants.DIRECTION_NORTH?l+h:l:p),g=i.x-C.x,x=i.y-C.y,u=C.x,p=C.y}v=s&&i.x<=o+a/2||!s&&i.y<=l+h/2?mxUtils.intersection(i.x,i.y,u,p,d.x,d.y,c.x,c.y):mxUtils.intersection(i.x,i.y,u,p,c.x,c.y,m.x,m.y)}return null==v&&(v=new mxPoint(u,p)),v},HexagonPerimeter:function(t,e,i,n){var r=t.x,s=t.y,o=t.width,l=t.height,a=t.getCenterX(),h=t.getCenterY(),u=i.x,p=i.y,d=u-a,c=p-h,m=-Math.atan2(c,d),g=Math.PI,x=Math.PI/2,f=new mxPoint(a,h),y=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,v=y==mxConstants.DIRECTION_NORTH||y==mxConstants.DIRECTION_SOUTH,C=new mxPoint,E=new mxPoint;if((us+l||u>r+o&&pr+o&&p>s+l)&&(n=!1),n){if(v){if(u==a){if(p<=s)return new mxPoint(a,s);if(p>=s+l)return new mxPoint(a,s+l)}else if(ur+o){if(p==s+l/4)return new mxPoint(r+o,s+l/4);if(p==s+3*l/4)return new mxPoint(r+o,s+3*l/4)}else if(u==r){if(ph)return new mxPoint(r,s+3*l/4)}else if(u==r+o){if(ph)return new mxPoint(r+o,s+3*l/4)}if(p==s)return new mxPoint(a,s);if(p==s+l)return new mxPoint(a,s+l);us+l/4&&ps+3*l/4&&(C=new mxPoint(r-Math.floor(.5*o),s+Math.floor(.5*l)),E=new mxPoint(r+o,s+Math.floor(1.25*l))):u>a&&(p>s+l/4&&ps+3*l/4&&(C=new mxPoint(r+Math.floor(1.5*o),s+Math.floor(.5*l)),E=new mxPoint(r,s+Math.floor(1.25*l))))}else{if(p==h){if(u<=r)return new mxPoint(r,s+l/2);if(u>=r+o)return new mxPoint(r+o,s+l/2)}else if(ps+l){if(u==r+o/4)return new mxPoint(r+o/4,s+l);if(u==r+3*o/4)return new mxPoint(r+3*o/4,s+l)}else if(p==s){if(ua)return new mxPoint(r+3*o/4,s)}else if(p==s+l){if(uh)return new mxPoint(r+3*o/4,s+l)}if(u==r)return new mxPoint(r,h);if(u==r+o)return new mxPoint(r+o,h);pr+o/4&&ur+3*o/4&&(C=new mxPoint(r+Math.floor(.5*o),s-Math.floor(.5*l)),E=new mxPoint(r+Math.floor(1.25*o),s+l)):p>h&&(u>r+o/4&&ur+3*o/4&&(C=new mxPoint(r+Math.floor(.5*o),s+Math.floor(1.5*l)),E=new mxPoint(r+Math.floor(1.25*o),s)))}var S=a,b=h;u>=r&&u<=r+o?(S=u,b=p=s&&p<=s+l&&(b=p,S=u-T?(C=new mxPoint(r+o,s),E=new mxPoint(r+o,s+l)):m>T&&mx&&mg-T&&m<=g||m<-g+T&&m>=-g?(C=new mxPoint(r,s),E=new mxPoint(r,s+l)):m<-T&&m>-x?(C=new mxPoint(r+Math.floor(1.5*o),s+Math.floor(.5*l)),E=new mxPoint(r,s+Math.floor(1.25*l))):m<-x&&m>-g+T&&(C=new mxPoint(r-Math.floor(.5*o),s+Math.floor(.5*l)),E=new mxPoint(r+o,s+Math.floor(1.25*l)))}else{var T;if(m==(T=Math.atan2(l/2,o/4)))return new mxPoint(r+Math.floor(.75*o),s);if(m==g-T)return new mxPoint(r+Math.floor(.25*o),s);if(m==g||m==-g)return new mxPoint(r,s+Math.floor(.5*l));if(0==m)return new mxPoint(r+o,s+Math.floor(.5*l));if(m==-T)return new mxPoint(r+Math.floor(.75*o),s+l);if(m==-g+T)return new mxPoint(r+Math.floor(.25*o),s+l);m>0&&mT&&mg-T&&m-T?(C=new mxPoint(r+Math.floor(.5*o),s+Math.floor(1.5*l)),E=new mxPoint(r+Math.floor(1.25*o),s)):m<-T&&m>-g+T?(C=new mxPoint(r,s+l),E=new mxPoint(r+o,s+l)):m<-g+T&&m>-g&&(C=new mxPoint(r-Math.floor(.25*o),s),E=new mxPoint(r+Math.floor(.5*o),s+Math.floor(1.5*l)))}f=mxUtils.intersection(a,h,i.x,i.y,C.x,C.y,E.x,E.y)}return null==f?new mxPoint(a,h):f}};function mxPrintPreview(t,e,i,n,r,s,o,l,a){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.border=null!=n?n:0,this.pageFormat=mxRectangle.fromRectangle(null!=i?i:t.pageFormat),this.title=null!=l?l:"Printer-friendly version",this.x0=null!=r?r:0,this.y0=null!=s?s:0,this.borderColor=o,this.pageSelector=null==a||a}function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(t,e,i){this.view=t,this.cell=e,this.style=null!=i?i:{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(t){this.graph=t,this.cells=[]}function mxSelectionChange(t,e,i){this.selectionModel=t,this.added=null!=e?e.slice():null,this.removed=null!=i?i.slice():null}function mxCellEditor(t){this.graph=t,this.zoomHandler=mxUtils.bind(this,(function(){this.graph.isEditing()&&this.resize()})),this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler),this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler),this.changeHandler=mxUtils.bind(this,(function(t){null!=this.editingCell&&null==this.graph.getView().getState(this.editingCell)&&this.stopEditing(!0)})),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}function mxCellRenderer(){}__mxOutput.mxPerimeter=void 0!==mxPerimeter?mxPerimeter:void 0,mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.marginTop=0,mxPrintPreview.prototype.marginBottom=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,mxPrintPreview.prototype.backgroundColor="#ffffff",mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.targetWindow=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.clipping=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return 5==document.documentMode?t='':8==document.documentMode?t='':document.documentMode>8&&(t='\x3c!--[if IE]>0&&l.writeln(a),mxClient.IS_VML?l.writeln(''):("CSS1Compat"===document.compatMode&&l.writeln(""),l.writeln("")),l.writeln(""),this.writeHead(l,t),l.writeln(""),l.writeln('')}var h=this.graph.getGraphBounds().clone(),u=this.graph.getView().getScale(),p=u/this.scale,d=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=d.x*this.scale,this.y0-=d.y*this.scale,h.width+=h.x,h.height+=h.y,h.x=0,h.y=0,this.border=0);var c=this.pageFormat.width-2*this.border,m=this.pageFormat.height-2*this.border;this.pageFormat.height+=this.marginTop+this.marginBottom,h.width/=p,h.height/=p;var g=Math.max(1,Math.ceil((h.width+this.x0)/c)),x=Math.max(1,Math.ceil((h.height+this.y0)/m));this.pageCount=g*x;var f=mxUtils.bind(this,(function(){if(this.pageSelector&&(x>1||g>1)){var t=this.createPageSelector(x,g);if(l.body.appendChild(t),mxClient.IS_IE&&null==l.documentMode||5==l.documentMode||8==l.documentMode||7==l.documentMode){t.style.position="absolute";var e=function(){t.style.top=(l.body.scrollTop||l.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",(function(t){e()})),mxEvent.addListener(this.wnd,"resize",(function(t){e()}))}}})),y=mxUtils.bind(this,(function(t,e){if(null!=this.borderColor&&(t.style.borderColor=this.borderColor,t.style.borderStyle="solid",t.style.borderWidth="1px"),t.style.background=this.backgroundColor,(i||e)&&(t.style.pageBreakAfter="always"),o&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE))l.writeln(t.outerHTML),t.parentNode.removeChild(t);else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var n=l.createElement("div");n.innerHTML=t.outerHTML,n=n.getElementsByTagName("div")[0],l.body.appendChild(n),t.parentNode.removeChild(t)}else t.parentNode.removeChild(t),l.body.appendChild(t);(i||e)&&this.addPageBreak(l)})),v=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(null!=v)for(var C=0;C"),t.writeln(""),t.close(),mxEvent.release(t.body)}}catch(t){}},mxPrintPreview.prototype.writeHead=function(t,e){null!=this.title&&t.writeln(""+this.title+""),mxClient.IS_VML&&t.writeln(''),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t),t.writeln('")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var i=this.wnd.document,n=i.createElement("table");n.className="mxPageSelector",n.setAttribute("border","0");for(var r=i.createElement("tbody"),s=0;s0&&(L[0].style.position="absolute")}o.overlayPane.parentNode.removeChild(o.overlayPane),this.graph.setEnabled(g),this.graph.container=l,this.graph.cellRenderer.redraw=f,o.canvas=a,o.backgroundPane=h,o.drawPane=u,o.overlayPane=p,o.translate=x,E.destroy(),o.setEventsEnabled(m)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,i){var n=this.graph.backgroundImage;if(null!=n){var r=document.createElement("img");r.style.position="absolute",r.style.marginLeft=Math.round(e*this.scale)+"px",r.style.marginTop=Math.round(i*this.scale)+"px",r.setAttribute("width",Math.round(this.scale*n.width)),r.setAttribute("height",Math.round(this.scale*n.height)),r.src=n.src,t.insertBefore(r,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},__mxOutput.mxPrintPreview=void 0!==mxPrintPreview?mxPrintPreview:void 0,mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#774400",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#446299",t},mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)},mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e},mxStylesheet.prototype.getCellStyle=function(t,e){var i=e;if(null!=t&&t.length>0){var n=t.split(";");i=null!=i&&";"!=t.charAt(0)?mxUtils.clone(i):new Object;for(var r=0;r=0){var l=s.substring(0,o),a=s.substring(o+1);a==mxConstants.NONE?delete i[l]:mxUtils.isNumeric(a)?i[l]=parseFloat(a):i[l]=a}else{var h=this.styles[s];if(null!=h)for(var l in h)i[l]=h[l]}}}return i},__mxOutput.mxStylesheet=void 0!==mxStylesheet?mxStylesheet:void 0,mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalidStyle=!1,mxCellState.prototype.invalid=!0,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.unscaledWidth=null,mxCellState.prototype.unscaledHeight=null,mxCellState.prototype.getPerimeterBounds=function(t,e){if(t=t||0,e=null!=e?e:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var i=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=i.x,e.y=i.y,e.width=this.shape.stencil.w0*i.width,e.height=this.shape.stencil.h0*i.height}return 0!=t&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[0]=t):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):1==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){null!=this.shape&&this.shape.setCursor(t),null!=this.text&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return null!=e?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t:this.visibleTargetState=t},mxCellState.prototype.getCellBounds=function(){return this.cellBounds},mxCellState.prototype.getPaintBounds=function(){return this.paintBounds},mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate,e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e),this.paintBounds=mxRectangle.fromRectangle(this.cellBounds),null!=this.shape&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()},mxCellState.prototype.setState=function(t){this.view=t.view,this.cell=t.cell,this.style=t.style,this.absolutePoints=t.absolutePoints,this.origin=t.origin,this.absoluteOffset=t.absoluteOffset,this.boundingBox=t.boundingBox,this.terminalDistance=t.terminalDistance,this.segments=t.segments,this.length=t.length,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.unscaledWidth=t.unscaledWidth,this.unscaledHeight=t.unscaledHeight},mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){t.absolutePoints=[];for(var e=0;e=0},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){null!=t&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(null!=t){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],i=0;i0&&null!=t[0]||null!=e&&e.length>0&&null!=e[0]){var i=new mxSelectionChange(this,t,e);i.execute();var n=new mxUndoableEdit(this,!1);n.add(i),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n))}},mxGraphSelectionModel.prototype.cellAdded=function(t){null==t||this.isSelected(t)||this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(null!=t){var e=mxUtils.indexOf(this.cells,t);e>=0&&this.cells.splice(e,1)}},mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var e=0;e":"",mxCellEditor.prototype.escapeCancelsEditing=!0,mxCellEditor.prototype.textNode="",mxCellEditor.prototype.zIndex=5,mxCellEditor.prototype.minResize=new mxRectangle(0,20),mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:mxClient.IS_IE11?0:1,mxCellEditor.prototype.blurEnabled=!1,mxCellEditor.prototype.initialValue=null,mxCellEditor.prototype.align=null,mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div"),this.textarea.className="mxCellEditor mxPlainTextEditor",this.textarea.contentEditable=!0,mxClient.IS_GC&&(this.textarea.style.minHeight="1em"),this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative",this.installListeners(this.textarea)},mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)},mxCellEditor.prototype.setAlign=function(t){null!=this.textarea&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){var i=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return mxClient.IS_QUIRKS||8==document.documentMode||9==document.documentMode||10==document.documentMode||(i=mxUtils.replaceTrailingNewlines(i,"

")),i.replace(/\n/g,"
")},mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)},mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)},mxCellEditor.prototype.installListeners=function(t){mxEvent.addListener(t,"dragstart",mxUtils.bind(this,(function(t){this.graph.stopEditing(!1),mxEvent.consume(t)}))),mxEvent.addListener(t,"blur",mxUtils.bind(this,(function(t){this.blurEnabled&&this.focusLost(t)}))),mxEvent.addListener(t,"keydown",mxUtils.bind(this,(function(t){mxEvent.isConsumed(t)||(this.isStopEditingEvent(t)?(this.graph.stopEditing(!1),mxEvent.consume(t)):27==t.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(t)),mxEvent.consume(t)))})));var e=mxUtils.bind(this,(function(e){null!=this.editingCell&&this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=e.keyCode&&46!=e.keyCode)&&(this.clearOnChange=!1,t.innerHTML="")}));mxEvent.addListener(t,"keypress",e),mxEvent.addListener(t,"paste",e);var i=mxUtils.bind(this,(function(t){null!=this.editingCell&&(0==this.textarea.innerHTML.length||"
"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=this.textarea.innerHTML.length>0):this.clearOnChange=!1)}));mxEvent.addListener(t,mxClient.IS_IE11||mxClient.IS_IE?"keyup":"input",i),mxEvent.addListener(t,"cut",i),mxEvent.addListener(t,"paste",i);var n=mxClient.IS_IE11||mxClient.IS_IE?"keydown":"input",r=mxUtils.bind(this,(function(t){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(t)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,(function(){this.resizeThread=null,this.resize()})),0))}));mxEvent.addListener(t,n,r),mxEvent.addListener(window,"resize",r),document.documentMode>=9?(mxEvent.addListener(t,"DOMNodeRemoved",r),mxEvent.addListener(t,"DOMNodeInserted",r)):(mxEvent.addListener(t,"cut",r),mxEvent.addListener(t,"paste",r))},mxCellEditor.prototype.isStopEditingEvent=function(t){return 113==t.keyCode||this.graph.isEnterStopsCellEditing()&&13==t.keyCode&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)},mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea},mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(null==t)this.stopEditing(!0);else if(null!=this.textarea){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=null;if(this.autoSize&&"fill"!=t.style[mxConstants.STYLE_OVERFLOW]){var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(null==(n=null!=t.text&&null==this.align?t.text.margin:null)&&(n=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),null!=r){var s=(parseFloat(r)+2)*i;this.bounds.width=s,this.bounds.x+=n.x*s}}else{var o=mxRectangle.fromRectangle(t),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&l==mxConstants.ALIGN_CENTER&&a==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,null!=r&&(o.width=parseFloat(r)*i),!t.view.graph.cellRenderer.legacySpacing||"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var h=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*i,u=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+h,p=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+h,d=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+h,c=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+h;l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);o=new mxRectangle(o.x+c,o.y+u,o.width-(l==mxConstants.ALIGN_CENTER&&null==r?c+p:0),o.height-(a==mxConstants.ALIGN_MIDDLE?u+d:0))}this.bounds=new mxRectangle(o.x+t.absoluteOffset.x,o.y+t.absoluteOffset.y,o.width,o.height)}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal";s=Math.round(this.bounds.width/(document.documentMode,i))+this.wordWrapPadding;"relative"!=this.textarea.style.position?(this.textarea.style.width=s+"px",this.textarea.scrollWidth>s&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=s+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";8==document.documentMode&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var m=this.textarea.scrollWidth,g=this.textarea.scrollHeight;8==document.documentMode?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-n.x*(this.bounds.width-(m+1)*i)+m*(i-1)*0+2*(n.x+.5))/i))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+1*Math.abs(n.y+.5))/i))+"px",this.textarea.style.width=Math.round(m*i)+"px",this.textarea.style.height=Math.round(g*i)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-n.x*(this.bounds.width-(m+1)*i)+m*(i-1)*0+2*(n.x+.5)))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+1*Math.abs(n.y+.5)))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-n.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-n.y*(this.bounds.height-4)+(-1==n.y?3:0))+1)+"px")}else this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/i)+"px",this.textarea.style.height=Math.round(this.bounds.height/i)+"px",8==document.documentMode||mxClient.IS_QUIRKS?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"),this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/i)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=""));mxClient.IS_VML?this.textarea.style.zoom=i:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+i+","+i+")"+(null==n?"":" translate("+100*n.x+"%,"+100*n.y+"%)")))}},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.getBackgroundColor=function(t){return null},mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML)return!0;var t=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(null!=e){var i=mxUtils.getCurrentStyle(e);null!=i&&(t="absolute"==i.position)}}return!t},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),this.align=null,null==this.textarea&&this.init(),null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var i=this.graph.getView().getState(t);if(null!=i){this.graph.getView().scale;var n=mxUtils.getValue(i.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),r=mxUtils.getValue(i.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),s=mxUtils.getValue(i.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(i.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),l=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,a=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,h=[];(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&h.push("underline"),(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&h.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(n*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(i),this.textarea.style.textDecoration=h.join(" "),this.textarea.style.fontWeight=l?"bold":"normal",this.textarea.style.fontStyle=a?"italic":"",this.textarea.style.fontSize=Math.round(n)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=r,this.textarea.style.textAlign=o,this.textarea.style.outline="none",this.textarea.style.color=s;var u=this.textDirection=mxUtils.getValue(i.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);u==mxConstants.TEXT_DIRECTION_AUTO&&(null==i||null==i.text||i.text.dialect==mxConstants.DIALECT_STRICTHTML||mxUtils.isNode(i.text.value)||(u=i.text.getAutoDirection())),u==mxConstants.TEXT_DIRECTION_LTR||u==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",u):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(i,e)||"",this.initialValue=this.textarea.innerHTML,0==this.textarea.innerHTML.length||"
"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.graph.container.appendChild(this.textarea),this.editingCell=t,this.trigger=e,this.textNode=null,null!=i.text&&this.isHideLabel(i)&&(this.textNode=i.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(i.cell)||"fill"!=i.style[mxConstants.STYLE_OVERFLOW])&&window.setTimeout(mxUtils.bind(this,(function(){this.resize()})),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch(t){}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),null!=t&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),i=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),null!=e&&(this.textarea.innerHTML!=i||null!=this.align)){this.prepareTextarea();var n=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{null!=n&&this.applyValue(e,n),null!=this.align&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[e.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea),this.textarea=null,this.align=null}},mxCellEditor.prototype.prepareTextarea=function(){null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*e+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=this.getMinimumSize(t),r=n.width,s=n.height,o=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&"fill"==t.style[mxConstants.STYLE_OVERFLOW])o=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var l=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*i,a=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+l,h=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+l,u=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+l,p=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+l;o=new mxRectangle(t.x,t.y,Math.max(r,t.width-p-h),Math.max(s,t.height-a-u));var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),c=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&d==mxConstants.ALIGN_CENTER&&c==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,e?(o.x=t.absoluteOffset.x,o.y=t.absoluteOffset.y,null!=t.text&&null!=t.text.boundingBox&&(t.text.boundingBox.x>0&&(o.x=t.text.boundingBox.x),t.text.boundingBox.y>0&&(o.y=t.text.boundingBox.y))):null!=t.text&&null!=t.text.boundingBox&&(o.x=Math.min(o.x,t.text.boundingBox.x),o.y=Math.min(o.y,t.text.boundingBox.y)),o.x+=p,o.y+=a,null!=t.text&&null!=t.text.boundingBox&&(e?(o.width=Math.max(r,t.text.boundingBox.width),o.height=Math.max(s,t.text.boundingBox.height)):(o.width=Math.max(o.width,t.text.boundingBox.width),o.height=Math.max(o.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var m=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);m==mxConstants.ALIGN_LEFT?o.x-=t.width:m==mxConstants.ALIGN_RIGHT&&(o.x+=t.width);var g=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);g==mxConstants.ALIGN_TOP?o.y-=t.height:g==mxConstants.ALIGN_BOTTOM&&(o.y+=t.height)}}return new mxRectangle(Math.round(o.x),Math.round(o.y),Math.round(o.width),Math.round(o.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},__mxOutput.mxCellEditor=void 0!==mxCellEditor?mxCellEditor:void 0,mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initializeShape=function(t){t.shape.dialect=t.view.graph.dialect,this.configureShape(t),t.shape.init(t.view.getDrawPane())},mxCellRenderer.prototype.createShape=function(t){var e=null;if(null!=t.style){var i=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(null!=i)e=new mxShape(i);else e=new(this.getShapeConstructor(t))}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return null!=t?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return null==e&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),e},mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t),t.shape.image=t.view.graph.getImage(t),t.shape.indicatorColor=t.view.graph.getIndicatorColor(t),t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR],t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t),t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION],t.shape.indicatorImage=t.view.graph.getIndicatorImage(t),this.postConfigureShape(t)},mxCellRenderer.prototype.postConfigureShape=function(t){null!=t.shape&&(this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(null!=t.style)for(var e=["inherit","swimlane","indicated"],i=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR],n=0;n=0)return!0;return!1},mxCellRenderer.prototype.resolveColor=function(t,e,i){var n=t.shape[e],r=t.view.graph,s=null;if("inherit"==n?s=r.model.getParent(t.cell):"swimlane"==n?(t.shape[e]=i==mxConstants.STYLE_STROKECOLOR?"#000000":"#ffffff",s=null!=r.model.getTerminal(t.cell,!1)?r.model.getTerminal(t.cell,!1):t.cell,s=r.getSwimlane(s),i=r.swimlaneIndicatorColorAttribute):"indicated"==n&&(t.shape[e]=t.shape.indicatorColor),null!=s){var o=r.getView().getState(s);t.shape[e]=null,null!=o&&(null!=o.shape&&"indicatorColor"!=e?t.shape[e]=o.shape[e]:t.shape[e]=o.style[i])}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var i=t.view.graph;if(i.getModel().isEdge(t.cell),t.style[mxConstants.STYLE_FONTSIZE]>0||null==t.style[mxConstants.STYLE_FONTSIZE]){var n=i.isHtmlLabel(t.cell)||null!=e&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,i.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],i.isWrapping(t.cell)&&i.isHtmlLabel(t.cell),i.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=n?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.style=t.style,t.text.state=t,this.initializeLabel(t,t.text);var r=!1,s=function(e){var n=t;if(mxClient.IS_TOUCH||r){var s=mxEvent.getClientX(e),o=mxEvent.getClientY(e),l=mxUtils.convertPoint(i.container,s,o);n=i.view.getState(i.getCellAt(l.x,l.y))}return n};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),r=i.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,s(e)))})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(i.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,s(e))),r=!1)}))),i.nativeDblClickEnabled&&mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(i.dblClick(e,t.cell),mxEvent.consume(e))})))}},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph.getCellOverlays(t.cell),i=null;if(null!=e){i=new mxDictionary;for(var n=0;n0)?this.createLabel(t,n):null==t.text||null!=n&&0!=n.length||(t.text.destroy(),t.text=null),null!=t.text){e&&(null!=t.text.lastValue&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=i.getVerticalAlign(t));var a=this.getLabelBounds(t),h=this.getTextScale(t);if(e||t.text.value!=n||t.text.isWrapping!=r||t.text.overflow!=l||t.text.isClipping!=s||t.text.scale!=h||t.text.dialect!=o||null==t.text.bounds||!t.text.bounds.equals(a)){t.text.dialect=o,t.text.value=n,t.text.bounds=a,t.text.scale=h,t.text.wrap=r,t.text.clipped=s,t.text.overflow=l;var u=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=u}}},mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function i(i,n,r){return"spacingTop"==n||"spacingRight"==n||"spacingBottom"==n||"spacingLeft"==n?parseFloat(e[i])-parseFloat(e.spacing)!=(t.style[n]||r):e[i]!=(t.style[n]||r)}return i("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||i("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||i("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||i("color",mxConstants.STYLE_FONTCOLOR,"black")||i("align",mxConstants.STYLE_ALIGN,"")||i("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||i("spacing",mxConstants.STYLE_SPACING,2)||i("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||i("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||i("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||i("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||i("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||i("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||i("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||i("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||i("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)},mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()},mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale},mxCellRenderer.prototype.getLabelBounds=function(t){var e=t.view.graph,i=t.view.scale,n=e.getModel().isEdge(t.cell),r=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(n){var s=t.text.getSpacing();r.x+=s.x*i,r.y+=s.y*i;var o=e.getCellGeometry(t.cell);null!=o&&(r.width=Math.max(0,o.width*i),r.height=Math.max(0,o.height*i))}else{if(t.text.isPaintBoundsInverted()){var l=r.x;r.x=r.y,r.y=l}r.x+=t.x,r.y+=t.y,r.width=Math.max(1,t.width),r.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var a=(t.width-t.height)/2;r.x+=a,r.y-=a;l=r.width;r.width=r.height,r.height=l}if(null!=t.shape){var h=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),u=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);h==mxConstants.ALIGN_CENTER&&u==mxConstants.ALIGN_MIDDLE&&(r=t.shape.getLabelBounds(r))}var p=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return null!=p&&(r.width=parseFloat(p)*i),n||this.rotateLabelBounds(t,r),r},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||"fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var i=t.view.scale,n=t.text.getSpacing();e.x+=n.x*i,e.y+=n.y*i;var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),o=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(r==mxConstants.ALIGN_CENTER&&null==o?t.text.spacingLeft*i+t.text.spacingRight*i:0)),e.height=Math.max(0,e.height-(s==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*i+t.text.spacingBottom*i:0))}var l=t.text.getTextRotation();if(0!=l&&null!=t&&t.view.graph.model.isVertex(t.cell)){var a=t.getCenterX(),h=t.getCenterY();if(e.x!=a||e.y!=h){var u=l*(Math.PI/180),p=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(u),Math.sin(u),new mxPoint(a,h));e.x=p.x,e.y=p.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(t,e){if(this.createCellOverlays(t),null!=t.overlays){var i=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90),n=mxUtils.toRadians(i),r=Math.cos(n),s=Math.sin(n);t.overlays.visit((function(n,o){var l=o.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)&&null!=t.shape&&0!=i){var a=l.getCenterX(),h=l.getCenterY(),u=mxUtils.getRotatedPoint(new mxPoint(a,h),r,s,new mxPoint(t.getCenterX(),t.getCenterY()));a=u.x,h=u.y,l.x=Math.round(a-l.width/2),l.y=Math.round(h-l.height/2)}!e&&null!=o.bounds&&o.scale==t.view.scale&&o.bounds.equals(l)||(o.bounds=l,o.scale=t.view.scale,o.redraw())}))}},mxCellRenderer.prototype.redrawControl=function(t,e){var i=t.view.graph.getFoldingImage(t);if(null!=t.control&&null!=i){var n=this.getControlBounds(t,i.width,i.height),r=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),s=t.view.scale;!e&&t.control.scale==s&&t.control.bounds.equals(n)&&t.control.rotation==r||(t.control.rotation=r,t.control.bounds=n,t.control.scale=s,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,i){if(null!=t.control){var n=t.view.scale,r=t.getCenterX(),s=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(r=t.x+e*n,s=t.y+i*n,null!=t.shape)){var o=t.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var l=(t.width-t.height)/2;r+=l,s-=l}if(0!=o){var a=mxUtils.toRadians(o),h=Math.cos(a),u=Math.sin(a),p=mxUtils.getRotatedPoint(new mxPoint(r,s),h,u,new mxPoint(t.getCenterX(),t.getCenterY()));r=p.x,s=p.y}}return t.view.graph.getModel().isEdge(t.cell),new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n))}return null},mxCellRenderer.prototype.insertStateAfter=function(t,e,i){for(var n=this.getShapesForState(t),r=0;r0?n[0]:null)&&(f=a.transformControlPoint(t,f),mxUtils.contains(e,f.x,f.y)&&(f=null));var u=0,p=0,d=0,c=0,m=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,h.gridSize)*a.scale,g=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_SOUTH?(u=a.getRoutingCenterX(e),p=m):(d=a.getRoutingCenterY(e),c=m),null==f||f.xe.x+e.width?null!=f?(u=f.x,c=Math.max(Math.abs(d-f.y),c)):g==mxConstants.DIRECTION_NORTH?d=e.y-2*p:g==mxConstants.DIRECTION_SOUTH?d=e.y+e.height+2*p:u=g==mxConstants.DIRECTION_EAST?e.x-2*c:e.x+e.width+2*c:null!=f&&(u=a.getRoutingCenterX(e),p=Math.max(Math.abs(u-f.x),c),d=f.y,c=0),r.push(new mxPoint(u-p,d-c)),r.push(new mxPoint(u+p,d+c))}}else if(null!=n&&n.length>0)for(var x=0;x0?n[0]:null,o=!1,l=!1;if(null!=e&&null!=i)if(null!=s){var a=Math.min(e.x,i.x),h=Math.max(e.x+e.width,i.x+i.width),u=Math.min(e.y,i.y),p=Math.max(e.y+e.height,i.y+i.height);o=(s=t.view.transformControlPoint(t,s)).yp,l=s.xh}else{if(!(o=(a=Math.max(e.x,i.x))==(h=Math.min(e.x+e.width,i.x+i.width))))l=(u=Math.max(e.y,i.y))==(p=Math.min(e.y+e.height,i.y+i.height))}l||!o&&t.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(t,e,i,n,r):mxEdgeStyle.TopToBottom(t,e,i,n,r)},SideToSide:function(t,e,i,n,r){var s=t.view,o=null!=n&&n.length>0?n[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=s.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((i=new mxCellState).x=h.x,i.y=h.y),null!=e&&null!=i){var u=Math.max(e.x,i.x),p=Math.min(e.x+e.width,i.x+i.width),d=null!=o?o.x:Math.round(p+(u-p)/2),c=s.getRoutingCenterY(e),m=s.getRoutingCenterY(i);if(null!=o&&(o.y>=e.y&&o.y<=e.y+e.height&&(c=o.y),o.y>=i.y&&o.y<=i.y+i.height&&(m=o.y)),mxUtils.contains(i,d,c)||mxUtils.contains(e,d,c)||r.push(new mxPoint(d,c)),mxUtils.contains(i,d,m)||mxUtils.contains(e,d,m)||r.push(new mxPoint(d,m)),1==r.length)if(null!=o)mxUtils.contains(i,d,o.y)||mxUtils.contains(e,d,o.y)||r.push(new mxPoint(d,o.y));else{var g=Math.max(e.y,i.y),x=Math.min(e.y+e.height,i.y+i.height);r.push(new mxPoint(d,g+(x-g)/2))}}},TopToBottom:function(t,e,i,n,r){var s=t.view,o=null!=n&&n.length>0?n[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=s.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((i=new mxCellState).x=h.x,i.y=h.y),null!=e&&null!=i){var u=Math.max(e.y,i.y),p=Math.min(e.y+e.height,i.y+i.height),d=s.getRoutingCenterX(e);null!=o&&o.x>=e.x&&o.x<=e.x+e.width&&(d=o.x);var c=null!=o?o.y:Math.round(p+(u-p)/2);if(mxUtils.contains(i,d,c)||mxUtils.contains(e,d,c)||r.push(new mxPoint(d,c)),d=null!=o&&o.x>=i.x&&o.x<=i.x+i.width?o.x:s.getRoutingCenterX(i),mxUtils.contains(i,d,c)||mxUtils.contains(e,d,c)||r.push(new mxPoint(d,c)),1==r.length)if(null!=o&&1==r.length)mxUtils.contains(i,o.x,c)||mxUtils.contains(e,o.x,c)||r.push(new mxPoint(o.x,c));else{var m=Math.max(e.x,i.x),g=Math.min(e.x+e.width,i.x+i.width);r.push(new mxPoint(m+(g-m)/2,c))}}},SegmentConnector:function(t,e,i,n,r){var s=t.absolutePoints,o=Math.max(1,t.view.scale),l=r.length>0?r[0]:null,a=!0,h=null;function u(t){return(null==l||Math.abs(l.x-t.x)>=o||Math.abs(l.y-t.y)>=o)&&(r.push(t),l=t),l}var p=s[0];null==p&&null!=e?p=new mxPoint(t.view.getRoutingCenterX(e),t.view.getRoutingCenterY(e)):null!=p&&(p=p.clone()),p.x=Math.round(p.x),p.y=Math.round(p.y);var d=s.length-1;if(null!=n&&n.length>0){for(var c=[],m=0;m=f.y&&E.y<=f.y+f.height,w=null!=f&&E.x>=f.x&&E.x<=f.x+f.width;if(v=b||null==y&&T,C=S||null==y&&w,0==m&&(v&&C||S&&b));else{if(null!=y&&!b&&!S&&(T||w)){a=!T;break}if(C||v){a=v,1==m&&(a=n.length%2==0?v:C);break}}f=i,null!=(y=s[d])&&(y.x=Math.round(y.x),y.y=Math.round(y.y),f=null),E=n[n.length-1],S&&b&&(n=n.slice(1))}a&&(null!=s[0]&&s[0].y!=h.y||null==s[0]&&null!=e&&(h.ye.y+e.height))?u(new mxPoint(p.x,h.y)):!a&&(null!=s[0]&&s[0].x!=h.x||null==s[0]&&null!=e&&(h.xe.x+e.width))&&u(new mxPoint(h.x,p.y)),a?p.y=h.y:p.x=h.x;for(m=0;mi.y+i.height))?u(new mxPoint(p.x,h.y)):!a&&(null!=s[d]&&s[d].x!=h.x||null==s[d]&&null!=i&&(h.xi.x+i.width))&&u(new mxPoint(h.x,p.y)))),null==s[0]&&null!=e)for(;r.length>1&&null!=r[1]&&mxUtils.contains(e,r[1].x,r[1].y);)r.splice(1,1);if(null==s[d]&&null!=i)for(;r.length>1&&null!=r[r.length-1]&&mxUtils.contains(i,r[r.length-1].x,r[r.length-1].y);)r.splice(r.length-1,1);null!=x&&null!=r[r.length-1]&&Math.abs(x.x-r[r.length-1].x)<=o&&Math.abs(x.y-r[r.length-1].y)<=o&&(r.splice(r.length-1,1),null!=r[r.length-1]&&(Math.abs(r[r.length-1].x-x.x)0||o||l)mxEdgeStyle.SegmentConnector(t,e,i,n,r);else{var b,T=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],w=0;if(null!=e)if(T[0]=mxUtils.getPortConstraints(e,t,!0,mxConstants.DIRECTION_MASK_ALL),0!=(w=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0)))p=(b=mxUtils.getBoundingBox(new mxRectangle(p,d,c,m),w)).x,d=b.y,c=b.width,m=b.height;if(null!=i)if(T[1]=mxUtils.getPortConstraints(i,t,!1,mxConstants.DIRECTION_MASK_ALL),0!=(w=mxUtils.getValue(i.style,mxConstants.STYLE_ROTATION,0)))g=(b=mxUtils.getBoundingBox(new mxRectangle(g,x,f,y),w)).x,x=b.y,f=b.width,y=b.height;for(var L=[0,0],A=[[p=Math.round(10*p)/10,d=Math.round(10*d)/10,c=Math.round(10*c)/10,m=Math.round(10*m)/10],[g=Math.round(10*g)/10,x=Math.round(10*x)/10,f=Math.round(10*f)/10,y=Math.round(10*y)/10]],I=[v,C],O=0;O<2;O++)mxEdgeStyle.limits[O][1]=A[O][0]-I[O],mxEdgeStyle.limits[O][2]=A[O][1]-I[O],mxEdgeStyle.limits[O][4]=A[O][0]+A[O][2]+I[O],mxEdgeStyle.limits[O][8]=A[O][1]+A[O][3]+I[O];var R,M=A[0][0]+A[0][2]/2,P=A[0][1]+A[0][3]/2,N=A[1][0]+A[1][2]/2,_=P-(A[1][1]+A[1][3]/2),D=0;(R=M-N)<0?D=_<0?2:1:_<=0&&(D=3,0==R&&(D=2));var H=null;null!=e&&(H=h);var G=[[.5,.5],[.5,.5]];for(O=0;O<2;O++)null!=H&&(G[O][0]=(H.x-A[O][0])/A[O][2],Math.abs(H.x-A[O][0])<=1?L[O]=mxConstants.DIRECTION_MASK_WEST:Math.abs(H.x-A[O][0]-A[O][2])<=1&&(L[O]=mxConstants.DIRECTION_MASK_EAST),G[O][1]=(H.y-A[O][1])/A[O][3],Math.abs(H.y-A[O][1])<=1?L[O]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(H.y-A[O][1]-A[O][3])<=1&&(L[O]=mxConstants.DIRECTION_MASK_SOUTH)),H=null,null!=i&&(H=u);var U=A[0][1]-(A[1][1]+A[1][3]),V=A[0][0]-(A[1][0]+A[1][2]),k=A[1][1]-(A[0][1]+A[0][3]),B=A[1][0]-(A[0][0]+A[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(V-E,0),mxEdgeStyle.vertexSeperations[2]=Math.max(U-E,0),mxEdgeStyle.vertexSeperations[4]=Math.max(k-E,0),mxEdgeStyle.vertexSeperations[3]=Math.max(B-E,0);var F=[],q=[],Y=[];q[0]=V>=B?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,Y[0]=U>=k?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,q[1]=mxUtils.reversePortConstraints(q[0]),Y[1]=mxUtils.reversePortConstraints(Y[0]);var z=V>=B?V:B,j=U>=k?U:k,X=[[0,0],[0,0]],W=!1;for(O=0;O<2;O++)0==L[O]&&(0==(q[O]&T[O])&&(q[O]=mxUtils.reversePortConstraints(q[O])),0==(Y[O]&T[O])&&(Y[O]=mxUtils.reversePortConstraints(Y[O])),X[O][0]=Y[O],X[O][1]=q[O]);j>0&&z>0&&((q[0]&T[0])>0&&(Y[1]&T[1])>0?(X[0][0]=q[0],X[0][1]=Y[0],X[1][0]=Y[1],X[1][1]=q[1],W=!0):(Y[0]&T[0])>0&&(q[1]&T[1])>0&&(X[0][0]=Y[0],X[0][1]=q[0],X[1][0]=q[1],X[1][1]=Y[1],W=!0)),j>0&&!W&&(X[0][0]=Y[0],X[0][1]=q[0],X[1][0]=Y[1],X[1][1]=q[1],W=!0),z>0&&!W&&(X[0][0]=q[0],X[0][1]=Y[0],X[1][0]=q[1],X[1][1]=Y[1],W=!0);for(O=0;O<2;O++)0==L[O]&&(0==(X[O][0]&T[O])&&(X[O][0]=X[O][1]),F[O]=X[O][0]&T[O],F[O]|=(X[O][1]&T[O])<<8,F[O]|=(X[1-O][O]&T[O])<<16,F[O]|=(X[1-O][1-O]&T[O])<<24,0==(15&F[O])&&(F[O]=F[O]<<8),0==(3840&F[O])&&(F[O]=15&F[O]|F[O]>>8),0==(983040&F[O])&&(F[O]=65535&F[O]|(251658240&F[O])>>8),L[O]=15&F[O],T[O]!=mxConstants.DIRECTION_MASK_WEST&&T[O]!=mxConstants.DIRECTION_MASK_NORTH&&T[O]!=mxConstants.DIRECTION_MASK_EAST&&T[O]!=mxConstants.DIRECTION_MASK_SOUTH||(L[O]=T[O]));var K=L[0]==mxConstants.DIRECTION_MASK_EAST?3:L[0],$=L[1]==mxConstants.DIRECTION_MASK_EAST?3:L[1];(K-=D)<1&&(K+=4),($-=D)<1&&($+=4);var Z=mxEdgeStyle.routePatterns[K-1][$-1];switch(mxEdgeStyle.wayPoints1[0][0]=A[0][0],mxEdgeStyle.wayPoints1[0][1]=A[0][1],L[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=v,mxEdgeStyle.wayPoints1[0][1]+=G[0][1]*A[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=G[0][0]*A[0][2],mxEdgeStyle.wayPoints1[0][1]+=A[0][3]+v;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=A[0][2]+v,mxEdgeStyle.wayPoints1[0][1]+=G[0][1]*A[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=G[0][0]*A[0][2],mxEdgeStyle.wayPoints1[0][1]-=v}var J=0,Q=(L[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,tt=Q,et=0;for(O=0;O4&&(nt-=4);var rt=mxEdgeStyle.dirVectors[nt-1];(et=nt%2>0?0:1)!=Q&&(J++,mxEdgeStyle.wayPoints1[J][0]=mxEdgeStyle.wayPoints1[J-1][0],mxEdgeStyle.wayPoints1[J][1]=mxEdgeStyle.wayPoints1[J-1][1]);var st=(Z[O]&mxEdgeStyle.TARGET_MASK)>0,ot=(Z[O]&mxEdgeStyle.SOURCE_MASK)>0,lt=(Z[O]&mxEdgeStyle.SIDE_MASK)>>5;(lt<<=D)>15&&(lt>>=4);var at=(Z[O]&mxEdgeStyle.CENTER_MASK)>0;if((ot||st)&<<9){var ht=0,ut=ot?0:1;if(ht=at&&0==et?A[ut][0]+G[ut][0]*A[ut][2]:at?A[ut][1]+G[ut][1]*A[ut][3]:mxEdgeStyle.limits[ut][lt],0==et){var pt=(ht-mxEdgeStyle.wayPoints1[J][0])*rt[0];pt>0&&(mxEdgeStyle.wayPoints1[J][0]+=rt[0]*pt)}else{var dt=(ht-mxEdgeStyle.wayPoints1[J][1])*rt[1];dt>0&&(mxEdgeStyle.wayPoints1[J][1]+=rt[1]*dt)}}else at&&(mxEdgeStyle.wayPoints1[J][0]+=rt[0]*Math.abs(mxEdgeStyle.vertexSeperations[nt]/2),mxEdgeStyle.wayPoints1[J][1]+=rt[1]*Math.abs(mxEdgeStyle.vertexSeperations[nt]/2));J>0&&mxEdgeStyle.wayPoints1[J][et]==mxEdgeStyle.wayPoints1[J-1][et]?J--:Q=et}for(O=0;O<=J;O++){if(O==J)if((((L[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1)==tt?0:1)!=(J+1)%2)break;r.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[O][0]),Math.round(mxEdgeStyle.wayPoints1[O][1])))}for(var ct=1;ct0)for(var i=this.graph.getModel(),n=0;n0||o.height>0){r=new mxPoint(e.x,e.y);var l=!1,a=!1;this.graph.model.isVertex(t.cell)&&(l=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0),a=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),null!=t.shape&&null!=t.shape.stencil&&(l=1==mxUtils.getValue(t.style,"stencilFlipH",0)||l,a=1==mxUtils.getValue(t.style,"stencilFlipV",0)||a),l&&(r.x=2*o.getCenterX()-r.x),a&&(r.y=2*o.getCenterY()-r.y)),null!=(r=s(o,t,r,i))&&(l&&(r.x=2*o.getCenterX()-r.x),a&&(r.y=2*o.getCenterY()-r.y))}}null==r&&(r=this.getPoint(t))}return r},mxGraphView.prototype.getRoutingCenterX=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=null!=e?e:0,null!=t&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if("string"==typeof e){var i=mxStyleRegistry.getValue(e);null==i&&this.isAllowEval()&&(i=mxUtils.eval(e)),e=i}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(t,e,i){var n=t.absolutePoints,r=null;if(null!=n&&n.length>=2){var s=n.length;r=n[i?Math.min(1,s-1):Math.max(0,s-2)]}return null==r&&null!=e&&(r=new mxPoint(e.getCenterX(),e.getCenterY())),r},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var i=this.graph.getModel(),n=i.getTerminal(t,e),r=n;null!=n&&n!=this.currentRoot;)this.graph.isCellVisible(r)&&!this.isCellCollapsed(n)||(r=n),n=i.getParent(n);return null==r||i.contains(r)&&i.getParent(r)!=i.getRoot()&&r!=this.currentRoot||(r=null),r},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,i=e[0],n=e[e.length-1];if(i.x!=n.x||i.y!=n.y){var r=n.x-i.x,s=n.y-i.y;t.terminalDistance=Math.sqrt(r*r+s*s)}else t.terminalDistance=0;var o=0,l=[],a=i;if(null!=a){for(var h=a.x,u=a.y,p=h,d=u,c=1;c=Math.round(a+l)&&h1){for(var s=t.length,o=t.segments,l=t.absolutePoints[0],a=t.absolutePoints[1],h=mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,i),u=0,p=0,d=0,c=2;cg&&(L=g);var A=Math.sqrt(mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,i));return-1==mxUtils.relativeCcw(l.x,l.y,a.x,a.y,e,i)&&(A=-A),new mxPoint((s/2-d-L)/s*-2,A/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),null!=e&&e.length>0&&null!=t.segments){var i=this.graph.getCellGeometry(t.cell);if(i.relative){var n=this.getPoint(t,i);null!=n&&(t.absoluteOffset=n)}else{var r=e[0],s=e[e.length-1];if(null!=r&&null!=s){var o=s.x-r.x,l=s.y-r.y,a=0,h=0,u=i.offset;null!=u&&(a=u.x,h=u.y);var p=r.x+o/2+a*this.scale,d=r.y+l/2+h*this.scale;t.absoluteOffset.x=p,t.absoluteOffset.y=d}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var i=null;return null!=t&&(i=this.states.get(t),e&&(null==i||this.updateStyle)&&this.graph.isCellVisible(t)&&(null==i?(i=this.createState(t),this.states.put(t,i)):i.style=this.graph.getCellStyle(t))),i},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(t){this.rendering=t},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(t){this.states=t},mxGraphView.prototype.getCellStates=function(t){if(null==t)return this.states;for(var e=[],i=0;ir&&i.x>r+2&&i.x<=n)return!0;var s=this.graph.container.offsetHeight,o=this.graph.container.clientHeight;return s>o&&i.y>o+2&&i.y<=s},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var t=this.graph,e=t.container;if(null!=e){mxClient.IS_TOUCH&&(mxEvent.addListener(e,"gesturestart",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)}))),mxEvent.addListener(e,"gesturechange",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)}))),mxEvent.addListener(e,"gestureend",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)})))),mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(e){!this.isContainerEvent(e)||(mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_GC||mxClient.IS_OP||mxClient.IS_SF)&&this.isScrollEvent(e)||t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))})),mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))})),mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))),mxEvent.addListener(e,"dblclick",mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.dblClick(e)})));t.addMouseListener({mouseDown:function(e,i){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,(function(i){null!=t.tooltipHandler&&t.tooltipHandler.isHideOnHover()&&t.tooltipHandler.hide(),this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(i)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&!mxEvent.isConsumed(i)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(i,function(i){var n=null;if(mxClient.IS_TOUCH){var r=mxEvent.getClientX(i),s=mxEvent.getClientY(i),o=mxUtils.convertPoint(e,r,s);n=t.view.getState(t.getCellAt(o.x,o.y))}return n}(i)))})),this.endHandler=mxUtils.bind(this,(function(e){this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(e)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(null!=t&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),t.appendChild(this.canvas),this.updateContainerStyle(t),mxClient.IS_QUIRKS)){var e=mxUtils.bind(this,(function(t){var e=this.getGraphBounds(),i=e.x+e.width+this.graph.border,n=e.y+e.height+this.graph.border;this.updateHtmlCanvasSize(i,n)}));mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(null!=this.graph.container){var i=this.graph.container.offsetWidth,n=this.graph.container.offsetHeight;this.canvas.style.width=i")},mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler(),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=this.createSelectionCellsHandler(),this.connectionHandler=this.createConnectionHandler(),this.connectionHandler.setEnabled(!1),this.graphHandler=this.createGraphHandler(),this.panningHandler=this.createPanningHandler(),this.panningHandler.panningEnabled=!1,this.popupMenuHandler=this.createPopupMenuHandler()},mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)},mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)},mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)},mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)},mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)},mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(t){this.stylesheet=t},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t},mxGraph.prototype.getSelectionCellsForChanges=function(t){for(var e=new mxDictionary,i=[],n=mxUtils.bind(this,(function(t){if(!e.get(t)&&this.model.contains(t))if(this.model.isEdge(t)||this.model.isVertex(t))e.put(t,!0),i.push(t);else for(var r=this.model.getChildCount(t),s=0;s=0){t.overlays.splice(i,1),0==t.overlays.length&&(t.overlays=null);var n=this.view.getState(t);null!=n&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else e=null}return e},mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(null!=e){t.overlays=null;var i=this.view.getState(t);null!=i&&this.cellRenderer.redraw(i);for(var n=0;n0){var r=new mxCellOverlay(i=null!=i?i:this.warningImage,""+e+"");return n&&r.addListener(mxEvent.CLICK,mxUtils.bind(this,(function(e,i){this.isEnabled()&&this.setSelectionCell(t)}))),this.addCellOverlay(t,r)}return this.removeCellOverlays(t),null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){null!=e&&mxEvent.isMultiTouchEvent(e)||(null==t&&(null==(t=this.getSelectionCell())||this.isCellEditable(t)||(t=null)),null!=t&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e)),this.cellEditor.startEditing(t,e),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))))},mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)},mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t),this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))},mxGraph.prototype.labelChanged=function(t,e,i){this.model.beginUpdate();try{var n=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",n,"event",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,i){this.model.beginUpdate();try{this.model.setValue(t,e),i&&this.cellSizeUpdated(t,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))},mxGraph.prototype.click=function(t){var e=t.getEvent(),i=t.getCell(),n=new mxEventObject(mxEvent.CLICK,"event",e,"cell",i);if(t.isConsumed()&&n.consume(),this.fireEvent(n),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed())if(null!=i){if(this.isTransparentClickEvent(e)){var r=!1,s=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,(function(t){var e=this.isCellSelected(t.cell);return!(r=r||e)||e})));null!=s&&(i=s)}this.selectCellForEvent(i,e)}else{var o=null;this.isSwimlaneSelectionEnabled()&&(o=this.getSwimlaneAt(t.getGraphX(),t.getGraphY())),null!=o?this.selectCellForEvent(o,e):this.isToggleEvent(e)||this.clearSelection()}},mxGraph.prototype.dblClick=function(t,e){var i=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",t,"cell",e);this.fireEvent(i),!this.isEnabled()||mxEvent.isConsumed(t)||i.isConsumed()||null==e||!this.isCellEditable(e)||this.isEditing(e)||(this.startEditingAtCell(e,t),mxEvent.consume(t))},mxGraph.prototype.tapAndHold=function(t){var e=t.getEvent(),i=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",e,"cell",t.getCell());if(this.fireEvent(i),i.isConsumed()&&(this.panningHandler.panningTrigger=!1),this.isEnabled()&&!mxEvent.isConsumed(e)&&!i.isConsumed()&&this.connectionHandler.isEnabled()){var n=this.view.getState(this.connectionHandler.marker.getCell(t));null!=n&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=n,this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(t.getGraphX(),t.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(t),this.connectionHandler.previous=n,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous)))}},mxGraph.prototype.scrollPointToVisible=function(t,e,i,n){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(t+this.panDx,e+this.panDy));else{var r=this.container;if(n=null!=n?n:20,t>=r.scrollLeft&&e>=r.scrollTop&&t<=r.scrollLeft+r.clientWidth&&e<=r.scrollTop+r.clientHeight){var s=r.scrollLeft+r.clientWidth-t;if(s0&&u.height>0){e&&null!=u.x&&null!=u.y&&((u=u.clone()).width+=u.x,u.height+=u.y,u.x=0,u.y=0);var p=this.view.scale,d=u.width/p,c=u.height/p;null!=this.backgroundImage&&(d=Math.max(d,this.backgroundImage.width-u.x/p),c=Math.max(c,this.backgroundImage.height-u.y/p));var m=(e?t:2*t)+i+1;a-=m,h-=m;var g=r?h/c:s?a/d:Math.min(a/d,h/c);if(null!=this.minFitScale&&(g=Math.max(g,this.minFitScale)),null!=this.maxFitScale&&(g=Math.min(g,this.maxFitScale)),!n)return g;if(e)this.view.scale!=g&&this.view.setScale(g);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(g);var x=this.getGraphBounds();null!=x.x&&(this.container.scrollLeft=x.x),null!=x.y&&(this.container.scrollTop=x.y)}else{var f=null!=u.x?Math.floor(this.view.translate.x-u.x/p+t/g+i/2):t,y=null!=u.y?Math.floor(this.view.translate.y-u.y/p+t/g+i/2):t;this.view.scaleAndTranslate(g,f,y)}}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(null!=this.container){var e=this.getBorder(),i=Math.max(0,t.x)+t.width+2*e,n=Math.max(0,t.y)+t.height+2*e;if(null!=this.minimumContainerSize&&(i=Math.max(i,this.minimumContainerSize.width),n=Math.max(n,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(i,n),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var r=this.getPreferredPageSize(t,Math.max(1,i),Math.max(1,n));null!=r&&(i=r.width*this.view.scale,n=r.height*this.view.scale)}if(null!=this.minimumGraphSize&&(i=Math.max(i,this.minimumGraphSize.width*this.view.scale),n=Math.max(n,this.minimumGraphSize.height*this.view.scale)),i=Math.ceil(i),n=Math.ceil(n),this.dialect==mxConstants.DIALECT_SVG){var s=this.view.getDrawPane().ownerSVGElement;null!=s&&(s.style.minWidth=Math.max(1,i)+"px",s.style.minHeight=Math.max(1,n)+"px",s.style.width="100%",s.style.height="100%")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,i),Math.max(1,n)):(this.view.canvas.style.minWidth=Math.max(1,i)+"px",this.view.canvas.style.minHeight=Math.max(1,n)+"px");this.updatePageBreaks(this.pageBreaksVisible,i,n)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))},mxGraph.prototype.doResizeContainer=function(t,e){null!=this.maximumContainerSize&&(t=Math.min(this.maximumContainerSize.width,t),e=Math.min(this.maximumContainerSize.height,e)),this.container.style.width=Math.ceil(t)+"px",this.container.style.height=Math.ceil(e)+"px"},mxGraph.prototype.updatePageBreaks=function(t,e,i){var n=this.view.scale,r=this.view.translate,s=this.pageFormat,o=n*this.pageScale,l=new mxRectangle(0,0,s.width*o,s.height*o),a=mxRectangle.fromRectangle(this.getGraphBounds());a.width=Math.max(1,a.width),a.height=Math.max(1,a.height),l.x=Math.floor((a.x-r.x*n)/l.width)*l.width+r.x*n,l.y=Math.floor((a.y-r.y*n)/l.height)*l.height+r.y*n,a.width=Math.ceil((a.width+(a.x-l.x))/l.width)*l.width,a.height=Math.ceil((a.height+(a.y-l.y))/l.height)*l.height;var h=(t=t&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(a.height/l.height)+1:0,u=t?Math.ceil(a.width/l.width)+1:0,p=(u-1)*l.width,d=(h-1)*l.height;null==this.horizontalPageBreaks&&h>0&&(this.horizontalPageBreaks=[]),null==this.verticalPageBreaks&&u>0&&(this.verticalPageBreaks=[]);var c=mxUtils.bind(this,(function(t){if(null!=t){for(var e=t==this.horizontalPageBreaks?h:u,i=0;i<=e;i++){var n=t==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+i*l.height)),new mxPoint(Math.round(l.x+p),Math.round(l.y+i*l.height))]:[new mxPoint(Math.round(l.x+i*l.width),Math.round(l.y)),new mxPoint(Math.round(l.x+i*l.width),Math.round(l.y+d))];if(null!=t[i])t[i].points=n,t[i].redraw();else{var r=new mxPolyline(n,this.pageBreakColor);r.dialect=this.dialect,r.pointerEvents=!1,r.isDashed=this.pageBreakDashed,r.init(this.view.backgroundPane),r.redraw(),t[i]=r}}for(i=e;i0&&";base64,"!=i.substring(n-7,n+1)&&(i=i.substring(0,n)+";base64,"+i.substring(n+1))}t[mxConstants.STYLE_IMAGE]=i}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(null!=(e=e||this.getSelectionCells())){this.model.beginUpdate();try{for(var i=0;i0){var r=this.view.getState(i[0]),s=null!=r?r.style:this.getCellStyle(i[0]);null!=s&&(n=mxUtils.getValue(s,t,e)?0:1,this.setCellStyles(t,n,i))}return n},mxGraph.prototype.setCellStyles=function(t,e,i){i=i||this.getSelectionCells(),mxUtils.setCellStyles(this.model,i,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,i){this.setCellStyleFlags(t,e,null,i)},mxGraph.prototype.setCellStyleFlags=function(t,e,i,n){if(null!=(n=n||this.getSelectionCells())&&n.length>0){if(null==i){var r=this.view.getState(n[0]),s=null!=r?r.style:this.getCellStyle(n[0]);if(null!=s)i=!((parseInt(s[t]||0)&e)==e)}mxUtils.setCellStyleFlags(this.model,n,t,e,i)}},mxGraph.prototype.alignCells=function(t,e,i){if(null==e&&(e=this.getSelectionCells()),null!=e&&e.length>1){if(null==i)for(var n=0;n0&&null!=n){var r=this.model.getParent(t);null==r&&(r=this.model.getParent(i[0])),this.model.beginUpdate();try{null==this.getCellGeometry(t)&&this.model.setGeometry(t,new mxGeometry);var s=this.model.getChildCount(r);this.cellsAdded([t],r,s,null,null,!1,!1,!1),s=this.model.getChildCount(t),this.cellsAdded(i,t,s,null,null,!1,!1,!1),this.cellsMoved(i,-n.x,-n.y,!1,!1,!1),this.cellsResized([t],[n],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",i))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(null!=t&&t.length>0){var i=this.model.getParent(t[0]);e.push(t[0]);for(var n=1;n0&&i.push(t[n]);t=i}if(null!=t&&t.length>0){this.model.beginUpdate();try{for(n=0;n0){r=r.slice();var s=this.model.getParent(t[n]),o=this.model.getChildCount(s);this.cellsAdded(r,s,o,null,null,!0),e=e.concat(r)}}this.removeCellsAfterUngroup(t),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",t))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){null==t&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),i=this.model.getChildCount(e);this.cellsAdded(t,e,i,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,i,n,r,s,o){null==t&&(t=this.getSelectionCells()),e=null!=e?e:0,i=null!=i&&i,n=null!=n?n:0,r=null!=r?r:0,s=null!=s?s:0,o=null!=o?o:0,this.model.beginUpdate();try{for(var l=t.length-1;l>=0;l--){var a=this.getCellGeometry(t[l]);if(null!=a){var h=this.getChildCells(t[l]);if(null!=h&&h.length>0){var u=this.getBoundingBoxFromGeometry(h,!0);if(null!=u&&u.width>0&&u.height>0){var p=0,d=0;if(this.isSwimlane(t[l])){var c=this.getStartSize(t[l]);p=c.width,d=c.height}a=a.clone(),i&&(a.x=Math.round(a.x+u.x-e-p-o),a.y=Math.round(a.y+u.y-e-d-n)),a.width=Math.round(u.width+2*e+p+o+r),a.height=Math.round(u.height+2*e+d+n+s),this.model.setGeometry(t[l],a),this.moveCells(h,e+p-u.x+o,e+d-u.y+n)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(null!=t&&t.length>0)for(var i=0;i0){var a=this.view.scale,h=this.view.translate;r=this.model.cloneCells(t,!0,i);for(l=0;lthis.model.getChildCount(e)&&i--,this.model.add(e,t[p],i+p),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[p],!0),(null==l||l)&&this.isExtendParentsOnAdd(t[p])&&this.isExtendParent(t[p])&&this.extendParent(t[p]),(null==o||o)&&this.constrainChild(t[p]),null!=n&&this.cellConnected(t[p],n,!0),null!=r&&this.cellConnected(t[p],r,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",i,"source",n,"target",r,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=null==e||e)for(var i=this.model.getChildCount(t),n=0;n0){var e=this.view.scale,i=this.view.translate;this.model.beginUpdate();try{for(var n=new mxDictionary,r=0;r0){this.model.beginUpdate();try{for(var i=0;i0){this.model.beginUpdate();try{for(var r=0;r0&&(s.height=Math.max(s.height,l))}}e.alternateBounds=new mxRectangle(0,0,s.width,s.height)}if(null!=e.alternateBounds){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var a=mxUtils.toRadians(r[mxConstants.STYLE_ROTATION]||0);if(0!=a){var h=e.alternateBounds.getCenterX()-e.getCenterX(),u=e.alternateBounds.getCenterY()-e.getCenterY(),p=Math.cos(a),d=Math.sin(a),c=p*h-d*u,m=d*h+p*u;e.alternateBounds.x+=c-h,e.alternateBounds.y+=m-u}}}},mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))},mxGraph.prototype.getAllEdges=function(t){var e=[];if(null!=t)for(var i=0;i0){this.isHtmlLabel(i.cell)||(a=mxUtils.htmlEntities(a,!1)),a=a.replace(/\n/g,"
");var h=mxUtils.getSizeForString(a,r,n[mxConstants.STYLE_FONTFAMILY],null,n[mxConstants.STYLE_FONTSTYLE]),u=h.width+s,p=h.height+o;if(!mxUtils.getValue(n,mxConstants.STYLE_HORIZONTAL,!0)){var d=p;p=u,u=d}this.gridEnabled&&(u=this.snap(u+this.gridSize/2),p=this.snap(p+this.gridSize/2)),e=new mxRectangle(0,0,u,p)}else{var c=4*this.gridSize;e=new mxRectangle(0,0,c,c)}}}return e},mxGraph.prototype.resizeCell=function(t,e,i){return this.resizeCells([t],[e],i)[0]},mxGraph.prototype.resizeCells=function(t,e,i){i=null!=i?i:this.isRecursiveResize(),this.model.beginUpdate();try{this.cellsResized(t,e,i),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,i){if(i=null!=i&&i,null!=t&&null!=e&&t.length==e.length){this.model.beginUpdate();try{for(var n=0;n0&&((o=mxRectangle.fromRectangle(o)).x-=o.width*l,o.y-=o.height*l,o.width+=2*o.width*l,o.height+=2*o.height*l),null==r?r=o:(r=mxRectangle.fromRectangle(r)).intersect(o)}}if(null!=r){var a=[t];if(!this.isCellCollapsed(t))for(var h=this.model.getDescendants(t),u=0;ur.width&&(d=i.width-r.width,i.width-=d),p.x+p.width>r.x+r.width&&(d-=p.x+p.width-r.x-r.width-d);var c=0;i.height>r.height&&(c=i.height-r.height,i.height-=c),p.y+p.height>r.y+r.height&&(c-=p.y+p.height-r.y-r.height-c),p.x0&&((e=e.clone()).points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,i){if(null!=e.shape){var n=this.view.getPerimeterBounds(e),r=e.style[mxConstants.STYLE_DIRECTION];if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){n.x+=n.width/2-n.height/2,n.y+=n.height/2-n.width/2;var s=n.width;n.width=n.height,n.height=s}var o=mxUtils.toRadians(e.shape.getShapeRotation());if(0!=o){var l=Math.cos(-o),a=Math.sin(-o),h=new mxPoint(n.getCenterX(),n.getCenterY());t=mxUtils.getRotatedPoint(t,l,a,h)}var u=1,p=1,d=0,c=0;if(this.getModel().isVertex(e.cell)){var m=e.style[mxConstants.STYLE_FLIPH],g=e.style[mxConstants.STYLE_FLIPV];if(null!=e.shape&&null!=e.shape.stencil&&(m=1==mxUtils.getValue(e.style,"stencilFlipH",0)||m,g=1==mxUtils.getValue(e.style,"stencilFlipV",0)||g),r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){s=m;m=g,g=s}m&&(u=-1,d=-n.width),g&&(p=-1,c=-n.height)}return t=new mxPoint((t.x-n.x)*u-d+n.x,(t.y-n.y)*p-c+n.y),new mxConnectionConstraint(new mxPoint(0==n.width?0:Math.round(1e3*(t.x-n.x)/n.width)/1e3,0==n.height?0:Math.round(1e3*(t.y-n.y)/n.height)/1e3),!1)}return null},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return null!=t&&null!=t.shape&&null!=t.shape.stencil?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,i){var n=null,r=t.style[i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=r){var s=t.style[i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=s&&(n=new mxPoint(parseFloat(r),parseFloat(s)))}var o=!1,l=0,a=0;return null!=n&&(o=mxUtils.getValue(t.style,i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),l=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),a=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),l=isFinite(l)?l:0,a=isFinite(a)?a:0),new mxConnectionConstraint(n,o,null,l,a)},mxGraph.prototype.setConnectionConstraint=function(t,e,i,n){if(null!=n){this.model.beginUpdate();try{null==n||null==n.point?(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):null!=n.point&&(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,n.point.x,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,n.point.y,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,n.dx,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,n.dy,[t]),n.perimeter?this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,i){i=null==i||i;var n=null;if(null!=t&&null!=e.point){var r=this.view.getPerimeterBounds(t),s=new mxPoint(r.getCenterX(),r.getCenterY()),o=t.style[mxConstants.STYLE_DIRECTION],l=0;null!=o&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(o==mxConstants.DIRECTION_NORTH?l+=270:o==mxConstants.DIRECTION_WEST?l+=180:o==mxConstants.DIRECTION_SOUTH&&(l+=90),o!=mxConstants.DIRECTION_NORTH&&o!=mxConstants.DIRECTION_SOUTH||r.rotate90());var a=this.view.scale;n=new mxPoint(r.x+e.point.x*r.width+e.dx*a,r.y+e.point.y*r.height+e.dy*a);var h=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(0!=l){var u=0,p=0;90==l?p=1:180==l?u=-1:270==l&&(p=-1),n=mxUtils.getRotatedPoint(n,u,p,s)}n=this.view.getPerimeterPoint(t,n,!1)}else if(h+=l,this.getModel().isVertex(t.cell)){var d=1==t.style[mxConstants.STYLE_FLIPH],c=1==t.style[mxConstants.STYLE_FLIPV];if(null!=t.shape&&null!=t.shape.stencil&&(d=1==mxUtils.getValue(t.style,"stencilFlipH",0)||d,c=1==mxUtils.getValue(t.style,"stencilFlipV",0)||c),o==mxConstants.DIRECTION_NORTH||o==mxConstants.DIRECTION_SOUTH){var m=d;d=c,c=m}d&&(n.x=2*r.getCenterX()-n.x),c&&(n.y=2*r.getCenterY()-n.y)}if(0!=h&&null!=n){var g=mxUtils.toRadians(h);u=Math.cos(g),p=Math.sin(g);n=mxUtils.getRotatedPoint(n,u,p,s)}}return i&&null!=n&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),n},mxGraph.prototype.connectCell=function(t,e,i,n){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);this.cellConnected(t,e,i,n),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,i,n){if(null!=t){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);if(this.setConnectionConstraint(t,e,i,n),this.isPortsEnabled()){var s=null;this.isPort(e)&&(s=e.getId(),e=this.getTerminalForPort(e,i));var o=i?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(o,s,[t])}this.model.setTerminal(t,e,i),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(null!=t){this.model.beginUpdate();try{for(var e=this.view.scale,i=this.view.translate,n=new mxDictionary,r=0;r0)for(var a=new mxRectangle(l[0].x,l[0].y,0,0),h=1;h=0&&(s.x+=a.x,s.y+=a.y))}else if(s=mxRectangle.fromRectangle(r),this.model.isVertex(u)&&mxUtils.indexOf(t,u)>=0)null!=(a=this.getBoundingBoxFromGeometry([u],!1))&&(s.x+=a.x,s.y+=a.y);null!=s&&null!=r.offset&&(s.x+=r.offset.x,s.y+=r.offset.y)}null!=s&&(null==i?i=mxRectangle.fromRectangle(s):i.add(s))}}return i},mxGraph.prototype.refresh=function(t){this.view.clear(t,null==t),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.snapDelta=function(t,e,i,n,r){var s=this.view.translate,o=this.view.scale;if(!i&&this.gridEnabled){var l=this.gridSize*o*.5;if(!n){var a=e.x-(this.snap(e.x/o-s.x)+s.x)*o;Math.abs(t.x-a)o&&(p=0),m>l&&(d=0),this.view.setTranslate(Math.floor(p/2-a.x),Math.floor(d/2-a.y)),this.container.scrollLeft=(c-o)/2,this.container.scrollTop=(m-l)/2}else this.view.setTranslate(t?Math.floor(h.x-a.x*u+p*i/u):h.x,e?Math.floor(h.y-a.y*u+d*n/u):h.y)},mxGraph.prototype.zoom=function(t,e){e=null!=e?e:this.centerZoom;var i=Math.round(this.view.scale*t*100)/100,n=this.view.getState(this.getSelectionCell());if(t=i/this.view.scale,this.keepSelectionVisibleOnZoom&&null!=n){var r=new mxRectangle(n.x*t,n.y*t,n.width*t,n.height*t);this.view.scale=i,this.scrollRectToVisible(r)||(this.view.revalidate(),this.view.setScale(i))}else{var s=mxUtils.hasScrollbars(this.container);if(e&&!s){var o,l=this.container.offsetWidth,a=this.container.offsetHeight;if(t>1)l*=-(o=(t-1)/(2*i)),a*=-o;else l*=o=(1/t-1)/(2*this.view.scale),a*=o;this.view.scaleAndTranslate(i,this.view.translate.x+l,this.view.translate.y+a)}else{var h=this.view.translate.x,u=this.view.translate.y,p=this.container.scrollLeft,d=this.container.scrollTop;if(this.view.setScale(i),s){l=0,a=0;e&&(l=this.container.offsetWidth*(t-1)/2,a=this.container.offsetHeight*(t-1)/2),this.container.scrollLeft=(this.view.translate.x-h)*this.view.scale+Math.round(p*t+l),this.container.scrollTop=(this.view.translate.y-u)*this.view.scale+Math.round(d*t+a)}}}},mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width/(this.container.clientHeight/t.height);t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var i=Math.min(this.container.scrollWidth,t.x+t.width),n=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=i-t.x,t.height=n-t.y,e<1){var r=t.height/e,s=(r-t.height)/2;t.height=r;var o=Math.min(t.y,s);t.y=t.y-o,n=Math.min(this.container.scrollHeight,t.y+t.height),t.height=n-t.y}else{var l=t.width*e,a=(l-t.width)/2;t.width=l;var h=Math.min(t.x,a);t.x=t.x-h,i=Math.min(this.container.scrollWidth,t.x+t.width),t.width=i-t.x}var u=this.container.clientWidth/t.width,p=this.view.scale*u;mxUtils.hasScrollbars(this.container)?(this.view.setScale(p),this.container.scrollLeft=Math.round(t.x*u),this.container.scrollTop=Math.round(t.y*u)):this.view.scaleAndTranslate(p,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var i=-this.view.translate.x,n=-this.view.translate.y,r=this.view.getState(t);if(null!=r){var s=new mxRectangle(i+r.x,n+r.y,r.width,r.height);if(e&&null!=this.container){var o=this.container.clientWidth,l=this.container.clientHeight;s.x=s.getCenterX()-o/2,s.width=o,s.y=s.getCenterY()-l/2,s.height=l}var a=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(s)){var h=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=a.x,this.view.translate.y=a.y,this.view.setTranslate(h.x,h.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(null!=t){var i=this.container.offsetWidth,n=this.container.offsetHeight,r=Math.min(i,t.width),s=Math.min(n,t.height);if(mxUtils.hasScrollbars(this.container)){var o=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var l=o.scrollLeft-t.x,a=Math.max(l-o.scrollLeft,0);l>0?o.scrollLeft-=l+2:(l=t.x+r-o.scrollLeft-o.clientWidth)>0&&(o.scrollLeft+=l+2);var h=o.scrollTop-t.y,u=Math.max(0,h-o.scrollTop);h>0?o.scrollTop-=h+2:(h=t.y+s-o.scrollTop-o.clientHeight)>0&&(o.scrollTop+=h+2),this.useScrollbarsForPanning||0==a&&0==u||this.view.setTranslate(a,u)}else{var p=-this.view.translate.x,d=-this.view.translate.y,c=this.view.scale;t.x+r>p+i&&(this.view.translate.x-=(t.x+r-i-p)/c,e=!0),t.y+s>d+n&&(this.view.translate.y-=(t.y+s-n-d)/c,e=!0),t.x1||1==r.length&&r[0]!=t)&&(n+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n")}var s=this.model.getDirectedEdgeCount(e,!0,t),o=this.model.getDirectedEdgeCount(i,!1,t);if(null!=this.multiplicities)for(var l=0;l0?n:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(t,e,i){return null},mxGraph.prototype.validateGraph=function(t,e){t=null!=t?t:this.model.getRoot(),e=null!=e?e:new Object;for(var i=!0,n=this.model.getChildCount(t),r=0;r")):this.setCellWarning(s,null),i=i&&null==l}var a="";this.isCellCollapsed(t)&&!i&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),this.model.isEdge(t)?a+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":a+=this.getCellValidationError(t)||"";var h=this.validateCell(t,e);return null!=h&&(a+=h),null==this.model.getParent(t)&&this.view.validate(),a.length>0||!i?a:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),i=this.model.getDirectedEdgeCount(t,!1),n=this.model.getValue(t),r="";if(null!=this.multiplicities)for(var s=0;so.max||eo.max||i0?r:null},mxGraph.prototype.validateCell=function(t,e){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(t){this.backgroundImage=t},mxGraph.prototype.getFoldingImage=function(t){if(null!=t&&this.foldingEnabled&&!this.getModel().isEdge(t.cell)){var e=this.isCellCollapsed(t.cell);if(this.isCellFoldable(t.cell,!e))return e?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(t){var e=this.model.getValue(t);if(null!=e){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&null!=t){var i=this.view.getState(t),n=null!=i?i.style:this.getCellStyle(t);mxUtils.getValue(n,mxConstants.STYLE_NOLABEL,!1)||(e=this.convertValueToString(t))}return e},mxGraph.prototype.isHtmlLabel=function(t){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(t){this.htmlLabels=t},mxGraph.prototype.isWrapping=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return null!=i&&"wrap"==i[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return null!=i&&"hidden"==i[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(t,e,i,n){var r=null;if(null!=t){if(null==t.control||e!=t.control.node&&e.parentNode!=t.control.node||(r=this.collapseExpandResource,r=mxUtils.htmlEntities(mxResources.get(r)||r).replace(/\\n/g,"
")),null==r&&null!=t.overlays&&t.overlays.visit((function(t,i){null!=r||e!=i.node&&e.parentNode!=i.node||(r=i.overlay.toString())})),null==r){var s=this.selectionCellsHandler.getHandler(t.cell);null!=s&&"function"==typeof s.getTooltipForNode&&(r=s.getTooltipForNode(e))}null==r&&(r=this.getTooltipForCell(t.cell))}return r},mxGraph.prototype.getTooltipForCell=function(t){return null!=t&&null!=t.getTooltip?t.getTooltip():this.convertValueToString(t)},mxGraph.prototype.getLinkForCell=function(t){return null},mxGraph.prototype.getCursorForMouseEvent=function(t){return this.getCursorForCell(t.getCell())},mxGraph.prototype.getCursorForCell=function(t){return null},mxGraph.prototype.getStartSize=function(t){var e=new mxRectangle,i=this.view.getState(t),n=null!=i?i.style:this.getCellStyle(t);if(null!=n){var r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));mxUtils.getValue(n,mxConstants.STYLE_HORIZONTAL,!0)?e.height=r:e.width=r}return e},mxGraph.prototype.getImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.isTransparentState=function(t){var e=!1;if(null!=t){var i=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),n=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=i==mxConstants.NONE&&n==mxConstants.NONE&&null==this.getImage(t)}return e},mxGraph.prototype.getVerticalAlign=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(t){this.border=t},mxGraph.prototype.isSwimlane=function(t){if(null!=t&&this.model.getParent(t)!=this.model.getRoot()){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);if(null!=i&&!this.model.isEdge(t))return i[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE}return!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(t){this.resizeContainer=t},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(t){this.enabled=t},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(t){this.escapeEnabled=t},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(t){this.invokesStopCellEditing=t},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(t){this.enterStopsCellEditing=t},mxGraph.prototype.isCellLocked=function(t){var e=this.model.getGeometry(t);return this.isCellsLocked()||null!=e&&this.model.isVertex(t)&&e.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(t){this.cellsLocked=t},mxGraph.prototype.getCloneableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellCloneable(t)})))},mxGraph.prototype.isCellCloneable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsCloneable()&&0!=i[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(t){this.cellsCloneable=t},mxGraph.prototype.getExportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canExportCell(t)})))},mxGraph.prototype.canExportCell=function(t){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canImportCell(t)})))},mxGraph.prototype.canImportCell=function(t){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(t){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(t){this.cellsSelectable=t},mxGraph.prototype.getDeletableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellDeletable(t)})))},mxGraph.prototype.isCellDeletable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsDeletable()&&0!=i[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(t){this.cellsDeletable=t},mxGraph.prototype.isLabelMovable=function(t){return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&this.vertexLabelsMovable)},mxGraph.prototype.isCellRotatable=function(t){var e=this.view.getState(t);return 0!=(null!=e?e.style:this.getCellStyle(t))[mxConstants.STYLE_ROTATABLE]},mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellMovable(t)})))},mxGraph.prototype.isCellMovable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&0!=i[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(t){this.cellsMovable=t},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(t){this.portsEnabled=t},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(t){this.gridSize=t},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(t){this.tolerance=t},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(t){this.vertexLabelsMovable=t},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(t){this.edgeLabelsMovable=t},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(t){this.swimlaneNesting=t},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(t){this.swimlaneSelectionEnabled=t},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(t){this.multigraph=t},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(t){this.allowDanglingEdges=t},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(t){this.connectableEdges=t},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(t){this.cloneInvalidEdges=t},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(t){this.allowLoops=t},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(t){this.disconnectOnMove=t},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(t){this.dropEnabled=t},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(t){this.splitEnabled=t},mxGraph.prototype.isCellResizable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&"0"!=mxUtils.getValue(i,mxConstants.STYLE_RESIZABLE,"1")},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t},mxGraph.prototype.isTerminalPointMovable=function(t,e){return!0},mxGraph.prototype.isCellBendable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&0!=i[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t},mxGraph.prototype.isCellEditable=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&0!=i[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,i){return this.isCellsDisconnectable()&&!this.isCellLocked(t)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(t){this.cellsDisconnectable=t},mxGraph.prototype.isValidSource=function(t){return null==t&&this.allowDanglingEdges||null!=t&&(!this.model.isEdge(t)||this.connectableEdges)&&this.isCellConnectable(t)},mxGraph.prototype.isValidTarget=function(t){return this.isValidSource(t)},mxGraph.prototype.isValidConnection=function(t,e){return this.isValidSource(t)&&this.isValidTarget(e)},mxGraph.prototype.setConnectable=function(t){this.connectionHandler.setEnabled(t)},mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(t){this.tooltipHandler.setEnabled(t)},mxGraph.prototype.setPanning=function(t){this.panningHandler.panningEnabled=t},mxGraph.prototype.isEditing=function(t){if(null!=this.cellEditor){var e=this.cellEditor.getEditingCell();return null==t?null!=e:t==e}return!1},mxGraph.prototype.isAutoSizeCell=function(t){var e=this.view.getState(t),i=null!=e?e.style:this.getCellStyle(t);return this.isAutoSizeCells()||1==i[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(t){this.autoSizeCells=t},mxGraph.prototype.isExtendParent=function(t){return!this.getModel().isEdge(t)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(t){this.extendParents=t},mxGraph.prototype.isExtendParentsOnAdd=function(t){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(t){this.extendParentsOnAdd=t},mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove},mxGraph.prototype.setExtendParentsOnMove=function(t){this.extendParentsOnMove=t},mxGraph.prototype.isRecursiveResize=function(t){return this.recursiveResize},mxGraph.prototype.setRecursiveResize=function(t){this.recursiveResize=t},mxGraph.prototype.isConstrainChild=function(t){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(t))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(t){this.constrainChildren=t},mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren},mxGraph.prototype.setConstrainRelativeChildren=function(t){this.constrainRelativeChildren=t},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(t){this.allowNegativeCoordinates=t},mxGraph.prototype.getOverlap=function(t){return this.isAllowOverlapParent(t)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(t){return!1},mxGraph.prototype.getFoldableCells=function(t,e){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellFoldable(t,e)})))},mxGraph.prototype.isCellFoldable=function(t,e){var i=this.view.getState(t),n=null!=i?i.style:this.getCellStyle(t);return this.model.getChildCount(t)>0&&0!=n[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(t,e,i){return null!=t&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,i)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,i){if(this.model.isEdge(t)&&null!=e&&1==e.length&&this.isCellConnectable(e[0])&&null==this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])){var n=this.model.getTerminal(t,!0),r=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],n)&&!this.model.isAncestor(e[0],r)}return!1},mxGraph.prototype.getDropTarget=function(t,e,i,n){if(!this.isSwimlaneNesting())for(var r=0;r=0;o--){var l=this.model.getChildAt(i,o),a=this.getCellAt(t,e,l,n,r,s);if(null!=a)return a;if(this.isCellVisible(l)&&(r&&this.model.isEdge(l)||n&&this.model.isVertex(l))){var h=this.view.getState(l);if(null!=h&&(null==s||!s(h,t,e))&&this.intersects(h,t,e))return l}}return null},mxGraph.prototype.intersects=function(t,e,i){if(null!=t){var n=t.absolutePoints;if(null!=n)for(var r=this.tolerance*this.tolerance,s=n[0],o=1;o0&&e>0&&e>r.width*s)return!0;if(r.height>0&&i>0&&i>r.height*s)return!0}return!1},mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraph.prototype.getChildCells=function(t,e,i){t=null!=t?t:this.getDefaultParent(),e=null!=e&&e,i=null!=i&&i;for(var n=this.model.getChildCells(t,e,i),r=[],s=0;s0||n>0){var o=this.getModel(),l=t+i,a=e+n;if(null==r&&null==(r=this.getCurrentRoot())&&(r=o.getRoot()),null!=r)for(var h=o.getChildCount(r),u=0;u=t&&m.y+m.height<=a&&m.y>=e&&m.x+m.width<=l?s.push(p):this.getCells(t,e,i,n,p,s)}}}return s},mxGraph.prototype.getCellsBeyond=function(t,e,i,n,r){var s=[];if((n||r)&&(null==i&&(i=this.getDefaultParent()),null!=i))for(var o=this.model.getChildCount(i),l=0;l=t)&&(!r||h.y>=e)&&s.push(a)}return s},mxGraph.prototype.findTreeRoots=function(t,e,i){e=null!=e&&e,i=null!=i&&i;var n=[];if(null!=t){for(var r=this.getModel(),s=r.getChildCount(t),o=null,l=0,a=0;a0||!i&&0==d&&p>0)&&n.push(h);var m=i?d-p:p-d;m>l&&(l=m,o=h)}}0==n.length&&null!=o&&n.push(o)}return n},mxGraph.prototype.traverse=function(t,e,i,n,r,s){if(null!=i&&null!=t&&(e=null==e||e,s=null!=s&&s,!(r=r||new mxDictionary).get(t))){r.put(t,!0);var o=i(t,n);if(null==o||o){var l=this.model.getEdgeCount(t);if(l>0)for(var a=0;a0?n.cells[0]:null;n.cells.length>1&&n.clear();var s=null!=r?this.model.getParent(r):this.getDefaultParent(),o=this.model.getChildCount(s);if(null==r&&o>0){var l=this.model.getChildAt(s,0);this.setSelectionCell(l)}else if(null!=r&&!e||null==this.view.getState(s)||null==this.model.getGeometry(s)){if(null!=r&&i){if(this.model.getChildCount(r)>0){l=this.model.getChildAt(r,0);this.setSelectionCell(l)}}else if(o>0){var a=s.getIndex(r);if(t){a++;l=this.model.getChildAt(s,a%o);this.setSelectionCell(l)}else{var h=--a<0?o-1:a;l=this.model.getChildAt(s,h);this.setSelectionCell(l)}}}else this.getCurrentRoot()!=s&&this.setSelectionCell(s)},mxGraph.prototype.selectAll=function(t,e){t=t||this.getDefaultParent();var i=e?this.model.filterDescendants(mxUtils.bind(this,(function(e){return e!=t&&null!=this.view.getState(e)})),t):this.model.getChildren(t);null!=i&&this.setSelectionCells(i)},mxGraph.prototype.selectVertices=function(t,e){this.selectCells(!0,!1,t,e)},mxGraph.prototype.selectEdges=function(t){this.selectCells(!1,!0,t)},mxGraph.prototype.selectCells=function(t,e,i,n){i=i||this.getDefaultParent();var r=mxUtils.bind(this,(function(i){return null!=this.view.getState(i)&&((n||0==this.model.getChildCount(i))&&this.model.isVertex(i)&&t&&!this.model.isEdge(this.model.getParent(i))||this.model.isEdge(i)&&e)})),s=this.model.filterDescendants(r,i);null!=s&&this.setSelectionCells(s)},mxGraph.prototype.selectCellForEvent=function(t,e){var i=this.isCellSelected(t);this.isToggleEvent(e)?i?this.removeSelectionCell(t):this.addSelectionCell(t):i&&1==this.getSelectionCount()||this.setSelectionCell(t)},mxGraph.prototype.selectCellsForEvent=function(t,e){this.isToggleEvent(e)?this.addSelectionCells(t):this.setSelectionCells(t)},mxGraph.prototype.createHandler=function(t){var e=null;if(null!=t)if(this.model.isEdge(t.cell)){var i=t.getVisibleTerminalState(!0),n=t.getVisibleTerminalState(!1),r=this.getCellGeometry(t.cell),s=this.view.getEdgeStyle(t,null!=r?r.points:null,i,n);e=this.createEdgeHandler(t,s)}else e=this.createVertexHandler(t);return e},mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)},mxGraph.prototype.createEdgeHandler=function(t,e){return e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(t):e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(t):new mxEdgeHandler(t)},mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)},mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)},mxGraph.prototype.addMouseListener=function(t){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(t)},mxGraph.prototype.removeMouseListener=function(t){if(null!=this.mouseListeners)for(var e=0;e0){this.outline.getView().scale!=d&&(this.outline.getView().scale=d,t=!0);var c=this.outline.getView();c.currentRoot!=this.source.getView().currentRoot&&c.setCurrentRoot(this.source.getView().currentRoot);var m=this.source.view.translate,g=m.x+this.source.panDx,x=m.y+this.source.panDy,f=this.getOutlineOffset(d);null!=f&&(g+=f.x,x+=f.y),n.x<0&&(g-=n.x),n.y<0&&(x-=n.y),c.translate.x==g&&c.translate.y==x||(c.translate.x=g,c.translate.y=x,t=!0);var y=c.translate,v=(d=this.source.getView().scale)/c.scale,C=1/c.scale,E=this.source.container;this.bounds=new mxRectangle((y.x-m.x-this.source.panDx)/C,(y.y-m.y-this.source.panDy)/C,E.clientWidth/v,E.clientHeight/v),this.bounds.x+=this.source.container.scrollLeft*c.scale/d,this.bounds.y+=this.source.container.scrollTop*c.scale/d,(S=this.selectionBorder.bounds).x==this.bounds.x&&S.y==this.bounds.y&&S.width==this.bounds.width&&S.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw());var S=this.sizer.bounds,b=new mxRectangle(this.bounds.x+this.bounds.width-S.width/2,this.bounds.y+this.bounds.height-S.height/2,S.width,S.height);S.x==b.x&&S.y==b.y&&S.width==b.width&&S.height==b.height||(this.sizer.bounds=b,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),t&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var i=mxEvent.isMouseEvent(e.getEvent())?0:this.source.tolerance,n=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||i>0)?new mxRectangle(e.getGraphX()-i,e.getGraphY()-i,2*i,2*i):null;this.zoom=e.isSource(this.sizer)||null!=n&&mxUtils.intersects(shape.bounds,n),this.startX=e.getX(),this.startY=e.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):(this.dx0=0,this.dy0=0)}e.consume()},mxOutline.prototype.mouseMove=function(t,e){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var i=this.getTranslateForEvent(e),n=i.x,r=i.y,s=null;if(this.zoom){var o=this.source.container;r=n/(o.clientWidth/o.clientHeight),s=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+r)),this.selectionBorder.bounds=s,this.selectionBorder.redraw()}else{var l=this.outline.getView().scale;s=new mxRectangle(this.bounds.x+n,this.bounds.y+r,this.bounds.width,this.bounds.height),this.selectionBorder.bounds=s,this.selectionBorder.redraw(),n/=l,n*=this.source.getView().scale,r/=l,r*=this.source.getView().scale,this.source.panGraph(-n-this.dx0,-r-this.dy0)}var a=this.sizer.bounds;this.sizer.bounds=new mxRectangle(s.x+s.width-a.width/2,s.y+s.height-a.height/2,a.width,a.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),e.consume()}},mxOutline.prototype.getTranslateForEvent=function(t){return new mxPoint(t.getX()-this.startX,t.getY()-this.startY)},mxOutline.prototype.mouseUp=function(t,e){if(this.active){var i=this.getTranslateForEvent(e),n=i.x,r=i.y;if(Math.abs(n)>0||Math.abs(r)>0){if(this.zoom){var s=this.selectionBorder.bounds.width,o=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,o-n*o/s),!1)}else if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0),n/=this.outline.getView().scale,r/=this.outline.getView().scale;var l=this.source.getView().translate;this.source.getView().setTranslate(l.x-n,l.y-r)}this.update(),e.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.removeListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},__mxOutput.mxOutline=void 0!==mxOutline?mxOutline:void 0,mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(t,e,i,n,r,s){var o="";(this.source&&this.checkTerminal(t,i,e)||!this.source&&this.checkTerminal(t,n,e))&&(null!=this.countError&&(this.source&&(0==this.max||r>=this.max)||!this.source&&(0==this.max||s>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&this.validNeighbors.length>0&&(this.checkNeighbors(t,e,i,n)||(o+=this.typeError+"\n")));return o.length>0?o:null},mxMultiplicity.prototype.checkNeighbors=function(t,e,i,n){for(var r=t.model.getValue(i),s=t.model.getValue(n),o=!this.validNeighborsAllowed,l=this.validNeighbors,a=0;a0;)e=e.concat(n),n=i.getParents(n);this.executeLayoutForCells(e)},mxLayoutManager.prototype.executeLayoutForCells=function(t){var e=mxUtils.sortCells(t,!0);e=e.concat(e.slice().reverse()),this.layoutCells(e)},mxLayoutManager.prototype.cellsMoved=function(t,e){if(null!=t&&null!=e)for(var i=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(e),mxEvent.getClientY(e)),n=this.getGraph().getModel(),r=0;r0){var e=this.getGraph().getModel();e.beginUpdate();try{for(var i=null,n=0;n1||null!=r.points&&r.points.length>0||null==n.getTerminal(i,!0)||null==n.getTerminal(i,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())?this.start(i,e.getX(),e.getY()):this.delayedSelection&&(this.cell=i),this.cellWasClicked=!0,this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}},mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent(),e=this.graph.getModel(),i=mxUtils.bind(this,(function(t){return null!=this.graph.view.getState(t)&&e.isVertex(t)&&null!=e.getGeometry(t)&&!e.getGeometry(t).relative}));return this.graph.view.getCellStates(e.filterDescendants(i,t))},mxGraphHandler.prototype.getCells=function(t){return!this.delayedSelection&&this.graph.isCellMovable(t)?[t]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(t){var e=this.getBoundingBox(t);if(null!=e){if(e.width=Math.max(0,e.width-1),e.height=Math.max(0,e.height-1),e.width0)for(var i=this.graph.getModel(),n=0;n=2)&&e!=(this.target||s))}))}},mxGraphHandler.prototype.addStates=function(t,e){var i=this.graph.view.getState(t),n=0;if(null!=i&&null==e.get(t)){e.put(t,i),n++;for(var r=this.graph.model.getChildCount(t),s=0;ss||Math.abs(r.y)>s){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var o=i.isCloneEvent(e.getEvent())&&i.isCellsCloneable()&&this.isCloneEnabled(),l=i.isGridEnabledEvent(e.getEvent()),a=e.getCell(),h=!0,u=null;this.cloning=o,i.isDropEnabled()&&this.highlightEnabled&&(u=i.getDropTarget(this.cells,e.getEvent(),a,o));var p=i.getView().getState(u),d=!1;if(null==p||i.model.getParent(this.cell)==u&&!o){if(this.target=null,this.connectOnDrop&&null!=a&&1==this.cells.length&&i.getModel().isVertex(a)&&i.isCellConnectable(a)&&null!=(p=i.getView().getState(a))){var c=null==i.getEdgeValidationError(null,this.cell,a)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(c),d=!0}}else this.target!=u&&(this.target=u,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),d=!0;null!=p&&d?this.highlight.highlight(p):this.highlight.hide(),this.livePreviewActive&&o?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?o&&this.livePreviewActive||(this.setHandlesVisibleForCells(this.graph.getSelectionCells(),!1),this.livePreviewActive=!0,this.livePreviewUsed=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds)),null!=this.guide&&this.useGuidesForEvent(e)?(r=this.guide.move(this.bounds,r,l,o),h=!1):r=this.graph.snapDelta(r,this.bounds,!l,!1,!1),null!=this.guide&&h&&this.guide.hide(),i.isConstrainedEvent(e.getEvent())&&(Math.abs(r.x)>Math.abs(r.y)?r.y=0:r.x=0),this.currentDx==r.x&&this.currentDy==r.y||(this.currentDx=r.x,this.currentDy=r.y,this.updatePreview())}this.updateHint(e),this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e),mxEvent.consume(e.getEvent())}},mxGraphHandler.prototype.updatePreview=function(t){this.livePreviewUsed&&!t?null!=this.cells&&this.updateLivePreview(this.currentDx,this.currentDy):this.updatePreviewShape()},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.updateLivePreview=function(t,e){if(!this.suspended){var i=[];null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,(function(n,r){var s=r.clone();i.push([r,s]),null!=r.shape&&(null==r.shape.originalPointerEvents&&(r.shape.originalPointerEvents=r.shape.pointerEvents),r.shape.pointerEvents=!1,null!=r.text&&(null==r.text.originalPointerEvents&&(r.text.originalPointerEvents=r.text.pointerEvents),r.text.pointerEvents=!1)),this.graph.model.isVertex(r.cell)&&(r.x+=t,r.y+=e,this.cloning||(r.view.graph.cellRenderer.redraw(r,!0),r.view.invalidate(r.cell),r.invalid=!1,null!=r.control&&null!=r.control.node&&(r.control.node.style.visibility="hidden")))})));for(var n=this.graph.view.scale,r=0;rthis.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}(this.active||this.panningTrigger)&&e.consume()},mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(null!=this.dx&&null!=this.dy){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var i=this.graph.getView().scale,n=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(n.x+this.dx/i,n.y+this.dy/i)}e.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",e))}this.reset()},mxPanningHandler.prototype.zoomGraph=function(t){var e=Math.round(this.initialScale*t.scale*100)/100;null!=this.minScale&&(e=Math.max(this.minScale,e)),null!=this.maxScale&&(e=Math.min(this.maxScale,e)),this.graph.view.scale!=e&&(this.graph.zoomTo(e),mxEvent.consume(t))},mxPanningHandler.prototype.reset=function(){this.panningTrigger=!1,this.mouseDownEvent=null,this.active=!1,this.dx=null,this.dy=null},mxPanningHandler.prototype.panGraph=function(t,e){this.graph.getView().setTranslate(t,e)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.forcePanningHandler),this.graph.removeListener(this.gestureHandler),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)},__mxOutput.mxPanningHandler=void 0!==mxPanningHandler?mxPanningHandler:void 0,mxPopupMenuHandler.prototype=new mxPopupMenu,mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler,mxPopupMenuHandler.prototype.graph=null,mxPopupMenuHandler.prototype.selectOnPopup=!0,mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0,mxPopupMenuHandler.prototype.triggerX=null,mxPopupMenuHandler.prototype.triggerY=null,mxPopupMenuHandler.prototype.screenX=null,mxPopupMenuHandler.prototype.screenY=null,mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,(function(t){this.graph.tooltipHandler.hide()})))},mxPopupMenuHandler.prototype.isSelectOnPopup=function(t){return this.selectOnPopup},mxPopupMenuHandler.prototype.mouseDown=function(t,e){this.isEnabled()&&!mxEvent.isMultiTouchEvent(e.getEvent())&&(this.hideMenu(),this.triggerX=e.getGraphX(),this.triggerY=e.getGraphY(),this.screenX=mxEvent.getMainEvent(e.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(e.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(e),this.inTolerance=!0)},mxPopupMenuHandler.prototype.mouseMove=function(t,e){this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(Math.abs(mxEvent.getMainEvent(e.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(e.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxPopupMenuHandler.prototype.mouseUp=function(t,e){if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var i=this.getCellForPopupEvent(e);this.graph.isEnabled()&&this.isSelectOnPopup(e)&&null!=i&&!this.graph.isCellSelected(i)?this.graph.setSelectionCell(i):this.clearSelectionOnBackground&&null==i&&this.graph.clearSelection(),this.graph.tooltipHandler.hide();var n=mxUtils.getScrollOrigin();this.popup(e.getX()+n.x+1,e.getY()+n.y+1,i,e.getEvent()),e.consume()}this.popupTrigger=!1,this.inTolerance=!1},mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){return t.getCell()},mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.gestureHandler),mxPopupMenu.prototype.destroy.apply(this)},__mxOutput.mxPopupMenuHandler=void 0!==mxPopupMenuHandler?mxPopupMenuHandler:void 0,mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(t){this.enabled=t},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(t){this.hotspot=t},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(t){this.hotspotEnabled=t},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){this.validState=null,null!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(t){var e=null;return this.isEnabled()&&(e=this.getState(t),this.setCurrentState(e,t)),e},mxCellMarker.prototype.setCurrentState=function(t,e,i){var n=null!=t&&this.isValidState(t);i=null!=i?i:this.getMarkerColor(e.getEvent(),t,n),this.validState=n?t:null,t==this.markedState&&i==this.currentColor||(this.currentColor=i,null!=t&&null!=this.currentColor?(this.markedState=t,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))},mxCellMarker.prototype.markCell=function(t,e){var i=this.graph.getView().getState(t);null!=i&&(this.currentColor=null!=e?e:this.validColor,this.markedState=i,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(t){return!0},mxCellMarker.prototype.getMarkerColor=function(t,e,i){return i?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(t){var e=this.graph.getView(),i=this.getCell(t),n=this.getStateToMark(e.getState(i));return null!=n&&this.intersects(n,t)?n:null},mxCellMarker.prototype.getCell=function(t){return t.getCell()},mxCellMarker.prototype.getStateToMark=function(t){return t},mxCellMarker.prototype.intersects=function(t,e){return!this.hotspotEnabled||mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},__mxOutput.mxCellMarker=void 0!==mxCellMarker?mxCellMarker:void 0,mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(t){this.enabled=t},mxSelectionCellsHandler.prototype.getHandler=function(t){return this.handlers.get(t)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit((function(t,e){e.reset.apply(e)}))},mxSelectionCellsHandler.prototype.refresh=function(){var t=this.handlers;this.handlers=new mxDictionary;for(var e=this.graph.getSelectionCells(),i=0;ithis.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(e,s),null!=this.first){var o=null,l=s;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(o=this.constraintHandler.currentConstraint,l=this.constraintHandler.currentPoint.clone()):null!=this.previous&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&(Math.abs(this.previous.getCenterX()-s.x)0?this.waypoints[0]:l;null!=(m=this.getSourcePerimeterPoint(this.previous,c,e))&&(a=m)}}if(null==this.currentState&&this.movePreviewAway){var m=a;if(null!=this.edgeState&&this.edgeState.absolutePoints.length>=2){var g=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];null!=g&&(m=g)}var x=l.x-m.x,f=l.y-m.y,y=Math.sqrt(x*x+f*f);if(0==y)return;this.originalPoint=l.clone(),l.x-=4*x/y,l.y-=4*f/y}else this.originalPoint=null;if(null==this.shape){x=Math.abs(e.getGraphX()-this.first.x),f=Math.abs(e.getGraphY()-this.first.y);(x>this.graph.tolerance||f>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(e,s))}if(null!=this.shape){if(null!=this.edgeState)this.shape.points=this.edgeState.absolutePoints;else{var v=[a];null!=this.waypoints&&(v=v.concat(this.waypoints)),v.push(l),this.shape.points=v}this.drawPreview()}null!=this.cursor&&(this.graph.container.style.cursor=this.cursor),mxEvent.consume(e.getEvent()),e.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),e.consume())),this.previous=this.currentState):this.previous!=this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||e.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(var C=!1,E=e.getSource(),S=0;S0?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),o=r(n.getPerimeterBounds(t),this.edgeState,s,!1);null!=o&&(i=o)}else i=new mxPoint(t.getCenterX(),t.getCenterY());return i},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,i){var n=null,r=t.view,s=r.getPerimeterFunction(t),o=new mxPoint(t.getCenterX(),t.getCenterY());if(null!=s){var l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),a=-l*(Math.PI/180);0!=l&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(a),Math.sin(a),o));var h=s(r.getPerimeterBounds(t),t,e,!1);null!=h&&(0!=l&&(h=mxUtils.getRotatedPoint(new mxPoint(h.x,h.y),Math.cos(-a),Math.sin(-a),o)),n=h)}else n=o;return n},mxConnectionHandler.prototype.updateIcons=function(t,e,i){},mxConnectionHandler.prototype.isStopEvent=function(t){return null!=t.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),i=Math.abs(e.x-this.first.x),n=Math.abs(e.y-this.first.y);if(null!=this.waypoints||this.mouseDownCounter>1&&(i>this.graph.tolerance||n>this.graph.tolerance)){null==this.waypoints&&(this.waypoints=[]);var r=this.graph.view.scale;e=new mxPoint(this.graph.snap(t.getGraphX()/r)*r,this.graph.snap(t.getGraphY()/r)*r);this.waypoints.push(e)}},mxConnectionHandler.prototype.checkConstraints=function(t,e){return null==t||null==e||null==t.point||null==e.point||!t.point.equals(e.point)||t.dx!=e.dx||t.dy!=e.dy||t.perimeter!=e.perimeter},mxConnectionHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(e))return this.addWaypointForEvent(e),void e.consume();var i=this.sourceConstraint,n=this.constraintHandler.currentConstraint,r=null!=this.previous?this.previous.cell:null,s=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(s=this.constraintHandler.currentFocus.cell),null==s&&null!=this.currentState&&(s=this.currentState.cell),null!=this.error||null!=r&&null!=s&&r==s&&!this.checkConstraints(i,n)?(null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,e.getEvent()),null!=this.error&&this.error.length>0&&this.graph.validationAlert(this.error)):this.connect(r,s,e.getEvent(),e.getCell()),this.destroyIcons(),e.consume()}null!=this.first&&this.reset()},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.cursor&&null!=this.graph.container&&(this.graph.container.style.cursor=""),this.destroyIcons(),this.marker.reset(),this.constraintHandler.reset(),this.originalPoint=null,this.currentPoint=null,this.edgeState=null,this.previous=null,this.error=null,this.sourceConstraint=null,this.mouseDownCounter=0,this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(null==this.error),this.shape.redraw()},mxConnectionHandler.prototype.updatePreview=function(t){this.shape.strokewidth=this.getEdgeWidth(t),this.shape.stroke=this.getEdgeColor(t)},mxConnectionHandler.prototype.getEdgeColor=function(t){return t?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(t){return t?3:1},mxConnectionHandler.prototype.connect=function(t,e,i,n){if(null!=e||this.isCreateTarget(i)||this.graph.allowDanglingEdges){var r=this.graph.getModel(),s=!1,o=null;r.beginUpdate();try{if(null!=t&&null==e&&!this.graph.isIgnoreTerminalEvent(i)&&this.isCreateTarget(i)&&null!=(e=this.createTargetVertex(i,t))){if(n=this.graph.getDropTarget([e],i,n),s=!0,null!=n&&this.graph.getModel().isEdge(n))n=this.graph.getDefaultParent();else{var l=this.graph.getView().getState(n);if(null!=l)(p=r.getGeometry(e)).x-=l.origin.x,p.y-=l.origin.y}this.graph.addCell(e,n)}var a=this.graph.getDefaultParent();null!=t&&null!=e&&r.getParent(t)==r.getParent(e)&&r.getParent(r.getParent(t))!=r.getRoot()&&(a=r.getParent(t),null!=t.geometry&&t.geometry.relative&&null!=e.geometry&&e.geometry.relative&&(a=r.getParent(a)));var h=null,u=null;if(null!=this.edgeState&&(h=this.edgeState.cell.value,u=this.edgeState.cell.style),null!=(o=this.insertEdge(a,null,h,t,e,u))){this.graph.setConnectionConstraint(o,t,!0,this.sourceConstraint),this.graph.setConnectionConstraint(o,e,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&r.setGeometry(o,this.edgeState.cell.geometry);a=r.getParent(t);if(this.isInsertBefore(o,t,e,i,n)){for(var p=t;null!=p.parent&&null!=p.geometry&&p.geometry.relative&&p.parent!=o.parent;)p=this.graph.model.getParent(p);null!=p&&null!=p.parent&&p.parent==o.parent&&r.add(a,o,p.parent.getIndex(p))}var d=r.getGeometry(o);if(null==d&&((d=new mxGeometry).relative=!0,r.setGeometry(o,d)),null!=this.waypoints&&this.waypoints.length>0){var c=this.graph.view.scale,m=this.graph.view.translate;d.points=[];for(var g=0;g0){var a=this.graph.view.getState(e);if(null!=a){var h=a.x/s-r.x,u=a.y/s-r.y;Math.abs(h-i.x)<=l&&(i.x=Math.round(h)),Math.abs(u-i.y)<=l&&(i.y=Math.round(u))}}}return n},mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(t,e,i,n){var r=null;if(null!=this.factoryMethod&&(r=this.factoryMethod(e,i,n)),null==r){(r=new mxCell(t||"")).setEdge(!0),r.setStyle(n);var s=new mxGeometry;s.relative=!0,r.setGeometry(s)}return r},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null),null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)},__mxOutput.mxConnectionHandler=void 0!==mxConnectionHandler?mxConnectionHandler:void 0,mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(t){this.enabled=t},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var t=0;ta||Math.abs(l)>a)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(r,s),e.consume())}},mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv);var t=this.sharedDiv;return mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut&&(this.sharedDiv=null),t},mxRubberband.prototype.isActive=function(t,e){return null!=this.div&&"none"!=this.div.style.display},mxRubberband.prototype.mouseUp=function(t,e){var i=this.isActive();this.reset(),i&&(this.execute(e.getEvent()),e.consume())},mxRubberband.prototype.execute=function(t){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(e,t)},mxRubberband.prototype.reset=function(){if(null!=this.div)if(mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut){var t=this.div;mxUtils.setPrefixedStyle(t.style,"transition","all 0.2s linear"),t.style.pointerEvents="none",t.style.opacity=0,window.setTimeout((function(){t.parentNode.removeChild(t)}),200)}else this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler),this.dragHandler=null,this.dropHandler=null,this.currentX=0,this.currentY=0,this.first=null,this.div=null},mxRubberband.prototype.update=function(t,e){this.currentX=t,this.currentY=e,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var t=this.currentX-this.graph.panDx,e=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,t),this.y=Math.min(this.first.y,e),this.width=Math.max(this.first.x,t)-this.x,this.height=Math.max(this.first.y,e)-this.y;var i=mxClient.IS_VML?this.graph.panDx:0,n=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+i+"px",this.div.style.top=this.y+n+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},__mxOutput.mxRubberband=void 0!==mxRubberband?mxRubberband:void 0,mxHandle.prototype.cursor="default",mxHandle.prototype.image=null,mxHandle.prototype.ignoreGrid=!1,mxHandle.prototype.getPosition=function(t){},mxHandle.prototype.setPosition=function(t,e,i){},mxHandle.prototype.execute=function(){},mxHandle.prototype.copyStyle=function(t){this.graph.setCellStyles(t,this.state.style[t],[this.state.cell])},mxHandle.prototype.processEvent=function(t){var e=this.graph.view.scale,i=this.graph.view.translate,n=new mxPoint(t.getGraphX()/e-i.x,t.getGraphY()/e-i.y);null!=this.shape&&null!=this.shape.bounds&&(n.x-=this.shape.bounds.width/e/4,n.y-=this.shape.bounds.height/e/4);var r=-mxUtils.toRadians(this.getRotation()),s=-mxUtils.toRadians(this.getTotalRotation())-r;n=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(n,r),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),s)),this.setPosition(this.state.getPaintBounds(),n,t),this.positionChanged(),this.redraw()},mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state),null!=this.state.shape&&this.state.shape.apply(this.state),this.graph.cellRenderer.redraw(this.state,!0)},mxHandle.prototype.getRotation=function(){return null!=this.state.shape?this.state.shape.getRotation():0},mxHandle.prototype.getTotalRotation=function(){return null!=this.state.shape?this.state.shape.getShapeRotation():0},mxHandle.prototype.init=function(){var t=this.isHtmlRequired();null!=this.image?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):this.shape=this.createShape(t),this.initShape(t)},mxHandle.prototype.createShape=function(t){return new mxRectangleShape(new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxHandle.prototype.initShape=function(t){t&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,null!=this.cursor&&this.shape.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state),this.shape.node.style.cursor=this.cursor},mxHandle.prototype.redraw=function(){if(null!=this.shape&&null!=this.state.shape){var t=this.getPosition(this.state.getPaintBounds());if(null!=t){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var i=this.graph.view.scale,n=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+n.x)*i-this.shape.bounds.width/2),this.shape.bounds.y=Math.floor((t.y+n.y)*i-this.shape.bounds.height/2),this.shape.redraw()}}},mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container},mxHandle.prototype.rotatePoint=function(t,e){var i=this.state.getCellBounds(),n=new mxPoint(i.getCenterX(),i.getCenterY()),r=Math.cos(e),s=Math.sin(e);return mxUtils.getRotatedPoint(t,r,s,n)},mxHandle.prototype.flipPoint=function(t){if(null!=this.state.shape){var e=this.state.getCellBounds();this.state.shape.flipH&&(t.x=2*e.x+e.width-t.x),this.state.shape.flipV&&(t.y=2*e.y+e.height-t.y)}return t},mxHandle.prototype.snapPoint=function(t,e){return e||(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t},mxHandle.prototype.setVisible=function(t){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=t?"":"none")},mxHandle.prototype.reset=function(){this.setVisible(!0),this.state.style=this.graph.getCellStyle(this.state.cell),this.positionChanged()},mxHandle.prototype.destroy=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxHandle=void 0!==mxHandle?mxHandle:void 0,mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.parentHighlightEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.rotationCursor="crosshair",mxVertexHandler.prototype.livePreview=!1,mxVertexHandler.prototype.manageSizers=!1,mxVertexHandler.prototype.constrainGroupByChildren=!1,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxVertexHandler.prototype.horizontalOffset=0,mxVertexHandler.prototype.verticalOffset=0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.selectionBorder.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),this.graph.isCellMovable(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()=2&&this.state.height>=2){var e=0;t&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",e++)),this.sizers.push(this.createSizer("n-resize",e++)),this.sizers.push(this.createSizer("ne-resize",e++)),this.sizers.push(this.createSizer("w-resize",e++)),this.sizers.push(this.createSizer("e-resize",e++)),this.sizers.push(this.createSizer("sw-resize",e++)),this.sizers.push(this.createSizer("s-resize",e++))),this.sizers.push(this.createSizer("se-resize",e++)));var i=this.graph.model.getGeometry(this.state.cell);null==i||i.relative||this.graph.isSwimlane(this.state.cell)||!this.graph.isLabelMovable(this.state.cell)||(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.isRotationHandleVisible()&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.customHandles=this.createCustomHandles(),this.redraw(),this.constrainGroupByChildren&&this.updateMinBounds()},mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()=2&&this.state.height>=2},mxVertexHandler.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t.getEvent())||"fixed"==this.state.style[mxConstants.STYLE_ASPECT]},mxVertexHandler.prototype.isCenteredEvent=function(t,e){return!1},mxVertexHandler.prototype.createCustomHandles=function(){return null},mxVertexHandler.prototype.updateMinBounds=function(){var t=this.graph.getChildCells(this.state.cell);if(t.length>0&&(this.minBounds=this.graph.view.getBounds(t),null!=this.minBounds)){var e=this.state.view.scale,i=this.state.view.translate;this.minBounds.x-=this.state.x,this.minBounds.y-=this.state.y,this.minBounds.x/=e,this.minBounds.y/=e,this.minBounds.width/=e,this.minBounds.height/=e,this.x0=this.state.x/e-i.x,this.y0=this.state.y/e-i.y}},mxVertexHandler.prototype.getSelectionBounds=function(t){return new mxRectangle(Math.round(t.x),Math.round(t.y),Math.round(t.width),Math.round(t.height))},mxVertexHandler.prototype.createParentHighlightShape=function(t){return this.createSelectionShape(t)},mxVertexHandler.prototype.createSelectionShape=function(t){var e=new mxRectangleShape(t,null,this.getSelectionColor());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(t,e,i,n){var r=new mxRectangle(0,0,i=i||mxConstants.HANDLE_SIZE,i),s=this.createSizerShape(r,e,n);return s.isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(s.bounds.height-=1,s.bounds.width-=1,s.dialect=mxConstants.DIALECT_STRICTHTML,s.init(this.graph.container)):(s.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(s.node,this.graph,this.state),this.graph.isEnabled()&&s.setCursor(t),this.isSizerVisible(e)||(s.visible=!1),s},mxVertexHandler.prototype.isSizerVisible=function(t){return!0},mxVertexHandler.prototype.createSizerShape=function(t,e,i){if(null!=this.handleImage){var n=new mxImageShape(t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height),this.handleImage.src);return n.preserveImageAspect=!1,n}return e==mxEvent.ROTATION_HANDLE?new mxEllipse(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(t,e,i){null!=t&&(t.bounds.x=Math.floor(e-t.bounds.width/2),t.bounds.y=Math.floor(i-t.bounds.height/2),null!=t.node&&"none"!=t.node.style.display&&t.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(t){var e=mxEvent.isMouseEvent(t.getEvent())?1:this.tolerance,i=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null;function n(e){return null!=e&&(t.isSource(e)||null!=i&&mxUtils.intersects(e.bounds,i)&&"none"!=e.node.style.display&&"hidden"!=e.node.style.visibility)}if(null!=this.customHandles&&this.isCustomHandleEvent(t))for(var r=this.customHandles.length-1;r>=0;r--)if(n(this.customHandles[r].shape))return mxEvent.CUSTOM_HANDLE-r;if(n(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(n(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(r=0;r0||e.getState()==this.state)){var n=this.getHandleForEvent(e);null!=n&&(this.start(e.getGraphX(),e.getGraphY(),n),e.consume())}},mxVertexHandler.prototype.isLivePreviewBorder=function(){return null!=this.state.shape&&null==this.state.shape.fill&&null==this.state.shape.stroke},mxVertexHandler.prototype.start=function(t,e,i){if(null!=this.selectionBorder){this.livePreviewActive=this.livePreview&&0==this.graph.model.getChildCount(this.state.cell),this.inTolerance=!0,this.childOffsetX=0,this.childOffsetY=0,this.index=i,this.startX=t,this.startY=e;var n=this.state.view.graph.model,r=n.getParent(this.state.cell);if(this.state.view.currentRoot!=r&&(n.isVertex(r)||n.isEdge(r))&&(this.parentState=this.state.view.graph.view.getState(r)),this.selectionBorder.node.style.display=i==mxEvent.ROTATION_HANDLE?"inline":"none",this.livePreviewActive&&!this.isLivePreviewBorder()||(this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))),i==mxEvent.ROTATION_HANDLE){var s=this.getRotationHandlePosition(),o=s.x-this.state.getCenterX(),l=s.y-this.state.getCenterY();this.startAngle=0!=o?180*Math.atan(l/o)/Math.PI+90:l<0?180:0,this.startDist=Math.sqrt(o*o+l*l)}if(this.livePreviewActive){this.hideSizers(),i==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":i==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":null!=this.sizers&&null!=this.sizers[i]?this.sizers[i].node.style.display="":i<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-i].setVisible(!0);var a=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var h=0;hthis.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxVertexHandler.prototype.updateHint=function(t){},mxVertexHandler.prototype.removeHint=function(){},mxVertexHandler.prototype.roundAngle=function(t){return Math.round(10*t)/10},mxVertexHandler.prototype.roundLength=function(t){return Math.round(100*t)/100},mxVertexHandler.prototype.mouseMove=function(t,e){e.isConsumed()||null==this.index?this.graph.isMouseDown||null==this.getHandleForEvent(e)||e.consume(!1):(this.checkTolerance(e),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(e):this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(e):this.resizeVertex(e),this.updateHint(e)),e.consume())},mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.graph.view.translate,n=this.graph.view.scale;this.graph.isGridEnabledEvent(t.getEvent())&&(e.x=(this.graph.snap(e.x/n-i.x)+i.x)*n,e.y=(this.graph.snap(e.y/n-i.y)+i.y)*n);var r=null!=this.rotationShape?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[r],e.x,e.y)},mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.state.x+this.state.width/2-e.x,n=this.state.y+this.state.height/2-e.y;if(this.currentAlpha=0!=i?180*Math.atan(n/i)/Math.PI+90:n<0?180:0,i>0&&(this.currentAlpha-=180),this.currentAlpha-=this.startAngle,this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){i=e.x-this.state.getCenterX(),n=e.y-this.state.getCenterY();var r=Math.sqrt(i*i+n*n);r-this.startDist<2?raster=15:r-this.startDist<25?raster=5:raster=1,this.currentAlpha=Math.round(this.currentAlpha/raster)*raster}else this.currentAlpha=this.roundAngle(this.currentAlpha);this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw(),this.livePreviewActive&&this.redrawHandles()},mxVertexHandler.prototype.resizeVertex=function(t){var e=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),n=new mxPoint(t.getGraphX(),t.getGraphY()),r=this.graph.view.translate,s=this.graph.view.scale,o=Math.cos(-i),l=Math.sin(-i),a=l*(m=n.x-this.startX)+o*(g=n.y-this.startY);m=o*m-l*g,g=a;var h=this.graph.getCellGeometry(this.state.cell);if(this.unscaledBounds=this.union(h,m/s,g/s,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t)),!h.relative){var u=this.graph.getMaximumGraphBounds();if(null!=u&&null!=this.parentState&&((u=mxRectangle.fromRectangle(u)).x-=(this.parentState.x-r.x*s)/s,u.y-=(this.parentState.y-r.y*s)/s),this.graph.isConstrainChild(this.state.cell)){var p=this.graph.getCellContainmentArea(this.state.cell);if(null!=p){var d=this.graph.getOverlap(this.state.cell);d>0&&((p=mxRectangle.fromRectangle(p)).x-=p.width*d,p.y-=p.height*d,p.width+=2*p.width*d,p.height+=2*p.height*d),null==u?u=p:(u=mxRectangle.fromRectangle(u)).intersect(p)}}null!=u&&(this.unscaledBounds.xu.x+u.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-u.x-u.width),this.unscaledBounds.y+this.unscaledBounds.height>u.y+u.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-u.y-u.height))}var c=this.bounds;this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:r.x*s)+this.unscaledBounds.x*s,(null!=this.parentState?this.parentState.y:r.y*s)+this.unscaledBounds.y*s,this.unscaledBounds.width*s,this.unscaledBounds.height*s),h.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y),o=Math.cos(i),l=Math.sin(i);var m,g,x=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY()),f=o*(m=x.x-e.x)-l*(g=x.y-e.y)-m,y=l*m+o*g-g,v=this.bounds.x-this.state.x,C=this.bounds.y-this.state.y,E=o*v-l*C,S=l*v+o*C;this.bounds.x+=f,this.bounds.y+=y,this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+f/s),this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+y/s),this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width),this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height),this.graph.isCellCollapsed(this.state.cell)||0==f&&0==y?(this.childOffsetX=0,this.childOffsetY=0):(this.childOffsetX=this.state.x-this.bounds.x+E,this.childOffsetY=this.state.y-this.bounds.y+S),c.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(t),null!=this.preview&&this.drawPreview())},mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale,i=this.graph.view.translate,n=this.state.clone();this.state.x=this.bounds.x,this.state.y=this.bounds.y,this.state.origin=new mxPoint(this.state.x/e-i.x,this.state.y/e-i.y),this.state.width=this.bounds.width,this.state.height=this.bounds.height;var r=this.state.absoluteOffset;r=new mxPoint(r.x,r.y),this.state.absoluteOffset.x=0,this.state.absoluteOffset.y=0;var s=this.graph.getCellGeometry(this.state.cell);if(null!=s){var o=s.offset||this.EMPTY_POINT;null==o||s.relative||(this.state.absoluteOffset.x=this.state.view.scale*o.x,this.state.absoluteOffset.y=this.state.view.scale*o.y),this.state.view.updateVertexLabelOffset(this.state)}this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate(),this.redrawHandles(),null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="hidden"),this.state.setState(n)},mxVertexHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.state){var i=new mxPoint(e.getGraphX(),e.getGraphY()),n=this.index;this.index=null,this.graph.getModel().beginUpdate();try{if(n<=mxEvent.CUSTOM_HANDLE)null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-n].active=!1,this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute());else if(n==mxEvent.ROTATION_HANDLE)if(null!=this.currentAlpha){var r=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);0!=r&&this.rotateCell(this.state.cell,r)}else this.rotateClick();else{var s=this.graph.isGridEnabledEvent(e.getEvent()),o=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-o),a=Math.sin(-o),h=i.x-this.startX,u=i.y-this.startY,p=a*h+l*u;h=l*h-a*u,u=p;var d=this.graph.view.scale,c=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(h/d),this.roundLength(u/d),n,s,this.isConstrainedEvent(e),c)}}finally{this.graph.getModel().endUpdate()}e.consume(),this.reset()}},mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveResize(this.state)},mxVertexHandler.prototype.rotateClick=function(){},mxVertexHandler.prototype.rotateCell=function(t,e,i){if(0!=e){var n=this.graph.getModel();if(n.isVertex(t)||n.isEdge(t)){if(!n.isEdge(t)){var r=this.graph.view.getState(t),s=null!=r?r.style:this.graph.getCellStyle(t);if(null!=s){var o=(s[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,o,[t])}}var l=this.graph.getCellGeometry(t);if(null!=l){var a=this.graph.getCellGeometry(i);if(null==a||n.isEdge(i)||((l=l.clone()).rotate(e,new mxPoint(a.width/2,a.height/2)),n.setGeometry(t,l)),n.isVertex(t)&&!l.relative||n.isEdge(t))for(var h=n.getChildCount(t),u=0;u4?(f+=i,f=r?this.graph.snap(f/s)*s:Math.round(f/s)*s):n<3&&(x+=i,x=r?this.graph.snap(x/s)*s:Math.round(x/s)*s),0==n||3==n||5==n?(m+=e,m=r?this.graph.snap(m/s)*s:Math.round(m/s)*s):2!=n&&4!=n&&7!=n||(g+=e,g=r?this.graph.snap(g/s)*s:Math.round(g/s)*s);var C=g-m,E=f-x;if(l){var S=this.graph.getCellGeometry(this.state.cell);if(null!=S){var b=S.width/S.height;1==n||2==n||7==n||6==n?C=E*b:E=C/b,0==n&&(m=g-C,x=f-E)}}if(a){var T=y-(m+(C+=C-d)/2),w=v-(x+(E+=E-c)/2);m+=T,x+=w,g+=T,f+=w}C<0&&(m+=C,C=Math.abs(C)),E<0&&(x+=E,E=Math.abs(E));var L=new mxRectangle(m+o.x*s,x+o.y*s,C,E);return null!=this.minBounds&&(L.width=Math.max(L.width,this.minBounds.x*s+this.minBounds.width*s+Math.max(0,this.x0*s-L.x)),L.height=Math.max(L.height,this.minBounds.y*s+this.minBounds.height*s+Math.max(0,this.y0*s-L.y))),L},mxVertexHandler.prototype.redraw=function(t){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview(),t||this.redrawHandles()},mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance;return null!=this.sizers&&this.sizers.length>0&&null!=this.sizers[0]&&(this.bounds.width<2*this.sizers[0].bounds.width+2*e||this.bounds.height<2*this.sizers[0].bounds.height+2*e)&&(e/=2,t.x=this.sizers[0].bounds.width+e,t.y=this.sizers[0].bounds.height+e),t},mxVertexHandler.prototype.redrawHandles=function(){var t=this.tolerance;this.horizontalOffset=0,this.verticalOffset=0;var e=this.bounds;if(null!=this.sizers&&this.sizers.length>0&&null!=this.sizers[0]){if(null==this.index&&this.manageSizers&&this.sizers.length>=8){var i=this.getHandlePadding();this.horizontalOffset=i.x,this.verticalOffset=i.y,0==this.horizontalOffset&&0==this.verticalOffset||((e=new mxRectangle(e.x,e.y,e.width,e.height)).x-=this.horizontalOffset/2,e.width+=this.horizontalOffset,e.y-=this.verticalOffset/2,e.height+=this.verticalOffset),this.sizers.length>=8&&(e.width<2*this.sizers[0].bounds.width+2*t||e.height<2*this.sizers[0].bounds.height+2*t?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))}var n=e.x+e.width,r=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],n,r);else{var s=e.x+e.width/2,o=e.y+e.height/2;if(this.sizers.length>=8){var l=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"],a=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),h=Math.cos(a),u=Math.sin(a),p=Math.round(4*a/Math.PI),d=new mxPoint(e.getCenterX(),e.getCenterY()),c=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),h,u,d);this.moveSizerTo(this.sizers[0],c.x,c.y),this.sizers[0].setCursor(l[mxUtils.mod(0+p,l.length)]),c.x=s,c.y=e.y,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[1],c.x,c.y),this.sizers[1].setCursor(l[mxUtils.mod(1+p,l.length)]),c.x=n,c.y=e.y,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[2],c.x,c.y),this.sizers[2].setCursor(l[mxUtils.mod(2+p,l.length)]),c.x=e.x,c.y=o,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[3],c.x,c.y),this.sizers[3].setCursor(l[mxUtils.mod(7+p,l.length)]),c.x=n,c.y=o,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[4],c.x,c.y),this.sizers[4].setCursor(l[mxUtils.mod(3+p,l.length)]),c.x=e.x,c.y=r,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[5],c.x,c.y),this.sizers[5].setCursor(l[mxUtils.mod(6+p,l.length)]),c.x=s,c.y=r,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[6],c.x,c.y),this.sizers[6].setCursor(l[mxUtils.mod(5+p,l.length)]),c.x=n,c.y=r,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[7],c.x,c.y),this.sizers[7].setCursor(l[mxUtils.mod(4+p,l.length)]),c.x=s+this.state.absoluteOffset.x,c.y=o+this.state.absoluteOffset.y,c=mxUtils.getRotatedPoint(c,h,u,d),this.moveSizerTo(this.sizers[8],c.x,c.y)}else this.state.width>=2&&this.state.height>=2?this.moveSizerTo(this.sizers[0],s+this.state.absoluteOffset.x,o+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}if(null!=this.rotationShape){a=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),h=Math.cos(a),u=Math.sin(a),d=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),c=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),h,u,d);null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,c.x,c.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()?"hidden":"")}if(null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.edgeHandlers)for(var m=0;m0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null,n=null,r=null;function s(e){if(null!=e&&null!=e.node&&"none"!=e.node.style.display&&"hidden"!=e.node.style.visibility&&(t.isSource(e)||null!=i&&mxUtils.intersects(e.bounds,i))){var r=t.getGraphX()-e.bounds.getCenterX(),s=t.getGraphY()-e.bounds.getCenterY(),o=r*r+s*s;if(null==n||o<=n)return n=o,!0}return!1}if(null!=this.customHandles&&this.isCustomHandleEvent(t))for(var o=this.customHandles.length-1;o>=0;o--)if(s(this.customHandles[o].shape))return mxEvent.CUSTOM_HANDLE-o;if((t.isSource(this.state.text)||s(this.labelShape))&&(r=mxEvent.LABEL_HANDLE),null!=this.bends)for(o=0;omxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(var s=0;s0&&this.isSnapToTerminalsEvent(t)){function l(t){if(null!=t){var e=t.x;Math.abs(n.x-e)0&&imxEvent.VIRTUAL_HANDLE&&(s[this.index-1]=o)}return null!=l?l:s},mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),i=t.getEvent(),n=mxEvent.getClientX(i),r=mxEvent.getClientY(i),s=document.documentElement,o=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),l=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),a=this.currentPoint.x-this.graph.container.scrollLeft+e.x-o,h=this.currentPoint.y-this.graph.container.scrollTop+e.y-l;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&null!=t.getState()||this.marker.highlight.isHighlightAt(n,r)||(a!=n||h!=r)&&null==t.getState()&&this.marker.highlight.isHighlightAt(a,h))},mxEdgeHandler.prototype.updatePreviewState=function(t,e,i,n,r){var s=this.isSource?i:this.state.getVisibleTerminalState(!0),o=this.isTarget?i:this.state.getVisibleTerminalState(!1),l=this.graph.getConnectionConstraint(t,s,!0),a=this.graph.getConnectionConstraint(t,o,!1),h=this.constraintHandler.currentConstraint;if(null==h&&r&&(null!=i?(n.isSource(this.marker.highlight.shape)&&(e=new mxPoint(n.getGraphX(),n.getGraphY())),h=this.graph.getOutlineConstraint(e,i,n),this.constraintHandler.setFocus(n,i,this.isSource),this.constraintHandler.currentConstraint=h,this.constraintHandler.currentPoint=e):h=new mxConnectionConstraint),this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var u=this.graph.view.scale;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=r?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/u/u,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.marker.getValidState()==n.getState()?mxConstants.DEFAULT_VALID_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/u/u,this.marker.highlight.repaint())}this.isSource?l=h:this.isTarget&&(a=h),(this.isSource||this.isTarget)&&(null!=h&&null!=h.point?(t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=h.point.x,t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=h.point.y):(delete t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y])),t.setVisibleTerminalState(s,!0),t.setVisibleTerminalState(o,!1),this.isSource&&null==s||t.view.updateFixedTerminalPoint(t,s,!0,l),this.isTarget&&null==o||t.view.updateFixedTerminalPoint(t,o,!1,a),(this.isSource||this.isTarget)&&null==i&&(t.setAbsoluteTerminalPoint(e,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),t.view.updatePoints(t,this.points,s,o),t.view.updateFloatingTerminalPoints(t,s,o)},mxEdgeHandler.prototype.mouseMove=function(t,e){if(null!=this.index&&null!=this.marker){if(this.currentPoint=this.getPointForEvent(e),this.error=null,!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&null!=this.snapPoint&&(Math.abs(this.snapPoint.x-this.currentPoint.x)mxEvent.VIRTUAL_HANDLE)null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e);else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,e);var i=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint)this.currentPoint=this.constraintHandler.currentPoint.clone();else if(this.outlineConnect){var n=!(!this.isSource&&!this.isTarget)&&this.isOutlineConnectEvent(e);n?i=this.marker.highlight.state:null!=i&&i!=e.getState()&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),i=null)}null==i||this.isCellEnabled(i.cell)||(i=null,this.marker.reset());var r=this.clonePreviewState(this.currentPoint,null!=i?i.cell:null);this.updatePreviewState(r,this.currentPoint,i,e,n);var s=null==this.error?this.marker.validColor:this.marker.invalidColor;this.setPreviewColor(s),this.abspoints=r.absolutePoints,this.active=!0}this.updateHint(e,this.currentPoint),this.drawPreview(),mxEvent.consume(e.getEvent()),e.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(e)&&e.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.marker){var i=this.state.cell,n=this.index;if(this.index=null,e.getX()!=this.startX||e.getY()!=this.startY){var r=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(null!=this.error)this.error.length>0&&this.graph.validationAlert(this.error);else if(n<=mxEvent.CUSTOM_HANDLE&&n>mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){(o=this.graph.getModel()).beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute()}finally{o.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var s=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(s=this.constraintHandler.currentFocus.cell),null==s&&this.marker.hasValidState()&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&&"white"!=this.marker.highlight.shape.stroke&&(s=this.marker.validState.cell),null!=s){var o,l=(o=this.graph.getModel()).getParent(i);o.beginUpdate();try{if(r){var a=o.getGeometry(i);r=this.graph.cloneCell(i);o.add(l,r,o.getChildCount(l)),null!=a&&(a=a.clone(),o.setGeometry(r,a));var h=o.getTerminal(i,!this.isSource);this.graph.connectCell(r,h,!this.isSource),i=r}i=this.connect(i,s,this.isSource,r,e)}finally{o.endUpdate()}}else if(this.graph.isAllowDanglingEdges()){var u=this.abspoints[this.isSource?0:this.abspoints.length-1];u.x=this.roundLength(u.x/this.graph.view.scale-this.graph.view.translate.x),u.y=this.roundLength(u.y/this.graph.view.scale-this.graph.view.translate.y);var p=this.graph.getView().getState(this.graph.getModel().getParent(i));null!=p&&(u.x-=p.origin.x,u.y-=p.origin.y),u.x-=this.graph.panDx/this.graph.view.scale,u.y-=this.graph.panDy/this.graph.view.scale,i=this.changeTerminalPoint(i,u,this.isSource,r)}}else this.active?i=this.changePoints(i,this.points,r):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}null!=this.marker&&(this.reset(),i!=this.state.cell&&this.graph.setSelectionCell(i)),e.consume()}},mxEdgeHandler.prototype.reset=function(){if(this.active&&this.refresh(),this.error=null,this.index=null,this.label=null,this.points=null,this.snapPoint=null,this.isLabel=!1,this.isSource=!1,this.isTarget=!1,this.active=!1,this.livePreview&&null!=this.sizers)for(var t=0;t0&&e0&&null!=i){null==this.points&&(this.points=[]);for(var n=1;n0&&this.graph.isLabelMovable(t),null!=this.bends&&this.bends.length>0){var n=this.abspoints.length-1,r=this.abspoints[0],s=r.x,o=r.y;e=this.bends[0].bounds,this.bends[0].bounds=new mxRectangle(Math.floor(s-e.width/2),Math.floor(o-e.height/2),e.width,e.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);var l=this.abspoints[n],a=l.x,h=l.y,u=this.bends.length-1;e=this.bends[u].bounds,this.bends[u].bounds=new mxRectangle(Math.floor(a-e.width/2),Math.floor(h-e.height/2),e.width,e.height),this.bends[u].fill=this.getHandleFillColor(u),this.bends[u].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[u].bounds),this.redrawInnerBends(r,l)}if(null!=this.abspoints&&null!=this.virtualBends&&this.virtualBends.length>0)for(var p=this.abspoints[0],d=0;d1?(t=n[1],e=n[n.length-2]):null!=i.points&&i.points.length>0&&(r=n[0]),r=null==r?new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2):new mxPoint(this.graph.getView().scale*(r.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(r.y+this.graph.getView().translate.y+this.state.origin.y));var s=this.bends[1].bounds,o=s.width,l=s.height,a=new mxRectangle(Math.round(r.x-o/2),Math.round(r.y-l/2),o,l);this.manageLabelHandle?this.checkLabelHandle(a):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(a,this.labelShape.bounds)&&(o=mxConstants.HANDLE_SIZE+3,l=mxConstants.HANDLE_SIZE+3,a=new mxRectangle(Math.floor(r.x-o/2),Math.floor(r.y-l/2),o,l)),this.bends[1].bounds=a,this.bends[1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)},__mxOutput.mxElbowEdgeHandler=void 0!==mxElbowEdgeHandler?mxElbowEdgeHandler:void 0,mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler),mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(null!=t){var e=Math.max(1,this.graph.view.scale);if(2==t.length||3==t.length&&(Math.abs(t[0].x-t[1].x)0){var l=this.abspoints,a=l[0],h=l[1];o=[];for(var u=2;u1){var n=!1;if(4==i.length&&0==Math.round(i[1].x-i[2].x)&&0==Math.round(i[1].y-i[2].y))if(n=!0,0==Math.round(i[0].y-i[i.length-1].y)){var r=i[0].x+(i[i.length-1].x-i[0].x)/2;i[1]=new mxPoint(r,i[1].y),i[2]=new mxPoint(r,i[2].y)}else{var s=i[0].y+(i[i.length-1].y-i[0].y)/2;i[1]=new mxPoint(i[1].x,s),i[2]=new mxPoint(i[2].x,s)}for(var o=0;o0){null==this.div&&this.init();var n=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex,this.div.style.left=e+n.x+"px",this.div.style.top=i+mxConstants.TOOLTIP_VERTICAL_OFFSET+n.y+"px",mxUtils.isNode(t)?(this.div.innerHTML="",this.div.appendChild(t)):this.div.innerHTML=t.replace(/\n/g,"
"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)},__mxOutput.mxTooltipHandler=void 0!==mxTooltipHandler?mxTooltipHandler:void 0,mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(t,e){},mxCellTracker.prototype.mouseMove=function(t,e){this.isEnabled()&&this.process(e)},mxCellTracker.prototype.mouseUp=function(t,e){},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},__mxOutput.mxCellTracker=void 0!==mxCellTracker?mxCellTracker:void 0,mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t,null!=this.shape&&(this.shape.stroke=t)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),this.keepOnTop||this.shape.node.parentNode.firstChild==this.shape.node||this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var t=this.graph.cellRenderer.createShape(this.state);return t.svgStrokeTolerance=this.graph.tolerance,t.points=this.state.absolutePoints,t.apply(this.state),t.stroke=this.highlightColor,t.opacity=this.opacity,t.isDashed=this.dashed,t.isShadow=!1,t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,this.state),this.graph.dialect!=mxConstants.DIALECT_SVG?t.pointerEvents=!1:t.svgPointerEvents="stroke",t},mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth},mxCellHighlight.prototype.repaint=function(){null!=this.state&&null!=this.shape&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),(mxClient.IS_QUIRKS||8==document.documentMode)&&("transparent"==this.shape.stroke?(this.shape.stroke="white",this.shape.opacity=1):this.shape.opacity=this.opacity),this.shape.redraw())},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(t){this.state!=t&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=t,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.isHighlightAt=function(t,e){var i=!1;if(null!=this.shape&&null!=document.elementFromPoint&&!mxClient.IS_QUIRKS)for(var n=document.elementFromPoint(t,e);null!=n;){if(n==this.shape.node){i=!0;break}n=n.parentNode}return i},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxCellHighlight=void 0!==mxCellHighlight?mxCellHighlight:void 0,mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(t,e,i){var n=mxUtils.bind(this,(function(){this.editor.execute(e)}));i?this.handler.bindControlKey(t,n):this.handler.bindKey(t,n)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},__mxOutput.mxDefaultKeyHandler=void 0!==mxDefaultKeyHandler?mxDefaultKeyHandler:void 0,mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(t,e,i,n){if(null!=this.config){var r=this.createConditions(t,i,n),s=this.config.firstChild;this.addItems(t,e,i,n,r,s,null)}},mxDefaultPopupMenu.prototype.addItems=function(t,e,i,n,r,s,o){for(var l=!1;null!=s;){if("add"==s.nodeName){var a=s.getAttribute("if");if(null==a||r[a]){var h=s.getAttribute("as");h=mxResources.get(h)||h;var u=mxUtils.eval(mxUtils.getTextContent(s)),p=s.getAttribute("action"),d=s.getAttribute("icon"),c=s.getAttribute("iconCls"),m=s.getAttribute("enabled-if"),g=null==m||r[m];l&&(e.addSeparator(o),l=!1),null!=d&&this.imageBasePath&&(d=this.imageBasePath+d);var x=this.addAction(e,t,h,d,u,p,i,o,c,g);this.addItems(t,e,i,n,r,s.firstChild,x)}}else"separator"==s.nodeName&&(l=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(t,e,i,n,r,s,o,l,a,h){return t.addItem(i,n,(function(t){"function"==typeof r&&r.call(e,e,o,t),null!=s&&e.execute(s,o,t)}),l,a,h)},mxDefaultPopupMenu.prototype.createConditions=function(t,e,i){var n=t.graph.getModel(),r=n.getChildCount(e),s=[];s.nocell=null==e,s.ncells=t.graph.getSelectionCount()>1,s.notRoot=n.getRoot()!=n.getParent(t.graph.getDefaultParent()),s.cell=null!=e;var o=null!=e&&1==t.graph.getSelectionCount();s.nonEmpty=o&&r>0,s.expandable=o&&t.graph.isCellFoldable(e,!1),s.collapsable=o&&t.graph.isCellFoldable(e,!0),s.validRoot=o&&t.graph.isValidRoot(e),s.emptyValidRoot=s.validRoot&&0==r,s.swimlane=o&&t.graph.isSwimlane(e);for(var l=this.config.getElementsByTagName("condition"),a=0;a0&&this.editor.execute(i)}));return this.toolbar.addItem(t,e,r,n)},mxDefaultToolbar.prototype.addSeparator=function(t){t=t||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(t)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(t){return this.toolbar.addActionCombo(t)},mxDefaultToolbar.prototype.addActionOption=function(t,e,i){var n=mxUtils.bind(this,(function(){this.editor.execute(i)}));this.addOption(t,e,n)},mxDefaultToolbar.prototype.addOption=function(t,e,i){return this.toolbar.addOption(t,e,i)},mxDefaultToolbar.prototype.addMode=function(t,e,i,n,r){var s=mxUtils.bind(this,(function(){this.editor.setMode(i),null!=r&&r(this.editor)}));return this.toolbar.addSwitchMode(t,e,s,n)},mxDefaultToolbar.prototype.addPrototype=function(t,e,i,n,r,s){var o=mxUtils.bind(this,(function(){return"function"==typeof i?i():null!=i?this.editor.graph.cloneCell(i):null})),l=mxUtils.bind(this,(function(t,e){"function"==typeof r?r(this.editor,o(),t,e):this.drop(o(),t,e),this.toolbar.resetMode(),mxEvent.consume(t)})),a=this.toolbar.addMode(t,e,l,n,null,s);return this.installDropHandler(a,(function(t,e,i){l(e,i)})),a},mxDefaultToolbar.prototype.drop=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(null!=i&&!r.isEdge(i)&&this.connectOnDrop&&n.isCellConnectable(i))this.connect(t,e,i);else{for(;null!=i&&!n.isValidDropTarget(i,[t],e);)i=r.getParent(i);this.insert(t,e,i)}},mxDefaultToolbar.prototype.insert=function(t,e,i){var n=this.editor.graph;if(n.canImportCell(t)){var r=mxEvent.getClientX(e),s=mxEvent.getClientY(e),o=mxUtils.convertPoint(n.container,r,s);return n.isSplitEnabled()&&n.isSplitTarget(i,[t],e)?n.splitEdge(i,[t],null,o.x,o.y):this.editor.addVertex(i,t,o.x,o.y)}return null},mxDefaultToolbar.prototype.connect=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(null!=i&&n.isCellConnectable(t)&&n.isEdgeValid(null,i,t)){var s=null;r.beginUpdate();try{var o=r.getGeometry(i),l=r.getGeometry(t).clone();l.x=o.x+(o.width-l.width)/2,l.y=o.y+(o.height-l.height)/2;var a=this.spacing*n.gridSize,h=20*r.getDirectedEdgeCount(i,!0);this.editor.horizontalFlow?l.x+=(l.width+o.width)/2+a+h:l.y+=(l.height+o.height)/2+a+h,t.setGeometry(l);var u=r.getParent(i);if(n.addCell(t,u),n.constrainChild(t),s=this.editor.createEdge(i,t),null==r.getGeometry(s)){var p=new mxGeometry;p.relative=!0,r.setGeometry(s,p)}n.addEdge(s,u,i,t)}finally{r.endUpdate()}n.setSelectionCells([t,s]),n.scrollCellToVisible(t)}},mxDefaultToolbar.prototype.installDropHandler=function(t,e){var i=document.createElement("img");i.setAttribute("src",t.getAttribute("src"));var n=mxUtils.bind(this,(function(r){i.style.width=2*t.offsetWidth+"px",i.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,e,i),mxEvent.removeListener(i,"load",n)}));mxClient.IS_IE?n():mxEvent.addListener(i,"load",n)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},__mxOutput.mxDefaultToolbar=void 0!==mxDefaultToolbar?mxDefaultToolbar:void 0,mxLoadResources?mxResources.add(mxClient.basePath+"/resources/editor"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed=" ",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(t){this.modified=t},mxEditor.prototype.addActions=function(){this.addAction("save",(function(t){t.save()})),this.addAction("print",(function(t){new mxPrintPreview(t.graph,1).open()})),this.addAction("show",(function(t){mxUtils.show(t.graph,null,10,10)})),this.addAction("exportImage",(function(t){var e=t.getUrlImage();if(null==e||mxClient.IS_LOCAL)t.execute("show");else{var i=mxUtils.getViewXml(t.graph,1),n=mxUtils.getXml(i,"\n");mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(n),document,"_blank")}})),this.addAction("refresh",(function(t){t.graph.refresh()})),this.addAction("cut",(function(t){t.graph.isEnabled()&&mxClipboard.cut(t.graph)})),this.addAction("copy",(function(t){t.graph.isEnabled()&&mxClipboard.copy(t.graph)})),this.addAction("paste",(function(t){t.graph.isEnabled()&&mxClipboard.paste(t.graph)})),this.addAction("delete",(function(t){t.graph.isEnabled()&&t.graph.removeCells()})),this.addAction("group",(function(t){t.graph.isEnabled()&&t.graph.setSelectionCell(t.groupCells())})),this.addAction("ungroup",(function(t){t.graph.isEnabled()&&t.graph.setSelectionCells(t.graph.ungroupCells())})),this.addAction("removeFromParent",(function(t){t.graph.isEnabled()&&t.graph.removeCellsFromParent()})),this.addAction("undo",(function(t){t.graph.isEnabled()&&t.undo()})),this.addAction("redo",(function(t){t.graph.isEnabled()&&t.redo()})),this.addAction("zoomIn",(function(t){t.graph.zoomIn()})),this.addAction("zoomOut",(function(t){t.graph.zoomOut()})),this.addAction("actualSize",(function(t){t.graph.zoomActual()})),this.addAction("fit",(function(t){t.graph.fit()})),this.addAction("showProperties",(function(t,e){t.showProperties(e)})),this.addAction("selectAll",(function(t){t.graph.isEnabled()&&t.graph.selectAll()})),this.addAction("selectNone",(function(t){t.graph.isEnabled()&&t.graph.clearSelection()})),this.addAction("selectVertices",(function(t){t.graph.isEnabled()&&t.graph.selectVertices()})),this.addAction("selectEdges",(function(t){t.graph.isEnabled()&&t.graph.selectEdges()})),this.addAction("edit",(function(t,e){t.graph.isEnabled()&&t.graph.isCellEditable(e)&&t.graph.startEditingAtCell(e)})),this.addAction("toBack",(function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!0)})),this.addAction("toFront",(function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!1)})),this.addAction("enterGroup",(function(t,e){t.graph.enterGroup(e)})),this.addAction("exitGroup",(function(t){t.graph.exitGroup()})),this.addAction("home",(function(t){t.graph.home()})),this.addAction("selectPrevious",(function(t){t.graph.isEnabled()&&t.graph.selectPreviousCell()})),this.addAction("selectNext",(function(t){t.graph.isEnabled()&&t.graph.selectNextCell()})),this.addAction("selectParent",(function(t){t.graph.isEnabled()&&t.graph.selectParentCell()})),this.addAction("selectChild",(function(t){t.graph.isEnabled()&&t.graph.selectChildCell()})),this.addAction("collapse",(function(t){t.graph.isEnabled()&&t.graph.foldCells(!0)})),this.addAction("collapseAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!0,!1,e)}})),this.addAction("expand",(function(t){t.graph.isEnabled()&&t.graph.foldCells(!1)})),this.addAction("expandAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!1,!1,e)}})),this.addAction("bold",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)})),this.addAction("italic",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)})),this.addAction("underline",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)})),this.addAction("alignCellsLeft",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_LEFT)})),this.addAction("alignCellsCenter",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_CENTER)})),this.addAction("alignCellsRight",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_RIGHT)})),this.addAction("alignCellsTop",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_TOP)})),this.addAction("alignCellsMiddle",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_MIDDLE)})),this.addAction("alignCellsBottom",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_BOTTOM)})),this.addAction("alignFontLeft",(function(t){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)})),this.addAction("alignFontCenter",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)})),this.addAction("alignFontRight",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)})),this.addAction("alignFontTop",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)})),this.addAction("alignFontMiddle",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)})),this.addAction("alignFontBottom",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)})),this.addAction("zoom",(function(t){var e=100*t.graph.getView().scale,i=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;isNaN(i)||t.graph.getView().setScale(i)})),this.addAction("toggleTasks",(function(t){null!=t.tasks?t.tasks.setVisible(!t.tasks.isVisible()):t.showTasks()})),this.addAction("toggleHelp",(function(t){null!=t.help?t.help.setVisible(!t.help.isVisible()):t.showHelp()})),this.addAction("toggleOutline",(function(t){null==t.outline?t.showOutline():t.outline.setVisible(!t.outline.isVisible())})),this.addAction("toggleConsole",(function(t){mxLog.setVisible(!mxLog.isVisible())}))},mxEditor.prototype.configure=function(t){null!=t&&(new mxCodec(t.ownerDocument).decode(t,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(t,e){this.actions[t]=e},mxEditor.prototype.execute=function(t,e,i){var n=this.actions[t];if(null!=n)try{var r=arguments;r[0]=this,n.apply(this,r)}catch(e){throw mxUtils.error("Cannot execute "+t+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+t,280,!0)},mxEditor.prototype.addTemplate=function(t,e){this.templates[t]=e},mxEditor.prototype.getTemplate=function(t){return this.templates[t]},mxEditor.prototype.createGraph=function(){var t=new mxGraph(null,null,this.graphRenderHint);return t.setTooltips(!0),t.setPanning(!0),this.installDblClickHandler(t),this.installUndoHandler(t),this.installDrillHandler(t),this.installChangeHandler(t),this.installInsertHandler(t),t.popupMenuHandler.factoryMethod=mxUtils.bind(this,(function(t,e,i){return this.createPopupMenu(t,e,i)})),t.connectionHandler.factoryMethod=mxUtils.bind(this,(function(t,e){return this.createEdge(t,e)})),this.createSwimlaneManager(t),this.createLayoutManager(t),t},mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,!1);return e.isHorizontal=mxUtils.bind(this,(function(){return this.horizontalFlow})),e.isEnabled=mxUtils.bind(this,(function(){return this.maintainSwimlanes})),e},mxEditor.prototype.createLayoutManager=function(t){var e=new mxLayoutManager(t),i=this;return e.getLayout=function(e){var n=null,r=i.graph.getModel();return null!=r.getParent(e)&&(i.layoutSwimlanes&&t.isSwimlane(e)?(null==i.swimlaneLayout&&(i.swimlaneLayout=i.createSwimlaneLayout()),n=i.swimlaneLayout):i.layoutDiagram&&(t.isValidRoot(e)||null==r.getParent(r.getParent(e)))&&(null==i.diagramLayout&&(i.diagramLayout=i.createDiagramLayout()),n=i.diagramLayout)),n},e},mxEditor.prototype.setGraphContainer=function(t){null==this.graph.container&&(this.graph.init(t),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(t),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.installDblClickHandler=function(t){t.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,(function(e,i){var n=i.getProperty("cell");null!=n&&t.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,n),i.consume())})))},mxEditor.prototype.installUndoHandler=function(t){var e=mxUtils.bind(this,(function(t,e){var i=e.getProperty("edit");this.undoManager.undoableEditHappened(i)}));t.getModel().addListener(mxEvent.UNDO,e),t.getView().addListener(mxEvent.UNDO,e);var i=function(e,i){var n=i.getProperty("edit").changes;t.setSelectionCells(t.getSelectionCellsForChanges(n))};this.undoManager.addListener(mxEvent.UNDO,i),this.undoManager.addListener(mxEvent.REDO,i)},mxEditor.prototype.installDrillHandler=function(t){var e=mxUtils.bind(this,(function(t){this.fireEvent(new mxEventObject(mxEvent.ROOT))}));t.getView().addListener(mxEvent.DOWN,e),t.getView().addListener(mxEvent.UP,e)},mxEditor.prototype.installChangeHandler=function(t){var e=mxUtils.bind(this,(function(e,i){this.setModified(!0),1==this.validating&&t.validateGraph();for(var n=i.getProperty("edit").changes,r=0;r "+e.convertValueToString(i)+t),i=e.getModel().getParent(i);return this.getRootTitle()+t},mxEditor.prototype.getRootTitle=function(){var t=this.graph.getModel().getRoot();return this.graph.convertValueToString(t)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var t=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){if(null!=t){var e=mxUtils.load(t).getXml();this.readGraphModel(e.documentElement),this.filename=t,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",t))}},mxEditor.prototype.readGraphModel=function(t){new mxCodec(t.ownerDocument).decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){if(null!=(t=t||this.getUrlPost())&&t.length>0){var i=this.writeGraphModel(e);this.postDiagram(t,i),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(t,e){this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,(function(i){this.fireEvent(new mxEventObject(mxEvent.POST,"request",i,"url",t,"data",e))})))},mxEditor.prototype.writeGraphModel=function(t){t=null!=t?t:this.linefeed;var e=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(e,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var i=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,i),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){if(null==(t=t||this.graph.getSelectionCell())&&null==(t=this.graph.getCurrentRoot())&&(t=this.graph.getModel().getRoot()),null!=t){this.graph.stopEditing(!0);var e=mxUtils.getOffset(this.graph.container),i=e.x+10,n=e.y;if(null==this.properties||this.movePropertiesDialog){var r=this.graph.getCellBounds(t);null!=r&&(i+=r.x+Math.min(200,r.width),n+=r.y)}else i=this.properties.getX(),n=this.properties.getY();this.hideProperties();var s=this.createProperties(t);null!=s&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,s,i,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel(),i=e.getValue(t);if(mxUtils.isNode(i)){var n=new mxForm("properties");n.addText("ID",t.getId()).setAttribute("readonly","true");var r=null,s=null,o=null,l=null,a=null;e.isVertex(t)&&null!=(r=e.getGeometry(t))&&(s=n.addText("top",r.y),o=n.addText("left",r.x),l=n.addText("width",r.width),a=n.addText("height",r.height));for(var h=e.getStyle(t),u=n.addText("Style",h||""),p=i.attributes,d=[],c=0;c0?e.setStyle(t,u.value):e.setStyle(t,null);for(var i=0;i0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){if(null!=this.cycleAttributeName){var e=this.consumeCycleAttribute(t);null!=e&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}},mxEditor.prototype.addVertex=function(t,e,i,n){for(var r=this.graph.getModel();null!=t&&!this.graph.isValidDropTarget(t);)t=r.getParent(t);t=null!=t?t:this.graph.getSwimlaneAt(i,n);var s=this.graph.getView().scale,o=r.getGeometry(e),l=r.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(null==t&&this.swimlaneRequired)return null;if(null!=t&&null!=l){var a=this.graph.getView().getState(t);if(null!=a){if(i-=a.origin.x*s,n-=a.origin.y*s,this.graph.isConstrainedMoving){var h=o.width,u=o.height,p=a.x+a.width;i+h>p&&(i-=i+h-p),n+u>(p=a.y+a.height)&&(n-=n+u-p)}}else null!=l&&(i-=l.x*s,n-=l.y*s)}}(o=o.clone()).x=this.graph.snap(i/s-this.graph.getView().translate.x-this.graph.gridSize/2),o.y=this.graph.snap(n/s-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(o),null==t&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),r.beginUpdate();try{null!=(e=this.graph.addCell(e,t))&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{r.endUpdate()}return null!=e&&(this.graph.setSelectionCell(e),this.graph.scrollCellToVisible(e),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))),e},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.status=null,this.templates=null)},__mxOutput.mxEditor=void 0!==mxEditor?mxEditor:void 0;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(null!=t){var e=t.getName();mxCodecRegistry.codecs[e]=t;var i=mxUtils.getFunctionName(t.template.constructor);i!=e&&mxCodecRegistry.addAlias(i,e)}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(null!=t){var i=mxUtils.getFunctionName(t),n=mxCodecRegistry.aliases[i];if(null!=n&&(i=n),null==(e=mxCodecRegistry.codecs[i]))try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch(t){}}return e}},codec;function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(t,e,i,n){for(var r in this.template=t,this.exclude=null!=e?e:[],this.idrefs=null!=i?i:[],this.mapping=null!=n?n:[],this.reverse=new Object,this.mapping)this.reverse[this.mapping[r]]=r}__mxOutput.mxCodecRegistry=void 0!==mxCodecRegistry?mxCodecRegistry:void 0,mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.elements=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(t,e){return this.objects[t]=e,e},mxCodec.prototype.getObject=function(t){var e=null;if(null!=t&&null==(e=this.objects[t])&&null==(e=this.lookup(t))){var i=this.getElementById(t);null!=i&&(e=this.decode(i))}return e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){return this.updateElements(),this.elements[t]},mxCodec.prototype.updateElements=function(){null==this.elements&&(this.elements=new Object,null!=this.document.documentElement&&this.addElement(this.document.documentElement))},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(null!=e)if(null==this.elements[e])this.elements[e]=t;else if(this.elements[e]!=t)throw new Error(e+": Duplicate ID")}for(t=t.firstChild;null!=t;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return null!=t&&null==(e=this.reference(t))&&t instanceof mxCell&&null==(e=t.getId())&&0==(e=mxCellPath.create(t)).length&&(e="root"),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e=null;if(null!=t&&null!=t.constructor){var i=mxCodecRegistry.getCodec(t.constructor);null!=i?e=i.encode(this,t):mxUtils.isNode(t)?e=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}return e},mxCodec.prototype.decode=function(t,e){this.updateElements();var i=null;if(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=null;try{n=window[t.nodeName]}catch(t){}var r=mxCodecRegistry.getCodec(n);null!=r?i=r.decode(this,t,e):(i=t.cloneNode(!0)).removeAttribute("as")}return i},mxCodec.prototype.encodeCell=function(t,e,i){if(e.appendChild(this.encode(t)),null==i||i)for(var n=t.getChildCount(),r=0;r=0},mxObjectCodec.prototype.isReference=function(t,e,i,n){return mxUtils.indexOf(this.idrefs,e)>=0},mxObjectCodec.prototype.encode=function(t,e){var i=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,i),this.encodeObject(t,e,i),this.afterEncode(t,e,i)},mxObjectCodec.prototype.encodeObject=function(t,e,i){for(var n in t.setAttribute(i,"id",t.getId(e)),e){var r=n,s=e[r];null==s||this.isExcluded(e,r,s,!0)||(mxUtils.isInteger(r)&&(r=null),this.encodeValue(t,e,r,s,i))}},mxObjectCodec.prototype.encodeValue=function(t,e,i,n,r){if(null!=n){if(this.isReference(e,i,n,!0)){var s=t.getId(n);if(null==s)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+i+"="+n);n=s}var o=this.template[i];(null==i||t.encodeDefaults||o!=n)&&(i=this.getAttributeName(i),this.writeAttribute(t,e,i,n,r))}},mxObjectCodec.prototype.writeAttribute=function(t,e,i,n,r){"object"!=typeof n?this.writePrimitiveAttribute(t,e,i,n,r):this.writeComplexAttribute(t,e,i,n,r)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,i,n,r){if(n=this.convertAttributeToXml(t,e,i,n,r),null==i){var s=t.document.createElement("add");"function"==typeof n?s.appendChild(t.document.createTextNode(n)):t.setAttribute(s,"value",n),r.appendChild(s)}else"function"!=typeof n&&t.setAttribute(r,i,n)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,i,n,r){var s=t.encode(n);null!=s?(null!=i&&s.setAttribute("as",i),r.appendChild(s)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+i+": "+n)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,i,n){return this.isBooleanAttribute(t,e,i,n)&&(n=1==n?"1":"0"),n},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,i,n){return void 0===n.length&&(1==n||0==n)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,i){var n=e.value;return this.isNumericAttribute(t,e,i)&&(n=parseFloat(n),!isNaN(n)&&isFinite(n)||(n=0)),n},mxObjectCodec.prototype.isNumericAttribute=function(t,e,i){return i.constructor==mxGeometry&&("x"==e.name||"y"==e.name||"width"==e.name||"height"==e.name)||i.constructor==mxPoint&&("x"==e.name||"y"==e.name)||mxUtils.isNumeric(e.value)},mxObjectCodec.prototype.beforeEncode=function(t,e,i){return e},mxObjectCodec.prototype.afterEncode=function(t,e,i){return i},mxObjectCodec.prototype.decode=function(t,e,i){var n=e.getAttribute("id"),r=t.objects[n];return null==r&&(r=i||this.cloneTemplate(),null!=n&&t.putObject(n,r)),e=this.beforeDecode(t,e,r),this.decodeNode(t,e,r),this.afterDecode(t,e,r)},mxObjectCodec.prototype.decodeNode=function(t,e,i){null!=e&&(this.decodeAttributes(t,e,i),this.decodeChildren(t,e,i))},mxObjectCodec.prototype.decodeAttributes=function(t,e,i){var n=e.attributes;if(null!=n)for(var r=0;r0&&(n=null),n},mxObjectCodec.prototype.addObjectValue=function(t,e,i,n){null!=i&&i!=n&&(null!=e&&e.length>0?t[e]=i:t.push(i))},mxObjectCodec.prototype.processInclude=function(t,e,i){if("include"==e.nodeName){var n=e.getAttribute("name");if(null!=n)try{var r=mxUtils.load(n).getDocumentElement();null!=r&&t.decode(r,i)}catch(t){}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(t,e,i){return e},mxObjectCodec.prototype.afterDecode=function(t,e,i){return i},__mxOutput.mxObjectCodec=void 0!==mxObjectCodec?mxObjectCodec:void 0,mxCodecRegistry.register((codec=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]),codec.isCellCodec=function(){return!0},codec.isNumericAttribute=function(t,e,i){return"value"!==e.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},codec.isExcluded=function(t,e,i,n){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||n&&"value"==e&&i.nodeType==mxConstants.NODETYPE_ELEMENT},codec.afterEncode=function(t,e,i){if(null!=e.value&&e.value.nodeType==mxConstants.NODETYPE_ELEMENT){var n=i;(i=mxUtils.importNode(t.document,e.value,!0)).appendChild(n);var r=n.getAttribute("id");i.setAttribute("id",r),n.removeAttribute("id")}return i},codec.beforeDecode=function(t,e,i){var n=e.cloneNode(!0),r=this.getName();if(e.nodeName!=r){var s=e.getElementsByTagName(r)[0];null!=s&&s.parentNode==e?(mxUtils.removeWhitespace(s,!0),mxUtils.removeWhitespace(s,!1),s.parentNode.removeChild(s),n=s):n=null,i.value=e.cloneNode(!0);var o=i.value.getAttribute("id");null!=o&&(i.setId(o),i.value.removeAttribute("id"))}else i.setId(e.getAttribute("id"));if(null!=n)for(var l=0;l=0},t.isExcluded=function(t,e,i,n){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||n&&null!=i&&("previous"==e||"parent"==e)&&!t.model.contains(i)},t.afterEncode=function(t,e,i){return this.isReference(e,"child",e.child,!0)?i.setAttribute("child",t.getId(e.child)):t.encodeCell(e.child,i),i},t.beforeDecode=function(t,e,i){if(null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var n=(e=e.cloneNode(!0)).firstChild;i.child=t.decodeCell(n,!1);var r=n.nextSibling;for(n.parentNode.removeChild(n),n=r;null!=n;){if(r=n.nextSibling,n.nodeType==mxConstants.NODETYPE_ELEMENT){var s=n.getAttribute("id");null==t.lookup(s)&&t.decodeCell(n)}n.parentNode.removeChild(n),n=r}}else{var o=e.getAttribute("child");i.child=t.getObject(o)}return e},t.afterDecode=function(t,e,i){return null!=i.child&&(null!=i.child.parent&&null!=i.previous&&i.child.parent!=i.previous&&(i.previous=i.child.parent),i.child.parent=i.previous,i.previous=i.parent,i.previousIndex=i.index),i},t}()),__mxOutput.mxChildChangeCodec="undefined"!=typeof mxChildChangeCodec?mxChildChangeCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(t,e,i){return i.previous=i.terminal,i},t}()),__mxOutput.mxTerminalChangeCodec="undefined"!=typeof mxTerminalChangeCodec?mxTerminalChangeCodec:void 0;var mxGenericChangeCodec=function(t,e){var i=new mxObjectCodec(t,["model","previous"],["cell"]);return i.afterDecode=function(t,i,n){return mxUtils.isNode(n.cell)&&(n.cell=t.decodeCell(n.cell,!1)),n.previous=n[e],n},i};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),__mxOutput.mxGenericChangeCodec=void 0!==mxGenericChangeCodec?mxGenericChangeCodec:void 0,mxCodecRegistry.register(new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])),__mxOutput.mxGraphCodec="undefined"!=typeof mxGraphCodec?mxGraphCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(t,e){return this.encodeCell(t,e,e.graph.getModel().getRoot())},t.encodeCell=function(t,e,i){var n=e.graph.getModel(),r=e.getState(i),s=n.getParent(i);if(null==s||null!=r){var o=n.getChildCount(i),l=e.graph.getCellGeometry(i),a=null;if(s==n.getRoot()?a="layer":null==s?a="graph":n.isEdge(i)?a="edge":o>0&&null!=l?a="group":n.isVertex(i)&&(a="vertex"),null!=a){var h=t.document.createElement(a);if(null!=e.graph.getLabel(i)&&(h.setAttribute("label",e.graph.getLabel(i)),e.graph.isHtmlLabel(i)&&h.setAttribute("html",!0)),null==s){var u=e.getGraphBounds();null!=u&&(h.setAttribute("x",Math.round(u.x)),h.setAttribute("y",Math.round(u.y)),h.setAttribute("width",Math.round(u.width)),h.setAttribute("height",Math.round(u.height))),h.setAttribute("scale",e.scale)}else if(null!=r&&null!=l){for(var p in r.style){var d=r.style[p];"function"==typeof d&&"object"==typeof d&&(d=mxStyleRegistry.getName(d)),null!=d&&"function"!=typeof d&&"object"!=typeof d&&h.setAttribute(p,d)}var c=r.absolutePoints;if(null!=c&&c.length>0){var m=Math.round(c[0].x)+","+Math.round(c[0].y);for(p=1;p0&&i.appendChild(s)}}return i},t.getStringValue=function(t,e){var i=typeof e;return"function"==i?e=mxStyleRegistry.getName(e):"object"==i&&(e=null),e},t.decode=function(t,e,i){var n=i||new this.template.constructor,r=e.getAttribute("id");for(null!=r&&(t.objects[r]=n),e=e.firstChild;null!=e;){if(!this.processInclude(t,e,n)&&"add"==e.nodeName){var s=e.getAttribute("as");if(null!=s){var o=e.getAttribute("extend"),l=null!=o?mxUtils.clone(n.styles[o]):null;null==l&&(null!=o&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+o+" not found to extend"),l=new Object);for(var a=e.firstChild;null!=a;){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var h=a.getAttribute("as");if("add"==a.nodeName){var u=mxUtils.getTextContent(a),p=null;null!=u&&u.length>0&&mxStylesheetCodec.allowEval?p=mxUtils.eval(u):(p=a.getAttribute("value"),mxUtils.isNumeric(p)&&(p=parseFloat(p))),null!=p&&(l[h]=p)}else"remove"==a.nodeName&&delete l[h]}a=a.nextSibling}n.putCellStyle(s,l)}}e=e.nextSibling}return n},t}());mxStylesheetCodec.allowEval=!0,__mxOutput.mxStylesheetCodec=void 0!==mxStylesheetCodec?mxStylesheetCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(t,e){return null},t.decode=function(t,e,i){if(null!=i)for(i.editor,e=e.firstChild;null!=e;){if(!this.processInclude(t,e,i)&&"add"==e.nodeName){var n=e.getAttribute("as"),r=e.getAttribute("action"),s=e.getAttribute("control");i.bindAction(n,r,s)}e=e.nextSibling}return i},t}()),__mxOutput.mxDefaultKeyHandlerCodec="undefined"!=typeof mxDefaultKeyHandlerCodec?mxDefaultKeyHandlerCodec:void 0;var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(t,e){return null},t.decode=function(t,e,i){if(null!=i){var n=i.editor;for(e=e.firstChild;null!=e;){if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(t,e,i))if("separator"==e.nodeName)i.addSeparator();else if("br"==e.nodeName)i.toolbar.addBreak();else if("hr"==e.nodeName)i.toolbar.addLine();else if("add"==e.nodeName){var r=e.getAttribute("as");r=mxResources.get(r)||r;var s=e.getAttribute("icon"),o=e.getAttribute("pressedIcon"),l=e.getAttribute("action"),a=e.getAttribute("mode"),h=e.getAttribute("template"),u="0"!=e.getAttribute("toggle"),p=mxUtils.getTextContent(e),d=null;if(null!=l)d=i.addItem(r,s,l,o);else if(null!=a){var c=mxDefaultToolbarCodec.allowEval?mxUtils.eval(p):null;d=i.addMode(r,s,a,o,c)}else if(null!=h||null!=p&&p.length>0){var m=n.templates[h],g=e.getAttribute("style");null!=m&&null!=g&&(m=n.graph.cloneCell(m)).setStyle(g);var x=null;null!=p&&p.length>0&&mxDefaultToolbarCodec.allowEval&&(x=mxUtils.eval(p)),d=i.addPrototype(r,s,m,o,x,u)}else{var f=mxUtils.getChildNodes(e);if(f.length>0)if(null==s)for(var y=i.addActionCombo(r),v=0;v0&&d.setAttribute("id",L)}}e=e.nextSibling}}return i},t}());return mxDefaultToolbarCodec.allowEval=!0,__mxOutput.mxDefaultToolbarCodec=void 0!==mxDefaultToolbarCodec?mxDefaultToolbarCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(t,e){return null},t.decode=function(t,e,i){var n=e.getElementsByTagName("include")[0];return null!=n?this.processInclude(t,n,i):null!=i&&(i.config=e),i},t}()),__mxOutput.mxDefaultPopupMenuCodec="undefined"!=typeof mxDefaultPopupMenuCodec?mxDefaultPopupMenuCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(t,e,i){var n=e.getAttribute("defaultEdge");null!=n&&(e.removeAttribute("defaultEdge"),i.defaultEdge=i.templates[n]);var r=e.getAttribute("defaultGroup");return null!=r&&(e.removeAttribute("defaultGroup"),i.defaultGroup=i.templates[r]),i},t.decodeChild=function(t,e,i){if("Array"==e.nodeName){var n=e.getAttribute("as");if("templates"==n)return void this.decodeTemplates(t,e,i)}else if("ui"==e.nodeName)return void this.decodeUi(t,e,i);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(t,e,i){for(var n=e.firstChild;null!=n;){if("add"==n.nodeName){var r=n.getAttribute("as"),s=n.getAttribute("element"),o=n.getAttribute("style"),l=null;if(null!=s)null!=(l=document.getElementById(s))&&null!=o&&(l.style.cssText+=";"+o);else{var a=parseInt(n.getAttribute("x")),h=parseInt(n.getAttribute("y")),u=n.getAttribute("width"),p=n.getAttribute("height");(l=document.createElement("div")).style.cssText=o,new mxWindow(mxResources.get(r)||r,l,a,h,u,p,!1,!0).setVisible(!0)}"graph"==r?i.setGraphContainer(l):"toolbar"==r?i.setToolbarContainer(l):"title"==r?i.setTitleContainer(l):"status"==r?i.setStatusContainer(l):"map"==r&&i.setMapContainer(l)}else"resource"==n.nodeName?mxResources.add(n.getAttribute("basename")):"stylesheet"==n.nodeName&&mxClient.link("stylesheet",n.getAttribute("name"));n=n.nextSibling}},t.decodeTemplates=function(t,e,i){null==i.templates&&(i.templates=[]);for(var n=mxUtils.getChildNodes(e),r=0;r{t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_BLOCK_THIN}],[FlowKind.MESSAGE_FLOW,t=>{t[mxgraph.mxConstants.STYLE_DASHED]=!0,t[mxgraph.mxConstants.STYLE_DASH_PATTERN]="8 5",t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_OVAL,t[mxgraph.mxConstants.STYLE_STARTSIZE]=8,t[mxgraph.mxConstants.STYLE_STARTFILL]=!1,t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_BLOCK_THIN,t[mxgraph.mxConstants.STYLE_ENDFILL]=!1}],[FlowKind.ASSOCIATION_FLOW,t=>{t[mxgraph.mxConstants.STYLE_DASHED]=!0,t[mxgraph.mxConstants.STYLE_DASH_PATTERN]="1 2",t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_OPEN_THIN,t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_OPEN_THIN,t[mxgraph.mxConstants.STYLE_STARTSIZE]=12}]]),this.specificSequenceFlowStyles=new Map([[SequenceFlowKind.DEFAULT,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=MarkerIdentifier.ARROW_DASH}],[SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_DIAMOND_THIN,t[mxgraph.mxConstants.STYLE_STARTSIZE]=18,t[mxgraph.mxConstants.STYLE_STARTFILL]=!1}]]),this.specificAssociationFlowStyles=new Map([[AssociationDirectionKind.NONE,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=void 0,t[mxgraph.mxConstants.STYLE_ENDARROW]=void 0,t[mxgraph.mxConstants.STYLE_EDGE]=void 0}],[AssociationDirectionKind.ONE,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=void 0,t[mxgraph.mxConstants.STYLE_EDGE]=void 0}],[AssociationDirectionKind.BOTH,t=>{t[mxgraph.mxConstants.STYLE_EDGE]=void 0}]])}configureStyles(){mxgraph.mxConstants.RECTANGLE_ROUNDING_FACTOR=.1,this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}getDefaultVertexStyle(){return this.getStylesheet().getDefaultVertexStyle()}getDefaultEdgeStyle(){return this.getStylesheet().getDefaultEdgeStyle()}cloneDefaultVertexStyle(){const t=this.getDefaultVertexStyle();return mxgraph.mxUtils.clone(t)}cloneDefaultEdgeStyle(){const t=this.getDefaultEdgeStyle();return mxgraph.mxUtils.clone(t)}putCellStyle(t,e){this.getStylesheet().putCellStyle(t,e)}configureDefaultVertexStyle(){const t=this.getDefaultVertexStyle();this.configureCommonDefaultStyle(t)}configurePoolStyle(){const t=this.cloneDefaultVertexStyle();t[mxgraph.mxConstants.STYLE_SHAPE]=mxgraph.mxConstants.SHAPE_SWIMLANE,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_CENTER,t[mxgraph.mxConstants.STYLE_STARTSIZE]=StyleDefault.POOL_LABEL_SIZE,this.graph.getStylesheet().putCellStyle(ShapeBpmnElementKind.POOL,t)}configureLaneStyle(){const t=this.cloneDefaultVertexStyle();t[mxgraph.mxConstants.STYLE_SHAPE]=mxgraph.mxConstants.SHAPE_SWIMLANE,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_CENTER,t[mxgraph.mxConstants.STYLE_SWIMLANE_LINE]=0,t[mxgraph.mxConstants.STYLE_STARTSIZE]=StyleDefault.LANE_LABEL_SIZE,this.graph.getStylesheet().putCellStyle(ShapeBpmnElementKind.LANE,t)}configureEventStyles(){ShapeUtil.topLevelBpmnEventKinds().forEach(t=>{const e=this.cloneDefaultVertexStyle();e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_PERIMETER]=mxgraph.mxPerimeter.EllipsePerimeter,e[mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_BOTTOM,this.putCellStyle(t,e)})}configureTextAnnotationStyle(){const t=this.cloneDefaultVertexStyle();t[mxgraph.mxConstants.STYLE_SHAPE]=ShapeBpmnElementKind.TEXT_ANNOTATION,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_LEFT,t[mxgraph.mxConstants.STYLE_SPACING_LEFT]=5,this.putCellStyle(ShapeBpmnElementKind.TEXT_ANNOTATION,t)}configureActivityStyles(){ShapeUtil.activityKinds().forEach(t=>{const e=this.cloneDefaultVertexStyle();e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,this.putCellStyle(t,e)})}configureGatewayStyles(){ShapeUtil.gatewayKinds().forEach(t=>{const e=this.cloneDefaultVertexStyle();e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_PERIMETER]=mxgraph.mxPerimeter.RhombusPerimeter,e[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_TOP,e[mxgraph.mxConstants.STYLE_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_LEFT,e[mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_TOP,this.putCellStyle(t,e)})}configureDefaultEdgeStyle(){const t=this.getDefaultEdgeStyle();t[mxgraph.mxConstants.STYLE_EDGE]=mxgraph.mxConstants.EDGESTYLE_SEGMENT,t[mxgraph.mxConstants.STYLE_ENDSIZE]=12,t[mxgraph.mxConstants.STYLE_STROKEWIDTH]=1.5,t[mxgraph.mxConstants.STYLE_ROUNDED]=1,t[mxgraph.mxConstants.STYLE_ARCSIZE]=5,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_BOTTOM,delete t[mxgraph.mxConstants.STYLE_ENDARROW],this.configureCommonDefaultStyle(t)}configureCommonDefaultStyle(t){t[mxgraph.mxConstants.STYLE_FONTFAMILY]=StyleDefault.DEFAULT_FONT_FAMILY,t[mxgraph.mxConstants.STYLE_FONTSIZE]=StyleDefault.DEFAULT_FONT_SIZE,t[mxgraph.mxConstants.STYLE_FONTCOLOR]=StyleDefault.DEFAULT_FONT_COLOR,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=StyleDefault.DEFAULT_FILL_COLOR,t[mxgraph.mxConstants.STYLE_STROKECOLOR]=StyleDefault.DEFAULT_STROKE_COLOR,t[mxgraph.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=mxgraph.mxConstants.NONE,t[mxgraph.mxConstants.STYLE_WHITE_SPACE]="wrap"}configureEdgeStyles(t,e){t.forEach(t=>{const i=this.cloneDefaultEdgeStyle();(e.get(t)||(()=>{}))(i),this.graph.getStylesheet().putCellStyle(t.toString(),i)})}configureSequenceFlowStyles(){this.configureEdgeStyles(Object.values(SequenceFlowKind),this.specificSequenceFlowStyles)}configureAssociationFlowStyles(){this.configureEdgeStyles(Object.values(AssociationDirectionKind),this.specificAssociationFlowStyles)}configureFlowStyles(){this.configureEdgeStyles(Object.values(FlowKind),this.specificFlowStyles),this.configureSequenceFlowStyles(),this.configureAssociationFlowStyles()}computeStyle(t,e){const i=[t.bpmnElement.kind];let n;t instanceof Shape?n=this.computeShapeStyle(t):(i.push(...this.computeEdgeStyle(t)),n=new Map);const r=this.computeFontStyleValues(t),s=this.computeLabelStyleValues(t,e);return[].concat([...i]).concat([...n,...r,...s].filter(([,t])=>t&&"undefined"!=t).map(([t,e])=>t+"="+e)).join(";")}computeShapeStyle(t){const e=new Map,i=t.bpmnElement;if(i instanceof ShapeBpmnEvent)e.set(StyleIdentifier.BPMN_STYLE_EVENT_KIND,i.eventKind),(i instanceof ShapeBpmnBoundaryEvent||i instanceof ShapeBpmnStartEvent&&void 0!==i.isInterrupting)&&e.set(StyleIdentifier.BPMN_STYLE_IS_INTERRUPTING,String(i.isInterrupting));else if(i instanceof ShapeBpmnActivity){i instanceof ShapeBpmnSubProcess?e.set(StyleIdentifier.BPMN_STYLE_SUB_PROCESS_KIND,i.subProcessKind):i.kind===ShapeBpmnElementKind.TASK_RECEIVE&&e.set(StyleIdentifier.BPMN_STYLE_INSTANTIATING,String(i.instantiate));const t=i.markers;t.length>0&&e.set(StyleIdentifier.BPMN_STYLE_MARKERS,t.join(","))}else ShapeUtil.isPoolOrLane(i.kind)?e.set(mxgraph.mxConstants.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):i instanceof ShapeBpmnEventBasedGateway&&(e.set(StyleIdentifier.BPMN_STYLE_INSTANTIATING,String(i.instantiate)),e.set(StyleIdentifier.BPMN_STYLE_EVENT_BASED_GATEWAY_KIND,String(i.gatewayKind)));return e}computeEdgeStyle(t){const e=[],i=t.bpmnElement;return i instanceof SequenceFlow&&e.push(i.sequenceFlowKind),i instanceof AssociationFlow&&e.push(i.associationDirectionKind),e}computeFontStyleValues(t){var e;const i=new Map,n=null===(e=t.label)||void 0===e?void 0:e.font;return n&&(i.set(mxgraph.mxConstants.STYLE_FONTFAMILY,n.name),i.set(mxgraph.mxConstants.STYLE_FONTSIZE,n.size),i.set(mxgraph.mxConstants.STYLE_FONTSTYLE,StyleConfigurator.getFontStyleValue(n))),i}computeLabelStyleValues(t,e){const i=new Map,n=t.bpmnElement;return e?(i.set(mxgraph.mxConstants.STYLE_VERTICAL_ALIGN,mxgraph.mxConstants.ALIGN_TOP),t.bpmnElement.kind!=ShapeBpmnElementKind.TEXT_ANNOTATION&&i.set(mxgraph.mxConstants.STYLE_ALIGN,mxgraph.mxConstants.ALIGN_CENTER),t instanceof Shape&&(i.set(mxgraph.mxConstants.STYLE_LABEL_WIDTH,e.width+1),i.set(mxgraph.mxConstants.STYLE_LABEL_POSITION,mxgraph.mxConstants.ALIGN_TOP),i.set(mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxgraph.mxConstants.ALIGN_LEFT))):t instanceof Shape&&(n instanceof ShapeBpmnSubProcess||n instanceof ShapeBpmnCallActivity)&&!n.markers.includes(ShapeBpmnMarkerKind.EXPAND)&&i.set(mxgraph.mxConstants.STYLE_VERTICAL_ALIGN,mxgraph.mxConstants.ALIGN_TOP),i}computeMessageFlowIconStyle(t){return`shape=${StyleIdentifier.BPMN_STYLE_MESSAGE_FLOW_ICON};${StyleIdentifier.BPMN_STYLE_IS_INITIATING}=${t.messageVisibleKind}`}static getFontStyleValue(t){let e=0;return t.isBold&&(e+=mxgraph.mxConstants.FONT_BOLD),t.isItalic&&(e+=mxgraph.mxConstants.FONT_ITALIC),t.isStrikeThrough&&(e+=mxgraph.mxConstants.FONT_STRIKETHROUGH),t.isUnderline&&(e+=mxgraph.mxConstants.FONT_UNDERLINE),e}}function computeScaledIconSize(t,e,i,n){let r,s;t.heightt.setIconOriginForIconCentered(),shape:{x:e,y:i,w:n,h:r,strokeWidth:s.strokewidth||StyleUtils.getStrokeWidth(s.style)},icon:{isFilled:l,fillColor:s.fill||StyleUtils.getFillColor(s.style),strokeColor:s.stroke||StyleUtils.getStrokeColor(s.style),strokeWidth:a,margin:StyleUtils.getMargin(s.style)}}}class IconPainter{paintEmptyIcon(){}newBpmnCanvas({c:t,ratioFromParent:e,setIconOrigin:i,shape:n,icon:r},s){return new BpmnCanvas({mxCanvas:t,shapeConfiguration:n,iconConfiguration:{originalSize:s,style:r,ratioFromShape:e,setIconOrigin:i}})}paintEnvelopeIcon(t){const e={width:485.41,height:321.76},i=this.newBpmnCanvas(t,e),n=e.width,r=e.height;i.rect(0,0,n,r),i.fillAndStroke();const{icon:s}=t;s.isFilled&&i.setStrokeColor(s.fillColor),i.begin(),i.moveTo(0,0),i.lineTo(.5*n,.6*r),i.lineTo(n,0),i.moveTo(0,r),i.lineTo(n/3,.45*r),i.moveTo(n,r),i.lineTo(2*n/3,.45*r),i.stroke()}paintCircleIcon(t){const e={width:t.shape.w,height:t.shape.h},i=this.newBpmnCanvas(t,e),n=e.width,r=e.height;n>0&&r>0&&i.ellipse(0,0,n,r),t.icon.isFilled?i.fillAndStroke():i.stroke()}paintClockIcon(t){const e=this.newBpmnCanvas(t,{height:152,width:152});e.begin(),e.moveTo(184,60),e.curveTo(188.4,60,192,56.4,192,52),e.lineTo(192,48),e.curveTo(192,40,188.4,40,184,40),e.curveTo(179.6,40,176,43.6,176,48),e.lineTo(176,52),e.curveTo(176,56.4,179.6,60,184,60),e.close(),e.moveTo(184,308),e.curveTo(179.6,308,176,311.6,176,316),e.lineTo(176,320),e.curveTo(176,324.4,179.6,328,184,328),e.curveTo(188.4,328,192,324.4,192,320),e.lineTo(192,316),e.curveTo(192,311.6,188.4,308,184,308),e.close(),e.moveTo(52,176),e.lineTo(48,176),e.curveTo(43.6,176,40,179.6,40,184),e.curveTo(40,188.4,43.6,192,48,192),e.lineTo(52,192),e.curveTo(56.4,192,69,188.4,60,184),e.curveTo(60,179.6,56.4,176,52,176),e.close(),e.moveTo(320,176),e.lineTo(316,176),e.curveTo(311.6,176,308,179.6,308,184),e.curveTo(308,188.4,311.6,192,316,192),e.lineTo(320,192),e.curveTo(324.4,192,328,188.4,328,184),e.curveTo(328,179.6,324.4,176,320,176),e.moveTo(93.6,82.4),e.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),e.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),e.lineTo(85.2,96.4),e.curveTo(86.8,98,88.8,98.8,90.8,98.8),e.curveTo(92.8,98.8,94.4,98,96.4,96.4),e.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),e.lineTo(93.6,82.4),e.moveTo(85.2,271.6),e.lineTo(82.4,274.4),e.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),e.curveTo(84,287.2,86,288,88,288),e.curveTo(90,288,92,287.2,93.6,285.6),e.lineTo(96.4,282.8),e.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),e.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),e.moveTo(274.4,82.4),e.lineTo(271.6,85.2),e.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),e.curveTo(273.298,98,275.2,98.8,277.2,98.8),e.curveTo(279.2,98.8,281.2,98,282.8,96.4),e.lineTo(285.6,93.6),e.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),e.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),e.moveTo(192,180.8),e.lineTo(192,108),e.curveTo(192,103.6,188.4,100,184,100),e.curveTo(179.6,100,176,103.6,176,108),e.lineTo(176,184),e.curveTo(176,186,176.8,188,178.4,189.6),e.lineTo(266,277.2),e.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),e.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),e.curveTo(280.4,274,280.4,269.2,277.2,266),e.lineTo(192,180.8),e.moveTo(184,0),e.curveTo(82.4,0,0,82.4,0,184),e.curveTo(0,285.6,82.4,368,184,368),e.curveTo(285.6,368,368,285.6,368,184),e.curveTo(368,82.4,285.6,0,184,0),e.moveTo(184,352),e.curveTo(91.2,352,16,276.8,16,184),e.curveTo(16,91.2,91.2,16,184,16),e.curveTo(276.8,16,352,91.2,352,184),e.curveTo(352,276.8,276.8,352,184,352),e.fillAndStroke()}paintTriangleIcon(t){const e=this.newBpmnCanvas(t,{height:735,width:849});e.begin(),e.moveTo(497,55),e.lineTo(817,609),e.curveTo(849,665,808,735,744,735),e.lineTo(105,735),e.curveTo(40,735,0,665,32,609),e.lineTo(352,55),e.curveTo(384,0,465,0,497,55),e.close(),e.fillAndStroke()}paintUpArrowheadIcon(t){const e=this.newBpmnCanvas(t,{height:50,width:40});e.begin(),e.moveTo(0,49.5),e.lineTo(19.5,1),e.curveTo(19.75,.25,20,0,20.25,.25),e.lineTo(40,49.5),e.curveTo(40,49.5,39.75,50,39.6,49.75),e.lineTo(20,30),e.lineTo(.4,49.75),e.curveTo(.4,49.75,.25,50,0,49.5),e.close(),e.fillAndStroke()}paintDoubleLeftArrowheadsIcon(t){const e=this.newBpmnCanvas(t,{height:53.5,width:105});e.begin(),e.moveTo(91.4,0),e.curveTo(91.4,0,91.2,0,91,.2),e.lineTo(50,25),e.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),e.lineTo(46.4,0),e.curveTo(46.4,0,46.2,0,46,.2),e.lineTo(4.9,25),e.curveTo(2,26.2,0,27.3,4.9,28.5),e.lineTo(45.8,53),e.curveTo(46,53.3,46.2,53.5,46.4,53.5),e.lineTo(46.4,27),e.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),e.lineTo(90.8,53.3),e.curveTo(91,53.3,91.2,53.5,91.4,53.5),e.lineTo(91.4,0),e.close(),e.fillAndStroke()}drawCrossIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});return e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,.38),e.lineTo(1,.38),e.lineTo(1,.62),e.lineTo(.62,.62),e.lineTo(.62,1),e.lineTo(.38,1),e.lineTo(.38,.62),e.lineTo(0,.62),e.lineTo(0,.38),e.lineTo(.38,.38),e.close(),e}paintListIcon(t){const e=this.newBpmnCanvas(t,{height:60,width:60});e.begin(),e.moveTo(0,0),e.lineTo(60,0),e.lineTo(60,60),e.lineTo(0,60),e.lineTo(0,0),e.close(),e.moveTo(5,5),e.lineTo(55,5),e.close(),e.moveTo(5,21.6),e.lineTo(55,21.6),e.close(),e.moveTo(5,38.3),e.lineTo(55,38.3),e.close(),e.moveTo(5,55),e.lineTo(55,55),e.close(),e.fillAndStroke()}paintXCrossIcon(t){const e=this.drawCrossIcon(t);e.rotateOnIconCenter(45),e.fillAndStroke()}paintPlusCrossIcon(t){this.drawCrossIcon(t).fillAndStroke()}paintPersonIcon(t){const e=this.newBpmnCanvas(Object.assign(Object.assign({},t),{icon:Object.assign(Object.assign({},t.icon),{isFilled:!0})}),{height:239.68,width:143.61});e.begin(),e.moveTo(124.31,150.29),e.lineTo(99.66,141.03),e.arcTo(6.43,6.43,0,0,1,95.51,135.03),e.lineTo(95.51,130.66),e.arcTo(47.75,47.75,0,0,0,119.51,89.25),e.lineTo(119.51,71.25),e.arcTo(47.62,47.62,0,0,0,101.18,33.64),e.arcTo(29.35,29.35,0,0,0,101.52,29.14),e.arcTo(29.68,29.68,0,0,0,42.17,29.14),e.arcTo(29.24,29.24,0,0,0,42.53,33.63),e.arcTo(47.65,47.65,0,0,0,24.14,71.23),e.lineTo(24.14,89.23),e.arcTo(47.7,47.7,0,0,0,48.19,130.63),e.lineTo(48.19,135.03),e.arcTo(6.43,6.43,0,0,1,44.03,141.03),e.lineTo(19.31,150.29),e.arcTo(29.81,29.81,0,0,0,.09,178.03),e.lineTo(.09,233.51),e.arcTo(5.63,5.63,0,1,0,11.34,233.51),e.lineTo(11.34,178.03),e.arcTo(18.19,18.19,0,0,1,11.57,175.17),e.lineTo(20.5,184.11),e.arcTo(12.32,12.32,0,0,1,24.14,192.89),e.lineTo(24.14,233.51),e.arcTo(5.63,5.63,0,1,0,35.39,233.51),e.lineTo(35.39,192.93),e.arcTo(23.5,23.5,0,0,0,28.46,176.2),e.lineTo(17.04,164.78),e.arcTo(18.34,18.34,0,0,1,23.29,160.78),e.lineTo(43.65,153.15),e.lineTo(66.22,175.72),e.lineTo(66.22,233.51),e.arcTo(5.63,5.63,0,1,0,77.47,233.51),e.lineTo(77.47,175.76),e.lineTo(100.04,153.19),e.lineTo(120.4,160.82),e.arcTo(18.39,18.39,0,0,1,126.65,164.82),e.lineTo(115.24,176.24),e.arcTo(23.5,23.5,0,0,0,108.31,192.93),e.lineTo(108.31,233.55),e.arcTo(5.63,5.63,0,1,0,119.56,233.55),e.lineTo(119.56,192.93),e.arcTo(12.35,12.35,0,0,1,123.19,184.15),e.lineTo(132.13,175.22),e.arcTo(18,18,0,0,1,132.36,178.08),e.lineTo(132.36,233.56),e.arcTo(5.63,5.63,0,0,0,143.61,233.56),e.lineTo(143.61,178.03),e.arcTo(29.81,29.81,0,0,0,124.31,150.29),e.close(),e.moveTo(71.85,10.72),e.arcTo(18.46,18.46,0,0,1,90.17,27.18),e.arcTo(47.68,47.68,0,0,0,53.53,27.18),e.arcTo(18.44,18.44,0,0,1,71.85,10.72),e.close(),e.moveTo(35.39,71.23),e.arcTo(36.46,36.46,0,0,1,108.31,71.23),e.lineTo(108.31,77.4),e.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),e.arcTo(5.62,5.62,0,0,0,48.78,62.71),e.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),e.close(),e.moveTo(35.39,89.23),e.lineTo(35.39,87.08),e.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),e.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),e.lineTo(108.31,89.24),e.arcTo(36.46,36.46,0,1,1,35.39,89.24),e.close(),e.moveTo(71.85,165.45),e.lineTo(54.06,147.69),e.arcTo(17.7,17.7,0,0,0,59.43,135.32),e.arcTo(47.57,47.57,0,0,0,84.27,135.32),e.arcTo(17.7,17.7,0,0,0,89.64,147.69),e.close(),e.fill()}paintGearIcon(t){const e=this.newBpmnCanvas(t,{height:100,width:100});IconPainter.paintGearIconBackground(e),e.translateIconOrigin(14,14),IconPainter.paintGearIconForeground(e)}static paintGearIconBackground(t){t.begin(),t.moveTo(2.06,24.62),t.lineTo(10.17,30.95),t.lineTo(9.29,37.73),t.lineTo(0,41.42),t.lineTo(2.95,54.24),t.lineTo(13.41,52.92),t.lineTo(17.39,58.52),t.lineTo(13.56,67.66),t.lineTo(24.47,74.44),t.lineTo(30.81,66.33),t.lineTo(37.88,67.21),t.lineTo(41.57,76.5),t.lineTo(54.24,73.55),t.lineTo(53.06,62.94),t.lineTo(58.52,58.52),t.lineTo(67.21,63.09),t.lineTo(74.58,51.88),t.lineTo(66.03,45.25),t.lineTo(66.92,38.62),t.lineTo(76.5,34.93),t.lineTo(73.7,22.26),t.lineTo(62.64,23.44),t.lineTo(58.81,18.42),t.lineTo(62.79,8.7),t.lineTo(51.74,2.21),t.lineTo(44.81,10.47),t.lineTo(38.03,9.43),t.lineTo(33.75,0),t.lineTo(21.52,3.24),t.lineTo(22.7,13.56),t.lineTo(18.13,17.54),t.lineTo(8.7,13.56),t.close();IconPainter.paintGearInnerCircle(t,24.8,39)}static paintGearIconForeground(t){t.begin(),t.moveTo(16.46,41.42),t.lineTo(24.57,47.75),t.lineTo(23.69,54.53),t.lineTo(14.4,58.22),t.lineTo(17.35,71.04),t.lineTo(27.81,69.72),t.lineTo(31.79,75.32),t.lineTo(27.96,84.46),t.lineTo(38.87,91.24),t.lineTo(45.21,83.13),t.lineTo(52.28,84.01),t.lineTo(55.97,93.3),t.lineTo(68.64,90.35),t.lineTo(67.46,79.74),t.lineTo(72.92,75.32),t.lineTo(81.61,79.89),t.lineTo(88.98,68.68),t.lineTo(80.43,62.05),t.lineTo(81.32,55.42),t.lineTo(90.9,51.73),t.lineTo(88.1,39.06),t.lineTo(77.04,40.24),t.lineTo(73.21,35.22),t.lineTo(77.19,25.5),t.lineTo(66.14,19.01),t.lineTo(59.21,27.27),t.lineTo(52.43,26.23),t.lineTo(48.15,16.8),t.lineTo(35.92,20.04),t.lineTo(37.1,30.36),t.lineTo(32.53,34.34),t.lineTo(23.1,30.36),t.close();IconPainter.paintGearInnerCircle(t,39.2,55.8),t.begin(),IconPainter.paintGearInnerCircle(t,39.2,55.8)}static paintGearInnerCircle(t,e,i){const n=13.5;t.moveTo(e,i),t.arcTo(n,n,0,1,1,e+27,i),t.arcTo(n,n,0,0,1,e,i),t.close(),t.fillAndStroke()}paintExpandIcon(t){const e={width:16,height:16},i=this.newBpmnCanvas(t,e),n=e.width,r=e.height;i.roundrect(0,0,n,r,2,2),i.stroke(),i.begin(),i.moveTo(n/2,r/4),i.lineTo(n/2,3*r/4),i.close(),i.moveTo(n/4,r/2),i.lineTo(3*n/4,r/2),i.close(),i.fillAndStroke()}paintLoopIcon(t){const{icon:e}=t;e.fillColor=e.strokeColor;const i=this.newBpmnCanvas(t,{width:22.49,height:21.62});i.begin(),i.moveTo(5.5,19.08),i.arcTo(8,8,0,1,1,10.5,21.08),i.stroke(),i.begin(),i.moveTo(7.5,14.08),i.lineTo(5.75,19.08),i.lineTo(0,17.08),i.close(),i.fillAndStroke()}paintSequentialMultiInstanceIcon(t){const e={width:16,height:16},i=this.newBpmnCanvas(t,e),{c:n,icon:r}=t;n.setFillColor(r.strokeColor);const s=e.width,o=e.height/5;i.rect(0,0,s,o),i.fill(),i.rect(0,2*o,s,o),i.fill(),i.rect(0,4*o,s,o),i.fill()}paintParallelMultiInstanceIcon(t){const e={width:16,height:16},i=this.newBpmnCanvas(t,e),{c:n,icon:r}=t;n.setFillColor(r.strokeColor);const s=e.width/5,o=e.height;i.begin(),i.rect(0,0,s,o),i.fill(),i.rect(2*s,0,s,o),i.fill(),i.rect(4*s,0,s,o),i.fill()}paintRightArrowIcon(t){const e=this.newBpmnCanvas(t,{width:512,height:415.23});e.setRoundLineJoin(),e.begin(),e.moveTo(512,207.61),e.lineTo(304.38,0),e.lineTo(304.38,135.39),e.lineTo(0,135.39),e.lineTo(0,279.84),e.lineTo(304.38,279.84),e.lineTo(304.38,415.23),e.lineTo(512,207.61),e.close(),e.fillAndStroke()}paintErrorIcon(t){const e=this.newBpmnCanvas(t,{width:72.44,height:71.82});e.begin(),e.moveTo(0,53.32),e.lineTo(19.48,0),e.lineTo(19.48,0),e.lineTo(50.85,40.07),e.lineTo(72.44,18.21),e.lineTo(53.12,71.82),e.lineTo(22.5,31.37),e.close(),e.fillAndStroke()}paintHandIcon(t){const e=this.newBpmnCanvas(t,{width:343.65,height:354.12});e.begin(),e.moveTo(231.66,336.39),e.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),e.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),e.lineTo(146.33,248.39),e.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),e.curveTo(275.75,283.38,297.25,288,301.42,267.77),e.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),e.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),e.lineTo(165.2,194.8),e.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),e.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),e.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),e.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),e.lineTo(169.35,138.97),e.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),e.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),e.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),e.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),e.lineTo(127.61,81.87),e.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),e.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),e.curveTo(143.83,0,124.08,14.49,124.08,14.49),e.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),e.lineTo(0,251.94),e.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),e.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),e.fillAndStroke()}paintScriptIcon(t){t.icon.fillColor=t.icon.strokeColor;const e=this.newBpmnCanvas(t,{width:458.75,height:461.64});e.begin(),e.moveTo(67.85,.57),e.curveTo(50.73,0,33.26,8.86,22.35,18.84),e.curveTo(8.11,32.15,0,50.77,0,70.26),e.curveTo(0,73.15,0,87.59,0,113.6),e.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),e.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),e.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),e.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),e.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),e.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),e.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),e.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),e.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),e.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),e.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),e.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),e.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),e.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),e.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),e.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),e.curveTo(389.09,14.11,366.95,.59,341.75,.59),e.curveTo(286.97,.59,122.63,.57,67.85,.57),e.close(),e.moveTo(85.04,72.68),e.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),e.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),e.curveTo(55.8,44.28,59.84,41,73.82,41),e.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),e.close(),e.moveTo(364.94,52.9),e.curveTo(370,61.11,373.9,76.44,377.38,93.51),e.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),e.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),e.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),e.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),e.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),e.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),e.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),e.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),e.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),e.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),e.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),e.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),e.close(),e.moveTo(409.96,399.48),e.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),e.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),e.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),e.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),e.close(),e.fill(),e.begin(),e.moveTo(182.1,131.2),e.lineTo(182.1,151.68),e.lineTo(321.89,151.68),e.lineTo(321.89,131.2),e.lineTo(182.1,131.2),e.close(),e.moveTo(162.25,251.09),e.lineTo(162.25,271.49),e.lineTo(301.96,271.49),e.lineTo(301.96,251.09),e.lineTo(162.25,251.09),e.close(),e.fill()}paintTableIcon(t){const e=this.newBpmnCanvas(t,{width:640,height:640});e.begin(),e.moveTo(.19,.1),e.lineTo(298.78,.1),e.lineTo(298.78,198.88),e.lineTo(.19,198.88),e.lineTo(.19,.1),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,48.88),e.lineTo(98.78,48.88),e.lineTo(98.78,198.88),e.lineTo(0,198.88),e.lineTo(0,48.88),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(1.09,122.69),e.lineTo(298.78,122.69),e.close(),e.fillAndStroke(),e.setFillColor(t.icon.strokeColor),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke()}paintPentagon(t){const e=this.newBpmnCanvas(t,{width:16,height:16});e.begin(),e.moveTo(16,6.5),e.lineTo(8,0),e.lineTo(0,6.5),e.lineTo(3,16),e.lineTo(13,16),e.lineTo(16,6.5),e.lineTo(8,0),e.stroke()}}class IconPainterProvider{static get(){return this.instance}static set(t){this.instance=t}}IconPainterProvider.instance=new IconPainter;class EventShape extends mxgraph.mxEllipse{constructor(t,e,i,n){super(t,e,i,n),this.iconPainter=IconPainterProvider.get(),this.iconPainters=new Map([[ShapeBpmnEventKind.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},t),{ratioFromParent:.5}))],[ShapeBpmnEventKind.TERMINATE,t=>this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6}))],[ShapeBpmnEventKind.TIMER,t=>this.iconPainter.paintClockIcon(Object.assign(Object.assign({},t),{setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(5)}))],[ShapeBpmnEventKind.SIGNAL,t=>this.iconPainter.paintTriangleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:StyleDefault.STROKE_WIDTH_THIN.valueOf()}),setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(4)}))],[ShapeBpmnEventKind.LINK,t=>this.iconPainter.paintRightArrowIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:1.5})}))],[ShapeBpmnEventKind.ERROR,t=>this.iconPainter.paintErrorIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:1.5})}))],[ShapeBpmnEventKind.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon(Object.assign(Object.assign({},t),{ratioFromParent:.7,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:1.5})}))],[ShapeBpmnEventKind.CANCEL,t=>this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},t),{ratioFromParent:.78}))],[ShapeBpmnEventKind.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:StyleDefault.STROKE_WIDTH_THIN.valueOf()})}))],[ShapeBpmnEventKind.CONDITIONAL,t=>this.iconPainter.paintListIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6,icon:Object.assign(Object.assign({},t.icon),{strokeWidth:1.5})}))]]),this.withFilledIcon=!1}paintVertexShape(t,e,i,n,r){this.markNonFullyRenderedEvents(t);const s=buildPaintParameter(t,e,i,n,r,this,.25,this.withFilledIcon);EventShape.setDashedOuterShapePattern(s,StyleUtils.getBpmnIsInterrupting(this.style)),this.paintOuterShape(s),EventShape.restoreOriginalOuterShapePattern(s),this.paintInnerShape(s)}markNonFullyRenderedEvents(t){}paintOuterShape({c:t,shape:{x:e,y:i,w:n,h:r}}){super.paintVertexShape(t,e,i,n,r)}paintInnerShape(t){(this.iconPainters.get(StyleUtils.getBpmnEventKind(this.style))||(()=>this.iconPainter.paintEmptyIcon()))(t)}static setDashedOuterShapePattern(t,e){t.c.save(),"false"===e&&(t.c.setDashed(!0,!1),t.c.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.c.restore()}}class StartEventShape extends EventShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}}class EndEventShape extends EventShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THICK){super(t,e,i,n),this.withFilledIcon=!0}}class IntermediateEventShape extends EventShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}paintOuterShape({c:t,shape:{x:e,y:i,w:n,h:r,strokeWidth:s}}){t.ellipse(e,i,n,r),t.fillAndStroke();const o=1.5*s;t.ellipse(.02*n+o+e,.02*r+o+i,.96*n-2*o,.96*r-2*o),t.stroke()}}class CatchIntermediateEventShape extends IntermediateEventShape{constructor(t,e,i,n){super(t,e,i,n)}}class ThrowIntermediateEventShape extends IntermediateEventShape{constructor(t,e,i,n){super(t,e,i,n),this.withFilledIcon=!0}}class BoundaryEventShape extends IntermediateEventShape{constructor(t,e,i,n){super(t,e,i,n)}}class GatewayShape extends mxgraph.mxRhombus{constructor(t,e,i,n){super(t,e,i,n),this.iconPainter=IconPainterProvider.get()}paintVertexShape(t,e,i,n,r){const s=buildPaintParameter(t,e,i,n,r,this);this.paintOuterShape(s),this.paintInnerShape(s)}paintOuterShape({c:t,shape:{x:e,y:i,w:n,h:r}}){super.paintVertexShape(t,e,i,n,r)}}class ExclusiveGatewayShape extends GatewayShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}paintInnerShape(t){this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},t),{icon:Object.assign(Object.assign({},t.icon),{isFilled:!0}),ratioFromParent:.5}))}}class ParallelGatewayShape extends GatewayShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}paintInnerShape(t){this.iconPainter.paintPlusCrossIcon(Object.assign(Object.assign({},t),{icon:Object.assign(Object.assign({},t.icon),{isFilled:!0}),ratioFromParent:.5}))}}class InclusiveGatewayShape extends GatewayShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}paintInnerShape(t){this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.62,icon:Object.assign(Object.assign({},t.icon),{isFilled:!1,strokeWidth:StyleDefault.STROKE_WIDTH_THICK.valueOf()})}))}}class EventBasedGatewayShape extends GatewayShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n)}paintInnerShape(t){t=Object.assign(Object.assign({},t),{icon:Object.assign(Object.assign({},t.icon),{strokeWidth:1})}),this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55})),StyleUtils.getBpmnIsInstantiating(this.style)||this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.45}));const e=Object.assign(Object.assign({},t),{ratioFromParent:.3});StyleUtils.getBpmnIsParallelEventBasedGateway(this.style)?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}const referenceOrderedMarkers=[ShapeBpmnMarkerKind.LOOP,ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL,ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL,ShapeBpmnMarkerKind.COMPENSATION,ShapeBpmnMarkerKind.EXPAND,ShapeBpmnMarkerKind.ADHOC];function orderActivityMarkers(t){const e=[];return referenceOrderedMarkers.forEach(i=>{t.includes(i)&&e.push(i)}),t.filter(t=>!e.includes(t)).forEach(t=>{e.push(t)}),e}function paintEnvelopeIcon(t,e){IconPainterProvider.get().paintEnvelopeIcon(Object.assign(Object.assign({},t),{setIconOrigin:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,icon:Object.assign(Object.assign({},t.icon),{isFilled:e})}))}class BaseActivityShape extends mxgraph.mxRectangleShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n),this.iconPainter=IconPainterProvider.get(),this.isRounded=!0}paintForeground(t,e,i,n,r){super.paintForeground(t,e,i,n,r),this.paintMarkerIcons(buildPaintParameter(t,e,i,n,r,this,0,!1,1.5))}paintMarkerIcons(t){const e=StyleUtils.getBpmnMarkers(this.style);e&&orderActivityMarkers(e.split(",")).forEach((e,i,n)=>{switch((t=Object.assign(Object.assign({},t),{setIconOrigin:this.getIconOriginForMarkerIcon(n.length,i+1)})).c.save(),e){case ShapeBpmnMarkerKind.LOOP:this.iconPainter.paintLoopIcon(t);break;case ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(t);break;case ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(t);break;case ShapeBpmnMarkerKind.EXPAND:this.iconPainter.paintExpandIcon(t)}t.c.restore()})}getIconOriginForMarkerIcon(t,e){let i;if(1===t)i=t=>t.setIconOriginForIconBottomCentered();else{if(2!==t)throw new Error("NOT_IMPLEMENTED - to have a group of >2 markers in a row, centered in the task, implement this piece of code");i=t=>{t.setIconOriginForIconBottomCentered();const i=Math.pow(-1,e)*(StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);t.translateIconOrigin(i,0)}}return i}}class BaseTaskShape extends BaseActivityShape{constructor(t,e,i,n){super(t,e,i,n)}paintForeground(t,e,i,n,r){super.paintForeground(t,e,i,n,r),this.paintTaskIcon(buildPaintParameter(t,e,i,n,r,this))}}class TaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintEmptyIcon()}}class ServiceTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintGearIcon(Object.assign(Object.assign({},t),{setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class UserTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},t),{setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class ReceiveTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){if(!StyleUtils.getBpmnIsInstantiating(this.style))return void paintEnvelopeIcon(t,!1);const e=Object.assign(Object.assign({},t.shape),{w:20,h:20});this.iconPainter.paintCircleIcon({c:t.c,shape:e,icon:Object.assign(Object.assign({},t.icon),{isFilled:!1}),ratioFromParent:void 0,setIconOrigin:t=>t.setIconOriginToShapeTopLeft(4,4)}),e.x+=4,e.y+=4,this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},t),{shape:e,ratioFromParent:.65,setIconOrigin:t=>t.setIconOriginForIconCentered()}))}}class SendTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){paintEnvelopeIcon(t,!0)}}class ManualTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintHandIcon(Object.assign(Object.assign({},t),{ratioFromParent:.18,setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class ScriptTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},t),{ratioFromParent:.22,setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class CallActivityShape extends BaseActivityShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THICK){super(t,e,i,n)}}class SubProcessShape extends BaseActivityShape{constructor(t,e,i,n){super(t,e,i,n)}paintBackground(t,e,i,n,r){const s=StyleUtils.getBpmnSubProcessKind(this.style);t.save(),s===ShapeBpmnSubProcessKind.EVENT&&(t.setDashed(!0,!1),t.setDashPattern("1 2")),super.paintBackground(t,e,i,n,r),t.restore()}}class BusinessRuleTaskShape extends BaseTaskShape{constructor(t,e,i,n){super(t,e,i,n)}paintTaskIcon(t){this.iconPainter.paintTableIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6,setIconOrigin:t=>t.setIconOriginToShapeTopLeftProportionally(15)}))}}class TextAnnotationShape extends mxgraph.mxRectangleShape{constructor(t,e,i,n=StyleDefault.STROKE_WIDTH_THIN){super(t,e,i,n),this.TEXT_ANNOTATION_BORDER_LENGTH=10}paintBackground(t,e,i,n,r){t.begin(),t.moveTo(e+this.TEXT_ANNOTATION_BORDER_LENGTH,i),t.lineTo(e,i),t.lineTo(e,i+r),t.lineTo(e+this.TEXT_ANNOTATION_BORDER_LENGTH,i+r),t.fillAndStroke()}}var MessageVisibleKind,FitType;!function(t){t.NONE="none",t.INITIATING="initiating",t.NON_INITIATING="non_initiating"}(MessageVisibleKind||(MessageVisibleKind={}));class MessageFlowIconShape extends mxgraph.mxRectangleShape{constructor(t,e,i,n){super(t,e,i,n),this.iconPainter=IconPainterProvider.get()}paintVertexShape(t,e,i,n,r){const s=buildPaintParameter(t,e,i,n,r,this,1,StyleUtils.getBpmnIsInitiating(this.style)===MessageVisibleKind.NON_INITIATING);this.iconPainter.paintEnvelopeIcon(s)}}function computeAllBpmnClassNames(t,e){const i=[];return i.push(computeBpmnBaseClassName(t)),e&&i.push("bpmn-label"),i}function computeBpmnBaseClassName(t){return t?"bpmn-"+t.replace(/([A-Z])/g,t=>"-"+t[0].toLowerCase()):""}function extractBpmnKindFromStyle(t){return t.style.split(";")[0]}class MxGraphCustomOverlay extends mxgraph.mxCellOverlay{constructor(t,e){super(null,"",null==e?void 0:e.horizontalAlign,null==e?void 0:e.verticalAlign,null,"default"),this.label=t}getBounds(t){const e=t.view.graph.getModel().isEdge(t.cell),i=t.view.scale;let n;if(e){const e=t.absolutePoints;if(e.length%2==1)n=e[Math.floor(e.length/2)];else{const t=e.length/2,i=e[t-1],r=e[t];n=new mxgraph.mxPoint(i.x+(r.x-i.x)/2,i.y+(r.y-i.y)/2)}}else n=new mxgraph.mxPoint,this.align==mxgraph.mxConstants.ALIGN_LEFT?n.x=t.x:this.align==mxgraph.mxConstants.ALIGN_CENTER?n.x=t.x+t.width/2:n.x=t.x+t.width,this.verticalAlign==mxgraph.mxConstants.ALIGN_TOP?n.y=t.y:this.verticalAlign==mxgraph.mxConstants.ALIGN_MIDDLE?n.y=t.y+t.height/2:n.y=t.y+t.height;return new mxgraph.mxRectangle(Math.round(n.x-(0*this.defaultOverlap-this.offset.x)*i),Math.round(n.y-(0*this.defaultOverlap-this.offset.y)*i),0*i,0*i)}}class OverlayBadgeShape extends mxgraph.mxText{constructor(t,e){super(t,e),this.border="black",this.background="white"}}class ShapeConfigurator{configureShapes(){this.initMxShapePrototype(),this.registerShapes(),this.initMxCellRendererCreateCellOverlays()}registerShapes(){mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.EVENT_END,EndEventShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.EVENT_START,StartEventShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW,ThrowIntermediateEventShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH,CatchIntermediateEventShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.EVENT_BOUNDARY,BoundaryEventShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.GATEWAY_EVENT_BASED,EventBasedGatewayShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,ExclusiveGatewayShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.GATEWAY_INCLUSIVE,InclusiveGatewayShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.GATEWAY_PARALLEL,ParallelGatewayShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.SUB_PROCESS,SubProcessShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.CALL_ACTIVITY,CallActivityShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK,TaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_SERVICE,ServiceTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_USER,UserTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_RECEIVE,ReceiveTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_SEND,SendTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_MANUAL,ManualTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_SCRIPT,ScriptTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TASK_BUSINESS_RULE,BusinessRuleTaskShape),mxgraph.mxCellRenderer.registerShape(ShapeBpmnElementKind.TEXT_ANNOTATION,TextAnnotationShape),mxgraph.mxCellRenderer.registerShape(StyleIdentifier.BPMN_STYLE_MESSAGE_FLOW_ICON,MessageFlowIconShape)}initMxShapePrototype(){mxgraph.mxShape.prototype.createSvgCanvas=function(){const t=new mxgraph.mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;const e=this.getSvgScreenOffset();if(0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),this.state&&this.state.cell){let t=computeAllBpmnClassNames(extractBpmnKindFromStyle(this.state.cell),this.dialect===mxgraph.mxConstants.DIALECT_STRICTHTML);const e=this.state.style[StyleIdentifier.BPMN_STYLE_EXTRA_CSS_CLASSES];e&&(t=t.concat(e)),this.node.setAttribute("class",t.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t}}initMxCellRendererCreateCellOverlays(){mxgraph.mxCellRenderer.prototype.createCellOverlays=function(t){const e=t.view.graph.getCellOverlays(t.cell);let i=null;if(null!=e){i=new mxgraph.mxDictionary;for(let n of e){const e=null!=t.overlays?t.overlays.remove(n):null;if(null!=e){i.put(n,e);continue}let r;n instanceof MxGraphCustomOverlay?r=new OverlayBadgeShape(n.label,new mxgraph.mxRectangle(0,0,0,0)):(r=new mxgraph.mxImageShape(new mxgraph.mxRectangle(0,0,0,0),n.image.src),r.preserveImageAspect=!1),r.dialect=t.view.graph.dialect,r.overlay=n,this.initializeOverlay(t,r),this.installCellOverlayListeners(t,n,r),null!=n.cursor&&(r.node.style.cursor=n.cursor),r instanceof OverlayBadgeShape&&(r.node.classList.add("overlay-badge"),r.node.setAttribute("data-bpmn-id",t.cell.id)),i.put(n,r)}}null!=t.overlays&&t.overlays.visit((function(t,e){e.destroy()})),t.overlays=i}}}class MarkerConfigurator{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){mxgraph.mxMarker.addMarker(MarkerIdentifier.ARROW_DASH,(t,e,i,n,r,s,o,l,a)=>{const h=r*(o+a+4),u=s*(o+a+4);return function(){t.begin(),t.moveTo(n.x-h/2-u/2,n.y-u/2+h/2),t.lineTo(n.x+u/2-3*h/2,n.y-3*u/2-h/2),t.stroke()}})}}function ensureInRange(t,e,i,n){let r=null==t?n:t;return r=Math.min(Math.max(r,e),i),r}function ensurePositiveValue(t){return Math.max(t||0,0)}function ensureValidZoomConfiguration(t){const e=null!=t?t:{};return e.debounceDelay=ensureInRange(e.debounceDelay,0,100,50),e.throttleDelay=ensureInRange(e.throttleDelay,0,100,50),e}!function(t){t.None="None",t.HorizontalVertical="HorizontalVertical",t.Horizontal="Horizontal",t.Vertical="Vertical",t.Center="Center"}(FitType||(FitType={}));var FUNC_ERROR_TEXT$1="Expected a function",NAN$1=NaN,symbolTag$1="[object Symbol]",reTrim$1=/^\s+|\s+$/g,reIsBadHex$1=/^[-+]0x[0-9a-f]+$/i,reIsBinary$1=/^0b[01]+$/i,reIsOctal$1=/^0o[0-7]+$/i,freeParseInt$1=parseInt,freeGlobal$1="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf$1="object"==typeof self&&self&&self.Object===Object&&self,root$1=freeGlobal$1||freeSelf$1||Function("return this")(),objectProto$1=Object.prototype,objectToString$1=objectProto$1.toString,nativeMax$1=Math.max,nativeMin$1=Math.min,now$1=function(){return root$1.Date.now()};function debounce$1(t,e,i){var n,r,s,o,l,a,h=0,u=!1,p=!1,d=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT$1);function c(e){var i=n,s=r;return n=r=void 0,h=e,o=t.apply(s,i)}function m(t){return h=t,l=setTimeout(x,e),u?c(t):o}function g(t){var i=t-a;return void 0===a||i>=e||i<0||p&&t-h>=s}function x(){var t=now$1();if(g(t))return f(t);l=setTimeout(x,function(t){var i=e-(t-a);return p?nativeMin$1(i,s-(t-h)):i}(t))}function f(t){return l=void 0,d&&n?c(t):(n=r=void 0,o)}function y(){var t=now$1(),i=g(t);if(n=arguments,r=this,a=t,i){if(void 0===l)return m(a);if(p)return l=setTimeout(x,e),c(a)}return void 0===l&&(l=setTimeout(x,e)),o}return e=toNumber$1(e)||0,isObject$1(i)&&(u=!!i.leading,s=(p="maxWait"in i)?nativeMax$1(toNumber$1(i.maxWait)||0,e):s,d="trailing"in i?!!i.trailing:d),y.cancel=function(){void 0!==l&&clearTimeout(l),h=0,n=a=r=l=void 0},y.flush=function(){return void 0===l?o:f(now$1())},y}function isObject$1(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function isObjectLike$1(t){return!!t&&"object"==typeof t}function isSymbol$1(t){return"symbol"==typeof t||isObjectLike$1(t)&&objectToString$1.call(t)==symbolTag$1}function toNumber$1(t){if("number"==typeof t)return t;if(isSymbol$1(t))return NAN$1;if(isObject$1(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=isObject$1(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(reTrim$1,"");var i=reIsBinary$1.test(t);return i||reIsOctal$1.test(t)?freeParseInt$1(t.slice(2),i?2:8):reIsBadHex$1.test(t)?NAN$1:+t}var lodash_debounce=debounce$1,FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};function debounce(t,e,i){var n,r,s,o,l,a,h=0,u=!1,p=!1,d=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);function c(e){var i=n,s=r;return n=r=void 0,h=e,o=t.apply(s,i)}function m(t){return h=t,l=setTimeout(x,e),u?c(t):o}function g(t){var i=t-a;return void 0===a||i>=e||i<0||p&&t-h>=s}function x(){var t=now();if(g(t))return f(t);l=setTimeout(x,function(t){var i=e-(t-a);return p?nativeMin(i,s-(t-h)):i}(t))}function f(t){return l=void 0,d&&n?c(t):(n=r=void 0,o)}function y(){var t=now(),i=g(t);if(n=arguments,r=this,a=t,i){if(void 0===l)return m(a);if(p)return l=setTimeout(x,e),c(a)}return void 0===l&&(l=setTimeout(x,e)),o}return e=toNumber(e)||0,isObject(i)&&(u=!!i.leading,s=(p="maxWait"in i)?nativeMax(toNumber(i.maxWait)||0,e):s,d="trailing"in i?!!i.trailing:d),y.cancel=function(){void 0!==l&&clearTimeout(l),h=0,n=a=r=l=void 0},y.flush=function(){return void 0===l?o:f(now())},y}function throttle(t,e,i){var n=!0,r=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);return isObject(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),debounce(t,e,{leading:n,maxWait:e,trailing:r})}function isObject(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function isObjectLike(t){return!!t&&"object"==typeof t}function isSymbol(t){return"symbol"==typeof t||isObjectLike(t)&&objectToString.call(t)==symbolTag}function toNumber(t){if("number"==typeof t)return t;if(isSymbol(t))return NAN;if(isObject(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=isObject(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(reTrim,"");var i=reIsBinary.test(t);return i||reIsOctal.test(t)?freeParseInt(t.slice(2),i?2:8):reIsBadHex.test(t)?NAN:+t}var lodash_throttle=throttle;class BpmnMxGraph extends mxgraph.mxGraph{constructor(t){super(t),this.container=t,this.cumulativeZoomFactor=1}fit(t,e,i,n,r,s,o){const l=super.fit(t,e,i,n,r,s,o);return this.cumulativeZoomFactor=l,l}zoomActual(){super.zoomActual(),this.cumulativeZoomFactor=this.view.scale}customFit(t){this.zoomActual();const e=null==t?void 0:t.type;if(null==e||e==FitType.None)return;const i=ensurePositiveValue(null==t?void 0:t.margin);if(e!=FitType.Center){let t=!1,n=!1;switch(e){case FitType.Horizontal:n=!0;break;case FitType.Vertical:t=!0}this.fit(this.border,!1,i,!0,t,n)}else{const t=3,e=this.getGraphBounds(),n=this.container.clientWidth-i,r=this.container.clientHeight-i,s=e.width/this.view.scale,o=e.height/this.view.scale,l=Math.min(t,Math.min(n/s,r/o));this.cumulativeZoomFactor=l,this.view.scaleAndTranslate(l,(i+n-s*l)/(2*l)-e.x/this.view.scale,(i+r-o*l)/(2*l)-e.y/this.view.scale)}}zoomTo(t,e,i,n,r,s){if(null===t){const[t,e,o]=this.getScaleAndTranslationDeltas(i,n,r);s&&this.view.scaleAndTranslate(t,this.view.translate.x+e,this.view.translate.y+o)}else super.zoomTo(t,e)}createMouseWheelZoomExperience(t){t=ensureValidZoomConfiguration(t),mxgraph.mxEvent.addMouseWheelListener(lodash_debounce(this.getZoomHandler(!0),t.debounceDelay),this.container),mxgraph.mxEvent.addMouseWheelListener(lodash_throttle(this.getZoomHandler(!1),t.throttleDelay),this.container)}performZoom(t,e,i){const[n,r]=this.getRelativeEventCoordinates(e);this.zoomTo(null,null,t,n,r,i),i&&mxgraph.mxEvent.consume(e)}getZoomHandler(t){return(e,i)=>{const n=e;if(mxgraph.mxEvent.isConsumed(n))return;(n.ctrlKey||mxgraph.mxClient.IS_MAC&&n.metaKey)&&!n.altKey&&!n.shiftKey&&this.performZoom(i,n,t)}}getRelativeEventCoordinates(t){const e=this.container.getBoundingClientRect();return[t.clientX-e.left,t.clientY-e.top]}getScaleAndTranslationDeltas(t,e,i){let n=2*e,r=2*i;const[s,o]=this.calculateFactorAndScale(t);return[n,r]=this.calculateTranslationDeltas(s,o,n,r),[o,n,r]}calculateTranslationDeltas(t,e,i,n){if(t>1){const r=(t-1)/(2*e);i*=-r,n*=-r}else{const e=(1/t-1)/(2*this.view.scale);i*=e,n*=e}return[i,n]}calculateFactorAndScale(t){this.cumulativeZoomFactor*=t?Math.sqrt(1.25):Math.sqrt(.8);let e=this.cumulativeZoomFactor/this.view.scale;const i=Math.round(this.view.scale*e*100)/100;return e=i/this.view.scale,[e,i]}}class MxGraphConfigurator{constructor(t){this.container=t,this.graph=new BpmnMxGraph(t)}configure(t){return this.configureGraph(),this.configureNavigationSupport(t),new StyleConfigurator(this.graph).configureStyles(),(new ShapeConfigurator).configureShapes(),(new MarkerConfigurator).configureMarkers(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}configureNavigationSupport(t){var e,i;const n=this.graph.panningHandler;(null===(e=null==t?void 0:t.navigation)||void 0===e?void 0:e.enabled)?(n.addListener(mxgraph.mxEvent.PAN_START,this.getPanningHandler("grab")),n.addListener(mxgraph.mxEvent.PAN_END,this.getPanningHandler("default")),this.graph.panningHandler.usePopupTrigger=!1,n.isForcePanningEvent=t=>mxgraph.mxEvent.isLeftMouseButton(t.getEvent())||mxgraph.mxEvent.isMultiTouchEvent(t.getEvent()),this.graph.setPanning(!0),this.graph.createMouseWheelZoomExperience(null===(i=null==t?void 0:t.navigation)||void 0===i?void 0:i.zoom)):(this.graph.setPanning(!1),n.setPinchEnabled(!1),n.isForcePanningEvent=t=>!1)}getPanningHandler(t){return this.getPanningHandlerCallback(t).bind(this.graph)}getPanningHandlerCallback(t){return function(){this.isEnabled()&&(this.container.style.cursor=t)}}}class CoordinatesTranslator{constructor(t){this.graph=t}computeRelativeCoordinates(t,e){const i=this.getTranslateForRoot(t),n=e.x+i.x,r=e.y+i.y;return new mxgraph.mxPoint(n,r)}getTranslateForRoot(t){const e=this.graph.getModel(),i=new mxgraph.mxPoint(0,0);for(;null!=t;){const n=e.getGeometry(t);null!=n&&(i.x-=n.x,i.y-=n.y),t=e.getParent(t)}return i}computeEdgeCenter(t){const e=t.geometry.points,i=e[0],n=e[e.length-1];if(null!=i&&null!=n){const t=n.x-i.x,e=n.y-i.y;return new mxgraph.mxPoint(i.x+t/2,i.y+e/2)}}}class MxGraphRenderer{constructor(t,e,i){this.graph=t,this.coordinatesTranslator=e,this.styleConfigurator=i}render(t,e){this.insertShapesAndEdges(t),this.graph.customFit(null==e?void 0:e.fit)}insertShapesAndEdges({pools:t,lanes:e,subprocesses:i,otherFlowNodes:n,boundaryEvents:r,edges:s}){const o=this.graph.getModel();o.clear(),o.beginUpdate();try{this.insertShapes(t),this.insertShapes(e),this.insertShapes(i),this.insertShapes(n),this.insertShapes(r),this.insertEdges(s)}finally{o.endUpdate()}}insertShapes(t){t.forEach(t=>{this.insertShape(t)})}getParent(t){const e=this.getCell(t.parentId);return e||(ShapeUtil.isBoundaryEvent(t.kind)?void 0:this.graph.getDefaultParent())}insertShape(t){var e;const i=t.bpmnElement;if(i){const n=this.getParent(i);if(!n)return void console.warn("Not possible to insert shape %s: parent cell %s is not found",i.id,i.parentId);const r=t.bounds;let s=null===(e=t.label)||void 0===e?void 0:e.bounds;s=ShapeUtil.isPoolOrLane(i.kind)?void 0:s;const o=this.styleConfigurator.computeStyle(t,s);this.insertVertex(n,i.id,i.name,r,s,o)}}insertEdges(t){t.forEach(t=>{var e;const i=t.bpmnElement;if(i){const n=this.graph.getDefaultParent(),r=this.getCell(i.sourceRefId),s=this.getCell(i.targetRefId),o=null===(e=t.label)||void 0===e?void 0:e.bounds,l=this.styleConfigurator.computeStyle(t,o),a=this.graph.insertEdge(n,i.id,i.name,r,s,l);if(this.insertWaypoints(t.waypoints,a),o){a.geometry.width=o.width,a.geometry.height=o.height;const t=this.coordinatesTranslator.computeEdgeCenter(a);if(t){a.geometry.relative=!1;const e=this.coordinatesTranslator.computeRelativeCoordinates(a.parent,new mxgraph.mxPoint(o.x,o.y)),i=e.x+o.width/2-t.x,n=e.y-t.y;a.geometry.offset=new mxgraph.mxPoint(i,n)}}this.insertMessageFlowIconIfNeeded(t,a)}})}insertMessageFlowIconIfNeeded(t,e){if(t.bpmnElement instanceof MessageFlow&&t.messageVisibleKind!==MessageVisibleKind.NONE){const i=this.graph.insertVertex(e,"messageFlowIcon_of_"+e.id,void 0,0,0,20,14,this.styleConfigurator.computeMessageFlowIconStyle(t));i.geometry.relative=!0,i.geometry.offset=new mxgraph.mxPoint(-10,-7)}}insertWaypoints(t,e){t&&(e.geometry.points=t.map(t=>this.coordinatesTranslator.computeRelativeCoordinates(e.parent,new mxgraph.mxPoint(t.x,t.y))))}getCell(t){return this.graph.getModel().getCell(t)}insertVertex(t,e,i,n,r,s){const o=this.coordinatesTranslator.computeRelativeCoordinates(t,new mxgraph.mxPoint(n.x,n.y)),l=this.graph.insertVertex(t,e,i,o.x,o.y,n.width,n.height,s);if(r){const t=r.x-n.x,e=r.y-n.y;l.geometry.offset=new mxgraph.mxPoint(t,e)}return l}}function newMxGraphRenderer(t){return new MxGraphRenderer(t,new CoordinatesTranslator(t),new StyleConfigurator(t))}var util=createCommonjsModule((function(t,e){const i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+i+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",r=new RegExp("^"+n+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,i){if(e){const n=Object.keys(e),r=n.length;for(let s=0;s1){n[o]=[];for(let i in t.child[o])t.child[o].hasOwnProperty(i)&&n[o].push(convertToJson(t.child[o][i],e,o))}else{const r=convertToJson(t.child[o][0],e,o),s=!0===e.arrayMode&&"object"==typeof r||util.isTagNameInArrayMode(o,e.arrayMode,i);n[o]=s?[r]:r}}return n};var convertToJson_1=convertToJson,node2json={convertToJson:convertToJson_1},xmlNode=function(t,e,i){this.tagname=t,this.parent=e,this.child={},this.attrsMap={},this.val=i,this.addChild=function(t){Array.isArray(this.child[t.tagname])?this.child[t.tagname].push(t):this.child[t.tagname]=[t]}};const buildOptions$3=util.buildOptions;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,util.nameRegexp),!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const defaultOptions$2={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",tagValueProcessor:function(t,e){return t},attrValueProcessor:function(t,e){return t},stopNodes:[]};var defaultOptions_1=defaultOptions$2;const props$2=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","stopNodes"];var props_1=props$2;function processTagValue(t,e,i){return e&&(i.trimValues&&(e=e.trim()),e=parseValue(e=i.tagValueProcessor(e,t),i.parseNodeValue,i.parseTrueNumberOnly)),e}function resolveNameSpace(t,e){if(e.ignoreNameSpace){const e=t.split(":"),i="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=i+e[1])}return t}function parseValue(t,e,i){if(e&&"string"==typeof t){let e;return""===t.trim()||isNaN(t)?e="true"===t||"false"!==t&&t:(-1!==t.indexOf("0x")?e=Number.parseInt(t,16):-1!==t.indexOf(".")?(e=Number.parseFloat(t),t=t.replace(/\.?0+$/,"")):e=Number.parseInt(t,10),i&&(e=String(e)===t?e:t)),e}return util.isExist(t)?t:""}const attrsRegx=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function buildAttributesMap(t,e){if(!e.ignoreAttributes&&"string"==typeof t){t=t.replace(/\r?\n/g," ");const i=util.getAllMatches(t,attrsRegx),n=i.length,r={};for(let t=0;t",i,"Closing Tag is not closed.");let o=t.substring(i+2,s).trim();if(e.ignoreNameSpace){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}n&&(n.val?n.val=util.getValue(n.val)+""+processTagValue(o,r,e):n.val=processTagValue(o,r,e)),e.stopNodes.length&&e.stopNodes.includes(n.tagname)&&(n.child=[],null==n.attrsMap&&(n.attrsMap={}),n.val=t.substr(n.startIndex+1,i-n.startIndex-1)),n=n.parent,r="",i=s}else if("?"===t[i+1])i=findClosingIndex(t,"?>",i,"Pi Tag is not closed.");else if("!--"===t.substr(i+1,3))i=findClosingIndex(t,"--\x3e",i,"Comment is not closed.");else if("!D"===t.substr(i+1,2)){const e=findClosingIndex(t,">",i,"DOCTYPE is not closed.");i=t.substring(i,e).indexOf("[")>=0?t.indexOf("]>",i)+1:e}else if("!["===t.substr(i+1,2)){const s=findClosingIndex(t,"]]>",i,"CDATA is not closed.")-2,o=t.substring(i+9,s);if(r&&(n.val=util.getValue(n.val)+""+processTagValue(n.tagname,r,e),r=""),e.cdataTagName){const t=new xmlNode(e.cdataTagName,n,o);n.addChild(t),n.val=util.getValue(n.val)+e.cdataPositionChar,o&&(t.val=o)}else n.val=(n.val||"")+(o||"");i=s+2}else{const s=closingIndexForOpeningTag(t,i+1);let o=s.data;const l=s.index,a=o.indexOf(" ");let h=o,u=!0;if(-1!==a&&(h=o.substr(0,a).replace(/\s\s*$/,""),o=o.substr(a+1)),e.ignoreNameSpace){const t=h.indexOf(":");-1!==t&&(h=h.substr(t+1),u=h!==s.data.substr(t+1))}if(n&&r&&"!xml"!==n.tagname&&(n.val=util.getValue(n.val)+""+processTagValue(n.tagname,r,e)),o.length>0&&o.lastIndexOf("/")===o.length-1){"/"===h[h.length-1]?(h=h.substr(0,h.length-1),o=h):o=o.substr(0,o.length-1);const t=new xmlNode(h,n,"");h!==o&&(t.attrsMap=buildAttributesMap(o,e)),n.addChild(t)}else{const t=new xmlNode(h,n);e.stopNodes.length&&e.stopNodes.includes(t.tagname)&&(t.startIndex=l),h!==o&&u&&(t.attrsMap=buildAttributesMap(o,e)),n.addChild(t),n=t}r="",i=l}else r+=t[i]}return i};function closingIndexForOpeningTag(t,e){let i,n="";for(let r=e;r"===e)return{data:n,index:r};"\t"===e&&(e=" ")}n+=e}}function findClosingIndex(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}var getTraversalObj_1=getTraversalObj,xmlstr2xmlnode={defaultOptions:defaultOptions_1,props:props_1,getTraversalObj:getTraversalObj_1};const defaultOptions$1={allowBooleanAttributes:!1},props$1=["allowBooleanAttributes"];var validate=function(t,e){e=util.buildOptions(e,defaultOptions$1,props$1);const i=[];let n=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let s=0;s"!==t[s]&&" "!==t[s]&&"\t"!==t[s]&&"\n"!==t[s]&&"\r"!==t[s];s++)l+=t[s];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),s--),!validateTagName(l)){let e;return e=0===l.trim().length?"There is an unnecessary space between tag name and backward slash '0)return getErrorObject("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",getLineNumberForPosition(t,s));{const e=i.pop();if(l!==e)return getErrorObject("InvalidTag","Closing tag '"+e+"' is expected inplace of '"+l+"'.",getLineNumberForPosition(t,s));0==i.length&&(r=!0)}}else{const o=validateAttributeString(h,e);if(!0!==o)return getErrorObject(o.err.code,o.err.msg,getLineNumberForPosition(t,s-h.length+o.err.line));if(!0===r)return getErrorObject("InvalidXml","Multiple possible root nodes found.",getLineNumberForPosition(t,s));i.push(l),n=!0}for(s++;s0)||getErrorObject("InvalidXml","Invalid '"+JSON.stringify(i,null,4).replace(/\r?\n/g,"")+"' found.",1):getErrorObject("InvalidXml","Start tag expected.",1)};function readPI(t,e){for(var i=e;e5&&"xml"===n)return getErrorObject("InvalidXml","XML declaration allowed only at the start of the document.",getLineNumberForPosition(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function readCommentAndCDATA(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let i=1;for(e+=8;e"===t[e]&&(i--,0===i))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}var doubleQuote='"',singleQuote="'";function readAttributeStr(t,e){let i="",n="",r=!1;for(;e"===t[e]&&""===n){r=!0;break}i+=t[e]}return""===n&&{value:i,index:e,tagClosed:r}}const validAttrStrRegxp=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function validateAttributeString(t,e){const i=util.getAllMatches(t,validAttrStrRegxp),n={};for(let r=0;r1){for(var o in n+='"'+s+'" : [ ',t.child[s])n+=_cToJsonStr(t.child[s][o],e)+" , ";n=n.substr(0,n.length-1)+" ] "}else n+='"'+s+'" : '+_cToJsonStr(t.child[s][0],e)+" ,"}return util.merge(n,t.attrsMap),util.isEmptyObject(n)?util.isExist(t.val)?t.val:"":(util.isExist(t.val)&&("string"!=typeof t.val||""!==t.val&&t.val!==e.cdataPositionChar)&&(n+='"'+e.textNodeName+'" : '+stringval(t.val)),","===n[n.length-1]&&(n=n.substr(0,n.length-2)),n+"}")};function stringval(t){return!0!==t&&!1!==t&&isNaN(t)?'"'+t+'"':t}var convertToJsonString_1=convertToJsonString,node2json_str={convertToJsonString:convertToJsonString_1};const buildOptions=util.buildOptions,defaultOptions={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataTagName:!1,cdataPositionChar:"\\c",format:!1,indentBy:" ",supressEmptyNode:!1,tagValueProcessor:function(t){return t},attrValueProcessor:function(t){return t}},props=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","cdataTagName","cdataPositionChar","format","indentBy","supressEmptyNode","tagValueProcessor","attrValueProcessor"];function Parser(t){this.options=buildOptions(t,defaultOptions,props),this.options.ignoreAttributes||this.options.attrNodeName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=isAttribute),this.options.cdataTagName?this.isCDATA=isCDATA:this.isCDATA=function(){return!1},this.replaceCDATAstr=replaceCDATAstr,this.replaceCDATAarr=replaceCDATAarr,this.options.format?(this.indentate=indentate,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.supressEmptyNode?(this.buildTextNode=buildEmptyTextNode,this.buildObjNode=buildEmptyObjNode):(this.buildTextNode=buildTextValNode,this.buildObjNode=buildObjectNode),this.buildTextValNode=buildTextValNode,this.buildObjectNode=buildObjectNode}function replaceCDATAstr(t,e){return t=this.options.tagValueProcessor(""+t),""===this.options.cdataPositionChar||""===t?t+"");return t+this.newLine}function buildObjectNode(t,e,i,n){return i&&!t.includes("<")?this.indentate(n)+"<"+e+i+">"+t+""+this.options.tagValueProcessor(t)+"",GT$1=">",Gt="≫",gtdot="⋗",gtlPar="⦕",gtquest="⩼",gtrapprox="⪆",gtrarr="⥸",gtrdot="⋗",gtreqless="⋛",gtreqqless="⪌",gtrless="≷",gtrsim="≳",gvertneqq="≩︀",gvnE="≩︀",Hacek="ˇ",hairsp=" ",half="½",hamilt="ℋ",HARDcy="Ъ",hardcy="ъ",harrcir="⥈",harr="↔",hArr="⇔",harrw="↭",Hat="^",hbar="ℏ",Hcirc="Ĥ",hcirc="ĥ",hearts="♥",heartsuit="♥",hellip="…",hercon="⊹",hfr="𝔥",Hfr="ℌ",HilbertSpace="ℋ",hksearow="⤥",hkswarow="⤦",hoarr="⇿",homtht="∻",hookleftarrow="↩",hookrightarrow="↪",hopf="𝕙",Hopf="ℍ",horbar="―",HorizontalLine="─",hscr="𝒽",Hscr="ℋ",hslash="ℏ",Hstrok="Ħ",hstrok="ħ",HumpDownHump="≎",HumpEqual="≏",hybull="⁃",hyphen="‐",Iacute$1="Í",iacute$1="í",ic="⁣",Icirc$1="Î",icirc$1="î",Icy="И",icy="и",Idot="İ",IEcy="Е",iecy="е",iexcl$1="¡",iff="⇔",ifr="𝔦",Ifr="ℑ",Igrave$1="Ì",igrave$1="ì",ii="ⅈ",iiiint="⨌",iiint="∭",iinfin="⧜",iiota="℩",IJlig="IJ",ijlig="ij",Imacr="Ī",imacr="ī",image="ℑ",ImaginaryI="ⅈ",imagline="ℐ",imagpart="ℑ",imath="ı",Im="ℑ",imof="⊷",imped="Ƶ",Implies="⇒",incare="℅",infin="∞",infintie="⧝",inodot="ı",intcal="⊺",int="∫",Int="∬",integers="ℤ",Integral="∫",intercal="⊺",Intersection="⋂",intlarhk="⨗",intprod="⨼",InvisibleComma="⁣",InvisibleTimes="⁢",IOcy="Ё",iocy="ё",Iogon="Į",iogon="į",Iopf="𝕀",iopf="𝕚",Iota="Ι",iota="ι",iprod="⨼",iquest$1="¿",iscr="𝒾",Iscr="ℐ",isin="∈",isindot="⋵",isinE="⋹",isins="⋴",isinsv="⋳",isinv="∈",it="⁢",Itilde="Ĩ",itilde="ĩ",Iukcy="І",iukcy="і",Iuml$1="Ï",iuml$1="ï",Jcirc="Ĵ",jcirc="ĵ",Jcy="Й",jcy="й",Jfr="𝔍",jfr="𝔧",jmath="ȷ",Jopf="𝕁",jopf="𝕛",Jscr="𝒥",jscr="𝒿",Jsercy="Ј",jsercy="ј",Jukcy="Є",jukcy="є",Kappa="Κ",kappa="κ",kappav="ϰ",Kcedil="Ķ",kcedil="ķ",Kcy="К",kcy="к",Kfr="𝔎",kfr="𝔨",kgreen="ĸ",KHcy="Х",khcy="х",KJcy="Ќ",kjcy="ќ",Kopf="𝕂",kopf="𝕜",Kscr="𝒦",kscr="𝓀",lAarr="⇚",Lacute="Ĺ",lacute="ĺ",laemptyv="⦴",lagran="ℒ",Lambda="Λ",lambda="λ",lang="⟨",Lang="⟪",langd="⦑",langle="⟨",lap="⪅",Laplacetrf="ℒ",laquo$1="«",larrb="⇤",larrbfs="⤟",larr="←",Larr="↞",lArr="⇐",larrfs="⤝",larrhk="↩",larrlp="↫",larrpl="⤹",larrsim="⥳",larrtl="↢",latail="⤙",lAtail="⤛",lat="⪫",late="⪭",lates="⪭︀",lbarr="⤌",lBarr="⤎",lbbrk="❲",lbrace="{",lbrack="[",lbrke="⦋",lbrksld="⦏",lbrkslu="⦍",Lcaron="Ľ",lcaron="ľ",Lcedil="Ļ",lcedil="ļ",lceil="⌈",lcub="{",Lcy="Л",lcy="л",ldca="⤶",ldquo="“",ldquor="„",ldrdhar="⥧",ldrushar="⥋",ldsh="↲",le="≤",lE="≦",LeftAngleBracket="⟨",LeftArrowBar="⇤",leftarrow="←",LeftArrow="←",Leftarrow="⇐",LeftArrowRightArrow="⇆",leftarrowtail="↢",LeftCeiling="⌈",LeftDoubleBracket="⟦",LeftDownTeeVector="⥡",LeftDownVectorBar="⥙",LeftDownVector="⇃",LeftFloor="⌊",leftharpoondown="↽",leftharpoonup="↼",leftleftarrows="⇇",leftrightarrow="↔",LeftRightArrow="↔",Leftrightarrow="⇔",leftrightarrows="⇆",leftrightharpoons="⇋",leftrightsquigarrow="↭",LeftRightVector="⥎",LeftTeeArrow="↤",LeftTee="⊣",LeftTeeVector="⥚",leftthreetimes="⋋",LeftTriangleBar="⧏",LeftTriangle="⊲",LeftTriangleEqual="⊴",LeftUpDownVector="⥑",LeftUpTeeVector="⥠",LeftUpVectorBar="⥘",LeftUpVector="↿",LeftVectorBar="⥒",LeftVector="↼",lEg="⪋",leg="⋚",leq="≤",leqq="≦",leqslant="⩽",lescc="⪨",les="⩽",lesdot="⩿",lesdoto="⪁",lesdotor="⪃",lesg="⋚︀",lesges="⪓",lessapprox="⪅",lessdot="⋖",lesseqgtr="⋚",lesseqqgtr="⪋",LessEqualGreater="⋚",LessFullEqual="≦",LessGreater="≶",lessgtr="≶",LessLess="⪡",lesssim="≲",LessSlantEqual="⩽",LessTilde="≲",lfisht="⥼",lfloor="⌊",Lfr="𝔏",lfr="𝔩",lg="≶",lgE="⪑",lHar="⥢",lhard="↽",lharu="↼",lharul="⥪",lhblk="▄",LJcy="Љ",ljcy="љ",llarr="⇇",ll="≪",Ll="⋘",llcorner="⌞",Lleftarrow="⇚",llhard="⥫",lltri="◺",Lmidot="Ŀ",lmidot="ŀ",lmoustache="⎰",lmoust="⎰",lnap="⪉",lnapprox="⪉",lne="⪇",lnE="≨",lneq="⪇",lneqq="≨",lnsim="⋦",loang="⟬",loarr="⇽",lobrk="⟦",longleftarrow="⟵",LongLeftArrow="⟵",Longleftarrow="⟸",longleftrightarrow="⟷",LongLeftRightArrow="⟷",Longleftrightarrow="⟺",longmapsto="⟼",longrightarrow="⟶",LongRightArrow="⟶",Longrightarrow="⟹",looparrowleft="↫",looparrowright="↬",lopar="⦅",Lopf="𝕃",lopf="𝕝",loplus="⨭",lotimes="⨴",lowast="∗",lowbar="_",LowerLeftArrow="↙",LowerRightArrow="↘",loz="◊",lozenge="◊",lozf="⧫",lpar="(",lparlt="⦓",lrarr="⇆",lrcorner="⌟",lrhar="⇋",lrhard="⥭",lrm="‎",lrtri="⊿",lsaquo="‹",lscr="𝓁",Lscr="ℒ",lsh="↰",Lsh="↰",lsim="≲",lsime="⪍",lsimg="⪏",lsqb="[",lsquo="‘",lsquor="‚",Lstrok="Ł",lstrok="ł",ltcc="⪦",ltcir="⩹",lt$2="<",LT$1="<",Lt="≪",ltdot="⋖",lthree="⋋",ltimes="⋉",ltlarr="⥶",ltquest="⩻",ltri="◃",ltrie="⊴",ltrif="◂",ltrPar="⦖",lurdshar="⥊",luruhar="⥦",lvertneqq="≨︀",lvnE="≨︀",macr$1="¯",male="♂",malt="✠",maltese="✠",map="↦",mapsto="↦",mapstodown="↧",mapstoleft="↤",mapstoup="↥",marker="▮",mcomma="⨩",Mcy="М",mcy="м",mdash="—",mDDot="∺",measuredangle="∡",MediumSpace=" ",Mellintrf="ℳ",Mfr="𝔐",mfr="𝔪",mho="℧",micro$1="µ",midast="*",midcir="⫰",mid="∣",middot$1="·",minusb="⊟",minus="−",minusd="∸",minusdu="⨪",MinusPlus="∓",mlcp="⫛",mldr="…",mnplus="∓",models="⊧",Mopf="𝕄",mopf="𝕞",mp="∓",mscr="𝓂",Mscr="ℳ",mstpos="∾",Mu="Μ",mu="μ",multimap="⊸",mumap="⊸",nabla="∇",Nacute="Ń",nacute="ń",nang="∠⃒",nap="≉",napE="⩰̸",napid="≋̸",napos="ʼn",napprox="≉",natural="♮",naturals="ℕ",natur="♮",nbsp$1=" ",nbump="≎̸",nbumpe="≏̸",ncap="⩃",Ncaron="Ň",ncaron="ň",Ncedil="Ņ",ncedil="ņ",ncong="≇",ncongdot="⩭̸",ncup="⩂",Ncy="Н",ncy="н",ndash="–",nearhk="⤤",nearr="↗",neArr="⇗",nearrow="↗",ne="≠",nedot="≐̸",NegativeMediumSpace="​",NegativeThickSpace="​",NegativeThinSpace="​",NegativeVeryThinSpace="​",nequiv="≢",nesear="⤨",nesim="≂̸",NestedGreaterGreater="≫",NestedLessLess="≪",NewLine="\n",nexist="∄",nexists="∄",Nfr="𝔑",nfr="𝔫",ngE="≧̸",nge="≱",ngeq="≱",ngeqq="≧̸",ngeqslant="⩾̸",nges="⩾̸",nGg="⋙̸",ngsim="≵",nGt="≫⃒",ngt="≯",ngtr="≯",nGtv="≫̸",nharr="↮",nhArr="⇎",nhpar="⫲",ni="∋",nis="⋼",nisd="⋺",niv="∋",NJcy="Њ",njcy="њ",nlarr="↚",nlArr="⇍",nldr="‥",nlE="≦̸",nle="≰",nleftarrow="↚",nLeftarrow="⇍",nleftrightarrow="↮",nLeftrightarrow="⇎",nleq="≰",nleqq="≦̸",nleqslant="⩽̸",nles="⩽̸",nless="≮",nLl="⋘̸",nlsim="≴",nLt="≪⃒",nlt="≮",nltri="⋪",nltrie="⋬",nLtv="≪̸",nmid="∤",NoBreak="⁠",NonBreakingSpace=" ",nopf="𝕟",Nopf="ℕ",Not="⫬",not$1="¬",NotCongruent="≢",NotCupCap="≭",NotDoubleVerticalBar="∦",NotElement="∉",NotEqual="≠",NotEqualTilde="≂̸",NotExists="∄",NotGreater="≯",NotGreaterEqual="≱",NotGreaterFullEqual="≧̸",NotGreaterGreater="≫̸",NotGreaterLess="≹",NotGreaterSlantEqual="⩾̸",NotGreaterTilde="≵",NotHumpDownHump="≎̸",NotHumpEqual="≏̸",notin="∉",notindot="⋵̸",notinE="⋹̸",notinva="∉",notinvb="⋷",notinvc="⋶",NotLeftTriangleBar="⧏̸",NotLeftTriangle="⋪",NotLeftTriangleEqual="⋬",NotLess="≮",NotLessEqual="≰",NotLessGreater="≸",NotLessLess="≪̸",NotLessSlantEqual="⩽̸",NotLessTilde="≴",NotNestedGreaterGreater="⪢̸",NotNestedLessLess="⪡̸",notni="∌",notniva="∌",notnivb="⋾",notnivc="⋽",NotPrecedes="⊀",NotPrecedesEqual="⪯̸",NotPrecedesSlantEqual="⋠",NotReverseElement="∌",NotRightTriangleBar="⧐̸",NotRightTriangle="⋫",NotRightTriangleEqual="⋭",NotSquareSubset="⊏̸",NotSquareSubsetEqual="⋢",NotSquareSuperset="⊐̸",NotSquareSupersetEqual="⋣",NotSubset="⊂⃒",NotSubsetEqual="⊈",NotSucceeds="⊁",NotSucceedsEqual="⪰̸",NotSucceedsSlantEqual="⋡",NotSucceedsTilde="≿̸",NotSuperset="⊃⃒",NotSupersetEqual="⊉",NotTilde="≁",NotTildeEqual="≄",NotTildeFullEqual="≇",NotTildeTilde="≉",NotVerticalBar="∤",nparallel="∦",npar="∦",nparsl="⫽⃥",npart="∂̸",npolint="⨔",npr="⊀",nprcue="⋠",nprec="⊀",npreceq="⪯̸",npre="⪯̸",nrarrc="⤳̸",nrarr="↛",nrArr="⇏",nrarrw="↝̸",nrightarrow="↛",nRightarrow="⇏",nrtri="⋫",nrtrie="⋭",nsc="⊁",nsccue="⋡",nsce="⪰̸",Nscr="𝒩",nscr="𝓃",nshortmid="∤",nshortparallel="∦",nsim="≁",nsime="≄",nsimeq="≄",nsmid="∤",nspar="∦",nsqsube="⋢",nsqsupe="⋣",nsub="⊄",nsubE="⫅̸",nsube="⊈",nsubset="⊂⃒",nsubseteq="⊈",nsubseteqq="⫅̸",nsucc="⊁",nsucceq="⪰̸",nsup="⊅",nsupE="⫆̸",nsupe="⊉",nsupset="⊃⃒",nsupseteq="⊉",nsupseteqq="⫆̸",ntgl="≹",Ntilde$1="Ñ",ntilde$1="ñ",ntlg="≸",ntriangleleft="⋪",ntrianglelefteq="⋬",ntriangleright="⋫",ntrianglerighteq="⋭",Nu="Ν",nu="ν",num="#",numero="№",numsp=" ",nvap="≍⃒",nvdash="⊬",nvDash="⊭",nVdash="⊮",nVDash="⊯",nvge="≥⃒",nvgt=">⃒",nvHarr="⤄",nvinfin="⧞",nvlArr="⤂",nvle="≤⃒",nvlt="<⃒",nvltrie="⊴⃒",nvrArr="⤃",nvrtrie="⊵⃒",nvsim="∼⃒",nwarhk="⤣",nwarr="↖",nwArr="⇖",nwarrow="↖",nwnear="⤧",Oacute$1="Ó",oacute$1="ó",oast="⊛",Ocirc$1="Ô",ocirc$1="ô",ocir="⊚",Ocy="О",ocy="о",odash="⊝",Odblac="Ő",odblac="ő",odiv="⨸",odot="⊙",odsold="⦼",OElig="Œ",oelig="œ",ofcir="⦿",Ofr="𝔒",ofr="𝔬",ogon="˛",Ograve$1="Ò",ograve$1="ò",ogt="⧁",ohbar="⦵",ohm="Ω",oint="∮",olarr="↺",olcir="⦾",olcross="⦻",oline="‾",olt="⧀",Omacr="Ō",omacr="ō",Omega="Ω",omega="ω",Omicron="Ο",omicron="ο",omid="⦶",ominus="⊖",Oopf="𝕆",oopf="𝕠",opar="⦷",OpenCurlyDoubleQuote="“",OpenCurlyQuote="‘",operp="⦹",oplus="⊕",orarr="↻",Or="⩔",or="∨",ord="⩝",order="ℴ",orderof="ℴ",ordf$1="ª",ordm$1="º",origof="⊶",oror="⩖",orslope="⩗",orv="⩛",oS="Ⓢ",Oscr="𝒪",oscr="ℴ",Oslash$1="Ø",oslash$1="ø",osol="⊘",Otilde$1="Õ",otilde$1="õ",otimesas="⨶",Otimes="⨷",otimes="⊗",Ouml$1="Ö",ouml$1="ö",ovbar="⌽",OverBar="‾",OverBrace="⏞",OverBracket="⎴",OverParenthesis="⏜",para$1="¶",parallel="∥",par="∥",parsim="⫳",parsl="⫽",part="∂",PartialD="∂",Pcy="П",pcy="п",percnt="%",period=".",permil="‰",perp="⊥",pertenk="‱",Pfr="𝔓",pfr="𝔭",Phi="Φ",phi="φ",phiv="ϕ",phmmat="ℳ",phone="☎",Pi="Π",pi="π",pitchfork="⋔",piv="ϖ",planck="ℏ",planckh="ℎ",plankv="ℏ",plusacir="⨣",plusb="⊞",pluscir="⨢",plus="+",plusdo="∔",plusdu="⨥",pluse="⩲",PlusMinus="±",plusmn$1="±",plussim="⨦",plustwo="⨧",pm="±",Poincareplane="ℌ",pointint="⨕",popf="𝕡",Popf="ℙ",pound$1="£",prap="⪷",Pr="⪻",pr="≺",prcue="≼",precapprox="⪷",prec="≺",preccurlyeq="≼",Precedes="≺",PrecedesEqual="⪯",PrecedesSlantEqual="≼",PrecedesTilde="≾",preceq="⪯",precnapprox="⪹",precneqq="⪵",precnsim="⋨",pre="⪯",prE="⪳",precsim="≾",prime="′",Prime="″",primes="ℙ",prnap="⪹",prnE="⪵",prnsim="⋨",prod="∏",Product="∏",profalar="⌮",profline="⌒",profsurf="⌓",prop="∝",Proportional="∝",Proportion="∷",propto="∝",prsim="≾",prurel="⊰",Pscr="𝒫",pscr="𝓅",Psi="Ψ",psi="ψ",puncsp=" ",Qfr="𝔔",qfr="𝔮",qint="⨌",qopf="𝕢",Qopf="ℚ",qprime="⁗",Qscr="𝒬",qscr="𝓆",quaternions="ℍ",quatint="⨖",quest="?",questeq="≟",quot$2='"',QUOT$1='"',rAarr="⇛",race="∽̱",Racute="Ŕ",racute="ŕ",radic="√",raemptyv="⦳",rang="⟩",Rang="⟫",rangd="⦒",range="⦥",rangle="⟩",raquo$1="»",rarrap="⥵",rarrb="⇥",rarrbfs="⤠",rarrc="⤳",rarr="→",Rarr="↠",rArr="⇒",rarrfs="⤞",rarrhk="↪",rarrlp="↬",rarrpl="⥅",rarrsim="⥴",Rarrtl="⤖",rarrtl="↣",rarrw="↝",ratail="⤚",rAtail="⤜",ratio="∶",rationals="ℚ",rbarr="⤍",rBarr="⤏",RBarr="⤐",rbbrk="❳",rbrace="}",rbrack="]",rbrke="⦌",rbrksld="⦎",rbrkslu="⦐",Rcaron="Ř",rcaron="ř",Rcedil="Ŗ",rcedil="ŗ",rceil="⌉",rcub="}",Rcy="Р",rcy="р",rdca="⤷",rdldhar="⥩",rdquo="”",rdquor="”",rdsh="↳",real="ℜ",realine="ℛ",realpart="ℜ",reals="ℝ",Re="ℜ",rect="▭",reg$1="®",REG$1="®",ReverseElement="∋",ReverseEquilibrium="⇋",ReverseUpEquilibrium="⥯",rfisht="⥽",rfloor="⌋",rfr="𝔯",Rfr="ℜ",rHar="⥤",rhard="⇁",rharu="⇀",rharul="⥬",Rho="Ρ",rho="ρ",rhov="ϱ",RightAngleBracket="⟩",RightArrowBar="⇥",rightarrow="→",RightArrow="→",Rightarrow="⇒",RightArrowLeftArrow="⇄",rightarrowtail="↣",RightCeiling="⌉",RightDoubleBracket="⟧",RightDownTeeVector="⥝",RightDownVectorBar="⥕",RightDownVector="⇂",RightFloor="⌋",rightharpoondown="⇁",rightharpoonup="⇀",rightleftarrows="⇄",rightleftharpoons="⇌",rightrightarrows="⇉",rightsquigarrow="↝",RightTeeArrow="↦",RightTee="⊢",RightTeeVector="⥛",rightthreetimes="⋌",RightTriangleBar="⧐",RightTriangle="⊳",RightTriangleEqual="⊵",RightUpDownVector="⥏",RightUpTeeVector="⥜",RightUpVectorBar="⥔",RightUpVector="↾",RightVectorBar="⥓",RightVector="⇀",ring="˚",risingdotseq="≓",rlarr="⇄",rlhar="⇌",rlm="‏",rmoustache="⎱",rmoust="⎱",rnmid="⫮",roang="⟭",roarr="⇾",robrk="⟧",ropar="⦆",ropf="𝕣",Ropf="ℝ",roplus="⨮",rotimes="⨵",RoundImplies="⥰",rpar=")",rpargt="⦔",rppolint="⨒",rrarr="⇉",Rrightarrow="⇛",rsaquo="›",rscr="𝓇",Rscr="ℛ",rsh="↱",Rsh="↱",rsqb="]",rsquo="’",rsquor="’",rthree="⋌",rtimes="⋊",rtri="▹",rtrie="⊵",rtrif="▸",rtriltri="⧎",RuleDelayed="⧴",ruluhar="⥨",rx="℞",Sacute="Ś",sacute="ś",sbquo="‚",scap="⪸",Scaron="Š",scaron="š",Sc="⪼",sc="≻",sccue="≽",sce="⪰",scE="⪴",Scedil="Ş",scedil="ş",Scirc="Ŝ",scirc="ŝ",scnap="⪺",scnE="⪶",scnsim="⋩",scpolint="⨓",scsim="≿",Scy="С",scy="с",sdotb="⊡",sdot="⋅",sdote="⩦",searhk="⤥",searr="↘",seArr="⇘",searrow="↘",sect$1="§",semi=";",seswar="⤩",setminus="∖",setmn="∖",sext="✶",Sfr="𝔖",sfr="𝔰",sfrown="⌢",sharp="♯",SHCHcy="Щ",shchcy="щ",SHcy="Ш",shcy="ш",ShortDownArrow="↓",ShortLeftArrow="←",shortmid="∣",shortparallel="∥",ShortRightArrow="→",ShortUpArrow="↑",shy$1="­",Sigma="Σ",sigma="σ",sigmaf="ς",sigmav="ς",sim="∼",simdot="⩪",sime="≃",simeq="≃",simg="⪞",simgE="⪠",siml="⪝",simlE="⪟",simne="≆",simplus="⨤",simrarr="⥲",slarr="←",SmallCircle="∘",smallsetminus="∖",smashp="⨳",smeparsl="⧤",smid="∣",smile="⌣",smt="⪪",smte="⪬",smtes="⪬︀",SOFTcy="Ь",softcy="ь",solbar="⌿",solb="⧄",sol="/",Sopf="𝕊",sopf="𝕤",spades="♠",spadesuit="♠",spar="∥",sqcap="⊓",sqcaps="⊓︀",sqcup="⊔",sqcups="⊔︀",Sqrt="√",sqsub="⊏",sqsube="⊑",sqsubset="⊏",sqsubseteq="⊑",sqsup="⊐",sqsupe="⊒",sqsupset="⊐",sqsupseteq="⊒",square="□",Square="□",SquareIntersection="⊓",SquareSubset="⊏",SquareSubsetEqual="⊑",SquareSuperset="⊐",SquareSupersetEqual="⊒",SquareUnion="⊔",squarf="▪",squ="□",squf="▪",srarr="→",Sscr="𝒮",sscr="𝓈",ssetmn="∖",ssmile="⌣",sstarf="⋆",Star="⋆",star="☆",starf="★",straightepsilon="ϵ",straightphi="ϕ",strns="¯",sub="⊂",Sub="⋐",subdot="⪽",subE="⫅",sube="⊆",subedot="⫃",submult="⫁",subnE="⫋",subne="⊊",subplus="⪿",subrarr="⥹",subset="⊂",Subset="⋐",subseteq="⊆",subseteqq="⫅",SubsetEqual="⊆",subsetneq="⊊",subsetneqq="⫋",subsim="⫇",subsub="⫕",subsup="⫓",succapprox="⪸",succ="≻",succcurlyeq="≽",Succeeds="≻",SucceedsEqual="⪰",SucceedsSlantEqual="≽",SucceedsTilde="≿",succeq="⪰",succnapprox="⪺",succneqq="⪶",succnsim="⋩",succsim="≿",SuchThat="∋",sum="∑",Sum="∑",sung="♪",sup1$1="¹",sup2$1="²",sup3$1="³",sup="⊃",Sup="⋑",supdot="⪾",supdsub="⫘",supE="⫆",supe="⊇",supedot="⫄",Superset="⊃",SupersetEqual="⊇",suphsol="⟉",suphsub="⫗",suplarr="⥻",supmult="⫂",supnE="⫌",supne="⊋",supplus="⫀",supset="⊃",Supset="⋑",supseteq="⊇",supseteqq="⫆",supsetneq="⊋",supsetneqq="⫌",supsim="⫈",supsub="⫔",supsup="⫖",swarhk="⤦",swarr="↙",swArr="⇙",swarrow="↙",swnwar="⤪",szlig$1="ß",Tab="\t",target="⌖",Tau="Τ",tau="τ",tbrk="⎴",Tcaron="Ť",tcaron="ť",Tcedil="Ţ",tcedil="ţ",Tcy="Т",tcy="т",tdot="⃛",telrec="⌕",Tfr="𝔗",tfr="𝔱",there4="∴",therefore="∴",Therefore="∴",Theta="Θ",theta="θ",thetasym="ϑ",thetav="ϑ",thickapprox="≈",thicksim="∼",ThickSpace="  ",ThinSpace=" ",thinsp=" ",thkap="≈",thksim="∼",THORN$1="Þ",thorn$1="þ",tilde="˜",Tilde="∼",TildeEqual="≃",TildeFullEqual="≅",TildeTilde="≈",timesbar="⨱",timesb="⊠",times$1="×",timesd="⨰",tint="∭",toea="⤨",topbot="⌶",topcir="⫱",top="⊤",Topf="𝕋",topf="𝕥",topfork="⫚",tosa="⤩",tprime="‴",trade="™",TRADE="™",triangle="▵",triangledown="▿",triangleleft="◃",trianglelefteq="⊴",triangleq="≜",triangleright="▹",trianglerighteq="⊵",tridot="◬",trie="≜",triminus="⨺",TripleDot="⃛",triplus="⨹",trisb="⧍",tritime="⨻",trpezium="⏢",Tscr="𝒯",tscr="𝓉",TScy="Ц",tscy="ц",TSHcy="Ћ",tshcy="ћ",Tstrok="Ŧ",tstrok="ŧ",twixt="≬",twoheadleftarrow="↞",twoheadrightarrow="↠",Uacute$1="Ú",uacute$1="ú",uarr="↑",Uarr="↟",uArr="⇑",Uarrocir="⥉",Ubrcy="Ў",ubrcy="ў",Ubreve="Ŭ",ubreve="ŭ",Ucirc$1="Û",ucirc$1="û",Ucy="У",ucy="у",udarr="⇅",Udblac="Ű",udblac="ű",udhar="⥮",ufisht="⥾",Ufr="𝔘",ufr="𝔲",Ugrave$1="Ù",ugrave$1="ù",uHar="⥣",uharl="↿",uharr="↾",uhblk="▀",ulcorn="⌜",ulcorner="⌜",ulcrop="⌏",ultri="◸",Umacr="Ū",umacr="ū",uml$1="¨",UnderBar="_",UnderBrace="⏟",UnderBracket="⎵",UnderParenthesis="⏝",Union="⋃",UnionPlus="⊎",Uogon="Ų",uogon="ų",Uopf="𝕌",uopf="𝕦",UpArrowBar="⤒",uparrow="↑",UpArrow="↑",Uparrow="⇑",UpArrowDownArrow="⇅",updownarrow="↕",UpDownArrow="↕",Updownarrow="⇕",UpEquilibrium="⥮",upharpoonleft="↿",upharpoonright="↾",uplus="⊎",UpperLeftArrow="↖",UpperRightArrow="↗",upsi="υ",Upsi="ϒ",upsih="ϒ",Upsilon="Υ",upsilon="υ",UpTeeArrow="↥",UpTee="⊥",upuparrows="⇈",urcorn="⌝",urcorner="⌝",urcrop="⌎",Uring="Ů",uring="ů",urtri="◹",Uscr="𝒰",uscr="𝓊",utdot="⋰",Utilde="Ũ",utilde="ũ",utri="▵",utrif="▴",uuarr="⇈",Uuml$1="Ü",uuml$1="ü",uwangle="⦧",vangrt="⦜",varepsilon="ϵ",varkappa="ϰ",varnothing="∅",varphi="ϕ",varpi="ϖ",varpropto="∝",varr="↕",vArr="⇕",varrho="ϱ",varsigma="ς",varsubsetneq="⊊︀",varsubsetneqq="⫋︀",varsupsetneq="⊋︀",varsupsetneqq="⫌︀",vartheta="ϑ",vartriangleleft="⊲",vartriangleright="⊳",vBar="⫨",Vbar="⫫",vBarv="⫩",Vcy="В",vcy="в",vdash="⊢",vDash="⊨",Vdash="⊩",VDash="⊫",Vdashl="⫦",veebar="⊻",vee="∨",Vee="⋁",veeeq="≚",vellip="⋮",verbar="|",Verbar="‖",vert="|",Vert="‖",VerticalBar="∣",VerticalLine="|",VerticalSeparator="❘",VerticalTilde="≀",VeryThinSpace=" ",Vfr="𝔙",vfr="𝔳",vltri="⊲",vnsub="⊂⃒",vnsup="⊃⃒",Vopf="𝕍",vopf="𝕧",vprop="∝",vrtri="⊳",Vscr="𝒱",vscr="𝓋",vsubnE="⫋︀",vsubne="⊊︀",vsupnE="⫌︀",vsupne="⊋︀",Vvdash="⊪",vzigzag="⦚",Wcirc="Ŵ",wcirc="ŵ",wedbar="⩟",wedge="∧",Wedge="⋀",wedgeq="≙",weierp="℘",Wfr="𝔚",wfr="𝔴",Wopf="𝕎",wopf="𝕨",wp="℘",wr="≀",wreath="≀",Wscr="𝒲",wscr="𝓌",xcap="⋂",xcirc="◯",xcup="⋃",xdtri="▽",Xfr="𝔛",xfr="𝔵",xharr="⟷",xhArr="⟺",Xi="Ξ",xi="ξ",xlarr="⟵",xlArr="⟸",xmap="⟼",xnis="⋻",xodot="⨀",Xopf="𝕏",xopf="𝕩",xoplus="⨁",xotime="⨂",xrarr="⟶",xrArr="⟹",Xscr="𝒳",xscr="𝓍",xsqcup="⨆",xuplus="⨄",xutri="△",xvee="⋁",xwedge="⋀",Yacute$1="Ý",yacute$1="ý",YAcy="Я",yacy="я",Ycirc="Ŷ",ycirc="ŷ",Ycy="Ы",ycy="ы",yen$1="¥",Yfr="𝔜",yfr="𝔶",YIcy="Ї",yicy="ї",Yopf="𝕐",yopf="𝕪",Yscr="𝒴",yscr="𝓎",YUcy="Ю",yucy="ю",yuml$1="ÿ",Yuml="Ÿ",Zacute="Ź",zacute="ź",Zcaron="Ž",zcaron="ž",Zcy="З",zcy="з",Zdot="Ż",zdot="ż",zeetrf="ℨ",ZeroWidthSpace="​",Zeta="Ζ",zeta="ζ",zfr="𝔷",Zfr="ℨ",ZHcy="Ж",zhcy="ж",zigrarr="⇝",zopf="𝕫",Zopf="ℤ",Zscr="𝒵",zscr="𝓏",zwj="‍",zwnj="‌",entities={Aacute:Aacute$1,aacute:aacute$1,Abreve,abreve,ac,acd,acE,Acirc:Acirc$1,acirc:acirc$1,acute:acute$1,Acy,acy,AElig:AElig$1,aelig:aelig$1,af,Afr,afr,Agrave:Agrave$1,agrave:agrave$1,alefsym,aleph,Alpha,alpha,Amacr,amacr,amalg,amp:amp$2,AMP:AMP$1,andand,And,and,andd,andslope,andv,ang,ange,angle,angmsdaa,angmsdab,angmsdac,angmsdad,angmsdae,angmsdaf,angmsdag,angmsdah,angmsd,angrt,angrtvb,angrtvbd,angsph,angst,angzarr,Aogon,aogon,Aopf,aopf,apacir,ap,apE,ape,apid,apos:apos$1,ApplyFunction,approx,approxeq,Aring:Aring$1,aring:aring$1,Ascr,ascr,Assign,ast,asymp,asympeq,Atilde:Atilde$1,atilde:atilde$1,Auml:Auml$1,auml:auml$1,awconint,awint,backcong,backepsilon,backprime,backsim,backsimeq,Backslash,Barv,barvee,barwed,Barwed,barwedge,bbrk,bbrktbrk,bcong,Bcy,bcy,bdquo,becaus,because,Because,bemptyv,bepsi,bernou,Bernoullis,Beta,beta,beth,between,Bfr,bfr,bigcap,bigcirc,bigcup,bigodot,bigoplus,bigotimes,bigsqcup,bigstar,bigtriangledown,bigtriangleup,biguplus,bigvee,bigwedge,bkarow,blacklozenge,blacksquare,blacktriangle,blacktriangledown,blacktriangleleft,blacktriangleright,blank,blk12,blk14,blk34,block,bne,bnequiv,bNot,bnot,Bopf,bopf,bot,bottom,bowtie,boxbox,boxdl,boxdL,boxDl,boxDL,boxdr,boxdR,boxDr,boxDR,boxh,boxH,boxhd,boxHd,boxhD,boxHD,boxhu,boxHu,boxhU,boxHU,boxminus,boxplus,boxtimes,boxul,boxuL,boxUl,boxUL,boxur,boxuR,boxUr,boxUR,boxv,boxV,boxvh,boxvH,boxVh,boxVH,boxvl,boxvL,boxVl,boxVL,boxvr,boxvR,boxVr,boxVR,bprime,breve,Breve,brvbar:brvbar$1,bscr,Bscr,bsemi,bsim,bsime,bsolb,bsol,bsolhsub,bull,bullet,bump,bumpE,bumpe,Bumpeq,bumpeq,Cacute,cacute,capand,capbrcup,capcap,cap,Cap,capcup,capdot,CapitalDifferentialD,caps,caret,caron,Cayleys,ccaps,Ccaron,ccaron,Ccedil:Ccedil$1,ccedil:ccedil$1,Ccirc,ccirc,Cconint,ccups,ccupssm,Cdot,cdot,cedil:cedil$1,Cedilla,cemptyv,cent:cent$1,centerdot,CenterDot,cfr,Cfr,CHcy,chcy,check,checkmark,Chi,chi,circ,circeq,circlearrowleft,circlearrowright,circledast,circledcirc,circleddash,CircleDot,circledR,circledS,CircleMinus,CirclePlus,CircleTimes,cir,cirE,cire,cirfnint,cirmid,cirscir,ClockwiseContourIntegral,CloseCurlyDoubleQuote,CloseCurlyQuote,clubs,clubsuit,colon,Colon,Colone,colone,coloneq,comma,commat,comp,compfn,complement,complexes,cong,congdot,Congruent,conint,Conint,ContourIntegral,copf,Copf,coprod,Coproduct,copy:copy$1,COPY:COPY$1,copysr,CounterClockwiseContourIntegral,crarr,cross,Cross,Cscr,cscr,csub,csube,csup,csupe,ctdot,cudarrl,cudarrr,cuepr,cuesc,cularr,cularrp,cupbrcap,cupcap,CupCap,cup,Cup,cupcup,cupdot,cupor,cups,curarr,curarrm,curlyeqprec,curlyeqsucc,curlyvee,curlywedge,curren:curren$1,curvearrowleft,curvearrowright,cuvee,cuwed,cwconint,cwint,cylcty,dagger,Dagger,daleth,darr,Darr,dArr,dash,Dashv,dashv,dbkarow,dblac,Dcaron,dcaron,Dcy,dcy,ddagger,ddarr,DD,dd,DDotrahd,ddotseq,deg:deg$1,Del,Delta,delta,demptyv,dfisht,Dfr,dfr,dHar,dharl,dharr,DiacriticalAcute,DiacriticalDot,DiacriticalDoubleAcute,DiacriticalGrave,DiacriticalTilde,diam,diamond,Diamond,diamondsuit,diams,die,DifferentialD,digamma,disin,div,divide:divide$1,divideontimes,divonx,DJcy,djcy,dlcorn,dlcrop,dollar,Dopf,dopf,Dot,dot,DotDot,doteq,doteqdot,DotEqual,dotminus,dotplus,dotsquare,doublebarwedge,DoubleContourIntegral,DoubleDot,DoubleDownArrow,DoubleLeftArrow,DoubleLeftRightArrow,DoubleLeftTee,DoubleLongLeftArrow,DoubleLongLeftRightArrow,DoubleLongRightArrow,DoubleRightArrow,DoubleRightTee,DoubleUpArrow,DoubleUpDownArrow,DoubleVerticalBar,DownArrowBar,downarrow,DownArrow,Downarrow,DownArrowUpArrow,DownBreve,downdownarrows,downharpoonleft,downharpoonright,DownLeftRightVector,DownLeftTeeVector,DownLeftVectorBar,DownLeftVector,DownRightTeeVector,DownRightVectorBar,DownRightVector,DownTeeArrow,DownTee,drbkarow,drcorn,drcrop,Dscr,dscr,DScy,dscy,dsol,Dstrok,dstrok,dtdot,dtri,dtrif,duarr,duhar,dwangle,DZcy,dzcy,dzigrarr,Eacute:Eacute$1,eacute:eacute$1,easter,Ecaron,ecaron,Ecirc:Ecirc$1,ecirc:ecirc$1,ecir,ecolon,Ecy,ecy,eDDot,Edot,edot,eDot,ee,efDot,Efr,efr,eg,Egrave:Egrave$1,egrave:egrave$1,egs,egsdot,el,Element,elinters,ell,els,elsdot,Emacr,emacr,empty,emptyset,EmptySmallSquare,emptyv,EmptyVerySmallSquare,emsp13,emsp14,emsp,ENG,eng,ensp,Eogon,eogon,Eopf,eopf,epar,eparsl,eplus,epsi,Epsilon,epsilon,epsiv,eqcirc,eqcolon,eqsim,eqslantgtr,eqslantless,Equal,equals,EqualTilde,equest,Equilibrium,equiv,equivDD,eqvparsl,erarr,erDot,escr,Escr,esdot,Esim,esim,Eta,eta,ETH:ETH$1,eth:eth$1,Euml:Euml$1,euml:euml$1,euro,excl,exist,Exists,expectation,exponentiale,ExponentialE,fallingdotseq,Fcy,fcy,female,ffilig,fflig,ffllig,Ffr,ffr,filig,FilledSmallSquare,FilledVerySmallSquare,fjlig,flat,fllig,fltns,fnof,Fopf,fopf,forall,ForAll,fork,forkv,Fouriertrf,fpartint,frac12:frac12$1,frac13,frac14:frac14$1,frac15,frac16,frac18,frac23,frac25,frac34:frac34$1,frac35,frac38,frac45,frac56,frac58,frac78,frasl,frown,fscr,Fscr,gacute,Gamma,gamma,Gammad,gammad,gap,Gbreve,gbreve,Gcedil,Gcirc,gcirc,Gcy,gcy,Gdot,gdot,ge,gE,gEl,gel,geq,geqq,geqslant,gescc,ges,gesdot,gesdoto,gesdotol,gesl,gesles,Gfr,gfr,gg,Gg,ggg,gimel,GJcy,gjcy,gla,gl,glE,glj,gnap,gnapprox,gne,gnE,gneq,gneqq,gnsim,Gopf,gopf,grave,GreaterEqual,GreaterEqualLess,GreaterFullEqual,GreaterGreater,GreaterLess,GreaterSlantEqual,GreaterTilde,Gscr,gscr,gsim,gsime,gsiml,gtcc,gtcir,gt:gt$2,GT:GT$1,Gt,gtdot,gtlPar,gtquest,gtrapprox,gtrarr,gtrdot,gtreqless,gtreqqless,gtrless,gtrsim,gvertneqq,gvnE,Hacek,hairsp,half,hamilt,HARDcy,hardcy,harrcir,harr,hArr,harrw,Hat,hbar,Hcirc,hcirc,hearts,heartsuit,hellip,hercon,hfr,Hfr,HilbertSpace,hksearow,hkswarow,hoarr,homtht,hookleftarrow,hookrightarrow,hopf,Hopf,horbar,HorizontalLine,hscr,Hscr,hslash,Hstrok,hstrok,HumpDownHump,HumpEqual,hybull,hyphen,Iacute:Iacute$1,iacute:iacute$1,ic,Icirc:Icirc$1,icirc:icirc$1,Icy,icy,Idot,IEcy,iecy,iexcl:iexcl$1,iff,ifr,Ifr,Igrave:Igrave$1,igrave:igrave$1,ii,iiiint,iiint,iinfin,iiota,IJlig,ijlig,Imacr,imacr,image,ImaginaryI,imagline,imagpart,imath,Im,imof,imped,Implies,incare,in:"∈",infin,infintie,inodot,intcal,int,Int,integers,Integral,intercal,Intersection,intlarhk,intprod,InvisibleComma,InvisibleTimes,IOcy,iocy,Iogon,iogon,Iopf,iopf,Iota,iota,iprod,iquest:iquest$1,iscr,Iscr,isin,isindot,isinE,isins,isinsv,isinv,it,Itilde,itilde,Iukcy,iukcy,Iuml:Iuml$1,iuml:iuml$1,Jcirc,jcirc,Jcy,jcy,Jfr,jfr,jmath,Jopf,jopf,Jscr,jscr,Jsercy,jsercy,Jukcy,jukcy,Kappa,kappa,kappav,Kcedil,kcedil,Kcy,kcy,Kfr,kfr,kgreen,KHcy,khcy,KJcy,kjcy,Kopf,kopf,Kscr,kscr,lAarr,Lacute,lacute,laemptyv,lagran,Lambda,lambda,lang,Lang,langd,langle,lap,Laplacetrf,laquo:laquo$1,larrb,larrbfs,larr,Larr,lArr,larrfs,larrhk,larrlp,larrpl,larrsim,larrtl,latail,lAtail,lat,late,lates,lbarr,lBarr,lbbrk,lbrace,lbrack,lbrke,lbrksld,lbrkslu,Lcaron,lcaron,Lcedil,lcedil,lceil,lcub,Lcy,lcy,ldca,ldquo,ldquor,ldrdhar,ldrushar,ldsh,le,lE,LeftAngleBracket,LeftArrowBar,leftarrow,LeftArrow,Leftarrow,LeftArrowRightArrow,leftarrowtail,LeftCeiling,LeftDoubleBracket,LeftDownTeeVector,LeftDownVectorBar,LeftDownVector,LeftFloor,leftharpoondown,leftharpoonup,leftleftarrows,leftrightarrow,LeftRightArrow,Leftrightarrow,leftrightarrows,leftrightharpoons,leftrightsquigarrow,LeftRightVector,LeftTeeArrow,LeftTee,LeftTeeVector,leftthreetimes,LeftTriangleBar,LeftTriangle,LeftTriangleEqual,LeftUpDownVector,LeftUpTeeVector,LeftUpVectorBar,LeftUpVector,LeftVectorBar,LeftVector,lEg,leg,leq,leqq,leqslant,lescc,les,lesdot,lesdoto,lesdotor,lesg,lesges,lessapprox,lessdot,lesseqgtr,lesseqqgtr,LessEqualGreater,LessFullEqual,LessGreater,lessgtr,LessLess,lesssim,LessSlantEqual,LessTilde,lfisht,lfloor,Lfr,lfr,lg,lgE,lHar,lhard,lharu,lharul,lhblk,LJcy,ljcy,llarr,ll,Ll,llcorner,Lleftarrow,llhard,lltri,Lmidot,lmidot,lmoustache,lmoust,lnap,lnapprox,lne,lnE,lneq,lneqq,lnsim,loang,loarr,lobrk,longleftarrow,LongLeftArrow,Longleftarrow,longleftrightarrow,LongLeftRightArrow,Longleftrightarrow,longmapsto,longrightarrow,LongRightArrow,Longrightarrow,looparrowleft,looparrowright,lopar,Lopf,lopf,loplus,lotimes,lowast,lowbar,LowerLeftArrow,LowerRightArrow,loz,lozenge,lozf,lpar,lparlt,lrarr,lrcorner,lrhar,lrhard,lrm,lrtri,lsaquo,lscr,Lscr,lsh,Lsh,lsim,lsime,lsimg,lsqb,lsquo,lsquor,Lstrok,lstrok,ltcc,ltcir,lt:lt$2,LT:LT$1,Lt,ltdot,lthree,ltimes,ltlarr,ltquest,ltri,ltrie,ltrif,ltrPar,lurdshar,luruhar,lvertneqq,lvnE,macr:macr$1,male,malt,maltese,Map:"⤅",map,mapsto,mapstodown,mapstoleft,mapstoup,marker,mcomma,Mcy,mcy,mdash,mDDot,measuredangle,MediumSpace,Mellintrf,Mfr,mfr,mho,micro:micro$1,midast,midcir,mid,middot:middot$1,minusb,minus,minusd,minusdu,MinusPlus,mlcp,mldr,mnplus,models,Mopf,mopf,mp,mscr,Mscr,mstpos,Mu,mu,multimap,mumap,nabla,Nacute,nacute,nang,nap,napE,napid,napos,napprox,natural,naturals,natur,nbsp:nbsp$1,nbump,nbumpe,ncap,Ncaron,ncaron,Ncedil,ncedil,ncong,ncongdot,ncup,Ncy,ncy,ndash,nearhk,nearr,neArr,nearrow,ne,nedot,NegativeMediumSpace,NegativeThickSpace,NegativeThinSpace,NegativeVeryThinSpace,nequiv,nesear,nesim,NestedGreaterGreater,NestedLessLess,NewLine,nexist,nexists,Nfr,nfr,ngE,nge,ngeq,ngeqq,ngeqslant,nges,nGg,ngsim,nGt,ngt,ngtr,nGtv,nharr,nhArr,nhpar,ni,nis,nisd,niv,NJcy,njcy,nlarr,nlArr,nldr,nlE,nle,nleftarrow,nLeftarrow,nleftrightarrow,nLeftrightarrow,nleq,nleqq,nleqslant,nles,nless,nLl,nlsim,nLt,nlt,nltri,nltrie,nLtv,nmid,NoBreak,NonBreakingSpace,nopf,Nopf,Not,not:not$1,NotCongruent,NotCupCap,NotDoubleVerticalBar,NotElement,NotEqual,NotEqualTilde,NotExists,NotGreater,NotGreaterEqual,NotGreaterFullEqual,NotGreaterGreater,NotGreaterLess,NotGreaterSlantEqual,NotGreaterTilde,NotHumpDownHump,NotHumpEqual,notin,notindot,notinE,notinva,notinvb,notinvc,NotLeftTriangleBar,NotLeftTriangle,NotLeftTriangleEqual,NotLess,NotLessEqual,NotLessGreater,NotLessLess,NotLessSlantEqual,NotLessTilde,NotNestedGreaterGreater,NotNestedLessLess,notni,notniva,notnivb,notnivc,NotPrecedes,NotPrecedesEqual,NotPrecedesSlantEqual,NotReverseElement,NotRightTriangleBar,NotRightTriangle,NotRightTriangleEqual,NotSquareSubset,NotSquareSubsetEqual,NotSquareSuperset,NotSquareSupersetEqual,NotSubset,NotSubsetEqual,NotSucceeds,NotSucceedsEqual,NotSucceedsSlantEqual,NotSucceedsTilde,NotSuperset,NotSupersetEqual,NotTilde,NotTildeEqual,NotTildeFullEqual,NotTildeTilde,NotVerticalBar,nparallel,npar,nparsl,npart,npolint,npr,nprcue,nprec,npreceq,npre,nrarrc,nrarr,nrArr,nrarrw,nrightarrow,nRightarrow,nrtri,nrtrie,nsc,nsccue,nsce,Nscr,nscr,nshortmid,nshortparallel,nsim,nsime,nsimeq,nsmid,nspar,nsqsube,nsqsupe,nsub,nsubE,nsube,nsubset,nsubseteq,nsubseteqq,nsucc,nsucceq,nsup,nsupE,nsupe,nsupset,nsupseteq,nsupseteqq,ntgl,Ntilde:Ntilde$1,ntilde:ntilde$1,ntlg,ntriangleleft,ntrianglelefteq,ntriangleright,ntrianglerighteq,Nu,nu,num,numero,numsp,nvap,nvdash,nvDash,nVdash,nVDash,nvge,nvgt,nvHarr,nvinfin,nvlArr,nvle,nvlt,nvltrie,nvrArr,nvrtrie,nvsim,nwarhk,nwarr,nwArr,nwarrow,nwnear,Oacute:Oacute$1,oacute:oacute$1,oast,Ocirc:Ocirc$1,ocirc:ocirc$1,ocir,Ocy,ocy,odash,Odblac,odblac,odiv,odot,odsold,OElig,oelig,ofcir,Ofr,ofr,ogon,Ograve:Ograve$1,ograve:ograve$1,ogt,ohbar,ohm,oint,olarr,olcir,olcross,oline,olt,Omacr,omacr,Omega,omega,Omicron,omicron,omid,ominus,Oopf,oopf,opar,OpenCurlyDoubleQuote,OpenCurlyQuote,operp,oplus,orarr,Or,or,ord,order,orderof,ordf:ordf$1,ordm:ordm$1,origof,oror,orslope,orv,oS,Oscr,oscr,Oslash:Oslash$1,oslash:oslash$1,osol,Otilde:Otilde$1,otilde:otilde$1,otimesas,Otimes,otimes,Ouml:Ouml$1,ouml:ouml$1,ovbar,OverBar,OverBrace,OverBracket,OverParenthesis,para:para$1,parallel,par,parsim,parsl,part,PartialD,Pcy,pcy,percnt,period,permil,perp,pertenk,Pfr,pfr,Phi,phi,phiv,phmmat,phone,Pi,pi,pitchfork,piv,planck,planckh,plankv,plusacir,plusb,pluscir,plus,plusdo,plusdu,pluse,PlusMinus,plusmn:plusmn$1,plussim,plustwo,pm,Poincareplane,pointint,popf,Popf,pound:pound$1,prap,Pr,pr,prcue,precapprox,prec,preccurlyeq,Precedes,PrecedesEqual,PrecedesSlantEqual,PrecedesTilde,preceq,precnapprox,precneqq,precnsim,pre,prE,precsim,prime,Prime,primes,prnap,prnE,prnsim,prod,Product,profalar,profline,profsurf,prop,Proportional,Proportion,propto,prsim,prurel,Pscr,pscr,Psi,psi,puncsp,Qfr,qfr,qint,qopf,Qopf,qprime,Qscr,qscr,quaternions,quatint,quest,questeq,quot:quot$2,QUOT:QUOT$1,rAarr,race,Racute,racute,radic,raemptyv,rang,Rang,rangd,range,rangle,raquo:raquo$1,rarrap,rarrb,rarrbfs,rarrc,rarr,Rarr,rArr,rarrfs,rarrhk,rarrlp,rarrpl,rarrsim,Rarrtl,rarrtl,rarrw,ratail,rAtail,ratio,rationals,rbarr,rBarr,RBarr,rbbrk,rbrace,rbrack,rbrke,rbrksld,rbrkslu,Rcaron,rcaron,Rcedil,rcedil,rceil,rcub,Rcy,rcy,rdca,rdldhar,rdquo,rdquor,rdsh,real,realine,realpart,reals,Re,rect,reg:reg$1,REG:REG$1,ReverseElement,ReverseEquilibrium,ReverseUpEquilibrium,rfisht,rfloor,rfr,Rfr,rHar,rhard,rharu,rharul,Rho,rho,rhov,RightAngleBracket,RightArrowBar,rightarrow,RightArrow,Rightarrow,RightArrowLeftArrow,rightarrowtail,RightCeiling,RightDoubleBracket,RightDownTeeVector,RightDownVectorBar,RightDownVector,RightFloor,rightharpoondown,rightharpoonup,rightleftarrows,rightleftharpoons,rightrightarrows,rightsquigarrow,RightTeeArrow,RightTee,RightTeeVector,rightthreetimes,RightTriangleBar,RightTriangle,RightTriangleEqual,RightUpDownVector,RightUpTeeVector,RightUpVectorBar,RightUpVector,RightVectorBar,RightVector,ring,risingdotseq,rlarr,rlhar,rlm,rmoustache,rmoust,rnmid,roang,roarr,robrk,ropar,ropf,Ropf,roplus,rotimes,RoundImplies,rpar,rpargt,rppolint,rrarr,Rrightarrow,rsaquo,rscr,Rscr,rsh,Rsh,rsqb,rsquo,rsquor,rthree,rtimes,rtri,rtrie,rtrif,rtriltri,RuleDelayed,ruluhar,rx,Sacute,sacute,sbquo,scap,Scaron,scaron,Sc,sc,sccue,sce,scE,Scedil,scedil,Scirc,scirc,scnap,scnE,scnsim,scpolint,scsim,Scy,scy,sdotb,sdot,sdote,searhk,searr,seArr,searrow,sect:sect$1,semi,seswar,setminus,setmn,sext,Sfr,sfr,sfrown,sharp,SHCHcy,shchcy,SHcy,shcy,ShortDownArrow,ShortLeftArrow,shortmid,shortparallel,ShortRightArrow,ShortUpArrow,shy:shy$1,Sigma,sigma,sigmaf,sigmav,sim,simdot,sime,simeq,simg,simgE,siml,simlE,simne,simplus,simrarr,slarr,SmallCircle,smallsetminus,smashp,smeparsl,smid,smile,smt,smte,smtes,SOFTcy,softcy,solbar,solb,sol,Sopf,sopf,spades,spadesuit,spar,sqcap,sqcaps,sqcup,sqcups,Sqrt,sqsub,sqsube,sqsubset,sqsubseteq,sqsup,sqsupe,sqsupset,sqsupseteq,square,Square,SquareIntersection,SquareSubset,SquareSubsetEqual,SquareSuperset,SquareSupersetEqual,SquareUnion,squarf,squ,squf,srarr,Sscr,sscr,ssetmn,ssmile,sstarf,Star,star,starf,straightepsilon,straightphi,strns,sub,Sub,subdot,subE,sube,subedot,submult,subnE,subne,subplus,subrarr,subset,Subset,subseteq,subseteqq,SubsetEqual,subsetneq,subsetneqq,subsim,subsub,subsup,succapprox,succ,succcurlyeq,Succeeds,SucceedsEqual,SucceedsSlantEqual,SucceedsTilde,succeq,succnapprox,succneqq,succnsim,succsim,SuchThat,sum,Sum,sung,sup1:sup1$1,sup2:sup2$1,sup3:sup3$1,sup,Sup,supdot,supdsub,supE,supe,supedot,Superset,SupersetEqual,suphsol,suphsub,suplarr,supmult,supnE,supne,supplus,supset,Supset,supseteq,supseteqq,supsetneq,supsetneqq,supsim,supsub,supsup,swarhk,swarr,swArr,swarrow,swnwar,szlig:szlig$1,Tab,target,Tau,tau,tbrk,Tcaron,tcaron,Tcedil,tcedil,Tcy,tcy,tdot,telrec,Tfr,tfr,there4,therefore,Therefore,Theta,theta,thetasym,thetav,thickapprox,thicksim,ThickSpace,ThinSpace,thinsp,thkap,thksim,THORN:THORN$1,thorn:thorn$1,tilde,Tilde,TildeEqual,TildeFullEqual,TildeTilde,timesbar,timesb,times:times$1,timesd,tint,toea,topbot,topcir,top,Topf,topf,topfork,tosa,tprime,trade,TRADE,triangle,triangledown,triangleleft,trianglelefteq,triangleq,triangleright,trianglerighteq,tridot,trie,triminus,TripleDot,triplus,trisb,tritime,trpezium,Tscr,tscr,TScy,tscy,TSHcy,tshcy,Tstrok,tstrok,twixt,twoheadleftarrow,twoheadrightarrow,Uacute:Uacute$1,uacute:uacute$1,uarr,Uarr,uArr,Uarrocir,Ubrcy,ubrcy,Ubreve,ubreve,Ucirc:Ucirc$1,ucirc:ucirc$1,Ucy,ucy,udarr,Udblac,udblac,udhar,ufisht,Ufr,ufr,Ugrave:Ugrave$1,ugrave:ugrave$1,uHar,uharl,uharr,uhblk,ulcorn,ulcorner,ulcrop,ultri,Umacr,umacr,uml:uml$1,UnderBar,UnderBrace,UnderBracket,UnderParenthesis,Union,UnionPlus,Uogon,uogon,Uopf,uopf,UpArrowBar,uparrow,UpArrow,Uparrow,UpArrowDownArrow,updownarrow,UpDownArrow,Updownarrow,UpEquilibrium,upharpoonleft,upharpoonright,uplus,UpperLeftArrow,UpperRightArrow,upsi,Upsi,upsih,Upsilon,upsilon,UpTeeArrow,UpTee,upuparrows,urcorn,urcorner,urcrop,Uring,uring,urtri,Uscr,uscr,utdot,Utilde,utilde,utri,utrif,uuarr,Uuml:Uuml$1,uuml:uuml$1,uwangle,vangrt,varepsilon,varkappa,varnothing,varphi,varpi,varpropto,varr,vArr,varrho,varsigma,varsubsetneq,varsubsetneqq,varsupsetneq,varsupsetneqq,vartheta,vartriangleleft,vartriangleright,vBar,Vbar,vBarv,Vcy,vcy,vdash,vDash,Vdash,VDash,Vdashl,veebar,vee,Vee,veeeq,vellip,verbar,Verbar,vert,Vert,VerticalBar,VerticalLine,VerticalSeparator,VerticalTilde,VeryThinSpace,Vfr,vfr,vltri,vnsub,vnsup,Vopf,vopf,vprop,vrtri,Vscr,vscr,vsubnE,vsubne,vsupnE,vsupne,Vvdash,vzigzag,Wcirc,wcirc,wedbar,wedge,Wedge,wedgeq,weierp,Wfr,wfr,Wopf,wopf,wp,wr,wreath,Wscr,wscr,xcap,xcirc,xcup,xdtri,Xfr,xfr,xharr,xhArr,Xi,xi,xlarr,xlArr,xmap,xnis,xodot,Xopf,xopf,xoplus,xotime,xrarr,xrArr,Xscr,xscr,xsqcup,xuplus,xutri,xvee,xwedge,Yacute:Yacute$1,yacute:yacute$1,YAcy,yacy,Ycirc,ycirc,Ycy,ycy,yen:yen$1,Yfr,yfr,YIcy,yicy,Yopf,yopf,Yscr,yscr,YUcy,yucy,yuml:yuml$1,Yuml,Zacute,zacute,Zcaron,zcaron,Zcy,zcy,Zdot,zdot,zeetrf,ZeroWidthSpace,Zeta,zeta,zfr,Zfr,ZHcy,zhcy,zigrarr,zopf,Zopf,Zscr,zscr,zwj,zwnj},entities$1=Object.freeze({__proto__:null,Aacute:Aacute$1,aacute:aacute$1,Abreve,abreve,ac,acd,acE,Acirc:Acirc$1,acirc:acirc$1,acute:acute$1,Acy,acy,AElig:AElig$1,aelig:aelig$1,af,Afr,afr,Agrave:Agrave$1,agrave:agrave$1,alefsym,aleph,Alpha,alpha,Amacr,amacr,amalg,amp:amp$2,AMP:AMP$1,andand,And,and,andd,andslope,andv,ang,ange,angle,angmsdaa,angmsdab,angmsdac,angmsdad,angmsdae,angmsdaf,angmsdag,angmsdah,angmsd,angrt,angrtvb,angrtvbd,angsph,angst,angzarr,Aogon,aogon,Aopf,aopf,apacir,ap,apE,ape,apid,apos:apos$1,ApplyFunction,approx,approxeq,Aring:Aring$1,aring:aring$1,Ascr,ascr,Assign,ast,asymp,asympeq,Atilde:Atilde$1,atilde:atilde$1,Auml:Auml$1,auml:auml$1,awconint,awint,backcong,backepsilon,backprime,backsim,backsimeq,Backslash,Barv,barvee,barwed,Barwed,barwedge,bbrk,bbrktbrk,bcong,Bcy,bcy,bdquo,becaus,because,Because,bemptyv,bepsi,bernou,Bernoullis,Beta,beta,beth,between,Bfr,bfr,bigcap,bigcirc,bigcup,bigodot,bigoplus,bigotimes,bigsqcup,bigstar,bigtriangledown,bigtriangleup,biguplus,bigvee,bigwedge,bkarow,blacklozenge,blacksquare,blacktriangle,blacktriangledown,blacktriangleleft,blacktriangleright,blank,blk12,blk14,blk34,block,bne,bnequiv,bNot,bnot,Bopf,bopf,bot,bottom,bowtie,boxbox,boxdl,boxdL,boxDl,boxDL,boxdr,boxdR,boxDr,boxDR,boxh,boxH,boxhd,boxHd,boxhD,boxHD,boxhu,boxHu,boxhU,boxHU,boxminus,boxplus,boxtimes,boxul,boxuL,boxUl,boxUL,boxur,boxuR,boxUr,boxUR,boxv,boxV,boxvh,boxvH,boxVh,boxVH,boxvl,boxvL,boxVl,boxVL,boxvr,boxvR,boxVr,boxVR,bprime,breve,Breve,brvbar:brvbar$1,bscr,Bscr,bsemi,bsim,bsime,bsolb,bsol,bsolhsub,bull,bullet,bump,bumpE,bumpe,Bumpeq,bumpeq,Cacute,cacute,capand,capbrcup,capcap,cap,Cap,capcup,capdot,CapitalDifferentialD,caps,caret,caron,Cayleys,ccaps,Ccaron,ccaron,Ccedil:Ccedil$1,ccedil:ccedil$1,Ccirc,ccirc,Cconint,ccups,ccupssm,Cdot,cdot,cedil:cedil$1,Cedilla,cemptyv,cent:cent$1,centerdot,CenterDot,cfr,Cfr,CHcy,chcy,check,checkmark,Chi,chi,circ,circeq,circlearrowleft,circlearrowright,circledast,circledcirc,circleddash,CircleDot,circledR,circledS,CircleMinus,CirclePlus,CircleTimes,cir,cirE,cire,cirfnint,cirmid,cirscir,ClockwiseContourIntegral,CloseCurlyDoubleQuote,CloseCurlyQuote,clubs,clubsuit,colon,Colon,Colone,colone,coloneq,comma,commat,comp,compfn,complement,complexes,cong,congdot,Congruent,conint,Conint,ContourIntegral,copf,Copf,coprod,Coproduct,copy:copy$1,COPY:COPY$1,copysr,CounterClockwiseContourIntegral,crarr,cross,Cross,Cscr,cscr,csub,csube,csup,csupe,ctdot,cudarrl,cudarrr,cuepr,cuesc,cularr,cularrp,cupbrcap,cupcap,CupCap,cup,Cup,cupcup,cupdot,cupor,cups,curarr,curarrm,curlyeqprec,curlyeqsucc,curlyvee,curlywedge,curren:curren$1,curvearrowleft,curvearrowright,cuvee,cuwed,cwconint,cwint,cylcty,dagger,Dagger,daleth,darr,Darr,dArr,dash,Dashv,dashv,dbkarow,dblac,Dcaron,dcaron,Dcy,dcy,ddagger,ddarr,DD,dd,DDotrahd,ddotseq,deg:deg$1,Del,Delta,delta,demptyv,dfisht,Dfr,dfr,dHar,dharl,dharr,DiacriticalAcute,DiacriticalDot,DiacriticalDoubleAcute,DiacriticalGrave,DiacriticalTilde,diam,diamond,Diamond,diamondsuit,diams,die,DifferentialD,digamma,disin,div,divide:divide$1,divideontimes,divonx,DJcy,djcy,dlcorn,dlcrop,dollar,Dopf,dopf,Dot,dot,DotDot,doteq,doteqdot,DotEqual,dotminus,dotplus,dotsquare,doublebarwedge,DoubleContourIntegral,DoubleDot,DoubleDownArrow,DoubleLeftArrow,DoubleLeftRightArrow,DoubleLeftTee,DoubleLongLeftArrow,DoubleLongLeftRightArrow,DoubleLongRightArrow,DoubleRightArrow,DoubleRightTee,DoubleUpArrow,DoubleUpDownArrow,DoubleVerticalBar,DownArrowBar,downarrow,DownArrow,Downarrow,DownArrowUpArrow,DownBreve,downdownarrows,downharpoonleft,downharpoonright,DownLeftRightVector,DownLeftTeeVector,DownLeftVectorBar,DownLeftVector,DownRightTeeVector,DownRightVectorBar,DownRightVector,DownTeeArrow,DownTee,drbkarow,drcorn,drcrop,Dscr,dscr,DScy,dscy,dsol,Dstrok,dstrok,dtdot,dtri,dtrif,duarr,duhar,dwangle,DZcy,dzcy,dzigrarr,Eacute:Eacute$1,eacute:eacute$1,easter,Ecaron,ecaron,Ecirc:Ecirc$1,ecirc:ecirc$1,ecir,ecolon,Ecy,ecy,eDDot,Edot,edot,eDot,ee,efDot,Efr,efr,eg,Egrave:Egrave$1,egrave:egrave$1,egs,egsdot,el,Element,elinters,ell,els,elsdot,Emacr,emacr,empty,emptyset,EmptySmallSquare,emptyv,EmptyVerySmallSquare,emsp13,emsp14,emsp,ENG,eng,ensp,Eogon,eogon,Eopf,eopf,epar,eparsl,eplus,epsi,Epsilon,epsilon,epsiv,eqcirc,eqcolon,eqsim,eqslantgtr,eqslantless,Equal,equals,EqualTilde,equest,Equilibrium,equiv,equivDD,eqvparsl,erarr,erDot,escr,Escr,esdot,Esim,esim,Eta,eta,ETH:ETH$1,eth:eth$1,Euml:Euml$1,euml:euml$1,euro,excl,exist,Exists,expectation,exponentiale,ExponentialE,fallingdotseq,Fcy,fcy,female,ffilig,fflig,ffllig,Ffr,ffr,filig,FilledSmallSquare,FilledVerySmallSquare,fjlig,flat,fllig,fltns,fnof,Fopf,fopf,forall,ForAll,fork,forkv,Fouriertrf,fpartint,frac12:frac12$1,frac13,frac14:frac14$1,frac15,frac16,frac18,frac23,frac25,frac34:frac34$1,frac35,frac38,frac45,frac56,frac58,frac78,frasl,frown,fscr,Fscr,gacute,Gamma,gamma,Gammad,gammad,gap,Gbreve,gbreve,Gcedil,Gcirc,gcirc,Gcy,gcy,Gdot,gdot,ge,gE,gEl,gel,geq,geqq,geqslant,gescc,ges,gesdot,gesdoto,gesdotol,gesl,gesles,Gfr,gfr,gg,Gg,ggg,gimel,GJcy,gjcy,gla,gl,glE,glj,gnap,gnapprox,gne,gnE,gneq,gneqq,gnsim,Gopf,gopf,grave,GreaterEqual,GreaterEqualLess,GreaterFullEqual,GreaterGreater,GreaterLess,GreaterSlantEqual,GreaterTilde,Gscr,gscr,gsim,gsime,gsiml,gtcc,gtcir,gt:gt$2,GT:GT$1,Gt,gtdot,gtlPar,gtquest,gtrapprox,gtrarr,gtrdot,gtreqless,gtreqqless,gtrless,gtrsim,gvertneqq,gvnE,Hacek,hairsp,half,hamilt,HARDcy,hardcy,harrcir,harr,hArr,harrw,Hat,hbar,Hcirc,hcirc,hearts,heartsuit,hellip,hercon,hfr,Hfr,HilbertSpace,hksearow,hkswarow,hoarr,homtht,hookleftarrow,hookrightarrow,hopf,Hopf,horbar,HorizontalLine,hscr,Hscr,hslash,Hstrok,hstrok,HumpDownHump,HumpEqual,hybull,hyphen,Iacute:Iacute$1,iacute:iacute$1,ic,Icirc:Icirc$1,icirc:icirc$1,Icy,icy,Idot,IEcy,iecy,iexcl:iexcl$1,iff,ifr,Ifr,Igrave:Igrave$1,igrave:igrave$1,ii,iiiint,iiint,iinfin,iiota,IJlig,ijlig,Imacr,imacr,image,ImaginaryI,imagline,imagpart,imath,Im,imof,imped,Implies,incare,infin,infintie,inodot,intcal,int,Int,integers,Integral,intercal,Intersection,intlarhk,intprod,InvisibleComma,InvisibleTimes,IOcy,iocy,Iogon,iogon,Iopf,iopf,Iota,iota,iprod,iquest:iquest$1,iscr,Iscr,isin,isindot,isinE,isins,isinsv,isinv,it,Itilde,itilde,Iukcy,iukcy,Iuml:Iuml$1,iuml:iuml$1,Jcirc,jcirc,Jcy,jcy,Jfr,jfr,jmath,Jopf,jopf,Jscr,jscr,Jsercy,jsercy,Jukcy,jukcy,Kappa,kappa,kappav,Kcedil,kcedil,Kcy,kcy,Kfr,kfr,kgreen,KHcy,khcy,KJcy,kjcy,Kopf,kopf,Kscr,kscr,lAarr,Lacute,lacute,laemptyv,lagran,Lambda,lambda,lang,Lang,langd,langle,lap,Laplacetrf,laquo:laquo$1,larrb,larrbfs,larr,Larr,lArr,larrfs,larrhk,larrlp,larrpl,larrsim,larrtl,latail,lAtail,lat,late,lates,lbarr,lBarr,lbbrk,lbrace,lbrack,lbrke,lbrksld,lbrkslu,Lcaron,lcaron,Lcedil,lcedil,lceil,lcub,Lcy,lcy,ldca,ldquo,ldquor,ldrdhar,ldrushar,ldsh,le,lE,LeftAngleBracket,LeftArrowBar,leftarrow,LeftArrow,Leftarrow,LeftArrowRightArrow,leftarrowtail,LeftCeiling,LeftDoubleBracket,LeftDownTeeVector,LeftDownVectorBar,LeftDownVector,LeftFloor,leftharpoondown,leftharpoonup,leftleftarrows,leftrightarrow,LeftRightArrow,Leftrightarrow,leftrightarrows,leftrightharpoons,leftrightsquigarrow,LeftRightVector,LeftTeeArrow,LeftTee,LeftTeeVector,leftthreetimes,LeftTriangleBar,LeftTriangle,LeftTriangleEqual,LeftUpDownVector,LeftUpTeeVector,LeftUpVectorBar,LeftUpVector,LeftVectorBar,LeftVector,lEg,leg,leq,leqq,leqslant,lescc,les,lesdot,lesdoto,lesdotor,lesg,lesges,lessapprox,lessdot,lesseqgtr,lesseqqgtr,LessEqualGreater,LessFullEqual,LessGreater,lessgtr,LessLess,lesssim,LessSlantEqual,LessTilde,lfisht,lfloor,Lfr,lfr,lg,lgE,lHar,lhard,lharu,lharul,lhblk,LJcy,ljcy,llarr,ll,Ll,llcorner,Lleftarrow,llhard,lltri,Lmidot,lmidot,lmoustache,lmoust,lnap,lnapprox,lne,lnE,lneq,lneqq,lnsim,loang,loarr,lobrk,longleftarrow,LongLeftArrow,Longleftarrow,longleftrightarrow,LongLeftRightArrow,Longleftrightarrow,longmapsto,longrightarrow,LongRightArrow,Longrightarrow,looparrowleft,looparrowright,lopar,Lopf,lopf,loplus,lotimes,lowast,lowbar,LowerLeftArrow,LowerRightArrow,loz,lozenge,lozf,lpar,lparlt,lrarr,lrcorner,lrhar,lrhard,lrm,lrtri,lsaquo,lscr,Lscr,lsh,Lsh,lsim,lsime,lsimg,lsqb,lsquo,lsquor,Lstrok,lstrok,ltcc,ltcir,lt:lt$2,LT:LT$1,Lt,ltdot,lthree,ltimes,ltlarr,ltquest,ltri,ltrie,ltrif,ltrPar,lurdshar,luruhar,lvertneqq,lvnE,macr:macr$1,male,malt,maltese,map,mapsto,mapstodown,mapstoleft,mapstoup,marker,mcomma,Mcy,mcy,mdash,mDDot,measuredangle,MediumSpace,Mellintrf,Mfr,mfr,mho,micro:micro$1,midast,midcir,mid,middot:middot$1,minusb,minus,minusd,minusdu,MinusPlus,mlcp,mldr,mnplus,models,Mopf,mopf,mp,mscr,Mscr,mstpos,Mu,mu,multimap,mumap,nabla,Nacute,nacute,nang,nap,napE,napid,napos,napprox,natural,naturals,natur,nbsp:nbsp$1,nbump,nbumpe,ncap,Ncaron,ncaron,Ncedil,ncedil,ncong,ncongdot,ncup,Ncy,ncy,ndash,nearhk,nearr,neArr,nearrow,ne,nedot,NegativeMediumSpace,NegativeThickSpace,NegativeThinSpace,NegativeVeryThinSpace,nequiv,nesear,nesim,NestedGreaterGreater,NestedLessLess,NewLine,nexist,nexists,Nfr,nfr,ngE,nge,ngeq,ngeqq,ngeqslant,nges,nGg,ngsim,nGt,ngt,ngtr,nGtv,nharr,nhArr,nhpar,ni,nis,nisd,niv,NJcy,njcy,nlarr,nlArr,nldr,nlE,nle,nleftarrow,nLeftarrow,nleftrightarrow,nLeftrightarrow,nleq,nleqq,nleqslant,nles,nless,nLl,nlsim,nLt,nlt,nltri,nltrie,nLtv,nmid,NoBreak,NonBreakingSpace,nopf,Nopf,Not,not:not$1,NotCongruent,NotCupCap,NotDoubleVerticalBar,NotElement,NotEqual,NotEqualTilde,NotExists,NotGreater,NotGreaterEqual,NotGreaterFullEqual,NotGreaterGreater,NotGreaterLess,NotGreaterSlantEqual,NotGreaterTilde,NotHumpDownHump,NotHumpEqual,notin,notindot,notinE,notinva,notinvb,notinvc,NotLeftTriangleBar,NotLeftTriangle,NotLeftTriangleEqual,NotLess,NotLessEqual,NotLessGreater,NotLessLess,NotLessSlantEqual,NotLessTilde,NotNestedGreaterGreater,NotNestedLessLess,notni,notniva,notnivb,notnivc,NotPrecedes,NotPrecedesEqual,NotPrecedesSlantEqual,NotReverseElement,NotRightTriangleBar,NotRightTriangle,NotRightTriangleEqual,NotSquareSubset,NotSquareSubsetEqual,NotSquareSuperset,NotSquareSupersetEqual,NotSubset,NotSubsetEqual,NotSucceeds,NotSucceedsEqual,NotSucceedsSlantEqual,NotSucceedsTilde,NotSuperset,NotSupersetEqual,NotTilde,NotTildeEqual,NotTildeFullEqual,NotTildeTilde,NotVerticalBar,nparallel,npar,nparsl,npart,npolint,npr,nprcue,nprec,npreceq,npre,nrarrc,nrarr,nrArr,nrarrw,nrightarrow,nRightarrow,nrtri,nrtrie,nsc,nsccue,nsce,Nscr,nscr,nshortmid,nshortparallel,nsim,nsime,nsimeq,nsmid,nspar,nsqsube,nsqsupe,nsub,nsubE,nsube,nsubset,nsubseteq,nsubseteqq,nsucc,nsucceq,nsup,nsupE,nsupe,nsupset,nsupseteq,nsupseteqq,ntgl,Ntilde:Ntilde$1,ntilde:ntilde$1,ntlg,ntriangleleft,ntrianglelefteq,ntriangleright,ntrianglerighteq,Nu,nu,num,numero,numsp,nvap,nvdash,nvDash,nVdash,nVDash,nvge,nvgt,nvHarr,nvinfin,nvlArr,nvle,nvlt,nvltrie,nvrArr,nvrtrie,nvsim,nwarhk,nwarr,nwArr,nwarrow,nwnear,Oacute:Oacute$1,oacute:oacute$1,oast,Ocirc:Ocirc$1,ocirc:ocirc$1,ocir,Ocy,ocy,odash,Odblac,odblac,odiv,odot,odsold,OElig,oelig,ofcir,Ofr,ofr,ogon,Ograve:Ograve$1,ograve:ograve$1,ogt,ohbar,ohm,oint,olarr,olcir,olcross,oline,olt,Omacr,omacr,Omega,omega,Omicron,omicron,omid,ominus,Oopf,oopf,opar,OpenCurlyDoubleQuote,OpenCurlyQuote,operp,oplus,orarr,Or,or,ord,order,orderof,ordf:ordf$1,ordm:ordm$1,origof,oror,orslope,orv,oS,Oscr,oscr,Oslash:Oslash$1,oslash:oslash$1,osol,Otilde:Otilde$1,otilde:otilde$1,otimesas,Otimes,otimes,Ouml:Ouml$1,ouml:ouml$1,ovbar,OverBar,OverBrace,OverBracket,OverParenthesis,para:para$1,parallel,par,parsim,parsl,part,PartialD,Pcy,pcy,percnt,period,permil,perp,pertenk,Pfr,pfr,Phi,phi,phiv,phmmat,phone,Pi,pi,pitchfork,piv,planck,planckh,plankv,plusacir,plusb,pluscir,plus,plusdo,plusdu,pluse,PlusMinus,plusmn:plusmn$1,plussim,plustwo,pm,Poincareplane,pointint,popf,Popf,pound:pound$1,prap,Pr,pr,prcue,precapprox,prec,preccurlyeq,Precedes,PrecedesEqual,PrecedesSlantEqual,PrecedesTilde,preceq,precnapprox,precneqq,precnsim,pre,prE,precsim,prime,Prime,primes,prnap,prnE,prnsim,prod,Product,profalar,profline,profsurf,prop,Proportional,Proportion,propto,prsim,prurel,Pscr,pscr,Psi,psi,puncsp,Qfr,qfr,qint,qopf,Qopf,qprime,Qscr,qscr,quaternions,quatint,quest,questeq,quot:quot$2,QUOT:QUOT$1,rAarr,race,Racute,racute,radic,raemptyv,rang,Rang,rangd,range,rangle,raquo:raquo$1,rarrap,rarrb,rarrbfs,rarrc,rarr,Rarr,rArr,rarrfs,rarrhk,rarrlp,rarrpl,rarrsim,Rarrtl,rarrtl,rarrw,ratail,rAtail,ratio,rationals,rbarr,rBarr,RBarr,rbbrk,rbrace,rbrack,rbrke,rbrksld,rbrkslu,Rcaron,rcaron,Rcedil,rcedil,rceil,rcub,Rcy,rcy,rdca,rdldhar,rdquo,rdquor,rdsh,real,realine,realpart,reals,Re,rect,reg:reg$1,REG:REG$1,ReverseElement,ReverseEquilibrium,ReverseUpEquilibrium,rfisht,rfloor,rfr,Rfr,rHar,rhard,rharu,rharul,Rho,rho,rhov,RightAngleBracket,RightArrowBar,rightarrow,RightArrow,Rightarrow,RightArrowLeftArrow,rightarrowtail,RightCeiling,RightDoubleBracket,RightDownTeeVector,RightDownVectorBar,RightDownVector,RightFloor,rightharpoondown,rightharpoonup,rightleftarrows,rightleftharpoons,rightrightarrows,rightsquigarrow,RightTeeArrow,RightTee,RightTeeVector,rightthreetimes,RightTriangleBar,RightTriangle,RightTriangleEqual,RightUpDownVector,RightUpTeeVector,RightUpVectorBar,RightUpVector,RightVectorBar,RightVector,ring,risingdotseq,rlarr,rlhar,rlm,rmoustache,rmoust,rnmid,roang,roarr,robrk,ropar,ropf,Ropf,roplus,rotimes,RoundImplies,rpar,rpargt,rppolint,rrarr,Rrightarrow,rsaquo,rscr,Rscr,rsh,Rsh,rsqb,rsquo,rsquor,rthree,rtimes,rtri,rtrie,rtrif,rtriltri,RuleDelayed,ruluhar,rx,Sacute,sacute,sbquo,scap,Scaron,scaron,Sc,sc,sccue,sce,scE,Scedil,scedil,Scirc,scirc,scnap,scnE,scnsim,scpolint,scsim,Scy,scy,sdotb,sdot,sdote,searhk,searr,seArr,searrow,sect:sect$1,semi,seswar,setminus,setmn,sext,Sfr,sfr,sfrown,sharp,SHCHcy,shchcy,SHcy,shcy,ShortDownArrow,ShortLeftArrow,shortmid,shortparallel,ShortRightArrow,ShortUpArrow,shy:shy$1,Sigma,sigma,sigmaf,sigmav,sim,simdot,sime,simeq,simg,simgE,siml,simlE,simne,simplus,simrarr,slarr,SmallCircle,smallsetminus,smashp,smeparsl,smid,smile,smt,smte,smtes,SOFTcy,softcy,solbar,solb,sol,Sopf,sopf,spades,spadesuit,spar,sqcap,sqcaps,sqcup,sqcups,Sqrt,sqsub,sqsube,sqsubset,sqsubseteq,sqsup,sqsupe,sqsupset,sqsupseteq,square,Square,SquareIntersection,SquareSubset,SquareSubsetEqual,SquareSuperset,SquareSupersetEqual,SquareUnion,squarf,squ,squf,srarr,Sscr,sscr,ssetmn,ssmile,sstarf,Star,star,starf,straightepsilon,straightphi,strns,sub,Sub,subdot,subE,sube,subedot,submult,subnE,subne,subplus,subrarr,subset,Subset,subseteq,subseteqq,SubsetEqual,subsetneq,subsetneqq,subsim,subsub,subsup,succapprox,succ,succcurlyeq,Succeeds,SucceedsEqual,SucceedsSlantEqual,SucceedsTilde,succeq,succnapprox,succneqq,succnsim,succsim,SuchThat,sum,Sum,sung,sup1:sup1$1,sup2:sup2$1,sup3:sup3$1,sup,Sup,supdot,supdsub,supE,supe,supedot,Superset,SupersetEqual,suphsol,suphsub,suplarr,supmult,supnE,supne,supplus,supset,Supset,supseteq,supseteqq,supsetneq,supsetneqq,supsim,supsub,supsup,swarhk,swarr,swArr,swarrow,swnwar,szlig:szlig$1,Tab,target,Tau,tau,tbrk,Tcaron,tcaron,Tcedil,tcedil,Tcy,tcy,tdot,telrec,Tfr,tfr,there4,therefore,Therefore,Theta,theta,thetasym,thetav,thickapprox,thicksim,ThickSpace,ThinSpace,thinsp,thkap,thksim,THORN:THORN$1,thorn:thorn$1,tilde,Tilde,TildeEqual,TildeFullEqual,TildeTilde,timesbar,timesb,times:times$1,timesd,tint,toea,topbot,topcir,top,Topf,topf,topfork,tosa,tprime,trade,TRADE,triangle,triangledown,triangleleft,trianglelefteq,triangleq,triangleright,trianglerighteq,tridot,trie,triminus,TripleDot,triplus,trisb,tritime,trpezium,Tscr,tscr,TScy,tscy,TSHcy,tshcy,Tstrok,tstrok,twixt,twoheadleftarrow,twoheadrightarrow,Uacute:Uacute$1,uacute:uacute$1,uarr,Uarr,uArr,Uarrocir,Ubrcy,ubrcy,Ubreve,ubreve,Ucirc:Ucirc$1,ucirc:ucirc$1,Ucy,ucy,udarr,Udblac,udblac,udhar,ufisht,Ufr,ufr,Ugrave:Ugrave$1,ugrave:ugrave$1,uHar,uharl,uharr,uhblk,ulcorn,ulcorner,ulcrop,ultri,Umacr,umacr,uml:uml$1,UnderBar,UnderBrace,UnderBracket,UnderParenthesis,Union,UnionPlus,Uogon,uogon,Uopf,uopf,UpArrowBar,uparrow,UpArrow,Uparrow,UpArrowDownArrow,updownarrow,UpDownArrow,Updownarrow,UpEquilibrium,upharpoonleft,upharpoonright,uplus,UpperLeftArrow,UpperRightArrow,upsi,Upsi,upsih,Upsilon,upsilon,UpTeeArrow,UpTee,upuparrows,urcorn,urcorner,urcrop,Uring,uring,urtri,Uscr,uscr,utdot,Utilde,utilde,utri,utrif,uuarr,Uuml:Uuml$1,uuml:uuml$1,uwangle,vangrt,varepsilon,varkappa,varnothing,varphi,varpi,varpropto,varr,vArr,varrho,varsigma,varsubsetneq,varsubsetneqq,varsupsetneq,varsupsetneqq,vartheta,vartriangleleft,vartriangleright,vBar,Vbar,vBarv,Vcy,vcy,vdash,vDash,Vdash,VDash,Vdashl,veebar,vee,Vee,veeeq,vellip,verbar,Verbar,vert,Vert,VerticalBar,VerticalLine,VerticalSeparator,VerticalTilde,VeryThinSpace,Vfr,vfr,vltri,vnsub,vnsup,Vopf,vopf,vprop,vrtri,Vscr,vscr,vsubnE,vsubne,vsupnE,vsupne,Vvdash,vzigzag,Wcirc,wcirc,wedbar,wedge,Wedge,wedgeq,weierp,Wfr,wfr,Wopf,wopf,wp,wr,wreath,Wscr,wscr,xcap,xcirc,xcup,xdtri,Xfr,xfr,xharr,xhArr,Xi,xi,xlarr,xlArr,xmap,xnis,xodot,Xopf,xopf,xoplus,xotime,xrarr,xrArr,Xscr,xscr,xsqcup,xuplus,xutri,xvee,xwedge,Yacute:Yacute$1,yacute:yacute$1,YAcy,yacy,Ycirc,ycirc,Ycy,ycy,yen:yen$1,Yfr,yfr,YIcy,yicy,Yopf,yopf,Yscr,yscr,YUcy,yucy,yuml:yuml$1,Yuml,Zacute,zacute,Zcaron,zcaron,Zcy,zcy,Zdot,zdot,zeetrf,ZeroWidthSpace,Zeta,zeta,zfr,Zfr,ZHcy,zhcy,zigrarr,zopf,Zopf,Zscr,zscr,zwj,zwnj,default:entities}),Aacute="Á",aacute="á",Acirc="Â",acirc="â",acute="´",AElig="Æ",aelig="æ",Agrave="À",agrave="à",amp$1="&",AMP="&",Aring="Å",aring="å",Atilde="Ã",atilde="ã",Auml="Ä",auml="ä",brvbar="¦",Ccedil="Ç",ccedil="ç",cedil="¸",cent="¢",copy="©",COPY="©",curren="¤",deg="°",divide="÷",Eacute="É",eacute="é",Ecirc="Ê",ecirc="ê",Egrave="È",egrave="è",ETH="Ð",eth="ð",Euml="Ë",euml="ë",frac12="½",frac14="¼",frac34="¾",gt$1=">",GT=">",Iacute="Í",iacute="í",Icirc="Î",icirc="î",iexcl="¡",Igrave="Ì",igrave="ì",iquest="¿",Iuml="Ï",iuml="ï",laquo="«",lt$1="<",LT="<",macr="¯",micro="µ",middot="·",nbsp=" ",not="¬",Ntilde="Ñ",ntilde="ñ",Oacute="Ó",oacute="ó",Ocirc="Ô",ocirc="ô",Ograve="Ò",ograve="ò",ordf="ª",ordm="º",Oslash="Ø",oslash="ø",Otilde="Õ",otilde="õ",Ouml="Ö",ouml="ö",para="¶",plusmn="±",pound="£",quot$1='"',QUOT='"',raquo="»",reg="®",REG="®",sect="§",shy="­",sup1="¹",sup2="²",sup3="³",szlig="ß",THORN="Þ",thorn="þ",times="×",Uacute="Ú",uacute="ú",Ucirc="Û",ucirc="û",Ugrave="Ù",ugrave="ù",uml="¨",Uuml="Ü",uuml="ü",Yacute="Ý",yacute="ý",yen="¥",yuml="ÿ",legacy={Aacute,aacute,Acirc,acirc,acute,AElig,aelig,Agrave,agrave,amp:amp$1,AMP,Aring,aring,Atilde,atilde,Auml,auml,brvbar,Ccedil,ccedil,cedil,cent,copy,COPY,curren,deg,divide,Eacute,eacute,Ecirc,ecirc,Egrave,egrave,ETH,eth,Euml,euml,frac12,frac14,frac34,gt:gt$1,GT,Iacute,iacute,Icirc,icirc,iexcl,Igrave,igrave,iquest,Iuml,iuml,laquo,lt:lt$1,LT,macr,micro,middot,nbsp,not,Ntilde,ntilde,Oacute,oacute,Ocirc,ocirc,Ograve,ograve,ordf,ordm,Oslash,oslash,Otilde,otilde,Ouml,ouml,para,plusmn,pound,quot:quot$1,QUOT,raquo,reg,REG,sect,shy,sup1,sup2,sup3,szlig,THORN,thorn,times,Uacute,uacute,Ucirc,ucirc,Ugrave,ugrave,uml,Uuml,uuml,Yacute,yacute,yen,yuml},legacy$1=Object.freeze({__proto__:null,Aacute,aacute,Acirc,acirc,acute,AElig,aelig,Agrave,agrave,amp:amp$1,AMP,Aring,aring,Atilde,atilde,Auml,auml,brvbar,Ccedil,ccedil,cedil,cent,copy,COPY,curren,deg,divide,Eacute,eacute,Ecirc,ecirc,Egrave,egrave,ETH,eth,Euml,euml,frac12,frac14,frac34,gt:gt$1,GT,Iacute,iacute,Icirc,icirc,iexcl,Igrave,igrave,iquest,Iuml,iuml,laquo,lt:lt$1,LT,macr,micro,middot,nbsp,not,Ntilde,ntilde,Oacute,oacute,Ocirc,ocirc,Ograve,ograve,ordf,ordm,Oslash,oslash,Otilde,otilde,Ouml,ouml,para,plusmn,pound,quot:quot$1,QUOT,raquo,reg,REG,sect,shy,sup1,sup2,sup3,szlig,THORN,thorn,times,Uacute,uacute,Ucirc,ucirc,Ugrave,ugrave,uml,Uuml,uuml,Yacute,yacute,yen,yuml,default:legacy}),amp="&",apos="'",gt=">",lt="<",quot='"',xml={amp,apos,gt,lt,quot},xml$1=Object.freeze({__proto__:null,amp,apos,gt,lt,quot,default:xml}),decode$1={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},decode$2=Object.freeze({__proto__:null,default:decode$1}),require$$0$1=getCjsExportFromNamespace(decode$2),decode_codepoint=createCommonjsModule((function(t,e){var i=commonjsGlobal&&commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(require$$0$1),r=String.fromCodePoint||function(t){var e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e+=String.fromCharCode(t)};e.default=function(t){return t>=55296&&t<=57343||t>1114111?"�":(t in n.default&&(t=n.default[t]),r(t))}}));unwrapExports(decode_codepoint);var require$$0=getCjsExportFromNamespace(entities$1),require$$1=getCjsExportFromNamespace(legacy$1),require$$2=getCjsExportFromNamespace(xml$1),decode=createCommonjsModule((function(t,e){var i=commonjsGlobal&&commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHTML=e.decodeHTMLStrict=e.decodeXML=void 0;var n=i(require$$0),r=i(require$$1),s=i(require$$2),o=i(decode_codepoint),l=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;function a(t){var e=u(t);return function(t){return String(t).replace(l,e)}}e.decodeXML=a(s.default),e.decodeHTMLStrict=a(n.default);var h=function(t,e){return tdecode_3(t)}}parse(t){return parser_1(t,this.options)}}function convertEmptyStringAndObject(t,e){return""===t?e?{}:void 0:t}function ensureIsArray(t,e=!1){if(null==t)return[];let i;return i=Array.isArray(t)?t.map(t=>convertEmptyStringAndObject(t,e)):[convertEmptyStringAndObject(t,e)],i.filter(t=>t)}class CollaborationConverter{constructor(t){this.convertedElements=t}deserialize(t){ensureIsArray(t).forEach(t=>this.parseCollaboration(t))}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow)}buildParticipant(t){ensureIsArray(t).forEach(t=>{this.convertedElements.registerParticipant(new Participant(t.id,t.name,t.processRef))})}buildMessageFlows(t){ensureIsArray(t).forEach(t=>{this.convertedElements.registerMessageFlow(new MessageFlow(t.id,t.name,t.sourceRef,t.targetRef))})}}class ProcessConverter{constructor(t){this.convertedElements=t,this.defaultSequenceFlowIds=[]}deserialize(t){ensureIsArray(t).forEach(t=>this.parseProcess(t))}parseProcess(t){this.convertedElements.registerProcess(new ShapeBpmnElement(t.id,t.name,ShapeBpmnElementKind.POOL)),this.buildProcessInnerElements(t)}buildProcessInnerElements(t){const e=t.id;ShapeUtil.flowNodeKinds().filter(t=>t!=ShapeBpmnElementKind.EVENT_BOUNDARY).forEach(i=>this.buildFlowNodeBpmnElements(e,t[i],i)),this.buildFlowNodeBpmnElements(e,t.boundaryEvent,ShapeBpmnElementKind.EVENT_BOUNDARY),this.buildLaneBpmnElements(e,t[ShapeBpmnElementKind.LANE]),this.buildLaneSetBpmnElements(e,t.laneSet),this.buildSequenceFlows(t[FlowKind.SEQUENCE_FLOW]),this.buildAssociationFlows(t[FlowKind.ASSOCIATION_FLOW])}buildFlowNodeBpmnElements(t,e,i){ensureIsArray(e).forEach(e=>{let n;if(ShapeUtil.isEvent(i))n=this.buildShapeBpmnEvent(e,i,t);else if(ShapeUtil.isActivity(i))n=this.buildShapeBpmnActivity(e,i,t);else if(i==ShapeBpmnElementKind.GATEWAY_EVENT_BASED){const i=e;n=new ShapeBpmnEventBasedGateway(e.id,i.name,t,i.instantiate,ShapeBpmnEventBasedGatewayKind[i.eventGatewayType])}else{const r=i===ShapeBpmnElementKind.TEXT_ANNOTATION?e.text:e.name;n=new ShapeBpmnElement(e.id,r,i,t,e.instantiate)}const r=e.default;ShapeUtil.isWithDefaultSequenceFlow(i)&&r&&this.defaultSequenceFlowIds.push(r),n&&this.convertedElements.registerFlowNode(n)})}buildShapeBpmnActivity(t,e,i){const n=this.buildMarkers(t);return ShapeUtil.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,i,n):ShapeUtil.isCallActivity(e)?this.convertedElements.isGlobalTask(t.calledElement)?void 0:new ShapeBpmnCallActivity(t.id,t.name,ShapeBpmnCallActivityKind.CALLING_PROCESS,i,n):new ShapeBpmnActivity(t.id,t.name,e,i,t.instantiate,n)}buildMarkers(t){const e=[],i=t.standardLoopCharacteristics,n=ensureIsArray(t.multiInstanceLoopCharacteristics,!0)[0];return i||""===i?e.push(ShapeBpmnMarkerKind.LOOP):n&&n.isSequential?e.push(ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL):(n&&!n.isSequential||""===n)&&e.push(ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL),e}buildShapeBpmnEvent(t,e,i){const n=this.getEventDefinitions(t),r=n.map(t=>t.counter).reduce((t,e)=>t+e,0);if(0==r&&ShapeUtil.canHaveNoneEvent(e))return new ShapeBpmnEvent(t.id,t.name,e,ShapeBpmnEventKind.NONE,i);if(1==r){const r=n[0].kind;if(supportedBpmnEventKinds.includes(r))return ShapeUtil.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,r):ShapeUtil.isStartEvent(e)?new ShapeBpmnStartEvent(t.id,t.name,r,i,t.isInterrupting):new ShapeBpmnEvent(t.id,t.name,e,r,i)}}buildShapeBpmnBoundaryEvent(t,e){const i=this.convertedElements.findFlowNode(t.attachedToRef);if(ShapeUtil.isActivity(null==i?void 0:i.kind))return new ShapeBpmnBoundaryEvent(t.id,t.name,e,t.attachedToRef,t.cancelActivity);console.warn("The boundary event %s must be attach to an activity, and not to %s",t.id,null==i?void 0:i.kind)}getEventDefinitions(t){const e=new Map;return bpmnEventKinds.forEach(i=>{const n=ensureIsArray(t[i+"EventDefinition"],!0).length;e.set(i,n)}),ensureIsArray(t.eventDefinitionRef).forEach(t=>{const i=this.convertedElements.findEventDefinitionOfDefinitions(t);e.set(i,e.get(i)+1)}),Array.from(e.keys()).map(t=>({kind:t,counter:e.get(t)})).filter(t=>t.counter>0)}buildShapeBpmnSubProcess(t,e,i){return this.buildSubProcessInnerElements(t),t.triggeredByEvent?new ShapeBpmnSubProcess(t.id,t.name,ShapeBpmnSubProcessKind.EVENT,e,i):new ShapeBpmnSubProcess(t.id,t.name,ShapeBpmnSubProcessKind.EMBEDDED,e,i)}buildSubProcessInnerElements(t){this.buildProcessInnerElements(t)}buildLaneSetBpmnElements(t,e){ensureIsArray(e).forEach(e=>{this.buildLaneBpmnElements(t,e.lane)})}buildLaneBpmnElements(t,e){ensureIsArray(e).forEach(e=>{var i;this.convertedElements.registerLane(new ShapeBpmnElement(e.id,e.name,ShapeBpmnElementKind.LANE,t)),this.assignParentOfLaneFlowNodes(e),(null===(i=e.childLaneSet)||void 0===i?void 0:i.lane)&&this.buildLaneBpmnElements(e.id,e.childLaneSet.lane)})}assignParentOfLaneFlowNodes(t){ensureIsArray(t.flowNodeRef).forEach(e=>{const i=this.convertedElements.findFlowNode(e),n=t.id;i?ShapeUtil.isBoundaryEvent(i.kind)||(i.parentId=n):console.warn("Unable to assign lane %s as parent: flow node %s is not found",n,e)})}buildSequenceFlows(t){ensureIsArray(t).forEach(t=>{const e=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new SequenceFlow(t.id,t.name,t.sourceRef,t.targetRef,e))})}buildAssociationFlows(t){ensureIsArray(t).forEach(t=>{const e=t.associationDirection;this.convertedElements.registerAssociationFlow(new AssociationFlow(t.id,void 0,t.sourceRef,t.targetRef,e))})}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return SequenceFlowKind.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&ShapeUtil.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return ShapeUtil.isActivity(e.kind)?SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY:SequenceFlowKind.CONDITIONAL_FROM_GATEWAY}return SequenceFlowKind.NORMAL}}class Bounds{constructor(t,e,i,n){this.x=t,this.y=e,this.width=i,this.height=n}}class Edge{constructor(t,e,i,n,r=MessageVisibleKind.NONE){this.id=t,this.bpmnElement=e,this.waypoints=i,this.label=n,this.messageVisibleKind=r}}class Waypoint{constructor(t,e){this.x=t,this.y=e}}class Label{constructor(t,e){this.font=t,this.bounds=e}}class Font{constructor(t,e,i,n,r,s){this.name=t,this.size=e,this.isBold=i,this.isItalic=n,this.isUnderline=r,this.isStrikeThrough=s}}class DiagramConverter{constructor(t){this.convertedElements=t,this.convertedFonts=new Map}deserialize(t){const e=[],i=[],n=[],r=[],s=ensureIsArray(t)[0];if(s){this.deserializeFonts(s.BPMNLabelStyle);const t=s.BPMNPlane,o=this.deserializeEdges(t.BPMNEdge),l=this.deserializeShapes(t.BPMNShape);e.push(...l.flowNodes),i.push(...l.lanes),n.push(...l.pools),r.push(...o)}return{flowNodes:e,lanes:i,pools:n,edges:r}}deserializeFonts(t){this.convertedFonts=new Map,ensureIsArray(t).forEach(t=>{ensureIsArray(t.Font).forEach(e=>{this.convertedFonts.set(t.id,new Font(e.name,e.size,e.isBold,e.isItalic,e.isUnderline,e.isStrikeThrough))})})}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};return ensureIsArray(t).forEach(t=>{const i=this.deserializeShape(t,t=>this.convertedElements.findFlowNode(t));if(i)return void e.flowNodes.push(i);const n=this.deserializeShape(t,t=>this.convertedElements.findLane(t));if(n)return void e.lanes.push(n);const r=this.deserializeShape(t,t=>this.convertedElements.findProcess(t));r?e.pools.push(r):console.warn("Shape json deserialization: unable to find bpmn element with id %s",t.bpmnElement)}),e}deserializeShape(t,e){const i=e(t.bpmnElement);if(i){const e=this.deserializeBounds(t);if(i.parentId){const t=this.convertedElements.findParticipantByProcessRef(i.parentId);t&&(i.parentId=t.id)}let n;(i instanceof ShapeBpmnSubProcess||i instanceof ShapeBpmnCallActivity)&&!t.isExpanded&&i.markers.push(ShapeBpmnMarkerKind.EXPAND),ShapeUtil.isPoolOrLane(i.kind)&&(n=void 0===t.isHorizontal||t.isHorizontal);const r=this.deserializeLabel(t.BPMNLabel,t.id);return new Shape(t.id,i,e,r,n)}}deserializeBounds(t){const e=t.Bounds;if(e)return new Bounds(e.x,e.y,e.width,e.height)}deserializeEdges(t){return ensureIsArray(t).map(t=>{const e=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!e)return void console.warn("Edge json deserialization: unable to find bpmn element with id %s",t.bpmnElement);const i=this.deserializeWaypoints(t.waypoint),n=this.deserializeLabel(t.BPMNLabel,t.id),r=t.messageVisibleKind?t.messageVisibleKind:MessageVisibleKind.NONE;return new Edge(t.id,e,i,n,r)}).filter(t=>t)}deserializeWaypoints(t){return ensureIsArray(t).map(t=>new Waypoint(t.x,t.y))}deserializeLabel(t,e){if(t&&"object"==typeof t){const i=this.findFont(t.labelStyle,e),n=this.deserializeBounds(t);if(i||n)return new Label(i,n)}}findFont(t,e){let i;return t&&(i=this.convertedFonts.get(t),i||console.warn("Unable to assign font from style %s to shape/edge %s",t,e)),i}}class EventDefinitionConverter{constructor(t){this.convertedElements=t}deserialize(t){bpmnEventKinds.forEach(e=>{ensureIsArray(t[e+"EventDefinition"],!0).forEach(t=>{this.convertedElements.registerEventDefinitionsOfDefinitions(t.id,e)})})}}class GlobalTaskConverter{constructor(t){this.convertedElements=t}deserialize(t){this.parseGlobalTasks(t.globalTask),this.parseGlobalTasks(t.globalBusinessRuleTask),this.parseGlobalTasks(t.globalManualTask),this.parseGlobalTasks(t.globalScriptTask),this.parseGlobalTasks(t.globalUserTask)}parseGlobalTasks(t){ensureIsArray(t).forEach(t=>{this.convertedElements.registerGlobalTask(t.id)})}}class ConvertedElements{constructor(){this.participantsById=new Map,this.participantsByProcessRef=new Map,this.processes=new Map,this.messageFlows=new Map,this.flowNodes=new Map,this.lanes=new Map,this.sequenceFlows=new Map,this.associationFlows=new Map,this.eventDefinitionsOfDefinitions=new Map,this.globalTaskIds=[]}findParticipantById(t){return this.participantsById.get(t)}findParticipantByProcessRef(t){return this.participantsByProcessRef.get(t)}registerParticipant(t){this.participantsById.set(t.id,t),t.processRef&&this.participantsByProcessRef.set(t.processRef,t)}_findProcess(t){return this.processes.get(t)}registerProcess(t){this.processes.set(t.id,t)}findProcess(t){const e=this.findParticipantById(t);if(e){const t=this._findProcess(e.processRef);if(t){const i=e.name||t.name;return new ShapeBpmnElement(e.id,i,t.kind,t.parentId)}return new ShapeBpmnElement(e.id,e.name,ShapeBpmnElementKind.POOL)}}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinitions(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinitions(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}isGlobalTask(t){return this.globalTaskIds.includes(t)}registerGlobalTask(t){this.globalTaskIds.push(t)}}class BpmnJsonParser{constructor(t,e,i,n,r){this.collaborationConverter=t,this.eventDefinitionConverter=e,this.globalTaskConverter=i,this.processConverter=n,this.diagramConverter=r}parse(t){const e=t.definitions;return this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function newBpmnJsonParser(){const t=new ConvertedElements;return new BpmnJsonParser(new CollaborationConverter(t),new EventDefinitionConverter(t),new GlobalTaskConverter(t),new ProcessConverter(t),new DiagramConverter(t))}class BpmnParser{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function newBpmnParser(){return new BpmnParser(newBpmnJsonParser(),new BpmnXmlParser)}class CssRegistry{constructor(){this.classNamesByBPMNId=new Map}getClassNames(t){return Array.from(this.classNamesByBPMNId.get(t)||[])}addClassNames(t,e){return this.updateClassNames(t,e,(t,e)=>e.add(t))}removeClassNames(t,e){return this.updateClassNames(t,e,(t,e)=>e.delete(t))}toggleClassNames(t,e){return this.updateClassNames(t,e,(t,e)=>e.has(t)?e.delete(t):e.add(t)),e&&e.length>0}updateClassNames(t,e,i){const n=this.getOrInitializeClassNames(t),r=n.size;return ensureIsArray(e).forEach(t=>i(t,n)),n.size!=r}getOrInitializeClassNames(t){let e=this.classNamesByBPMNId.get(t);return null==e&&(e=new Set,this.classNamesByBPMNId.set(t,e)),e}}class OverlayConverter{constructor(){this.overlayPositions=new Map([["start",{horizontalAlign:"left",verticalAlign:"top"}],["middle",{horizontalAlign:"center",verticalAlign:"top"}],["end",{horizontalAlign:"right",verticalAlign:"top"}],["top-left",{horizontalAlign:"left",verticalAlign:"top"}],["top-right",{horizontalAlign:"right",verticalAlign:"top"}],["bottom-left",{horizontalAlign:"left",verticalAlign:"bottom"}],["bottom-right",{horizontalAlign:"right",verticalAlign:"bottom"}]])}convertPosition(t){return this.overlayPositions.get(t.position)}}function newMxGraphCellUpdater(t){return new MxGraphCellUpdater(t,new OverlayConverter)}class MxGraphCellUpdater{constructor(t,e){this.graph=t,this.overlayConverter=e}updateAndRefreshCssClassesOfCell(t,e){const i=this.graph.getModel().getCell(t);if(!i)return;const n=this.graph.getView().getState(i);n.style[StyleIdentifier.BPMN_STYLE_EXTRA_CSS_CLASSES]=e,n.shape.apply(n),n.shape.redraw()}addOverlay(t,e){const i=this.graph.getModel().getCell(t);i&&ensureIsArray(e).forEach(t=>{const e=new MxGraphCustomOverlay(t.label,this.overlayConverter.convertPosition(t));this.graph.addCellOverlay(i,e)})}}class BpmnQuerySelectors{constructor(t){this.containerId=t}existingElement(){return`#${this.containerId} > svg > g > g > g[data-bpmn-id]`}element(t){return`#${this.containerId} svg g g[data-bpmn-id="${t}"]`}labelOfElement(t){return`#${this.containerId} > svg > g > g > g[data-bpmn-id="${t}"].bpmn-label > g > foreignObject`}elementsOfKind(t){return`#${this.containerId} > svg > g > g > g.${t}:not(.bpmn-label)`}}function newBpmnElementsRegistry(t,e){var i;return new BpmnElementsRegistry(t,new HtmlElementRegistry(new BpmnQuerySelectors(null===(i=e.container)||void 0===i?void 0:i.id)),new CssRegistry,newMxGraphCellUpdater(e))}class BpmnElementsRegistry{constructor(t,e,i,n){this.bpmnModelRegistry=t,this.htmlElementRegistry=e,this.cssRegistry=i,this.mxGraphCellUpdater=n}getElementsByIds(t){return ensureIsArray(t).map(t=>this.bpmnModelRegistry.getBpmnSemantic(t)).filter(t=>t).map(t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)}))}getElementsByKinds(t){const e=[];return ensureIsArray(t).map(t=>this.htmlElementRegistry.getBpmnHtmlElements(t).map(t=>({htmlElement:t,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(t.getAttribute("data-bpmn-id"))}))).forEach(t=>e.push(...t)),e}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.addClassNames.bind(this.cssRegistry))}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.removeClassNames.bind(this.cssRegistry))}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.toggleClassNames.bind(this.cssRegistry))}updateCssClasses(t,e,i){const n=ensureIsArray(e);ensureIsArray(t).forEach(t=>this.updateCellIfChanged(i(t,n),t))}updateCellIfChanged(t,e){if(t){const t=this.cssRegistry.getClassNames(e);this.mxGraphCellUpdater.updateAndRefreshCssClassesOfCell(e,t)}}addOverlays(t,e){this.mxGraphCellUpdater.addOverlay(t,e)}}class HtmlElementRegistry{constructor(t){this.selectors=t}getBpmnHtmlElement(t){return document.querySelector(this.selectors.element(t))}getBpmnHtmlElements(t){const e=this.selectors.elementsOfKind(computeBpmnBaseClassName(t));return[...document.querySelectorAll(e)]}}class BpmnModelRegistry{computeRenderedModel(t){return this.searchableModel=new SearchableModel(t),toRenderedModel(t)}getBpmnSemantic(t){const e=this.searchableModel.elementById(t);if(!e)return;const i=e.bpmnElement,n=i instanceof ShapeBpmnElement;return{id:t,name:i.name,isShape:n,kind:i.kind}}}function toRenderedModel(t){const e=t.flowNodes.filter(t=>{const e=t.bpmnElement;return ShapeUtil.isSubProcess(e.kind)&&e.markers.includes(ShapeBpmnMarkerKind.EXPAND)}).map(t=>t.bpmnElement.id),i=[],n=[],r=[];return t.flowNodes.forEach(t=>{const s=t.bpmnElement.kind;ShapeUtil.isSubProcess(s)?i.push(t):ShapeUtil.isBoundaryEvent(s)?n.push(t):e.includes(t.bpmnElement.parentId)||r.push(t)}),{boundaryEvents:n,edges:t.edges,lanes:t.lanes,otherFlowNodes:r,pools:t.pools,subprocesses:i}}class SearchableModel{constructor(t){this.elements=new Map,[].concat(t.pools,t.lanes,t.flowNodes,t.edges).forEach(t=>{this.elements.set(t.bpmnElement.id,t)})}elementById(t){return this.elements.get(t)}}function htmlElement(t){return t instanceof HTMLElement?t:document.getElementById(t)}class BpmnVisualization{constructor(t){const e=new MxGraphConfigurator(htmlElement(null==t?void 0:t.container));this.graph=e.configure(t),this._bpmnModelRegistry=new BpmnModelRegistry,this.bpmnElementsRegistry=newBpmnElementsRegistry(this._bpmnModelRegistry,this.graph)}load(t,e){try{const i=newBpmnParser().parse(t),n=this._bpmnModelRegistry.computeRenderedModel(i);newMxGraphRenderer(this.graph).render(n,e)}catch(t){throw window.alert("Cannot load bpmn diagram: "+t.message),t}}fit(t){this.graph.customFit(t)}}function documentReady(t){"complete"===document.readyState||"interactive"===document.readyState?setTimeout(t,1):document.addEventListener("DOMContentLoaded",t)}function _log(t,e,...i){console.info(t+" "+e,...i)}function logStartup(t,...e){_log("[DEMO STARTUP]",t,...e)}function log(t,...e){_log("[DEMO]",t,...e)}class DropFileUserInterface{constructor(t,e,i,n){this.window=t,this.outerContainerId=e,this.containerToFadeId=i,this.dropCallback=n,this.document=t.document,this.head=document.head,this.body=document.body,this.initializeDragAndDrop()}initializeDragAndDrop(){const t=document.getElementById(this.containerToFadeId);this.addDomElements(t),this.addStyle();const e=document.getElementById(this.outerContainerId);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],e),this.addEventsOnDropContainer(e,t),this.addEventsOnDocument(this.outerContainerId,t)}preventDefaults(t){t.preventDefault(),t.stopPropagation()}preventDefaultsOnEvents(t,e){t.forEach(t=>{e.addEventListener(t,this.preventDefaults,!1)})}addDomElements(t){const e=this.document.createElement("p");e.textContent="open BPMN diagram";const i=this.document.createElement("div");i.classList.add("drop-here-text"),i.appendChild(e);const n=this.document.createElement("div");n.id=this.outerContainerId,n.appendChild(i),t.parentNode.prepend(n)}addStyle(){const t=`\n#${this.containerToFadeId} {\n opacity: 1;\n}\n#${this.containerToFadeId}.faded {\n opacity: 0.1;\n}\n#${this.outerContainerId} {\n overflow: hidden;\n position: absolute;\n top: 10px;\n right: 10px;\n bottom: 10px;\n left: 10px;\n font-weight: bold;\n text-align: center;\n color: #555;\n padding: 10px;\n}\n#${this.outerContainerId} .drop-here-text {\n display: none;\n border: 2px solid transparent;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n#${this.outerContainerId} .drop-here-text p {\n margin-top: 45%;\n font-style: normal;\n font-family: monospace;\n font-size: 40px;\n color: rgba(1,1,1,.2);\n}\n#${this.outerContainerId}.dragging .drop-here-text {\n cursor: default;\n display: block;\n border: 2px dashed rgba(0,0,0,.2);\n border-radius: 7px;\n}`,e=document.createElement("style");e.appendChild(document.createTextNode(t)),this.head.appendChild(e)}addEventsOnDropContainer(t,e){t.addEventListener("dragover",this.getAddClassCallback(e,!1),!1),t.addEventListener("mousedown",this.getRemoveClassCallback(e,!1),!1),t.addEventListener("drop",this.getDropCallbackForElement(e,!1,this.dropCallback),!1)}addEventsOnDocument(t,e){this.document.addEventListener("dragover",this.getAddClassCallback(e,!0,t),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(e,!0,t),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(e,!0,this.dropCallback,t),!1)}getAddClassCallback(t,e,i){return function(){e?this.querySelector("#"+i).classList.add("dragging"):this.classList.add("dragging"),t.classList.add("faded")}}getRemoveClassCallback(t,e,i){return function(){e?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}getDropCallbackForElement(t,e,i,n){return function(r){try{const s=r.dataTransfer.files;i(s[0])}catch(t){console.error(t)}finally{e?this.querySelector("#"+n).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}}}let bpmnVisualization,loadOptions={};function updateLoadOptions(t){log("Updating load options",t),loadOptions.fit=t,log("Load options updated!",stringify(loadOptions))}function getCurrentLoadOptions(){return Object.assign({},loadOptions)}function stringify(t){return JSON.stringify(t,void 0,2)}function loadBpmn(t){log("Loading bpmn...."),bpmnVisualization.load(t,loadOptions),log("BPMN loaded with configuration",stringify(loadOptions)),document.dispatchEvent(new CustomEvent("diagramLoaded"))}function fit(t){log("Fitting...."),bpmnVisualization.fit(t),log("Fit done with configuration",stringify(t))}function getElementsByKinds(t){return bpmnVisualization.bpmnElementsRegistry.getElementsByKinds(t)}function addCssClasses(t,e){return bpmnVisualization.bpmnElementsRegistry.addCssClasses(t,e)}function removeCssClasses(t,e){return bpmnVisualization.bpmnElementsRegistry.removeCssClasses(t,e)}function addOverlay(t,e){return bpmnVisualization.bpmnElementsRegistry.addOverlays(t,[e])}function readAndLoadFile(t){const e=new FileReader;e.onload=()=>{loadBpmn(e.result)},e.readAsText(t)}function handleFileSelect(t){readAndLoadFile(t.target.files[0])}function fetchBpmnContent(t){return log("Fetching BPMN content from url "+t),fetch(t).then(t=>{if(!t.ok)throw Error(String(t.status));return t.text()})}function loadBpmnFromUrl(t,e){fetchBpmnContent(t).catch(i=>{const n=`Unable to fetch ${t}. ${i}`;throw e(n),new Error(n)}).then(t=>(log("BPMN content fetched"),t)).then(e=>{loadBpmn(e),log("Bpmn loaded from url "+t)})}function defaultStatusFetchKoNotifier(t){console.error(t)}function getFitOptionsFromParameters(t,e){var i;const n=(null===(i=t.loadOptions)||void 0===i?void 0:i.fit)||{},r=e.get("fitTypeOnLoad");r&&(n.type=r);const s=e.get("fitMargin");return s&&(n.margin=Number(s)),n}function startBpmnVisualization(t){const e=logStartup,i=t.globalOptions.container;e(`Initializing BpmnVisualization with container '${i}'...`),bpmnVisualization=new BpmnVisualization(t.globalOptions),e("Initialization completed"),new DropFileUserInterface(window,"drop-container",i,readAndLoadFile),e("Drag&Drop support initialized");const n=new URLSearchParams(window.location.search);e("Configuring Load Options"),loadOptions=t.loadOptions||{},loadOptions.fit=getFitOptionsFromParameters(t,n),e("Checking if 'BPMN content' is provided as query parameter");const r=n.get("bpmn");if(r){const t=decodeURIComponent(r);return e("Received bpmn length: "+t.length),e("Received bpmn content: "+t),e("BPMN auto loading"),loadBpmn(t),void e("BPMN content loading completed")}e("No 'BPMN content' provided"),e("Checking if an 'url to fetch BPMN content' is provided as query parameter");const s=n.get("url");if(s){loadBpmnFromUrl(decodeURIComponent(s),t.statusFetchKoNotifier||defaultStatusFetchKoNotifier)}else e("No 'url to fetch BPMN content' provided")}const mxConstants=mxgraph.mxConstants;export{BpmnElementsRegistry,BpmnVisualization,FitType,IconPainter,IconPainterProvider,MarkerIdentifier,ShapeBpmnCallActivityKind,ShapeBpmnElementKind,ShapeBpmnEventBasedGatewayKind,ShapeBpmnEventKind,ShapeBpmnMarkerKind,ShapeBpmnSubProcessKind,ShapeUtil,StyleConfigurator,StyleDefault,StyleIdentifier,addCssClasses,addOverlay,bpmnEventKinds,buildPaintParameter,computeScaledIconSize,documentReady,fit,getCurrentLoadOptions,getElementsByKinds,handleFileSelect,log,logStartup,mxConstants,removeCssClasses,startBpmnVisualization,supportedBpmnEventKinds,updateLoadOptions}; diff --git a/demo/overlays.html b/demo/overlays.html new file mode 100644 index 00000000..b957cea8 --- /dev/null +++ b/demo/overlays.html @@ -0,0 +1,25 @@ + + + + + BPMN Visualization Overlays + + + + +
+
+ + + + + diff --git a/demo/static/css/tailwind.css b/demo/static/css/tailwind.css index 092ff62c..06256843 100644 --- a/demo/static/css/tailwind.css +++ b/demo/static/css/tailwind.css @@ -1,3 +1,3 @@ -/*! tailwindcss v2.0.3 | MIT License | https://tailwindcss.com*/ +/*! tailwindcss v2.0.4 | MIT License | https://tailwindcss.com*/ /*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji}hr{height:0;color:inherit}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],button{-webkit-appearance:button}legend{padding:0}progress{vertical-align:baseline}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{font-family:inherit;line-height:inherit}*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder, textarea::-moz-placeholder{opacity:1;color:#9ca3af}input:-ms-input-placeholder, textarea:-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgba(107,114,128,var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity:1;background-color:rgba(31,41,55,var(--tw-bg-opacity))}.bg-gradient-to-r{background-image:linear-gradient(90deg,var(--tw-gradient-stops))}.bg-gradient-to-b{background-image:linear-gradient(180deg,var(--tw-gradient-stops))}.from-red-200{--tw-gradient-from:#fecaca;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to,rgba(254,202,202,0))}.from-purple-900{--tw-gradient-from:#4c1d95;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to,rgba(76,29,149,0))}.to-gray-800{--tw-gradient-to:#1f2937}.to-red-100{--tw-gradient-to:#fee2e2}.border-transparent{border-color:transparent}.border-gray-800{--tw-border-opacity:1;border-color:rgba(31,41,55,var(--tw-border-opacity))}.border-red-500{--tw-border-opacity:1;border-color:rgba(239,68,68,var(--tw-border-opacity))}.border-red-600{--tw-border-opacity:1;border-color:rgba(220,38,38,var(--tw-border-opacity))}.border-yellow-500{--tw-border-opacity:1;border-color:rgba(245,158,11,var(--tw-border-opacity))}.border-blue-600{--tw-border-opacity:1;border-color:rgba(37,99,235,var(--tw-border-opacity))}.border-purple-500{--tw-border-opacity:1;border-color:rgba(139,92,246,var(--tw-border-opacity))}.hover\:border-red-900:hover{--tw-border-opacity:1;border-color:rgba(127,29,29,var(--tw-border-opacity))}.rounded-lg{border-radius:.5rem}.rounded-tl-3xl{border-top-left-radius:1.5rem}.border-b-2{border-bottom-width:2px}.border-b-4{border-bottom-width:4px}.cursor-pointer{cursor:pointer}.block{display:block}.flex{display:flex}.table{display:table}.hidden{display:none}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.content-center{align-content:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.flex-1{flex:1 1 0%}.flex-grow{flex-grow:1}.flex-shrink{flex-shrink:1}.float-right{float:right}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-bold{font-weight:700}.h-11{height:2.75rem}.h-16{height:4rem}.h-auto{height:auto}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.leading-normal{line-height:1.5}.m-2{margin:.5rem}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mr-3{margin-right:.75rem}.ml-3{margin-left:.75rem}.mt-12{margin-top:3rem}.overflow-hidden{overflow:hidden}.p-4{padding:1rem}.p-6{padding:1.5rem}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:.25rem;padding-bottom:.25rem}.px-1{padding-left:.25rem;padding-right:.25rem}.pl-0{padding-left:0}.pb-1{padding-bottom:.25rem}.pl-1{padding-left:.25rem}.pt-2{padding-top:.5rem}.pl-2{padding-left:.5rem}.pt-3{padding-top:.75rem}.pb-24{padding-bottom:6rem}.fixed{position:fixed}.absolute{position:absolute}.top-0{top:0}.bottom-0{bottom:0}*{--tw-shadow:0 0 transparent}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.06)}.shadow,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,0.1),0 10px 10px -5px rgba(0,0,0,0.04)}*{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-black{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgba(239,68,68,var(--tw-text-opacity))}.text-red-900{--tw-text-opacity:1;color:rgba(127,29,29,var(--tw-text-opacity))}.text-blue-900{--tw-text-opacity:1;color:rgba(30,58,138,var(--tw-text-opacity))}.hover\:text-red-900:hover{--tw-text-opacity:1;color:rgba(127,29,29,var(--tw-text-opacity))}.no-underline{text-decoration:none}.tracking-normal{letter-spacing:0}.align-middle{vertical-align:middle}.w-full{width:100%}.z-10{z-index:10}.z-20{z-index:20}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@media (min-width:768px){.md\:flex-row{flex-direction:row}.md\:flex-col{flex-direction:column}.md\:content-start{align-content:flex-start}.md\:justify-start{justify-content:flex-start}.md\:h-screen{height:100vh}.md\:mt-2{margin-top:.5rem}.md\:mt-12{margin-top:3rem}.md\:px-2{padding-left:.5rem;padding-right:.5rem}.md\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\:py-5{padding-top:1.25rem;padding-bottom:1.25rem}.md\:pt-1{padding-top:.25rem}.md\:pl-1{padding-left:.25rem}.md\:pb-5{padding-bottom:1.25rem}.md\:fixed{position:fixed}.md\:relative{position:relative}.md\:top-0{top:0}.md\:left-0{left:0}.md\:text-left{text-align:left}.md\:text-center{text-align:center}.md\:w-48{width:12rem}.md\:w-1\/3{width:33.333333%}} \ No newline at end of file diff --git a/demo/static/js/elements-identification.js b/demo/static/js/elements-identification.js index 47991094..e3aa774f 100644 --- a/demo/static/js/elements-identification.js +++ b/demo/static/js/elements-identification.js @@ -13,34 +13,55 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { documentReady, FitType, getElementsByKinds, addCssClasses, removeCssClasses, log, startBpmnVisualization, updateLoadOptions, ShapeUtil } from '../../index.es.js'; +import { + documentReady, + FitType, + getElementsByKinds, + addCssClasses, + removeCssClasses, + log, + startBpmnVisualization, + updateLoadOptions, + ShapeUtil, + addOverlay, +} from '../../index.es.js'; let lastBpmnIdsWithExtraCssClasses = []; let lastCssClassName = ''; // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -function configureControls() { - const textArea = document.getElementById('elements-result'); +function updateSelectedBPMNElements(textArea, bpmnKind) { + log(`Searching for Bpmn elements of '${bpmnKind}' kind`); + const elementsByKinds = getElementsByKinds(bpmnKind); - document.getElementById('bpmn-kinds-select').onchange = function (ev) { - const bpmnKind = ev.target.value; - log(`Searching for Bpmn elements of '${bpmnKind}' kind`); - const elementsByKinds = getElementsByKinds(bpmnKind); + // Update text area + const textHeader = `Found ${elementsByKinds.length} ${bpmnKind}(s)`; + log(textHeader); + const lines = elementsByKinds.map(elt => ` - ${elt.bpmnSemantic.id}: '${elt.bpmnSemantic.name}'`).join('\n'); - const textHeader = `Found ${elementsByKinds.length} ${bpmnKind}(s)`; - log(textHeader); - const lines = elementsByKinds.map(elt => ` - ${elt.bpmnSemantic.id}: '${elt.bpmnSemantic.name}'`).join('\n'); + textArea.value += [textHeader, lines].join('\n') + '\n'; + textArea.scrollTop = textArea.scrollHeight; - textArea.value += [textHeader, lines].join('\n') + '\n'; - textArea.scrollTop = textArea.scrollHeight; + // CSS classes update + removeCssClasses(lastBpmnIdsWithExtraCssClasses, lastCssClassName); + const bpmnIds = elementsByKinds.map(elt => elt.bpmnSemantic.id); + lastCssClassName = getCustomCssClassName(bpmnKind); + addCssClasses(bpmnIds, lastCssClassName); + lastBpmnIdsWithExtraCssClasses = bpmnIds; - // CSS classes update - removeCssClasses(lastBpmnIdsWithExtraCssClasses, lastCssClassName); - const bpmnIds = elementsByKinds.map(elt => elt.bpmnSemantic.id); - lastCssClassName = getCustomCssClassName(bpmnKind); - addCssClasses(bpmnIds, lastCssClassName); - lastBpmnIdsWithExtraCssClasses = bpmnIds; - }; + // Overlay update + bpmnIds.forEach(id => { + addOverlay(id, getOverlay(bpmnKind)); + }); +} + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +function configureControls() { + const textArea = document.getElementById('elements-result'); + + const selectedKindElt = document.getElementById('bpmn-kinds-select'); + selectedKindElt.onchange = event => updateSelectedBPMNElements(textArea, event.target.value); + document.addEventListener('diagramLoaded', () => updateSelectedBPMNElements(textArea, selectedKindElt.value), false); document.getElementById('bpmn-kinds-textarea-clean-btn').onclick = function () { textArea.value = ''; @@ -66,6 +87,22 @@ function getCustomCssClassName(bpmnKind) { return 'detection'; } +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +function getOverlay(bpmnKind) { + if (ShapeUtil.isActivity(bpmnKind)) { + return { position: 'top-left', label: '30' }; + } else if (bpmnKind.includes('Gateway')) { + return { position: 'top-right', label: '3' }; + } else if (bpmnKind.includes('Event')) { + return { position: 'bottom-left', label: '15' }; + } else if (bpmnKind.includes('lane')) { + return { position: 'bottom-right', label: '100' }; + } else if (bpmnKind.includes('Flow')) { + return { position: 'middle', label: '999999' }; + } + return { position: 'top-left', label: '40' }; +} + documentReady(() => { startBpmnVisualization({ globalOptions: { diff --git a/demo/static/js/overlays.js b/demo/static/js/overlays.js new file mode 100644 index 00000000..e5a1f3fd --- /dev/null +++ b/demo/static/js/overlays.js @@ -0,0 +1,47 @@ +/** + * Copyright 2020 Bonitasoft S.A. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { documentReady, FitType, startBpmnVisualization, updateLoadOptions, addOverlay } from '../../index.es.js'; + +documentReady(() => { + startBpmnVisualization({ + globalOptions: { + container: 'bpmn-container', + navigation: { + enabled: true, + }, + }, + }); + updateLoadOptions({ type: FitType.Center, margin: 20 }); + + const positions = new Map([ + ['StartEvent_1', 'top-left'], + // TODO: uncomment or use when we add support for edge overlay + // ['Flow_1', 'middle'], + ['Activity_1', 'top-right'], + ]); + + setTimeout(() => { + // Overlay update + [ + 'StartEvent_1', + // TODO: uncomment or use when we add support for edge overlay + // 'Flow_1', + 'Activity_1', + ].forEach(id => { + addOverlay(id, { position: positions.get(id), label: '123' }); + }); + }, 500); +}); diff --git a/examples/custom-animation/growing-sequence-flow/index.html b/examples/custom-animation/growing-sequence-flow/index.html index 5353f8ff..9883e6af 100644 --- a/examples/custom-animation/growing-sequence-flow/index.html +++ b/examples/custom-animation/growing-sequence-flow/index.html @@ -89,7 +89,7 @@

Growing Sequence Flow

- + diff --git a/examples/custom-animation/running-dashed-message-flow/index.html b/examples/custom-animation/running-dashed-message-flow/index.html index d7906a16..25ac9d3e 100644 --- a/examples/custom-animation/running-dashed-message-flow/index.html +++ b/examples/custom-animation/running-dashed-message-flow/index.html @@ -89,7 +89,7 @@

Running Dashed Message Flow

- + diff --git a/examples/custom-bpmn-theme/custom-colors/index.html b/examples/custom-bpmn-theme/custom-colors/index.html index 9d7da1d1..76abc8a3 100644 --- a/examples/custom-bpmn-theme/custom-colors/index.html +++ b/examples/custom-bpmn-theme/custom-colors/index.html @@ -64,7 +64,7 @@

Custom colors for User Task

- + diff --git a/examples/custom-bpmn-theme/custom-fonts/index.html b/examples/custom-bpmn-theme/custom-fonts/index.html index be9d2015..b77ca76f 100644 --- a/examples/custom-bpmn-theme/custom-fonts/index.html +++ b/examples/custom-bpmn-theme/custom-fonts/index.html @@ -61,7 +61,7 @@

Custom BPMN element fonts

- + diff --git a/examples/custom-bpmn-theme/custom-user-task-icon/index.html b/examples/custom-bpmn-theme/custom-user-task-icon/index.html index 168191f6..47251c8b 100644 --- a/examples/custom-bpmn-theme/custom-user-task-icon/index.html +++ b/examples/custom-bpmn-theme/custom-user-task-icon/index.html @@ -56,7 +56,7 @@

Custom User Task icon

- + diff --git a/examples/custom-bpmn-theme/hacktoberfest-diagram/index.html b/examples/custom-bpmn-theme/hacktoberfest-diagram/index.html index 97f0e963..797e9a8f 100644 --- a/examples/custom-bpmn-theme/hacktoberfest-diagram/index.html +++ b/examples/custom-bpmn-theme/hacktoberfest-diagram/index.html @@ -69,7 +69,7 @@

Dark Hacktoberfest Theme

- + diff --git a/examples/custom-interaction/apply-css-classes/index.html b/examples/custom-interaction/apply-css-classes/index.html index 30e21db0..0c3c4feb 100644 --- a/examples/custom-interaction/apply-css-classes/index.html +++ b/examples/custom-interaction/apply-css-classes/index.html @@ -151,7 +151,7 @@

Apply css classes

- + - + diff --git a/examples/custom-interaction/popover-static/index.html b/examples/custom-interaction/popover-static/index.html index 5941ec1b..6862dd80 100644 --- a/examples/custom-interaction/popover-static/index.html +++ b/examples/custom-interaction/popover-static/index.html @@ -116,7 +116,7 @@
Popover content
- + diff --git a/examples/custom-interaction/select-elements-by-bpmn-kind/index.html b/examples/custom-interaction/select-elements-by-bpmn-kind/index.html index 1579db6b..04befa9b 100644 --- a/examples/custom-interaction/select-elements-by-bpmn-kind/index.html +++ b/examples/custom-interaction/select-elements-by-bpmn-kind/index.html @@ -130,7 +130,7 @@

Select elements by BPMN kind

- + diff --git a/examples/custom-navigation/call-activity-with-modal-on-mouse-over/index.html b/examples/custom-navigation/call-activity-with-modal-on-mouse-over/index.html index 4dc65f77..c15e9366 100644 --- a/examples/custom-navigation/call-activity-with-modal-on-mouse-over/index.html +++ b/examples/custom-navigation/call-activity-with-modal-on-mouse-over/index.html @@ -80,7 +80,7 @@

Open a modal on mouse over on a call activity

- + diff --git a/examples/custom-navigation/call-activity-with-reload-on-dblclick/index.html b/examples/custom-navigation/call-activity-with-reload-on-dblclick/index.html index 5c7ada27..9ca7dd88 100644 --- a/examples/custom-navigation/call-activity-with-reload-on-dblclick/index.html +++ b/examples/custom-navigation/call-activity-with-reload-on-dblclick/index.html @@ -73,7 +73,7 @@

Load new BPMN diagram on double click on call activity

- + diff --git a/examples/custom-navigation/call-activity-with-tabs-on-click/index.html b/examples/custom-navigation/call-activity-with-tabs-on-click/index.html index ab8ac211..088d0c83 100644 --- a/examples/custom-navigation/call-activity-with-tabs-on-click/index.html +++ b/examples/custom-navigation/call-activity-with-tabs-on-click/index.html @@ -75,7 +75,7 @@

Switch BPMN diagram display on click on call activity

- + diff --git a/examples/diagram-navigation/diagram-fit-after-load/index.html b/examples/diagram-navigation/diagram-fit-after-load/index.html index 99066e61..5bf208eb 100644 --- a/examples/diagram-navigation/diagram-fit-after-load/index.html +++ b/examples/diagram-navigation/diagram-fit-after-load/index.html @@ -131,7 +131,7 @@

Various fit after load

- + - + diff --git a/examples/diagram-navigation/diagram-navigation/index.html b/examples/diagram-navigation/diagram-navigation/index.html index e2871c46..3565ad2b 100644 --- a/examples/diagram-navigation/diagram-navigation/index.html +++ b/examples/diagram-navigation/diagram-navigation/index.html @@ -76,7 +76,7 @@

With Diagram Navigation enabled

- + + ``` 💡 During the development step, you can use the non-minified version: ```html - + ``` ### Use the library diff --git a/examples/display-bpmn-diagram/01-getting-started/index.html b/examples/display-bpmn-diagram/01-getting-started/index.html index 8fb2b1e4..112878f9 100644 --- a/examples/display-bpmn-diagram/01-getting-started/index.html +++ b/examples/display-bpmn-diagram/01-getting-started/index.html @@ -51,9 +51,9 @@

Getting Started

- + - + - + - + - + - +