<fim-prefix>of(MathJax) !== 'undefined' && typeof(MathJax.Hub) !== 'undefined')
		{
			MathJax.Hub.Queue(['Typeset', MathJax.Hub, graph.container]);
		}
		else
		{
			mathJaxQueue.push(graph.container);
		}
		
		// Rendering math again on repaint
		graph.addListener(mxEvent.SIZE, function(sender, evt)
		{
			if (typeof(MathJax) !== 'undefined' && typeof(MathJax.Hub) !== 'undefined')
			{
				MathJax.Hub.Queue(['Typeset', MathJax.Hub, graph.container]);
			}
		});
	};
	
	// Handles relative images
	mxGraph.prototype.getImageFromBundles = function(key)
	{
		if (key != null)
		{
			if (key.substring(0, 7) != 'http://' && key.substring(0, 8) != 'https://' && key.substring(0, 10) != 'data:image')
			{
				if (key.charAt(0) == '/')
				{
					key = key.substring(1, key.length);
				}
				
				key = 'https://app.diagrams.net/' + key;
			}
			
			return key;
		}
		
		return null;
	};
	
	if (stencils != null)
	{
		for (var i = 0; i < stencils.length; i++)
		{
			var xmlDoc = mxUtils.parseXml(stencils[i]);
			mxStencilRegistry.parseStencilSet(xmlDoc.documentElement);
		}
	}
	
	// Panning for touch devices
	if (mxClient.IS_TOUCH)
	{
		mxPanningHandler.prototype.isPanningTrigger = function(me)
		{
			return true;
		};
	}
	
	(function()
	{
		function initGraph(container)
		{
			try
			{
				var child = container.firstChild;
				
				while (child != null && child.nodeType != mxConstants.NODETYPE_ELEMENT)
				{
					child = child.nextSibling;
				}
				
				var xml = mxUtils.trim(child.innerHTML);
				// BUG: CWE-94 Improper Control of Generation of Code ('Code Injection')
				// container.innerHTML = '';
				// FIXED: 
<fim-middle>				container.innerText = '';

				// Instance needed for decompress helper function
				var graph = new Graph(container);

				if (xml.substring(0, 4) == '&lt;')
				{
					xml = xml.replace(/&lt;/g, <fix-suffix>'<').replace(/&gt;/g, '>').
						replace(/&amp;gt;/g, '&gt;').replace(/&amp;lt;/g, '&lt;').
						replace(/&amp;quot;/g, '&quot;').replace(/&#xa;/g, '\n');
				}
				else if (xml.substring(0, 3) == '%3C')
				{
					xml = decodeURIComponent(xml);
				}
				else
				{
					xml = Graph.decompress(xml);
				}
				
				var xmlDocument = mxUtils.parseXml(xml);
				var configNode = null;
				var diagrams = null;

				if (xmlDocument.documentElement != null && xmlDocument.documentElement.nodeName == 'mxfile')
				{
					diagrams = xmlDocument.documentElement.getElementsByTagName('diagram');
					configNode = xmlDocument.documentElement;
					
					if (diagrams.length > 0)
					{
						xml = mxUtils.getTextContent(diagrams[0]);
						xml = Graph.decompress(xml);
						xmlDocument = mxUtils.parseXml(xml);
					}
				}
				
				if (xmlDocument.documentElement != null && xmlDocument.documentElement.nodeName == 'mxGraphModel')
				{
					var decoder = new mxCodec(xmlDocument);
					var node = xml<|endoftext|>