diff --git a/ChangeLog b/ChangeLog index e7854de3e0cf0dd499baaf06e8f7742db2a43ca3..f488503f248bbd659f61ebdd4bd00a6b1269ff3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +04-MAR-2018: 8.5.3 + +- Gliffy import improvement +- Fix for anchor download issue in Chrome 65 + 31-MAR-2018: 8.5.2 - Add mass gliffy import in Confluence Cloud diff --git a/VERSION b/VERSION index bd0b85a9b1d1a0f86f13f56c06cce7d3918f7d7d..6a295953916762d2c916d27e4d9d9420d6ea41eb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.5.2 \ No newline at end of file +8.5.3 \ No newline at end of file diff --git a/etc/slidesaddon/Code.gs b/etc/slidesaddon/Code.gs new file mode 100644 index 0000000000000000000000000000000000000000..fb679a9f85911bd60c5030222860e5d89773a7dd --- /dev/null +++ b/etc/slidesaddon/Code.gs @@ -0,0 +1,606 @@ +/** + * Draw.io Diagrams Docs add-on v1.9 + * Copyright (c) 2018, JGraph Ltd + */ +var EXPORT_URL = "https://exp.draw.io/ImageExport4/export"; +var DRAW_URL = "https://www.draw.io/"; +var SCALING_VALUE = 0.8; // Google Docs seem to be downscaling all images by this amount + +/** + * Creates a menu entry in the Google Docs UI when the document is opened. + */ +function onOpen() +{ + SlidesApp.getUi().createAddonMenu() + .addItem("Insert Diagrams", "insertDiagrams") + .addItem("Update Selected", "updateSelected") + .addItem("Update All", "updateAll") + .addToUi(); +} + +/** + * Runs when the add-on is installed. + */ +function onInstall() +{ + onOpen(); +} + +/** + * Gets the user's OAuth 2.0 access token so that it can be passed to Picker. + * This technique keeps Picker from needing to show its own authorization + * dialog, but is only possible if the OAuth scope that Picker needs is + * available in Apps Script. In this case, the function includes an unused call + * to a DriveApp method to ensure that Apps Script requests access to all files + * in the user's Drive. + * + * @return {string} The user's OAuth 2.0 access token. + */ +function getOAuthToken() { + DriveApp.getRootFolder(); + return ScriptApp.getOAuthToken(); +} + +/** + * Shows a picker and lets the user select multiple diagrams to insert. + */ +function insertDiagrams() +{ + var html = HtmlService.createHtmlOutputFromFile('Picker.html') + .setWidth(620).setHeight(440) + .setSandboxMode(HtmlService.SandboxMode.IFRAME); + SlidesApp.getUi().showModalDialog(html, 'Select draw.io Diagrams'); +} + +/** + * Inserts an image for the given diagram. + */ +function pickerHandler(items) +{ + var app = UiApp.getActiveApplication(); + + // Delay after closing the picker used to show spinner on client-side + app.close(); + + if (items != null && items.length > 0) + { + var inserted = 0; + var errors = []; + + // if there are selected items in the slides, assume they are going to be replaced + // by the newly inserted images + var selectionCoordinates = getSelectionCoordinates(); + var offsetX = selectionCoordinates[0]; + var offsetY = selectionCoordinates[1]; + + deleteSelectedElements(); + + var step = 10; + + for (var i = 0; i < items.length; i++) + { + try + { + if (insertDiagram(items[i].id, items[i].page, offsetX, offsetY) != null) + { + inserted++; + offsetX = offsetX + step; + offsetY = offsetY + step; + } + else + { + errors.push("- " + items[i].name + ": Unknown error"); + } + } + catch (e) + { + errors.push("- " + items[i].name + ": " + e.message); + } + } + + // Shows message only in case of errors + if (errors.length > 0) + { + var msg = ""; + + if (errors.length > 0) + { + msg += errors.length + " insert" + ((errors.length > 1) ? "s" : "") + " failed:\n"; + } + + msg += errors.join("\n"); + SlidesApp.getUi().alert(msg); + } + } +} + +/** + Finds left-most and top-most coordinates of selected page elements; (0,0) by default + @return left-most and top-most coordinates in an array +**/ +function getSelectionCoordinates() +{ + var selection = SlidesApp.getActivePresentation().getSelection(); + switch (selection.getSelectionType()) + { + case SlidesApp.SelectionType.PAGE_ELEMENT: + { + // only interested if selection is containing page elements + var elements = selection.getPageElementRange(); + var top = 1000000; + var left = 1000000; + if (elements) + { + // find the left-most, top-most coordinate of selected elements + var pageElements = elements.getPageElements(); + for (var i = 0; i < pageElements.length; i++) + { + var element = pageElements[i]; + var elementTop = element.getTop(); + var elementLeft = element.getLeft(); + if (top > elementTop) + top = elementTop; + if (left > elementLeft) + left = elementLeft; + } + return [left, top]; + } + } + } + return [0, 0]; +} + +/** + Deletes selected elements +**/ +function deleteSelectedElements() +{ + var selection = SlidesApp.getActivePresentation().getSelection(); + switch (selection.getSelectionType()) + { + case SlidesApp.SelectionType.PAGE_ELEMENT: + { + // only interested if selection is containing page elements + var elements = selection.getPageElementRange(); + if (elements) { + var pageElements = elements.getPageElements(); + // find the left-most, top-most coordinate of selected elements + for (var i = 0; i < pageElements.length; i++) + { + // delete all selected page elements + var element = pageElements[i]; + element.remove(); + } + } + } + } +} + +/** + * Inserts the given diagram at the given position. + */ +function insertDiagram(id, page, offsetX, offsetY) +{ + var scale = 2; + var result = fetchImage(id, page, scale); + + var blob = result[0]; + var w = result[1] * SCALING_VALUE; + var h = result[2] * SCALING_VALUE; + var img = null; + + if (blob != null) + { + var slide = SlidesApp.getActivePresentation().getSelection().getCurrentPage().asSlide(); + var img = slide.insertImage(blob); + img.setLeft(offsetX); + img.setTop(offsetY); + var wmax = SlidesApp.getActivePresentation().getPageWidth(); + var hmax = SlidesApp.getActivePresentation().getPageHeight(); + + var link = createLink(id, page, scale); + img.setLinkUrl(link); + + // Scales to document width if not placeholder + if (w == 0 && h == 0) { + var w = img.getWidth(); + var h = img.getHeight(); + } + + var nw = w; + var nh = h; + + // adjust scale (retina/HiDPI display support) + w /= scale; + h /= scale; + + if (wmax > 0 && w > wmax) + { + var aspect = w / h; + + // Keeps width and aspect + nw = wmax; + nh = wmax / aspect; + } + else if (hmax > 0 && h > hmax) { + var aspect = h / w; + + // Keeps height and aspect + nh = hmax; + nw = hmax / aspect; + } + img.setWidth(w); + img.setHeight(h); + } + else + { + throw new Error("Invalid image " + id); + } + + return img; +} + +/** + * Updates the selected diagrams in-place. + */ +function updateSelected() +{ + var selection = SlidesApp.getActivePresentation().getSelection(); + + if (selection) + { + switch (selection.getSelectionType()) + { + case SlidesApp.SelectionType.PAGE_ELEMENT: + { + var selected = selection.getPageElementRange(); + if (!selected) + return; + + selected = selected.getPageElements(); + + var elts = []; + + // Unwraps selection elements + for (var i = 0; i < selected.length; i++) + { + var pageElement = selected[i]; + switch (pageElement.getPageElementType()) + { + case SlidesApp.PageElementType.IMAGE: + { + elts.push(selected[i].asImage()); + } + } + } + updateElements(elts); + } + } + } + else + { + SlidesApp.getUi().alert("No selection"); + } +} + +/** + * Updates all diagrams in the document. + */ +function updateAll() +{ + // collect all slides + var slides = SlidesApp.getActivePresentation().getSlides(); + var images = []; + for (var i = 0; i < slides.length; i++) + { + // collect all images on all slides + var slide = slides[i]; + var slideImages = slide.getImages(); + images = images.concat(slideImages); + } + updateElements(images); +} + +/** + * Updates all diagrams in the document. + */ +function updateElements(elts) +{ + if (elts != null) + { + var updated = 0; + var errors = []; + + for (var i = 0; i < elts.length; i++) + { + try + { + if (updateElement(elts[i]) != null) + { + updated++; + } + } + catch (e) + { + errors.push("- " + e.message); + } + } + + // Shows status in case of errors or multiple updates + if (errors.length > 0 || updated > 1) + { + var msg = ""; + + if (updated > 0) + { + msg += updated + " diagram" + ((updated > 1) ? "s" : "") + " updated\n"; + } + + if (errors.length > 0) + { + msg += errors.length + " update" + ((errors.length > 1) ? "s" : "") + " failed:\n"; + } + + msg += errors.join("\n"); + SlidesApp.getUi().alert(msg); + } + } +} + +/** + * Returns true if the given URL points to draw.io + */ +function createLink(id, page, scale) +{ + var params = []; + + if (page != null && page != "0") + { + params.push('page=' + page); + } + + // This URL parameter is ignored and is used internally to + // store the retina flag since there is no other storage + if (scale != null && scale != 1) + { + params.push('scale=' + scale); + } + + return DRAW_URL + ((params.length > 0) ? "?" + params.join("&") : "") + "#G" + id; +} + +/** + * Returns true if the given URL points to draw.io + */ +function isValidLink(url) +{ + return url != null && (url.substring(0, DRAW_URL.length) == DRAW_URL || url.substring(0, 22) == "https://drive.draw.io/"); +} + +/** + * Returns the diagram ID for the given URL. + */ +function getDiagramId(url) +{ + return url.substring(url.lastIndexOf("#G") + 2); +} + +/** + * Returns the diagram ID for the given URL. + */ +function getUrlParams(url) +{ + var result = {}; + var idx = url.indexOf("?"); + + if (idx > 0) + { + var idx2 = url.indexOf("#", idx + 1); + + if (idx2 < 0) + { + idx2 = url.length; + } + + if (idx2 > idx) + { + var search = url.substring(idx + 1, idx2); + var tokens = search.split("&"); + + for (var i = 0; i < tokens.length; i++) + { + var idx3 = tokens[i].indexOf('='); + + if (idx3 > 0) + { + result[tokens[i].substring(0, idx3)] = tokens[i].substring(idx3 + 1); + } + } + } + } + + return result; +} + +/** + * Updates the diagram in the given inline image and returns the new inline image. + */ +function updateElement(elt) +{ + var result = null; + + if (elt.getPageElementType() == SlidesApp.PageElementType.IMAGE) + { + var url = elt.getLink(); + if (url != null) + url = url.getUrl(); + + if (url == null) + { + // commenting this out - missing link is most of the time an indicator image is not coming from draw.io + // we probably don't want to have this popping out as an error + // throw new Error("Missing link") + } + else if (isValidLink(url)) + { + var id = getDiagramId(url); + var params = getUrlParams(url); + + if (id != null && id.length > 0) + { + result = updateDiagram(id, params["page"], parseFloat(params["scale"] || 1), elt); + } + else + { + // commenting this out as well - invalid link might indicate image is not coming from draw.io + // throw new Error("Invalid link " + url); + } + } + } + + return result; +} + +/** + * Updates the diagram in the given inline image and returns the new inline image. + */ +function updateDiagram(id, page, scale, elt) +{ + var img = null; + var result = fetchImage(id, page, scale); + + var isOK = false; + + if (result != null) + { + var blob = result[0]; + var w = result[1] / scale; + var h = result[2] / scale; + + if (blob != null) + { + isOK = true; + // There doesn't seem to be a natural way to replace images in SlidesApp + // Slides API seems to only provide means to get a page and a group associated with the image + // Groups only allow removal of elements though, not insertions (seems like a half-baked API) + + // This code just adds a new image to page to the same position as the old image and removes the old image + // TODO: No group information will be preserved right now + // TODO: A question about it was posted here: + // TODO: https://plus.google.com/111221846870143003075/posts/EPAM8HrZhe2 + // TODO: if there is a satisfying answer, it will be implemented + + var page = elt.getParentPage(); + var left = elt.getLeft(); + var top = elt.getTop(); + var width = elt.getWidth(); + var height = elt.getHeight(); + + // This part addresses the possibility of updated diagrams having completely different shapes, + // causing diagrams no longer fitting into page + + // Keep top-left corner, adjust width x height + // keep either original width or height together with new aspect ratio + + if (w == 0 && h == 0) + { + w = width; + h = height; + } + + // make sure dimensions are reasonable + if (w == 0 || h == 0) + throw new Error("One or both image dimensions are zero!"); + + var nw = w; + var nh = h; + + // if aspect w/h < 1, use original width, otherwise use original height + // i.e. the smaller dimension keeps preserved (seems more natural while testing than preserving the larger dimension; can be changed anyway) + var aspect = w / h; + + if (aspect < 1) + { + nw = width; + nh = width / aspect; + } + else + { + nw = height * aspect; + nh = height; + } + + // now check if the image is still not too large + var wmax = SlidesApp.getActivePresentation().getPageWidth(); + var hmax = SlidesApp.getActivePresentation().getPageHeight(); + + if (wmax > 0 && w > wmax) + { + aspect = w / h; + + // Keeps width and aspect + nw = wmax; + nh = wmax / aspect; + } + else if (hmax > 0 && h > hmax) { + aspect = h / w; + + // Keeps height and aspect + nh = hmax; + nw = hmax / aspect; + } + + // make sure image is at least 1 pixel wide/high + nw = Math.max(1, nw); + nh = Math.max(1, nh); + + // replace image with the same link + var img = page.insertImage(blob, left, top, nw, nh); + var link = createLink(id, page, scale); + img.setLinkUrl(link); + + elt.remove(); + } + } + if (!isOK) + { + throw new Error("Invalid image " + id); + } + + return img; +} + +/** + * Fetches the diagram for the given document ID. + */ +function fetchImage(id, page, scale) +{ + var file = DriveApp.getFileById(id); + + if (file != null && file.getSize() > 0) + { + var response = UrlFetchApp.fetch(EXPORT_URL, + { + "method": "post", + "payload": + { + "format": "png", + "scale": scale || "1", +// "border": (scale == 2) ? "1" : "0", // not sure why it was set to 1, it looks better with 0 now, so I commented it out + "border": "0", + "from": page || "0", + "xml": encodeURIComponent(file.getBlob().getDataAsString()) + } + }); + + var headers = response.getHeaders(); + + return [response.getBlob(), headers["content-ex-width"] || 0, headers["content-ex-height"] || 0]; + } + else + { + // Returns an empty, transparent 1x1 PNG image as a placeholder + return Utilities.newBlob(Utilities.base64Decode("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNg+M9QDwADgQF/e5IkGQAAAABJRU5ErkJggg=="), "image/png"); + } +} + diff --git a/etc/slidesaddon/Picker.html b/etc/slidesaddon/Picker.html new file mode 100644 index 0000000000000000000000000000000000000000..e17936ae4b95e289a0a1ae6eae2d815299a5534e --- /dev/null +++ b/etc/slidesaddon/Picker.html @@ -0,0 +1,252 @@ +<!DOCTYPE html> +<html> +<head> +<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons.css"> +<script type="text/javascript"> + var DIALOG_DIMENSIONS = {width: 600, height: 420}; + var DEVELOPER_KEY = 'AIzaSyB4sU8tc25bR_87qNb7eUVQN72_vv8mpbU'; + + /** + * Loads the Google Picker API. + */ + function onApiLoad() + { + gapi.load('picker', {'callback': function() + { + getOAuthToken(); + }}); + } + + /** + * Gets the user's OAuth 2.0 access token from the server-side script so that + * it can be passed to Picker. This technique keeps Picker from needing to + * show its own authorization dialog, but is only possible if the OAuth scope + * that Picker needs is available in Apps Script. Otherwise, your Picker code + * will need to declare its own OAuth scopes. + */ + function getOAuthToken() + { + try + { + google.script.run.withSuccessHandler(createPicker) + .withFailureHandler(showError).getOAuthToken(); + } + catch (e) + { + showError(e.message); + } + } + + /** + * Creates a Picker that can access the user's spreadsheets. This function + * uses advanced options to hide the Picker's left navigation panel and + * default title bar. + * + * @param {string} token An OAuth 2.0 access token that lets Picker access the + * file type specified in the addView call. + */ + function createPicker(token) + { + if (token) + { + var view1 = new google.picker.DocsView(google.picker.ViewId.FOLDERS) + .setParent('root') + .setIncludeFolders(true) + .setMimeTypes('*/*'); + + var view2 = new google.picker.DocsView() + .setIncludeFolders(true); + + var view3 = new google.picker.DocsView() + .setEnableTeamDrives(true) + .setIncludeFolders(true); + + var view4 = new google.picker.DocsUploadView() + .setIncludeFolders(true); + + var picker = new google.picker.PickerBuilder() + .addView(view1) + .addView(view2) + .addView(view3) + .addView(view4) + .addView(google.picker.ViewId.RECENTLY_PICKED) + .enableFeature(google.picker.Feature.MULTISELECT_ENABLED) + .enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES) + .hideTitleBar() + .setOAuthToken(token) + .setDeveloperKey(DEVELOPER_KEY) + .setCallback(pickerCallback) + .setOrigin(google.script.host.origin) + .setSize(DIALOG_DIMENSIONS.width - 2, DIALOG_DIMENSIONS.height - 2) + .build(); + picker.setVisible(true); + } + else + { + showError('Unable to load the file picker.'); + } + } + + /** + * A callback function that extracts the chosen document's metadata from the + * response object. For details on the response object, see + * https://developers.google.com/picker/docs/result + * + * @param {object} data The response object. + */ + function pickerCallback(data) + { + var action = data[google.picker.Response.ACTION]; + + if (action == google.picker.Action.PICKED) + { + var items = []; + var docs = data[google.picker.Response.DOCUMENTS]; + + for (var i = 0; i < docs.length; i++) + { + items.push({name: docs[i][google.picker.Document.NAME], id: docs[i][google.picker.Document.ID]}); + } + + if (items.length > 0) + { + selectPages(items, function(execute) + { + if (execute) + { + document.getElementById('status').innerHTML = (items.length > 1) ? + 'Inserting ' + items.length + ' Diagrams...' : "Inserting Diagram..."; + google.script.run.withSuccessHandler(closeWindow).pickerHandler(items); + } + else + { + google.script.host.close(); + } + }); + } + else + { + google.script.host.close(); + } + } + else if (action == google.picker.Action.CANCEL) + { + google.script.host.close(); + } + } + + /** + * Closes the window after all diagrams have been inserted. + */ + function selectPages(items, handler) + { + document.getElementById('spinner').style.display = 'none'; + + var pageInputs = []; + var table = document.createElement('table'); + table.setAttribute('cellpadding', '4'); + table.style.width = '100%'; + var tbody = document.createElement('tbody'); + + var title = document.createElement('td'); + title.setAttribute('colspan', '2'); + title.innerHTML = '<font size="3">Select ' + ((items.length > 1) ? 'Pages' : 'Page') + + ' and Click Insert</font>'; + + var row = document.createElement('tr'); + row.appendChild(title); + tbody.appendChild(row); + + for (var i = 0; i < items.length; i++) + { + var row = document.createElement('tr'); + + var td1 = document.createElement('td'); + td1.appendChild(document.createTextNode(items[i].name)); + td1.setAttribute('title', 'ID ' + items[i].id); + row.appendChild(td1); + + var td2 = document.createElement('td'); + td2.style.paddingLeft = '10px'; + td2.setAttribute('align', 'right'); + td2.innerHTML = 'Page: '; + var input = document.createElement('input'); + input.setAttribute('type', 'number'); + input.setAttribute('min', '1'); + input.setAttribute('value', '1'); + input.style.width = '60px'; + td2.appendChild(input); + pageInputs.push(input); + row.appendChild(td2); + + tbody.appendChild(row); + } + + var buttons = document.createElement('td'); + buttons.setAttribute('colspan', '2'); + buttons.setAttribute('align', 'right'); + + var cancelButton = document.createElement('button'); + cancelButton.innerHTML = 'Cancel'; + buttons.appendChild(cancelButton); + + cancelButton.addEventListener('click', function() + { + handler(false); + }); + + var insertButton = document.createElement('button'); + insertButton.innerHTML = 'Insert'; + insertButton.className = 'blue'; + buttons.appendChild(insertButton); + + insertButton.addEventListener('click', function() + { + table.parentNode.removeChild(table); + document.getElementById('spinner').style.display = ''; + + for (var i = 0; i < items.length; i++) + { + items[i].page = (parseInt(pageInputs[i].value) || 1) - 1; + } + + handler(true); + }); + + var row = document.createElement('tr'); + row.appendChild(buttons); + tbody.appendChild(row); + + table.appendChild(tbody); + document.body.appendChild(table); + } + + /** + * Closes the window after all diagrams have been inserted. + */ + function closeWindow() + { + google.script.host.close(); + } + + /** + * Displays an error message within the #result element. + * + * @param {string} message The error message to display. + */ + function showError(message) + { + document.getElementById('icon').setAttribute('src', 'https://www.draw.io/images/stop-flat-icon-80.png'); + document.getElementById('status').innerHTML = 'Error: ' + message; + } +</script> +</head> +<body> +<div id="spinner" style="text-align:center;padding-top:100px;"> +<img id="icon" src="https://www.draw.io/images/ajax-loader.gif"/> +<h3 id="status" style="margin-top:6px;">Loading...</h3> +</div> +<script src="https://apis.google.com/js/api.js?onload=onApiLoad"></script> +</body> +</html> + diff --git a/etc/slidesaddon/README b/etc/slidesaddon/README new file mode 100644 index 0000000000000000000000000000000000000000..869ab11bee2ba4eb5a39ce1aedf708805c9d44d3 --- /dev/null +++ b/etc/slidesaddon/README @@ -0,0 +1,15 @@ +For Testing: + +As david.benson@appsscripttesting.com use (see Tools, Script Editor): +- TBA - + +For Deployment: + +As david@jgraph.com use (see Tools, Script Editor): +- TBA - + +Open the web app script in the script editor. +Make the changes you wanted. Test the code to ensure it functions as intended and is bug-free. +Click File > Manage Versions. Enter a new version description and click Save New Version. Click OK to close the dialog. +Click Publish > Deploy as Docs add-on. Update the Project version to the new version you just created. +Click Update. diff --git a/src/main/java/com/mxgraph/io/gliffy/importer/gliffyTranslation.properties b/src/main/java/com/mxgraph/io/gliffy/importer/gliffyTranslation.properties index 8bd99af619befab8cd206fa7f05daee576df0a35..d9e1d5f72800e56bf6b54dc05278c172ccff0b62 100644 --- a/src/main/java/com/mxgraph/io/gliffy/importer/gliffyTranslation.properties +++ b/src/main/java/com/mxgraph/io/gliffy/importer/gliffyTranslation.properties @@ -1121,8 +1121,7 @@ com.gliffy.shape.network.network_v3.business.comm_link=mxgraph.networks.comm_lin com.gliffy.shape.network.network_v3.business.user=image;image=img/lib/clip_art/people/Tech_Man_128x128.png com.gliffy.shape.network.network_v3.business.user_female=image;image=img/lib/clip_art/people/Worker_Woman_128x128.png com.gliffy.shape.network.network_v3.business.user_male=image;image=img/lib/clip_art/people/Tech_Man_128x128.png -#composite -com.gliffy.shape.network.network_v3.business.user_group=rect +com.gliffy.shape.network.network_v3.business.user_group=mxgraph.networks.users;strokeColor=#ffffff com.gliffy.shape.network.network_v3.business.server=image;image=img/lib/clip_art/computers/Server_Tower_128x128.png com.gliffy.shape.network.network_v3.business.database_server=image;image=img/lib/clip_art/computers/Server_Tower_128x128.png com.gliffy.shape.network.network_v3.business.mail_server=image;image=img/lib/clip_art/computers/Server_Tower_128x128.png @@ -1141,7 +1140,7 @@ com.gliffy.shape.network.network_v3.business.mainframe=image;image=img/lib/clip_ com.gliffy.shape.network.network_v3.business.rack_server_1u=image;image=img/lib/clip_art/computers/Server_128x128.png com.gliffy.shape.network.network_v3.business.multi_u_server=image;image=img/lib/clip_art/computers/Server_128x128.png com.gliffy.shape.network.network_v3.business.rack=image;image=img/lib/clip_art/computers/Server_Rack_Empty_128x128.png -#com.gliffy.shape.network.network_v3.business.telephone= +com.gliffy.shape.network.network_v3.business.telephone=image;image=img/lib/clip_art/telecommunication/iPhone_128x128.png #com.gliffy.shape.network.network_v3.business.flash_drive= #It needs a new modern icon to match the remaining icons com.gliffy.shape.network.network_v3.business.tape_backup=mxgraph.networks.tape_storage;strokeColor=#ffffff diff --git a/src/main/webapp/WEB-INF/lib/appengine-api-1.0-sdk-1.9.63.jar b/src/main/webapp/WEB-INF/lib/appengine-api-1.0-sdk-1.9.63.jar new file mode 100644 index 0000000000000000000000000000000000000000..b481dc044032344482ba6dee7389828d0f8596a7 Binary files /dev/null and b/src/main/webapp/WEB-INF/lib/appengine-api-1.0-sdk-1.9.63.jar differ diff --git a/src/main/webapp/cache.manifest b/src/main/webapp/cache.manifest index 5460179fffdc6e3c2755682e8ddeb3a4af56fcde..f15b54522012b0ac714f4f9fb115871e4cc6522e 100644 --- a/src/main/webapp/cache.manifest +++ b/src/main/webapp/cache.manifest @@ -1,7 +1,7 @@ CACHE MANIFEST # THIS FILE WAS GENERATED. DO NOT MODIFY! -# 03/31/2018 02:35 PM +# 04/04/2018 01:26 PM app.html index.html?offline=1 diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js index 68899de88459dba60c15858c474cc1fcceff7947..9fe07c4bfc5a77c343ab1c9d0a16a582e6d0ab33 100644 --- a/src/main/webapp/js/app.min.js +++ b/src/main/webapp/js/app.min.js @@ -96,9 +96,9 @@ ea;m.wa=m.normalizeRCData=e;m.xa=m.sanitize=function(a,b,d,e){return Q(a,ea(b,d, l--,_+=n[s++]<<u,u+=8}if(a.nlen=(31&_)+257,_>>>=5,u-=5,a.ndist=(31&_)+1,_>>>=5,u-=5,a.ncode=(15&_)+4,_>>>=4,u-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=_t;break}a.have=0,a.mode=tt;case tt:for(;a.have<a.ncode;){for(;u<3;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.lens[At[a.have++]]=7&_,_>>>=3,u-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=y(x,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=_t;break}a.have=0,a.mode=et;case et:for(;a.have<a.nlen+a.ndist;){for(;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(wt<16)_>>>=gt,u-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_>>>=gt,u-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=_t;break}yt=a.lens[a.have-1],g=3+(3&_),_>>>=2,u-=2}else if(17===wt){for(Bt=gt+3;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=3+(7&_),_>>>=3,u-=3}else{for(Bt=gt+7;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=11+(127&_),_>>>=7,u-=7}if(a.have+g>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=_t;break}for(;g--;)a.lens[a.have++]=yt}}if(a.mode===_t)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=_t;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=y(z,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=_t;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=y(B,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=_t;break}if(a.mode=at,e===A)break t;case at:a.mode=it;case it:if(l>=6&&h>=258){t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,k(t,b),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,a.mode===X&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(mt&&0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.lencode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=lt;break}if(32&mt){a.back=-1,a.mode=X;break}if(64&mt){t.msg="invalid literal/length code",a.mode=_t;break}a.extra=15&mt,a.mode=nt;case nt:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.length+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=rt;case rt:for(;St=a.distcode[_&(1<<a.distbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.distcode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=_t;break}a.offset=wt,a.extra=15&mt,a.mode=st;case st:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.offset+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=_t;break}a.mode=ot;case ot:if(0===h)break t;if(g=b-h,a.offset>g){if(g=a.offset-g,g>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=_t;break}g>a.wnext?(g-=a.wnext,m=a.wsize-g):m=a.wnext-g,g>a.length&&(g=a.length),bt=a.window}else bt=r,m=o-a.offset,g=a.length;g>h&&(g=h),h-=g,a.length-=g;do r[o++]=bt[m++];while(--g);0===a.length&&(a.mode=it);break;case lt:if(0===h)break t;r[o++]=a.length,h--,a.mode=it;break;case ht:if(a.wrap){for(;u<32;){if(0===l)break t;l--,_|=n[s++]<<u,u+=8}if(b-=h,t.total_out+=b,a.total+=b,b&&(t.adler=a.check=a.flags?v(a.check,r,b,o-b):p(a.check,r,b,o-b)),b=h,(a.flags?_:i(_))!==a.check){t.msg="incorrect data check",a.mode=_t;break}_=0,u=0}a.mode=dt;case dt:if(a.wrap&&a.flags){for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=_t;break}_=0,u=0}a.mode=ft;case ft:xt=R;break t;case _t:xt=O;break t;case ut:return D;case ct:default:return N}return t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,(a.wsize||b!==t.avail_out&&a.mode<_t&&(a.mode<ht||e!==S))&&f(t,t.output,t.next_out,b-t.avail_out)?(a.mode=ut,D):(c-=t.avail_in,b-=t.avail_out,t.total_in+=c,t.total_out+=b,a.total+=b,a.wrap&&b&&(t.adler=a.check=a.flags?v(a.check,r,b,t.next_out-b):p(a.check,r,b,t.next_out-b)),t.data_type=a.bits+(a.last?64:0)+(a.mode===X?128:0)+(a.mode===at||a.mode===Q?256:0),(0===c&&0===b||e===S)&&xt===Z&&(xt=I),xt)}function u(t){if(!t||!t.state)return N;var e=t.state;return e.window&&(e.window=null),t.state=null,Z}function c(t,e){var a;return t&&t.state?(a=t.state,0===(2&a.wrap)?N:(a.head=e,e.done=!1,Z)):N}function b(t,e){var a,i,n,r=e.length;return t&&t.state?(a=t.state,0!==a.wrap&&a.mode!==G?N:a.mode===G&&(i=1,i=p(i,e,r,0),i!==a.check)?O:(n=f(t,e,r,r))?(a.mode=ut,D):(a.havedict=1,Z)):N}var g,m,w=t("../utils/common"),p=t("./adler32"),v=t("./crc32"),k=t("./inffast"),y=t("./inftrees"),x=0,z=1,B=2,S=4,E=5,A=6,Z=0,R=1,C=2,N=-2,O=-3,D=-4,I=-5,U=8,T=1,F=2,L=3,H=4,j=5,K=6,M=7,P=8,Y=9,q=10,G=11,X=12,W=13,J=14,Q=15,V=16,$=17,tt=18,et=19,at=20,it=21,nt=22,rt=23,st=24,ot=25,lt=26,ht=27,dt=28,ft=29,_t=30,ut=31,ct=32,bt=852,gt=592,mt=15,wt=mt,pt=!0;a.inflateReset=s,a.inflateReset2=o,a.inflateResetKeep=r,a.inflateInit=h,a.inflateInit2=l,a.inflate=_,a.inflateEnd=u,a.inflateGetHeader=c,a.inflateSetDictionary=b,a.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(t,e,a){"use strict";var i=t("../utils/common"),n=15,r=852,s=592,o=0,l=1,h=2,d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],_=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,a,c,b,g,m,w){var p,v,k,y,x,z,B,S,E,A=w.bits,Z=0,R=0,C=0,N=0,O=0,D=0,I=0,U=0,T=0,F=0,L=null,H=0,j=new i.Buf16(n+1),K=new i.Buf16(n+1),M=null,P=0;for(Z=0;Z<=n;Z++)j[Z]=0;for(R=0;R<c;R++)j[e[a+R]]++;for(O=A,N=n;N>=1&&0===j[N];N--);if(O>N&&(O=N),0===N)return b[g++]=20971520,b[g++]=20971520,w.bits=1,0;for(C=1;C<N&&0===j[C];C++);for(O<C&&(O=C),U=1,Z=1;Z<=n;Z++)if(U<<=1,U-=j[Z],U<0)return-1;if(U>0&&(t===o||1!==N))return-1;for(K[1]=0,Z=1;Z<n;Z++)K[Z+1]=K[Z]+j[Z];for(R=0;R<c;R++)0!==e[a+R]&&(m[K[e[a+R]]++]=R);if(t===o?(L=M=m,z=19):t===l?(L=d,H-=257,M=f,P-=257,z=256):(L=_,M=u,z=-1),F=0,R=0,Z=C,x=g,D=O,I=0,k=-1,T=1<<O,y=T-1,t===l&&T>r||t===h&&T>s)return 1;for(var Y=0;;){Y++,B=Z-I,m[R]<z?(S=0,E=m[R]):m[R]>z?(S=M[P+m[R]],E=L[H+m[R]]):(S=96,E=0),p=1<<Z-I,v=1<<D,C=v;do v-=p,b[x+(F>>I)+v]=B<<24|S<<16|E|0;while(0!==v);for(p=1<<Z-1;F&p;)p>>=1;if(0!==p?(F&=p-1,F+=p):F=0,R++,0===--j[Z]){if(Z===N)break;Z=e[a+m[R]]}if(Z>O&&(F&y)!==k){for(0===I&&(I=O),x+=C,D=Z-I,U=1<<D;D+I<N&&(U-=j[D+I],!(U<=0));)D++,U<<=1;if(T+=1<<D,t===l&&T>r||t===h&&T>s)return 1;k=F&y,b[k]=O<<24|D<<16|x-g|0}}return 0!==F&&(b[x+F]=Z-I<<24|64<<16|0),w.bits=O,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?lt[t]:lt[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>W-a?(t.bi_buf|=e<<t.bi_valid&65535,o(t,t.bi_buf),t.bi_buf=e>>W-t.bi_valid,t.bi_valid+=a-W):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)}function h(t,e,a){l(t,a[2*e],a[2*e+1])}function d(t,e){var a=0;do a|=1&t,t>>>=1,a<<=1;while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=X;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<G;a++)i=t.heap[a],r=l[2*l[2*i+1]+1]+1,r>c&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)n=t.heap[--a],n>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(X+1),s=0;for(i=1;i<=X;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(X+1);for(a=0,i=0;i<K-1;i++)for(dt[i]=a,t=0;t<1<<et[i];t++)ht[a++]=i;for(ht[a-1]=i,r=0,i=0;i<16;i++)for(ft[i]=r,t=0;t<1<<at[i];t++)lt[r++]=i;for(r>>=7;i<Y;i++)for(ft[i]=r<<7,t=0;t<1<<at[i]-7;t++)lt[256+r++]=i;for(e=0;e<=X;e++)s[e]=0;for(t=0;t<=143;)st[2*t+1]=8,t++,s[8]++;for(;t<=255;)st[2*t+1]=9,t++,s[9]++;for(;t<=279;)st[2*t+1]=7,t++,s[7]++;for(;t<=287;)st[2*t+1]=8,t++,s[8]++;for(u(st,P+1,s),t=0;t<Y;t++)ot[2*t+1]=5,ot[2*t]=d(t,5);_t=new n(st,et,M+1,P,X),ut=new n(ot,at,0,Y,X),ct=new n(new Array(0),it,0,q,J)}function b(t){var e;for(e=0;e<P;e++)t.dyn_ltree[2*e]=0;for(e=0;e<Y;e++)t.dyn_dtree[2*e]=0;for(e=0;e<q;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*Q]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function g(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),N.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]<t[r]||t[n]===t[r]&&i[e]<=i[a]}function p(t,e,a){for(var i=t.heap[a],n=a<<1;n<=t.heap_len&&(n<t.heap_len&&w(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!w(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i}function v(t,e,a){var i,n,r,o,d=0;if(0!==t.last_lit)do i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],n=t.pending_buf[t.l_buf+d],d++,0===i?h(t,n,e):(r=ht[n],h(t,r+M+1,e),o=et[r],0!==o&&(n-=dt[r],l(t,n,o)),i--,r=s(i),h(t,r,a),o=at[r],0!==o&&(i-=ft[r],l(t,i,o)));while(d<t.last_lit);h(t,Q,e)}function k(t,e){var a,i,n,r=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=G,a=0;a<l;a++)0!==r[2*a]?(t.heap[++t.heap_len]=h=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)n=t.heap[++t.heap_len]=h<2?++h:0,r[2*n]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=s[2*n+1]);for(e.max_code=h,a=t.heap_len>>1;a>=1;a--)p(t,r,a);n=l;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o<l&&n===s||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[2*V]++):o<=10?t.bl_tree[2*$]++:t.bl_tree[2*tt]++,o=0,r=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4))}function x(t,e,a){var i,n,r=-1,s=e[1],o=0,d=7,f=4;for(0===s&&(d=138,f=3),i=0;i<=a;i++)if(n=s,s=e[2*(i+1)+1],!(++o<d&&n===s)){if(o<f){do h(t,n,t.bl_tree);while(0!==--o)}else 0!==n?(n!==r&&(h(t,n,t.bl_tree),o--),h(t,V,t.bl_tree),l(t,o-3,2)):o<=10?(h(t,$,t.bl_tree),l(t,o-3,3)):(h(t,tt,t.bl_tree),l(t,o-11,7));o=0,r=n,0===s?(d=138,f=3):n===s?(d=6,f=3):(d=7,f=4)}}function z(t){var e;for(y(t,t.dyn_ltree,t.l_desc.max_code),y(t,t.dyn_dtree,t.d_desc.max_code),k(t,t.bl_desc),e=q-1;e>=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n<i;n++)l(t,t.bl_tree[2*nt[n]+1],3);x(t,t.dyn_ltree,e-1),x(t,t.dyn_dtree,a-1)}function S(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return D;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return I;for(e=32;e<M;e++)if(0!==t.dyn_ltree[2*e])return I;return D}function E(t){bt||(c(),bt=!0),t.l_desc=new r(t.dyn_ltree,_t),t.d_desc=new r(t.dyn_dtree,ut),t.bl_desc=new r(t.bl_tree,ct),t.bi_buf=0,t.bi_valid=0,b(t)}function A(t,e,a,i){l(t,(T<<1)+(i?1:0),3),m(t,e,a,!0)}function Z(t){l(t,F<<1,3),h(t,Q,st),f(t)}function R(t,e,a,i){var n,r,s=0;t.level>0?(t.strm.data_type===U&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=n&&(n=r)):n=r=a+5,a+4<=n&&e!==-1?A(t,e,a,i):t.strategy===O||r===n?(l(t,(F<<1)+(i?1:0),3),v(t,st,ot)):(l(t,(L<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)}function C(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(ht[a]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var N=t("../utils/common"),O=4,D=0,I=1,U=2,T=0,F=1,L=2,H=3,j=258,K=29,M=256,P=M+1+K,Y=30,q=19,G=2*P+1,X=15,W=16,J=7,Q=256,V=16,$=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],at=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,st=new Array(2*(P+2));i(st);var ot=new Array(2*Y);i(ot);var lt=new Array(rt);i(lt);var ht=new Array(j-H+1);i(ht);var dt=new Array(K);i(dt);var ft=new Array(Y);i(ft);var _t,ut,ct,bt=!1;a._tr_init=E,a._tr_stored_block=A,a._tr_flush_block=R,a._tr_tally=C,a._tr_align=Z},{"../utils/common":3}],15:[function(t,e,a){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=i},{}],"/":[function(t,e,a){"use strict";var i=t("./lib/utils/common").assign,n=t("./lib/deflate"),r=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};i(o,n,r,s),e.exports=o},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")}); var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a,b){var c="",d,e,f,g,k,l,m=0;for(null!=b&&b||(a=Base64._utf8_encode(a));m<a.length;)d=a.charCodeAt(m++),e=a.charCodeAt(m++),f=a.charCodeAt(m++),g=d>>2,d=(d&3)<<4|e>>4,k=(e&15)<<2|f>>6,l=f&63,isNaN(e)?k=l=64:isNaN(f)&&(l=64),c=c+this._keyStr.charAt(g)+this._keyStr.charAt(d)+this._keyStr.charAt(k)+this._keyStr.charAt(l);return c},decode:function(a,b){b=null!=b?b:!1;var c="",d,e,f,g,k,l=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g, "");l<a.length;)d=this._keyStr.indexOf(a.charAt(l++)),e=this._keyStr.indexOf(a.charAt(l++)),g=this._keyStr.indexOf(a.charAt(l++)),k=this._keyStr.indexOf(a.charAt(l++)),d=d<<2|e>>4,e=(e&15)<<4|g>>2,f=(g&3)<<6|k,c+=String.fromCharCode(d),64!=g&&(c+=String.fromCharCode(e)),64!=k&&(c+=String.fromCharCode(f));b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):(127<d&&2048>d?b+= -String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0,d;for(c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"open";window.PROXY_URL=window.PROXY_URL||"proxy";window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img"; -window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":"https://www.draw.io/iconSearch");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.mxLoadResources=window.mxLoadResources||!1; -window.mxLanguage=window.mxLanguage||function(){var a="1"==urlParams.offline?"en":urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null)}catch(c){isLocalStorage=!1}return a}(); +String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0,d;for(c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.VSD_CONVERT_URL=window.VSD_CONVERT_URL||"https://convert.draw.io/VsdConverter/api/converter";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"open";window.PROXY_URL=window.PROXY_URL||"proxy"; +window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img";window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":"https://www.draw.io/iconSearch");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia"; +window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||function(){var a="1"==urlParams.offline?"en":urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null)}catch(c){isLocalStorage=!1}return a}(); window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Bahasa Melayu",bs:"Bosanski",bg:"Bulgarian",ca:"Català ",cs:"ÄŒeÅ¡tina",da:"Dansk",de:"Deutsch",et:"Eesti",en:"English",es:"Español",fil:"Filipino",fr:"Français",it:"Italiano",hu:"Magyar",nl:"Nederlands",no:"Norsk",pl:"Polski","pt-br":"Português (Brasil)",pt:"Português (Portugal)",ro:"Română",fi:"Suomi",sv:"Svenska",vi:"Tiếng Việt",tr:"Türkçe",el:"Ελληνικά",ru:"РуÑÑкий",sr:"СрпÑки",uk:"УкраїнÑька",he:"עברית",ar:"العربية",th:"ไทย", ko:"í•œêµì–´",ja:"日本語",zh:"ä¸æ–‡ï¼ˆä¸å›½ï¼‰","zh-tw":"ä¸æ–‡ï¼ˆå°ç£ï¼‰"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph");if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang)}window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}return a}(); function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)} @@ -6652,12 +6652,12 @@ function(){x("_blank")}),m.className="geBtn",l.appendChild(m));mxClient.IS_IOS|| f.style.textAlign="left";mxUtils.write(f,mxResources.get("fileOpenLocation"));mxUtils.br(f);mxUtils.br(f);var h=mxUtils.button(mxResources.get("openInThisWindow"),function(){e&&a.hideDialog();null!=c&&c()});h.className="geBtn";h.style.marginBottom="8px";h.style.width="280px";f.appendChild(h);mxUtils.br(f);var l=mxUtils.button(mxResources.get("openInNewWindow"),function(){e&&a.hideDialog();null!=d&&d();a.openLink(b)});l.className="geBtn gePrimaryBtn";l.style.width=h.style.width;f.appendChild(l);mxUtils.br(f); mxUtils.br(f);mxUtils.write(f,mxResources.get("allowPopups"));this.container=f},ImageDialog=function(a,b,d,c,e,f){f=null!=f?f:!0;var h=a.editor.graph,l=document.createElement("div");mxUtils.write(l,b);b=document.createElement("div");b.className="geTitle";b.style.backgroundColor="transparent";b.style.borderColor="transparent";b.style.whiteSpace="nowrap";b.style.textOverflow="clip";b.style.cursor="default";mxClient.IS_VML||(b.style.paddingRight="20px");var m=document.createElement("input");m.setAttribute("value", d);m.setAttribute("type","text");m.setAttribute("spellcheck","false");m.setAttribute("autocorrect","off");m.setAttribute("autocomplete","off");m.setAttribute("autocapitalize","off");m.style.marginTop="6px";m.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?20:-20)+"px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat";m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";d=document.createElement("div");d.setAttribute("title", -mxResources.get("reset"));d.style.position="relative";d.style.left="-16px";d.style.width="12px";d.style.height="14px";d.style.cursor="pointer";d.style.display=mxClient.IS_VML?"inline":"inline-block";d.style.top=(mxClient.IS_VML?0:3)+"px";d.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(d,"click",function(){m.value="";m.focus()});b.appendChild(m);b.appendChild(d);l.appendChild(b);var g=function(b,d,g,k){var e="data:"==b.substring(0,5);!a.isOffline()||e&&"undefined"===typeof chrome? -0<b.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(b,function(t){a.spinner.stop();a.hideDialog();var e=!1===k?1:null!=d&&null!=g?Math.max(d/t.width,g/t.height):Math.min(1,Math.min(520/t.width,520/t.height));f&&(b=a.convertDataUri(b));c(b,Math.round(Number(t.width)*e),Math.round(Number(t.height)*e))},function(){a.spinner.stop();c(null);a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),c(b)):(b=a.convertDataUri(b), +mxResources.get("reset"));d.style.position="relative";d.style.left="-16px";d.style.width="12px";d.style.height="14px";d.style.cursor="pointer";d.style.display=mxClient.IS_VML?"inline":"inline-block";d.style.top=(mxClient.IS_VML?0:3)+"px";d.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(d,"click",function(){m.value="";m.focus()});b.appendChild(m);b.appendChild(d);l.appendChild(b);var g=function(b,d,g,k){var n="data:"==b.substring(0,5);!a.isOffline()||n&&"undefined"===typeof chrome? +0<b.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(b,function(t){a.spinner.stop();a.hideDialog();var n=!1===k?1:null!=d&&null!=g?Math.max(d/t.width,g/t.height):Math.min(1,Math.min(520/t.width,520/t.height));f&&(b=a.convertDataUri(b));c(b,Math.round(Number(t.width)*n),Math.round(Number(t.height)*n))},function(){a.spinner.stop();c(null);a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),c(b)):(b=a.convertDataUri(b), d=null==d?120:d,g=null==g?100:g,a.hideDialog(),c(b,d,g))},k=function(b,d){if(null!=b){var k=e?null:h.getModel().getGeometry(h.getSelectionCell());null!=k?g(b,k.width,k.height,d):g(b,null,null,d)}else a.hideDialog(),c(null)};this.init=function(){m.focus();if(Graph.fileSupport){m.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=l.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b, -"dragover",mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,function(a,b,c,d,g,e,n,f){k(a,f)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(b)); +"dragover",mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,function(a,b,c,d,g,n,e,f){k(a,f)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(b)); else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var d=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(d)&&k(decodeURIComponent(d))}b.stopPropagation();b.preventDefault()}),!1)}};d=document.createElement("div");d.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";d.style.textAlign="right";b=mxUtils.button(mxResources.get("cancel"),function(){a.spinner.stop();a.hideDialog()});b.className="geBtn";a.editor.cancelFirst&&d.appendChild(b);ImageDialog.filePicked= -function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(m.value=a.url));m.focus()};if(Graph.fileSupport){var n=document.createElement("input");n.setAttribute("multiple","multiple");n.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(n,"change",function(b){a.importFiles(n.files,0,0,a.maxImageSize,function(a,b,c,d,g,e){k(a)},function(){},function(a){return"image/"==a.type.substring(0, +function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(m.value=a.url));m.focus()};if(Graph.fileSupport){var n=document.createElement("input");n.setAttribute("multiple","multiple");n.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(n,"change",function(b){a.importFiles(n.files,0,0,a.maxImageSize,function(a,b,c,d,g,n){k(a)},function(){},function(a){return"image/"==a.type.substring(0, 6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0)});var q=mxUtils.button(mxResources.get("open"),function(){n.click()});q.className="geBtn";d.appendChild(q)}}document.createElement("canvas").getContext&&"data:image/"==m.value.substring(0,11)&&"data:image/svg"!=m.value.substring(0,14)&&(q=mxUtils.button(mxResources.get("crop"),function(){var b=new CropImageDialog(a,m.value,function(a){m.value=a});a.showDialog(b.container,200,180,!0,!0);b.init()}),q.className="geBtn",d.appendChild(q));"undefined"!= typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(q=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),q.className="geBtn",d.appendChild(q),null!=a.drive&&"1"==urlParams.photos&& (q=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=gapi.auth.getToken().access_token,b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}), @@ -6694,14 +6694,14 @@ document.createElement("div");v.style.position="absolute";v.style.textAlign="rig a.replaceFileData(y);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});D.className="geBtn";D.setAttribute("disabled","disabled");var E=document.createElement("select");E.setAttribute("disabled","disabled");E.style.maxWidth="80px";E.style.position="relative";E.style.top="-2px";E.style.verticalAlign="bottom";E.style.marginRight="6px";E.style.display="none";var H=null;mxEvent.addListener(E,"change",function(a){null!= H&&(H(a),mxEvent.consume(a))});var A=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=x&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(x.documentElement)),window.openWindow(a.getUrl()))});A.className="geBtn";A.setAttribute("disabled","disabled");null!=d&&(A.style.display="none");var K=mxUtils.button(mxResources.get("show"),function(){null!=w&&a.openLink(w.getUrl())});K.className="geBtn gePrimaryBtn";K.setAttribute("disabled", "disabled");null!=d&&(K.style.display="none",D.className="geBtn gePrimaryBtn");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.width="640px";e.style.textAlign="right";var B=document.createElement("div");B.className="geToolbarContainer";B.style.backgroundColor="transparent";B.style.padding="2px";B.style.border="none";B.style.left="199px";B.style.top="442px";var L=null;if(null!=b&&0<b.length){h.style.cursor="move";var O=document.createElement("table");O.style.border= -"1px solid lightGray";O.style.borderCollapse="collapse";O.style.borderSpacing="0px";O.style.width="100%";var S=document.createElement("tbody"),Y=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(m=mxUtils.indexOf(a.pages,a.currentPage));for(var N=b.length-1;0<=N;N--){var M=function(c){var d=new Date(c.modifiedDate),e=null;if(0<=d.getTime()){var n=function(b){q.stop();var c=mxUtils.parseXml(b),n=a.editor.extractGraphModel(c.documentElement,!0);if(null!=n){var f=function(b){null!=b&&(b= -p(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},p=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";h.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,l.getModel());l.maxFitScale=1;l.fit(8);l.center();return a};E.style.display="none";E.innerHTML="";x=c;y=b;g=parseSelectFunction=null;k=0;if("mxfile"==n.nodeName){c=n.getElementsByTagName("diagram");g=[];for(b=0;b<c.length;b++)g.push(c[b]); -k=Math.min(m,g.length-1);0<g.length&&f(g[k]);if(1<g.length)for(E.removeAttribute("disabled"),E.style.display="",b=0;b<g.length;b++)c=document.createElement("option"),mxUtils.write(c,g[b].getAttribute("name")||mxResources.get("pageWithNumber",[b+1])),c.setAttribute("value",b),b==k&&c.setAttribute("selected","selected"),E.appendChild(c);H=function(){k=m=parseInt(E.value);f(g[m])}}else p(n);v.innerHTML="";mxUtils.write(v,d.toLocaleDateString()+" "+d.toLocaleTimeString());v.setAttribute("title",e.getAttribute("title")); +"1px solid lightGray";O.style.borderCollapse="collapse";O.style.borderSpacing="0px";O.style.width="100%";var S=document.createElement("tbody"),Y=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(m=mxUtils.indexOf(a.pages,a.currentPage));for(var N=b.length-1;0<=N;N--){var M=function(c){var d=new Date(c.modifiedDate),n=null;if(0<=d.getTime()){var e=function(b){q.stop();var c=mxUtils.parseXml(b),e=a.editor.extractGraphModel(c.documentElement,!0);if(null!=e){var f=function(b){null!=b&&(b= +p(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},p=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";h.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,l.getModel());l.maxFitScale=1;l.fit(8);l.center();return a};E.style.display="none";E.innerHTML="";x=c;y=b;g=parseSelectFunction=null;k=0;if("mxfile"==e.nodeName){c=e.getElementsByTagName("diagram");g=[];for(b=0;b<c.length;b++)g.push(c[b]); +k=Math.min(m,g.length-1);0<g.length&&f(g[k]);if(1<g.length)for(E.removeAttribute("disabled"),E.style.display="",b=0;b<g.length;b++)c=document.createElement("option"),mxUtils.write(c,g[b].getAttribute("name")||mxResources.get("pageWithNumber",[b+1])),c.setAttribute("value",b),b==k&&c.setAttribute("selected","selected"),E.appendChild(c);H=function(){k=m=parseInt(E.value);f(g[m])}}else p(e);v.innerHTML="";mxUtils.write(v,d.toLocaleDateString()+" "+d.toLocaleTimeString());v.setAttribute("title",n.getAttribute("title")); t.removeAttribute("disabled");z.removeAttribute("disabled");F.removeAttribute("disabled");C.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&D.removeAttribute("disabled"),G.removeAttribute("disabled"),K.removeAttribute("disabled"),A.removeAttribute("disabled"));mxUtils.setOpacity(t,60);mxUtils.setOpacity(z,60);mxUtils.setOpacity(F,60);mxUtils.setOpacity(C,60)}else E.style.display="none",E.innerHTML="",v.innerHTML="",mxUtils.write(v,mxResources.get("errorLoadingFile"))}, -e=document.createElement("tr");e.style.borderBottom="1px solid lightGray";e.style.fontSize="12px";e.style.cursor="pointer";var f=document.createElement("td");f.style.padding="6px";f.style.whiteSpace="nowrap";c==b[b.length-1]?mxUtils.write(f,mxResources.get("current")):d.toDateString()===Y?mxUtils.write(f,d.toLocaleTimeString()):mxUtils.write(f,d.toLocaleDateString()+" "+d.toLocaleTimeString());e.appendChild(f);e.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(c.fileSize))+ -(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(e,"click",function(a){w!=c&&(q.stop(),null!=p&&(p.style.backgroundColor=""),w=c,p=e,p.style.backgroundColor="#ebf2f9",y=x=null,v.removeAttribute("title"),v.innerHTML=mxResources.get("loading")+"...",h.style.backgroundColor="#ffffff",l.getModel().clear(),D.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),C.setAttribute("disabled", -"disabled"),F.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),K.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),mxUtils.setOpacity(t,20),mxUtils.setOpacity(z,20),mxUtils.setOpacity(F,20),mxUtils.setOpacity(C,20),q.spin(h),c.getXml(function(a){w==c&&n(a)},function(a){q.stop();E.style.display="none";E.innerHTML="";v.innerHTML="";mxUtils.write(v,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(e,"dblclick",function(a){K.click(); -window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);S.appendChild(e)}return e}(b[N]);null!=M&&N==b.length-1&&(L=M)}O.appendChild(S);f.appendChild(O)}else null==u||null==a.drive&&u.constructor==window.DriveFile||null==a.dropbox&&u.constructor==window.DropboxFile?(h.style.display="none",B.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(h.style.display="none",B.style.display="none",mxUtils.write(f, +n=document.createElement("tr");n.style.borderBottom="1px solid lightGray";n.style.fontSize="12px";n.style.cursor="pointer";var f=document.createElement("td");f.style.padding="6px";f.style.whiteSpace="nowrap";c==b[b.length-1]?mxUtils.write(f,mxResources.get("current")):d.toDateString()===Y?mxUtils.write(f,d.toLocaleTimeString()):mxUtils.write(f,d.toLocaleDateString()+" "+d.toLocaleTimeString());n.appendChild(f);n.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(c.fileSize))+ +(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(n,"click",function(a){w!=c&&(q.stop(),null!=p&&(p.style.backgroundColor=""),w=c,p=n,p.style.backgroundColor="#ebf2f9",y=x=null,v.removeAttribute("title"),v.innerHTML=mxResources.get("loading")+"...",h.style.backgroundColor="#ffffff",l.getModel().clear(),D.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),C.setAttribute("disabled", +"disabled"),F.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),K.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),mxUtils.setOpacity(t,20),mxUtils.setOpacity(z,20),mxUtils.setOpacity(F,20),mxUtils.setOpacity(C,20),q.spin(h),c.getXml(function(a){w==c&&e(a)},function(a){q.stop();E.style.display="none";E.innerHTML="";v.innerHTML="";mxUtils.write(v,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(n,"dblclick",function(a){K.click(); +window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);S.appendChild(n)}return n}(b[N]);null!=M&&N==b.length-1&&(L=M)}O.appendChild(S);f.appendChild(O)}else null==u||null==a.drive&&u.constructor==window.DriveFile||null==a.dropbox&&u.constructor==window.DropboxFile?(h.style.display="none",B.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(h.style.display="none",B.style.display="none",mxUtils.write(f, mxResources.get("noRevisions")));this.init=function(){null!=L&&L.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";B.appendChild(E);B.appendChild(t);B.appendChild(z);B.appendChild(C);B.appendChild(F);a.editor.cancelFirst?(e.appendChild(f),e.appendChild(G),e.appendChild(A),e.appendChild(D),e.appendChild(K)):(e.appendChild(G),e.appendChild(A),e.appendChild(D),e.appendChild(K),e.appendChild(f));c.appendChild(e);c.appendChild(B);c.appendChild(v);this.container= c},DraftDialog=function(a,b,d,c,e,f,h,l){var m=document.createElement("div"),g=document.createElement("div");g.style.marginTop="0px";g.style.whiteSpace="nowrap";g.style.overflow="auto";mxUtils.write(g,b);m.appendChild(g);var k=document.createElement("div");k.style.position="absolute";k.style.border="1px solid lightGray";k.style.marginTop="10px";k.style.width="640px";k.style.top="46px";k.style.bottom="74px";k.style.overflow="hidden";mxEvent.disableContextMenu(k);m.appendChild(k);var n=new Graph(k); n.setEnabled(!1);n.setPanning(!0);n.panningHandler.ignoreCell=!0;n.panningHandler.useLeftButtonForPanning=!0;n.minFitScale=null;n.maxFitScale=null;n.centerZoom=!0;b=mxUtils.parseXml(d);var q=a.editor.extractGraphModel(b.documentElement,!0),u=0,p=null,w=n.getGlobalVariable;n.getGlobalVariable=function(a){return"page"==a&&null!=p&&null!=p[u]?p[u].getAttribute("name"):"pagenumber"==a?u+1:w.apply(this,arguments)};n.getLinkForCell=function(){return null};b=mxUtils.button("",function(){n.zoomIn()});b.className= @@ -6711,14 +6711,14 @@ mxResources.get("fit"));g.style.outline="none";g.style.border="none";g.style.mar this.init=function(){function b(a){if(null!=a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center()}}function c(c){null!=c&&(c=b(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(c))).documentElement));return c}mxEvent.addListener(y,"change",function(a){u=parseInt(y.value);c(p[u]);mxEvent.consume(a)});if("mxfile"==q.nodeName){var d=q.getElementsByTagName("diagram"); p=[];for(var g=0;g<d.length;g++)p.push(d[g]);0<p.length&&c(p[u]);if(1<p.length)for(y.style.display="",g=0;g<p.length;g++)d=document.createElement("option"),mxUtils.write(d,p[g].getAttribute("name")||mxResources.get("pageWithNumber",[g+1])),d.setAttribute("value",g),g==u&&d.setAttribute("selected","selected"),y.appendChild(d)}else b(q)};h.appendChild(y);h.appendChild(b);h.appendChild(d);h.appendChild(x);h.appendChild(g);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.className= "geBtn";l=null!=l?mxUtils.button(mxResources.get("ignore"),l):null;null!=l&&(l.className="geBtn");a.editor.cancelFirst?(f.appendChild(b),null!=l&&f.appendChild(l),f.appendChild(e),f.appendChild(c)):(f.appendChild(c),f.appendChild(e),null!=l&&f.appendChild(l),f.appendChild(b));m.appendChild(f);m.appendChild(h);this.container=m},FindWindow=function(a,b,d,c,e){function f(a,b,c){if("object"===typeof b.value&&null!=b.value.attributes){b=b.value.attributes;for(var d=0;d<b.length;d++)if("label"!=b[d].nodeName){var g= -mxUtils.trim(b[d].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&g.substring(0,c.length)===c||null!=a&&a.test(g))return!0}}return!1}function h(){var a=m.model.getDescendants(m.model.getRoot()),b=q.value.toLowerCase(),c=u.checked?new RegExp(b):null,d=null;g!=b&&(g=b,k=null);var e=null==k;if(0<b.length)for(var n=0;n<a.length;n++){var h=m.view.getState(a[n]);if(null!=h&&null!=h.cell.value&&(e||null==d)&&(m.model.isVertex(h.cell)||m.model.isEdge(h.cell))&&(m.isHtmlLabel(h.cell)? -(p.innerHTML=m.getLabel(h.cell),label=mxUtils.extractTextWithWhitespace([p])):label=m.getLabel(h.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===b||f(c,h.cell,b))||null!=c&&(c.test(label)||f(c,h.cell,b))))if(e){d=h;break}else null==d&&(d=h);e=e||h==k}null!=d?(k=d,m.scrollCellToVisible(k.cell),m.isEnabled()?m.setSelectionCell(k.cell):m.highlightCell(k.cell)):m.isEnabled()&&m.clearSelection();return 0==b.length||null!=d} +mxUtils.trim(b[d].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&g.substring(0,c.length)===c||null!=a&&a.test(g))return!0}}return!1}function h(){var a=m.model.getDescendants(m.model.getRoot()),b=q.value.toLowerCase(),c=u.checked?new RegExp(b):null,d=null;g!=b&&(g=b,k=null);var n=null==k;if(0<b.length)for(var e=0;e<a.length;e++){var h=m.view.getState(a[e]);if(null!=h&&null!=h.cell.value&&(n||null==d)&&(m.model.isVertex(h.cell)||m.model.isEdge(h.cell))&&(m.isHtmlLabel(h.cell)? +(p.innerHTML=m.getLabel(h.cell),label=mxUtils.extractTextWithWhitespace([p])):label=m.getLabel(h.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===b||f(c,h.cell,b))||null!=c&&(c.test(label)||f(c,h.cell,b))))if(n){d=h;break}else null==d&&(d=h);n=n||h==k}null!=d?(k=d,m.scrollCellToVisible(k.cell),m.isEnabled()?m.setSelectionCell(k.cell):m.highlightCell(k.cell)):m.isEnabled()&&m.clearSelection();return 0==b.length||null!=d} var l=a.actions.get("find"),m=a.editor.graph,g=null,k=null,n=document.createElement("div");n.style.userSelect="none";n.style.overflow="hidden";n.style.padding="10px";n.style.height="100%";var q=document.createElement("input");q.setAttribute("placeholder",mxResources.get("find"));q.setAttribute("type","text");q.style.marginTop="4px";q.style.marginBottom="6px";q.style.width="200px";q.style.fontSize="12px";q.style.borderRadius="4px";q.style.padding="6px";n.appendChild(q);mxUtils.br(n);var u=document.createElement("input"); u.setAttribute("type","checkbox");u.style.marginRight="4px";n.appendChild(u);mxUtils.write(n,mxResources.get("regularExpression"));var p=document.createElement("div");mxUtils.br(n);var w=mxUtils.button(mxResources.get("reset"),function(){q.value="";q.style.backgroundColor="";g=k=null;q.focus()});w.setAttribute("title",mxResources.get("reset"));w.style.marginTop="6px";w.style.marginRight="4px";w.className="geBtn";n.appendChild(w);w=mxUtils.button(mxResources.get("find"),function(){try{q.style.backgroundColor= h()?"":"#ffcfcf"}catch(x){a.handleError(x)}});w.setAttribute("title",mxResources.get("find")+" (Enter)");w.style.marginTop="6px";w.className="geBtn gePrimaryBtn";n.appendChild(w);mxEvent.addListener(q,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)l.funct();else if(g!=q.value.toLowerCase()||13==a.keyCode)try{q.style.backgroundColor=h()?"":"#ffcfcf"}catch(y){q.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(n,"keydown",function(b){70==b.keyCode&& a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&(l.funct(),mxEvent.consume(b))});this.window=new mxWindow(mxResources.get("find"),n,b,d,c,e,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)):m.container.focus()}))}, -TagsWindow=function(a,b,d,c,e){function f(a){a=null!=a?a:l.model.getDescendants(l.model.getRoot());for(var b=k.value.split(" "),c=[],d=0;d<a.length;d++)if(l.model.isVertex(a[d])||l.model.isEdge(a[d])){var g=null!=a[d].value&&"object"==typeof a[d].value?mxUtils.trim(a[d].value.getAttribute(m)||""):"",e=!0;if(0<g.length)for(var g=g.toLowerCase().split(" "),n=0;n<b.length&&e;n++)var f=mxUtils.trim(b[n]).toLowerCase(),e=e&&(0==f.length||0<=mxUtils.indexOf(g,f));else e=0==mxUtils.trim(k.value).length; -e&&c.push(a[d])}return c}function h(a,b){l.model.beginUpdate();try{for(var c=0;c<a.length;c++)l.model.setVisible(a[c],b)}finally{l.model.endUpdate()}}var l=a.editor.graph,m="tags",g=document.createElement("div");g.style.userSelect="none";g.style.overflow="hidden";g.style.padding="10px";g.style.height="100%";var k=document.createElement("input");k.setAttribute("placeholder",mxResources.get("allTags"));k.setAttribute("type","text");k.style.marginTop="4px";k.style.width="260px";k.style.fontSize="12px"; +TagsWindow=function(a,b,d,c,e){function f(a){a=null!=a?a:l.model.getDescendants(l.model.getRoot());for(var b=k.value.split(" "),c=[],d=0;d<a.length;d++)if(l.model.isVertex(a[d])||l.model.isEdge(a[d])){var g=null!=a[d].value&&"object"==typeof a[d].value?mxUtils.trim(a[d].value.getAttribute(m)||""):"",n=!0;if(0<g.length)for(var g=g.toLowerCase().split(" "),e=0;e<b.length&&n;e++)var f=mxUtils.trim(b[e]).toLowerCase(),n=n&&(0==f.length||0<=mxUtils.indexOf(g,f));else n=0==mxUtils.trim(k.value).length; +n&&c.push(a[d])}return c}function h(a,b){l.model.beginUpdate();try{for(var c=0;c<a.length;c++)l.model.setVisible(a[c],b)}finally{l.model.endUpdate()}}var l=a.editor.graph,m="tags",g=document.createElement("div");g.style.userSelect="none";g.style.overflow="hidden";g.style.padding="10px";g.style.height="100%";var k=document.createElement("input");k.setAttribute("placeholder",mxResources.get("allTags"));k.setAttribute("type","text");k.style.marginTop="4px";k.style.width="260px";k.style.fontSize="12px"; k.style.borderRadius="4px";k.style.padding="6px";g.appendChild(k);if(!a.isOffline()||mxClient.IS_CHROMEAPP){k.style.width="240px";var n=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000046966");n.firstChild.style.marginBottom="6px";n.style.marginLeft="6px";g.appendChild(n)}mxEvent.addListener(k,"dblclick",function(){var b=new FilenameDialog(a,m,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(m=a)}),mxResources.get("enterPropertyName"));a.showDialog(b.container, 300,80,!0,!0);b.init()});k.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(g);n=mxUtils.button(mxResources.get("hide"),function(){h(f(),!1)});n.setAttribute("title",mxResources.get("hide"));n.style.marginTop="8px";n.style.marginRight="4px";n.className="geBtn";g.appendChild(n);n=mxUtils.button(mxResources.get("show"),function(){var a=f();h(a,!0);l.isEnabled()&&l.setSelectionCells(a)});n.setAttribute("title",mxResources.get("show"));n.style.marginTop="8px";n.style.marginRight= "4px";n.className="geBtn";g.appendChild(n);var q=a.actions.get("tags"),n=mxUtils.button(mxResources.get("close"),function(){q.funct()});n.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");n.style.marginTop="8px";n.className="geBtn gePrimaryBtn";g.appendChild(n);mxEvent.addListener(k,"keyup",function(a){13!=a.keyCode&&27!=a.keyCode||q.funct()});this.window=new mxWindow(mxResources.get("tags"),g,b,d,c,e,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1); @@ -6855,7 +6855,7 @@ var P=document.createElement("input");P.style.cssText="margin:0 8px 0 8px;";P.se m.className="geBtn",e.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)}),m.className="geBtn",e.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});m.className="geBtn gePrimaryBtn";e.appendChild(m);a.editor.cancelFirst||e.appendChild(h);k.appendChild(e);this.container=k};var w=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null== this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(w.apply(this,arguments),null!=this.mathEnabled&& this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})(); -(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,c){c.ui=a.ui;return d};a.afterDecode=function(a,d,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.5.2";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>'; +(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,c){c.ui=a.ui;return d};a.afterDecode=function(a,d,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.5.3";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>'; EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;"; EditorUi.prototype.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport= !1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(u){}try{var b=document.createElement("canvas"),c=new Image;c.onload=function(){try{b.getContext("2d").drawImage(c,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&& @@ -6898,86 +6898,87 @@ a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.cre function(a){var b=this.sidebar.palettes[a];if(null!=b){for(var c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;if(null==a){var c=this.sidebar.palettes["L.scratchpad"];null==c&&(c=this.sidebar.palettes.search);null!=c&&(a=c[c.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;var c=b.lastChild,d=c.previousSibling;b.insertBefore(c,a);b.insertBefore(d,c)};EditorUi.prototype.loadLibrary= function(a){var b=mxUtils.parseXml(a.getData());if("mxlibrary"==b.documentElement.nodeName){var c=JSON.parse(mxUtils.getTextContent(b.documentElement));this.libraryLoaded(a,c,b.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&& (this.scratchpad=a);var d=this.sidebar.palettes[a.getHash()],d=null!=d?d[d.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var g=null,e=mxUtils.bind(this,function(b,c){if(0==b.length&&a.isEditable())null==g&&(g=document.createElement("div"),mxUtils.setPrefixedStyle(g.style,"borderRadius","6px"),g.style.border="3px dotted lightGray",g.style.textAlign="center",g.style.padding="8px",g.style.color="#B3B3B3",mxUtils.write(g,mxResources.get("dragElementsHere"))),c.appendChild(g);else for(var d= -0;d<b.length;d++){var e=b[d],k=e.data;if(null!=k){var k=this.convertDataUri(k),f="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(f+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(f+"image="+k,e.w,e.h,"",e.title||"",!1,!1,!0))}else null!=e.xml&&(k=this.stringToCells(this.editor.graph.decompress(e.xml)),0<k.length&&c.appendChild(this.sidebar.createVertexTemplateFromCells(k,e.w,e.h,e.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!= +0;d<b.length;d++){var e=b[d],k=e.data;if(null!=k){var k=this.convertDataUri(k),n="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(n+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(n+"image="+k,e.w,e.h,"",e.title||"",!1,!1,!0))}else null!=e.xml&&(k=this.stringToCells(this.editor.graph.decompress(e.xml)),0<k.length&&c.appendChild(this.sidebar.createVertexTemplateFromCells(k,e.w,e.h,e.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!= b)for(var k=0;k<b.length;k++)mxUtils.bind(this,function(a){var b=a.data;null!=b&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){b=this.convertDataUri(b);var c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(c+="aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var b=this.stringToCells(this.editor.graph.decompress(a.xml)); -return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[k]);c=null!=c&&0<c.length?c:a.getTitle();var f=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(d);var n=f.parentNode.previousSibling;c=n.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&n.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var t=document.createElement("div");t.style.position="absolute";t.style.right="0px";t.style.top= -"5px";mxClient.IS_QUIRKS||8==document.documentMode||(t.style.backgroundColor="inherit");n.style.position="relative";var h=document.createElement("img");h.setAttribute("src",Dialog.prototype.closeImage);h.setAttribute("title",mxResources.get("close"));h.setAttribute("align","top");h.setAttribute("border","0");h.className="geButton";h.style.marginRight="1px";h.style.marginTop="-1px";t.appendChild(h);var l=null;mxEvent.addListener(h,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c= -mxUtils.bind(this,function(){this.closeLibrary(a)});null!=l?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var m=this.editor.graph,v=null,G=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),f,b,a,a.getMode());mxEvent.consume(c)}),D=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v),v=h.cloneNode(!1), -v.setAttribute("src",Editor.spinImage),v.setAttribute("title",mxResources.get("saving")),v.style.cursor="default",v.style.marginRight="2px",v.style.marginTop="-2px",t.insertBefore(v,t.firstChild),n.style.paddingRight=18*t.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=v&&null!=v.parentNode&&(v.parentNode.removeChild(v),n.style.paddingRight=18*t.childNodes.length+"px")})):null==l&&(l=h.cloneNode(!1),l.setAttribute("src",IMAGE_PATH+"/download.png"),l.setAttribute("title", -mxResources.get("save")),t.insertBefore(l,t.firstChild),mxEvent.addListener(l,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==l||a.isModified()||(n.style.paddingRight=18*t.childNodes.length+"px",l.parentNode.removeChild(l),l=null)});mxEvent.consume(c)})),n.style.paddingRight=18*t.childNodes.length+"px")}),E=mxUtils.bind(this,function(a,c,d,e){a=m.cloneCells(mxUtils.sortCells(m.model.getTopmostCells(a)));for(var k= -0;k<a.length;k++){var n=m.getCellGeometry(a[k]);null!=n&&n.translate(-c.x,-c.y)}f.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);D(d);null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)}),H=mxUtils.bind(this,function(a){if(m.isSelectionEmpty())m.getRubberband().isActive()?(m.getRubberband().execute(a), -m.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=m.getSelectionCells(),c=m.view.getBounds(b),d=m.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=m.view.translate.x;c.y-=m.view.translate.y;E(b,c)}mxEvent.consume(a)});f.style.border="3px solid transparent";mxEvent.addGestureListeners(f,function(){},mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility= -"hidden",null!=g?g.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)",f.style.cursor="copy",m.panningManager.stop(),m.autoScroll=!1,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!1),null!=m.graphHandler.hint&&(m.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler&&(f.style.border="3px solid transparent",null!=g&&(g.style.border="3px dotted lightGray"), -f.style.cursor="default",this.sidebar.showTooltips=!0,m.panningManager.stop(),m.graphHandler.reset(),m.isMouseDown=!1,m.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(f,"mouseleave",mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility="visible",f.style.border="3px solid transparent",f.style.cursor="",m.autoScroll=!0,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!0),null!=m.graphHandler.hint&&(m.graphHandler.hint.style.visibility= -"visible"),null!=g&&(g.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(f,"dragover",mxUtils.bind(this,function(a){null!=g?g.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";f.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(f,"drop",mxUtils.bind(this,function(a){f.style.border="3px solid transparent";f.style.cursor="";null!=g&&(g.style.border= -"3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,k,n,t,h,l,m,q){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,t,h),c)],c[0].vertex=!0,E(c,new mxRectangle(0,0,t,h),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=g&&null!=g.parentNode&& -0<b.length&&(g.parentNode.removeChild(g),g=null);else{var p=!1,u=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var n=JSON.parse(mxUtils.getTextContent(k.documentElement));e(n,f);b=b.concat(n);D(a);this.spinner.stop();p=!0}catch(P){}else if("mxfile"==k.documentElement.nodeName)try{for(var t=k.documentElement.getElementsByTagName("diagram"),k=0;k<t.length;k++){var n=mxUtils.getTextContent(t[k]),h=this.stringToCells(this.editor.graph.decompress(n)), -l=this.editor.graph.getBoundingBoxFromGeometry(h);E(h,new mxRectangle(0,0,l.width,l.height),a)}p=!0}catch(P){null!=window.console&&console.log("error in drop handler:",P)}}p||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)});null!=q&&null!=l&&(/(\.vsdx)($|\?)/i.test(l)||/(\.vssx)($|\?)/i.test(l))?this.importVisio(q,function(a){u(a,"text/xml")}):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(c,l)&&null!=q?this.parseFile(q,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?u(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):u(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(f,"dragleave",function(a){null!=g?g.style.border="3px dotted lightGray":(f.style.border="3px solid transparent", -f.style.cursor="");a.stopPropagation();a.preventDefault()}));h=h.cloneNode(!1);h.setAttribute("src",IMAGE_PATH+"/edit.gif");h.setAttribute("title",mxResources.get("edit"));t.insertBefore(h,t.firstChild);mxEvent.addListener(h,"click",G);mxEvent.addListener(f,"dblclick",function(a){mxEvent.getSource(a)==f&&G(a)});c=h.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));t.insertBefore(c,t.firstChild);mxEvent.addListener(c,"click",H);this.isOffline()||".scratchpad"!= -a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),t.insertBefore(c,t.firstChild))}n.appendChild(t);n.style.paddingRight=18*t.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight= -4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position= -"relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"), -Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a", -Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor= -"#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))}; -EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display="none",this.refresh())};EditorUi.prototype.showFooter=function(a){var b=document.getElementById("geFooter");null!=b&&(this.footerHeight=a,b.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,d,e){a=new ImageDialog(this,a,b,c,d,e);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0, -!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,d,e){a=new LibraryDialog(this,a,b,c,d,e);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null== -this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer");a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this, -function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},e=null!=a&&null!=a.error?a.error:a;if(null!=e||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var g=mxResources.get("ok"),k=null;b=null!=b?b:mxResources.get("error");if(null!=e)if(null!=e.retry&&(g=mxResources.get("cancel"),k=function(){d();e.retry()}),"undefined"!= -typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));else if(404==e.code||404==e.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var f=window.location.hash;null!=f&&"#G"==f.substring(0,2)&&(f=f.substring(2), -a+=' <a href="https://drive.google.com/open?id='+f+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else e.code==App.ERROR_TIMEOUT?a=mxUtils.htmlEntities(mxResources.get("timeout")):e.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=e.message?a=mxUtils.htmlEntities(e.message):null!=e.response&&null!=e.response.error&&(a=mxUtils.htmlEntities(e.response.error));this.showError(b,a,g,c,k)}else null!=c&&c()};EditorUi.prototype.showError= -function(a,b,c,d,e,f,h){a=new ErrorDialog(this,a,b,c,d,e,f,h);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,c,d,e){var g=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){g();null!=b&&b()},function(){g();null!=c&&c()},d,e)).container, -340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,c){var d=a.toDataURL("image/"+c);if(6>=d.length|| -d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return d};EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,e=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(e,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&& -"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.doSaveLocalFile=function(a,b,c,d,e){if(window.Blob&&navigator.msSaveOrOpenBlob)a=d?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs", -!0,b),c.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height="380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var g=document.createElement("a"),k=!mxClient.IS_SF&&"undefined"!==typeof g.download;if(k||this.isOffline()){g.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));k?g.download=b:g.setAttribute("target","_blank"); -document.body.appendChild(g);try{window.setTimeout(function(){URL.revokeObjectURL(g.href)},0),g.click(),g.parentNode.removeChild(g)}catch(x){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,f){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=f?"&base64="+f:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob= -function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),g=Array(e),k=0;k<e;++k){for(var f=1024*k,h=Math.min(f+1024,d),t=Array(h-f),l=0;f<h;++l,++f)t[l]=c[f].charCodeAt(0);g[k]=new Uint8Array(t)}return new Blob(g,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,f,h){f=null!=f?f:!1;h=null!=h?h:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(f);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){try{if("_blank"==e)if(null==c||"image/"!=c.substring(0, -6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var g=window.open("about:blank");null==g?mxUtils.popup(a,!0):(g.document.write(mxUtils.htmlEntities(a,!1)),g.document.close())}else this.openInNewWindow(a,c,d);else e==App.MODE_DEVICE?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(e,mxUtils.bind(this,function(g){try{this.exportFile(a,b,c,d,e,g)}catch(F){this.handleError(F)}}))}catch(z){this.handleError(z)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"), -mxResources.get("download"),!1,f,h,null,null,4<e?3:4,a,c,d);this.showDialog(b.container,420,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+ -'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog), -this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding= -"4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=d.zIndex;var e=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});e.spin(this.exportDialog); -this.exportToCanvas(mxUtils.bind(this,function(a){e.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this, -function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,e){this.isLocalFileSave()?this.saveLocalFile(c, -a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,g){return this.createEchoRequest(c,a,d,e,b,g)}),c,e,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,e,f,h){h=null!=h?h:!mxClient.IS_IOS||!navigator.standalone;var g=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,e){if("_blank"==e||null!=a&&0<a.length){var g=c("_blank"==e?null:a,e==App.MODE_DEVICE||null==e||"_blank"==e?"0":"1");null!=g&&(e==App.MODE_DEVICE||"_blank"==e?g.simulate(document,"_blank"):this.pickFolder(e, -mxUtils.bind(this,function(c){f=null!=f?f:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,a,f,!0,e,c)}catch(C){this.handleError(C)}else this.spinner.spin(document.body,mxResources.get("saving"))&&g.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=g.getStatus()&&299>=g.getStatus())try{this.exportFile(g.getText(),a,f,!0,e,c)}catch(C){this.handleError(C)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}), -mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,h,null,null,4<g?3:4,d,f,e);this.showDialog(a.container,380,g==(mxClient.IS_IOS?0:1)?160:4<g?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,f){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,f,h,l,m){if(this.spinner.spin(document.body, -mxResources.get("export"))){var g=this.editor.graph.isSelectionEmpty();c=null!=c?c:g;g=b?null:this.editor.graph.background;g==mxConstants.NONE&&(g=null);null==g&&0==b&&(g="#ffffff");var k=this.editor.graph.getSvg(g,a,h,l,null,c);d&&this.editor.graph.addSvgShadow(k);var n=this.getBaseFilename()+".svg",q=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,m));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS? -b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var d='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||d.length<=MAX_REQUEST_SIZE?this.saveData(n,"svg",d,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"), -mxUtils.bind(this,function(){mxUtils.popup(d)}))});this.convertMath(this.editor.graph,k,!1,mxUtils.bind(this,function(){f?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(k,q,this.thumbImageCache)):q(k)}))}};EditorUi.prototype.addCheckbox=function(a,b,c,d,e,f){f=null!=f?f:!0;var g=document.createElement("input");g.style.marginRight="8px";g.style.marginTop="16px";g.setAttribute("type","checkbox");c&&(g.setAttribute("checked","checked"),g.defaultChecked=!0);d&&g.setAttribute("disabled", -"disabled");f&&(a.appendChild(g),mxUtils.write(a,b),e||mxUtils.br(a));return g};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),e="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(e=window.location.href);var g=document.createElement("select");g.style.width="120px";g.style.marginLeft="8px";g.style.marginRight="10px";g.className="geBtn";d=document.createElement("option"); -d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));g.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");g.appendChild(d);a.appendChild(g);mxEvent.addListener(g,"change",mxUtils.bind(this,function(){if("custom"==g.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:g.value="blank"},mxResources.get("url"),null,null,null,null,function(){g.value="blank"});this.showDialog(a.container, -300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===g.value?"_blank":e:null},getEditInput:function(){return c},getEditSelect:function(){return g}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=g&&g!=mxConstants.NONE? -"border:1px solid black;background-color:"+g:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var e=document.createElement("option");e.setAttribute("value","auto");mxUtils.write(e,mxResources.get("automatic"));d.appendChild(e);e=document.createElement("option"); -e.setAttribute("value","blank");mxUtils.write(e,mxResources.get("openInNewWindow"));d.appendChild(e);e=document.createElement("option");e.setAttribute("value","self");mxUtils.write(e,mxResources.get("openInThisWindow"));d.appendChild(e);b&&(e=document.createElement("option"),e.setAttribute("value","frame"),mxUtils.write(e,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(e));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var g="#0000ff",k= -null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(g||"none",function(a){g=a;c()});mxEvent.consume(a)}));c();k.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return g},getTarget:function(){return d.value},focus:function(){d.focus()}}}; -EditorUi.prototype.createLink=function(a,b,c,d,e,f,h,l){var g=this.getCurrentFile(),k=[];d&&(k.push("lightbox=1"),"auto"!=a&&k.push("target="+a),null!=b&&b!=mxConstants.NONE&&k.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&k.push("edit="+encodeURIComponent(e)),f&&k.push("layers=1"),this.editor.graph.foldingEnabled&&k.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&k.push("page="+a); -break}a=!0;null!=h?c="#U"+encodeURIComponent(h):(g=this.getCurrentFile(),l||null==g||g.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+g.getHash(),a=!1));a&&null!=g&&null!=g.getTitle()&&g.getTitle()!=this.defaultFilename&&k.push("title="+encodeURIComponent(g.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)? -"https://www.draw.io/":"https://"+window.location.host+"/")+(0<k.length?"?"+k.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,d,e,f,h,l,m,t,z){this.getBasenames();var g={};""!=e&&e!=mxConstants.NONE&&(g.highlight=e);"auto"!==d&&(g.target=d);m||(g.lightbox=!1);g.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(g.zoom=c/100);c=[];h&&(c.push("pages"),g.resize=!0,null!=this.pages&&null!=this.currentPage&&(g.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"), -g.resize=!0);l&&c.push("layers");0<c.length&&(m&&c.push("lightbox"),g.toolbar=c.join(" "));null!=t&&0<t.length&&(g.edit=t);null!=a?g.url=a:g.xml=this.getFileData(!0,null,null,null,null,!h);b='<div class="mxgraph" style="'+(f?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(g))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";z(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1": -"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("html"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(g);var k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;"; -var f=document.createElement("input");f.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";f.setAttribute("value","url");f.setAttribute("type","radio");f.setAttribute("name","type-embedhtmldialog");g=f.cloneNode(!0);g.setAttribute("value","copy");k.appendChild(g);var n=document.createElement("span");mxUtils.write(n,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(n);mxUtils.br(k);k.appendChild(f);n=document.createElement("span");mxUtils.write(n,mxResources.get("publicDiagramUrl")); -k.appendChild(n);var h=this.getCurrentFile();null==c&&null!=h&&h.constructor==window.DriveFile&&(n=document.createElement("a"),n.style.paddingLeft="12px",n.style.color="gray",n.setAttribute("href","javascript:void(0);"),mxUtils.write(n,mxResources.get("share")),k.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(h.getId())})));g.setAttribute("checked","checked");null==c&&f.setAttribute("disabled","disabled");e.appendChild(k);var l= -this.addLinkSection(e),m=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value="100%";e.appendChild(q);var v=this.addCheckbox(e,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,G=G=this.addCheckbox(e,mxResources.get("allPages"),k,!k),D=this.addCheckbox(e,mxResources.get("layers"),!0), -E=this.addCheckbox(e,mxResources.get("lightbox"),!0),H=this.addEditButton(e,E),A=H.getEditInput();A.style.marginBottom="16px";mxEvent.addListener(E,"change",function(){E.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled");A.checked&&E.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(f.checked?c:null,m.checked,q.value,l.getTarget(),l.getColor(),v.checked,G.checked, -D.checked,E.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);g.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,f){var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=document.createElement("h3");mxUtils.write(k,a||mxResources.get("link"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";g.appendChild(k);var n=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!= -n&&n.constructor==window.DriveFile&&!b){a=80;var k="https://desk.draw.io/support/solutions/articles/16000039384",h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var l=document.createElement("div");l.style.whiteSpace="normal";mxUtils.write(l,mxResources.get("linkAccountRequired"));h.appendChild(l);l=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(n.getId())})); -l.style.marginTop="12px";l.className="geBtn";h.appendChild(l);g.appendChild(h);l=document.createElement("a");l.style.paddingLeft="12px";l.style.color="gray";l.style.fontSize="11px";l.setAttribute("href","javascript:void(0);");mxUtils.write(l,mxResources.get("check"));h.appendChild(l);mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this, -null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,q=null;if(null!=c||null!=d)a+=30,mxUtils.write(g,mxResources.get("width")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",g.appendChild(m),mxUtils.write(g,mxResources.get("height")+ -":"),q=document.createElement("input"),q.setAttribute("type","text"),q.style.width="50px",q.style.marginLeft="6px",q.style.marginBottom="10px",q.value=d+"px",g.appendChild(q),mxUtils.br(g);var p=this.addLinkSection(g,f);c=null!=this.pages&&1<this.pages.length;var u=null;if(null==n||n.constructor!=window.DriveFile||b)u=this.addCheckbox(g,mxResources.get("allPages"),c,!c);var D=this.addCheckbox(g,mxResources.get("lightbox"),!0),E=this.addEditButton(g,D),H=E.getEditInput(),A=this.addCheckbox(g,mxResources.get("layers"), -!0);A.style.marginLeft=H.style.marginLeft;A.style.marginBottom="16px";A.style.marginTop="8px";mxEvent.addListener(D,"change",function(){D.checked?(A.removeAttribute("disabled"),H.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&D.checked?E.getEditSelect().removeAttribute("disabled"):E.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){e(p.getTarget(),p.getColor(),null==u? -!0:u.checked,D.checked,E.getLink(),A.checked,null!=m?m.value:null,null!=q?q.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,254+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):p.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g, -mxResources.get("image"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(g);var k=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),f=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),!0);null!=f&&(f.style.marginBottom="16px");a=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!k.checked,null!=f?f.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog= -function(a,b,c,d,e,f,h,l){h=null!=h?h:!0;var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=this.editor.graph,n="jpeg"==l?196:300,m=document.createElement("h3");mxUtils.write(m,a);m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";g.appendChild(m);mxUtils.write(g,mxResources.get("zoom")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight= -"12px";q.value=this.lastExportZoom||"100%";g.appendChild(q);mxUtils.write(g,mxResources.get("borderWidth")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.value=this.lastExportBorder||"0";g.appendChild(p);mxUtils.br(g);var u=this.addCheckbox(g,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background,null,null,"jpeg"!=l),w=this.addCheckbox(g,mxResources.get("selectionOnly"), -!1,k.isSelectionEmpty()),x=document.createElement("input");x.style.marginTop="16px";x.style.marginRight="8px";x.style.marginLeft="24px";x.setAttribute("disabled","disabled");x.setAttribute("type","checkbox");f&&(g.appendChild(x),mxUtils.write(g,mxResources.get("crop")),mxUtils.br(g),n+=26,mxEvent.addListener(w,"change",function(){w.checked?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(x.setAttribute("checked","checked"),x.defaultChecked=!0);var H=this.addCheckbox(g, -mxResources.get("shadow"),k.shadowVisible),A=document.createElement("input");A.style.marginTop="16px";A.style.marginRight="8px";A.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||A.setAttribute("disabled","disabled");b&&(g.appendChild(A),mxUtils.write(g,mxResources.get("embedImages")),mxUtils.br(g),n+=26);var K=this.addCheckbox(g,mxResources.get("includeCopyOfMyDiagram"),h,null,null,"jpeg"!=l),B=null!=this.pages&&1<this.pages.length,L=this.addCheckbox(g,B?mxResources.get("allPages"): -"",B,!B,null,"jpeg"!=l);L.style.marginLeft="24px";L.style.marginBottom="16px";B||(L.style.visibility="hidden");mxEvent.addListener(K,"change",function(){K.checked&&B?L.removeAttribute("disabled"):L.setAttribute("disabled","disabled")});h&&B||L.setAttribute("disabled","disabled");a=new CustomDialog(this,g,mxUtils.bind(this,function(){this.lastExportBorder=p.value;this.lastExportZoom=q.value;e(q.value,u.checked,!w.checked,H.checked,K.checked,A.checked,p.value,x.checked,!L.checked)}),null,c,d);this.showDialog(a.container, -340,n,!0,!0);q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,e){var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=this.editor.graph;if(null!=b){var f=document.createElement("h3");mxUtils.write(f,b);f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";g.appendChild(f)}var n=this.addCheckbox(g,mxResources.get("fit"), -!0),h=this.addCheckbox(g,mxResources.get("shadow"),k.shadowVisible&&d,!d),l=this.addCheckbox(g,c),m=this.addCheckbox(g,mxResources.get("lightbox"),!0),q=this.addEditButton(g,m),u=q.getEditInput(),G=1<k.model.getChildCount(k.model.getRoot()),D=this.addCheckbox(g,mxResources.get("layers"),G,!G);D.style.marginLeft=u.style.marginLeft;D.style.marginBottom="12px";D.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(G&&D.removeAttribute("disabled"),u.removeAttribute("disabled")): -(D.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"));u.checked&&m.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){a(n.checked,h.checked,l.checked,m.checked,q.getLink(),D.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,e,f,h,l){function g(b){var g=" ",n="";d&&(g=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ +return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[k]);c=null!=c&&0<c.length?c:a.getTitle();var n=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(d);var f=n.parentNode.previousSibling;c=f.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&f.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var t=document.createElement("div");t.style.position="absolute";t.style.right="0px";t.style.top= +"5px";mxClient.IS_QUIRKS||8==document.documentMode||(t.style.backgroundColor="inherit");f.style.position="relative";var h=document.createElement("img");h.setAttribute("src",Dialog.prototype.closeImage);h.setAttribute("title",mxResources.get("close"));h.setAttribute("align","top");h.setAttribute("border","0");h.className="geButton";h.style.marginRight="1px";h.style.marginTop="-1px";t.appendChild(h);var l=null;mxEvent.addListener(h,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c= +mxUtils.bind(this,function(){this.closeLibrary(a)});null!=l?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var m=this.editor.graph,v=null,G=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),n,b,a,a.getMode());mxEvent.consume(c)}),D=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v),v=h.cloneNode(!1), +v.setAttribute("src",Editor.spinImage),v.setAttribute("title",mxResources.get("saving")),v.style.cursor="default",v.style.marginRight="2px",v.style.marginTop="-2px",t.insertBefore(v,t.firstChild),f.style.paddingRight=18*t.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=v&&null!=v.parentNode&&(v.parentNode.removeChild(v),f.style.paddingRight=18*t.childNodes.length+"px")})):null==l&&(l=h.cloneNode(!1),l.setAttribute("src",IMAGE_PATH+"/download.png"),l.setAttribute("title", +mxResources.get("save")),t.insertBefore(l,t.firstChild),mxEvent.addListener(l,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==l||a.isModified()||(f.style.paddingRight=18*t.childNodes.length+"px",l.parentNode.removeChild(l),l=null)});mxEvent.consume(c)})),f.style.paddingRight=18*t.childNodes.length+"px")}),E=mxUtils.bind(this,function(a,c,d,e){a=m.cloneCells(mxUtils.sortCells(m.model.getTopmostCells(a)));for(var k= +0;k<a.length;k++){var f=m.getCellGeometry(a[k]);null!=f&&f.translate(-c.x,-c.y)}n.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);D(d);null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)}),H=mxUtils.bind(this,function(a){if(m.isSelectionEmpty())m.getRubberband().isActive()?(m.getRubberband().execute(a), +m.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=m.getSelectionCells(),c=m.view.getBounds(b),d=m.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=m.view.translate.x;c.y-=m.view.translate.y;E(b,c)}mxEvent.consume(a)});n.style.border="3px solid transparent";mxEvent.addGestureListeners(n,function(){},mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility= +"hidden",null!=g?g.style.border="3px dotted rgb(254, 137, 12)":n.style.border="3px dotted rgb(254, 137, 12)",n.style.cursor="copy",m.panningManager.stop(),m.autoScroll=!1,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!1),null!=m.graphHandler.hint&&(m.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler&&(n.style.border="3px solid transparent",null!=g&&(g.style.border="3px dotted lightGray"), +n.style.cursor="default",this.sidebar.showTooltips=!0,m.panningManager.stop(),m.graphHandler.reset(),m.isMouseDown=!1,m.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(n,"mouseleave",mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility="visible",n.style.border="3px solid transparent",n.style.cursor="",m.autoScroll=!0,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!0),null!=m.graphHandler.hint&&(m.graphHandler.hint.style.visibility= +"visible"),null!=g&&(g.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(n,"dragover",mxUtils.bind(this,function(a){null!=g?g.style.border="3px dotted rgb(254, 137, 12)":n.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";n.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(n,"drop",mxUtils.bind(this,function(a){n.style.border="3px solid transparent";n.style.cursor="";null!=g&&(g.style.border= +"3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,k,f,t,h,l,m,q){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,t,h),c)],c[0].vertex=!0,E(c,new mxRectangle(0,0,t,h),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=g&&null!=g.parentNode&& +0<b.length&&(g.parentNode.removeChild(g),g=null);else{var p=!1,u=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var f=JSON.parse(mxUtils.getTextContent(k.documentElement));e(f,n);b=b.concat(f);D(a);this.spinner.stop();p=!0}catch(P){}else if("mxfile"==k.documentElement.nodeName)try{for(var t=k.documentElement.getElementsByTagName("diagram"),k=0;k<t.length;k++){var f=mxUtils.getTextContent(t[k]),h=this.stringToCells(this.editor.graph.decompress(f)), +l=this.editor.graph.getBoundingBoxFromGeometry(h);E(h,new mxRectangle(0,0,l.width,l.height),a)}p=!0}catch(P){null!=window.console&&console.log("error in drop handler:",P)}}p||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)});null!=q&&null!=l&&(/(\.vsdx)($|\?)/i.test(l)||/(\.vssx)($|\?)/i.test(l)||/(\.vsd)($|\?)/i.test(l))?this.importVisio(q,function(a){u(a,"text/xml")},null,l):!this.isOffline()&& +(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,l)&&null!=q?this.parseFile(q,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?u(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):u(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(n,"dragleave",function(a){null!=g?g.style.border="3px dotted lightGray":(n.style.border= +"3px solid transparent",n.style.cursor="");a.stopPropagation();a.preventDefault()}));h=h.cloneNode(!1);h.setAttribute("src",IMAGE_PATH+"/edit.gif");h.setAttribute("title",mxResources.get("edit"));t.insertBefore(h,t.firstChild);mxEvent.addListener(h,"click",G);mxEvent.addListener(n,"dblclick",function(a){mxEvent.getSource(a)==n&&G(a)});c=h.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));t.insertBefore(c,t.firstChild);mxEvent.addListener(c,"click", +H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),t.insertBefore(c,t.firstChild))}f.appendChild(t);f.style.paddingRight=18*t.childNodes.length+"px"}};"1"==urlParams.offline|| +EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide")); +a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)", +Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme", +Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor= +"#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=", +Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display= +"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var b=document.getElementById("geFooter");null!=b&&(this.footerHeight=a,b.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,d,e){a=new ImageDialog(this,a,b,c,d,e);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor= +!0;this.editor.graph.model.execute(a)});var b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,d,e){a=new LibraryDialog(this,a,b,c,d,e);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer"); +a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c){var d=null!=this.spinner&&null!= +this.spinner.pause?this.spinner.pause():function(){},e=null!=a&&null!=a.error?a.error:a;if(null!=e||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var g=mxResources.get("ok"),k=null;b=null!=b?b:mxResources.get("error");if(null!=e)if(null!=e.retry&&(g=mxResources.get("cancel"),k=function(){d();e.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden")); +else if(404==e.code||404==e.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var n=window.location.hash;null!=n&&"#G"==n.substring(0,2)&&(n=n.substring(2),a+=' <a href="https://drive.google.com/open?id='+n+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else e.code==App.ERROR_TIMEOUT?a= +mxUtils.htmlEntities(mxResources.get("timeout")):e.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=e.message?a=mxUtils.htmlEntities(e.message):null!=e.response&&null!=e.response.error&&(a=mxUtils.htmlEntities(e.response.error));this.showError(b,a,g,c,k)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,d,e,f,h){a=new ErrorDialog(this,a,b,c,d,e,f,h);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this, +null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,c,d,e){var g=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){g();null!=b&&b()},function(){g();null!=c&&c()},d,e)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas= +function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,c){var d=a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return d}; +EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,e=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(e,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS}; +EditorUi.prototype.doSaveLocalFile=function(a,b,c,d,e){if(window.Blob&&navigator.msSaveOrOpenBlob)a=d?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height= +"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var g=document.createElement("a"),k=!mxClient.IS_SF&&"undefined"!==typeof g.download;if(k||this.isOffline()){g.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));k&&(g.download=b);g.setAttribute("target","_blank");document.body.appendChild(g);try{window.setTimeout(function(){URL.revokeObjectURL(g.href)},0),g.click(),g.parentNode.removeChild(g)}catch(x){}}else this.createEchoRequest(a, +b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,f){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=f?"&base64="+f:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),g=Array(e),k=0;k<e;++k){for(var f=1024*k,h=Math.min(f+1024,d),t=Array(h-f),l=0;f<h;++l,++f)t[l]= +c[f].charCodeAt(0);g[k]=new Uint8Array(t)}return new Blob(g,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,f,h){f=null!=f?f:!1;h=null!=h?h:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(f);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){try{if("_blank"==e)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var g=window.open("about:blank");null==g?mxUtils.popup(a,!0):(g.document.write(mxUtils.htmlEntities(a, +!1)),g.document.close())}else this.openInNewWindow(a,c,d);else e==App.MODE_DEVICE?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(e,mxUtils.bind(this,function(g){try{this.exportFile(a,b,c,d,e,g)}catch(F){this.handleError(F)}}))}catch(z){this.handleError(z)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,f,h,null,null,4<e?3:4,a,c,d);this.showDialog(b.container,420,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()}; +EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a, +!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div"); +var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left= +d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=d.zIndex;var e=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});e.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){e.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height= +"auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null, +this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,e){this.isLocalFileSave()?this.saveLocalFile(c,a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,g){return this.createEchoRequest(c,a,d,e,b,g)}),c, +e,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,e,f,h){h=null!=h?h:!mxClient.IS_IOS||!navigator.standalone;var g=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,e){if("_blank"==e||null!=a&&0<a.length){var g=c("_blank"==e?null:a,e==App.MODE_DEVICE||null==e||"_blank"==e?"0":"1");null!=g&&(e==App.MODE_DEVICE||"_blank"==e?g.simulate(document,"_blank"):this.pickFolder(e,mxUtils.bind(this,function(c){f=null!=f?f:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d, +a,f,!0,e,c)}catch(C){this.handleError(C)}else this.spinner.spin(document.body,mxResources.get("saving"))&&g.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=g.getStatus()&&299>=g.getStatus())try{this.exportFile(g.getText(),a,f,!0,e,c)}catch(C){this.handleError(C)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"), +!1,!1,h,null,null,4<g?3:4,d,f,e);this.showDialog(a.container,380,g==(mxClient.IS_IOS?0:1)?160:4<g?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,f){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,f,h,l,m){if(this.spinner.spin(document.body,mxResources.get("export"))){var g=this.editor.graph.isSelectionEmpty();c=null!=c?c:g;g=b?null:this.editor.graph.background; +g==mxConstants.NONE&&(g=null);null==g&&0==b&&(g="#ffffff");var k=this.editor.graph.getSvg(g,a,h,l,null,c);d&&this.editor.graph.addSvgShadow(k);var n=this.getBaseFilename()+".svg",q=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,m));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b, +this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var d='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||d.length<=MAX_REQUEST_SIZE?this.saveData(n,"svg",d,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(d)}))});this.convertMath(this.editor.graph,k,!1,mxUtils.bind(this,function(){f?(null== +this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(k,q,this.thumbImageCache)):q(k)}))}};EditorUi.prototype.addCheckbox=function(a,b,c,d,e,f){f=null!=f?f:!0;var g=document.createElement("input");g.style.marginRight="8px";g.style.marginTop="16px";g.setAttribute("type","checkbox");c&&(g.setAttribute("checked","checked"),g.defaultChecked=!0);d&&g.setAttribute("disabled","disabled");f&&(a.appendChild(g),mxUtils.write(a,b),e||mxUtils.br(a));return g};EditorUi.prototype.addEditButton=function(a, +b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),e="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(e=window.location.href);var g=document.createElement("select");g.style.width="120px";g.style.marginLeft="8px";g.style.marginRight="10px";g.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));g.appendChild(d);d=document.createElement("option"); +d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");g.appendChild(d);a.appendChild(g);mxEvent.addListener(g,"change",mxUtils.bind(this,function(){if("custom"==g.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:g.value="blank"},mxResources.get("url"),null,null,null,null,function(){g.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b|| +b.checked)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===g.value?"_blank":e:null},getEditInput:function(){return c},getEditSelect:function(){return g}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=g&&g!=mxConstants.NONE?"border:1px solid black;background-color:"+g:"background-position:center center;background-repeat:no-repeat;background-image:url('"+ +Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var e=document.createElement("option");e.setAttribute("value","auto");mxUtils.write(e,mxResources.get("automatic"));d.appendChild(e);e=document.createElement("option");e.setAttribute("value","blank");mxUtils.write(e,mxResources.get("openInNewWindow"));d.appendChild(e);e=document.createElement("option"); +e.setAttribute("value","self");mxUtils.write(e,mxResources.get("openInThisWindow"));d.appendChild(e);b&&(e=document.createElement("option"),e.setAttribute("value","frame"),mxUtils.write(e,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(e));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var g="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(g||"none",function(a){g=a;c()});mxEvent.consume(a)}));c();k.style.padding= +mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return g},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,e,f,h,l){var g=this.getCurrentFile(),k=[];d&&(k.push("lightbox=1"),"auto"!=a&&k.push("target="+ +a),null!=b&&b!=mxConstants.NONE&&k.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&k.push("edit="+encodeURIComponent(e)),f&&k.push("layers=1"),this.editor.graph.foldingEnabled&&k.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&k.push("page="+a);break}a=!0;null!=h?c="#U"+encodeURIComponent(h):(g=this.getCurrentFile(),l||null==g||g.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c? +this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+g.getHash(),a=!1));a&&null!=g&&null!=g.getTitle()&&g.getTitle()!=this.defaultFilename&&k.push("title="+encodeURIComponent(g.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<k.length?"?"+k.join("&"):"")+c};EditorUi.prototype.createHtml=function(a, +b,c,d,e,f,h,l,m,t,z){this.getBasenames();var g={};""!=e&&e!=mxConstants.NONE&&(g.highlight=e);"auto"!==d&&(g.target=d);m||(g.lightbox=!1);g.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(g.zoom=c/100);c=[];h&&(c.push("pages"),g.resize=!0,null!=this.pages&&null!=this.currentPage&&(g.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),g.resize=!0);l&&c.push("layers");0<c.length&&(m&&c.push("lightbox"),g.toolbar=c.join(" "));null!=t&&0<t.length&&(g.edit=t);null!= +a?g.url=a:g.xml=this.getFileData(!0,null,null,null,null,!h);b='<div class="mxgraph" style="'+(f?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(g))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";z(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+ +'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("html"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(g);var k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var f=document.createElement("input");f.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;"; +f.setAttribute("value","url");f.setAttribute("type","radio");f.setAttribute("name","type-embedhtmldialog");g=f.cloneNode(!0);g.setAttribute("value","copy");k.appendChild(g);var n=document.createElement("span");mxUtils.write(n,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(n);mxUtils.br(k);k.appendChild(f);n=document.createElement("span");mxUtils.write(n,mxResources.get("publicDiagramUrl"));k.appendChild(n);var h=this.getCurrentFile();null==c&&null!=h&&h.constructor==window.DriveFile&&(n= +document.createElement("a"),n.style.paddingLeft="12px",n.style.color="gray",n.setAttribute("href","javascript:void(0);"),mxUtils.write(n,mxResources.get("share")),k.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(h.getId())})));g.setAttribute("checked","checked");null==c&&f.setAttribute("disabled","disabled");e.appendChild(k);var l=this.addLinkSection(e),m=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e, +":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value="100%";e.appendChild(q);var v=this.addCheckbox(e,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,G=G=this.addCheckbox(e,mxResources.get("allPages"),k,!k),D=this.addCheckbox(e,mxResources.get("layers"),!0),E=this.addCheckbox(e,mxResources.get("lightbox"),!0),H=this.addEditButton(e,E),A=H.getEditInput(); +A.style.marginBottom="16px";mxEvent.addListener(E,"change",function(){E.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled");A.checked&&E.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(f.checked?c:null,m.checked,q.value,l.getTarget(),l.getColor(),v.checked,G.checked,D.checked,E.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);g.focus()}; +EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,f){var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=document.createElement("h3");mxUtils.write(k,a||mxResources.get("link"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";g.appendChild(k);var n=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=n&&n.constructor==window.DriveFile&&!b){a=80;var k="https://desk.draw.io/support/solutions/articles/16000039384", +h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var l=document.createElement("div");l.style.whiteSpace="normal";mxUtils.write(l,mxResources.get("linkAccountRequired"));h.appendChild(l);l=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(n.getId())}));l.style.marginTop="12px";l.className="geBtn";h.appendChild(l);g.appendChild(h);l=document.createElement("a"); +l.style.paddingLeft="12px";l.style.color="gray";l.style.fontSize="11px";l.setAttribute("href","javascript:void(0);");mxUtils.write(l,mxResources.get("check"));h.appendChild(l);mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok")); +this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,q=null;if(null!=c||null!=d)a+=30,mxUtils.write(g,mxResources.get("width")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",g.appendChild(m),mxUtils.write(g,mxResources.get("height")+":"),q=document.createElement("input"),q.setAttribute("type","text"),q.style.width="50px", +q.style.marginLeft="6px",q.style.marginBottom="10px",q.value=d+"px",g.appendChild(q),mxUtils.br(g);var p=this.addLinkSection(g,f);c=null!=this.pages&&1<this.pages.length;var u=null;if(null==n||n.constructor!=window.DriveFile||b)u=this.addCheckbox(g,mxResources.get("allPages"),c,!c);var D=this.addCheckbox(g,mxResources.get("lightbox"),!0),E=this.addEditButton(g,D),H=E.getEditInput(),A=this.addCheckbox(g,mxResources.get("layers"),!0);A.style.marginLeft=H.style.marginLeft;A.style.marginBottom="16px"; +A.style.marginTop="8px";mxEvent.addListener(D,"change",function(){D.checked?(A.removeAttribute("disabled"),H.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&D.checked?E.getEditSelect().removeAttribute("disabled"):E.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){e(p.getTarget(),p.getColor(),null==u?!0:u.checked,D.checked,E.getLink(),A.checked,null!=m?m.value:null,null!= +q?q.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,254+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):p.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("image"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px"; +e.appendChild(g);var k=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),f=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),!0);null!=f&&(f.style.marginBottom="16px");a=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!k.checked,null!=f?f.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,f,h,l){h=null!=h?h:!0;var g=document.createElement("div");g.style.whiteSpace= +"nowrap";var k=this.editor.graph,n="jpeg"==l?196:300,m=document.createElement("h3");mxUtils.write(m,a);m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";g.appendChild(m);mxUtils.write(g,mxResources.get("zoom")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value=this.lastExportZoom||"100%";g.appendChild(q);mxUtils.write(g,mxResources.get("borderWidth")+ +":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.value=this.lastExportBorder||"0";g.appendChild(p);mxUtils.br(g);var u=this.addCheckbox(g,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background,null,null,"jpeg"!=l),w=this.addCheckbox(g,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),x=document.createElement("input");x.style.marginTop="16px";x.style.marginRight= +"8px";x.style.marginLeft="24px";x.setAttribute("disabled","disabled");x.setAttribute("type","checkbox");f&&(g.appendChild(x),mxUtils.write(g,mxResources.get("crop")),mxUtils.br(g),n+=26,mxEvent.addListener(w,"change",function(){w.checked?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(x.setAttribute("checked","checked"),x.defaultChecked=!0);var H=this.addCheckbox(g,mxResources.get("shadow"),k.shadowVisible),A=document.createElement("input");A.style.marginTop= +"16px";A.style.marginRight="8px";A.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||A.setAttribute("disabled","disabled");b&&(g.appendChild(A),mxUtils.write(g,mxResources.get("embedImages")),mxUtils.br(g),n+=26);var K=this.addCheckbox(g,mxResources.get("includeCopyOfMyDiagram"),h,null,null,"jpeg"!=l),B=null!=this.pages&&1<this.pages.length,L=this.addCheckbox(g,B?mxResources.get("allPages"):"",B,!B,null,"jpeg"!=l);L.style.marginLeft="24px";L.style.marginBottom="16px";B||(L.style.visibility= +"hidden");mxEvent.addListener(K,"change",function(){K.checked&&B?L.removeAttribute("disabled"):L.setAttribute("disabled","disabled")});h&&B||L.setAttribute("disabled","disabled");a=new CustomDialog(this,g,mxUtils.bind(this,function(){this.lastExportBorder=p.value;this.lastExportZoom=q.value;e(q.value,u.checked,!w.checked,H.checked,K.checked,A.checked,p.value,x.checked,!L.checked)}),null,c,d);this.showDialog(a.container,340,n,!0,!0);q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode|| +mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,e){var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=this.editor.graph;if(null!=b){var f=document.createElement("h3");mxUtils.write(f,b);f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";g.appendChild(f)}var n=this.addCheckbox(g,mxResources.get("fit"),!0),h=this.addCheckbox(g,mxResources.get("shadow"),k.shadowVisible&&d, +!d),l=this.addCheckbox(g,c),m=this.addCheckbox(g,mxResources.get("lightbox"),!0),q=this.addEditButton(g,m),u=q.getEditInput(),G=1<k.model.getChildCount(k.model.getRoot()),D=this.addCheckbox(g,mxResources.get("layers"),G,!G);D.style.marginLeft=u.style.marginLeft;D.style.marginBottom="12px";D.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(G&&D.removeAttribute("disabled"),u.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled")); +u.checked&&m.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){a(n.checked,h.checked,l.checked,m.checked,q.getLink(),D.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,e,f,h,l){function g(b){var g=" ",n="";d&&(g=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ (e?"&edit=_blank":"")+(f?"&layers=1":"")+"');}})(this);\"",n+="cursor:pointer;");a&&(n+="max-width:100%;");var t="";c&&(t=' width="'+Math.round(k.width)+'" height="'+Math.round(k.height)+'"');h('<img src="'+b+'"'+t+(""!=n?' style="'+n+'"':"")+g+"/>")}var k=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");g(a)}),null,null,null,mxUtils.bind(this,function(a){l({message:mxResources.get("unknownError")})}), null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),k.width*k.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var n="";c&&(n="&w="+Math.round(2*k.width)+"&h="+Math.round(2*k.height));var m=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+n+"&xml="+encodeURIComponent(b));m.send(mxUtils.bind(this,function(){200<=m.getStatus()&&299>=m.getStatus()?g("data:image/png;base64,"+m.getText()):l({message:mxResources.get("unknownError")})}))}else l({message:mxResources.get("drawingTooLarge")})}; EditorUi.prototype.createEmbedSvg=function(a,b,c,d,e,f,h){var g=this.editor.graph.getSvg(),k=g.getElementsByTagName("a");if(null!=k)for(var n=0;n<k.length;n++){var l=k[n].getAttribute("href");null!=l&&"#"==l.charAt(0)&&"_blank"==k[n].getAttribute("target")&&k[n].removeAttribute("target")}d&&g.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(g);if(c){var m=" ",q="";d&&(m="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ @@ -6985,150 +6986,151 @@ EditorUi.prototype.createEmbedSvg=function(a,b,c,d,e,f,h){var g=this.editor.grap (e?"&edit=_blank":"")+(f?"&layers=1":"")+"');}}})(this);"),q+="cursor:pointer;"),a&&(a=parseInt(g.getAttribute("width")),b=parseInt(g.getAttribute("height")),g.setAttribute("viewBox","0 0 "+a+" "+b),q+="max-width:100%;max-height:"+b+"px;",g.removeAttribute("height")),""!=q&&g.setAttribute("style",q),h(mxUtils.getXml(g))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxResources.get("years");b=Math.floor(a/2592E3);if(1<b)return b+ " "+mxResources.get("months");b=Math.floor(a/86400);if(1<b)return b+" "+mxResources.get("days");b=Math.floor(a/3600);if(1<b)return b+" "+mxResources.get("hours");b=Math.floor(a/60);return 1<b?b+" "+mxResources.get("minutes"):1==b?b+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,c,d){d()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var d=a.getElementsByTagName("diagram");if(0< d.length){var c=d[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:e.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(p){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,c){var d=this.editor.graph, -e=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),d),e=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),g=d.getGlobalVariable,f=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:g.apply(this,arguments)};document.body.appendChild(d.container); -d.model.setRoot(f.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==e&&(e=this.getFileData(!0));var g=c.toDataURL("image/png"),g=this.writeGraphModelToPng(g,"zTXt","mxGraphModel",atob(this.editor.graph.compress(e)));a(g.substring(g.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(t){null!=b&&b(t)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)};EditorUi.prototype.getEmbeddedSvg= +e=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),d),e=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),g=d.getGlobalVariable,k=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:g.apply(this,arguments)};document.body.appendChild(d.container); +d.model.setRoot(k.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==e&&(e=this.getFileData(!0));var g=c.toDataURL("image/png"),g=this.writeGraphModelToPng(g,"zTXt","mxGraphModel",atob(this.editor.graph.compress(e)));a(g.substring(g.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(t){null!=b&&b(t)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)};EditorUi.prototype.getEmbeddedSvg= function(a,b,c,d,e,f,h){h=b.background;h==mxConstants.NONE&&(h=null);b=b.getSvg(h,null,null,null,null,f);null!=a&&b.setAttribute("content",a);null!=c&&b.setAttribute("resource",c);if(null!=e)this.convertImages(b,mxUtils.bind(this,function(a){e((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+ mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,d,e,f,h,l,m){m=null!=m?m:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var g=this.editor.graph.isSelectionEmpty();c=null!=c?c:g;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,l):null,m)}catch(F){"Invalid image"==F.message?this.downloadFile(m):this.handleError(F)}}),null, this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,f,h)}catch(z){this.spinner.stop(),this.handleError(z)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,e={},g=mxUtils.bind(this,function(){if(0==d){for(var g=[c[0]],f=1;f<c.length;f++){var k= c[f].indexOf(")");g.push('url("');g.push(e[b(c[f].substring(0,k))]);g.push('"'+c[f].substring(k))}this.editor.resolvedFontCss=g.join("");a()}});if(0<c.length)for(var f=1;f<c.length;f++){var h=c[f].indexOf(")"),l=null,t=c[f].indexOf("format(",h);0<t&&(l=b(c[f].substring(t+7,c[f].indexOf(")",t))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var b="application/x-font-ttf";if("svg"==l||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==l||"embedded-opentype"==l||/(\.otf)($|\?)/i.test(a))b= "application/x-font-opentype";else if("woff"==l||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==l||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==l||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==l||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=a;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){e[a]=b;d--;g()}),mxUtils.bind(this, function(a){d--;g()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[f].substring(0,h)),l)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,f,h,l,m,t,z,F,C,v){f=null!=f?f:!0;F=null!=F?F:this.editor.graph;C=null!=C?C:0;var g=m?null:F.background;g==mxConstants.NONE&&(g=null);null==g&&(g=d);null==g&&0==m&&(g=this.editor.graph.defaultPageBackgroundColor);this.convertImages(F.getSvg(g,null,null,v,null,null!=h?h:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this, -function(){try{var k=document.createElement("canvas"),h=parseInt(c.getAttribute("width")),n=parseInt(c.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=f?Math.min(1,Math.min(3*b/(4*n),b/h)):b/h);h=Math.ceil(l*h)+2*C;n=Math.ceil(l*n)+2*C;k.setAttribute("width",h);k.setAttribute("height",n);var t=k.getContext("2d");null!=g&&(t.beginPath(),t.rect(0,0,h,n),t.fillStyle=g,t.fill());t.scale(l,l);t.drawImage(d,C/l,C/l);a(k)}catch(O){null!=e&&e(O)}});d.onerror=function(a){null!=e&&e(a)};try{t&&this.editor.graph.addSvgShadow(c); +function(){try{var k=document.createElement("canvas"),n=parseInt(c.getAttribute("width")),h=parseInt(c.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=f?Math.min(1,Math.min(3*b/(4*h),b/n)):b/n);n=Math.ceil(l*n)+2*C;h=Math.ceil(l*h)+2*C;k.setAttribute("width",n);k.setAttribute("height",h);var t=k.getContext("2d");null!=g&&(t.beginPath(),t.rect(0,0,n,h),t.fillStyle=g,t.fill());t.scale(l,l);t.drawImage(d,C/l,C/l);a(k)}catch(O){null!=e&&e(O)}});d.onerror=function(a){null!=e&&e(a)};try{t&&this.editor.graph.addSvgShadow(c); var k=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(F,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(k)}catch(A){null!=e&&e(A)}}),c,z)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert, c=this;a.convert=function(d){if(null!=d){var e="http://"==d.substring(0,7)||"https://"==d.substring(0,8);e&&!navigator.onLine?d=c.svgBrokenImage.src:!e||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.isCorsEnabledForUrl(d)?"chrome-extension://"!=d.substring(0,19)&&(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var e=0,g=c||{};c=mxUtils.bind(this, -function(c,f){for(var k=a.getElementsByTagName(c),h=0;h<k.length;h++)mxUtils.bind(this,function(c){var k=d.convert(c.getAttribute(f));if(null!=k&&"data:"!=k.substring(0,5)){var h=g[k];null==h?(e++,this.convertImageToDataUri(k,function(d){null!=d&&(g[k]=d,c.setAttribute(f,d));e--;0==e&&b(a)})):c.setAttribute(f,h)}else null!=k&&c.setAttribute(f,k)})(k[h])});c("image","xlink:href");c("img","src");0==e&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,f){try{var g=d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)|| +function(c,f){for(var k=a.getElementsByTagName(c),n=0;n<k.length;n++)mxUtils.bind(this,function(c){var k=d.convert(c.getAttribute(f));if(null!=k&&"data:"!=k.substring(0,5)){var n=g[k];null==n?(e++,this.convertImageToDataUri(k,function(d){null!=d&&(g[k]=d,c.setAttribute(f,d));e--;0==e&&b(a)})):c.setAttribute(f,n)}else null!=k&&c.setAttribute(f,k)})(k[n])});c("image","xlink:href");c("img","src");0==e&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,f){try{var g=d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)|| /(\.gif)($|\?)/i.test(a);e=null!=e?e:!0;var k=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var d=a.getText();if(g){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);d=d.join("")}f=null!=f?f:"data:image/png;base64,";d=f+this.base64Encode(d)}b(d)}}else null!= c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},g,this.timeout,function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:k})})});k()}catch(y){null!=c&&c(y)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0, 23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var c=new Image,d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),e=a.getContext("2d"); a.height=c.height;a.width=c.width;e.drawImage(c,0,0);try{b(a.toDataURL())}catch(w){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!=b?b:0;c=null!=c?c:0;var g=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var k=mxUtils.parseXml(a),h=this.editor.extractGraphModel(k.documentElement,null!=this.pages);if(null!=h&&"mxfile"==h.nodeName&&null!=this.pages){var n=h.getElementsByTagName("diagram");if(1==n.length)h= mxUtils.parseXml(f.decompress(mxUtils.getTextContent(n[0]))).documentElement;else if(1<n.length){f.model.beginUpdate();try{for(a=0;a<n.length;a++){var l=this.updatePageRoot(new DiagramPage(n[a])),m=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[m+1]));f.model.execute(new ChangePage(this,l,l,m))}}finally{f.model.endUpdate()}}}null!=h&&"mxGraphModel"===h.nodeName&&(g=f.importGraphModel(h,b,c,d))}}catch(C){throw e||this.handleError(C,mxResources.get("invalidOrMissingFile")), -C;}return g};EditorUi.prototype.importVisio=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)try{this.doImportVisio(a,b,c)}catch(u){c(u)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!== -typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(k){this.handleError(k)}});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,c,d,e){var g=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,c,d,e)}catch(w){this.handleError(w)}finally{null!=e&&e()}});this.pasteLucidChart||this.loadingExtensions|| -this.isOffline()?window.setTimeout(g,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",g):mxscript("js/extensions.min.js",g))};EditorUi.prototype.insertLucidChart=function(a,b,c,d,e){e=JSON.parse(a);a=[];if(null!=e.state){e=JSON.parse(e.state);for(var g in e.Pages)a.push(e.Pages[g]);a.sort(function(a,b){return a.Properties.Order<b.Properties.Order?-1:a.Properties.Order>b.Properties.Order?1:0})}else a.push(e);if(0<a.length){this.editor.graph.getModel().beginUpdate(); -try{if(this.pasteLucidChart(a[0],b,c,d),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=function(a,b,c,d,e,f,h){f=null!=f?f:!0;h=null!=h?h:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this, -function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(e||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var g=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var k=this.extractGraphModelFromPng(a),n=this.importXml(k,b,c,f,!0);if(0<n.length)return n}if("data:image/svg+xml;"==a.substring(0,19))try{if(k=null,"data:image/svg+xml;base64,"==a.substring(0, -26)?(k=a.substring(a.indexOf(",")+1),k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0)):k=decodeURIComponent(a.substring(a.indexOf(",")+1)),n=this.importXml(k,b,c,f,!0),0<n.length)return n}catch(z){}this.loadImage(a,mxUtils.bind(this,function(d){if("data:"==a.substring(0,5))this.resizeImage(d,a,mxUtils.bind(this,function(a,d,e){g.setSelectionCell(g.insertVertex(null,null,"",g.snap(b),g.snap(c),d,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ -this.convertDataUri(a)+";"))}),h,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/d.width,this.maxImageSize/d.height)),f=Math.round(d.width*e);d=Math.round(d.height*e);g.setSelectionCell(g.insertVertex(null,null,"",g.snap(b),g.snap(c),f,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var e=null;g.getModel().beginUpdate();try{e=g.insertVertex(g.getDefaultParent(), -null,a,g.snap(b),g.snap(c),1,1,"text;"+(d?"html=1;":"")),g.updateCellSize(e),g.fireEvent(new mxEventObject("textInserted","cells",[e]))}finally{g.getModel().endUpdate()}g.setSelectionCell(e)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,f);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,c,f);else{g=this.editor.graph;e=null;g.getModel().beginUpdate();try{e=g.insertVertex(g.getDefaultParent(), -null,"",g.snap(b),g.snap(c),1,1,"text;"+(d?"html=1;":"")),g.fireEvent(new mxEventObject("textInserted","cells",[e])),e.value=a,g.updateCellSize(e),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(e.value)&&g.setLinkForCell(e,e.value),e.geometry.width+=g.gridSize,e.geometry.height+=g.gridSize}finally{g.getModel().endUpdate()}return[e]}}return[]}; -EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importFile=function(a,b,c,d,e,f,h,l, -m,t,z){t=null!=t?t:!0;var g=!1,k=null,n=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,h)):b=this.importXml(a,c,d,t);null!=l&&l(b)});"image"==b.substring(0,5)?(m=!1,"image/png"==b.substring(0,9)&&(b=z?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,d,t),m=!0)),m||(k=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),t&&k.isGridEnabled()&&(c=k.snap(c), -d=k.snap(d)),k=[k.insertVertex(null,null,"",c,d,e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,c,d,t);null!=l&&l(a)})):null!=m&&null!=h&&(/(\.vsdx)($|\?)/i.test(h)||/(\.vssx)($|\?)/i.test(h))?(g=!0,this.importVisio(m,n)):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(a,h)?(g=!0,this.parseFile(null!=m?m:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?n(a.responseText):null!=l&&l(null))}),h)):/(\.vsd)($|\?)/i.test(h)||(k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,t));g||null==l||l(k);return k};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,g,f;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}g=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);b+="=";break}f=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(f&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,f,h,l,m,t,z,F){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;t=null!=t?t:this.maxImageBytes;var g=null!=b&&null!=c,k=!0,n=!1;if(!mxClient.IS_CHROMEAPP&& -null!=a)for(var q=z||this.resampleThreshold,p=0;p<a.length;p++)if("image/"==a[p].type.substring(0,6)&&a[p].size>q){n=!0;break}var u=mxUtils.bind(this,function(){var n=this.editor.graph,m=n.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,f,k,h,n){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,d,e,f,k,h,n,g,F)});f=null!=f?f:mxUtils.bind(this,function(a){n.setSelectionCells(a)});if(this.spinner.spin(document.body, -mxResources.get("loading")))for(var q=a.length,p=q,u=[],v=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--p){this.spinner.stop();if(null!=l)l(u);else{var c=[];n.getModel().beginUpdate();try{for(var d=0;d<u.length;d++){var e=u[d]();null!=e&&(c=c.concat(e))}}finally{n.getModel().endUpdate()}}f(c)}}),w=0;w<q;w++)mxUtils.bind(this,function(g){var f=a[g],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==h||h(f))if("image/"==f.type.substring(0,6))if("image/svg"==f.type.substring(0,9)){var l= -a.target.result,q=l.indexOf(","),p=decodeURIComponent(escape(atob(l.substring(q+1)))),u=mxUtils.parseXml(p),p=u.getElementsByTagName("svg");if(0<p.length){var p=p[0],A=F?null:p.getAttribute("content");null!=A&&"<"!=A.charAt(0)&&"%"!=A.charAt(0)&&(A=unescape(window.atob?atob(A):Base64.decode(A,!0)));null!=A&&"%"==A.charAt(0)&&(A=decodeURIComponent(A));null==A||"<mxfile "!==A.substring(0,8)&&"<mxGraphModel "!==A.substring(0,14)?v(g,mxUtils.bind(this,function(){try{if(l.substring(0,q+1),null!=u){var a= -u.getElementsByTagName("svg");if(0<a.length){var h=a[0],t=parseFloat(h.getAttribute("width")),p=parseFloat(h.getAttribute("height")),z=h.getAttribute("viewBox");if(null==z||0==z.length)h.setAttribute("viewBox","0 0 "+t+" "+p);else if(isNaN(t)||isNaN(p)){var A=z.split(" ");3<A.length&&(t=parseFloat(A[2]),p=parseFloat(A[3]))}l=this.createSvgDataUri(mxUtils.getXml(h));var v=Math.min(1,Math.min(d/Math.max(1,t)),d/Math.max(1,p)),B=e(l,f.type,b+g*m,c+g*m,Math.max(1,Math.round(t*v)),Math.max(1,Math.round(p* -v)),f.name,k);if(isNaN(t)||isNaN(p)){var w=new Image;w.onload=mxUtils.bind(this,function(){t=Math.max(1,w.width);p=Math.max(1,w.height);B[0].geometry.width=t;B[0].geometry.height=p;h.setAttribute("viewBox","0 0 "+t+" "+p);l=this.createSvgDataUri(mxUtils.getXml(h));var a=l.indexOf(";");0<a&&(l=l.substring(0,a)+l.substring(l.indexOf(",",a+1)));n.setCellStyles("image",l,[B[0]])});w.src=this.createSvgDataUri(mxUtils.getXml(h))}return B}}}catch(ba){}return null})):v(g,mxUtils.bind(this,function(){return e(A, -"text/xml",b+g*m,c+g*m,0,0,f.name)}))}}else{p=!1;if("image/png"==f.type){var B=F?null:this.extractGraphModelFromPng(a.target.result);if(null!=B&&0<B.length){var w=new Image;w.src=a.target.result;v(g,mxUtils.bind(this,function(){return e(B,"text/xml",b+g*m,c+g*m,w.width,w.height,f.name)}));p=!0}}p||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"), -mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,n,l){v(g,mxUtils.bind(this,function(){if(null!=h&&h.length<t){var q=k&&this.isResampleImage(a.target.result,z)?Math.min(1,Math.min(d/n,d/l)):1;return e(h,f.type,b+g*m,c+g*m,Math.round(n*q),Math.round(l*q),f.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,d,z)}),mxUtils.bind(this, -function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,f.type,b+g*m,c+g*m,240,160,f.name,function(a){v(g,function(){return a})})});/(\.vsdx)($|\?)/i.test(f.name)||/(\.vssx)($|\?)/i.test(f.name)?e(null,f.type,b+g*m,c+g*m,240,160,f.name,function(a){v(g,function(){return a})},f):"image"==f.type.substring(0,5)?l.readAsDataURL(f):l.readAsText(f)})(w)});n?this.confirmImageResize(function(a){k=a;u()},m):u()};EditorUi.prototype.confirmImageResize=function(a, -b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+ -'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length> -b};EditorUi.prototype.resizeImage=function(a,b,c,d,e,f){e=null!=e?e:this.maxImageSize;var g=Math.max(1,a.width),k=Math.max(1,a.height);if(d&&this.isResampleImage(b,f))try{var h=Math.max(g/e,k/e);if(1<h){var l=Math.round(g/h),n=Math.round(k/h),m=document.createElement("canvas");m.width=l;m.height=n;m.getContext("2d").drawImage(a,0,0,l,n);var q=m.toDataURL();if(q.length<b.length){var p=document.createElement("canvas");p.width=l;p.height=n;var u=p.toDataURL();q!==u&&(b=q,g=l,k=n)}}}catch(D){}c(b,g,k)}; -EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var c=d,e=0;8>e;e++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[d]=c;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e<d;e++)a=EditorUi.prototype.crcTable[(a^b[c+e])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function g(a,b){var c=h;h+=b;return a.substring(c,h)}function f(a){a=g(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function k(a){return String.fromCharCode(a>> -24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var h=0;if(g(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(g(a,4),"IHDR"!=g(a,4))null!=e&&e();else{g(a,17);e=a.substring(0,h);do{var l=f(a);if("IDAT"==g(a,4)){e=a.substring(0,h-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,b,0,4);d=this.updateCRC(d,c,0,c.length);e+=k(c.length)+b+c+k(d^4294967295); -e+=a.substring(h-8,a.length);break}e+=a.substring(h-8,h-4+l);g(a,l);g(a,4)}while(l);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+ -2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(u){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var f=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c= -a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,c=this.editor.graph;c.addListener("pageLinkClicked",function(b,c){a(c.getProperty("href"))});this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var d=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!= -a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,arguments)};var e=c.addClickHandler;c.addClickHandler=function(b,d,g){var f=d;d=function(b,d){if(null==d){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(d=e.getAttribute("href"))}null==d||!c.isPageLink(d)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)|| -(a(d),mxEvent.consume(b));null!=f&&f(b,d)};e.call(this,b,d,g)};f.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=c.getGlobalVariable;c.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a? -null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,arguments)};var l=c.createLinkForHint;c.createLinkForHint=function(d,e){var g=c.isPageLink(d);if(g){var f=d.indexOf(",");0<f&&(f=b.getPageById(d.substring(f+1)),e=null!=f?f.getName():mxResources.get("pageNotFound"))}f=l.call(this,d,e);g&&mxEvent.addListener(f,"click",function(b){a(d);mxEvent.consume(b)});return f};var m=c.labelLinkClicked;c.labelLinkClicked=function(b,d,e){var g=d.getAttribute("href");if(null== -g||!c.isPageLink(g)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e))m.apply(this,arguments);else{if(!c.isEnabled()||null!=b&&c.isCellLocked(b.cell))a(g),c.getRubberband().reset();mxEvent.consume(e)}};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var y=this.actions.get("print");y.setEnabled(!mxClient.IS_IOS||!navigator.standalone);y.visible=y.isEnabled();if(!this.editor.chromeless||this.editor.editable){var t= -function(){window.setTimeout(function(){z.innerHTML=" ";z.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||c.container.addEventListener("paste", -mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var g=c.items;for(index in g){var f=g[index];if("file"===f.kind){if(b.isEditing())this.importFiles([f.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,g,f){b.insertImage(a,g,f)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()}); -else{var k=this.editor.graph.getInsertPoint();this.importFiles([f.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(N){}}),!1);var z=document.createElement("div");z.style.position="absolute";z.style.whiteSpace="nowrap";z.style.overflow="hidden";z.style.display="block";z.contentEditable=!0;mxUtils.setOpacity(z,0);z.style.width="1px";z.style.height="1px";z.innerHTML=" ";var F=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86, -null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==c.container||!c.isEnabled()||c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||F||(z.style.left=c.container.scrollLeft+10+"px",z.style.top=c.container.scrollTop+10+"px",c.container.appendChild(z),F=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){z.focus();document.execCommand("selectAll", -!1,null)},0):(z.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!F||224!=b&&17!=b&&91!=b||(F=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),z.parentNode.removeChild(z))}),0)}));mxEvent.addListener(z,"copy",mxUtils.bind(this,function(a){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(z),t())}));mxEvent.addListener(z,"cut",mxUtils.bind(this, -function(a){c.isEnabled()&&(this.copyCells(z,!0),t())}));mxEvent.addListener(z,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(z.innerHTML=" ",z.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,z);z.innerHTML=" "}),0))}),!0);var C=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==z?!0:C.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight|| -0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation(); -a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,g,f){b.insertImage(a,g,f)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list"); -/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types, -"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){y=document.createElement("div");y.style.position="absolute";y.style.top="95px";y.style.left="250px";y.style.width="2000px";y.style.height="30px";y.style.background="whiteSmoke";document.body.appendChild(y);var v=document.createElement("div");v.style.position="absolute";v.style.top="125px";v.style.left="220px"; -v.style.width="30px";v.style.height="1000px";v.style.background="whiteSmoke";document.body.appendChild(v);var G=document.createElement("div");G.style.position="absolute";G.style.top="95px";G.style.left="220px";G.style.width="30px";G.style.height="30px";G.style.background="whiteSmoke";document.body.appendChild(G);this.vRuler=new mxRuler(this.editor.graph,v,!0);this.hRuler=new mxRuler(this.editor.graph,y,!1)}if("1"==urlParams.test){y=document.getElementById("geFooter");null!=y&&(this.styleInput=document.createElement("input"), -this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),y.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE, -mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var D=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:D.apply(this,arguments)}}y=document.getElementById("geInfo");null!=y&&y.parentNode.removeChild(y);if(Graph.fileSupport&& -(!this.editor.chromeless||this.editor.editable)){var E=null;mxEvent.addListener(c.container,"dragleave",function(a){c.isEnabled()&&(null!=E&&(E.parentNode.removeChild(E),E=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(a){null==E&&(!mxClient.IS_IE||10<document.documentMode)&&(E=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c.container, -"drop",mxUtils.bind(this,function(a){null!=E&&(E.parentNode.removeChild(E),E=null);if(c.isEnabled()){var b=mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=c.view.translate,e=c.view.scale,g=b.x/e-d.x,f=b.y/e-d.y;mxEvent.isAltDown(a)&&(f=g=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,g,f,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var k=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")? -a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=b)c.setSelectionCells(this.importXml(b,g,f,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var h=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=h;var l=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(h=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)||(l=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&& -(h=b[0].getAttribute("href")));var t=!0,m=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(h,g,f,!0,l,null,t))});l&&h.length>this.resampleThreshold?this.confirmImageResize(function(a){t=a;m()},mxEvent.isControlDown(a)):m()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,b)),d/Math.max(1,a));c.setSelectionCell(c.insertVertex(null, -null,"",g,f,b*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+k+";"))}),mxUtils.bind(this,function(a){c.setSelectionCells(this.insertTextAt(k,g,f,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),g,f,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()}; -EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged", -mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat= -mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave); -mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph; -if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"=== -c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),g=!1;try{var f=e.lastIndexOf("%3E");0<=f&&f<e.length-3&&(e=e.substring(0,f+3))}catch(y){}try{var c=b.getElementsByTagName("span"),h=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e); -this.isCompatibleString(h)&&(g=!0,e=h)}catch(y){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(g||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(g=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,g.x+c,g.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&& -this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(y){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&& -12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0); -else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))): -0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash= -"#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var g=document.documentElement;d=(e.clientWidth||g.clientWidth)-3;e=Math.max(e.clientHeight||0,g.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth, -e=a.clientHeight;g=document.createElement("div");g.style.zIndex=mxPopupMenu.prototype.zIndex+2;g.style.border="3px dotted rgb(254, 137, 12)";g.style.pointerEvents="none";g.style.position="absolute";g.style.top=b+"px";g.style.left=c+"px";g.style.width=Math.max(0,d-3)+"px";g.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(g):document.body.appendChild(g);return g};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a); -var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!= -e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var g=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(z){this.handleError(z,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a, -e,b)});if(/(\.vsdx)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();g(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?g(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})); -else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this, -c.target.result,a.name))}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,e,b)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(), -e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,c))});null!=a&&0<a.length&&(null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"), -null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root, -a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,e=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW]))); -for(var e=d.model.getChildCount(a),g=0;g<e;g++)this.addBasenamesForCell(d.model.getChildAt(a,g),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden")}; -EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()): -(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))}; -EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,f=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))): -this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,f);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function h(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(L){}return a}if(f.source== -(window.opener||window.parent)){var k=f.data;if("json"==urlParams.proto){try{k=JSON.parse(k)}catch(B){k=null}if(null==k)return;if("dialog"==k.action){this.showError(null!=k.titleKey?mxResources.get(k.titleKey):k.title,null!=k.messageKey?mxResources.get(k.messageKey):k.message,null!=k.buttonKey?mxResources.get(k.buttonKey):k.button);null!=k.modified&&(this.editor.modified=k.modified);return}if("prompt"==k.action){this.spinner.stop();var l=new FilenameDialog(this,k.defaultValue||"",null!=k.okKey?mxResources.get(k.okKey): -null,function(a){null!=a&&g.postMessage(JSON.stringify({event:"prompt",value:a,message:k}),"*")},null!=k.titleKey?mxResources.get(k.titleKey):k.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==k.action){l=null;l="data:image/png;base64,"==k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):h(k.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[k.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft", -result:"edit",message:k}),"*")}),mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"discard",message:k}),"*")}),k.editKey?mxResources.get(k.editKey):null,k.discardKey?mxResources.get(k.discardKey):null,k.ignore?mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()})); -try{l.init()}catch(B){g.postMessage(JSON.stringify({event:"draft",error:B.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();var l=1==k.enableRecent,m=1==k.enableSearch,l=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=k.callback?g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null, -null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=a;g.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,m?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;g.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){g.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"== -k.action)this.searchReadyCallback(k.list,k.errorMsg);else if("recentDocsList"==k.action)this.recentReadyCallback(k.list,k.errorMsg);else{if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))):null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message));null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var n=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body, -n):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var q=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,u=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=k.format;b.message=k;b.data=a;b.xml=encodeURIComponent(q); -g.postMessage(JSON.stringify(b),"*")}),w=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(q))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);u(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),x=p.getGlobalVariable,A=this.pages[0];p.getGlobalVariable=function(a){return"page"== -a?A.getName():"pagenumber"==a?1:x.apply(this,arguments)};document.body.appendChild(p.container);p.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,function(a){w(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){w(null)}),null,null,null,null,null,null,p)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(q)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()? -u("data:image/png;base64,"+a.getText()):w(null)}),mxUtils.bind(this,function(){w(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);n=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),n.xml=mxUtils.getXml(l),n.data=this.getFileData(null,null,!0,null,null,null,l),n.format=k.format;else if("html"==k.format)q=this.editor.getGraphXml(),n.data=this.getHtml(q,this.editor.graph), -n.xml=mxUtils.getXml(q),n.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);n.xml=this.getFileData(!0);n.format="svg";if(k.embedImages||null==k.embedImages){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==k.format?this.getEmbeddedSvg(n.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0); -this.spinner.stop();n.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(n),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(n),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));n.data=this.createSvgDataUri(l)}g.postMessage(JSON.stringify(n), -"*")}return}if("load"==k.action)d=1==k.autosave,this.hideDialog(),null!=k.modified&&null==urlParams.modified&&(urlParams.modified=k.modified),null!=k.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=k.saveAndExit),null!=k.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop= -"6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):null!=k.xml&&"data:image/png;base64,"==k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):k.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),"*");return}}}k=h(k);c=!0;try{a(k,f)}catch(B){this.handleError(B)}c=!1;null!=urlParams.modified&& -this.editor.setStatus("");var K=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=K();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=K();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged", -b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}})); -var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title", -mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding= -"4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b); -this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv= -function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,f=null,g="auto",h="auto",l=null,m=null,z=40,F=40,C=0,v=this.editor.graph;v.getGraphBounds();for(var G=function(){v.setSelectionCells(X);v.scrollCellToVisible(v.getSelectionCell())},D=v.getFreeInsertPoint(),E=D.x,H=D.y,D=H,A=null,K="auto",B=[],L=null,O=null,S=0;S<b.length&&"#"==b[S].charAt(0);){a=b[S];for(S++;S<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[S].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[S].substring(1)), -S++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var N=mxUtils.trim(a.substring(1,Y)),M=mxUtils.trim(a.substring(Y+1));"label"==N?A=v.sanitizeHtml(M):"style"==N?e=M:"identity"==N&&0<M.length&&"-"!=M?f=M:"width"==N?g=M:"height"==N?h=M:"left"==N&&0<M.length?l=M:"top"==N&&0<M.length?m=M:"ignore"==N?O=M.split(","):"connect"==N?B.push(JSON.parse(M)):"link"==N?L=M:"padding"==N?C=parseFloat(M):"edgespacing"==N?z=parseFloat(M):"nodespacing"==N?F=parseFloat(M):"layout"==N&&(K=M)}}}var W=this.editor.csvToArray(b[S]); -a=null;if(null!=f)for(var I=0;I<W.length;I++)if(f==W[I]){a=I;break}null==A&&(A="%"+W[0]+"%");if(null!=B)for(var Q=0;Q<B.length;Q++)null==d[B[Q].to]&&(d[B[Q].to]={});v.model.beginUpdate();try{for(I=S+1;I<b.length;I++){var Z=this.editor.csvToArray(b[I]);if(Z.length==W.length){var J=null,V=null!=a?Z[a]:null;null!=V&&(J=v.model.getCell(V));null==J&&(J=new mxCell(A,new mxGeometry(E,D,0,0),e||"whiteSpace=wrap;html=1;"),J.vertex=!0,J.id=V);for(var T=0;T<Z.length;T++)v.setAttributeForCell(J,W[T],Z[T]);v.setAttributeForCell(J, -"placeholders","1");J.style=v.replacePlaceholders(J,J.style);for(Q=0;Q<B.length;Q++)d[B[Q].to][J.getAttribute(B[Q].to)]=J;null!=L&&"link"!=L&&(v.setLinkForCell(J,J.getAttribute(L)),v.setAttributeForCell(J,L,null));v.fireEvent(new mxEventObject("cellsInserted","cells",[J]));var R=this.editor.graph.getPreferredSizeForCell(J);J.vertex&&(null!=l&&null!=J.getAttribute(l)&&(J.geometry.x=E+parseFloat(J.getAttribute(l))),null!=m&&null!=J.getAttribute(m)&&(J.geometry.y=H+parseFloat(J.getAttribute(m))),"@"== -g.charAt(0)&&null!=J.getAttribute(g.substring(1))?J.geometry.width=parseFloat(J.getAttribute(g.substring(1))):J.geometry.width="auto"==g?R.width+C:parseFloat(g),"@"==h.charAt(0)&&null!=J.getAttribute(h.substring(1))?J.geometry.height=parseFloat(J.getAttribute(h.substring(1))):J.geometry.height="auto"==h?R.height+C:parseFloat(h),D+=J.geometry.height+F);c.push(v.addCell(J))}}for(var U=c.slice(),X=c.slice(),Q=0;Q<B.length;Q++)for(var P=B[Q],I=0;I<c.length;I++){var J=c[I],ga=J.getAttribute(P.from);if(null!= -ga){v.setAttributeForCell(J,P.from,null);for(var ha=ga.split(","),T=0;T<ha.length;T++){var aa=d[P.to][ha[T]];null!=aa&&(A=P.label,null!=P.fromlabel&&(A=(J.getAttribute(P.fromlabel)||"")+(A||"")),null!=P.tolabel&&(A=(A||"")+(aa.getAttribute(P.tolabel)||"")),X.push(v.insertEdge(null,null,A||"",P.invert?aa:J,P.invert?J:aa,P.style||v.createCurrentEdgeStyle())),mxUtils.remove(P.invert?J:aa,U))}}}if(null!=O)for(I=0;I<c.length;I++)for(J=c[I],T=0;T<O.length;T++)v.setAttributeForCell(J,mxUtils.trim(O[T]), -null);var da=new mxParallelEdgeLayout(v);da.spacing=z;var ia=function(){da.execute(v.getDefaultParent());for(var a=0;a<c.length;a++){var b=v.getCellGeometry(c[a]);b.x=Math.round(v.snap(b.x));b.y=Math.round(v.snap(b.y));"auto"==g&&(b.width=Math.round(v.snap(b.width)));"auto"==h&&(b.height=Math.round(v.snap(b.height)))}};if("circle"==K){var ea=new mxCircleLayout(v);ea.resetEdges=!1;var ja=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){ea.execute(v.getDefaultParent()); -ia()},!0,G);G=null}else if("horizontaltree"==K||"verticaltree"==K||"auto"==K&&X.length==2*c.length-1&&1==U.length){v.view.validate();var ba=new mxCompactTreeLayout(v,"horizontaltree"==K);ba.levelDistance=F;ba.edgeRouting=!1;ba.resetEdges=!1;this.executeLayout(function(){ba.execute(v.getDefaultParent(),0<U.length?U[0]:null)},!0,G);G=null}else if("horizontalflow"==K||"verticalflow"==K||"auto"==K&&1==U.length){v.view.validate();var fa=new mxHierarchicalLayout(v,"horizontalflow"==K?mxConstants.DIRECTION_WEST: -mxConstants.DIRECTION_NORTH);fa.intraCellSpacing=F;fa.disableEdgeStyle=!1;this.executeLayout(function(){fa.execute(v.getDefaultParent(),X);v.moveCells(X,E,H)},!0,G);G=null}else if("organic"==K||"auto"==K&&X.length>c.length){v.view.validate();var ca=new mxFastOrganicLayout(v);ca.forceConstant=3*F;ca.resetEdges=!1;var ka=ca.isVertexIgnored;ca.isVertexIgnored=function(a){return ka.apply(this,arguments)||0>mxUtils.indexOf(c,a)};da=new mxParallelEdgeLayout(v);da.spacing=z;this.executeLayout(function(){ca.execute(v.getDefaultParent()); -ia()},!0,G);G=null}this.hideDialog()}finally{v.model.endUpdate()}null!=G&&G()}}catch(la){this.handleError(la)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0; -if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var h=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b= -h.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&& -null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width- -2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var f=b.init;b.init=function(){f.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()}; -this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root, -!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi= -function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!= -urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a); -this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var d=applicationCache;if(null!=d&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px"; -this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var d=window.applicationCache, -e=null,b=mxUtils.bind(this,function(){var a=d.status,b;a==d.CHECKING&&(a=d.DOWNLOADING);switch(a){case d.UNCACHED:b="";break;case d.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case d.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break; -case d.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=e&&(this.offlineStatus.innerHTML=b,e=a)});mxEvent.addListener(d,"checking",b);mxEvent.addListener(d,"noupdate",b);mxEvent.addListener(d,"downloading",b);mxEvent.addListener(d,"progress",b);mxEvent.addListener(d,"cached",b);mxEvent.addListener(d,"updateready",b);mxEvent.addListener(d,"obsolete",b);mxEvent.addListener(d,"error",b); -b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var l=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){l.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b); -this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b);this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell())); -this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("rename").setEnabled(null!=c&&c.isRenamable());this.actions.get("close").setEnabled(null!= -c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var m=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);m.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile= -function(a,b,c,d,e,f){var g=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(g.getSvg(d,e,f)),"image/svg+xml");else{var h=a.getFileData(!0,null,null,null,null,!0),k=g.getGraphBounds(),l=Math.floor(k.width*e/g.view.scale),m=Math.floor(k.height*e/g.view.scale);h.length<=MAX_REQUEST_SIZE&&l*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL, -"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+l+"&h="+m+"&border="+f+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor}, +C;}return g};EditorUi.prototype.importVisio=function(a,b,c,d){d=null!=d?d:a.name;c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var e=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(/(\.vsd)($|\?)/i.test(d)){var e=new FormData;e.append("file1",a);var g=new XMLHttpRequest;g.open("POST",VSD_CONVERT_URL);g.responseType="blob";g.onreadystatechange=mxUtils.bind(this,function(){if(4==g.readyState)if(200<=g.status&&299>=g.status)try{this.doImportVisio(g.response, +b,c)}catch(x){c(x)}else c({})});g.send(e)}else try{this.doImportVisio(a,b,c)}catch(x){c(x)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(k){this.handleError(k)}});"undefined"!==typeof VsdxExport||this.loadingExtensions|| +this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,c,d,e){var g=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,c,d,e)}catch(w){this.handleError(w)}finally{null!=e&&e()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(g,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",g):mxscript("js/extensions.min.js", +g))};EditorUi.prototype.insertLucidChart=function(a,b,c,d,e){e=JSON.parse(a);a=[];if(null!=e.state){e=JSON.parse(e.state);for(var g in e.Pages)a.push(e.Pages[g]);a.sort(function(a,b){return a.Properties.Order<b.Properties.Order?-1:a.Properties.Order>b.Properties.Order?1:0})}else a.push(e);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,c,d),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}}; +EditorUi.prototype.insertTextAt=function(a,b,c,d,e,f,h){f=null!=f?f:!0;h=null!=h?h:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(e||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var g= +this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var k=this.extractGraphModelFromPng(a),n=this.importXml(k,b,c,f,!0);if(0<n.length)return n}if("data:image/svg+xml;"==a.substring(0,19))try{if(k=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(k=a.substring(a.indexOf(",")+1),k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0)):k=decodeURIComponent(a.substring(a.indexOf(",")+1)),n=this.importXml(k,b,c,f,!0),0<n.length)return n}catch(z){}this.loadImage(a,mxUtils.bind(this, +function(d){if("data:"==a.substring(0,5))this.resizeImage(d,a,mxUtils.bind(this,function(a,d,e){g.setSelectionCell(g.insertVertex(null,null,"",g.snap(b),g.snap(c),d,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),h,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/d.width,this.maxImageSize/d.height)),f=Math.round(d.width*e);d=Math.round(d.height*e);g.setSelectionCell(g.insertVertex(null, +null,"",g.snap(b),g.snap(c),f,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var e=null;g.getModel().beginUpdate();try{e=g.insertVertex(g.getDefaultParent(),null,a,g.snap(b),g.snap(c),1,1,"text;"+(d?"html=1;":"")),g.updateCellSize(e),g.fireEvent(new mxEventObject("textInserted","cells",[e]))}finally{g.getModel().endUpdate()}g.setSelectionCell(e)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a)); +if(this.isCompatibleString(a))return this.importXml(a,b,c,f);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,c,f);else{g=this.editor.graph;e=null;g.getModel().beginUpdate();try{e=g.insertVertex(g.getDefaultParent(),null,"",g.snap(b),g.snap(c),1,1,"text;"+(d?"html=1;":"")),g.fireEvent(new mxEventObject("textInserted","cells",[e])),e.value=a,g.updateCellSize(e),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(e.value)&& +g.setLinkForCell(e,e.value),e.geometry.width+=g.gridSize,e.geometry.height+=g.gridSize}finally{g.getModel().endUpdate()}return[e]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat= +function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importFile=function(a,b,c,d,e,f,h,l,m,t,z){t=null!=t?t:!0;var g=!1,k=null,n=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,h)):b=this.importXml(a,c,d,t);null!=l&&l(b)});"image"==b.substring(0,5)?(m=!1,"image/png"==b.substring(0,9)&&(b=z?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,d,t),m= +!0)),m||(k=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),t&&k.isGridEnabled()&&(c=k.snap(c),d=k.snap(d)),k=[k.insertVertex(null,null,"",c,d,e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,c,d,t);null!=l&&l(a)})):null!= +m&&null!=h&&(/(\.vsdx)($|\?)/i.test(h)||/(\.vssx)($|\?)/i.test(h)||/(\.vsd)($|\?)/i.test(h))?(g=!0,this.importVisio(m,n)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,h)?(g=!0,this.parseFile(null!=m?m:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?n(a.responseText):null!=l&&l(null))}),h)):/(\.vsd)($|\?)/i.test(h)||(k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,t));g||null==l||l(k); +return k};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,g,f;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}g=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e& +3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);b+="=";break}f=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(f&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f&63)}return b}; +EditorUi.prototype.importFiles=function(a,b,c,d,e,f,h,l,m,t,z,F){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;t=null!=t?t:this.maxImageBytes;var g=null!=b&&null!=c,k=!0,n=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var q=z||this.resampleThreshold,p=0;p<a.length;p++)if("image/"==a[p].type.substring(0,6)&&a[p].size>q){n=!0;break}var u=mxUtils.bind(this,function(){var n=this.editor.graph,m=n.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,f,k,h,n){return null!=a&&"<mxlibrary"==a.substring(0, +10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,d,e,f,k,h,n,g,F)});f=null!=f?f:mxUtils.bind(this,function(a){n.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,p=q,u=[],v=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--p){this.spinner.stop();if(null!=l)l(u);else{var c=[];n.getModel().beginUpdate();try{for(var d=0;d<u.length;d++){var e=u[d]();null!=e&&(c=c.concat(e))}}finally{n.getModel().endUpdate()}}f(c)}}), +w=0;w<q;w++)mxUtils.bind(this,function(g){var f=a[g],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==h||h(f))if("image/"==f.type.substring(0,6))if("image/svg"==f.type.substring(0,9)){var l=a.target.result,q=l.indexOf(","),p=decodeURIComponent(escape(atob(l.substring(q+1)))),u=mxUtils.parseXml(p),p=u.getElementsByTagName("svg");if(0<p.length){var p=p[0],A=F?null:p.getAttribute("content");null!=A&&"<"!=A.charAt(0)&&"%"!=A.charAt(0)&&(A=unescape(window.atob?atob(A):Base64.decode(A,!0))); +null!=A&&"%"==A.charAt(0)&&(A=decodeURIComponent(A));null==A||"<mxfile "!==A.substring(0,8)&&"<mxGraphModel "!==A.substring(0,14)?v(g,mxUtils.bind(this,function(){try{if(l.substring(0,q+1),null!=u){var a=u.getElementsByTagName("svg");if(0<a.length){var h=a[0],t=parseFloat(h.getAttribute("width")),p=parseFloat(h.getAttribute("height")),z=h.getAttribute("viewBox");if(null==z||0==z.length)h.setAttribute("viewBox","0 0 "+t+" "+p);else if(isNaN(t)||isNaN(p)){var A=z.split(" ");3<A.length&&(t=parseFloat(A[2]), +p=parseFloat(A[3]))}l=this.createSvgDataUri(mxUtils.getXml(h));var v=Math.min(1,Math.min(d/Math.max(1,t)),d/Math.max(1,p)),B=e(l,f.type,b+g*m,c+g*m,Math.max(1,Math.round(t*v)),Math.max(1,Math.round(p*v)),f.name,k);if(isNaN(t)||isNaN(p)){var w=new Image;w.onload=mxUtils.bind(this,function(){t=Math.max(1,w.width);p=Math.max(1,w.height);B[0].geometry.width=t;B[0].geometry.height=p;h.setAttribute("viewBox","0 0 "+t+" "+p);l=this.createSvgDataUri(mxUtils.getXml(h));var a=l.indexOf(";");0<a&&(l=l.substring(0, +a)+l.substring(l.indexOf(",",a+1)));n.setCellStyles("image",l,[B[0]])});w.src=this.createSvgDataUri(mxUtils.getXml(h))}return B}}}catch(ba){}return null})):v(g,mxUtils.bind(this,function(){return e(A,"text/xml",b+g*m,c+g*m,0,0,f.name)}))}}else{p=!1;if("image/png"==f.type){var B=F?null:this.extractGraphModelFromPng(a.target.result);if(null!=B&&0<B.length){var w=new Image;w.src=a.target.result;v(g,mxUtils.bind(this,function(){return e(B,"text/xml",b+g*m,c+g*m,w.width,w.height,f.name)}));p=!0}}p||(mxClient.IS_CHROMEAPP? +(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,n,l){v(g,mxUtils.bind(this,function(){if(null!=h&&h.length<t){var q=k&&this.isResampleImage(a.target.result,z)?Math.min(1, +Math.min(d/n,d/l)):1;return e(h,f.type,b+g*m,c+g*m,Math.round(n*q),Math.round(l*q),f.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,d,z)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,f.type,b+g*m,c+g*m,240,160,f.name,function(a){v(g,function(){return a})})});/(\.vsdx)($|\?)/i.test(f.name)||/(\.vssx)($|\?)/i.test(f.name)||/(\.vsd)($|\?)/i.test(f.name)?e(null,f.type,b+g*m,c+g*m,240,160, +f.name,function(a){v(g,function(){return a})},f):"image"==f.type.substring(0,5)?l.readAsDataURL(f):l.readAsText(f)})(w)});n?this.confirmImageResize(function(a){k=a;u()},m):u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d|| +b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format", +"xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,d,e,f){e=null!=e?e:this.maxImageSize;var g=Math.max(1,a.width),k=Math.max(1,a.height);if(d&&this.isResampleImage(b,f))try{var h=Math.max(g/e,k/e);if(1<h){var n=Math.round(g/h),l=Math.round(k/h),m=document.createElement("canvas"); +m.width=n;m.height=l;m.getContext("2d").drawImage(a,0,0,n,l);var q=m.toDataURL();if(q.length<b.length){var p=document.createElement("canvas");p.width=n;p.height=l;var u=p.toDataURL();q!==u&&(b=q,g=n,k=l)}}}catch(D){}c(b,g,k)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var c=d,e=0;8>e;e++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[d]=c;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e<d;e++)a=EditorUi.prototype.crcTable[(a^b[c+e])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng= +function(a,b,c,d,e){function g(a,b){var c=h;h+=b;return a.substring(c,h)}function f(a){a=g(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function k(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var h=0;if(g(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(g(a,4),"IHDR"!=g(a,4))null!=e&&e();else{g(a,17);e=a.substring(0, +h);do{var n=f(a);if("IDAT"==g(a,4)){e=a.substring(0,h-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,b,0,4);d=this.updateCRC(d,c,0,c.length);e+=k(c.length)+b+c+k(d^4294967295);e+=a.substring(h-8,a.length);break}e+=a.substring(h-8,h-4+n);g(a,n);g(a,4)}while(n);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&& +!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(u){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)); +null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var f=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c=a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,c=this.editor.graph;c.addListener("pageLinkClicked",function(b, +c){a(c.getProperty("href"))});this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var d=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this, +arguments)};var e=c.addClickHandler;c.addClickHandler=function(b,d,g){var f=d;d=function(b,d){if(null==d){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(d=e.getAttribute("href"))}null==d||!c.isPageLink(d)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(d),mxEvent.consume(b));null!=f&&f(b,d)};e.call(this,b,d,g)};f.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container, +360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=c.getGlobalVariable;c.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,arguments)};var l=c.createLinkForHint;c.createLinkForHint=function(d,e){var g=c.isPageLink(d);if(g){var f=d.indexOf(",");0<f&&(f=b.getPageById(d.substring(f+1)),e=null!= +f?f.getName():mxResources.get("pageNotFound"))}f=l.call(this,d,e);g&&mxEvent.addListener(f,"click",function(b){a(d);mxEvent.consume(b)});return f};var m=c.labelLinkClicked;c.labelLinkClicked=function(b,d,e){var g=d.getAttribute("href");if(null==g||!c.isPageLink(g)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e))m.apply(this,arguments);else{if(!c.isEnabled()||null!=b&&c.isCellLocked(b.cell))a(g),c.getRubberband().reset();mxEvent.consume(e)}};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename, +c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var y=this.actions.get("print");y.setEnabled(!mxClient.IS_IOS||!navigator.standalone);y.visible=y.isEnabled();if(!this.editor.chromeless||this.editor.editable){var t=function(){window.setTimeout(function(){z.innerHTML=" ";z.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0); +this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||c.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var g=c.items; +for(index in g){var f=g[index];if("file"===f.kind){if(b.isEditing())this.importFiles([f.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,g,f){b.insertImage(a,g,f)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var k=this.editor.graph.getInsertPoint();this.importFiles([f.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(N){}}),!1);var z=document.createElement("div");z.style.position="absolute";z.style.whiteSpace= +"nowrap";z.style.overflow="hidden";z.style.display="block";z.contentEditable=!0;mxUtils.setOpacity(z,0);z.style.width="1px";z.style.height="1px";z.innerHTML=" ";var F=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==c.container||!c.isEnabled()||c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"== +b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||F||(z.style.left=c.container.scrollLeft+10+"px",z.style.top=c.container.scrollTop+10+"px",c.container.appendChild(z),F=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){z.focus();document.execCommand("selectAll",!1,null)},0):(z.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!F|| +224!=b&&17!=b&&91!=b||(F=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),z.parentNode.removeChild(z))}),0)}));mxEvent.addListener(z,"copy",mxUtils.bind(this,function(a){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(z),t())}));mxEvent.addListener(z,"cut",mxUtils.bind(this,function(a){c.isEnabled()&&(this.copyCells(z,!0),t())}));mxEvent.addListener(z,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(z.innerHTML=" ",z.focus(), +window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,z);z.innerHTML=" "}),0))}),!0);var C=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==z?!0:C.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph, +c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files, +0,0,this.maxImageSize,function(a,c,d,e,g,f){b.insertImage(a,g,f)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1, +Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!== +typeof mxRuler){y=document.createElement("div");y.style.position="absolute";y.style.top="95px";y.style.left="250px";y.style.width="2000px";y.style.height="30px";y.style.background="whiteSmoke";document.body.appendChild(y);var v=document.createElement("div");v.style.position="absolute";v.style.top="125px";v.style.left="220px";v.style.width="30px";v.style.height="1000px";v.style.background="whiteSmoke";document.body.appendChild(v);var G=document.createElement("div");G.style.position="absolute";G.style.top= +"95px";G.style.left="220px";G.style.width="30px";G.style.height="30px";G.style.background="whiteSmoke";document.body.appendChild(G);this.vRuler=new mxRuler(this.editor.graph,v,!0);this.hRuler=new mxRuler(this.editor.graph,y,!1)}if("1"==urlParams.test){y=document.getElementById("geFooter");null!=y&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width= +"98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),y.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c); +this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var D=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:D.apply(this,arguments)}}y=document.getElementById("geInfo");null!=y&&y.parentNode.removeChild(y);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var E=null;mxEvent.addListener(c.container,"dragleave",function(a){c.isEnabled()&&(null!=E&&(E.parentNode.removeChild(E), +E=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(a){null==E&&(!mxClient.IS_IE||10<document.documentMode)&&(E=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c.container,"drop",mxUtils.bind(this,function(a){null!=E&&(E.parentNode.removeChild(E),E=null);if(c.isEnabled()){var b=mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)), +d=c.view.translate,e=c.view.scale,g=b.x/e-d.x,f=b.y/e-d.y;mxEvent.isAltDown(a)&&(f=g=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,g,f,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var k=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=b)c.setSelectionCells(this.importXml(b,g,f,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types, +"text/html")){var h=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=h;var l=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(h=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)||(l=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(h=b[0].getAttribute("href")));var n=!0,t=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(h,g,f,!0,l,null,n))});l&&h.length>this.resampleThreshold?this.confirmImageResize(function(a){n= +a;t()},mxEvent.isControlDown(a)):t()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,b)),d/Math.max(1,a));c.setSelectionCell(c.insertVertex(null,null,"",g,f,b*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+k+";"))}),mxUtils.bind(this,function(a){c.setSelectionCells(this.insertTextAt(k, +g,f,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),g,f,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors= +mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget()); +this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged", +mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew|| +8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d, +!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS|| +8==document.documentMode?mxUtils.getTextContent(b):b.textContent),g=!1;try{var f=e.lastIndexOf("%3E");0<=f&&f<e.length-3&&(e=e.substring(0,f+3))}catch(y){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(k)&&(g=!0,e=k)}catch(y){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(g||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e, +c,c)):(g=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,g.x+c,g.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(y){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave", +function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()|| +"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types, +"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)? +(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))}; +EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var g=document.documentElement;d=(e.clientWidth||g.clientWidth)-3;e=Math.max(e.clientHeight||0,g.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;g=document.createElement("div");g.style.zIndex=mxPopupMenu.prototype.zIndex+2;g.style.border="3px dotted rgb(254, 137, 12)";g.style.pointerEvents="none";g.style.position="absolute";g.style.top=b+"px";g.style.left=c+"px";g.style.width= +Math.max(0,d-3)+"px";g.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(g):document.body.appendChild(g);return g};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles= +function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var g=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&& +"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(z){this.handleError(z,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.vsdx)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e)||/(\.vsd)($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();g(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))this.parseFile(a, +mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?g(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear(); +this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,e,b)}});c.onerror=mxUtils.bind(this, +function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this, +a,b||this.defaultFilename,c))});null!=a&&0<a.length&&(null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"), +null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1, +a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,e=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=d.model.getChildCount(a),g=0;g<e;g++)this.addBasenamesForCell(d.model.getChildAt(a,g),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility= +a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden")};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this, +function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&& +this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale, +page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,g=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,g);mxEvent.addListener(window,"message",mxUtils.bind(this,function(g){function h(a){if(null!= +a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(L){}return a}if(g.source==(window.opener||window.parent)){var k=g.data;if("json"==urlParams.proto){try{k=JSON.parse(k)}catch(B){k=null}if(null==k)return;if("dialog"==k.action){this.showError(null!= +k.titleKey?mxResources.get(k.titleKey):k.title,null!=k.messageKey?mxResources.get(k.messageKey):k.message,null!=k.buttonKey?mxResources.get(k.buttonKey):k.button);null!=k.modified&&(this.editor.modified=k.modified);return}if("prompt"==k.action){this.spinner.stop();var l=new FilenameDialog(this,k.defaultValue||"",null!=k.okKey?mxResources.get(k.okKey):null,function(a){null!=a&&f.postMessage(JSON.stringify({event:"prompt",value:a,message:k}),"*")},null!=k.titleKey?mxResources.get(k.titleKey):k.title); +this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==k.action){l=null;l="data:image/png;base64,"==k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):h(k.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[k.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();f.postMessage(JSON.stringify({event:"draft",result:"edit",message:k}),"*")}),mxUtils.bind(this,function(){this.hideDialog();f.postMessage(JSON.stringify({event:"draft", +result:"discard",message:k}),"*")}),k.editKey?mxResources.get(k.editKey):null,k.discardKey?mxResources.get(k.discardKey):null,k.ignore?mxUtils.bind(this,function(){this.hideDialog();f.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(B){f.postMessage(JSON.stringify({event:"draft",error:B.toString(),message:k}),"*")}return}if("template"== +k.action){this.spinner.stop();var l=1==k.enableRecent,m=1==k.enableSearch,l=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=k.callback?f.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,g,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=a;f.postMessage(JSON.stringify({event:"recentDocs"}), +"*")}):null,m?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;f.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){f.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==k.action)this.searchReadyCallback(k.list,k.errorMsg);else if("recentDocsList"==k.action)this.recentReadyCallback(k.list, +k.errorMsg);else{if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))):null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message));null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var n=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,n):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null== +k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var q=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,u=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=k.format;b.message=k;b.data=a;b.xml=encodeURIComponent(q);f.postMessage(JSON.stringify(b),"*")}),w=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage); +"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(q))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);u(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),x=p.getGlobalVariable,A=this.pages[0];p.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:x.apply(this,arguments)};document.body.appendChild(p.container); +p.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,function(a){w(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){w(null)}),null,null,null,null,null,null,p)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(q)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?u("data:image/png;base64,"+a.getText()):w(null)}),mxUtils.bind(this,function(){w(null)}))}}else{null!= +k.xml&&0<k.xml.length&&this.setFileData(k.xml);n=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),n.xml=mxUtils.getXml(l),n.data=this.getFileData(null,null,!0,null,null,null,l),n.format=k.format;else if("html"==k.format)q=this.editor.getGraphXml(),n.data=this.getHtml(q,this.editor.graph),n.xml=mxUtils.getXml(q),n.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background; +l==mxConstants.NONE&&(l=null);n.xml=this.getFileData(!0);n.format="svg";if(k.embedImages||null==k.embedImages){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==k.format?this.getEmbeddedSvg(n.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(a);f.postMessage(JSON.stringify(n),"*")})):this.convertImages(this.editor.graph.getSvg(l), +mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(mxUtils.getXml(a));f.postMessage(JSON.stringify(n),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));n.data=this.createSvgDataUri(l)}f.postMessage(JSON.stringify(n),"*")}return}if("load"==k.action)d=1==k.autosave,this.hideDialog(),null!=k.modified&&null==urlParams.modified&&(urlParams.modified= +k.modified),null!=k.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=k.saveAndExit),null!=k.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan), +this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):null!=k.xml&&"data:image/png;base64,"==k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):k.xml;else{f.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),"*");return}}}k=h(k);c=!0;try{a(k,g)}catch(B){this.handleError(B)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var K=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&& +1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=K();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=K();if(d!=e&&!c){var g=this.createLoadMessage("autosave");g.xml=d;d=JSON.stringify(g);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged", +b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||f.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var f=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}): +urlParams.ready||"ready";f.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize= +"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})), +a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog= +function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,f=null,g="auto",h="auto",l=null,m=null,z=40,F=40,C=0,v=this.editor.graph; +v.getGraphBounds();for(var G=function(){v.setSelectionCells(X);v.scrollCellToVisible(v.getSelectionCell())},D=v.getFreeInsertPoint(),E=D.x,H=D.y,D=H,A=null,K="auto",B=[],L=null,O=null,S=0;S<b.length&&"#"==b[S].charAt(0);){a=b[S];for(S++;S<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[S].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[S].substring(1)),S++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var N=mxUtils.trim(a.substring(1,Y)),M=mxUtils.trim(a.substring(Y+1));"label"==N?A=v.sanitizeHtml(M): +"style"==N?e=M:"identity"==N&&0<M.length&&"-"!=M?f=M:"width"==N?g=M:"height"==N?h=M:"left"==N&&0<M.length?l=M:"top"==N&&0<M.length?m=M:"ignore"==N?O=M.split(","):"connect"==N?B.push(JSON.parse(M)):"link"==N?L=M:"padding"==N?C=parseFloat(M):"edgespacing"==N?z=parseFloat(M):"nodespacing"==N?F=parseFloat(M):"layout"==N&&(K=M)}}}var W=this.editor.csvToArray(b[S]);a=null;if(null!=f)for(var I=0;I<W.length;I++)if(f==W[I]){a=I;break}null==A&&(A="%"+W[0]+"%");if(null!=B)for(var Q=0;Q<B.length;Q++)null==d[B[Q].to]&& +(d[B[Q].to]={});v.model.beginUpdate();try{for(I=S+1;I<b.length;I++){var Z=this.editor.csvToArray(b[I]);if(Z.length==W.length){var J=null,V=null!=a?Z[a]:null;null!=V&&(J=v.model.getCell(V));null==J&&(J=new mxCell(A,new mxGeometry(E,D,0,0),e||"whiteSpace=wrap;html=1;"),J.vertex=!0,J.id=V);for(var T=0;T<Z.length;T++)v.setAttributeForCell(J,W[T],Z[T]);v.setAttributeForCell(J,"placeholders","1");J.style=v.replacePlaceholders(J,J.style);for(Q=0;Q<B.length;Q++)d[B[Q].to][J.getAttribute(B[Q].to)]=J;null!= +L&&"link"!=L&&(v.setLinkForCell(J,J.getAttribute(L)),v.setAttributeForCell(J,L,null));v.fireEvent(new mxEventObject("cellsInserted","cells",[J]));var R=this.editor.graph.getPreferredSizeForCell(J);J.vertex&&(null!=l&&null!=J.getAttribute(l)&&(J.geometry.x=E+parseFloat(J.getAttribute(l))),null!=m&&null!=J.getAttribute(m)&&(J.geometry.y=H+parseFloat(J.getAttribute(m))),"@"==g.charAt(0)&&null!=J.getAttribute(g.substring(1))?J.geometry.width=parseFloat(J.getAttribute(g.substring(1))):J.geometry.width= +"auto"==g?R.width+C:parseFloat(g),"@"==h.charAt(0)&&null!=J.getAttribute(h.substring(1))?J.geometry.height=parseFloat(J.getAttribute(h.substring(1))):J.geometry.height="auto"==h?R.height+C:parseFloat(h),D+=J.geometry.height+F);c.push(v.addCell(J))}}for(var U=c.slice(),X=c.slice(),Q=0;Q<B.length;Q++)for(var P=B[Q],I=0;I<c.length;I++){var J=c[I],ga=J.getAttribute(P.from);if(null!=ga){v.setAttributeForCell(J,P.from,null);for(var ha=ga.split(","),T=0;T<ha.length;T++){var aa=d[P.to][ha[T]];null!=aa&&(A= +P.label,null!=P.fromlabel&&(A=(J.getAttribute(P.fromlabel)||"")+(A||"")),null!=P.tolabel&&(A=(A||"")+(aa.getAttribute(P.tolabel)||"")),X.push(v.insertEdge(null,null,A||"",P.invert?aa:J,P.invert?J:aa,P.style||v.createCurrentEdgeStyle())),mxUtils.remove(P.invert?J:aa,U))}}}if(null!=O)for(I=0;I<c.length;I++)for(J=c[I],T=0;T<O.length;T++)v.setAttributeForCell(J,mxUtils.trim(O[T]),null);var da=new mxParallelEdgeLayout(v);da.spacing=z;var ia=function(){da.execute(v.getDefaultParent());for(var a=0;a<c.length;a++){var b= +v.getCellGeometry(c[a]);b.x=Math.round(v.snap(b.x));b.y=Math.round(v.snap(b.y));"auto"==g&&(b.width=Math.round(v.snap(b.width)));"auto"==h&&(b.height=Math.round(v.snap(b.height)))}};if("circle"==K){var ea=new mxCircleLayout(v);ea.resetEdges=!1;var ja=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){ea.execute(v.getDefaultParent());ia()},!0,G);G=null}else if("horizontaltree"==K||"verticaltree"==K||"auto"==K&&X.length== +2*c.length-1&&1==U.length){v.view.validate();var ba=new mxCompactTreeLayout(v,"horizontaltree"==K);ba.levelDistance=F;ba.edgeRouting=!1;ba.resetEdges=!1;this.executeLayout(function(){ba.execute(v.getDefaultParent(),0<U.length?U[0]:null)},!0,G);G=null}else if("horizontalflow"==K||"verticalflow"==K||"auto"==K&&1==U.length){v.view.validate();var fa=new mxHierarchicalLayout(v,"horizontalflow"==K?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);fa.intraCellSpacing=F;fa.disableEdgeStyle=!1;this.executeLayout(function(){fa.execute(v.getDefaultParent(), +X);v.moveCells(X,E,H)},!0,G);G=null}else if("organic"==K||"auto"==K&&X.length>c.length){v.view.validate();var ca=new mxFastOrganicLayout(v);ca.forceConstant=3*F;ca.resetEdges=!1;var ka=ca.isVertexIgnored;ca.isVertexIgnored=function(a){return ka.apply(this,arguments)||0>mxUtils.indexOf(c,a)};da=new mxParallelEdgeLayout(v);da.spacing=z;this.executeLayout(function(){ca.execute(v.getDefaultParent());ia()},!0,G);G=null}this.hideDialog()}finally{v.model.endUpdate()}null!=G&&G()}}catch(la){this.handleError(la)}}; +EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "), +d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var h=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=h.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&& +null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width* +b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/ +a,8/a)};var f=b.init;b.init=function(){f.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat= +e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient|| +c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled(); +this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c); +a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!= +this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var d=applicationCache;if(null!=d&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding= +"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var d=window.applicationCache,e=null,b=mxUtils.bind(this,function(){var a=d.status,b;a==d.CHECKING&&(a=d.DOWNLOADING);switch(a){case d.UNCACHED:b="";break;case d.IDLE:b= +'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case d.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case d.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+ +IMAGE_PATH+'/clear.gif"/>'}a!=e&&(this.offlineStatus.innerHTML=b,e=a)});mxEvent.addListener(d,"checking",b);mxEvent.addListener(d,"noupdate",b);mxEvent.addListener(d,"downloading",b);mxEvent.addListener(d,"progress",b);mxEvent.addListener(d,"cached",b);mxEvent.addListener(d,"updateready",b);mxEvent.addListener(d,"obsolete",b);mxEvent.addListener(d,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){}; +EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var l=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){l.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b); +this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b); +this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("rename").setEnabled(null!=c&&c.isRenamable());this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted()); +a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var m=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);m.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,f){var g=a.editor.graph;if("xml"== +c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(g.getSvg(d,e,f)),"image/svg+xml");else{var h=a.getFileData(!0,null,null,null,null,!0),k=g.getGraphBounds(),l=Math.floor(k.width*e/g.view.scale),m=Math.floor(k.height*e/g.view.scale);h.length<=MAX_REQUEST_SIZE&&l*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+ +encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+l+"&h="+m+"&border="+f+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor}, setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries= a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins= a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle}, @@ -7590,10 +7592,10 @@ d():this.confirm(mxResources.get("replaceIt",[b]),d))}; App.prototype.descriptorChanged=function(){var a=this.getCurrentFile();if(null!=a){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerHTML="";var b=null!=a.getTitle()?a.getTitle():this.defaultFilename;mxUtils.write(this.fname,b);this.fname.setAttribute("title",b+" - "+mxResources.get("rename"))}this.editor.graph.setEnabled(a.isEditable());null==urlParams.rev&&(this.updateDocumentTitle(),a=a.getHash(),0<a.length?window.location.hash=a:0<window.location.hash.length&&(window.location.hash= ""))}};App.prototype.toggleChat=function(){var a=this.getCurrentFile();if(null!=a){if(null==a.chatWindow){var b=document.body.offsetWidth-300;a.chatWindow=new ChatWindow(this,mxResources.get("chatWindowTitle"),document.getElementById("geChat"),b,80,250,350,a.realtime);a.chatWindow.window.setVisible(!1)}a.chatWindow.window.setVisible(!a.chatWindow.window.isVisible())}}; App.prototype.showAuthDialog=function(a,b,d,c){var e=this.spinner.pause();this.showDialog((new AuthDialog(this,a,b,mxUtils.bind(this,function(a){try{null!=d&&d(a,mxUtils.bind(this,function(){this.hideDialog();e()}))}catch(h){this.editor.setStatus(mxUtils.htmlEntities(h.message))}}))).container,300,b?180:140,!0,!0,mxUtils.bind(this,function(a){null!=c&&c();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}; -App.prototype.convertFile=function(a,b,d,c,e,f){var h=b;/\.svg$/i.test(h)||(h=h.substring(0,b.lastIndexOf("."))+c);var l=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(l=!0);if(/\.vsdx$/i.test(b)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var m=new XMLHttpRequest;m.open("GET",a,!0);l||(m.responseType="blob");m.onload=mxUtils.bind(this,function(){var a=null;l?(a=JSON.parse(m.responseText),a=this.base64ToBlob(a.content, -"application/octet-stream")):a=new Blob([m.response],{type:"application/octet-stream"});this.importVisio(a,mxUtils.bind(this,function(a){e(new LocalFile(this,a,h,!0))}),f)});m.send()}else{var g=mxUtils.bind(this,function(c){try{/\.png$/i.test(b)?(temp=this.extractGraphModelFromPng(c),null!=temp?e(new LocalFile(this,temp,h,!0)):e(new LocalFile(this,c,b,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,a)?this.parseFile(new Blob([c],{type:"application/octet-stream"}),mxUtils.bind(this, -function(a){4==a.readyState&&(200<=a.status&&299>=a.status?e(new LocalFile(this,a.responseText,h,!0)):null!=f&&f({message:mxResources.get("errorLoadingFile")}))}),b):e(new LocalFile(this,c,h,!0))}catch(n){null!=f&&f(n)}});d=/\.png$/i.test(b)||/\.jpe?g$/i.test(b)||null!=d&&"image/"==d.substring(0,6);l?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=e){a=JSON.parse(a.getText());var c=a.content;"base64"===a.encoding&&(c=/\.png$/i.test(b)?"data:image/png;base64,"+ -c:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(c):atob(c));g(c)}}else null!=f&&f({code:App.ERROR_UNKNOWN})}),function(){null!=f&&f({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=f&&f({code:App.ERROR_TIMEOUT,retry:fn})}):this.loadUrl(a,g,f,d)}}; +App.prototype.convertFile=function(a,b,d,c,e,f){var h=b;/\.svg$/i.test(h)||(h=h.substring(0,b.lastIndexOf("."))+c);var l=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(l=!0);if((/\.vsdx$/i.test(b)||/\.vsd$/i.test(b))&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var m=new XMLHttpRequest;m.open("GET",a,!0);l||(m.responseType="blob");m.onload=mxUtils.bind(this,function(){var a=null;l?(a=JSON.parse(m.responseText), +a=this.base64ToBlob(a.content,"application/octet-stream")):a=new Blob([m.response],{type:"application/octet-stream"});this.importVisio(a,mxUtils.bind(this,function(a){e(new LocalFile(this,a,h,!0))}),f,b)});m.send()}else{var g=mxUtils.bind(this,function(c){try{/\.png$/i.test(b)?(temp=this.extractGraphModelFromPng(c),null!=temp?e(new LocalFile(this,temp,h,!0)):e(new LocalFile(this,c,b,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,a)?this.parseFile(new Blob([c],{type:"application/octet-stream"}), +mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?e(new LocalFile(this,a.responseText,h,!0)):null!=f&&f({message:mxResources.get("errorLoadingFile")}))}),b):e(new LocalFile(this,c,h,!0))}catch(n){null!=f&&f(n)}});d=/\.png$/i.test(b)||/\.jpe?g$/i.test(b)||null!=d&&"image/"==d.substring(0,6);l?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=e){a=JSON.parse(a.getText());var c=a.content;"base64"===a.encoding&&(c=/\.png$/i.test(b)? +"data:image/png;base64,"+c:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(c):atob(c));g(c)}}else null!=f&&f({code:App.ERROR_UNKNOWN})}),function(){null!=f&&f({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=f&&f({code:App.ERROR_TIMEOUT,retry:fn})}):this.loadUrl(a,g,f,d)}}; App.prototype.updateHeader=function(){if(null!=this.menubar){this.appIcon=document.createElement("a");this.appIcon.style.display="block";this.appIcon.style.position="absolute";this.appIcon.style.width="40px";this.appIcon.style.backgroundColor="#f18808";this.appIcon.style.height=this.menubarHeight+"px";mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon,"click",mxUtils.bind(this,function(a){this.appIconClicked(a)}));var a=mxClient.IS_SVG?"url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIKICAgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzA2LjE4NSAxMjAuMjk2IgogICB2aWV3Qm94PSIyNCAyNiA2OCA2OCIKICAgeT0iMHB4IgogICB4PSIwcHgiCiAgIHZlcnNpb249IjEuMSI+CiAgIAkgPGc+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNDEuMDYxIgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjkiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTUyOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNzUuMDc2IgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjgiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTAwOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGc+PHBhdGgKICAgICAgICAgZD0iTTUyLjc3Myw3Ny4wODRjMCwxLjk1NC0xLjU5OSwzLjU1My0zLjU1MywzLjU1M0gzNi45OTljLTEuOTU0LDAtMy41NTMtMS41OTktMy41NTMtMy41NTN2LTkuMzc5ICAgIGMwLTEuOTU0LDEuNTk5LTMuNTUzLDMuNTUzLTMuNTUzaDEyLjIyMmMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjc3LjA4NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnCiAgICAgICBpZD0iZzM0MTkiPjxwYXRoCiAgICAgICAgIGQ9Ik02Ny43NjIsNDguMDc0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINTEuOTg4Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M0g2NC4yMWMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjQ4LjA3NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnPjxwYXRoCiAgICAgICAgIGQ9Ik04Mi43NTIsNzcuMDg0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINjYuOTc3Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M2gxMi4yMjJjMS45NTQsMCwzLjU1MywxLjU5OSwzLjU1MywzLjU1M1Y3Ny4wODR6IgogICAgICAgICBmaWxsPSIjRkZGRkZGIiAvPjwvZz48L2c+PC9zdmc+)": "url('"+IMAGE_PATH+"/logo-white.png')";this.appIcon.style.backgroundImage=a;this.appIcon.style.backgroundPosition="center center";this.appIcon.style.backgroundRepeat="no-repeat";mxUtils.setPrefixedStyle(this.appIcon.style,"transition","all 125ms linear");mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&(a=a.getMode(),a==App.MODE_GOOGLE?this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/google-drive-logo-white.svg)":a==App.MODE_DROPBOX? this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/dropbox-logo-white.svg)":a==App.MODE_ONEDRIVE?this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/onedrive-logo-white.svg)":a==App.MODE_GITHUB?this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/github-logo-white.svg)":a==App.MODE_TRELLO&&(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/trello-logo-white-orange.svg)"))}));mxEvent.addListener(this.appIcon,"mouseout",mxUtils.bind(this,function(){this.appIcon.style.backgroundImage=a})); diff --git a/src/main/webapp/js/atlas-viewer.min.js b/src/main/webapp/js/atlas-viewer.min.js index 96a85ed84a52de314752ad723e740cc03f5f499a..3162b6ac6c3f70601a6db1434e7f30903ae25a81 100644 --- a/src/main/webapp/js/atlas-viewer.min.js +++ b/src/main/webapp/js/atlas-viewer.min.js @@ -97,9 +97,9 @@ ea;m.wa=m.normalizeRCData=e;m.xa=m.sanitize=function(a,b,d,e){return Q(a,ea(b,d, l--,_+=n[s++]<<u,u+=8}if(a.nlen=(31&_)+257,_>>>=5,u-=5,a.ndist=(31&_)+1,_>>>=5,u-=5,a.ncode=(15&_)+4,_>>>=4,u-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=_t;break}a.have=0,a.mode=tt;case tt:for(;a.have<a.ncode;){for(;u<3;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.lens[At[a.have++]]=7&_,_>>>=3,u-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=y(x,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=_t;break}a.have=0,a.mode=et;case et:for(;a.have<a.nlen+a.ndist;){for(;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(wt<16)_>>>=gt,u-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_>>>=gt,u-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=_t;break}yt=a.lens[a.have-1],g=3+(3&_),_>>>=2,u-=2}else if(17===wt){for(Bt=gt+3;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=3+(7&_),_>>>=3,u-=3}else{for(Bt=gt+7;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=11+(127&_),_>>>=7,u-=7}if(a.have+g>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=_t;break}for(;g--;)a.lens[a.have++]=yt}}if(a.mode===_t)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=_t;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=y(z,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=_t;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=y(B,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=_t;break}if(a.mode=at,e===A)break t;case at:a.mode=it;case it:if(l>=6&&h>=258){t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,k(t,b),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,a.mode===X&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(mt&&0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.lencode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=lt;break}if(32&mt){a.back=-1,a.mode=X;break}if(64&mt){t.msg="invalid literal/length code",a.mode=_t;break}a.extra=15&mt,a.mode=nt;case nt:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.length+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=rt;case rt:for(;St=a.distcode[_&(1<<a.distbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.distcode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=_t;break}a.offset=wt,a.extra=15&mt,a.mode=st;case st:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.offset+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=_t;break}a.mode=ot;case ot:if(0===h)break t;if(g=b-h,a.offset>g){if(g=a.offset-g,g>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=_t;break}g>a.wnext?(g-=a.wnext,m=a.wsize-g):m=a.wnext-g,g>a.length&&(g=a.length),bt=a.window}else bt=r,m=o-a.offset,g=a.length;g>h&&(g=h),h-=g,a.length-=g;do r[o++]=bt[m++];while(--g);0===a.length&&(a.mode=it);break;case lt:if(0===h)break t;r[o++]=a.length,h--,a.mode=it;break;case ht:if(a.wrap){for(;u<32;){if(0===l)break t;l--,_|=n[s++]<<u,u+=8}if(b-=h,t.total_out+=b,a.total+=b,b&&(t.adler=a.check=a.flags?v(a.check,r,b,o-b):p(a.check,r,b,o-b)),b=h,(a.flags?_:i(_))!==a.check){t.msg="incorrect data check",a.mode=_t;break}_=0,u=0}a.mode=dt;case dt:if(a.wrap&&a.flags){for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=_t;break}_=0,u=0}a.mode=ft;case ft:xt=R;break t;case _t:xt=O;break t;case ut:return D;case ct:default:return N}return t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,(a.wsize||b!==t.avail_out&&a.mode<_t&&(a.mode<ht||e!==S))&&f(t,t.output,t.next_out,b-t.avail_out)?(a.mode=ut,D):(c-=t.avail_in,b-=t.avail_out,t.total_in+=c,t.total_out+=b,a.total+=b,a.wrap&&b&&(t.adler=a.check=a.flags?v(a.check,r,b,t.next_out-b):p(a.check,r,b,t.next_out-b)),t.data_type=a.bits+(a.last?64:0)+(a.mode===X?128:0)+(a.mode===at||a.mode===Q?256:0),(0===c&&0===b||e===S)&&xt===Z&&(xt=I),xt)}function u(t){if(!t||!t.state)return N;var e=t.state;return e.window&&(e.window=null),t.state=null,Z}function c(t,e){var a;return t&&t.state?(a=t.state,0===(2&a.wrap)?N:(a.head=e,e.done=!1,Z)):N}function b(t,e){var a,i,n,r=e.length;return t&&t.state?(a=t.state,0!==a.wrap&&a.mode!==G?N:a.mode===G&&(i=1,i=p(i,e,r,0),i!==a.check)?O:(n=f(t,e,r,r))?(a.mode=ut,D):(a.havedict=1,Z)):N}var g,m,w=t("../utils/common"),p=t("./adler32"),v=t("./crc32"),k=t("./inffast"),y=t("./inftrees"),x=0,z=1,B=2,S=4,E=5,A=6,Z=0,R=1,C=2,N=-2,O=-3,D=-4,I=-5,U=8,T=1,F=2,L=3,H=4,j=5,K=6,M=7,P=8,Y=9,q=10,G=11,X=12,W=13,J=14,Q=15,V=16,$=17,tt=18,et=19,at=20,it=21,nt=22,rt=23,st=24,ot=25,lt=26,ht=27,dt=28,ft=29,_t=30,ut=31,ct=32,bt=852,gt=592,mt=15,wt=mt,pt=!0;a.inflateReset=s,a.inflateReset2=o,a.inflateResetKeep=r,a.inflateInit=h,a.inflateInit2=l,a.inflate=_,a.inflateEnd=u,a.inflateGetHeader=c,a.inflateSetDictionary=b,a.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(t,e,a){"use strict";var i=t("../utils/common"),n=15,r=852,s=592,o=0,l=1,h=2,d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],_=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,a,c,b,g,m,w){var p,v,k,y,x,z,B,S,E,A=w.bits,Z=0,R=0,C=0,N=0,O=0,D=0,I=0,U=0,T=0,F=0,L=null,H=0,j=new i.Buf16(n+1),K=new i.Buf16(n+1),M=null,P=0;for(Z=0;Z<=n;Z++)j[Z]=0;for(R=0;R<c;R++)j[e[a+R]]++;for(O=A,N=n;N>=1&&0===j[N];N--);if(O>N&&(O=N),0===N)return b[g++]=20971520,b[g++]=20971520,w.bits=1,0;for(C=1;C<N&&0===j[C];C++);for(O<C&&(O=C),U=1,Z=1;Z<=n;Z++)if(U<<=1,U-=j[Z],U<0)return-1;if(U>0&&(t===o||1!==N))return-1;for(K[1]=0,Z=1;Z<n;Z++)K[Z+1]=K[Z]+j[Z];for(R=0;R<c;R++)0!==e[a+R]&&(m[K[e[a+R]]++]=R);if(t===o?(L=M=m,z=19):t===l?(L=d,H-=257,M=f,P-=257,z=256):(L=_,M=u,z=-1),F=0,R=0,Z=C,x=g,D=O,I=0,k=-1,T=1<<O,y=T-1,t===l&&T>r||t===h&&T>s)return 1;for(var Y=0;;){Y++,B=Z-I,m[R]<z?(S=0,E=m[R]):m[R]>z?(S=M[P+m[R]],E=L[H+m[R]]):(S=96,E=0),p=1<<Z-I,v=1<<D,C=v;do v-=p,b[x+(F>>I)+v]=B<<24|S<<16|E|0;while(0!==v);for(p=1<<Z-1;F&p;)p>>=1;if(0!==p?(F&=p-1,F+=p):F=0,R++,0===--j[Z]){if(Z===N)break;Z=e[a+m[R]]}if(Z>O&&(F&y)!==k){for(0===I&&(I=O),x+=C,D=Z-I,U=1<<D;D+I<N&&(U-=j[D+I],!(U<=0));)D++,U<<=1;if(T+=1<<D,t===l&&T>r||t===h&&T>s)return 1;k=F&y,b[k]=O<<24|D<<16|x-g|0}}return 0!==F&&(b[x+F]=Z-I<<24|64<<16|0),w.bits=O,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?lt[t]:lt[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>W-a?(t.bi_buf|=e<<t.bi_valid&65535,o(t,t.bi_buf),t.bi_buf=e>>W-t.bi_valid,t.bi_valid+=a-W):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)}function h(t,e,a){l(t,a[2*e],a[2*e+1])}function d(t,e){var a=0;do a|=1&t,t>>>=1,a<<=1;while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=X;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<G;a++)i=t.heap[a],r=l[2*l[2*i+1]+1]+1,r>c&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)n=t.heap[--a],n>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(X+1),s=0;for(i=1;i<=X;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(X+1);for(a=0,i=0;i<K-1;i++)for(dt[i]=a,t=0;t<1<<et[i];t++)ht[a++]=i;for(ht[a-1]=i,r=0,i=0;i<16;i++)for(ft[i]=r,t=0;t<1<<at[i];t++)lt[r++]=i;for(r>>=7;i<Y;i++)for(ft[i]=r<<7,t=0;t<1<<at[i]-7;t++)lt[256+r++]=i;for(e=0;e<=X;e++)s[e]=0;for(t=0;t<=143;)st[2*t+1]=8,t++,s[8]++;for(;t<=255;)st[2*t+1]=9,t++,s[9]++;for(;t<=279;)st[2*t+1]=7,t++,s[7]++;for(;t<=287;)st[2*t+1]=8,t++,s[8]++;for(u(st,P+1,s),t=0;t<Y;t++)ot[2*t+1]=5,ot[2*t]=d(t,5);_t=new n(st,et,M+1,P,X),ut=new n(ot,at,0,Y,X),ct=new n(new Array(0),it,0,q,J)}function b(t){var e;for(e=0;e<P;e++)t.dyn_ltree[2*e]=0;for(e=0;e<Y;e++)t.dyn_dtree[2*e]=0;for(e=0;e<q;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*Q]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function g(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),N.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]<t[r]||t[n]===t[r]&&i[e]<=i[a]}function p(t,e,a){for(var i=t.heap[a],n=a<<1;n<=t.heap_len&&(n<t.heap_len&&w(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!w(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i}function v(t,e,a){var i,n,r,o,d=0;if(0!==t.last_lit)do i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],n=t.pending_buf[t.l_buf+d],d++,0===i?h(t,n,e):(r=ht[n],h(t,r+M+1,e),o=et[r],0!==o&&(n-=dt[r],l(t,n,o)),i--,r=s(i),h(t,r,a),o=at[r],0!==o&&(i-=ft[r],l(t,i,o)));while(d<t.last_lit);h(t,Q,e)}function k(t,e){var a,i,n,r=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=G,a=0;a<l;a++)0!==r[2*a]?(t.heap[++t.heap_len]=h=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)n=t.heap[++t.heap_len]=h<2?++h:0,r[2*n]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=s[2*n+1]);for(e.max_code=h,a=t.heap_len>>1;a>=1;a--)p(t,r,a);n=l;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o<l&&n===s||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[2*V]++):o<=10?t.bl_tree[2*$]++:t.bl_tree[2*tt]++,o=0,r=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4))}function x(t,e,a){var i,n,r=-1,s=e[1],o=0,d=7,f=4;for(0===s&&(d=138,f=3),i=0;i<=a;i++)if(n=s,s=e[2*(i+1)+1],!(++o<d&&n===s)){if(o<f){do h(t,n,t.bl_tree);while(0!==--o)}else 0!==n?(n!==r&&(h(t,n,t.bl_tree),o--),h(t,V,t.bl_tree),l(t,o-3,2)):o<=10?(h(t,$,t.bl_tree),l(t,o-3,3)):(h(t,tt,t.bl_tree),l(t,o-11,7));o=0,r=n,0===s?(d=138,f=3):n===s?(d=6,f=3):(d=7,f=4)}}function z(t){var e;for(y(t,t.dyn_ltree,t.l_desc.max_code),y(t,t.dyn_dtree,t.d_desc.max_code),k(t,t.bl_desc),e=q-1;e>=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n<i;n++)l(t,t.bl_tree[2*nt[n]+1],3);x(t,t.dyn_ltree,e-1),x(t,t.dyn_dtree,a-1)}function S(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return D;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return I;for(e=32;e<M;e++)if(0!==t.dyn_ltree[2*e])return I;return D}function E(t){bt||(c(),bt=!0),t.l_desc=new r(t.dyn_ltree,_t),t.d_desc=new r(t.dyn_dtree,ut),t.bl_desc=new r(t.bl_tree,ct),t.bi_buf=0,t.bi_valid=0,b(t)}function A(t,e,a,i){l(t,(T<<1)+(i?1:0),3),m(t,e,a,!0)}function Z(t){l(t,F<<1,3),h(t,Q,st),f(t)}function R(t,e,a,i){var n,r,s=0;t.level>0?(t.strm.data_type===U&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=n&&(n=r)):n=r=a+5,a+4<=n&&e!==-1?A(t,e,a,i):t.strategy===O||r===n?(l(t,(F<<1)+(i?1:0),3),v(t,st,ot)):(l(t,(L<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)}function C(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(ht[a]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var N=t("../utils/common"),O=4,D=0,I=1,U=2,T=0,F=1,L=2,H=3,j=258,K=29,M=256,P=M+1+K,Y=30,q=19,G=2*P+1,X=15,W=16,J=7,Q=256,V=16,$=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],at=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,st=new Array(2*(P+2));i(st);var ot=new Array(2*Y);i(ot);var lt=new Array(rt);i(lt);var ht=new Array(j-H+1);i(ht);var dt=new Array(K);i(dt);var ft=new Array(Y);i(ft);var _t,ut,ct,bt=!1;a._tr_init=E,a._tr_stored_block=A,a._tr_flush_block=R,a._tr_tally=C,a._tr_align=Z},{"../utils/common":3}],15:[function(t,e,a){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=i},{}],"/":[function(t,e,a){"use strict";var i=t("./lib/utils/common").assign,n=t("./lib/deflate"),r=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};i(o,n,r,s),e.exports=o},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")}); var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a,b){var c="",d,e,f,g,k,l,m=0;for(null!=b&&b||(a=Base64._utf8_encode(a));m<a.length;)d=a.charCodeAt(m++),e=a.charCodeAt(m++),f=a.charCodeAt(m++),g=d>>2,d=(d&3)<<4|e>>4,k=(e&15)<<2|f>>6,l=f&63,isNaN(e)?k=l=64:isNaN(f)&&(l=64),c=c+this._keyStr.charAt(g)+this._keyStr.charAt(d)+this._keyStr.charAt(k)+this._keyStr.charAt(l);return c},decode:function(a,b){b=null!=b?b:!1;var c="",d,e,f,g,k,l=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g, "");l<a.length;)d=this._keyStr.indexOf(a.charAt(l++)),e=this._keyStr.indexOf(a.charAt(l++)),g=this._keyStr.indexOf(a.charAt(l++)),k=this._keyStr.indexOf(a.charAt(l++)),d=d<<2|e>>4,e=(e&15)<<4|g>>2,f=(g&3)<<6|k,c+=String.fromCharCode(d),64!=g&&(c+=String.fromCharCode(e)),64!=k&&(c+=String.fromCharCode(f));b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):(127<d&&2048>d?b+= -String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0,d;for(c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"open";window.PROXY_URL=window.PROXY_URL||"proxy";window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img"; -window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":"https://www.draw.io/iconSearch");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.mxLoadResources=window.mxLoadResources||!1; -window.mxLanguage=window.mxLanguage||function(){var a="1"==urlParams.offline?"en":urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null)}catch(c){isLocalStorage=!1}return a}(); +String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0,d;for(c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.VSD_CONVERT_URL=window.VSD_CONVERT_URL||"https://convert.draw.io/VsdConverter/api/converter";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"open";window.PROXY_URL=window.PROXY_URL||"proxy"; +window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img";window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":"https://www.draw.io/iconSearch");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia"; +window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||function(){var a="1"==urlParams.offline?"en":urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null)}catch(c){isLocalStorage=!1}return a}(); window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Bahasa Melayu",bs:"Bosanski",bg:"Bulgarian",ca:"Català ",cs:"ÄŒeÅ¡tina",da:"Dansk",de:"Deutsch",et:"Eesti",en:"English",es:"Español",fil:"Filipino",fr:"Français",it:"Italiano",hu:"Magyar",nl:"Nederlands",no:"Norsk",pl:"Polski","pt-br":"Português (Brasil)",pt:"Português (Portugal)",ro:"Română",fi:"Suomi",sv:"Svenska",vi:"Tiếng Việt",tr:"Türkçe",el:"Ελληνικά",ru:"РуÑÑкий",sr:"СрпÑки",uk:"УкраїнÑька",he:"עברית",ar:"العربية",th:"ไทย", ko:"í•œêµì–´",ja:"日本語",zh:"ä¸æ–‡ï¼ˆä¸å›½ï¼‰","zh-tw":"ä¸æ–‡ï¼ˆå°ç£ï¼‰"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph");if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang)}window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}return a}(); function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)} @@ -2053,11 +2053,11 @@ b.substring(0,b.length-1));h.toolbar.setFontName(b);h.toolbar.setFontSize(parseI if(window.self===window.top&&null!=c.container.parentNode)try{c.container.focus()}catch(F){}var v=c.fireMouseEvent;c.fireMouseEvent=function(a,d,c){a==mxEvent.MOUSE_DOWN&&this.container.focus();v.apply(this,arguments)};c.popupMenuHandler.autoExpand=!0;null!=this.menus&&(c.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,d,c){this.menus.createPopupMenu(a,d,c)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){c.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(a); this.getKeyHandler=function(){return keyHandler};var r="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),A="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var d=c.view.getState(a);if(null!=d){a=a.clone();a.style="";a=c.getCellStyle(a);var b=[],f=[],g;for(g in d.style)a[g]!=d.style[g]&&(b.push(d.style[g]),f.push(g));g=c.getModel().getStyle(d.cell);for(var e=null!=g?g.split(";"):[],p=0;p<e.length;p++){var h=e[p], m=h.indexOf("=");0<=m&&(g=h.substring(0,m),h=h.substring(m+1),null!=a[g]&&"none"==h&&(b.push(h),f.push(g)))}c.getModel().isEdge(d.cell)?c.currentEdgeStyle={}:c.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",b,"cells",[d.cell]))}};this.clearDefaultStyle=function(){c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var C= -["fontFamily","fontSize","fontColor"],y="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),z=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],C,["align"],["html"]];for(a=0;a<z.length;a++)for(b=0;b<z[a].length;b++)r.push(z[a][b]);for(a=0;a<A.length;a++)0>mxUtils.indexOf(r,A[a])&&r.push(A[a]);var B=function(a,d){var b=c.getModel();b.beginUpdate(); -try{if(d)for(var f=b.isEdge(h),g=f?c.currentEdgeStyle:c.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var p=g[f[e]];null!=p&&c.setCellStyles(f[e],p,a)}else for(p=0;p<a.length;p++){for(var h=a[p],m=b.getStyle(h),u=null!=m?m.split(";"):[],G=r.slice(),e=0;e<u.length;e++){var v=u[e],k=v.indexOf("=");if(0<=k){var w=v.substring(0,k),q=mxUtils.indexOf(G,w);0<=q&&G.splice(q,1);for(var y=0;y<z.length;y++){var l=z[y];if(0<=mxUtils.indexOf(l,w))for(var n=0;n<l.length;n++){var C= -mxUtils.indexOf(G,l[n]);0<=C&&G.splice(C,1)}}}}for(var g=(f=b.isEdge(h))?c.currentEdgeStyle:c.currentVertexStyle,t=b.getStyle(h),e=0;e<G.length;e++){var w=G[e],F=g[w];null==F||"shape"==w&&!f||f&&!(0>mxUtils.indexOf(A,w))||(t=mxUtils.setStyle(t,w,F))}b.setStyle(h,t)}}finally{b.endUpdate()}};c.addListener("cellsInserted",function(a,d){B(d.getProperty("cells"))});c.addListener("textInserted",function(a,d){B(d.getProperty("cells"),!0)});c.connectionHandler.addListener(mxEvent.CONNECT,function(a,d){var b= -[d.getProperty("cell")];d.getProperty("terminalInserted")&&b.push(d.getProperty("terminal"));B(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,d){var b=d.getProperty("cells"),f=!1,g=!1;if(0<b.length)for(var e=0;e<b.length&&(f=c.getModel().isVertex(b[e])||f,!(g=c.getModel().isEdge(b[e])||g)||!f);e++);else g=f=!0;for(var b=d.getProperty("keys"),p=d.getProperty("values"),e=0;e<b.length;e++){var h=0<=mxUtils.indexOf(C,b[e]);if("strokeColor"!=b[e]||null!=p[e]&&"none"!=p[e])if(0<=mxUtils.indexOf(A, -b[e]))g||0<=mxUtils.indexOf(y,b[e])?null==p[e]?delete c.currentEdgeStyle[b[e]]:c.currentEdgeStyle[b[e]]=p[e]:f&&0<=mxUtils.indexOf(r,b[e])&&(null==p[e]?delete c.currentVertexStyle[b[e]]:c.currentVertexStyle[b[e]]=p[e]);else if(0<=mxUtils.indexOf(r,b[e])){if(f||h)null==p[e]?delete c.currentVertexStyle[b[e]]:c.currentVertexStyle[b[e]]=p[e];if(g||h||0<=mxUtils.indexOf(y,b[e]))null==p[e]?delete c.currentEdgeStyle[b[e]]:c.currentEdgeStyle[b[e]]=p[e]}}null!=this.toolbar&&(this.toolbar.setFontName(c.currentVertexStyle.fontFamily|| +["fontFamily","fontSize","fontColor"],x="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),z=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],C,["align"],["html"]];for(a=0;a<z.length;a++)for(b=0;b<z[a].length;b++)r.push(z[a][b]);for(a=0;a<A.length;a++)0>mxUtils.indexOf(r,A[a])&&r.push(A[a]);var B=function(a,d){var b=c.getModel();b.beginUpdate(); +try{if(d)for(var f=b.isEdge(p),g=f?c.currentEdgeStyle:c.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var h=g[f[e]];null!=h&&c.setCellStyles(f[e],h,a)}else for(h=0;h<a.length;h++){for(var p=a[h],m=b.getStyle(p),u=null!=m?m.split(";"):[],G=r.slice(),e=0;e<u.length;e++){var v=u[e],k=v.indexOf("=");if(0<=k){var w=v.substring(0,k),q=mxUtils.indexOf(G,w);0<=q&&G.splice(q,1);for(var x=0;x<z.length;x++){var l=z[x];if(0<=mxUtils.indexOf(l,w))for(var n=0;n<l.length;n++){var C= +mxUtils.indexOf(G,l[n]);0<=C&&G.splice(C,1)}}}}for(var g=(f=b.isEdge(p))?c.currentEdgeStyle:c.currentVertexStyle,t=b.getStyle(p),e=0;e<G.length;e++){var w=G[e],F=g[w];null==F||"shape"==w&&!f||f&&!(0>mxUtils.indexOf(A,w))||(t=mxUtils.setStyle(t,w,F))}b.setStyle(p,t)}}finally{b.endUpdate()}};c.addListener("cellsInserted",function(a,d){B(d.getProperty("cells"))});c.addListener("textInserted",function(a,d){B(d.getProperty("cells"),!0)});c.connectionHandler.addListener(mxEvent.CONNECT,function(a,d){var b= +[d.getProperty("cell")];d.getProperty("terminalInserted")&&b.push(d.getProperty("terminal"));B(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,d){var b=d.getProperty("cells"),f=!1,g=!1;if(0<b.length)for(var e=0;e<b.length&&(f=c.getModel().isVertex(b[e])||f,!(g=c.getModel().isEdge(b[e])||g)||!f);e++);else g=f=!0;for(var b=d.getProperty("keys"),h=d.getProperty("values"),e=0;e<b.length;e++){var p=0<=mxUtils.indexOf(C,b[e]);if("strokeColor"!=b[e]||null!=h[e]&&"none"!=h[e])if(0<=mxUtils.indexOf(A, +b[e]))g||0<=mxUtils.indexOf(x,b[e])?null==h[e]?delete c.currentEdgeStyle[b[e]]:c.currentEdgeStyle[b[e]]=h[e]:f&&0<=mxUtils.indexOf(r,b[e])&&(null==h[e]?delete c.currentVertexStyle[b[e]]:c.currentVertexStyle[b[e]]=h[e]);else if(0<=mxUtils.indexOf(r,b[e])){if(f||p)null==h[e]?delete c.currentVertexStyle[b[e]]:c.currentVertexStyle[b[e]]=h[e];if(g||p||0<=mxUtils.indexOf(x,b[e]))null==h[e]?delete c.currentEdgeStyle[b[e]]:c.currentEdgeStyle[b[e]]=h[e]}}null!=this.toolbar&&(this.toolbar.setFontName(c.currentVertexStyle.fontFamily|| Menus.prototype.defaultFont),this.toolbar.setFontSize(c.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==c.currentEdgeStyle.edgeStyle&&"1"==c.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==c.currentEdgeStyle.edgeStyle||"none"==c.currentEdgeStyle.edgeStyle||null==c.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"== c.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==c.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==c.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==c.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==c.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==c.currentEdgeStyle.shape? "geSprite geSprite-linkedge":"flexArrow"==c.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==c.currentEdgeStyle.shape?"geSprite geSprite-simplearrow":"geSprite geSprite-connection"),null!=this.toolbar.lineStartMenu&&(this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",c.currentEdgeStyle.shape,c.currentEdgeStyle[mxConstants.STYLE_STARTARROW],mxUtils.getValue(c.currentEdgeStyle,"startFill","1"))),null!=this.toolbar.lineEndMenu&&(this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className= @@ -2079,9 +2079,9 @@ EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,b= EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipboard.cut=function(c){c.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):b.apply(this,arguments);a.updatePasteActionStates()};var e=mxClipboard.copy;mxClipboard.copy=function(b){b.cellEditor.isContentEditing()?document.execCommand("copy",!1,null):e.apply(this,arguments);a.updatePasteActionStates()};var c=mxClipboard.paste;mxClipboard.paste=function(b){var e=null;b.cellEditor.isContentEditing()?document.execCommand("paste", !1,null):e=c.apply(this,arguments);a.updatePasteActionStates();return e};var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);a.updatePasteActionStates()};var l=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,c){l.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()}; EditorUi.prototype.initCanvas=function(){var a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var a=this.graph.getPageLayout(),d=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*d.width),this.scale*(this.translate.y+a.y*d.height),this.scale*a.width*d.width, -this.scale*a.height*d.height)};a.getPreferredPageSize=function(a,d,b){a=this.getPageLayout();d=this.getPageSize();return new mxRectangle(0,0,a.width*d.width,a.height*d.height)};var b=null,e=this;if(this.editor.chromeless){this.chromelessResize=b=mxUtils.bind(this,function(d,b,c,f){if(null!=a.container){c=null!=c?c:0;f=null!=f?f:0;var g=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),p=a.view.translate,h=a.view.scale,m=mxRectangle.fromRectangle(g); -m.x=m.x/h-p.x;m.y=m.y/h-p.y;m.width/=h;m.height/=h;var p=a.container.scrollTop,u=a.container.scrollLeft,r=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)r+=3;var v=a.container.offsetWidth-r,r=a.container.offsetHeight-r;d=d?Math.max(.3,Math.min(b||1,v/m.width)):h;b=(v-d*m.width)/2/d;var k=0==this.lightboxVerticalDivider?0:(r-d*m.height)/this.lightboxVerticalDivider/d;e&&(b=Math.max(b,0),k=Math.max(k,0));if(e||g.width<v||g.height<r)a.view.scaleAndTranslate(d, -Math.floor(b-m.x),Math.floor(k-m.y)),a.container.scrollTop=p*d/h,a.container.scrollLeft=u*d/h;else if(0!=c||0!=f)g=a.view.translate,a.view.setTranslate(Math.floor(g.x+c/h),Math.floor(g.y+f/h))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var c=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",c);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",c)});this.editor.addListener("resetGraphView", +this.scale*a.height*d.height)};a.getPreferredPageSize=function(a,d,b){a=this.getPageLayout();d=this.getPageSize();return new mxRectangle(0,0,a.width*d.width,a.height*d.height)};var b=null,e=this;if(this.editor.chromeless){this.chromelessResize=b=mxUtils.bind(this,function(d,b,c,f){if(null!=a.container){c=null!=c?c:0;f=null!=f?f:0;var g=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),h=a.view.translate,p=a.view.scale,m=mxRectangle.fromRectangle(g); +m.x=m.x/p-h.x;m.y=m.y/p-h.y;m.width/=p;m.height/=p;var h=a.container.scrollTop,u=a.container.scrollLeft,r=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)r+=3;var v=a.container.offsetWidth-r,r=a.container.offsetHeight-r;d=d?Math.max(.3,Math.min(b||1,v/m.width)):p;b=(v-d*m.width)/2/d;var k=0==this.lightboxVerticalDivider?0:(r-d*m.height)/this.lightboxVerticalDivider/d;e&&(b=Math.max(b,0),k=Math.max(k,0));if(e||g.width<v||g.height<r)a.view.scaleAndTranslate(d, +Math.floor(b-m.x),Math.floor(k-m.y)),a.container.scrollTop=h*d/p,a.container.scrollLeft=u*d/p;else if(0!=c||0!=f)g=a.view.translate,a.view.setTranslate(Math.floor(g.x+c/p),Math.floor(g.y+f/p))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var c=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",c);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",c)});this.editor.addListener("resetGraphView", mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(d){a.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(d){a.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace= "nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var k=mxUtils.bind(this,function(){var d=mxUtils.getCurrentStyle(a.container);this.chromelessToolbar.style.bottom=(null!=d?parseInt(d["margin-bottom"]|| 0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",k);k();var l=0,k=mxUtils.bind(this,function(a,d,b){l++;var c=document.createElement("span");c.style.paddingLeft="8px";c.style.paddingRight="8px";c.style.cursor="pointer";mxEvent.addListener(c,"click",a);null!=b&&c.setAttribute("title",b);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",d);c.appendChild(a);this.chromelessToolbar.appendChild(c); @@ -2195,7 +2195,7 @@ this.getRubberband=function(){return g};var p=(new Date).getTime(),m=0,h=this.co (r=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=r)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var A=this.click;this.click=function(a){var d=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);if(this.isEnabled()&&!d||a.isConsumed())return A.apply(this, arguments);d=d?a.sourceState.cell:a.getCell();if(null!=d){var b=this.getLinkForCell(d);null!=b&&(this.isPageLink(b)?this.pageLinkClicked(d,b):this.openLink(b))}};this.tooltipHandler.getStateForEvent=function(a){return a.sourceState};this.getCursorForMouseEvent=function(a){var d=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);return this.getCursorForCell(d?a.sourceState.cell:a.getCell())};var C=this.getCursorForCell;this.getCursorForCell=function(a){if(!this.isEnabled()|| this.isCellLocked(a)){if(null!=this.getLinkForCell(a))return"pointer";if(this.isCellLocked(a))return"default"}return C.apply(this,arguments)};this.selectRegion=function(a,d){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,d);return b};this.getAllCells=function(a,d,b,c,f,g){g=null!=g?g:[];if(0<b||0<c){var e=this.getModel(),h=a+b,p=d+c;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var m=e.getChildCount(f),G=0;G<m;G++){var r=e.getChildAt(f,G), -u=this.view.getState(r);if(null!=u&&this.isCellVisible(r)&&"1"!=mxUtils.getValue(u.style,"locked","0")){var v=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=v&&(u=mxUtils.getBoundingBox(u,v));(e.isEdge(r)||e.isVertex(r))&&u.x>=a&&u.y+u.height<=p&&u.y>=d&&u.x+u.width<=h&&g.push(r);this.getAllCells(a,d,b,c,r,g)}}}return g};var y=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,d,b){return this.graph.isCellSelected(a)?!1:y.apply(this, +u=this.view.getState(r);if(null!=u&&this.isCellVisible(r)&&"1"!=mxUtils.getValue(u.style,"locked","0")){var v=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=v&&(u=mxUtils.getBoundingBox(u,v));(e.isEdge(r)||e.isVertex(r))&&u.x>=a&&u.y+u.height<=p&&u.y>=d&&u.x+u.width<=h&&g.push(r);this.getAllCells(a,d,b,c,r,g)}}}return g};var x=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,d,b){return this.graph.isCellSelected(a)?!1:x.apply(this, arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var z=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,d){if("mouseDown"==d.getProperty("eventName")){var b=d.getProperty("event").getState();z=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD, mxUtils.bind(this,function(a,d){if(!mxEvent.isMultiTouchEvent(d)){var b=d.getProperty("event"),c=d.getProperty("cell");null==c?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),g.start(b.x,b.y)):null!=z?this.addSelectionCells(z):1<this.getSelectionCount()&&this.isCellSelected(c)&&this.removeSelectionCell(c);z=null;d.consume()}}));this.connectionHandler.selectCells=function(a,d){this.graph.setSelectionCell(d||a)};this.connectionHandler.constraintHandler.isStateIgnored= function(a,d){return d&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var B=this.updateMouseEvent;this.updateMouseEvent=function(a){a=B.apply(this,arguments);null!=a.state&&this.isCellLocked(a.getCell())&&(a.state= @@ -2289,8 +2289,8 @@ this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var d d.length-2&&mxUtils.ptSegDistSq(u.x,u.y,r.x,r.y,k.x,k.y)<1*this.scale*this.scale;)k=r,h++,r=d[h+2];for(var b=e(0,u.x,u.y)||b,q=0;q<this.validEdges.length;q++){var l=this.validEdges[q],n=l.absolutePoints;if(null!=n&&mxUtils.intersects(a,l)&&"1"!=l.style.noJump)for(l=0;l<n.length-1;l++){for(var t=n[l+1],B=n[l],r=n[l+2];l<n.length-2&&mxUtils.ptSegDistSq(B.x,B.y,r.x,r.y,t.x,t.y)<1*this.scale*this.scale;)t=r,l++,r=n[l+2];r=mxUtils.intersection(u.x,u.y,k.x,k.y,B.x,B.y,t.x,t.y);if(null!=r&&(Math.abs(r.x- B.x)>m||Math.abs(r.y-B.y)>m)&&(Math.abs(r.x-t.x)>m||Math.abs(r.y-t.y)>m)){t=r.x-u.x;B=r.y-u.y;r={distSq:t*t+B*B,x:r.x,y:r.y};for(t=0;t<v.length;t++)if(v[t].distSq>r.distSq){v.splice(t,0,r);r=null;break}null==r||0!=v.length&&v[v.length-1].x===r.x&&v[v.length-1].y===r.y||v.push(r)}}}for(l=0;l<v.length;l++)b=e(1,v[l].x,v[l].y)||b}r=d[d.length-1];b=e(0,r.x,r.y)||b}a.routedPoints=c;return b}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,d,b){this.routedPoints= null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,f=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),h,q=!0,u=null,v=null;h=[];var r=null;a.begin();for(var l=0;l<this.state.routedPoints.length;l++){var n= -this.state.routedPoints[l],y=new mxPoint(n.x/this.scale,n.y/this.scale);0==l?y=d[0]:l==this.state.routedPoints.length-1&&(y=d[d.length-1]);var t=!1;if(null!=u&&1==n.type){var B=this.state.routedPoints[l+1],n=B.x/this.scale-y.x,B=B.y/this.scale-y.y,n=n*n+B*B;null==r&&(r=new mxPoint(y.x-u.x,y.y-u.y),v=Math.sqrt(r.x*r.x+r.y*r.y),r.x=r.x*f/v,r.y=r.y*f/v);n>f*f&&0<v&&(n=u.x-y.x,B=u.y-y.y,n=n*n+B*B,n>f*f&&(t=new mxPoint(y.x-r.x,y.y-r.y),n=new mxPoint(y.x+r.x,y.y+r.y),h.push(t),this.addPoints(a,h,b,c,!1, -null,q),h=0>Math.round(r.x)||0==Math.round(r.x)&&0>=Math.round(r.y)?1:-1,q=!1,"sharp"==e?(a.lineTo(t.x-r.y*h,t.y+r.x*h),a.lineTo(n.x-r.y*h,n.y+r.x*h),a.lineTo(n.x,n.y)):"arc"==e?(h*=1.3,a.curveTo(t.x-r.y*h,t.y+r.x*h,n.x-r.y*h,n.y+r.x*h,n.x,n.y)):(a.moveTo(n.x,n.y),q=!0),h=[n],t=!0))}else r=null;t||(h.push(y),u=y)}this.addPoints(a,h,b,c,!1,null,q);a.stroke()}};var l=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,d,b,c){if(null==d||null== +this.state.routedPoints[l],x=new mxPoint(n.x/this.scale,n.y/this.scale);0==l?x=d[0]:l==this.state.routedPoints.length-1&&(x=d[d.length-1]);var t=!1;if(null!=u&&1==n.type){var B=this.state.routedPoints[l+1],n=B.x/this.scale-x.x,B=B.y/this.scale-x.y,n=n*n+B*B;null==r&&(r=new mxPoint(x.x-u.x,x.y-u.y),v=Math.sqrt(r.x*r.x+r.y*r.y),r.x=r.x*f/v,r.y=r.y*f/v);n>f*f&&0<v&&(n=u.x-x.x,B=u.y-x.y,n=n*n+B*B,n>f*f&&(t=new mxPoint(x.x-r.x,x.y-r.y),n=new mxPoint(x.x+r.x,x.y+r.y),h.push(t),this.addPoints(a,h,b,c,!1, +null,q),h=0>Math.round(r.x)||0==Math.round(r.x)&&0>=Math.round(r.y)?1:-1,q=!1,"sharp"==e?(a.lineTo(t.x-r.y*h,t.y+r.x*h),a.lineTo(n.x-r.y*h,n.y+r.x*h),a.lineTo(n.x,n.y)):"arc"==e?(h*=1.3,a.curveTo(t.x-r.y*h,t.y+r.x*h,n.x-r.y*h,n.y+r.x*h,n.x,n.y)):(a.moveTo(n.x,n.y),q=!0),h=[n],t=!0))}else r=null;t||(h.push(x),u=x)}this.addPoints(a,h,b,c,!1,null,q);a.stroke()}};var l=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,d,b,c){if(null==d||null== a||"1"!=d.style.snapToPoint&&"1"!=a.style.snapToPoint)l.apply(this,arguments);else{d=this.getTerminalPort(a,d,c);var f=this.getNextPoint(a,b,c),g=this.graph.isOrthogonal(a),e=mxUtils.toRadians(Number(d.style[mxConstants.STYLE_ROTATION]||"0")),k=new mxPoint(d.getCenterX(),d.getCenterY());if(0!=e)var u=Math.cos(-e),v=Math.sin(-e),f=mxUtils.getRotatedPoint(f,u,v,k);u=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);u+=parseFloat(a.style[c?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]|| 0);f=this.getPerimeterPoint(d,f,0==e&&g,u);0!=e&&(u=Math.cos(e),v=Math.sin(e),f=mxUtils.getRotatedPoint(f,u,v,k));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,d,b,c,f),c)}};mxGraphView.prototype.snapToAnchorPoint=function(a,d,b,c,e){if(null!=d&&null!=a){a=this.graph.getAllConnectionConstraints(d);c=b=null;for(var f=0;f<a.length;f++){var g=this.graph.getConnectionPoint(d,a[f]);if(null!=g){var p=(g.x-e.x)*(g.x-e.x)+(g.y-e.y)*(g.y-e.y);if(null==c||p<c)b=g,c=p}}null!=b&&(e=b)}return e};var n=mxStencil.prototype.evaluateTextAttribute; mxStencil.prototype.evaluateTextAttribute=function(a,d,b){var c=n.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=b.state&&(c=b.state.view.graph.replacePlaceholders(b.state.cell,c));return c};var q=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var d=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=d&&"stencil("==d.substring(0,8))try{var b=d.substring(8,d.length-1),c=mxUtils.parseXml(a.view.graph.decompress(b)); @@ -2316,7 +2316,7 @@ Graph.prototype.isValidRoot=function(a){for(var d=this.model.getChildCount(a),b= "1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var d=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(d&&null!=a&&null!=this.layoutManager){var b=this.model.getParent(a);null!=b&&(b=this.layoutManager.getLayout(b),null!=b&&b.constructor==mxStackLayout&&(d=!1))}return d};Graph.prototype.getPreferredSizeForCell=function(a){var d=mxGraph.prototype.getPreferredSizeForCell.apply(this, arguments);null!=d&&(d.width+=10,d.height+=4,this.gridEnabled&&(d.width=this.snap(d.width),d.height=this.snap(d.height)));return d};Graph.prototype.turnShapes=function(a){var d=this.getModel(),b=[];d.beginUpdate();try{for(var c=0;c<a.length;c++){var f=a[c];if(d.isEdge(f)){var g=d.getTerminal(f,!0),e=d.getTerminal(f,!1);d.setTerminal(f,e,!0);d.setTerminal(f,g,!1);var h=d.getGeometry(f);if(null!=h){h=h.clone();null!=h.points&&h.points.reverse();var p=h.getTerminalPoint(!0),m=h.getTerminalPoint(!1); h.setTerminalPoint(p,!1);h.setTerminalPoint(m,!0);d.setGeometry(f,h);var u=this.view.getState(f),r=this.view.getState(g),G=this.view.getState(e);if(null!=u){var v=null!=r?this.getConnectionConstraint(u,r,!0):null,k=null!=G?this.getConnectionConstraint(u,G,!1):null;this.setConnectionConstraint(f,g,!0,k);this.setConnectionConstraint(f,e,!1,v)}b.push(f)}}else if(d.isVertex(f)&&(h=this.getCellGeometry(f),null!=h)){h=h.clone();h.x+=h.width/2-h.height/2;h.y+=h.height/2-h.width/2;var q=h.width;h.width=h.height; -h.height=q;d.setGeometry(f,h);var w=this.view.getState(f);if(null!=w){var x=w.style[mxConstants.STYLE_DIRECTION]||"east";"east"==x?x="south":"south"==x?x="west":"west"==x?x="north":"north"==x&&(x="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,x,[f])}b.push(f)}}}finally{d.endUpdate()}return b};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var d=this.model.getDescendants(a.cell); +h.height=q;d.setGeometry(f,h);var w=this.view.getState(f);if(null!=w){var y=w.style[mxConstants.STYLE_DIRECTION]||"east";"east"==y?y="south":"south"==y?y="west":"west"==y?y="north":"north"==y&&(y="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,y,[f])}b.push(f)}}}finally{d.endUpdate()}return b};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var d=this.model.getDescendants(a.cell); if(0<d.length)for(var b=0;b<d.length;b++)this.isReplacePlaceholders(d[b])&&this.view.invalidate(d[b],!1,!1)}};Graph.prototype.replaceElement=function(a,d){for(var b=a.ownerDocument.createElement(null!=d?d:"span"),c=Array.prototype.slice.call(a.attributes);attr=c.pop();)b.setAttribute(attr.nodeName,attr.nodeValue);b.innerHTML=a.innerHTML;a.parentNode.replaceChild(b,a)};Graph.prototype.updateLabelElements=function(a,d,b){a=null!=a?a:this.getSelectionCells();for(var c=document.createElement("div"),f= 0;f<a.length;f++)if(this.isHtmlLabel(a[f])){var g=this.convertValueToString(a[f]);if(null!=g&&0<g.length){c.innerHTML=g;for(var e=c.getElementsByTagName(null!=b?b:"*"),h=0;h<e.length;h++)d(e[h]);c.innerHTML!=g&&this.cellLabelChanged(a[f],c.innerHTML)}}};Graph.prototype.cellLabelChanged=function(a,d,b){d=this.zapGremlins(d);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var c=a.getAttribute("placeholder"), f=a;null!=f;){if(f==this.model.getRoot()||null!=f.value&&"object"==typeof f.value&&f.hasAttribute(c)){this.setAttributeForCell(f,c,d);break}f=this.model.getParent(f)}var g=a.value.cloneNode(!0);g.setAttribute("label",d);d=g}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var d=new mxDictionary,b=0;b<a.length;b++)d.put(a[b],!0);for(var c=[],b=0;b<a.length;b++){var f=this.model.getParent(a[b]);null==f|| @@ -2342,9 +2342,9 @@ u=this.getCellGeometry(b[g].cell),c=c+p;null!=u&&null!=m&&(u=u.clone(),a?u.x=Mat this.view.getState(a[c]);if(null!=f){var g=this.getCellGeometry(d[c]);null==g||!g.relative||this.model.isEdge(a[c])||b.get(this.model.getParent(a[c]))||(g.relative=!1,g.x=f.x/f.view.scale-f.view.translate.x,g.y=f.y/f.view.scale-f.view.translate.y)}}b=new mxCodec;f=new mxGraphModel;g=f.getChildAt(f.getRoot(),0);for(c=0;c<a.length;c++)f.add(g,d[c]);return b.encode(f)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,d){return this.getLinkForCell(a.cell)}); return a};Graph.prototype.getSvg=function(a,d,b,c,f,g,e,h){d=null!=d?d:1;b=null!=b?b:0;f=null!=f?f:!0;g=null!=g?g:!0;e=null!=e?e:!0;c=g||c?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==c)throw Error(mxResources.get("drawingEmpty"));var p=this.view.scale,m=mxUtils.createXmlDocument(),u=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"svg"):m.createElement("svg");null!=a&&(null!=u.style?u.style.backgroundColor=a:u.setAttribute("style","background-color:"+ a));null==m.createElementNS?(u.setAttribute("xmlns",mxConstants.NS_SVG),u.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):u.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=d/p;u.setAttribute("width",Math.max(1,Math.ceil(c.width*a)+2*b)+"px");u.setAttribute("height",Math.max(1,Math.ceil(c.height*a)+2*b)+"px");u.setAttribute("version","1.1");var r=u;f&&(r=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"g"):m.createElement("g"),r.setAttribute("transform", -"translate(0.5,0.5)"),u.appendChild(r));m.appendChild(u);m=this.createSvgCanvas(r);m.foOffset=f?-.5:0;m.textOffset=f?-.5:0;m.imageOffset=f?-.5:0;m.translate(Math.floor((b/d-c.x)/p),Math.floor((b/d-c.y)/p));var v=document.createElement("textarea"),k=m.createAlternateContent;m.createAlternateContent=function(a,d,b,c,f,g,e,h,m,p,u,r,q){var x=this.state;if(null!=this.foAltText&&(0==c||0!=x.fontSize&&g.length<5*c/x.fontSize)){var w=this.createElement("text");w.setAttribute("x",Math.round(c/2));w.setAttribute("y", -Math.round((f+x.fontSize)/2));w.setAttribute("fill",x.fontColor||"black");w.setAttribute("text-anchor","middle");w.setAttribute("font-size",Math.round(x.fontSize)+"px");w.setAttribute("font-family",x.fontFamily);(x.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&w.setAttribute("font-weight","bold");(x.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&w.setAttribute("font-style","italic");(x.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&w.setAttribute("text-decoration", -"underline");try{return v.innerHTML=g,w.textContent=v.value,w}catch(Ba){return k.apply(this,arguments)}}else return k.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=p/d,d=this.view.translate,f=new mxRectangle(d.x*f,d.y*f,b.width*f,b.height*f),mxUtils.intersects(c,f)&&m.image(d.x,d.y,b.width,b.height,b.src,!0));m.scale(a);m.textEnabled=e;h=null!=h?h:this.createSvgImageExport();var q=h.drawCellState;h.drawCellState=function(a,d){(g||a.view.graph.isCellSelected(a.cell))&&q.apply(this,arguments)}; +"translate(0.5,0.5)"),u.appendChild(r));m.appendChild(u);m=this.createSvgCanvas(r);m.foOffset=f?-.5:0;m.textOffset=f?-.5:0;m.imageOffset=f?-.5:0;m.translate(Math.floor((b/d-c.x)/p),Math.floor((b/d-c.y)/p));var v=document.createElement("textarea"),k=m.createAlternateContent;m.createAlternateContent=function(a,d,b,c,f,g,e,h,m,p,u,r,q){var w=this.state;if(null!=this.foAltText&&(0==c||0!=w.fontSize&&g.length<5*c/w.fontSize)){var y=this.createElement("text");y.setAttribute("x",Math.round(c/2));y.setAttribute("y", +Math.round((f+w.fontSize)/2));y.setAttribute("fill",w.fontColor||"black");y.setAttribute("text-anchor","middle");y.setAttribute("font-size",Math.round(w.fontSize)+"px");y.setAttribute("font-family",w.fontFamily);(w.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold");(w.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");(w.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.setAttribute("text-decoration", +"underline");try{return v.innerHTML=g,y.textContent=v.value,y}catch(Ba){return k.apply(this,arguments)}}else return k.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=p/d,d=this.view.translate,f=new mxRectangle(d.x*f,d.y*f,b.width*f,b.height*f),mxUtils.intersects(c,f)&&m.image(d.x,d.y,b.width,b.height,b.src,!0));m.scale(a);m.textEnabled=e;h=null!=h?h:this.createSvgImageExport();var q=h.drawCellState;h.drawCellState=function(a,d){(g||a.view.graph.isCellSelected(a.cell))&&q.apply(this,arguments)}; h.drawState(this.getView().getState(this.model.root),m);return u};Graph.prototype.createSvgCanvas=function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var d=window.getSelection();d.getRangeAt&&d.rangeCount&&(a=d.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());return a};Graph.prototype.getParentByName=function(a,d,b){for(;null!=a&&a.nodeName!=d;){if(a==b)return null; a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var d=null;if(window.getSelection){if(d=window.getSelection(),d.getRangeAt&&d.rangeCount){var b=document.createRange();b.selectNode(a);d.removeAllRanges();d.addRange(b)}}else(d=document.selection)&&"Control"!=d.type&&(a=d.createRange(),a.collapse(!0),b=d.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=function(a,d){for(var b=a.tBodies[0],c=0<b.rows.length?b.rows[0].cells.length:1,b=b.insertRow(d), f=0;f<c;f++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow=function(a,d){a.tBodies[0].deleteRow(d)};Graph.prototype.insertColumn=function(a,d){var b=a.tHead;if(null!=b)for(var c=0;c<b.rows.length;c++){var f=document.createElement("th");b.rows[c].appendChild(f);mxUtils.br(f)}b=a.tBodies[0];for(c=0;c<b.rows.length;c++)f=b.rows[c].insertCell(d),mxUtils.br(f);return b.rows[0].cells[0<=d?d:b.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,d){if(0<=d)for(var b= @@ -2399,7 +2399,7 @@ arguments)};var w=(new Date).getTime(),u=0,v=mxEdgeHandler.prototype.updatePrevi "0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&r.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,d){var b=null!=a&&0==a,c=this.state.getVisibleTerminalState(b),f=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,c,b):null,b=null!=(null!=f?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b), f):null)?this.fixedHandleImage:null!=f&&null!=c?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var A=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,d,b){this.handleImage=d==mxEvent.ROTATION_HANDLE? HoverIcons.prototype.rotationHandle:d==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return A.apply(this,arguments)};var C=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var d=this.graph.getModel(),b=d.getParent(a[0]),c=this.graph.getCellGeometry(a[0]);if(d.isEdge(b)&&null!=c&&c.relative&&(d=this.graph.view.getState(a[0]),null!=d&&2>d.width&&2>d.height&&null!=d.text&&null!=d.text.boundingBox))return mxRectangle.fromRectangle(d.text.boundingBox)}return C.apply(this, -arguments)};var y=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var d=this.graph.getModel(),b=d.getParent(a.cell),c=this.graph.getCellGeometry(a.cell);return d.isEdge(b)&&null!=c&&c.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(d=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(d.x),Math.round(d.y),Math.round(d.width),Math.round(d.height))):y.apply(this,arguments)};var z=mxVertexHandler.prototype.mouseDown; +arguments)};var x=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var d=this.graph.getModel(),b=d.getParent(a.cell),c=this.graph.getCellGeometry(a.cell);return d.isEdge(b)&&null!=c&&c.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(d=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(d.x),Math.round(d.y),Math.round(d.width),Math.round(d.height))):x.apply(this,arguments)};var z=mxVertexHandler.prototype.mouseDown; mxVertexHandler.prototype.mouseDown=function(a,d){var b=this.graph.getModel(),c=b.getParent(this.state.cell),f=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(d)==mxEvent.ROTATION_HANDLE||!b.isEdge(c)||null==f||!f.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&z.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells|| this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};var B=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,d){B.apply(this,arguments);null!=this.graph.graphHandler.first&&null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none")};var F=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp= function(a,d){F.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var H=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){H.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));var d=mxUtils.bind(this,function(){null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display= @@ -2410,7 +2410,7 @@ document.createElement("img");c.setAttribute("src",IMAGE_PATH+"/edit.gif");c.set c.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));c.setAttribute("width","13");c.setAttribute("height","10");c.style.marginLeft="4px";c.style.marginBottom="-1px";c.style.cursor="pointer";this.linkHint.appendChild(c);mxEvent.addListener(c,"click",mxUtils.bind(this,function(a){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(a)}))}if(null!=b)for(c=0;c<b.length;c++){var f=document.createElement("div");f.style.marginTop=null!=d||0<c?"6px":"0px";f.appendChild(this.graph.createLinkForHint(b[c].getAttribute("href"), mxUtils.getTextContent(b[c])));this.linkHint.appendChild(f)}}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var L=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){L.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var a=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!= this.labelShape&&(this.labelShape.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none")});this.selectionHandler=mxUtils.bind(this,function(d,b){a()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler);this.changeHandler=mxUtils.bind(this,function(d,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));a();this.redrawHandles()});this.graph.getModel().addListener(mxEvent.CHANGE, -this.changeHandler);var d=this.graph.getLinkForCell(this.state.cell),b=this.graph.getLinksForState(this.state);if(null!=d||null!=b&&0<b.length)this.updateLinkHint(d,b),this.redrawHandles()};var x=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){x.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var I=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){I.apply(this); +this.changeHandler);var d=this.graph.getLinkForCell(this.state.cell),b=this.graph.getLinksForState(this.state);if(null!=d||null!=b&&0<b.length)this.updateLinkHint(d,b),this.redrawHandles()};var y=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){y.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var I=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){I.apply(this); if(null!=this.state&&null!=this.linkHint){var a=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),d=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),b=mxUtils.getBoundingBox(d,this.state.style[mxConstants.STYLE_ROTATION]||"0",a),a=null!=b?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,d=null!=this.state.text?this.state.text.boundingBox:null;null==b&&(b=this.state);b=b.y+b.height;null!=d&&(b=Math.max(b, d.y+d.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(b+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var E=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){E.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var Q=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy= function(){Q.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var X=mxEdgeHandler.prototype.redrawHandles; @@ -2418,8 +2418,8 @@ mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(X.apply( function(){R.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Z=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Z.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler), this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function e(){mxCylinder.call(this)}function c(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function l(){mxActor.call(this)}function n(){mxCylinder.call(this)}function q(){mxActor.call(this)}function t(){mxActor.call(this)}function d(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function p(){mxActor.call(this)}function m(){mxActor.call(this)}function h(a,d){this.canvas= a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=d;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,h.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,h.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,h.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,h.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo; -this.canvas.curveTo=mxUtils.bind(this,h.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,h.prototype.arcTo)}function w(){mxRectangleShape.call(this)}function u(){mxRectangleShape.call(this)}function v(){mxActor.call(this)}function r(){mxActor.call(this)}function A(){mxActor.call(this)}function C(){mxRectangleShape.call(this)}function y(){mxRectangleShape.call(this)}function z(){mxCylinder.call(this)}function B(){mxShape.call(this)}function F(){mxShape.call(this)} -function H(){mxEllipse.call(this)}function L(){mxShape.call(this)}function x(){mxShape.call(this)}function I(){mxRectangleShape.call(this)}function E(){mxShape.call(this)}function Q(){mxShape.call(this)}function X(){mxShape.call(this)}function R(){mxCylinder.call(this)}function Z(){mxDoubleEllipse.call(this)}function G(){mxDoubleEllipse.call(this)}function K(){mxArrowConnector.call(this);this.spacing=0}function S(){mxArrowConnector.call(this);this.spacing=0}function J(){mxActor.call(this)}function N(){mxRectangleShape.call(this)} +this.canvas.curveTo=mxUtils.bind(this,h.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,h.prototype.arcTo)}function w(){mxRectangleShape.call(this)}function u(){mxRectangleShape.call(this)}function v(){mxActor.call(this)}function r(){mxActor.call(this)}function A(){mxActor.call(this)}function C(){mxRectangleShape.call(this)}function x(){mxRectangleShape.call(this)}function z(){mxCylinder.call(this)}function B(){mxShape.call(this)}function F(){mxShape.call(this)} +function H(){mxEllipse.call(this)}function L(){mxShape.call(this)}function y(){mxShape.call(this)}function I(){mxRectangleShape.call(this)}function E(){mxShape.call(this)}function Q(){mxShape.call(this)}function X(){mxShape.call(this)}function R(){mxCylinder.call(this)}function Z(){mxDoubleEllipse.call(this)}function G(){mxDoubleEllipse.call(this)}function K(){mxArrowConnector.call(this);this.spacing=0}function S(){mxArrowConnector.call(this);this.spacing=0}function J(){mxActor.call(this)}function N(){mxRectangleShape.call(this)} function U(){mxActor.call(this)}function D(){mxActor.call(this)}function W(){mxActor.call(this)}function O(){mxActor.call(this)}function T(){mxActor.call(this)}function V(){mxActor.call(this)}function Y(){mxActor.call(this)}function M(){mxActor.call(this)}function ca(){mxActor.call(this)}function da(){mxActor.call(this)}function aa(){mxEllipse.call(this)}function ea(){mxEllipse.call(this)}function la(){mxEllipse.call(this)}function ha(){mxRhombus.call(this)}function ra(){mxEllipse.call(this)}function fa(){mxEllipse.call(this)} function ma(){mxEllipse.call(this)}function ba(){mxEllipse.call(this)}function pa(){mxActor.call(this)}function ia(){mxActor.call(this)}function qa(){mxActor.call(this)}function na(){mxConnector.call(this)}function Aa(a,d,b,c,f,g,e,h,p,m){e+=p;var ja=c.clone();c.x-=f*(2*e+p);c.y-=g*(2*e+p);f*=e+p;g*=e+p;return function(){a.ellipse(ja.x-f-e,ja.y-g-e,2*e,2*e);m?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxCylinder);a.prototype.size=20;a.prototype.redrawPath=function(a,d,b,c,f,g){d=Math.max(0,Math.min(c, Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g?(a.moveTo(d,f),a.lineTo(d,d),a.lineTo(0,0),a.moveTo(d,d),a.lineTo(c,d)):(a.moveTo(0,0),a.lineTo(c-d,0),a.lineTo(c,d),a.lineTo(c,f),a.lineTo(d,f),a.lineTo(0,f-d),a.lineTo(0,0),a.close());a.end()};a.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?(a=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(a,a,0,0)):null};mxCellRenderer.registerShape("cube", @@ -2451,13 +2451,13 @@ v);mxUtils.extend(r,mxActor);r.prototype.size=.2;r.prototype.fixedSize=20;r.prot d,f),new mxPoint(0,f),new mxPoint(d,f/2)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("step",r);mxUtils.extend(A,mxHexagon);A.prototype.size=.25;A.prototype.redrawPath=function(a,d,b,c,f){d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(d,0),new mxPoint(c-d,0),new mxPoint(c,.5*f),new mxPoint(c-d,f),new mxPoint(d,f),new mxPoint(0,.5*f)], this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",A);mxUtils.extend(C,mxRectangleShape);C.prototype.isHtmlAllowed=function(){return!1};C.prototype.paintForeground=function(a,d,b,c,f){var g=Math.min(c/5,f/5)+1;a.begin();a.moveTo(d+c/2,b+g);a.lineTo(d+c/2,b+f-g);a.moveTo(d+g,b+f/2);a.lineTo(d+c-g,b+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",C);var Ca=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds= function(a){if(1==this.style["double"]){var d=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+d,a.y+d,a.width-2*d,a.height-2*d)}return a};mxRhombus.prototype.paintVertexShape=function(a,d,b,c,f){Ca.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var g=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);d+=g;b+=g;c-=2*g;f-=2*g;0<c&&0<f&&(a.setShadow(!1),Ca.apply(this,[a,d, -b,c,f]))}};mxUtils.extend(y,mxRectangleShape);y.prototype.isHtmlAllowed=function(){return!1};y.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var d=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+d,a.y+d,a.width-2*d,a.height-2*d)}return a};y.prototype.paintForeground=function(a,d,b,c,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var g=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]|| +b,c,f]))}};mxUtils.extend(x,mxRectangleShape);x.prototype.isHtmlAllowed=function(){return!1};x.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var d=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+d,a.y+d,a.width-2*d,a.height-2*d)}return a};x.prototype.paintForeground=function(a,d,b,c,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var g=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]|| 0);d+=g;b+=g;c-=2*g;f-=2*g;0<c&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var g=0,e;do{e=mxCellRenderer.defaultShapes[this.style["symbol"+g]];if(null!=e){var h=this.style["symbol"+g+"Align"],ja=this.style["symbol"+g+"VerticalAlign"],p=this.style["symbol"+g+"Width"],m=this.style["symbol"+g+"Height"],u=this.style["symbol"+g+"Spacing"]||0,r=this.style["symbol"+g+"VSpacing"]||u,v=this.style["symbol"+g+"ArcSpacing"];null!=v&&(v*=this.getArcSize(c+this.strokewidth, -f+this.strokewidth),u+=v,r+=v);var v=d,k=b,v=h==mxConstants.ALIGN_CENTER?v+(c-p)/2:h==mxConstants.ALIGN_RIGHT?v+(c-p-u):v+u,k=ja==mxConstants.ALIGN_MIDDLE?k+(f-m)/2:ja==mxConstants.ALIGN_BOTTOM?k+(f-m-r):k+r;a.save();h=new e;h.style=this.style;e.prototype.paintVertexShape.call(h,a,v,k,p,m);a.restore()}g++}while(null!=e)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",y);mxUtils.extend(z,mxCylinder);z.prototype.redrawPath=function(a,d,b,c,f,g){g? +f+this.strokewidth),u+=v,r+=v);var v=d,k=b,v=h==mxConstants.ALIGN_CENTER?v+(c-p)/2:h==mxConstants.ALIGN_RIGHT?v+(c-p-u):v+u,k=ja==mxConstants.ALIGN_MIDDLE?k+(f-m)/2:ja==mxConstants.ALIGN_BOTTOM?k+(f-m-r):k+r;a.save();h=new e;h.style=this.style;e.prototype.paintVertexShape.call(h,a,v,k,p,m);a.restore()}g++}while(null!=e)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",x);mxUtils.extend(z,mxCylinder);z.prototype.redrawPath=function(a,d,b,c,f,g){g? (a.moveTo(0,0),a.lineTo(c/2,f/2),a.lineTo(c,0),a.end()):(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,f),a.lineTo(0,f),a.close())};mxCellRenderer.registerShape("message",z);mxUtils.extend(B,mxShape);B.prototype.paintBackground=function(a,d,b,c,f){a.translate(d,b);a.ellipse(c/4,0,c/2,f/4);a.fillAndStroke();a.begin();a.moveTo(c/2,f/4);a.lineTo(c/2,2*f/3);a.moveTo(c/2,f/3);a.lineTo(0,f/3);a.moveTo(c/2,f/3);a.lineTo(c,f/3);a.moveTo(c/2,2*f/3);a.lineTo(0,f);a.moveTo(c/2,2*f/3);a.lineTo(c,f);a.end();a.stroke()}; mxCellRenderer.registerShape("umlActor",B);mxUtils.extend(F,mxShape);F.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};F.prototype.paintBackground=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(0,f/4);a.lineTo(0,3*f/4);a.end();a.stroke();a.begin();a.moveTo(0,f/2);a.lineTo(c/6,f/2);a.end();a.stroke();a.ellipse(c/6,0,5*c/6,f);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",F);mxUtils.extend(H,mxEllipse);H.prototype.paintVertexShape=function(a,d, -b,c,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(d+c/8,b+f);a.lineTo(d+7*c/8,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",H);mxUtils.extend(L,mxShape);L.prototype.paintVertexShape=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(c,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(c,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",L);mxUtils.extend(x,mxShape);x.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+ -a.height/8,a.width,7*a.height/8)};x.prototype.paintBackground=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(3*c/8,f/8*1.1);a.lineTo(5*c/8,0);a.end();a.stroke();a.ellipse(0,f/8,c,7*f/8);a.fillAndStroke()};x.prototype.paintForeground=function(a,d,b,c,f){a.begin();a.moveTo(3*c/8,f/8*1.1);a.lineTo(5*c/8,f/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",x);mxUtils.extend(I,mxRectangleShape);I.prototype.size=40;I.prototype.isHtmlAllowed=function(){return!1};I.prototype.getLabelBounds= +b,c,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(d+c/8,b+f);a.lineTo(d+7*c/8,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",H);mxUtils.extend(L,mxShape);L.prototype.paintVertexShape=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(c,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(c,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",L);mxUtils.extend(y,mxShape);y.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+ +a.height/8,a.width,7*a.height/8)};y.prototype.paintBackground=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(3*c/8,f/8*1.1);a.lineTo(5*c/8,0);a.end();a.stroke();a.ellipse(0,f/8,c,7*f/8);a.fillAndStroke()};y.prototype.paintForeground=function(a,d,b,c,f){a.begin();a.moveTo(3*c/8,f/8*1.1);a.lineTo(5*c/8,f/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",y);mxUtils.extend(I,mxRectangleShape);I.prototype.size=40;I.prototype.isHtmlAllowed=function(){return!1};I.prototype.getLabelBounds= function(a){var d=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,d)};I.prototype.paintBackground=function(a,d,b,c,f){var g=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),e=mxUtils.getValue(this.style,"participant");null==e||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,d,b,c,g):(e=this.state.view.graph.cellRenderer.getShape(e),null!=e&&e!=I&&(e=new e, e.apply(this.state),a.save(),e.paintVertexShape(a,d,b,c,g),a.restore()));g<f&&(a.setDashed(!0),a.begin(),a.moveTo(d+c/2,b+g),a.lineTo(d+c/2,b+f),a.end(),a.stroke())};I.prototype.paintForeground=function(a,d,b,c,f){var g=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,d,b,c,Math.min(f,g))};mxCellRenderer.registerShape("umlLifeline",I);mxUtils.extend(E,mxShape);E.prototype.width=60;E.prototype.height=30;E.prototype.corner= 10;E.prototype.getLabelMargins=function(a){return new mxRectangle(0,0,a.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),a.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};E.prototype.paintBackground=function(a,d,b,c,f){var g=this.corner,e=Math.min(c,Math.max(g,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),h=Math.min(f,Math.max(1.5*g,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),p=mxUtils.getValue(this.style, @@ -2685,8 +2685,8 @@ mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegist PrintDialog.prototype.create=function(a,d){function b(){l.value=Math.max(1,Math.min(h,Math.max(parseInt(l.value),parseInt(w.value))));w.value=Math.max(1,Math.min(h,Math.min(parseInt(l.value),parseInt(w.value))))}function c(d){function b(d,b,f){var g=d.getGraphBounds(),e=0,h=0,p=Y.get(),m=1/d.pageScale,k=t.checked;if(k)var m=parseInt(T.value),r=parseInt(V.value),m=Math.min(p.height*r/(g.height/d.view.scale),p.width*m/(g.width/d.view.scale));else m=parseInt(q.value)/(100*d.pageScale),isNaN(m)&&(c=1/ d.pageScale,q.value="100 %");p=mxRectangle.fromRectangle(p);p.width=Math.ceil(p.width*c);p.height=Math.ceil(p.height*c);m*=c;!k&&d.pageVisible?(g=d.getPageLayout(),e-=g.x*p.width,h-=g.y*p.height):k=!0;if(null==b){b=PrintDialog.createPrintPreview(d,m,p,0,e,h,k);b.pageSelector=!1;b.mathEnabled=!1;d=a.getCurrentFile();null!=d&&(b.title=d.getTitle());var u=b.writeHead;b.writeHead=function(d){u.apply(this,arguments);null!=a.editor.fontCss&&(d.writeln('<style type="text/css">'),d.writeln(a.editor.fontCss), d.writeln("</style>"))};if("undefined"!==typeof MathJax){var w=b.renderPage;b.renderPage=function(a,d,b,c,f,g){var e=w.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:e.className="geDisableMathJax";return e}}b.open(null,null,f,!0)}else{p=d.background;if(null==p||""==p||p==mxConstants.NONE)p="#ffffff";b.backgroundColor=p;b.autoOrigin=k;b.appendGraph(d,m,e,h,f,!0)}return b}var c=parseInt(M.value)/100;isNaN(c)&&(c=1,M.value="100 %");var c=.75*c,g=w.value,e=l.value,h=!k.checked,m=null; -h&&(h=g==p&&e==p);if(!h&&null!=a.pages&&a.pages.length){var r=0,h=a.pages.length-1;k.checked||(r=parseInt(g)-1,h=parseInt(e)-1);for(var u=r;u<=h;u++){var x=a.pages[u],g=x==a.currentPage?f:null;if(null==g){var g=a.createTemporaryGraph(f.getStylesheet()),e=!0,r=!1,n=null,v=null;null==x.viewState&&null==x.mapping&&null==x.root&&a.updatePageRoot(x);null!=x.viewState?(e=x.viewState.pageVisible,r=x.viewState.mathEnabled,n=x.viewState.background,v=x.viewState.backgroundImage):null!=x.mapping&&null!=x.mapping.diagramMap&& -(r="0"!=x.mapping.diagramMap.get("mathEnabled"),n=x.mapping.diagramMap.get("background"),v=x.mapping.diagramMap.get("backgroundImage"),v=null!=v&&0<v.length?JSON.parse(v):null);g.background=n;g.backgroundImage=null!=v?new mxImage(v.src,v.width,v.height):null;g.pageVisible=e;g.mathEnabled=r;var A=g.getGlobalVariable;g.getGlobalVariable=function(a){return"page"==a?x.getName():"pagenumber"==a?u+1:A.apply(this,arguments)};document.body.appendChild(g.container);a.updatePageRoot(x);g.model.setRoot(x.root)}m= +h&&(h=g==p&&e==p);if(!h&&null!=a.pages&&a.pages.length){var r=0,h=a.pages.length-1;k.checked||(r=parseInt(g)-1,h=parseInt(e)-1);for(var u=r;u<=h;u++){var y=a.pages[u],g=y==a.currentPage?f:null;if(null==g){var g=a.createTemporaryGraph(f.getStylesheet()),e=!0,r=!1,n=null,v=null;null==y.viewState&&null==y.mapping&&null==y.root&&a.updatePageRoot(y);null!=y.viewState?(e=y.viewState.pageVisible,r=y.viewState.mathEnabled,n=y.viewState.background,v=y.viewState.backgroundImage):null!=y.mapping&&null!=y.mapping.diagramMap&& +(r="0"!=y.mapping.diagramMap.get("mathEnabled"),n=y.mapping.diagramMap.get("background"),v=y.mapping.diagramMap.get("backgroundImage"),v=null!=v&&0<v.length?JSON.parse(v):null);g.background=n;g.backgroundImage=null!=v?new mxImage(v.src,v.width,v.height):null;g.pageVisible=e;g.mathEnabled=r;var A=g.getGlobalVariable;g.getGlobalVariable=function(a){return"page"==a?y.getName():"pagenumber"==a?u+1:A.apply(this,arguments)};document.body.appendChild(g.container);a.updatePageRoot(y);g.model.setRoot(y.root)}m= b(g,m,u!=h);g!=f&&g.container.parentNode.removeChild(g.container)}}else m=b(f);m.mathEnabled&&(h=m.wnd.document,h.writeln('<script type="text/x-mathjax-config">'),h.writeln("MathJax.Hub.Config({"),h.writeln('messageStyle: "none",'),h.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),h.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),h.writeln("TeX: {"),h.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'), h.writeln("},"),h.writeln("tex2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("},"),h.writeln("asciimath2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("}"),h.writeln("});"),d&&(h.writeln("MathJax.Hub.Queue(function () {"),h.writeln("window.print();"),h.writeln("});")),h.writeln("\x3c/script>"),h.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));m.closeDocument();!m.mathEnabled&&d&&PrintDialog.printPreview(m)} var f=a.editor.graph,g=document.createElement("div"),e=document.createElement("h3");e.style.width="100%";e.style.textAlign="center";e.style.marginTop="0px";mxUtils.write(e,d||mxResources.get("print"));g.appendChild(e);var h=1,p=1,m=document.createElement("div");m.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","all");k.setAttribute("type","radio"); @@ -2748,82 +2748,83 @@ function(a){var d=mxUtils.parseXml(a.getData());if("mxlibrary"==d.documentElemen b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var d=a.data;null!=d&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){d=this.convertDataUri(d);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+d,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var d=this.stringToCells(this.editor.graph.decompress(a.xml)); return this.sidebar.createVertexTemplateFromCells(d,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);c=null!=c&&0<c.length?c:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(d);var l=k.parentNode.previousSibling;c=l.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&l.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var r=document.createElement("div");r.style.position="absolute";r.style.right="0px";r.style.top= "5px";mxClient.IS_QUIRKS||8==document.documentMode||(r.style.backgroundColor="inherit");l.style.position="relative";var n=document.createElement("img");n.setAttribute("src",Dialog.prototype.closeImage);n.setAttribute("title",mxResources.get("close"));n.setAttribute("align","top");n.setAttribute("border","0");n.className="geButton";n.style.marginRight="1px";n.style.marginTop="-1px";r.appendChild(n);var q=null;mxEvent.addListener(n,"click",mxUtils.bind(this,function(d){if(!mxEvent.isConsumed(d)){var b= -mxUtils.bind(this,function(){this.closeLibrary(a)});null!=q?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(d)}}));if(a.isEditable()){var y=this.editor.graph,t=null,B=mxUtils.bind(this,function(d){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(d)}),F=mxUtils.bind(this,function(d){a.setModified(!0);a.isAutosave()?(null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t),t=n.cloneNode(!1), +mxUtils.bind(this,function(){this.closeLibrary(a)});null!=q?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(d)}}));if(a.isEditable()){var x=this.editor.graph,t=null,B=mxUtils.bind(this,function(d){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(d)}),F=mxUtils.bind(this,function(d){a.setModified(!0);a.isAutosave()?(null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t),t=n.cloneNode(!1), t.setAttribute("src",Editor.spinImage),t.setAttribute("title",mxResources.get("saving")),t.style.cursor="default",t.style.marginRight="2px",t.style.marginTop="-2px",r.insertBefore(t,r.firstChild),l.style.paddingRight=18*r.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=t&&null!=t.parentNode&&(t.parentNode.removeChild(t),l.style.paddingRight=18*r.childNodes.length+"px")})):null==q&&(q=n.cloneNode(!1),q.setAttribute("src",IMAGE_PATH+"/download.png"),q.setAttribute("title", -mxResources.get("save")),r.insertBefore(q,r.firstChild),mxEvent.addListener(q,"click",mxUtils.bind(this,function(d){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==q||a.isModified()||(l.style.paddingRight=18*r.childNodes.length+"px",q.parentNode.removeChild(q),q=null)});mxEvent.consume(d)})),l.style.paddingRight=18*r.childNodes.length+"px")}),H=mxUtils.bind(this,function(a,d,c,e){a=y.cloneCells(mxUtils.sortCells(y.model.getTopmostCells(a)));for(var g= -0;g<a.length;g++){var h=y.getCellGeometry(a[g]);null!=h&&h.translate(-d.x,-d.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,d.width,d.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:d.width,h:d.height};null!=e&&(a.title=e);b.push(a);F(c);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),L=mxUtils.bind(this,function(a){if(y.isSelectionEmpty())y.getRubberband().isActive()?(y.getRubberband().execute(a), -y.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var d=y.getSelectionCells(),b=y.view.getBounds(d),c=y.view.scale;b.x/=c;b.y/=c;b.width/=c;b.height/=c;b.x-=y.view.translate.x;b.y-=y.view.translate.y;H(d,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){y.isMouseDown&&null!=y.panningManager&&null!=y.graphHandler.shape&&(y.graphHandler.shape.node.style.visibility= -"hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",y.panningManager.stop(),y.autoScroll=!1,null!=y.graphHandler.guide&&y.graphHandler.guide.setVisible(!1),null!=y.graphHandler.hint&&(y.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){y.isMouseDown&&null!=y.panningManager&&null!=y.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"), -k.style.cursor="default",this.sidebar.showTooltips=!0,y.panningManager.stop(),y.graphHandler.reset(),y.isMouseDown=!1,y.autoScroll=!0,L(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){y.isMouseDown&&null!=y.graphHandler.shape&&(y.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor="",y.autoScroll=!0,null!=y.graphHandler.guide&&y.graphHandler.guide.setVisible(!0),null!=y.graphHandler.hint&&(y.graphHandler.hint.style.visibility= +mxResources.get("save")),r.insertBefore(q,r.firstChild),mxEvent.addListener(q,"click",mxUtils.bind(this,function(d){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==q||a.isModified()||(l.style.paddingRight=18*r.childNodes.length+"px",q.parentNode.removeChild(q),q=null)});mxEvent.consume(d)})),l.style.paddingRight=18*r.childNodes.length+"px")}),H=mxUtils.bind(this,function(a,d,c,e){a=x.cloneCells(mxUtils.sortCells(x.model.getTopmostCells(a)));for(var g= +0;g<a.length;g++){var h=x.getCellGeometry(a[g]);null!=h&&h.translate(-d.x,-d.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,d.width,d.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:d.width,h:d.height};null!=e&&(a.title=e);b.push(a);F(c);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),L=mxUtils.bind(this,function(a){if(x.isSelectionEmpty())x.getRubberband().isActive()?(x.getRubberband().execute(a), +x.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var d=x.getSelectionCells(),b=x.view.getBounds(d),c=x.view.scale;b.x/=c;b.y/=c;b.width/=c;b.height/=c;b.x-=x.view.translate.x;b.y-=x.view.translate.y;H(d,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){x.isMouseDown&&null!=x.panningManager&&null!=x.graphHandler.shape&&(x.graphHandler.shape.node.style.visibility= +"hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",x.panningManager.stop(),x.autoScroll=!1,null!=x.graphHandler.guide&&x.graphHandler.guide.setVisible(!1),null!=x.graphHandler.hint&&(x.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){x.isMouseDown&&null!=x.panningManager&&null!=x.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"), +k.style.cursor="default",this.sidebar.showTooltips=!0,x.panningManager.stop(),x.graphHandler.reset(),x.isMouseDown=!1,x.autoScroll=!0,L(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){x.isMouseDown&&null!=x.graphHandler.shape&&(x.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor="",x.autoScroll=!0,null!=x.graphHandler.guide&&x.graphHandler.guide.setVisible(!0),null!=x.graphHandler.hint&&(x.graphHandler.hint.style.visibility= "visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border= "3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(d,c,g,h,p,m,r,u,l){if(null!=d&&"image/"==c.substring(0,6))d="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(d),d=[new mxCell("",new mxGeometry(0,0,p,m),d)],d[0].vertex=!0,H(d,new mxRectangle(0,0,p,m),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&& 0<b.length&&(f.parentNode.removeChild(f),f=null);else{var n=!1,w=mxUtils.bind(this,function(d,c){if(null!=d&&"text/xml"==c){var g=mxUtils.parseXml(d);if("mxlibrary"==g.documentElement.nodeName)try{var h=JSON.parse(mxUtils.getTextContent(g.documentElement));e(h,k);b=b.concat(h);F(a);this.spinner.stop();n=!0}catch(M){}else if("mxfile"==g.documentElement.nodeName)try{for(var p=g.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var h=mxUtils.getTextContent(p[g]),m=this.stringToCells(this.editor.graph.decompress(h)), -r=this.editor.graph.getBoundingBoxFromGeometry(m);H(m,new mxRectangle(0,0,r.width,r.height),a)}n=!0}catch(M){null!=window.console&&console.log("error in drop handler:",M)}}n||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=l&&null!=r&&(/(\.vsdx)($|\?)/i.test(r)||/(\.vssx)($|\?)/i.test(r))?this.importVisio(l,function(a){w(a,"text/xml")}):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(d,r)&&null!=l?this.parseFile(l,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?w(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):w(d,c)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border="3px solid transparent", -k.style.cursor="");a.stopPropagation();a.preventDefault()}));n=n.cloneNode(!1);n.setAttribute("src",IMAGE_PATH+"/edit.gif");n.setAttribute("title",mxResources.get("edit"));r.insertBefore(n,r.firstChild);mxEvent.addListener(n,"click",B);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&B(a)});c=n.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));r.insertBefore(c,r.firstChild);mxEvent.addListener(c,"click",L);this.isOffline()||".scratchpad"!= -a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),r.insertBefore(c,r.firstChild))}l.appendChild(r);l.style.paddingRight=18*r.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight= -4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position= -"relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"), -Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a", -Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor= -"#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))}; -EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display="none",this.refresh())};EditorUi.prototype.showFooter=function(a){var d=document.getElementById("geFooter");null!=d&&(this.footerHeight=a,d.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,e,m){a=new ImageDialog(this,a,b,c,e,m);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0, -!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var d=new BackgroundImageDialog(this,mxUtils.bind(this,function(d){a(d)}));this.showDialog(d.container,360,200,!0,!0);d.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,e,m){a=new LibraryDialog(this,a,b,c,e,m);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null== -this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer");a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this, -function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),g=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),g=function(){d();f.retry()}),"undefined"!= -typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var k=window.location.hash;null!=k&&"#G"==k.substring(0,2)&&(k=k.substring(2), -a+=' <a href="https://drive.google.com/open?id='+k+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a=mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,c,g)}else null!=c&&c()};EditorUi.prototype.showError= -function(a,b,c,e,m,h,k){a=new ErrorDialog(this,a,b,c,e,m,h,k);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var d=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(d.container,340,100,!0,!1);d.init()};EditorUi.prototype.confirm=function(a,b,c,e,m){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){d();null!=b&&b()},function(){d();null!=c&&c()},e,m)).container, -340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,c){var d=a.toDataURL("image/"+c);if(6>=d.length|| -d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return d};EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,f=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(f,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&& -"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.doSaveLocalFile=function(a,b,c,e,m){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs", -!0,b),c.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height="380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var d=document.createElement("a"),f=!mxClient.IS_SF&&"undefined"!==typeof d.download;if(f||this.isOffline()){d.href=URL.createObjectURL(e?this.base64ToBlob(a,c):new Blob([a],{type:c}));f?d.download=b:d.setAttribute("target","_blank"); -document.body.appendChild(d);try{window.setTimeout(function(){URL.revokeObjectURL(d.href)},0),d.click(),d.parentNode.removeChild(d)}catch(u){}}else this.createEchoRequest(a,b,c,e,m).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,e,m,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=m?"&format="+m:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob= -function(a,b){b=b||"";for(var d=atob(a),c=d.length,f=Math.ceil(c/1024),e=Array(f),k=0;k<f;++k){for(var l=1024*k,n=Math.min(l+1024,c),r=Array(n-l),q=0;l<n;++q,++l)r[q]=d[l].charCodeAt(0);e[k]=new Uint8Array(r)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,e,m,h,k){h=null!=h?h:!1;k=null!=k?k:"vsdx"!=m&&(!mxClient.IS_IOS||!navigator.standalone);m=this.getServiceCount(h);b=new CreateDialog(this,b,mxUtils.bind(this,function(d,b){try{if("_blank"==b)if(null==c||"image/"!=c.substring(0, -6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,c,e);else b==App.MODE_DEVICE?this.doSaveLocalFile(a,d,c,e):null!=d&&0<d.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,d,c,e,b,f)}catch(C){this.handleError(C)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"), -mxResources.get("download"),!1,h,k,null,null,4<m?3:4,a,c,e);this.showDialog(b.container,420,m==(mxClient.IS_IOS?0:1)?160:4<m?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+ -'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var d=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog), -this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var c=d.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding= -"4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=c.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";c=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=c.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog); -this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var d=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",d);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this, -function(){this.openInNewWindow(d.substring(d.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,e,m){this.isLocalFileSave()?this.saveLocalFile(c, -a,e,m,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,d){return this.createEchoRequest(c,a,e,m,b,d)}),c,m,e)};EditorUi.prototype.saveRequest=function(a,b,c,e,m,h,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var d=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,d){if("_blank"==d||null!=a&&0<a.length){var f=c("_blank"==d?null:a,d==App.MODE_DEVICE||null==d||"_blank"==d?"0":"1");null!=f&&(d==App.MODE_DEVICE||"_blank"==d?f.simulate(document,"_blank"):this.pickFolder(d, -mxUtils.bind(this,function(c){h=null!=h?h:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,h,!0,d,c)}catch(y){this.handleError(y)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,h,!0,d,c)}catch(y){this.handleError(y)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}), -mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,k,null,null,4<d?3:4,e,h,m);this.showDialog(a.container,380,d==(mxClient.IS_IOS?0:1)?160:4<d?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,e,m,h){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,e,m,h,k,l,n){if(this.spinner.spin(document.body, -mxResources.get("export"))){var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;d=b?null:this.editor.graph.background;d==mxConstants.NONE&&(d=null);null==d&&0==b&&(d="#ffffff");var f=this.editor.graph.getSvg(d,a,k,l,null,c);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();m&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,n));if(null!=this.editor.fontCss){var d=a.ownerDocument,d=null!=d.createElementNS? -d.createElementNS(mxConstants.NS_SVG,"style"):d.createElement("style");d.setAttribute("type","text/css");mxUtils.setTextContent(d,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(d)}var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"), -mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){h?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,p,this.thumbImageCache)):p(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,c,e,m,h){h=null!=h?h:!0;var d=document.createElement("input");d.style.marginRight="8px";d.style.marginTop="16px";d.setAttribute("type","checkbox");c&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);e&&d.setAttribute("disabled", -"disabled");h&&(a.appendChild(d),mxUtils.write(a,b),m||mxUtils.br(a));return d};EditorUi.prototype.addEditButton=function(a,b){var d=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);d.style.marginLeft="24px";var c=this.getCurrentFile(),f="";null!=c&&c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";c=document.createElement("option"); -c.setAttribute("value","blank");mxUtils.write(c,mxResources.get("makeCopy"));e.appendChild(c);c=document.createElement("option");c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom")+"...");e.appendChild(c);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container, -300,80,!0,!1);a.init()}}));mxEvent.addListener(d,"change",mxUtils.bind(this,function(){d.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return d.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return d},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function d(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE? -"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var c=document.createElement("select");c.style.width="100px";c.style.marginLeft="8px";c.style.marginRight="10px";c.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));c.appendChild(f);f=document.createElement("option"); -f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));c.appendChild(f);f=document.createElement("option");f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));c.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),c.appendChild(f));a.appendChild(c);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",k= -null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;d()});mxEvent.consume(a)}));d();k.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return c.value},focus:function(){c.focus()}}}; -EditorUi.prototype.createLink=function(a,b,c,e,m,h,k,l){var d=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=m&&0<m.length&&f.push("edit="+encodeURIComponent(m)),h&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a); -break}a=!0;null!=k?c="#U"+encodeURIComponent(k):(d=this.getCurrentFile(),l||null==d||d.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+d.getHash(),a=!1));a&&null!=d&&null!=d.getTitle()&&d.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(d.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)? -"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,e,m,h,k,l,n,r,q){this.getBasenames();var d={};""!=m&&m!=mxConstants.NONE&&(d.highlight=m);"auto"!==e&&(d.target=e);n||(d.lightbox=!1);d.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(d.zoom=c/100);c=[];k&&(c.push("pages"),d.resize=!0,null!=this.pages&&null!=this.currentPage&&(d.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"), -d.resize=!0);l&&c.push("layers");0<c.length&&(n&&c.push("lightbox"),d.toolbar=c.join(" "));null!=r&&0<r.length&&(d.edit=r);null!=a?d.url=a:d.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(h?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(d))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";q(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1": -"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;"; -var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";p.setAttribute("value","url");p.setAttribute("type","radio");p.setAttribute("name","type-embedhtmldialog");f=p.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(k);mxUtils.br(g);g.appendChild(p);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl")); -g.appendChild(k);var r=this.getCurrentFile();null==c&&null!=r&&r.constructor==window.DriveFile&&(k=document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),g.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(r.getId())})));f.setAttribute("checked","checked");null==c&&p.setAttribute("disabled","disabled");d.appendChild(g);var l= -this.addLinkSection(d),n=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d,":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value="100%";d.appendChild(q);var t=this.addCheckbox(d,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,B=B=this.addCheckbox(d,mxResources.get("allPages"),g,!g),F=this.addCheckbox(d,mxResources.get("layers"),!0), -H=this.addCheckbox(d,mxResources.get("lightbox"),!0),L=this.addEditButton(d,H),x=L.getEditInput();x.style.marginBottom="16px";mxEvent.addListener(H,"change",function(){H.checked?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled");x.checked&&H.checked?L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,d,mxUtils.bind(this,function(){e(p.checked?c:null,n.checked,q.value,l.getTarget(),l.getColor(),t.checked,B.checked, -F.checked,H.checked,L.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,m,h){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(f);var g=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!= -g&&g.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var k=document.createElement("div");k.style.whiteSpace="normal";mxUtils.write(k,mxResources.get("linkAccountRequired"));p.appendChild(k);k=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())})); -k.style.marginTop="12px";k.className="geBtn";p.appendChild(k);d.appendChild(p);k=document.createElement("a");k.style.paddingLeft="12px";k.style.color="gray";k.style.fontSize="11px";k.setAttribute("href","javascript:void(0);");mxUtils.write(k,mxResources.get("check"));p.appendChild(k);mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this, -null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var l=null,n=null;if(null!=c||null!=e)a+=30,mxUtils.write(d,mxResources.get("width")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.marginRight="16px",l.style.width="50px",l.style.marginLeft="6px",l.style.marginRight="16px",l.style.marginBottom="10px",l.value="100%",d.appendChild(l),mxUtils.write(d,mxResources.get("height")+ -":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.width="50px",n.style.marginLeft="6px",n.style.marginBottom="10px",n.value=e+"px",d.appendChild(n),mxUtils.br(d);var q=this.addLinkSection(d,h);c=null!=this.pages&&1<this.pages.length;var t=null;if(null==g||g.constructor!=window.DriveFile||b)t=this.addCheckbox(d,mxResources.get("allPages"),c,!c);var F=this.addCheckbox(d,mxResources.get("lightbox"),!0),H=this.addEditButton(d,F),L=H.getEditInput(),x=this.addCheckbox(d,mxResources.get("layers"), -!0);x.style.marginLeft=L.style.marginLeft;x.style.marginBottom="16px";x.style.marginTop="8px";mxEvent.addListener(F,"change",function(){F.checked?(x.removeAttribute("disabled"),L.removeAttribute("disabled")):(x.setAttribute("disabled","disabled"),L.setAttribute("disabled","disabled"));L.checked&&F.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){m(q.getTarget(),q.getColor(),null==t? -!0:t.checked,F.checked,H.getLink(),x.checked,null!=l?l.value:null,null!=n?n.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=l?(l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f, -mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(f);var g=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,d,mxUtils.bind(this,function(){c(!g.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog= -function(a,b,c,e,k,h,l,n){l=null!=l?l:!0;var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=this.editor.graph,g="jpeg"==n?196:300,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";d.appendChild(p);mxUtils.write(d,mxResources.get("zoom")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight= -"12px";m.value=this.lastExportZoom||"100%";d.appendChild(m);mxUtils.write(d,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";d.appendChild(u);mxUtils.br(d);var q=this.addCheckbox(d,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=n),w=this.addCheckbox(d,mxResources.get("selectionOnly"), -!1,f.isSelectionEmpty()),t=document.createElement("input");t.style.marginTop="16px";t.style.marginRight="8px";t.style.marginLeft="24px";t.setAttribute("disabled","disabled");t.setAttribute("type","checkbox");h&&(d.appendChild(t),mxUtils.write(d,mxResources.get("crop")),mxUtils.br(d),g+=26,mxEvent.addListener(w,"change",function(){w.checked?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(t.setAttribute("checked","checked"),t.defaultChecked=!0);var L=this.addCheckbox(d, -mxResources.get("shadow"),f.shadowVisible),x=document.createElement("input");x.style.marginTop="16px";x.style.marginRight="8px";x.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||x.setAttribute("disabled","disabled");b&&(d.appendChild(x),mxUtils.write(d,mxResources.get("embedImages")),mxUtils.br(d),g+=26);var I=this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=n),E=null!=this.pages&&1<this.pages.length,Q=this.addCheckbox(d,E?mxResources.get("allPages"): -"",E,!E,null,"jpeg"!=n);Q.style.marginLeft="24px";Q.style.marginBottom="16px";E||(Q.style.visibility="hidden");mxEvent.addListener(I,"change",function(){I.checked&&E?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled")});l&&E||Q.setAttribute("disabled","disabled");a=new CustomDialog(this,d,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=m.value;k(m.value,q.checked,!w.checked,L.checked,I.checked,x.checked,u.value,t.checked,!Q.checked)}),null,c,e);this.showDialog(a.container, -340,g,!0,!0);m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,e,k){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(g)}var p=this.addCheckbox(d,mxResources.get("fit"), -!0),m=this.addCheckbox(d,mxResources.get("shadow"),f.shadowVisible&&e,!e),l=this.addCheckbox(d,c),n=this.addCheckbox(d,mxResources.get("lightbox"),!0),q=this.addEditButton(d,n),t=q.getEditInput(),B=1<f.model.getChildCount(f.model.getRoot()),F=this.addCheckbox(d,mxResources.get("layers"),B,!B);F.style.marginLeft=t.style.marginLeft;F.style.marginBottom="12px";F.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(B&&F.removeAttribute("disabled"),t.removeAttribute("disabled")): -(F.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));t.checked&&n.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){a(p.checked,m.checked,l.checked,n.checked,q.getLink(),F.checked)}),null,mxResources.get("embed"),k);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,e,k,h,l,n){function d(d){var b=" ",g="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ +r=this.editor.graph.getBoundingBoxFromGeometry(m);H(m,new mxRectangle(0,0,r.width,r.height),a)}n=!0}catch(M){null!=window.console&&console.log("error in drop handler:",M)}}n||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=l&&null!=r&&(/(\.vsdx)($|\?)/i.test(r)||/(\.vssx)($|\?)/i.test(r)||/(\.vsd)($|\?)/i.test(r))?this.importVisio(l,function(a){w(a,"text/xml")},null,r):!this.isOffline()&& +(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,r)&&null!=l?this.parseFile(l,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?w(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):w(d,c)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border= +"3px solid transparent",k.style.cursor="");a.stopPropagation();a.preventDefault()}));n=n.cloneNode(!1);n.setAttribute("src",IMAGE_PATH+"/edit.gif");n.setAttribute("title",mxResources.get("edit"));r.insertBefore(n,r.firstChild);mxEvent.addListener(n,"click",B);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&B(a)});c=n.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));r.insertBefore(c,r.firstChild);mxEvent.addListener(c,"click", +L);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),r.insertBefore(c,r.firstChild))}l.appendChild(r);l.style.paddingRight=18*r.childNodes.length+"px"}};"1"==urlParams.offline|| +EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide")); +a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)", +Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme", +Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor= +"#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=", +Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display= +"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var d=document.getElementById("geFooter");null!=d&&(this.footerHeight=a,d.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,e,m){a=new ImageDialog(this,a,b,c,e,m);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor= +!0;this.editor.graph.model.execute(a)});var d=new BackgroundImageDialog(this,mxUtils.bind(this,function(d){a(d)}));this.showDialog(d.container,360,200,!0,!0);d.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,e,m){a=new LibraryDialog(this,a,b,c,e,m);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer"); +a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c){var d=null!=this.spinner&&null!= +this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),g=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),g=function(){d();f.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden")); +else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var k=window.location.hash;null!=k&&"#G"==k.substring(0,2)&&(k=k.substring(2),a+=' <a href="https://drive.google.com/open?id='+k+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a= +mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,c,g)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,e,m,h,k){a=new ErrorDialog(this,a,b,c,e,m,h,k);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var d=new ErrorDialog(this, +null,a,mxResources.get("ok"),b);this.showDialog(d.container,340,100,!0,!1);d.init()};EditorUi.prototype.confirm=function(a,b,c,e,m){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){d();null!=b&&b()},function(){d();null!=c&&c()},e,m)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas= +function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,c){var d=a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return d}; +EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,f=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(f,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS}; +EditorUi.prototype.doSaveLocalFile=function(a,b,c,e,m){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height= +"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var d=document.createElement("a"),f=!mxClient.IS_SF&&"undefined"!==typeof d.download;if(f||this.isOffline()){d.href=URL.createObjectURL(e?this.base64ToBlob(a,c):new Blob([a],{type:c}));f&&(d.download=b);d.setAttribute("target","_blank");document.body.appendChild(d);try{window.setTimeout(function(){URL.revokeObjectURL(d.href)},0),d.click(),d.parentNode.removeChild(d)}catch(u){}}else this.createEchoRequest(a, +b,c,e,m).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,e,m,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=m?"&format="+m:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var d=atob(a),c=d.length,f=Math.ceil(c/1024),e=Array(f),k=0;k<f;++k){for(var l=1024*k,n=Math.min(l+1024,c),r=Array(n-l),q=0;l<n;++q,++l)r[q]= +d[l].charCodeAt(0);e[k]=new Uint8Array(r)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,e,m,h,k){h=null!=h?h:!1;k=null!=k?k:"vsdx"!=m&&(!mxClient.IS_IOS||!navigator.standalone);m=this.getServiceCount(h);b=new CreateDialog(this,b,mxUtils.bind(this,function(d,b){try{if("_blank"==b)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a, +!1)),f.document.close())}else this.openInNewWindow(a,c,e);else b==App.MODE_DEVICE?this.doSaveLocalFile(a,d,c,e):null!=d&&0<d.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,d,c,e,b,f)}catch(C){this.handleError(C)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,h,k,null,null,4<m?3:4,a,c,e);this.showDialog(b.container,420,m==(mxClient.IS_IOS?0:1)?160:4<m?390:270,!0,!0);b.init()}; +EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a, +!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var d=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div"); +var c=d.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left= +c.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";c=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=c.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height= +"auto";this.exportDialog.style.padding="10px";var d=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",d);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(d.substring(d.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null, +this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,e,m){this.isLocalFileSave()?this.saveLocalFile(c,a,e,m,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,d){return this.createEchoRequest(c,a,e,m,b,d)}),c, +m,e)};EditorUi.prototype.saveRequest=function(a,b,c,e,m,h,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var d=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,d){if("_blank"==d||null!=a&&0<a.length){var f=c("_blank"==d?null:a,d==App.MODE_DEVICE||null==d||"_blank"==d?"0":"1");null!=f&&(d==App.MODE_DEVICE||"_blank"==d?f.simulate(document,"_blank"):this.pickFolder(d,mxUtils.bind(this,function(c){h=null!=h?h:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e, +a,h,!0,d,c)}catch(x){this.handleError(x)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,h,!0,d,c)}catch(x){this.handleError(x)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"), +!1,!1,k,null,null,4<d?3:4,e,h,m);this.showDialog(a.container,380,d==(mxClient.IS_IOS?0:1)?160:4<d?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,e,m,h){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,e,m,h,k,l,n){if(this.spinner.spin(document.body,mxResources.get("export"))){var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;d=b?null:this.editor.graph.background; +d==mxConstants.NONE&&(d=null);null==d&&0==b&&(d="#ffffff");var f=this.editor.graph.getSvg(d,a,k,l,null,c);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();m&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,n));if(null!=this.editor.fontCss){var d=a.ownerDocument,d=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"style"):d.createElement("style");d.setAttribute("type","text/css");mxUtils.setTextContent(d, +this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(d)}var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){h?(null== +this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,p,this.thumbImageCache)):p(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,c,e,m,h){h=null!=h?h:!0;var d=document.createElement("input");d.style.marginRight="8px";d.style.marginTop="16px";d.setAttribute("type","checkbox");c&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);e&&d.setAttribute("disabled","disabled");h&&(a.appendChild(d),mxUtils.write(a,b),m||mxUtils.br(a));return d};EditorUi.prototype.addEditButton=function(a, +b){var d=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);d.style.marginLeft="24px";var c=this.getCurrentFile(),f="";null!=c&&c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";c=document.createElement("option");c.setAttribute("value","blank");mxUtils.write(c,mxResources.get("makeCopy"));e.appendChild(c);c=document.createElement("option"); +c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom")+"...");e.appendChild(c);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(d,"change",mxUtils.bind(this,function(){d.checked&&(null==b|| +b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return d.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return d},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function d(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+ +Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var c=document.createElement("select");c.style.width="100px";c.style.marginLeft="8px";c.style.marginRight="10px";c.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));c.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));c.appendChild(f);f=document.createElement("option"); +f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));c.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),c.appendChild(f));a.appendChild(c);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;d()});mxEvent.consume(a)}));d();k.style.padding= +mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return c.value},focus:function(){c.focus()}}};EditorUi.prototype.createLink=function(a,b,c,e,m,h,k,l){var d=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+ +a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=m&&0<m.length&&f.push("edit="+encodeURIComponent(m)),h&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=k?c="#U"+encodeURIComponent(k):(d=this.getCurrentFile(),l||null==d||d.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c? +this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+d.getHash(),a=!1));a&&null!=d&&null!=d.getTitle()&&d.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(d.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+c};EditorUi.prototype.createHtml=function(a, +b,c,e,m,h,k,l,n,r,q){this.getBasenames();var d={};""!=m&&m!=mxConstants.NONE&&(d.highlight=m);"auto"!==e&&(d.target=e);n||(d.lightbox=!1);d.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(d.zoom=c/100);c=[];k&&(c.push("pages"),d.resize=!0,null!=this.pages&&null!=this.currentPage&&(d.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),d.resize=!0);l&&c.push("layers");0<c.length&&(n&&c.push("lightbox"),d.toolbar=c.join(" "));null!=r&&0<r.length&&(d.edit=r);null!= +a?d.url=a:d.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(h?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(d))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";q(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+ +'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;"; +p.setAttribute("value","url");p.setAttribute("type","radio");p.setAttribute("name","type-embedhtmldialog");f=p.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(k);mxUtils.br(g);g.appendChild(p);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));g.appendChild(k);var r=this.getCurrentFile();null==c&&null!=r&&r.constructor==window.DriveFile&&(k= +document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),g.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(r.getId())})));f.setAttribute("checked","checked");null==c&&p.setAttribute("disabled","disabled");d.appendChild(g);var l=this.addLinkSection(d),n=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d, +":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value="100%";d.appendChild(q);var t=this.addCheckbox(d,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,B=B=this.addCheckbox(d,mxResources.get("allPages"),g,!g),F=this.addCheckbox(d,mxResources.get("layers"),!0),H=this.addCheckbox(d,mxResources.get("lightbox"),!0),L=this.addEditButton(d,H),y=L.getEditInput(); +y.style.marginBottom="16px";mxEvent.addListener(H,"change",function(){H.checked?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled");y.checked&&H.checked?L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,d,mxUtils.bind(this,function(){e(p.checked?c:null,n.checked,q.value,l.getTarget(),l.getColor(),t.checked,B.checked,F.checked,H.checked,L.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()}; +EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,m,h){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(f);var g=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=g&&g.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384", +p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var k=document.createElement("div");k.style.whiteSpace="normal";mxUtils.write(k,mxResources.get("linkAccountRequired"));p.appendChild(k);k=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())}));k.style.marginTop="12px";k.className="geBtn";p.appendChild(k);d.appendChild(p);k=document.createElement("a"); +k.style.paddingLeft="12px";k.style.color="gray";k.style.fontSize="11px";k.setAttribute("href","javascript:void(0);");mxUtils.write(k,mxResources.get("check"));p.appendChild(k);mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok")); +this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var l=null,n=null;if(null!=c||null!=e)a+=30,mxUtils.write(d,mxResources.get("width")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.marginRight="16px",l.style.width="50px",l.style.marginLeft="6px",l.style.marginRight="16px",l.style.marginBottom="10px",l.value="100%",d.appendChild(l),mxUtils.write(d,mxResources.get("height")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.width="50px", +n.style.marginLeft="6px",n.style.marginBottom="10px",n.value=e+"px",d.appendChild(n),mxUtils.br(d);var q=this.addLinkSection(d,h);c=null!=this.pages&&1<this.pages.length;var t=null;if(null==g||g.constructor!=window.DriveFile||b)t=this.addCheckbox(d,mxResources.get("allPages"),c,!c);var F=this.addCheckbox(d,mxResources.get("lightbox"),!0),H=this.addEditButton(d,F),L=H.getEditInput(),y=this.addCheckbox(d,mxResources.get("layers"),!0);y.style.marginLeft=L.style.marginLeft;y.style.marginBottom="16px"; +y.style.marginTop="8px";mxEvent.addListener(F,"change",function(){F.checked?(y.removeAttribute("disabled"),L.removeAttribute("disabled")):(y.setAttribute("disabled","disabled"),L.setAttribute("disabled","disabled"));L.checked&&F.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){m(q.getTarget(),q.getColor(),null==t?!0:t.checked,F.checked,H.getLink(),y.checked,null!=l?l.value:null,null!= +n?n.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=l?(l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px"; +d.appendChild(f);var g=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,d,mxUtils.bind(this,function(){c(!g.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,e,k,h,l,n){l=null!=l?l:!0;var d=document.createElement("div");d.style.whiteSpace= +"nowrap";var f=this.editor.graph,g="jpeg"==n?196:300,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";d.appendChild(p);mxUtils.write(d,mxResources.get("zoom")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="12px";m.value=this.lastExportZoom||"100%";d.appendChild(m);mxUtils.write(d,mxResources.get("borderWidth")+ +":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";d.appendChild(u);mxUtils.br(d);var q=this.addCheckbox(d,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=n),w=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),t=document.createElement("input");t.style.marginTop="16px";t.style.marginRight= +"8px";t.style.marginLeft="24px";t.setAttribute("disabled","disabled");t.setAttribute("type","checkbox");h&&(d.appendChild(t),mxUtils.write(d,mxResources.get("crop")),mxUtils.br(d),g+=26,mxEvent.addListener(w,"change",function(){w.checked?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(t.setAttribute("checked","checked"),t.defaultChecked=!0);var L=this.addCheckbox(d,mxResources.get("shadow"),f.shadowVisible),y=document.createElement("input");y.style.marginTop= +"16px";y.style.marginRight="8px";y.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||y.setAttribute("disabled","disabled");b&&(d.appendChild(y),mxUtils.write(d,mxResources.get("embedImages")),mxUtils.br(d),g+=26);var I=this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=n),E=null!=this.pages&&1<this.pages.length,Q=this.addCheckbox(d,E?mxResources.get("allPages"):"",E,!E,null,"jpeg"!=n);Q.style.marginLeft="24px";Q.style.marginBottom="16px";E||(Q.style.visibility= +"hidden");mxEvent.addListener(I,"change",function(){I.checked&&E?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled")});l&&E||Q.setAttribute("disabled","disabled");a=new CustomDialog(this,d,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=m.value;k(m.value,q.checked,!w.checked,L.checked,I.checked,y.checked,u.value,t.checked,!Q.checked)}),null,c,e);this.showDialog(a.container,340,g,!0,!0);m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode|| +mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,e,k){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(g)}var p=this.addCheckbox(d,mxResources.get("fit"),!0),m=this.addCheckbox(d,mxResources.get("shadow"),f.shadowVisible&&e, +!e),l=this.addCheckbox(d,c),n=this.addCheckbox(d,mxResources.get("lightbox"),!0),q=this.addEditButton(d,n),t=q.getEditInput(),B=1<f.model.getChildCount(f.model.getRoot()),F=this.addCheckbox(d,mxResources.get("layers"),B,!B);F.style.marginLeft=t.style.marginLeft;F.style.marginBottom="12px";F.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(B&&F.removeAttribute("disabled"),t.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled")); +t.checked&&n.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){a(p.checked,m.checked,l.checked,n.checked,q.getLink(),F.checked)}),null,mxResources.get("embed"),k);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,e,k,h,l,n){function d(d){var b=" ",g="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ (k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var p="";c&&(p=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');l('<img src="'+d+'"'+p+(""!=g?' style="'+g+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");d(a)}),null,null,null,mxUtils.bind(this,function(a){n({message:mxResources.get("unknownError")})}), null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var g="";c&&(g="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var p=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));p.send(mxUtils.bind(this,function(){200<=p.getStatus()&&299>=p.getStatus()?d("data:image/png;base64,"+p.getText()):n({message:mxResources.get("unknownError")})}))}else n({message:mxResources.get("drawingTooLarge")})}; EditorUi.prototype.createEmbedSvg=function(a,b,c,e,k,h,l){var d=this.editor.graph.getSvg(),f=d.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var p=f[g].getAttribute("href");null!=p&&"#"==p.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&d.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(d);if(c){var m=" ",n="";e&&(m="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ @@ -2838,143 +2839,144 @@ mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,e,k,h,l,n,q){q= this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,e,null,null,h,l)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var d=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),c=0,e={},h=mxUtils.bind(this,function(){if(0==c){for(var f=[b[0]],g=1;g<b.length;g++){var h= b[g].indexOf(")");f.push('url("');f.push(e[d(b[g].substring(0,h))]);f.push('"'+b[g].substring(h))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var k=1;k<b.length;k++){var l=b[k].indexOf(")"),n=null,r=b[k].indexOf("format(",l);0<r&&(n=d(b[k].substring(r+7,b[k].indexOf(")",r))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;c++;var d="application/x-font-ttf";if("svg"==n||/(\.svg)($|\?)/i.test(a))d="image/svg+xml";else if("otf"==n||"embedded-opentype"==n||/(\.otf)($|\?)/i.test(a))d= "application/x-font-opentype";else if("woff"==n||/(\.woff)($|\?)/i.test(a))d="application/font-woff";else if("woff2"==n||/(\.woff2)($|\?)/i.test(a))d="application/font-woff2";else if("eot"==n||/(\.eot)($|\?)/i.test(a))d="application/vnd.ms-fontobject";else if("sfnt"==n||/(\.sfnt)($|\?)/i.test(a))d="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(d){e[a]=d;c--;h()}),mxUtils.bind(this, -function(a){c--;h()}),!0,null,"data:"+d+";charset=utf-8;base64,")}})(d(b[k].substring(0,l)),n)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,e,k,h,l,n,q,r,t,C,y,z){h=null!=h?h:!0;C=null!=C?C:this.editor.graph;y=null!=y?y:0;var d=q?null:C.background;d==mxConstants.NONE&&(d=null);null==d&&(d=e);null==d&&0==q&&(d=this.editor.graph.defaultPageBackgroundColor);this.convertImages(C.getSvg(d,null,null,z,null,null!=l?l:!0),mxUtils.bind(this,function(c){var f=new Image;f.onload=mxUtils.bind(this, -function(){try{var e=document.createElement("canvas"),g=parseInt(c.getAttribute("width")),m=parseInt(c.getAttribute("height"));n=null!=n?n:1;null!=b&&(n=h?Math.min(1,Math.min(3*b/(4*m),b/g)):b/g);g=Math.ceil(n*g)+2*y;m=Math.ceil(n*m)+2*y;e.setAttribute("width",g);e.setAttribute("height",m);var p=e.getContext("2d");null!=d&&(p.beginPath(),p.rect(0,0,g,m),p.fillStyle=d,p.fill());p.scale(n,n);p.drawImage(f,y/n,y/n);a(e)}catch(X){null!=k&&k(X)}});f.onerror=function(a){null!=k&&k(a)};try{r&&this.editor.graph.addSvgShadow(c); -var e=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(C,c,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(e)}catch(x){null!=k&&k(x)}}),c,t)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert, +function(a){c--;h()}),!0,null,"data:"+d+";charset=utf-8;base64,")}})(d(b[k].substring(0,l)),n)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,e,k,h,l,n,q,r,t,C,x,z){h=null!=h?h:!0;C=null!=C?C:this.editor.graph;x=null!=x?x:0;var d=q?null:C.background;d==mxConstants.NONE&&(d=null);null==d&&(d=e);null==d&&0==q&&(d=this.editor.graph.defaultPageBackgroundColor);this.convertImages(C.getSvg(d,null,null,z,null,null!=l?l:!0),mxUtils.bind(this,function(c){var f=new Image;f.onload=mxUtils.bind(this, +function(){try{var e=document.createElement("canvas"),g=parseInt(c.getAttribute("width")),m=parseInt(c.getAttribute("height"));n=null!=n?n:1;null!=b&&(n=h?Math.min(1,Math.min(3*b/(4*m),b/g)):b/g);g=Math.ceil(n*g)+2*x;m=Math.ceil(n*m)+2*x;e.setAttribute("width",g);e.setAttribute("height",m);var p=e.getContext("2d");null!=d&&(p.beginPath(),p.rect(0,0,g,m),p.fillStyle=d,p.fill());p.scale(n,n);p.drawImage(f,x/n,x/n);a(e)}catch(X){null!=k&&k(X)}});f.onerror=function(a){null!=k&&k(a)};try{r&&this.editor.graph.addSvgShadow(c); +var e=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(C,c,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(e)}catch(y){null!=k&&k(y)}}),c,t)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert, c=this;a.convert=function(d){if(null!=d){var f="http://"==d.substring(0,7)||"https://"==d.substring(0,8);f&&!navigator.onLine?d=c.svgBrokenImage.src:!f||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.isCorsEnabledForUrl(d)?"chrome-extension://"!=d.substring(0,19)&&(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,e){null==e&&(e=this.createImageUrlConverter());var d=0,f=c||{};c=mxUtils.bind(this, function(c,g){for(var h=a.getElementsByTagName(c),k=0;k<h.length;k++)mxUtils.bind(this,function(c){var h=e.convert(c.getAttribute(g));if(null!=h&&"data:"!=h.substring(0,5)){var k=f[h];null==k?(d++,this.convertImageToDataUri(h,function(e){null!=e&&(f[h]=e,c.setAttribute(g,e));d--;0==d&&b(a)})):c.setAttribute(g,k)}else null!=h&&c.setAttribute(g,h)})(h[k])});c("image","xlink:href");c("img","src");0==d&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,e,k,h){try{var d=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)|| /(\.gif)($|\?)/i.test(a);k=null!=k?k:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var f=a.getText();if(d){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}h=null!=h?h:"data:image/png;base64,";f=h+this.base64Encode(f)}b(f)}}else null!= c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},d,this.timeout,function(){k&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(v){null!=c&&c(v)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0, 23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var d=new Image,c=this;this.crossOriginImages&&(d.crossOrigin="anonymous");d.onload=function(){var a=document.createElement("canvas"),f=a.getContext("2d"); a.height=d.height;a.width=d.width;f.drawImage(d,0,0);try{b(a.toDataURL())}catch(w){b(c.svgBrokenImage.src)}};d.onerror=function(){b(c.svgBrokenImage.src)};d.src=a}};EditorUi.prototype.importXml=function(a,b,c,e,k){b=null!=b?b:0;c=null!=c?c:0;var d=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),m=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=m&&"mxfile"==m.nodeName&&null!=this.pages){var p=m.getElementsByTagName("diagram");if(1==p.length)m= -mxUtils.parseXml(f.decompress(mxUtils.getTextContent(p[0]))).documentElement;else if(1<p.length){f.model.beginUpdate();try{for(a=0;a<p.length;a++){var l=this.updatePageRoot(new DiagramPage(p[a])),n=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[n+1]));f.model.execute(new ChangePage(this,l,l,n))}}finally{f.model.endUpdate()}}}null!=m&&"mxGraphModel"===m.nodeName&&(d=f.importGraphModel(m,b,c,e))}}catch(y){throw k||this.handleError(y,mxResources.get("invalidOrMissingFile")), -y;}return d};EditorUi.prototype.importVisio=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)try{this.doImportVisio(a,b,c)}catch(m){c(m)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!== -typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(f){this.handleError(f)}});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,c,e,k){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,c,e,k)}catch(w){this.handleError(w)}finally{null!=k&&k()}});this.pasteLucidChart||this.loadingExtensions|| -this.isOffline()?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.insertLucidChart=function(a,b,c,e,k){k=JSON.parse(a);a=[];if(null!=k.state){k=JSON.parse(k.state);for(var d in k.Pages)a.push(k.Pages[d]);a.sort(function(a,d){return a.Properties.Order<d.Properties.Order?-1:a.Properties.Order>d.Properties.Order?1:0})}else a.push(k);if(0<a.length){this.editor.graph.getModel().beginUpdate(); -try{if(this.pasteLucidChart(a[0],b,c,e),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=function(a,b,c,e,k,h,l){h=null!=h?h:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this, -function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(k||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var d=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,c,h,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0, -26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,c,h,!0),0<g.length)return g}catch(A){}this.loadImage(a,mxUtils.bind(this,function(f){if("data:"==a.substring(0,5))this.resizeImage(f,a,mxUtils.bind(this,function(a,f,e){d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ -this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/f.width,this.maxImageSize/f.height)),g=Math.round(f.width*e);f=Math.round(f.height*e);d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),g,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;d.getModel().beginUpdate();try{f=d.insertVertex(d.getDefaultParent(), -null,a,d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.updateCellSize(f),d.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{d.getModel().endUpdate()}d.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,h);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,c,h);else{d=this.editor.graph;k=null;d.getModel().beginUpdate();try{k=d.insertVertex(d.getDefaultParent(), -null,"",d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.fireEvent(new mxEventObject("textInserted","cells",[k])),k.value=a,d.updateCellSize(k),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(k.value)&&d.setLinkForCell(k,k.value),k.geometry.width+=d.gridSize,k.geometry.height+=d.gridSize}finally{d.getModel().endUpdate()}return[k]}}return[]}; -EditorUi.prototype.formatFileSize=function(a){var d=-1;do a/=1024,d++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[d]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var d=a.indexOf(";");0<d&&(a=a.substring(0,d)+a.substring(a.indexOf(",",d+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importFile=function(a,b,c,e,k,h,l,n, -q,r,t){r=null!=r?r:!0;var d=!1,f=null,g=mxUtils.bind(this,function(a){var d=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,l)):d=this.importXml(a,c,e,r);null!=n&&n(d)});"image"==b.substring(0,5)?(q=!1,"image/png"==b.substring(0,9)&&(b=t?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,c,e,r),q=!0)),q||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),r&&f.isGridEnabled()&&(c=f.snap(c), -e=f.snap(e)),f=[f.insertVertex(null,null,"",c,e,k,h,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,c,e,r);null!=n&&n(a)})):null!=q&&null!=l&&(/(\.vsdx)($|\?)/i.test(l)||/(\.vssx)($|\?)/i.test(l))?(d=!0,this.importVisio(q,g)):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(a,l)?(d=!0,this.parseFile(null!=q?q:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=n&&n(null))}),l)):/(\.vsd)($|\?)/i.test(l)||(f=this.insertTextAt(this.validateFileData(a),c,e,!0,null,r));d||null==n||n(f);return f};EditorUi.prototype.base64Encode=function(a){for(var d="",b=0,c=a.length,e,h,k;b<c;){e=a.charCodeAt(b++)&255;if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);d+="==";break}h=a.charCodeAt(b++);if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);d+="=";break}k=a.charCodeAt(b++);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(k&192)>>6);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return d};EditorUi.prototype.importFiles=function(a,b,c,e,k,h,l,n,q,r,t,C){b=null!=b?b:0;c=null!=c?c:0;e=null!=e?e:this.maxImageSize;r=null!=r?r:this.maxImageBytes;var d=null!=b&&null!=c,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&& -null!=a)for(var p=t||this.resampleThreshold,m=0;m<a.length;m++)if("image/"==a[m].type.substring(0,6)&&a[m].size>p){g=!0;break}var u=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;k=null!=k?k:mxUtils.bind(this,function(a,b,c,e,f,g,h,k,p){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,c,e,f,g,h,k,p,d,C)});h=null!=h?h:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body, -mxResources.get("loading")))for(var m=a.length,q=m,u=[],w=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--q){this.spinner.stop();if(null!=n)n(u);else{var d=[];g.getModel().beginUpdate();try{for(var c=0;c<u.length;c++){var e=u[c]();null!=e&&(d=d.concat(e))}}finally{g.getModel().endUpdate()}}h(d)}}),v=0;v<m;v++)mxUtils.bind(this,function(d){var h=a[d],m=new FileReader;m.onload=mxUtils.bind(this,function(a){if(null==l||l(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var m= -a.target.result,n=m.indexOf(","),q=decodeURIComponent(escape(atob(m.substring(n+1)))),x=mxUtils.parseXml(q),q=x.getElementsByTagName("svg");if(0<q.length){var q=q[0],u=C?null:q.getAttribute("content");null!=u&&"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(u,!0)));null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u));null==u||"<mxfile "!==u.substring(0,8)&&"<mxGraphModel "!==u.substring(0,14)?w(d,mxUtils.bind(this,function(){try{if(m.substring(0,n+1),null!=x){var a= -x.getElementsByTagName("svg");if(0<a.length){var l=a[0],r=parseFloat(l.getAttribute("width")),q=parseFloat(l.getAttribute("height")),u=l.getAttribute("viewBox");if(null==u||0==u.length)l.setAttribute("viewBox","0 0 "+r+" "+q);else if(isNaN(r)||isNaN(q)){var t=u.split(" ");3<t.length&&(r=parseFloat(t[2]),q=parseFloat(t[3]))}m=this.createSvgDataUri(mxUtils.getXml(l));var w=Math.min(1,Math.min(e/Math.max(1,r)),e/Math.max(1,q)),E=k(m,h.type,b+d*p,c+d*p,Math.max(1,Math.round(r*w)),Math.max(1,Math.round(q* -w)),h.name,f);if(isNaN(r)||isNaN(q)){var v=new Image;v.onload=mxUtils.bind(this,function(){r=Math.max(1,v.width);q=Math.max(1,v.height);E[0].geometry.width=r;E[0].geometry.height=q;l.setAttribute("viewBox","0 0 "+r+" "+q);m=this.createSvgDataUri(mxUtils.getXml(l));var a=m.indexOf(";");0<a&&(m=m.substring(0,a)+m.substring(m.indexOf(",",a+1)));g.setCellStyles("image",m,[E[0]])});v.src=this.createSvgDataUri(mxUtils.getXml(l))}return E}}}catch(fa){}return null})):w(d,mxUtils.bind(this,function(){return k(u, -"text/xml",b+d*p,c+d*p,0,0,h.name)}))}}else{q=!1;if("image/png"==h.type){var E=C?null:this.extractGraphModelFromPng(a.target.result);if(null!=E&&0<E.length){var v=new Image;v.src=a.target.result;w(d,mxUtils.bind(this,function(){return k(E,"text/xml",b+d*p,c+d*p,v.width,v.height,h.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"), -mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,m,l){w(d,mxUtils.bind(this,function(){if(null!=g&&g.length<r){var n=f&&this.isResampleImage(a.target.result,t)?Math.min(1,Math.min(e/m,e/l)):1;return k(g,h.type,b+d*p,c+d*p,Math.round(m*n),Math.round(l*n),h.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,t)}),mxUtils.bind(this, -function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else k(a.target.result,h.type,b+d*p,c+d*p,240,160,h.name,function(a){w(d,function(){return a})})});/(\.vsdx)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name)?k(null,h.type,b+d*p,c+d*p,240,160,h.name,function(a){w(d,function(){return a})},h):"image"==h.type.substring(0,5)?m.readAsDataURL(h):m.readAsText(h)})(v)});g?this.confirmImageResize(function(a){f=a;u()},q):u()};EditorUi.prototype.confirmImageResize=function(a, -b){b=null!=b?b:!1;var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(c,e){if(c||b)mxSettings.setResizeImages(c?e:null),mxSettings.save();d();a(e)};null==c||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+ -'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,c)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length> -b};EditorUi.prototype.resizeImage=function(a,b,c,e,k,h){k=null!=k?k:this.maxImageSize;var d=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,h))try{var g=Math.max(d/k,f/k);if(1<g){var p=Math.round(d/g),m=Math.round(f/g),l=document.createElement("canvas");l.width=p;l.height=m;l.getContext("2d").drawImage(a,0,0,p,m);var n=l.toDataURL();if(n.length<b.length){var q=document.createElement("canvas");q.width=p;q.height=m;var t=q.toDataURL();n!==t&&(b=n,d=p,f=m)}}}catch(F){}c(b,d,f)}; -EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var c=e,k=0;8>k;k++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[e]=c;EditorUi.prototype.updateCRC=function(a,b,c,e){for(var d=0;d<e;d++)a=EditorUi.prototype.crcTable[(a^b[c+d])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,e,k){function d(a,b){var d=p;p+=b;return a.substring(d,p)}function f(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>> -24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(d(a,4),"IHDR"!=d(a,4))null!=k&&k();else{d(a,17);k=a.substring(0,p);do{var m=f(a);if("IDAT"==d(a,4)){k=a.substring(0,p-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,c,0,c.length);k+=g(c.length)+b+c+g(e^4294967295); -k+=a.substring(p-8,a.length);break}k+=a.substring(p-8,p-4+m);d(a,m);d(a,4)}while(m);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var d=a.substring(a.indexOf(",")+1),c=window.atob&&!mxClient.IS_SF?atob(d):Base64.decode(d,!0);EditorUi.parsePng(c,mxUtils.bind(this,function(a,d,e){a=c.substring(a+8,a+8+e);"zTXt"==d?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+ -2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==d&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==d)return!0}))}catch(m){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var d= -a.indexOf(",");0<d&&(a=b.getPageById(a.substring(d+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,c=this.editor.graph;c.addListener("pageLinkClicked",function(b,d){a(d.getProperty("href"))});this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!= -a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var d=0;d<b.pages.length;d++)if(b.pages[d]==b.currentPage){0<d&&(a+=(0<a.length?"&":"?")+"page="+d);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,arguments)};var k=c.addClickHandler;c.addClickHandler=function(b,d,e){var f=d;d=function(b,d){if(null==d){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(d=e.getAttribute("href"))}null==d||!c.isPageLink(d)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)|| -(a(d),mxEvent.consume(b));null!=f&&f(b,d)};k.call(this,b,d,e)};l.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=c.getGlobalVariable;c.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a? -null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,arguments)};var n=c.createLinkForHint;c.createLinkForHint=function(d,e){var f=c.isPageLink(d);if(f){var g=d.indexOf(",");0<g&&(g=b.getPageById(d.substring(g+1)),e=null!=g?g.getName():mxResources.get("pageNotFound"))}g=n.call(this,d,e);f&&mxEvent.addListener(g,"click",function(b){a(d);mxEvent.consume(b)});return g};var q=c.labelLinkClicked;c.labelLinkClicked=function(b,d,e){var f=d.getAttribute("href");if(null== -f||!c.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e))q.apply(this,arguments);else{if(!c.isEnabled()||null!=b&&c.isCellLocked(b.cell))a(f),c.getRubberband().reset();mxEvent.consume(e)}};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,d=b.getCurrentFile();null!=d&&(a=null!=d.getTitle()?d.getTitle():a);return a};var t=this.actions.get("print");t.setEnabled(!mxClient.IS_IOS||!navigator.standalone);t.visible=t.isEnabled();if(!this.editor.chromeless||this.editor.editable){var r= -function(){window.setTimeout(function(){A.innerHTML=" ";A.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||c.container.addEventListener("paste", -mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var d=a.clipboardData||a.originalEvent.clipboardData,c=!1,e=0;e<d.types.length;e++)if("text/"===d.types[e].substring(0,5)){c=!0;break}if(!c){var f=d.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,d,c,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()}); -else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(G){}}),!1);var A=document.createElement("div");A.style.position="absolute";A.style.whiteSpace="nowrap";A.style.overflow="hidden";A.style.display="block";A.contentEditable=!0;mxUtils.setOpacity(A,0);A.style.width="1px";A.style.height="1px";A.innerHTML=" ";var C=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86, -null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==c.container||!c.isEnabled()||c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||C||(A.style.left=c.container.scrollLeft+10+"px",A.style.top=c.container.scrollTop+10+"px",c.container.appendChild(A),C=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){A.focus();document.execCommand("selectAll", -!1,null)},0):(A.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!C||224!=b&&17!=b&&91!=b||(C=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),A.parentNode.removeChild(A))}),0)}));mxEvent.addListener(A,"copy",mxUtils.bind(this,function(a){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(A),r())}));mxEvent.addListener(A,"cut",mxUtils.bind(this, -function(a){c.isEnabled()&&(this.copyCells(A,!0),r())}));mxEvent.addListener(A,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(A.innerHTML=" ",A.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,A);A.innerHTML=" "}),0))}),!0);var y=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==A?!0:y.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight|| -0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,d=b.cellEditor.text2,c=null;null!=d&&(mxEvent.addListener(d,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=this.highlightElement(d));a.stopPropagation(); -a.preventDefault()})),mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,d,c,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var d=a.dataTransfer.getData("text/uri-list"); -/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)?this.loadImage(decodeURIComponent(d),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,c)),e/Math.max(1,a));b.insertImage(decodeURIComponent(d),c*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types, -"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){t=document.createElement("div");t.style.position="absolute";t.style.top="95px";t.style.left="250px";t.style.width="2000px";t.style.height="30px";t.style.background="whiteSmoke";document.body.appendChild(t);var z=document.createElement("div");z.style.position="absolute";z.style.top="125px";z.style.left="220px"; -z.style.width="30px";z.style.height="1000px";z.style.background="whiteSmoke";document.body.appendChild(z);var B=document.createElement("div");B.style.position="absolute";B.style.top="95px";B.style.left="220px";B.style.width="30px";B.style.height="30px";B.style.background="whiteSmoke";document.body.appendChild(B);this.vRuler=new mxRuler(this.editor.graph,z,!0);this.hRuler=new mxRuler(this.editor.graph,t,!1)}if("1"==urlParams.test){t=document.getElementById("geFooter");null!=t&&(this.styleInput=document.createElement("input"), -this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),t.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE, -mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var d=this.editor.graph.getSelectionCell(),d=this.editor.graph.getModel().getStyle(d);this.styleInput.value=d||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var F=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:F.apply(this,arguments)}}t=document.getElementById("geInfo");null!=t&&t.parentNode.removeChild(t);if(Graph.fileSupport&& -(!this.editor.chromeless||this.editor.editable)){var H=null;mxEvent.addListener(c.container,"dragleave",function(a){c.isEnabled()&&(null!=H&&(H.parentNode.removeChild(H),H=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(a){null==H&&(!mxClient.IS_IE||10<document.documentMode)&&(H=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c.container, -"drop",mxUtils.bind(this,function(a){null!=H&&(H.parentNode.removeChild(H),H=null);if(c.isEnabled()){var b=mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=c.view.translate,e=c.view.scale,f=b.x/e-d.x,g=b.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")? -a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=b)c.setSelectionCells(this.importXml(b,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=k;var p=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(p=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&& -(k=b[0].getAttribute("href")));var m=!0,l=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(k,f,g,!0,p,null,m))});p&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){m=a;l()},mxEvent.isControlDown(a)):l()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,b)),d/Math.max(1,a));c.setSelectionCell(c.insertVertex(null, -null,"",f,g,b*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(a){c.setSelectionCells(this.insertTextAt(h,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()}; -EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged", -mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat= -mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave); -mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var d=this.editor.graph; -if(d.isSelectionEmpty())a.innerHTML="";else{var c=mxUtils.sortCells(d.model.getTopmostCells(d.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(c));mxUtils.setTextContent(a,encodeURIComponent(e));b?(d.removeCells(c,!1),d.lastPasteXml=null):(d.lastPasteXml=e,d.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var d=b.getElementsByTagName("span");if(null!=d&&0<d.length&&"application/vnd.lucid.chart.objects"=== -d[0].getAttribute("data-lucid-type")){var c=d[0].getAttribute("data-lucid-content");null!=c&&0<c.length&&(this.importLucidChart(c,0,0),mxEvent.consume(a))}else{var c=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var k=e.lastIndexOf("%3E");0<=k&&k<e.length-3&&(e=e.substring(0,k+3))}catch(v){}try{var d=b.getElementsByTagName("span"),l=null!=d&&0<d.length?mxUtils.trim(decodeURIComponent(d[0].textContent)):decodeURIComponent(e); -this.isCompatibleString(l)&&(f=!0,e=l)}catch(v){}c.lastPasteXml==e?c.pasteCounter++:(c.lastPasteXml=e,c.pasteCounter=0);d=c.pasteCounter*c.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?c.setSelectionCells(this.importXml(e,d,d)):(f=c.getInsertPoint(),c.isMouseInsertPoint()&&(d=0,c.lastPasteXml==e&&0<c.pasteCounter&&c.pasteCounter--),c.setSelectionCells(this.insertTextAt(e,f.x+d,f.y+d,!0))),!c.isSelectionEmpty())){c.scrollCellToVisible(c.getSelectionCell());null!=this.hoverIcons&& -this.hoverIcons.update(c.view.getState(c.getSelectionCell()));try{mxEvent.consume(a)}catch(v){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,d=0;d<a.length;d++)mxEvent.addListener(a[d],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[d],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&& -12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[d],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0); -else{var d=this.extractGraphModelFromEvent(a);if(null==d){var c=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=c&&(10==document.documentMode||11==document.documentMode?d=c.getData("Text"):(d=null,d=0<=mxUtils.indexOf(c.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(c.types,"text/html")?c.getData("text/html"):null,null!=d&&0<d.length?(c=document.createElement("div"),c.innerHTML=d,c=c.getElementsByTagName("img"),0<c.length&&(d=c[0].getAttribute("src"))): -0<=mxUtils.indexOf(c.types,"text/plain")&&(d=c.getData("text/plain"))),null!=d&&("data:image/png;base64,"==d.substring(0,22)?(d=this.extractGraphModelFromPng(d),null!=d&&0<d.length&&this.openLocalFile(d,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(d)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(d))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(d)&&(null==this.getCurrentFile()?window.location.hash= -"#U"+encodeURIComponent(d):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(d)))))}else this.openLocalFile(d,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,d=0,c,e;if(null==a){e=document.body;var h=document.documentElement;c=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-3}else b=a.offsetTop,d=a.offsetLeft,c=a.clientWidth, -e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=b+"px";h.style.left=d+"px";h.style.width=Math.max(0,c-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a); -var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var d=new mxCodec(b.ownerDocument),c=new mxGraphModel;d.decode(b,c);b=c.getChildAt(c.getRoot(),0);for(d=0;d<c.getChildCount(b);d++)a.push(c.getChildAt(b,d))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var d=0;d<a.length;d++)mxUtils.bind(this,function(a){var d=new FileReader;d.onload=mxUtils.bind(this,function(d){var c=d.target.result,e=a.name;if(null!= -e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(A){this.handleError(A,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a, -e,b)});if(/(\.vsdx)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,e))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})); -else if('{"state":"{\\"Properties\\":'==c.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(c,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==d.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this, -d.target.result,a.name))}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(c=this.extractGraphModelFromPng(c)),this.spinner.stop(),this.openLocalFile(c,e,b)}});d.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?d.readAsDataURL(a):d.readAsText(a)})(a[d])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(), -e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,c))});null!=a&&0<a.length&&(null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"), -null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root, -a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function d(a){if(null!=a){var d=a.lastIndexOf(".");0<d&&(a=a.substring(d+1,a.length));null==b[a]&&(b[a]=!0)}}var c=this.editor.graph,e=c.getCellStyle(a);d(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));c.model.isEdge(a)&&(d(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),d(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW]))); -for(var e=c.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(c.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden")}; -EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()): -(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))}; -EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,d=!1,c=!1,e=null,h=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))): -this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(Q){}return a}if(f.source== -(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(E){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey): -null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft", -result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()})); -try{l.init()}catch(E){k.postMessage(JSON.stringify({event:"draft",error:E.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();var l=1==h.enableRecent,n=1==h.enableSearch,l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,d){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:d}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null, -null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=a;k.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,n?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,d){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:d}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"== -h.action)this.searchReadyCallback(h.list,h.errorMsg);else if("recentDocsList"==h.action)this.recentReadyCallback(h.list,h.errorMsg);else{if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var p=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body, -p):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var m=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(m); -k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(m))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),w=q.getGlobalVariable,x=this.pages[0];q.getGlobalVariable=function(a){return"page"== -a?x.getName():"pagenumber"==a?1:w.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(x.root)}this.exportToCanvas(mxUtils.bind(this,function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(m)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()? -t("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);p=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),p.xml=mxUtils.getXml(l),p.data=this.getFileData(null,null,!0,null,null,null,l),p.format=h.format;else if("html"==h.format)m=this.editor.getGraphXml(),p.data=this.getHtml(m,this.editor.graph), -p.xml=mxUtils.getXml(m),p.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);p.xml=this.getFileData(!0);p.format="svg";if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0); -this.spinner.stop();p.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(p),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));p.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(p), -"*")}return}if("load"==h.action)c=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop= -"6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}}h=g(h);d=!0;try{a(h,f)}catch(E){this.handleError(E)}d=!1;null!=urlParams.modified&& -this.editor.setStatus("");var I=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=I();c&&null==b&&(b=mxUtils.bind(this,function(a,b){var c=I();if(c!=e&&!d){var f=this.createLoadMessage("autosave");f.xml=c;c=JSON.stringify(f);(window.opener||window.parent).postMessage(c,"*")}e=c}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged", -b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}})); -var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title", -mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding= -"4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b); -this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv= -function(a){try{var b=a.split("\n"),d=[];if(0<b.length){var c={},e=null,h=null,k="auto",l="auto",n=null,q=null,t=40,C=40,y=0,z=this.editor.graph;z.getGraphBounds();for(var B=function(){z.setSelectionCells(Y);z.scrollCellToVisible(z.getSelectionCell())},F=z.getFreeInsertPoint(),H=F.x,L=F.y,F=L,x=null,I="auto",E=[],Q=null,X=null,R=0;R<b.length&&"#"==b[R].charAt(0);){a=b[R];for(R++;R<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[R].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[R].substring(1)), -R++;if("#"!=a.charAt(1)){var Z=a.indexOf(":");if(0<Z){var G=mxUtils.trim(a.substring(1,Z)),K=mxUtils.trim(a.substring(Z+1));"label"==G?x=z.sanitizeHtml(K):"style"==G?e=K:"identity"==G&&0<K.length&&"-"!=K?h=K:"width"==G?k=K:"height"==G?l=K:"left"==G&&0<K.length?n=K:"top"==G&&0<K.length?q=K:"ignore"==G?X=K.split(","):"connect"==G?E.push(JSON.parse(K)):"link"==G?Q=K:"padding"==G?y=parseFloat(K):"edgespacing"==G?t=parseFloat(K):"nodespacing"==G?C=parseFloat(K):"layout"==G&&(I=K)}}}var S=this.editor.csvToArray(b[R]); -a=null;if(null!=h)for(var J=0;J<S.length;J++)if(h==S[J]){a=J;break}null==x&&(x="%"+S[0]+"%");if(null!=E)for(var N=0;N<E.length;N++)null==c[E[N].to]&&(c[E[N].to]={});z.model.beginUpdate();try{for(J=R+1;J<b.length;J++){var U=this.editor.csvToArray(b[J]);if(U.length==S.length){var D=null,W=null!=a?U[a]:null;null!=W&&(D=z.model.getCell(W));null==D&&(D=new mxCell(x,new mxGeometry(H,F,0,0),e||"whiteSpace=wrap;html=1;"),D.vertex=!0,D.id=W);for(var O=0;O<U.length;O++)z.setAttributeForCell(D,S[O],U[O]);z.setAttributeForCell(D, -"placeholders","1");D.style=z.replacePlaceholders(D,D.style);for(N=0;N<E.length;N++)c[E[N].to][D.getAttribute(E[N].to)]=D;null!=Q&&"link"!=Q&&(z.setLinkForCell(D,D.getAttribute(Q)),z.setAttributeForCell(D,Q,null));z.fireEvent(new mxEventObject("cellsInserted","cells",[D]));var T=this.editor.graph.getPreferredSizeForCell(D);D.vertex&&(null!=n&&null!=D.getAttribute(n)&&(D.geometry.x=H+parseFloat(D.getAttribute(n))),null!=q&&null!=D.getAttribute(q)&&(D.geometry.y=L+parseFloat(D.getAttribute(q))),"@"== -k.charAt(0)&&null!=D.getAttribute(k.substring(1))?D.geometry.width=parseFloat(D.getAttribute(k.substring(1))):D.geometry.width="auto"==k?T.width+y:parseFloat(k),"@"==l.charAt(0)&&null!=D.getAttribute(l.substring(1))?D.geometry.height=parseFloat(D.getAttribute(l.substring(1))):D.geometry.height="auto"==l?T.height+y:parseFloat(l),F+=D.geometry.height+C);d.push(z.addCell(D))}}for(var V=d.slice(),Y=d.slice(),N=0;N<E.length;N++)for(var M=E[N],J=0;J<d.length;J++){var D=d[J],ca=D.getAttribute(M.from);if(null!= -ca){z.setAttributeForCell(D,M.from,null);for(var da=ca.split(","),O=0;O<da.length;O++){var aa=c[M.to][da[O]];null!=aa&&(x=M.label,null!=M.fromlabel&&(x=(D.getAttribute(M.fromlabel)||"")+(x||"")),null!=M.tolabel&&(x=(x||"")+(aa.getAttribute(M.tolabel)||"")),Y.push(z.insertEdge(null,null,x||"",M.invert?aa:D,M.invert?D:aa,M.style||z.createCurrentEdgeStyle())),mxUtils.remove(M.invert?D:aa,V))}}}if(null!=X)for(J=0;J<d.length;J++)for(D=d[J],O=0;O<X.length;O++)z.setAttributeForCell(D,mxUtils.trim(X[O]), -null);var ea=new mxParallelEdgeLayout(z);ea.spacing=t;var la=function(){ea.execute(z.getDefaultParent());for(var a=0;a<d.length;a++){var b=z.getCellGeometry(d[a]);b.x=Math.round(z.snap(b.x));b.y=Math.round(z.snap(b.y));"auto"==k&&(b.width=Math.round(z.snap(b.width)));"auto"==l&&(b.height=Math.round(z.snap(b.height)))}};if("circle"==I){var ha=new mxCircleLayout(z);ha.resetEdges=!1;var ra=ha.isVertexIgnored;ha.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){ha.execute(z.getDefaultParent()); -la()},!0,B);B=null}else if("horizontaltree"==I||"verticaltree"==I||"auto"==I&&Y.length==2*d.length-1&&1==V.length){z.view.validate();var fa=new mxCompactTreeLayout(z,"horizontaltree"==I);fa.levelDistance=C;fa.edgeRouting=!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(z.getDefaultParent(),0<V.length?V[0]:null)},!0,B);B=null}else if("horizontalflow"==I||"verticalflow"==I||"auto"==I&&1==V.length){z.view.validate();var ma=new mxHierarchicalLayout(z,"horizontalflow"==I?mxConstants.DIRECTION_WEST: -mxConstants.DIRECTION_NORTH);ma.intraCellSpacing=C;ma.disableEdgeStyle=!1;this.executeLayout(function(){ma.execute(z.getDefaultParent(),Y);z.moveCells(Y,H,L)},!0,B);B=null}else if("organic"==I||"auto"==I&&Y.length>d.length){z.view.validate();var ba=new mxFastOrganicLayout(z);ba.forceConstant=3*C;ba.resetEdges=!1;var pa=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return pa.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ea=new mxParallelEdgeLayout(z);ea.spacing=t;this.executeLayout(function(){ba.execute(z.getDefaultParent()); -la()},!0,B);B=null}this.hideDialog()}finally{z.model.endUpdate()}null!=B&&B()}}catch(ia){this.handleError(ia)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var d="?",c;for(c in urlParams)0>mxUtils.indexOf(a,c)&&null!=urlParams[c]&&(b+=d+c+"="+urlParams[c],d="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0; -if("1"==urlParams.offline)a+=window.location.search;else{var d="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),c;for(c in urlParams)0>mxUtils.indexOf(d,c)&&(a=0==b?a+"?":a+"&",null!=urlParams[c]&&(a+=c+"="+urlParams[c],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var n=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b= -n.apply(this,arguments),d=this.editor.graph,c=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(d.container)&&d.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return c.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(d.container)&& -null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(d.container)&&null!=this.source.minimumGraphSize){var c=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width- -2*c.x))/2)-c.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*c.y))/2)-c.y-5/a))}return new mxPoint(8/a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=d.getPageLayout(),b=d.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()}; -this.editor.addListener("pageSelected",function(a,d){var c=d.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(c.previousPage.root, -!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var d=0;null==this.drive&&"function"!==typeof window.DriveClient||d++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||d++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||d++;b||null==this.gitHub||d++;b||null==this.trello&&"function"!==typeof window.TrelloClient||d++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&d++;mxClient.IS_IOS||d++;return d};EditorUi.prototype.updateUi= -function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!= -urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a); -this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px"; -this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache, -k=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break; -case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=k&&(this.offlineStatus.innerHTML=b,k=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b); -b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var q=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){q.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b); -this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b);this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell())); -this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("rename").setEnabled(null!=c&&c.isRenamable());this.actions.get("close").setEnabled(null!= -c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile= -function(a,b,c,e,k,h){var d=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(d.getSvg(e,k,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=d.getGraphBounds(),l=Math.floor(g.width*k/d.view.scale),n=Math.floor(g.height*k/d.view.scale);f.length<=MAX_REQUEST_SIZE&&l*n<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL, -"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+l+"&h="+n+"&border="+h+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; +mxUtils.parseXml(f.decompress(mxUtils.getTextContent(p[0]))).documentElement;else if(1<p.length){f.model.beginUpdate();try{for(a=0;a<p.length;a++){var l=this.updatePageRoot(new DiagramPage(p[a])),n=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[n+1]));f.model.execute(new ChangePage(this,l,l,n))}}finally{f.model.endUpdate()}}}null!=m&&"mxGraphModel"===m.nodeName&&(d=f.importGraphModel(m,b,c,e))}}catch(x){throw k||this.handleError(x,mxResources.get("invalidOrMissingFile")), +x;}return d};EditorUi.prototype.importVisio=function(a,b,c,e){e=null!=e?e:a.name;c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(/(\.vsd)($|\?)/i.test(e)){var d=new FormData;d.append("file1",a);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);f.responseType="blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{this.doImportVisio(f.response, +b,c)}catch(u){c(u)}else c({})});f.send(d)}else try{this.doImportVisio(a,b,c)}catch(u){c(u)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(f){this.handleError(f)}});"undefined"!==typeof VsdxExport||this.loadingExtensions|| +this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,c,e,k){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,c,e,k)}catch(w){this.handleError(w)}finally{null!=k&&k()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js", +d))};EditorUi.prototype.insertLucidChart=function(a,b,c,e,k){k=JSON.parse(a);a=[];if(null!=k.state){k=JSON.parse(k.state);for(var d in k.Pages)a.push(k.Pages[d]);a.sort(function(a,d){return a.Properties.Order<d.Properties.Order?-1:a.Properties.Order>d.Properties.Order?1:0})}else a.push(k);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,c,e),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}}; +EditorUi.prototype.insertTextAt=function(a,b,c,e,k,h,l){h=null!=h?h:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(k||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var d= +this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,c,h,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,c,h,!0),0<g.length)return g}catch(A){}this.loadImage(a,mxUtils.bind(this, +function(f){if("data:"==a.substring(0,5))this.resizeImage(f,a,mxUtils.bind(this,function(a,f,e){d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/f.width,this.maxImageSize/f.height)),g=Math.round(f.width*e);f=Math.round(f.height*e);d.setSelectionCell(d.insertVertex(null, +null,"",d.snap(b),d.snap(c),g,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;d.getModel().beginUpdate();try{f=d.insertVertex(d.getDefaultParent(),null,a,d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.updateCellSize(f),d.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{d.getModel().endUpdate()}d.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a)); +if(this.isCompatibleString(a))return this.importXml(a,b,c,h);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,c,h);else{d=this.editor.graph;k=null;d.getModel().beginUpdate();try{k=d.insertVertex(d.getDefaultParent(),null,"",d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.fireEvent(new mxEventObject("textInserted","cells",[k])),k.value=a,d.updateCellSize(k),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(k.value)&& +d.setLinkForCell(k,k.value),k.geometry.width+=d.gridSize,k.geometry.height+=d.gridSize}finally{d.getModel().endUpdate()}return[k]}}return[]};EditorUi.prototype.formatFileSize=function(a){var d=-1;do a/=1024,d++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[d]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var d=a.indexOf(";");0<d&&(a=a.substring(0,d)+a.substring(a.indexOf(",",d+1)))}return a};EditorUi.prototype.isRemoteFileFormat= +function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importFile=function(a,b,c,e,k,h,l,n,q,r,t){r=null!=r?r:!0;var d=!1,f=null,g=mxUtils.bind(this,function(a){var d=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,l)):d=this.importXml(a,c,e,r);null!=n&&n(d)});"image"==b.substring(0,5)?(q=!1,"image/png"==b.substring(0,9)&&(b=t?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,c,e,r),q= +!0)),q||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),r&&f.isGridEnabled()&&(c=f.snap(c),e=f.snap(e)),f=[f.insertVertex(null,null,"",c,e,k,h,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,c,e,r);null!=n&&n(a)})):null!= +q&&null!=l&&(/(\.vsdx)($|\?)/i.test(l)||/(\.vssx)($|\?)/i.test(l)||/(\.vsd)($|\?)/i.test(l))?(d=!0,this.importVisio(q,g)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(d=!0,this.parseFile(null!=q?q:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=n&&n(null))}),l)):/(\.vsd)($|\?)/i.test(l)||(f=this.insertTextAt(this.validateFileData(a),c,e,!0,null,r));d||null==n||n(f); +return f};EditorUi.prototype.base64Encode=function(a){for(var d="",b=0,c=a.length,e,h,k;b<c;){e=a.charCodeAt(b++)&255;if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);d+="==";break}h=a.charCodeAt(b++);if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e& +3)<<4|(h&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);d+="=";break}k=a.charCodeAt(b++);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(k&192)>>6);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return d}; +EditorUi.prototype.importFiles=function(a,b,c,e,k,h,l,n,q,r,t,C){b=null!=b?b:0;c=null!=c?c:0;e=null!=e?e:this.maxImageSize;r=null!=r?r:this.maxImageBytes;var d=null!=b&&null!=c,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=t||this.resampleThreshold,m=0;m<a.length;m++)if("image/"==a[m].type.substring(0,6)&&a[m].size>p){g=!0;break}var u=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;k=null!=k?k:mxUtils.bind(this,function(a,b,c,e,f,g,h,k,p){return null!=a&&"<mxlibrary"==a.substring(0, +10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,c,e,f,g,h,k,p,d,C)});h=null!=h?h:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var m=a.length,q=m,u=[],w=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--q){this.spinner.stop();if(null!=n)n(u);else{var d=[];g.getModel().beginUpdate();try{for(var c=0;c<u.length;c++){var e=u[c]();null!=e&&(d=d.concat(e))}}finally{g.getModel().endUpdate()}}h(d)}}), +v=0;v<m;v++)mxUtils.bind(this,function(d){var h=a[d],m=new FileReader;m.onload=mxUtils.bind(this,function(a){if(null==l||l(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var m=a.target.result,n=m.indexOf(","),q=decodeURIComponent(escape(atob(m.substring(n+1)))),y=mxUtils.parseXml(q),q=y.getElementsByTagName("svg");if(0<q.length){var q=q[0],u=C?null:q.getAttribute("content");null!=u&&"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(u,!0))); +null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u));null==u||"<mxfile "!==u.substring(0,8)&&"<mxGraphModel "!==u.substring(0,14)?w(d,mxUtils.bind(this,function(){try{if(m.substring(0,n+1),null!=y){var a=y.getElementsByTagName("svg");if(0<a.length){var l=a[0],r=parseFloat(l.getAttribute("width")),q=parseFloat(l.getAttribute("height")),u=l.getAttribute("viewBox");if(null==u||0==u.length)l.setAttribute("viewBox","0 0 "+r+" "+q);else if(isNaN(r)||isNaN(q)){var t=u.split(" ");3<t.length&&(r=parseFloat(t[2]), +q=parseFloat(t[3]))}m=this.createSvgDataUri(mxUtils.getXml(l));var w=Math.min(1,Math.min(e/Math.max(1,r)),e/Math.max(1,q)),E=k(m,h.type,b+d*p,c+d*p,Math.max(1,Math.round(r*w)),Math.max(1,Math.round(q*w)),h.name,f);if(isNaN(r)||isNaN(q)){var v=new Image;v.onload=mxUtils.bind(this,function(){r=Math.max(1,v.width);q=Math.max(1,v.height);E[0].geometry.width=r;E[0].geometry.height=q;l.setAttribute("viewBox","0 0 "+r+" "+q);m=this.createSvgDataUri(mxUtils.getXml(l));var a=m.indexOf(";");0<a&&(m=m.substring(0, +a)+m.substring(m.indexOf(",",a+1)));g.setCellStyles("image",m,[E[0]])});v.src=this.createSvgDataUri(mxUtils.getXml(l))}return E}}}catch(fa){}return null})):w(d,mxUtils.bind(this,function(){return k(u,"text/xml",b+d*p,c+d*p,0,0,h.name)}))}}else{q=!1;if("image/png"==h.type){var E=C?null:this.extractGraphModelFromPng(a.target.result);if(null!=E&&0<E.length){var v=new Image;v.src=a.target.result;w(d,mxUtils.bind(this,function(){return k(E,"text/xml",b+d*p,c+d*p,v.width,v.height,h.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP? +(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,m,l){w(d,mxUtils.bind(this,function(){if(null!=g&&g.length<r){var n=f&&this.isResampleImage(a.target.result,t)?Math.min(1, +Math.min(e/m,e/l)):1;return k(g,h.type,b+d*p,c+d*p,Math.round(m*n),Math.round(l*n),h.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,t)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else k(a.target.result,h.type,b+d*p,c+d*p,240,160,h.name,function(a){w(d,function(){return a})})});/(\.vsdx)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name)||/(\.vsd)($|\?)/i.test(h.name)?k(null,h.type,b+d*p,c+d*p,240,160, +h.name,function(a){w(d,function(){return a})},h):"image"==h.type.substring(0,5)?m.readAsDataURL(h):m.readAsText(h)})(v)});g?this.confirmImageResize(function(a){f=a;u()},q):u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(c,e){if(c||b)mxSettings.setResizeImages(c?e:null),mxSettings.save();d();a(e)};null==c|| +b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,c)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format", +"xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,e,k,h){k=null!=k?k:this.maxImageSize;var d=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,h))try{var g=Math.max(d/k,f/k);if(1<g){var p=Math.round(d/g),m=Math.round(f/g),l=document.createElement("canvas"); +l.width=p;l.height=m;l.getContext("2d").drawImage(a,0,0,p,m);var n=l.toDataURL();if(n.length<b.length){var q=document.createElement("canvas");q.width=p;q.height=m;var t=q.toDataURL();n!==t&&(b=n,d=p,f=m)}}}catch(F){}c(b,d,f)};EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var c=e,k=0;8>k;k++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[e]=c;EditorUi.prototype.updateCRC=function(a,b,c,e){for(var d=0;d<e;d++)a=EditorUi.prototype.crcTable[(a^b[c+d])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng= +function(a,b,c,e,k){function d(a,b){var d=p;p+=b;return a.substring(d,p)}function f(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(d(a,4),"IHDR"!=d(a,4))null!=k&&k();else{d(a,17);k=a.substring(0, +p);do{var m=f(a);if("IDAT"==d(a,4)){k=a.substring(0,p-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,c,0,c.length);k+=g(c.length)+b+c+g(e^4294967295);k+=a.substring(p-8,a.length);break}k+=a.substring(p-8,p-4+m);d(a,m);d(a,4)}while(m);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var d=a.substring(a.indexOf(",")+1),c=window.atob&& +!mxClient.IS_SF?atob(d):Base64.decode(d,!0);EditorUi.parsePng(c,mxUtils.bind(this,function(a,d,e){a=c.substring(a+8,a+8+e);"zTXt"==d?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==d&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==d)return!0}))}catch(m){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)); +null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var d=a.indexOf(",");0<d&&(a=b.getPageById(a.substring(d+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,c=this.editor.graph;c.addListener("pageLinkClicked",function(b, +d){a(d.getProperty("href"))});this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var d=0;d<b.pages.length;d++)if(b.pages[d]==b.currentPage){0<d&&(a+=(0<a.length?"&":"?")+"page="+d);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this, +arguments)};var k=c.addClickHandler;c.addClickHandler=function(b,d,e){var f=d;d=function(b,d){if(null==d){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(d=e.getAttribute("href"))}null==d||!c.isPageLink(d)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(d),mxEvent.consume(b));null!=f&&f(b,d)};k.call(this,b,d,e)};l.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container, +360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=c.getGlobalVariable;c.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,arguments)};var n=c.createLinkForHint;c.createLinkForHint=function(d,e){var f=c.isPageLink(d);if(f){var g=d.indexOf(",");0<g&&(g=b.getPageById(d.substring(g+1)),e=null!= +g?g.getName():mxResources.get("pageNotFound"))}g=n.call(this,d,e);f&&mxEvent.addListener(g,"click",function(b){a(d);mxEvent.consume(b)});return g};var q=c.labelLinkClicked;c.labelLinkClicked=function(b,d,e){var f=d.getAttribute("href");if(null==f||!c.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e))q.apply(this,arguments);else{if(!c.isEnabled()||null!=b&&c.isCellLocked(b.cell))a(f),c.getRubberband().reset();mxEvent.consume(e)}};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename, +d=b.getCurrentFile();null!=d&&(a=null!=d.getTitle()?d.getTitle():a);return a};var t=this.actions.get("print");t.setEnabled(!mxClient.IS_IOS||!navigator.standalone);t.visible=t.isEnabled();if(!this.editor.chromeless||this.editor.editable){var r=function(){window.setTimeout(function(){A.innerHTML=" ";A.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0); +this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||c.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var d=a.clipboardData||a.originalEvent.clipboardData,c=!1,e=0;e<d.types.length;e++)if("text/"===d.types[e].substring(0,5)){c=!0;break}if(!c){var f=d.items; +for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,d,c,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(G){}}),!1);var A=document.createElement("div");A.style.position="absolute";A.style.whiteSpace= +"nowrap";A.style.overflow="hidden";A.style.display="block";A.contentEditable=!0;mxUtils.setOpacity(A,0);A.style.width="1px";A.style.height="1px";A.innerHTML=" ";var C=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==c.container||!c.isEnabled()||c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"== +b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||C||(A.style.left=c.container.scrollLeft+10+"px",A.style.top=c.container.scrollTop+10+"px",c.container.appendChild(A),C=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){A.focus();document.execCommand("selectAll",!1,null)},0):(A.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!C|| +224!=b&&17!=b&&91!=b||(C=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),A.parentNode.removeChild(A))}),0)}));mxEvent.addListener(A,"copy",mxUtils.bind(this,function(a){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(A),r())}));mxEvent.addListener(A,"cut",mxUtils.bind(this,function(a){c.isEnabled()&&(this.copyCells(A,!0),r())}));mxEvent.addListener(A,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(A.innerHTML=" ",A.focus(), +window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,A);A.innerHTML=" "}),0))}),!0);var x=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==A?!0:x.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph, +d=b.cellEditor.text2,c=null;null!=d&&(mxEvent.addListener(d,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=this.highlightElement(d));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files, +0,0,this.maxImageSize,function(a,d,c,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var d=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)?this.loadImage(decodeURIComponent(d),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1, +Math.min(e/Math.max(1,c)),e/Math.max(1,a));b.insertImage(decodeURIComponent(d),c*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!== +typeof mxRuler){t=document.createElement("div");t.style.position="absolute";t.style.top="95px";t.style.left="250px";t.style.width="2000px";t.style.height="30px";t.style.background="whiteSmoke";document.body.appendChild(t);var z=document.createElement("div");z.style.position="absolute";z.style.top="125px";z.style.left="220px";z.style.width="30px";z.style.height="1000px";z.style.background="whiteSmoke";document.body.appendChild(z);var B=document.createElement("div");B.style.position="absolute";B.style.top= +"95px";B.style.left="220px";B.style.width="30px";B.style.height="30px";B.style.background="whiteSmoke";document.body.appendChild(B);this.vRuler=new mxRuler(this.editor.graph,z,!0);this.hRuler=new mxRuler(this.editor.graph,t,!1)}if("1"==urlParams.test){t=document.getElementById("geFooter");null!=t&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width= +"98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),t.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var d=this.editor.graph.getSelectionCell(),d=this.editor.graph.getModel().getStyle(d); +this.styleInput.value=d||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var F=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:F.apply(this,arguments)}}t=document.getElementById("geInfo");null!=t&&t.parentNode.removeChild(t);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var H=null;mxEvent.addListener(c.container,"dragleave",function(a){c.isEnabled()&&(null!=H&&(H.parentNode.removeChild(H), +H=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(a){null==H&&(!mxClient.IS_IE||10<document.documentMode)&&(H=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c.container,"drop",mxUtils.bind(this,function(a){null!=H&&(H.parentNode.removeChild(H),H=null);if(c.isEnabled()){var b=mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)), +d=c.view.translate,e=c.view.scale,f=b.x/e-d.x,g=b.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=b)c.setSelectionCells(this.importXml(b,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types, +"text/html")){var k=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=k;var p=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(p=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(k=b[0].getAttribute("href")));var m=!0,l=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(k,f,g,!0,p,null,m))});p&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){m= +a;l()},mxEvent.isControlDown(a)):l()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,b)),d/Math.max(1,a));c.setSelectionCell(c.insertVertex(null,null,"",f,g,b*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(a){c.setSelectionCells(this.insertTextAt(h, +f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors= +mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget()); +this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged", +mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew|| +8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var d=this.editor.graph;if(d.isSelectionEmpty())a.innerHTML="";else{var c=mxUtils.sortCells(d.model.getTopmostCells(d.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(c));mxUtils.setTextContent(a,encodeURIComponent(e));b?(d.removeCells(c, +!1),d.lastPasteXml=null):(d.lastPasteXml=e,d.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var d=b.getElementsByTagName("span");if(null!=d&&0<d.length&&"application/vnd.lucid.chart.objects"===d[0].getAttribute("data-lucid-type")){var c=d[0].getAttribute("data-lucid-content");null!=c&&0<c.length&&(this.importLucidChart(c,0,0),mxEvent.consume(a))}else{var c=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS|| +8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var k=e.lastIndexOf("%3E");0<=k&&k<e.length-3&&(e=e.substring(0,k+3))}catch(v){}try{var d=b.getElementsByTagName("span"),l=null!=d&&0<d.length?mxUtils.trim(decodeURIComponent(d[0].textContent)):decodeURIComponent(e);this.isCompatibleString(l)&&(f=!0,e=l)}catch(v){}c.lastPasteXml==e?c.pasteCounter++:(c.lastPasteXml=e,c.pasteCounter=0);d=c.pasteCounter*c.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?c.setSelectionCells(this.importXml(e, +d,d)):(f=c.getInsertPoint(),c.isMouseInsertPoint()&&(d=0,c.lastPasteXml==e&&0<c.pasteCounter&&c.pasteCounter--),c.setSelectionCells(this.insertTextAt(e,f.x+d,f.y+d,!0))),!c.isSelectionEmpty())){c.scrollCellToVisible(c.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(c.view.getState(c.getSelectionCell()));try{mxEvent.consume(a)}catch(v){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,d=0;d<a.length;d++)mxEvent.addListener(a[d],"dragleave", +function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[d],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[d],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()|| +"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var d=this.extractGraphModelFromEvent(a);if(null==d){var c=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=c&&(10==document.documentMode||11==document.documentMode?d=c.getData("Text"):(d=null,d=0<=mxUtils.indexOf(c.types, +"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(c.types,"text/html")?c.getData("text/html"):null,null!=d&&0<d.length?(c=document.createElement("div"),c.innerHTML=d,c=c.getElementsByTagName("img"),0<c.length&&(d=c[0].getAttribute("src"))):0<=mxUtils.indexOf(c.types,"text/plain")&&(d=c.getData("text/plain"))),null!=d&&("data:image/png;base64,"==d.substring(0,22)?(d=this.extractGraphModelFromPng(d),null!=d&&0<d.length&&this.openLocalFile(d,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(d)? +(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(d))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(d)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(d):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(d)))))}else this.openLocalFile(d,null,!0)}a.stopPropagation();a.preventDefault()}))}; +EditorUi.prototype.highlightElement=function(a){var b=0,d=0,c,e;if(null==a){e=document.body;var h=document.documentElement;c=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-3}else b=a.offsetTop,d=a.offsetLeft,c=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=b+"px";h.style.left=d+"px";h.style.width= +Math.max(0,c-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var d=new mxCodec(b.ownerDocument),c=new mxGraphModel;d.decode(b,c);b=c.getChildAt(c.getRoot(),0);for(d=0;d<c.getChildCount(b);d++)a.push(c.getChildAt(b,d))}return a};EditorUi.prototype.openFiles= +function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var d=0;d<a.length;d++)mxUtils.bind(this,function(a){var d=new FileReader;d.onload=mxUtils.bind(this,function(d){var c=d.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&& +"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(A){this.handleError(A,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.vsdx)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e)||/(\.vsd)($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,e))this.parseFile(a, +mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==c.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(c,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear(); +this.spinner.stop()}));else if("<mxlibrary"==d.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,d.target.result,a.name))}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(c=this.extractGraphModelFromPng(c)),this.spinner.stop(),this.openLocalFile(c,e,b)}});d.onerror=mxUtils.bind(this, +function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?d.readAsDataURL(a):d.readAsText(a)})(a[d])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this, +a,b||this.defaultFilename,c))});null!=a&&0<a.length&&(null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"), +null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function d(a){if(null!=a){var d=a.lastIndexOf(".");0<d&&(a=a.substring(d+1, +a.length));null==b[a]&&(b[a]=!0)}}var c=this.editor.graph,e=c.getCellStyle(a);d(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));c.model.isEdge(a)&&(d(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),d(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=c.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(c.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility= +a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden")};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this, +function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&& +this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale, +page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,d=!1,c=!1,e=null,h=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!= +a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(Q){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(E){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!= +h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title); +this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft", +result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(E){k.postMessage(JSON.stringify({event:"draft",error:E.toString(),message:h}),"*")}return}if("template"== +h.action){this.spinner.stop();var l=1==h.enableRecent,n=1==h.enableSearch,l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,d){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:d}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=a;k.postMessage(JSON.stringify({event:"recentDocs"}), +"*")}):null,n?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,d){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:d}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==h.action)this.searchReadyCallback(h.list,h.errorMsg);else if("recentDocsList"==h.action)this.recentReadyCallback(h.list, +h.errorMsg);else{if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var p=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,p):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null== +h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var m=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(m);k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage); +"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(m))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),w=q.getGlobalVariable,y=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?y.getName():"pagenumber"==a?1:w.apply(this,arguments)};document.body.appendChild(q.container); +q.model.setRoot(y.root)}this.exportToCanvas(mxUtils.bind(this,function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(m)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!= +h.xml&&0<h.xml.length&&this.setFileData(h.xml);p=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),p.xml=mxUtils.getXml(l),p.data=this.getFileData(null,null,!0,null,null,null,l),p.format=h.format;else if("html"==h.format)m=this.editor.getGraphXml(),p.data=this.getHtml(m,this.editor.graph),p.xml=mxUtils.getXml(m),p.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background; +l==mxConstants.NONE&&(l=null);p.xml=this.getFileData(!0);p.format="svg";if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(l), +mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(p),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));p.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(p),"*")}return}if("load"==h.action)c=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified= +h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan), +this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}}h=g(h);d=!0;try{a(h,f)}catch(E){this.handleError(E)}d=!1;null!=urlParams.modified&&this.editor.setStatus("");var I=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&& +1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=I();c&&null==b&&(b=mxUtils.bind(this,function(a,b){var c=I();if(c!=e&&!d){var f=this.createLoadMessage("autosave");f.xml=c;c=JSON.stringify(f);(window.opener||window.parent).postMessage(c,"*")}e=c}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged", +b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}): +urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize= +"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})), +a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog= +function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),d=[];if(0<b.length){var c={},e=null,h=null,k="auto",l="auto",n=null,q=null,t=40,C=40,x=0,z=this.editor.graph; +z.getGraphBounds();for(var B=function(){z.setSelectionCells(Y);z.scrollCellToVisible(z.getSelectionCell())},F=z.getFreeInsertPoint(),H=F.x,L=F.y,F=L,y=null,I="auto",E=[],Q=null,X=null,R=0;R<b.length&&"#"==b[R].charAt(0);){a=b[R];for(R++;R<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[R].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[R].substring(1)),R++;if("#"!=a.charAt(1)){var Z=a.indexOf(":");if(0<Z){var G=mxUtils.trim(a.substring(1,Z)),K=mxUtils.trim(a.substring(Z+1));"label"==G?y=z.sanitizeHtml(K): +"style"==G?e=K:"identity"==G&&0<K.length&&"-"!=K?h=K:"width"==G?k=K:"height"==G?l=K:"left"==G&&0<K.length?n=K:"top"==G&&0<K.length?q=K:"ignore"==G?X=K.split(","):"connect"==G?E.push(JSON.parse(K)):"link"==G?Q=K:"padding"==G?x=parseFloat(K):"edgespacing"==G?t=parseFloat(K):"nodespacing"==G?C=parseFloat(K):"layout"==G&&(I=K)}}}var S=this.editor.csvToArray(b[R]);a=null;if(null!=h)for(var J=0;J<S.length;J++)if(h==S[J]){a=J;break}null==y&&(y="%"+S[0]+"%");if(null!=E)for(var N=0;N<E.length;N++)null==c[E[N].to]&& +(c[E[N].to]={});z.model.beginUpdate();try{for(J=R+1;J<b.length;J++){var U=this.editor.csvToArray(b[J]);if(U.length==S.length){var D=null,W=null!=a?U[a]:null;null!=W&&(D=z.model.getCell(W));null==D&&(D=new mxCell(y,new mxGeometry(H,F,0,0),e||"whiteSpace=wrap;html=1;"),D.vertex=!0,D.id=W);for(var O=0;O<U.length;O++)z.setAttributeForCell(D,S[O],U[O]);z.setAttributeForCell(D,"placeholders","1");D.style=z.replacePlaceholders(D,D.style);for(N=0;N<E.length;N++)c[E[N].to][D.getAttribute(E[N].to)]=D;null!= +Q&&"link"!=Q&&(z.setLinkForCell(D,D.getAttribute(Q)),z.setAttributeForCell(D,Q,null));z.fireEvent(new mxEventObject("cellsInserted","cells",[D]));var T=this.editor.graph.getPreferredSizeForCell(D);D.vertex&&(null!=n&&null!=D.getAttribute(n)&&(D.geometry.x=H+parseFloat(D.getAttribute(n))),null!=q&&null!=D.getAttribute(q)&&(D.geometry.y=L+parseFloat(D.getAttribute(q))),"@"==k.charAt(0)&&null!=D.getAttribute(k.substring(1))?D.geometry.width=parseFloat(D.getAttribute(k.substring(1))):D.geometry.width= +"auto"==k?T.width+x:parseFloat(k),"@"==l.charAt(0)&&null!=D.getAttribute(l.substring(1))?D.geometry.height=parseFloat(D.getAttribute(l.substring(1))):D.geometry.height="auto"==l?T.height+x:parseFloat(l),F+=D.geometry.height+C);d.push(z.addCell(D))}}for(var V=d.slice(),Y=d.slice(),N=0;N<E.length;N++)for(var M=E[N],J=0;J<d.length;J++){var D=d[J],ca=D.getAttribute(M.from);if(null!=ca){z.setAttributeForCell(D,M.from,null);for(var da=ca.split(","),O=0;O<da.length;O++){var aa=c[M.to][da[O]];null!=aa&&(y= +M.label,null!=M.fromlabel&&(y=(D.getAttribute(M.fromlabel)||"")+(y||"")),null!=M.tolabel&&(y=(y||"")+(aa.getAttribute(M.tolabel)||"")),Y.push(z.insertEdge(null,null,y||"",M.invert?aa:D,M.invert?D:aa,M.style||z.createCurrentEdgeStyle())),mxUtils.remove(M.invert?D:aa,V))}}}if(null!=X)for(J=0;J<d.length;J++)for(D=d[J],O=0;O<X.length;O++)z.setAttributeForCell(D,mxUtils.trim(X[O]),null);var ea=new mxParallelEdgeLayout(z);ea.spacing=t;var la=function(){ea.execute(z.getDefaultParent());for(var a=0;a<d.length;a++){var b= +z.getCellGeometry(d[a]);b.x=Math.round(z.snap(b.x));b.y=Math.round(z.snap(b.y));"auto"==k&&(b.width=Math.round(z.snap(b.width)));"auto"==l&&(b.height=Math.round(z.snap(b.height)))}};if("circle"==I){var ha=new mxCircleLayout(z);ha.resetEdges=!1;var ra=ha.isVertexIgnored;ha.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){ha.execute(z.getDefaultParent());la()},!0,B);B=null}else if("horizontaltree"==I||"verticaltree"==I||"auto"==I&&Y.length== +2*d.length-1&&1==V.length){z.view.validate();var fa=new mxCompactTreeLayout(z,"horizontaltree"==I);fa.levelDistance=C;fa.edgeRouting=!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(z.getDefaultParent(),0<V.length?V[0]:null)},!0,B);B=null}else if("horizontalflow"==I||"verticalflow"==I||"auto"==I&&1==V.length){z.view.validate();var ma=new mxHierarchicalLayout(z,"horizontalflow"==I?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ma.intraCellSpacing=C;ma.disableEdgeStyle=!1;this.executeLayout(function(){ma.execute(z.getDefaultParent(), +Y);z.moveCells(Y,H,L)},!0,B);B=null}else if("organic"==I||"auto"==I&&Y.length>d.length){z.view.validate();var ba=new mxFastOrganicLayout(z);ba.forceConstant=3*C;ba.resetEdges=!1;var pa=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return pa.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ea=new mxParallelEdgeLayout(z);ea.spacing=t;this.executeLayout(function(){ba.execute(z.getDefaultParent());la()},!0,B);B=null}this.hideDialog()}finally{z.model.endUpdate()}null!=B&&B()}}catch(ia){this.handleError(ia)}}; +EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var d="?",c;for(c in urlParams)0>mxUtils.indexOf(a,c)&&null!=urlParams[c]&&(b+=d+c+"="+urlParams[c],d="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var d="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "), +c;for(c in urlParams)0>mxUtils.indexOf(d,c)&&(a=0==b?a+"?":a+"&",null!=urlParams[c]&&(a+=c+"="+urlParams[c],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var n=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=n.apply(this,arguments),d=this.editor.graph,c=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(d.container)&&d.pageVisible&& +null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return c.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(d.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width* +b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(d.container)&&null!=this.source.minimumGraphSize){var c=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*c.x))/2)-c.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*c.y))/2)-c.y-5/a))}return new mxPoint(8/ +a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=d.getPageLayout(),b=d.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,d){var c=d.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat= +e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(c.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var d=0;null==this.drive&&"function"!==typeof window.DriveClient|| +d++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||d++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||d++;b||null==this.gitHub||d++;b||null==this.trello&&"function"!==typeof window.TrelloClient||d++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&d++;mxClient.IS_IOS||d++;return d};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled(); +this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c); +a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!= +this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding= +"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,k=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b= +'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+ +IMAGE_PATH+'/clear.gif"/>'}a!=k&&(this.offlineStatus.innerHTML=b,k=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){}; +EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var q=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){q.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b); +this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b); +this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("rename").setEnabled(null!=c&&c.isRenamable());this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted()); +a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,e,k,h){var d=a.editor.graph;if("xml"== +c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(d.getSvg(e,k,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=d.getGraphBounds(),l=Math.floor(g.width*k/d.view.scale),n=Math.floor(g.height*k/d.view.scale);f.length<=MAX_REQUEST_SIZE&&l*n<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+ +encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+l+"&h="+n+"&border="+h+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,e){this.ui=a;this.page=b;this.previous=this.name=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))}; function MovePage(a,b,e){this.ui=a;this.oldIndex=b;this.newIndex=e}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))}; function SelectPage(a,b){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b))} @@ -3028,8 +3030,8 @@ a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);e=d;e=b.apply(this,arg return b}function e(a){var b=!1;null!=a&&(a=w.getParent(a),b=h.view.getState(a),h.view.getState(a),b=null!=(null!=b?b.style:h.getCellStyle(a)).childLayout);return b}function q(a){a=h.view.getState(a);if(null!=a){var b=h.getIncomingEdges(a.cell);if(0<b.length&&(b=h.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())< a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function t(a,b){b=null!=b?b:!0;h.model.beginUpdate();try{var c=h.model.getParent(a),d=h.getIncomingEdges(a),e=h.cloneCells([d[0],a]);h.model.setTerminal(e[0],h.model.getTerminal(d[0],!0),!0);var f=q(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+ 10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);h.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=h.view.getState(a),l=h.view.scale;if(null!=k){var n=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*l:n.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var m=h.getOutgoingEdges(h.model.getTerminal(d[0], -!0));if(null!=m){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=d=0;t<m.length;t++){var r=h.model.getTerminal(m[t],!1);if(f==q(r)){var x=h.view.getState(r);r!=a&&null!=x&&(p&&b!=x.getCenterX()<k.getCenterX()||!p&&b!=x.getCenterY()<k.getCenterY())&&mxUtils.intersects(n,x)&&(d=10+Math.max(d,(Math.min(n.x+n.width,x.x+x.width)-Math.max(n.x,x.x))/l),g=10+Math.max(g,(Math.min(n.y+n.height,x.y+x.height)-Math.max(n.y,x.y))/l))}}p?g=0:d=0;for(t=0;t<m.length;t++)if(r=h.model.getTerminal(m[t], -!1),f==q(r)&&(x=h.view.getState(r),r!=a&&null!=x&&(p&&b!=x.getCenterX()<k.getCenterX()||!p&&b!=x.getCenterY()<k.getCenterY()))){var u=[];h.traverse(x.cell,!0,function(a,b){null!=b&&u.push(b);u.push(a);return!0});h.moveCells(u,(b?1:-1)*d,(b?1:-1)*g)}}}return h.addCells(e,c)}finally{h.model.endUpdate()}}function d(a){h.model.beginUpdate();try{var b=q(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(c[0],d[1],!1);h.model.setTerminal(d[0],d[1],!0);h.model.setTerminal(d[0],a,!1); +!0));if(null!=m){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=d=0;t<m.length;t++){var r=h.model.getTerminal(m[t],!1);if(f==q(r)){var u=h.view.getState(r);r!=a&&null!=u&&(p&&b!=u.getCenterX()<k.getCenterX()||!p&&b!=u.getCenterY()<k.getCenterY())&&mxUtils.intersects(n,u)&&(d=10+Math.max(d,(Math.min(n.x+n.width,u.x+u.width)-Math.max(n.x,u.x))/l),g=10+Math.max(g,(Math.min(n.y+n.height,u.y+u.height)-Math.max(n.y,u.y))/l))}}p?g=0:d=0;for(t=0;t<m.length;t++)if(r=h.model.getTerminal(m[t], +!1),f==q(r)&&(u=h.view.getState(r),r!=a&&null!=u&&(p&&b!=u.getCenterX()<k.getCenterX()||!p&&b!=u.getCenterY()<k.getCenterY()))){var y=[];h.traverse(u.cell,!0,function(a,b){null!=b&&y.push(b);y.push(a);return!0});h.moveCells(y,(b?1:-1)*d,(b?1:-1)*g)}}}return h.addCells(e,c)}finally{h.model.endUpdate()}}function d(a){h.model.beginUpdate();try{var b=q(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(c[0],d[1],!1);h.model.setTerminal(d[0],d[1],!0);h.model.setTerminal(d[0],a,!1); var e=h.model.getParent(a),f=e.geometry,g=[];h.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);h.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-40):b==mxConstants.DIRECTION_WEST?(k=-40,l=0):b==mxConstants.DIRECTION_EAST&&(l=0);h.moveCells(g,k,l);return h.addCells(d,e)}finally{h.model.endUpdate()}}function f(a){h.model.beginUpdate();try{var b= h.model.getParent(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(d[0],a,!0);var c=h.getOutgoingEdges(a),e=b.geometry,f=[];h.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var k=h.model.getTerminal(c[g],!1);null!=k&&f.push(k)}var l=h.view.getBounds(f),n=q(a),m=h.view.translate,p=h.view.scale;n==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(l.x+l.width)/p-m.x-e.x+10,d[1].geometry.y+=a.geometry.height- e.y+40):n==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(l.x+l.width)/p-m.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=n==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==l?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(l.y+l.height)/p-m.y+-e.y+10);return h.addCells(d,b)}finally{h.model.endUpdate()}}function g(a, @@ -3043,9 +3045,9 @@ function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=h.getIncomingEdges(a[f]) a)}this.model.beginUpdate();try{var k=r.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var l=h.getIncomingEdges(k[e]),g=h.getIncomingEdges(a[e]);if(0==l.length&&0<g.length){var n=this.cloneCells([g[0]])[0];this.addEdge(n,h.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var A=h.moveCells;h.moveCells=function(a,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var n=f,m=this.view.getState(f),p=null!=m?m.style:this.getCellStyle(f); if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||h.model.isEdge(a[q])&&null==h.model.getTerminal(a[q],!0)){f=h.model.getParent(a[q]);break}if(null!=n&&f!=n&&null!=this.view.getState(a[0])){var t=h.getIncomingEdges(a[0]);if(0<t.length){var r=h.view.getState(h.model.getTerminal(t[0],!0));if(null!=r){var u=h.view.getState(n);null!=u&&(c=(u.getCenterX()-r.getCenterX())/h.view.scale,d=(u.getCenterY()-r.getCenterY())/h.view.scale)}}}}l=A.apply(this,arguments); if(null!=l&&null!=a&&l.length==a.length)for(q=0;q<l.length;q++)if(this.model.isEdge(l[q]))b(n)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q],n,!0);else if(b(a[q])&&(t=h.getIncomingEdges(a[q]),0<t.length))if(!e)b(n)&&0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],n,!0);else if(0==h.getIncomingEdges(l[q]).length){m=n;if(null==m||m==h.model.getParent(a[q]))m=h.model.getTerminal(t[0],!0);e=this.cloneCells([t[0]])[0];this.addEdge(e, -h.getDefaultParent(),m,l[q])}}finally{this.model.endUpdate()}return l};if(null!=m.sidebar){var C=m.sidebar.dropAndConnect;m.sidebar.dropAndConnect=function(a,c,d,e){var f=h.model,g=null;f.beginUpdate();try{if(g=C.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=h.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var y={88:m.actions.get("selectChildren"), +h.getDefaultParent(),m,l[q])}}finally{this.model.endUpdate()}return l};if(null!=m.sidebar){var C=m.sidebar.dropAndConnect;m.sidebar.dropAndConnect=function(a,c,d,e){var f=h.model,g=null;f.beginUpdate();try{if(g=C.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=h.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var x={88:m.actions.get("selectChildren"), 84:m.actions.get("selectSubtree"),80:m.actions.get("selectParent"),83:m.actions.get("selectSiblings")},z=m.onKeyDown;m.onKeyDown=function(a){try{if(h.isEnabled()&&!h.isEditing()&&b(h.getSelectionCell())&&1==h.getSelectionCount()){var c=null;0<h.getIncomingEdges(h.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?d(h.getSelectionCell()):f(h.getSelectionCell()):13==a.which&&(c=t(h.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&h.model.isEdge(c[0])?h.setSelectionCell(h.model.getTerminal(c[0], -!1)):h.setSelectionCell(c[c.length-1]),null!=m.hoverIcons&&m.hoverIcons.update(h.view.getState(h.getSelectionCell())),h.startEditingAtCell(h.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=y[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(h.getSelectionCell(), +!1)):h.setSelectionCell(c[c.length-1]),null!=m.hoverIcons&&m.hoverIcons.update(h.view.getState(h.getSelectionCell())),h.startEditingAtCell(h.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=x[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(h.getSelectionCell(), mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(p(h.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(Q){console.log("error",Q)}mxEvent.isConsumed(a)||z.apply(this,arguments)};var B=h.connectVertex;h.connectVertex=function(a,c,e,g,k,l){var n=h.getIncomingEdges(a);return b(a)&&0<n.length?(e=q(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,k=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,e==c?f(a):g==k?d(a):t(a,c!=mxConstants.DIRECTION_NORTH&& c!=mxConstants.DIRECTION_WEST)):B.call(this,a,c,e,g,k,l)};h.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&h.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var F=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){F.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"), this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells); @@ -3120,6 +3122,6 @@ GraphViewer.initCss=function(){try{var a=document.createElement("style");a.type= GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,b,e){if(null!=GraphViewer.cachedUrls[a])b(GraphViewer.cachedUrls[a]);else{var c=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;c.open("GET",a);c.onload=function(){b(null!=c.getText?c.getText():c.responseText)};c.onerror=e;c.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0; (function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(e,c){function k(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function l(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function n(b,c){if(!b.resizedAttached)b.resizedAttached= new k,b.resizedAttached.add(c);else if(b.resizedAttached){b.resizedAttached.add(c);return}b.resizeSensor=document.createElement("div");b.resizeSensor.className="resize-sensor";b.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";b.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>'; -b.appendChild(b.resizeSensor);"static"==l(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],g=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};g();var n=!1,p=function(){b.resizedAttached&&(n&&(b.resizedAttached.call(),n=!1),a(p))};a(p);var q,t,y,z,B=function(){if((y=b.offsetWidth)!=q||(z=b.offsetHeight)!=t)n=!0,q=y,t=z;g()},F=function(a,b,c){a.attachEvent? +b.appendChild(b.resizeSensor);"static"==l(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],g=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};g();var n=!1,p=function(){b.resizedAttached&&(n&&(b.resizedAttached.call(),n=!1),a(p))};a(p);var q,t,x,z,B=function(){if((x=b.offsetWidth)!=q||(z=b.offsetHeight)!=t)n=!0,q=x,t=z;g()},F=function(a,b,c){a.attachEvent? a.attachEvent("on"+b,c):a.addEventListener(b,c)};F(d,"scroll",B);F(f,"scroll",B)}var q=function(){GraphViewer.resizeSensorEnabled&&c()},t=Object.prototype.toString.call(e),d="[object Array]"===t||"[object NodeList]"===t||"[object HTMLCollection]"===t||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(d)for(var t=0,f=e.length;t<f;t++)n(e[t],q);else n(e,q);this.detach=function(){if(d)for(var a=0,c=e.length;a<c;a++)b.detach(e[a]);else b.detach(e)}}; b.detach=function(a){a.resizeSensor&&(a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)};window.ResizeSensor=b})(); diff --git a/src/main/webapp/js/atlas.min.js b/src/main/webapp/js/atlas.min.js index 156da7d88eb2b5cd8399bf16b55bc1554ea33706..3f4ab50304993853c6d0cb4d904bf1b9093ca7f4 100644 --- a/src/main/webapp/js/atlas.min.js +++ b/src/main/webapp/js/atlas.min.js @@ -96,9 +96,9 @@ ea;m.wa=m.normalizeRCData=e;m.xa=m.sanitize=function(a,b,d,e){return Q(a,ea(b,d, l--,_+=n[s++]<<u,u+=8}if(a.nlen=(31&_)+257,_>>>=5,u-=5,a.ndist=(31&_)+1,_>>>=5,u-=5,a.ncode=(15&_)+4,_>>>=4,u-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=_t;break}a.have=0,a.mode=tt;case tt:for(;a.have<a.ncode;){for(;u<3;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.lens[At[a.have++]]=7&_,_>>>=3,u-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=y(x,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=_t;break}a.have=0,a.mode=et;case et:for(;a.have<a.nlen+a.ndist;){for(;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(wt<16)_>>>=gt,u-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_>>>=gt,u-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=_t;break}yt=a.lens[a.have-1],g=3+(3&_),_>>>=2,u-=2}else if(17===wt){for(Bt=gt+3;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=3+(7&_),_>>>=3,u-=3}else{for(Bt=gt+7;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=11+(127&_),_>>>=7,u-=7}if(a.have+g>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=_t;break}for(;g--;)a.lens[a.have++]=yt}}if(a.mode===_t)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=_t;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=y(z,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=_t;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=y(B,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=_t;break}if(a.mode=at,e===A)break t;case at:a.mode=it;case it:if(l>=6&&h>=258){t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,k(t,b),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,a.mode===X&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(mt&&0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.lencode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=lt;break}if(32&mt){a.back=-1,a.mode=X;break}if(64&mt){t.msg="invalid literal/length code",a.mode=_t;break}a.extra=15&mt,a.mode=nt;case nt:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.length+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=rt;case rt:for(;St=a.distcode[_&(1<<a.distbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.distcode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=_t;break}a.offset=wt,a.extra=15&mt,a.mode=st;case st:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.offset+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=_t;break}a.mode=ot;case ot:if(0===h)break t;if(g=b-h,a.offset>g){if(g=a.offset-g,g>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=_t;break}g>a.wnext?(g-=a.wnext,m=a.wsize-g):m=a.wnext-g,g>a.length&&(g=a.length),bt=a.window}else bt=r,m=o-a.offset,g=a.length;g>h&&(g=h),h-=g,a.length-=g;do r[o++]=bt[m++];while(--g);0===a.length&&(a.mode=it);break;case lt:if(0===h)break t;r[o++]=a.length,h--,a.mode=it;break;case ht:if(a.wrap){for(;u<32;){if(0===l)break t;l--,_|=n[s++]<<u,u+=8}if(b-=h,t.total_out+=b,a.total+=b,b&&(t.adler=a.check=a.flags?v(a.check,r,b,o-b):p(a.check,r,b,o-b)),b=h,(a.flags?_:i(_))!==a.check){t.msg="incorrect data check",a.mode=_t;break}_=0,u=0}a.mode=dt;case dt:if(a.wrap&&a.flags){for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=_t;break}_=0,u=0}a.mode=ft;case ft:xt=R;break t;case _t:xt=O;break t;case ut:return D;case ct:default:return N}return t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,(a.wsize||b!==t.avail_out&&a.mode<_t&&(a.mode<ht||e!==S))&&f(t,t.output,t.next_out,b-t.avail_out)?(a.mode=ut,D):(c-=t.avail_in,b-=t.avail_out,t.total_in+=c,t.total_out+=b,a.total+=b,a.wrap&&b&&(t.adler=a.check=a.flags?v(a.check,r,b,t.next_out-b):p(a.check,r,b,t.next_out-b)),t.data_type=a.bits+(a.last?64:0)+(a.mode===X?128:0)+(a.mode===at||a.mode===Q?256:0),(0===c&&0===b||e===S)&&xt===Z&&(xt=I),xt)}function u(t){if(!t||!t.state)return N;var e=t.state;return e.window&&(e.window=null),t.state=null,Z}function c(t,e){var a;return t&&t.state?(a=t.state,0===(2&a.wrap)?N:(a.head=e,e.done=!1,Z)):N}function b(t,e){var a,i,n,r=e.length;return t&&t.state?(a=t.state,0!==a.wrap&&a.mode!==G?N:a.mode===G&&(i=1,i=p(i,e,r,0),i!==a.check)?O:(n=f(t,e,r,r))?(a.mode=ut,D):(a.havedict=1,Z)):N}var g,m,w=t("../utils/common"),p=t("./adler32"),v=t("./crc32"),k=t("./inffast"),y=t("./inftrees"),x=0,z=1,B=2,S=4,E=5,A=6,Z=0,R=1,C=2,N=-2,O=-3,D=-4,I=-5,U=8,T=1,F=2,L=3,H=4,j=5,K=6,M=7,P=8,Y=9,q=10,G=11,X=12,W=13,J=14,Q=15,V=16,$=17,tt=18,et=19,at=20,it=21,nt=22,rt=23,st=24,ot=25,lt=26,ht=27,dt=28,ft=29,_t=30,ut=31,ct=32,bt=852,gt=592,mt=15,wt=mt,pt=!0;a.inflateReset=s,a.inflateReset2=o,a.inflateResetKeep=r,a.inflateInit=h,a.inflateInit2=l,a.inflate=_,a.inflateEnd=u,a.inflateGetHeader=c,a.inflateSetDictionary=b,a.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(t,e,a){"use strict";var i=t("../utils/common"),n=15,r=852,s=592,o=0,l=1,h=2,d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],_=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,a,c,b,g,m,w){var p,v,k,y,x,z,B,S,E,A=w.bits,Z=0,R=0,C=0,N=0,O=0,D=0,I=0,U=0,T=0,F=0,L=null,H=0,j=new i.Buf16(n+1),K=new i.Buf16(n+1),M=null,P=0;for(Z=0;Z<=n;Z++)j[Z]=0;for(R=0;R<c;R++)j[e[a+R]]++;for(O=A,N=n;N>=1&&0===j[N];N--);if(O>N&&(O=N),0===N)return b[g++]=20971520,b[g++]=20971520,w.bits=1,0;for(C=1;C<N&&0===j[C];C++);for(O<C&&(O=C),U=1,Z=1;Z<=n;Z++)if(U<<=1,U-=j[Z],U<0)return-1;if(U>0&&(t===o||1!==N))return-1;for(K[1]=0,Z=1;Z<n;Z++)K[Z+1]=K[Z]+j[Z];for(R=0;R<c;R++)0!==e[a+R]&&(m[K[e[a+R]]++]=R);if(t===o?(L=M=m,z=19):t===l?(L=d,H-=257,M=f,P-=257,z=256):(L=_,M=u,z=-1),F=0,R=0,Z=C,x=g,D=O,I=0,k=-1,T=1<<O,y=T-1,t===l&&T>r||t===h&&T>s)return 1;for(var Y=0;;){Y++,B=Z-I,m[R]<z?(S=0,E=m[R]):m[R]>z?(S=M[P+m[R]],E=L[H+m[R]]):(S=96,E=0),p=1<<Z-I,v=1<<D,C=v;do v-=p,b[x+(F>>I)+v]=B<<24|S<<16|E|0;while(0!==v);for(p=1<<Z-1;F&p;)p>>=1;if(0!==p?(F&=p-1,F+=p):F=0,R++,0===--j[Z]){if(Z===N)break;Z=e[a+m[R]]}if(Z>O&&(F&y)!==k){for(0===I&&(I=O),x+=C,D=Z-I,U=1<<D;D+I<N&&(U-=j[D+I],!(U<=0));)D++,U<<=1;if(T+=1<<D,t===l&&T>r||t===h&&T>s)return 1;k=F&y,b[k]=O<<24|D<<16|x-g|0}}return 0!==F&&(b[x+F]=Z-I<<24|64<<16|0),w.bits=O,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?lt[t]:lt[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>W-a?(t.bi_buf|=e<<t.bi_valid&65535,o(t,t.bi_buf),t.bi_buf=e>>W-t.bi_valid,t.bi_valid+=a-W):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)}function h(t,e,a){l(t,a[2*e],a[2*e+1])}function d(t,e){var a=0;do a|=1&t,t>>>=1,a<<=1;while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=X;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<G;a++)i=t.heap[a],r=l[2*l[2*i+1]+1]+1,r>c&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)n=t.heap[--a],n>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(X+1),s=0;for(i=1;i<=X;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(X+1);for(a=0,i=0;i<K-1;i++)for(dt[i]=a,t=0;t<1<<et[i];t++)ht[a++]=i;for(ht[a-1]=i,r=0,i=0;i<16;i++)for(ft[i]=r,t=0;t<1<<at[i];t++)lt[r++]=i;for(r>>=7;i<Y;i++)for(ft[i]=r<<7,t=0;t<1<<at[i]-7;t++)lt[256+r++]=i;for(e=0;e<=X;e++)s[e]=0;for(t=0;t<=143;)st[2*t+1]=8,t++,s[8]++;for(;t<=255;)st[2*t+1]=9,t++,s[9]++;for(;t<=279;)st[2*t+1]=7,t++,s[7]++;for(;t<=287;)st[2*t+1]=8,t++,s[8]++;for(u(st,P+1,s),t=0;t<Y;t++)ot[2*t+1]=5,ot[2*t]=d(t,5);_t=new n(st,et,M+1,P,X),ut=new n(ot,at,0,Y,X),ct=new n(new Array(0),it,0,q,J)}function b(t){var e;for(e=0;e<P;e++)t.dyn_ltree[2*e]=0;for(e=0;e<Y;e++)t.dyn_dtree[2*e]=0;for(e=0;e<q;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*Q]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function g(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),N.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]<t[r]||t[n]===t[r]&&i[e]<=i[a]}function p(t,e,a){for(var i=t.heap[a],n=a<<1;n<=t.heap_len&&(n<t.heap_len&&w(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!w(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i}function v(t,e,a){var i,n,r,o,d=0;if(0!==t.last_lit)do i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],n=t.pending_buf[t.l_buf+d],d++,0===i?h(t,n,e):(r=ht[n],h(t,r+M+1,e),o=et[r],0!==o&&(n-=dt[r],l(t,n,o)),i--,r=s(i),h(t,r,a),o=at[r],0!==o&&(i-=ft[r],l(t,i,o)));while(d<t.last_lit);h(t,Q,e)}function k(t,e){var a,i,n,r=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=G,a=0;a<l;a++)0!==r[2*a]?(t.heap[++t.heap_len]=h=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)n=t.heap[++t.heap_len]=h<2?++h:0,r[2*n]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=s[2*n+1]);for(e.max_code=h,a=t.heap_len>>1;a>=1;a--)p(t,r,a);n=l;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o<l&&n===s||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[2*V]++):o<=10?t.bl_tree[2*$]++:t.bl_tree[2*tt]++,o=0,r=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4))}function x(t,e,a){var i,n,r=-1,s=e[1],o=0,d=7,f=4;for(0===s&&(d=138,f=3),i=0;i<=a;i++)if(n=s,s=e[2*(i+1)+1],!(++o<d&&n===s)){if(o<f){do h(t,n,t.bl_tree);while(0!==--o)}else 0!==n?(n!==r&&(h(t,n,t.bl_tree),o--),h(t,V,t.bl_tree),l(t,o-3,2)):o<=10?(h(t,$,t.bl_tree),l(t,o-3,3)):(h(t,tt,t.bl_tree),l(t,o-11,7));o=0,r=n,0===s?(d=138,f=3):n===s?(d=6,f=3):(d=7,f=4)}}function z(t){var e;for(y(t,t.dyn_ltree,t.l_desc.max_code),y(t,t.dyn_dtree,t.d_desc.max_code),k(t,t.bl_desc),e=q-1;e>=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n<i;n++)l(t,t.bl_tree[2*nt[n]+1],3);x(t,t.dyn_ltree,e-1),x(t,t.dyn_dtree,a-1)}function S(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return D;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return I;for(e=32;e<M;e++)if(0!==t.dyn_ltree[2*e])return I;return D}function E(t){bt||(c(),bt=!0),t.l_desc=new r(t.dyn_ltree,_t),t.d_desc=new r(t.dyn_dtree,ut),t.bl_desc=new r(t.bl_tree,ct),t.bi_buf=0,t.bi_valid=0,b(t)}function A(t,e,a,i){l(t,(T<<1)+(i?1:0),3),m(t,e,a,!0)}function Z(t){l(t,F<<1,3),h(t,Q,st),f(t)}function R(t,e,a,i){var n,r,s=0;t.level>0?(t.strm.data_type===U&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=n&&(n=r)):n=r=a+5,a+4<=n&&e!==-1?A(t,e,a,i):t.strategy===O||r===n?(l(t,(F<<1)+(i?1:0),3),v(t,st,ot)):(l(t,(L<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)}function C(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(ht[a]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var N=t("../utils/common"),O=4,D=0,I=1,U=2,T=0,F=1,L=2,H=3,j=258,K=29,M=256,P=M+1+K,Y=30,q=19,G=2*P+1,X=15,W=16,J=7,Q=256,V=16,$=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],at=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,st=new Array(2*(P+2));i(st);var ot=new Array(2*Y);i(ot);var lt=new Array(rt);i(lt);var ht=new Array(j-H+1);i(ht);var dt=new Array(K);i(dt);var ft=new Array(Y);i(ft);var _t,ut,ct,bt=!1;a._tr_init=E,a._tr_stored_block=A,a._tr_flush_block=R,a._tr_tally=C,a._tr_align=Z},{"../utils/common":3}],15:[function(t,e,a){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=i},{}],"/":[function(t,e,a){"use strict";var i=t("./lib/utils/common").assign,n=t("./lib/deflate"),r=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};i(o,n,r,s),e.exports=o},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")}); var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a,b){var c="",d,e,f,g,k,l,m=0;for(null!=b&&b||(a=Base64._utf8_encode(a));m<a.length;)d=a.charCodeAt(m++),e=a.charCodeAt(m++),f=a.charCodeAt(m++),g=d>>2,d=(d&3)<<4|e>>4,k=(e&15)<<2|f>>6,l=f&63,isNaN(e)?k=l=64:isNaN(f)&&(l=64),c=c+this._keyStr.charAt(g)+this._keyStr.charAt(d)+this._keyStr.charAt(k)+this._keyStr.charAt(l);return c},decode:function(a,b){b=null!=b?b:!1;var c="",d,e,f,g,k,l=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g, "");l<a.length;)d=this._keyStr.indexOf(a.charAt(l++)),e=this._keyStr.indexOf(a.charAt(l++)),g=this._keyStr.indexOf(a.charAt(l++)),k=this._keyStr.indexOf(a.charAt(l++)),d=d<<2|e>>4,e=(e&15)<<4|g>>2,f=(g&3)<<6|k,c+=String.fromCharCode(d),64!=g&&(c+=String.fromCharCode(e)),64!=k&&(c+=String.fromCharCode(f));b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):(127<d&&2048>d?b+= -String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0,d;for(c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"open";window.PROXY_URL=window.PROXY_URL||"proxy";window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img"; -window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":"https://www.draw.io/iconSearch");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.mxLoadResources=window.mxLoadResources||!1; -window.mxLanguage=window.mxLanguage||function(){var a="1"==urlParams.offline?"en":urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null)}catch(c){isLocalStorage=!1}return a}(); +String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0,d;for(c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.VSD_CONVERT_URL=window.VSD_CONVERT_URL||"https://convert.draw.io/VsdConverter/api/converter";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"open";window.PROXY_URL=window.PROXY_URL||"proxy"; +window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img";window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":"https://www.draw.io/iconSearch");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia"; +window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||function(){var a="1"==urlParams.offline?"en":urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null)}catch(c){isLocalStorage=!1}return a}(); window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Bahasa Melayu",bs:"Bosanski",bg:"Bulgarian",ca:"Català ",cs:"ÄŒeÅ¡tina",da:"Dansk",de:"Deutsch",et:"Eesti",en:"English",es:"Español",fil:"Filipino",fr:"Français",it:"Italiano",hu:"Magyar",nl:"Nederlands",no:"Norsk",pl:"Polski","pt-br":"Português (Brasil)",pt:"Português (Portugal)",ro:"Română",fi:"Suomi",sv:"Svenska",vi:"Tiếng Việt",tr:"Türkçe",el:"Ελληνικά",ru:"РуÑÑкий",sr:"СрпÑки",uk:"УкраїнÑька",he:"עברית",ar:"العربية",th:"ไทย", ko:"í•œêµì–´",ja:"日本語",zh:"ä¸æ–‡ï¼ˆä¸å›½ï¼‰","zh-tw":"ä¸æ–‡ï¼ˆå°ç£ï¼‰"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph");if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang)}window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}return a}(); function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)} @@ -6533,7 +6533,7 @@ StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.sav StorageFile.prototype.saveFile=function(a,e,d,b){if(this.isEditable()){var g=mxUtils.bind(this,function(){this.isRenamable()&&(this.title=a);try{this.ui.setLocalData(this.title,this.getData(),mxUtils.bind(this,function(){this.setModified(!1);this.contentChanged();null!=d&&d()}))}catch(k){null!=b&&b(k)}});this.isRenamable()&&"."==a.charAt(0)&&null!=b?b({message:mxResources.get("invalidName")}):this.ui.getLocalData(a,mxUtils.bind(this,function(d){this.isRenamable()&&this.getTitle()!=a&&null!=d?this.ui.confirm(mxResources.get("replaceIt", [a]),g,b):g()}))}else null!=d&&d()};StorageFile.prototype.rename=function(a,e,d){var b=this.getTitle();b!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(g){var k=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(b,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(b,e)}),d)});null!=g?this.ui.confirm(mxResources.get("replaceIt",[a]),k,d):k()})):e()}; StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,e,d){StorageFile.call(this,a,e,d)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,e,d){this.saveFile(a,!1,e,d)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title}; -StorageLibrary.prototype.isRenamable=function(a,e,d){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,e,d){StorageFile.call(this,a,e,d);a=d;e=a.lastIndexOf("/");0<=e&&(a=a.substring(e+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,e,d){return!1};UrlLibrary.prototype.saveAs=function(a,e,d){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,e,d){function b(b,t,q,m,v,u){function g(){mxEvent.addListener(y,"click",null!=u?u:function(){q!=App.MODE_GOOGLE||a.isDriveDomain()?q==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(q,c.checked);e()})):(a.setMode(q,c.checked),e()):window.location.hostname=DriveClient.prototype.newAppHostname})}var y=document.createElement("a");y.style.overflow="hidden";y.style.display= +StorageLibrary.prototype.isRenamable=function(a,e,d){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,e,d){StorageFile.call(this,a,e,d);a=d;e=a.lastIndexOf("/");0<=e&&(a=a.substring(e+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,e,d){return!1};UrlLibrary.prototype.saveAs=function(a,e,d){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,e,d){function b(b,t,u,m,v,q){function g(){mxEvent.addListener(y,"click",null!=q?q:function(){u!=App.MODE_GOOGLE||a.isDriveDomain()?u==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(u,c.checked);e()})):(a.setMode(u,c.checked),e()):window.location.hostname=DriveClient.prototype.newAppHostname})}var y=document.createElement("a");y.style.overflow="hidden";y.style.display= mxClient.IS_QUIRKS?"inline":"inline-block";y.className="geBaseButton";y.style.boxSizing="border-box";y.style.fontSize="11px";y.style.position="relative";y.style.margin="4px";y.style.padding="8px 10px 12px 10px";y.style.width="88px";y.style.height="100px";y.style.whiteSpace="nowrap";y.setAttribute("title",t);mxClient.IS_QUIRKS&&(y.style.cssFloat="left",y.style.zoom="1");var z=document.createElement("div");z.style.textOverflow="ellipsis";z.style.overflow="hidden";if(null!=b){var w=document.createElement("img"); w.setAttribute("src",b);w.setAttribute("border","0");w.setAttribute("align","absmiddle");w.style.width="60px";w.style.height="60px";w.style.paddingBottom="6px";y.appendChild(w)}else z.style.paddingTop="5px",z.style.whiteSpace="normal",mxClient.IS_IOS?(y.style.padding="0px 10px 20px 10px",y.style.top="6px"):mxClient.IS_FF&&(z.style.paddingTop="0px",z.style.marginTop="-2px");y.appendChild(z);mxUtils.write(z,t);if(null!=v)for(b=0;b<v.length;b++)mxUtils.br(z),mxUtils.write(z,v[b]);if(null!=m&&null==a[m]){w.style.visibility= "hidden";mxUtils.setOpacity(z,10);var k=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});k.spin(y);var n=window.setTimeout(function(){null==a[m]&&(k.stop(),y.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[m]&&(window.clearTimeout(n),mxUtils.setOpacity(z,100),w.style.visibility="",k.stop(),g(),"drive"==m&&null!=h.parentNode&&h.parentNode.removeChild(h))}))}else g(); @@ -6620,9 +6620,9 @@ var l=document.createElement("select"),p=document.createElement("option");p.setA l.appendChild(f));var h=b();n.value=h;k.appendChild(n);this.init=function(){n.focus()};Graph.fileSupport&&(n.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),n.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var c=new FileReader;c.onload=function(a){n.value=a.target.result};c.readAsText(a)}},!1));k.appendChild(l);mxEvent.addListener(l,"change",function(){var a=b();if(0==n.value.length|| n.value==h)h=a,n.value=h});p=mxUtils.button(mxResources.get("close"),function(){n.value==h?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});p.className="geBtn";a.editor.cancelFirst&&k.appendChild(p);c=mxUtils.button(mxResources.get("insert"),function(){a.hideDialog();d(n.value,l.value)});k.appendChild(c);c.className="geBtn gePrimaryBtn";a.editor.cancelFirst||k.appendChild(p);this.container=k},NewDialog=function(a,e,d,b,g,k,n,l,p,c,f,h,q,t,u){function w(){for(var a= !0;C<R.length&&(a||0!=mxUtils.mod(C,30));)a=R[C++],m(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info,a.onClick),a=!1}function y(){if(M)a.hideDialog(),t(M,W,G.value);else if(b)d||a.hideDialog(),b(Y,G.value);else{var c=G.value;null!=c&&0<c.length&&a.pickFolder(a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_TRELLO||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?a.mode:null,function(b){a.createFile(c,Y,null!=S&&0<S.length?S:null,null,function(){a.hideDialog()}, -null,b)})}}function z(a,c,b,f,m){null!=N&&(N.style.backgroundColor="transparent",N.style.border="1px solid transparent");E.removeAttribute("disabled");Y=c;S=b;N=a;M=f;W=m;N.style.backgroundColor=l;N.style.border=p}function m(a,c,b,f,m,h,d,e){var t=document.createElement("div");t.className="geTemplate";t.style.height=Z+"px";t.style.width=J+"px";null!=f&&0<f.length&&t.setAttribute("title",f);if(null!=h)t.style.backgroundImage="url("+h+")",t.style.backgroundSize="contain",t.style.backgroundPosition= -"center center",t.style.backgroundRepeat="no-repeat",mxEvent.addListener(t,"click",function(c){z(t,null,null,a,d)}),mxEvent.addListener(t,"dblclick",function(a){y()});else if(null!=a&&0<a.length){a.substring(0,a.length-4);t.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,a.length-4)+".png)";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";var v=!1;mxEvent.addListener(t,"click",function(b){E.setAttribute("disabled","disabled");t.style.backgroundColor="transparent"; -t.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(z(t,a.getText(),c),v&&y())}))});mxEvent.addListener(t,"dblclick",function(a){v=!0})}else t.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+mxResources.get(b)+"</td></tr></table>",m&&z(t),null!=e?mxEvent.addListener(t,"click",e):(mxEvent.addListener(t,"click",function(a){z(t)}),mxEvent.addListener(t,"dblclick",function(a){y()})); +null,b)})}}function z(a,c,b,f,m){null!=N&&(N.style.backgroundColor="transparent",N.style.border="1px solid transparent");E.removeAttribute("disabled");Y=c;S=b;N=a;M=f;W=m;N.style.backgroundColor=l;N.style.border=p}function m(a,c,b,f,m,h,e,d){var t=document.createElement("div");t.className="geTemplate";t.style.height=Z+"px";t.style.width=J+"px";null!=f&&0<f.length&&t.setAttribute("title",f);if(null!=h)t.style.backgroundImage="url("+h+")",t.style.backgroundSize="contain",t.style.backgroundPosition= +"center center",t.style.backgroundRepeat="no-repeat",mxEvent.addListener(t,"click",function(c){z(t,null,null,a,e)}),mxEvent.addListener(t,"dblclick",function(a){y()});else if(null!=a&&0<a.length){a.substring(0,a.length-4);t.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,a.length-4)+".png)";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";var v=!1;mxEvent.addListener(t,"click",function(b){E.setAttribute("disabled","disabled");t.style.backgroundColor="transparent"; +t.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(z(t,a.getText(),c),v&&y())}))});mxEvent.addListener(t,"dblclick",function(a){v=!0})}else t.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+mxResources.get(b)+"</td></tr></table>",m&&z(t),null!=d?mxEvent.addListener(t,"click",d):(mxEvent.addListener(t,"click",function(a){z(t)}),mxEvent.addListener(t,"dblclick",function(a){y()})); I.appendChild(t)}function v(){mxEvent.addListener(I,"scroll",function(a){I.scrollTop+I.clientHeight>=I.scrollHeight&&(w(),mxEvent.consume(a))});var a=null,b;for(b in V){var f=document.createElement("div"),m=mxResources.get(b),h=V[b];null==m&&(m=b.substring(0,1).toUpperCase()+b.substring(1));18<m.length&&(m=m.substring(0,18)+"…");f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";f.setAttribute("title",m+" ("+ h.length+")");mxUtils.write(f,f.getAttribute("title"));null!=c&&(f.style.padding=c);Q.appendChild(f);null==a&&(a=f,a.style.backgroundColor=n);(function(c,b){mxEvent.addListener(f,"click",function(){a!=b&&(a.style.backgroundColor="",a=b,a.style.backgroundColor=n,I.scrollTop=0,I.innerHTML="",C=0,R=V[c],A=null,w())})})(b,f)}w()}d=null!=d?d:!0;g=null!=g?g:!1;n=null!=n?n:"#ebf2f9";l=null!=l?l:"#e6eff8";p=null!=p?p:"1px solid #ccd9ea";f=null!=f?f:TEMPLATE_PATH+"/index.xml";var F=document.createElement("div"); F.style.height="100%";var D=document.createElement("div");D.style.whiteSpace="nowrap";D.style.height="46px";d&&F.appendChild(D);var x=document.createElement("img");x.setAttribute("border","0");x.setAttribute("align","absmiddle");x.style.width="40px";x.style.height="40px";x.style.marginRight="10px";x.style.paddingBottom="4px";x.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg": @@ -6638,8 +6638,8 @@ title:a.getAttribute("title"),tooltip:a.getAttribute("url")})}}a=a.nextSibling}v window.location.href=c:window.openWindow(c))},mxResources.get("url"));a.showDialog(c.container,300,80,!0,!0);c.init()}),e.className="geBtn",f.appendChild(e));Graph.fileSupport&&u&&(u=mxUtils.button(mxResources.get("import"),function(){var c=document.createElement("input");c.setAttribute("multiple","multiple");c.setAttribute("type","file");mxEvent.addListener(c,"change",function(b){a.openFiles(c.files,!0)});c.click()}),u.className="geBtn",f.appendChild(u));f.appendChild(E);a.editor.cancelFirst||null!= b||g&&null==k||f.appendChild(D);F.appendChild(f);this.container=F},CreateDialog=function(a,e,d,b,g,k,n,l,p,c,f,h,q,t,u){function w(c,b,f,m){function t(){mxEvent.addListener(d,"click",function(){var c=f;if(n){var b=v.value,m=b.lastIndexOf(".");if(0>e.lastIndexOf(".")&&0>m){var c=null!=c?c:x.value,h="";c==App.MODE_GOOGLE?h=a.drive.extension:c==App.MODE_GITHUB?h=a.gitHub.extension:c==App.MODE_TRELLO?h=a.trello.extension:c==App.MODE_DROPBOX?h=a.dropbox.extension:c==App.MODE_ONEDRIVE?h=a.oneDrive.extension: c==App.MODE_DEVICE&&(h=".xml");0<=m&&(b=b.substring(0,m));v.value=b+h}}y(f)})}var d=document.createElement("a");d.style.overflow="hidden";var q=document.createElement("img");q.src=c;q.setAttribute("border","0");q.setAttribute("align","absmiddle");q.style.width="60px";q.style.height="60px";q.style.paddingBottom="6px";d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";d.className="geBaseButton";d.style.position="relative";d.style.margin="4px";d.style.padding="8px 8px 10px 8px";d.style.whiteSpace= -"nowrap";d.appendChild(q);mxClient.IS_QUIRKS&&(d.style.cssFloat="left",d.style.zoom="1");d.style.color="gray";d.style.fontSize="11px";var g=document.createElement("div");d.appendChild(g);mxUtils.write(g,b);if(null!=m&&null==a[m]){q.style.visibility="hidden";mxUtils.setOpacity(g,10);var u=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});u.spin(d);var z=window.setTimeout(function(){null==a[m]&&(u.stop(),d.style.display= -"none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[m]&&(window.clearTimeout(z),mxUtils.setOpacity(g,100),q.style.visibility="",u.stop(),t())}))}else t();F.appendChild(d);++D==h&&(mxUtils.br(F),D=0)}function y(c){var b=v.value;if(null==c||null!=b&&0<b.length)a.hideDialog(),d(b,c)}n=null!=n?n:!0;l=null!=l?l:!0;h=null!=h?h:4;var z=document.createElement("div");null==b&&a.addLanguageMenu(z);var m=document.createElement("h2");mxUtils.write(m,g||mxResources.get("create"));m.style.marginTop= +"nowrap";d.appendChild(q);mxClient.IS_QUIRKS&&(d.style.cssFloat="left",d.style.zoom="1");d.style.color="gray";d.style.fontSize="11px";var u=document.createElement("div");d.appendChild(u);mxUtils.write(u,b);if(null!=m&&null==a[m]){q.style.visibility="hidden";mxUtils.setOpacity(u,10);var g=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});g.spin(d);var z=window.setTimeout(function(){null==a[m]&&(g.stop(),d.style.display= +"none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[m]&&(window.clearTimeout(z),mxUtils.setOpacity(u,100),q.style.visibility="",g.stop(),t())}))}else t();F.appendChild(d);++D==h&&(mxUtils.br(F),D=0)}function y(c){var b=v.value;if(null==c||null!=b&&0<b.length)a.hideDialog(),d(b,c)}n=null!=n?n:!0;l=null!=l?l:!0;h=null!=h?h:4;var z=document.createElement("div");null==b&&a.addLanguageMenu(z);var m=document.createElement("h2");mxUtils.write(m,g||mxResources.get("create"));m.style.marginTop= "0px";m.style.marginBottom="24px";z.appendChild(m);mxUtils.write(z,mxResources.get("filename")+":");var v=document.createElement("input");v.setAttribute("value",e);v.style.width="280px";v.style.marginLeft="10px";v.style.marginBottom="20px";this.init=function(){v.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?v.select():document.execCommand("selectAll",!1,null)};z.appendChild(v);null!=q&&null!=t&&"image/"==t.substring(0,6)&&(v.style.width="160px",g=null,"image/svg+xml"== t&&mxClient.IS_SVG?(g=document.createElement("div"),g.innerHTML=mxUtils.trim(q),q=g.getElementsByTagName("svg")[0],t=parseInt(q.getAttribute("width")),u=parseInt(q.getAttribute("height")),q.setAttribute("viewBox","0 0 "+t+" "+u),q.setAttribute("width","120px"),q.setAttribute("height","80px")):(g=document.createElement("img"),g.setAttribute("src","data:"+t+(u?";base64,":";utf8,")+q)),g.style.position="absolute",g.style.top="70px",g.style.right="100px",g.style.maxWidth="120px",g.style.maxHeight="80px", mxUtils.setPrefixedStyle(g.style,"transform","translate(50%,-50%)"),z.appendChild(g),p&&(g.style.cursor="pointer",mxEvent.addListener(g,"click",function(){y("_blank")})));mxUtils.br(z);var F=document.createElement("div");F.style.textAlign="center";var D=0;F.style.marginTop="6px";z.appendChild(F);var x=document.createElement("select");x.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(g=document.createElement("option"),g.setAttribute("value",App.MODE_GOOGLE), @@ -6855,7 +6855,7 @@ var P=document.createElement("input");P.style.cssText="margin:0 8px 0 8px;";P.se w.className="geBtn",e.appendChild(w));PrintDialog.previewEnabled&&(w=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();f(!1)}),w.className="geBtn",e.appendChild(w));w=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});w.className="geBtn gePrimaryBtn";e.appendChild(w);a.editor.cancelFirst||e.appendChild(q);d.appendChild(e);this.container=d};var w=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null== this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(w.apply(this,arguments),null!=this.mathEnabled&& this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})(); -(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,b){b.ui=a.ui;return d};a.afterDecode=function(a,d,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.5.2";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>'; +(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,b){b.ui=a.ui;return d};a.afterDecode=function(a,d,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.5.3";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>'; EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;"; EditorUi.prototype.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport= !1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(t){}try{var b=document.createElement("canvas"),h=new Image;h.onload=function(){try{b.getContext("2d").drawImage(h,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&& @@ -6910,80 +6910,81 @@ l.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.g "hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":g.style.border="3px dotted rgb(254, 137, 12)",g.style.cursor="copy",l.panningManager.stop(),l.autoScroll=!1,null!=l.graphHandler.guide&&l.graphHandler.guide.setVisible(!1),null!=l.graphHandler.hint&&(l.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){l.isMouseDown&&null!=l.panningManager&&null!=l.graphHandler&&(g.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"), g.style.cursor="default",this.sidebar.showTooltips=!0,l.panningManager.stop(),l.graphHandler.reset(),l.isMouseDown=!1,l.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(g,"mouseleave",mxUtils.bind(this,function(a){l.isMouseDown&&null!=l.graphHandler.shape&&(l.graphHandler.shape.node.style.visibility="visible",g.style.border="3px solid transparent",g.style.cursor="",l.autoScroll=!0,null!=l.graphHandler.guide&&l.graphHandler.guide.setVisible(!0),null!=l.graphHandler.hint&&(l.graphHandler.hint.style.visibility= "visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(g,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":g.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";g.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"drop",mxUtils.bind(this,function(a){g.style.border="3px solid transparent";g.style.cursor="";null!=f&&(f.style.border= -"3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,h,d,m,q,t,k,v,n){if(null!=c&&"image/"==h.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,q,t),c)],c[0].vertex=!0,E(c,new mxRectangle(0,0,q,t),a,mxEvent.isAltDown(a)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&& -0<b.length&&(f.parentNode.removeChild(f),f=null);else{var u=!1,l=mxUtils.bind(this,function(c,h){if(null!=c&&"text/xml"==h){var d=mxUtils.parseXml(c);if("mxlibrary"==d.documentElement.nodeName)try{var m=JSON.parse(mxUtils.getTextContent(d.documentElement));e(m,g);b=b.concat(m);C(a);this.spinner.stop();u=!0}catch(P){}else if("mxfile"==d.documentElement.nodeName)try{for(var q=d.documentElement.getElementsByTagName("diagram"),d=0;d<q.length;d++){var m=mxUtils.getTextContent(q[d]),k=this.stringToCells(this.editor.graph.decompress(m)), -t=this.editor.graph.getBoundingBoxFromGeometry(k);E(k,new mxRectangle(0,0,t.width,t.height),a)}u=!0}catch(P){null!=window.console&&console.log("error in drop handler:",P)}}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=n&&null!=k&&(/(\.vsdx)($|\?)/i.test(k)||/(\.vssx)($|\?)/i.test(k))?this.importVisio(n,function(a){l(a,"text/xml")}):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(c,k)&&null!=n?this.parseFile(n,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?l(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):l(c,h)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(g.style.border="3px solid transparent", -g.style.cursor="");a.stopPropagation();a.preventDefault()}));v=v.cloneNode(!1);v.setAttribute("src",IMAGE_PATH+"/edit.gif");v.setAttribute("title",mxResources.get("edit"));m.insertBefore(v,m.firstChild);mxEvent.addListener(v,"click",G);mxEvent.addListener(g,"dblclick",function(a){mxEvent.getSource(a)==g&&G(a)});h=v.cloneNode(!1);h.setAttribute("src",Editor.plusImage);h.setAttribute("title",mxResources.get("add"));m.insertBefore(h,m.firstChild);mxEvent.addListener(h,"click",H);this.isOffline()||".scratchpad"!= -a.title||null==EditorUi.scratchpadHelpLink||(h=document.createElement("span"),h.setAttribute("title",mxResources.get("help")),h.style.cssText="color:gray;text-decoration:none;",h.className="geButton",mxUtils.write(h,"?"),mxEvent.addGestureListeners(h,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),m.insertBefore(h,m.firstChild))}k.appendChild(m);k.style.paddingRight=18*m.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight= -4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position= -"relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"), -Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a", -Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor= -"#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))}; -EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display="none",this.refresh())};EditorUi.prototype.showFooter=function(a){var b=document.getElementById("geFooter");null!=b&&(this.footerHeight=a,b.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,h,e,d){a=new ImageDialog(this,a,b,h,e,d);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0, -!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,h,e,d){a=new LibraryDialog(this,a,b,h,e,d);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null== -this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer");a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this, -function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,h){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),d=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),d=function(){c();f.retry()}),"undefined"!= -typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var g=window.location.hash;null!=g&&"#G"==g.substring(0,2)&&(g=g.substring(2), -a+=' <a href="https://drive.google.com/open?id='+g+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a=mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,h,d)}else null!=h&&h()};EditorUi.prototype.showError= -function(a,b,h,e,d,g,k){a=new ErrorDialog(this,a,b,h,e,d,g,k);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,h,e,d){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){c();null!=b&&b()},function(){c();null!=h&&h()},e,d)).container, -340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,h){var c=a.toDataURL("image/"+h);if(6>=c.length|| -c==a.cloneNode(!1).toDataURL("image/"+h))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return c};EditorUi.prototype.saveCanvas=function(a,b,h){var c="jpeg"==h?"jpg":h,f=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,h);this.saveData(f,c,a.substring(a.lastIndexOf(",")+1),"image/"+h,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&& -"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.doSaveLocalFile=function(a,b,h,e,d){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,h):new Blob([a],{type:h}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)h=window.open("about:blank","_blank"),null==h?mxUtils.popup(a,!0):(h.document.write(a),h.document.close(),h.document.execCommand("SaveAs", -!0,b),h.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height="380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var c=document.createElement("a"),f=!mxClient.IS_SF&&"undefined"!==typeof c.download;if(f||this.isOffline()){c.href=URL.createObjectURL(e?this.base64ToBlob(a,h):new Blob([a],{type:h}));f?c.download=b:c.setAttribute("target","_blank"); -document.body.appendChild(c);try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(y){}}else this.createEchoRequest(a,b,h,e,d).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,h,e,d,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=h?"&mime="+h:"")+(null!=d?"&format="+d:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob= -function(a,b){b=b||"";for(var c=atob(a),f=c.length,e=Math.ceil(f/1024),d=Array(e),g=0;g<e;++g){for(var k=1024*g,n=Math.min(k+1024,f),m=Array(n-k),v=0;k<n;++v,++k)m[v]=c[k].charCodeAt(0);d[g]=new Uint8Array(m)}return new Blob(d,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,h,e,d,g,k){g=null!=g?g:!1;k=null!=k?k:"vsdx"!=d&&(!mxClient.IS_IOS||!navigator.standalone);d=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,c){try{if("_blank"==c)if(null==h||"image/"!=h.substring(0, -6)||"image/svg"==h.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,h,e);else c==App.MODE_DEVICE?this.doSaveLocalFile(a,b,h,e):null!=b&&0<b.length&&this.pickFolder(c,mxUtils.bind(this,function(f){try{this.exportFile(a,b,h,e,c,f)}catch(F){this.handleError(F)}}))}catch(v){this.handleError(v)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"), -mxResources.get("download"),!1,g,k,null,null,4<d?3:4,a,h,e);this.showDialog(b.container,420,d==(mxClient.IS_IOS?0:1)?160:4<d?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,h){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(h?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+ -'"/></html>'),c.document.close())}else c=window.open("data:"+b+(h?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==c&&mxUtils.popup(a,!0)};var e=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var b=a(mxUtils.bind(this,function(a){var c=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",c);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog), -this.exportDialog=null)});if(null!=this.exportDialog)c.apply(this);else{this.exportDialog=document.createElement("div");var f=b.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding= -"4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=f.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";f=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=f.zIndex;var h=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});h.spin(this.exportDialog); -this.exportToCanvas(mxUtils.bind(this,function(a){h.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var b=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",b);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this, -function(){this.openInNewWindow(b.substring(b.indexOf(",")+1),"image/png",!0);c.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",c);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}e.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,h,e,d){this.isLocalFileSave()?this.saveLocalFile(h, -a,e,d,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(h,a,e,d,b,c)}),h,d,e)};EditorUi.prototype.saveRequest=function(a,b,h,e,d,g,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=h("_blank"==c?null:a,c==App.MODE_DEVICE||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c, -mxUtils.bind(this,function(h){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,g,!0,c,h)}catch(D){this.handleError(D)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,g,!0,c,h)}catch(D){this.handleError(D)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}), -mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,k,null,null,4<c?3:4,e,g,d);this.showDialog(a.container,380,c==(mxClient.IS_IOS?0:1)?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,h,e,d,g){};EditorUi.prototype.pickFolder=function(a,b,h){b(null)};EditorUi.prototype.exportSvg=function(a,b,h,e,d,g,k,n,l){if(this.spinner.spin(document.body, -mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();h=null!=h?h:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,k,n,null,h);e&&this.editor.graph.addSvgShadow(f);var q=this.getBaseFilename()+".svg",t=mxUtils.bind(this,function(a){this.spinner.stop();d&&a.setAttribute("content",this.getFileData(!0,null,null,null,h,l));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS? -b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var c='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||c.length<=MAX_REQUEST_SIZE?this.saveData(q,"svg",c,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"), -mxUtils.bind(this,function(){mxUtils.popup(c)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,t,this.thumbImageCache)):t(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,h,e,d,g){g=null!=g?g:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");h&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled", -"disabled");g&&(a.appendChild(c),mxUtils.write(a,b),d||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var f=this.getCurrentFile(),e="";null!=f&&f.getMode()!=App.MODE_DEVICE&&f.getMode()!=App.MODE_BROWSER&&(e=window.location.href);var d=document.createElement("select");d.style.width="120px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";f=document.createElement("option"); -f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("makeCopy"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","custom");mxUtils.write(f,mxResources.get("custom")+"...");d.appendChild(f);a.appendChild(d);mxEvent.addListener(d,"change",mxUtils.bind(this,function(){if("custom"==d.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:d.value="blank"},mxResources.get("url"),null,null,null,null,function(){d.value="blank"});this.showDialog(a.container, -300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?d.removeAttribute("disabled"):d.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===d.value?"_blank":e:null},getEditInput:function(){return c},getEditSelect:function(){return d}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){g.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE? -"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var f=document.createElement("select");f.style.width="100px";f.style.marginLeft="8px";f.style.marginRight="10px";f.className="geBtn";var d=document.createElement("option");d.setAttribute("value","auto");mxUtils.write(d,mxResources.get("automatic"));f.appendChild(d);d=document.createElement("option"); -d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("openInNewWindow"));f.appendChild(d);d=document.createElement("option");d.setAttribute("value","self");mxUtils.write(d,mxResources.get("openInThisWindow"));f.appendChild(d);b&&(d=document.createElement("option"),d.setAttribute("value","frame"),mxUtils.write(d,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),f.appendChild(d));a.appendChild(f);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",g= -null,g=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();g.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";g.style.marginLeft="4px";g.style.height="22px";g.style.width="22px";g.style.position="relative";g.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";g.className="geColorBtn";a.appendChild(g);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return f.value},focus:function(){f.focus()}}}; -EditorUi.prototype.createLink=function(a,b,h,d,e,g,k,n){var c=this.getCurrentFile(),f=[];d&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&f.push("edit="+encodeURIComponent(e)),g&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(h&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a); -break}a=!0;null!=k?h="#U"+encodeURIComponent(k):(c=this.getCurrentFile(),n||null==c||c.constructor!=window.DriveFile?h="#R"+encodeURIComponent(h?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(h="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)? -"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+h};EditorUi.prototype.createHtml=function(a,b,h,d,e,g,k,n,l,m,v){this.getBasenames();var c={};""!=e&&e!=mxConstants.NONE&&(c.highlight=e);"auto"!==d&&(c.target=d);l||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;h=parseInt(h);isNaN(h)||100==h||(c.zoom=h/100);h=[];k&&(h.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(h.push("zoom"), -c.resize=!0);n&&h.push("layers");0<h.length&&(l&&h.push("lightbox"),c.toolbar=h.join(" "));null!=m&&0<m.length&&(c.edit=m);null!=a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=h?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";v(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1": -"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;"; -var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");f=g.cloneNode(!0);f.setAttribute("value","copy");h.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));h.appendChild(k);mxUtils.br(h);h.appendChild(g);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl")); -h.appendChild(k);var m=this.getCurrentFile();null==d&&null!=m&&m.constructor==window.DriveFile&&(k=document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),h.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(m.getId())})));f.setAttribute("checked","checked");null==d&&g.setAttribute("disabled","disabled");c.appendChild(h);var n= -this.addLinkSection(c),q=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");var l=document.createElement("input");l.setAttribute("type","text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.style.marginRight="12px";l.value="100%";c.appendChild(l);var p=this.addCheckbox(c,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,G=G=this.addCheckbox(c,mxResources.get("allPages"),h,!h),C=this.addCheckbox(c,mxResources.get("layers"),!0), -E=this.addCheckbox(c,mxResources.get("lightbox"),!0),H=this.addEditButton(c,E),A=H.getEditInput();A.style.marginBottom="16px";mxEvent.addListener(E,"change",function(){E.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled");A.checked&&E.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(g.checked?d:null,q.checked,l.value,n.getTarget(),n.getColor(),p.checked,G.checked, -C.checked,E.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,h,d,e,g){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var k=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!= -k&&k.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",m=document.createElement("div");m.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));m.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(k.getId())})); -n.style.marginTop="12px";n.className="geBtn";m.appendChild(n);c.appendChild(m);n=document.createElement("a");n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));m.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this, -null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var q=null,t=null;if(null!=h||null!=d)a+=30,mxUtils.write(c,mxResources.get("width")+":"),q=document.createElement("input"),q.setAttribute("type","text"),q.style.marginRight="16px",q.style.width="50px",q.style.marginLeft="6px",q.style.marginRight="16px",q.style.marginBottom="10px",q.value="100%",c.appendChild(q),mxUtils.write(c,mxResources.get("height")+ -":"),t=document.createElement("input"),t.setAttribute("type","text"),t.style.width="50px",t.style.marginLeft="6px",t.style.marginBottom="10px",t.value=d+"px",c.appendChild(t),mxUtils.br(c);var l=this.addLinkSection(c,g);h=null!=this.pages&&1<this.pages.length;var u=null;if(null==k||k.constructor!=window.DriveFile||b)u=this.addCheckbox(c,mxResources.get("allPages"),h,!h);var p=this.addCheckbox(c,mxResources.get("lightbox"),!0),E=this.addEditButton(c,p),H=E.getEditInput(),A=this.addCheckbox(c,mxResources.get("layers"), -!0);A.style.marginLeft=H.style.marginLeft;A.style.marginBottom="16px";A.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(A.removeAttribute("disabled"),H.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&p.checked?E.getEditSelect().removeAttribute("disabled"):E.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){e(l.getTarget(),l.getColor(),null==u? -!0:u.checked,p.checked,E.getLink(),A.checked,null!=q?q.value:null,null!=t?t.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=q?(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)):l.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f, -mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(f);var h=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0);null!=g&&(g.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!h.checked,null!=g?g.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog= -function(a,b,d,e,g,k,n,l){n=null!=n?n:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph,h="jpeg"==l?196:300,q=document.createElement("h3");mxUtils.write(q,a);q.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(q);mxUtils.write(c,mxResources.get("zoom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight= -"12px";t.value=this.lastExportZoom||"100%";c.appendChild(t);mxUtils.write(c,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";c.appendChild(u);mxUtils.br(c);var p=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=l),y=this.addCheckbox(c,mxResources.get("selectionOnly"), -!1,f.isSelectionEmpty()),w=document.createElement("input");w.style.marginTop="16px";w.style.marginRight="8px";w.style.marginLeft="24px";w.setAttribute("disabled","disabled");w.setAttribute("type","checkbox");k&&(c.appendChild(w),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),h+=26,mxEvent.addListener(y,"change",function(){y.checked?w.removeAttribute("disabled"):w.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(w.setAttribute("checked","checked"),w.defaultChecked=!0);var H=this.addCheckbox(c, -mxResources.get("shadow"),f.shadowVisible),A=document.createElement("input");A.style.marginTop="16px";A.style.marginRight="8px";A.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||A.setAttribute("disabled","disabled");b&&(c.appendChild(A),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),h+=26);var K=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),n,null,null,"jpeg"!=l),B=null!=this.pages&&1<this.pages.length,L=this.addCheckbox(c,B?mxResources.get("allPages"): -"",B,!B,null,"jpeg"!=l);L.style.marginLeft="24px";L.style.marginBottom="16px";B||(L.style.visibility="hidden");mxEvent.addListener(K,"change",function(){K.checked&&B?L.removeAttribute("disabled"):L.setAttribute("disabled","disabled")});n&&B||L.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=t.value;g(t.value,p.checked,!y.checked,H.checked,K.checked,A.checked,u.value,w.checked,!L.checked)}),null,d,e);this.showDialog(a.container, -340,h,!0,!0);t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,g){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(h)}var k=this.addCheckbox(c,mxResources.get("fit"), -!0),m=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,!e),n=this.addCheckbox(c,d),q=this.addCheckbox(c,mxResources.get("lightbox"),!0),t=this.addEditButton(c,q),l=t.getEditInput(),p=1<f.model.getChildCount(f.model.getRoot()),C=this.addCheckbox(c,mxResources.get("layers"),p,!p);C.style.marginLeft=l.style.marginLeft;C.style.marginBottom="12px";C.style.marginTop="8px";mxEvent.addListener(q,"change",function(){q.checked?(p&&C.removeAttribute("disabled"),l.removeAttribute("disabled")): -(C.setAttribute("disabled","disabled"),l.setAttribute("disabled","disabled"));l.checked&&q.checked?t.getEditSelect().removeAttribute("disabled"):t.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(k.checked,m.checked,n.checked,q.checked,t.getLink(),C.checked)}),null,mxResources.get("embed"),g);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,g,k,n,l){function c(b){var c=" ",h="";e&&(c=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ -(g?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",h+="cursor:pointer;");a&&(h+="max-width:100%;");var m="";d&&(m=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');n('<img src="'+b+'"'+m+(""!=h?' style="'+h+'"':"")+c+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){l({message:mxResources.get("unknownError")})}), -null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var h="";d&&(h="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var q=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+h+"&xml="+encodeURIComponent(b));q.send(mxUtils.bind(this,function(){200<=q.getStatus()&&299>=q.getStatus()?c("data:image/png;base64,"+q.getText()):l({message:mxResources.get("unknownError")})}))}else l({message:mxResources.get("drawingTooLarge")})}; -EditorUi.prototype.createEmbedSvg=function(a,b,d,e,g,k,n){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var h=0;h<f.length;h++){var q=f[h].getAttribute("href");null!=q&&"#"==q.charAt(0)&&"_blank"==f[h].getAttribute("target")&&f[h].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var l=" ",t="";e&&(l="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ -(g?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",t+="cursor:pointer;");a&&(t+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){n('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=t?' style="'+t+'"':"")+l+"/>")}))}else t="",e&&(c.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ +"3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,h,d,m,q,t,k,v,u){if(null!=c&&"image/"==h.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,q,t),c)],c[0].vertex=!0,E(c,new mxRectangle(0,0,q,t),a,mxEvent.isAltDown(a)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&& +0<b.length&&(f.parentNode.removeChild(f),f=null);else{var n=!1,l=mxUtils.bind(this,function(c,h){if(null!=c&&"text/xml"==h){var d=mxUtils.parseXml(c);if("mxlibrary"==d.documentElement.nodeName)try{var m=JSON.parse(mxUtils.getTextContent(d.documentElement));e(m,g);b=b.concat(m);C(a);this.spinner.stop();n=!0}catch(P){}else if("mxfile"==d.documentElement.nodeName)try{for(var q=d.documentElement.getElementsByTagName("diagram"),d=0;d<q.length;d++){var m=mxUtils.getTextContent(q[d]),k=this.stringToCells(this.editor.graph.decompress(m)), +t=this.editor.graph.getBoundingBoxFromGeometry(k);E(k,new mxRectangle(0,0,t.width,t.height),a)}n=!0}catch(P){null!=window.console&&console.log("error in drop handler:",P)}}n||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=u&&null!=k&&(/(\.vsdx)($|\?)/i.test(k)||/(\.vssx)($|\?)/i.test(k)||/(\.vsd)($|\?)/i.test(k))?this.importVisio(u,function(a){l(a,"text/xml")},null,k):!this.isOffline()&& +(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,k)&&null!=u?this.parseFile(u,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?l(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):l(c,h)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(g.style.border= +"3px solid transparent",g.style.cursor="");a.stopPropagation();a.preventDefault()}));v=v.cloneNode(!1);v.setAttribute("src",IMAGE_PATH+"/edit.gif");v.setAttribute("title",mxResources.get("edit"));m.insertBefore(v,m.firstChild);mxEvent.addListener(v,"click",G);mxEvent.addListener(g,"dblclick",function(a){mxEvent.getSource(a)==g&&G(a)});h=v.cloneNode(!1);h.setAttribute("src",Editor.plusImage);h.setAttribute("title",mxResources.get("add"));m.insertBefore(h,m.firstChild);mxEvent.addListener(h,"click", +H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(h=document.createElement("span"),h.setAttribute("title",mxResources.get("help")),h.style.cssText="color:gray;text-decoration:none;",h.className="geButton",mxUtils.write(h,"?"),mxEvent.addGestureListeners(h,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),m.insertBefore(h,m.firstChild))}k.appendChild(m);k.style.paddingRight=18*m.childNodes.length+"px"}};"1"==urlParams.offline|| +EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide")); +a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)", +Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme", +Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor= +"#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=", +Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display= +"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var b=document.getElementById("geFooter");null!=b&&(this.footerHeight=a,b.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,h,e,d){a=new ImageDialog(this,a,b,h,e,d);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor= +!0;this.editor.graph.model.execute(a)});var b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,h,e,d){a=new LibraryDialog(this,a,b,h,e,d);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer"); +a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,h){var c=null!=this.spinner&&null!= +this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),d=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),d=function(){c();f.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden")); +else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var g=window.location.hash;null!=g&&"#G"==g.substring(0,2)&&(g=g.substring(2),a+=' <a href="https://drive.google.com/open?id='+g+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a= +mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,h,d)}else null!=h&&h()};EditorUi.prototype.showError=function(a,b,h,e,d,g,k){a=new ErrorDialog(this,a,b,h,e,d,g,k);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this, +null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,h,e,d){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){c();null!=b&&b()},function(){c();null!=h&&h()},e,d)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas= +function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,h){var c=a.toDataURL("image/"+h);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+h))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return c}; +EditorUi.prototype.saveCanvas=function(a,b,h){var c="jpeg"==h?"jpg":h,f=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,h);this.saveData(f,c,a.substring(a.lastIndexOf(",")+1),"image/"+h,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS}; +EditorUi.prototype.doSaveLocalFile=function(a,b,h,e,d){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,h):new Blob([a],{type:h}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)h=window.open("about:blank","_blank"),null==h?mxUtils.popup(a,!0):(h.document.write(a),h.document.close(),h.document.execCommand("SaveAs",!0,b),h.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height= +"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var c=document.createElement("a"),f=!mxClient.IS_SF&&"undefined"!==typeof c.download;if(f||this.isOffline()){c.href=URL.createObjectURL(e?this.base64ToBlob(a,h):new Blob([a],{type:h}));f&&(c.download=b);c.setAttribute("target","_blank");document.body.appendChild(c);try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(y){}}else this.createEchoRequest(a, +b,h,e,d).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,h,e,d,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=h?"&mime="+h:"")+(null!=d?"&format="+d:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),f=c.length,e=Math.ceil(f/1024),d=Array(e),g=0;g<e;++g){for(var k=1024*g,n=Math.min(k+1024,f),m=Array(n-k),v=0;k<n;++v,++k)m[v]= +c[k].charCodeAt(0);d[g]=new Uint8Array(m)}return new Blob(d,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,h,e,d,g,k){g=null!=g?g:!1;k=null!=k?k:"vsdx"!=d&&(!mxClient.IS_IOS||!navigator.standalone);d=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,c){try{if("_blank"==c)if(null==h||"image/"!=h.substring(0,6)||"image/svg"==h.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a, +!1)),f.document.close())}else this.openInNewWindow(a,h,e);else c==App.MODE_DEVICE?this.doSaveLocalFile(a,b,h,e):null!=b&&0<b.length&&this.pickFolder(c,mxUtils.bind(this,function(f){try{this.exportFile(a,b,h,e,c,f)}catch(F){this.handleError(F)}}))}catch(v){this.handleError(v)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,k,null,null,4<d?3:4,a,h,e);this.showDialog(b.container,420,d==(mxClient.IS_IOS?0:1)?160:4<d?390:270,!0,!0);b.init()}; +EditorUi.prototype.openInNewWindow=function(a,b,h){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(h?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),c.document.close())}else c=window.open("data:"+b+(h?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==c&&mxUtils.popup(a, +!0)};var e=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var b=a(mxUtils.bind(this,function(a){var c=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",c);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)c.apply(this);else{this.exportDialog=document.createElement("div"); +var f=b.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left= +f.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";f=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=f.zIndex;var h=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});h.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){h.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height= +"auto";this.exportDialog.style.padding="10px";var b=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",b);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(b.substring(b.indexOf(",")+1),"image/png",!0);c.apply(this,arguments)}))}),null, +this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",c);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}e.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,h,e,d){this.isLocalFileSave()?this.saveLocalFile(h,a,e,d,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(h,a,e,d,b,c)}),h, +d,e)};EditorUi.prototype.saveRequest=function(a,b,h,e,d,g,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=h("_blank"==c?null:a,c==App.MODE_DEVICE||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(h){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e, +a,g,!0,c,h)}catch(D){this.handleError(D)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,g,!0,c,h)}catch(D){this.handleError(D)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"), +!1,!1,k,null,null,4<c?3:4,e,g,d);this.showDialog(a.container,380,c==(mxClient.IS_IOS?0:1)?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,h,e,d,g){};EditorUi.prototype.pickFolder=function(a,b,h){b(null)};EditorUi.prototype.exportSvg=function(a,b,h,e,d,g,k,n,l){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();h=null!=h?h:c;c=b?null:this.editor.graph.background; +c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,k,n,null,h);e&&this.editor.graph.addSvgShadow(f);var q=this.getBaseFilename()+".svg",t=mxUtils.bind(this,function(a){this.spinner.stop();d&&a.setAttribute("content",this.getFileData(!0,null,null,null,h,l));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b, +this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var c='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||c.length<=MAX_REQUEST_SIZE?this.saveData(q,"svg",c,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){g?(null== +this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,t,this.thumbImageCache)):t(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,h,e,d,g){g=null!=g?g:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");h&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled","disabled");g&&(a.appendChild(c),mxUtils.write(a,b),d||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a, +b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var f=this.getCurrentFile(),e="";null!=f&&f.getMode()!=App.MODE_DEVICE&&f.getMode()!=App.MODE_BROWSER&&(e=window.location.href);var d=document.createElement("select");d.style.width="120px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("makeCopy"));d.appendChild(f);f=document.createElement("option"); +f.setAttribute("value","custom");mxUtils.write(f,mxResources.get("custom")+"...");d.appendChild(f);a.appendChild(d);mxEvent.addListener(d,"change",mxUtils.bind(this,function(){if("custom"==d.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:d.value="blank"},mxResources.get("url"),null,null,null,null,function(){d.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b|| +b.checked)?d.removeAttribute("disabled"):d.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===d.value?"_blank":e:null},getEditInput:function(){return c},getEditSelect:function(){return d}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){g.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+ +Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var f=document.createElement("select");f.style.width="100px";f.style.marginLeft="8px";f.style.marginRight="10px";f.className="geBtn";var d=document.createElement("option");d.setAttribute("value","auto");mxUtils.write(d,mxResources.get("automatic"));f.appendChild(d);d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("openInNewWindow"));f.appendChild(d);d=document.createElement("option"); +d.setAttribute("value","self");mxUtils.write(d,mxResources.get("openInThisWindow"));f.appendChild(d);b&&(d=document.createElement("option"),d.setAttribute("value","frame"),mxUtils.write(d,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),f.appendChild(d));a.appendChild(f);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",g=null,g=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();g.style.padding= +mxClient.IS_FF?"4px 2px 4px 2px":"4px";g.style.marginLeft="4px";g.style.height="22px";g.style.width="22px";g.style.position="relative";g.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";g.className="geColorBtn";a.appendChild(g);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return f.value},focus:function(){f.focus()}}};EditorUi.prototype.createLink=function(a,b,h,d,e,g,k,n){var c=this.getCurrentFile(),f=[];d&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+ +a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&f.push("edit="+encodeURIComponent(e)),g&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(h&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=k?h="#U"+encodeURIComponent(k):(c=this.getCurrentFile(),n||null==c||c.constructor!=window.DriveFile?h="#R"+encodeURIComponent(h? +this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(h="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+h};EditorUi.prototype.createHtml=function(a, +b,h,d,e,g,k,n,l,m,v){this.getBasenames();var c={};""!=e&&e!=mxConstants.NONE&&(c.highlight=e);"auto"!==d&&(c.target=d);l||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;h=parseInt(h);isNaN(h)||100==h||(c.zoom=h/100);h=[];k&&(h.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(h.push("zoom"),c.resize=!0);n&&h.push("layers");0<h.length&&(l&&h.push("lightbox"),c.toolbar=h.join(" "));null!=m&&0<m.length&&(c.edit=m);null!= +a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=h?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";v(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+ +'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,h,d){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var e=document.createElement("div");e.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;"; +g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");f=g.cloneNode(!0);f.setAttribute("value","copy");e.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));e.appendChild(k);mxUtils.br(e);e.appendChild(g);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));e.appendChild(k);var m=this.getCurrentFile();null==h&&null!=m&&m.constructor==window.DriveFile&&(k= +document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),e.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(m.getId())})));f.setAttribute("checked","checked");null==h&&g.setAttribute("disabled","disabled");c.appendChild(e);var n=this.addLinkSection(c),q=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c, +":");var l=document.createElement("input");l.setAttribute("type","text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.style.marginRight="12px";l.value="100%";c.appendChild(l);var p=this.addCheckbox(c,mxResources.get("fit"),!0),e=null!=this.pages&&1<this.pages.length,G=G=this.addCheckbox(c,mxResources.get("allPages"),e,!e),C=this.addCheckbox(c,mxResources.get("layers"),!0),E=this.addCheckbox(c,mxResources.get("lightbox"),!0),H=this.addEditButton(c,E),A=H.getEditInput(); +A.style.marginBottom="16px";mxEvent.addListener(E,"change",function(){E.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled");A.checked&&E.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(g.checked?h:null,q.checked,l.value,n.getTarget(),n.getColor(),p.checked,G.checked,C.checked,E.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()}; +EditorUi.prototype.showPublishLinkDialog=function(a,b,e,d,g,k){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=h&&h.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384", +m=document.createElement("div");m.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));m.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(h.getId())}));n.style.marginTop="12px";n.className="geBtn";m.appendChild(n);c.appendChild(m);n=document.createElement("a"); +n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));m.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok")); +this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var q=null,t=null;if(null!=e||null!=d)a+=30,mxUtils.write(c,mxResources.get("width")+":"),q=document.createElement("input"),q.setAttribute("type","text"),q.style.marginRight="16px",q.style.width="50px",q.style.marginLeft="6px",q.style.marginRight="16px",q.style.marginBottom="10px",q.value="100%",c.appendChild(q),mxUtils.write(c,mxResources.get("height")+":"),t=document.createElement("input"),t.setAttribute("type","text"),t.style.width="50px", +t.style.marginLeft="6px",t.style.marginBottom="10px",t.value=d+"px",c.appendChild(t),mxUtils.br(c);var l=this.addLinkSection(c,k);e=null!=this.pages&&1<this.pages.length;var u=null;if(null==h||h.constructor!=window.DriveFile||b)u=this.addCheckbox(c,mxResources.get("allPages"),e,!e);var p=this.addCheckbox(c,mxResources.get("lightbox"),!0),E=this.addEditButton(c,p),H=E.getEditInput(),A=this.addCheckbox(c,mxResources.get("layers"),!0);A.style.marginLeft=H.style.marginLeft;A.style.marginBottom="16px"; +A.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(A.removeAttribute("disabled"),H.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&p.checked?E.getEditSelect().removeAttribute("disabled"):E.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){g(l.getTarget(),l.getColor(),null==u?!0:u.checked,p.checked,E.getLink(),A.checked,null!=q?q.value:null,null!= +t?t.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=q?(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)):l.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,e,d){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px"; +c.appendChild(f);var h=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=d?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0);null!=g&&(g.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(!h.checked,null!=g?g.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,e,d,g,k,n,l){n=null!=n?n:!0;var c=document.createElement("div");c.style.whiteSpace= +"nowrap";var f=this.editor.graph,h="jpeg"==l?196:300,q=document.createElement("h3");mxUtils.write(q,a);q.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(q);mxUtils.write(c,mxResources.get("zoom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value=this.lastExportZoom||"100%";c.appendChild(t);mxUtils.write(c,mxResources.get("borderWidth")+ +":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";c.appendChild(u);mxUtils.br(c);var p=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=l),y=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),w=document.createElement("input");w.style.marginTop="16px";w.style.marginRight= +"8px";w.style.marginLeft="24px";w.setAttribute("disabled","disabled");w.setAttribute("type","checkbox");k&&(c.appendChild(w),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),h+=26,mxEvent.addListener(y,"change",function(){y.checked?w.removeAttribute("disabled"):w.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(w.setAttribute("checked","checked"),w.defaultChecked=!0);var H=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),A=document.createElement("input");A.style.marginTop= +"16px";A.style.marginRight="8px";A.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||A.setAttribute("disabled","disabled");b&&(c.appendChild(A),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),h+=26);var K=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),n,null,null,"jpeg"!=l),B=null!=this.pages&&1<this.pages.length,L=this.addCheckbox(c,B?mxResources.get("allPages"):"",B,!B,null,"jpeg"!=l);L.style.marginLeft="24px";L.style.marginBottom="16px";B||(L.style.visibility= +"hidden");mxEvent.addListener(K,"change",function(){K.checked&&B?L.removeAttribute("disabled"):L.setAttribute("disabled","disabled")});n&&B||L.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=t.value;g(t.value,p.checked,!y.checked,H.checked,K.checked,A.checked,u.value,w.checked,!L.checked)}),null,e,d);this.showDialog(a.container,340,h,!0,!0);t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode|| +mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,e,d,g){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(h)}var k=this.addCheckbox(c,mxResources.get("fit"),!0),m=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&d, +!d),n=this.addCheckbox(c,e),q=this.addCheckbox(c,mxResources.get("lightbox"),!0),t=this.addEditButton(c,q),l=t.getEditInput(),p=1<f.model.getChildCount(f.model.getRoot()),C=this.addCheckbox(c,mxResources.get("layers"),p,!p);C.style.marginLeft=l.style.marginLeft;C.style.marginBottom="12px";C.style.marginTop="8px";mxEvent.addListener(q,"change",function(){q.checked?(p&&C.removeAttribute("disabled"),l.removeAttribute("disabled")):(C.setAttribute("disabled","disabled"),l.setAttribute("disabled","disabled")); +l.checked&&q.checked?t.getEditSelect().removeAttribute("disabled"):t.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(k.checked,m.checked,n.checked,q.checked,t.getLink(),C.checked)}),null,mxResources.get("embed"),g);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,e,d,g,k,n,l){function c(b){var c=" ",h="";d&&(c=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ +(g?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",h+="cursor:pointer;");a&&(h+="max-width:100%;");var m="";e&&(m=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');n('<img src="'+b+'"'+m+(""!=h?' style="'+h+'"':"")+c+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){l({message:mxResources.get("unknownError")})}), +null,!0,e?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var h="";e&&(h="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var q=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+h+"&xml="+encodeURIComponent(b));q.send(mxUtils.bind(this,function(){200<=q.getStatus()&&299>=q.getStatus()?c("data:image/png;base64,"+q.getText()):l({message:mxResources.get("unknownError")})}))}else l({message:mxResources.get("drawingTooLarge")})}; +EditorUi.prototype.createEmbedSvg=function(a,b,e,d,g,k,n){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var h=0;h<f.length;h++){var q=f[h].getAttribute("href");null!=q&&"#"==q.charAt(0)&&"_blank"==f[h].getAttribute("target")&&f[h].removeAttribute("target")}d&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(e){var l=" ",t="";d&&(l="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ +(g?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",t+="cursor:pointer;");a&&(t+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){n('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=t?' style="'+t+'"':"")+l+"/>")}))}else t="",d&&(c.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ (g?"&edit=_blank":"")+(k?"&layers=1":"")+"');}}})(this);"),t+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","0 0 "+a+" "+b),t+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=t&&c.setAttribute("style",t),n(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxResources.get("years");b=Math.floor(a/2592E3);if(1<b)return b+ -" "+mxResources.get("months");b=Math.floor(a/86400);if(1<b)return b+" "+mxResources.get("days");b=Math.floor(a/3600);if(1<b)return b+" "+mxResources.get("hours");b=Math.floor(a/60);return 1<b?b+" "+mxResources.get("minutes"):1==b?b+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,d,e){e()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var f=a.getElementsByTagName("diagram");if(0< +" "+mxResources.get("months");b=Math.floor(a/86400);if(1<b)return b+" "+mxResources.get("days");b=Math.floor(a/3600);if(1<b)return b+" "+mxResources.get("hours");b=Math.floor(a/60);return 1<b?b+" "+mxResources.get("minutes"):1==b?b+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,e,d){d()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var f=a.getElementsByTagName("diagram");if(0< f.length){var c=f[0],d=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:d.apply(this,arguments)}}}null!=c&&(f=b.decompress(mxUtils.getTextContent(c)),null!=f&&0<f.length&&(a=mxUtils.parseXml(f).documentElement))}f=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(u){}finally{this.editor.graph=f}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){var c=this.editor.graph, f=null;if(null!=d&&0<d.length)c=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(c.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(d).documentElement,!0),c),f=d;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),e=c.getGlobalVariable,h=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?h.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(c.container); c.model.setRoot(h.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==f&&(f=this.getFileData(!0));var e=d.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(this.editor.graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(m){null!=b&&b(m)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)};EditorUi.prototype.getEmbeddedSvg= @@ -7002,133 +7003,134 @@ d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN 23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var c=new Image,f=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),d=a.getContext("2d"); a.height=c.height;a.width=c.width;d.drawImage(c,0,0);try{b(a.toDataURL())}catch(w){b(f.svgBrokenImage.src)}};c.onerror=function(){b(f.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,g){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var h=mxUtils.parseXml(a),k=this.editor.extractGraphModel(h.documentElement,null!=this.pages);if(null!=k&&"mxfile"==k.nodeName&&null!=this.pages){var m=k.getElementsByTagName("diagram");if(1==m.length)k= mxUtils.parseXml(f.decompress(mxUtils.getTextContent(m[0]))).documentElement;else if(1<m.length){f.model.beginUpdate();try{for(a=0;a<m.length;a++){var n=this.updatePageRoot(new DiagramPage(m[a])),l=this.pages.length;null==n.getName()&&n.setName(mxResources.get("pageWithNumber",[l+1]));f.model.execute(new ChangePage(this,n,n,l))}}finally{f.model.endUpdate()}}}null!=k&&"mxGraphModel"===k.nodeName&&(c=f.importGraphModel(k,b,d,e))}}catch(D){throw g||this.handleError(D,mxResources.get("invalidOrMissingFile")), -D;}return c};EditorUi.prototype.importVisio=function(a,b,d){d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)try{this.doImportVisio(a,b,d)}catch(t){d(t)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!== -typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(f){this.handleError(f)}});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,d,e,g){var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,g)}catch(w){this.handleError(w)}finally{null!=g&&g()}});this.pasteLucidChart||this.loadingExtensions|| -this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,g){g=JSON.parse(a);a=[];if(null!=g.state){g=JSON.parse(g.state);for(var c in g.Pages)a.push(g.Pages[c]);a.sort(function(a,b){return a.Properties.Order<b.Properties.Order?-1:a.Properties.Order>b.Properties.Order?1:0})}else a.push(g);if(0<a.length){this.editor.graph.getModel().beginUpdate(); -try{if(this.pasteLucidChart(a[0],b,d,e),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=function(a,b,d,e,g,k,n){k=null!=k?k:!0;n=null!=n?n:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this, -function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(g||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),h=this.importXml(f,b,d,k,!0);if(0<h.length)return h}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0, -26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),h=this.importXml(f,b,d,k,!0),0<h.length)return h}catch(v){}this.loadImage(a,mxUtils.bind(this,function(f){if("data:"==a.substring(0,5))this.resizeImage(f,a,mxUtils.bind(this,function(a,f,e){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ -this.convertDataUri(a)+";"))}),n,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/f.width,this.maxImageSize/f.height)),h=Math.round(f.width*e);f=Math.round(f.height*e);c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),h,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;c.getModel().beginUpdate();try{f=c.insertVertex(c.getDefaultParent(), -null,a,c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.updateCellSize(f),c.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,d,k);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,d,k);else{c=this.editor.graph;g=null;c.getModel().beginUpdate();try{g=c.insertVertex(c.getDefaultParent(), -null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[g])),g.value=a,c.updateCellSize(g),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(g.value)&&c.setLinkForCell(g,g.value),g.geometry.width+=c.gridSize,g.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[g]}}return[]}; -EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importFile=function(a,b,d,e,g,k,n,l, -p,m,v){m=null!=m?m:!0;var c=!1,f=null,h=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,n)):b=this.importXml(a,d,e,m);null!=l&&l(b)});"image"==b.substring(0,5)?(p=!1,"image/png"==b.substring(0,9)&&(b=v?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,m),p=!0)),p||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),m&&f.isGridEnabled()&&(d=f.snap(d), -e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,g,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,m);null!=l&&l(a)})):null!=p&&null!=n&&(/(\.vsdx)($|\?)/i.test(n)||/(\.vssx)($|\?)/i.test(n))?(c=!0,this.importVisio(p,h)):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(a,n)?(c=!0,this.parseFile(null!=p?p:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?h(a.responseText):null!=l&&l(null))}),n)):/(\.vsd)($|\?)/i.test(n)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,m));c||null==l||l(f);return f};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,g,k;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}g=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);b+="=";break}k=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(k&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return b};EditorUi.prototype.importFiles=function(a,b,d,e,g,k,n,l,p,m,v,F){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;m=null!=m?m:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,h=!1;if(!mxClient.IS_CHROMEAPP&& -null!=a)for(var q=v||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0,6)&&a[t].size>q){h=!0;break}var u=mxUtils.bind(this,function(){var h=this.editor.graph,q=h.gridSize;g=null!=g?g:mxUtils.bind(this,function(a,b,d,f,e,h,g,m,k){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,d,f,e,h,g,m,k,c,F)});k=null!=k?k:mxUtils.bind(this,function(a){h.setSelectionCells(a)});if(this.spinner.spin(document.body, -mxResources.get("loading")))for(var t=a.length,p=t,u=[],w=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--p){this.spinner.stop();if(null!=l)l(u);else{var c=[];h.getModel().beginUpdate();try{for(var d=0;d<u.length;d++){var f=u[d]();null!=f&&(c=c.concat(f))}}finally{h.getModel().endUpdate()}}k(c)}}),x=0;x<t;x++)mxUtils.bind(this,function(c){var k=a[c],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==n||n(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var l= -a.target.result,t=l.indexOf(","),p=decodeURIComponent(escape(atob(l.substring(t+1)))),u=mxUtils.parseXml(p),p=u.getElementsByTagName("svg");if(0<p.length){var p=p[0],A=F?null:p.getAttribute("content");null!=A&&"<"!=A.charAt(0)&&"%"!=A.charAt(0)&&(A=unescape(window.atob?atob(A):Base64.decode(A,!0)));null!=A&&"%"==A.charAt(0)&&(A=decodeURIComponent(A));null==A||"<mxfile "!==A.substring(0,8)&&"<mxGraphModel "!==A.substring(0,14)?w(c,mxUtils.bind(this,function(){try{if(l.substring(0,t+1),null!=u){var a= -u.getElementsByTagName("svg");if(0<a.length){var m=a[0],n=parseFloat(m.getAttribute("width")),v=parseFloat(m.getAttribute("height")),p=m.getAttribute("viewBox");if(null==p||0==p.length)m.setAttribute("viewBox","0 0 "+n+" "+v);else if(isNaN(n)||isNaN(v)){var A=p.split(" ");3<A.length&&(n=parseFloat(A[2]),v=parseFloat(A[3]))}l=this.createSvgDataUri(mxUtils.getXml(m));var B=Math.min(1,Math.min(e/Math.max(1,n)),e/Math.max(1,v)),w=g(l,k.type,b+c*q,d+c*q,Math.max(1,Math.round(n*B)),Math.max(1,Math.round(v* -B)),k.name,f);if(isNaN(n)||isNaN(v)){var x=new Image;x.onload=mxUtils.bind(this,function(){n=Math.max(1,x.width);v=Math.max(1,x.height);w[0].geometry.width=n;w[0].geometry.height=v;m.setAttribute("viewBox","0 0 "+n+" "+v);l=this.createSvgDataUri(mxUtils.getXml(m));var a=l.indexOf(";");0<a&&(l=l.substring(0,a)+l.substring(l.indexOf(",",a+1)));h.setCellStyles("image",l,[w[0]])});x.src=this.createSvgDataUri(mxUtils.getXml(m))}return w}}}catch(ba){}return null})):w(c,mxUtils.bind(this,function(){return g(A, -"text/xml",b+c*q,d+c*q,0,0,k.name)}))}}else{p=!1;if("image/png"==k.type){var B=F?null:this.extractGraphModelFromPng(a.target.result);if(null!=B&&0<B.length){var x=new Image;x.src=a.target.result;w(c,mxUtils.bind(this,function(){return g(B,"text/xml",b+c*q,d+c*q,x.width,x.height,k.name)}));p=!0}}p||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"), -mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,n,l){w(c,mxUtils.bind(this,function(){if(null!=h&&h.length<m){var p=f&&this.isResampleImage(a.target.result,v)?Math.min(1,Math.min(e/n,e/l)):1;return g(h,k.type,b+c*q,d+c*q,Math.round(n*p),Math.round(l*p),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,v)}),mxUtils.bind(this, -function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else g(a.target.result,k.type,b+c*q,d+c*q,240,160,k.name,function(a){w(c,function(){return a})})});/(\.vsdx)($|\?)/i.test(k.name)||/(\.vssx)($|\?)/i.test(k.name)?g(null,k.type,b+c*q,d+c*q,240,160,k.name,function(a){w(c,function(){return a})},k):"image"==k.type.substring(0,5)?l.readAsDataURL(k):l.readAsText(k)})(x)});h?this.confirmImageResize(function(a){f=a;u()},p):u()};EditorUi.prototype.confirmImageResize=function(a, -b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,f=function(d,f){if(d||b)mxSettings.setResizeImages(d?f:null),mxSettings.save();c();a(f)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){f(a,!0)},function(a){f(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+ -'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):f(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var f=new XMLHttpRequest;f.open("POST",OPEN_URL);f.onreadystatechange=function(){b(f)};f.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length> -b};EditorUi.prototype.resizeImage=function(a,b,d,e,g,k){g=null!=g?g:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,k))try{var h=Math.max(c/g,f/g);if(1<h){var m=Math.round(c/h),n=Math.round(f/h),l=document.createElement("canvas");l.width=m;l.height=n;l.getContext("2d").drawImage(a,0,0,m,n);var q=l.toDataURL();if(q.length<b.length){var p=document.createElement("canvas");p.width=m;p.height=n;var t=p.toDataURL();q!==t&&(b=q,c=m,f=n)}}}catch(C){}d(b,c,f)}; -EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var b=d,g=0;8>g;g++)b=1==(b&1)?3988292384^b>>>1:b>>>1,EditorUi.prototype.crcTable[d]=b;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,g){function c(a,b){var c=k;k+=b;return a.substring(c,k)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function h(a){return String.fromCharCode(a>> -24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var k=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(c(a,4),"IHDR"!=c(a,4))null!=g&&g();else{c(a,17);g=a.substring(0,k);do{var m=f(a);if("IDAT"==c(a,4)){g=a.substring(0,k-8);d=d+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);g+=h(d.length)+b+d+h(e^4294967295); -g+=a.substring(k-8,a.length);break}g+=a.substring(k-8,k-4+m);c(a,m);c(a,4)}while(m);return"data:image/png;base64,"+(window.btoa?btoa(g):Base64.encode(g,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+ -2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(t){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var k=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c= -a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,d=this.editor.graph;d.addListener("pageLinkClicked",function(b,c){a(c.getProperty("href"))});this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!= -a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,arguments)};var g=d.addClickHandler;d.addClickHandler=function(b,c,e){var f=c;c=function(b,c){if(null==c){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(c=e.getAttribute("href"))}null==c||!d.isPageLink(c)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)|| -(a(c),mxEvent.consume(b));null!=f&&f(b,c)};g.call(this,b,c,e)};k.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(d.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var n=d.getGlobalVariable;d.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a? -null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:n.apply(this,arguments)};var l=d.createLinkForHint;d.createLinkForHint=function(c,e){var f=d.isPageLink(c);if(f){var g=c.indexOf(",");0<g&&(g=b.getPageById(c.substring(g+1)),e=null!=g?g.getName():mxResources.get("pageNotFound"))}g=l.call(this,c,e);f&&mxEvent.addListener(g,"click",function(b){a(c);mxEvent.consume(b)});return g};var p=d.labelLinkClicked;d.labelLinkClicked=function(b,c,e){var f=c.getAttribute("href");if(null== -f||!d.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e))p.apply(this,arguments);else{if(!d.isEnabled()||null!=b&&d.isCellLocked(b.cell))a(f),d.getRubberband().reset();mxEvent.consume(e)}};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var z=this.actions.get("print");z.setEnabled(!mxClient.IS_IOS||!navigator.standalone);z.visible=z.isEnabled();if(!this.editor.chromeless||this.editor.editable){var m= -function(){window.setTimeout(function(){v.innerHTML=" ";v.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||d.container.addEventListener("paste", -mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()}); -else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(N){}}),!1);var v=document.createElement("div");v.style.position="absolute";v.style.whiteSpace="nowrap";v.style.overflow="hidden";v.style.display="block";v.contentEditable=!0;mxUtils.setOpacity(v,0);v.style.width="1px";v.style.height="1px";v.innerHTML=" ";var F=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86, -null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==d.container||!d.isEnabled()||d.isMouseDown||d.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||F||(v.style.left=d.container.scrollLeft+10+"px",v.style.top=d.container.scrollTop+10+"px",d.container.appendChild(v),F=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){v.focus();document.execCommand("selectAll", -!1,null)},0):(v.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!F||224!=b&&17!=b&&91!=b||(F=!1,d.isEditing()||null!=this.dialog||null==d.container||d.container.focus(),v.parentNode.removeChild(v))}),0)}));mxEvent.addListener(v,"copy",mxUtils.bind(this,function(a){d.isEnabled()&&(mxClipboard.copy(d),this.copyCells(v),m())}));mxEvent.addListener(v,"cut",mxUtils.bind(this, -function(a){d.isEnabled()&&(this.copyCells(v,!0),m())}));mxEvent.addListener(v,"paste",mxUtils.bind(this,function(a){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(v.innerHTML=" ",v.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,v);v.innerHTML=" "}),0))}),!0);var D=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==v?!0:D.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight|| -0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation(); -a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list"); -/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types, -"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){z=document.createElement("div");z.style.position="absolute";z.style.top="95px";z.style.left="250px";z.style.width="2000px";z.style.height="30px";z.style.background="whiteSmoke";document.body.appendChild(z);var x=document.createElement("div");x.style.position="absolute";x.style.top="125px";x.style.left="220px"; -x.style.width="30px";x.style.height="1000px";x.style.background="whiteSmoke";document.body.appendChild(x);var G=document.createElement("div");G.style.position="absolute";G.style.top="95px";G.style.left="220px";G.style.width="30px";G.style.height="30px";G.style.background="whiteSmoke";document.body.appendChild(G);this.vRuler=new mxRuler(this.editor.graph,x,!0);this.hRuler=new mxRuler(this.editor.graph,z,!1)}if("1"==urlParams.test){z=document.getElementById("geFooter");null!=z&&(this.styleInput=document.createElement("input"), -this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),z.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE, -mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var C=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:C.apply(this,arguments)}}z=document.getElementById("geInfo");null!=z&&z.parentNode.removeChild(z);if(Graph.fileSupport&& -(!this.editor.chromeless||this.editor.editable)){var E=null;mxEvent.addListener(d.container,"dragleave",function(a){d.isEnabled()&&(null!=E&&(E.parentNode.removeChild(E),E=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(d.container,"dragover",mxUtils.bind(this,function(a){null==E&&(!mxClient.IS_IE||10<document.documentMode)&&(E=this.highlightElement(d.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d.container, -"drop",mxUtils.bind(this,function(a){null!=E&&(E.parentNode.removeChild(E),E=null);if(d.isEnabled()){var b=mxUtils.convertPoint(d.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),c=d.view.translate,e=d.view.scale,f=b.x/e-c.x,g=b.y/e-c.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")? -a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=b)d.setSelectionCells(this.importXml(b,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var m=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=m;var k=null,c=b.getElementsByTagName("img");null!=c&&1==c.length?(m=c[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(m)||(k=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&& -(m=b[0].getAttribute("href")));var n=!0,l=mxUtils.bind(this,function(){d.setSelectionCells(this.insertTextAt(m,f,g,!0,k,null,n))});k&&m.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;l()},mxEvent.isControlDown(a)):l()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var c=this.maxImageSize,c=Math.min(1,Math.min(c/Math.max(1,b)),c/Math.max(1,a));d.setSelectionCell(d.insertVertex(null, -null,"",f,g,b*c,a*c,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(a){d.setSelectionCells(this.insertTextAt(h,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&d.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()}; -EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged", -mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat= -mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave); -mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph; -if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"=== -c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var g=e.lastIndexOf("%3E");0<=g&&g<e.length-3&&(e=e.substring(0,g+3))}catch(z){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e); -this.isCompatibleString(k)&&(f=!0,e=k)}catch(z){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&& -this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(z){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&& -12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0); -else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))): -0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash= -"#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var g=document.documentElement;d=(e.clientWidth||g.clientWidth)-3;e=Math.max(e.clientHeight||0,g.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth, -e=a.clientHeight;g=document.createElement("div");g.style.zIndex=mxPopupMenu.prototype.zIndex+2;g.style.border="3px dotted rgb(254, 137, 12)";g.style.pointerEvents="none";g.style.position="absolute";g.style.top=b+"px";g.style.left=c+"px";g.style.width=Math.max(0,d-3)+"px";g.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(g):document.body.appendChild(g);return g};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a); -var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!= -e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(v){this.handleError(v,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a, -e,b)});if(/(\.vsdx)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})); -else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this, -c.target.result,a.name))}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,e,b)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,d){var c=this.getCurrentFile(), -e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var c=mxUtils.parseXml(a);null!=c&&(this.editor.setGraphXml(c.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,d))});null!=a&&0<a.length&&(null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"), -null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root, -a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],d;for(d in a)b.push(d);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,e=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW]))); -for(var e=d.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(d.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden")}; -EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()): -(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=d?d:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))}; -EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,g=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))): -this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,g);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(L){}return a}if(f.source== -(window.opener||window.parent)){var m=f.data;if("json"==urlParams.proto){try{m=JSON.parse(m)}catch(B){m=null}if(null==m)return;if("dialog"==m.action){this.showError(null!=m.titleKey?mxResources.get(m.titleKey):m.title,null!=m.messageKey?mxResources.get(m.messageKey):m.message,null!=m.buttonKey?mxResources.get(m.buttonKey):m.button);null!=m.modified&&(this.editor.modified=m.modified);return}if("prompt"==m.action){this.spinner.stop();var h=new FilenameDialog(this,m.defaultValue||"",null!=m.okKey?mxResources.get(m.okKey): -null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:m}),"*")},null!=m.titleKey?mxResources.get(m.titleKey):m.title);this.showDialog(h.container,300,80,!0,!1);h.init();return}if("draft"==m.action){h=null;h="data:image/png;base64,"==m.xml.substring(0,22)?this.extractGraphModelFromPng(m.xml):g(m.xml);this.spinner.stop();h=new DraftDialog(this,mxResources.get("draftFound",[m.name||this.defaultFilename]),h,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft", -result:"edit",message:m}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:m}),"*")}),m.editKey?mxResources.get(m.editKey):null,m.discardKey?mxResources.get(m.discardKey):null,m.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:m}),"*")}):null);this.showDialog(h.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()})); -try{h.init()}catch(B){k.postMessage(JSON.stringify({event:"draft",error:B.toString(),message:m}),"*")}return}if("template"==m.action){this.spinner.stop();var h=1==m.enableRecent,n=1==m.enableSearch,h=new NewDialog(this,!1,null!=m.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=m.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null, -null,null,null,null,null,h?mxUtils.bind(this,function(a){this.recentReadyCallback=a;k.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,n?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(h.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));h.init();return}if("searchDocsList"== -m.action)this.searchReadyCallback(m.list,m.errorMsg);else if("recentDocsList"==m.action)this.recentReadyCallback(m.list,m.errorMsg);else{if("status"==m.action){null!=m.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(m.messageKey))):null!=m.message&&this.editor.setStatus(mxUtils.htmlEntities(m.message));null!=m.modified&&(this.editor.modified=m.modified);return}if("spinner"==m.action){var l=null!=m.messageKey?mxResources.get(m.messageKey):m.message;null==m.show||m.show?this.spinner.spin(document.body, -l):this.spinner.stop();return}if("export"==m.action){if("png"==m.format||"xmlpng"==m.format){if(null==m.spin&&null==m.spinKey||this.spinner.spin(document.body,null!=m.spinKey?mxResources.get(m.spinKey):m.spin)){var p=null!=m.xml?m.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=m.format;b.message=m;b.data=a;b.xml=encodeURIComponent(p); -k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==m.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),w=q.getGlobalVariable,A=this.pages[0];q.getGlobalVariable=function(a){return"page"== -a?A.getName():"pagenumber"==a?1:w.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==m.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()? -t("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!=m.xml&&0<m.xml.length&&this.setFileData(m.xml);l=this.createLoadMessage("export");if("html2"==m.format||"html"==m.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))h=this.getXmlFileData(),l.xml=mxUtils.getXml(h),l.data=this.getFileData(null,null,!0,null,null,null,h),l.format=m.format;else if("html"==m.format)p=this.editor.getGraphXml(),l.data=this.getHtml(p,this.editor.graph), -l.xml=mxUtils.getXml(p),l.format=m.format;else{mxSvgCanvas2D.prototype.foAltText=null;h=this.editor.graph.background;h==mxConstants.NONE&&(h=null);l.xml=this.getFileData(!0);l.format="svg";if(m.embedImages||null==m.embedImages){if(null==m.spin&&null==m.spinKey||this.spinner.spin(document.body,null!=m.spinKey?mxResources.get(m.spinKey):m.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==m.format?this.getEmbeddedSvg(l.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0); -this.spinner.stop();l.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(l),"*")})):this.convertImages(this.editor.graph.getSvg(h),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(l),"*")}));return}h="xmlsvg"==m.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(h));l.data=this.createSvgDataUri(h)}k.postMessage(JSON.stringify(l), -"*")}return}if("load"==m.action)d=1==m.autosave,this.hideDialog(),null!=m.modified&&null==urlParams.modified&&(urlParams.modified=m.modified),null!=m.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=m.saveAndExit),null!=m.title&&null!=this.buttonContainer&&(h=document.createElement("span"),mxUtils.write(h,m.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop= -"6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(h),this.embedFilenameSpan=h),m=null!=m.xmlpng?this.extractGraphModelFromPng(m.xmlpng):null!=m.xml&&"data:image/png;base64,"==m.xml.substring(0,22)?this.extractGraphModelFromPng(m.xml):m.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(m)}),"*");return}}}m=g(m);c=!0;try{a(m,f)}catch(B){this.handleError(B)}c=!1;null!=urlParams.modified&& -this.editor.setStatus("");var y=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=y();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=y();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged", -b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}})); -var k=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title", -mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding= -"4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b); -this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv= -function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,g=null,k="auto",n="auto",l=null,m=null,p=40,F=40,D=0,x=this.editor.graph;x.getGraphBounds();for(var G=function(){x.setSelectionCells(X);x.scrollCellToVisible(x.getSelectionCell())},C=x.getFreeInsertPoint(),E=C.x,H=C.y,C=H,A=null,K="auto",B=[],L=null,O=null,S=0;S<b.length&&"#"==b[S].charAt(0);){a=b[S];for(S++;S<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[S].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[S].substring(1)), -S++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var N=mxUtils.trim(a.substring(1,Y)),M=mxUtils.trim(a.substring(Y+1));"label"==N?A=x.sanitizeHtml(M):"style"==N?e=M:"identity"==N&&0<M.length&&"-"!=M?g=M:"width"==N?k=M:"height"==N?n=M:"left"==N&&0<M.length?l=M:"top"==N&&0<M.length?m=M:"ignore"==N?O=M.split(","):"connect"==N?B.push(JSON.parse(M)):"link"==N?L=M:"padding"==N?D=parseFloat(M):"edgespacing"==N?p=parseFloat(M):"nodespacing"==N?F=parseFloat(M):"layout"==N&&(K=M)}}}var W=this.editor.csvToArray(b[S]); -a=null;if(null!=g)for(var I=0;I<W.length;I++)if(g==W[I]){a=I;break}null==A&&(A="%"+W[0]+"%");if(null!=B)for(var Q=0;Q<B.length;Q++)null==d[B[Q].to]&&(d[B[Q].to]={});x.model.beginUpdate();try{for(I=S+1;I<b.length;I++){var Z=this.editor.csvToArray(b[I]);if(Z.length==W.length){var J=null,V=null!=a?Z[a]:null;null!=V&&(J=x.model.getCell(V));null==J&&(J=new mxCell(A,new mxGeometry(E,C,0,0),e||"whiteSpace=wrap;html=1;"),J.vertex=!0,J.id=V);for(var T=0;T<Z.length;T++)x.setAttributeForCell(J,W[T],Z[T]);x.setAttributeForCell(J, -"placeholders","1");J.style=x.replacePlaceholders(J,J.style);for(Q=0;Q<B.length;Q++)d[B[Q].to][J.getAttribute(B[Q].to)]=J;null!=L&&"link"!=L&&(x.setLinkForCell(J,J.getAttribute(L)),x.setAttributeForCell(J,L,null));x.fireEvent(new mxEventObject("cellsInserted","cells",[J]));var R=this.editor.graph.getPreferredSizeForCell(J);J.vertex&&(null!=l&&null!=J.getAttribute(l)&&(J.geometry.x=E+parseFloat(J.getAttribute(l))),null!=m&&null!=J.getAttribute(m)&&(J.geometry.y=H+parseFloat(J.getAttribute(m))),"@"== -k.charAt(0)&&null!=J.getAttribute(k.substring(1))?J.geometry.width=parseFloat(J.getAttribute(k.substring(1))):J.geometry.width="auto"==k?R.width+D:parseFloat(k),"@"==n.charAt(0)&&null!=J.getAttribute(n.substring(1))?J.geometry.height=parseFloat(J.getAttribute(n.substring(1))):J.geometry.height="auto"==n?R.height+D:parseFloat(n),C+=J.geometry.height+F);c.push(x.addCell(J))}}for(var U=c.slice(),X=c.slice(),Q=0;Q<B.length;Q++)for(var P=B[Q],I=0;I<c.length;I++){var J=c[I],ga=J.getAttribute(P.from);if(null!= -ga){x.setAttributeForCell(J,P.from,null);for(var ha=ga.split(","),T=0;T<ha.length;T++){var aa=d[P.to][ha[T]];null!=aa&&(A=P.label,null!=P.fromlabel&&(A=(J.getAttribute(P.fromlabel)||"")+(A||"")),null!=P.tolabel&&(A=(A||"")+(aa.getAttribute(P.tolabel)||"")),X.push(x.insertEdge(null,null,A||"",P.invert?aa:J,P.invert?J:aa,P.style||x.createCurrentEdgeStyle())),mxUtils.remove(P.invert?J:aa,U))}}}if(null!=O)for(I=0;I<c.length;I++)for(J=c[I],T=0;T<O.length;T++)x.setAttributeForCell(J,mxUtils.trim(O[T]), -null);var da=new mxParallelEdgeLayout(x);da.spacing=p;var ia=function(){da.execute(x.getDefaultParent());for(var a=0;a<c.length;a++){var b=x.getCellGeometry(c[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==k&&(b.width=Math.round(x.snap(b.width)));"auto"==n&&(b.height=Math.round(x.snap(b.height)))}};if("circle"==K){var ea=new mxCircleLayout(x);ea.resetEdges=!1;var ja=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){ea.execute(x.getDefaultParent()); -ia()},!0,G);G=null}else if("horizontaltree"==K||"verticaltree"==K||"auto"==K&&X.length==2*c.length-1&&1==U.length){x.view.validate();var ba=new mxCompactTreeLayout(x,"horizontaltree"==K);ba.levelDistance=F;ba.edgeRouting=!1;ba.resetEdges=!1;this.executeLayout(function(){ba.execute(x.getDefaultParent(),0<U.length?U[0]:null)},!0,G);G=null}else if("horizontalflow"==K||"verticalflow"==K||"auto"==K&&1==U.length){x.view.validate();var fa=new mxHierarchicalLayout(x,"horizontalflow"==K?mxConstants.DIRECTION_WEST: -mxConstants.DIRECTION_NORTH);fa.intraCellSpacing=F;fa.disableEdgeStyle=!1;this.executeLayout(function(){fa.execute(x.getDefaultParent(),X);x.moveCells(X,E,H)},!0,G);G=null}else if("organic"==K||"auto"==K&&X.length>c.length){x.view.validate();var ca=new mxFastOrganicLayout(x);ca.forceConstant=3*F;ca.resetEdges=!1;var ka=ca.isVertexIgnored;ca.isVertexIgnored=function(a){return ka.apply(this,arguments)||0>mxUtils.indexOf(c,a)};da=new mxParallelEdgeLayout(x);da.spacing=p;this.executeLayout(function(){ca.execute(x.getDefaultParent()); -ia()},!0,G);G=null}this.hideDialog()}finally{x.model.endUpdate()}null!=G&&G()}}catch(la){this.handleError(la)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0; -if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var n=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b= -n.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&& -null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width- -2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()}; -this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,g=b.outline;g.pageScale=e.pageScale;g.pageFormat=e.pageFormat;g.background=e.background;g.pageVisible=e.pageVisible;g.background=e.background;var f=mxUtils.getCurrentStyle(e.container);g.container.style.backgroundColor=f.backgroundColor;null!=e.view.backgroundPageShape&&null!=g.view.backgroundPageShape&&(g.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root, -!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi= -function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!= -urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a); -this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px"; -this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache, -g=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break; -case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=g&&(this.offlineStatus.innerHTML=b,g=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b); -b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var l=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){l.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b); -this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell())); -this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("rename").setEnabled(null!=d&&d.isRenamable());this.actions.get("close").setEnabled(null!= -d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);p.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile= -function(a,b,d,e,g,k){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,g,k)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),h=c.getGraphBounds(),m=Math.floor(h.width*g/c.view.scale),n=Math.floor(h.height*g/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*n<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL, -"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+n+"&border="+k+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor}, +D;}return c};EditorUi.prototype.importVisio=function(a,b,d,e){e=null!=e?e:a.name;d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(/(\.vsd)($|\?)/i.test(e)){var c=new FormData;c.append("file1",a);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);f.responseType="blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{this.doImportVisio(f.response, +b,d)}catch(y){d(y)}else d({})});f.send(c)}else try{this.doImportVisio(a,b,d)}catch(y){d(y)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(f){this.handleError(f)}});"undefined"!==typeof VsdxExport||this.loadingExtensions|| +this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,d,e,g){var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,g)}catch(w){this.handleError(w)}finally{null!=g&&g()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js", +c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,g){g=JSON.parse(a);a=[];if(null!=g.state){g=JSON.parse(g.state);for(var c in g.Pages)a.push(g.Pages[c]);a.sort(function(a,b){return a.Properties.Order<b.Properties.Order?-1:a.Properties.Order>b.Properties.Order?1:0})}else a.push(g);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,d,e),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}}; +EditorUi.prototype.insertTextAt=function(a,b,d,e,g,k,n){k=null!=k?k:!0;n=null!=n?n:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(g||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c= +this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),h=this.importXml(f,b,d,k,!0);if(0<h.length)return h}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),h=this.importXml(f,b,d,k,!0),0<h.length)return h}catch(v){}this.loadImage(a,mxUtils.bind(this, +function(f){if("data:"==a.substring(0,5))this.resizeImage(f,a,mxUtils.bind(this,function(a,f,e){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),n,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/f.width,this.maxImageSize/f.height)),h=Math.round(f.width*e);f=Math.round(f.height*e);c.setSelectionCell(c.insertVertex(null, +null,"",c.snap(b),c.snap(d),h,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;c.getModel().beginUpdate();try{f=c.insertVertex(c.getDefaultParent(),null,a,c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.updateCellSize(f),c.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a)); +if(this.isCompatibleString(a))return this.importXml(a,b,d,k);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,d,k);else{c=this.editor.graph;g=null;c.getModel().beginUpdate();try{g=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[g])),g.value=a,c.updateCellSize(g),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(g.value)&& +c.setLinkForCell(g,g.value),g.geometry.width+=c.gridSize,g.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[g]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat= +function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importFile=function(a,b,d,e,g,k,n,l,p,m,v){m=null!=m?m:!0;var c=!1,f=null,h=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,n)):b=this.importXml(a,d,e,m);null!=l&&l(b)});"image"==b.substring(0,5)?(p=!1,"image/png"==b.substring(0,9)&&(b=v?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,m),p= +!0)),p||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),m&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,g,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,m);null!=l&&l(a)})):null!= +p&&null!=n&&(/(\.vsdx)($|\?)/i.test(n)||/(\.vssx)($|\?)/i.test(n)||/(\.vsd)($|\?)/i.test(n))?(c=!0,this.importVisio(p,h)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,n)?(c=!0,this.parseFile(null!=p?p:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?h(a.responseText):null!=l&&l(null))}),n)):/(\.vsd)($|\?)/i.test(n)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,m));c||null==l||l(f); +return f};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,g,k;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}g=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e& +3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);b+="=";break}k=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(k&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return b}; +EditorUi.prototype.importFiles=function(a,b,d,e,g,k,n,l,p,m,v,F){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;m=null!=m?m:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,h=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var q=v||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0,6)&&a[t].size>q){h=!0;break}var u=mxUtils.bind(this,function(){var h=this.editor.graph,q=h.gridSize;g=null!=g?g:mxUtils.bind(this,function(a,b,d,f,e,h,g,m,k){return null!=a&&"<mxlibrary"==a.substring(0, +10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,d,f,e,h,g,m,k,c,F)});k=null!=k?k:mxUtils.bind(this,function(a){h.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var t=a.length,p=t,u=[],w=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--p){this.spinner.stop();if(null!=l)l(u);else{var c=[];h.getModel().beginUpdate();try{for(var d=0;d<u.length;d++){var f=u[d]();null!=f&&(c=c.concat(f))}}finally{h.getModel().endUpdate()}}k(c)}}), +x=0;x<t;x++)mxUtils.bind(this,function(c){var k=a[c],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==n||n(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var l=a.target.result,t=l.indexOf(","),p=decodeURIComponent(escape(atob(l.substring(t+1)))),u=mxUtils.parseXml(p),p=u.getElementsByTagName("svg");if(0<p.length){var p=p[0],A=F?null:p.getAttribute("content");null!=A&&"<"!=A.charAt(0)&&"%"!=A.charAt(0)&&(A=unescape(window.atob?atob(A):Base64.decode(A,!0))); +null!=A&&"%"==A.charAt(0)&&(A=decodeURIComponent(A));null==A||"<mxfile "!==A.substring(0,8)&&"<mxGraphModel "!==A.substring(0,14)?w(c,mxUtils.bind(this,function(){try{if(l.substring(0,t+1),null!=u){var a=u.getElementsByTagName("svg");if(0<a.length){var m=a[0],n=parseFloat(m.getAttribute("width")),v=parseFloat(m.getAttribute("height")),p=m.getAttribute("viewBox");if(null==p||0==p.length)m.setAttribute("viewBox","0 0 "+n+" "+v);else if(isNaN(n)||isNaN(v)){var A=p.split(" ");3<A.length&&(n=parseFloat(A[2]), +v=parseFloat(A[3]))}l=this.createSvgDataUri(mxUtils.getXml(m));var B=Math.min(1,Math.min(e/Math.max(1,n)),e/Math.max(1,v)),w=g(l,k.type,b+c*q,d+c*q,Math.max(1,Math.round(n*B)),Math.max(1,Math.round(v*B)),k.name,f);if(isNaN(n)||isNaN(v)){var x=new Image;x.onload=mxUtils.bind(this,function(){n=Math.max(1,x.width);v=Math.max(1,x.height);w[0].geometry.width=n;w[0].geometry.height=v;m.setAttribute("viewBox","0 0 "+n+" "+v);l=this.createSvgDataUri(mxUtils.getXml(m));var a=l.indexOf(";");0<a&&(l=l.substring(0, +a)+l.substring(l.indexOf(",",a+1)));h.setCellStyles("image",l,[w[0]])});x.src=this.createSvgDataUri(mxUtils.getXml(m))}return w}}}catch(ba){}return null})):w(c,mxUtils.bind(this,function(){return g(A,"text/xml",b+c*q,d+c*q,0,0,k.name)}))}}else{p=!1;if("image/png"==k.type){var B=F?null:this.extractGraphModelFromPng(a.target.result);if(null!=B&&0<B.length){var x=new Image;x.src=a.target.result;w(c,mxUtils.bind(this,function(){return g(B,"text/xml",b+c*q,d+c*q,x.width,x.height,k.name)}));p=!0}}p||(mxClient.IS_CHROMEAPP? +(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,n,l){w(c,mxUtils.bind(this,function(){if(null!=h&&h.length<m){var p=f&&this.isResampleImage(a.target.result,v)?Math.min(1, +Math.min(e/n,e/l)):1;return g(h,k.type,b+c*q,d+c*q,Math.round(n*p),Math.round(l*p),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,v)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else g(a.target.result,k.type,b+c*q,d+c*q,240,160,k.name,function(a){w(c,function(){return a})})});/(\.vsdx)($|\?)/i.test(k.name)||/(\.vssx)($|\?)/i.test(k.name)||/(\.vsd)($|\?)/i.test(k.name)?g(null,k.type,b+c*q,d+c*q,240,160, +k.name,function(a){w(c,function(){return a})},k):"image"==k.type.substring(0,5)?l.readAsDataURL(k):l.readAsText(k)})(x)});h?this.confirmImageResize(function(a){f=a;u()},p):u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,f=function(d,f){if(d||b)mxSettings.setResizeImages(d?f:null),mxSettings.save();c();a(f)};null==d|| +b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){f(a,!0)},function(a){f(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):f(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format", +"xml");c.append("upfile",a,d);var f=new XMLHttpRequest;f.open("POST",OPEN_URL);f.onreadystatechange=function(){b(f)};f.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,g,k){g=null!=g?g:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,k))try{var h=Math.max(c/g,f/g);if(1<h){var m=Math.round(c/h),n=Math.round(f/h),l=document.createElement("canvas"); +l.width=m;l.height=n;l.getContext("2d").drawImage(a,0,0,m,n);var q=l.toDataURL();if(q.length<b.length){var p=document.createElement("canvas");p.width=m;p.height=n;var t=p.toDataURL();q!==t&&(b=q,c=m,f=n)}}}catch(C){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var b=d,g=0;8>g;g++)b=1==(b&1)?3988292384^b>>>1:b>>>1,EditorUi.prototype.crcTable[d]=b;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng= +function(a,b,d,e,g){function c(a,b){var c=k;k+=b;return a.substring(c,k)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function h(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var k=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(c(a,4),"IHDR"!=c(a,4))null!=g&&g();else{c(a,17);g=a.substring(0, +k);do{var m=f(a);if("IDAT"==c(a,4)){g=a.substring(0,k-8);d=d+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);g+=h(d.length)+b+d+h(e^4294967295);g+=a.substring(k-8,a.length);break}g+=a.substring(k-8,k-4+m);c(a,m);c(a,4)}while(m);return"data:image/png;base64,"+(window.btoa?btoa(g):Base64.encode(g,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&& +!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(t){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)); +null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var k=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c=a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,d=this.editor.graph;d.addListener("pageLinkClicked",function(b, +c){a(c.getProperty("href"))});this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this, +arguments)};var g=d.addClickHandler;d.addClickHandler=function(b,c,e){var f=c;c=function(b,c){if(null==c){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(c=e.getAttribute("href"))}null==c||!d.isPageLink(c)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(c),mxEvent.consume(b));null!=f&&f(b,c)};g.call(this,b,c,e)};k.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(d.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container, +360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var n=d.getGlobalVariable;d.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:n.apply(this,arguments)};var l=d.createLinkForHint;d.createLinkForHint=function(c,e){var f=d.isPageLink(c);if(f){var g=c.indexOf(",");0<g&&(g=b.getPageById(c.substring(g+1)),e=null!= +g?g.getName():mxResources.get("pageNotFound"))}g=l.call(this,c,e);f&&mxEvent.addListener(g,"click",function(b){a(c);mxEvent.consume(b)});return g};var p=d.labelLinkClicked;d.labelLinkClicked=function(b,c,e){var f=c.getAttribute("href");if(null==f||!d.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e))p.apply(this,arguments);else{if(!d.isEnabled()||null!=b&&d.isCellLocked(b.cell))a(f),d.getRubberband().reset();mxEvent.consume(e)}};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename, +c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var z=this.actions.get("print");z.setEnabled(!mxClient.IS_IOS||!navigator.standalone);z.visible=z.isEnabled();if(!this.editor.chromeless||this.editor.editable){var m=function(){window.setTimeout(function(){v.innerHTML=" ";v.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0); +this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||d.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items; +for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(N){}}),!1);var v=document.createElement("div");v.style.position="absolute";v.style.whiteSpace= +"nowrap";v.style.overflow="hidden";v.style.display="block";v.contentEditable=!0;mxUtils.setOpacity(v,0);v.style.width="1px";v.style.height="1px";v.innerHTML=" ";var F=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==d.container||!d.isEnabled()||d.isMouseDown||d.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"== +b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||F||(v.style.left=d.container.scrollLeft+10+"px",v.style.top=d.container.scrollTop+10+"px",d.container.appendChild(v),F=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){v.focus();document.execCommand("selectAll",!1,null)},0):(v.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!F|| +224!=b&&17!=b&&91!=b||(F=!1,d.isEditing()||null!=this.dialog||null==d.container||d.container.focus(),v.parentNode.removeChild(v))}),0)}));mxEvent.addListener(v,"copy",mxUtils.bind(this,function(a){d.isEnabled()&&(mxClipboard.copy(d),this.copyCells(v),m())}));mxEvent.addListener(v,"cut",mxUtils.bind(this,function(a){d.isEnabled()&&(this.copyCells(v,!0),m())}));mxEvent.addListener(v,"paste",mxUtils.bind(this,function(a){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(v.innerHTML=" ",v.focus(), +window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,v);v.innerHTML=" "}),0))}),!0);var D=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==v?!0:D.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph, +c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files, +0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1, +Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!== +typeof mxRuler){z=document.createElement("div");z.style.position="absolute";z.style.top="95px";z.style.left="250px";z.style.width="2000px";z.style.height="30px";z.style.background="whiteSmoke";document.body.appendChild(z);var x=document.createElement("div");x.style.position="absolute";x.style.top="125px";x.style.left="220px";x.style.width="30px";x.style.height="1000px";x.style.background="whiteSmoke";document.body.appendChild(x);var G=document.createElement("div");G.style.position="absolute";G.style.top= +"95px";G.style.left="220px";G.style.width="30px";G.style.height="30px";G.style.background="whiteSmoke";document.body.appendChild(G);this.vRuler=new mxRuler(this.editor.graph,x,!0);this.hRuler=new mxRuler(this.editor.graph,z,!1)}if("1"==urlParams.test){z=document.getElementById("geFooter");null!=z&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width= +"98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),z.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c); +this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var C=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:C.apply(this,arguments)}}z=document.getElementById("geInfo");null!=z&&z.parentNode.removeChild(z);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var E=null;mxEvent.addListener(d.container,"dragleave",function(a){d.isEnabled()&&(null!=E&&(E.parentNode.removeChild(E), +E=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(d.container,"dragover",mxUtils.bind(this,function(a){null==E&&(!mxClient.IS_IE||10<document.documentMode)&&(E=this.highlightElement(d.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d.container,"drop",mxUtils.bind(this,function(a){null!=E&&(E.parentNode.removeChild(E),E=null);if(d.isEnabled()){var b=mxUtils.convertPoint(d.container,mxEvent.getClientX(a),mxEvent.getClientY(a)), +c=d.view.translate,e=d.view.scale,f=b.x/e-c.x,g=b.y/e-c.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=b)d.setSelectionCells(this.importXml(b,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types, +"text/html")){var m=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=m;var k=null,c=b.getElementsByTagName("img");null!=c&&1==c.length?(m=c[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(m)||(k=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(m=b[0].getAttribute("href")));var n=!0,l=mxUtils.bind(this,function(){d.setSelectionCells(this.insertTextAt(m,f,g,!0,k,null,n))});k&&m.length>this.resampleThreshold?this.confirmImageResize(function(a){n= +a;l()},mxEvent.isControlDown(a)):l()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var c=this.maxImageSize,c=Math.min(1,Math.min(c/Math.max(1,b)),c/Math.max(1,a));d.setSelectionCell(d.insertVertex(null,null,"",f,g,b*c,a*c,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(a){d.setSelectionCells(this.insertTextAt(h, +f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&d.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors= +mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget()); +this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged", +mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew|| +8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d, +!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS|| +8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var g=e.lastIndexOf("%3E");0<=g&&g<e.length-3&&(e=e.substring(0,g+3))}catch(z){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(k)&&(f=!0,e=k)}catch(z){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e, +c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(z){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave", +function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()|| +"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types, +"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)? +(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))}; +EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var g=document.documentElement;d=(e.clientWidth||g.clientWidth)-3;e=Math.max(e.clientHeight||0,g.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;g=document.createElement("div");g.style.zIndex=mxPopupMenu.prototype.zIndex+2;g.style.border="3px dotted rgb(254, 137, 12)";g.style.pointerEvents="none";g.style.position="absolute";g.style.top=b+"px";g.style.left=c+"px";g.style.width= +Math.max(0,d-3)+"px";g.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(g):document.body.appendChild(g);return g};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles= +function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&& +"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(v){this.handleError(v,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.vsdx)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e)||/(\.vsd)($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))this.parseFile(a, +mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear(); +this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,e,b)}});c.onerror=mxUtils.bind(this, +function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,d){var c=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var c=mxUtils.parseXml(a);null!=c&&(this.editor.setGraphXml(c.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this, +a,b||this.defaultFilename,d))});null!=a&&0<a.length&&(null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"), +null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],d;for(d in a)b.push(d);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1, +a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,e=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=d.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(d.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility= +a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden")};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this, +function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=d?d:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&& +this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale, +page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,g=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,g);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!= +a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(L){}return a}if(f.source==(window.opener||window.parent)){var m=f.data;if("json"==urlParams.proto){try{m=JSON.parse(m)}catch(B){m=null}if(null==m)return;if("dialog"==m.action){this.showError(null!= +m.titleKey?mxResources.get(m.titleKey):m.title,null!=m.messageKey?mxResources.get(m.messageKey):m.message,null!=m.buttonKey?mxResources.get(m.buttonKey):m.button);null!=m.modified&&(this.editor.modified=m.modified);return}if("prompt"==m.action){this.spinner.stop();var h=new FilenameDialog(this,m.defaultValue||"",null!=m.okKey?mxResources.get(m.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:m}),"*")},null!=m.titleKey?mxResources.get(m.titleKey):m.title); +this.showDialog(h.container,300,80,!0,!1);h.init();return}if("draft"==m.action){h=null;h="data:image/png;base64,"==m.xml.substring(0,22)?this.extractGraphModelFromPng(m.xml):g(m.xml);this.spinner.stop();h=new DraftDialog(this,mxResources.get("draftFound",[m.name||this.defaultFilename]),h,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:m}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft", +result:"discard",message:m}),"*")}),m.editKey?mxResources.get(m.editKey):null,m.discardKey?mxResources.get(m.discardKey):null,m.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:m}),"*")}):null);this.showDialog(h.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{h.init()}catch(B){k.postMessage(JSON.stringify({event:"draft",error:B.toString(),message:m}),"*")}return}if("template"== +m.action){this.spinner.stop();var h=1==m.enableRecent,n=1==m.enableSearch,h=new NewDialog(this,!1,null!=m.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=m.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,h?mxUtils.bind(this,function(a){this.recentReadyCallback=a;k.postMessage(JSON.stringify({event:"recentDocs"}), +"*")}):null,n?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(h.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));h.init();return}if("searchDocsList"==m.action)this.searchReadyCallback(m.list,m.errorMsg);else if("recentDocsList"==m.action)this.recentReadyCallback(m.list, +m.errorMsg);else{if("status"==m.action){null!=m.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(m.messageKey))):null!=m.message&&this.editor.setStatus(mxUtils.htmlEntities(m.message));null!=m.modified&&(this.editor.modified=m.modified);return}if("spinner"==m.action){var l=null!=m.messageKey?mxResources.get(m.messageKey):m.message;null==m.show||m.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("export"==m.action){if("png"==m.format||"xmlpng"==m.format){if(null== +m.spin&&null==m.spinKey||this.spinner.spin(document.body,null!=m.spinKey?mxResources.get(m.spinKey):m.spin)){var p=null!=m.xml?m.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=m.format;b.message=m;b.data=a;b.xml=encodeURIComponent(p);k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage); +"xmlpng"==m.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),w=q.getGlobalVariable,A=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:w.apply(this,arguments)};document.body.appendChild(q.container); +q.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==m.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!= +m.xml&&0<m.xml.length&&this.setFileData(m.xml);l=this.createLoadMessage("export");if("html2"==m.format||"html"==m.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))h=this.getXmlFileData(),l.xml=mxUtils.getXml(h),l.data=this.getFileData(null,null,!0,null,null,null,h),l.format=m.format;else if("html"==m.format)p=this.editor.getGraphXml(),l.data=this.getHtml(p,this.editor.graph),l.xml=mxUtils.getXml(p),l.format=m.format;else{mxSvgCanvas2D.prototype.foAltText=null;h=this.editor.graph.background; +h==mxConstants.NONE&&(h=null);l.xml=this.getFileData(!0);l.format="svg";if(m.embedImages||null==m.embedImages){if(null==m.spin&&null==m.spinKey||this.spinner.spin(document.body,null!=m.spinKey?mxResources.get(m.spinKey):m.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==m.format?this.getEmbeddedSvg(l.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(l),"*")})):this.convertImages(this.editor.graph.getSvg(h), +mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(l),"*")}));return}h="xmlsvg"==m.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(h));l.data=this.createSvgDataUri(h)}k.postMessage(JSON.stringify(l),"*")}return}if("load"==m.action)d=1==m.autosave,this.hideDialog(),null!=m.modified&&null==urlParams.modified&&(urlParams.modified= +m.modified),null!=m.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=m.saveAndExit),null!=m.title&&null!=this.buttonContainer&&(h=document.createElement("span"),mxUtils.write(h,m.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan), +this.buttonContainer.appendChild(h),this.embedFilenameSpan=h),m=null!=m.xmlpng?this.extractGraphModelFromPng(m.xmlpng):null!=m.xml&&"data:image/png;base64,"==m.xml.substring(0,22)?this.extractGraphModelFromPng(m.xml):m.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(m)}),"*");return}}}m=g(m);c=!0;try{a(m,f)}catch(B){this.handleError(B)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var y=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&& +1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=y();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=y();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged", +b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}): +urlParams.ready||"ready";k.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize= +"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})), +a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog= +function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,g=null,k="auto",n="auto",l=null,m=null,p=40,F=40,D=0,x=this.editor.graph; +x.getGraphBounds();for(var G=function(){x.setSelectionCells(X);x.scrollCellToVisible(x.getSelectionCell())},C=x.getFreeInsertPoint(),E=C.x,H=C.y,C=H,A=null,K="auto",B=[],L=null,O=null,S=0;S<b.length&&"#"==b[S].charAt(0);){a=b[S];for(S++;S<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[S].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[S].substring(1)),S++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var N=mxUtils.trim(a.substring(1,Y)),M=mxUtils.trim(a.substring(Y+1));"label"==N?A=x.sanitizeHtml(M): +"style"==N?e=M:"identity"==N&&0<M.length&&"-"!=M?g=M:"width"==N?k=M:"height"==N?n=M:"left"==N&&0<M.length?l=M:"top"==N&&0<M.length?m=M:"ignore"==N?O=M.split(","):"connect"==N?B.push(JSON.parse(M)):"link"==N?L=M:"padding"==N?D=parseFloat(M):"edgespacing"==N?p=parseFloat(M):"nodespacing"==N?F=parseFloat(M):"layout"==N&&(K=M)}}}var W=this.editor.csvToArray(b[S]);a=null;if(null!=g)for(var I=0;I<W.length;I++)if(g==W[I]){a=I;break}null==A&&(A="%"+W[0]+"%");if(null!=B)for(var Q=0;Q<B.length;Q++)null==d[B[Q].to]&& +(d[B[Q].to]={});x.model.beginUpdate();try{for(I=S+1;I<b.length;I++){var Z=this.editor.csvToArray(b[I]);if(Z.length==W.length){var J=null,V=null!=a?Z[a]:null;null!=V&&(J=x.model.getCell(V));null==J&&(J=new mxCell(A,new mxGeometry(E,C,0,0),e||"whiteSpace=wrap;html=1;"),J.vertex=!0,J.id=V);for(var T=0;T<Z.length;T++)x.setAttributeForCell(J,W[T],Z[T]);x.setAttributeForCell(J,"placeholders","1");J.style=x.replacePlaceholders(J,J.style);for(Q=0;Q<B.length;Q++)d[B[Q].to][J.getAttribute(B[Q].to)]=J;null!= +L&&"link"!=L&&(x.setLinkForCell(J,J.getAttribute(L)),x.setAttributeForCell(J,L,null));x.fireEvent(new mxEventObject("cellsInserted","cells",[J]));var R=this.editor.graph.getPreferredSizeForCell(J);J.vertex&&(null!=l&&null!=J.getAttribute(l)&&(J.geometry.x=E+parseFloat(J.getAttribute(l))),null!=m&&null!=J.getAttribute(m)&&(J.geometry.y=H+parseFloat(J.getAttribute(m))),"@"==k.charAt(0)&&null!=J.getAttribute(k.substring(1))?J.geometry.width=parseFloat(J.getAttribute(k.substring(1))):J.geometry.width= +"auto"==k?R.width+D:parseFloat(k),"@"==n.charAt(0)&&null!=J.getAttribute(n.substring(1))?J.geometry.height=parseFloat(J.getAttribute(n.substring(1))):J.geometry.height="auto"==n?R.height+D:parseFloat(n),C+=J.geometry.height+F);c.push(x.addCell(J))}}for(var U=c.slice(),X=c.slice(),Q=0;Q<B.length;Q++)for(var P=B[Q],I=0;I<c.length;I++){var J=c[I],ga=J.getAttribute(P.from);if(null!=ga){x.setAttributeForCell(J,P.from,null);for(var ha=ga.split(","),T=0;T<ha.length;T++){var aa=d[P.to][ha[T]];null!=aa&&(A= +P.label,null!=P.fromlabel&&(A=(J.getAttribute(P.fromlabel)||"")+(A||"")),null!=P.tolabel&&(A=(A||"")+(aa.getAttribute(P.tolabel)||"")),X.push(x.insertEdge(null,null,A||"",P.invert?aa:J,P.invert?J:aa,P.style||x.createCurrentEdgeStyle())),mxUtils.remove(P.invert?J:aa,U))}}}if(null!=O)for(I=0;I<c.length;I++)for(J=c[I],T=0;T<O.length;T++)x.setAttributeForCell(J,mxUtils.trim(O[T]),null);var da=new mxParallelEdgeLayout(x);da.spacing=p;var ia=function(){da.execute(x.getDefaultParent());for(var a=0;a<c.length;a++){var b= +x.getCellGeometry(c[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==k&&(b.width=Math.round(x.snap(b.width)));"auto"==n&&(b.height=Math.round(x.snap(b.height)))}};if("circle"==K){var ea=new mxCircleLayout(x);ea.resetEdges=!1;var ja=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){ea.execute(x.getDefaultParent());ia()},!0,G);G=null}else if("horizontaltree"==K||"verticaltree"==K||"auto"==K&&X.length== +2*c.length-1&&1==U.length){x.view.validate();var ba=new mxCompactTreeLayout(x,"horizontaltree"==K);ba.levelDistance=F;ba.edgeRouting=!1;ba.resetEdges=!1;this.executeLayout(function(){ba.execute(x.getDefaultParent(),0<U.length?U[0]:null)},!0,G);G=null}else if("horizontalflow"==K||"verticalflow"==K||"auto"==K&&1==U.length){x.view.validate();var fa=new mxHierarchicalLayout(x,"horizontalflow"==K?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);fa.intraCellSpacing=F;fa.disableEdgeStyle=!1;this.executeLayout(function(){fa.execute(x.getDefaultParent(), +X);x.moveCells(X,E,H)},!0,G);G=null}else if("organic"==K||"auto"==K&&X.length>c.length){x.view.validate();var ca=new mxFastOrganicLayout(x);ca.forceConstant=3*F;ca.resetEdges=!1;var ka=ca.isVertexIgnored;ca.isVertexIgnored=function(a){return ka.apply(this,arguments)||0>mxUtils.indexOf(c,a)};da=new mxParallelEdgeLayout(x);da.spacing=p;this.executeLayout(function(){ca.execute(x.getDefaultParent());ia()},!0,G);G=null}this.hideDialog()}finally{x.model.endUpdate()}null!=G&&G()}}catch(la){this.handleError(la)}}; +EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "), +d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var n=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=n.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&& +null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width* +b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/ +a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,g=b.outline;g.pageScale=e.pageScale;g.pageFormat= +e.pageFormat;g.background=e.background;g.pageVisible=e.pageVisible;g.background=e.background;var f=mxUtils.getCurrentStyle(e.container);g.container.style.backgroundColor=f.backgroundColor;null!=e.view.backgroundPageShape&&null!=g.view.backgroundPageShape&&(g.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient|| +c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled(); +this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d); +a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!= +this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding= +"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,g=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b= +'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+ +IMAGE_PATH+'/clear.gif"/>'}a!=g&&(this.offlineStatus.innerHTML=b,g=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){}; +EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var l=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){l.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b); +this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b); +this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("rename").setEnabled(null!=d&&d.isRenamable());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted()); +a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);p.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,g,k){var c=a.editor.graph;if("xml"== +d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,g,k)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),h=c.getGraphBounds(),m=Math.floor(h.width*g/c.view.scale),n=Math.floor(h.height*g/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*n<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+ +encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+n+"&border="+k+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor}, setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries= a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins= a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle}, @@ -7275,10 +7277,10 @@ d():this.confirm(mxResources.get("replaceIt",[e]),d))}; App.prototype.descriptorChanged=function(){var a=this.getCurrentFile();if(null!=a){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerHTML="";var e=null!=a.getTitle()?a.getTitle():this.defaultFilename;mxUtils.write(this.fname,e);this.fname.setAttribute("title",e+" - "+mxResources.get("rename"))}this.editor.graph.setEnabled(a.isEditable());null==urlParams.rev&&(this.updateDocumentTitle(),a=a.getHash(),0<a.length?window.location.hash=a:0<window.location.hash.length&&(window.location.hash= ""))}};App.prototype.toggleChat=function(){var a=this.getCurrentFile();if(null!=a){if(null==a.chatWindow){var e=document.body.offsetWidth-300;a.chatWindow=new ChatWindow(this,mxResources.get("chatWindowTitle"),document.getElementById("geChat"),e,80,250,350,a.realtime);a.chatWindow.window.setVisible(!1)}a.chatWindow.window.setVisible(!a.chatWindow.window.isVisible())}}; App.prototype.showAuthDialog=function(a,e,d,b){var g=this.spinner.pause();this.showDialog((new AuthDialog(this,a,e,mxUtils.bind(this,function(a){try{null!=d&&d(a,mxUtils.bind(this,function(){this.hideDialog();g()}))}catch(n){this.editor.setStatus(mxUtils.htmlEntities(n.message))}}))).container,300,e?180:140,!0,!0,mxUtils.bind(this,function(a){null!=b&&b();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}; -App.prototype.convertFile=function(a,e,d,b,g,k){var n=e;/\.svg$/i.test(n)||(n=n.substring(0,e.lastIndexOf("."))+b);var l=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(l=!0);if(/\.vsdx$/i.test(e)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var p=new XMLHttpRequest;p.open("GET",a,!0);l||(p.responseType="blob");p.onload=mxUtils.bind(this,function(){var a=null;l?(a=JSON.parse(p.responseText),a=this.base64ToBlob(a.content, -"application/octet-stream")):a=new Blob([p.response],{type:"application/octet-stream"});this.importVisio(a,mxUtils.bind(this,function(a){g(new LocalFile(this,a,n,!0))}),k)});p.send()}else{var c=mxUtils.bind(this,function(b){try{/\.png$/i.test(e)?(temp=this.extractGraphModelFromPng(b),null!=temp?g(new LocalFile(this,temp,n,!0)):g(new LocalFile(this,b,e,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this, -function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(new LocalFile(this,a.responseText,n,!0)):null!=k&&k({message:mxResources.get("errorLoadingFile")}))}),e):g(new LocalFile(this,b,n,!0))}catch(h){null!=k&&k(h)}});d=/\.png$/i.test(e)||/\.jpe?g$/i.test(e)||null!=d&&"image/"==d.substring(0,6);l?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=g){a=JSON.parse(a.getText());var b=a.content;"base64"===a.encoding&&(b=/\.png$/i.test(e)?"data:image/png;base64,"+ -b:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b));c(b)}}else null!=k&&k({code:App.ERROR_UNKNOWN})}),function(){null!=k&&k({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=k&&k({code:App.ERROR_TIMEOUT,retry:fn})}):this.loadUrl(a,c,k,d)}}; +App.prototype.convertFile=function(a,e,d,b,g,k){var n=e;/\.svg$/i.test(n)||(n=n.substring(0,e.lastIndexOf("."))+b);var l=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(l=!0);if((/\.vsdx$/i.test(e)||/\.vsd$/i.test(e))&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var p=new XMLHttpRequest;p.open("GET",a,!0);l||(p.responseType="blob");p.onload=mxUtils.bind(this,function(){var a=null;l?(a=JSON.parse(p.responseText), +a=this.base64ToBlob(a.content,"application/octet-stream")):a=new Blob([p.response],{type:"application/octet-stream"});this.importVisio(a,mxUtils.bind(this,function(a){g(new LocalFile(this,a,n,!0))}),k,e)});p.send()}else{var c=mxUtils.bind(this,function(b){try{/\.png$/i.test(e)?(temp=this.extractGraphModelFromPng(b),null!=temp?g(new LocalFile(this,temp,n,!0)):g(new LocalFile(this,b,e,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}), +mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(new LocalFile(this,a.responseText,n,!0)):null!=k&&k({message:mxResources.get("errorLoadingFile")}))}),e):g(new LocalFile(this,b,n,!0))}catch(h){null!=k&&k(h)}});d=/\.png$/i.test(e)||/\.jpe?g$/i.test(e)||null!=d&&"image/"==d.substring(0,6);l?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=g){a=JSON.parse(a.getText());var b=a.content;"base64"===a.encoding&&(b=/\.png$/i.test(e)? +"data:image/png;base64,"+b:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b));c(b)}}else null!=k&&k({code:App.ERROR_UNKNOWN})}),function(){null!=k&&k({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=k&&k({code:App.ERROR_TIMEOUT,retry:fn})}):this.loadUrl(a,c,k,d)}}; App.prototype.updateHeader=function(){if(null!=this.menubar){this.appIcon=document.createElement("a");this.appIcon.style.display="block";this.appIcon.style.position="absolute";this.appIcon.style.width="40px";this.appIcon.style.backgroundColor="#f18808";this.appIcon.style.height=this.menubarHeight+"px";mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon,"click",mxUtils.bind(this,function(a){this.appIconClicked(a)}));var a=mxClient.IS_SVG?"url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIKICAgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzA2LjE4NSAxMjAuMjk2IgogICB2aWV3Qm94PSIyNCAyNiA2OCA2OCIKICAgeT0iMHB4IgogICB4PSIwcHgiCiAgIHZlcnNpb249IjEuMSI+CiAgIAkgPGc+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNDEuMDYxIgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjkiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTUyOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNzUuMDc2IgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjgiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTAwOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGc+PHBhdGgKICAgICAgICAgZD0iTTUyLjc3Myw3Ny4wODRjMCwxLjk1NC0xLjU5OSwzLjU1My0zLjU1MywzLjU1M0gzNi45OTljLTEuOTU0LDAtMy41NTMtMS41OTktMy41NTMtMy41NTN2LTkuMzc5ICAgIGMwLTEuOTU0LDEuNTk5LTMuNTUzLDMuNTUzLTMuNTUzaDEyLjIyMmMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjc3LjA4NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnCiAgICAgICBpZD0iZzM0MTkiPjxwYXRoCiAgICAgICAgIGQ9Ik02Ny43NjIsNDguMDc0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINTEuOTg4Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M0g2NC4yMWMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjQ4LjA3NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnPjxwYXRoCiAgICAgICAgIGQ9Ik04Mi43NTIsNzcuMDg0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINjYuOTc3Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M2gxMi4yMjJjMS45NTQsMCwzLjU1MywxLjU5OSwzLjU1MywzLjU1M1Y3Ny4wODR6IgogICAgICAgICBmaWxsPSIjRkZGRkZGIiAvPjwvZz48L2c+PC9zdmc+)": "url('"+IMAGE_PATH+"/logo-white.png')";this.appIcon.style.backgroundImage=a;this.appIcon.style.backgroundPosition="center center";this.appIcon.style.backgroundRepeat="no-repeat";mxUtils.setPrefixedStyle(this.appIcon.style,"transition","all 125ms linear");mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&(a=a.getMode(),a==App.MODE_GOOGLE?this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/google-drive-logo-white.svg)":a==App.MODE_DROPBOX? this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/dropbox-logo-white.svg)":a==App.MODE_ONEDRIVE?this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/onedrive-logo-white.svg)":a==App.MODE_GITHUB?this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/github-logo-white.svg)":a==App.MODE_TRELLO&&(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/trello-logo-white-orange.svg)"))}));mxEvent.addListener(this.appIcon,"mouseout",mxUtils.bind(this,function(){this.appIcon.style.backgroundImage=a})); diff --git a/src/main/webapp/js/diagramly/App.js b/src/main/webapp/js/diagramly/App.js index 4a753f6d9598894d45aeb8130d9a1c6abdf0feb0..469380259102427e33d07664ee3caf9cfbe727a9 100644 --- a/src/main/webapp/js/diagramly/App.js +++ b/src/main/webapp/js/diagramly/App.js @@ -4306,8 +4306,8 @@ App.prototype.convertFile = function(url, filename, mimeType, extension, success gitHubUrl = true; } - // Workaround for wrong binary response with VSDX files - if (/\.vsdx$/i.test(filename) && Graph.fileSupport && new XMLHttpRequest().upload && + // Workaround for wrong binary response with VSDX/VSD files + if ((/\.vsdx$/i.test(filename) || /\.vsd$/i.test(filename)) && Graph.fileSupport && new XMLHttpRequest().upload && typeof new XMLHttpRequest().responseType === 'string') { var req = new XMLHttpRequest(); @@ -4335,7 +4335,7 @@ App.prototype.convertFile = function(url, filename, mimeType, extension, success this.importVisio(blob, mxUtils.bind(this, function(xml) { success(new LocalFile(this, xml, name, true)); - }), error) + }), error, filename) }); req.send(); diff --git a/src/main/webapp/js/diagramly/EditorUi.js b/src/main/webapp/js/diagramly/EditorUi.js index 52198d35ff406e60b85c0018a2055441a2808916..fb8d63709d8b224b19cd07fe5c31a37faccaa789 100644 --- a/src/main/webapp/js/diagramly/EditorUi.js +++ b/src/main/webapp/js/diagramly/EditorUi.js @@ -2156,12 +2156,12 @@ } }); - if (file != null && img != null && ((/(\.vsdx)($|\?)/i.test(img)) || /(\.vssx)($|\?)/i.test(img))) + if (file != null && img != null && ((/(\.vsdx)($|\?)/i.test(img)) || /(\.vssx)($|\?)/i.test(img) || (/(\.vsd)($|\?)/i.test(img)))) { this.importVisio(file, function(xml) { doImport(xml, 'text/xml'); - }); + }, null, img); } else if (!this.isOffline() && new XMLHttpRequest().upload && this.isRemoteFileFormat(data, img) && file != null) { @@ -2745,12 +2745,8 @@ { a.download = filename; } - else - { - // Workaround for same window in Safari - a.setAttribute('target', '_blank'); - } + a.setAttribute('target', '_blank'); document.body.appendChild(a); try @@ -5389,8 +5385,10 @@ /** * Imports the given Visio file */ - EditorUi.prototype.importVisio = function(file, done, onerror) + EditorUi.prototype.importVisio = function(file, done, onerror, filename) { + filename = (filename != null) ? filename : file.name; + onerror = (onerror != null) ? onerror : mxUtils.bind(this, function(e) { this.handleError(e); @@ -5402,13 +5400,47 @@ if (this.doImportVisio) { - try + if (/(\.vsd)($|\?)/i.test(filename)) { - this.doImportVisio(file, done, onerror); - } - catch (e) - { - onerror(e); + var formData = new FormData(); + formData.append("file1", file); + + var xhr = new XMLHttpRequest(); + xhr.open('POST', VSD_CONVERT_URL); + xhr.responseType = "blob"; + + xhr.onreadystatechange = mxUtils.bind(this, function() + { + if (xhr.readyState == 4) + { + if (xhr.status >= 200 && xhr.status <= 299) + { + try + { + this.doImportVisio(xhr.response, done, onerror); + } + catch (e) + { + onerror(e); + } + } + else + { + onerror({}); + } + } + }); + + xhr.send(formData); + } else { + try + { + this.doImportVisio(file, done, onerror); + } + catch (e) + { + onerror(e); + } } } }); @@ -5874,7 +5906,11 @@ } })); } - else if (file != null && filename != null && ((/(\.vsdx)($|\?)/i.test(filename)) || /(\.vssx)($|\?)/i.test(filename))) +// else if (file != null && filename != null && ((/(\.vsdx)($|\?)/i.test(filename)) || /(\.vssx)($|\?)/i.test(filename) || /(\.vsd)($|\?)/i.test(filename))) +// { +// +// } + else if (file != null && filename != null && ((/(\.vsdx)($|\?)/i.test(filename)) || /(\.vssx)($|\?)/i.test(filename) || /(\.vsd)($|\?)/i.test(filename))) { // LATER: done and async are a hack before making this asynchronous async = true; @@ -6282,7 +6318,7 @@ }); // Handles special cases - if (/(\.vsdx)($|\?)/i.test(file.name) || /(\.vssx)($|\?)/i.test(file.name)) + if (/(\.vsdx)($|\?)/i.test(file.name) || /(\.vssx)($|\?)/i.test(file.name) || /(\.vsd)($|\?)/i.test(file.name)) { fn(null, file.type, x + index * gs, y + index * gs, 240, 160, file.name, function(cells) { @@ -8091,7 +8127,7 @@ } }); - if (/(\.vsdx)($|\?)/i.test(name) || /(\.vssx)($|\?)/i.test(name)) + if (/(\.vsdx)($|\?)/i.test(name) || /(\.vssx)($|\?)/i.test(name) || /(\.vsd)($|\?)/i.test(name)) { this.importVisio(file, mxUtils.bind(this, function(xml) { diff --git a/src/main/webapp/js/diagramly/Init.js b/src/main/webapp/js/diagramly/Init.js index 3e1f4c8beb53e3a215840f3605fbb8d8325004e7..c1b60ebfebc035c0aced4243423c09bfd9a4edbc 100644 --- a/src/main/webapp/js/diagramly/Init.js +++ b/src/main/webapp/js/diagramly/Init.js @@ -9,6 +9,7 @@ window.isSvgBrowser = window.isSvgBrowser || (navigator.userAgent.indexOf('MSIE' // CUSTOM_PARAMETERS - URLs for save and export window.EXPORT_URL = window.EXPORT_URL || 'https://exp.draw.io/ImageExport4/export'; +window.VSD_CONVERT_URL = window.VSD_CONVERT_URL || "https://convert.draw.io/VsdConverter/api/converter"; window.SAVE_URL = window.SAVE_URL || 'save'; window.OPEN_URL = window.OPEN_URL || 'open'; window.PROXY_URL = window.PROXY_URL || 'proxy'; diff --git a/src/main/webapp/js/embed-static.min.js b/src/main/webapp/js/embed-static.min.js index c506a862a798b9c1a951ac025fe758c6d8e68e33..d7b59c10eecb2e2c4509aa68f1c8cd10f618ecd0 100644 --- a/src/main/webapp/js/embed-static.min.js +++ b/src/main/webapp/js/embed-static.min.js @@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})}); "function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images"; -window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.5.2",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& +window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.5.3",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& 0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=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."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&& 0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=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."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")|| diff --git a/src/main/webapp/js/reader.min.js b/src/main/webapp/js/reader.min.js index 10b380b5865816b6ebc679b5d0aef033cd5093d0..ac5dd0deb1588a22035b7f15f39d35f1b978b9ec 100644 --- a/src/main/webapp/js/reader.min.js +++ b/src/main/webapp/js/reader.min.js @@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})}); "function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images"; -window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.5.2",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& +window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.5.3",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& 0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=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."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&& 0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=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."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")|| diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js index 76ee129a719899f86d2b2133c0364f3d19f2413a..c588f123dc01ebc03a1688569bce11aca26ca3a6 100644 --- a/src/main/webapp/js/viewer.min.js +++ b/src/main/webapp/js/viewer.min.js @@ -97,9 +97,9 @@ ea;m.wa=m.normalizeRCData=e;m.xa=m.sanitize=function(a,b,d,e){return Q(a,ea(b,d, l--,_+=n[s++]<<u,u+=8}if(a.nlen=(31&_)+257,_>>>=5,u-=5,a.ndist=(31&_)+1,_>>>=5,u-=5,a.ncode=(15&_)+4,_>>>=4,u-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=_t;break}a.have=0,a.mode=tt;case tt:for(;a.have<a.ncode;){for(;u<3;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.lens[At[a.have++]]=7&_,_>>>=3,u-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=y(x,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=_t;break}a.have=0,a.mode=et;case et:for(;a.have<a.nlen+a.ndist;){for(;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(wt<16)_>>>=gt,u-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_>>>=gt,u-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=_t;break}yt=a.lens[a.have-1],g=3+(3&_),_>>>=2,u-=2}else if(17===wt){for(Bt=gt+3;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=3+(7&_),_>>>=3,u-=3}else{for(Bt=gt+7;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=11+(127&_),_>>>=7,u-=7}if(a.have+g>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=_t;break}for(;g--;)a.lens[a.have++]=yt}}if(a.mode===_t)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=_t;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=y(z,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=_t;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=y(B,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=_t;break}if(a.mode=at,e===A)break t;case at:a.mode=it;case it:if(l>=6&&h>=258){t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,k(t,b),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,a.mode===X&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(mt&&0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.lencode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=lt;break}if(32&mt){a.back=-1,a.mode=X;break}if(64&mt){t.msg="invalid literal/length code",a.mode=_t;break}a.extra=15&mt,a.mode=nt;case nt:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.length+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=rt;case rt:for(;St=a.distcode[_&(1<<a.distbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.distcode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=_t;break}a.offset=wt,a.extra=15&mt,a.mode=st;case st:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.offset+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=_t;break}a.mode=ot;case ot:if(0===h)break t;if(g=b-h,a.offset>g){if(g=a.offset-g,g>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=_t;break}g>a.wnext?(g-=a.wnext,m=a.wsize-g):m=a.wnext-g,g>a.length&&(g=a.length),bt=a.window}else bt=r,m=o-a.offset,g=a.length;g>h&&(g=h),h-=g,a.length-=g;do r[o++]=bt[m++];while(--g);0===a.length&&(a.mode=it);break;case lt:if(0===h)break t;r[o++]=a.length,h--,a.mode=it;break;case ht:if(a.wrap){for(;u<32;){if(0===l)break t;l--,_|=n[s++]<<u,u+=8}if(b-=h,t.total_out+=b,a.total+=b,b&&(t.adler=a.check=a.flags?v(a.check,r,b,o-b):p(a.check,r,b,o-b)),b=h,(a.flags?_:i(_))!==a.check){t.msg="incorrect data check",a.mode=_t;break}_=0,u=0}a.mode=dt;case dt:if(a.wrap&&a.flags){for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=_t;break}_=0,u=0}a.mode=ft;case ft:xt=R;break t;case _t:xt=O;break t;case ut:return D;case ct:default:return N}return t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,(a.wsize||b!==t.avail_out&&a.mode<_t&&(a.mode<ht||e!==S))&&f(t,t.output,t.next_out,b-t.avail_out)?(a.mode=ut,D):(c-=t.avail_in,b-=t.avail_out,t.total_in+=c,t.total_out+=b,a.total+=b,a.wrap&&b&&(t.adler=a.check=a.flags?v(a.check,r,b,t.next_out-b):p(a.check,r,b,t.next_out-b)),t.data_type=a.bits+(a.last?64:0)+(a.mode===X?128:0)+(a.mode===at||a.mode===Q?256:0),(0===c&&0===b||e===S)&&xt===Z&&(xt=I),xt)}function u(t){if(!t||!t.state)return N;var e=t.state;return e.window&&(e.window=null),t.state=null,Z}function c(t,e){var a;return t&&t.state?(a=t.state,0===(2&a.wrap)?N:(a.head=e,e.done=!1,Z)):N}function b(t,e){var a,i,n,r=e.length;return t&&t.state?(a=t.state,0!==a.wrap&&a.mode!==G?N:a.mode===G&&(i=1,i=p(i,e,r,0),i!==a.check)?O:(n=f(t,e,r,r))?(a.mode=ut,D):(a.havedict=1,Z)):N}var g,m,w=t("../utils/common"),p=t("./adler32"),v=t("./crc32"),k=t("./inffast"),y=t("./inftrees"),x=0,z=1,B=2,S=4,E=5,A=6,Z=0,R=1,C=2,N=-2,O=-3,D=-4,I=-5,U=8,T=1,F=2,L=3,H=4,j=5,K=6,M=7,P=8,Y=9,q=10,G=11,X=12,W=13,J=14,Q=15,V=16,$=17,tt=18,et=19,at=20,it=21,nt=22,rt=23,st=24,ot=25,lt=26,ht=27,dt=28,ft=29,_t=30,ut=31,ct=32,bt=852,gt=592,mt=15,wt=mt,pt=!0;a.inflateReset=s,a.inflateReset2=o,a.inflateResetKeep=r,a.inflateInit=h,a.inflateInit2=l,a.inflate=_,a.inflateEnd=u,a.inflateGetHeader=c,a.inflateSetDictionary=b,a.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(t,e,a){"use strict";var i=t("../utils/common"),n=15,r=852,s=592,o=0,l=1,h=2,d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],_=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,a,c,b,g,m,w){var p,v,k,y,x,z,B,S,E,A=w.bits,Z=0,R=0,C=0,N=0,O=0,D=0,I=0,U=0,T=0,F=0,L=null,H=0,j=new i.Buf16(n+1),K=new i.Buf16(n+1),M=null,P=0;for(Z=0;Z<=n;Z++)j[Z]=0;for(R=0;R<c;R++)j[e[a+R]]++;for(O=A,N=n;N>=1&&0===j[N];N--);if(O>N&&(O=N),0===N)return b[g++]=20971520,b[g++]=20971520,w.bits=1,0;for(C=1;C<N&&0===j[C];C++);for(O<C&&(O=C),U=1,Z=1;Z<=n;Z++)if(U<<=1,U-=j[Z],U<0)return-1;if(U>0&&(t===o||1!==N))return-1;for(K[1]=0,Z=1;Z<n;Z++)K[Z+1]=K[Z]+j[Z];for(R=0;R<c;R++)0!==e[a+R]&&(m[K[e[a+R]]++]=R);if(t===o?(L=M=m,z=19):t===l?(L=d,H-=257,M=f,P-=257,z=256):(L=_,M=u,z=-1),F=0,R=0,Z=C,x=g,D=O,I=0,k=-1,T=1<<O,y=T-1,t===l&&T>r||t===h&&T>s)return 1;for(var Y=0;;){Y++,B=Z-I,m[R]<z?(S=0,E=m[R]):m[R]>z?(S=M[P+m[R]],E=L[H+m[R]]):(S=96,E=0),p=1<<Z-I,v=1<<D,C=v;do v-=p,b[x+(F>>I)+v]=B<<24|S<<16|E|0;while(0!==v);for(p=1<<Z-1;F&p;)p>>=1;if(0!==p?(F&=p-1,F+=p):F=0,R++,0===--j[Z]){if(Z===N)break;Z=e[a+m[R]]}if(Z>O&&(F&y)!==k){for(0===I&&(I=O),x+=C,D=Z-I,U=1<<D;D+I<N&&(U-=j[D+I],!(U<=0));)D++,U<<=1;if(T+=1<<D,t===l&&T>r||t===h&&T>s)return 1;k=F&y,b[k]=O<<24|D<<16|x-g|0}}return 0!==F&&(b[x+F]=Z-I<<24|64<<16|0),w.bits=O,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?lt[t]:lt[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>W-a?(t.bi_buf|=e<<t.bi_valid&65535,o(t,t.bi_buf),t.bi_buf=e>>W-t.bi_valid,t.bi_valid+=a-W):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)}function h(t,e,a){l(t,a[2*e],a[2*e+1])}function d(t,e){var a=0;do a|=1&t,t>>>=1,a<<=1;while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=X;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<G;a++)i=t.heap[a],r=l[2*l[2*i+1]+1]+1,r>c&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)n=t.heap[--a],n>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(X+1),s=0;for(i=1;i<=X;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(X+1);for(a=0,i=0;i<K-1;i++)for(dt[i]=a,t=0;t<1<<et[i];t++)ht[a++]=i;for(ht[a-1]=i,r=0,i=0;i<16;i++)for(ft[i]=r,t=0;t<1<<at[i];t++)lt[r++]=i;for(r>>=7;i<Y;i++)for(ft[i]=r<<7,t=0;t<1<<at[i]-7;t++)lt[256+r++]=i;for(e=0;e<=X;e++)s[e]=0;for(t=0;t<=143;)st[2*t+1]=8,t++,s[8]++;for(;t<=255;)st[2*t+1]=9,t++,s[9]++;for(;t<=279;)st[2*t+1]=7,t++,s[7]++;for(;t<=287;)st[2*t+1]=8,t++,s[8]++;for(u(st,P+1,s),t=0;t<Y;t++)ot[2*t+1]=5,ot[2*t]=d(t,5);_t=new n(st,et,M+1,P,X),ut=new n(ot,at,0,Y,X),ct=new n(new Array(0),it,0,q,J)}function b(t){var e;for(e=0;e<P;e++)t.dyn_ltree[2*e]=0;for(e=0;e<Y;e++)t.dyn_dtree[2*e]=0;for(e=0;e<q;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*Q]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function g(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),N.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]<t[r]||t[n]===t[r]&&i[e]<=i[a]}function p(t,e,a){for(var i=t.heap[a],n=a<<1;n<=t.heap_len&&(n<t.heap_len&&w(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!w(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i}function v(t,e,a){var i,n,r,o,d=0;if(0!==t.last_lit)do i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],n=t.pending_buf[t.l_buf+d],d++,0===i?h(t,n,e):(r=ht[n],h(t,r+M+1,e),o=et[r],0!==o&&(n-=dt[r],l(t,n,o)),i--,r=s(i),h(t,r,a),o=at[r],0!==o&&(i-=ft[r],l(t,i,o)));while(d<t.last_lit);h(t,Q,e)}function k(t,e){var a,i,n,r=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=G,a=0;a<l;a++)0!==r[2*a]?(t.heap[++t.heap_len]=h=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)n=t.heap[++t.heap_len]=h<2?++h:0,r[2*n]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=s[2*n+1]);for(e.max_code=h,a=t.heap_len>>1;a>=1;a--)p(t,r,a);n=l;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o<l&&n===s||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[2*V]++):o<=10?t.bl_tree[2*$]++:t.bl_tree[2*tt]++,o=0,r=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4))}function x(t,e,a){var i,n,r=-1,s=e[1],o=0,d=7,f=4;for(0===s&&(d=138,f=3),i=0;i<=a;i++)if(n=s,s=e[2*(i+1)+1],!(++o<d&&n===s)){if(o<f){do h(t,n,t.bl_tree);while(0!==--o)}else 0!==n?(n!==r&&(h(t,n,t.bl_tree),o--),h(t,V,t.bl_tree),l(t,o-3,2)):o<=10?(h(t,$,t.bl_tree),l(t,o-3,3)):(h(t,tt,t.bl_tree),l(t,o-11,7));o=0,r=n,0===s?(d=138,f=3):n===s?(d=6,f=3):(d=7,f=4)}}function z(t){var e;for(y(t,t.dyn_ltree,t.l_desc.max_code),y(t,t.dyn_dtree,t.d_desc.max_code),k(t,t.bl_desc),e=q-1;e>=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n<i;n++)l(t,t.bl_tree[2*nt[n]+1],3);x(t,t.dyn_ltree,e-1),x(t,t.dyn_dtree,a-1)}function S(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return D;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return I;for(e=32;e<M;e++)if(0!==t.dyn_ltree[2*e])return I;return D}function E(t){bt||(c(),bt=!0),t.l_desc=new r(t.dyn_ltree,_t),t.d_desc=new r(t.dyn_dtree,ut),t.bl_desc=new r(t.bl_tree,ct),t.bi_buf=0,t.bi_valid=0,b(t)}function A(t,e,a,i){l(t,(T<<1)+(i?1:0),3),m(t,e,a,!0)}function Z(t){l(t,F<<1,3),h(t,Q,st),f(t)}function R(t,e,a,i){var n,r,s=0;t.level>0?(t.strm.data_type===U&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=n&&(n=r)):n=r=a+5,a+4<=n&&e!==-1?A(t,e,a,i):t.strategy===O||r===n?(l(t,(F<<1)+(i?1:0),3),v(t,st,ot)):(l(t,(L<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)}function C(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(ht[a]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var N=t("../utils/common"),O=4,D=0,I=1,U=2,T=0,F=1,L=2,H=3,j=258,K=29,M=256,P=M+1+K,Y=30,q=19,G=2*P+1,X=15,W=16,J=7,Q=256,V=16,$=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],at=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,st=new Array(2*(P+2));i(st);var ot=new Array(2*Y);i(ot);var lt=new Array(rt);i(lt);var ht=new Array(j-H+1);i(ht);var dt=new Array(K);i(dt);var ft=new Array(Y);i(ft);var _t,ut,ct,bt=!1;a._tr_init=E,a._tr_stored_block=A,a._tr_flush_block=R,a._tr_tally=C,a._tr_align=Z},{"../utils/common":3}],15:[function(t,e,a){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=i},{}],"/":[function(t,e,a){"use strict";var i=t("./lib/utils/common").assign,n=t("./lib/deflate"),r=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};i(o,n,r,s),e.exports=o},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")}); var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a,b){var c="",d,e,f,g,k,l,m=0;for(null!=b&&b||(a=Base64._utf8_encode(a));m<a.length;)d=a.charCodeAt(m++),e=a.charCodeAt(m++),f=a.charCodeAt(m++),g=d>>2,d=(d&3)<<4|e>>4,k=(e&15)<<2|f>>6,l=f&63,isNaN(e)?k=l=64:isNaN(f)&&(l=64),c=c+this._keyStr.charAt(g)+this._keyStr.charAt(d)+this._keyStr.charAt(k)+this._keyStr.charAt(l);return c},decode:function(a,b){b=null!=b?b:!1;var c="",d,e,f,g,k,l=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g, "");l<a.length;)d=this._keyStr.indexOf(a.charAt(l++)),e=this._keyStr.indexOf(a.charAt(l++)),g=this._keyStr.indexOf(a.charAt(l++)),k=this._keyStr.indexOf(a.charAt(l++)),d=d<<2|e>>4,e=(e&15)<<4|g>>2,f=(g&3)<<6|k,c+=String.fromCharCode(d),64!=g&&(c+=String.fromCharCode(e)),64!=k&&(c+=String.fromCharCode(f));b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):(127<d&&2048>d?b+= -String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0,d;for(c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"open";window.PROXY_URL=window.PROXY_URL||"proxy";window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img"; -window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":"https://www.draw.io/iconSearch");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.mxLoadResources=window.mxLoadResources||!1; -window.mxLanguage=window.mxLanguage||function(){var a="1"==urlParams.offline?"en":urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null)}catch(c){isLocalStorage=!1}return a}(); +String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0,d;for(c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.VSD_CONVERT_URL=window.VSD_CONVERT_URL||"https://convert.draw.io/VsdConverter/api/converter";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"open";window.PROXY_URL=window.PROXY_URL||"proxy"; +window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img";window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":"https://www.draw.io/iconSearch");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia"; +window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||function(){var a="1"==urlParams.offline?"en":urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null)}catch(c){isLocalStorage=!1}return a}(); window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Bahasa Melayu",bs:"Bosanski",bg:"Bulgarian",ca:"Català ",cs:"ÄŒeÅ¡tina",da:"Dansk",de:"Deutsch",et:"Eesti",en:"English",es:"Español",fil:"Filipino",fr:"Français",it:"Italiano",hu:"Magyar",nl:"Nederlands",no:"Norsk",pl:"Polski","pt-br":"Português (Brasil)",pt:"Português (Portugal)",ro:"Română",fi:"Suomi",sv:"Svenska",vi:"Tiếng Việt",tr:"Türkçe",el:"Ελληνικά",ru:"РуÑÑкий",sr:"СрпÑки",uk:"УкраїнÑька",he:"עברית",ar:"العربية",th:"ไทย", ko:"í•œêµì–´",ja:"日本語",zh:"ä¸æ–‡ï¼ˆä¸å›½ï¼‰","zh-tw":"ä¸æ–‡ï¼ˆå°ç£ï¼‰"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph");if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang)}window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}return a}(); function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)} @@ -2053,11 +2053,11 @@ b.substring(0,b.length-1));h.toolbar.setFontName(b);h.toolbar.setFontSize(parseI if(window.self===window.top&&null!=c.container.parentNode)try{c.container.focus()}catch(F){}var v=c.fireMouseEvent;c.fireMouseEvent=function(a,d,c){a==mxEvent.MOUSE_DOWN&&this.container.focus();v.apply(this,arguments)};c.popupMenuHandler.autoExpand=!0;null!=this.menus&&(c.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,d,c){this.menus.createPopupMenu(a,d,c)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){c.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(a); this.getKeyHandler=function(){return keyHandler};var r="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),A="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var d=c.view.getState(a);if(null!=d){a=a.clone();a.style="";a=c.getCellStyle(a);var b=[],f=[],g;for(g in d.style)a[g]!=d.style[g]&&(b.push(d.style[g]),f.push(g));g=c.getModel().getStyle(d.cell);for(var e=null!=g?g.split(";"):[],p=0;p<e.length;p++){var h=e[p], m=h.indexOf("=");0<=m&&(g=h.substring(0,m),h=h.substring(m+1),null!=a[g]&&"none"==h&&(b.push(h),f.push(g)))}c.getModel().isEdge(d.cell)?c.currentEdgeStyle={}:c.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",b,"cells",[d.cell]))}};this.clearDefaultStyle=function(){c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var C= -["fontFamily","fontSize","fontColor"],y="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),z=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],C,["align"],["html"]];for(a=0;a<z.length;a++)for(b=0;b<z[a].length;b++)r.push(z[a][b]);for(a=0;a<A.length;a++)0>mxUtils.indexOf(r,A[a])&&r.push(A[a]);var B=function(a,d){var b=c.getModel();b.beginUpdate(); -try{if(d)for(var f=b.isEdge(h),g=f?c.currentEdgeStyle:c.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var p=g[f[e]];null!=p&&c.setCellStyles(f[e],p,a)}else for(p=0;p<a.length;p++){for(var h=a[p],m=b.getStyle(h),u=null!=m?m.split(";"):[],G=r.slice(),e=0;e<u.length;e++){var v=u[e],k=v.indexOf("=");if(0<=k){var w=v.substring(0,k),q=mxUtils.indexOf(G,w);0<=q&&G.splice(q,1);for(var y=0;y<z.length;y++){var l=z[y];if(0<=mxUtils.indexOf(l,w))for(var n=0;n<l.length;n++){var C= -mxUtils.indexOf(G,l[n]);0<=C&&G.splice(C,1)}}}}for(var g=(f=b.isEdge(h))?c.currentEdgeStyle:c.currentVertexStyle,t=b.getStyle(h),e=0;e<G.length;e++){var w=G[e],F=g[w];null==F||"shape"==w&&!f||f&&!(0>mxUtils.indexOf(A,w))||(t=mxUtils.setStyle(t,w,F))}b.setStyle(h,t)}}finally{b.endUpdate()}};c.addListener("cellsInserted",function(a,d){B(d.getProperty("cells"))});c.addListener("textInserted",function(a,d){B(d.getProperty("cells"),!0)});c.connectionHandler.addListener(mxEvent.CONNECT,function(a,d){var b= -[d.getProperty("cell")];d.getProperty("terminalInserted")&&b.push(d.getProperty("terminal"));B(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,d){var b=d.getProperty("cells"),f=!1,g=!1;if(0<b.length)for(var e=0;e<b.length&&(f=c.getModel().isVertex(b[e])||f,!(g=c.getModel().isEdge(b[e])||g)||!f);e++);else g=f=!0;for(var b=d.getProperty("keys"),p=d.getProperty("values"),e=0;e<b.length;e++){var h=0<=mxUtils.indexOf(C,b[e]);if("strokeColor"!=b[e]||null!=p[e]&&"none"!=p[e])if(0<=mxUtils.indexOf(A, -b[e]))g||0<=mxUtils.indexOf(y,b[e])?null==p[e]?delete c.currentEdgeStyle[b[e]]:c.currentEdgeStyle[b[e]]=p[e]:f&&0<=mxUtils.indexOf(r,b[e])&&(null==p[e]?delete c.currentVertexStyle[b[e]]:c.currentVertexStyle[b[e]]=p[e]);else if(0<=mxUtils.indexOf(r,b[e])){if(f||h)null==p[e]?delete c.currentVertexStyle[b[e]]:c.currentVertexStyle[b[e]]=p[e];if(g||h||0<=mxUtils.indexOf(y,b[e]))null==p[e]?delete c.currentEdgeStyle[b[e]]:c.currentEdgeStyle[b[e]]=p[e]}}null!=this.toolbar&&(this.toolbar.setFontName(c.currentVertexStyle.fontFamily|| +["fontFamily","fontSize","fontColor"],x="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),z=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],C,["align"],["html"]];for(a=0;a<z.length;a++)for(b=0;b<z[a].length;b++)r.push(z[a][b]);for(a=0;a<A.length;a++)0>mxUtils.indexOf(r,A[a])&&r.push(A[a]);var B=function(a,d){var b=c.getModel();b.beginUpdate(); +try{if(d)for(var f=b.isEdge(p),g=f?c.currentEdgeStyle:c.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var h=g[f[e]];null!=h&&c.setCellStyles(f[e],h,a)}else for(h=0;h<a.length;h++){for(var p=a[h],m=b.getStyle(p),u=null!=m?m.split(";"):[],G=r.slice(),e=0;e<u.length;e++){var v=u[e],k=v.indexOf("=");if(0<=k){var w=v.substring(0,k),q=mxUtils.indexOf(G,w);0<=q&&G.splice(q,1);for(var x=0;x<z.length;x++){var l=z[x];if(0<=mxUtils.indexOf(l,w))for(var n=0;n<l.length;n++){var C= +mxUtils.indexOf(G,l[n]);0<=C&&G.splice(C,1)}}}}for(var g=(f=b.isEdge(p))?c.currentEdgeStyle:c.currentVertexStyle,t=b.getStyle(p),e=0;e<G.length;e++){var w=G[e],F=g[w];null==F||"shape"==w&&!f||f&&!(0>mxUtils.indexOf(A,w))||(t=mxUtils.setStyle(t,w,F))}b.setStyle(p,t)}}finally{b.endUpdate()}};c.addListener("cellsInserted",function(a,d){B(d.getProperty("cells"))});c.addListener("textInserted",function(a,d){B(d.getProperty("cells"),!0)});c.connectionHandler.addListener(mxEvent.CONNECT,function(a,d){var b= +[d.getProperty("cell")];d.getProperty("terminalInserted")&&b.push(d.getProperty("terminal"));B(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,d){var b=d.getProperty("cells"),f=!1,g=!1;if(0<b.length)for(var e=0;e<b.length&&(f=c.getModel().isVertex(b[e])||f,!(g=c.getModel().isEdge(b[e])||g)||!f);e++);else g=f=!0;for(var b=d.getProperty("keys"),h=d.getProperty("values"),e=0;e<b.length;e++){var p=0<=mxUtils.indexOf(C,b[e]);if("strokeColor"!=b[e]||null!=h[e]&&"none"!=h[e])if(0<=mxUtils.indexOf(A, +b[e]))g||0<=mxUtils.indexOf(x,b[e])?null==h[e]?delete c.currentEdgeStyle[b[e]]:c.currentEdgeStyle[b[e]]=h[e]:f&&0<=mxUtils.indexOf(r,b[e])&&(null==h[e]?delete c.currentVertexStyle[b[e]]:c.currentVertexStyle[b[e]]=h[e]);else if(0<=mxUtils.indexOf(r,b[e])){if(f||p)null==h[e]?delete c.currentVertexStyle[b[e]]:c.currentVertexStyle[b[e]]=h[e];if(g||p||0<=mxUtils.indexOf(x,b[e]))null==h[e]?delete c.currentEdgeStyle[b[e]]:c.currentEdgeStyle[b[e]]=h[e]}}null!=this.toolbar&&(this.toolbar.setFontName(c.currentVertexStyle.fontFamily|| Menus.prototype.defaultFont),this.toolbar.setFontSize(c.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==c.currentEdgeStyle.edgeStyle&&"1"==c.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==c.currentEdgeStyle.edgeStyle||"none"==c.currentEdgeStyle.edgeStyle||null==c.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"== c.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==c.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==c.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==c.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==c.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==c.currentEdgeStyle.shape? "geSprite geSprite-linkedge":"flexArrow"==c.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==c.currentEdgeStyle.shape?"geSprite geSprite-simplearrow":"geSprite geSprite-connection"),null!=this.toolbar.lineStartMenu&&(this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",c.currentEdgeStyle.shape,c.currentEdgeStyle[mxConstants.STYLE_STARTARROW],mxUtils.getValue(c.currentEdgeStyle,"startFill","1"))),null!=this.toolbar.lineEndMenu&&(this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className= @@ -2079,9 +2079,9 @@ EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,b= EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipboard.cut=function(c){c.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):b.apply(this,arguments);a.updatePasteActionStates()};var e=mxClipboard.copy;mxClipboard.copy=function(b){b.cellEditor.isContentEditing()?document.execCommand("copy",!1,null):e.apply(this,arguments);a.updatePasteActionStates()};var c=mxClipboard.paste;mxClipboard.paste=function(b){var e=null;b.cellEditor.isContentEditing()?document.execCommand("paste", !1,null):e=c.apply(this,arguments);a.updatePasteActionStates();return e};var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);a.updatePasteActionStates()};var l=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,c){l.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()}; EditorUi.prototype.initCanvas=function(){var a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var a=this.graph.getPageLayout(),d=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*d.width),this.scale*(this.translate.y+a.y*d.height),this.scale*a.width*d.width, -this.scale*a.height*d.height)};a.getPreferredPageSize=function(a,d,b){a=this.getPageLayout();d=this.getPageSize();return new mxRectangle(0,0,a.width*d.width,a.height*d.height)};var b=null,e=this;if(this.editor.chromeless){this.chromelessResize=b=mxUtils.bind(this,function(d,b,c,f){if(null!=a.container){c=null!=c?c:0;f=null!=f?f:0;var g=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),p=a.view.translate,h=a.view.scale,m=mxRectangle.fromRectangle(g); -m.x=m.x/h-p.x;m.y=m.y/h-p.y;m.width/=h;m.height/=h;var p=a.container.scrollTop,u=a.container.scrollLeft,r=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)r+=3;var v=a.container.offsetWidth-r,r=a.container.offsetHeight-r;d=d?Math.max(.3,Math.min(b||1,v/m.width)):h;b=(v-d*m.width)/2/d;var k=0==this.lightboxVerticalDivider?0:(r-d*m.height)/this.lightboxVerticalDivider/d;e&&(b=Math.max(b,0),k=Math.max(k,0));if(e||g.width<v||g.height<r)a.view.scaleAndTranslate(d, -Math.floor(b-m.x),Math.floor(k-m.y)),a.container.scrollTop=p*d/h,a.container.scrollLeft=u*d/h;else if(0!=c||0!=f)g=a.view.translate,a.view.setTranslate(Math.floor(g.x+c/h),Math.floor(g.y+f/h))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var c=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",c);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",c)});this.editor.addListener("resetGraphView", +this.scale*a.height*d.height)};a.getPreferredPageSize=function(a,d,b){a=this.getPageLayout();d=this.getPageSize();return new mxRectangle(0,0,a.width*d.width,a.height*d.height)};var b=null,e=this;if(this.editor.chromeless){this.chromelessResize=b=mxUtils.bind(this,function(d,b,c,f){if(null!=a.container){c=null!=c?c:0;f=null!=f?f:0;var g=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),h=a.view.translate,p=a.view.scale,m=mxRectangle.fromRectangle(g); +m.x=m.x/p-h.x;m.y=m.y/p-h.y;m.width/=p;m.height/=p;var h=a.container.scrollTop,u=a.container.scrollLeft,r=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)r+=3;var v=a.container.offsetWidth-r,r=a.container.offsetHeight-r;d=d?Math.max(.3,Math.min(b||1,v/m.width)):p;b=(v-d*m.width)/2/d;var k=0==this.lightboxVerticalDivider?0:(r-d*m.height)/this.lightboxVerticalDivider/d;e&&(b=Math.max(b,0),k=Math.max(k,0));if(e||g.width<v||g.height<r)a.view.scaleAndTranslate(d, +Math.floor(b-m.x),Math.floor(k-m.y)),a.container.scrollTop=h*d/p,a.container.scrollLeft=u*d/p;else if(0!=c||0!=f)g=a.view.translate,a.view.setTranslate(Math.floor(g.x+c/p),Math.floor(g.y+f/p))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var c=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",c);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",c)});this.editor.addListener("resetGraphView", mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(d){a.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(d){a.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace= "nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var k=mxUtils.bind(this,function(){var d=mxUtils.getCurrentStyle(a.container);this.chromelessToolbar.style.bottom=(null!=d?parseInt(d["margin-bottom"]|| 0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",k);k();var l=0,k=mxUtils.bind(this,function(a,d,b){l++;var c=document.createElement("span");c.style.paddingLeft="8px";c.style.paddingRight="8px";c.style.cursor="pointer";mxEvent.addListener(c,"click",a);null!=b&&c.setAttribute("title",b);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",d);c.appendChild(a);this.chromelessToolbar.appendChild(c); @@ -2195,7 +2195,7 @@ this.getRubberband=function(){return g};var p=(new Date).getTime(),m=0,h=this.co (r=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=r)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var A=this.click;this.click=function(a){var d=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);if(this.isEnabled()&&!d||a.isConsumed())return A.apply(this, arguments);d=d?a.sourceState.cell:a.getCell();if(null!=d){var b=this.getLinkForCell(d);null!=b&&(this.isPageLink(b)?this.pageLinkClicked(d,b):this.openLink(b))}};this.tooltipHandler.getStateForEvent=function(a){return a.sourceState};this.getCursorForMouseEvent=function(a){var d=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);return this.getCursorForCell(d?a.sourceState.cell:a.getCell())};var C=this.getCursorForCell;this.getCursorForCell=function(a){if(!this.isEnabled()|| this.isCellLocked(a)){if(null!=this.getLinkForCell(a))return"pointer";if(this.isCellLocked(a))return"default"}return C.apply(this,arguments)};this.selectRegion=function(a,d){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,d);return b};this.getAllCells=function(a,d,b,c,f,g){g=null!=g?g:[];if(0<b||0<c){var e=this.getModel(),h=a+b,p=d+c;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var m=e.getChildCount(f),G=0;G<m;G++){var r=e.getChildAt(f,G), -u=this.view.getState(r);if(null!=u&&this.isCellVisible(r)&&"1"!=mxUtils.getValue(u.style,"locked","0")){var v=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=v&&(u=mxUtils.getBoundingBox(u,v));(e.isEdge(r)||e.isVertex(r))&&u.x>=a&&u.y+u.height<=p&&u.y>=d&&u.x+u.width<=h&&g.push(r);this.getAllCells(a,d,b,c,r,g)}}}return g};var y=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,d,b){return this.graph.isCellSelected(a)?!1:y.apply(this, +u=this.view.getState(r);if(null!=u&&this.isCellVisible(r)&&"1"!=mxUtils.getValue(u.style,"locked","0")){var v=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=v&&(u=mxUtils.getBoundingBox(u,v));(e.isEdge(r)||e.isVertex(r))&&u.x>=a&&u.y+u.height<=p&&u.y>=d&&u.x+u.width<=h&&g.push(r);this.getAllCells(a,d,b,c,r,g)}}}return g};var x=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,d,b){return this.graph.isCellSelected(a)?!1:x.apply(this, arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var z=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,d){if("mouseDown"==d.getProperty("eventName")){var b=d.getProperty("event").getState();z=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD, mxUtils.bind(this,function(a,d){if(!mxEvent.isMultiTouchEvent(d)){var b=d.getProperty("event"),c=d.getProperty("cell");null==c?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),g.start(b.x,b.y)):null!=z?this.addSelectionCells(z):1<this.getSelectionCount()&&this.isCellSelected(c)&&this.removeSelectionCell(c);z=null;d.consume()}}));this.connectionHandler.selectCells=function(a,d){this.graph.setSelectionCell(d||a)};this.connectionHandler.constraintHandler.isStateIgnored= function(a,d){return d&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var B=this.updateMouseEvent;this.updateMouseEvent=function(a){a=B.apply(this,arguments);null!=a.state&&this.isCellLocked(a.getCell())&&(a.state= @@ -2289,8 +2289,8 @@ this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var d d.length-2&&mxUtils.ptSegDistSq(u.x,u.y,r.x,r.y,k.x,k.y)<1*this.scale*this.scale;)k=r,h++,r=d[h+2];for(var b=e(0,u.x,u.y)||b,q=0;q<this.validEdges.length;q++){var l=this.validEdges[q],n=l.absolutePoints;if(null!=n&&mxUtils.intersects(a,l)&&"1"!=l.style.noJump)for(l=0;l<n.length-1;l++){for(var t=n[l+1],B=n[l],r=n[l+2];l<n.length-2&&mxUtils.ptSegDistSq(B.x,B.y,r.x,r.y,t.x,t.y)<1*this.scale*this.scale;)t=r,l++,r=n[l+2];r=mxUtils.intersection(u.x,u.y,k.x,k.y,B.x,B.y,t.x,t.y);if(null!=r&&(Math.abs(r.x- B.x)>m||Math.abs(r.y-B.y)>m)&&(Math.abs(r.x-t.x)>m||Math.abs(r.y-t.y)>m)){t=r.x-u.x;B=r.y-u.y;r={distSq:t*t+B*B,x:r.x,y:r.y};for(t=0;t<v.length;t++)if(v[t].distSq>r.distSq){v.splice(t,0,r);r=null;break}null==r||0!=v.length&&v[v.length-1].x===r.x&&v[v.length-1].y===r.y||v.push(r)}}}for(l=0;l<v.length;l++)b=e(1,v[l].x,v[l].y)||b}r=d[d.length-1];b=e(0,r.x,r.y)||b}a.routedPoints=c;return b}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,d,b){this.routedPoints= null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,f=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),h,q=!0,u=null,v=null;h=[];var r=null;a.begin();for(var l=0;l<this.state.routedPoints.length;l++){var n= -this.state.routedPoints[l],y=new mxPoint(n.x/this.scale,n.y/this.scale);0==l?y=d[0]:l==this.state.routedPoints.length-1&&(y=d[d.length-1]);var t=!1;if(null!=u&&1==n.type){var B=this.state.routedPoints[l+1],n=B.x/this.scale-y.x,B=B.y/this.scale-y.y,n=n*n+B*B;null==r&&(r=new mxPoint(y.x-u.x,y.y-u.y),v=Math.sqrt(r.x*r.x+r.y*r.y),r.x=r.x*f/v,r.y=r.y*f/v);n>f*f&&0<v&&(n=u.x-y.x,B=u.y-y.y,n=n*n+B*B,n>f*f&&(t=new mxPoint(y.x-r.x,y.y-r.y),n=new mxPoint(y.x+r.x,y.y+r.y),h.push(t),this.addPoints(a,h,b,c,!1, -null,q),h=0>Math.round(r.x)||0==Math.round(r.x)&&0>=Math.round(r.y)?1:-1,q=!1,"sharp"==e?(a.lineTo(t.x-r.y*h,t.y+r.x*h),a.lineTo(n.x-r.y*h,n.y+r.x*h),a.lineTo(n.x,n.y)):"arc"==e?(h*=1.3,a.curveTo(t.x-r.y*h,t.y+r.x*h,n.x-r.y*h,n.y+r.x*h,n.x,n.y)):(a.moveTo(n.x,n.y),q=!0),h=[n],t=!0))}else r=null;t||(h.push(y),u=y)}this.addPoints(a,h,b,c,!1,null,q);a.stroke()}};var l=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,d,b,c){if(null==d||null== +this.state.routedPoints[l],x=new mxPoint(n.x/this.scale,n.y/this.scale);0==l?x=d[0]:l==this.state.routedPoints.length-1&&(x=d[d.length-1]);var t=!1;if(null!=u&&1==n.type){var B=this.state.routedPoints[l+1],n=B.x/this.scale-x.x,B=B.y/this.scale-x.y,n=n*n+B*B;null==r&&(r=new mxPoint(x.x-u.x,x.y-u.y),v=Math.sqrt(r.x*r.x+r.y*r.y),r.x=r.x*f/v,r.y=r.y*f/v);n>f*f&&0<v&&(n=u.x-x.x,B=u.y-x.y,n=n*n+B*B,n>f*f&&(t=new mxPoint(x.x-r.x,x.y-r.y),n=new mxPoint(x.x+r.x,x.y+r.y),h.push(t),this.addPoints(a,h,b,c,!1, +null,q),h=0>Math.round(r.x)||0==Math.round(r.x)&&0>=Math.round(r.y)?1:-1,q=!1,"sharp"==e?(a.lineTo(t.x-r.y*h,t.y+r.x*h),a.lineTo(n.x-r.y*h,n.y+r.x*h),a.lineTo(n.x,n.y)):"arc"==e?(h*=1.3,a.curveTo(t.x-r.y*h,t.y+r.x*h,n.x-r.y*h,n.y+r.x*h,n.x,n.y)):(a.moveTo(n.x,n.y),q=!0),h=[n],t=!0))}else r=null;t||(h.push(x),u=x)}this.addPoints(a,h,b,c,!1,null,q);a.stroke()}};var l=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,d,b,c){if(null==d||null== a||"1"!=d.style.snapToPoint&&"1"!=a.style.snapToPoint)l.apply(this,arguments);else{d=this.getTerminalPort(a,d,c);var f=this.getNextPoint(a,b,c),g=this.graph.isOrthogonal(a),e=mxUtils.toRadians(Number(d.style[mxConstants.STYLE_ROTATION]||"0")),k=new mxPoint(d.getCenterX(),d.getCenterY());if(0!=e)var u=Math.cos(-e),v=Math.sin(-e),f=mxUtils.getRotatedPoint(f,u,v,k);u=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);u+=parseFloat(a.style[c?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]|| 0);f=this.getPerimeterPoint(d,f,0==e&&g,u);0!=e&&(u=Math.cos(e),v=Math.sin(e),f=mxUtils.getRotatedPoint(f,u,v,k));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,d,b,c,f),c)}};mxGraphView.prototype.snapToAnchorPoint=function(a,d,b,c,e){if(null!=d&&null!=a){a=this.graph.getAllConnectionConstraints(d);c=b=null;for(var f=0;f<a.length;f++){var g=this.graph.getConnectionPoint(d,a[f]);if(null!=g){var p=(g.x-e.x)*(g.x-e.x)+(g.y-e.y)*(g.y-e.y);if(null==c||p<c)b=g,c=p}}null!=b&&(e=b)}return e};var n=mxStencil.prototype.evaluateTextAttribute; mxStencil.prototype.evaluateTextAttribute=function(a,d,b){var c=n.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=b.state&&(c=b.state.view.graph.replacePlaceholders(b.state.cell,c));return c};var q=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var d=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=d&&"stencil("==d.substring(0,8))try{var b=d.substring(8,d.length-1),c=mxUtils.parseXml(a.view.graph.decompress(b)); @@ -2316,7 +2316,7 @@ Graph.prototype.isValidRoot=function(a){for(var d=this.model.getChildCount(a),b= "1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var d=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(d&&null!=a&&null!=this.layoutManager){var b=this.model.getParent(a);null!=b&&(b=this.layoutManager.getLayout(b),null!=b&&b.constructor==mxStackLayout&&(d=!1))}return d};Graph.prototype.getPreferredSizeForCell=function(a){var d=mxGraph.prototype.getPreferredSizeForCell.apply(this, arguments);null!=d&&(d.width+=10,d.height+=4,this.gridEnabled&&(d.width=this.snap(d.width),d.height=this.snap(d.height)));return d};Graph.prototype.turnShapes=function(a){var d=this.getModel(),b=[];d.beginUpdate();try{for(var c=0;c<a.length;c++){var f=a[c];if(d.isEdge(f)){var g=d.getTerminal(f,!0),e=d.getTerminal(f,!1);d.setTerminal(f,e,!0);d.setTerminal(f,g,!1);var h=d.getGeometry(f);if(null!=h){h=h.clone();null!=h.points&&h.points.reverse();var p=h.getTerminalPoint(!0),m=h.getTerminalPoint(!1); h.setTerminalPoint(p,!1);h.setTerminalPoint(m,!0);d.setGeometry(f,h);var u=this.view.getState(f),r=this.view.getState(g),G=this.view.getState(e);if(null!=u){var v=null!=r?this.getConnectionConstraint(u,r,!0):null,k=null!=G?this.getConnectionConstraint(u,G,!1):null;this.setConnectionConstraint(f,g,!0,k);this.setConnectionConstraint(f,e,!1,v)}b.push(f)}}else if(d.isVertex(f)&&(h=this.getCellGeometry(f),null!=h)){h=h.clone();h.x+=h.width/2-h.height/2;h.y+=h.height/2-h.width/2;var q=h.width;h.width=h.height; -h.height=q;d.setGeometry(f,h);var w=this.view.getState(f);if(null!=w){var x=w.style[mxConstants.STYLE_DIRECTION]||"east";"east"==x?x="south":"south"==x?x="west":"west"==x?x="north":"north"==x&&(x="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,x,[f])}b.push(f)}}}finally{d.endUpdate()}return b};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var d=this.model.getDescendants(a.cell); +h.height=q;d.setGeometry(f,h);var w=this.view.getState(f);if(null!=w){var y=w.style[mxConstants.STYLE_DIRECTION]||"east";"east"==y?y="south":"south"==y?y="west":"west"==y?y="north":"north"==y&&(y="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,y,[f])}b.push(f)}}}finally{d.endUpdate()}return b};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var d=this.model.getDescendants(a.cell); if(0<d.length)for(var b=0;b<d.length;b++)this.isReplacePlaceholders(d[b])&&this.view.invalidate(d[b],!1,!1)}};Graph.prototype.replaceElement=function(a,d){for(var b=a.ownerDocument.createElement(null!=d?d:"span"),c=Array.prototype.slice.call(a.attributes);attr=c.pop();)b.setAttribute(attr.nodeName,attr.nodeValue);b.innerHTML=a.innerHTML;a.parentNode.replaceChild(b,a)};Graph.prototype.updateLabelElements=function(a,d,b){a=null!=a?a:this.getSelectionCells();for(var c=document.createElement("div"),f= 0;f<a.length;f++)if(this.isHtmlLabel(a[f])){var g=this.convertValueToString(a[f]);if(null!=g&&0<g.length){c.innerHTML=g;for(var e=c.getElementsByTagName(null!=b?b:"*"),h=0;h<e.length;h++)d(e[h]);c.innerHTML!=g&&this.cellLabelChanged(a[f],c.innerHTML)}}};Graph.prototype.cellLabelChanged=function(a,d,b){d=this.zapGremlins(d);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var c=a.getAttribute("placeholder"), f=a;null!=f;){if(f==this.model.getRoot()||null!=f.value&&"object"==typeof f.value&&f.hasAttribute(c)){this.setAttributeForCell(f,c,d);break}f=this.model.getParent(f)}var g=a.value.cloneNode(!0);g.setAttribute("label",d);d=g}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var d=new mxDictionary,b=0;b<a.length;b++)d.put(a[b],!0);for(var c=[],b=0;b<a.length;b++){var f=this.model.getParent(a[b]);null==f|| @@ -2342,9 +2342,9 @@ u=this.getCellGeometry(b[g].cell),c=c+p;null!=u&&null!=m&&(u=u.clone(),a?u.x=Mat this.view.getState(a[c]);if(null!=f){var g=this.getCellGeometry(d[c]);null==g||!g.relative||this.model.isEdge(a[c])||b.get(this.model.getParent(a[c]))||(g.relative=!1,g.x=f.x/f.view.scale-f.view.translate.x,g.y=f.y/f.view.scale-f.view.translate.y)}}b=new mxCodec;f=new mxGraphModel;g=f.getChildAt(f.getRoot(),0);for(c=0;c<a.length;c++)f.add(g,d[c]);return b.encode(f)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,d){return this.getLinkForCell(a.cell)}); return a};Graph.prototype.getSvg=function(a,d,b,c,f,g,e,h){d=null!=d?d:1;b=null!=b?b:0;f=null!=f?f:!0;g=null!=g?g:!0;e=null!=e?e:!0;c=g||c?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==c)throw Error(mxResources.get("drawingEmpty"));var p=this.view.scale,m=mxUtils.createXmlDocument(),u=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"svg"):m.createElement("svg");null!=a&&(null!=u.style?u.style.backgroundColor=a:u.setAttribute("style","background-color:"+ a));null==m.createElementNS?(u.setAttribute("xmlns",mxConstants.NS_SVG),u.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):u.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=d/p;u.setAttribute("width",Math.max(1,Math.ceil(c.width*a)+2*b)+"px");u.setAttribute("height",Math.max(1,Math.ceil(c.height*a)+2*b)+"px");u.setAttribute("version","1.1");var r=u;f&&(r=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"g"):m.createElement("g"),r.setAttribute("transform", -"translate(0.5,0.5)"),u.appendChild(r));m.appendChild(u);m=this.createSvgCanvas(r);m.foOffset=f?-.5:0;m.textOffset=f?-.5:0;m.imageOffset=f?-.5:0;m.translate(Math.floor((b/d-c.x)/p),Math.floor((b/d-c.y)/p));var v=document.createElement("textarea"),k=m.createAlternateContent;m.createAlternateContent=function(a,d,b,c,f,g,e,h,m,p,u,r,q){var x=this.state;if(null!=this.foAltText&&(0==c||0!=x.fontSize&&g.length<5*c/x.fontSize)){var w=this.createElement("text");w.setAttribute("x",Math.round(c/2));w.setAttribute("y", -Math.round((f+x.fontSize)/2));w.setAttribute("fill",x.fontColor||"black");w.setAttribute("text-anchor","middle");w.setAttribute("font-size",Math.round(x.fontSize)+"px");w.setAttribute("font-family",x.fontFamily);(x.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&w.setAttribute("font-weight","bold");(x.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&w.setAttribute("font-style","italic");(x.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&w.setAttribute("text-decoration", -"underline");try{return v.innerHTML=g,w.textContent=v.value,w}catch(Ba){return k.apply(this,arguments)}}else return k.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=p/d,d=this.view.translate,f=new mxRectangle(d.x*f,d.y*f,b.width*f,b.height*f),mxUtils.intersects(c,f)&&m.image(d.x,d.y,b.width,b.height,b.src,!0));m.scale(a);m.textEnabled=e;h=null!=h?h:this.createSvgImageExport();var q=h.drawCellState;h.drawCellState=function(a,d){(g||a.view.graph.isCellSelected(a.cell))&&q.apply(this,arguments)}; +"translate(0.5,0.5)"),u.appendChild(r));m.appendChild(u);m=this.createSvgCanvas(r);m.foOffset=f?-.5:0;m.textOffset=f?-.5:0;m.imageOffset=f?-.5:0;m.translate(Math.floor((b/d-c.x)/p),Math.floor((b/d-c.y)/p));var v=document.createElement("textarea"),k=m.createAlternateContent;m.createAlternateContent=function(a,d,b,c,f,g,e,h,m,p,u,r,q){var w=this.state;if(null!=this.foAltText&&(0==c||0!=w.fontSize&&g.length<5*c/w.fontSize)){var y=this.createElement("text");y.setAttribute("x",Math.round(c/2));y.setAttribute("y", +Math.round((f+w.fontSize)/2));y.setAttribute("fill",w.fontColor||"black");y.setAttribute("text-anchor","middle");y.setAttribute("font-size",Math.round(w.fontSize)+"px");y.setAttribute("font-family",w.fontFamily);(w.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold");(w.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");(w.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.setAttribute("text-decoration", +"underline");try{return v.innerHTML=g,y.textContent=v.value,y}catch(Ba){return k.apply(this,arguments)}}else return k.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=p/d,d=this.view.translate,f=new mxRectangle(d.x*f,d.y*f,b.width*f,b.height*f),mxUtils.intersects(c,f)&&m.image(d.x,d.y,b.width,b.height,b.src,!0));m.scale(a);m.textEnabled=e;h=null!=h?h:this.createSvgImageExport();var q=h.drawCellState;h.drawCellState=function(a,d){(g||a.view.graph.isCellSelected(a.cell))&&q.apply(this,arguments)}; h.drawState(this.getView().getState(this.model.root),m);return u};Graph.prototype.createSvgCanvas=function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var d=window.getSelection();d.getRangeAt&&d.rangeCount&&(a=d.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());return a};Graph.prototype.getParentByName=function(a,d,b){for(;null!=a&&a.nodeName!=d;){if(a==b)return null; a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var d=null;if(window.getSelection){if(d=window.getSelection(),d.getRangeAt&&d.rangeCount){var b=document.createRange();b.selectNode(a);d.removeAllRanges();d.addRange(b)}}else(d=document.selection)&&"Control"!=d.type&&(a=d.createRange(),a.collapse(!0),b=d.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=function(a,d){for(var b=a.tBodies[0],c=0<b.rows.length?b.rows[0].cells.length:1,b=b.insertRow(d), f=0;f<c;f++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow=function(a,d){a.tBodies[0].deleteRow(d)};Graph.prototype.insertColumn=function(a,d){var b=a.tHead;if(null!=b)for(var c=0;c<b.rows.length;c++){var f=document.createElement("th");b.rows[c].appendChild(f);mxUtils.br(f)}b=a.tBodies[0];for(c=0;c<b.rows.length;c++)f=b.rows[c].insertCell(d),mxUtils.br(f);return b.rows[0].cells[0<=d?d:b.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,d){if(0<=d)for(var b= @@ -2399,7 +2399,7 @@ arguments)};var w=(new Date).getTime(),u=0,v=mxEdgeHandler.prototype.updatePrevi "0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&r.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,d){var b=null!=a&&0==a,c=this.state.getVisibleTerminalState(b),f=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,c,b):null,b=null!=(null!=f?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b), f):null)?this.fixedHandleImage:null!=f&&null!=c?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var A=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,d,b){this.handleImage=d==mxEvent.ROTATION_HANDLE? HoverIcons.prototype.rotationHandle:d==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return A.apply(this,arguments)};var C=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var d=this.graph.getModel(),b=d.getParent(a[0]),c=this.graph.getCellGeometry(a[0]);if(d.isEdge(b)&&null!=c&&c.relative&&(d=this.graph.view.getState(a[0]),null!=d&&2>d.width&&2>d.height&&null!=d.text&&null!=d.text.boundingBox))return mxRectangle.fromRectangle(d.text.boundingBox)}return C.apply(this, -arguments)};var y=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var d=this.graph.getModel(),b=d.getParent(a.cell),c=this.graph.getCellGeometry(a.cell);return d.isEdge(b)&&null!=c&&c.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(d=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(d.x),Math.round(d.y),Math.round(d.width),Math.round(d.height))):y.apply(this,arguments)};var z=mxVertexHandler.prototype.mouseDown; +arguments)};var x=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var d=this.graph.getModel(),b=d.getParent(a.cell),c=this.graph.getCellGeometry(a.cell);return d.isEdge(b)&&null!=c&&c.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(d=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(d.x),Math.round(d.y),Math.round(d.width),Math.round(d.height))):x.apply(this,arguments)};var z=mxVertexHandler.prototype.mouseDown; mxVertexHandler.prototype.mouseDown=function(a,d){var b=this.graph.getModel(),c=b.getParent(this.state.cell),f=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(d)==mxEvent.ROTATION_HANDLE||!b.isEdge(c)||null==f||!f.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&z.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells|| this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};var B=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,d){B.apply(this,arguments);null!=this.graph.graphHandler.first&&null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none")};var F=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp= function(a,d){F.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var H=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){H.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));var d=mxUtils.bind(this,function(){null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display= @@ -2410,7 +2410,7 @@ document.createElement("img");c.setAttribute("src",IMAGE_PATH+"/edit.gif");c.set c.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));c.setAttribute("width","13");c.setAttribute("height","10");c.style.marginLeft="4px";c.style.marginBottom="-1px";c.style.cursor="pointer";this.linkHint.appendChild(c);mxEvent.addListener(c,"click",mxUtils.bind(this,function(a){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(a)}))}if(null!=b)for(c=0;c<b.length;c++){var f=document.createElement("div");f.style.marginTop=null!=d||0<c?"6px":"0px";f.appendChild(this.graph.createLinkForHint(b[c].getAttribute("href"), mxUtils.getTextContent(b[c])));this.linkHint.appendChild(f)}}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var L=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){L.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var a=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!= this.labelShape&&(this.labelShape.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none")});this.selectionHandler=mxUtils.bind(this,function(d,b){a()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler);this.changeHandler=mxUtils.bind(this,function(d,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));a();this.redrawHandles()});this.graph.getModel().addListener(mxEvent.CHANGE, -this.changeHandler);var d=this.graph.getLinkForCell(this.state.cell),b=this.graph.getLinksForState(this.state);if(null!=d||null!=b&&0<b.length)this.updateLinkHint(d,b),this.redrawHandles()};var x=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){x.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var I=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){I.apply(this); +this.changeHandler);var d=this.graph.getLinkForCell(this.state.cell),b=this.graph.getLinksForState(this.state);if(null!=d||null!=b&&0<b.length)this.updateLinkHint(d,b),this.redrawHandles()};var y=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){y.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var I=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){I.apply(this); if(null!=this.state&&null!=this.linkHint){var a=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),d=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),b=mxUtils.getBoundingBox(d,this.state.style[mxConstants.STYLE_ROTATION]||"0",a),a=null!=b?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,d=null!=this.state.text?this.state.text.boundingBox:null;null==b&&(b=this.state);b=b.y+b.height;null!=d&&(b=Math.max(b, d.y+d.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(b+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var E=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){E.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var Q=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy= function(){Q.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var X=mxEdgeHandler.prototype.redrawHandles; @@ -2418,8 +2418,8 @@ mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(X.apply( function(){R.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Z=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Z.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler), this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function e(){mxCylinder.call(this)}function c(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function l(){mxActor.call(this)}function n(){mxCylinder.call(this)}function q(){mxActor.call(this)}function t(){mxActor.call(this)}function d(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function p(){mxActor.call(this)}function m(){mxActor.call(this)}function h(a,d){this.canvas= a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=d;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,h.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,h.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,h.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,h.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo; -this.canvas.curveTo=mxUtils.bind(this,h.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,h.prototype.arcTo)}function w(){mxRectangleShape.call(this)}function u(){mxRectangleShape.call(this)}function v(){mxActor.call(this)}function r(){mxActor.call(this)}function A(){mxActor.call(this)}function C(){mxRectangleShape.call(this)}function y(){mxRectangleShape.call(this)}function z(){mxCylinder.call(this)}function B(){mxShape.call(this)}function F(){mxShape.call(this)} -function H(){mxEllipse.call(this)}function L(){mxShape.call(this)}function x(){mxShape.call(this)}function I(){mxRectangleShape.call(this)}function E(){mxShape.call(this)}function Q(){mxShape.call(this)}function X(){mxShape.call(this)}function R(){mxCylinder.call(this)}function Z(){mxDoubleEllipse.call(this)}function G(){mxDoubleEllipse.call(this)}function K(){mxArrowConnector.call(this);this.spacing=0}function S(){mxArrowConnector.call(this);this.spacing=0}function J(){mxActor.call(this)}function N(){mxRectangleShape.call(this)} +this.canvas.curveTo=mxUtils.bind(this,h.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,h.prototype.arcTo)}function w(){mxRectangleShape.call(this)}function u(){mxRectangleShape.call(this)}function v(){mxActor.call(this)}function r(){mxActor.call(this)}function A(){mxActor.call(this)}function C(){mxRectangleShape.call(this)}function x(){mxRectangleShape.call(this)}function z(){mxCylinder.call(this)}function B(){mxShape.call(this)}function F(){mxShape.call(this)} +function H(){mxEllipse.call(this)}function L(){mxShape.call(this)}function y(){mxShape.call(this)}function I(){mxRectangleShape.call(this)}function E(){mxShape.call(this)}function Q(){mxShape.call(this)}function X(){mxShape.call(this)}function R(){mxCylinder.call(this)}function Z(){mxDoubleEllipse.call(this)}function G(){mxDoubleEllipse.call(this)}function K(){mxArrowConnector.call(this);this.spacing=0}function S(){mxArrowConnector.call(this);this.spacing=0}function J(){mxActor.call(this)}function N(){mxRectangleShape.call(this)} function U(){mxActor.call(this)}function D(){mxActor.call(this)}function W(){mxActor.call(this)}function O(){mxActor.call(this)}function T(){mxActor.call(this)}function V(){mxActor.call(this)}function Y(){mxActor.call(this)}function M(){mxActor.call(this)}function ca(){mxActor.call(this)}function da(){mxActor.call(this)}function aa(){mxEllipse.call(this)}function ea(){mxEllipse.call(this)}function la(){mxEllipse.call(this)}function ha(){mxRhombus.call(this)}function ra(){mxEllipse.call(this)}function fa(){mxEllipse.call(this)} function ma(){mxEllipse.call(this)}function ba(){mxEllipse.call(this)}function pa(){mxActor.call(this)}function ia(){mxActor.call(this)}function qa(){mxActor.call(this)}function na(){mxConnector.call(this)}function Aa(a,d,b,c,f,g,e,h,p,m){e+=p;var ja=c.clone();c.x-=f*(2*e+p);c.y-=g*(2*e+p);f*=e+p;g*=e+p;return function(){a.ellipse(ja.x-f-e,ja.y-g-e,2*e,2*e);m?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxCylinder);a.prototype.size=20;a.prototype.redrawPath=function(a,d,b,c,f,g){d=Math.max(0,Math.min(c, Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g?(a.moveTo(d,f),a.lineTo(d,d),a.lineTo(0,0),a.moveTo(d,d),a.lineTo(c,d)):(a.moveTo(0,0),a.lineTo(c-d,0),a.lineTo(c,d),a.lineTo(c,f),a.lineTo(d,f),a.lineTo(0,f-d),a.lineTo(0,0),a.close());a.end()};a.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?(a=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(a,a,0,0)):null};mxCellRenderer.registerShape("cube", @@ -2451,13 +2451,13 @@ v);mxUtils.extend(r,mxActor);r.prototype.size=.2;r.prototype.fixedSize=20;r.prot d,f),new mxPoint(0,f),new mxPoint(d,f/2)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("step",r);mxUtils.extend(A,mxHexagon);A.prototype.size=.25;A.prototype.redrawPath=function(a,d,b,c,f){d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(d,0),new mxPoint(c-d,0),new mxPoint(c,.5*f),new mxPoint(c-d,f),new mxPoint(d,f),new mxPoint(0,.5*f)], this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",A);mxUtils.extend(C,mxRectangleShape);C.prototype.isHtmlAllowed=function(){return!1};C.prototype.paintForeground=function(a,d,b,c,f){var g=Math.min(c/5,f/5)+1;a.begin();a.moveTo(d+c/2,b+g);a.lineTo(d+c/2,b+f-g);a.moveTo(d+g,b+f/2);a.lineTo(d+c-g,b+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",C);var Ca=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds= function(a){if(1==this.style["double"]){var d=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+d,a.y+d,a.width-2*d,a.height-2*d)}return a};mxRhombus.prototype.paintVertexShape=function(a,d,b,c,f){Ca.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var g=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);d+=g;b+=g;c-=2*g;f-=2*g;0<c&&0<f&&(a.setShadow(!1),Ca.apply(this,[a,d, -b,c,f]))}};mxUtils.extend(y,mxRectangleShape);y.prototype.isHtmlAllowed=function(){return!1};y.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var d=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+d,a.y+d,a.width-2*d,a.height-2*d)}return a};y.prototype.paintForeground=function(a,d,b,c,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var g=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]|| +b,c,f]))}};mxUtils.extend(x,mxRectangleShape);x.prototype.isHtmlAllowed=function(){return!1};x.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var d=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+d,a.y+d,a.width-2*d,a.height-2*d)}return a};x.prototype.paintForeground=function(a,d,b,c,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var g=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]|| 0);d+=g;b+=g;c-=2*g;f-=2*g;0<c&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var g=0,e;do{e=mxCellRenderer.defaultShapes[this.style["symbol"+g]];if(null!=e){var h=this.style["symbol"+g+"Align"],ja=this.style["symbol"+g+"VerticalAlign"],p=this.style["symbol"+g+"Width"],m=this.style["symbol"+g+"Height"],u=this.style["symbol"+g+"Spacing"]||0,r=this.style["symbol"+g+"VSpacing"]||u,v=this.style["symbol"+g+"ArcSpacing"];null!=v&&(v*=this.getArcSize(c+this.strokewidth, -f+this.strokewidth),u+=v,r+=v);var v=d,k=b,v=h==mxConstants.ALIGN_CENTER?v+(c-p)/2:h==mxConstants.ALIGN_RIGHT?v+(c-p-u):v+u,k=ja==mxConstants.ALIGN_MIDDLE?k+(f-m)/2:ja==mxConstants.ALIGN_BOTTOM?k+(f-m-r):k+r;a.save();h=new e;h.style=this.style;e.prototype.paintVertexShape.call(h,a,v,k,p,m);a.restore()}g++}while(null!=e)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",y);mxUtils.extend(z,mxCylinder);z.prototype.redrawPath=function(a,d,b,c,f,g){g? +f+this.strokewidth),u+=v,r+=v);var v=d,k=b,v=h==mxConstants.ALIGN_CENTER?v+(c-p)/2:h==mxConstants.ALIGN_RIGHT?v+(c-p-u):v+u,k=ja==mxConstants.ALIGN_MIDDLE?k+(f-m)/2:ja==mxConstants.ALIGN_BOTTOM?k+(f-m-r):k+r;a.save();h=new e;h.style=this.style;e.prototype.paintVertexShape.call(h,a,v,k,p,m);a.restore()}g++}while(null!=e)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",x);mxUtils.extend(z,mxCylinder);z.prototype.redrawPath=function(a,d,b,c,f,g){g? (a.moveTo(0,0),a.lineTo(c/2,f/2),a.lineTo(c,0),a.end()):(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,f),a.lineTo(0,f),a.close())};mxCellRenderer.registerShape("message",z);mxUtils.extend(B,mxShape);B.prototype.paintBackground=function(a,d,b,c,f){a.translate(d,b);a.ellipse(c/4,0,c/2,f/4);a.fillAndStroke();a.begin();a.moveTo(c/2,f/4);a.lineTo(c/2,2*f/3);a.moveTo(c/2,f/3);a.lineTo(0,f/3);a.moveTo(c/2,f/3);a.lineTo(c,f/3);a.moveTo(c/2,2*f/3);a.lineTo(0,f);a.moveTo(c/2,2*f/3);a.lineTo(c,f);a.end();a.stroke()}; mxCellRenderer.registerShape("umlActor",B);mxUtils.extend(F,mxShape);F.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};F.prototype.paintBackground=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(0,f/4);a.lineTo(0,3*f/4);a.end();a.stroke();a.begin();a.moveTo(0,f/2);a.lineTo(c/6,f/2);a.end();a.stroke();a.ellipse(c/6,0,5*c/6,f);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",F);mxUtils.extend(H,mxEllipse);H.prototype.paintVertexShape=function(a,d, -b,c,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(d+c/8,b+f);a.lineTo(d+7*c/8,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",H);mxUtils.extend(L,mxShape);L.prototype.paintVertexShape=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(c,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(c,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",L);mxUtils.extend(x,mxShape);x.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+ -a.height/8,a.width,7*a.height/8)};x.prototype.paintBackground=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(3*c/8,f/8*1.1);a.lineTo(5*c/8,0);a.end();a.stroke();a.ellipse(0,f/8,c,7*f/8);a.fillAndStroke()};x.prototype.paintForeground=function(a,d,b,c,f){a.begin();a.moveTo(3*c/8,f/8*1.1);a.lineTo(5*c/8,f/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",x);mxUtils.extend(I,mxRectangleShape);I.prototype.size=40;I.prototype.isHtmlAllowed=function(){return!1};I.prototype.getLabelBounds= +b,c,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(d+c/8,b+f);a.lineTo(d+7*c/8,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",H);mxUtils.extend(L,mxShape);L.prototype.paintVertexShape=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(c,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(c,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",L);mxUtils.extend(y,mxShape);y.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+ +a.height/8,a.width,7*a.height/8)};y.prototype.paintBackground=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(3*c/8,f/8*1.1);a.lineTo(5*c/8,0);a.end();a.stroke();a.ellipse(0,f/8,c,7*f/8);a.fillAndStroke()};y.prototype.paintForeground=function(a,d,b,c,f){a.begin();a.moveTo(3*c/8,f/8*1.1);a.lineTo(5*c/8,f/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",y);mxUtils.extend(I,mxRectangleShape);I.prototype.size=40;I.prototype.isHtmlAllowed=function(){return!1};I.prototype.getLabelBounds= function(a){var d=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,d)};I.prototype.paintBackground=function(a,d,b,c,f){var g=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),e=mxUtils.getValue(this.style,"participant");null==e||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,d,b,c,g):(e=this.state.view.graph.cellRenderer.getShape(e),null!=e&&e!=I&&(e=new e, e.apply(this.state),a.save(),e.paintVertexShape(a,d,b,c,g),a.restore()));g<f&&(a.setDashed(!0),a.begin(),a.moveTo(d+c/2,b+g),a.lineTo(d+c/2,b+f),a.end(),a.stroke())};I.prototype.paintForeground=function(a,d,b,c,f){var g=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,d,b,c,Math.min(f,g))};mxCellRenderer.registerShape("umlLifeline",I);mxUtils.extend(E,mxShape);E.prototype.width=60;E.prototype.height=30;E.prototype.corner= 10;E.prototype.getLabelMargins=function(a){return new mxRectangle(0,0,a.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),a.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};E.prototype.paintBackground=function(a,d,b,c,f){var g=this.corner,e=Math.min(c,Math.max(g,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),h=Math.min(f,Math.max(1.5*g,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),p=mxUtils.getValue(this.style, @@ -2685,8 +2685,8 @@ mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegist PrintDialog.prototype.create=function(a,d){function b(){l.value=Math.max(1,Math.min(h,Math.max(parseInt(l.value),parseInt(w.value))));w.value=Math.max(1,Math.min(h,Math.min(parseInt(l.value),parseInt(w.value))))}function c(d){function b(d,b,f){var g=d.getGraphBounds(),e=0,h=0,p=Y.get(),m=1/d.pageScale,k=t.checked;if(k)var m=parseInt(T.value),r=parseInt(V.value),m=Math.min(p.height*r/(g.height/d.view.scale),p.width*m/(g.width/d.view.scale));else m=parseInt(q.value)/(100*d.pageScale),isNaN(m)&&(c=1/ d.pageScale,q.value="100 %");p=mxRectangle.fromRectangle(p);p.width=Math.ceil(p.width*c);p.height=Math.ceil(p.height*c);m*=c;!k&&d.pageVisible?(g=d.getPageLayout(),e-=g.x*p.width,h-=g.y*p.height):k=!0;if(null==b){b=PrintDialog.createPrintPreview(d,m,p,0,e,h,k);b.pageSelector=!1;b.mathEnabled=!1;d=a.getCurrentFile();null!=d&&(b.title=d.getTitle());var u=b.writeHead;b.writeHead=function(d){u.apply(this,arguments);null!=a.editor.fontCss&&(d.writeln('<style type="text/css">'),d.writeln(a.editor.fontCss), d.writeln("</style>"))};if("undefined"!==typeof MathJax){var w=b.renderPage;b.renderPage=function(a,d,b,c,f,g){var e=w.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:e.className="geDisableMathJax";return e}}b.open(null,null,f,!0)}else{p=d.background;if(null==p||""==p||p==mxConstants.NONE)p="#ffffff";b.backgroundColor=p;b.autoOrigin=k;b.appendGraph(d,m,e,h,f,!0)}return b}var c=parseInt(M.value)/100;isNaN(c)&&(c=1,M.value="100 %");var c=.75*c,g=w.value,e=l.value,h=!k.checked,m=null; -h&&(h=g==p&&e==p);if(!h&&null!=a.pages&&a.pages.length){var r=0,h=a.pages.length-1;k.checked||(r=parseInt(g)-1,h=parseInt(e)-1);for(var u=r;u<=h;u++){var x=a.pages[u],g=x==a.currentPage?f:null;if(null==g){var g=a.createTemporaryGraph(f.getStylesheet()),e=!0,r=!1,n=null,v=null;null==x.viewState&&null==x.mapping&&null==x.root&&a.updatePageRoot(x);null!=x.viewState?(e=x.viewState.pageVisible,r=x.viewState.mathEnabled,n=x.viewState.background,v=x.viewState.backgroundImage):null!=x.mapping&&null!=x.mapping.diagramMap&& -(r="0"!=x.mapping.diagramMap.get("mathEnabled"),n=x.mapping.diagramMap.get("background"),v=x.mapping.diagramMap.get("backgroundImage"),v=null!=v&&0<v.length?JSON.parse(v):null);g.background=n;g.backgroundImage=null!=v?new mxImage(v.src,v.width,v.height):null;g.pageVisible=e;g.mathEnabled=r;var A=g.getGlobalVariable;g.getGlobalVariable=function(a){return"page"==a?x.getName():"pagenumber"==a?u+1:A.apply(this,arguments)};document.body.appendChild(g.container);a.updatePageRoot(x);g.model.setRoot(x.root)}m= +h&&(h=g==p&&e==p);if(!h&&null!=a.pages&&a.pages.length){var r=0,h=a.pages.length-1;k.checked||(r=parseInt(g)-1,h=parseInt(e)-1);for(var u=r;u<=h;u++){var y=a.pages[u],g=y==a.currentPage?f:null;if(null==g){var g=a.createTemporaryGraph(f.getStylesheet()),e=!0,r=!1,n=null,v=null;null==y.viewState&&null==y.mapping&&null==y.root&&a.updatePageRoot(y);null!=y.viewState?(e=y.viewState.pageVisible,r=y.viewState.mathEnabled,n=y.viewState.background,v=y.viewState.backgroundImage):null!=y.mapping&&null!=y.mapping.diagramMap&& +(r="0"!=y.mapping.diagramMap.get("mathEnabled"),n=y.mapping.diagramMap.get("background"),v=y.mapping.diagramMap.get("backgroundImage"),v=null!=v&&0<v.length?JSON.parse(v):null);g.background=n;g.backgroundImage=null!=v?new mxImage(v.src,v.width,v.height):null;g.pageVisible=e;g.mathEnabled=r;var A=g.getGlobalVariable;g.getGlobalVariable=function(a){return"page"==a?y.getName():"pagenumber"==a?u+1:A.apply(this,arguments)};document.body.appendChild(g.container);a.updatePageRoot(y);g.model.setRoot(y.root)}m= b(g,m,u!=h);g!=f&&g.container.parentNode.removeChild(g.container)}}else m=b(f);m.mathEnabled&&(h=m.wnd.document,h.writeln('<script type="text/x-mathjax-config">'),h.writeln("MathJax.Hub.Config({"),h.writeln('messageStyle: "none",'),h.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),h.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),h.writeln("TeX: {"),h.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'), h.writeln("},"),h.writeln("tex2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("},"),h.writeln("asciimath2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("}"),h.writeln("});"),d&&(h.writeln("MathJax.Hub.Queue(function () {"),h.writeln("window.print();"),h.writeln("});")),h.writeln("\x3c/script>"),h.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));m.closeDocument();!m.mathEnabled&&d&&PrintDialog.printPreview(m)} var f=a.editor.graph,g=document.createElement("div"),e=document.createElement("h3");e.style.width="100%";e.style.textAlign="center";e.style.marginTop="0px";mxUtils.write(e,d||mxResources.get("print"));g.appendChild(e);var h=1,p=1,m=document.createElement("div");m.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","all");k.setAttribute("type","radio"); @@ -2748,82 +2748,83 @@ function(a){var d=mxUtils.parseXml(a.getData());if("mxlibrary"==d.documentElemen b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var d=a.data;null!=d&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){d=this.convertDataUri(d);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+d,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var d=this.stringToCells(this.editor.graph.decompress(a.xml)); return this.sidebar.createVertexTemplateFromCells(d,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);c=null!=c&&0<c.length?c:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(d);var l=k.parentNode.previousSibling;c=l.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&l.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var r=document.createElement("div");r.style.position="absolute";r.style.right="0px";r.style.top= "5px";mxClient.IS_QUIRKS||8==document.documentMode||(r.style.backgroundColor="inherit");l.style.position="relative";var n=document.createElement("img");n.setAttribute("src",Dialog.prototype.closeImage);n.setAttribute("title",mxResources.get("close"));n.setAttribute("align","top");n.setAttribute("border","0");n.className="geButton";n.style.marginRight="1px";n.style.marginTop="-1px";r.appendChild(n);var q=null;mxEvent.addListener(n,"click",mxUtils.bind(this,function(d){if(!mxEvent.isConsumed(d)){var b= -mxUtils.bind(this,function(){this.closeLibrary(a)});null!=q?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(d)}}));if(a.isEditable()){var y=this.editor.graph,t=null,B=mxUtils.bind(this,function(d){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(d)}),F=mxUtils.bind(this,function(d){a.setModified(!0);a.isAutosave()?(null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t),t=n.cloneNode(!1), +mxUtils.bind(this,function(){this.closeLibrary(a)});null!=q?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(d)}}));if(a.isEditable()){var x=this.editor.graph,t=null,B=mxUtils.bind(this,function(d){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(d)}),F=mxUtils.bind(this,function(d){a.setModified(!0);a.isAutosave()?(null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t),t=n.cloneNode(!1), t.setAttribute("src",Editor.spinImage),t.setAttribute("title",mxResources.get("saving")),t.style.cursor="default",t.style.marginRight="2px",t.style.marginTop="-2px",r.insertBefore(t,r.firstChild),l.style.paddingRight=18*r.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=t&&null!=t.parentNode&&(t.parentNode.removeChild(t),l.style.paddingRight=18*r.childNodes.length+"px")})):null==q&&(q=n.cloneNode(!1),q.setAttribute("src",IMAGE_PATH+"/download.png"),q.setAttribute("title", -mxResources.get("save")),r.insertBefore(q,r.firstChild),mxEvent.addListener(q,"click",mxUtils.bind(this,function(d){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==q||a.isModified()||(l.style.paddingRight=18*r.childNodes.length+"px",q.parentNode.removeChild(q),q=null)});mxEvent.consume(d)})),l.style.paddingRight=18*r.childNodes.length+"px")}),H=mxUtils.bind(this,function(a,d,c,e){a=y.cloneCells(mxUtils.sortCells(y.model.getTopmostCells(a)));for(var g= -0;g<a.length;g++){var h=y.getCellGeometry(a[g]);null!=h&&h.translate(-d.x,-d.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,d.width,d.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:d.width,h:d.height};null!=e&&(a.title=e);b.push(a);F(c);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),L=mxUtils.bind(this,function(a){if(y.isSelectionEmpty())y.getRubberband().isActive()?(y.getRubberband().execute(a), -y.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var d=y.getSelectionCells(),b=y.view.getBounds(d),c=y.view.scale;b.x/=c;b.y/=c;b.width/=c;b.height/=c;b.x-=y.view.translate.x;b.y-=y.view.translate.y;H(d,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){y.isMouseDown&&null!=y.panningManager&&null!=y.graphHandler.shape&&(y.graphHandler.shape.node.style.visibility= -"hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",y.panningManager.stop(),y.autoScroll=!1,null!=y.graphHandler.guide&&y.graphHandler.guide.setVisible(!1),null!=y.graphHandler.hint&&(y.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){y.isMouseDown&&null!=y.panningManager&&null!=y.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"), -k.style.cursor="default",this.sidebar.showTooltips=!0,y.panningManager.stop(),y.graphHandler.reset(),y.isMouseDown=!1,y.autoScroll=!0,L(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){y.isMouseDown&&null!=y.graphHandler.shape&&(y.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor="",y.autoScroll=!0,null!=y.graphHandler.guide&&y.graphHandler.guide.setVisible(!0),null!=y.graphHandler.hint&&(y.graphHandler.hint.style.visibility= +mxResources.get("save")),r.insertBefore(q,r.firstChild),mxEvent.addListener(q,"click",mxUtils.bind(this,function(d){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==q||a.isModified()||(l.style.paddingRight=18*r.childNodes.length+"px",q.parentNode.removeChild(q),q=null)});mxEvent.consume(d)})),l.style.paddingRight=18*r.childNodes.length+"px")}),H=mxUtils.bind(this,function(a,d,c,e){a=x.cloneCells(mxUtils.sortCells(x.model.getTopmostCells(a)));for(var g= +0;g<a.length;g++){var h=x.getCellGeometry(a[g]);null!=h&&h.translate(-d.x,-d.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,d.width,d.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:d.width,h:d.height};null!=e&&(a.title=e);b.push(a);F(c);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),L=mxUtils.bind(this,function(a){if(x.isSelectionEmpty())x.getRubberband().isActive()?(x.getRubberband().execute(a), +x.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var d=x.getSelectionCells(),b=x.view.getBounds(d),c=x.view.scale;b.x/=c;b.y/=c;b.width/=c;b.height/=c;b.x-=x.view.translate.x;b.y-=x.view.translate.y;H(d,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){x.isMouseDown&&null!=x.panningManager&&null!=x.graphHandler.shape&&(x.graphHandler.shape.node.style.visibility= +"hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",x.panningManager.stop(),x.autoScroll=!1,null!=x.graphHandler.guide&&x.graphHandler.guide.setVisible(!1),null!=x.graphHandler.hint&&(x.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){x.isMouseDown&&null!=x.panningManager&&null!=x.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"), +k.style.cursor="default",this.sidebar.showTooltips=!0,x.panningManager.stop(),x.graphHandler.reset(),x.isMouseDown=!1,x.autoScroll=!0,L(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){x.isMouseDown&&null!=x.graphHandler.shape&&(x.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor="",x.autoScroll=!0,null!=x.graphHandler.guide&&x.graphHandler.guide.setVisible(!0),null!=x.graphHandler.hint&&(x.graphHandler.hint.style.visibility= "visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border= "3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(d,c,g,h,p,m,r,u,l){if(null!=d&&"image/"==c.substring(0,6))d="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(d),d=[new mxCell("",new mxGeometry(0,0,p,m),d)],d[0].vertex=!0,H(d,new mxRectangle(0,0,p,m),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&& 0<b.length&&(f.parentNode.removeChild(f),f=null);else{var n=!1,w=mxUtils.bind(this,function(d,c){if(null!=d&&"text/xml"==c){var g=mxUtils.parseXml(d);if("mxlibrary"==g.documentElement.nodeName)try{var h=JSON.parse(mxUtils.getTextContent(g.documentElement));e(h,k);b=b.concat(h);F(a);this.spinner.stop();n=!0}catch(M){}else if("mxfile"==g.documentElement.nodeName)try{for(var p=g.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var h=mxUtils.getTextContent(p[g]),m=this.stringToCells(this.editor.graph.decompress(h)), -r=this.editor.graph.getBoundingBoxFromGeometry(m);H(m,new mxRectangle(0,0,r.width,r.height),a)}n=!0}catch(M){null!=window.console&&console.log("error in drop handler:",M)}}n||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=l&&null!=r&&(/(\.vsdx)($|\?)/i.test(r)||/(\.vssx)($|\?)/i.test(r))?this.importVisio(l,function(a){w(a,"text/xml")}):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(d,r)&&null!=l?this.parseFile(l,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?w(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):w(d,c)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border="3px solid transparent", -k.style.cursor="");a.stopPropagation();a.preventDefault()}));n=n.cloneNode(!1);n.setAttribute("src",IMAGE_PATH+"/edit.gif");n.setAttribute("title",mxResources.get("edit"));r.insertBefore(n,r.firstChild);mxEvent.addListener(n,"click",B);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&B(a)});c=n.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));r.insertBefore(c,r.firstChild);mxEvent.addListener(c,"click",L);this.isOffline()||".scratchpad"!= -a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),r.insertBefore(c,r.firstChild))}l.appendChild(r);l.style.paddingRight=18*r.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight= -4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position= -"relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"), -Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a", -Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor= -"#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))}; -EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display="none",this.refresh())};EditorUi.prototype.showFooter=function(a){var d=document.getElementById("geFooter");null!=d&&(this.footerHeight=a,d.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,e,m){a=new ImageDialog(this,a,b,c,e,m);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0, -!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var d=new BackgroundImageDialog(this,mxUtils.bind(this,function(d){a(d)}));this.showDialog(d.container,360,200,!0,!0);d.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,e,m){a=new LibraryDialog(this,a,b,c,e,m);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null== -this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer");a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this, -function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),g=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),g=function(){d();f.retry()}),"undefined"!= -typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var k=window.location.hash;null!=k&&"#G"==k.substring(0,2)&&(k=k.substring(2), -a+=' <a href="https://drive.google.com/open?id='+k+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a=mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,c,g)}else null!=c&&c()};EditorUi.prototype.showError= -function(a,b,c,e,m,h,k){a=new ErrorDialog(this,a,b,c,e,m,h,k);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var d=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(d.container,340,100,!0,!1);d.init()};EditorUi.prototype.confirm=function(a,b,c,e,m){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){d();null!=b&&b()},function(){d();null!=c&&c()},e,m)).container, -340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,c){var d=a.toDataURL("image/"+c);if(6>=d.length|| -d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return d};EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,f=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(f,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&& -"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.doSaveLocalFile=function(a,b,c,e,m){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs", -!0,b),c.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height="380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var d=document.createElement("a"),f=!mxClient.IS_SF&&"undefined"!==typeof d.download;if(f||this.isOffline()){d.href=URL.createObjectURL(e?this.base64ToBlob(a,c):new Blob([a],{type:c}));f?d.download=b:d.setAttribute("target","_blank"); -document.body.appendChild(d);try{window.setTimeout(function(){URL.revokeObjectURL(d.href)},0),d.click(),d.parentNode.removeChild(d)}catch(u){}}else this.createEchoRequest(a,b,c,e,m).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,e,m,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=m?"&format="+m:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob= -function(a,b){b=b||"";for(var d=atob(a),c=d.length,f=Math.ceil(c/1024),e=Array(f),k=0;k<f;++k){for(var l=1024*k,n=Math.min(l+1024,c),r=Array(n-l),q=0;l<n;++q,++l)r[q]=d[l].charCodeAt(0);e[k]=new Uint8Array(r)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,e,m,h,k){h=null!=h?h:!1;k=null!=k?k:"vsdx"!=m&&(!mxClient.IS_IOS||!navigator.standalone);m=this.getServiceCount(h);b=new CreateDialog(this,b,mxUtils.bind(this,function(d,b){try{if("_blank"==b)if(null==c||"image/"!=c.substring(0, -6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,c,e);else b==App.MODE_DEVICE?this.doSaveLocalFile(a,d,c,e):null!=d&&0<d.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,d,c,e,b,f)}catch(C){this.handleError(C)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"), -mxResources.get("download"),!1,h,k,null,null,4<m?3:4,a,c,e);this.showDialog(b.container,420,m==(mxClient.IS_IOS?0:1)?160:4<m?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+ -'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var d=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog), -this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var c=d.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding= -"4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=c.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";c=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=c.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog); -this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var d=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",d);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this, -function(){this.openInNewWindow(d.substring(d.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,e,m){this.isLocalFileSave()?this.saveLocalFile(c, -a,e,m,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,d){return this.createEchoRequest(c,a,e,m,b,d)}),c,m,e)};EditorUi.prototype.saveRequest=function(a,b,c,e,m,h,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var d=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,d){if("_blank"==d||null!=a&&0<a.length){var f=c("_blank"==d?null:a,d==App.MODE_DEVICE||null==d||"_blank"==d?"0":"1");null!=f&&(d==App.MODE_DEVICE||"_blank"==d?f.simulate(document,"_blank"):this.pickFolder(d, -mxUtils.bind(this,function(c){h=null!=h?h:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,h,!0,d,c)}catch(y){this.handleError(y)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,h,!0,d,c)}catch(y){this.handleError(y)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}), -mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,k,null,null,4<d?3:4,e,h,m);this.showDialog(a.container,380,d==(mxClient.IS_IOS?0:1)?160:4<d?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,e,m,h){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,e,m,h,k,l,n){if(this.spinner.spin(document.body, -mxResources.get("export"))){var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;d=b?null:this.editor.graph.background;d==mxConstants.NONE&&(d=null);null==d&&0==b&&(d="#ffffff");var f=this.editor.graph.getSvg(d,a,k,l,null,c);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();m&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,n));if(null!=this.editor.fontCss){var d=a.ownerDocument,d=null!=d.createElementNS? -d.createElementNS(mxConstants.NS_SVG,"style"):d.createElement("style");d.setAttribute("type","text/css");mxUtils.setTextContent(d,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(d)}var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"), -mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){h?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,p,this.thumbImageCache)):p(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,c,e,m,h){h=null!=h?h:!0;var d=document.createElement("input");d.style.marginRight="8px";d.style.marginTop="16px";d.setAttribute("type","checkbox");c&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);e&&d.setAttribute("disabled", -"disabled");h&&(a.appendChild(d),mxUtils.write(a,b),m||mxUtils.br(a));return d};EditorUi.prototype.addEditButton=function(a,b){var d=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);d.style.marginLeft="24px";var c=this.getCurrentFile(),f="";null!=c&&c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";c=document.createElement("option"); -c.setAttribute("value","blank");mxUtils.write(c,mxResources.get("makeCopy"));e.appendChild(c);c=document.createElement("option");c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom")+"...");e.appendChild(c);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container, -300,80,!0,!1);a.init()}}));mxEvent.addListener(d,"change",mxUtils.bind(this,function(){d.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return d.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return d},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function d(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE? -"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var c=document.createElement("select");c.style.width="100px";c.style.marginLeft="8px";c.style.marginRight="10px";c.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));c.appendChild(f);f=document.createElement("option"); -f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));c.appendChild(f);f=document.createElement("option");f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));c.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),c.appendChild(f));a.appendChild(c);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",k= -null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;d()});mxEvent.consume(a)}));d();k.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return c.value},focus:function(){c.focus()}}}; -EditorUi.prototype.createLink=function(a,b,c,e,m,h,k,l){var d=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=m&&0<m.length&&f.push("edit="+encodeURIComponent(m)),h&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a); -break}a=!0;null!=k?c="#U"+encodeURIComponent(k):(d=this.getCurrentFile(),l||null==d||d.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+d.getHash(),a=!1));a&&null!=d&&null!=d.getTitle()&&d.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(d.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)? -"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,e,m,h,k,l,n,r,q){this.getBasenames();var d={};""!=m&&m!=mxConstants.NONE&&(d.highlight=m);"auto"!==e&&(d.target=e);n||(d.lightbox=!1);d.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(d.zoom=c/100);c=[];k&&(c.push("pages"),d.resize=!0,null!=this.pages&&null!=this.currentPage&&(d.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"), -d.resize=!0);l&&c.push("layers");0<c.length&&(n&&c.push("lightbox"),d.toolbar=c.join(" "));null!=r&&0<r.length&&(d.edit=r);null!=a?d.url=a:d.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(h?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(d))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";q(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1": -"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;"; -var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";p.setAttribute("value","url");p.setAttribute("type","radio");p.setAttribute("name","type-embedhtmldialog");f=p.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(k);mxUtils.br(g);g.appendChild(p);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl")); -g.appendChild(k);var r=this.getCurrentFile();null==c&&null!=r&&r.constructor==window.DriveFile&&(k=document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),g.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(r.getId())})));f.setAttribute("checked","checked");null==c&&p.setAttribute("disabled","disabled");d.appendChild(g);var l= -this.addLinkSection(d),n=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d,":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value="100%";d.appendChild(q);var t=this.addCheckbox(d,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,B=B=this.addCheckbox(d,mxResources.get("allPages"),g,!g),F=this.addCheckbox(d,mxResources.get("layers"),!0), -H=this.addCheckbox(d,mxResources.get("lightbox"),!0),L=this.addEditButton(d,H),x=L.getEditInput();x.style.marginBottom="16px";mxEvent.addListener(H,"change",function(){H.checked?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled");x.checked&&H.checked?L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,d,mxUtils.bind(this,function(){e(p.checked?c:null,n.checked,q.value,l.getTarget(),l.getColor(),t.checked,B.checked, -F.checked,H.checked,L.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,m,h){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(f);var g=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!= -g&&g.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var k=document.createElement("div");k.style.whiteSpace="normal";mxUtils.write(k,mxResources.get("linkAccountRequired"));p.appendChild(k);k=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())})); -k.style.marginTop="12px";k.className="geBtn";p.appendChild(k);d.appendChild(p);k=document.createElement("a");k.style.paddingLeft="12px";k.style.color="gray";k.style.fontSize="11px";k.setAttribute("href","javascript:void(0);");mxUtils.write(k,mxResources.get("check"));p.appendChild(k);mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this, -null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var l=null,n=null;if(null!=c||null!=e)a+=30,mxUtils.write(d,mxResources.get("width")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.marginRight="16px",l.style.width="50px",l.style.marginLeft="6px",l.style.marginRight="16px",l.style.marginBottom="10px",l.value="100%",d.appendChild(l),mxUtils.write(d,mxResources.get("height")+ -":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.width="50px",n.style.marginLeft="6px",n.style.marginBottom="10px",n.value=e+"px",d.appendChild(n),mxUtils.br(d);var q=this.addLinkSection(d,h);c=null!=this.pages&&1<this.pages.length;var t=null;if(null==g||g.constructor!=window.DriveFile||b)t=this.addCheckbox(d,mxResources.get("allPages"),c,!c);var F=this.addCheckbox(d,mxResources.get("lightbox"),!0),H=this.addEditButton(d,F),L=H.getEditInput(),x=this.addCheckbox(d,mxResources.get("layers"), -!0);x.style.marginLeft=L.style.marginLeft;x.style.marginBottom="16px";x.style.marginTop="8px";mxEvent.addListener(F,"change",function(){F.checked?(x.removeAttribute("disabled"),L.removeAttribute("disabled")):(x.setAttribute("disabled","disabled"),L.setAttribute("disabled","disabled"));L.checked&&F.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){m(q.getTarget(),q.getColor(),null==t? -!0:t.checked,F.checked,H.getLink(),x.checked,null!=l?l.value:null,null!=n?n.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=l?(l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f, -mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(f);var g=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,d,mxUtils.bind(this,function(){c(!g.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog= -function(a,b,c,e,k,h,l,n){l=null!=l?l:!0;var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=this.editor.graph,g="jpeg"==n?196:300,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";d.appendChild(p);mxUtils.write(d,mxResources.get("zoom")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight= -"12px";m.value=this.lastExportZoom||"100%";d.appendChild(m);mxUtils.write(d,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";d.appendChild(u);mxUtils.br(d);var q=this.addCheckbox(d,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=n),w=this.addCheckbox(d,mxResources.get("selectionOnly"), -!1,f.isSelectionEmpty()),t=document.createElement("input");t.style.marginTop="16px";t.style.marginRight="8px";t.style.marginLeft="24px";t.setAttribute("disabled","disabled");t.setAttribute("type","checkbox");h&&(d.appendChild(t),mxUtils.write(d,mxResources.get("crop")),mxUtils.br(d),g+=26,mxEvent.addListener(w,"change",function(){w.checked?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(t.setAttribute("checked","checked"),t.defaultChecked=!0);var L=this.addCheckbox(d, -mxResources.get("shadow"),f.shadowVisible),x=document.createElement("input");x.style.marginTop="16px";x.style.marginRight="8px";x.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||x.setAttribute("disabled","disabled");b&&(d.appendChild(x),mxUtils.write(d,mxResources.get("embedImages")),mxUtils.br(d),g+=26);var I=this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=n),E=null!=this.pages&&1<this.pages.length,Q=this.addCheckbox(d,E?mxResources.get("allPages"): -"",E,!E,null,"jpeg"!=n);Q.style.marginLeft="24px";Q.style.marginBottom="16px";E||(Q.style.visibility="hidden");mxEvent.addListener(I,"change",function(){I.checked&&E?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled")});l&&E||Q.setAttribute("disabled","disabled");a=new CustomDialog(this,d,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=m.value;k(m.value,q.checked,!w.checked,L.checked,I.checked,x.checked,u.value,t.checked,!Q.checked)}),null,c,e);this.showDialog(a.container, -340,g,!0,!0);m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,e,k){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(g)}var p=this.addCheckbox(d,mxResources.get("fit"), -!0),m=this.addCheckbox(d,mxResources.get("shadow"),f.shadowVisible&&e,!e),l=this.addCheckbox(d,c),n=this.addCheckbox(d,mxResources.get("lightbox"),!0),q=this.addEditButton(d,n),t=q.getEditInput(),B=1<f.model.getChildCount(f.model.getRoot()),F=this.addCheckbox(d,mxResources.get("layers"),B,!B);F.style.marginLeft=t.style.marginLeft;F.style.marginBottom="12px";F.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(B&&F.removeAttribute("disabled"),t.removeAttribute("disabled")): -(F.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));t.checked&&n.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){a(p.checked,m.checked,l.checked,n.checked,q.getLink(),F.checked)}),null,mxResources.get("embed"),k);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,e,k,h,l,n){function d(d){var b=" ",g="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ +r=this.editor.graph.getBoundingBoxFromGeometry(m);H(m,new mxRectangle(0,0,r.width,r.height),a)}n=!0}catch(M){null!=window.console&&console.log("error in drop handler:",M)}}n||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=l&&null!=r&&(/(\.vsdx)($|\?)/i.test(r)||/(\.vssx)($|\?)/i.test(r)||/(\.vsd)($|\?)/i.test(r))?this.importVisio(l,function(a){w(a,"text/xml")},null,r):!this.isOffline()&& +(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,r)&&null!=l?this.parseFile(l,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?w(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):w(d,c)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border= +"3px solid transparent",k.style.cursor="");a.stopPropagation();a.preventDefault()}));n=n.cloneNode(!1);n.setAttribute("src",IMAGE_PATH+"/edit.gif");n.setAttribute("title",mxResources.get("edit"));r.insertBefore(n,r.firstChild);mxEvent.addListener(n,"click",B);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&B(a)});c=n.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));r.insertBefore(c,r.firstChild);mxEvent.addListener(c,"click", +L);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),r.insertBefore(c,r.firstChild))}l.appendChild(r);l.style.paddingRight=18*r.childNodes.length+"px"}};"1"==urlParams.offline|| +EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide")); +a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)", +Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme", +Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor= +"#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=", +Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display= +"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var d=document.getElementById("geFooter");null!=d&&(this.footerHeight=a,d.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,e,m){a=new ImageDialog(this,a,b,c,e,m);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor= +!0;this.editor.graph.model.execute(a)});var d=new BackgroundImageDialog(this,mxUtils.bind(this,function(d){a(d)}));this.showDialog(d.container,360,200,!0,!0);d.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,e,m){a=new LibraryDialog(this,a,b,c,e,m);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer"); +a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c){var d=null!=this.spinner&&null!= +this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),g=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),g=function(){d();f.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden")); +else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var k=window.location.hash;null!=k&&"#G"==k.substring(0,2)&&(k=k.substring(2),a+=' <a href="https://drive.google.com/open?id='+k+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a= +mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,c,g)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,e,m,h,k){a=new ErrorDialog(this,a,b,c,e,m,h,k);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var d=new ErrorDialog(this, +null,a,mxResources.get("ok"),b);this.showDialog(d.container,340,100,!0,!1);d.init()};EditorUi.prototype.confirm=function(a,b,c,e,m){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){d();null!=b&&b()},function(){d();null!=c&&c()},e,m)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas= +function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,c){var d=a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return d}; +EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,f=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(f,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS}; +EditorUi.prototype.doSaveLocalFile=function(a,b,c,e,m){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height= +"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var d=document.createElement("a"),f=!mxClient.IS_SF&&"undefined"!==typeof d.download;if(f||this.isOffline()){d.href=URL.createObjectURL(e?this.base64ToBlob(a,c):new Blob([a],{type:c}));f&&(d.download=b);d.setAttribute("target","_blank");document.body.appendChild(d);try{window.setTimeout(function(){URL.revokeObjectURL(d.href)},0),d.click(),d.parentNode.removeChild(d)}catch(u){}}else this.createEchoRequest(a, +b,c,e,m).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,e,m,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=m?"&format="+m:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var d=atob(a),c=d.length,f=Math.ceil(c/1024),e=Array(f),k=0;k<f;++k){for(var l=1024*k,n=Math.min(l+1024,c),r=Array(n-l),q=0;l<n;++q,++l)r[q]= +d[l].charCodeAt(0);e[k]=new Uint8Array(r)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,e,m,h,k){h=null!=h?h:!1;k=null!=k?k:"vsdx"!=m&&(!mxClient.IS_IOS||!navigator.standalone);m=this.getServiceCount(h);b=new CreateDialog(this,b,mxUtils.bind(this,function(d,b){try{if("_blank"==b)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a, +!1)),f.document.close())}else this.openInNewWindow(a,c,e);else b==App.MODE_DEVICE?this.doSaveLocalFile(a,d,c,e):null!=d&&0<d.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,d,c,e,b,f)}catch(C){this.handleError(C)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,h,k,null,null,4<m?3:4,a,c,e);this.showDialog(b.container,420,m==(mxClient.IS_IOS?0:1)?160:4<m?390:270,!0,!0);b.init()}; +EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a, +!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var d=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div"); +var c=d.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left= +c.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";c=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=c.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height= +"auto";this.exportDialog.style.padding="10px";var d=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",d);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(d.substring(d.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null, +this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,e,m){this.isLocalFileSave()?this.saveLocalFile(c,a,e,m,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,d){return this.createEchoRequest(c,a,e,m,b,d)}),c, +m,e)};EditorUi.prototype.saveRequest=function(a,b,c,e,m,h,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var d=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,d){if("_blank"==d||null!=a&&0<a.length){var f=c("_blank"==d?null:a,d==App.MODE_DEVICE||null==d||"_blank"==d?"0":"1");null!=f&&(d==App.MODE_DEVICE||"_blank"==d?f.simulate(document,"_blank"):this.pickFolder(d,mxUtils.bind(this,function(c){h=null!=h?h:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e, +a,h,!0,d,c)}catch(x){this.handleError(x)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,h,!0,d,c)}catch(x){this.handleError(x)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"), +!1,!1,k,null,null,4<d?3:4,e,h,m);this.showDialog(a.container,380,d==(mxClient.IS_IOS?0:1)?160:4<d?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,e,m,h){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,e,m,h,k,l,n){if(this.spinner.spin(document.body,mxResources.get("export"))){var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;d=b?null:this.editor.graph.background; +d==mxConstants.NONE&&(d=null);null==d&&0==b&&(d="#ffffff");var f=this.editor.graph.getSvg(d,a,k,l,null,c);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();m&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,n));if(null!=this.editor.fontCss){var d=a.ownerDocument,d=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"style"):d.createElement("style");d.setAttribute("type","text/css");mxUtils.setTextContent(d, +this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(d)}var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){h?(null== +this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,p,this.thumbImageCache)):p(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,c,e,m,h){h=null!=h?h:!0;var d=document.createElement("input");d.style.marginRight="8px";d.style.marginTop="16px";d.setAttribute("type","checkbox");c&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);e&&d.setAttribute("disabled","disabled");h&&(a.appendChild(d),mxUtils.write(a,b),m||mxUtils.br(a));return d};EditorUi.prototype.addEditButton=function(a, +b){var d=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);d.style.marginLeft="24px";var c=this.getCurrentFile(),f="";null!=c&&c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";c=document.createElement("option");c.setAttribute("value","blank");mxUtils.write(c,mxResources.get("makeCopy"));e.appendChild(c);c=document.createElement("option"); +c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom")+"...");e.appendChild(c);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(d,"change",mxUtils.bind(this,function(){d.checked&&(null==b|| +b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return d.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return d},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function d(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+ +Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var c=document.createElement("select");c.style.width="100px";c.style.marginLeft="8px";c.style.marginRight="10px";c.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));c.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));c.appendChild(f);f=document.createElement("option"); +f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));c.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),c.appendChild(f));a.appendChild(c);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;d()});mxEvent.consume(a)}));d();k.style.padding= +mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return c.value},focus:function(){c.focus()}}};EditorUi.prototype.createLink=function(a,b,c,e,m,h,k,l){var d=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+ +a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=m&&0<m.length&&f.push("edit="+encodeURIComponent(m)),h&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=k?c="#U"+encodeURIComponent(k):(d=this.getCurrentFile(),l||null==d||d.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c? +this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+d.getHash(),a=!1));a&&null!=d&&null!=d.getTitle()&&d.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(d.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+c};EditorUi.prototype.createHtml=function(a, +b,c,e,m,h,k,l,n,r,q){this.getBasenames();var d={};""!=m&&m!=mxConstants.NONE&&(d.highlight=m);"auto"!==e&&(d.target=e);n||(d.lightbox=!1);d.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(d.zoom=c/100);c=[];k&&(c.push("pages"),d.resize=!0,null!=this.pages&&null!=this.currentPage&&(d.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),d.resize=!0);l&&c.push("layers");0<c.length&&(n&&c.push("lightbox"),d.toolbar=c.join(" "));null!=r&&0<r.length&&(d.edit=r);null!= +a?d.url=a:d.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(h?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(d))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";q(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+ +'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;"; +p.setAttribute("value","url");p.setAttribute("type","radio");p.setAttribute("name","type-embedhtmldialog");f=p.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(k);mxUtils.br(g);g.appendChild(p);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));g.appendChild(k);var r=this.getCurrentFile();null==c&&null!=r&&r.constructor==window.DriveFile&&(k= +document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),g.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(r.getId())})));f.setAttribute("checked","checked");null==c&&p.setAttribute("disabled","disabled");d.appendChild(g);var l=this.addLinkSection(d),n=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d, +":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value="100%";d.appendChild(q);var t=this.addCheckbox(d,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,B=B=this.addCheckbox(d,mxResources.get("allPages"),g,!g),F=this.addCheckbox(d,mxResources.get("layers"),!0),H=this.addCheckbox(d,mxResources.get("lightbox"),!0),L=this.addEditButton(d,H),y=L.getEditInput(); +y.style.marginBottom="16px";mxEvent.addListener(H,"change",function(){H.checked?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled");y.checked&&H.checked?L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,d,mxUtils.bind(this,function(){e(p.checked?c:null,n.checked,q.value,l.getTarget(),l.getColor(),t.checked,B.checked,F.checked,H.checked,L.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()}; +EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,m,h){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(f);var g=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=g&&g.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384", +p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var k=document.createElement("div");k.style.whiteSpace="normal";mxUtils.write(k,mxResources.get("linkAccountRequired"));p.appendChild(k);k=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())}));k.style.marginTop="12px";k.className="geBtn";p.appendChild(k);d.appendChild(p);k=document.createElement("a"); +k.style.paddingLeft="12px";k.style.color="gray";k.style.fontSize="11px";k.setAttribute("href","javascript:void(0);");mxUtils.write(k,mxResources.get("check"));p.appendChild(k);mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok")); +this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var l=null,n=null;if(null!=c||null!=e)a+=30,mxUtils.write(d,mxResources.get("width")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.marginRight="16px",l.style.width="50px",l.style.marginLeft="6px",l.style.marginRight="16px",l.style.marginBottom="10px",l.value="100%",d.appendChild(l),mxUtils.write(d,mxResources.get("height")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.width="50px", +n.style.marginLeft="6px",n.style.marginBottom="10px",n.value=e+"px",d.appendChild(n),mxUtils.br(d);var q=this.addLinkSection(d,h);c=null!=this.pages&&1<this.pages.length;var t=null;if(null==g||g.constructor!=window.DriveFile||b)t=this.addCheckbox(d,mxResources.get("allPages"),c,!c);var F=this.addCheckbox(d,mxResources.get("lightbox"),!0),H=this.addEditButton(d,F),L=H.getEditInput(),y=this.addCheckbox(d,mxResources.get("layers"),!0);y.style.marginLeft=L.style.marginLeft;y.style.marginBottom="16px"; +y.style.marginTop="8px";mxEvent.addListener(F,"change",function(){F.checked?(y.removeAttribute("disabled"),L.removeAttribute("disabled")):(y.setAttribute("disabled","disabled"),L.setAttribute("disabled","disabled"));L.checked&&F.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){m(q.getTarget(),q.getColor(),null==t?!0:t.checked,F.checked,H.getLink(),y.checked,null!=l?l.value:null,null!= +n?n.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=l?(l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px"; +d.appendChild(f);var g=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,d,mxUtils.bind(this,function(){c(!g.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,e,k,h,l,n){l=null!=l?l:!0;var d=document.createElement("div");d.style.whiteSpace= +"nowrap";var f=this.editor.graph,g="jpeg"==n?196:300,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";d.appendChild(p);mxUtils.write(d,mxResources.get("zoom")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="12px";m.value=this.lastExportZoom||"100%";d.appendChild(m);mxUtils.write(d,mxResources.get("borderWidth")+ +":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";d.appendChild(u);mxUtils.br(d);var q=this.addCheckbox(d,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=n),w=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),t=document.createElement("input");t.style.marginTop="16px";t.style.marginRight= +"8px";t.style.marginLeft="24px";t.setAttribute("disabled","disabled");t.setAttribute("type","checkbox");h&&(d.appendChild(t),mxUtils.write(d,mxResources.get("crop")),mxUtils.br(d),g+=26,mxEvent.addListener(w,"change",function(){w.checked?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(t.setAttribute("checked","checked"),t.defaultChecked=!0);var L=this.addCheckbox(d,mxResources.get("shadow"),f.shadowVisible),y=document.createElement("input");y.style.marginTop= +"16px";y.style.marginRight="8px";y.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||y.setAttribute("disabled","disabled");b&&(d.appendChild(y),mxUtils.write(d,mxResources.get("embedImages")),mxUtils.br(d),g+=26);var I=this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=n),E=null!=this.pages&&1<this.pages.length,Q=this.addCheckbox(d,E?mxResources.get("allPages"):"",E,!E,null,"jpeg"!=n);Q.style.marginLeft="24px";Q.style.marginBottom="16px";E||(Q.style.visibility= +"hidden");mxEvent.addListener(I,"change",function(){I.checked&&E?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled")});l&&E||Q.setAttribute("disabled","disabled");a=new CustomDialog(this,d,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=m.value;k(m.value,q.checked,!w.checked,L.checked,I.checked,y.checked,u.value,t.checked,!Q.checked)}),null,c,e);this.showDialog(a.container,340,g,!0,!0);m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode|| +mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,e,k){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(g)}var p=this.addCheckbox(d,mxResources.get("fit"),!0),m=this.addCheckbox(d,mxResources.get("shadow"),f.shadowVisible&&e, +!e),l=this.addCheckbox(d,c),n=this.addCheckbox(d,mxResources.get("lightbox"),!0),q=this.addEditButton(d,n),t=q.getEditInput(),B=1<f.model.getChildCount(f.model.getRoot()),F=this.addCheckbox(d,mxResources.get("layers"),B,!B);F.style.marginLeft=t.style.marginLeft;F.style.marginBottom="12px";F.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(B&&F.removeAttribute("disabled"),t.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled")); +t.checked&&n.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){a(p.checked,m.checked,l.checked,n.checked,q.getLink(),F.checked)}),null,mxResources.get("embed"),k);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,e,k,h,l,n){function d(d){var b=" ",g="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ (k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var p="";c&&(p=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');l('<img src="'+d+'"'+p+(""!=g?' style="'+g+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");d(a)}),null,null,null,mxUtils.bind(this,function(a){n({message:mxResources.get("unknownError")})}), null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var g="";c&&(g="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var p=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));p.send(mxUtils.bind(this,function(){200<=p.getStatus()&&299>=p.getStatus()?d("data:image/png;base64,"+p.getText()):n({message:mxResources.get("unknownError")})}))}else n({message:mxResources.get("drawingTooLarge")})}; EditorUi.prototype.createEmbedSvg=function(a,b,c,e,k,h,l){var d=this.editor.graph.getSvg(),f=d.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var p=f[g].getAttribute("href");null!=p&&"#"==p.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&d.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(d);if(c){var m=" ",n="";e&&(m="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ @@ -2838,143 +2839,144 @@ mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,e,k,h,l,n,q){q= this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,e,null,null,h,l)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var d=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),c=0,e={},h=mxUtils.bind(this,function(){if(0==c){for(var f=[b[0]],g=1;g<b.length;g++){var h= b[g].indexOf(")");f.push('url("');f.push(e[d(b[g].substring(0,h))]);f.push('"'+b[g].substring(h))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var k=1;k<b.length;k++){var l=b[k].indexOf(")"),n=null,r=b[k].indexOf("format(",l);0<r&&(n=d(b[k].substring(r+7,b[k].indexOf(")",r))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;c++;var d="application/x-font-ttf";if("svg"==n||/(\.svg)($|\?)/i.test(a))d="image/svg+xml";else if("otf"==n||"embedded-opentype"==n||/(\.otf)($|\?)/i.test(a))d= "application/x-font-opentype";else if("woff"==n||/(\.woff)($|\?)/i.test(a))d="application/font-woff";else if("woff2"==n||/(\.woff2)($|\?)/i.test(a))d="application/font-woff2";else if("eot"==n||/(\.eot)($|\?)/i.test(a))d="application/vnd.ms-fontobject";else if("sfnt"==n||/(\.sfnt)($|\?)/i.test(a))d="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(d){e[a]=d;c--;h()}),mxUtils.bind(this, -function(a){c--;h()}),!0,null,"data:"+d+";charset=utf-8;base64,")}})(d(b[k].substring(0,l)),n)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,e,k,h,l,n,q,r,t,C,y,z){h=null!=h?h:!0;C=null!=C?C:this.editor.graph;y=null!=y?y:0;var d=q?null:C.background;d==mxConstants.NONE&&(d=null);null==d&&(d=e);null==d&&0==q&&(d=this.editor.graph.defaultPageBackgroundColor);this.convertImages(C.getSvg(d,null,null,z,null,null!=l?l:!0),mxUtils.bind(this,function(c){var f=new Image;f.onload=mxUtils.bind(this, -function(){try{var e=document.createElement("canvas"),g=parseInt(c.getAttribute("width")),m=parseInt(c.getAttribute("height"));n=null!=n?n:1;null!=b&&(n=h?Math.min(1,Math.min(3*b/(4*m),b/g)):b/g);g=Math.ceil(n*g)+2*y;m=Math.ceil(n*m)+2*y;e.setAttribute("width",g);e.setAttribute("height",m);var p=e.getContext("2d");null!=d&&(p.beginPath(),p.rect(0,0,g,m),p.fillStyle=d,p.fill());p.scale(n,n);p.drawImage(f,y/n,y/n);a(e)}catch(X){null!=k&&k(X)}});f.onerror=function(a){null!=k&&k(a)};try{r&&this.editor.graph.addSvgShadow(c); -var e=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(C,c,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(e)}catch(x){null!=k&&k(x)}}),c,t)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert, +function(a){c--;h()}),!0,null,"data:"+d+";charset=utf-8;base64,")}})(d(b[k].substring(0,l)),n)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,e,k,h,l,n,q,r,t,C,x,z){h=null!=h?h:!0;C=null!=C?C:this.editor.graph;x=null!=x?x:0;var d=q?null:C.background;d==mxConstants.NONE&&(d=null);null==d&&(d=e);null==d&&0==q&&(d=this.editor.graph.defaultPageBackgroundColor);this.convertImages(C.getSvg(d,null,null,z,null,null!=l?l:!0),mxUtils.bind(this,function(c){var f=new Image;f.onload=mxUtils.bind(this, +function(){try{var e=document.createElement("canvas"),g=parseInt(c.getAttribute("width")),m=parseInt(c.getAttribute("height"));n=null!=n?n:1;null!=b&&(n=h?Math.min(1,Math.min(3*b/(4*m),b/g)):b/g);g=Math.ceil(n*g)+2*x;m=Math.ceil(n*m)+2*x;e.setAttribute("width",g);e.setAttribute("height",m);var p=e.getContext("2d");null!=d&&(p.beginPath(),p.rect(0,0,g,m),p.fillStyle=d,p.fill());p.scale(n,n);p.drawImage(f,x/n,x/n);a(e)}catch(X){null!=k&&k(X)}});f.onerror=function(a){null!=k&&k(a)};try{r&&this.editor.graph.addSvgShadow(c); +var e=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(C,c,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(e)}catch(y){null!=k&&k(y)}}),c,t)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert, c=this;a.convert=function(d){if(null!=d){var f="http://"==d.substring(0,7)||"https://"==d.substring(0,8);f&&!navigator.onLine?d=c.svgBrokenImage.src:!f||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.isCorsEnabledForUrl(d)?"chrome-extension://"!=d.substring(0,19)&&(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,e){null==e&&(e=this.createImageUrlConverter());var d=0,f=c||{};c=mxUtils.bind(this, function(c,g){for(var h=a.getElementsByTagName(c),k=0;k<h.length;k++)mxUtils.bind(this,function(c){var h=e.convert(c.getAttribute(g));if(null!=h&&"data:"!=h.substring(0,5)){var k=f[h];null==k?(d++,this.convertImageToDataUri(h,function(e){null!=e&&(f[h]=e,c.setAttribute(g,e));d--;0==d&&b(a)})):c.setAttribute(g,k)}else null!=h&&c.setAttribute(g,h)})(h[k])});c("image","xlink:href");c("img","src");0==d&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,e,k,h){try{var d=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)|| /(\.gif)($|\?)/i.test(a);k=null!=k?k:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var f=a.getText();if(d){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}h=null!=h?h:"data:image/png;base64,";f=h+this.base64Encode(f)}b(f)}}else null!= c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},d,this.timeout,function(){k&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(v){null!=c&&c(v)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0, 23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var d=new Image,c=this;this.crossOriginImages&&(d.crossOrigin="anonymous");d.onload=function(){var a=document.createElement("canvas"),f=a.getContext("2d"); a.height=d.height;a.width=d.width;f.drawImage(d,0,0);try{b(a.toDataURL())}catch(w){b(c.svgBrokenImage.src)}};d.onerror=function(){b(c.svgBrokenImage.src)};d.src=a}};EditorUi.prototype.importXml=function(a,b,c,e,k){b=null!=b?b:0;c=null!=c?c:0;var d=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),m=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=m&&"mxfile"==m.nodeName&&null!=this.pages){var p=m.getElementsByTagName("diagram");if(1==p.length)m= -mxUtils.parseXml(f.decompress(mxUtils.getTextContent(p[0]))).documentElement;else if(1<p.length){f.model.beginUpdate();try{for(a=0;a<p.length;a++){var l=this.updatePageRoot(new DiagramPage(p[a])),n=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[n+1]));f.model.execute(new ChangePage(this,l,l,n))}}finally{f.model.endUpdate()}}}null!=m&&"mxGraphModel"===m.nodeName&&(d=f.importGraphModel(m,b,c,e))}}catch(y){throw k||this.handleError(y,mxResources.get("invalidOrMissingFile")), -y;}return d};EditorUi.prototype.importVisio=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)try{this.doImportVisio(a,b,c)}catch(m){c(m)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!== -typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(f){this.handleError(f)}});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,c,e,k){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,c,e,k)}catch(w){this.handleError(w)}finally{null!=k&&k()}});this.pasteLucidChart||this.loadingExtensions|| -this.isOffline()?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.insertLucidChart=function(a,b,c,e,k){k=JSON.parse(a);a=[];if(null!=k.state){k=JSON.parse(k.state);for(var d in k.Pages)a.push(k.Pages[d]);a.sort(function(a,d){return a.Properties.Order<d.Properties.Order?-1:a.Properties.Order>d.Properties.Order?1:0})}else a.push(k);if(0<a.length){this.editor.graph.getModel().beginUpdate(); -try{if(this.pasteLucidChart(a[0],b,c,e),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=function(a,b,c,e,k,h,l){h=null!=h?h:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this, -function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(k||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var d=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,c,h,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0, -26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,c,h,!0),0<g.length)return g}catch(A){}this.loadImage(a,mxUtils.bind(this,function(f){if("data:"==a.substring(0,5))this.resizeImage(f,a,mxUtils.bind(this,function(a,f,e){d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ -this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/f.width,this.maxImageSize/f.height)),g=Math.round(f.width*e);f=Math.round(f.height*e);d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),g,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;d.getModel().beginUpdate();try{f=d.insertVertex(d.getDefaultParent(), -null,a,d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.updateCellSize(f),d.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{d.getModel().endUpdate()}d.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,h);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,c,h);else{d=this.editor.graph;k=null;d.getModel().beginUpdate();try{k=d.insertVertex(d.getDefaultParent(), -null,"",d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.fireEvent(new mxEventObject("textInserted","cells",[k])),k.value=a,d.updateCellSize(k),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(k.value)&&d.setLinkForCell(k,k.value),k.geometry.width+=d.gridSize,k.geometry.height+=d.gridSize}finally{d.getModel().endUpdate()}return[k]}}return[]}; -EditorUi.prototype.formatFileSize=function(a){var d=-1;do a/=1024,d++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[d]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var d=a.indexOf(";");0<d&&(a=a.substring(0,d)+a.substring(a.indexOf(",",d+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importFile=function(a,b,c,e,k,h,l,n, -q,r,t){r=null!=r?r:!0;var d=!1,f=null,g=mxUtils.bind(this,function(a){var d=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,l)):d=this.importXml(a,c,e,r);null!=n&&n(d)});"image"==b.substring(0,5)?(q=!1,"image/png"==b.substring(0,9)&&(b=t?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,c,e,r),q=!0)),q||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),r&&f.isGridEnabled()&&(c=f.snap(c), -e=f.snap(e)),f=[f.insertVertex(null,null,"",c,e,k,h,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,c,e,r);null!=n&&n(a)})):null!=q&&null!=l&&(/(\.vsdx)($|\?)/i.test(l)||/(\.vssx)($|\?)/i.test(l))?(d=!0,this.importVisio(q,g)):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(a,l)?(d=!0,this.parseFile(null!=q?q:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=n&&n(null))}),l)):/(\.vsd)($|\?)/i.test(l)||(f=this.insertTextAt(this.validateFileData(a),c,e,!0,null,r));d||null==n||n(f);return f};EditorUi.prototype.base64Encode=function(a){for(var d="",b=0,c=a.length,e,h,k;b<c;){e=a.charCodeAt(b++)&255;if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);d+="==";break}h=a.charCodeAt(b++);if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);d+="=";break}k=a.charCodeAt(b++);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(k&192)>>6);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return d};EditorUi.prototype.importFiles=function(a,b,c,e,k,h,l,n,q,r,t,C){b=null!=b?b:0;c=null!=c?c:0;e=null!=e?e:this.maxImageSize;r=null!=r?r:this.maxImageBytes;var d=null!=b&&null!=c,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&& -null!=a)for(var p=t||this.resampleThreshold,m=0;m<a.length;m++)if("image/"==a[m].type.substring(0,6)&&a[m].size>p){g=!0;break}var u=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;k=null!=k?k:mxUtils.bind(this,function(a,b,c,e,f,g,h,k,p){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,c,e,f,g,h,k,p,d,C)});h=null!=h?h:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body, -mxResources.get("loading")))for(var m=a.length,q=m,u=[],w=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--q){this.spinner.stop();if(null!=n)n(u);else{var d=[];g.getModel().beginUpdate();try{for(var c=0;c<u.length;c++){var e=u[c]();null!=e&&(d=d.concat(e))}}finally{g.getModel().endUpdate()}}h(d)}}),v=0;v<m;v++)mxUtils.bind(this,function(d){var h=a[d],m=new FileReader;m.onload=mxUtils.bind(this,function(a){if(null==l||l(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var m= -a.target.result,n=m.indexOf(","),q=decodeURIComponent(escape(atob(m.substring(n+1)))),x=mxUtils.parseXml(q),q=x.getElementsByTagName("svg");if(0<q.length){var q=q[0],u=C?null:q.getAttribute("content");null!=u&&"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(u,!0)));null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u));null==u||"<mxfile "!==u.substring(0,8)&&"<mxGraphModel "!==u.substring(0,14)?w(d,mxUtils.bind(this,function(){try{if(m.substring(0,n+1),null!=x){var a= -x.getElementsByTagName("svg");if(0<a.length){var l=a[0],r=parseFloat(l.getAttribute("width")),q=parseFloat(l.getAttribute("height")),u=l.getAttribute("viewBox");if(null==u||0==u.length)l.setAttribute("viewBox","0 0 "+r+" "+q);else if(isNaN(r)||isNaN(q)){var t=u.split(" ");3<t.length&&(r=parseFloat(t[2]),q=parseFloat(t[3]))}m=this.createSvgDataUri(mxUtils.getXml(l));var w=Math.min(1,Math.min(e/Math.max(1,r)),e/Math.max(1,q)),E=k(m,h.type,b+d*p,c+d*p,Math.max(1,Math.round(r*w)),Math.max(1,Math.round(q* -w)),h.name,f);if(isNaN(r)||isNaN(q)){var v=new Image;v.onload=mxUtils.bind(this,function(){r=Math.max(1,v.width);q=Math.max(1,v.height);E[0].geometry.width=r;E[0].geometry.height=q;l.setAttribute("viewBox","0 0 "+r+" "+q);m=this.createSvgDataUri(mxUtils.getXml(l));var a=m.indexOf(";");0<a&&(m=m.substring(0,a)+m.substring(m.indexOf(",",a+1)));g.setCellStyles("image",m,[E[0]])});v.src=this.createSvgDataUri(mxUtils.getXml(l))}return E}}}catch(fa){}return null})):w(d,mxUtils.bind(this,function(){return k(u, -"text/xml",b+d*p,c+d*p,0,0,h.name)}))}}else{q=!1;if("image/png"==h.type){var E=C?null:this.extractGraphModelFromPng(a.target.result);if(null!=E&&0<E.length){var v=new Image;v.src=a.target.result;w(d,mxUtils.bind(this,function(){return k(E,"text/xml",b+d*p,c+d*p,v.width,v.height,h.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"), -mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,m,l){w(d,mxUtils.bind(this,function(){if(null!=g&&g.length<r){var n=f&&this.isResampleImage(a.target.result,t)?Math.min(1,Math.min(e/m,e/l)):1;return k(g,h.type,b+d*p,c+d*p,Math.round(m*n),Math.round(l*n),h.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,t)}),mxUtils.bind(this, -function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else k(a.target.result,h.type,b+d*p,c+d*p,240,160,h.name,function(a){w(d,function(){return a})})});/(\.vsdx)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name)?k(null,h.type,b+d*p,c+d*p,240,160,h.name,function(a){w(d,function(){return a})},h):"image"==h.type.substring(0,5)?m.readAsDataURL(h):m.readAsText(h)})(v)});g?this.confirmImageResize(function(a){f=a;u()},q):u()};EditorUi.prototype.confirmImageResize=function(a, -b){b=null!=b?b:!1;var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(c,e){if(c||b)mxSettings.setResizeImages(c?e:null),mxSettings.save();d();a(e)};null==c||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+ -'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,c)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length> -b};EditorUi.prototype.resizeImage=function(a,b,c,e,k,h){k=null!=k?k:this.maxImageSize;var d=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,h))try{var g=Math.max(d/k,f/k);if(1<g){var p=Math.round(d/g),m=Math.round(f/g),l=document.createElement("canvas");l.width=p;l.height=m;l.getContext("2d").drawImage(a,0,0,p,m);var n=l.toDataURL();if(n.length<b.length){var q=document.createElement("canvas");q.width=p;q.height=m;var t=q.toDataURL();n!==t&&(b=n,d=p,f=m)}}}catch(F){}c(b,d,f)}; -EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var c=e,k=0;8>k;k++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[e]=c;EditorUi.prototype.updateCRC=function(a,b,c,e){for(var d=0;d<e;d++)a=EditorUi.prototype.crcTable[(a^b[c+d])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,e,k){function d(a,b){var d=p;p+=b;return a.substring(d,p)}function f(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>> -24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(d(a,4),"IHDR"!=d(a,4))null!=k&&k();else{d(a,17);k=a.substring(0,p);do{var m=f(a);if("IDAT"==d(a,4)){k=a.substring(0,p-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,c,0,c.length);k+=g(c.length)+b+c+g(e^4294967295); -k+=a.substring(p-8,a.length);break}k+=a.substring(p-8,p-4+m);d(a,m);d(a,4)}while(m);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var d=a.substring(a.indexOf(",")+1),c=window.atob&&!mxClient.IS_SF?atob(d):Base64.decode(d,!0);EditorUi.parsePng(c,mxUtils.bind(this,function(a,d,e){a=c.substring(a+8,a+8+e);"zTXt"==d?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+ -2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==d&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==d)return!0}))}catch(m){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var d= -a.indexOf(",");0<d&&(a=b.getPageById(a.substring(d+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,c=this.editor.graph;c.addListener("pageLinkClicked",function(b,d){a(d.getProperty("href"))});this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!= -a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var d=0;d<b.pages.length;d++)if(b.pages[d]==b.currentPage){0<d&&(a+=(0<a.length?"&":"?")+"page="+d);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,arguments)};var k=c.addClickHandler;c.addClickHandler=function(b,d,e){var f=d;d=function(b,d){if(null==d){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(d=e.getAttribute("href"))}null==d||!c.isPageLink(d)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)|| -(a(d),mxEvent.consume(b));null!=f&&f(b,d)};k.call(this,b,d,e)};l.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=c.getGlobalVariable;c.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a? -null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,arguments)};var n=c.createLinkForHint;c.createLinkForHint=function(d,e){var f=c.isPageLink(d);if(f){var g=d.indexOf(",");0<g&&(g=b.getPageById(d.substring(g+1)),e=null!=g?g.getName():mxResources.get("pageNotFound"))}g=n.call(this,d,e);f&&mxEvent.addListener(g,"click",function(b){a(d);mxEvent.consume(b)});return g};var q=c.labelLinkClicked;c.labelLinkClicked=function(b,d,e){var f=d.getAttribute("href");if(null== -f||!c.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e))q.apply(this,arguments);else{if(!c.isEnabled()||null!=b&&c.isCellLocked(b.cell))a(f),c.getRubberband().reset();mxEvent.consume(e)}};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,d=b.getCurrentFile();null!=d&&(a=null!=d.getTitle()?d.getTitle():a);return a};var t=this.actions.get("print");t.setEnabled(!mxClient.IS_IOS||!navigator.standalone);t.visible=t.isEnabled();if(!this.editor.chromeless||this.editor.editable){var r= -function(){window.setTimeout(function(){A.innerHTML=" ";A.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||c.container.addEventListener("paste", -mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var d=a.clipboardData||a.originalEvent.clipboardData,c=!1,e=0;e<d.types.length;e++)if("text/"===d.types[e].substring(0,5)){c=!0;break}if(!c){var f=d.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,d,c,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()}); -else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(G){}}),!1);var A=document.createElement("div");A.style.position="absolute";A.style.whiteSpace="nowrap";A.style.overflow="hidden";A.style.display="block";A.contentEditable=!0;mxUtils.setOpacity(A,0);A.style.width="1px";A.style.height="1px";A.innerHTML=" ";var C=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86, -null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==c.container||!c.isEnabled()||c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||C||(A.style.left=c.container.scrollLeft+10+"px",A.style.top=c.container.scrollTop+10+"px",c.container.appendChild(A),C=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){A.focus();document.execCommand("selectAll", -!1,null)},0):(A.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!C||224!=b&&17!=b&&91!=b||(C=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),A.parentNode.removeChild(A))}),0)}));mxEvent.addListener(A,"copy",mxUtils.bind(this,function(a){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(A),r())}));mxEvent.addListener(A,"cut",mxUtils.bind(this, -function(a){c.isEnabled()&&(this.copyCells(A,!0),r())}));mxEvent.addListener(A,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(A.innerHTML=" ",A.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,A);A.innerHTML=" "}),0))}),!0);var y=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==A?!0:y.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight|| -0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,d=b.cellEditor.text2,c=null;null!=d&&(mxEvent.addListener(d,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=this.highlightElement(d));a.stopPropagation(); -a.preventDefault()})),mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,d,c,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var d=a.dataTransfer.getData("text/uri-list"); -/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)?this.loadImage(decodeURIComponent(d),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,c)),e/Math.max(1,a));b.insertImage(decodeURIComponent(d),c*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types, -"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){t=document.createElement("div");t.style.position="absolute";t.style.top="95px";t.style.left="250px";t.style.width="2000px";t.style.height="30px";t.style.background="whiteSmoke";document.body.appendChild(t);var z=document.createElement("div");z.style.position="absolute";z.style.top="125px";z.style.left="220px"; -z.style.width="30px";z.style.height="1000px";z.style.background="whiteSmoke";document.body.appendChild(z);var B=document.createElement("div");B.style.position="absolute";B.style.top="95px";B.style.left="220px";B.style.width="30px";B.style.height="30px";B.style.background="whiteSmoke";document.body.appendChild(B);this.vRuler=new mxRuler(this.editor.graph,z,!0);this.hRuler=new mxRuler(this.editor.graph,t,!1)}if("1"==urlParams.test){t=document.getElementById("geFooter");null!=t&&(this.styleInput=document.createElement("input"), -this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),t.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE, -mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var d=this.editor.graph.getSelectionCell(),d=this.editor.graph.getModel().getStyle(d);this.styleInput.value=d||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var F=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:F.apply(this,arguments)}}t=document.getElementById("geInfo");null!=t&&t.parentNode.removeChild(t);if(Graph.fileSupport&& -(!this.editor.chromeless||this.editor.editable)){var H=null;mxEvent.addListener(c.container,"dragleave",function(a){c.isEnabled()&&(null!=H&&(H.parentNode.removeChild(H),H=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(a){null==H&&(!mxClient.IS_IE||10<document.documentMode)&&(H=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c.container, -"drop",mxUtils.bind(this,function(a){null!=H&&(H.parentNode.removeChild(H),H=null);if(c.isEnabled()){var b=mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=c.view.translate,e=c.view.scale,f=b.x/e-d.x,g=b.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")? -a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=b)c.setSelectionCells(this.importXml(b,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=k;var p=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(p=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&& -(k=b[0].getAttribute("href")));var m=!0,l=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(k,f,g,!0,p,null,m))});p&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){m=a;l()},mxEvent.isControlDown(a)):l()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,b)),d/Math.max(1,a));c.setSelectionCell(c.insertVertex(null, -null,"",f,g,b*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(a){c.setSelectionCells(this.insertTextAt(h,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()}; -EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged", -mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat= -mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave); -mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var d=this.editor.graph; -if(d.isSelectionEmpty())a.innerHTML="";else{var c=mxUtils.sortCells(d.model.getTopmostCells(d.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(c));mxUtils.setTextContent(a,encodeURIComponent(e));b?(d.removeCells(c,!1),d.lastPasteXml=null):(d.lastPasteXml=e,d.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var d=b.getElementsByTagName("span");if(null!=d&&0<d.length&&"application/vnd.lucid.chart.objects"=== -d[0].getAttribute("data-lucid-type")){var c=d[0].getAttribute("data-lucid-content");null!=c&&0<c.length&&(this.importLucidChart(c,0,0),mxEvent.consume(a))}else{var c=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var k=e.lastIndexOf("%3E");0<=k&&k<e.length-3&&(e=e.substring(0,k+3))}catch(v){}try{var d=b.getElementsByTagName("span"),l=null!=d&&0<d.length?mxUtils.trim(decodeURIComponent(d[0].textContent)):decodeURIComponent(e); -this.isCompatibleString(l)&&(f=!0,e=l)}catch(v){}c.lastPasteXml==e?c.pasteCounter++:(c.lastPasteXml=e,c.pasteCounter=0);d=c.pasteCounter*c.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?c.setSelectionCells(this.importXml(e,d,d)):(f=c.getInsertPoint(),c.isMouseInsertPoint()&&(d=0,c.lastPasteXml==e&&0<c.pasteCounter&&c.pasteCounter--),c.setSelectionCells(this.insertTextAt(e,f.x+d,f.y+d,!0))),!c.isSelectionEmpty())){c.scrollCellToVisible(c.getSelectionCell());null!=this.hoverIcons&& -this.hoverIcons.update(c.view.getState(c.getSelectionCell()));try{mxEvent.consume(a)}catch(v){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,d=0;d<a.length;d++)mxEvent.addListener(a[d],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[d],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&& -12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[d],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0); -else{var d=this.extractGraphModelFromEvent(a);if(null==d){var c=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=c&&(10==document.documentMode||11==document.documentMode?d=c.getData("Text"):(d=null,d=0<=mxUtils.indexOf(c.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(c.types,"text/html")?c.getData("text/html"):null,null!=d&&0<d.length?(c=document.createElement("div"),c.innerHTML=d,c=c.getElementsByTagName("img"),0<c.length&&(d=c[0].getAttribute("src"))): -0<=mxUtils.indexOf(c.types,"text/plain")&&(d=c.getData("text/plain"))),null!=d&&("data:image/png;base64,"==d.substring(0,22)?(d=this.extractGraphModelFromPng(d),null!=d&&0<d.length&&this.openLocalFile(d,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(d)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(d))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(d)&&(null==this.getCurrentFile()?window.location.hash= -"#U"+encodeURIComponent(d):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(d)))))}else this.openLocalFile(d,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,d=0,c,e;if(null==a){e=document.body;var h=document.documentElement;c=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-3}else b=a.offsetTop,d=a.offsetLeft,c=a.clientWidth, -e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=b+"px";h.style.left=d+"px";h.style.width=Math.max(0,c-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a); -var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var d=new mxCodec(b.ownerDocument),c=new mxGraphModel;d.decode(b,c);b=c.getChildAt(c.getRoot(),0);for(d=0;d<c.getChildCount(b);d++)a.push(c.getChildAt(b,d))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var d=0;d<a.length;d++)mxUtils.bind(this,function(a){var d=new FileReader;d.onload=mxUtils.bind(this,function(d){var c=d.target.result,e=a.name;if(null!= -e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(A){this.handleError(A,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a, -e,b)});if(/(\.vsdx)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,e))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})); -else if('{"state":"{\\"Properties\\":'==c.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(c,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==d.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this, -d.target.result,a.name))}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(c=this.extractGraphModelFromPng(c)),this.spinner.stop(),this.openLocalFile(c,e,b)}});d.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?d.readAsDataURL(a):d.readAsText(a)})(a[d])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(), -e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,c))});null!=a&&0<a.length&&(null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"), -null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root, -a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function d(a){if(null!=a){var d=a.lastIndexOf(".");0<d&&(a=a.substring(d+1,a.length));null==b[a]&&(b[a]=!0)}}var c=this.editor.graph,e=c.getCellStyle(a);d(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));c.model.isEdge(a)&&(d(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),d(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW]))); -for(var e=c.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(c.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden")}; -EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()): -(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))}; -EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,d=!1,c=!1,e=null,h=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))): -this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(Q){}return a}if(f.source== -(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(E){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey): -null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft", -result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()})); -try{l.init()}catch(E){k.postMessage(JSON.stringify({event:"draft",error:E.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();var l=1==h.enableRecent,n=1==h.enableSearch,l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,d){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:d}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null, -null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=a;k.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,n?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,d){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:d}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"== -h.action)this.searchReadyCallback(h.list,h.errorMsg);else if("recentDocsList"==h.action)this.recentReadyCallback(h.list,h.errorMsg);else{if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var p=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body, -p):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var m=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(m); -k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(m))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),w=q.getGlobalVariable,x=this.pages[0];q.getGlobalVariable=function(a){return"page"== -a?x.getName():"pagenumber"==a?1:w.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(x.root)}this.exportToCanvas(mxUtils.bind(this,function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(m)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()? -t("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);p=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),p.xml=mxUtils.getXml(l),p.data=this.getFileData(null,null,!0,null,null,null,l),p.format=h.format;else if("html"==h.format)m=this.editor.getGraphXml(),p.data=this.getHtml(m,this.editor.graph), -p.xml=mxUtils.getXml(m),p.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);p.xml=this.getFileData(!0);p.format="svg";if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0); -this.spinner.stop();p.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(p),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));p.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(p), -"*")}return}if("load"==h.action)c=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop= -"6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}}h=g(h);d=!0;try{a(h,f)}catch(E){this.handleError(E)}d=!1;null!=urlParams.modified&& -this.editor.setStatus("");var I=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=I();c&&null==b&&(b=mxUtils.bind(this,function(a,b){var c=I();if(c!=e&&!d){var f=this.createLoadMessage("autosave");f.xml=c;c=JSON.stringify(f);(window.opener||window.parent).postMessage(c,"*")}e=c}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged", -b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}})); -var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title", -mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding= -"4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b); -this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv= -function(a){try{var b=a.split("\n"),d=[];if(0<b.length){var c={},e=null,h=null,k="auto",l="auto",n=null,q=null,t=40,C=40,y=0,z=this.editor.graph;z.getGraphBounds();for(var B=function(){z.setSelectionCells(Y);z.scrollCellToVisible(z.getSelectionCell())},F=z.getFreeInsertPoint(),H=F.x,L=F.y,F=L,x=null,I="auto",E=[],Q=null,X=null,R=0;R<b.length&&"#"==b[R].charAt(0);){a=b[R];for(R++;R<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[R].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[R].substring(1)), -R++;if("#"!=a.charAt(1)){var Z=a.indexOf(":");if(0<Z){var G=mxUtils.trim(a.substring(1,Z)),K=mxUtils.trim(a.substring(Z+1));"label"==G?x=z.sanitizeHtml(K):"style"==G?e=K:"identity"==G&&0<K.length&&"-"!=K?h=K:"width"==G?k=K:"height"==G?l=K:"left"==G&&0<K.length?n=K:"top"==G&&0<K.length?q=K:"ignore"==G?X=K.split(","):"connect"==G?E.push(JSON.parse(K)):"link"==G?Q=K:"padding"==G?y=parseFloat(K):"edgespacing"==G?t=parseFloat(K):"nodespacing"==G?C=parseFloat(K):"layout"==G&&(I=K)}}}var S=this.editor.csvToArray(b[R]); -a=null;if(null!=h)for(var J=0;J<S.length;J++)if(h==S[J]){a=J;break}null==x&&(x="%"+S[0]+"%");if(null!=E)for(var N=0;N<E.length;N++)null==c[E[N].to]&&(c[E[N].to]={});z.model.beginUpdate();try{for(J=R+1;J<b.length;J++){var U=this.editor.csvToArray(b[J]);if(U.length==S.length){var D=null,W=null!=a?U[a]:null;null!=W&&(D=z.model.getCell(W));null==D&&(D=new mxCell(x,new mxGeometry(H,F,0,0),e||"whiteSpace=wrap;html=1;"),D.vertex=!0,D.id=W);for(var O=0;O<U.length;O++)z.setAttributeForCell(D,S[O],U[O]);z.setAttributeForCell(D, -"placeholders","1");D.style=z.replacePlaceholders(D,D.style);for(N=0;N<E.length;N++)c[E[N].to][D.getAttribute(E[N].to)]=D;null!=Q&&"link"!=Q&&(z.setLinkForCell(D,D.getAttribute(Q)),z.setAttributeForCell(D,Q,null));z.fireEvent(new mxEventObject("cellsInserted","cells",[D]));var T=this.editor.graph.getPreferredSizeForCell(D);D.vertex&&(null!=n&&null!=D.getAttribute(n)&&(D.geometry.x=H+parseFloat(D.getAttribute(n))),null!=q&&null!=D.getAttribute(q)&&(D.geometry.y=L+parseFloat(D.getAttribute(q))),"@"== -k.charAt(0)&&null!=D.getAttribute(k.substring(1))?D.geometry.width=parseFloat(D.getAttribute(k.substring(1))):D.geometry.width="auto"==k?T.width+y:parseFloat(k),"@"==l.charAt(0)&&null!=D.getAttribute(l.substring(1))?D.geometry.height=parseFloat(D.getAttribute(l.substring(1))):D.geometry.height="auto"==l?T.height+y:parseFloat(l),F+=D.geometry.height+C);d.push(z.addCell(D))}}for(var V=d.slice(),Y=d.slice(),N=0;N<E.length;N++)for(var M=E[N],J=0;J<d.length;J++){var D=d[J],ca=D.getAttribute(M.from);if(null!= -ca){z.setAttributeForCell(D,M.from,null);for(var da=ca.split(","),O=0;O<da.length;O++){var aa=c[M.to][da[O]];null!=aa&&(x=M.label,null!=M.fromlabel&&(x=(D.getAttribute(M.fromlabel)||"")+(x||"")),null!=M.tolabel&&(x=(x||"")+(aa.getAttribute(M.tolabel)||"")),Y.push(z.insertEdge(null,null,x||"",M.invert?aa:D,M.invert?D:aa,M.style||z.createCurrentEdgeStyle())),mxUtils.remove(M.invert?D:aa,V))}}}if(null!=X)for(J=0;J<d.length;J++)for(D=d[J],O=0;O<X.length;O++)z.setAttributeForCell(D,mxUtils.trim(X[O]), -null);var ea=new mxParallelEdgeLayout(z);ea.spacing=t;var la=function(){ea.execute(z.getDefaultParent());for(var a=0;a<d.length;a++){var b=z.getCellGeometry(d[a]);b.x=Math.round(z.snap(b.x));b.y=Math.round(z.snap(b.y));"auto"==k&&(b.width=Math.round(z.snap(b.width)));"auto"==l&&(b.height=Math.round(z.snap(b.height)))}};if("circle"==I){var ha=new mxCircleLayout(z);ha.resetEdges=!1;var ra=ha.isVertexIgnored;ha.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){ha.execute(z.getDefaultParent()); -la()},!0,B);B=null}else if("horizontaltree"==I||"verticaltree"==I||"auto"==I&&Y.length==2*d.length-1&&1==V.length){z.view.validate();var fa=new mxCompactTreeLayout(z,"horizontaltree"==I);fa.levelDistance=C;fa.edgeRouting=!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(z.getDefaultParent(),0<V.length?V[0]:null)},!0,B);B=null}else if("horizontalflow"==I||"verticalflow"==I||"auto"==I&&1==V.length){z.view.validate();var ma=new mxHierarchicalLayout(z,"horizontalflow"==I?mxConstants.DIRECTION_WEST: -mxConstants.DIRECTION_NORTH);ma.intraCellSpacing=C;ma.disableEdgeStyle=!1;this.executeLayout(function(){ma.execute(z.getDefaultParent(),Y);z.moveCells(Y,H,L)},!0,B);B=null}else if("organic"==I||"auto"==I&&Y.length>d.length){z.view.validate();var ba=new mxFastOrganicLayout(z);ba.forceConstant=3*C;ba.resetEdges=!1;var pa=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return pa.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ea=new mxParallelEdgeLayout(z);ea.spacing=t;this.executeLayout(function(){ba.execute(z.getDefaultParent()); -la()},!0,B);B=null}this.hideDialog()}finally{z.model.endUpdate()}null!=B&&B()}}catch(ia){this.handleError(ia)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var d="?",c;for(c in urlParams)0>mxUtils.indexOf(a,c)&&null!=urlParams[c]&&(b+=d+c+"="+urlParams[c],d="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0; -if("1"==urlParams.offline)a+=window.location.search;else{var d="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),c;for(c in urlParams)0>mxUtils.indexOf(d,c)&&(a=0==b?a+"?":a+"&",null!=urlParams[c]&&(a+=c+"="+urlParams[c],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var n=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b= -n.apply(this,arguments),d=this.editor.graph,c=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(d.container)&&d.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return c.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(d.container)&& -null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(d.container)&&null!=this.source.minimumGraphSize){var c=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width- -2*c.x))/2)-c.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*c.y))/2)-c.y-5/a))}return new mxPoint(8/a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=d.getPageLayout(),b=d.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()}; -this.editor.addListener("pageSelected",function(a,d){var c=d.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(c.previousPage.root, -!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var d=0;null==this.drive&&"function"!==typeof window.DriveClient||d++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||d++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||d++;b||null==this.gitHub||d++;b||null==this.trello&&"function"!==typeof window.TrelloClient||d++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&d++;mxClient.IS_IOS||d++;return d};EditorUi.prototype.updateUi= -function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!= -urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a); -this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px"; -this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache, -k=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break; -case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=k&&(this.offlineStatus.innerHTML=b,k=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b); -b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var q=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){q.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b); -this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b);this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell())); -this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("rename").setEnabled(null!=c&&c.isRenamable());this.actions.get("close").setEnabled(null!= -c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile= -function(a,b,c,e,k,h){var d=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(d.getSvg(e,k,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=d.getGraphBounds(),l=Math.floor(g.width*k/d.view.scale),n=Math.floor(g.height*k/d.view.scale);f.length<=MAX_REQUEST_SIZE&&l*n<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL, -"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+l+"&h="+n+"&border="+h+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; +mxUtils.parseXml(f.decompress(mxUtils.getTextContent(p[0]))).documentElement;else if(1<p.length){f.model.beginUpdate();try{for(a=0;a<p.length;a++){var l=this.updatePageRoot(new DiagramPage(p[a])),n=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[n+1]));f.model.execute(new ChangePage(this,l,l,n))}}finally{f.model.endUpdate()}}}null!=m&&"mxGraphModel"===m.nodeName&&(d=f.importGraphModel(m,b,c,e))}}catch(x){throw k||this.handleError(x,mxResources.get("invalidOrMissingFile")), +x;}return d};EditorUi.prototype.importVisio=function(a,b,c,e){e=null!=e?e:a.name;c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(/(\.vsd)($|\?)/i.test(e)){var d=new FormData;d.append("file1",a);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);f.responseType="blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{this.doImportVisio(f.response, +b,c)}catch(u){c(u)}else c({})});f.send(d)}else try{this.doImportVisio(a,b,c)}catch(u){c(u)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(f){this.handleError(f)}});"undefined"!==typeof VsdxExport||this.loadingExtensions|| +this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,c,e,k){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,c,e,k)}catch(w){this.handleError(w)}finally{null!=k&&k()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js", +d))};EditorUi.prototype.insertLucidChart=function(a,b,c,e,k){k=JSON.parse(a);a=[];if(null!=k.state){k=JSON.parse(k.state);for(var d in k.Pages)a.push(k.Pages[d]);a.sort(function(a,d){return a.Properties.Order<d.Properties.Order?-1:a.Properties.Order>d.Properties.Order?1:0})}else a.push(k);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,c,e),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}}; +EditorUi.prototype.insertTextAt=function(a,b,c,e,k,h,l){h=null!=h?h:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(k||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var d= +this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,c,h,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,c,h,!0),0<g.length)return g}catch(A){}this.loadImage(a,mxUtils.bind(this, +function(f){if("data:"==a.substring(0,5))this.resizeImage(f,a,mxUtils.bind(this,function(a,f,e){d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/f.width,this.maxImageSize/f.height)),g=Math.round(f.width*e);f=Math.round(f.height*e);d.setSelectionCell(d.insertVertex(null, +null,"",d.snap(b),d.snap(c),g,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;d.getModel().beginUpdate();try{f=d.insertVertex(d.getDefaultParent(),null,a,d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.updateCellSize(f),d.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{d.getModel().endUpdate()}d.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a)); +if(this.isCompatibleString(a))return this.importXml(a,b,c,h);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,c,h);else{d=this.editor.graph;k=null;d.getModel().beginUpdate();try{k=d.insertVertex(d.getDefaultParent(),null,"",d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.fireEvent(new mxEventObject("textInserted","cells",[k])),k.value=a,d.updateCellSize(k),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(k.value)&& +d.setLinkForCell(k,k.value),k.geometry.width+=d.gridSize,k.geometry.height+=d.gridSize}finally{d.getModel().endUpdate()}return[k]}}return[]};EditorUi.prototype.formatFileSize=function(a){var d=-1;do a/=1024,d++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[d]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var d=a.indexOf(";");0<d&&(a=a.substring(0,d)+a.substring(a.indexOf(",",d+1)))}return a};EditorUi.prototype.isRemoteFileFormat= +function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importFile=function(a,b,c,e,k,h,l,n,q,r,t){r=null!=r?r:!0;var d=!1,f=null,g=mxUtils.bind(this,function(a){var d=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,l)):d=this.importXml(a,c,e,r);null!=n&&n(d)});"image"==b.substring(0,5)?(q=!1,"image/png"==b.substring(0,9)&&(b=t?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,c,e,r),q= +!0)),q||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),r&&f.isGridEnabled()&&(c=f.snap(c),e=f.snap(e)),f=[f.insertVertex(null,null,"",c,e,k,h,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,c,e,r);null!=n&&n(a)})):null!= +q&&null!=l&&(/(\.vsdx)($|\?)/i.test(l)||/(\.vssx)($|\?)/i.test(l)||/(\.vsd)($|\?)/i.test(l))?(d=!0,this.importVisio(q,g)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(d=!0,this.parseFile(null!=q?q:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=n&&n(null))}),l)):/(\.vsd)($|\?)/i.test(l)||(f=this.insertTextAt(this.validateFileData(a),c,e,!0,null,r));d||null==n||n(f); +return f};EditorUi.prototype.base64Encode=function(a){for(var d="",b=0,c=a.length,e,h,k;b<c;){e=a.charCodeAt(b++)&255;if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);d+="==";break}h=a.charCodeAt(b++);if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e& +3)<<4|(h&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);d+="=";break}k=a.charCodeAt(b++);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(k&192)>>6);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return d}; +EditorUi.prototype.importFiles=function(a,b,c,e,k,h,l,n,q,r,t,C){b=null!=b?b:0;c=null!=c?c:0;e=null!=e?e:this.maxImageSize;r=null!=r?r:this.maxImageBytes;var d=null!=b&&null!=c,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=t||this.resampleThreshold,m=0;m<a.length;m++)if("image/"==a[m].type.substring(0,6)&&a[m].size>p){g=!0;break}var u=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;k=null!=k?k:mxUtils.bind(this,function(a,b,c,e,f,g,h,k,p){return null!=a&&"<mxlibrary"==a.substring(0, +10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,c,e,f,g,h,k,p,d,C)});h=null!=h?h:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var m=a.length,q=m,u=[],w=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--q){this.spinner.stop();if(null!=n)n(u);else{var d=[];g.getModel().beginUpdate();try{for(var c=0;c<u.length;c++){var e=u[c]();null!=e&&(d=d.concat(e))}}finally{g.getModel().endUpdate()}}h(d)}}), +v=0;v<m;v++)mxUtils.bind(this,function(d){var h=a[d],m=new FileReader;m.onload=mxUtils.bind(this,function(a){if(null==l||l(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var m=a.target.result,n=m.indexOf(","),q=decodeURIComponent(escape(atob(m.substring(n+1)))),y=mxUtils.parseXml(q),q=y.getElementsByTagName("svg");if(0<q.length){var q=q[0],u=C?null:q.getAttribute("content");null!=u&&"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(u,!0))); +null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u));null==u||"<mxfile "!==u.substring(0,8)&&"<mxGraphModel "!==u.substring(0,14)?w(d,mxUtils.bind(this,function(){try{if(m.substring(0,n+1),null!=y){var a=y.getElementsByTagName("svg");if(0<a.length){var l=a[0],r=parseFloat(l.getAttribute("width")),q=parseFloat(l.getAttribute("height")),u=l.getAttribute("viewBox");if(null==u||0==u.length)l.setAttribute("viewBox","0 0 "+r+" "+q);else if(isNaN(r)||isNaN(q)){var t=u.split(" ");3<t.length&&(r=parseFloat(t[2]), +q=parseFloat(t[3]))}m=this.createSvgDataUri(mxUtils.getXml(l));var w=Math.min(1,Math.min(e/Math.max(1,r)),e/Math.max(1,q)),E=k(m,h.type,b+d*p,c+d*p,Math.max(1,Math.round(r*w)),Math.max(1,Math.round(q*w)),h.name,f);if(isNaN(r)||isNaN(q)){var v=new Image;v.onload=mxUtils.bind(this,function(){r=Math.max(1,v.width);q=Math.max(1,v.height);E[0].geometry.width=r;E[0].geometry.height=q;l.setAttribute("viewBox","0 0 "+r+" "+q);m=this.createSvgDataUri(mxUtils.getXml(l));var a=m.indexOf(";");0<a&&(m=m.substring(0, +a)+m.substring(m.indexOf(",",a+1)));g.setCellStyles("image",m,[E[0]])});v.src=this.createSvgDataUri(mxUtils.getXml(l))}return E}}}catch(fa){}return null})):w(d,mxUtils.bind(this,function(){return k(u,"text/xml",b+d*p,c+d*p,0,0,h.name)}))}}else{q=!1;if("image/png"==h.type){var E=C?null:this.extractGraphModelFromPng(a.target.result);if(null!=E&&0<E.length){var v=new Image;v.src=a.target.result;w(d,mxUtils.bind(this,function(){return k(E,"text/xml",b+d*p,c+d*p,v.width,v.height,h.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP? +(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,m,l){w(d,mxUtils.bind(this,function(){if(null!=g&&g.length<r){var n=f&&this.isResampleImage(a.target.result,t)?Math.min(1, +Math.min(e/m,e/l)):1;return k(g,h.type,b+d*p,c+d*p,Math.round(m*n),Math.round(l*n),h.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,t)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else k(a.target.result,h.type,b+d*p,c+d*p,240,160,h.name,function(a){w(d,function(){return a})})});/(\.vsdx)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name)||/(\.vsd)($|\?)/i.test(h.name)?k(null,h.type,b+d*p,c+d*p,240,160, +h.name,function(a){w(d,function(){return a})},h):"image"==h.type.substring(0,5)?m.readAsDataURL(h):m.readAsText(h)})(v)});g?this.confirmImageResize(function(a){f=a;u()},q):u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(c,e){if(c||b)mxSettings.setResizeImages(c?e:null),mxSettings.save();d();a(e)};null==c|| +b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,c)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format", +"xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,e,k,h){k=null!=k?k:this.maxImageSize;var d=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,h))try{var g=Math.max(d/k,f/k);if(1<g){var p=Math.round(d/g),m=Math.round(f/g),l=document.createElement("canvas"); +l.width=p;l.height=m;l.getContext("2d").drawImage(a,0,0,p,m);var n=l.toDataURL();if(n.length<b.length){var q=document.createElement("canvas");q.width=p;q.height=m;var t=q.toDataURL();n!==t&&(b=n,d=p,f=m)}}}catch(F){}c(b,d,f)};EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var c=e,k=0;8>k;k++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[e]=c;EditorUi.prototype.updateCRC=function(a,b,c,e){for(var d=0;d<e;d++)a=EditorUi.prototype.crcTable[(a^b[c+d])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng= +function(a,b,c,e,k){function d(a,b){var d=p;p+=b;return a.substring(d,p)}function f(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(d(a,4),"IHDR"!=d(a,4))null!=k&&k();else{d(a,17);k=a.substring(0, +p);do{var m=f(a);if("IDAT"==d(a,4)){k=a.substring(0,p-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,c,0,c.length);k+=g(c.length)+b+c+g(e^4294967295);k+=a.substring(p-8,a.length);break}k+=a.substring(p-8,p-4+m);d(a,m);d(a,4)}while(m);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var d=a.substring(a.indexOf(",")+1),c=window.atob&& +!mxClient.IS_SF?atob(d):Base64.decode(d,!0);EditorUi.parsePng(c,mxUtils.bind(this,function(a,d,e){a=c.substring(a+8,a+8+e);"zTXt"==d?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==d&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==d)return!0}))}catch(m){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)); +null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var d=a.indexOf(",");0<d&&(a=b.getPageById(a.substring(d+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,c=this.editor.graph;c.addListener("pageLinkClicked",function(b, +d){a(d.getProperty("href"))});this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var d=0;d<b.pages.length;d++)if(b.pages[d]==b.currentPage){0<d&&(a+=(0<a.length?"&":"?")+"page="+d);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this, +arguments)};var k=c.addClickHandler;c.addClickHandler=function(b,d,e){var f=d;d=function(b,d){if(null==d){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(d=e.getAttribute("href"))}null==d||!c.isPageLink(d)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(d),mxEvent.consume(b));null!=f&&f(b,d)};k.call(this,b,d,e)};l.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container, +360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=c.getGlobalVariable;c.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,arguments)};var n=c.createLinkForHint;c.createLinkForHint=function(d,e){var f=c.isPageLink(d);if(f){var g=d.indexOf(",");0<g&&(g=b.getPageById(d.substring(g+1)),e=null!= +g?g.getName():mxResources.get("pageNotFound"))}g=n.call(this,d,e);f&&mxEvent.addListener(g,"click",function(b){a(d);mxEvent.consume(b)});return g};var q=c.labelLinkClicked;c.labelLinkClicked=function(b,d,e){var f=d.getAttribute("href");if(null==f||!c.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e))q.apply(this,arguments);else{if(!c.isEnabled()||null!=b&&c.isCellLocked(b.cell))a(f),c.getRubberband().reset();mxEvent.consume(e)}};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename, +d=b.getCurrentFile();null!=d&&(a=null!=d.getTitle()?d.getTitle():a);return a};var t=this.actions.get("print");t.setEnabled(!mxClient.IS_IOS||!navigator.standalone);t.visible=t.isEnabled();if(!this.editor.chromeless||this.editor.editable){var r=function(){window.setTimeout(function(){A.innerHTML=" ";A.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0); +this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||c.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var d=a.clipboardData||a.originalEvent.clipboardData,c=!1,e=0;e<d.types.length;e++)if("text/"===d.types[e].substring(0,5)){c=!0;break}if(!c){var f=d.items; +for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,d,c,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(G){}}),!1);var A=document.createElement("div");A.style.position="absolute";A.style.whiteSpace= +"nowrap";A.style.overflow="hidden";A.style.display="block";A.contentEditable=!0;mxUtils.setOpacity(A,0);A.style.width="1px";A.style.height="1px";A.innerHTML=" ";var C=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==c.container||!c.isEnabled()||c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"== +b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||C||(A.style.left=c.container.scrollLeft+10+"px",A.style.top=c.container.scrollTop+10+"px",c.container.appendChild(A),C=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){A.focus();document.execCommand("selectAll",!1,null)},0):(A.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!C|| +224!=b&&17!=b&&91!=b||(C=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),A.parentNode.removeChild(A))}),0)}));mxEvent.addListener(A,"copy",mxUtils.bind(this,function(a){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(A),r())}));mxEvent.addListener(A,"cut",mxUtils.bind(this,function(a){c.isEnabled()&&(this.copyCells(A,!0),r())}));mxEvent.addListener(A,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(A.innerHTML=" ",A.focus(), +window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,A);A.innerHTML=" "}),0))}),!0);var x=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==A?!0:x.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph, +d=b.cellEditor.text2,c=null;null!=d&&(mxEvent.addListener(d,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=this.highlightElement(d));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files, +0,0,this.maxImageSize,function(a,d,c,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var d=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)?this.loadImage(decodeURIComponent(d),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1, +Math.min(e/Math.max(1,c)),e/Math.max(1,a));b.insertImage(decodeURIComponent(d),c*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!== +typeof mxRuler){t=document.createElement("div");t.style.position="absolute";t.style.top="95px";t.style.left="250px";t.style.width="2000px";t.style.height="30px";t.style.background="whiteSmoke";document.body.appendChild(t);var z=document.createElement("div");z.style.position="absolute";z.style.top="125px";z.style.left="220px";z.style.width="30px";z.style.height="1000px";z.style.background="whiteSmoke";document.body.appendChild(z);var B=document.createElement("div");B.style.position="absolute";B.style.top= +"95px";B.style.left="220px";B.style.width="30px";B.style.height="30px";B.style.background="whiteSmoke";document.body.appendChild(B);this.vRuler=new mxRuler(this.editor.graph,z,!0);this.hRuler=new mxRuler(this.editor.graph,t,!1)}if("1"==urlParams.test){t=document.getElementById("geFooter");null!=t&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width= +"98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),t.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var d=this.editor.graph.getSelectionCell(),d=this.editor.graph.getModel().getStyle(d); +this.styleInput.value=d||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var F=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:F.apply(this,arguments)}}t=document.getElementById("geInfo");null!=t&&t.parentNode.removeChild(t);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var H=null;mxEvent.addListener(c.container,"dragleave",function(a){c.isEnabled()&&(null!=H&&(H.parentNode.removeChild(H), +H=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(a){null==H&&(!mxClient.IS_IE||10<document.documentMode)&&(H=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c.container,"drop",mxUtils.bind(this,function(a){null!=H&&(H.parentNode.removeChild(H),H=null);if(c.isEnabled()){var b=mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)), +d=c.view.translate,e=c.view.scale,f=b.x/e-d.x,g=b.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=b)c.setSelectionCells(this.importXml(b,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types, +"text/html")){var k=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=k;var p=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(p=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(k=b[0].getAttribute("href")));var m=!0,l=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(k,f,g,!0,p,null,m))});p&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){m= +a;l()},mxEvent.isControlDown(a)):l()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,b)),d/Math.max(1,a));c.setSelectionCell(c.insertVertex(null,null,"",f,g,b*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(a){c.setSelectionCells(this.insertTextAt(h, +f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors= +mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget()); +this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged", +mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew|| +8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var d=this.editor.graph;if(d.isSelectionEmpty())a.innerHTML="";else{var c=mxUtils.sortCells(d.model.getTopmostCells(d.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(c));mxUtils.setTextContent(a,encodeURIComponent(e));b?(d.removeCells(c, +!1),d.lastPasteXml=null):(d.lastPasteXml=e,d.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var d=b.getElementsByTagName("span");if(null!=d&&0<d.length&&"application/vnd.lucid.chart.objects"===d[0].getAttribute("data-lucid-type")){var c=d[0].getAttribute("data-lucid-content");null!=c&&0<c.length&&(this.importLucidChart(c,0,0),mxEvent.consume(a))}else{var c=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS|| +8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var k=e.lastIndexOf("%3E");0<=k&&k<e.length-3&&(e=e.substring(0,k+3))}catch(v){}try{var d=b.getElementsByTagName("span"),l=null!=d&&0<d.length?mxUtils.trim(decodeURIComponent(d[0].textContent)):decodeURIComponent(e);this.isCompatibleString(l)&&(f=!0,e=l)}catch(v){}c.lastPasteXml==e?c.pasteCounter++:(c.lastPasteXml=e,c.pasteCounter=0);d=c.pasteCounter*c.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?c.setSelectionCells(this.importXml(e, +d,d)):(f=c.getInsertPoint(),c.isMouseInsertPoint()&&(d=0,c.lastPasteXml==e&&0<c.pasteCounter&&c.pasteCounter--),c.setSelectionCells(this.insertTextAt(e,f.x+d,f.y+d,!0))),!c.isSelectionEmpty())){c.scrollCellToVisible(c.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(c.view.getState(c.getSelectionCell()));try{mxEvent.consume(a)}catch(v){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,d=0;d<a.length;d++)mxEvent.addListener(a[d],"dragleave", +function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[d],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[d],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()|| +"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var d=this.extractGraphModelFromEvent(a);if(null==d){var c=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=c&&(10==document.documentMode||11==document.documentMode?d=c.getData("Text"):(d=null,d=0<=mxUtils.indexOf(c.types, +"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(c.types,"text/html")?c.getData("text/html"):null,null!=d&&0<d.length?(c=document.createElement("div"),c.innerHTML=d,c=c.getElementsByTagName("img"),0<c.length&&(d=c[0].getAttribute("src"))):0<=mxUtils.indexOf(c.types,"text/plain")&&(d=c.getData("text/plain"))),null!=d&&("data:image/png;base64,"==d.substring(0,22)?(d=this.extractGraphModelFromPng(d),null!=d&&0<d.length&&this.openLocalFile(d,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(d)? +(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(d))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(d)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(d):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(d)))))}else this.openLocalFile(d,null,!0)}a.stopPropagation();a.preventDefault()}))}; +EditorUi.prototype.highlightElement=function(a){var b=0,d=0,c,e;if(null==a){e=document.body;var h=document.documentElement;c=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-3}else b=a.offsetTop,d=a.offsetLeft,c=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=b+"px";h.style.left=d+"px";h.style.width= +Math.max(0,c-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var d=new mxCodec(b.ownerDocument),c=new mxGraphModel;d.decode(b,c);b=c.getChildAt(c.getRoot(),0);for(d=0;d<c.getChildCount(b);d++)a.push(c.getChildAt(b,d))}return a};EditorUi.prototype.openFiles= +function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var d=0;d<a.length;d++)mxUtils.bind(this,function(a){var d=new FileReader;d.onload=mxUtils.bind(this,function(d){var c=d.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&& +"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(A){this.handleError(A,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.vsdx)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e)||/(\.vsd)($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,e))this.parseFile(a, +mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==c.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(c,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear(); +this.spinner.stop()}));else if("<mxlibrary"==d.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,d.target.result,a.name))}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(c=this.extractGraphModelFromPng(c)),this.spinner.stop(),this.openLocalFile(c,e,b)}});d.onerror=mxUtils.bind(this, +function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?d.readAsDataURL(a):d.readAsText(a)})(a[d])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this, +a,b||this.defaultFilename,c))});null!=a&&0<a.length&&(null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"), +null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function d(a){if(null!=a){var d=a.lastIndexOf(".");0<d&&(a=a.substring(d+1, +a.length));null==b[a]&&(b[a]=!0)}}var c=this.editor.graph,e=c.getCellStyle(a);d(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));c.model.isEdge(a)&&(d(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),d(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=c.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(c.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility= +a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden")};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this, +function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&& +this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale, +page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,d=!1,c=!1,e=null,h=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!= +a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(Q){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(E){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!= +h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title); +this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft", +result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(E){k.postMessage(JSON.stringify({event:"draft",error:E.toString(),message:h}),"*")}return}if("template"== +h.action){this.spinner.stop();var l=1==h.enableRecent,n=1==h.enableSearch,l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,d){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:d}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=a;k.postMessage(JSON.stringify({event:"recentDocs"}), +"*")}):null,n?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,d){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:d}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==h.action)this.searchReadyCallback(h.list,h.errorMsg);else if("recentDocsList"==h.action)this.recentReadyCallback(h.list, +h.errorMsg);else{if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var p=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,p):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null== +h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var m=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(m);k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage); +"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(m))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),w=q.getGlobalVariable,y=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?y.getName():"pagenumber"==a?1:w.apply(this,arguments)};document.body.appendChild(q.container); +q.model.setRoot(y.root)}this.exportToCanvas(mxUtils.bind(this,function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(m)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!= +h.xml&&0<h.xml.length&&this.setFileData(h.xml);p=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),p.xml=mxUtils.getXml(l),p.data=this.getFileData(null,null,!0,null,null,null,l),p.format=h.format;else if("html"==h.format)m=this.editor.getGraphXml(),p.data=this.getHtml(m,this.editor.graph),p.xml=mxUtils.getXml(m),p.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background; +l==mxConstants.NONE&&(l=null);p.xml=this.getFileData(!0);p.format="svg";if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(l), +mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(p),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));p.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(p),"*")}return}if("load"==h.action)c=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified= +h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan), +this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}}h=g(h);d=!0;try{a(h,f)}catch(E){this.handleError(E)}d=!1;null!=urlParams.modified&&this.editor.setStatus("");var I=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&& +1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=I();c&&null==b&&(b=mxUtils.bind(this,function(a,b){var c=I();if(c!=e&&!d){var f=this.createLoadMessage("autosave");f.xml=c;c=JSON.stringify(f);(window.opener||window.parent).postMessage(c,"*")}e=c}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged", +b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}): +urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize= +"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})), +a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog= +function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),d=[];if(0<b.length){var c={},e=null,h=null,k="auto",l="auto",n=null,q=null,t=40,C=40,x=0,z=this.editor.graph; +z.getGraphBounds();for(var B=function(){z.setSelectionCells(Y);z.scrollCellToVisible(z.getSelectionCell())},F=z.getFreeInsertPoint(),H=F.x,L=F.y,F=L,y=null,I="auto",E=[],Q=null,X=null,R=0;R<b.length&&"#"==b[R].charAt(0);){a=b[R];for(R++;R<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[R].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[R].substring(1)),R++;if("#"!=a.charAt(1)){var Z=a.indexOf(":");if(0<Z){var G=mxUtils.trim(a.substring(1,Z)),K=mxUtils.trim(a.substring(Z+1));"label"==G?y=z.sanitizeHtml(K): +"style"==G?e=K:"identity"==G&&0<K.length&&"-"!=K?h=K:"width"==G?k=K:"height"==G?l=K:"left"==G&&0<K.length?n=K:"top"==G&&0<K.length?q=K:"ignore"==G?X=K.split(","):"connect"==G?E.push(JSON.parse(K)):"link"==G?Q=K:"padding"==G?x=parseFloat(K):"edgespacing"==G?t=parseFloat(K):"nodespacing"==G?C=parseFloat(K):"layout"==G&&(I=K)}}}var S=this.editor.csvToArray(b[R]);a=null;if(null!=h)for(var J=0;J<S.length;J++)if(h==S[J]){a=J;break}null==y&&(y="%"+S[0]+"%");if(null!=E)for(var N=0;N<E.length;N++)null==c[E[N].to]&& +(c[E[N].to]={});z.model.beginUpdate();try{for(J=R+1;J<b.length;J++){var U=this.editor.csvToArray(b[J]);if(U.length==S.length){var D=null,W=null!=a?U[a]:null;null!=W&&(D=z.model.getCell(W));null==D&&(D=new mxCell(y,new mxGeometry(H,F,0,0),e||"whiteSpace=wrap;html=1;"),D.vertex=!0,D.id=W);for(var O=0;O<U.length;O++)z.setAttributeForCell(D,S[O],U[O]);z.setAttributeForCell(D,"placeholders","1");D.style=z.replacePlaceholders(D,D.style);for(N=0;N<E.length;N++)c[E[N].to][D.getAttribute(E[N].to)]=D;null!= +Q&&"link"!=Q&&(z.setLinkForCell(D,D.getAttribute(Q)),z.setAttributeForCell(D,Q,null));z.fireEvent(new mxEventObject("cellsInserted","cells",[D]));var T=this.editor.graph.getPreferredSizeForCell(D);D.vertex&&(null!=n&&null!=D.getAttribute(n)&&(D.geometry.x=H+parseFloat(D.getAttribute(n))),null!=q&&null!=D.getAttribute(q)&&(D.geometry.y=L+parseFloat(D.getAttribute(q))),"@"==k.charAt(0)&&null!=D.getAttribute(k.substring(1))?D.geometry.width=parseFloat(D.getAttribute(k.substring(1))):D.geometry.width= +"auto"==k?T.width+x:parseFloat(k),"@"==l.charAt(0)&&null!=D.getAttribute(l.substring(1))?D.geometry.height=parseFloat(D.getAttribute(l.substring(1))):D.geometry.height="auto"==l?T.height+x:parseFloat(l),F+=D.geometry.height+C);d.push(z.addCell(D))}}for(var V=d.slice(),Y=d.slice(),N=0;N<E.length;N++)for(var M=E[N],J=0;J<d.length;J++){var D=d[J],ca=D.getAttribute(M.from);if(null!=ca){z.setAttributeForCell(D,M.from,null);for(var da=ca.split(","),O=0;O<da.length;O++){var aa=c[M.to][da[O]];null!=aa&&(y= +M.label,null!=M.fromlabel&&(y=(D.getAttribute(M.fromlabel)||"")+(y||"")),null!=M.tolabel&&(y=(y||"")+(aa.getAttribute(M.tolabel)||"")),Y.push(z.insertEdge(null,null,y||"",M.invert?aa:D,M.invert?D:aa,M.style||z.createCurrentEdgeStyle())),mxUtils.remove(M.invert?D:aa,V))}}}if(null!=X)for(J=0;J<d.length;J++)for(D=d[J],O=0;O<X.length;O++)z.setAttributeForCell(D,mxUtils.trim(X[O]),null);var ea=new mxParallelEdgeLayout(z);ea.spacing=t;var la=function(){ea.execute(z.getDefaultParent());for(var a=0;a<d.length;a++){var b= +z.getCellGeometry(d[a]);b.x=Math.round(z.snap(b.x));b.y=Math.round(z.snap(b.y));"auto"==k&&(b.width=Math.round(z.snap(b.width)));"auto"==l&&(b.height=Math.round(z.snap(b.height)))}};if("circle"==I){var ha=new mxCircleLayout(z);ha.resetEdges=!1;var ra=ha.isVertexIgnored;ha.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){ha.execute(z.getDefaultParent());la()},!0,B);B=null}else if("horizontaltree"==I||"verticaltree"==I||"auto"==I&&Y.length== +2*d.length-1&&1==V.length){z.view.validate();var fa=new mxCompactTreeLayout(z,"horizontaltree"==I);fa.levelDistance=C;fa.edgeRouting=!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(z.getDefaultParent(),0<V.length?V[0]:null)},!0,B);B=null}else if("horizontalflow"==I||"verticalflow"==I||"auto"==I&&1==V.length){z.view.validate();var ma=new mxHierarchicalLayout(z,"horizontalflow"==I?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ma.intraCellSpacing=C;ma.disableEdgeStyle=!1;this.executeLayout(function(){ma.execute(z.getDefaultParent(), +Y);z.moveCells(Y,H,L)},!0,B);B=null}else if("organic"==I||"auto"==I&&Y.length>d.length){z.view.validate();var ba=new mxFastOrganicLayout(z);ba.forceConstant=3*C;ba.resetEdges=!1;var pa=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return pa.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ea=new mxParallelEdgeLayout(z);ea.spacing=t;this.executeLayout(function(){ba.execute(z.getDefaultParent());la()},!0,B);B=null}this.hideDialog()}finally{z.model.endUpdate()}null!=B&&B()}}catch(ia){this.handleError(ia)}}; +EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var d="?",c;for(c in urlParams)0>mxUtils.indexOf(a,c)&&null!=urlParams[c]&&(b+=d+c+"="+urlParams[c],d="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var d="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "), +c;for(c in urlParams)0>mxUtils.indexOf(d,c)&&(a=0==b?a+"?":a+"&",null!=urlParams[c]&&(a+=c+"="+urlParams[c],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var n=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=n.apply(this,arguments),d=this.editor.graph,c=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(d.container)&&d.pageVisible&& +null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return c.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(d.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width* +b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(d.container)&&null!=this.source.minimumGraphSize){var c=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*c.x))/2)-c.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*c.y))/2)-c.y-5/a))}return new mxPoint(8/ +a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=d.getPageLayout(),b=d.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,d){var c=d.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat= +e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(c.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var d=0;null==this.drive&&"function"!==typeof window.DriveClient|| +d++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||d++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||d++;b||null==this.gitHub||d++;b||null==this.trello&&"function"!==typeof window.TrelloClient||d++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&d++;mxClient.IS_IOS||d++;return d};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled(); +this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c); +a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!= +this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding= +"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,k=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b= +'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+ +IMAGE_PATH+'/clear.gif"/>'}a!=k&&(this.offlineStatus.innerHTML=b,k=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){}; +EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var q=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){q.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b); +this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b); +this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("rename").setEnabled(null!=c&&c.isRenamable());this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted()); +a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,e,k,h){var d=a.editor.graph;if("xml"== +c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(d.getSvg(e,k,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=d.getGraphBounds(),l=Math.floor(g.width*k/d.view.scale),n=Math.floor(g.height*k/d.view.scale);f.length<=MAX_REQUEST_SIZE&&l*n<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+ +encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+l+"&h="+n+"&border="+h+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,e){this.ui=a;this.page=b;this.previous=this.name=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))}; function MovePage(a,b,e){this.ui=a;this.oldIndex=b;this.newIndex=e}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))}; function SelectPage(a,b){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b))} @@ -3028,8 +3030,8 @@ a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);e=d;e=b.apply(this,arg return b}function e(a){var b=!1;null!=a&&(a=w.getParent(a),b=h.view.getState(a),h.view.getState(a),b=null!=(null!=b?b.style:h.getCellStyle(a)).childLayout);return b}function q(a){a=h.view.getState(a);if(null!=a){var b=h.getIncomingEdges(a.cell);if(0<b.length&&(b=h.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())< a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function t(a,b){b=null!=b?b:!0;h.model.beginUpdate();try{var c=h.model.getParent(a),d=h.getIncomingEdges(a),e=h.cloneCells([d[0],a]);h.model.setTerminal(e[0],h.model.getTerminal(d[0],!0),!0);var f=q(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+ 10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);h.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=h.view.getState(a),l=h.view.scale;if(null!=k){var n=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*l:n.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var m=h.getOutgoingEdges(h.model.getTerminal(d[0], -!0));if(null!=m){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=d=0;t<m.length;t++){var r=h.model.getTerminal(m[t],!1);if(f==q(r)){var x=h.view.getState(r);r!=a&&null!=x&&(p&&b!=x.getCenterX()<k.getCenterX()||!p&&b!=x.getCenterY()<k.getCenterY())&&mxUtils.intersects(n,x)&&(d=10+Math.max(d,(Math.min(n.x+n.width,x.x+x.width)-Math.max(n.x,x.x))/l),g=10+Math.max(g,(Math.min(n.y+n.height,x.y+x.height)-Math.max(n.y,x.y))/l))}}p?g=0:d=0;for(t=0;t<m.length;t++)if(r=h.model.getTerminal(m[t], -!1),f==q(r)&&(x=h.view.getState(r),r!=a&&null!=x&&(p&&b!=x.getCenterX()<k.getCenterX()||!p&&b!=x.getCenterY()<k.getCenterY()))){var u=[];h.traverse(x.cell,!0,function(a,b){null!=b&&u.push(b);u.push(a);return!0});h.moveCells(u,(b?1:-1)*d,(b?1:-1)*g)}}}return h.addCells(e,c)}finally{h.model.endUpdate()}}function d(a){h.model.beginUpdate();try{var b=q(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(c[0],d[1],!1);h.model.setTerminal(d[0],d[1],!0);h.model.setTerminal(d[0],a,!1); +!0));if(null!=m){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=d=0;t<m.length;t++){var r=h.model.getTerminal(m[t],!1);if(f==q(r)){var u=h.view.getState(r);r!=a&&null!=u&&(p&&b!=u.getCenterX()<k.getCenterX()||!p&&b!=u.getCenterY()<k.getCenterY())&&mxUtils.intersects(n,u)&&(d=10+Math.max(d,(Math.min(n.x+n.width,u.x+u.width)-Math.max(n.x,u.x))/l),g=10+Math.max(g,(Math.min(n.y+n.height,u.y+u.height)-Math.max(n.y,u.y))/l))}}p?g=0:d=0;for(t=0;t<m.length;t++)if(r=h.model.getTerminal(m[t], +!1),f==q(r)&&(u=h.view.getState(r),r!=a&&null!=u&&(p&&b!=u.getCenterX()<k.getCenterX()||!p&&b!=u.getCenterY()<k.getCenterY()))){var y=[];h.traverse(u.cell,!0,function(a,b){null!=b&&y.push(b);y.push(a);return!0});h.moveCells(y,(b?1:-1)*d,(b?1:-1)*g)}}}return h.addCells(e,c)}finally{h.model.endUpdate()}}function d(a){h.model.beginUpdate();try{var b=q(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(c[0],d[1],!1);h.model.setTerminal(d[0],d[1],!0);h.model.setTerminal(d[0],a,!1); var e=h.model.getParent(a),f=e.geometry,g=[];h.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);h.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-40):b==mxConstants.DIRECTION_WEST?(k=-40,l=0):b==mxConstants.DIRECTION_EAST&&(l=0);h.moveCells(g,k,l);return h.addCells(d,e)}finally{h.model.endUpdate()}}function f(a){h.model.beginUpdate();try{var b= h.model.getParent(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(d[0],a,!0);var c=h.getOutgoingEdges(a),e=b.geometry,f=[];h.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var k=h.model.getTerminal(c[g],!1);null!=k&&f.push(k)}var l=h.view.getBounds(f),n=q(a),m=h.view.translate,p=h.view.scale;n==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(l.x+l.width)/p-m.x-e.x+10,d[1].geometry.y+=a.geometry.height- e.y+40):n==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(l.x+l.width)/p-m.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=n==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==l?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(l.y+l.height)/p-m.y+-e.y+10);return h.addCells(d,b)}finally{h.model.endUpdate()}}function g(a, @@ -3043,9 +3045,9 @@ function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=h.getIncomingEdges(a[f]) a)}this.model.beginUpdate();try{var k=r.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var l=h.getIncomingEdges(k[e]),g=h.getIncomingEdges(a[e]);if(0==l.length&&0<g.length){var n=this.cloneCells([g[0]])[0];this.addEdge(n,h.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var A=h.moveCells;h.moveCells=function(a,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var n=f,m=this.view.getState(f),p=null!=m?m.style:this.getCellStyle(f); if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||h.model.isEdge(a[q])&&null==h.model.getTerminal(a[q],!0)){f=h.model.getParent(a[q]);break}if(null!=n&&f!=n&&null!=this.view.getState(a[0])){var t=h.getIncomingEdges(a[0]);if(0<t.length){var r=h.view.getState(h.model.getTerminal(t[0],!0));if(null!=r){var u=h.view.getState(n);null!=u&&(c=(u.getCenterX()-r.getCenterX())/h.view.scale,d=(u.getCenterY()-r.getCenterY())/h.view.scale)}}}}l=A.apply(this,arguments); if(null!=l&&null!=a&&l.length==a.length)for(q=0;q<l.length;q++)if(this.model.isEdge(l[q]))b(n)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q],n,!0);else if(b(a[q])&&(t=h.getIncomingEdges(a[q]),0<t.length))if(!e)b(n)&&0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],n,!0);else if(0==h.getIncomingEdges(l[q]).length){m=n;if(null==m||m==h.model.getParent(a[q]))m=h.model.getTerminal(t[0],!0);e=this.cloneCells([t[0]])[0];this.addEdge(e, -h.getDefaultParent(),m,l[q])}}finally{this.model.endUpdate()}return l};if(null!=m.sidebar){var C=m.sidebar.dropAndConnect;m.sidebar.dropAndConnect=function(a,c,d,e){var f=h.model,g=null;f.beginUpdate();try{if(g=C.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=h.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var y={88:m.actions.get("selectChildren"), +h.getDefaultParent(),m,l[q])}}finally{this.model.endUpdate()}return l};if(null!=m.sidebar){var C=m.sidebar.dropAndConnect;m.sidebar.dropAndConnect=function(a,c,d,e){var f=h.model,g=null;f.beginUpdate();try{if(g=C.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=h.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var x={88:m.actions.get("selectChildren"), 84:m.actions.get("selectSubtree"),80:m.actions.get("selectParent"),83:m.actions.get("selectSiblings")},z=m.onKeyDown;m.onKeyDown=function(a){try{if(h.isEnabled()&&!h.isEditing()&&b(h.getSelectionCell())&&1==h.getSelectionCount()){var c=null;0<h.getIncomingEdges(h.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?d(h.getSelectionCell()):f(h.getSelectionCell()):13==a.which&&(c=t(h.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&h.model.isEdge(c[0])?h.setSelectionCell(h.model.getTerminal(c[0], -!1)):h.setSelectionCell(c[c.length-1]),null!=m.hoverIcons&&m.hoverIcons.update(h.view.getState(h.getSelectionCell())),h.startEditingAtCell(h.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=y[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(h.getSelectionCell(), +!1)):h.setSelectionCell(c[c.length-1]),null!=m.hoverIcons&&m.hoverIcons.update(h.view.getState(h.getSelectionCell())),h.startEditingAtCell(h.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=x[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(h.getSelectionCell(), mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(p(h.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(Q){console.log("error",Q)}mxEvent.isConsumed(a)||z.apply(this,arguments)};var B=h.connectVertex;h.connectVertex=function(a,c,e,g,k,l){var n=h.getIncomingEdges(a);return b(a)&&0<n.length?(e=q(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,k=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,e==c?f(a):g==k?d(a):t(a,c!=mxConstants.DIRECTION_NORTH&& c!=mxConstants.DIRECTION_WEST)):B.call(this,a,c,e,g,k,l)};h.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&h.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var F=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){F.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"), this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells); @@ -3120,7 +3122,7 @@ GraphViewer.initCss=function(){try{var a=document.createElement("style");a.type= GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,b,e){if(null!=GraphViewer.cachedUrls[a])b(GraphViewer.cachedUrls[a]);else{var c=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;c.open("GET",a);c.onload=function(){b(null!=c.getText?c.getText():c.responseText)};c.onerror=e;c.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0; (function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(e,c){function k(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function l(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function n(b,c){if(!b.resizedAttached)b.resizedAttached= new k,b.resizedAttached.add(c);else if(b.resizedAttached){b.resizedAttached.add(c);return}b.resizeSensor=document.createElement("div");b.resizeSensor.className="resize-sensor";b.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";b.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>'; -b.appendChild(b.resizeSensor);"static"==l(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],g=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};g();var n=!1,p=function(){b.resizedAttached&&(n&&(b.resizedAttached.call(),n=!1),a(p))};a(p);var q,t,y,z,B=function(){if((y=b.offsetWidth)!=q||(z=b.offsetHeight)!=t)n=!0,q=y,t=z;g()},F=function(a,b,c){a.attachEvent? +b.appendChild(b.resizeSensor);"static"==l(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],g=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};g();var n=!1,p=function(){b.resizedAttached&&(n&&(b.resizedAttached.call(),n=!1),a(p))};a(p);var q,t,x,z,B=function(){if((x=b.offsetWidth)!=q||(z=b.offsetHeight)!=t)n=!0,q=x,t=z;g()},F=function(a,b,c){a.attachEvent? a.attachEvent("on"+b,c):a.addEventListener(b,c)};F(d,"scroll",B);F(f,"scroll",B)}var q=function(){GraphViewer.resizeSensorEnabled&&c()},t=Object.prototype.toString.call(e),d="[object Array]"===t||"[object NodeList]"===t||"[object HTMLCollection]"===t||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(d)for(var t=0,f=e.length;t<f;t++)n(e[t],q);else n(e,q);this.detach=function(){if(d)for(var a=0,c=e.length;a<c;a++)b.detach(e[a]);else b.detach(e)}}; b.detach=function(a){a.resizeSensor&&(a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)};window.ResizeSensor=b})(); (function(){Editor.initMath();GraphViewer.initCss();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();