(self["webpackChunk"] = self["webpackChunk"] || []).push([[45152],{ /***/ 60028: /*!**********************************************************!*\ !*** ./node_modules/_antd@5.9.0@antd/es/upload/index.js ***! \**********************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _Dragger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Dragger */ 71409); /* harmony import */ var _Upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Upload */ 37714); "use client"; const Upload = _Upload__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z; Upload.Dragger = _Dragger__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z; Upload.LIST_IGNORE = _Upload__WEBPACK_IMPORTED_MODULE_0__/* .LIST_IGNORE */ .E; /* harmony default export */ __webpack_exports__.Z = (Upload); /***/ }), /***/ 71737: /*!************************************************************************************!*\ !*** ./node_modules/_gojs-react@1.1.3@gojs-react/lib/esm/gojsreact.js + 1 modules ***! \************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { FI: function() { return /* binding */ ReactDiagram; } }); // UNUSED EXPORTS: ReactOverview, ReactPalette ;// CONCATENATED MODULE: ./node_modules/_tslib@2.5.3@tslib/tslib.es6.mjs /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { var context = {}; for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; for (var p in contextIn.access) context.access[p] = contextIn.access[p]; context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); if (_ = accept(result.get)) descriptor.get = _; if (_ = accept(result.set)) descriptor.set = _; if (_ = accept(result.init)) initializers.unshift(_); } else if (_ = accept(result)) { if (kind === "field") initializers.unshift(_); else descriptor[key] = _; } } if (target) Object.defineProperty(target, contextIn.name, descriptor); done = true; }; function __runInitializers(thisArg, initializers, value) { var useValue = arguments.length > 2; for (var i = 0; i < initializers.length; i++) { value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); } return useValue ? value : void 0; }; function __propKey(x) { return typeof x === "symbol" ? x : "".concat(x); }; function __setFunctionName(f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); }; function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } function __classPrivateFieldIn(state, receiver) { if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); return typeof state === "function" ? receiver === state : state.has(receiver); } /* harmony default export */ var tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, }); // EXTERNAL MODULE: ./node_modules/_gojs3@2.3.10@gojs3/release/go-module.js var go_module = __webpack_require__(12378); // EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js var _react_17_0_2_react = __webpack_require__(59301); ;// CONCATENATED MODULE: ./node_modules/_gojs-react@1.1.3@gojs-react/lib/esm/gojsreact.js /*! Copyright (C) 1998-2025 by Northwoods Software Corporation. All Rights Reserved. */ var ReactDiagram = (function (_super) { __extends(ReactDiagram, _super); function ReactDiagram(props) { var _this = _super.call(this, props) || this; _this.wasCleared = false; _this.modelChangedListener = null; _this.divRef = _react_17_0_2_react.createRef(); return _this; } ReactDiagram.prototype.getDiagram = function () { if (this.divRef.current === null) return null; return go_module/* Diagram */.S0.fromDiv(this.divRef.current); }; ReactDiagram.prototype.clear = function () { var diagram = this.getDiagram(); if (diagram !== null) { diagram.clear(); this.wasCleared = true; } }; ReactDiagram.prototype.componentDidMount = function () { var _this = this; if (this.divRef.current === null) return; var diagram = this.props.initDiagram(); diagram.div = this.divRef.current; this.modelChangedListener = function (e) { if (e.isTransactionFinished && e.model && !e.model.isReadOnly && _this.props.onModelChange) { var dataChanges = e.model.toIncrementalData(e); if (dataChanges !== null) _this.props.onModelChange(dataChanges, e); } }; diagram.addModelChangedListener(this.modelChangedListener); diagram.delayInitialization(function () { _this.mergeData(diagram, true); }); }; ReactDiagram.prototype.componentWillUnmount = function () { var diagram = this.getDiagram(); if (diagram !== null) { diagram.div = null; if (this.modelChangedListener !== null) { diagram.removeModelChangedListener(this.modelChangedListener); this.modelChangedListener = null; } } }; ReactDiagram.prototype.shouldComponentUpdate = function (nextProps, nextState) { if (nextProps.divClassName !== this.props.divClassName || nextProps.style !== this.props.style) return true; if (nextProps.skipsDiagramUpdate) return false; if (nextProps.nodeDataArray === this.props.nodeDataArray && nextProps.linkDataArray === this.props.linkDataArray && nextProps.modelData === this.props.modelData) return false; return true; }; ReactDiagram.prototype.componentDidUpdate = function (prevProps, prevState) { var _this = this; if (prevProps.nodeDataArray === this.props.nodeDataArray && prevProps.linkDataArray === this.props.linkDataArray && prevProps.modelData === this.props.modelData) return; var diagram = this.getDiagram(); if (diagram !== null) { if (this.wasCleared) { diagram.delayInitialization(function () { _this.mergeData(diagram, true); _this.wasCleared = false; }); } else { this.mergeData(diagram, false); } } }; ReactDiagram.prototype.mergeData = function (diagram, isInit) { var _this = this; var model = diagram.model; model.commit(function (m) { if (_this.props.modelData !== undefined) { m.assignAllDataProperties(m.modelData, _this.props.modelData); } m.mergeNodeDataArray(_this.props.nodeDataArray); if (_this.props.linkDataArray !== undefined && m instanceof go_module/* GraphLinksModel */.FJ) { m.mergeLinkDataArray(_this.props.linkDataArray); } }, isInit ? 'initial merge' : 'merge data'); }; ReactDiagram.prototype.render = function () { return (_react_17_0_2_react.createElement("div", { ref: this.divRef, className: this.props.divClassName, style: this.props.style })); }; return ReactDiagram; }(_react_17_0_2_react.Component)); var ReactOverview = (function (_super) { __extends(ReactOverview, _super); function ReactOverview(props) { var _this = _super.call(this, props) || this; _this.divRef = _react_17_0_2_react.createRef(); return _this; } ReactOverview.prototype.getOverview = function () { if (this.divRef.current === null) return null; return go_module/* Diagram */.S0.fromDiv(this.divRef.current); }; ReactOverview.prototype.componentDidMount = function () { if (this.divRef.current === null) return; var overview; if (this.props.initOverview !== undefined) { overview = this.props.initOverview(); } else { overview = new go_module/* Overview */.g2(); overview.contentAlignment = go_module/* Spot */.z6.Center; } overview.div = this.divRef.current; overview.observed = this.props.observedDiagram; }; ReactOverview.prototype.componentWillUnmount = function () { var overview = this.getOverview(); if (overview !== null) { overview.div = null; overview.observed = null; } }; ReactOverview.prototype.shouldComponentUpdate = function (nextProps, nextState) { if (nextProps.divClassName !== this.props.divClassName || nextProps.style !== this.props.style) return true; if (nextProps.observedDiagram === this.props.observedDiagram) return false; return true; }; ReactOverview.prototype.componentDidUpdate = function (prevProps, prevState) { if (prevProps.observedDiagram === this.props.observedDiagram) return; var overview = this.getOverview(); if (overview !== null) { overview.observed = this.props.observedDiagram; } }; ReactOverview.prototype.render = function () { return (_react_17_0_2_react.createElement("div", { ref: this.divRef, className: this.props.divClassName, style: this.props.style })); }; return ReactOverview; }(_react_17_0_2_react.Component)); var ReactPalette = (function (_super) { __extends(ReactPalette, _super); function ReactPalette(props) { var _this = _super.call(this, props) || this; _this.wasCleared = false; _this.divRef = _react_17_0_2_react.createRef(); return _this; } ReactPalette.prototype.getPalette = function () { if (this.divRef.current === null) return null; return go_module/* Diagram */.S0.fromDiv(this.divRef.current); }; ReactPalette.prototype.clear = function () { var palette = this.getPalette(); if (palette !== null) { palette.clear(); this.wasCleared = true; } }; ReactPalette.prototype.componentDidMount = function () { var _this = this; if (this.divRef.current === null) return; var palette = this.props.initPalette(); palette.div = this.divRef.current; palette.delayInitialization(function () { _this.mergeData(palette, true); }); }; ReactPalette.prototype.componentWillUnmount = function () { var palette = this.getPalette(); if (palette !== null) { palette.div = null; } }; ReactPalette.prototype.shouldComponentUpdate = function (nextProps, nextState) { if (nextProps.divClassName !== this.props.divClassName || nextProps.style !== this.props.style) return true; if (nextProps.nodeDataArray === this.props.nodeDataArray && nextProps.linkDataArray === this.props.linkDataArray && nextProps.modelData === this.props.modelData) return false; return true; }; ReactPalette.prototype.componentDidUpdate = function (prevProps, prevState) { var _this = this; if (prevProps.nodeDataArray === this.props.nodeDataArray && prevProps.linkDataArray === this.props.linkDataArray && prevProps.modelData === this.props.modelData) return; var palette = this.getPalette(); if (palette !== null) { if (this.wasCleared) { palette.delayInitialization(function () { _this.mergeData(palette, true); _this.wasCleared = false; }); } else { this.mergeData(palette, false); } } }; ReactPalette.prototype.mergeData = function (diagram, isInit) { var _this = this; var model = diagram.model; model.commit(function (m) { if (_this.props.modelData !== undefined) { m.assignAllDataProperties(m.modelData, _this.props.modelData); } m.mergeNodeDataArray(_this.props.nodeDataArray); if (_this.props.linkDataArray !== undefined && m instanceof go_module/* GraphLinksModel */.FJ) { m.mergeLinkDataArray(_this.props.linkDataArray); } }, isInit ? 'initial merge' : 'merge data'); }; ReactPalette.prototype.render = function () { return (_react_17_0_2_react.createElement("div", { ref: this.divRef, className: this.props.divClassName, style: this.props.style })); }; return ReactPalette; }(_react_17_0_2_react.Component)); /***/ }), /***/ 12378: /*!***************************************************************!*\ !*** ./node_modules/_gojs3@2.3.10@gojs3/release/go-module.js ***! \***************************************************************/ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $u: function() { return /* binding */ Size; }, /* harmony export */ BD: function() { return /* binding */ Brush; }, /* harmony export */ E9: function() { return /* binding */ Point; }, /* harmony export */ FF: function() { return /* binding */ TreeLayout; }, /* harmony export */ FJ: function() { return /* binding */ GraphLinksModel; }, /* harmony export */ Hn: function() { return /* binding */ Model; }, /* harmony export */ KX: function() { return /* binding */ Binding; }, /* harmony export */ NB: function() { return /* binding */ Node; }, /* harmony export */ S0: function() { return /* binding */ Diagram; }, /* harmony export */ UL: function() { return /* binding */ Rect; }, /* harmony export */ Vk: function() { return /* binding */ ChangedEvent; }, /* harmony export */ al: function() { return /* binding */ TextBlock; }, /* harmony export */ bn: function() { return /* binding */ Shape; }, /* harmony export */ bx: function() { return /* binding */ GraphObject; }, /* harmony export */ g2: function() { return /* binding */ Overview; }, /* harmony export */ h1: function() { return /* binding */ DraggingTool; }, /* harmony export */ hD: function() { return /* binding */ ForceDirectedLayout; }, /* harmony export */ l4: function() { return /* binding */ Set; }, /* harmony export */ rU: function() { return /* binding */ Link; }, /* harmony export */ s_: function() { return /* binding */ Panel; }, /* harmony export */ z6: function() { return /* binding */ Spot; } /* harmony export */ }); /* unused harmony exports go, Group, EnumValue, List, Map, Margin, Geometry, PathFigure, PathSegment, InputEvent, DiagramEvent, TreeModel, Transaction, UndoManager, CommandHandler, Tool, DraggingInfo, LinkingBaseTool, LinkingTool, RelinkingTool, LinkReshapingTool, ResizingTool, RotatingTool, ClickSelectingTool, ActionTool, ClickCreatingTool, HTMLInfo, ContextMenuTool, DragSelectingTool, PanningTool, TextEditingTool, ToolManager, Animation, AnimationManager, AnimationTrigger, Layer, Palette, RowColumnDefinition, TextBlockMetrics, Picture, Part, Adornment, Placeholder, Layout, LayoutNetwork, LayoutVertex, LayoutEdge, GridLayout, PanelLayout, CircularLayout, CircularNetwork, CircularVertex, CircularEdge, ForceDirectedNetwork, ForceDirectedVertex, ForceDirectedEdge, LayeredDigraphLayout, LayeredDigraphNetwork, LayeredDigraphVertex, LayeredDigraphEdge, TreeNetwork, TreeVertex, TreeEdge, version */ /* module decorator */ module = __webpack_require__.hmd(module); /* * GoJS v2.3.10 JavaScript Library for HTML Diagrams, https://gojs.net * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com. * Copyright (C) 1998-2023 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.3.10/license.html. * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE. */ (function() { var t;function aa(a){var b=0;return function(){return bc&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c=a.length?a.push(c):a.splice(b,0,c):C("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Da(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):C("Cannot remove an object from an HTMLCollection or NodeList at "+b)} function Ea(){var a=Fa.pop();return void 0===a?[]:a}function Ga(a){a.length=0;Fa.push(a)}function Ha(a){if("function"===typeof a){if(a.className)return a.className;if(a.name)return a.name;var b=a.toString();b=b.substring(9,b.indexOf("(")).trim();if(""!==b)return a._className=b}else if(za(a)&&a.constructor)return Ha(a.constructor);return typeof a} function Ia(a){var b=a;za(a)&&(a.text?b=a.text:a.name?b=a.name:void 0!==a.key?b=a.key:void 0!==a.id?b=a.id:a.constructor===Object&&(a.Text?b=a.Text:a.Name?b=a.Name:void 0!==a.Key?b=a.Key:void 0!==a.Id?b=a.Id:void 0!==a.ID&&(b=a.ID)));return void 0===b?"undefined":null===b?"null":b.toString()}function Ja(a,b){if(a.hasOwnProperty(b))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(b))return!0;var c=a.CA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function Ka(a,b,c){Object.defineProperty(La.prototype,a,{get:b,set:c})} function Ma(a){for(var b=[],c=0;256>c;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);c=[];for(var d=0,e=0;ec;c++)b[c]=c;for(c=d=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;d=c=0;for(var f="",g=0;g-1 || f.indexOf('© 1998-2021 Northwoods Software')>-1 || f.indexOf('Not for distribution or production use')>-1 || f.indexOf('gojs.net')>-1 ){ return ''; }else{ return f};return f} var Na=void 0!==x.navigator&&0this.key)return!1;a=a.s;var b=a.length,c=++this.Za,d=this.qf;if(null!==d)for(;cthis.key)return!1;var b=--this.Za;if(0<=b)return this.key=b,this.value=a.s[b],!0;this.de();return!1};ab.prototype.Ad=function(){return this.next()}; ab.prototype.first=function(){var a=this.Bb;this.qa=a.Ja;var b=a.s;this.Za=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};ab.prototype.any=function(a){var b=this.Bb;b.Hg=null;b=b.s;var c=b.length;this.Za=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};ab.prototype.all=function(a){var b=this.Bb;b.Hg=null;b=b.s;var c=b.length;this.Za=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0}; ab.prototype.each=function(a){var b=this.Bb;b.Hg=null;b=b.s;var c=b.length;this.Za=c;for(--c;0<=c;c--)a(b[c]);return this};ab.prototype.map=function(a){var b=this.Bb;b.Hg=null;var c=[];b=b.s;var d=b.length;this.Za=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new F;a.s=c;a.xb();return a.iterator};ab.prototype.filter=function(a){var b=this.Bb;b.Hg=null;var c=[];b=b.s;var d=b.length;this.Za=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new F;a.s=c;a.xb();return a.iterator}; ab.prototype.de=function(){this.key=-1;this.value=null;this.qa=-1;this.Bb.Hg=this};ab.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"};ma.Object.defineProperties(ab.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}});ab.prototype.first=ab.prototype.first;ab.prototype.hasNext=ab.prototype.Ad;ab.prototype.next=ab.prototype.next;ab.prototype.reset=ab.prototype.reset; ab.className="ListIteratorBackwards";function F(a){Qa(this);this._isFrozen=!1;this.s=[];this.Ja=0;this.Hg=this.Sa=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=F.prototype;t.xb=function(){var a=this.Ja;a++;999999999a||a>=b.length)&&xa(a,"0 <= i < length",F,"elt:i");return b[a]};t.get=function(a){return this.M(a)};t.cd=function(a,b){var c=this.s;(0>a||a>=c.length)&&xa(a,"0 <= i < length",F,"setElt:i");this._isFrozen&&va(this,a);c[a]=b};t.set=function(a,b){this.cd(a,b)};t.first=function(){var a=this.s;return 0===a.length?null:a[0]};t.jc=function(){var a=this.s,b=a.length;return 0a&&xa(a,">= 0",F,"insertAt:i");this._isFrozen&&va(this,a);var c=this.s;a>=c.length?c.push(b):c.splice(a,0,b);this.xb()};t.remove=function(a){if(null===a)return!1;this._isFrozen&&va(this,a);var b=this.s;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.xb();return!0};t.delete=function(a){return this.remove(a)}; t.mb=function(a){var b=this.s;(0>a||a>=b.length)&&xa(a,"0 <= i < length",F,"removeAt:i");this._isFrozen&&va(this,a);a===b.length-1?b.pop():b.splice(a,1);this.xb()};t.removeRange=function(a,b){var c=this.s,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this._isFrozen&&va(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&xa(b,"0 <= from < length",F,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0=e)d.sort(a);else for(b=d.slice(0,c),b.sort(a),a=0;a=e)for(c=d.slice(b),c.sort(a),a=b;a=this.s.length)return Ya;var a=this.Sa;return null!==a?(a.reset(),a):new $a(this)}},iteratorBackwards:{ get:function(){if(0>=this.s.length)return Ya;var a=this.Hg;return null!==a?(a.reset(),a):new ab(this)}}});F.prototype.reverse=F.prototype.reverse;F.prototype.sortRange=F.prototype.zi;F.prototype.sort=F.prototype.sort;F.prototype.toSet=F.prototype.Iv;F.prototype.toArray=F.prototype.Fa;F.prototype.removeRange=F.prototype.removeRange;F.prototype.removeAt=F.prototype.mb;F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.insertAt=F.prototype.Gb; F.prototype.pop=F.prototype.pop;F.prototype.last=F.prototype.jc;F.prototype.first=F.prototype.first;F.prototype.set=F.prototype.set;F.prototype.setElt=F.prototype.cd;F.prototype.get=F.prototype.get;F.prototype.elt=F.prototype.M;F.prototype.indexOf=F.prototype.indexOf;F.prototype.has=F.prototype.has;F.prototype.contains=F.prototype.contains;F.prototype.clear=F.prototype.clear;F.prototype.addAll=F.prototype.addAll;F.prototype.push=F.prototype.push;F.prototype.add=F.prototype.add;F.prototype.thaw=F.prototype.ka; F.prototype.freeze=F.prototype.freeze;F.className="List";function cb(a){this.eg=a;a.Sa=null;this.qa=a.Ja;this.sa=null}cb.prototype.reset=function(){var a=this.eg;a.Sa=null;this.qa=a.Ja;this.sa=null};cb.prototype.next=function(){var a=this.eg;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.va;if(null!==b)return this.sa=b,this.value=b.value,this.key=b.key,!0;this.de();return!1};cb.prototype.Ad=function(){return this.next()}; cb.prototype.first=function(){var a=this.eg;this.qa=a.Ja;a=a.ea;if(null!==a){this.sa=a;var b=a.value;this.key=a.key;return this.value=b}return null};cb.prototype.any=function(a){var b=this.eg;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(a(b.value))return!0;b=b.va}return!1};cb.prototype.all=function(a){var b=this.eg;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(!a(b.value))return!1;b=b.va}return!0};cb.prototype.each=function(a){var b=this.eg;this.sa=b.Sa=null;for(b=b.ea;null!==b;)a(b.value),b=b.va;return this}; cb.prototype.map=function(a){var b=this.eg;b.Sa=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b.value)),b=b.va;return c.iterator};cb.prototype.filter=function(a){var b=this.eg;b.Sa=null;var c=new F;for(b=b.ea;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.va}return c.iterator};cb.prototype.de=function(){this.value=this.key=null;this.qa=-1;this.eg.Sa=this};cb.prototype.toString=function(){return null!==this.sa?"SetIterator@"+this.sa.value:"SetIterator"}; ma.Object.defineProperties(cb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}});cb.prototype.first=cb.prototype.first;cb.prototype.hasNext=cb.prototype.Ad;cb.prototype.next=cb.prototype.next;cb.prototype.reset=cb.prototype.reset;cb.className="SetIterator"; function H(a){Qa(this);this._isFrozen=!1;this.Tb={};this.Sb=0;this.Sa=null;this.Ja=0;this.kf=this.ea=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=H.prototype;t.xb=function(){var a=this.Ja;a++;999999999=this.Sb)return Ya;var a=this.Sa;return null!==a?(a.reset(),a):new cb(this)}}});H.prototype.toList=H.prototype.Hv;H.prototype.toArray=H.prototype.Fa; H.prototype.clear=H.prototype.clear;H.prototype.retainAll=H.prototype.pA;H.prototype.removeAll=H.prototype.hp;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.first=H.prototype.first;H.prototype.containsAny=H.prototype.Ty;H.prototype.containsAll=H.prototype.Sy;H.prototype.has=H.prototype.has;H.prototype.contains=H.prototype.contains;H.prototype.addAll=H.prototype.addAll;H.prototype.add=H.prototype.add;H.prototype.thaw=H.prototype.ka;H.prototype.freeze=H.prototype.freeze; var jb=1;H.className="Set";H.uniqueHash=Qa;H.hashIdUnique=fb;H.hashId=bb;function kb(a){this.ma=a;this.qa=a.Ja;this.sa=null}kb.prototype.reset=function(){this.qa=this.ma.Ja;this.sa=null};kb.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.va;if(null!==b)return this.sa=b,this.value=this.key=a=b.key,!0;this.de();return!1};kb.prototype.Ad=function(){return this.next()}; kb.prototype.first=function(){var a=this.ma;this.qa=a.Ja;a=a.ea;return null!==a?(this.sa=a,this.value=this.key=a=a.key):null};kb.prototype.any=function(a){var b=this.ma;this.sa=null;for(b=b.ea;null!==b;){if(a(b.key))return!0;b=b.va}return!1};kb.prototype.all=function(a){var b=this.ma;this.sa=null;for(b=b.ea;null!==b;){if(!a(b.key))return!1;b=b.va}return!0};kb.prototype.each=function(a){var b=this.ma;this.sa=null;for(b=b.ea;null!==b;)a(b.key),b=b.va;return this}; kb.prototype.map=function(a){var b=this.ma;this.sa=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b.key)),b=b.va;return c.iterator};kb.prototype.filter=function(a){var b=this.ma;this.sa=null;var c=new F;for(b=b.ea;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.va}return c.iterator};kb.prototype.de=function(){this.value=this.key=null;this.qa=-1};kb.prototype.toString=function(){return null!==this.sa?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"}; ma.Object.defineProperties(kb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}});kb.prototype.first=kb.prototype.first;kb.prototype.hasNext=kb.prototype.Ad;kb.prototype.next=kb.prototype.next;kb.prototype.reset=kb.prototype.reset;kb.className="MapKeySetIterator";function lb(a){H.call(this);Qa(this);this._isFrozen=!0;this.ma=a}la(lb,H);t=lb.prototype;t.freeze=function(){return this};t.ka=function(){return this}; t.toString=function(){return"MapKeySet("+this.ma.toString()+")"};t.add=function(){C("This Set is read-only: "+this.toString())};t.contains=function(a){return this.ma.contains(a)};t.has=function(a){return this.contains(a)};t.remove=function(){C("This Set is read-only: "+this.toString())};t.delete=function(a){return this.remove(a)};t.clear=function(){C("This Set is read-only: "+this.toString())};t.first=function(){var a=this.ma.ea;return null!==a?a.key:null}; lb.prototype.any=function(a){for(var b=this.ma.ea;null!==b;){if(a(b.key))return!0;b=b.va}return!1};lb.prototype.all=function(a){for(var b=this.ma.ea;null!==b;){if(!a(b.key))return!1;b=b.va}return!0};lb.prototype.each=function(a){for(var b=this.ma.ea;null!==b;)a(b.key),b=b.va;return this};lb.prototype.map=function(a){for(var b=new H,c=this.ma.ea;null!==c;)b.add(a(c.key)),c=c.va;return b};lb.prototype.filter=function(a){for(var b=new H,c=this.ma.ea;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.va}return b}; lb.prototype.copy=function(){return new lb(this.ma)};lb.prototype.Iv=function(){var a=new H,b=this.ma.Tb,c;for(c in b)a.add(b[c].key);return a};lb.prototype.Fa=function(){var a=this.ma.Tb,b=Array(this.ma.Sb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};lb.prototype.Hv=function(){var a=new F,b=this.ma.Tb,c;for(c in b)a.add(b[c].key);return a}; ma.Object.defineProperties(lb.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?Ya:new kb(this.ma)}}});lb.prototype.toList=lb.prototype.Hv;lb.prototype.toArray=lb.prototype.Fa;lb.prototype.toSet=lb.prototype.Iv;lb.prototype.first=lb.prototype.first;lb.prototype.clear=lb.prototype.clear;lb.prototype["delete"]=lb.prototype.delete; lb.prototype.remove=lb.prototype.remove;lb.prototype.has=lb.prototype.has;lb.prototype.contains=lb.prototype.contains;lb.prototype.add=lb.prototype.add;lb.prototype.thaw=lb.prototype.ka;lb.prototype.freeze=lb.prototype.freeze;lb.className="MapKeySet";function mb(a){this.ma=a;a.jf=null;this.qa=a.Ja;this.sa=null}mb.prototype.reset=function(){var a=this.ma;a.jf=null;this.qa=a.Ja;this.sa=null}; mb.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.va;if(null!==b)return this.sa=b,this.value=b.value,this.key=b.key,!0;this.de();return!1};mb.prototype.Ad=function(){return this.next()};mb.prototype.first=function(){var a=this.ma;this.qa=a.Ja;a=a.ea;if(null!==a){this.sa=a;var b=a.value;this.key=a.key;return this.value=b}return null}; mb.prototype.any=function(a){var b=this.ma;this.sa=b.jf=null;for(b=b.ea;null!==b;){if(a(b.value))return!0;b=b.va}return!1};mb.prototype.all=function(a){var b=this.ma;this.sa=b.jf=null;for(b=b.ea;null!==b;){if(!a(b.value))return!1;b=b.va}return!0};mb.prototype.each=function(a){var b=this.ma;this.sa=b.jf=null;for(b=b.ea;null!==b;)a(b.value),b=b.va;return this};mb.prototype.map=function(a){var b=this.ma;this.sa=b.jf=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b.value)),b=b.va;return c.iterator}; mb.prototype.filter=function(a){var b=this.ma;this.sa=b.jf=null;var c=new F;for(b=b.ea;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.va}return c.iterator};mb.prototype.de=function(){this.value=this.key=null;this.qa=-1;this.ma.jf=this};mb.prototype.toString=function(){return null!==this.sa?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"};ma.Object.defineProperties(mb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}); mb.prototype.first=mb.prototype.first;mb.prototype.hasNext=mb.prototype.Ad;mb.prototype.next=mb.prototype.next;mb.prototype.reset=mb.prototype.reset;mb.className="MapValueSetIterator";function ib(a,b){this.key=a;this.value=b;this.ll=this.va=null}ib.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};ib.className="KeyValuePair";function nb(a){this.ma=a;a.Sa=null;this.qa=a.Ja;this.sa=null}nb.prototype.reset=function(){var a=this.ma;a.Sa=null;this.qa=a.Ja;this.sa=null}; nb.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.va;if(null!==b)return this.sa=b,this.key=b.key,this.value=b.value,!0;this.de();return!1};nb.prototype.Ad=function(){return this.next()};nb.prototype.first=function(){var a=this.ma;this.qa=a.Ja;a=a.ea;return null!==a?(this.sa=a,this.key=a.key,this.value=a.value,a):null};nb.prototype.any=function(a){var b=this.ma;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(a(b))return!0;b=b.va}return!1}; nb.prototype.all=function(a){var b=this.ma;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(!a(b))return!1;b=b.va}return!0};nb.prototype.each=function(a){var b=this.ma;this.sa=b.Sa=null;for(b=b.ea;null!==b;)a(b),b=b.va;return this};nb.prototype.map=function(a){var b=this.ma;this.sa=b.Sa=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b)),b=b.va;return c.iterator};nb.prototype.filter=function(a){var b=this.ma;this.sa=b.Sa=null;var c=new F;for(b=b.ea;null!==b;)a(b)&&c.add(b),b=b.va;return c.iterator}; nb.prototype.de=function(){this.value=this.key=null;this.qa=-1;this.ma.Sa=this};nb.prototype.toString=function(){return null!==this.sa?"MapIterator@"+this.sa:"MapIterator"};ma.Object.defineProperties(nb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}});nb.prototype.first=nb.prototype.first;nb.prototype.hasNext=nb.prototype.Ad;nb.prototype.next=nb.prototype.next;nb.prototype.reset=nb.prototype.reset; nb.className="MapIterator";function ob(a){Qa(this);this._isFrozen=!1;this.Tb={};this.Sb=0;this.jf=this.Sa=null;this.Ja=0;this.kf=this.ea=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=ob.prototype;t.xb=function(){var a=this.Ja;a++;999999999=this.count)return Ya;var a=this.Sa;return null!==a?(a.reset(),a):new nb(this)}},iteratorKeys:{get:function(){return 0>=this.count?Ya:new kb(this)}},iteratorValues:{get:function(){if(0>=this.count)return Ya; var a=this.jf;return null!==a?(a.reset(),a):new mb(this)}}});ob.prototype.toKeySet=ob.prototype.Lf;ob.prototype.toArray=ob.prototype.Fa;ob.prototype.clear=ob.prototype.clear;ob.prototype["delete"]=ob.prototype.delete;ob.prototype.remove=ob.prototype.remove;ob.prototype.get=ob.prototype.get;ob.prototype.getValue=ob.prototype.I;ob.prototype.has=ob.prototype.has;ob.prototype.contains=ob.prototype.contains;ob.prototype.first=ob.prototype.first;ob.prototype.addAll=ob.prototype.addAll; ob.prototype.set=ob.prototype.set;ob.prototype.add=ob.prototype.add;ob.prototype.thaw=ob.prototype.ka;ob.prototype.freeze=ob.prototype.freeze;ob.className="Map";function J(a,b){void 0===a?this.y=this.x=0:"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):C("Invalid arguments to Point constructor: "+a+", "+b);this._isFrozen=!1}var pb,qb,rb,sb,tb;J.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};J.prototype.h=function(a,b){this.x=a;this.y=b;return this}; J.prototype.sg=function(a,b){this.x=a;this.y=b;return this};J.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};J.prototype.copy=function(){var a=new J;a.x=this.x;a.y=this.y;return a};t=J.prototype;t.ja=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this}; t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this};function ub(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new J(c,e)}return new J}function vb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.D=function(a){return a instanceof J?this.x===a.x&&this.y===a.y:!1}; t.hi=function(a,b){return this.x===a&&this.y===b};t.Xa=function(a){return K.B(this.x,a.x)&&K.B(this.y,a.y)};t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.re=function(a){this.x-=a.x;this.y-=a.y;return this};t.offset=function(a,b){this.x+=a;this.y+=b;return this}; J.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;360<=a?a-=360:0>a&&(a+=360);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));this.x=a*b-d*c;this.y=d*b+a*c;return this};t=J.prototype;t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.Bf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.zd=function(a,b){a-=this.x;b-=this.y;return a*a+b*b}; t.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0b?270:0;if(0===b)return 0a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}t.Ry=function(a,b){return K.Fl(a.x,a.y,b.x,b.y,this.x,this.y)}; t.fA=function(a,b,c,d){K.qh(a,b,c,d,this.x,this.y,this);return this};t.gA=function(a,b){K.qh(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.uA=function(a,b,c,d){K.No(this.x,this.y,a,b,c,d,this);return this};t.vA=function(a,b){K.No(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};t.xi=function(a,b){this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};t.yi=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this}; t.transform=function(a){a.Ga(this);return this};function xb(a,b){b.Cd(a);return a}function yb(a,b,c,d,e,f){var g=e-c,h=f-d,k=g*g+h*h;c-=a;d-=b;var l=-c*g-d*h;if(0>=l||l>=k)return g=e-a,h=f-b,Math.min(c*c+d*d,g*g+h*h);a=g*d-h*c;return a*a/k}function zb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b}function Ab(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0b?270:0;if(0===b)return 0a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d} t.w=function(){return isFinite(this.x)&&isFinite(this.y)};J.alloc=function(){var a=Bb.pop();return void 0===a?new J:a};J.allocAt=function(a,b){var c=Bb.pop();if(void 0===c)return new J(a,b);c.x=a;c.y=b;return c};J.free=function(a){Bb.push(a)};J.prototype.isReal=J.prototype.w;J.prototype.setSpot=J.prototype.yi;J.prototype.setRectSpot=J.prototype.xi;J.prototype.snapToGridPoint=J.prototype.vA;J.prototype.snapToGrid=J.prototype.uA;J.prototype.projectOntoLineSegmentPoint=J.prototype.gA; J.prototype.projectOntoLineSegment=J.prototype.fA;J.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return K.Rl(a,b,c,d,e,f,g,h)};J.prototype.compareWithLineSegmentPoint=J.prototype.Ry;J.compareWithLineSegment=function(a,b,c,d,e,f){return K.Fl(a,b,c,d,e,f)};J.prototype.direction=J.prototype.direction;J.prototype.directionPoint=J.prototype.ab;J.prototype.normalize=J.prototype.normalize;J.prototype.distanceSquared=J.prototype.zd;J.prototype.distanceSquaredPoint=J.prototype.Bf;J.prototype.scale=J.prototype.scale; J.prototype.rotate=J.prototype.rotate;J.prototype.offset=J.prototype.offset;J.prototype.subtract=J.prototype.re;J.prototype.add=J.prototype.add;J.prototype.equalsApprox=J.prototype.Xa;J.prototype.equalTo=J.prototype.hi;J.prototype.equals=J.prototype.D;J.prototype.set=J.prototype.set;J.prototype.setTo=J.prototype.sg;var Bb=[];J.className="Point";J.parse=ub;J.stringify=vb;J.distanceLineSegmentSquared=yb;J.distanceSquared=zb;J.direction=Ab;J.Origin=pb=(new J(0,0)).ja(); J.InfiniteTopLeft=qb=(new J(-Infinity,-Infinity)).ja();J.InfiniteBottomRight=rb=(new J(Infinity,Infinity)).ja();J.SixPoint=sb=(new J(6,6)).ja();J.NoPoint=tb=(new J(NaN,NaN)).ja();J.parse=ub;J.stringify=vb;J.distanceLineSegmentSquared=yb;J.distanceSquared=zb;J.direction=Ab; function L(a,b){void 0===a?this.height=this.width=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.width=a,this.height=b):C("Invalid arguments to Size constructor: "+a+", "+b);this._isFrozen=!1}var Cb,Gb,Hb,Ib,Jb,Kb,Lb;L.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};L.prototype.h=function(a,b){this.width=a;this.height=b;return this};L.prototype.sg=function(a,b){this.width=a;this.height=b;return this}; L.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};L.prototype.copy=function(){var a=new L;a.width=this.width;a.height=this.height;return a};t=L.prototype;t.ja=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this}; function Mb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new L(c,e)}return new L}function Nb(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.D=function(a){return a instanceof L?this.width===a.width&&this.height===a.height:!1};t.hi=function(a,b){return this.width===a&&this.height===b}; t.Xa=function(a){return K.B(this.width,a.width)&&K.B(this.height,a.height)};t.Bc=function(a,b){a=this.width+a;this.width=0<=a?a:0;b=this.height+b;this.height=0<=b?b:0;return this};t.w=function(){return isFinite(this.width)&&isFinite(this.height)};L.alloc=function(){var a=Ob.pop();return void 0===a?new L:a};L.free=function(a){Ob.push(a)};L.prototype.isReal=L.prototype.w;L.prototype.inflate=L.prototype.Bc;L.prototype.equalsApprox=L.prototype.Xa;L.prototype.equalTo=L.prototype.hi; L.prototype.equals=L.prototype.D;L.prototype.set=L.prototype.set;L.prototype.setTo=L.prototype.sg;var Ob=[];L.className="Size";L.parse=Mb;L.stringify=Nb;L.ZeroSize=Cb=(new L(0,0)).ja();L.OneSize=Gb=(new L(1,1)).ja();L.SixSize=Hb=(new L(6,6)).ja();L.EightSize=Ib=(new L(8,8)).ja();L.TenSize=Jb=(new L(10,10)).ja();L.InfiniteSize=Kb=(new L(Infinity,Infinity)).ja();L.NoSize=Lb=(new L(NaN,NaN)).ja();L.parse=Mb;L.stringify=Nb; function N(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.x=a,this.y=b,this.width=c,this.height=d):a instanceof J?(c=a.x,a=a.y,b instanceof J?(d=b.x,b=b.y,this.x=Math.min(c,d),this.y=Math.min(a,b),this.width=Math.abs(c-d),this.height=Math.abs(a-b)):b instanceof L?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):C("Incorrect second argument supplied to Rect constructor "+ b)):C("Invalid arguments to Rect constructor: "+a+", "+b+", "+c+", "+d);this._isFrozen=!1}t=N.prototype;t.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};t.h=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};function Pb(a,b,c){a.width=b;a.height=c}t.sg=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};t.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this}; t.dd=function(a){this.x=a.x;this.y=a.y;return this};t.tA=function(a){this.width=a.width;this.height=a.height;return this};N.prototype.copy=function(){var a=new N;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};t=N.prototype;t.ja=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this}; t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this};function Qb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return new N(c,e,f,g)}return new N} function Rb(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.D=function(a){return a instanceof N?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};t.hi=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Xa=function(a){return K.B(this.x,a.x)&&K.B(this.y,a.y)&&K.B(this.width,a.width)&&K.B(this.height,a.height)}; function Ub(a,b){return K.$(a.x,b.x)&&K.$(a.y,b.y)&&K.$(a.width,b.width)&&K.$(a.height,b.height)}t.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.Re=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height};t.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height};t.offset=function(a,b){this.x+=a;this.y+=b;return this}; t.Bc=function(a,b){return Vb(this,b,a,b,a)};t.Co=function(a){return Vb(this,a.top,a.right,a.bottom,a.left)};t.Fv=function(a){return Vb(this,-a.top,-a.right,-a.bottom,-a.left)};t.Hz=function(a,b,c,d){return Vb(this,a,b,c,d)};function Vb(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}t.Ex=function(a){return Wb(this,a.x,a.y,a.width,a.height)};t.Uu=function(a,b,c,d){return Wb(this,a,b,c,d)}; function Wb(a,b,c,d,e){var f=Math.max(a.x,b),g=Math.max(a.y,c);b=Math.min(a.x+a.width,b+d);c=Math.min(a.y+a.height,c+e);a.x=f;a.y=g;a.width=Math.max(0,b-f);a.height=Math.max(0,c-g);return a}t.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)};t.Vu=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0}; function Xb(a,b){var c=a.width,d=a.x,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.height;a=a.y;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.Ye=function(a){return Yb(this,a.x,a.y,0,0)};t.ed=function(a){return Yb(this,a.x,a.y,a.width,a.height)};t.Kv=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return Yb(this,a,b,c,d)}; function Yb(a,b,c,d,e){var f=Math.min(a.x,b),g=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=g;a.width=b-f;a.height=c-g;return a}t.yi=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};function Zb(a,b,c,d,e,f,g,h){void 0===g&&(g=0);void 0===h&&(h=0);return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d}function $b(a,b,c,d,e,f,g,h){return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0} t.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Mz=function(){return 0===this.width&&0===this.height};N.alloc=function(){var a=ac.pop();return void 0===a?new N:a};N.allocAt=function(a,b,c,d){var e=ac.pop();return void 0===e?new N(a,b,c,d):e.h(a,b,c,d)};N.free=function(a){ac.push(a)}; ma.Object.defineProperties(N.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{ get:function(){return new J(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new L(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new J(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2}, set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}});N.prototype.isEmpty=N.prototype.Mz;N.prototype.isReal=N.prototype.w;N.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return K.Fx(a,b,c,d,e,f,g,h)};N.prototype.setSpot=N.prototype.yi;N.prototype.union=N.prototype.Kv;N.prototype.unionRect=N.prototype.ed;N.prototype.unionPoint=N.prototype.Ye;N.prototype.intersects=N.prototype.Vu; N.prototype.intersectsRect=N.prototype.Yc;N.prototype.intersect=N.prototype.Uu;N.prototype.intersectRect=N.prototype.Ex;N.prototype.grow=N.prototype.Hz;N.prototype.subtractMargin=N.prototype.Fv;N.prototype.addMargin=N.prototype.Co;N.prototype.inflate=N.prototype.Bc;N.prototype.offset=N.prototype.offset;N.prototype.contains=N.prototype.contains;N.prototype.containsRect=N.prototype.Re;N.prototype.containsPoint=N.prototype.ca;N.prototype.equalsApprox=N.prototype.Xa;N.prototype.equalTo=N.prototype.hi; N.prototype.equals=N.prototype.D;N.prototype.setSize=N.prototype.tA;N.prototype.setPoint=N.prototype.dd;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.sg;var bc=null,cc=null,ac=[];N.className="Rect";N.parse=Qb;N.stringify=Rb;N.contains=Zb;N.intersects=$b;N.ZeroRect=bc=(new N(0,0,0,0)).ja();N.NoRect=cc=(new N(NaN,NaN,NaN,NaN)).ja();N.parse=Qb;N.stringify=Rb;N.contains=Zb;N.intersects=$b; function dc(a,b,c,d){void 0===a?this.left=this.bottom=this.right=this.top=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(this.top=a,this.right=b,this.bottom=a,this.left=b):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):C("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this._isFrozen=!1}dc.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this}; dc.prototype.sg=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};dc.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};dc.prototype.copy=function(){var a=new dc;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};t=dc.prototype;t.ja=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()}; t.freeze=function(){this._isFrozen=!0;return this};t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this}; function ic(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new dc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new dc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new dc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new dc(c,e):new dc(c,e,f,g)}return new dc} function jc(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}t.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};t.D=function(a){return a instanceof dc?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};t.hi=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d}; t.Xa=function(a){return K.B(this.top,a.top)&&K.B(this.right,a.right)&&K.B(this.bottom,a.bottom)&&K.B(this.left,a.left)};t.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};dc.alloc=function(){var a=kc.pop();return void 0===a?new dc:a};dc.free=function(a){kc.push(a)};dc.prototype.isReal=dc.prototype.w;dc.prototype.equalsApprox=dc.prototype.Xa;dc.prototype.equalTo=dc.prototype.hi;dc.prototype.equals=dc.prototype.D;dc.prototype.set=dc.prototype.set; dc.prototype.setTo=dc.prototype.sg;var lc=null,mc=null,kc=[];dc.className="Margin";dc.parse=ic;dc.stringify=jc;dc.ZeroMargin=lc=(new dc(0,0,0,0)).ja();dc.TwoMargin=mc=(new dc(2,2,2,2)).ja();dc.parse=ic;dc.stringify=jc;function O(a,b,c,d){void 0===a?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d);this._isFrozen=!1} var rc,sc,tc,uc,vc,wc,yc,zc,Ac,Bc,Cc,Dc,Ec,Fc,Gc,Ic,Jc,Kc,Lc,Mc,Nc,Oc,Pc,Qc,Rc,Sc,Wc,Xc,Yc,Zc,$c,ad,bd,cd,dd,gd;O.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this};O.prototype.sg=function(a,b,c,d){this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this};O.prototype.set=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this}; O.prototype.copy=function(){var a=new O;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};t=O.prototype;t.ja=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this};function hd(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a} function id(a){if("string"===typeof a){a=a.trim();if("None"===a)return rc;if("TopLeft"===a)return sc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return tc;if("TopRight"===a)return uc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return vc;if("Center"===a)return wc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return yc;if("BottomLeft"===a)return zc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Ac;if("BottomRight"===a)return Bc;if("TopSide"===a)return Cc;if("LeftSide"=== a)return Dc;if("RightSide"===a)return Ec;if("BottomSide"===a)return Fc;if("TopBottomSides"===a)return Gc;if("LeftRightSides"===a)return Ic;if("TopLeftSides"===a)return Jc;if("TopRightSides"===a)return Kc;if("BottomLeftSides"===a)return Lc;if("BottomRightSides"===a)return Mc;if("NotTopSide"===a)return Nc;if("NotLeftSide"===a)return Oc;if("NotRightSide"===a)return Pc;if("NotBottomSide"===a)return Qc;if("AllSides"===a)return Rc;if("Default"===a)return Sc;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; var d=a[b++];void 0!==d&&0a&&(a+=360);if(0===a)return this;this.translate(b,c);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.m12*a+this.m22*d,f=this.m11*-d+this.m21*a,g=this.m12*-d+this.m22*a;this.m11=this.m11*a+this.m21*d;this.m12=e;this.m21=f;this.m22=g;this.translate(-b,-c);return this};t=ld.prototype;t.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this}; t.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.Ga=function(a){var b=a.x,c=a.y;return a.h(b*this.m11+c*this.m21+this.dx,b*this.m12+c*this.m22+this.dy)};t.Cd=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=a.x,d=a.y;return a.h(c*this.m22*b+d*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx),c*-this.m12*b+d*this.m11*b+b*(this.m12*this.dx-this.m11*this.dy))}; t.Eu=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=1.25*a.x,d=1.2*a.y;return a.h(c*this.m22*b+d*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx),c*-this.m12*b+d*this.m11*b+b*(this.m12*this.dx-this.m11*this.dy))}; t.pp=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,g=this.m12,h=this.m21,k=this.m22,l=this.dx,m=this.dy,n=b*f+c*h+l,p=b*g+c*k+m,q=d*f+c*h+l,r=d*g+c*k+m;c=b*f+e*h+l;b=b*g+e*k+m;f=d*f+e*h+l;d=d*g+e*k+m;e=Math.min(n,q);n=Math.max(n,q);q=Math.min(p,r);p=Math.max(p,r);e=Math.min(e,c);n=Math.max(n,c);q=Math.min(q,b);p=Math.max(p,b);e=Math.min(e,f);n=Math.max(n,f);q=Math.min(q,d);p=Math.max(p,d);a.h(e,q,n-e,p-q);return a};ld.alloc=function(){var a=md.pop();return void 0===a?new ld:a}; ld.free=function(a){md.push(a)};ld.prototype.transformRect=ld.prototype.pp;ld.prototype.transformPoint=ld.prototype.Ga;ld.prototype.scale=ld.prototype.scale;ld.prototype.translate=ld.prototype.translate;ld.prototype.rotate=ld.prototype.rotate;ld.prototype.invert=ld.prototype.Vj;ld.prototype.multiplyInverted=ld.prototype.bv;ld.prototype.multiply=ld.prototype.multiply;ld.prototype.reset=ld.prototype.reset;ld.prototype.isIdentity=ld.prototype.ws;ld.prototype.equals=ld.prototype.D; ld.prototype.setTransform=ld.prototype.setTransform;ld.prototype.set=ld.prototype.set;var md=[];ld.className="Transform";ld.xF="54a702f3e53909c447824c6706603faf4c"; var K={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(a){if(0>=a)return 0;var b=K.Uv;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);K.Uv=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},B:function(a,b){a-=b;return.5>a&&-.5a&&-5E-8=e&&(e=1E-6);if(am-l)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=g&&g<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(g=(c-a)/(d-b)*(g-b)+a,g-e<=f&&f<=g+e)return!0}else return!0;return!1},cs:function(a,b,c,d,e,f,g,h,k,l,m,n){if(K.Yb(a,b,g,h,n,c,d)&&K.Yb(a,b,g,h,n,e,f))return K.Yb(a,b,g,h,n,l,m);var p=(a+c)/2,q=(b+d)/2,r=(c+e)/2,u=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(p+r)/2;c=(q+u)/2;r=(r+e)/2;u=(u+f)/2;var w=(d+r)/2,v=(c+u)/2;return K.cs(a, b,p,q,d,c,w,v,k,l,m,n)||K.cs(w,v,r,u,e,f,g,h,k,l,m,n)},ax:function(a,b,c,d,e,f,g,h,k){var l=(c+e)/2,m=(d+f)/2;k.h((((a+c)/2+l)/2+(l+(e+g)/2)/2)/2,(((b+d)/2+m)/2+(m+(f+h)/2)/2)/2);return k},My:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Ab(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},Dl:function(a,b,c,d,e,f,g,h,k,l){if(K.Yb(a,b,g,h,k,c,d)&&K.Yb(a,b,g,h,k,e,f))Yb(l,a,b,0,0),Yb(l,g,h,0,0);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,q=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+q)/ 2;p=(p+e)/2;q=(q+f)/2;var r=(d+p)/2,u=(c+q)/2;K.Dl(a,b,m,n,d,c,r,u,k,l);K.Dl(r,u,p,q,e,f,g,h,k,l)}return l},Qe:function(a,b,c,d,e,f,g,h,k,l){if(K.Yb(a,b,g,h,k,c,d)&&K.Yb(a,b,g,h,k,e,f))0===l.length&&(l.push(a),l.push(b)),l.push(g),l.push(h);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,q=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+q)/2;p=(p+e)/2;q=(q+f)/2;var r=(d+p)/2,u=(c+q)/2;K.Qe(a,b,m,n,d,c,r,u,k,l);K.Qe(r,u,p,q,e,f,g,h,k,l)}return l},jv:function(a,b,c,d,e,f,g,h,k,l){if(K.Yb(a,b,e,f,l,c,d))return K.Yb(a, b,e,f,l,h,k);var m=(a+c)/2,n=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var p=(m+c)/2,q=(n+d)/2;return K.jv(a,b,m,n,p,q,g,h,k,l)||K.jv(p,q,c,d,e,f,g,h,k,l)},OA:function(a,b,c,d,e,f,g){g.h(((a+c)/2+(c+e)/2)/2,((b+d)/2+(d+f)/2)/2);return g},iv:function(a,b,c,d,e,f,g,h){if(K.Yb(a,b,e,f,g,c,d))Yb(h,a,b,0,0),Yb(h,e,f,0,0);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;K.iv(a,b,k,l,m,n,g,h);K.iv(m,n,c,d,e,f,g,h)}return h},ep:function(a,b,c,d,e,f,g,h){if(K.Yb(a,b,e,f,g,c,d))0===h.length&&(h.push(a), h.push(b)),h.push(e),h.push(f);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;K.ep(a,b,k,l,m,n,g,h);K.ep(m,n,c,d,e,f,g,h)}return h},Eo:function(a,b,c,d,e,f,g,h,k,l,m,n,p,q){if(K.Yb(a,b,g,h,p,c,d)&&K.Yb(a,b,g,h,p,e,f)){if(!K.Rl(a,b,g,h,k,l,m,n))return!1;p=(a-g)*(l-n)-(b-h)*(k-m);if(0===p)return!1;q.h(((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/p,((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/p);return!0}var r=(a+c)/2,u=(b+d)/2,w=(c+e)/2,v=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(r+w)/2;c=(u+v)/2;w=(w+e)/ 2;v=(v+f)/2;var y=(d+w)/2,z=(c+v)/2,A=Infinity,B=!1,D=0,M=0;K.Eo(a,b,r,u,d,c,y,z,k,l,m,n,p,q)&&(a=(q.x-k)*(q.x-k)+(q.y-l)*(q.y-l),a=m)return q; if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(ba)return q}else if(aa)return q;0p&&q--}else{r=(a+c)/2;u=(b+d)/2;var w=(c+e)/2,v=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(r+w)/2;c=(u+v)/2;w=(w+e)/2;v=(v+f)/2;var y=(d+w)/2,z=(c+v)/2;q+=K.Fo(a,b,r,u,d,c,y,z,k,l,m,n,p);q+=K.Fo(y,z,w,v,e,f,g,h,k,l,m,n,p)}return q},qh:function(a,b,c,d,e,f,g){if(K.$(a,c)){bb)return g.h(a,b),!1;g.h(a,f);return!0}if(K.$(b,d)){aa)return g.h(a,b),!1;g.h(e,b);return!0}e=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>e)return g.h(a,b),!1;if(1.000005b)return k.h(a,b),!1; k.h(a,c);return!0}g=(d-b)/(c-a);if(K.$(h,g))return K.qh(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(K.$(g,0)){aa)return k.h(a,b),!1;k.h(e,b);return!0}return K.qh(a,b,c,d,e,g*(e-a)+b,k)},MA:function(a,b,c,d,e){return K.Ve(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},KA:function(a,b,c,d,e,f,g,h,k,l){function m(c,d){var e=(c-a)*(c-a)+(d-b)*(d-b);e(c>a?c-a:a-c)){p=1-(c-e)*(c-e)/(p*p);if(0>p)return k;p=Math.sqrt(p);d=-l*p+f;m(c,l*p+f);m(c,d)}else{c=(d-b)/(c-a);d=1/(p*p)+c*c/(l*l);h=2*c*(b-c*a)/(l*l)-2*c*f/(l*l)-2*e/(p*p);p=h*h-4*d*(2*c*a*f/(l*l)-2*b*f/(l*l)+f*f/(l*l)+e*e/(p*p)-1+(b-c*a)*(b-c*a)/(l*l));if(0>p)return k;p=Math.sqrt(p);l=(-h+p)/(2*d);m(l,c*l-c*a+b);p=(-h-p)/(2*d);m(p,c*p-c*a+b)}return k},Ff:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(K.Ve(a,b,a,d,e,f,g, h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);pl},us:function(a,b,c){return K.Fx(a.x,a.y,a.width,a.height,b.x,b.y,c.x,c.y)},Fx:function(a,b,c,d,e,f,g,h){var k=a+c,l=b+d;return e===g?(f=b):f===h?(e=a):Zb(a,b,c,d,e,f)||Zb(a,b,c,d,g,h)||K.Rl(a,b,k,b,e,f,g,h)||K.Rl(k,b,k,l,e,f,g,h)||K.Rl(k,l,a,l,e,f,g,h)||K.Rl(a,l,a,b,e,f,g,h)?!0:!1},Rl:function(a,b,c,d,e,f,g,h){return a===c&&b===d&&e===g&&f===h?a===e&&b===f:0>=K.Fl(a,b,c,d,e,f)*K.Fl(a,b,c,d,g,h)&&0>=K.Fl(e,f,g,h,a,b)*K.Fl(e,f,g,h,c,d)},Fl:function(a,b,c,d,e,f){c-=a;d-=b;a=e-a;b=f-b;f=a*d-b*c;0===f&&(f=a*c+b*d,0f&&(f=0)));return f},bp:function(a){0>a&&(a+=360); 360<=a&&(a-=360);return a},jx:function(a,b,c,d,e,f){var g=Math.PI;f||(d*=g/180,e*=g/180);var h=d>e?-1:1;f=[];var k=g/2,l=d;d=Math.min(2*g,Math.abs(e-d));if(1E-5>d)return k=l+h*Math.min(d,k),h=a+c*Math.cos(l),l=b+c*Math.sin(l),a+=c*Math.cos(k),b+=c*Math.sin(k),c=(h+a)/2,k=(l+b)/2,f.push([h,l,c,k,c,k,a,b]),f;for(;1E-5c,f=0>d;if(al;++l){b=.5*(h+k);if(b===h||b===k)break;var m=a/(b+e),n=g/(b+f);m=m*m+n*n-1;if(0m)k=b;else break}c=e*c/(b+e)-c;d=f*d/(b+f)-d;c=Math.sqrt(c*c+d*d)}else c=Math.abs(d-b);else d=a*a-b*b,f=a*c,fa?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a)+"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);case P.u:var b=new N(this.startX,this.startY,0,0);b.Kv(this.endX,this.endY,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+ b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case P.F:b=new N(this.startX,this.startY,0,0);b.Kv(this.endX,this.endY,0,0);if(0>a)return a=b.left.toString()+" "+(b.y+b.height/2).toString(),"M"+a+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+(b.right.toString()+" "+(b.y+b.height/2).toString())+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+a;var c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+ c+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+(b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a))+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case P.o:b="";c=this.figures.s;for(var d=c.length,e=0;e=A-1?!0:null!==l[u+1].match(B)}function d(){u++;return l[u]}function e(a){var b=parseFloat(d()),c=parseFloat(d());w===w.toLowerCase()&&(b=z.x+b,c=z.y+c);a.h(b,c)}function f(){e(z);return z}function g(){e(y);return y}function h(){var a=v.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?z:new J(2*z.x-y.x,2*z.y-y.y)}void 0===b&&(b=!1);var k=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;a=a.replace(/,/gm," ");a=a.replace(k,"$1 $2"); a=a.replace(k,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2");a=a.replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");var l=a.split(" ");for(a=0;a=A-1);)if(v=w,w=d(),""!==w)switch(w.toUpperCase()){case "X":q=!0;n=m=!1;break;case "M":r=f();null===a.mc||!0===q?(wd(a,r.x,r.y,m,!n,p),q=!1):a.moveTo(r.x,r.y);for(k.assign(z);!c();)r=f(),a.lineTo(r.x,r.y);break;case "L":for(;!c();)r=f(),a.lineTo(r.x,r.y);break;case "H":for(;!c();)z=new J((w===w.toLowerCase()?z.x:0)+parseFloat(d()), z.y),a.lineTo(z.x,z.y);break;case "V":for(;!c();)z=new J(z.x,(w===w.toLowerCase()?z.y:0)+parseFloat(d())),a.lineTo(z.x,z.y);break;case "C":for(;!c();){r=new J;e(r);var D=g(),M=f();xd(a,r.x,r.y,D.x,D.y,M.x,M.y)}break;case "S":for(;!c();)r=h(),D=g(),M=f(),xd(a,r.x,r.y,D.x,D.y,M.x,M.y);break;case "Q":for(;!c();)r=g(),D=f(),yd(a,r.x,r.y,D.x,D.y);break;case "T":for(;!c();)y=r=h(),D=f(),yd(a,r.x,r.y,D.x,D.y);break;case "B":for(;!c();){r=parseFloat(d());D=parseFloat(d());M=parseFloat(d());var S=parseFloat(d()), R=parseFloat(d()),I=R,G=!1;c()||(I=parseFloat(d()),c()||(G=0!==parseFloat(d())));w===w.toLowerCase()&&(M+=z.x,S+=z.y);a.arcTo(r,D,M,S,R,I,G)}break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),D=Math.abs(parseFloat(d())),M=parseFloat(d()),R=S=!1,G=I=0,I=d(),1===I.length?(S=!!parseFloat(I),R=!!parseFloat(d()),I=parseFloat(d())):2===I.length?(S=!!parseFloat(I[0]),R=!!parseFloat(I[1]),I=parseFloat(d())):(S=!!parseFloat(I[0]),R=!!parseFloat(I[1]),I=parseFloat(I.slice(2))),G=parseFloat(d()),w===w.toLowerCase()&& (I=z.x+I,G=z.y+G),z.h(I,G),zd(a,r,D,M,S,R,I,G);break;case "Z":Ad(a);z.assign(k);break;case "F":r="";for(D=1;l[u+D];)if("0"===l[u+D])p=!0,D++;else if(null!==l[u+D].match(/[Uu]/))D++;else if(null===l[u+D].match(B))D++;else{r=l[u+D];break}r.match(/[Mm]/)?m=!0:0g&&(g+=360),r.startAngle+=g);0>a&&(r.startAngle=180-r.startAngle,r.sweepAngle=-r.sweepAngle); 0>d&&(r.startAngle=-r.startAngle,r.sweepAngle=-r.sweepAngle);r.radiusX*=Math.sqrt(a*a+c*c);void 0!==r.radiusY&&(r.radiusY*=Math.sqrt(b*b+d*d));break;case Md:g=r.endX;h=r.endY;r.endX=g*a+h*c+e;r.endY=g*b+h*d+f;if(0===r.radiusX||0===r.radiusY)break;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),r.xAxisRotation+=g);0>a&&(r.xAxisRotation=180-r.xAxisRotation,r.isClockwiseArc=!r.isClockwiseArc);0>d&&(r.xAxisRotation=-r.xAxisRotation,r.isClockwiseArc=!r.isClockwiseArc);r.radiusX*=Math.sqrt(a*a+c*c); r.radiusY*=Math.sqrt(b*b+d*d);break;default:C("Unknown Segment type: "+r.type)}}}}this._isInvalidBounds=!0;return this}; t.ca=function(a,b){void 0===b&&(b=0);var c=this.od,d=this.pd,e=this.Dc,f=this.Ec;switch(this.type){case P.j:return K.Yb(c,d,e,f,b,a.x,a.y);case P.u:var g=N.allocAt(Math.min(c,e)-b,Math.min(d,f)-b,Math.abs(e-c)+2*b,Math.abs(f-d)+2*b);a=g.ca(a);N.free(g);return a;case P.F:g=Math.min(c,e)-b;var h=Math.min(d,f)-b;c=(Math.abs(e-c)+2*b)/2;b=(Math.abs(f-d)+2*b)/2;if(0>=c||0>=b)return!1;g=a.x-(g+c);h=a.y-(h+b);return 1>=g*g/(c*c)+h*h/(b*b);case P.o:return Pd(this,a,b,!0,!1);default:return!1}}; function Pd(a,b,c,d,e){var f=b.x;b=b.y;for(var g=a.bounds.x-20,h=0,k,l,m,n,p=a.figures.s,q=p.length,r=0;r=a)return 0;if((e>g?e-g:g-e)<(f>h?f-h:h-f))if(fh)return 0}else{if(bf)return 0}else if(eg)return 0}else if(le)return 0;return 0a?a=0:1=f)return d=f-g,d=0===m?0:d/m,c=c[h],h=c[2*a],e=c[2*a+1],b.h(h+(c[2*a+2]-h)*d,e+(c[2*a+3]-e)*d),b;g+=m}}return b}; t.wx=function(a){0>a?a=0:1=e)return e=b[g],b=e[2*a],c=e[2*a+1],d=e[2*a+2],a=e[2*a+3],1>Math.abs(d-b)&&1>Math.abs(a-c)?0:1>Math.abs(d-b)?0<=a-c?90:270:1>Math.abs(a-c)?0<=d-b?0:180:180*Math.atan2(a-c,d-b)/Math.PI;f+=l}}return NaN}; t.Qu=function(a,b){0>a?a=0:1=f)return d=f-g,d=0===m?0:d/m,m=c[h],c=m[2*a],h=m[2*a+1],e=m[2*a+2],a=m[2* a+3],b[0]=c+(e-c)*d,b[1]=h+(a-h)*d,b[2]=1>Math.abs(e-c)&&1>Math.abs(a-h)?0:1>Math.abs(e-c)?0<=a-h?90:270:1>Math.abs(a-h)?0<=e-c?0:180:180*Math.atan2(a-h,e-c)/Math.PI,b;g+=m}}return b}; t.xx=function(a){if(this.type===P.j){var b=this.startX,c=this.startY,d=this.endX,e=this.endY;if(b!==d||c!==e){var f=a.x;a=a.y;if(b===d){if(c=d?d===c?0:1:Math.abs(a-c)/(d-g)}if(c===e)return b=d?d===b?0:1:Math.abs(f-b)/(d-g);g=(d-b)*(d-b)+(e-c)*(e-c);var h=J.alloc();K.qh(b,c,d,e,f,a,h);a=h.x;f=h.y;J.free(h);return Math.sqrt(((a-b)*(a-b)+(f-c)*(f-c))/g)}}else if(this.type===P.u){g=this.startX;h=this.startY;var k=this.endX; e=this.endY;if(g!==k||h!==e){b=k-g;c=e-h;f=2*b+2*c;d=a.x;a=a.y;d=Math.min(Math.max(d,g),k);a=Math.min(Math.max(a,h),e);g=Math.abs(d-g);k=Math.abs(d-k);h=Math.abs(a-h);e=Math.abs(a-e);var l=Math.min(g,k,h,e);if(l===h)return d/f;if(l===k)return(b+a)/f;if(l===e)return(2*b+c-d)/f;if(l===g)return(2*b+2*c-a)/f}}else{b=this.flattenedSegments;c=this.flattenedLengths;f=this.flattenedTotalLength;d=J.alloc();e=Infinity;h=g=0;k=b.length;for(var m=l=0,n=0;na?0:1a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a);for(var c=this.segments.s,d=c.length,e=0;ea&&(a+=360),this.Ne=a,this.Vh=0,this.Wh=Math.max(d,0),this.Pg=Math.max(e,0),"boolean"===typeof g?g&&(this.isLargeArc=!0):"number"===typeof g&&g&&(this.isLargeArc=!0),h&&(this.isClockwiseArc=!0)):(this.Ne=d,this.Vh=e,a===Ld&&(f=Math.max(f,0)),this.Wh=f,"number"===typeof g?(a=== Ld&&(g=Math.max(g,0)),this.Pg=g):this.Pg=0);this.ae=null}Xd.prototype.copy=function(){var a=new Xd;a.na=this.na;a.l=this.l&-2;a.Dc=this.Dc;a.Ec=this.Ec;a.Ne=this.Ne;a.Vh=this.Vh;a.Wh=this.Wh;a.Pg=this.Pg;return a};t=Xd.prototype; t.Xa=function(a){if(!(a instanceof Xd)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Dd:case pd:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY);case Ed:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.point1X,a.point1X)&&K.B(this.point1Y,a.point1Y)&&K.B(this.point2X,a.point2X)&&K.B(this.point2Y,a.point2Y);case Kd:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.point1X,a.point1X)&&K.B(this.point1Y,a.point1Y);case Ld:return K.B(this.startAngle, a.startAngle)&&K.B(this.sweepAngle,a.sweepAngle)&&K.B(this.centerX,a.centerX)&&K.B(this.centerY,a.centerY)&&K.B(this.radiusX,a.radiusX)&&K.B(this.radiusY,a.radiusY);case Md:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&K.B(this.xAxisRotation,a.xAxisRotation)&&K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.radiusX,a.radiusX)&&K.B(this.radiusY,a.radiusY);default:return!1}};t.qb=function(a){a.classType===Xd&&(this.type=a)}; t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Dd:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case pd:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Ed:a=0>a?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(a)+ " "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Kd:a=0>a?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Ld:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+ " "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(a)+" "+this.sweepAngle.toFixed(a)+" "+this.centerX.toFixed(a)+" "+this.centerY.toFixed(a)+" "+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a);break;case Md:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+ " "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.isClosed?"z":"")};t.freeze=function(){this._isFrozen=!0;return this};t.ka=function(){this._isFrozen=!1;return this};t.close=function(){this.isClosed=!0;return this}; function Nd(a,b){if(null!==a.ae&&!1===b._isInvalidBounds)return a.ae;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.ae=[],a.ae;b=a.Ne;var e=a.Vh,f=K.jx(0,0,c=q?g=Math.PI:1<=q&&(g=0);!k&&0g&&(g+=2*Math.PI);k=b>f?1:b/f;q=b>f?f/b:1;b=K.jx(0,0,b>f?b:f,m,m+g,!0);f=ld.alloc();f.reset();f.translate(c,d);f.rotate(a.Ne,0,0);f.scale(k,q);P.Ha(b,f); ld.free(f);a.ae=b;return a.ae} ma.Object.defineProperties(Xd.prototype,{_isFrozen:{get:function(){return 0!==(this.l&1)},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return 0!==(this.l&2)},set:function(a){this.l=a?this.l|2:this.l&-3}},isClosed:{get:function(){return 0!==(this.l&8)},set:function(a){this.isClosed!==a&&(this.l=a?this.l|8:this.l&-9,this._isInvalidBounds=!0)}},type:{ get:function(){return this.na},set:function(a){this._isFrozen&&va(this,a);this.na=a;this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&va(this,a);this.Dc=a;this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&va(this,a);this.Ec=a;this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&& va(this,a);this.Ne=a;this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&va(this,a);this.Vh=a;this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&va(this,a);this.Wh=a;this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&va(this,a);this.Pg=a;this._isInvalidBounds=!0}},centerX:{ get:function(){return this.Ne},set:function(a){this._isFrozen&&va(this,a);this.Ne=a;this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&va(this,a);this.Vh=a;this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&xa(a,">= zero",Xd,"radiusX");this._isFrozen&&va(this,a);this.Wh=a;this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg}, set:function(a){0>a&&xa(a,">= zero",Xd,"radiusY");this._isFrozen&&va(this,a);this.Pg=a;this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&va(this,a);a%=360;0>a&&(a+=360);this.Dc=a;this._isInvalidBounds=!0}},sweepAngle:{get:function(){return this.Ec},set:function(a){this._isFrozen&&va(this,a);360a&&(a=-360);this.Ec=a;this._isInvalidBounds=!0}},isClockwiseArc:{ get:function(){return 0!==(this.l&4)},set:function(a){this._isFrozen&&va(this,a);this.l=a?this.l|4:this.l&-5;this._isInvalidBounds=!0}},isLargeArc:{get:function(){return 0!==(this.l&16)},set:function(a){this._isFrozen&&va(this,a);this.l=a?this.l|16:this.l&-17;this._isInvalidBounds=!0}},xAxisRotation:{get:function(){return this.Ne},set:function(a){this._isFrozen&&va(this,a);a%=360;0>a&&(a+=360);this.Ne=a;this._isInvalidBounds= !0}}});Xd.prototype.equalsApprox=Xd.prototype.Xa;var Dd=new E(Xd,"Move",0),pd=new E(Xd,"Line",1),Ed=new E(Xd,"Bezier",2),Kd=new E(Xd,"QuadraticBezier",3),Ld=new E(Xd,"Arc",4),Md=new E(Xd,"SvgArc",4);Xd.className="PathSegment";Xd.Move=Dd;Xd.Line=pd;Xd.Bezier=Ed;Xd.QuadraticBezier=Kd;Xd.Arc=Ld;Xd.SvgArc=Md; function Zd(){this.H=null;this.xu=(new J(0,0)).freeze();this.mt=(new J(0,0)).freeze();this.Bp=this.Rq=0;this.Cp=1;this.xq="";this.Wr=this.Tp=!1;this.Rp=this.Ep=0;this.xg=this.nq=this.tq=!1;this.Zp=null;this.Rr=0;this.xd=this.Nr=null}Zd.prototype.copy=function(){var a=new Zd;return this.clone(a)}; Zd.prototype.clone=function(a){a.H=this.H;a.xu.assign(this.viewPoint);a.mt.assign(this.documentPoint);a.Rq=this.Rq;a.Bp=this.Bp;a.Cp=this.Cp;a.xq=this.xq;a.Tp=this.Tp;a.Wr=this.Wr;a.Ep=this.Ep;a.Rp=this.Rp;a.tq=this.tq;a.nq=this.nq;a.xg=this.xg;a.Zp=this.Zp;a.Rr=this.Rr;a.Nr=this.Nr;a.xd=this.xd;return a}; Zd.prototype.toString=function(){var a="^";0!==this.modifiers&&(a+="M:"+this.modifiers);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.clickCount&&(a+="C:"+this.clickCount);0!==this.delta&&(a+="D:"+this.delta);this.handled&&(a+="h");this.bubbles&&(a+="b");null!==this.documentPoint&&(a+="@"+this.documentPoint.toString());return a};Zd.prototype.So=function(a,b){var c=this.diagram;if(null===c)return b;$d(c,a,b);return b}; Zd.prototype.Bz=function(a,b){var c=this.diagram;if(null===c)return b;$d(c,a,b);b.assign(c.Ps(b));return b}; ma.Object.defineProperties(Zd.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},viewPoint:{get:function(){return this.xu},set:function(a){this.xu.assign(a)}},documentPoint:{get:function(){return this.mt},set:function(a){this.mt.assign(a)}},modifiers:{get:function(){return this.Rq},set:function(a){this.Rq=a}},button:{get:function(){return this.Bp}, set:function(a){this.Bp=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.Cp},set:function(a){this.Cp=a}},key:{get:function(){return this.xq},set:function(a){this.xq=a}},down:{get:function(){return this.Tp},set:function(a){this.Tp=a}},up:{get:function(){return this.Wr},set:function(a){this.Wr= a}},clickCount:{get:function(){return this.Ep},set:function(a){this.Ep=a}},delta:{get:function(){return this.Rp},set:function(a){this.Rp=a}},isMultiTouch:{get:function(){return this.tq},set:function(a){this.tq=a}},handled:{get:function(){return this.nq},set:function(a){this.nq=a}},bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},event:{ get:function(){return this.Zp},set:function(a){this.Zp=a}},isTouchEvent:{get:function(){var a=this.event;return null===a?!1:"touch"===a.pointerType||"pen"===a.pointerType}},timestamp:{get:function(){return this.Rr},set:function(a){this.Rr=a}},targetDiagram:{get:function(){return this.Nr},set:function(a){this.Nr=a}},targetObject:{get:function(){return this.xd},set:function(a){this.xd= a}},control:{get:function(){return 0!==(this.modifiers&1)},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{get:function(){return 0!==(this.modifiers&4)},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{get:function(){return 0!==(this.modifiers&2)},set:function(a){this.modifiers=a?this.modifiers|2:this.modifiers&-3}},meta:{get:function(){return 0!== (this.modifiers&8)},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&1):0===this.button},set:function(a){this.buttons=a?this.buttons|1:this.buttons&-2}},right:{get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!== a.type&&"pointerup"!==a.type?0!==(this.buttons&2):2===this.button},set:function(a){this.buttons=a?this.buttons|2:this.buttons&-3}},middle:{get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&4):1===this.button},set:function(a){this.buttons=a?this.buttons|4:this.buttons&-5}}});Zd.prototype.getMultiTouchDocumentPoint=Zd.prototype.Bz; Zd.prototype.getMultiTouchViewPoint=Zd.prototype.So;Zd.className="InputEvent";function ae(){this.H=null;this.xa="";this.ar=this.Lr=null}ae.prototype.copy=function(){var a=new ae;a.H=this.H;a.xa=this.xa;a.Lr=this.Lr;a.ar=this.ar;return a};ae.prototype.toString=function(){var a="*"+this.name;null!==this.subject&&(a+=":"+this.subject.toString());null!==this.parameter&&(a+="("+this.parameter.toString()+")");return a}; ma.Object.defineProperties(ae.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},subject:{get:function(){return this.Lr},set:function(a){this.Lr=a}},parameter:{get:function(){return this.ar},set:function(a){this.ar=a}}});ae.className="DiagramEvent"; function be(){this.Fm=ce;this.rf=this.Qq="";this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}be.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}; be.prototype.copy=function(){var a=new be;a.Fm=this.Fm;a.Qq=this.Qq;a.rf=this.rf;a.cc=this.cc;a.H=this.H;a.Qn=this.Qn;var b=this.Sn;a.Sn=za(b)&&"function"===typeof b.J?b.J():b;b=this.Rn;a.Rn=za(b)&&"function"===typeof b.J?b.J():b;b=this.Mn;a.Mn=za(b)&&"function"===typeof b.J?b.J():b;b=this.Ln;a.Ln=za(b)&&"function"===typeof b.J?b.J():b;return a};be.prototype.qb=function(a){a.classType===be&&(this.change=a)}; be.prototype.toString=function(){var a="";a=this.change===de?a+"* ":this.change===ce?a+(null!==this.model?"!m":"!d"):a+((null!==this.model?"!m":"!d")+this.change);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange);a+=": ";this.change===de?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Ia(this.object)),null!==this.oldValue&&(a+=" old: "+Ia(this.oldValue)),null!== this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Ia(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};be.prototype.I=function(a){return a?this.oldValue:this.newValue};be.prototype.Dz=function(a){return a?this.oldParam:this.newParam};be.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1}; be.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))};be.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};be.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))}; ma.Object.defineProperties(be.prototype,{model:{get:function(){return this.cc},set:function(a){this.cc=a}},diagram:{get:function(){return this.H},set:function(a){this.H=a}},change:{get:function(){return this.Fm},set:function(a){this.Fm=a}},modelChange:{get:function(){return this.Qq},set:function(a){this.Qq=a}},propertyName:{get:function(){return this.rf}, set:function(a){this.rf=a}},isTransactionFinished:{get:function(){return this.Fm===de&&("CommittedTransaction"===this.rf||"FinishedUndo"===this.rf||"FinishedRedo"===this.rf)}},object:{get:function(){return this.Qn},set:function(a){this.Qn=a}},oldValue:{get:function(){return this.Sn},set:function(a){this.Sn=a}},oldParam:{get:function(){return this.Rn},set:function(a){this.Rn=a}}, newValue:{get:function(){return this.Mn},set:function(a){this.Mn=a}},newParam:{get:function(){return this.Ln},set:function(a){this.Ln=a}}});be.prototype.redo=be.prototype.redo;be.prototype.canRedo=be.prototype.canRedo;be.prototype.undo=be.prototype.undo;be.prototype.canUndo=be.prototype.canUndo;be.prototype.getParam=be.prototype.Dz;be.prototype.getValue=be.prototype.I;be.prototype.clear=be.prototype.clear; var de=new E(be,"Transaction",-1),ce=new E(be,"Property",0),ee=new E(be,"Insert",1),fe=new E(be,"Remove",2);be.className="ChangedEvent";be.Transaction=de;be.Property=ce;be.Insert=ee;be.Remove=fe;function ge(){this.o=(new F).freeze();this.xa="";this.j=!1}ge.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0b&&a.cd(b,d),b++);for(;a.length>b;)a.pop();a.freeze()}}; ma.Object.defineProperties(ge.prototype,{changes:{get:function(){return this.o}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},isComplete:{get:function(){return this.j},set:function(a){this.j=a}}});ge.prototype.optimize=ge.prototype.ak;ge.prototype.redo=ge.prototype.redo;ge.prototype.canRedo=ge.prototype.canRedo;ge.prototype.undo=ge.prototype.undo;ge.prototype.canUndo=ge.prototype.canUndo; ge.prototype.clear=ge.prototype.clear;ge.className="Transaction";function he(){this.Pt=new H;this.Jd=!1;this.u=(new F).freeze();this.Ce=-1;this.o=999;this.Fe=!1;this.Np=null;this.bi=0;this.j=!1;this.Ie=(new F).freeze();this.hl=new F;this.tt=!0;this.Dt=this.rq=this.Gt=this.Ft=!1} he.prototype.toString=function(a){var b="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;b+="[";for(var c=this.nestedTransactionNames.count,d=0;da.transactionLevel&&ya("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel,e=a.currentTransaction;d&&b&&(a.isInternalTransaction||a.Ob("CommittingTransaction",c,e));var f=0;if(0=d&&(f=b.M(0),null!==f&&f.clear(),b.mb(0),a.Ce--)),0===d||0!==b.count&&b.get(b.count-1)===e||(b.add(e),a.Ce++),b.freeze()),a.isInternalTransaction||a.Ob("CommittedTransaction",c,e);else{a.Fe=!0;try{a.isEnabled&&null!==e&&(e.isComplete=!0,e.undo())}finally{a.isInternalTransaction||a.Ob("RolledBackTransaction",c,e),a.Fe=!1}null!== e&&e.clear()}a.Np=null;a.isPendingClear&&a.clear();a.isPendingClear=!1;a.isPendingUnmodified=!1;return!0}if(a.isEnabled&&!b&&null!==e){a=f;c=e.changes;for(e=c.count-1;e>=a;e--)b=c.M(e),null!==b&&b.undo(),c.ka(),c.mb(e);c.freeze()}return!1}t.lx=function(){if(!this.isUndoingRedoing&&this.canRedo()){var a=this.history;a.ka();for(var b=a.count-1;b>this.historyIndex;b--){var c=a.M(b);null!==c&&c.clear();a.mb(b);this.rq=!0}a.freeze()}}; he.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.tt&&(a=a.diagram,null!==a&&!1===a.pi||ya("Change not within a transaction: "+c.toString()))}}; he.prototype.skipsEvent=function(a){if(null===a||0>a.change.value)return!0;a=a.object;if(null===a)return!1;if(void 0!==a.layer){if(a=a.layer,null!==a&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1}; ma.Object.defineProperties(he.prototype,{models:{get:function(){return this.Pt.iterator}},isEnabled:{get:function(){return this.Jd},set:function(a){this.Jd=a}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.M(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndexe||Math.abs(b.y-a.y)>d}; ma.Object.defineProperties(je.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof Q&&(this.H=a)}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},isEnabled:{get:function(){return this.Jd},set:function(a){this.Jd=a}},isActive:{get:function(){return this.nb},set:function(a){this.nb=a}},transactionResult:{get:function(){return this.wm}, set:function(a){this.wm=a}}});je.prototype.startTransaction=je.prototype.Ea;je.className="Tool";function La(){je.call(this);this.name="ToolManager";this.hb=new F;this.ob=new F;this.Hb=new F;this.F=this.V=850;this.o=(new L(2,2)).ja();this.Ha=5E3;this.ia=se;this.u=ue;this.Mp=this.j=null;this.zj=-1}la(La,je);La.prototype.initializeStandardTools=function(){}; La.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof te&&this.Mp===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; La.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===ve&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===we){b.bubbles=!0;return}if(this.gestureBehavior===ve)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}for(var c=this.mouseDownTools.length,d=0;de.right&&(c.x-=d.width+5/b.scale);c.xe.bottom?c.y-(d.height+5/b.scale):c.y+20/b.scale;c.yc.pointsCount)){var d=a.diagram;if(!d.isReadOnly){var e=a.Oe;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=sf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=sf(a,c.i(c.pointsCount-1),!0),null!==h&&(k=h.part));e.isValidLink(g,f,k,h)?b?(c.defaultFromPoint=c.i(0),c.defaultToPoint=c.i(c.pointsCount-1),c.suspendsRouting=!1,c.fromNode=g,null!==f&&(c.fromPortId=f.portId),c.toNode=k,null!==h&&(c.toPortId=h.portId),c.fromPort!== d.Mx&&d.R("LinkRelinked",c,d.Mx),c.toPort!==d.Nx&&d.R("LinkRelinked",c,d.Nx)):tf(e,g,f,k,h):tf(e,null,null,null,null)}}}}Ae.prototype.doDragOver=function(){}; function uf(a,b){var c=a.diagram;a.dragsLink&&of(a,!0);Te(a);var d=a.findDragOverObject(b),e=c.lastInput;e.targetObject=d;if(null!==d){e.handled=!1;for(var f=d;null!==f;){var g=f.mouseDrop;if(null!==g&&(g(e,f),e.handled))break;vf(a,e,f);f=rf(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==De){for(e=(a.copiedParts||a.draggedParts).iterator;e.next();)f=e.key,f instanceof V&&f.linksConnected.each(function(a){a.suspendsRouting=!1});a.doDropOnto(b,d);if(a.isActive||null!==De){a=N.alloc();for(b= c.selection.iterator;b.next();)d=b.value,d instanceof V&&wf(c,d,a);N.free(a)}}}function vf(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof pf||(c=a.mouseDrop,null!==c&&c(b))}function wf(a,b,c){var d=!1;c=b.getAvoidableRect(c);a.viewportBounds.Re(c)&&(d=!0);a=a.Nu(c,function(a){return a.part},function(a){return a instanceof T},!0,function(a){return a instanceof T},d);if(0!==a.count)for(a=a.iterator;a.next();)c=a.value,!c.Td(b)&&c.isAvoiding&&c.bb()} Ae.prototype.doDropOnto=function(){};Ae.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;this.simulatedMouseMove(b.event,b.documentPoint,b.targetDiagram)||null===this.currentPart||null===this.draggedParts||(this.mayCopy()?(af(this,!1),Ge(a,this.copiedParts),cf(this,this.copiedParts,!1),Ue(a,this.copiedParts)):this.mayMove()?(We(this),cf(this,this.draggedParts,!0)):this.mayDragOut()?(af(this,!1),cf(this,this.copiedParts,!1)):We(this),nf(this,a.lastInput.documentPoint))}}; Ae.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;if(!this.simulatedMouseUp(b.event,b.documentPoint,b.targetDiagram)){b=!1;var c=this.mayCopy();c&&null!==this.copiedParts?(We(this),af(this,!0),Ge(a,this.copiedParts),cf(this,this.copiedParts,!1),Ue(a,this.copiedParts),null!==this.copiedParts&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,We(this),this.mayMove()&&(cf(this,this.draggedParts, !0),nf(this,a.lastInput.documentPoint)));this.Ym=!0;uf(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null;b&&xf(this);a.Ya();Ue(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.R(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.R("ChangedSelection",a.selection)}}}; Ae.prototype.simulatedMouseMove=function(a,b,c){if(null===De)return!1;var d=De.diagram;c instanceof Q||(c=null);var e=He;c!==e&&(null!==e&&e!==d&&(e.ug(),De.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),He=c,null!==c&&c!==d&&(Ze(),e=c.toolManager.findTool("Dragging"),null!==e&&(Ce.contains(e)||Ce.add(e),e.doSimulatedDragEnter())),this.doUpdateCursor(null));if(null===c||c===d||!c.allowDrop||c.isReadOnly||!c.allowInsert)return!1;d=c.toolManager.findTool("Dragging"); null!==d&&(null!==a&&(void 0!==a.targetTouches&&(0g&&(g=l),m>h&&(h=m))}}Infinity===d?f.h(0,0,0,0):f.h(d,e,g-d,h-e);d=f.x+f.width/2;e=f.y+f.height/2;N.free(f); f=a.Fr;g=new ob;h=J.alloc();for(k=b.iterator;k.next();)l=k.value,l instanceof T&&l.canCopy()&&(m=c.I(l),null!==m&&(m.points=l.points,bf(m,f.x-d,f.y-e),m.suspendsRouting=!0,g.add(m,a.Pd())));for(b=b.iterator;b.next();)l=b.value,l.Zc()&&l.canCopy()&&(k=c.I(l),null!==k&&(l=l.location,h.h(f.x-(d-l.x),f.y-(e-l.y)),k.location=h,k.Va(),g.add(k,a.Pd(h))));J.free(h);a.copiedParts=g;Ee(a,g.Lf());null!==a.draggedLink&&(c=a.draggedLink,b=c.routeBounds,bf(c,a.startPoint.x-(b.x+b.width/2),a.startPoint.y-(b.y+b.height/ 2)));a.doUpdateCursor(null)}}}Ae.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1;this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor;this.Bn=null};Ae.prototype.computeMove=function(a,b,c,d){c=this.diagram;return null!==c?c.computeMove(a,b,this.dragOptions,d):new J}; ma.Object.defineProperties(Ae.prototype,{isCopyEnabled:{get:function(){return this.ob},set:function(a){this.ob=a}},copiesEffectiveCollection:{get:function(){return this.u},set:function(a){this.u=a}},dragOptions:{get:function(){return this.ia},set:function(a){this.ia=a}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){this.dragOptions.isGridSnapEnabled= a}},isComplexRoutingRealtime:{get:function(){return this.hb},set:function(a){this.hb=a}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){this.dragOptions.isGridSnapRealtime=a}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){this.dragOptions.gridSnapCellSize.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{ get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){this.dragOptions.gridSnapCellSpot.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){this.dragOptions.gridSnapOrigin.D(a)||(a=a.J(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(a){this.dragOptions.dragsLink= a}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(a){this.dragOptions.dragsTree=a}},copyCursor:{get:function(){return this.F},set:function(a){this.F=a}},moveCursor:{get:function(){return this.Oc},set:function(a){this.Oc=a}},nodropCursor:{get:function(){return this.Pc},set:function(a){this.Pc=a}},currentPart:{get:function(){return this.V}, set:function(a){this.V=a}},copiedParts:{get:function(){return this.o},set:function(a){this.o=a}},draggedParts:{get:function(){return this.Ha},set:function(a){this.Ha=a}},draggingParts:{get:function(){return null!==this.copiedParts?this.copiedParts.Lf():null!==this.draggedParts?this.draggedParts.Lf():this.te}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(a){this.diagram.draggedLink= a}},isDragOutStarted:{get:function(){return this.Hb},set:function(a){this.Hb=a}},startPoint:{get:function(){return this.Fr},set:function(a){this.Fr.D(a)||this.Fr.assign(a)}},delay:{get:function(){return this.Ik},set:function(a){this.Ik=a}}});Ae.prototype.getDraggingSource=Ae.prototype.Az;var De=null,He=null;Ae.className="DraggingTool";Ce=new F; Ka("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)});La.prototype.doCancel=function(){null!==De&&De.doCancel();je.prototype.doCancel.call(this)}; function Af(){je.call(this);this.te=100;this.Ha=!1;this.u="pointer";var a=new T,b=new Bf;b.isPanelMain=!0;b.stroke="blue";a.add(b);b=new Bf;b.toArrow="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.layerName="Tool";this.Ci=a;a=new V;b=new Bf;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth=2;b.desiredSize=Gb;a.add(b);a.selectable=!1;a.layerName="Tool";this.Bi=a;this.j=b;a=new V;b=new Bf;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth= 2;b.desiredSize=Gb;a.add(b);a.selectable=!1;a.layerName="Tool";this.Di=a;this.o=b;this.Pc=this.Oc=this.ob=this.hb=this.Hb=null;this.ia=!0;this.hy=new ob;this.Of=this.gj=this.Pf=null}la(Af,je);Af.prototype.doStop=function(){this.diagram.ug();this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null;this.validPortsCache.clear();this.targetPort=null}; Af.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){var f=b.Df(),g=L.alloc();g.width=b.naturalBounds.width*f;g.height=b.naturalBounds.height*f;d.desiredSize=g;L.free(g);e?(d.toSpot=b.toSpot,d.toEndSegmentLength=b.toEndSegmentLength):(d.fromSpot=b.fromSpot,d.fromEndSegmentLength=b.fromEndSegmentLength);c.locationSpot=wc;f=J.alloc();c.location=b.ga(wc,f);J.free(f);d.angle=b.li();null!==this.portTargeted&&this.portTargeted(a,b,c,d,e)}}; Af.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.desiredSize=Gb,b.fromSpot=rc,b.toSpot=rc);null!==a&&(a.location=this.diagram.lastInput.documentPoint);null!==this.portTargeted&&this.portTargeted(null,null,a,b,c)};Af.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()}; Af.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;this.targetPort=this.findTargetPort(this.isForwards);if(null!==this.targetPort&&this.targetPort.part instanceof V){var b=this.targetPort.part;this.isForwards?this.copyPortProperties(b,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(b,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort, !0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}};Af.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.part;if(!(c instanceof V))return null;for(;null!==a;){var d=b?a.toLinkable:a.fromLinkable;if(!0===d&&(null!==a.portId||a instanceof V)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.panel}return null}; Af.prototype.findTargetPort=function(a){var b=this.diagram,c=b.lastInput.documentPoint,d=this.portGravity;0>=d&&(d=.1);var e=this,f=b.og(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0);d=Infinity;b=null;for(f=f.iterator;f.next();){var g=f.value,h=g.part;if(h instanceof V){var k=g.ga(wc,J.alloc()),l=c.x-k.x,m=c.y-k.y;J.free(k);k=l*l+m*m;kc){if(null!==this.originalLink&&a===this.originalFromNode&&b===this.originalFromPort)return!0;b=b.portId;null===b&&(b="");if(a.Mo(b).count>=c)return!1}return!0}; Af.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==a.layer&&!a.layer.allowLink||!0!==b.toLinkable))return!1;var c=b.toMaxLinks;if(Infinity>c){if(null!==this.originalLink&&a===this.originalToNode&&b===this.originalToPort)return!0;b=b.portId;null===b&&(b="");if(a.Sd(b).count>=c)return!1}return!0}; Af.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;a=a.part;b=b.part;return null!==a&&a===b};Af.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.part;if(!(c instanceof V))return!1;a=a.portId;null===a&&(a="");var d=b.part;if(!(d instanceof V))return!1;b=b.portId;null===b&&(b="");for(b=d.Sd(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; Af.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.fromLinkableSelfNode&&d.toLinkableSelfNode||!this.isInSameNode(b,d))&&(b.fromLinkableDuplicates&&d.toLinkableDuplicates||!this.isLinked(b,d)))||null!==this.originalLink&&(null!==a&&this.isLabelDependentOnLink(a,this.originalLink)||null!==c&&this.isLabelDependentOnLink(c,this.originalLink))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a, c,this.originalLink))return!1;if(null!==a){var e=a.linkValidation;if(null!==e&&!e(a,b,c,d,this.originalLink))return!1}if(null!==c&&(e=c.linkValidation,null!==e&&!e(a,b,c,d,this.originalLink)))return!1;e=this.linkValidation;return null!==e?e(a,b,c,d,this.originalLink):!0};Af.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.labeledLink;if(null===c)return!1;if(c===b)return!0;var d=new H;d.add(a);return Cf(this,c,b,d)}; function Cf(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),Cf(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),Cf(a,b.labeledLink,c,d))?!0:!1} Af.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.isUnconnectedLinkValid;var d=this.diagram.validCycle;if(d!==Df){if(d===Ef){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=b.linksConnected;d.next();){var e=d.value;if(e!==c&&e.isTreeLink&&e.toNode===b)return!1}return!Ff(this,a,b,c,!0)}if(d===Gf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=a.linksConnected;d.next();)if(e=d.value,e!==c&&e.isTreeLink&&e.fromNode=== a)return!1;return!Ff(this,a,b,c,!0)}if(d===Hf)return a===b?a=!0:(d=new H,d.add(b),a=If(this,d,a,b,c)),!a;if(d===Jf)return!Ff(this,a,b,c,!1);if(d===Rf)return a===b?a=!0:(d=new H,d.add(b),a=Sf(this,d,a,b,c)),!a}return!0};function Ff(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.linksConnected;f.next();){var g=f.value;if(g!==d&&(!e||g.isTreeLink)&&g.toNode===b&&(g=g.fromNode,g!==b&&Ff(a,g,c,d,e)))return!0}return!1} function If(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.linksConnected;f.next();){var g=f.value;if(g!==e&&g.toNode===c&&(g=g.fromNode,g!==c&&If(a,b,g,d,e)))return!0}return!1}function Sf(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.linksConnected;f.next();){var g=f.value;if(g!==e){var h=g.fromNode;g=g.toNode;h=h===c?g:h;if(h!==c&&Sf(a,b,h,d,e))return!0}}return!1} ma.Object.defineProperties(Af.prototype,{portGravity:{get:function(){return this.te},set:function(a){0<=a&&(this.te=a)}},isUnconnectedLinkValid:{get:function(){return this.Ha},set:function(a){this.Ha=a}},linkingCursor:{get:function(){return this.u},set:function(a){this.u=a}},temporaryLink:{get:function(){return this.Ci},set:function(a){this.Ci=a}},temporaryFromNode:{ get:function(){return this.Bi},set:function(a){if(this.Bi=a)this.j=a.port}},temporaryFromPort:{get:function(){return this.j},set:function(a){if(null!==this.j){var b=this.j.panel;if(null!==b){var c=b.O.indexOf(this.j);b.mb(c);b.Gb(c,a)}}this.j=a}},temporaryToNode:{get:function(){return this.Di},set:function(a){if(this.Di=a)this.o=a.port}},temporaryToPort:{get:function(){return this.o},set:function(a){if(null!== this.o){var b=this.o.panel;if(null!==b){var c=b.O.indexOf(this.o);b.mb(c);b.Gb(c,a)}}this.o=a}},originalLink:{get:function(){return this.Hb},set:function(a){this.Hb=a}},originalFromNode:{get:function(){return this.hb},set:function(a){this.hb=a}},originalFromPort:{get:function(){return this.ob},set:function(a){this.ob=a}},originalToNode:{get:function(){return this.Oc},set:function(a){this.Oc= a}},originalToPort:{get:function(){return this.Pc},set:function(a){this.Pc=a}},isForwards:{get:function(){return this.ia},set:function(a){this.ia=a}},validPortsCache:{get:function(){return this.hy}},targetPort:{get:function(){return this.Pf},set:function(a){this.Pf=a}},linkValidation:{get:function(){return this.gj},set:function(a){this.gj=a}},portTargeted:{ get:function(){return this.Of},set:function(a){this.Of=a}}});Af.className="LinkingBaseTool";function Tf(){Af.call(this);this.name="Linking";this.V={};this.F=null;this.K=Uf;this.Xd=null}la(Tf,Af);Tf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.xs()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:null!==this.findLinkablePort()}; Tf.prototype.findLinkablePort=function(){var a=this.diagram,b=this.startObject;null===b&&(b=a.ic(a.firstInput.documentPoint,null,null));if(null===b)return null;a=b.part;if(!(a instanceof V))return null;var c=this.direction;if(c===Uf||c===Vf){var d=this.findValidLinkablePort(b,!1);if(null!==d||this.startObject===a&&(d=a.port,this.findValidLinkablePort(d,!1)))return this.isForwards=!0,d}if(c===Uf||c===Wf)if(b=this.findValidLinkablePort(b,!0),null!==b||this.startObject===a&&(b=a.port,this.findValidLinkablePort(b, !0)))return this.isForwards=!1,b;return null}; Tf.prototype.doActivate=function(){var a=this.diagram,b=this.findLinkablePort();null===b?this.stopTool():(this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(null!==this.temporaryToNode&&(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=b,b=this.originalFromPort.part,b instanceof V&&(this.originalFromNode=b),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(null!== this.temporaryFromNode&&(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=b,b=this.originalToPort.part,b instanceof V&&(this.originalToNode=b),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.Va(),a.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.Va(),null!==this.temporaryLink&&(null!==this.temporaryFromNode&& (this.temporaryLink.fromNode=this.temporaryFromNode),null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.bb(),a.add(this.temporaryLink)),this.isActive=!0)};Tf.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink);a.remove(this.temporaryFromNode);a.remove(this.temporaryToNode);a.isMouseCaptured=!1;a.currentCursor="";this.stopTransaction()}; Tf.prototype.doStop=function(){Af.prototype.doStop.call(this);this.startObject=null}; Tf.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=this.transactionResult=null,c=null,d=null,e=null,f=null;try{var g=this.targetPort=this.findTargetPort(this.isForwards);if(null!==g){var h=g.part;h instanceof V&&(this.isForwards?(null!==this.originalFromNode&&(b=this.originalFromNode,c=this.originalFromPort),d=h,e=g):(b=h,c=g,null!==this.originalToNode&&(d=this.originalToNode,e=this.originalToPort)))}else this.isForwards?null!==this.originalFromNode&&this.isUnconnectedLinkValid&& (b=this.originalFromNode,c=this.originalFromPort):null!==this.originalToNode&&this.isUnconnectedLinkValid&&(d=this.originalToNode,e=this.originalToPort);null!==b||null!==d?(f=this.insertLink(b,c,d,e),null!==f?(null===g&&(this.isForwards?f.defaultToPoint=a.lastInput.documentPoint:f.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),f.isSelected=!0),this.transactionResult=this.name,a.R("LinkDrawn",f)):this.doNoLink(b,c,d,e)):this.isForwards? this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),f&&a.allowSelect&&a.R("ChangedSelection",a.selection)}}};Tf.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(null===a)return!0;if(a instanceof T)return a.isTreeLink;var b=this.diagram;if(null===b)return!0;a=b.partManager.getLinkCategoryForData(a);b=b.partManager.findLinkTemplateForCategory(a);return null!==b?b.isTreeLink:!0}; Tf.prototype.insertLink=function(a,b,c,d){return this.diagram.partManager.insertLink(a,b,c,d)};Tf.prototype.doNoLink=function(){}; ma.Object.defineProperties(Tf.prototype,{archetypeLinkData:{get:function(){return this.V},set:function(a){this.V=a}},archetypeLabelNodeData:{get:function(){return this.F},set:function(a){this.F=a}},direction:{get:function(){return this.K},set:function(a){this.K=a}},startObject:{get:function(){return this.Xd},set:function(a){this.Xd=a}}}); var Uf=new E(Tf,"Either",0),Vf=new E(Tf,"ForwardsOnly",0),Wf=new E(Tf,"BackwardsOnly",0);Tf.className="LinkingTool";Tf.Either=Uf;Tf.ForwardsOnly=Vf;Tf.BackwardsOnly=Wf; function Ie(){Af.call(this);this.name="Relinking";var a=new Bf;a.figure="Diamond";a.desiredSize=Ib;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=0;this.V=a;a=new Bf;a.figure="Diamond";a.desiredSize=Ib;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=-1;this.Xd=a;this.F=null;this.Ew=new N}la(Ie,Af); Ie.prototype.updateAdornments=function(a){if(null!==a&&a instanceof T){var b="RelinkFrom",c=null;if(a.isSelected&&!this.diagram.isReadOnly){var d=a.selectionObject;null!==d&&a.canRelinkFrom()&&a.actualBounds.w()&&a.isVisible()&&d.actualBounds.w()&&d.Ed()&&(c=a.Pj(b),null===c&&(c=this.makeAdornment(d,!1),a.bh(b,c)))}null===c&&a.Jf(b);b="RelinkTo";c=null;a.isSelected&&!this.diagram.isReadOnly&&(d=a.selectionObject,null!==d&&a.canRelinkTo()&&a.actualBounds.w()&&a.isVisible()&&d.actualBounds.w()&&d.Ed()&& (c=a.Pj(b),null===c?(c=this.makeAdornment(d,!0),a.bh(b,c)):c.v()));null===c&&a.Jf(b)}};Ie.prototype.makeAdornment=function(a,b){var c=new te;c.type=W.Link;b=b?this.toHandleArchetype:this.fromHandleArchetype;null!==b&&c.add(b.copy());c.adornedObject=a;return c}; Ie.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.xs()||!a.lastInput.left)return!1;var b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo"));return null!==b}; Ie.prototype.doActivate=function(){var a=this.diagram;if(null===this.originalLink){var b=this.handle;null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom"),null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo")));if(null===b)return;var c=b.part;if(!(c instanceof te&&c.adornedPart instanceof T))return;this.handle=b;this.isForwards=null===c||"RelinkTo"===c.category;this.originalLink=c.adornedPart}this.Ea(this.name);a.isMouseCaptured=!0;a.currentCursor=this.linkingCursor; this.originalFromPort=this.originalLink.fromPort;this.originalFromNode=this.originalLink.fromNode;this.originalToPort=this.originalLink.toPort;this.originalToNode=this.originalLink.toNode;this.Ew.set(this.originalLink.actualBounds);null!==this.originalLink&&0b.firstPickIndex+1&&c=c.x)b=0>=c.y?b+225:1<=c.y?b+135:b+180;else if(1<=c.x)0>=c.y?b+=315:1<=c.y&&(b+=45);else if(0>=c.y)b+=270;else if(1<=c.y)b+=90;else break a;0>b?b+=360:360<=b&&(b-=360);a.cursor=22.5>b?"e-resize":67.5>b?"se-resize":112.5>b?"s-resize":157.5>b?"sw-resize":202.5>b?"w-resize":247.5>b?"nw-resize":292.5>b?"n-resize":337.5>b?"ne-resize": "e-resize"}else if(a instanceof W)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};gg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowResize&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; gg.prototype.doActivate=function(){var a=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));null!==this.handle&&(this.adornedObject=this.handle.part.adornedObject,null!==this.adornedObject&&(a.isMouseCaptured=!0,a.animationManager.Cc(),this.Ea(this.name),this.Xq.set(this.adornedObject.ga(this.handle.alignment.gv())),this.Tn.set(this.adornedObject.part.location),this.Dw.set(this.adornedObject.desiredSize),this.pt=this.computeCellSize(),this.rt= this.computeMinSize(),this.qt=this.computeMaxSize(),this.isActive=!0))};gg.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.ue=this.handle=null;this.isActive=a.isMouseCaptured=!1};gg.prototype.stopTransaction=function(){var a=this.diagram,b=je.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.ak();return b}; gg.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()};gg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.rt,c=this.qt,d=this.pt,e=this.adornedObject.qs(a.lastInput.documentPoint,J.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.bd();J.free(e)}}; gg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.rt,c=this.qt,d=this.pt,e=this.adornedObject.qs(a.lastInput.documentPoint,J.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);J.free(e);a.Ya();this.transactionResult=this.name;a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; gg.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject;if(null!==c){c.desiredSize=a.size;a=c.part;a.Va();c=c.ga(this.handle.alignment.gv());if(a instanceof pf){var d=new F;d.add(a);if(!this.dragsMembers&&null===a.placeholder){var e=new Be;e.dragsMembers=!1}b.moveParts(d,this.oppositePoint.copy().re(c),!0,e)}else a.location=a.location.copy().re(c).add(this.oppositePoint);b.bd()}}; gg.prototype.computeResize=function(a,b,c,d,e,f){b.Mc()&&(b=wc);var g=this.adornedObject.naturalBounds,h=g.x,k=g.y,l=g.x+g.width,m=g.y+g.height,n=1;if(!f){n=g.width;var p=g.height;0>=n&&(n=1);0>=p&&(p=1);n=p/n}p=J.alloc();K.No(a.x,a.y,h,k,e.width,e.height,p);a=g.copy();0>=b.x?0>=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n* a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width,a.y=m-a.height)):1<=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width)):(a.x= Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=l-a.x,f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width), a.y=m-a.height)):1<=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width))):(a.width=Math.max(Math.min(p.x-h,d.width),c.width),f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):0>=b.y?(a.y=Math.max(p.y,m-d.height), a.y=Math.min(a.y,m-c.height),a.height=m-a.y,f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width))):1<=b.y&&(a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width)));J.free(p);return a};gg.prototype.computeReshape=function(){var a=kg;this.adornedObject instanceof Bf&&(a=lg(this.adornedObject));return!(a===mg||this.diagram.lastInput.shift)}; gg.prototype.computeMinSize=function(){var a=this.adornedObject.minSize.copy(),b=this.minSize;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};gg.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),b=this.maxSize;!isNaN(b.width)&&b.widthc?c+=360:360<=c&&(c-=360);c=Math.round(45*Math.round(c/45));var d=this.handleDistance;0===c?b.x=a.naturalBounds.width+d:45===c?(b.x=a.naturalBounds.width+d,b.y=a.naturalBounds.height+d):90===c?b.y=a.naturalBounds.height+d:135===c?(b.x=-d,b.y=a.naturalBounds.height+d):180===c?b.x=-d:225===c?(b.x=-d,b.y=-d):270===c?b.y=-d:315===c&&(b.x=a.naturalBounds.width+ d,b.y=-d);return a.ga(b)};ng.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.ue=this.handle=null;this.kr=new J(NaN,NaN);this.isActive=a.isMouseCaptured=!1};ng.prototype.stopTransaction=function(){var a=this.diagram,b=je.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.ak();return b};ng.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()}; ng.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))};ng.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.Ya();this.transactionResult=this.name;a.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}; ng.prototype.rotate=function(a){var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.Va();var c=b.locationObject,d=b.rotateObject;if(c===d||c.rg(d))c=this.Tn.copy(),b.location=c.re(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint);this.diagram.bd()}}; ng.prototype.computeRotate=function(a){a=this.rotationPoint.ab(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.li());360<=a?a-=360:0>a&&(a+=360);b=Math.min(Math.abs(this.snapAngleMultiple),180);var c=Math.min(Math.abs(this.snapAngleEpsilon),b/2);!this.diagram.lastInput.shift&&0b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a}; ma.Object.defineProperties(ng.prototype,{handleArchetype:{get:function(){return this.o},set:function(a){this.o=a}},handle:{get:function(){return this.j},set:function(a){if(null!==a&&!(a.part instanceof te))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedObject:{get:function(){return this.ue},set:function(a){if(null!==a&&a.part instanceof te)throw Error("new handle must not be in an Adornment: "+ a);this.ue=a}},snapAngleMultiple:{get:function(){return this.ia},set:function(a){this.ia=a}},snapAngleEpsilon:{get:function(){return this.V},set:function(a){this.V=a}},originalAngle:{get:function(){return this.Cw}},rotationPoint:{get:function(){return this.kr},set:function(a){this.kr=a.copy()}},handleAngle:{get:function(){return this.u},set:function(a){this.u= a}},handleDistance:{get:function(){return this.F},set:function(a){this.F=a}}});ng.className="RotatingTool";Ka("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function og(){je.call(this);this.name="ClickSelecting"}la(og,je);og.prototype.canStart=function(){return!this.isEnabled||this.isBeyondDragSize()?!1:!0}; og.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip());this.stopTool()};og.className="ClickSelectingTool";function pg(){je.call(this);this.name="Action";this.pk=null}la(pg,je); pg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,b=a.lastInput,c=a.ic(b.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a});if(null!==c){if(!c.isActionable)return!1;this.pk=c;a.Ck=a.ic(b.documentPoint,null,null);return!0}return!1};pg.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.pk;null!==b&&(a.targetObject=b,null!==b.actionDown&&b.actionDown(a,b))}else this.canStart()&&this.doActivate()}; pg.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.pk;null!==b&&(a.targetObject=b,null!==b.actionMove&&b.actionMove(a,b))}};pg.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.pk;if(null===b)return;a.targetObject=b;null!==b.actionUp&&b.actionUp(a,b);this.standardMouseClick(function(a){for(;null!==a.panel&&(!a.isActionable||a!==b);)a=a.panel;return a},function(a){return a===b})}this.stopTool()}; pg.prototype.doCancel=function(){var a=this.diagram.lastInput,b=this.pk;null!==b&&(a.targetObject=b,null!==b.actionCancel&&b.actionCancel(a,b),this.stopTool())};pg.prototype.doStop=function(){this.pk=null};pg.className="ActionTool";function qg(){je.call(this);this.name="ClickCreating";this.Ri=null;this.o=!0;this.j=!1;this.mw=new J(0,0)}la(qg,je); qg.prototype.canStart=function(){if(!this.isEnabled||null===this.archetypeNodeData)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(1===a.lastInput.clickCount&&(this.mw=a.lastInput.viewPoint.copy()),2!==a.lastInput.clickCount||this.isBeyondDragSize(this.mw))return!1}else if(1!==a.lastInput.clickCount)return!1;return a.currentTool!==this&&null!==a.Ol(a.lastInput.documentPoint,!0)?!1:!0}; qg.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint);this.stopTool()}; qg.prototype.insertPart=function(a){var b=this.diagram,c=this.archetypeNodeData;if(null===c)return null;var d=null;try{b.R("ChangingSelection",b.selection);this.Ea(this.name);if(c instanceof U)c.Zc()&&(jg(c),d=c.copy(),null!==d&&b.add(d));else if(null!==c){var e=b.model.copyNodeData(c);za(e)&&(b.model.xf(e),d=b.Lc(e))}if(null!==d){var f=J.allocAt(a.x,a.y);this.isGridSnapEnabled&&zg(this.diagram,d,a,f);d.location=f;b.allowSelect&&(b.clearSelection(!0),d.isSelected=!0);J.free(f)}b.Ya();this.transactionResult= this.name;b.R("PartCreated",d)}finally{this.stopTransaction(),b.R("ChangedSelection",b.selection)}return d};ma.Object.defineProperties(qg.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(a){this.Ri=a}},isDoubleClick:{get:function(){return this.o},set:function(a){this.o=a}},isGridSnapEnabled:{get:function(){return this.j},set:function(a){this.j=a}}});qg.className="ClickCreatingTool"; function Ag(){je.call(this);this.name="DragSelecting";this.Ik=175;this.o=!1;var a=new U;a.layerName="Tool";a.selectable=!1;var b=new Bf;b.name="SHAPE";b.figure="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.j=a}la(Ag,je); Ag.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!==this&&(!this.isBeyondDragSize()||b.timestamp-a.firstInput.timestampe.right&&(c.x-=d.width+5/b.scale);c.xe.bottom&&(c.y-=d.height+5/b.scale);c.ya.lastInput.clickCount?!1:!0};Og.prototype.doStart=function(){Yg=this;null!==this.textBlock&&this.doActivate()}; Og.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.ic(a.lastInput.documentPoint));if(null!==b&&b instanceof Pg&&(this.textBlock=b,null!==b.part)){a.animationManager.Cc();this.isActive=!0;this.qa=Vg;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.Zh=this.textBlock.copy();var d=new N(this.textBlock.ga(sc),this.textBlock.ga(Bc));a.tv(d);c.show(b,a,this);this.currentTextEditor=c}}}};Og.prototype.doCancel=function(){this.stopTool()}; Og.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()};Og.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Zg)};Og.prototype.acceptText=function(a){switch(a){case Zg:if(this.qa===ah)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.qa===Vg||this.qa===Xg||this.qa===Wg)this.qa=bh,ch(this);break;case dh:case Tg:case Ug:if(Tg!==a||!0!==this.textBlock.isMultiline)if(this.qa===Vg||this.qa===Xg||this.qa===Wg)this.qa=bh,ch(this)}}; function ch(a){var b=a.textBlock,c=a.diagram,d=a.currentTextEditor;if(null!==b&&null!==d){var e=b.text,f="";null!==d.valueFunction&&(f=d.valueFunction());a.isValidText(b,e,f)?(a.Ea(a.name),a.qa=ah,a.transactionResult=a.name,b.text=f,a.doSuccess(e,f),null!==c&&c.R("TextEdited",b,e),a.stopTransaction(),a.stopTool(),null!==c&&c.doFocus()):(a.qa=Xg,a.doError(e,f))}} Og.prototype.doError=function(a,b){var c=this.textBlock;null!==c.errorFunction&&c.errorFunction(this,a,b);(a=this.currentTextEditor)&&a.show(c,this.diagram,this)};Og.prototype.doSuccess=function(a,b){var c=this.textBlock;null!==c.textEdited&&c.textEdited(c,a,b)};Og.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.qa=Rg,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)};Og.prototype.doStop=function(){Yg=null}; Og.prototype.isValidText=function(a,b,c){var d=this.textValidation;if(null!==d&&!d(a,b,c))return!1;d=a.textValidation;return null===d||d(a,b,c)?!0:!1};Og.prototype.Lx=function(a){var b=this.Zh;b.text=a;b.measure(this.textBlock.Ih,Infinity);return b}; ma.Object.defineProperties(Og.prototype,{textBlock:{get:function(){return this.ia},set:function(a){this.ia=a}},currentTextEditor:{get:function(){return this.o},set:function(a){this.o=a}},defaultTextEditor:{get:function(){return this.j},set:function(a){this.j=a}},starting:{get:function(){return this.V},set:function(a){this.V=a}},textValidation:{get:function(){return this.vj}, set:function(a){this.vj=a}},minimumEditorScale:{get:function(){return this.u},set:function(a){this.u=a}},selectsTextOnActivate:{get:function(){return this.F},set:function(a){this.F=a}},state:{get:function(){return this.qa},set:function(a){this.qa!==a&&(this.qa=a)}}});Og.prototype.measureTemporaryTextBlock=Og.prototype.Lx; var dh=new E(Og,"LostFocus",0),Zg=new E(Og,"MouseDown",1),Ug=new E(Og,"Tab",2),Tg=new E(Og,"Enter",3),eh=new E(Og,"SingleClick",0),Qg=new E(Og,"SingleClickSelected",1),$g=new E(Og,"DoubleClick",2),Rg=new E(Og,"StateNone",0),Vg=new E(Og,"StateActive",1),Wg=new E(Og,"StateEditing",2),bh=new E(Og,"StateValidating",3),Xg=new E(Og,"StateInvalid",4),ah=new E(Og,"StateValidated",5),Yg=null;Og.className="TextEditingTool";Og.LostFocus=dh;Og.MouseDown=Zg;Og.Tab=Ug;Og.Enter=Tg;Og.SingleClick=eh; Og.SingleClickSelected=Qg;Og.DoubleClick=$g;Og.StateNone=Rg;Og.StateActive=Vg;Og.StateEditing=Wg;Og.StateValidating=bh;Og.StateInvalid=Xg;Og.StateValidated=ah;Ka("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)}); function fh(a){gh||(hh(),gh=!0);this.H=ke;this.Ok=this.zb=this.vq=this.bc=!1;this.Qw=!0;this.Pk=ih;this.Dm=!1;this.Gh=this.Jd=!0;this.Dg=600;this.cw=this.Ow=!1;this.Zd=new H;this.ce=new jh;this.ce.Yd=this;this.Ei=new H;this.pu=new H;this.Sr=new H;this.pr=new H;a&&Object.assign(this,a)}fh.prototype.Xe=function(a){this.H=a};fh.prototype.canStart=function(){return!0};function kh(a,b){a.Jd&&a.canStart(b)&&(a.Zd.add(b),a.defaultAnimation.isAnimating&&a.Cc(),lh(a.H),a.zb=!0)} function mh(a){if(a.Jd&&a.zb){var b=a.ce,c=a.H,d=a.Zd.contains("Model");d&&(a.Ok=!0,a.Pk===ih?(b.isViewportUnconstrained=!0,b.vc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.Pk===nh&&b.vc.clear(),a.Qw=a.Pk===oh&&c.du.D(c.pa)?!0:!1,c.R("InitialAnimationStarting",a));d&&!a.Gh||0===b.vc.count?(a.Zd.clear(),a.zb=!1,b.vc.clear(),ph(b,c),a.Ok=!1,c.N()):(a.Zd.clear(),c.kg=!1,d=b.vc.get(c),c.autoScale!==qh&&null!==d&&(delete d.start.scale,delete d.end.scale), x.requestAnimationFrame(function(){!1===a.zb||b.bc||(c.Gf("temporaryPixelRatio")&&Fe(c),rh(c),a.zb=!1,b.start(),b.bc&&(sh(a),c.Ya(),th(b,0),yf(c,!0),uh(a),c.R("AnimationStarting",a)))}))}}function vh(a){return a.Zd.contains("Trigger")&&1===a.Zd.count}function wh(a,b,c,d){a.isTicking||vh(a)||b instanceof T&&(null!==b.fromNode||null!==b.toNode)||a.ce.add(b,"position",c,d,!1)}t=fh.prototype;t.fv=function(a){return this.ce.fv(a)};t.Xu=function(a){return this.ce.Xu(a)}; function Hh(a,b){function c(){0f?f+=360:k+=360);f=e(c,f,k-f,d)%360;g=e(c,g,l-g,d);h=e(c,h,m-h,d);c=e(c,a,b-a,d);return"hsla("+f+", "+g+"%, "+h+"%, "+c+")"} function hh(){function a(a,b,e,f,g,h){a.position=new J(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))}var b=new ob;b.add("position:diagram",a);b.add("position",a);b.add("position:part",function(a,b,e,f,g,h){ga&&xa(a,">= 1",fh,"duration");this.Dg=a}},isAnimating:{get:function(){return this.bc}}, isTicking:{get:function(){return this.vq}},isInitial:{get:function(){return this.Gh},set:function(a){this.Gh=a}},defaultAnimation:{get:function(){return this.ce}},activeAnimations:{get:function(){return this.Ei}},initialAnimationStyle:{get:function(){return this.Pk},set:function(a){this.Pk=a}}});fh.prototype.stopAnimation=fh.prototype.Cc; var Ph=null,gh=!1,ih=new E(fh,"Default",1),oh=new E(fh,"AnimateLocations",2),nh=new E(fh,"None",3);fh.className="AnimationManager";fh.defineAnimationEffect=function(a,b){gh||(hh(),gh=!0);Ph.add(a,b)};fh.Default=ih;fh.AnimateLocations=oh;fh.None=nh; function jh(a){this.vu=this.Nw=this.Yd=this.H=null;this.Xk=this.bc=this.j=!1;this.cn=this.Qd=0;this.Lp=this.ot=Qh;this.Wk=this.ho=!1;this.cu=1;this.au=0;this.Gd=this.Dg=NaN;this.gw=0;this.dn=null;this.o=pb;this.vc=new ob;this.Tt=new ob;this.yl=new H;this.Ut=new H;this.dw=Rh;a&&Object.assign(this,a)}jh.prototype.suspend=function(){this.Xk=!0};jh.prototype.advanceTo=function(a,b){b&&(this.Xk=!1);this.ho&&a>=this.Gd&&(this.Wk=!0,a-=this.Gd);this.gw=a;Ih(this,!0);sh(this.Yd);yf(this.H);uh(this.Yd);this.H.redraw()}; function ph(a,b){a.Tt.clear();a.Wk=!1;a.au=0;a.Gd=NaN;0a.cn?a.Gd:d-a.Qd;b&&(e=a.gw,ea.cn&&(a.ho&&!a.Wk?(a.Qd=+new Date,a.cn=a.Qd+a.Gd,a.Wk=!0):a.Ml(!1))}}} function th(a,b){for(var c=a.Gd,d=a.vc.iterator,e=a.Wk;d.next();){var f=d.key;if(!(f instanceof Y&&null===f.diagram)){var g=d.value,h=e?g.end:g.start;g=e?g.start:g.end;var k=Ph,l;for(l in g)"position"===l&&(g["position:placeholder"]||g["position:nodeCollapse"])||null===k.get(l)||k.get(l)(f,h[l],g[l],a.Lp,b,c,a)}}}t.stop=function(){if(!this.bc)return this;this.Ml(!0);return this}; t.Ml=function(a){null!==this.vu&&this.vu.jo.remove(this.Nw);if(this.bc){var b=this.H,c=this.Yd;this.Xk=this.bc=c.Ok=!1;sh(c);for(var d=this.vc,e=this.yl.iterator;e.next();)b.remove(e.value);for(e=this.Ut.iterator;e.next();)e.value.v();e=this.ho;d=d.iterator;for(var f=Ph;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.Ku,n;for(n in l)if(null!==f.get(n)){var p=n;!h.Hu||"position:nodeCollapse"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]: h.Hu?k[n]:l[n],this.Lp,this.Gd,this.Gd,this)}h.Hu&&void 0!==m.location&&g instanceof U&&(g.location=m.location);h.nv&&g instanceof U&&g.Zb(!1)}b.As.clear();Xe(b,!1);b.Ya();b.N();yf(b,!0);if(c.defaultAnimation===this){for(n=c.pr.iterator;n.next();)e=n.value,null!==e.Tg&&(e.points=e.Tg,e.Tg=null);c.pr.clear()}yf(b,!0);this.isViewportUnconstrained&&(b.scrollMode=this.dw);uh(c);this.au++;!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),ph(this,null),c.Ml(this),b.$b())}}; t.Cj=function(a,b){var c=b.actualBounds,d=null;b instanceof pf&&(d=b.placeholder);null!==d?(c=d.ga(sc),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new J(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof pf)for(a=a.memberParts;a.next();)d=a.value,d instanceof V&&this.Cj(d,b)}; t.Aj=function(a,b){if(a.isVisible()){var c=null;b instanceof pf&&(c=b.placeholder);if(null!==c){var d=c.ga(sc);c=c.padding;d.x+=c.left;d.y+=c.top;this.add(a,"position:placeholder",a.position,d,!0)}else this.add(a,"position:nodeCollapse",a.position,b,!0);this.add(a,"scale",a.scale,.01,!0);d=this.vc;d.contains(a)&&(d.I(a).nv=!0);if(a instanceof pf)for(a=a.memberParts;a.next();)d=a.value,d instanceof V&&this.Aj(d,b)}};t.Ez=function(a){var b=this.Tt.get(a);null===b&&(b={},this.Tt.add(a,b));return b}; ma.Object.defineProperties(jh.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&xa(a,">= 1",jh,"duration");this.Dg=a}},reversible:{get:function(){return this.ho},set:function(a){this.ho=a}},runCount:{get:function(){return this.cu},set:function(a){0a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function Sh(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}jh.className="Animation";jh.EaseLinear=function(a,b,c,d){return c*a/d+b};jh.EaseInOutQuad=Qh;jh.EaseInQuad=function(a,b,c,d){return c*(a/=d)*a+b};jh.EaseOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};jh.EaseInExpo=function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b};jh.EaseOutExpo=Sh; function Yh(a,b,c){this.start=a;this.end=b;this.Ku={};this.Hu=c;this.nv=!1}Yh.className="AnimationState";function Zh(a,b,c){this.xd=null;this.rf=a;this.so=c||$h;this.uk=null;void 0!==b&&(this.uk=b,void 0===c&&(this.so=ai))}Zh.prototype.copy=function(){var a=new Zh(this.rf);a.so=this.so;var b=this.uk;if(null!==b){var c={};void 0!==b.duration&&(c.duration=b.duration);void 0!==b.finished&&(c.finished=b.finished);void 0!==b.easing&&(c.easing=b.easing);a.uk=c}return a}; function bi(a,b){a=a.uk;null!==a&&(a.duration&&(b.duration=a.duration),a.finished&&(b.finished=a.finished),a.easing&&(b.easing=a.easing))}ma.Object.defineProperties(Zh.prototype,{propertyName:{get:function(){return this.rf},set:function(a){this.rf=a}},animationSettings:{get:function(){return this.uk},set:function(a){this.uk=a}},startCondition:{get:function(){return this.so},set:function(a){this.so=a}}}); var $h=new E(Zh,"Default",1),ai=new E(Zh,"Immediate",2),ci=new E(Zh,"Bundled",3);Zh.className="AnimationTrigger";Zh.Default=$h;Zh.Immediate=ai;Zh.Bundled=ci;function di(a){Qa(this);this.H=null;this.Pa=new F;this.xa="";this.pb=1;this.o=!1;this.j=this.Uh=this.u=this.Oi=this.Ni=this.Mi=this.Li=this.Ji=this.Ki=this.Ii=this.Qi=this.Hi=this.Pi=this.Gi=this.Fi=!0;this.Zq=[];a&&Object.assign(this,a)}t=di.prototype; t.clear=function(){for(var a=this.Pa,b=0;b=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Pa.iterator;h.next();){var k=h.value;k instanceof pf?e++:k instanceof V?d++:k instanceof T?f++:k instanceof te?g++:c++}h="";0c.Oq||h.height*e>c.Oq?b.gc(a,c):(e=b.actualBounds, f=b.naturalBounds,0===e.width||0===e.height||isNaN(e.x)||isNaN(e.y)||!b.isVisible()||(c=b.transform,null!==b.areaBackground&&(ji(b,a,b.areaBackground,!0,!0,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null===b.areaBackground&&null===b.background&&(ji(b,a,"rgba(0,0,0,0.3)",!0,!1,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null!==b.background&&(a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),ji(b,a,b.background,!0,!1,f,e),a.fillRect(0,0,f.width/2,f.height/2),c.ws()||(b=1/(c.m11*c.m22-c.m12*c.m21),a.transform(c.m22* b,-c.m12*b,-c.m21*b,c.m11*b,b*(c.m21*c.dy-c.m22*c.dx),b*(c.m12*c.dx-c.m11*c.dy))))));d&&(a.restore(),a.Vc(!0))}};t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.cb(ce,a,this,b,c,d,e)};t.oi=function(a,b,c){var d=this.Pa;b.Ig=this;null===this&&ei(b);if(a>=d.count)a=d.count;else if(d.M(a)===b)return-1;d.Gb(a,b);b.Vo(c);d=this.diagram;null!==d&&(c?d.N():d.oi(b));ki(this,a,b);return a}; t.pc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.pc(a,b,c);var d=this.Pa;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.M(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.Wo(c);d.mb(a);d=this.diagram;null!==d&&(c?d.N():d.pc(b));b.Ig=null;ei(b);return a}; function ki(a,b,c){b=li(a,b,c);if(c instanceof pf&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Pa.s,f=e.length,g=0;gd&&h.containingGroup===c&&(d=g,0<=b))break}!(0>d)&&d=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var f=b-1,g=NaN;0<=f;){g=a.M(f).zOrder;if(!isNaN(g))break;f--}for(var h=b+1,k=NaN;hd)for(;;){if(-1===f||g<=d){f++;if(f===b)break;a.mb(b);a.Gb(f,c);return f}for(g=NaN;0<=--f&&(g=a.M(f).zOrder,isNaN(g)););}else if(!isNaN(k)&&k=d){h--;if(h===b)break;a.mb(b);a.Gb(h,c);return h}for(k=NaN;++h< e&&(k=a.M(h).zOrder,isNaN(k)););}return b} ma.Object.defineProperties(di.prototype,{parts:{get:function(){return this.Pa.iterator}},partsBackwards:{get:function(){return this.Pa.iteratorBackwards}},diagram:{get:function(){return this.H}},name:{get:function(){return this.xa},set:function(a){var b=this.xa;if(b!==a){var c=this.diagram;if(null!==c)for(""===b&&C("Cannot rename default Layer to: "+a),c=c.layers;c.next();)c.value.name=== a&&C("Layer.name is already present in this diagram: "+a);this.xa=a;this.g("name",b,a);for(a=this.Pa.iterator;a.next();)a.value.layerName=this.xa}}},opacity:{get:function(){return this.pb},set:function(a){var b=this.pb;b!==a&&((0>a||1=a)return b;for(var c=this.Wa.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b}; function vi(a,b){if(Ng){void 0!==b&&null!==b||C("Diagram setup requires an argument DIV.");null!==a.Ka&&C("Diagram has already completed setup.");"string"===typeof b?a.Ka=x.document.getElementById(b):b instanceof HTMLDivElement?a.Ka=b:C("No DIV or DIV id supplied: "+b);null===a.Ka&&C("Invalid DIV id; could not get element with id: "+b);void 0!==a.Ka.H&&C("Invalid div id; div already has a Diagram associated with it.");if(!a.ol&&x.ResizeObserver){var c=sa(function(){a.$b()},250);a.ol=new x.ResizeObserver(function(){c()}); a.ol.observe(a.Ka)}"static"===x.getComputedStyle(a.Ka,null).position&&(a.Ka.style.position="relative");b=5;var d="rgba(2"+b+"5, 255, 255, 0)";b--;a.Ka.style["-webkit-tap-highlight-color"]=d;a.Ka.innerHTML="";a.Ka.H=a;a.Ka.goDiagram=a;a.Ka.go=x.go;var e=new Pi(a);void 0!==e.style&&(e.style.position="absolute",e.style.top="0px",e.style.left="0px","rtl"===x.getComputedStyle(a.Ka,null).getPropertyValue("direction")&&(a.tn=!0),e.style.zIndex="2",e.style.userSelect="none",e.style.MozUserSelect="none",e.style.touchAction= "none",e.style.letterSpacing="normal !important",e.style.wordSpacing="normal !important");a.ta=e;a.ib=e.context;d=a.ib;a.Mb=a.computePixelRatio();a.viewSize.w()||(a.Aa=a.Ka.clientWidth||1,a.ya=a.Ka.clientHeight||1);Qi(a,a.Aa,a.ya);a.Ka.insertBefore(e.Oa,a.Ka.firstChild);e=new Pi(null);e.width=1;e.height=1;a.jw=e;a.oy=e.context;if(Ng){e=ua("div");var f=ua("div");e.style.position="absolute";e.style.overflow="auto";e.style.width=a.Aa+"px";e.style.height=a.ya+"px";e.style.zIndex="1";f.style.position= "absolute";f.style.width="1px";f.style.height="1px";a.Ka.appendChild(e);e.appendChild(f);e.onscroll=Ri;e.addEventListener("pointerdown",Si);e.H=a;e.uy=!0;e.vy=!0;a.ku=e;a.hu=f}a.hk=sa(function(){a.Yh=null;a.N()},300);a.Ov=sa(function(){rh(a)},250);a.preventDefault=function(a){a.preventDefault();return!1};a.$j=function(b){if(a.isEnabled){var c=Ti(a,b,!0);c.bubbles=!0;var d=0,e=0;c.delta=0;void 0!==b.deltaX?(0!==b.deltaX&&(d=0 Math.abs(b.deltaY)?-d:-e):void 0!==b.wheelDeltaX?(0!==b.wheelDeltaX&&(d=0Math.abs(b.wheelDeltaY)?-d:-e):void 0!==b.wheelDelta&&0!==b.wheelDelta&&(c.delta=0c|| Math.abs(e.y-b.screenY)>c)?a.yq++:a.yq=1;d.clickCount=a.yq;a.tw=b.timeStamp;a.uw.sg(b.screenX,b.screenY);a.doMouseDown();1===b.button?b.preventDefault():Ui(d,b)}};a.dk=function(b){if(a.isEnabled){a.Vk=!0;var c=a.oj;if(null===c[0]||c[0].pointerId!==b.pointerId&&c[0].pointerType===b.pointerType){if(null!==c[1]&&c[1].pointerId===b.pointerId){c[1]=b;return}if(null===c[0])c[0]=b;else return}else c[0]=b;if(c[0].pointerId===b.pointerId){c=Vi(a,b,!1,!1,!1,null!==c[1]);var d=x.document.elementFromPoint(b.clientX, b.clientY)||null;null!==d&&void 0!==d.shadowRoot&&null!==d.shadowRoot&&(d=d.shadowRoot.elementFromPoint(b.clientX,b.clientY));var e=a,f=b;d&&d.H&&(f=b,e=d.H);c.targetDiagram=e;Wi(a,f,c);c.targetObject=null;a.doMouseMove();Ui(c,b)}}};a.fk=function(b){if(a.isEnabled){a.Vk=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.Yt;if(c&&a.qu)delete d[b.pointerId],b.preventDefault();else if(d=a.oj,null===d[0]||d[0].pointerId!==b.pointerId&&d[0].pointerType===b.pointerType)null!==d[1]&&d[1].pointerId=== b.pointerId&&(d[1]=null);else{d[0]=null;d=Vi(a,b,!1,!0,!0,!1);var e=x.document.elementFromPoint(b.clientX,b.clientY)||null;null!==e&&void 0!==e.shadowRoot&&null!==e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(b.clientX,b.clientY));null!==e&&e.H instanceof Q&&e.H!==a&&Wi(e.H,b,d);null===e&&(e=b.target);Wi(a,b,d);d.clickCount=a.yq;d.targetDiagram=Xi(b,e);d.targetObject=null;a.doMouseUp();Ui(d,b);c&&(a.wq=!1)}}};a.ek=function(b){if(a.isEnabled){a.Vk=!1;var c=a.Yt;c[b.pointerId]&&delete c[b.pointerId]; c=a.oj;null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null);null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null);"touch"!==b.pointerType&&"pen"!==b.pointerType&&(b=a.currentTool,b.cancelWaitAfter(),b.standardMouseOver())}};a.ck=function(b){var c=a.oj;null!==c[0]&&c[0].pointerId===b.pointerId?(c[0]=null,a.wq=!1):null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null)};a.Vp=d.Z["d"+Yi[1]+Yi[2]+"wI"+Zi.slice(1,5)]["b"+$i.slice(1,b)](d.Z,aj,b,b);d.Vc(!0);bj(a);"svg"===a.nl&&(b=a.pj.get("svg"),a.Ka.appendChild(b.Oa), a.ib=b.context)}}Q.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,{capture:d,passive:!1})};Q.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,{capture:d})}; function bj(a){var b=a.ta.Oa;b instanceof HTMLCanvasElement||(b=a.div);a.addEventListener(b,"pointerdown",a.ui,!1);a.addEventListener(b,"pointermove",a.dk,!1);a.addEventListener(b,"pointerup",a.fk,!1);a.addEventListener(b,"pointerout",a.ek,!1);a.addEventListener(b,"pointercancel",a.ck,!1);a.addEventListener(b,"pointerenter",a.bz,!1);a.addEventListener(b,"pointerleave",a.cz,!1);a.addEventListener(b,"wheel",a.$j,!1);a.addEventListener(b,"keydown",a.Qz,!1);a.addEventListener(b,"keyup",a.Rz,!1);a.addEventListener(b, "blur",a.Ny,!1);a.addEventListener(b,"focus",a.Oy,!1);a.addEventListener(b,"selectstart",function(a){a.preventDefault();return!1},!1);a.addEventListener(b,"contextmenu",function(a){a.preventDefault();return!1},!1);a.addEventListener(x,"resize",a.Ov,!1)}function Fe(a){30r&&(this.position=w.h(-(b.scrollWidth-this.Aa)+v-this.Aa/e+m,this.position.y))),a.vy&&this.allowVerticalScroll&&(hu&&(this.position= w.h(this.position.x,-(b.scrollHeight-this.ya)+a.scrollTop-this.ya/e+f))),J.free(w),this.vd=!0,this.Ee=this.qr=!1,d=this.documentBounds,e=this.viewportBounds,m=d.right,r=e.right,f=d.bottom,u=e.bottom,g=d.x,n=e.x,h=d.y,d=e.y,p>=k&&g>=n&&m<=r&&(c.style.width="1px"),q>=l&&h>=d&&f<=u&&(c.style.height="1px"))}};Q.prototype.computeBounds=function(a){void 0===a&&(a=new N);lh(this);return ej(this,a)}; function ej(a,b){if(a.fixedBounds.w())return b.assign(a.fixedBounds),b.Co(a.yb),b;for(var c=!0,d=a.Wa.s,e=d.length,f=0;fc&&(b=c),ba.maxScale&&(b=a.maxScale),b):b===jj?(b=k>h?(g-a.Db)/d:(f-a.Db)/e,b>c&&(b=c),ba.maxScale&&(b=a.maxScale),b):a.scale} Q.prototype.zoomToFit=function(){var a=this.sj;this.sj=Rh;this.scale=gj(this,ij);a!==Rh&&(fj(this,!1),hj(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1));this.sj=a};t=Q.prototype; t.BA=function(a,b){void 0===b&&(b=ij);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===ij||b===jj)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.Aa;var f=this.ya;e=b===jj?f/d>e/c?(f-(this.Be?this.Db:0))/d:(e-(this.gf?this.Db:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new J(a.x,a.y)}}; t.Jy=function(a,b){this.Va();var c=this.documentBounds,d=this.viewportBounds;this.position=new J(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))};t.zz=function(a){if(a instanceof Y){this.eq=a;var b=J.alloc();this.fq=this.op(a.ga(sc,b));J.free(b)}else this.eq=null,this.fq=tb}; function hj(a,b,c,d,e,f){var g=J.allocAt(a.pa.x,a.pa.y),h=g.x,k=g.y;if(null!==a.eq){var l=J.alloc();l=a.eq.ga(sc,l);h=l.x-a.fq.x/a.scale;k=l.y-a.fq.y/a.scale;e=rc;J.free(l)}if(f||a.scrollMode===Rh)e.sb()&&(c>b.width&&(h=b.x+(e.x*b.width+e.offsetX)-(e.x*c-e.offsetX)),d>b.height&&(k=b.y+(e.y*b.height+e.offsetY)-(e.y*d-e.offsetY))),e=a.rj,f=c-b.width,cb.left?h=b.left:hb.top?k=b.top:kb;b++){var c=a.De.iterator;if(null===c||0===a.De.count)break;a.De=new H;a.Nv(c,a.De)}a.nodes.each(function(a){a instanceof pf&&0!==(a.U&65536)!==!1&&(a.U=a.U^65536)})}} t.Nv=function(a,b){for(a.reset();a.next();){var c=a.value;!c.Zc()||c instanceof pf||(c.si()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof pf&&c.isVisible()&&tj(this,c);for(a.reset();a.next();)c=a.value,c instanceof T&&c.isVisible()&&(c.si()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof te&&c.isVisible()&&(c.si()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; function tj(a,b){for(var c=Ea(),d=Ea(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof pf?(uj(f)||vj(f)||wj(f))&&tj(a,f):f instanceof T?f.fromNode===b||f.toNode===b?d.push(f):c.push(f):(f.measure(Infinity,Infinity),f.arrange()))}a=c.length;for(e=0;eB&&(v=M.left, y=M.right),w.height>D&&(z=M.top,A=M.bottom)):(v=M.left,y=M.right,z=M.top,A=M.bottom);var S=w.width+v+y,R=w.height+z+A;M=a.scale;var I=S>k/M,G=R>l/M;if(!(f||a.gf||a.Be||I||G))return!0;v=w.x-v;k=m.x;y=w.right+y;l=m.right+g;z=w.y-z;var ca=m.y;w=w.bottom+A;m=m.bottom+h;var X="1px";A="1px";a.scrollMode===Rh&&(I||G)&&(I&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(I=1,v+1l+1&&(I=Math.max((y-l)*M+a.Aa,I)),B+g+1m+1&&(I=Math.max((w-m)*M+a.ya,I)),D+h+1l+1&&(g=Math.max((y-l)*M+a.Aa,g)),B+1m+1&&(h=Math.max((w-m)*M+g,h)),D+1l+1&&(b=a.position.x*M));if(a.tn)switch(a.bu){case "negative":b=-(r.scrollWidth-b-r.clientWidth);break;case "reverse":b=r.scrollWidth-b-r.clientWidth}r.scrollLeft=b;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(D+1m+1&&(r.scrollTop=a.position.y*M));k=a.Aa;l=a.ya;r.style.width=k+(a.gf?a.Db:0)+"px";r.style.height=l+(a.Be?a.Db:0)+"px";return c!==k||d!==l||a.animationManager.zb?(c=N.allocAt(e,n,p,q),a.onViewportBoundsChanged(c,a.viewportBounds,M,f),N.free(c),!1):!0}t=Q.prototype; t.add=function(a){var b=a.diagram;if(b!==this&&(null!==b&&C("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString()),b=this.Qj(a.layerName),null===b&&(b=this.Qj("")),null===b&&C('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==b)){var c=b.oi(99999999,a,a.diagram===this);0<=c&&this.cb(ee,"parts",b,null,a,null,c);b.isTemporary||this.Ya();a.C(1);c=a.layerChanged;null!==c&&c(a,null,b)}}; t.oi=function(a){this.partManager.oi(a);var b=this;Hj(a,function(a){Ij(b,a)});(a instanceof te||a instanceof pf&&null!==a.placeholder)&&a.v();null!==a.data&&Hj(a,function(a){Jj(b.partManager,a)});!0!==vj(a)&&!0!==wj(a)||this.De.add(a);Kj(a,!0,this);Lj(a)?(a.actualBounds.w()&&this.N(Gj(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(Gj(a,a.actualBounds));this.$b()}; t.pc=function(a){a.Ej();this.partManager.pc(a);var b=this;null!==a.data&&Hj(a,function(a){Mj(b.partManager,a,b)});this.De.remove(a);Lj(a)?(a.actualBounds.w()&&this.N(Gj(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(Gj(a,a.actualBounds));this.$b()};t.remove=function(a){Nj(this,a,!0)}; function Nj(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.C(2),c&&b.Lj(),c=d.pc(-1,b,!1),0<=c&&a.cb(fe,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.Is=function(a,b){void 0===b&&(b=!1);if(Aa(a))for(var c=a.length,d=0;dd&&this.Ya();return this}; t.Cy=function(a,b){Tj(this,a,b);a.Xe(this);var c=this.Wa,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.cc&&this.cb(fe,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;fd&&this.Ya();return this}; t.kA=function(a){a.diagram!==this&&C("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.Wa,c=b.indexOf(a);if(b.remove(a)){for(b=a.Pa.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.cc&&this.cb(fe,"layers",this,a,null,c,null);this.N();this.Ya()}}};t.Qj=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null}; t.Yw=function(a){null===this.pf&&(this.pf=new F);this.pf.add(a);this.model.Pe(a);return this};t.mA=function(a){null!==this.pf&&(this.pf.remove(a),0===this.pf.count&&(this.pf=null));this.model.ik(a)};t.Pe=function(a){null===this.zg&&(this.zg=new F);this.zg.add(a);return this};t.ik=function(a){null!==this.zg&&(this.zg.remove(a),0===this.zg.count&&(this.zg=null))}; t.ds=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a);a.change!==de&&(this.isModified=!0);if(null!==this.zg)for(var b=this.zg,c=b.length,d=0;dn.Pa.indexOf(q)&&n.oi(p,q,r):(q.isSelected=!1,q.isHighlighted=!1,q.Wb(),n.pc(r?p:-1,q,r)))}else n instanceof Q?"number"===typeof p&&q instanceof di&&(b?(q.Xe(this),this.Wa.Gb(p,q)):this.Wa.mb(p)):C("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else d!==de&&C("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings= c}}};Q.prototype.Ea=function(a){return this.undoManager.Ea(a)};Q.prototype.eb=function(a){return this.undoManager.eb(a)};Q.prototype.Kf=function(){return this.undoManager.Kf()};Q.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.Ea(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.eb(b):this.undoManager.Kf(),this.skipsUndoManager=c}};Q.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)}; Q.prototype.rp=function(){this.partManager.rp()}; function Yj(a,b,c){var d=a.animationManager;if(a.vb||a.ld)a.Ca=c,Ni(a),a.N(),a.Ee=!0,d.zb&&(vh(d)||d.ce.add(d.H,"scale",b,a.Ca));else if(null===a.ta)a.Ca=c,Ni(a);else{a.vb=!0;var e=a.viewportBounds.copy(),f=a.Aa,g=a.ya,h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.$c()?l.Hf(Dc)?h=0:l.Hf(Ec)&&(h=f-1):h=l.sb()?l.x*(f-1):f/2);isNaN(k)&&(l.$c()?l.Hf(Cc)?k=0:l.Hf(Fc)&&(k=g-1):k=l.sb()?l.y*(g-1):g/2);null===a.scaleComputation||a.animationManager.defaultAnimation.isAnimating||(c=a.scaleComputation(a, c));ca.maxScale&&(c=a.maxScale);f=J.allocAt(a.pa.x+h/b-h/c,a.pa.y+k/b-k/c);a.position=f;J.free(f);a.Ca=c;Ni(a);a.vb=!1;a.onViewportBoundsChanged(e,a.viewportBounds,b,!1);fj(a,!1);d.zb&&(vh(d)||d.ce.add(d.H,"scale",b,a.Ca))}} Q.prototype.onViewportBoundsChanged=function(a,b,c,d){if(!a.D(b)){void 0===d&&(d=!1);d||(this.Ee=!0);this.vd=!0;var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==qh||a.width===b.width&&a.height===b.height||e.C();e=this.currentTool;!0===this.Vk&&e instanceof La&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),xe(e,this));this.vb||this.invalidateViewport(a,b);qj(this);this.fc.scale=c;this.fc.position.x=a.x;this.fc.position.y=a.y;this.fc.bounds.assign(a);this.fc.canvasSize.width= Math.round(a.width*c);this.fc.canvasSize.height=Math.round(a.height*c);this.fc.newCanvasSize.width=this.Aa;this.fc.newCanvasSize.height=this.ya;this.fc.isScroll=d;this.R("ViewportBoundsChanged",this.fc,a);this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.Yc(b)&&a.bb()})}}; function qj(a,b){var c=a.fe;if(null!==c&&c.visible){for(var d=L.alloc(),e=1,f=1,g=c.O.s,h=g.length,k=0;km||(Zj(l.figure)?f=f*m/K.vx(f,m):e=e*m/K.vx(e,m))}g=c.gridCellSize;d.h(f*g.width,e*g.height);if(void 0!==b)e=b.width,f=b.height,a=b.x,g=b.y;else{b=N.alloc();a=a.viewportBounds;b.h(a.x,a.y,a.width,a.height);if(!b.w()){N.free(b);return}e=b.width;f=b.height;a=b.x;g=b.y;N.free(b)}c.width=e+2*d.width;c.height=f+2*d.height;b=J.alloc();K.No(a,g,0,0,d.width,d.height, b);b.offset(-d.width,-d.height);L.free(d);c.part.location=b;J.free(b)}}Q.prototype.clearSelection=function(a){void 0===a&&(a=!1);var b=this.selection;if(0!==b.count){a||this.R("ChangingSelection",b);for(var c=b.Fa(),d=c.length,e=0;e=d&&!f.defaultAnimation.isAnimating&&!f.zb&&(b||kh(f,"Layout"));a.xh=!1;for(var g=a.ai.iterator;g.next();)hk(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),lh(a),e.isValidLayout=!0):a.xh=!0)}finally{b=a.undoManager.isInternalTransaction,0===d&&(a.eb("Layout"),a.undoManager.isInternalTransaction= !1),!b||0!==d&&1!==d||mh(f),a.aa=c}}}function hk(a,b,c,d){if(null!==b){for(var e=b.gl.iterator;e.next();)hk(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.rh=!b.location.w(),e.doLayout(b),b.C(32),tj(a,b),e.isValidLayout=!0):a.xh=!0)}}t.yz=function(){for(var a=new F,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.kh()&&a.add(c)}return a.iterator}; function xi(a){function b(a){var b=a.toLowerCase(),e=new F;c.add(a,e);c.add(b,e);d.add(a,a);d.add(b,a)}var c=new ob,d=new ob;b("InitialAnimationStarting");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("GainedFocus");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped"); b("LostFocus");b("Modified");b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");b("InvalidateDraw");a.iw=c;a.hw=d} function Dj(a,b){var c=a.hw.I(b);return null!==c?c:a.hw.I(b.toLowerCase())}function ik(a,b){var c=a.iw.I(b);if(null!==c)return c;c=a.iw.I(b.toLowerCase());if(null!==c)return c;C("Unknown DiagramEvent name: "+b)}t.Bj=function(a,b){a=ik(this,a);null!==a&&a.add(b);return this};t.am=function(a,b){a=ik(this,a);null!==a&&a.remove(b)}; t.R=function(a,b,c){var d=ik(this,a),e=new ae;e.diagram=this;a=Dj(this,a);null!==a&&(e.name=a);void 0!==b&&(e.subject=b);void 0!==c&&(e.parameter=c);b=d.length;if(1===b)d.M(0)(e);else if(0!==b)for(d=d.Fa(),c=0;c=c.top&&0>=c.left&&0>=c.right&&0>=c.bottom)return b;var d=this.viewportBounds,e=this.scale;d=N.allocAt(0,0,d.width*e,d.height*e);var f=J.allocAt(0,0);if(a.x>=d.x&&a.xd.x+d.width-c.right&&this.allowHorizontalScroll&&(g=Math.max(this.scrollHorizontalLineChange, 1),g|=0,f.x+=g,a.x>d.x+d.width-c.right/2&&(f.x+=g),a.x>d.x+d.width-c.right/4&&(f.x+=4*g));a.y>=d.y&&a.yd.y+d.height-c.bottom&&this.allowVerticalScroll&&(g=Math.max(this.scrollVerticalLineChange,1),g|=0,f.y+=g,a.y>d.y+d.height-c.bottom/2&&(f.y+=g),a.y>d.y+d.height-c.bottom/4&&(f.y+=4*g));f.Xa(pb)||(b=new J(b.x+f.x/e,b.y+f.y/e)); N.free(d);J.free(f);return b};t=Q.prototype;t.Cs=function(){return null};t.av=function(){return null};t.bs=function(a,b){this.pj.add(a,b)};t.Fu=function(a){(this.Pw=a)||this.nodes.each(function(a){a instanceof pf&&(a.$p=null)})}; function Ek(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].al){f=!1;break}f||a-l>k?b(c,e,h):x.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Og.iterator;g.next();)if(!g.value[0].al){f=!1;break}if("function"!==typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;x.requestAnimationFrame(function(){d()});return null}t.Wz=function(a){if(!Ng)return null;void 0===a&&(a={});a.returnType="Image";return this.Jx(a)}; t.Jx=function(a){void 0===a&&(a={});return Ek(this,this.Xz,a)}; t.Xz=function(a,b,c){var d=Fk(c,a,"canvas",null);if(null===d)return null;c=d.Z.canvas;var e=null;if(null!==c)switch(e=a.returnType,void 0===e?e="string":e=e.toLowerCase(),e){case Zi+"data":e=d.getImageData(0,0,c.width,c.height);break;case Zi:d=(a.document||document).createElement("img");d.src=c.toDataURL(a.type,a.details);e=d;break;case "blob":"function"!==typeof b&&C('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.');if("function"=== typeof c.toBlob)return c.toBlob(b,a.type,a.details),"toBlob";b(null);return null;default:e=c.toDataURL(a.type,a.details)}return"function"===typeof b?(b(e),null):e}; function Fk(a,b,c,d){a.animationManager.Cc();a.bd();if(null===a.ta)return null;"object"!==typeof b&&C("properties argument must be an Object.");var e=b.size||null,f=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(f="NaN");var g=b.maxSize;void 0===b.maxSize&&(g="SVG"===c?new L(Infinity,Infinity):new L(2E3,2E3));var h=b.position||null,k=b.parts||null,l=void 0===b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0===n&&(n=!0);var p=b.document||document,q=b.elementFinished||null,r=b.showTemporary; void 0===r&&(r=!n);b=b.showGrid;void 0===b&&(b=r);null!==e&&isNaN(e.width)&&isNaN(e.height)&&(e=null);"number"===typeof l?l=new dc(l):l instanceof dc||C("MakeImage padding must be a Margin or a number.");l.left=Math.max(l.left,0);l.right=Math.max(l.right,0);l.top=Math.max(l.top,0);l.bottom=Math.max(l.bottom,0);a.ib.Vc(!0);n=new Pi(null,p,void 0,!0);var u=n.context;if(!(e||f||k||h)){n.width=a.Aa+Math.ceil(l.left+l.right);n.height=a.ya+Math.ceil(l.top+l.bottom);if("SVG"===c){if(null===d)return null; d.resize(n.width,n.height,n.width,n.height);d.ownerDocument=p;d.hs=q;Bj(a,d.context,l,new L(n.width,n.height),a.Ca,a.pa,k,m,r,b);return d.context}a.Xm=!1;Bj(a,u,l,new L(n.width,n.height),a.Ca,a.pa,k,m,r,b);a.Xm=!0;return n.context}var w=a.Pp,v=a.documentBounds.copy();v.Fv(a.yb);if(r)for(var y=a.Wa.s,z=y.length,A=0;Aw?(f=w,e=v.width,v=v.height):(e=g.width,v=g.height)):(e=v.width*f,v=v.height*f):(f=w,e=v.width,v=v.height);null!==l?(e+=h,v+=z):l=new dc(0);null!==g&&(w=g.width,g=g.height,isNaN(w)&&(w=2E3),isNaN(g)&&(g=2E3),isFinite(w)&& (e=Math.min(e,w)),isFinite(g)&&(v=Math.min(v,g)));n.width=Math.ceil(e);n.height=Math.ceil(v);if("SVG"===c){if(null===d)return null;d.resize(n.width,n.height,n.width,n.height);d.ownerDocument=p;d.hs=q;Bj(a,d.context,l,new L(Math.ceil(e),Math.ceil(v)),f,y,k,m,r,b);return d.context}a.Xm=!1;Bj(a,u,l,new L(Math.ceil(e),Math.ceil(v)),f,y,k,m,r,b);a.Xm=!0;return n.context} ma.Object.defineProperties(Q.prototype,{renderer:{get:function(){return this.nl},set:function(a){this instanceof Gk||(""===a&&(a="default"),a=a.toLowerCase(),a!==this.nl&&(this.nl=a,"default"===a||"canvas"===a?(a=this.pj.get("svg"),null!==a&&a.Oa.remove(),this.ta&&(this.ib=this.ta.context)):"svg"===a?(this.pj.contains("svg")?a=this.pj.get("svg"):(a=new Fj(this,x.document),this.bs("svg",a)),null!==this.div&&this.div.appendChild(a.Oa),this.ib=a.context,this.ta&&(this.ta.context.setTransform(this.Mb, 0,0,this.Mb,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya))):"debug"!==a||this.pj.contains("SVG")||(a=new Fj(this,x.document),this.bs("SVG",a),a.Oa.style.backgroundColor="whitesmoke",null!==this.div&&this.div.after(a.Oa)),this.hk()))}},div:{get:function(){return this.Ka},set:function(a){if(this.Ka!==a){var b=this.Ka;null!==b?(b.H=void 0,b.goDiagram=void 0,b.go=void 0,b.innerHTML="",null!==this.ta&&(b=this.ta.Oa,this.removeEventListener(b,"pointermove",this.dk,!1), this.removeEventListener(b,"pointerdown",this.ui,!1),this.removeEventListener(b,"pointerup",this.fk,!1),this.removeEventListener(b,"pointerout",this.ek,!1),this.removeEventListener(b,"pointercancel",this.ck,!1),this.ta.mx()),this.ol&&(this.ol.disconnect(),this.ol=null),b=this.toolManager,null!==b&&(b.mouseDownTools.each(function(a){a.cancelWaitAfter()}),b.mouseMoveTools.each(function(a){a.cancelWaitAfter()}),b.mouseUpTools.each(function(a){a.cancelWaitAfter()})),b.cancelWaitAfter(),this.currentTool.doCancel(), this.ta=null,this.removeEventListener(x,"resize",this.Ov,!1),this.removeEventListener(x,"wheel",this.$j,!0),ke===this&&(ke=null)):null===this.ui&&(this.hf=!1);this.Ka=null;if(null!==a){if(b=a.H)b.div=null;vi(this,a);this.hk()}}}},$w:{get:function(){return this.Sq}},pi:{get:function(){return this.hf}},draggedLink:{get:function(){return this.nt},set:function(a){this.nt!==a&&(this.nt=a,null!==a&&(this.Vt=a.fromPort, this.Wt=a.toPort))}},Mx:{get:function(){return this.Vt},set:function(a){this.Vt=a}},Nx:{get:function(){return this.Wt},set:function(a){this.Wt=a}},animationManager:{get:function(){return this.Yd}},undoManager:{get:function(){return this.cc.undoManager}},skipsUndoManager:{get:function(){return this.Wg},set:function(a){this.Wg=a;this.cc.skipsUndoManager= a}},delaysLayout:{get:function(){return this.lt},set:function(a){this.lt=a}},opacity:{get:function(){return this.pb},set:function(a){var b=this.pb;b!==a&&((0>a||1a&&xa(a,">= 0",Q,"scrollHorizontalLineChange"),this.iu= a,this.g("scrollHorizontalLineChange",b,a))}},scrollVerticalLineChange:{get:function(){return this.mu},set:function(a){var b=this.mu;b!==a&&(0>a&&xa(a,">= 0",Q,"scrollVerticalLineChange"),this.mu=a,this.g("scrollVerticalLineChange",b,a))}},lastInput:{get:function(){return this.cj},set:function(a){this.cj=a}},previousInput:{get:function(){return this.Qg},set:function(a){this.Qg=a}},firstInput:{ get:function(){return this.bq},set:function(a){this.bq=a}},currentCursor:{get:function(){return this.it},set:function(a){""===a&&(a=this.Op);if(this.it!==a){var b=this.ta,c=this.Ka;if(null!==b&&null!==c){this.it=a;var d=b.style.cursor;b.style.cursor=a;c.style.cursor=a;b.style.cursor===d&&(b.style.cursor="-webkit-"+a,c.style.cursor="-webkit-"+a,b.style.cursor===d&&(b.style.cursor="-moz-"+a,c.style.cursor="-moz-"+a,b.style.cursor===d&&(b.style.cursor=a,c.style.cursor= a)))}}}},defaultCursor:{get:function(){return this.Op},set:function(a){""===a&&(a="auto");var b=this.Op;b!==a&&(this.Op=a,this.g("defaultCursor",b,a))}},click:{get:function(){return this.zh},set:function(a){var b=this.zh;b!==a&&(this.zh=a,this.g("click",b,a))}},doubleClick:{get:function(){return this.Fh},set:function(a){var b=this.Fh;b!==a&&(this.Fh=a,this.g("doubleClick",b,a))}},contextClick:{ get:function(){return this.Bh},set:function(a){var b=this.Bh;b!==a&&(this.Bh=a,this.g("contextClick",b,a))}},mouseOver:{get:function(){return this.Qh},set:function(a){var b=this.Qh;b!==a&&(this.Qh=a,this.g("mouseOver",b,a))}},mouseHover:{get:function(){return this.Oh},set:function(a){var b=this.Oh;b!==a&&(this.Oh=a,this.g("mouseHover",b,a))}},mouseHold:{get:function(){return this.Nh},set:function(a){var b= this.Nh;b!==a&&(this.Nh=a,this.g("mouseHold",b,a))}},mouseDragOver:{get:function(){return this.Qt},set:function(a){var b=this.Qt;b!==a&&(this.Qt=a,this.g("mouseDragOver",b,a))}},mouseDrop:{get:function(){return this.Lh},set:function(a){var b=this.Lh;b!==a&&(this.Lh=a,this.g("mouseDrop",b,a))}},handlesDragDropForTopLevelParts:{get:function(){return this.xt},set:function(a){var b=this.xt;b!==a&&(this.xt=a,this.g("handlesDragDropForTopLevelParts", b,a))}},mouseEnter:{get:function(){return this.Mh},set:function(a){var b=this.Mh;b!==a&&(this.Mh=a,this.g("mouseEnter",b,a))}},mouseLeave:{get:function(){return this.Ph},set:function(a){var b=this.Ph;b!==a&&(this.Ph=a,this.g("mouseLeave",b,a))}},toolTip:{get:function(){return this.$h},set:function(a){var b=this.$h;b!==a&&(this.$h=a,this.g("toolTip",b,a))}},contextMenu:{get:function(){return this.Ch}, set:function(a){var b=this.Ch;b!==a&&(this.Ch=a,this.g("contextMenu",b,a))}},commandHandler:{get:function(){return this.nb},set:function(a){this.nb!==a&&(this.nb=a,a.Xe(this))}},toolManager:{get:function(){return this.te},set:function(a){this.te!==a&&(this.te=a,a.diagram=this)}},defaultTool:{get:function(){return this.ob},set:function(a){var b=this.ob;b!==a&&(this.ob=a,a.diagram=this,this.currentTool===b&&(this.currentTool= a))}},currentTool:{get:function(){return this.hb},set:function(a){var b=this.hb;b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&&(this.hb=a,a.diagram=this,a.doStart())}},selection:{get:function(){return this.Hw}},maxSelectionCount:{get:function(){return this.Nt},set:function(a){var b=this.Nt;if(b!==a)if(0<=a&&!isNaN(a)){if(this.Nt=a,this.g("maxSelectionCount", b,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0= 0",Q,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.St},set:function(a){var b=this.St;b!==a&&(this.St=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{ get:function(){return this.wt},set:function(a){var b=this.wt;b!==a&&(this.wt=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{get:function(){return this.Kt},set:function(a){var b=this.Kt;b!==a&&(this.Kt=a,this.g("linkSelectionAdornmentTemplate",b,a))}},highlighteds:{get:function(){return this.nw}},isModified:{get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction? !0:this.rn&&this.Ce!==a.historyIndex:this.rn},set:function(a){if(this.rn!==a){this.rn=a;var b=this.undoManager;!a&&b.isEnabled&&(this.Ce=b.historyIndex);a||ak(this)}}},model:{get:function(){return this.cc},set:function(a){var b=this.cc;if(b!==a){this.currentTool.doCancel();b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&&C("Do not replace a Diagram.model while a transaction is in progress.");this.animationManager.Cc(!0);var c=Li(this,!0);this.hf=!1;this.fn= !0;this.Ce=-2;this.kg=!1;var d=this.vb;this.vb=!0;kh(this.animationManager,"Model");b&&(null!==this.pf&&this.pf.each(function(a){return b.ik(a)}),b.ik(this.Oc));this.cc=a;this.partManager=bk(this.cc.type);for(var e=0;ethis.scale&&(this.scale=a)):xa(a,"> 0",Q,"minScale"))}},maxScale:{get:function(){return this.Mt},set:function(a){var b=this.Mt;b!==a&&(0 0",Q,"maxScale"))}},zoomPoint:{get:function(){return this.zu},set:function(a){this.zu.D(a)||(this.zu=a=a.J())}},contentAlignment:{get:function(){return this.zk}, set:function(a){var b=this.zk;b.D(a)||(this.zk=a=a.J(),this.g("contentAlignment",b,a),fj(this,!1))}},initialContentAlignment:{get:function(){return this.pq},set:function(a){var b=this.pq;b.D(a)||(this.pq=a=a.J(),this.g("initialContentAlignment",b,a))}},padding:{get:function(){return this.yb},set:function(a){"number"===typeof a&&(a=new dc(a));var b=this.yb;b.D(a)||(this.yb=a=a.J(),this.Ya(),this.g("padding",b,a))}},partManager:{ get:function(){return this.Pc},set:function(a){var b=this.Pc;b!==a&&(null!==a.diagram&&C("Cannot share PartManagers between Diagrams: "+a.toString()),b&&b.Xe(null),this.Pc=a,a.Xe(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{ get:function(){return this.Sc},set:function(a){var b=this.Sc;b!==a&&(this.Sc=a,a.diagram=this,a.group=null,this.xh=!0,this.g("layout",b,a),this.$b())}},isTreePathToChildren:{get:function(){return this.Ht},set:function(a){var b=this.Ht;if(b!==a&&(this.Ht=a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Hk(a.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(a){var b= this.uu;b!==a&&(a!==yi&&a!==Ik&&a!==Jk&&C("Unknown Diagram.treeCollapsePolicy: "+a),this.uu=a,this.g("treeCollapsePolicy",b,a))}},Ue:{get:function(){return this.pw},set:function(a){this.pw=a}},avoidanceCellSize:{get:function(){return this.aw},set:function(a){this.Xh=null;this.aw=new L(Math.max(1,a.width),Math.max(1,a.height))}},avoidanceLimit:{get:function(){return this.bw},set:function(a){this.bw=Math.max(1, a)}},autoScrollInterval:{get:function(){return this.vp},set:function(a){var b=this.vp;b!==a&&(this.vp=a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{get:function(){return this.xp},set:function(a){"number"===typeof a&&(a=new dc(a));var b=this.xp;b.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",b,a))}}}); ma.Object.defineProperties(Q,{licenseKey:{get:function(){return Kk.jc()},set:function(a){Kk.add(a.replace(/\s/g,""))}},version:{get:function(){return Lk}}});Q.prototype.makeImageData=Q.prototype.Jx;Q.prototype.makeImage=Q.prototype.Wz;Q.prototype.cacheGroupExternalLinks=Q.prototype.Fu;Q.prototype.addRenderer=Q.prototype.bs;Q.prototype.makeSVG=Q.prototype.av;Q.prototype.makeSvg=Q.prototype.Cs;Q.prototype.stopAutoScroll=Q.prototype.ug; Q.prototype.doAutoScroll=Q.prototype.gs;Q.prototype.isUnoccupied=Q.prototype.Yj;Q.prototype.raiseDiagramEvent=Q.prototype.R;Q.prototype.removeDiagramListener=Q.prototype.am;Q.prototype.addDiagramListener=Q.prototype.Bj;Q.prototype.findTreeRoots=Q.prototype.yz;Q.prototype.layoutDiagram=Q.prototype.Uz;Q.prototype.findTopLevelGroups=Q.prototype.qz;Q.prototype.findTopLevelNodesAndLinks=Q.prototype.rz;Q.prototype.ensureBounds=Q.prototype.Va;Q.prototype.findLinksByExample=Q.prototype.ls; Q.prototype.findNodesByExample=Q.prototype.ms;Q.prototype.findLinkForData=Q.prototype.Kc;Q.prototype.findNodeForData=Q.prototype.ii;Q.prototype.findPartForData=Q.prototype.Lc;Q.prototype.findLinkForKey=Q.prototype.findLinkForKey;Q.prototype.findNodeForKey=Q.prototype.Vb;Q.prototype.findPartForKey=Q.prototype.findPartForKey;Q.prototype.rebuildParts=Q.prototype.Wd;Q.prototype.transformViewToDoc=Q.prototype.Ps;Q.prototype.transformRectDocToView=Q.prototype.zA;Q.prototype.transformDocToView=Q.prototype.op; Q.prototype.centerRect=Q.prototype.es;Q.prototype.scrollToRect=Q.prototype.tv;Q.prototype.scroll=Q.prototype.scroll;Q.prototype.highlightCollection=Q.prototype.Jz;Q.prototype.highlight=Q.prototype.Iz;Q.prototype.selectCollection=Q.prototype.rA;Q.prototype.select=Q.prototype.select;Q.prototype.updateAllRelationshipsFromData=Q.prototype.rp;Q.prototype.updateAllTargetBindings=Q.prototype.updateAllTargetBindings;Q.prototype.commit=Q.prototype.commit;Q.prototype.rollbackTransaction=Q.prototype.Kf; Q.prototype.commitTransaction=Q.prototype.eb;Q.prototype.startTransaction=Q.prototype.Ea;Q.prototype.raiseChanged=Q.prototype.g;Q.prototype.raiseChangedEvent=Q.prototype.cb;Q.prototype.removeChangedListener=Q.prototype.ik;Q.prototype.addChangedListener=Q.prototype.Pe;Q.prototype.removeModelChangedListener=Q.prototype.mA;Q.prototype.addModelChangedListener=Q.prototype.Yw;Q.prototype.findLayer=Q.prototype.Qj;Q.prototype.removeLayer=Q.prototype.kA;Q.prototype.addLayerAfter=Q.prototype.Cy; Q.prototype.addLayerBefore=Q.prototype.Ww;Q.prototype.addLayer=Q.prototype.Al;Q.prototype.moveParts=Q.prototype.moveParts;Q.prototype.copyParts=Q.prototype.Kj;Q.prototype.removeParts=Q.prototype.Is;Q.prototype.remove=Q.prototype.remove;Q.prototype.add=Q.prototype.add;Q.prototype.clearDelayedGeometries=Q.prototype.bx;Q.prototype.setProperties=Q.prototype.nm;Q.prototype.attach=Q.prototype.Du;Q.prototype.set=Q.prototype.set;Q.prototype.resetInputOptions=Q.prototype.Sx;Q.prototype.setInputOption=Q.prototype.sA; Q.prototype.getInputOption=Q.prototype.Ql;Q.prototype.resetRenderingHints=Q.prototype.Tx;Q.prototype.setRenderingHint=Q.prototype.Xx;Q.prototype.getRenderingHint=Q.prototype.Gf;Q.prototype.maybeUpdate=Q.prototype.bd;Q.prototype.requestUpdate=Q.prototype.$b;Q.prototype.delayInitialization=Q.prototype.Xy;Q.prototype.isUpdateRequested=Q.prototype.Pz;Q.prototype.invalidateDocumentBounds=Q.prototype.Ya;Q.prototype.findObjectsNear=Q.prototype.og;Q.prototype.findPartsNear=Q.prototype.mz; Q.prototype.findObjectsIn=Q.prototype.Cf;Q.prototype.findPartsIn=Q.prototype.ux;Q.prototype.findObjectsAt=Q.prototype.ji;Q.prototype.findPartsAt=Q.prototype.lz;Q.prototype.findObjectAt=Q.prototype.ic;Q.prototype.findPartAt=Q.prototype.Ol;Q.prototype.focusObject=Q.prototype.zz;Q.prototype.alignDocument=Q.prototype.Jy;Q.prototype.zoomToRect=Q.prototype.BA;Q.prototype.zoomToFit=Q.prototype.zoomToFit;Q.prototype.diagramScroll=Q.prototype.kx;Q.prototype.focus=Q.prototype.focus; var oi=new ob,Oi=null,Ng=void 0!==x.document,Ji=null,Ki="",qh=new E(Q,"None",0),ij=new E(Q,"Uniform",1),jj=new E(Q,"UniformToFill",2),Df=new E(Q,"CycleAll",10),Hf=new E(Q,"CycleNotDirected",11),Jf=new E(Q,"CycleNotDirectedFast",12),Rf=new E(Q,"CycleNotUndirected",13),Ef=new E(Q,"CycleDestinationTree",14),Gf=new E(Q,"CycleSourceTree",15),Rh=new E(Q,"DocumentScroll",1),Th=new E(Q,"InfiniteScroll",2),yi=new E(Q,"TreeParentCollapsed",21),Ik=new E(Q,"AllParentsCollapsed",22),Jk=new E(Q,"AnyParentsCollapsed", 23),Kk=new F,Lk="2.3.10",Zi="image",aj=null,mi=!1; function ni(){if(Ng){var a=x.document.createElement("canvas"),b=a.getContext("2d"),c=Ma("7ca11abfd022028846");b[c]=Ma("398c3597c01238");for(var d=["5da73c80a36455d7038e4972187c3cae51fd22",ra.Dx+"4ae6247590da4bb21c324ba3a84e385776",ld.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",K.za],e=1;5>e;e++)b[Ma("7ca11abfd7330390")](Ma(d[e-1]),10,15*e);b[c]=Ma("39f046ebb36e4b");for(c=1;5>c;c++)b[Ma("7ca11abfd7330390")](Ma(d[c-1]),10,15*c);if(4!==d.length||"5"!==d[0][0]||"7"!==d[3][0])ld.prototype.Cd=ld.prototype.Eu; aj=a}}Q.className="Diagram";Q.fromDiv=function(a){var b=a;"string"===typeof a&&(b=x.document.getElementById(a));return b instanceof HTMLDivElement&&b.H instanceof Q?b.H:null};Q.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};Q.useDOM=function(a){Ng=a?void 0!==x.document:!1};Q.isUsingDOM=function(){return Ng};Q.None=qh;Q.Uniform=ij; Q.UniformToFill=jj;Q.CycleAll=Df;Q.CycleNotDirected=Hf;Q.CycleNotDirectedFast=Jf;Q.CycleNotUndirected=Rf;Q.CycleDestinationTree=Ef;Q.CycleSourceTree=Gf;Q.DocumentScroll=Rh;Q.InfiniteScroll=Th;Q.TreeParentCollapsed=yi;Q.AllParentsCollapsed=Ik;Q.AnyParentsCollapsed=Jk;function ui(){this.wy=null;this.j="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.Rc=this.j=!0:this.Rc=null} function Aj(a,b){b.ib.setTransform(b.Mb,0,0,b.Mb,0,0);b.ib.yc();if(null===a.Rc)a:{b="f";var c=x[Ma("76a715b2f73f148a")][Ma("72ba13b5")]||"";a.Rc=!0;if(Ng){var d=Q[Ma("76a115b6ed251eaf4692")];if(d)for(var e=Kk.iterator;e.next();){d=e.value;d=Ma(d).split(Ma("39e9"));if(6>d.length)break;var f=Ma(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Ma(ra[Ma("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){var h=x[Ma("74a900bae4370f8b51")][Ma("6fbb13a1c2311e8a57")].toLowerCase();g=h[Ma("73a612b6fb191d")](Ma("3aad1ab6e022098b4dc4")); f=Ma(d[2]);if(-1g&&f!==Ma("7da71ca0ad381e90")&&(g=b[Ma("73a612b6fb191d")](Ma("76a715b2ef3e149757")));0>g&&(g=b[Ma("73a612b6fb191d")](Ma("76a715b2ef3e149757")));0>g&&(g=b[Ma("73a612b6fb191d")](Ma("2bfa41fdb3784bca12")));0>g&&(g=c[Ma("73a612b6fb191d")](Ma("7baa19a6f76c1988428554")));a.Rc=!(0<=g&&gh),!a.Rc))break;if("#"===f[0]){g=x.document.createElement("div");for(var k=d[0].replace(/[A-Za-z]/g,"");4>k.length;)k+="9";h=k;k=k.substr(k.length-4);d="";d+=["gsh","gsf"][parseInt(k.substr(0, 1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(k.substr(0,1),10)%4];g[Ma("79a417a0f0181a8946")]=d;if(x.document[Ma("78a712aa")]){x.document[Ma("78a712aa")][Ma("7bb806b6ed32388c4a875b")](g);k=x.getComputedStyle(g).getPropertyValue(Ma("78a704b7e62456904c9b12701b6532a8"));var l=x.getComputedStyle(g).getPropertyValue(Ma("75b817b0ea2202"));x.document[Ma("78a712aa")][Ma("68ad1bbcf533388c4a875b")](g);if(k)if(g=x[Ma("77a902b0eb1b1e804a8a")],l==="0."+parseInt(h,10)%100||-1!==k.indexOf(parseInt(f[1]+ f[2],16))&&-1!==k.indexOf(parseInt(f[3]+f[4],16))){a.Rc=!1;break}else if(g&&g(Ma("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(d="."+d,f=0;fd.updateDelay?d.N():d.o||(d.o=!0,setTimeout(function(){return d.redraw()}, d.updateDelay))};c.Of=function(){null!==d.observed&&Qk(d)};c.autoScale=ij;c.vb=!1;b&&Object.assign(c,b);return c}la(Gk,Q);Gk.prototype.computePixelRatio=function(){return 1}; Gk.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var a=this.ta,b=this.ib;if(null!==a&&null!==b){xj(this);if(null===this.ql){var c=new Pi(null);c.width=a.width;c.height=a.height;this.ql=c}try{this.ta=this.ql,this.ib=this.ta.context,this.ib.Vc(!0),this.ib.setTransform(1,0,0,1,0,0),this.ib.clearRect(0,0,this.ta.width,this.ta.height),Rk(this)}finally{this.ta=a,this.ib=b}}}Q.prototype.redraw.call(this)}; Gk.prototype.gc=function(){null===this.Ka&&C("No div specified");null===this.ta&&C("No canvas specified");if(!(this.ta instanceof Fj)&&(fi(this.box),this.Fc)){var a=this.observed;if(null!==a&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){xj(this);var b=this.ta;a=this.ib;a.Vc(!0);a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,b.width,b.height);1>this.updateDelay?Rk(this):null!==this.ql&&(a.drawImage(this.ql.Oa,0,0),b=this.Ab,b.reset(),1!==this.scale&&b.scale(this.scale),0===this.position.x&& 0===this.position.y||b.translate(-this.position.x,-this.position.y),a.scale(this.Mb,this.Mb),a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy),a.yc());b=this.Wa.s;for(var c=b.length,d=0;da&&(a=0);this.ia!==a&&(this.ia=a)}}});Gk.className="Overview";function Pk(){Ae.call(this);this.j=null}la(Pk,Ae); Pk.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(null===a||!a.allowMove||!a.allowSelect)return!1;var b=a.observed;if(null===b)return!1;var c=a.lastInput;if(!c.left||a.currentTool!==this&&(!this.isBeyondDragSize()||c.isTouchEvent&&c.timestamp-a.firstInput.timestampb.maxScale||(b.scale=a))};Sk.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);var b=this.diagram;if(b.autoScale!==qh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom}; Sk.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);var b=this.diagram;b.autoScale===qh&&(a=b.scale*a,ab.maxScale||(b.scale=a))};Sk.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);var b=this.diagram;if(b.autoScale!==qh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};Sk.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);var b=this.diagram;ab.maxScale||(b.scale=a)}; Sk.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);var b=this.diagram;return ab.maxScale?!1:b.allowZoom}; Sk.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.Cc();a.redraw();var c=a.position,d=a.scale;kh(b,"Zoom To Fit");this.isZoomToFitRestoreEnabled&&d===this.Au&&!isNaN(this.Jt)&&a.documentBounds.D(this.yu)?(a.scale=this.Jt,a.position=this.sw,this.Au=NaN,this.yu=bc):(this.Jt=d,this.sw=c.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy());mh(b)};Sk.prototype.canZoomToFit=function(){return this.diagram.allowZoom}; Sk.prototype.scrollToPart=function(a){void 0===a&&(a=null);var b=this.diagram;b.Va();if(null===a){try{null!==this.cg&&(this.cg.next()?a=this.cg.value:this.cg=null)}catch(k){this.cg=null}null===a&&(0a&&(a+=360));return a}; t.Df=function(){if(0!==(this.l&4096)===!1)return this.Kk;var a=this.Ca;return null!==this.panel?a*this.panel.Df():a};t.qs=function(a,b){void 0===b&&(b=new J);b.assign(a);this.oe.Cd(b);return b};t.rs=function(a,b,c){return this.Sj(a.x,a.y,b.x,b.y,c)}; t.Sj=function(a,b,c,d,e){var f=this.transform,g=1/(f.m11*f.m22-f.m12*f.m21),h=f.m22*g,k=-f.m12*g,l=-f.m21*g,m=f.m11*g,n=g*(f.m21*f.dy-f.m22*f.dx),p=g*(f.m12*f.dx-f.m11*f.dy);if(null!==this.areaBackground)return f=this.actualBounds,K.Ff(f.left,f.top,f.right,f.bottom,a,b,c,d,e);g=a*h+b*l+n;a=a*k+b*m+p;b=c*h+d*l+n;c=c*k+d*m+p;e.h(0,0);d=this.naturalBounds;c=K.Ff(0,0,d.width,d.height,g,a,b,c,e);e.transform(f);return c}; Y.prototype.measure=function(a,b,c,d){if(!1!==uj(this)){var e=this.Kg,f=e.right+e.left;e=e.top+e.bottom;a=Math.max(a-f,0);b=Math.max(b-e,0);c=Math.max((c||0)-f,0);d=Math.max((d||0)-e,0);f=this.angle;e=this.desiredSize;var g=this.kq();90===f||270===f?(a=isFinite(e.height)?e.height+g:a,b=isFinite(e.width)?e.width+g:b):(a=isFinite(e.width)?e.width+g:a,b=isFinite(e.height)?e.height+g:b);e=c||0;g=d||0;var h=this instanceof W;switch(jl(this,!0)){case kg:g=e=0;h&&(b=a=Infinity);break;case nd:isFinite(a)&& a>c&&(e=a);isFinite(b)&&b>d&&(g=b);break;case Wk:isFinite(a)&&a>c&&(e=a);g=0;h&&(b=Infinity);break;case Xk:isFinite(b)&&b>d&&(g=b),e=0,h&&(a=Infinity)}h=this.maxSize;var k=this.minSize;e>h.width&&k.widthh.height&&k.heighta.height||this.Cb> a.width)))c=!0;this.l=c?this.l|256:this.l&-257;this.Ib.w()||C("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString());this.Xl(f,this.Ib);ll(this,!1);N.free(f)};t=Y.prototype;t.eh=function(){}; function ml(a,b,c,d,e){a.Ib.h(b,c,d,e);if(!a.desiredSize.w()){var f=a.uc;c=a.Kg;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=jl(a,!0);c===d&&f===e&&(b=kg);switch(b){case kg:if(c>d||f>e)pj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case nd:pj(a,!0);a.measure(d,e,0,0);break;case Wk:pj(a,!0);a.measure(d,f,0,0);break;case Xk:pj(a,!0),a.measure(c,e,0,0)}}} t.Xl=function(a,b){var c=this.part;null!==c&&null!==c.diagram&&(c.selectionObject!==this&&c.resizeObject!==this&&c.rotateObject!==this||nl(c,!0),this.N(),Ub(a,b)||(c.oh(),this.Pn(c)))};t.Pn=function(a){null!==this.portId&&(nl(a,!0),a instanceof V&&ol(a,this))}; t.gc=function(a,b){if(!pl(this,a,b)&&this.visible){var c=this.opacity;if(0!==c){var d=1;1!==c&&(d=a.globalAlpha,a.globalAlpha=d*c);var e="";""!==this.filter&&(e=a.filter,a.filter=this.filter);var f=this instanceof W&&kl(this),g=this.Ib;if(f){var h=this.Ib,k=this.dc,l=this.areaBackground,m=this.Ma;null===l&&null===m||a.yc();null!==l&&(ji(this,a,l,!0,!0,k,h),l instanceof ql&&l.type===rl?(a.beginPath(),a.rect(h.x,h.y,h.width,h.height),a.ng(l)):a.fillRect(h.x,h.y,h.width,h.height));null!==m&&(ji(this, a,m,!0,!1,k,h),m instanceof ql&&m.type===rl?(a.beginPath(),a.rect(h.x,h.y,h.width,h.height),a.ng(m)):a.fillRect(h.x,h.y,h.width,h.height));this.hh(a,b)}if(!f&&(f||0!==g.width&&0!==g.height&&!isNaN(g.x)&&!isNaN(g.y))){f=this.transform;h=this.panel;0!==(this.l&4096)===!0&&sl(this);l=this.part;k=!1;var n=0;l&&b.Gf("drawShadows")&&(k=l.isShadowed)&&(m=l.shadowOffset,n=Math.max(m.y,m.x)*b.scale*b.Mb);m=this.Dd();var p;if(!(p=b.$i||!m)){var q=this.naturalBounds;p=this.wh;var r=p.m11,u=p.m21,w=p.dx,v=p.m12, y=p.m22,z=p.dy,A,B=A=0;p=A*r+B*u+w;var D=A*v+B*y+z;A=q.width+n;B=0;var M=A*r+B*u+w;A=A*v+B*y+z;B=Math.min(p,M);var S=Math.min(D,A);var R=Math.max(p+0,M)-B;var I=Math.max(D+0,A)-S;p=B;D=S;A=q.width+n;B=q.height+n;M=A*r+B*u+w;A=A*v+B*y+z;B=Math.min(p,M);S=Math.min(D,A);R=Math.max(p+R,M)-B;I=Math.max(D+I,A)-S;p=B;D=S;A=0;B=q.height+n;M=A*r+B*u+w;A=A*v+B*y+z;B=Math.min(p,M);S=Math.min(D,A);R=Math.max(p+R,M)-B;I=Math.max(D+I,A)-S;p=B;D=S;n=b.viewportBounds;q=n.x;r=n.y;p=!(p>n.width+q||q>R+p||D>n.height+ r||r>I+D)}if(p){p=0!==(this.l&256);a.clipInsteadOfFill&&(p=!1);this instanceof Pg&&(a.font=this.font);if(p){D=h.se()?h.naturalBounds:h.actualBounds;R=Math.max(g.x,D.x);I=Math.max(g.y,D.y);n=Math.min(g.right,D.right)-R;q=Math.min(g.bottom,D.bottom)-I;r=this.tb;null!==r&&(R=r.x,I=r.y,n=r.width,q=r.height);if(R>g.width+g.x||g.x>D.width+D.x){1!==c&&(a.globalAlpha=d);""!==this.filter&&(a.filter=e);return}a.save();a.beginPath();a.rect(R,I,n,q);a.clip()}if(m){if(!l.isVisible()){1!==c&&(a.globalAlpha=d); ""!==this.filter&&(a.filter=e);return}k&&(D=l.shadowOffset,a.Ev(D.x*b.scale*this.scale*b.Mb,D.y*b.scale*this.scale*b.Mb,l.shadowBlur),tl(a),a.shadowColor=l.shadowColor)}k&&!0===this.shadowVisible?tl(a):k&&!1===this.shadowVisible&&ul(a);l=this.naturalBounds;null!==this.areaBackground&&(a.yc(),vl(this,a,l,g));a.transform(f.m11,f.m12,f.m21,f.m22,f.dx,f.dy);k&&wl(this,h)&&null===this.shadowVisible&&ul(a);null!==this.Ma&&(a.yc(),xl(this,a,l,g));k&&(null!==this.Ma||null!==this.areaBackground||wl(this,h))? (yl(this,!0),null===this.shadowVisible&&ul(a)):yl(this,!1);this.hh(a,b);k&&0!==(this.l&512)===!0&&tl(a);m&&k&&ul(a);p&&(a.restore(),a.Vc(this instanceof W));f.ws()||(b=1/(f.m11*f.m22-f.m12*f.m21),a.transform(f.m22*b,-f.m12*b,-f.m21*b,f.m11*b,b*(f.m21*f.dy-f.m22*f.dx),b*(f.m12*f.dx-f.m11*f.dy)))}}1!==c&&(a.globalAlpha=d);""!==this.filter&&(a.filter=e)}}};function wl(a,b){if(null===b)return!1;kl(b)&&(b=b.panel);return 0!==(b.l&512)||(b.type===W.Auto||b.type===W.Spot)&&b.Pb()!==a}t.Dv=function(){}; function vl(a,b,c,d){ji(a,b,a.areaBackground,!0,!0,c,d);a.areaBackground instanceof ql&&a.areaBackground.type===rl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.ng(a.areaBackground)):b.fillRect(d.x,d.y,d.width,d.height)}function xl(a,b,c,d){var e=a.kq(),f=c.x,g=c.y,h=c.width+e,k=c.height+e;ji(a,b,a.Ma,!0,!1,c,d);a.Ma instanceof ql&&a.Ma.type===rl?(b.beginPath(),b.rect(f-e/2,g-e/2,h,k),b.ng(a.Ma)):b.fillRect(f-e/2,g-e/2,h,k)} function zl(a,b,c){for(var d=b.O.s,e=d.length,f=-1,g=0;ge)&&C("Must specify non-negative integer row for RowColumnDefinition "+ b+", not: "+e),a.isRow=!0,a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&C("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.isRow=!1,a.index=e);e=new Ta;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);Cj(a,e)}else Cj(a,b);else C('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}function Zl(a,b){Vl.add(a,b)} function $l(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b} ma.Object.defineProperties(Y.prototype,{bindingId:{get:function(){return null!==this.A?this.A.zp:-1},set:function(a){this.bindingId!==a&&(null===this.A&&(this.A=new dl),this.A.zp=a)}},localBindings:{get:function(){return null!==this.A?this.A.te:null},set:function(a){this.localBindings!==a&&(null===this.A&&(this.A=new dl),this.A.te=a)}},srcBindings:{get:function(){return null!==this.A?this.A.wm:null},set:function(a){this.srcBindings!== a&&(null===this.A&&(this.A=new dl),this.A.wm=a)}},shadowVisible:{get:function(){return null!==this.A?this.A.Ci:null},set:function(a){var b=this.shadowVisible;b!==a&&(cl(this),this.A.Ci=a,this.Uc=!0,this.N(),this.g("shadowVisible",b,a))}},enabledChanged:{get:function(){return null!==this.A?this.A.Hb:null},set:function(a){var b=this.enabledChanged;b!==a&&(cl(this),this.A.Hb=a,this.g("enabledChanged",b,a))}},segmentOrientation:{ get:function(){return null!==this.Ua?this.Ua.rr:Zf},set:function(a){var b=this.segmentOrientation;b!==a&&(null===this.Ua&&(this.Ua=new am),this.Ua.rr=a,this.v(),this.g("segmentOrientation",b,a),a===Zf&&(this.angle=0))}},segmentIndex:{get:function(){return null!==this.Ua?this.Ua.u:-Infinity},set:function(a){a=Math.round(a);var b=this.segmentIndex;b!==a&&(null===this.Ua&&(this.Ua=new am),this.Ua.u=a,this.v(),this.g("segmentIndex",b,a))}},segmentFraction:{ get:function(){return null!==this.Ua?this.Ua.o:0},set:function(a){isNaN(a)?a=0:0>a?a=0:1a||1=a&&C("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ca=a,this.v(),this.g("scale",b,a))}},angle:{get:function(){return this.Kb},set:function(a){var b=this.Kb;b!==a&& (a%=360,0>a&&(a+=360),b!==a&&(this.Kb=a,Rl(this),this.v(),this.g("angle",b,a)))}},desiredSize:{get:function(){return this.jd},set:function(a){var b=a.width,c=a.height,d=this.jd,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.jd=a=a.J(),this.v(),this instanceof Bf&&this.qc(),this.g("desiredSize",d,a),fl(this)&&(a=this.part,null!==a&&(gl(this,a,"width"),gl(this,a,"height"))))}},width:{get:function(){return this.jd.width}, set:function(a){var b=this.jd.width;b===a||isNaN(b)&&isNaN(a)||(b=this.jd,this.jd=a=(new L(a,this.jd.height)).freeze(),this.v(),this instanceof Bf&&this.qc(),this.g("desiredSize",b,a),fl(this)&&(a=this.part,null!==a&&gl(this,a,"width")))}},height:{get:function(){return this.jd.height},set:function(a){var b=this.jd.height;b===a||isNaN(b)&&isNaN(a)||(b=this.jd,this.jd=a=(new L(this.jd.width,a)).freeze(),this.v(),this instanceof Bf&&this.qc(),this.g("desiredSize",b,a),fl(this)&& (a=this.part,null!==a&&gl(this,a,"height")))}},minSize:{get:function(){return null!==this.A?this.A.u:Cb},set:function(a){var b=this.minSize;b.D(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),cl(this),this.A.u=a,this.v(),this.g("minSize",b,a))}},maxSize:{get:function(){return null!==this.A?this.A.o:Kb},set:function(a){var b=this.maxSize;b.D(a)||(a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&& (a.height=Infinity),a.freeze(),cl(this),this.A.o=a,this.v(),this.g("maxSize",b,a))}},measuredBounds:{get:function(){return this.uc}},naturalBounds:{get:function(){return this.dc}},margin:{get:function(){return this.Kg},set:function(a){"number"===typeof a&&(a=new dc(a));var b=this.Kg;b.D(a)||(this.Kg=a=a.J(),this.v(),this.g("margin",b,a))}},transform:{get:function(){0!==(this.l&2048)=== !0&&sl(this);return this.Ab}},oe:{get:function(){0!==(this.l&4096)===!0&&sl(this);return this.wh}},animationTriggers:{get:function(){return null!==this.A?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(cl(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return null!==this.A?this.A.Pf:kg},set:function(a){this.reshapingBehavior!==a&&(cl(this),this.A.Pf=a)}},alignment:{ get:function(){return this.Jb},set:function(a){var b=this.Jb;b.D(a)||(a.Mc()&&!a.Xb()&&C("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),Ml(this),this.g("alignment",b,a))}},column:{get:function(){return this.Ag},set:function(a){a=Math.round(a);var b=this.Ag;b!==a&&(0>a&&xa(a,">= 0",Y,"column"),this.Ag=a,this.v(),this.g("column",b,a),null!==this.svg&&this.svg.remove())}},columnSpan:{get:function(){return null!== this.A?this.A.ob:1},set:function(a){a=Math.round(a);var b=this.columnSpan;b!==a&&(1>a&&xa(a,">= 1",Y,"columnSpan"),cl(this),this.A.ob=a,this.v(),this.g("columnSpan",b,a))}},row:{get:function(){return this.io},set:function(a){a=Math.round(a);var b=this.io;b!==a&&(0>a&&xa(a,">= 0",Y,"row"),this.io=a,this.v(),this.g("row",b,a),null!==this.svg&&this.svg.remove())}},rowSpan:{get:function(){return null!==this.A?this.A.Bi:1},set:function(a){a=Math.round(a); var b=this.rowSpan;b!==a&&(1>a&&xa(a,">= 1",Y,"rowSpan"),cl(this),this.A.Bi=a,this.v(),this.g("rowSpan",b,a))}},spanAllocation:{get:function(){return null!==this.A?this.A.Di:null},set:function(a){var b=this.spanAllocation;b!==a&&(cl(this),this.A.Di=a,this.v(),this.g("spanAllocation",b,a))}},alignmentFocus:{get:function(){return this.sk},set:function(a){var b=this.sk;b.D(a)||(this.sk=a=a.J(),this.v(),this.g("alignmentFocus",b,a))}},portId:{ get:function(){return this.Yn},set:function(a){var b=this.Yn;if(b!==a){var c=this.part;null===c||c instanceof V||C("Cannot set portID on a Link: "+a);null!==b&&null!==c&&cm(c,this);this.Yn=a;null!==a&&null!==c&&(c.Te=!0,dm(c,this));this.g("portId",b,a)}}},toSpot:{get:function(){return null!==this.ba?this.ba.yj:rc},set:function(a){var b=this.toSpot;b.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",b,a),Ql(this))}},toEndSegmentLength:{ get:function(){return null!==this.ba?this.ba.wj:10},set:function(a){var b=this.toEndSegmentLength;b!==a&&(0>a&&xa(a,">= 0",Y,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",b,a),Ql(this))}},toShortLength:{get:function(){return null!==this.ba?this.ba.xj:0},set:function(a){var b=this.toShortLength;b!==a&&(this.Xc(),this.ba.xj=a,this.g("toShortLength",b,a),Ql(this))}},toLinkable:{get:function(){return null!== this.ba?this.ba.Tr:null},set:function(a){var b=this.toLinkable;b!==a&&(this.Xc(),this.ba.Tr=a,this.g("toLinkable",b,a))}},toMaxLinks:{get:function(){return null!==this.ba?this.ba.Ur:Infinity},set:function(a){var b=this.toMaxLinks;b!==a&&(0>a&&xa(a,">= 0",Y,"toMaxLinks"),this.Xc(),this.ba.Ur=a,this.g("toMaxLinks",b,a))}},fromSpot:{get:function(){return null!==this.ba?this.ba.Xi:rc},set:function(a){var b=this.fromSpot;b.D(a)||(a=a.J(),this.Xc(), this.ba.Xi=a,this.g("fromSpot",b,a),Ql(this))}},fromEndSegmentLength:{get:function(){return null!==this.ba?this.ba.Vi:10},set:function(a){var b=this.fromEndSegmentLength;b!==a&&(0>a&&xa(a,">= 0",Y,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",b,a),Ql(this))}},fromShortLength:{get:function(){return null!==this.ba?this.ba.Wi:0},set:function(a){var b=this.fromShortLength;b!==a&&(this.Xc(),this.ba.Wi=a,this.g("fromShortLength", b,a),Ql(this))}},fromLinkable:{get:function(){return null!==this.ba?this.ba.hq:null},set:function(a){var b=this.fromLinkable;b!==a&&(this.Xc(),this.ba.hq=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{get:function(){return null!==this.ba?this.ba.iq:Infinity},set:function(a){var b=this.fromMaxLinks;b!==a&&(0>a&&xa(a,">= 0",Y,"fromMaxLinks"),this.Xc(),this.ba.iq=a,this.g("fromMaxLinks",b,a))}},cursor:{get:function(){return null!== this.A?this.A.j:""},set:function(a){var b=this.cursor;b!==a&&(cl(this),this.A.j=a,this.g("cursor",b,a))}},click:{get:function(){return null!==this.A?this.A.zh:null},set:function(a){var b=this.click;b!==a&&(cl(this),this.A.zh=a,this.g("click",b,a))}},doubleClick:{get:function(){return null!==this.A?this.A.Fh:null},set:function(a){var b=this.doubleClick;b!==a&&(cl(this),this.A.Fh=a,this.g("doubleClick",b,a))}},contextClick:{ get:function(){return null!==this.A?this.A.Bh:null},set:function(a){var b=this.contextClick;b!==a&&(cl(this),this.A.Bh=a,this.g("contextClick",b,a))}},mouseEnter:{get:function(){return null!==this.A?this.A.Mh:null},set:function(a){var b=this.mouseEnter;b!==a&&(cl(this),this.A.Mh=a,this.g("mouseEnter",b,a))}},mouseLeave:{get:function(){return null!==this.A?this.A.Ph:null},set:function(a){var b=this.mouseLeave;b!==a&&(cl(this), this.A.Ph=a,this.g("mouseLeave",b,a))}},mouseOver:{get:function(){return null!==this.A?this.A.Qh:null},set:function(a){var b=this.mouseOver;b!==a&&(cl(this),this.A.Qh=a,this.g("mouseOver",b,a))}},mouseHover:{get:function(){return null!==this.A?this.A.Oh:null},set:function(a){var b=this.mouseHover;b!==a&&(cl(this),this.A.Oh=a,this.g("mouseHover",b,a))}},mouseHold:{get:function(){return null!==this.A?this.A.Nh: null},set:function(a){var b=this.mouseHold;b!==a&&(cl(this),this.A.Nh=a,this.g("mouseHold",b,a))}},mouseDragEnter:{get:function(){return null!==this.A?this.A.Of:null},set:function(a){var b=this.mouseDragEnter;b!==a&&(cl(this),this.A.Of=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{get:function(){return null!==this.A?this.A.Xd:null},set:function(a){var b=this.mouseDragLeave;b!==a&&(cl(this),this.A.Xd=a,this.g("mouseDragLeave",b,a))}}, mouseDrop:{get:function(){return null!==this.A?this.A.Lh:null},set:function(a){var b=this.mouseDrop;b!==a&&(cl(this),this.A.Lh=a,this.g("mouseDrop",b,a))}},actionDown:{get:function(){return null!==this.A?this.A.V:null},set:function(a){var b=this.actionDown;b!==a&&(cl(this),this.A.V=a,this.g("actionDown",b,a))}},actionMove:{get:function(){return null!==this.A?this.A.ia:null},set:function(a){var b=this.actionMove; b!==a&&(cl(this),this.A.ia=a,this.g("actionMove",b,a))}},actionUp:{get:function(){return null!==this.A?this.A.Ha:null},set:function(a){var b=this.actionUp;b!==a&&(cl(this),this.A.Ha=a,this.g("actionUp",b,a))}},actionCancel:{get:function(){return null!==this.A?this.A.F:null},set:function(a){var b=this.actionCancel;b!==a&&(cl(this),this.A.F=a,this.g("actionCancel",b,a))}},toolTip:{get:function(){return null!== this.A?this.A.$h:null},set:function(a){var b=this.toolTip;b!==a&&(cl(this),this.A.$h=a,this.g("toolTip",b,a))}},contextMenu:{get:function(){return null!==this.A?this.A.Ch:null},set:function(a){var b=this.contextMenu;b!==a&&(cl(this),this.A.Ch=a,this.g("contextMenu",b,a))}}});Y.prototype.trigger=Y.prototype.Jv;Y.prototype.findBindingPanel=Y.prototype.ih;Y.prototype.findTemplateBinder=Y.prototype.pz;Y.prototype.setProperties=Y.prototype.nm;Y.prototype.apply=Y.prototype.apply; Y.prototype.attach=Y.prototype.Du;Y.prototype.set=Y.prototype.set;Y.prototype.isEnabledObject=Y.prototype.If;Y.prototype.isVisibleObject=Y.prototype.Ed;Y.prototype.isContainedBy=Y.prototype.rg;Y.prototype.getNearestIntersectionPoint=Y.prototype.rs;Y.prototype.getLocalPoint=Y.prototype.qs;Y.prototype.getDocumentScale=Y.prototype.Df;Y.prototype.getDocumentAngle=Y.prototype.li;Y.prototype.getDocumentBounds=Y.prototype.mi;Y.prototype.getDocumentPoint=Y.prototype.ga;Y.prototype.intersectsRect=Y.prototype.Yc; Y.prototype.containedInRect=Y.prototype.fh;Y.prototype.containsRect=Y.prototype.Re;Y.prototype.containsPoint=Y.prototype.ca;Y.prototype.raiseChanged=Y.prototype.g;Y.prototype.raiseChangedEvent=Y.prototype.cb;Y.prototype.addCopyProperty=Y.prototype.Vw;var Vl=null;Y.className="GraphObject";Vl=new ob; Zl("Button",function(){function a(a,b){return null!==a.diagram.ic(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=Ul(W,W.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof W){var c=a.fb("ButtonBorder");null!==c&&(c.fill=b?a._buttonFillNormal:a._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD", _buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},Ul(Bf,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new O(0,0,2.76142374915397,2.761423749153969),spot2:new O(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));b.mouseEnter=function(a,b){if(b.If()&&b instanceof W&&(a=b.fb("ButtonBorder"),a instanceof Bf)){var c=b._buttonFillOver;b._buttonFillNormal=a.fill;a.fill=c;c=b._buttonStrokeOver;b._buttonStrokeNormal=a.stroke;a.stroke=c}}; b.mouseLeave=function(a,b){b.If()&&b instanceof W&&(a=b.fb("ButtonBorder"),a instanceof Bf&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.If()&&b instanceof W&&null!==b._buttonFillPressed&&0===a.button){var c=b.fb("ButtonBorder");if(c instanceof Bf){a=a.diagram;var d=a.skipsUndoManager;a.skipsUndoManager=!0;var g=b._buttonFillPressed;b._buttonFillOver=c.fill;c.fill=g;g=b._buttonStrokePressed;b._buttonStrokeOver=c.stroke;c.stroke=g;a.skipsUndoManager= d}}};b.actionUp=function(b,d){if(d.If()&&d instanceof W&&null!==d._buttonFillPressed&&0===b.button){var c=d.fb("ButtonBorder");if(c instanceof Bf){var f=b.diagram,g=f.skipsUndoManager;f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionCancel=function(b,d){if(d.If()&&d instanceof W&&null!==d._buttonFillPressed){var c=d.fb("ButtonBorder");if(c instanceof Bf){var f=b.diagram, g=f.skipsUndoManager;f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionMove=function(b,d){if(d.If()&&d instanceof W&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.fb("ButtonBorder"),b instanceof Bf))){var f=c.skipsUndoManager;c.skipsUndoManager=!0;var g=d._buttonFillPressed;b.fill!==g&&(b.fill=g);g= d._buttonStrokePressed;b.stroke!==g&&(b.stroke=g);c.skipsUndoManager=f}}};return b}); Zl("TreeExpanderButton",function(){var a=Ul("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Ul(Bf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ib},(new Gi("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).cp()),{visible:!1},(new Gi("visible","isTreeLeaf",function(a){return!a})).cp());a.click=function(a,c){c=c.part;c instanceof te&&(c=c.adornedPart);if(c instanceof V){var b=c.diagram; if(null!==b){b=b.commandHandler;if(c.isTreeExpanded){if(!b.canCollapseTree(c))return}else if(!b.canExpandTree(c))return;a.handled=!0;c.isTreeExpanded?b.collapseTree(c):b.expandTree(c)}}};return a}); Zl("SubGraphExpanderButton",function(){var a=Ul("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Ul(Bf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ib},(new Gi("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).cp()));a.click=function(a,c){c=c.part;c instanceof te&&(c=c.adornedPart);if(c instanceof pf){var b=c.diagram;if(null!==b){b=b.commandHandler;if(c.isSubGraphExpanded){if(!b.canCollapseSubGraph(c))return}else if(!b.canExpandSubGraph(c))return; a.handled=!0;c.isSubGraphExpanded?b.collapseSubGraph(c):b.expandSubGraph(c)}}};return a});Zl("ToolTip",function(){return Ul(te,W.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new J(0,3),shadowBlur:5},Ul(Bf,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new O(0,0,4,6),spot2:new O(1,1,-4,-4)}))}); Zl("ContextMenu",function(){return Ul(te,W.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new J(0,3),shadowBlur:5},new Gi("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});Zl("ContextMenuButton",function(){var a=Ul("Button");a.stretch=Wk;var b=a.fb("ButtonBorder");b instanceof Bf&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new O(0,0,2,3),b.spot2=new O(1,1,-2,-2));return a}); Zl("PanelExpanderButton",function(a){var b=$l(a,"COLLAPSIBLE"),c=Ul("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},Ul(Bf,{name:"ButtonIcon",strokeWidth:2},(new Gi("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).cp(b))); a=c.fb("ButtonBorder");a instanceof Bf&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)");c.click=function(a,c){var d=c.diagram;if(null!==d&&!d.isReadOnly){var e=c.ih();null===e&&(e=c.part);null!==e&&(c=e.fb(b),null!==c&&(a.handled=!0,d.Ea("Collapse/Expand Panel"),c.visible=!c.visible,d.eb("Collapse/Expand Panel")))}};return c}); Zl("CheckBoxButton",function(a){var b=$l(a);a=Ul("Button",{desiredSize:new L(14,14)},Ul(Bf,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:nd,geometryStretch:mg,visible:!1},""!==b?(new Gi("visible",b)).Kx():[]));a.click=function(a,d){if(d instanceof W){var c=a.diagram;if(!(null===c||c.isReadOnly||""!==b&&c.model.isReadOnly)){a.handled=!0;var f=d.fb("ButtonIcon");c.Ea("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a, d);c.eb("checkbox")}}};return a}); Zl("CheckBox",function(a){a=$l(a);a=Ul("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new dc(0,1,0,0)});var b=Ul(W,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new dc(1),_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillPressed:a._buttonFillPressed,_buttonStrokePressed:a._buttonStrokePressed,_buttonFillDisabled:a._buttonFillDisabled,mouseEnter:a.mouseEnter,mouseLeave:a.mouseLeave, actionDown:a.actionDown,actionUp:a.actionUp,actionCancel:a.actionCancel,actionMove:a.actionMove,click:a.click,_buttonClick:a.click});a.mouseEnter=null;a.mouseLeave=null;a.actionDown=null;a.actionUp=null;a.actionCancel=null;a.actionMove=null;a.click=null;return b});Y.None=kg=new E(Y,"None",0);Y.Default=Yk=new E(Y,"Default",0);Y.Vertical=Xk=new E(Y,"Vertical",4);Y.Horizontal=Wk=new E(Y,"Horizontal",5);Y.Fill=nd=new E(Y,"Fill",3);Y.Uniform=mg=new E(Y,"Uniform",1); Y.UniformToFill=Zk=new E(Y,"UniformToFill",2);Y.FlipVertical=$k=new E(Y,"FlipVertical",1);Y.FlipHorizontal=al=new E(Y,"FlipHorizontal",2);Y.FlipBoth=bl=new E(Y,"FlipBoth",3);Y.make=Ul;Y.getBuilders=function(){var a=new ob,b;for(b in Vl)if(b!==b.toLowerCase()){var c=Vl.I(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};Y.defineBuilder=Zl; Y.build=function(a,b,c){for(var d=[],e=2;ea&&(a+=360);if(0!==a){this.translate(b,c);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.ha[1]*a+this.ha[3]*d,f=this.ha[0]*-d+this.ha[2]*a,g=this.ha[1]*-d+this.ha[3]*a;this.ha[0]=this.ha[0]*a+this.ha[2]*d;this.ha[1]=e;this.ha[2]=f;this.ha[3]=g;this.translate(-b,-c)}};em.className="STransform"; function fm(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.gx=[];this.pattern=null}fm.prototype.addColorStop=function(a,b){this.gx.push({offset:a,color:b})};fm.className="SGradient"; function Fj(a,b,c){this.ownerDocument=a=void 0===b?x.document:b;this.cA="http://www.w3.org/2000/svg";void 0!==a&&(this.Oa=this.Ud("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.hs=null;this.context=new ii(this, c)}Fj.prototype.resize=function(a,b,c,d){return this.width!==a||this.height!==b?(this.width=a,this.height=b,this.style.width=c+"px",this.style.height=d+"px",this.Oa.setAttributeNS(null,"width",c+"px"),this.Oa.setAttributeNS(null,"height",d+"px"),this.Oa.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.ww.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.ww.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; Fj.prototype.Ud=function(a,b,c){a=this.ownerDocument.createElementNS(this.cA,a);if(za(b))for(var d in b)a.setAttributeNS("href"===d?"http://www.w3.org/1999/xlink":"",d,b[d]);void 0!==c&&(a.textContent=c);return a};Fj.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()};Fj.prototype.focus=function(){this.Oa.focus()};Fj.prototype.mx=function(){this.ownerDocument=null}; ma.Object.defineProperties(Fj.prototype,{width:{get:function(){return this.Oa.width.baseVal.value},set:function(a){this.Oa.setAttribute("width",a+"px")}},height:{get:function(){return this.Oa.height.baseVal.value},set:function(a){this.Oa.setAttribute("height",a+"px")}},style:{get:function(){return this.Oa.style}}});Fj.className="SVGSurface"; function ii(a,b){this.Gv=a;this.svg=a.Oa;this.stack=[];this.nh=[];this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.lineDashOffset=0;this.lineJoin="miter";this.lineWidth=1;this.miterLimit=10;this.shadowBlur=0;this.shadowColor="rgba(0, 0, 0, 0)";this.shadowOffsetY=this.shadowOffsetX=0;this.Il=!1;this.strokeStyle="#000000";this.textAlign="start";this.clipInsteadOfFill=!1;this.Vg=this.Br=this.Ar=0;this.yd=this.ad=null;this.path=[];this.Yl={};this.Ct=!1; this.Yg=null;this.uj=0;this.rb=new em;this.j=Cl(this);this.Nj=Cl(this,"gojs-diagram");this.Hl=this.ti=null;var c=jb++,d=this.Ud("clipPath",{id:"mainClip"+c});d.appendChild(this.Ud("rect",{x:0,y:0,width:a.width,height:a.height}));this.ww=d;this.svg.appendChild(this.j);this.j.appendChild(this.Nj);this.svg.appendChild(d);this.j.setAttributeNS(null,"clip-path","url(#mainClip"+c+")");this.eA={};this.isTemporary=!!b;this.filter="";this.bk=null} function yj(a,b,c,d,e,f,g){void 0===a.Nj?Al(a,b,c,d,e,f,g):a.Nj.setAttribute("transform","matrix("+b+", "+c+", "+d+", "+e+", "+f+", "+g+")")}t=ii.prototype; t.arc=function(a,b,c,d,e,f,g,h){var k=2*Math.PI,l=k-1E-6,m=c*Math.cos(d),n=c*Math.sin(d),p=a+m,q=b+n,r=f?0:1;d=f?d-e:e-d;(1E-6d&&(d=d%k+k);d>l?(this.path.push(["A",c,c,0,1,r,a-m,b-n]),this.path.push(["A",c,c,0,1,r,p,q])):1E-6=Math.PI),r,a+c*Math.cos(e),b+c*Math.sin(e)])};t.beginPath=function(){this.path=[];this.Yl={stroke:"none",fill:"none"}};t.Se=function(a){this.addPath(this.path,this.rb,a||0)}; t.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};t.clearRect=function(){};t.clip=function(){this.Yl.clipPath=!0};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new fm("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e}; t.createPattern=function(a){var b="";a instanceof HTMLCanvasElement&&(b=a.toDataURL());a instanceof HTMLImageElement&&(b=a.getAttribute("src"));var c=this.eA;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+jb++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.Ud("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.Ud(Zi,e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"}; t.createRadialGradient=function(a,b,c,d,e,f){var g=new fm("radial");g.x1=a;g.y1=b;g.r1=c;g.x2=d;g.y2=e;g.r2=f;return g};function Dl(a,b,c,d,e,f,g,h,k){d=h/d;e=k/e;0===f&&0===g||a.rb.translate(f,g);1===d&&1===e||a.rb.scale(d,e);0===b&&0===c||a.rb.translate(-b,-c)} t.drawImage=function(a,b,c,d,e,f,g,h,k){var l="";a instanceof HTMLCanvasElement&&(l=a.toDataURL());a instanceof HTMLImageElement&&(l=a.getAttribute("src"));var m=a instanceof HTMLImageElement?a.naturalWidth:a.width;a=a instanceof HTMLImageElement?a.naturalHeight:a.height;void 0===d&&(f=b,g=c,h=d=m,k=e=a);d=d||0;e=e||0;h=h||0;k=k||0;Dl(this,b,c,d,e,f||0,g||0,h,k);f={x:0,y:0,width:m||d,height:a||e,href:l};K.$(d,h)&&K.$(e,k)?-1===l.toLowerCase().indexOf(".svg")&&-1===l.toLowerCase().indexOf("data:image/svg")&& (f.preserveAspectRatio="xMidYMid slice"):f.preserveAspectRatio="none";if(0!==b||0!==c||d!==m||e!==a)d+=b,e+=c,f["clip-path"]="path('M "+b+","+c+" L "+d+" "+c+" L "+d+" "+e+" L "+b+" "+e+" z')";gm(this,Zi,f,this.rb);this.addElement(Zi,f)};t.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd");hm(this,this.Yl)};t.ng=function(a,b){this.clipInsteadOfFill?this.clip():this.fill(b)}; t.fillRect=function(a,b,c,d){a=[a,b,c,d];a={x:a[0],y:a[1],width:a[2],height:a[3]};gm(this,"fill",a,this.rb);this.addElement("rect",a)};t.ox=function(a,b,c,d){a={x:a,y:b,width:c,height:d};gm(this,"fill",a,this.rb);hm(this,a);this.svg.prepend(this.Ud("rect",a))};t.fillText=function(a,b,c){a=[a,b,c];b=this.textAlign;"left"===b?b="start":"right"===b?b="end":"center"===b&&(b="middle");b={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":b};gm(this,"fill",b,this.rb);this.addElement("text",b,a[0])}; t.lineTo=function(a,b){this.path.push(["L",a,b])};t.moveTo=function(a,b){this.path.push(["M",a,b])};t.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};t.rect=function(a,b,c,d){this.path.push(["M",a,b],["L",a+c,b],["L",a+c,b+d],["L",a,b+d],["z"])}; t.restore=function(){this.rb=this.stack.pop();this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle;this.font=a.font;this.globalAlpha=a.globalAlpha;this.lineCap=a.lineCap;this.lineDashOffset=a.lineDashOffset;this.lineJoin=a.lineJoin;this.lineWidth=a.lineWidth;this.miterLimit=a.miterLimit;this.shadowBlur=a.shadowBlur;this.shadowColor=a.shadowColor;this.shadowOffsetX=a.shadowOffsetX;this.shadowOffsetY=a.shadowOffsetY;this.strokeStyle=a.strokeStyle;this.textAlign=a.textAlign;this.bk= a.bk}; t.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign,bk:this.bk});for(var a=[],b=0;bb.offset?1:-1});for(e=0;ec?(this.scale(c/a,1),this.translate((a-c)/2,0)):c>a&&(this.scale(1,a/c),this.translate(0,(c-a)/2));this.Hm?this.clip():this.fill(b);a>c?(this.translate(-(a-c)/2,0),this.scale(1/(c/a),1)):c>a&&(this.translate(0,-(c-a)/2),this.scale(1,1/(a/c)))}else this.Hm?this.clip():this.fill(b)};t.jk=function(){this.Hm||this.stroke()};t.Ev=function(a,b,c){this.Ar=a;this.Br=b;this.Vg=c}; t.js=function(a,b){var c=this.Z;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.fs=function(){var a=this.Z;void 0!==a.setLineDash&&(a.setLineDash(lm),a.lineDashOffset=0)};t.Vc=function(a){a&&(this.dt="");this.ct=this.et=""};t.Hs=function(){}; ma.Object.defineProperties(Hl.prototype,{fillStyle:{get:function(){return this.Z.fillStyle},set:function(a){this.ct!==a&&(this.ct=this.Z.fillStyle=a)}},font:{get:function(){return this.Z.font},set:function(a){this.dt!==a&&(this.dt=this.Z.font=a)}},globalAlpha:{get:function(){return this.Z.globalAlpha},set:function(a){this.Z.globalAlpha=a}},lineCap:{get:function(){return this.Z.lineCap}, set:function(a){this.Z.lineCap=a}},lineDashOffset:{get:function(){return this.Z.lineDashOffset},set:function(a){this.Z.lineDashOffset=a}},lineJoin:{get:function(){return this.Z.lineJoin},set:function(a){this.Z.lineJoin=a}},lineWidth:{get:function(){return this.Z.lineWidth},set:function(a){this.Z.lineWidth=a}},miterLimit:{get:function(){return this.Z.miterLimit},set:function(a){this.Z.miterLimit= a}},shadowBlur:{get:function(){return this.Z.shadowBlur},set:function(a){this.Z.shadowBlur=a}},shadowColor:{get:function(){return this.Z.shadowColor},set:function(a){this.Z.shadowColor=a}},shadowOffsetX:{get:function(){return this.Z.shadowOffsetX},set:function(a){this.Z.shadowOffsetX=a}},shadowOffsetY:{get:function(){return this.Z.shadowOffsetY},set:function(a){this.Z.shadowOffsetY= a}},strokeStyle:{get:function(){return this.Z.strokeStyle},set:function(a){this.et!==a&&(this.et=this.Z.strokeStyle=a)}},textAlign:{get:function(){return this.Z.textAlign},set:function(a){this.Z.textAlign=a}},imageSmoothingEnabled:{get:function(){return this.Z.imageSmoothingEnabled},set:function(a){this.Z.imageSmoothingEnabled=a}},filter:{get:function(){return this.Z.filter},set:function(a){this.Z.filter= ""===a?"none":a}},clipInsteadOfFill:{get:function(){return this.Hm},set:function(a){this.Hm=a}}});var lm=Object.freeze([]);Hl.className="CanvasSurfaceContext";function mm(){this.F=this.o=this.u=this.j=0}mm.className="ColorNumbers"; function ql(a,b){nm||(om(),nm=!0);Qa(this);this._isFrozen=!1;void 0===a?(this.na=Gl,this.xk="black"):"string"===typeof a?(this.na=Gl,this.xk=a):(this.na=a,this.xk="black");a=this.na;a===Jl?(this.Qd=tc,this.Lk=Ac):this.Lk=a===rl?this.Qd=wc:this.Qd=rc;this.Gr=0;this.Xp=NaN;this.xe=this.cr=this.we=null;this.ft=this.yk=0;b&&Object.assign(this,b)} ql.prototype.copy=function(){var a=new ql;a.na=this.na;a.xk=this.xk;a.Qd=this.Qd.J();a.Lk=this.Lk.J();a.Gr=this.Gr;a.Xp=this.Xp;null!==this.we&&(a.we=this.we.copy());a.cr=this.cr;return a};t=ql.prototype;t.freeze=function(){this._isFrozen=!0;null!==this.we&&this.we.freeze();return this};t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;null!==this.we&&this.we.ka();return this};t.qb=function(a){a.classType===ql&&(this.type=a)}; t.toString=function(){var a="Brush(";if(this.type===Gl)a+=this.color;else if(a=this.type===Jl?a+"Linear ":this.type===rl?a+"Radial ":this.type===Il?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.colorStops)for(var b=this.colorStops.iterator;b.next();)a+=" "+b.key+":"+b.value;return a+")"}; t.addColorStop=function(a,b){this._isFrozen&&va(this);("number"!==typeof a||!isFinite(a)||1a)&&xa(a,"0 <= loc <= 1",ql,"addColorStop:loc");null===this.we&&(this.we=new ob);this.we.add(a,b);this.na===Gl&&(this.type=Jl);this.xe=null;return this}; t.Vz=function(a,b){this._isFrozen&&va(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?pm:b;if(this.type===Gl)Uh(this.color),this.color=qm(a,b);else if((this.type===Jl||this.type===rl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)Uh(c.value),this.addColorStop(c.key,qm(a,b));return this};function rm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?pm:c;Uh(a);return qm(b,c)} t.Wy=function(a,b){this._isFrozen&&va(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?pm:b;if(this.type===Gl)Uh(this.color),this.color=qm(-a,b);else if((this.type===Jl||this.type===rl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)Uh(c.value),this.addColorStop(c.key,qm(-a,b));return this};function sm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?pm:c;Uh(a);return qm(-b,c)} function tm(a,b,c){Uh(a);a=um.j;var d=um.u,e=um.o,f=um.F;Uh(b);void 0===c&&(c=.5);return"rgba("+Math.round((um.j-a)*c+a)+", "+Math.round((um.u-d)*c+d)+", "+Math.round((um.o-e)*c+e)+", "+Math.round((um.F-f)*c+f)+")"} t.Gx=function(){if(this.type===Gl)return vm(this.color);if((this.type===Jl||this.type===rl)&&null!==this.colorStops){var a=this.colorStops;if(this.type===rl)return vm(a.first().value);if(null!==a.get(.5))return vm(a.get(.5));if(2===a.count)return a=a.Fa(),vm(tm(a[0].value,a[1].value));for(var b=a.iterator,c=-1,d=-1,e=1,f=1;b.next();){var g=b.key,h=Math.abs(.5-b.key);e>f&&h=e&&hd&&(f=c,c=d,d=f,f=e);e=d-c;return vm(tm(a.get(c),a.get(d),1-f/e))}return!1}; function vm(a){if(!a)return!1;if(a instanceof ql)return a.Gx();Uh(a);return 128>(299*um.j+587*um.u+114*um.o)/1E3} function qm(a,b){switch(b){case pm:b=100*wm(um.j);var c=100*wm(um.u),d=100*wm(um.o);xm.j=.4124564*b+.3575761*c+.1804375*d;xm.u=.2126729*b+.7151522*c+.072175*d;xm.o=.0193339*b+.119192*c+.9503041*d;xm.F=um.F;b=ym(xm.j/zm[0]);c=ym(xm.u/zm[1]);d=ym(xm.o/zm[2]);Am.j=116*c-16;Am.u=500*(b-c);Am.o=200*(c-d);Am.F=xm.F;Am.j=Math.min(100,Math.max(0,Am.j+100*a));a=(Am.j+16)/116;b=a-Am.o/200;xm.j=zm[0]*Bm(Am.u/500+a);xm.u=zm[1]*(Am.j>Cm*Dm?Math.pow(a,3):Am.j/Cm);xm.o=zm[2]*Bm(b);xm.F=Am.F;a=-.969266*xm.j+1.8760108* xm.u+.041556*xm.o;b=.0556434*xm.j+-.2040259*xm.u+1.0572252*xm.o;um.j=255*Em((3.2404542*xm.j+-1.5371385*xm.u+-.4985314*xm.o)/100);um.u=255*Em(a/100);um.o=255*Em(b/100);um.F=xm.F;um.j=Math.round(um.j);255um.j&&(um.j=0);um.u=Math.round(um.u);255um.u&&(um.u=0);um.o=Math.round(um.o);255um.o&&(um.o=0);return"rgba("+um.j+", "+um.u+", "+um.o+", "+um.F+")";case Fm:return Vh(),Wh.o=Math.min(100,Math.max(0,Wh.o+100*a)),"hsla("+Wh.j+", "+Wh.u+"%, "+Wh.o+"%, "+ Wh.F+")";default:C("Unknown color space: "+b)}}function Uh(a){nm||(om(),nm=!0);var b=Gm;if(null!==b){b.clearRect(0,0,1,1);b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;b.fillStyle!==c?(b.fillRect(0,0,1,1),a=b.getImageData(0,0,1,1).data,um.j=a[0],um.u=a[1],um.o=a[2],um.F=a[3]/255):(b.fillStyle="#FFFFFF",b.fillStyle=a,um.j=0,um.u=0,um.o=0,um.F=1)}} function Vh(){var a=um.j/255,b=um.u/255,c=um.o/255,d=Math.max(a,b,c),e=Math.min(a,b,c),f=d-e;e=(d+e)/2;if(0===f)var g=a=0;else{switch(d){case a:g=(b-c)/f%6;break;case b:g=(c-a)/f+2;break;case c:g=(a-b)/f+4}g*=60;0>g&&(g+=360);a=f/(1-Math.abs(2*e-1))}Wh.j=Math.round(g);Wh.u=Math.round(100*a);Wh.o=Math.round(100*e);Wh.F=um.F}function wm(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Em(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055} function ym(a){return a>Dm?Math.pow(a,1/3):(Cm*a+16)/116}function Bm(a){var b=a*a*a;return b>Dm?b:(116*a-16)/Cm}function bm(a,b){"string"!==typeof a&&(a instanceof ql||C("Value for "+b+" must be a color string or a Brush, not "+a))}function om(){Gm=Ng?(new Pi(null,void 0,{willReadFrequently:!0})).context:null} ma.Object.defineProperties(ql.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&va(this,a);this.na=a;this.start.Mc()&&(a===Jl?this.start=tc:a===rl&&(this.start=wc));this.end.Mc()&&(a===Jl?this.end=Ac:a===rl&&(this.end=wc));this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&va(this,a);this.xk=a;this.xe=null}},start:{get:function(){return this.Qd}, set:function(a){this._isFrozen&&va(this,a);this.Qd=a.J();this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&va(this,a);this.Lk=a.J();this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&va(this,a);0>a&&xa(a,">= zero",ql,"startRadius");this.Gr=a;this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&va(this, a);0>a&&xa(a,">= zero",ql,"endRadius");this.Xp=a;this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&va(this,a);this.we=a;this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&va(this,a);this.cr=a;this.xe=null}}});ql.prototype.isDark=ql.prototype.Gx;ql.prototype.darkenBy=ql.prototype.Wy;ql.prototype.lightenBy=ql.prototype.Vz;ql.prototype.addColorStop=ql.prototype.addColorStop; var Dm=216/24389,Cm=24389/27,zm=[95.047,100,108.883],Gm=null,um=new mm,Wh=new mm,xm=new mm,Am=new mm,nm=!1;ql.className="Brush";var Gl;ql.Solid=Gl=new E(ql,"Solid",0);var Jl;ql.Linear=Jl=new E(ql,"Linear",1);var rl;ql.Radial=rl=new E(ql,"Radial",2);var Il;ql.Pattern=Il=new E(ql,"Pattern",4);var pm;ql.Lab=pm=new E(ql,"Lab",5);var Fm;ql.HSL=Fm=new E(ql,"HSL",6); ql.randomColor=function(a,b){void 0===a&&(a=128);void 0===b&&(b=Math.max(a,255));var c=Math.abs(b-a);b=Math.floor(a+Math.random()*c).toString(16);var d=Math.floor(a+Math.random()*c).toString(16);a=Math.floor(a+Math.random()*c).toString(16);2>b.length&&(b="0"+b);2>d.length&&(d="0"+d);2>a.length&&(a="0"+a);return"#"+b+d+a}; ql.isValidColor=function(a){if("black"===a)return!0;if(""===a)return!1;nm||(om(),nm=!0);var b=Gm;if(null===b)return!0;b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;if(b.fillStyle!==c)return!0;b.fillStyle="#FFFFFF";c=b.fillStyle;b.fillStyle=a;return b.fillStyle!==c};ql.lighten=function(a){return rm(a)};ql.lightenBy=rm;ql.darken=function(a){return sm(a)};ql.darkenBy=sm;ql.mix=tm;ql.isDark=vm;function Yl(){this.xa="Base"}Yl.prototype.measure=function(){}; Yl.prototype.Yz=function(a,b,c,d,e){a.measure(b,c,d,e)};Yl.prototype.arrange=function(){};Yl.prototype.Ly=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};Yl.prototype.iA=function(a){a.Uj()};Yl.prototype.gc=function(){};ma.Object.defineProperties(Yl.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return W}}});Yl.prototype.remeasureObject=Yl.prototype.iA;Yl.prototype.arrangeElement=Yl.prototype.Ly; Yl.prototype.measureElement=Yl.prototype.Yz;Yl.className="PanelLayout";function Hm(){this.xa="Base"}la(Hm,Yl); Hm.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=Im(a);for(var k=0;kS&&(eb=Math.max(S-ff,0));var nk=0===G.oa;G.oc=G.oc+eb;G.actual=G.oa+eb;S=Math.max(S-(eb+(nk?ff:0)),0)}if(1===ec.columnSpan&&(Fb===kg||Fb===Xk)){G=a.Eb(Eb);var Ai=G.Wc();eb=Math.max(Kf-G.actual,0);eb+Ai>M&&(eb=Math.max(M-Ai,0));var Qn=0===G.oa;G.oc=G.oc+eb;G.actual= G.oa+eb;M=Math.max(M-(eb+(Qn?Ai:0)),0)}ef&&ec.Uj()}}}}}Ga(y);var Td=0,ne=0;f=a.columnCount;for(var sg=0;sg=a.rowCount);Oe++)G=a.Fb(Pa.row+Oe),eb=0,eb=Fb===nd||Fb===Xk?Math.max(G.minimum, 0===ud[Pa.row+Oe]?G.maximum:Math.min(ud[Pa.row+Oe],G.maximum)):Math.max(G.minimum,isNaN(G.Hc)?G.maximum:Math.min(G.Hc,G.maximum)),Id.height+=eb,qc+=G.minimum;for(var Vc=1;Vc=a.columnCount);Vc++)G=a.Eb(Pa.column+Vc),eb=0,eb=Fb===nd||Fb===Wk?Math.max(G.minimum,0===Hc[Pa.column+Vc]?G.maximum:Math.min(Hc[Pa.column+Vc],G.maximum)):Math.max(G.minimum,isNaN(G.Hc)?G.maximum:Math.min(G.Hc,G.maximum)),Id.width+=eb,rk+=G.minimum;hb.width+=Id.width;hb.height+=Id.height;var Eh=Pa.margin, lf=Eh.right+Eh.left,Ci=Eh.top+Eh.bottom;Pa.measure(hb.width,hb.height,rk,qc);for(var Fh=Pa.measuredBounds,Jd=Math.max(Fh.width+lf,0),Of=Math.max(Fh.height+Ci,0),mf=0,Gh=0;Gh=a.rowCount);Gh++)G=a.Fb(Pa.row+Gh),mf+=G.total||0;if(mf=Pe)&&!(Pa.row+qe>=a.rowCount);qe++){G=a.Fb(Pa.row+qe);var Re=G.oa||0,Pf=Qe(Pa,G,Vd);G.actual=Math.min(G.maximum,Re+Pf);G.oa!==Re&&(Pe-=G.oa- Re)}for(;0vd&&(G.actual=Math.min(G.maximum,vd+Pe),G.oa!==vd&&(Pe-=G.oa-vd));if(0===G.index)break;G=a.Fb(G.index-1)}}for(var vg=0,Se=0;Se=a.columnCount);Se++)G=a.Eb(Pa.column+Se),vg+=G.total||0;if(vg=wg)&&!(Pa.column+Qf>=a.columnCount);Qf++){G=a.Eb(Pa.column+Qf);var Di=G.oa||0,Tn=re(Pa,G,Sn);G.actual=Math.min(G.maximum, Di+Tn);G.oa!==Di&&(wg-=G.oa-Di)}for(;0sk&&(G.actual=Math.min(G.maximum,sk+wg),G.oa!==sk&&(wg-=G.oa-sk));if(0===G.index)break;G=a.Eb(G.index-1)}}}}Ga(z);L.free(Id);L.free(hb);void 0!==ud&&Ga(ud);void 0!==Hc&&Ga(Hc);var xg=0,yg=0,tk=a.desiredSize,Er=a.maxSize;Fb=jl(a,!0);var Ei=ne=Td=0,Fi=0;f=a.columnCount;for(var uk=0;uk=a.rowCount);G++){var ca=a.Fb(y+G);0!==ca.oa&&(v.height+=ca.total)}for(G= 1;G=a.columnCount);G++)ca=a.Eb(A+G),0!==ca.oa&&(v.width+=ca.total);var X=B.oa+v.width,na=z.oa+v.height;G=h;ca=k;var wa=X,db=na,gb=h,Db=k,eb=X,Ke=na;h+X>c.width&&(eb=Math.max(c.width-h,0));k+na>c.height&&(Ke=Math.max(c.height-k,0));var Ua=R.alignment;if(Ua.Xb()){Ua=a.defaultAlignment;Ua.sb()||(Ua=wc);var rd=Ua.x;var Eb=Ua.y;var Le=Ua.offsetX;Ua=Ua.offsetY;var xc=B.alignment,Tc=z.alignment;xc.sb()&&(rd=xc.x,Le=xc.offsetX);Tc.sb()&&(Eb=Tc.y,Ua=Tc.offsetY)}else rd=Ua.x,Eb=Ua.y,Le= Ua.offsetX,Ua=Ua.offsetY;if(isNaN(rd)||isNaN(Eb))Eb=rd=.5,Ua=Le=0;xc=I.width;Tc=I.height;var nc=R.margin,ec=nc.left+nc.right,ef=nc.top+nc.bottom,sd=Nl(R,z,B,!1);!isNaN(R.desiredSize.width)||sd!==nd&&sd!==Wk||(xc=Math.max(X-ec,0));!isNaN(R.desiredSize.height)||sd!==nd&&sd!==Xk||(Tc=Math.max(na-ef,0));X=R.maxSize;na=R.minSize;xc=Math.min(X.width,xc);Tc=Math.min(X.height,Tc);xc=Math.max(na.width,xc);Tc=Math.max(na.height,Tc);X=Tc+ef;G+=wa*rd-(xc+ec)*rd+Le+nc.left;ca+=db*Eb-X*Eb+Ua+nc.top;R.visible&& (Zb(gb,Db,eb,Ke,G,ca,I.width,I.height)?R.arrange(G,ca,xc,Tc):R.arrange(G,ca,xc,Tc,new N(gb,Db,eb,Ke)))}}L.free(v);for(a=0;a=c&&(c=1);var d=a.gridCellSize,e=d.width;d=d.height;var f=a.naturalBounds,g=a.actualBounds,h=f.width,k=f.height,l=Math.ceil(h/e),m=Math.ceil(k/d),n=a.gridOrigin,p=n.x;n=n.y;b.save();b.beginPath();b.rect(0,0,h,k);b.clip();b.Se();for(var q=[],r=a.O.s,u=r.length,w=0;wz)){v=Zj(v.figure);for(var A=0;Az&&y.push(B))}}}}r= a.O.s;u=r.length;for(w=0;we*v*c))){z=D.segmentIndex;if(!isFinite(z)||isNaN(z))z=0;0>z&&(z=v-Math.min(-z,v));z=Math.round(z%v);v=D.opacity;A=1;if(1!==v){if(0===v)continue;A=b.globalAlpha;b.globalAlpha=A*v}B=q[w];var M=!1,S=D.strokeDashArray;null!==S&&(M=!0,b.js(S,D.strokeDashOffset));if("LineV"===D.figure&&null!==D.stroke&&0b)return a%b===c;if(a%b!==c)return!1;b=d.length;for(var e=0;en)y.measure(Infinity,Infinity,0,0),z=y.measuredBounds,c.ed(z),q.push(z);else{var A=y.segmentIndex,B=y.segmentFraction,D=y.alignmentFocus;D.Mc()&&(D=wc);var M=y.segmentOrientation,S=y.segmentOffset;if(isNaN(A)){var R=k.ua;z=Ea();R.Qu(B,z);var I=J.allocAt(z[0],z[1]);I.add(k.i(0));R.type=== P.j?I.offset(-R.startX,-R.startY):(R=R.figures.first(),null!==R&&I.offset(-R.startX,-R.startY));R=z[2];if(M!==Zf){var G=k.computeAngle(y,M,R);y.Kb=G}G=I.x-b.x;var ca=I.y-b.y;J.free(I);Ga(z)}else if(A<-n||A>=n)z=J.alloc(),k.vg(),k.computeMidPoint(z),R=k.midAngle,M!==Zf&&(G=k.computeAngle(y,M,R),y.Kb=G),G=z.x-b.x,ca=z.y-b.y,J.free(z);else{G=0;0<=A?(ca=m.M(A),z=AX+10?0<=A?R.ab(ca):ca.ab(R):X>I+10?0<=A?z.ab(G):G.ab(z):0<=A?R.ab(G):G.ab(R)}else R=0<=A?ca.ab(z):z.ab(ca);M!==Zf&&(G=k.computeAngle(y,M,R),y.Kb=G);G=ca.x+(z.x-ca.x)*B-b.x;ca=ca.y+(z.y-ca.y)*B-b.y}y.measure(Infinity,Infinity,0,0);z=y.measuredBounds;I=y.naturalBounds;var na=0;y instanceof Bf&&(na=y.strokeWidth);X=I.width+na;var wa=I.height+na;r.reset();r.translate(-z.x,-z.y);r.scale(y.scale,y.scale);r.rotate(M===Zf?y.angle:R,X/2,wa/2);M!==$m&&M!==an||r.rotate(90, X/2,wa/2);M!==bn&&M!==cn||r.rotate(-90,X/2,wa/2);M===dn&&(45R||225R)&&r.rotate(-R,X/2,wa/2);I=new N(0,0,X,wa);u.xi(I,D);r.Ga(u);D=-u.x+na/2*y.scale;y=-u.y+na/2*y.scale;w.assign(S);na=isNaN(S.x);var db=isNaN(S.y);if(na||db){X=X/2+3;wa=wa/2+3;var gb=45<=R&&135>=R,Db=225<=R&&315>=R;M===Zf&&(gb||Db)?(w.x=db?X:S.y,w.y=na?wa:S.x,gb?0<=A||isNaN(A)&&.5>B||!na||(w.y=-wa):Db&&((0<=A||isNaN(A)&&.5>B)&&na&&(w.y=-wa),db&&(w.x=-X))):(na&&(w.x=0<=A||isNaN(A)&&.5>B?X:-X),db&&(w.y=-wa),w.rotate(R))}else w.rotate(R); G+=w.x;ca+=w.y;I.set(z);I.h(G+D,ca+y,z.width,z.height);q.push(I);c.ed(I)}}if(null!==g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.jg=c;a.position.h(b.x+c.x,b.y+c.y);Pb(e,c.width||0,c.height||0);ld.free(r);J.free(u);J.free(w)}}}}; Ym.prototype.arrange=function(a,b){var c=b.length;if(a instanceof te||a instanceof T){var d=a,e=null;a instanceof te&&(e=a,d=e.adornedPart);var f=a instanceof te?null:d.path,g=a.j;if(0!==g.length){var h=0;if(null!==f&&h=c)r=J.alloc(),q=n,w=r,q.vg(),q.computeMidPoint(w),q=n.midAngle,l!==Zf&&(n=n.computeAngle(g,l,q),g.angle=n),n=r.x,w=r.y, J.free(r);else{u=0;0<=h?(r=b.s[h],w=hy+10?0<=h?q.ab(r):r.ab(q):y>v+10?0<=h?w.ab(u):u.ab(w):0<=h?q.ab(u):u.ab(q)}else q=0<=h?r.ab(w):w.ab(r);l!==Zf&&(n=n.computeAngle(g,l,q),g.angle=n);n=r.x+(w.x-r.x)*k;w=r.y+(w.y-r.y)*k}if(p.ys())g.location=new J(n,w);else{p.Mc()&&(p=wc);r=ld.alloc();r.reset();r.scale(g.scale,g.scale);r.rotate(g.angle, 0,0);var z=g.naturalBounds;u=N.allocAt(0,0,z.width,z.height);v=J.alloc();v.xi(u,p);r.Ga(v);p=-v.x;y=-v.y;var A=z.width,B=z.height;z=J.alloc();z.assign(m);var D=isNaN(m.x),M=isNaN(m.y);if(D||M){A=A/2+3;B=B/2+3;var S=45<=q&&135>=q,R=225<=q&&315>=q;l===Zf&&(S||R)?(z.x=M?A:m.y,z.y=D?B:m.x,S?0<=h||isNaN(h)&&.5>k||!D||(z.y=-B):R&&((0<=h||isNaN(h)&&.5>k)&&D&&(z.y=-B),M&&(z.x=-A))):(D&&(z.x=0<=h||isNaN(h)&&.5>k?A:-A),M&&(z.y=-B),z.rotate(q))}else z.rotate(q);n+=z.x;w+=z.y;r.pp(u);p+=u.x;y+=u.y;h=J.allocAt(n+ p,w+y);g.move(h);J.free(h);J.free(z);J.free(v);N.free(u);ld.free(r)}}null!==e?e.Ul(!1):d.Ul(!1);d=en(a);a.location.h(a.position.x+d.x,a.position.y+d.y);J.free(d)}}; function Zm(a,b,c,d){if(!1!==uj(d)){var e=d.strokeWidth;0===e&&a instanceof te&&a.type===W.Link&&a.adornedObject instanceof Bf&&(e=a.adornedObject.strokeWidth);e*=d.Ca;a instanceof T&&null!==a.ua?(a=a.geometry.bounds,d.Ge(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof te&&null!==a.adornedPart.ua?(a=a.adornedPart.ua.bounds,d.Ge(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):d.Ge(-(e/2),-(e/2),b+e,c+e);e=d.desiredSize;e.w()||null===d.ua?d.dc.h(0,0,e.width,e.height):d.dc.assign(d.ua.bounds);pj(d,!1)}} function fn(){this.xa="Base"}la(fn,Yl); fn.prototype.measure=function(a,b,c,d,e,f,g){var h=a.Pb();a.graduatedBounds=[];var k=h.margin,l=k.right+k.left,m=k.top+k.bottom;h.measure(b,c,f,g);var n=h.measuredBounds,p=new N(-k.left,-k.top,Math.max(n.width+l,0),Math.max(n.height+m,0));a.graduatedBounds.push(p);e.assign(p);for(var q=h.geometry,r=h.strokeWidth,u=q.flattenedSegments,w=q.flattenedLengths,v=q.flattenedTotalLength,y=u.length,z=0,A=0,B=Ea(),D=0;DX&&(X+=360);S.push(X)}z=G;A=ca}B.push(S)}if(null===a.graduatedIntervals){for(var na=[],wa=a.O.s,db=wa.length,gb=0;gbKe))for(var Ua=0;UaKe&&eb.push(Eb)}}}}a.graduatedIntervals=na}var Le=a.graduatedIntervals;var xc=a.O.s,Tc=xc.length,nc=0,ec=0,ef=v;a.graduatedMarks=[];for(var sd, xh=0;xhzi*Fb*v/a.graduatedRange&&null===oc.graduatedSkip)){var rg=w[0][0],Fd=0,fc=0;ec=v*oc.graduatedStart-1E-4;ef=v*oc.graduatedEnd+1E-4;var Kf=zi*Fb,pc=a.graduatedTickBase;if(pca.graduatedMin+Kf&&(pc-=Math.floor((pc-a.graduatedMin)/Kf)*Kf);for(var nk=Le[xh],Ai=pc,Qn=1E-6*a.graduatedMax,Td= 1;pc<=a.graduatedMax+Qn;Td++){a:{for(var ne=nk.length,sg=0;sg-yh){var hf=!1;break a}}hf=!0}if(hf&&(pc>a.graduatedMax&&(pc=a.graduatedMax),null===oc.graduatedSkip||oc instanceof Pg&&!oc.graduatedSkip(pc,oc)||oc instanceof Bf&&!oc.graduatedSkip(pc,oc))&&(nc=(pc-a.graduatedMin)*v/a.graduatedRange,nc>v&&(nc=v),ec<=nc&&nc<=ef)){for(var Ud=B[Fd][fc],Me=w[Fd][fc];Fdrg&&fcoe&&.4995oe?0oe||.9995tg){var Ah=1-Math.abs(.5-oe);Ud=(td*Ah+Hd*(1-Ah))%360;break a}}}Ud=td}if(oc instanceof Pg){var ed="";null!==oc.graduatedFunction?(ed=oc.graduatedFunction(pc,oc),ed=null!==ed&&void 0!==ed?ed.toString():""):ed=(+pc.toFixed(2)).toString();""!==ed&&sd.push({$l:zh,angle:Ud,text:ed})}else sd.push({$l:zh,angle:Ud})}pc=Ai+Td*Kf}}}a.graduatedMarks.push(sd)}Ga(B); var hb=a.graduatedMarks;if(null!==hb)for(var Bi=d.length,Sb=0;Sbfd;fd++){switch(fd){case 0:hc.h(Id,ud);break;case 1:hc.h(Id+Bh,ud);break;case 2:hc.h(Id,ud+Nf);break;case 3:hc.h(Id+Bh,ud+Nf)}hc.rotate(Pa+Va.angle);hc.offset(qk,Dh);0===Ch&&0===fd?Hc.h(hc.x,hc.y,0,0):Hc.Ye(hc);hc.offset(-qk,-Dh);hc.rotate(-Pa-Va.angle)}J.free(hc);null!==pe.graduatedBounds&&pe.graduatedBounds.push(Hc);Yb(Ne,Hc.x,Hc.y,Hc.width,Hc.height)}else if(Va instanceof Pg){var Uc=a,rk=e;null===Uc.temporaryTextBlock&&(Uc.temporaryTextBlock=new Pg);var qc=Uc.temporaryTextBlock;gn(qc,Va); var Oe=Va.alignmentFocus;Oe.Mc()&&(Oe=tc);for(var Vc=Va.segmentOrientation,Eh=Va.segmentOffset,lf=new N,Ci=0,Fh=0,Jd=0,Of=0,mf=0,Gh=Tb.length,Pe=0;PeJd||225Jd)&&vd.rotate(-Jd,Re/2,Pf/2);var vg=N.allocAt(0,0,Re,Pf),Se=J.alloc();Se.xi(vg,Oe);vd.Ga(Se);var wg=-Se.x,Sn=-Se.y,re=J.alloc();re.assign(Eh);isNaN(re.x)&&(re.x=Re/2+3);isNaN(re.y)&&(re.y=-(Pf/2+3));re.rotate(Jd);Ci+=re.x+wg;Fh+=re.y+Sn;var Qf=new N(Ci,Fh,Qe.width,Qe.height),Di=new N(Qe.x,Qe.y,Qe.width,Qe.height),Tn=new N(qe.x,qe.y,qe.width,qe.height); Vd.Sz=Of;Vd.lineCount=qc.lineCount;Vd.lines=[qc.Cb,qc.Ih,qc.df,qc.Le,qc.Qc,qc.Qb,qc.ze];Vd.actualBounds=Qf;Vd.measuredBounds=Di;Vd.naturalBounds=Tn;0===Pe?lf.assign(Qf):lf.ed(Qf);J.free(re);J.free(Se);N.free(vg);ld.free(vd)}null!==Uc.graduatedBounds&&Uc.graduatedBounds.push(lf);Yb(rk,lf.x,lf.y,lf.width,lf.height)}pj(Va,!1)}}}; fn.prototype.arrange=function(a,b,c){if(null!==a.graduatedBounds){var d=a.Pb(),e=a.graduatedMarks;if(null!==e){var f=a.graduatedBounds,g=0,h=f[g];g++;null!==d&&d.arrange(h.x-c.x,h.y-c.y,h.width,h.height);for(var k=b.length,l=0;l=g&&(g=1);for(var h=f.actualBounds,k=a.O.s,l=a.graduatedMarks,m=k.length,n=0;na.graduatedTickUnit*p.interval*f.geometry.flattenedTotalLength/a.graduatedRange*g&&null===p.graduatedSkip)){var u= p.measuredBounds,w=p.strokeWidth*p.scale,v=p.alignmentFocus;v.Mc()&&(v=tc);for(var y=0;yg.height)continue}else if(l.position>g.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var n=l.separatorStroke;null===n&&(n=c?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke);if(0!==m&&null!==n){ji(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray; null===p&&(p=c?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray);null!==p&&(n=!0,b.js(p,0));b.beginPath();p=l.position+m;c?p>g.height&&(m-=p-g.height):p>g.width&&(m-=p-g.width);l=l.position+m/2;b.lineWidth=m;m=a.yb;c?(l+=m.top,p=g.width-m.right,b.moveTo(m.left,l),b.lineTo(p,l)):(l+=m.left,p=g.height-m.bottom,b.moveTo(l,m.top),b.lineTo(l,p));b.stroke();b.Se();n&&b.fs()}}}} function ln(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=nn(a,!0),l=nn(a,!1),m=0;mp)){var q=n.Wc(),r=n.separatorStrokeWidth;isNaN(r)&&(r=c?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var u=n.separatorStroke;null===u&&(u=c?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke);if(null===u||n.index===(c?k:l))r=0;q-= r;r=n.position+r;q+=n.actual;r+q>p&&(q=p-r);0>=q||(p=a.yb,ji(a,b,n.background,!0,!1,h,g),c?b.fillRect(p.left,r+p.top,g.width-(p.left+p.right),q):b.fillRect(r+p.left,p.top,q,g.height-(p.top+p.bottom)))}}}}function nn(a,b){for(var c=b?a.rowCount:a.columnCount,d=0;dd&&e.set(r),J.free(r));J.free(m);f&&e.transform(g);return l}; t.Gj=function(){for(var a=this.O.s,b=a.length,c=0;cc||f>d)this.v(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case nd:this.v(!0);this.measure(c+h,d+g,0,0);break;case Wk:this.v(!0);this.measure(c+h,f+g,0,0);break;case Xk:this.v(!0),this.measure(b+h,d+g,0,0)}}this.na.arrange(this,e,this.jg)}}; t.gh=function(a){var b=this.naturalBounds,c=Im(this);if(Zb(0,0,b.width,b.height,a.x,a.y)){b=this.O.s;for(var d=b.length,e=J.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(xb(e.set(a),f.transform),f.ca(e))return J.free(e),!0}J.free(e);return null===this.Ma&&null===this.areaBackground?!1:!0}return!1};t.ks=function(a){if(this.bindingId===a)return this;for(var b=this.O.s,c=b.length,d=0;dp.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof W?m:null;p=ld.alloc();p.set(g); if(null!==m?m.Cf(a,b,c,d,e,p):il(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);ld.free(p)}}}void 0===f&&ld.free(g);return d}void 0===f&&ld.free(g);return!1};function un(a,b,c,d){for(var e=a.O.s,f=e.length;f--;){var g=e[f];if(g.visible){var h=g.actualBounds,k=a.naturalBounds;h.x>k.width||h.y>k.height||0>h.x+h.width||0>h.y+h.height||(g instanceof W&&un(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}} t.og=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var g=this.naturalBounds,h=this.se(),k=h?a:xb(J.allocAt(a.x,a.y),this.transform),l=h?b:xb(J.allocAt(b.x,b.y),this.transform),m=k.Bf(l),n=0w.width||u.y>w.height||0>u.x+u.width||0>u.y+u.height))if(r.se()?(u=r.transform,xb(k.set(a),u),xb(l.set(b),u)):(k.set(a),l.set(b)),u=r,r=r instanceof W?r:null,null!==r?r.og(k,l,c,d,e,f):u.tx(k,l,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}J.free(k);J.free(l)}return e?n:g}return!1}; function Om(a){var b=null;a instanceof Bf&&(b=a.spot1,b===Sc&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=sc);return b}function Pm(a){var b=null;a instanceof Bf&&(b=a.spot2,b===Sc&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Bc);return b}t.add=function(a){for(var b=[],c=0;c=e.count&&a>=e.count)return; e.mb(f);d=f}else C("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Gb(a,b);if(0===a||b.isPanelMain)this.$g=null;uj(this)||this.v();b.v(!1);null!==b.portId?this.Te=!0:b instanceof W&&!0===b.Te&&(this.Te=!0);this.graduatedIntervals=null;this.If()||vn(this,b,!1);c=this.part;null!==c&&(c.Rh=null,c.ag=NaN,this.Te&&c instanceof V&&(c.Te=!0),c.Te&&c instanceof V&&(c.wc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&& c.cb(fe,"elements",this,b,null,d,null),c.cb(ee,"elements",this,null,b,null,a)))};function wn(a,b){a.l=b?a.l|16777216:a.l&-16777217}t.remove=function(a){for(var b=this.O.s,c=b.length,d=-1,e=0;ea&&xa(a,">= 0",W,"getRowDefinition:idx");a=Math.round(a);var b=this.rowDefs;if(void 0===b[a]){var c=new Vj;c.wi(this);c.isRow=!0;c.index=a;b[a]=c;this.cb(ee,"rowdefs",this,null,c,null,a)}return b[a]};t.oA=function(a){0>a&&xa(a,">= 0",W,"removeRowDefinition:idx");if(0!==this.rowCount){a=Math.round(a);var b=this.rowDefs,c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.cb(fe,"rowdefs",this,c,null,a,null);this.v()}}}; function Wj(a,b,c){var d=a.rowDefs;if(!(0>b)){d[b]=c instanceof Vj?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.v()}}t.Eb=function(a){0>a&&xa(a,">= 0",W,"getColumnDefinition:idx");a=Math.round(a);var b=this.colDefs;if(void 0===b[a]){var c=new Vj;c.wi(this);c.isRow=!1;c.index=a;b[a]=c;this.cb(ee,"coldefs",this,null,c,null,a)}return b[a]}; t.jA=function(a){0>a&&xa(a,">= 0",W,"removeColumnDefinition:idx");if(0!==this.columnCount){a=Math.round(a);var b=this.colDefs,c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.cb(fe,"coldefs",this,c,null,a,null);this.v()}}};function Xj(a,b,c){var d=a.colDefs;if(!(0>b)){d[b]=c instanceof Vj?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.v()}}t.Gy=function(a){var b=null;a.isRow?b=this.Fb(a.index):a.isRow||(b=this.Eb(a.index));b&&Xl(b,a);return this}; t.Hy=function(a,b){(a=this.Fb(a))&&Xl(a,new Vj(b));return this};t.By=function(a,b){(a=this.Eb(a))&&Xl(a,new Vj(b));return this};t.nz=function(a){if(0>a||this.type!==W.Table||0===this.rowCount)return-1;for(var b=0,c=this.rowDefs,d=c.length,e=this.topIndex;ea||this.type!==W.Table||0===this.columnCount)return-1;for(var b=0,c=this.colDefs,d=c.length,e=this.leftIndex;ea;)this.pc(this.O.length-1,!1);zn(this,this.itemArray)}; function zn(a,b){var c=sn(a);if(null===b||0===b.length)for(;a.O.length>c;)a.pc(a.O.length-1,!1);else if(a.O.length<=c){c=b.length;for(var d=0;dc)){var e=Bn(a,b);e=Cn(a,e);if(null!==e){jg(e);e=e.copy();if(0!==(e.l&16777216)){var f=a.ih();null!==f&&wn(f,!0)}"object"===typeof b&&(null===a.ge&&(a.ge=new ob),a.ge.add(b,e));f=c+sn(a);a.Gb(f,e);d&&(e.ub=b,Dn(a,f,c),e.ub=null);e.data=b}}} function Dn(a,b,c){for(a=a.O;ba&&xa(a,">= 0",W,"padding"), a=new dc(a)):(0>a.left&&xa(a.left,">= 0",W,"padding:value.left"),0>a.right&&xa(a.right,">= 0",W,"padding:value.right"),0>a.top&&xa(a.top,">= 0",W,"padding:value.top"),0>a.bottom&&xa(a.bottom,">= 0",W,"padding:value.bottom"));var b=this.yb;b.D(a)||(this.yb=a=a.J(),this.v(),this.g("padding",b,a))}},defaultAlignment:{get:function(){return this.Tm},set:function(a){var b=this.Tm;b.D(a)||(this.Tm=a=a.J(),this.v(),this.g("defaultAlignment",b,a))}},defaultStretch:{ get:function(){return this.Uf},set:function(a){var b=this.Uf;b!==a&&(this.Uf=a,this.v(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{get:function(){return null!==this.T?this.T.Qp:lc},set:function(a){"number"===typeof a&&(a=new dc(a));var b=this.defaultSeparatorPadding;b.D(a)||(a=a.J(),null===this.T&&(this.T=new In),this.T.Qp=a,this.v(),this.g("defaultSeparatorPadding",b,a))}},defaultRowSeparatorStroke:{get:function(){return null!== this.T?this.T.ia:null},set:function(a){var b=this.defaultRowSeparatorStroke;b!==a&&(null===a||"string"===typeof a||a instanceof ql)&&(a instanceof ql&&a.freeze(),null===this.T&&(this.T=new In),this.T.ia=a,this.N(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{get:function(){return null!==this.T?this.T.Ha:1},set:function(a){var b=this.defaultRowSeparatorStrokeWidth;b!==a&&isFinite(a)&&0<=a&&(null===this.T&&(this.T=new In),this.T.Ha=a,this.v(), this.g("defaultRowSeparatorStrokeWidth",b,a))}},defaultRowSeparatorDashArray:{get:function(){return null!==this.T?this.T.V:null},set:function(a){var b=this.defaultRowSeparatorDashArray;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ea)&&C("Panel.topIndex must be greater than zero and a real number, not: "+a),null===this.T&&(this.T=new In),this.T.Hb=a,this.v(),this.g("topIndex",b,a))}},leftIndex:{get:function(){return null!==this.T?this.T.hb:0},set:function(a){var b=this.leftIndex;b!==a&&((!isFinite(a)||0>a)&&C("Panel.leftIndex must be greater than zero and a real number, not: "+ a),null===this.T&&(this.T=new In),this.T.hb=a,this.v(),this.g("leftIndex",b,a))}},data:{get:function(){return this.ub},set:function(a){var b=this.ub;if(b!==a){var c=this instanceof U&&!(this instanceof te);jg(this);this.ub=a;var d=this.diagram;null!==d&&(c?(c=d.partManager,this instanceof T?(null!==b&&c.bf.remove(b),null!==a&&c.bf.add(a,this)):this instanceof U&&(null!==b&&c.cf.remove(b),null!==a&&c.cf.add(a,this))):(c=this.panel,null!==c&&null!==c.ge&&(null!==b&&c.ge.remove(b), null!==a&&c.ge.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.La()}}},itemIndex:{get:function(){return this.zn},set:function(a){var b=this.zn;b!==a&&(this.zn=a,this.g("itemIndex",b,a))}},allBindings:{get:function(){return null!==this.A?this.A.nb:null},set:function(a){this.localBindings!==a&&(null===this.A&&(this.A=new dl),this.A.nb=a)}},itemArray:{get:function(){return this.Hh}, set:function(a){var b=this.Hh;if(b!==a||null!==a&&yn(this,a)){var c=this.diagram;b!==a&&(null!==c&&null!==b&&Mj(c.partManager,this,c),this.Hh=a,null!==c&&null!==a&&Jj(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||zn(this,a)}}},itemTemplate:{get:function(){return null===this.itemTemplateMap?null:this.itemTemplateMap.I("")},set:function(a){if(null===this.itemTemplateMap){if(null===a)return;this.itemTemplateMap=new ob}var b=this.itemTemplateMap.I(""); b!==a&&((a instanceof U||a.isPanelMain)&&C("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.itemTemplateMap.add("",a),this.g("itemTemplate",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.mv())}},itemTemplateMap:{get:function(){return null!==this.A?this.A.Pc:null},set:function(a){var b=this.itemTemplateMap;if(b!==a){for(var c=a.iterator;c.next(););cl(this);this.A.Pc=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing|| this.mv()}}},itemCategoryProperty:{get:function(){return null!==this.A?this.A.Oc:"category"},set:function(a){var b=this.itemCategoryProperty;b!==a&&(cl(this),this.A.Oc=a,this.g("itemCategoryProperty",b,a))}},isAtomic:{get:function(){return 0!==(this.l&1048576)},set:function(a){var b=0!==(this.l&1048576);b!==a&&(this.l^=1048576,this.g("isAtomic",b,a))}},isClipping:{get:function(){return 0!==(this.l&2097152)}, set:function(a){var b=0!==(this.l&2097152);b!==a&&(this.l^=2097152,this instanceof pf&&(this.tb=null),this.v(),this.g("isClipping",b,a))}},isOpposite:{get:function(){return 0!==(this.l&33554432)},set:function(a){var b=0!==(this.l&33554432);b!==a&&(this.l^=33554432,this.v(),this.g("isOpposite",b,a))}},isEnabled:{get:function(){return 0!==(this.l&4194304)},set:function(a){var b=0!==(this.l&4194304);if(b!==a){var c=null===this.panel||this.panel.If(); this.l^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!==b&&b.undoManager.isUndoingRedoing||c&&vn(this,this,a)}}},alignmentFocusName:{get:function(){return this.$e},set:function(a){var b=this.$e;b!==a&&(this.$e=a,this.v(),this.g("alignmentFocusName",b,a))}}}); ma.Object.defineProperties(W,{Position:{get:function(){return Wl.I("Position")}},Horizontal:{get:function(){return Wl.I("Horizontal")}},Vertical:{get:function(){return Wl.I("Vertical")}},Spot:{get:function(){return Wl.I("Spot")}},Auto:{get:function(){return Wl.I("Auto")}},Table:{get:function(){return Wl.I("Table")}},Viewbox:{ get:function(){return Wl.I("Viewbox")}},TableRow:{get:function(){return Wl.I("TableRow")}},TableColumn:{get:function(){return Wl.I("TableColumn")}},Link:{get:function(){return Wl.I("Link")}},Grid:{get:function(){return Wl.I("Grid")}},Graduated:{get:function(){return Wl.I("Graduated")}}});W.prototype.rebuildItemElements=W.prototype.mv; W.prototype.findItemPanelForData=W.prototype.sx;W.prototype.updateTargetBindings=W.prototype.La;W.prototype.copyTemplate=W.prototype.Uy;W.prototype.graduatedValueForPoint=W.prototype.Gz;W.prototype.graduatedPointForValue=W.prototype.Fz;W.prototype.findColumnForLocalX=W.prototype.fz;W.prototype.findRowForLocalY=W.prototype.nz;W.prototype.addColumnDefinition=W.prototype.By;W.prototype.addRowDefinition=W.prototype.Hy;W.prototype.addRowColumnDefinition=W.prototype.Gy; W.prototype.removeColumnDefinition=W.prototype.jA;W.prototype.getColumnDefinition=W.prototype.Eb;W.prototype.removeRowDefinition=W.prototype.oA;W.prototype.getRowDefinition=W.prototype.Fb;W.prototype.removeAt=W.prototype.mb;W.prototype.remove=W.prototype.remove;W.prototype.insertAt=W.prototype.Gb;W.prototype.elt=W.prototype.M;W.prototype.add=W.prototype.add;W.prototype.findObject=W.prototype.fb;W.prototype.findInVisualTree=W.prototype.Nl;W.prototype.walkVisualTreeFrom=W.prototype.qm; W.prototype.findMainElement=W.prototype.Pb;var Fn=!1,Gn=null,Wl=new ob;W.className="Panel";W.definePanelLayout=Hn;Hn("Position",new Hm);Hn("Vertical",new Km);Hn("Auto",new Nm);Hn("Link",new Ym);function Jn(){this.lq=0;this.F=100;this.ia=10;this.V=0;this.Zh=this.o=this.j=this.u=null}Jn.prototype.copy=function(){var a=new Jn;a.lq=this.lq;a.F=this.F;a.ia=this.ia;a.V=this.V;a.u=this.u;a.j=this.j;a.o=this.o;a.Zh=this.Zh;return a};Jn.className="GradPanelSettings"; function In(){this.Pc=[];this.Oc=[];this.j=this.ob=Kn;this.hb=this.Hb=0;this.Qp=lc;this.Ha=1;this.V=this.ia=null;this.F=1;this.nb=this.o=this.u=null} In.prototype.copy=function(a){for(var b=new In,c=this.Pc,d=c.length,e=b.Pc,f=0;fa&&xa(a,">= 0",Vj,"height"),this.Hc=a,this.actual=this.oa,null!==this.panel&&this.panel.v(), this.Ob("height",b,a))}},width:{get:function(){return this.Hc},set:function(a){var b=this.Hc;b!==a&&(0>a&&xa(a,">= 0",Vj,"width"),this.Hc=a,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Ob("width",b,a))}},minimum:{get:function(){return this.jj},set:function(a){var b=this.jj;b!==a&&((0>a||!isFinite(a))&&xa(a,">= 0",Vj,"minimum"),this.jj=a,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Ob("minimum",b,a))}},maximum:{ get:function(){return this.hj},set:function(a){var b=this.hj;b!==a&&(0>a&&xa(a,">= 0",Vj,"maximum"),this.hj=a,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Ob("maximum",b,a))}},alignment:{get:function(){return this.Jb},set:function(a){var b=this.Jb;b.D(a)||(this.Jb=a.J(),null!==this.panel&&this.panel.v(),this.Ob("alignment",b,a))}},stretch:{get:function(){return this.hg},set:function(a){var b=this.hg;b!==a&&(this.hg= a,null!==this.panel&&this.panel.v(),this.Ob("stretch",b,a))}},separatorPadding:{get:function(){return this.dg},set:function(a){"number"===typeof a&&(a=new dc(a));var b=this.dg;null!==a&&null!==b&&b.D(a)||(null!==a&&(a=a.J()),this.dg=a,null!==this.panel&&this.panel.v(),this.Ob("separatorPadding",b,a))}},separatorStroke:{get:function(){return this.lo},set:function(a){var b=this.lo;b!==a&&(null!==a&&bm(a,"RowColumnDefinition.separatorStroke"), a instanceof ql&&a.freeze(),this.lo=a,null!==this.panel&&this.panel.v(),this.Ob("separatorStroke",b,a))}},separatorStrokeWidth:{get:function(){return this.mo},set:function(a){var b=this.mo;b!==a&&(this.mo=a,null!==this.panel&&this.panel.v(),this.Ob("separatorStrokeWidth",b,a))}},separatorDashArray:{get:function(){return this.tj},set:function(a){var b=this.tj;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ee)){var f=d.measuredBounds,g=Math.max(1,f.width);f=f.height;for(var h=c[0],k=c[1],l,m,n,p,q,r,u=0,w=Ea(),v=2;vn&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;v=0;r=w[v];n=r[0];q=r[1];p=r[2];r=r[3];for(var y=0;.1<=u;){0===y&&(m?(e=c,e-=l,u-=l,m=!1):e=c,0===e&&(e=1)); if(e>u){Ga(w);return}e>r?(y=e-r,e=r):y=0;var z=Math.sqrt(e*e/(1+p*p));0>n&&(z=-z);h+=z;k+=p*z;a.translate(h,k);a.rotate(q);a.translate(-(g/2),-(f/2));0===y&&d.hh(a,b);a.translate(g/2,f/2);a.rotate(-q);a.translate(-h,-k);u-=e;r-=e;if(0!==y){v++;if(v===w.length){Ga(w);return}r=w[v];n=r[0];q=r[1];p=r[2];r=r[3];e=y}}Ga(w)}} t.hh=function(a,b){var c=this.xc,d=this.Ui;if(null!==c||null!==d){var e=this.ua;if(null!==e){a.yc();var f=this.actualBounds,g=this.naturalBounds;null!==d&&ji(this,a,d,!0,!1,g,f);var h=this.part,k=this.ig;null===c||0!==k||null===h||!this.isPanelMain&&h.Pb()!==this||(k=h.type===W.Link&&h instanceof te&&"Selection"===h.category&&h.adornedObject instanceof Bf&&h.adornedPart.Pb()===h.adornedObject?h.adornedObject.strokeWidth:0);0===k&&(c=null);null!==c&&0!==k&&(ji(this,a,c,!1,!1,g,f),a.lineWidth=k,a.lineJoin= this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit);f=!1;h&&b.Gf("drawShadows")&&(f=h.isShadowed);!1===a.Il&&(f=!1);h=!0;null===c||null!==d&&"transparent"!==d||(h=!1);g=!1;k=this.strokeDashArray;null!==k&&(g=!0,a.js(k,this.strokeDashOffset));if(e.type===P.j)a.beginPath(),a.moveTo(e.startX,e.startY),a.lineTo(e.endX,e.endY),null!==c&&a.jk(),a.Se();else if(e.type===P.u){var l=e.startX;k=e.startY;var m=e.endX,n=e.endY;e=Math.min(l,m);var p=Math.min(k,n);l=Math.abs(m-l);k=Math.abs(n- k);a.beginPath();a.rect(e,p,l,k);null!==d&&a.ng(d);null!==c&&(h&&f&&ul(a),a.jk(),h&&f&&tl(a));a.Se()}else if(e.type===P.F)l=e.startX,k=e.startY,m=e.endX,n=e.endY,e=Math.abs(m-l)/2,p=Math.abs(n-k)/2,l=Math.min(l,m)+e,k=Math.min(k,n)+p,a.beginPath(),a.moveTo(l,k-p),a.bezierCurveTo(l+K.wg*e,k-p,l+e,k-K.wg*p,l+e,k),a.bezierCurveTo(l+e,k+K.wg*p,l+K.wg*e,k+p,l,k+p),a.bezierCurveTo(l-K.wg*e,k+p,l-e,k+K.wg*p,l-e,k),a.bezierCurveTo(l-e,k-K.wg*p,l-K.wg*e,k-p,l,k-p),a.closePath(),null!==d&&a.ng(d),null!==c&& (h&&f&&ul(a),a.jk(),h&&f&&tl(a)),a.Se();else if(e.type===P.o)for(e=e.figures,k=e.length,p=0;pu.sweepAngle,null!==q?q.endX:l.startX,null!==q?q.endY:l.startY)}else if(q=Nd(u,l),w=q.length,0===w)a.lineTo(u.centerX,u.centerY);else for(var v=0;v(c.startX-c.endX)*(a.x-c.endX)+(c.startY-c.endY)*(a.y-c.endY)||0>d)return!1;N.free(f);return K.Yb(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type=== P.u){b=c.startX;var g=c.startY,h=c.endX;c=c.endY;f.x=Math.min(b,h);f.y=Math.min(g,c);f.width=Math.abs(h-b);f.height=Math.abs(c-g);if(null===this.fill){f.Bc(-d,-d);if(f.ca(a))return N.free(f),!1;f.Bc(d,d)}null!==this.stroke&&f.Bc(e,e);a=f.ca(a);N.free(f);return a}if(c.type===P.F){g=c.startX;e=c.startY;h=c.endX;var k=c.endY;c=Math.min(g,h);b=Math.min(e,k);g=Math.abs(h-g)/2;e=Math.abs(k-e)/2;c=a.x-(c+g);b=a.y-(b+e);if(null===this.fill){g-=d;e-=d;if(0>=g||0>=e||1>=c*c/(g*g)+b*b/(e*e))return N.free(f), !1;g+=d;e+=d}null!==this.stroke&&(g+=d,e+=d);N.free(f);return 0>=g||0>=e?!1:1>=c*c/(g*g)+b*b/(e*e)}if(c.type===P.o)return N.free(f),null===this.fill?Rd(c,a.x,a.y,e):Pd(c,a,e,1=this.strokeWidth)m=K.Ve(l.startX,l.startY,l.endX,l.endY,f,g,h,k,e);else{l.startX===l.endX?(d=n,m=0):(b=(l.endY-l.startY)/(l.endX-l.startX),m=n/Math.sqrt(1+b*b), d=m*b);b=Ea();a=new J;K.Ve(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new J;K.Ve(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new J;K.Ve(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new J;K.Ve(l.endX+d,l.endY+m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);h=b.length;if(0===h)return Ga(b),!1;m=!0;k=Infinity;for(d=0;dMath.abs(c)){k=g-m-c*(f-d);if(0>a*a*c*c+l*l-k*k){e.x=NaN;e.y=NaN;m=!1;break a}n=Math.sqrt(a*a*c*c+l*l-k*k);h=(-(a*a*c*k)+a*l*n)/(l*l+a*a*c*c)+d;a=(-(a*a*c*k)-a*l*n)/(l*l+a*a*c*c)+d;l=c*(h-d)+k+m;k=c* (a-d)+k+m;Math.abs((f-h)*(f-h))+Math.abs((g-l)*(g-l))h){e.x=NaN;e.y=NaN;m=!1;break a}k=Math.sqrt(h);h=m+k;k=m-k;Math.abs(h-g)Math.abs(r)?(u*=.5/r,r=.5):0!==u&&.5>Math.abs(u)&&(r*=.5/u,u=.5),v-=r,y-= u;q.contains(v,y);)v-=r,y-=u;e.x=h;e.y=k;for(u=0;uc?a-c:c-a)<(b>d?b-d:d-b)?(a=ba||K.$(k.y,a))&&(k.yb||K.$(k.x,b))&&(k.x=a&&d<=b;a=d&&c<=a} t.tx=function(a,b,c){function d(a,b){for(var c=a.length,d=0;de)return!0;return!1}if(c&&null!==this.fill&&this.gh(a,!0))return!0;var e=a.Bf(b),f=e;1.5=e||zb(b,f,0,-n)>=e||zb(b, f,0,n)>=e||zb(b,f,m,0)>=e?!1:!0}else if(b.type===P.o){l=b.bounds;f=l.x;h=l.y;k=l.x+l.width;l=l.y+l.height;if(a.x>k&&a.xl&&a.ye&&yb(a.x,a.y,f,h,k,h)>e&&yb(a.x,a.y,k,l,f,l)>e&&yb(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?Rd(b,a.x,a.y,f):Pd(b,a,f,!0,!1))return!0}else{c=b.figures;for(b=0;be)return!1;h=f.segments.s;k=h.length;for(l=0;le)return!1;break;case Ed:var p=Ea();K.Qe(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Ga(p);if(g)return!1;g=n.endX;m=n.endY;if(a.zd(g,m)>e)return!1;break;case Kd:p=Ea();K.ep(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Ga(p);if(g)return!1;g=n.endX;m=n.endY;if(a.zd(g,m)>e)return!1;break;case Ld:case Md:p=n.type===Ld?Nd(n,f):Od(n,f,g,m);var q=p.length;if(0===q){g=n.type===Ld?n.centerX:n.endX;m=n.type===Ld?n.centerY:n.endY;if(a.zd(g,m)>e)return!1; break}n=null;for(var r=Ea(),u=0;u= 0",Bf,"strokeWidth:value")}},strokeCap:{ get:function(){return null!==this.Na?this.Na.Hr:"butt"},set:function(a){var b=this.strokeCap;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?xa(a,'"butt", "round", or "square"',Bf,"strokeCap"):(Mn(this),this.Na.Hr=a,this.N(),this.g("strokeCap",b,a)))}},strokeJoin:{get:function(){return null!==this.Na?this.Na.Ir:"miter"},set:function(a){var b=this.strokeJoin;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?xa(a,'"miter", "bevel", or "round"', Bf,"strokeJoin"):(Mn(this),this.Na.Ir=a,this.N(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{get:function(){return null!==this.Na?this.Na.Jr:10},set:function(a){var b=this.strokeMiterLimit;if(b!==a&&1<=a){Mn(this);this.Na.Jr=a;this.N();var c=this.part;null!==c&&(c.ag=NaN);this.g("strokeMiterLimit",b,a)}}},strokeDashArray:{get:function(){return this.Yg},set:function(a){var b=this.Yg;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1(n*n+m*m)*p*p&&(c=!0);b.ib!==a&&(c=!1);b.ib instanceof ii&& (c=!1);!1===b.Gf("textGreeking")&&(c=!1);b=this.spacingAbove;n=this.spacingBelow;switch(this.flip){case al:a.translate(e,0);a.scale(-1,1);break;case $k:a.translate(0,f);a.scale(1,-1);break;case bl:a.translate(e,f),a.scale(-1,-1)}a.yc();m=this.Gc;p=(b+g+n)*m;f>p&&(d=this.verticalAlignment,d=d.y*f-d.y*p+d.offsetY);if(1===m&&null!==this.ze)n=this.Cb,n>e&&(n=e),this.Oj(this.ze,a,0,d+b,e,g,n,c,h,k,l);else if(null!==this.Qc&&null!==this.Qb)for(p=0;pe&&(q=e);d+=b;this.Oj(this.Qb[p], a,0,d,e,g,q,c,h,k,l);d+=g+n}switch(this.flip){case al:a.scale(-1,1);a.translate(-e,0);break;case $k:a.scale(1,-1);a.translate(0,-f);break;case bl:a.scale(-1,-1),a.translate(-e,-f)}}}; t.Oj=function(a,b,c,d,e,f,g,h,k,l,m){var n=0;if(h)"left"===k?n=0:"right"===k?n=e-g:"center"===k&&(n=(e-g)/2),b.fillRect(c+n,d+.25*f,g,1);else{"left"===k?n=0:"right"===k?n=e:"center"===k&&(n=e/2);e=null!==jo?jo(this,f):.75*f;b.fillText(a,c+n,d+e);a=f/20|0;0===a&&(a=1);"right"===k?n-=g:"center"===k&&(n-=g/2);if(l){h=null!==ko?ko(this,f):.8*f;k=c+n;l=d+h;e=c+n+g;h=d+h;var p=a;b.beginPath();b.lineWidth=p;b.moveTo(k,l);b.lineTo(e,h);b.stroke();b.Se();b instanceof ii&&b.ad.classList.add("gojs-td")}m&&(m= d+f-f/2.2|0,0!==a%2&&(m+=.5),d=c+n,f=m,c=c+n+g,g=m,n=a,b.beginPath(),b.lineWidth=n,b.moveTo(d,f),b.lineTo(c,g),b.stroke(),b.Se(),b instanceof ii&&b.ad.classList.add("gojs-td"))}}; t.kk=function(a,b,c){if(!Y.prototype.kk.call(this,a,b,c))return!1;ji(this,a,this.xc,!0,!1,this.naturalBounds,this.actualBounds);if(c){if(0===this.svg.getElementsByTagName("text").length)return!0;b=this.svg.getElementsByClassName("gojs-td");for(c=0;c=this.Qb.length))){this.l|=16777216; l=this.Qb[k];for(b=Math.max(1,a-b);no(l)>b&&1a.maxLines&&(a.l|=16777216)}} function uo(a,b,c,d){var e=a.formatting===mo;e&&(b=b.trim());var f=0,g=a.Ae,h=a.spacingAbove+a.spacingBelow;h=Math.max(0,io(a)+h);var k=a.overflow===po?qo(g):0;if(a.Gc>=a.maxLines)null!==d&&d.h(0,h);else if(g=b,a.wrap===vo){a.Le=1;var l=no(b);if(0===k||l<=c)a.Cb=Math.max(a.Cb,l),to(a,b,a.Cb),null!==d&&d.h(l,h);else{f=wo(a,g);g=g.substr(f.length);b=wo(a,g);for(l=no(f+b);0 c&&1c;){var n=1;l=no(b.substr(0,n));for(m=0;l<=c;)n++,m=l,l=no(b.substr(0,n));if(1===n){var p=l;f=Math.max(f,l)}else p=m,f=Math.max(f,m);n--;1>n&&(n=1);to(a,b.substr(0,n),p);k++;b=b.substr(n);if(a.Gc+k>a.maxLines)break}m=wo(a,g);for(l=no(b+m);0a.maxLines))break}a.Le=Math.min(a.maxLines,k);a.Cb=Math.max(a.Cb,f);null!==d&&d.h(a.Cb,h*a.Le)}} function wo(a,b){if(a.wrap===xo)return b.substr(0,1);for(var c=b.length,d=0,e=yo;d=b.length?b:b.substr(0,d)}function no(a){return null===fo?8*a.length:fo.measureText(a).width}function io(a){if(null!==a.df)return a.df;var b=a.Ae;if(null===fo){var c=16;return a.df=c}void 0!==Ao[b]&&5E3>Bo?c=Ao[b]:(c=1.3*fo.measureText("M").width,Ao[b]=c,Bo++);return a.df=c} function qo(a){if(null===fo)return 6;if(void 0!==Co[a]&&5E3>Do)var b=Co[a];else b=fo.measureText(ro).width,Co[a]=b,Do++;return b} function oo(a,b){var c=a.ec.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d=a.spacingAbove+a.spacingBelow;d=Math.max(0,io(a)+d);if(0===c.length)return a.Cb=0,a.Gc=1,d;if(!a.isMultiline){var e=c.indexOf("\n",0);0<=e&&(c=c.substr(0,e))}e=0;for(var f=a.Gc=0,g,h=!1;!h;){g=c.indexOf("\n",f);-1===g&&(g=c.length,h=!0);if(f<=g){f=c.substr(f,g-f);if(a.wrap!==vo){a.Le=0;var k=L.alloc();uo(a,f,b,k);e+=k.height;L.free(k);a.Gc+=a.Le}else uo(a,f,b,null),e+=d,a.Gc++;a.Gc===a.maxLines&&(h=!0)}f=g+1}return a.Lq=e} ma.Object.defineProperties(Pg.prototype,{font:{get:function(){return this.Ae},set:function(a){var b=this.Ae;b!==a&&(this.Ae=a,this.df=null,this.v(),this.g("font",b,a))}},text:{get:function(){return this.ec},set:function(a){var b=this.ec;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.ec=a,this.v(),this.g("text",b,a),this.Uc=!0)}},textAlign:{get:function(){return null!==this.da?this.da.Or:"start"},set:function(a){var b= this.textAlign;b===a||"start"!==a&&"end"!==a&&"left"!==a&&"right"!==a&&"center"!==a||(go(this),this.da.Or=a,this.N(),this.g("textAlign",b,a))}},flip:{get:function(){return null!==this.da?this.da.Xf:kg},set:function(a){var b=this.flip;b!==a&&(go(this),this.da.Xf=a,this.N(),this.g("flip",b,a))}},verticalAlignment:{get:function(){return null!==this.da?this.da.Yr:Yc},set:function(a){var b=this.verticalAlignment;b.D(a)||(a=a.J(),go(this),this.da.Yr= a,Ml(this),this.g("verticalAlignment",b,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=L.alloc();uo(this,this.ec,999999,a);var b=a.width;L.free(a);a=oo(this,b);var c=this.desiredSize;isNaN(c.width)||(b=c.width);isNaN(c.height)||(a=c.height);Pb(this.dc,b,a)}return this.dc}},isMultiline:{get:function(){return 0!==(this.l&2097152)},set:function(a){var b=0!==(this.l&2097152);b!==a&&(this.l^=2097152,this.v(),this.g("isMultiline",b, a))}},isUnderline:{get:function(){return 0!==(this.l&4194304)},set:function(a){var b=0!==(this.l&4194304);b!==a&&(this.l^=4194304,this.Uc=!0,this.N(),this.g("isUnderline",b,a))}},isStrikethrough:{get:function(){return 0!==(this.l&8388608)},set:function(a){var b=0!==(this.l&8388608);b!==a&&(this.l^=8388608,this.Uc=!0,this.N(),this.g("isStrikethrough",b,a))}},wrap:{get:function(){return null!==this.da?this.da.$r: Eo},set:function(a){var b=this.wrap;b!==a&&(go(this),this.da.$r=a,this.v(),this.g("wrap",b,a))}},overflow:{get:function(){return null!==this.da?this.da.$q:Fo},set:function(a){var b=this.overflow;b!==a&&(go(this),this.da.$q=a,this.v(),this.g("overflow",b,a))}},isOverflowed:{get:function(){return 0!==(this.l&16777216)}},stroke:{get:function(){return this.xc},set:function(a){var b=this.xc;b!==a&&(null!==a&&bm(a, "TextBlock.stroke"),a instanceof ql&&a.freeze(),this.xc=a,this.N(),this.g("stroke",b,a))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return io(this)}},editable:{get:function(){return 0!==(this.l&1048576)},set:function(a){var b=0!==(this.l&1048576);b!==a&&(this.l^=1048576,this.g("editable",b,a))}},textEditor:{get:function(){return null!==this.da?this.da.Qr: null},set:function(a){var b=this.textEditor;b!==a&&(go(this),this.da.Qr=a,this.g("textEditor",b,a))}},errorFunction:{get:function(){return null!==this.da?this.da.Hd:null},set:function(a){var b=this.errorFunction;b!==a&&(go(this),this.da.Hd=a,this.g("errorFunction",b,a))}},interval:{get:function(){return null!==this.fa?this.fa.Tk:1},set:function(a){var b=this.interval;a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){null===this.fa&&(this.fa= new co);this.fa.Tk=a;this.v();var c=this.panel;null!==c&&(c.graduatedIntervals=null);this.g("interval",b,a)}}},graduatedStart:{get:function(){return null!==this.fa?this.fa.u:0},set:function(a){var b=this.graduatedStart;b!==a&&(0>a?a=0:1a?a=0:1=a&&xa(a,"> 0",Pg,"maxLines"),go(this),this.da.Jq=a,this.v(),this.g("maxLines",b,a))}},metrics:{get:function(){return{arrSize:null!==this.Qc?this.Qc:[this.Cb],arrText:null!==this.Qb?this.Qb:[this.ze],maxLineWidth:this.Cb,fontHeight:this.df}}},choices:{ get:function(){return this.Gm},set:function(a){var b=this.Gm;b!==a&&(this.Gm=a,this.g("choices",b,a))}}});var jo=null,ko=null,vo=new E(Pg,"None",0),so=new E(Pg,"WrapFit",1),Eo=new E(Pg,"WrapDesiredSize",2),xo=new E(Pg,"WrapBreakAll",3),Fo=new E(Pg,"OverflowClip",0),po=new E(Pg,"OverflowEllipsis",1),mo=new E(Pg,"FormatTrim",0),zo=new E(Pg,"FormatNone",0),yo=/[ \u200b\u00ad]/,Ao=new Ta,Bo=0,Co=new Ta,Do=0,ro="...",lo="",fo=null,eo=!1;Pg.className="TextBlock"; function ho(){this.nc=!1;this.Hd=null;this.Xf=kg;this.gq=mo;this.Jq=Infinity;this.$q=Fo;this.Er=this.Dr=0;this.Or="start";this.vj=this.Qr=this.Pr=null;this.Yr=Yc;this.$r=Eo}ho.prototype.copy=function(){var a=new ho;a.Hd=this.Hd;a.Xf=this.Xf;a.gq=this.gq;a.Jq=this.Jq;a.$q=this.$q;a.Dr=this.Dr;a.Er=this.Er;a.Or=this.Or;a.Pr=this.Pr;a.Qr=this.Qr;a.vj=this.vj;a.Yr=this.Yr;a.$r=this.$r;return a};Pg.getEllipsis=function(){return ro};Pg.setEllipsis=function(a){ro=a;Co=new Ta;Do=0};Pg.getBaseline=function(){return jo}; Pg.setBaseline=function(a){jo=a};Pg.getUnderline=function(){return ko};Pg.setUnderline=function(a){ko=a};Pg.isValidFont=function(a){eo||(fo=Ng?(new Pi(null)).context:null,eo=!0);if(null===fo)return!0;var b=fo.font;if(a===b||"10px sans-serif"===a)return!0;fo.font="10px sans-serif";fo.font=a;var c=fo.font;if("10px sans-serif"!==c)return fo.font=b,!0;fo.font="19px serif";var d=fo.font;fo.font=a;c=fo.font;fo.font=b;return c!==d};Pg.FormatNone=zo;Pg.FormatTrim=mo;Pg.None=vo;Pg.OverflowClip=Fo; Pg.OverflowEllipsis=po;Pg.WrapBreakAll=xo;Pg.WrapDesiredSize=Eo;Pg.WrapFit=so;function co(){this.Tk=1;this.u=0;this.j=1;this.o=this.F=null}co.prototype.copy=function(){var a=new co;a.Tk=this.Tk;a.u=this.u;a.j=this.j;a.F=this.F;a.o=this.o;return a};co.className="GradElementSettings"; function dk(a,b){Y.call(this);this.Eg=null;this.qo="";this.Xg=cc;this.Nk=nd;this.Zg=this.Hd=null;this.Mk=wc;this.Xf=kg;this.vl=null;this.qn=!1;this.en=!0;this.al=!1;this.bt=this.rl=null;"string"===typeof a?this.source=a:a&&Object.assign(this,a);b&&Object.assign(this,b)}var Go;la(dk,Y); dk.prototype.cloneProtected=function(a){Y.prototype.cloneProtected.call(this,a);a.qo=this.qo;a.element=this.Eg;a.Xg=this.Xg.J();a.Nk=this.Nk;a.Xf=this.Xf;a.Hd=this.Hd;a.Zg=this.Zg;a.Mk=this.Mk.J();a.en=this.en;a.rl=this.rl};dk.prototype.qb=function(a){a===kg||a===mg||a===Zk?this.imageStretch=a:Y.prototype.qb.call(this,a)};dk.prototype.toString=function(){return"Picture("+this.source+")#"+bb(this)};function Mi(a){void 0===a&&(a="");""!==a?Go[a]&&(delete Go[a],Ho--):(Go=new Ta,Ho=0)} function Io(a,b){b.qy||(b.Fq=function(c){b.sq=!0;b.ln=!1;var d=b.Bg.copy();if(null!==d&&void 0!==d){for(d=d.iterator;d.next();){var e=d.value;e.N();var f=b.getAttribute("src")||"";var g=e.Og.I(f);if(null!==g)for(var h=g.length,k=0;k=d.width&&(f=f+r.offsetX+(n*r.x-d.width*r.x));p>=d.height&&(g=g+r.offsetY+(p*r.y-d.height*r.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case nd:n=d.width;p=d.height;break;case mg:case Zk:q===mg?(q=Math.min(d.height/p,d.width/n),n*=q,p*=q):q===Zk&&(q=Math.max(d.height/p,d.width/n),n*=q,p*=q,n>=d.width&&(f=(f+r.offsetX+(n*r.x-d.width*r.x)/n)*k),p>=d.height&&(g=(g+r.offsetY+(p*r.y-d.height*r.y)/ p)*h),k*=1/(n/d.width),h*=1/(p/d.height),n=d.width,p=d.height)}q=this.Df()*b.scale;var u=n*q*p*q,w=k*h/u,v=c.__goCache;q=null;var y=Jo;if(!e){if(c.sq&&void 0!==v&&4y*y)for(null===v.gi&&(Ko(v,4,l,m,c),Ko(v,16,l,m,c)),e=v.gi,l=e.length,m=0;ma)a=5;a=Math.min(a,b/3);a=Math.min(a,c/3);var d="rr"+b+","+c+","+a,e=K.Mf[d];if(void 0!==e)return e;var f=a*K.wg;e=(new P).add((new Wd(a,0,!0)).add(new Xd(pd,b-a,0)).add(new Xd(Ed,b,a,b-f,0,b,f)).add(new Xd(pd,b,c-a)).add(new Xd(Ed,b-a,c,b,c-f,b-f,c)).add(new Xd(pd,a,c)).add(new Xd(Ed,0,c-a,f,c,0,c-f)).add(new Xd(pd,0,a)).add((new Xd(Ed,a,0,0,f,f,0)).close()));1e.x&&a.y>e.y&&a.righte.x&&b.y>e.y&&b.right=c.maxSelectionCount)){this.G^=4096;var d=!1;if(null!==c){d=c.skipsUndoManager;c.skipsUndoManager=!0;var e=c.selection; e.ka();a?e.add(this):e.remove(this);e.freeze()}this.g("isSelected",b,a);this.Wb();a=this.selectionChanged;null!==a&&a(this);null!==c&&(c.$b(),c.skipsUndoManager=d)}}}},isHighlighted:{get:function(){return 0!==(this.G&524288)},set:function(a){var b=0!==(this.G&524288);if(b!==a){this.G^=524288;var c=this.diagram;null!==c&&(c=c.highlighteds,c.ka(),a?c.add(this):c.remove(this),c.freeze());this.g("isHighlighted",b,a);this.N();a=this.highlightedChanged;null!==a&&a(this)}}}, isShadowed:{get:function(){return 0!==(this.G&8192)},set:function(a){var b=0!==(this.G&8192);b!==a&&(this.G^=8192,this.Uc=!0,this.g("isShadowed",b,a),this.N())}},isAnimated:{get:function(){return 0!==(this.G&262144)},set:function(a){var b=0!==(this.G&262144);b!==a&&(this.G^=262144,this.g("isAnimated",b,a))}},highlightedChanged:{get:function(){return null!==this.P?this.P.oq:null},set:function(a){var b=this.highlightedChanged; b!==a&&(Qo(this),this.P.oq=a,this.g("highlightedChanged",b,a))}},selectionObjectName:{get:function(){return null!==this.P?this.P.vr:""},set:function(a){var b=this.selectionObjectName;b!==a&&(Qo(this),this.P.vr=a,this.Ug=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{get:function(){return null!==this.P?this.P.tr:null},set:function(a){var b=this.selectionAdornmentTemplate;b!==a&&(Qo(this),this.P.tr=a,this.g("selectionAdornmentTemplate", b,a))}},selectionObject:{get:function(){if(null===this.Ug){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.fb(a),null!==a?this.Ug=a:this.Ug=this):this instanceof T?(a=this.path,null!==a?this.Ug=a:this.Ug=this):this.Ug=this}return this.Ug}},selectionChanged:{get:function(){return null!==this.P?this.P.ur:null},set:function(a){var b=this.selectionChanged;b!==a&&(Qo(this),this.P.ur=a,this.g("selectionChanged",b,a))}},resizeAdornmentTemplate:{ get:function(){return null!==this.P?this.P.fr:null},set:function(a){var b=this.resizeAdornmentTemplate;b!==a&&(Qo(this),this.P.fr=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{get:function(){return null!==this.P?this.P.hr:""},set:function(a){var b=this.resizeObjectName;b!==a&&(Qo(this),this.P.hr=a,this.g("resizeObjectName",b,a))}},resizeObject:{get:function(){var a=this.resizeObjectName;return""!==a&&(a=this.fb(a), null!==a)?a:this}},resizeCellSize:{get:function(){return null!==this.P?this.P.gr:Lb},set:function(a){var b=this.resizeCellSize;b.D(a)||(a=a.J(),Qo(this),this.P.gr=a,this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{get:function(){return null!==this.P?this.P.ir:null},set:function(a){var b=this.rotateAdornmentTemplate;b!==a&&(Qo(this),this.P.ir=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{ get:function(){return null!==this.P?this.P.jr:""},set:function(a){var b=this.rotateObjectName;b!==a&&(Qo(this),this.P.jr=a,this.g("rotateObjectName",b,a))}},rotateObject:{get:function(){var a=this.rotateObjectName;return""!==a&&(a=this.fb(a),null!==a)?a:this}},rotationSpot:{get:function(){return null!==this.P?this.P.lr:Sc},set:function(a){var b=this.rotationSpot;b.D(a)||(a=a.J(),Qo(this),this.P.lr=a,this.g("rotationSpot",b,a))}},text:{ get:function(){return this.ec},set:function(a){var b=this.ec;b!==a&&(this.ec=a,this.g("text",b,a))}},containingGroup:{get:function(){return this.Ah},set:function(a){if(this.Zc()){var b=this.Ah;if(b!==a){null===a||this!==a&&!a.Td(this)||(this===a&&C("Cannot make a Group a member of itself: "+this.toString()),C("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.C(2);var c=this.diagram;null!==b?dp(b,this): this instanceof pf&&null!==c&&c.ai.remove(this);this.Ah=a;null!==a?cp(a,this):this instanceof pf&&null!==c&&c.ai.add(this);this.C(1);if(null!==c&&c.aa){var d=this.data,e=c.model;if(null!==d&&e.Xj()){var f=e.wa(null!==a?a.data:null);e.mp(d,f)}}d=this.containingGroupChanged;null!==d&&(e=!0,null!==c&&(e=c.aa,c.aa=!0),d(this,b,a),null!==c&&(c.aa=e));if(this instanceof pf)for(c=new H,Tk(c,this,!0,0,!0),c=c.iterator;c.next();)if(d=c.value,d instanceof V)for(d=d.linksConnected;d.next();)ip(d.value);if(this instanceof V){for(c=this.linksConnected;c.next();)ip(c.value);c=this.labeledLink;null!==c&&ip(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&ki(b,-1,a))}}else C("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{get:function(){return null!==this.P?this.P.Kp:null},set:function(a){var b=this.containingGroupChanged;b!==a&&(Qo(this),this.P.Kp=a,this.g("containingGroupChanged",b,a))}},isTopLevel:{get:function(){return null!== this.containingGroup||this instanceof V&&null!==this.labeledLink?!1:!0}},layoutConditions:{get:function(){return null!==this.P?this.P.Cq:127},set:function(a){var b=this.layoutConditions;b!==a&&(Qo(this),this.P.Cq=a,this.g("layoutConditions",b,a))}},dragComputation:{get:function(){return null!==this.P?this.P.Up:null},set:function(a){var b=this.dragComputation;b!==a&&(Qo(this),this.P.Up=a,this.g("dragComputation",b,a))}},shadowOffset:{ get:function(){return null!==this.P?this.P.zr:sb},set:function(a){var b=this.shadowOffset;b.D(a)||(a=a.J(),Qo(this),this.P.zr=a,this.N(),this.g("shadowOffset",b,a))}},shadowColor:{get:function(){return null!==this.P?this.P.yr:"gray"},set:function(a){var b=this.shadowColor;b!==a&&(Qo(this),this.P.yr=a,this.N(),this.g("shadowColor",b,a))}},shadowBlur:{get:function(){return null!==this.P?this.P.Vg:4},set:function(a){var b=this.shadowBlur; b!==a&&(Qo(this),this.P.Vg=a,this.N(),this.g("shadowBlur",b,a))}}});U.prototype.invalidateLayout=U.prototype.C;U.prototype.findCommonContainingGroup=U.prototype.px;U.prototype.isMemberOf=U.prototype.Td;U.prototype.findTopLevelPart=U.prototype.sz;U.prototype.findSubGraphLevel=U.prototype.oz;U.prototype.ensureBounds=U.prototype.Va;U.prototype.getDocumentBounds=U.prototype.mi;U.prototype.findObject=U.prototype.fb;U.prototype.moveTo=U.prototype.moveTo;U.prototype.invalidateAdornments=U.prototype.Wb; U.prototype.clearAdornments=U.prototype.Ej;U.prototype.removeAdornment=U.prototype.Jf;U.prototype.addAdornment=U.prototype.bh;U.prototype.findAdornment=U.prototype.Pj;U.prototype.updateTargetBindings=U.prototype.La;var ap=!1;U.className="Part";U.LayoutNone=0;U.LayoutAdded=1;U.LayoutRemoved=2;U.LayoutShown=4;U.LayoutHidden=8;U.LayoutNodeSized=16;U.LayoutGroupLayout=32;U.LayoutNodeReplaced=64;U.LayoutStandard=127;U.LayoutAll=16777215; function te(a,b){void 0===a||a instanceof Yl||"string"===typeof a?U.call(this,a):(U.call(this),a&&(b=a));this.G&=-257;this.Jg="Adornment";this.ue=null;this.Aw=0;this.Uw=!1;this.j=this.$a=null;b&&Object.assign(this,b)}la(te,U);te.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};te.prototype.updateRelationshipsFromData=function(){}; te.prototype.Ul=function(a){var b=this.adornedObject,c=null===b||void 0===b?void 0:b.part;if(c instanceof T&&b instanceof Bf){b=c.path;c.Ul(a);a=b.geometry;c=this.O.s;b=c.length;for(var d=0;da&&(a=1);var b=this.diagram;if(null!==b&&!b.Ue){b.Ue=!0;var c=new H;c.add(this);vp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===yi);b.Ue=!1}};function vp(a,b,c,d,e,f,g){if(1a&&(a=2);var b=this.diagram;if(null!==b&&!b.Ue){b.Ue=!0;var c=new H;c.add(this);xp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===yi);b.Ue=!1}}; function xp(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.Mo():a.Sd(),l={};k.next();){var m=k.value;if(m.isTreeLink&&(h||m.fd||m.bb(),m=m.To(a),null!==m&&m!==a&&!b.contains(m))){b.add(m);if(!h){m.Zb(!0);m.oh();var n=c?m.Oo():m.Po();l.vv=a;n.all(function(a){return function(b){return b===a.vv||!b.isTreeExpanded}}(l))&&e.Cj(m,f)}if(2e&&(e=h.right);h.bottom>f&&(f=h.bottom)}}isFinite(c)&&isFinite(d)?a.h(c,d,e-c,f-d):(b=b.location, a.h(b.x,b.y,0,0));return a};ma.Object.defineProperties(ig.prototype,{padding:{get:function(){return this.yb},set:function(a){"number"===typeof a&&(a=new dc(a));var b=this.yb;b.D(a)||(this.yb=a=a.J(),this.g("padding",b,a),this.v())}}});ig.className="Placeholder"; function T(a){U.call(this,W.Link);this.Qa=8;this.ef=null;this.ff="";this.uf=this.gn=null;this.vf="";this.uo=null;this.qk=Zf;this.Om=0;this.Qm=Zf;this.Rm=NaN;this.qj=Cp;this.po=.5;this.wd=null;this.Nb=(new F).freeze();this.Tg=this.Mg=null;this.ml=new N;this.ua=new P;this.u=this.o=this.Sf=this.Wf=null;this.su=new J;this.cq=this.Mw=this.Lw=null;this.vt=NaN;this.ba=null;this.j=[];a&&Object.assign(this,a)}la(T,U); T.prototype.cloneProtected=function(a){U.prototype.cloneProtected.call(this,a);a.Qa=this.Qa&-113;a.ff=this.ff;a.gn=this.gn;a.vf=this.vf;a.uo=this.uo;a.qk=this.qk;a.Om=this.Om;a.Qm=this.Qm;a.Rm=this.Rm;a.qj=this.qj;a.po=this.po;null!==this.ba&&(a.ba=this.ba.copy())};t=T.prototype;t.Af=function(a){U.prototype.Af.call(this,a);this.ff=a.ff;this.vf=a.vf;a.Mg=null;a.bb();a.Sf=this.Sf;var b=a.fromPort;null!==b&&op(b);a=a.toPort;null!==a&&op(a)}; t.qb=function(a){a.classType===T?2===(a.value&2)?this.routing=a:a===bg||a===Yf||a===Xf?this.curve=a:a===Dp||a===Ep||a===Fp?this.adjusting=a:a!==Cp&&a!==Zf&&C("Unknown Link enum value for a Link property: "+a):U.prototype.qb.call(this,a)};t.Xc=function(){null===this.ba&&(this.ba=new el)};t.si=function(){var a=this.fromNode;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(vj(a)||wj(a))return!1}a=this.toNode;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),vj(a)||wj(a))?!1:!0};t.zv=function(){return!1}; t.Av=function(){};t.Zc=function(){return!1};T.prototype.computeAngle=function(a,b,c){return T.computeAngle(b,c)};T.computeAngle=function(a,b){switch(a){default:case Zf:a=0;break;case hn:a=b;break;case $m:a=b+90;break;case bn:a=b-90;break;case Gp:a=b+180;break;case jn:a=K.bp(b);90a&&(a-=180);break;case an:a=K.bp(b+90);90a&&(a-=180);break;case cn:a=K.bp(b-90);90a&&(a-=180);break;case dn:a=K.bp(b);if(45a||225a)return 0;90a&&(a-=180)}return K.bp(a)}; function ip(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.px(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.Ah;if(c!==b){null!==c&&dp(c,a);a.Ah=b;null!==b&&cp(b,a);var e=a.containingGroupChanged;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.aa,g.aa=!0);e(a,c,b);null!==g&&(g.aa=f)}!a.fd||a.Lw!==c&&a.Mw!==c||a.bb()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=T.prototype; t.oh=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&U.prototype.oh.call(this)};t.To=function(a){var b=this.fromNode;return a===b?this.toNode:b};t.Cz=function(a){var b=this.fromPort;return a===b?this.toPort:b};function sp(a,b){null===a.wd&&(a.wd=new H);a.wd.add(b);a.v()} t.Vo=function(a){U.prototype.Vo.call(this,a);Hp(this)&&this.Xo(this.actualBounds);if(!a){a=this.ef;var b=null;null!==a&&(b=this.fromPort,qp(a,this,b));var c=this.uf;if(null!==c){var d=this.toPort;c===a&&d===b||qp(c,this,d)}Ip(this)}};t.Wo=function(a){U.prototype.Wo.call(this,a);Hp(this)&&this.Xo(this.actualBounds);if(!a){a=this.ef;var b=null;null!==a&&(b=this.fromPort,rp(a,this,b));var c=this.uf;if(null!==c){var d=this.toPort;c===a&&d===b||rp(c,this,d)}Jp(this)}}; t.Lj=function(){this.fd=!0;if(null!==this.wd){var a=this.diagram;if(null!==a)for(var b=this.wd.copy().iterator;b.next();)a.remove(b.value)}null!==this.data&&(a=this.diagram,null!==a&&a.partManager.removeDataForLink(this))};T.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var a=this.diagram;null!==a&&a.partManager.updateRelationshipsFromData(this)}}; T.prototype.move=function(a,b){var c=b?this.location:this.position,d=c.x;isNaN(d)&&(d=0);var e=c.y;isNaN(e)&&(e=0);d=a.x-d;e=a.y-e;!0===b?U.prototype.move.call(this,a,!1):(a=J.allocAt(c.x+d,c.y+e),U.prototype.move.call(this,a,!1),J.free(a));bf(this,d,e);for(a=this.labelNodes;a.next();)b=a.value,c=b.position,b.moveTo(c.x+d,c.y+e)}; T.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRelink)return!1;a=a.diagram;return null===a||a.allowRelink?!0:!1};T.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRelink)return!1;a=a.diagram;return null===a||a.allowRelink?!0:!1}; T.prototype.computeMidPoint=function(a){var b=this.pointsCount;if(0===b)return a.assign(tb),a;if(1===b)return a.assign(this.i(0)),a;if(2===b){var c=this.i(0),d=this.i(1);a.h((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===bg))return this.ua.Pu(.5,a),a.add(this.i(0)),c=this.ua.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===bg){if(3===b){c=this.i(0);d=this.i(1);var e=this.i(2);K.ax(c.x,c.y,d.x,d.y,d.x,d.y,e.x,e.y,a); return a}d=(b-1)/3|0;c=3*(d/2|0);if(1===d%2){d=this.i(c);e=this.i(c+1);var f=this.i(c+2);c=this.i(c+3);K.ax(d.x,d.y,e.x,e.y,f.x,f.y,c.x,c.y,a)}else a.assign(this.i(c));return a}var g=this.flattenedLengths;c=this.flattenedTotalLength;for(e=f=d=0;dc/2)break;d+=e;f++}b=this.i(f);f=this.i(f+1);1>Math.abs(b.x-f.x)?b.y>f.y?a.h(b.x,b.y-(c/2-d)):a.h(b.x,b.y+(c/2-d)):1>Math.abs(b.y-f.y)?b.x>f.x?a.h(b.x-(c/2-d),b.y):a.h(b.x+(c/2-d),b.y):(c=(c/2-d)/e,a.h(b.x+c*(f.x-b.x),b.y+c*(f.y- b.y)));return a}; T.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(2===a)return this.i(0).ab(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===bg))return this.ua.wx(.5);if(this.computeCurve()===bg&&4<=a){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){c=Math.floor(c);a=this.i(c);b=this.i(c+1);var d=this.i(c+2);c=this.i(c+3);return K.My(a.x,a.y,b.x,b.y,d.x,d.y,c.x,c.y)}if(0d/2)break;e+=f;c++}b=this.i(c);d=this.i(c+1);if(1>Math.abs(b.x-d.x)&&1>Math.abs(b.y-d.y)){if(0Math.abs(b.x-d.x))return b.y>d.y?270:90;if(1>Math.abs(b.y-d.y))return b.x>d.x?180:0}return b.ab(d)};t=T.prototype;t.i=function(a){return this.Nb.s[a]};t.dd=function(a,b){this.Nb.cd(a,b)};t.L=function(a,b,c){this.Nb.cd(a,new J(b,c))};t.Kz=function(a,b){this.Nb.Gb(a,b)}; t.m=function(a,b,c){this.Nb.Gb(a,new J(b,c))};t.ne=function(a){this.Nb.add(a)};t.yf=function(a,b){this.Nb.add(new J(a,b))};t.pv=function(a){this.Nb.mb(a)};t.Fj=function(){this.Nb.clear()}; function bf(a,b,c){if(0!==b||0!==c)if(0===a.pointsCount)a.defaultFromPoint&&a.defaultFromPoint.offset(b,c),a.defaultToPoint&&a.defaultToPoint.offset(b,c);else{for(var d=a.fd,e=new F,f=a.Nb.iterator;f.next();){var g=f.value;e.add((new J(g.x+b,g.y+c)).freeze())}e.freeze();f=a.Nb;a.Nb=e;g=a.diagram;isNaN(b)||isNaN(c)||null!==g&&g.animationManager.zb?a.v():(a.ke.h(a.ke.x+b,a.ke.y+c),a.pa.h(a.pa.x+b,a.pa.y+c),Ml(a));d?Kp(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint= a.i(a.pointsCount-1)));null!==g&&g.animationManager.zb&&Nh(g.animationManager,a,e);a.g("points",f,e)}}t.uh=function(){null===this.Mg&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())}; t.zf=function(){if(null!==this.Mg){for(var a=this.Mg,b=this.Nb,c=Infinity,d=Infinity,e=a.s,f=e.length,g=0;gl&&(n=-n),u= (0>k?-1:1)*n+q,w=m*(u-q)+r);q=f.x+2*h/3;r=f.y+2*k/3;var v=q,y=r;K.B(k,0)?y=0k?-1:1)*n+q,y=m*(v-q)+r);this.Fj();this.ne(f);this.yf(u,w);this.yf(v,y);this.ne(p);this.dd(0,this.getLinkPoint(a,b,g,!0,!1,d,e));this.dd(3,this.getLinkPoint(d,e,c,!1,!1,a,b))}else if(f=d,p=e,d=this.getLinkPoint(a,b,g,!0,!1,f,p),e=this.getLinkPoint(f,p,c,!1,!1,a,b),this.hasCurviness())p=e.x-d.x,c=e.y-d.y,g=this.computeCurviness(),a=d.x+p/2,b=d.y+c/2,f=a,h=b,K.B(c,0)?h=0g&&(f=-f),f=(0>c?-1:1)*f+a,h=p*(f-a)+b),this.ne(d),this.yf(f,h),this.ne(e);else{this.ne(d);this.ne(e);h=N.alloc();b.mi(h);k=h.ca(e);p.mi(h);l=h.ca(d);if(k||l)g=b.ga(Pp(g),new J),this.dd(0,this.getLinkPointFromPoint(a,b,g,e,!0,g)),c=p.ga(Pp(c),new J),this.dd(1,this.getLinkPointFromPoint(f,p,c,d,!1,c));N.free(h)}}else{n=this.isAvoiding;p&&(m&&n||l)&&this.Fj();var z=l?this.computeCurviness():0;n=this.getLinkPoint(a,b,g,!0,m,d,e);q=u=r=0;if(m||!h||l)w=this.computeEndSegmentLength(a,b,g,!0),q= this.getLinkDirection(a,b,n,g,!0,m,d,e),l&&(h||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(q-=m?90:30,0>z&&(q-=180)),0>q?q+=360:360<=q&&(q-=360),l&&(w+=Math.abs(z)*(m?1:2)),0===q?r=w:90===q?u=w:180===q?r=-w:270===q?u=-w:(r=w*Math.cos(q*Math.PI/180),u=w*Math.sin(q*Math.PI/180)),g.Mc()&&l&&(w=b.ga(wc,J.alloc()),v=J.allocAt(w.x+1E3*r,w.y+1E3*u),this.getLinkPointFromPoint(a,b,w,v,!0,n),J.free(w),J.free(v));w=this.getLinkPoint(d,e,c,!1,m,a,b);var A=y=v=0;if(m||!k||l){var B=this.computeEndSegmentLength(d,e, c,!1);A=this.getLinkDirection(d,e,w,c,!1,m,a,b);l&&(k||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(A+=m?0:30,0>z&&(A+=180));0>A?A+=360:360<=A&&(A-=360);l&&(B+=Math.abs(z)*(m?1:2));0===A?v=B:90===A?y=B:180===A?v=-B:270===A?y=-B:(v=B*Math.cos(A*Math.PI/180),y=B*Math.sin(A*Math.PI/180));c.Mc()&&l&&(c=e.ga(wc,J.alloc()),g=J.allocAt(c.x+1E3*v,c.y+1E3*y),this.getLinkPointFromPoint(d,e,c,g,!1,w),J.free(c),J.free(g))}c=n;if(m||!h||l)c=new J(n.x+r,n.y+u);g=w;if(m||!k||l)g=new J(w.x+v,w.y+y);!p&&!m&&h&&3Math.abs(b.y-a.y)?(b.x>=a.x?b.x=a.x+9E9:b.x=a.x-9E9,b.y=a.y):(b.y>=a.y?b.y=a.y+9E9:b.y=a.y-9E9,b.x=a.x);return b} T.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new J);if(null===a||null===b)return f.assign(c),f;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));a=null;e=b.panel;null===e||e.se()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.oe;e=1/(a.m11*a.m22-a.m12*a.m21);g=a.m22*e;var h=-a.m12*e,k=-a.m21*e,l=a.m11*e,m=e*(a.m21*a.dy-a.m22*a.dx),n=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*g+d.y*k+m;d=d.x*h+d.y*l+n;g=c.x*g+c.y*k+m;c=c.x*h+c.y*l+n}b.Sj(e,d,g,c,f);null!== a&&f.transform(a);return f};function Rp(a,b){var c=b.Zn;null===c&&(c=new Sp,c.port=b,c.node=b.part,b.Zn=c);return Tp(c,a)} T.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new J);if(c.sb()&&!Op(c))return b.ga(c,h),h;if(c.$c()){var k=Rp(this,b);if(null!==k){h.assign(k.Zo);if(e&&this.routing===Up){var l=Rp(this,g);if(null!==l&&k.Gl=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.Hf(Cc)||c.Hf(Fc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);J.free(k);J.free(l)}}return h}}c= b.ga(Pp(c),J.alloc());this.pointsCount>(e?6:2)?(g=d?this.i(1):this.i(this.pointsCount-2),e&&(g=Qp(c,g.copy()))):(k=this.computeSpot(!d,g),f=J.alloc(),g=g.ga(Pp(k),f),e&&(g=Qp(c,g)),J.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);J.free(c);return h}; T.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.sb())var k=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5(f?6:2)?(h=e?this.i(1):this.i(this.pointsCount-2),h=f?Qp(k,h.copy()):c):(c=J.alloc(),h=h.ga(wc,c),J.free(c));c=Math.abs(h.x-k.x)>Math.abs(h.y-k.y)?h.x>= k.x?0:180:h.y>=k.y?90:270;J.free(k);k=c}d.Mc()&&g.Td(a)&&(k+=180,360<=k&&(k-=360));if(Op(d))return k;a=b.li();if(0===a)return k;45<=a&&135>a?k+=90:135<=a&&225>a?k+=180:225<=a&&315>a&&(k+=270);360<=k&&(k-=360);return k};T.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.$c()&&(a=Rp(this,b),null!==a))return a.Ju;a=d?this.fromEndSegmentLength:this.toEndSegmentLength;null!==b&&isNaN(a)&&(a=d?b.fromEndSegmentLength:b.toEndSegmentLength);isNaN(a)&&(a=10);return a}; T.prototype.computeSpot=function(a,b){void 0===b&&(b=null);a?(a=b?b:this.fromPort,null===a?a=wc:(b=this.fromSpot,b.Xb()&&(b=a.fromSpot),a=b===Sc?rc:b)):(a=b?b:this.toPort,null===a?a=wc:(b=this.toSpot,b.Xb()&&(b=a.toSpot),a=b===Sc?rc:b));return a};function Op(a){return a===rc||.5===a.x&&.5===a.y}function Pp(a){return.5===a.x&&.5===a.y?a:wc} T.prototype.computeOtherPoint=function(a,b){if(this.computeAdjusting()!==Zf&&4p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=ld.alloc();n.set(g); if(m instanceof W)h=m.Cf(a,b,c,d,e,n);else if(this.path===m){if(m instanceof Bf)if(h=a,p=d,!1===m.pickable)h=!1;else if(n.multiply(m.transform),p)b:{var q=h,r=n;if(m.fh(q,r))h=!0;else{if(void 0===r&&(r=m.transform,q.Re(m.actualBounds))){h=!0;break b}h=q.left;p=q.right;var u=q.top;q=q.bottom;var w=J.alloc(),v=J.alloc(),y=J.alloc(),z=ld.alloc();z.set(r);z.bv(m.transform);z.Vj();v.x=p;v.y=u;v.transform(z);w.x=h;w.y=u;w.transform(z);r=!1;Zn(m,w,v,y)?r=!0:(w.x=p,w.y=q,w.transform(z),Zn(m,w,v,y)?r=!0:(v.x= h,v.y=q,v.transform(z),Zn(m,w,v,y)?r=!0:(w.x=h,w.y=u,w.transform(z),Zn(m,w,v,y)&&(r=!0))));ld.free(z);J.free(w);J.free(v);J.free(y);h=r}}else h=m.fh(h,n)}else h=il(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));ld.free(n)}}}void 0===f&&ld.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&ld.free(g);return!1}; T.prototype.computeCurve=function(){if(null===this.Wf){var a=this.fromPort,b=this.isOrthogonal;this.Wf=null!==a&&a===this.toPort&&!b}return this.Wf?bg:this.curve};T.prototype.computeCorner=function(){if(this.curve===bg)return 0;var a=this.corner;if(isNaN(a)||0>a)a=10;return a}; T.prototype.findMidLabel=function(){for(var a=this.path,b=this.O.s,c=b.length,d=0;dk?-Math.PI/2:Math.PI/2;else m=Math.atan(k/Math.abs(h)),0>h&&(m=Math.PI-m);g=b.x;var n=b.y;h=d.x-g;var p=d.y-n;k=Math.sqrt(h*h+p*p);K.$(h,0)?p=0>p?-Math.PI/2:Math.PI/2:(p=Math.atan(p/Math.abs(h)),0>h&&(p=Math.PI-p));l= k/l;m=p-m;this.dd(a,b);for(a+=1;ak?-Math.PI/2:Math.PI/2:(k=Math.atan(k/Math.abs(h)),0>h&&(k=Math.PI-k)),h=k+m,b*=l,this.L(a,g+b*Math.cos(h),n+b*Math.sin(h)));this.dd(c,d)}}return!0;case Fp:f=this.i(a);n=this.i(c);if(!f.Xa(b)||!n.Xa(d)){e=f.x;f=f.y;g=n.x;n=n.y;l=(g-e)*(g-e)+(n-f)*(n-f);h=b.x;m=b.y;k=d.x;p=d.y;var q=1;if(0!==k-h){var r=(p-m)/(k-h);q=Math.sqrt(1+1/(r*r))}else r=9E9;this.dd(a,b);for(a+=1;ab?b+=360:360<=b&&(b-=360);0>d?d+=360:360<=d&&(d-=360);var g=d;b=315<=b||45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=315<=d||45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.actualBounds.copy(),k=f.actualBounds.copy();if(h.w()&&k.w()){h.Bc(Xp,Xp);k.Bc(Xp,Xp);h.Ye(a);k.Ye(c);var l=J.alloc(),m=J.alloc();if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&k.right>a.x)l.h(c.x,a.y),m.h(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x, a.y,c.x,c.y,!1),m.x=l.x,m.y=c.y):270===d&&c.ya.y?(l.x=a.xk.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.xk.top&&a.yh.bottom)180===d&&(k.ca(a)||h.ca(c))? l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l.h(Math.max((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y&&k.lefta.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,a.y,k.right,c.y,!1):a.x>k.left&&(270===d&&a.yk.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.left,m.x=l.x, m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.yh.bottom)0===d&&(k.ca(a)||h.ca(c))?l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x= c.x,m.y=l.y;if(l.y>h.top&&l.y=a.x||a.x>=k.left&&a.x<=c.x){if(90===d||270===d)l.h(Math.min((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y||180===d&&c.xa.y||0===d&&c.x>a.x&&k.bottom>a.y)l.h(a.x,c.y),m.h((a.x+c.x)/2,c.y),270===d?(l.y=this.computeMidOrthoPosition(a.x,a.y,c.x, c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.xa.x?(l.y=a.yk.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.bottom,m.x=c.x,m.y=l.y):90===d&&a.yk.left&&a.xh.right)270===d&&(k.ca(a)||h.ca(c))?l.x=this.computeMidOrthoPosition(a.x, a.y,c.x,c.y,!1):c.xa.x&&(270===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l.h(a.x,Math.max((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.xa.x&&k.top=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.x,a.y,c.x,k.bottom,!0):a.y>k.top&&(180===d&&a.xk.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.xh.right)90===d&&(k.ca(a)||h.ca(c))?l.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):c.xa.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l.h(a.x,Math.min((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x=$p&&(zk(q),h.Bc(q.Ho*q.Hx,q.Go*q.Ix),Yp(q,a,b,n,d,h,!1),k=Zp(q, n.x,n.y));if(!q.abort&&k<$p&&Zp(q,n.x,n.y)!==Bk){aq(this,q,n.x,n.y,d,!0,g);h=this.i(2);if(4>this.pointsCount)0===b||180===b?(h.x=a.x,h.y=n.y):(h.x=n.x,h.y=a.y),this.L(2,h.x,h.y),this.m(3,h.x,h.y);else if(g=this.i(3),0===b||180===b)K.B(h.x,g.x)?(h=0===b?Math.max(h.x,a.x):Math.min(h.x,a.x),this.L(2,h,a.y),this.L(3,h,g.y)):K.B(h.y,g.y)?(Math.abs(a.y-h.y)<=q.Go/2&&(this.L(2,h.x,a.y),this.L(3,g.x,a.y)),this.m(2,h.x,a.y)):this.L(2,a.x,h.y);else if(90===b||270===b)K.B(h.y,g.y)?(h=90===b?Math.max(h.y,a.y): Math.min(h.y,a.y),this.L(2,a.x,h),this.L(3,g.x,h)):K.B(h.x,g.x)?(Math.abs(a.x-h.x)<=q.Ho/2&&(this.L(2,a.x,h.y),this.L(3,a.x,g.y)),this.m(2,a.x,h.y)):this.L(2,h.x,a.y);null!==c&&(a=this.i(1),g=this.i(2),a.x!==g.x&&a.y!==g.y?0===b||180===b?this.m(2,a.x,g.y):this.m(2,g.x,a.y):0===b||180===b?this.m(2,e.x,c.y):this.m(2,c.x,e.y));null!==r&&(0===d||180===d?this.yf(f.x,r.y):this.yf(r.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.ne(l.copy()),this.ne(m.copy()));J.free(l);J.free(m)}}; T.prototype.computeMidOrthoPosition=function(a,b,c,d,e){var f=0;!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(f=this.computeCurviness());return e?(b+d)/2+f:(a+c)/2+f}; function Sj(a){if(null===a.diagram||!a.isAvoiding||!jk(a.diagram))return!1;var b=a.points.s,c=b.length;if(4>c)return!1;a=kk(a.diagram,!0,a.containingGroup,null);for(var d=1;dbq&&Zp(b,m,n)!==l-1&&(Zp(b,c-h,d)===l-1?(e=180,m=c-h,n=d):Zp(b,c+h,d)===l-1?(e=0,m=c+h,n=d):Zp(b,c,d-k)===l-1?(e=270,m=c,n=d-k):Zp(b,c,d+k)===l-1&&(e=90,m=c,n=d+k));for(;l>bq&&Zp(b,m,n)===l-1;)c=m,d=n,0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k,--l;if(f){if(l>bq)if(180===e||0===e)c=Math.floor(c/h)*h+h/2;else if(90===e||270===e)d=Math.floor(d/k)*k+k/2}else c=Math.floor(c/h)*h+h/2,d=Math.floor(d/ k)*k+k/2;l>bq&&(f=e,g=c,m=d,0===e?(f=90,m+=k):90===e?(f=180,g-=h):180===e?(f=270,m-=k):270===e&&(f=0,g+=h),Zp(b,g,m)===l-1?aq(a,b,g,m,f,!1,f):(g=c,m=d,0===e?(f=270,m-=k):90===e?(f=0,g+=h):180===e?(f=90,m+=k):270===e&&(f=180,g-=h),Zp(b,g,m)===l-1&&aq(a,b,g,m,f,!1,f)));a.yf(c,d)}T.prototype.ez=function(a){var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=yb(b,a,c.x,c.y,d.x,d.y),f=0,g=1;gthis.pointsCount?this.lk=!0:this.ua=this.makeGeometry();a=this.path;if(null!==a){a.ua=this.ua;for(var b=this.O.s,c=b.length,d=0;d=b&&(d=b-1),k=this.i(d),f.x=Math.min(k.x,f.x),f.y=Math.min(k.y,f.y);d=f.x;k=f.y}else{for(k=0;kw?r>q?(f.x=v-z,f.y=q-z,e.x=v+u,e.y=q+u):(f.x=v-z,f.y=q+z,e.x=v+u,e.y=q-u):r>q?(f.x=v+z,f.y=q-z,e.x=v-u,e.y=q+u):(f.x=v+z,f.y=q+z,e.x=v-u,e.y=q-u));K.$(w,v)&&K.$(q,r)&&(q>p?(y>v?(f.x=v-z,f.y=q-z,e.x=v+u):(f.x=v+z,f.y=q-z,e.x=v-u),e.y=q+u):(y>v?(f.x=v-z,f.y=q+z,e.x=v+u):(f.x=v+z,f.y=q+z,e.x=v-u),e.y=q-u));if(K.$(w,v)&&K.$(v,y)||K.$(p,q)&&K.$(q,r))w=.5*(w+y),p=.5*(p+r),f.x=w,f.y=p,e.x=w,e.y=p;1===n?(c.x=.5*(g.x+l.x),c.y=.5*(g.y+l.y)):2===n&&K.$(g.x,this.i(0).x)&&K.$(g.y,this.i(0).y)&& (c.x=.5*(g.x+l.x),c.y=.5*(g.y+l.y));xd(h,c.x-d,c.y-k,f.x-d,f.y-k,l.x-d,l.y-k);b.set(f);c.set(e);g=l}}l=g.x;g=g.y;m=this.i(this.pointsCount-1);0!==this.computeShortLength(!1)&&(m=cq(this,m.copy(),!1,pb));l=.5*(l+m.x);g=.5*(g+m.y);xd(h,e.x-d,e.y-k,l-d,g-k,m.x-d,m.y-k);J.free(b);J.free(c);J.free(f);J.free(e)}else for(c=3;c=b&&(c=b-1),e=this.i(c-1),g=this.i(c),c===b-1&&0!==this.computeShortLength(!1)&&(g=cq(this,g.copy(),!1,pb)),xd(h,f.x-d,f.y-k,e.x-d,e.y-k,g.x-d,g.y-k);else{f= J.alloc();f.assign(this.i(0));e=J.alloc();e.assign(f);g=this.computeCorner();n=1;for(l=0;n=b-1){if(!f.D(m))0!==this.computeShortLength(!1)&&(m=cq(this,m.copy(),!1,pb)),fq(this,h,-d,-k,f,m,c);else if(0===l)for(n=1;nf.x?A=p.x-r:A=p.x+r;v.y>p.y?y=p.y+z:y=p.y-z;v=J.allocAt(A,B);fq(this,h,n,w,f,v,u);J.free(v);yd(h,p.x+n,p.y+w,q+n,y+w);f.h(q,y)}else K.B(f.x,p.x)&&K.B(p.y,v.y)?(r=Math.min(g,Math.abs(p.y-e.y)/2),r=z=Math.min(r,Math.abs(v.x-p.x)/2),K.B(z,0)?(fq(this,h,n,w,f,p,u),f.assign(p)):(A=p.x,B=p.y,q=A,y=B,p.y>f.y?B=p.y-r:B=p.y+r,v.x>p.x?q=p.x+z:q=p.x-z,v=J.allocAt(A,B),fq(this,h,n,w,f,v,u),J.free(v),yd(h,p.x+n,p.y+w,q+n,y+w),f.h(q,y))):(fq(this,h,n,w,f, p,u),f.assign(p));e.assign(m);n=l}J.free(f)}Bd=h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=cq(this,e,!0,f)),0!==this.computeShortLength(!1)&&(h=cq(this,h,!1,f)),a.type=P.j,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.lk=!0;return a};function eq(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return K.$(a,0)?b:K.$(b,0)?a:Math.sqrt(a*a+b*b)} function cq(a,b,c,d){var e=a.pointsCount;if(2>e)return b;if(c){var f=a.i(1);c=f.x-d.x;f=f.y-d.y;d=eq(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!0);a>e&&(a=e);e=a*(f-b.y)/d;b.x+=a*(c-b.x)/d;b.y+=e}else{f=a.i(e-2);c=f.x-d.x;f=f.y-d.y;d=eq(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!1);a>e&&(a=e);e=a*(b.y-f)/d;b.x-=a*(b.x-c)/d;b.y-=e}return b} function dq(a,b,c,d){for(var e=a.pointsCount,f=b;K.$(b.x,f.x)&&K.$(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!K.$(b.x,f.x)&&!K.$(b.y,f.y))return c-1;for(var g=f;K.$(b.x,f.x)&&K.$(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||K.$(b.y,f.y)&&K.$(f.y,g.y)&&(!d||(b.x>=f.x?f.x>=g.x:f.x<=g.x));){if(c>=e)return e-1;g=a.i(c++)}return c-2}T.prototype.computeJumpLength=function(){return 10}; function fq(a,b,c,d,e,f,g){if(!g&&Hp(a)){g=a.computeJumpLength();var h=g/2,k=[],l=0;a.isVisible()&&(l=gq(a,e,f,k));if(0n-g)l--,n=Math.max(m-h,f.x);else break;m=f.y-g+d;n+=c;q=f.y+d;a.curve===Yf?wd(b,n,q,!1):xd(b,p,m,n,m,n,q)}else if(K.B(e.x,f.x))if(e.ym-g)l--,m=Math.max(n-h,f.y);else break;n=f.x-g+c;q=f.x+c;m+=d;a.curve===Yf?wd(b,q,m,!1):xd(b,n,p,n,m,q,m)}}b.lineTo(f.x+c,f.y+d)} function gq(a,b,c,d){var e=a.diagram;if(null===e||b.D(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!==f&&f.visible){f=f.Pa.s;for(var g=f.length,h=0;hg.x&&m.x>=l.x||l.xg.y&&m.y>=l.y||l.yr&&Math.min(g,w)n&&!K.B(g,w)){h.x=r;h.y=n;m=!0;break a}}else if(!K.B(n,q)&& K.B(g,w)&&Math.min(n,q)g&&Math.min(r,u)m&&!K.B(r,u)){h.x=m;h.y=g;m=!0;break a}h.x=0;h.y=0;m=!1}m&&(e?c.push(h.x):c.push(h.y));g=l}J.free(h)}function Hp(a){a=a.curve;return a===Xf||a===Yf}function Lp(a,b){if(b||Hp(a))b=a.diagram,null===b||b.animationManager.isTicking||b.Eh.contains(a)||0===a.ml.width&&0===a.ml.height||b.Eh.add(a,a.ml.copy())} T.prototype.Xo=function(a){var b=this.layer;if(null!==b&&b.visible&&!b.isTemporary){var c=b.diagram;if(null!==c&&!c.animationManager.isTicking){var d=!1;for(c=c.layers;c.next();){var e=c.value;if(e.visible)if(e===b){d=!0;var f=!1;e=e.Pa.s;for(var g=e.length,h=0;ha&&xa(a,">= 0",T,"fromEndSegmentLength"),this.Xc(), this.ba.Vi=a,this.g("fromEndSegmentLength",b,a),this.bb())}},fromShortLength:{get:function(){return null!==this.ba?this.ba.Wi:NaN},set:function(a){var b=this.fromShortLength;b!==a&&(this.Xc(),this.ba.Wi=a,this.qc(),this.g("fromShortLength",b,a))}},toSpot:{get:function(){return null!==this.ba?this.ba.yj:Sc},set:function(a){var b=this.toSpot;b.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",b,a),(b.$c()||a.$c())&&null!==this.toNode&& op(this.toPort),this.bb())}},toEndSegmentLength:{get:function(){return null!==this.ba?this.ba.wj:NaN},set:function(a){var b=this.toEndSegmentLength;b!==a&&(0>a&&xa(a,">= 0",T,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",b,a),this.bb())}},toShortLength:{get:function(){return null!==this.ba?this.ba.xj:NaN},set:function(a){var b=this.toShortLength;b!==a&&(this.Xc(),this.ba.xj=a,this.qc(),this.g("toShortLength",b, a))}},isLabeledLink:{get:function(){return null===this.wd?!1:0=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);K.Dl(e.x,e.y,g.x,g.y,h.x,h.y,k.x,k.y,.5,a);b=Math.min(k.x,b);c=Math.min(k.y,c);e=k}else for(e=this.i(0),f=this.i(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y),a.h(e.x,e.y,0,0),a.Ye(f),e=2;ed&&(d=-d)):K.$(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.Bf(e)); a.push(d)}}return this.cq}},flattenedTotalLength:{get:function(){var a=this.vt;if(isNaN(a)){for(var b=this.flattenedLengths,c=b.length,d=a=0;dthis.pointsCount)return this.lk=!0,this.ua;this.ua=this.makeGeometry()}return this.ua}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!Op(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return 0=== a?0:2>=a?a-1:this.isOrthogonal||!Op(this.computeSpot(!1))?a-2:a-1}},adjusting:{get:function(){return this.qk},set:function(a){var b=this.qk;b!==a&&(this.qk=a,this.g("adjusting",b,a))}},corner:{get:function(){return this.Om},set:function(a){var b=this.Om;b!==a&&(this.Om=a,this.qc(),this.g("corner",b,a))}},curve:{get:function(){return this.Qm},set:function(a){var b=this.Qm;b!==a&&(this.Qm=a,this.bb(),this.qc(), Lp(this,b===Yf||b===Xf||a===Yf||a===Xf),this.g("curve",b,a))}},curviness:{get:function(){return this.Rm},set:function(a){var b=this.Rm;b!==a&&(this.Rm=a,this.bb(),this.qc(),this.g("curviness",b,a))}},routing:{get:function(){return this.qj},set:function(a){var b=this.qj;b!==a&&(this.qj=a,this.Wf=null,this.bb(),Lp(this,2===(b.value&2)||2===(a.value&2)),this.g("routing",b,a))}},smoothness:{get:function(){return this.po}, set:function(a){var b=this.po;b!==a&&(this.po=a,this.qc(),this.g("smoothness",b,a))}},key:{get:function(){var a=this.diagram;if(null!==a&&a.model.ri())return a.model.Ac(this.data)}}});T.prototype.invalidateOtherJumpOvers=T.prototype.Xo;T.prototype.findClosestSegment=T.prototype.ez;T.prototype.updateRoute=T.prototype.vg;T.prototype.invalidateRoute=T.prototype.bb;T.prototype.rollbackRoute=T.prototype.rv;T.prototype.commitRoute=T.prototype.zf;T.prototype.startRoute=T.prototype.uh; T.prototype.clearPoints=T.prototype.Fj;T.prototype.removePoint=T.prototype.pv;T.prototype.addPointAt=T.prototype.yf;T.prototype.addPoint=T.prototype.ne;T.prototype.insertPointAt=T.prototype.m;T.prototype.insertPoint=T.prototype.Kz;T.prototype.setPointAt=T.prototype.L;T.prototype.setPoint=T.prototype.dd;T.prototype.getPoint=T.prototype.i;T.prototype.getOtherPort=T.prototype.Cz;T.prototype.getOtherNode=T.prototype.To; var Mp=null,Np=null,Cp=new E(T,"Normal",1),kq=new E(T,"Orthogonal",2),lq=new E(T,"AvoidsNodes",6),Up=new E(T,"AvoidsNodesStraight",7),Zf=new E(T,"None",0),bg=new E(T,"Bezier",9),Yf=new E(T,"JumpGap",10),Xf=new E(T,"JumpOver",11),Dp=new E(T,"End",17),Ep=new E(T,"Scale",18),Fp=new E(T,"Stretch",19),hn=new E(T,"OrientAlong",21),$m=new E(T,"OrientPlus90",22),bn=new E(T,"OrientMinus90",23),Gp=new E(T,"OrientOpposite",24),jn=new E(T,"OrientUpright",25),an=new E(T,"OrientPlus90Upright",26),cn=new E(T,"OrientMinus90Upright", 27),dn=new E(T,"OrientUpright45",28),Wp=16,Vp=14,Xp=8;T.className="Link";T.Normal=Cp;T.Orthogonal=kq;T.AvoidsNodes=lq;T.AvoidsNodesStraight=Up;T.None=Zf;T.Bezier=bg;T.JumpGap=Yf;T.JumpOver=Xf;T.End=Dp;T.Scale=Ep;T.Stretch=Fp;T.OrientAlong=hn;T.OrientPlus90=$m;T.OrientMinus90=bn;T.OrientOpposite=Gp;T.OrientUpright=jn;T.OrientPlus90Upright=an;T.OrientMinus90Upright=cn;T.OrientUpright45=dn;T.EndSegmentStep=8;T.CurvinessStart=Wp;T.SpacingMin=Vp;T.OrthoShortCut=Xp; function jq(a,b,c,d){Qa(this);this.Fe=this.qq=!1;this.Ds=a;this.Ox=b;this.cv=c;this.Px=d;this.links=[]}jq.prototype.Sl=function(){if(!this.qq){var a=this.links;0=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.Nd=Math.floor((a.x-this.rc)/this.rc)*this.rc;this.Od=Math.floor((b-this.sc)/this.sc)*this.sc;this.En=Math.ceil((c+2*this.rc)/this.rc)*this.rc;this.Fn=Math.ceil((d+2*this.sc)/this.sc)*this.sc;a=1+(Math.ceil((this.En-this.Nd)/this.rc)|0);b=1+(Math.ceil((this.Fn-this.Od)/this.sc)|0);if(null===this.ac||this.di=bq&&(c[d]=mq)} lk.prototype.Yj=function(a,b,c,d){if(a>this.En||a+cthis.Fn||b+da&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.di)|0;for(c=Math.min(b+e-1,this.ei)|0;a<=d;a++){e=this.ac[a];for(var f=b;f<=c;f++)if(e[f]===Bk)return!1}return!0}; function nq(a,b,c,d,e,f,g,h,k){if(!(bg||ck)){var l=b|0;var m=c|0;var n=a.ac[l][m];if(n>=bq&&n<$p)for(e?m+=d:l+=d,n+=1;f<=l&&l<=g&&h<=m&&m<=k&&!(n>=a.ac[l][m]);)a.ac[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0l;c+=d)nq(a,b,c,1,!e,f,g,h,k),nq(a,b,c,-1,!e,f,g,h,k);else if(0l;b+=d)nq(a,b,c,1,!e,f,g,h,k),nq(a,b,c,-1,!e,f,g,h, k)}}function oq(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=Bk,m=bq;for(a.ac[b][c]=m;l===Bk&&b>f&&bh&&cf&&bh&&c=Math.abs(h-l)&&1>=Math.abs(k-m))a.abort=!0;else{var n=f.x;d=f.y;b=f.x+f.width;var p=f.y+f.height;n-=a.Nd;n/=a.rc;d-=a.Od;d/=a.sc;b-=a.Nd;b/=a.rc;p-=a.Od;p/=a.sc;f=Math.max(0,Math.min(a.di,n|0));b=Math.min(a.di,Math.max(0,b|0));n=Math.max(0,Math.min(a.ei,d|0));p=Math.min(a.ei,Math.max(0,p|0));d=a.ac;h|=0;k|=0;l|=0;m|= 0;var q=0===c||90===c?1:-1;c=90===c||270===c;d[h][k]===Bk?(oq(a,h,k,q,c,f,b,n,p),oq(a,h,k,1,!c,f,b,n,p),oq(a,h,k,-1,!c,f,b,n,p)):oq(a,h,k,q,c,h,k,h,k);d[l][m]===Bk?(pq(a,l,m,0===e||90===e?1:-1,90===e||270===e,f,b,n,p),pq(a,l,m,1,!(90===e||270===e),f,b,n,p),pq(a,l,m,-1,!(90===e||270===e),f,b,n,p)):pq(a,l,m,q,c,l,m,l,m);c=Ea();if(g&&qq(a,l,m,e,h,k,c)){if(c[0]!==l||c[1]!==m)c.unshift(m),c.unshift(l);if(c[c.length-2]!==h||c[c.length-1]!==k)c.push(h),c.push(k);a=bq;e=c[c.length-2];g=c[c.length-1];d[e][g]= a++;for(f=c.length-4;0<=f;f-=2)for(e=c[f+2],g=c[f+3],b=c[f],l=c[f+1];b>e?e++:bg?g++:le)m--;else break;else if(n>f)n--;else break;var p=h[m][n];if(0===p||p===rq)break;k=m;l=n}for(;;){m=d;n=k;p=l;0===d?pf&&(m=270,p--):90===d?ne&&(m=180,n--):180===d?pf&&(m=270,p--):ne&&(m=180,n--);n=h[n][p];if(m!==d&&0!==n&&n!==rq){g.push(k);g.push(l);if(qq(a,k,l, m,e,f,g))return!0;g.pop();g.pop()}h[k][l]=rq;if(0===d){if(k===b)return!1;k--}else if(90===d){if(l===c)return!1;l--}else if(180===d){if(k===b)return!1;k++}else{if(l===c)return!1;l++}}} ma.Object.defineProperties(lk.prototype,{bounds:{get:function(){return new N(this.Nd,this.Od,this.En-this.Nd,this.Fn-this.Od)}},Ho:{get:function(){return this.rc},set:function(a){0=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case 3:return c>a&&c<=180+a?180:270;case 5:return c>180-a&&c<=360-a?270:0;case 12:return c>a&&c<=180+a?90:0;case 10:return c>180-a&&c<=360-a?180:90;case 7:return 90180+a&&c<=360-a?270:0;case 13:return 180a&&180>=c?90:0;case 14:return c> a&&c<=180-a?90:c>180-a&&270>=c?180:0;case 11:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&15!==b&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}Sp.prototype.Sl=function(){this.pe.length=0}; function Tp(a,b){var c=a.pe;if(0===c.length){a:if(!a.ap){c=a.ap;a.ap=!0;var d=null,e=a.node,f=e instanceof pf?e:null;if(null===f||f.isSubGraphExpanded)var g=e.isTreeExpanded?e.findLinksConnected(a.port.portId):e.qx();else{if(!f.actualBounds.w()){a.ap=c;break a}d=f;g=d.Lu()}f=a.pe.length=0;var h=a.port.ga(sc,J.alloc()),k=a.port.ga(Bc,J.alloc());e=N.allocAt(h.x,h.y,0,0);e.Ye(k);J.free(h);J.free(k);h=J.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.li();for(g=g.iterator;g.next();){var l=g.value;if(l.isVisible()&& l.fromPort!==l.toPort){var m=l.fromPort===a.port||null!==l.fromNode&&l.fromNode.Td(d),n=l.computeSpot(m,a.port);if(n.$c()&&(m=m?l.toPort:l.fromPort,null!==m)){var p=m.part;if(null!==p){var q=p.findVisibleNode();null!==q&&q!==p&&(p=q,m=p.port);m=l.computeOtherPoint(p,m);p=h.ab(m);p-=k;0>p?p+=360:360<=p&&(p-=360);n=sq(e,n,p,l.isOrthogonal);0===n?(n=4,180p&&(p+=360));q=a.pe[f];void 0===q?(q=new tq(l,p,n),a.pe[f]=q):(q.link=l,q.angle=p,q.Nc= n);q.hv.set(m);f++}}}}J.free(h);a.pe.sort(Sp.prototype.j);k=a.pe.length;d=-1;for(f=h=0;fMath.abs(u)?(y=Math.abs(u)/p,p=Math.abs(u)):y=1;break;case 2:q>Math.abs(z)?(y=Math.abs(z)/q,q=Math.abs(z)):y=1;break;case 1:n>Math.abs(u)?(y=Math.abs(u)/n,n=Math.abs(u)):y=1;break;default:case 4:m>Math.abs(z)?(y=Math.abs(z)/ m,m=Math.abs(z)):y=1}v=0}var D=A.Zo;if(d===zp){A=A.link.computeThickness();A*=y;D.set(B);switch(r){case 8:D.x=B.x+u/2+p/2-v-A/2;break;case 2:D.y=B.y+z/2+q/2-v-A/2;break;case 1:D.x=B.x+u/2-n/2+v+A/2;break;default:case 4:D.y=B.y+z/2-m/2+v+A/2}v+=A}else{var M=.5;d===kp&&(M=(A.Uo+1)/(A.Gl+1));D.x=B.x+u*M;D.y=B.y+z*M}}}J.free(h);J.free(k);J.free(g);J.free(l);B=a.pe;for(f=0;fb.Nc?1:a.angleb.angle?1:0}; Sp.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,rc,b.fromPort===this.port),d=a.Uo;if(0>d)return c;var e=a.Gl;if(1>=e||!b.isOrthogonal)return c;b=a.hv;var f=a.Zo;if(2===a.Nc||8===a.Nc)d=e-1-d;return((a=2===a.Nc||4===a.Nc)?b.y=b-1?(f=0,d=c,e+=g+20,g=0):f++}}; ti.prototype.doMinimalNetworkLayout=function(){var a=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var b=this.arrangementOrigin.x,c=b,d=this.arrangementOrigin.y,e=0,f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value.node;if(!(null===h||h instanceof T)&&(wq(h),this.rh(h))){var k=h.measuredBounds,l=k.width;k=k.height;h.moveTo(c,d);h instanceof pf&&(h.rh=!1);c+=Math.max(l,50)+20;f=Math.max(f,Math.max(k,50));e>=a-1?(e= 0,c=b,d+=f+20,f=0):e++}}};ti.prototype.rh=function(a){return!a.location.w()||a instanceof pf&&a.rh?!0:!1};function vq(a,b,c,d,e,f,g,h){for(c=c.iterator;c.next();){var k=c.value;d&&!k.isTopLevel||null!==e&&!e(k)||!k.canLayout()||(f&&k instanceof V?k.isLinkLabel||(k instanceof pf?null===k.layout?vq(a,b,k.memberParts,!1,e,f,g,h):(wq(k),b.add(k)):(wq(k),b.add(k))):g&&k instanceof T?b.add(k):!h||!k.Zc()||k instanceof V||(wq(k),b.add(k)))}} function wq(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.Va()}ti.prototype.ni=function(a,b){var c=this.boundsComputation;if(null!==c)return b||(b=new N),c(a,this,b);if(!b)return a.actualBounds;b.set(a.actualBounds);return b}; ti.prototype.ex=function(a){var b=new H;a instanceof Q?(vq(this,b,a.nodes,!0,null,!0,!0,!0),vq(this,b,a.links,!0,null,!0,!0,!0),vq(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof pf?vq(this,b,a.memberParts,!1,null,!0,!0,!0):vq(this,b,a.iterator,!1,null,!0,!0,!0);return b}; ti.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.ga(sc),(isNaN(c.x)||isNaN(c.y))&&c.set(a),a=b.padding,c.x+=a.left,c.y+=a.top);return c}return a}; ma.Object.defineProperties(ti.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},group:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a,null!==a&&(this.H=a.diagram))}},isOngoing:{get:function(){return this.sn},set:function(a){this.sn!==a&&(this.sn=a)}},isInitial:{get:function(){return this.Gh},set:function(a){this.Gh=a;a||(this.xn=!0)}}, isViewportSized:{get:function(){return this.yn},set:function(a){this.yn!==a&&(this.yn=a)&&this.C()}},isRouting:{get:function(){return this.vn},set:function(a){this.vn!==a&&(this.vn=a)}},isRealtime:{get:function(){return this.un},set:function(a){this.un!==a&&(this.un=a)}},isValidLayout:{get:function(){return this.xn},set:function(a){this.xn!==a&&(this.xn=a,a||(a=this.diagram,null!== a&&(a.xh=!0)))}},network:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,null!==a&&(a.layout=this))}},boundsComputation:{get:function(){return this.Em},set:function(a){this.Em!==a&&(this.Em=a,this.C())}},arrangementOrigin:{get:function(){return this.Am},set:function(a){this.Am.D(a)||(this.Am.assign(a),this.C())}}});ti.prototype.collectParts=ti.prototype.ex;ti.prototype.getLayoutBounds=ti.prototype.ni; ti.prototype.invalidateLayout=ti.prototype.C;ti.className="Layout";function uq(a){Qa(this);this.Sc=a;this.wf=new H;this.ye=new H;this.Es=new ob;this.zs=new ob}uq.prototype.clear=function(){if(this.wf)for(var a=this.wf.iterator;a.next();)a.value.clear();if(this.ye)for(a=this.ye.iterator;a.next();)a.value.clear();this.wf=new H;this.ye=new H;this.Es=new ob;this.zs=new ob}; uq.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.layout?"("+this.layout.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.wf.count+" edges: "+this.ye.count;if(1b?1:0):1:null!==b?-1:0} ma.Object.defineProperties(xq.prototype,{sourceEdgesArrayAccess:{get:function(){return this.tg._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.mg._dataArray}},data:{get:function(){return this.ub},set:function(a){this.ub=a;if(null!==a&&a.bounds){var b=a.bounds;a=b.x;var c=b.y,d=b.width;b=b.height;this.o.h(d/2,b/2);this.j.h(a,c,d,b)}}},node:{get:function(){return this.Sh}, set:function(a){if(this.Sh!==a){this.Sh=a;a.Va();var b=this.network.layout,c=N.alloc(),d=b.ni(a,c);b=d.x;var e=d.y,f=d.width;d=d.height;isNaN(b)&&(b=0);isNaN(e)&&(e=0);this.j.h(b,e,f,d);N.free(c);if(!(a instanceof pf)&&(a=a.locationObject.ga(wc),a.w())){this.o.h(a.x-b,a.y-e);return}this.o.h(f/2,d/2)}}},bounds:{get:function(){return this.j},set:function(a){this.j.D(a)||this.j.assign(a)}},focus:{get:function(){return this.o},set:function(a){this.o.D(a)|| this.o.assign(a)}},centerX:{get:function(){return this.j.x+this.o.x},set:function(a){var b=this.j;b.x+this.o.x!==a&&(b.ka(),b.x=a-this.o.x,b.freeze())}},centerY:{get:function(){return this.j.y+this.o.y},set:function(a){var b=this.j;b.y+this.o.y!==a&&(b.ka(),b.y=a-this.o.y,b.freeze())}},focusX:{get:function(){return this.o.x},set:function(a){var b=this.o;b.x!==a&&(b.ka(),b.x=a,b.freeze())}},focusY:{ get:function(){return this.o.y},set:function(a){var b=this.o;b.y!==a&&(b.ka(),b.y=a,b.freeze())}},x:{get:function(){return this.j.x},set:function(a){var b=this.j;b.x!==a&&(b.ka(),b.x=a,b.freeze())}},y:{get:function(){return this.j.y},set:function(a){var b=this.j;b.y!==a&&(b.ka(),b.y=a,b.freeze())}},width:{get:function(){return this.j.width},set:function(a){var b=this.j;b.width!==a&&(b.ka(),b.width= a,b.freeze())}},height:{get:function(){return this.j.height},set:function(a){var b=this.j;b.height!==a&&(b.ka(),b.height=a,b.freeze())}},network:{get:function(){return this.ob},set:function(a){this.ob=a}},sourceVertexes:{get:function(){for(var a=new H,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new H,b= this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new H,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);for(b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},sourceEdges:{get:function(){return this.tg.iterator}},destinationEdges:{get:function(){return this.mg.iterator}},edges:{get:function(){for(var a= new F,b=this.sourceEdges;b.next();)a.add(b.value);for(b=this.destinationEdges;b.next();)a.add(b.value);return a.iterator}},edgesCount:{get:function(){return this.tg.count+this.mg.count}}});xq.prototype.deleteDestinationEdge=xq.prototype.Jl;xq.prototype.addDestinationEdge=xq.prototype.zl;xq.prototype.deleteSourceEdge=xq.prototype.Kl;xq.prototype.addSourceEdge=xq.prototype.Cl;xq.className="LayoutVertex";xq.standardComparer=Eq; xq.smartComparer=function(a,b){if(null!==a){if(null!==b){a=a.Sh;var c=b.Sh;if(null!==a){if(null!==c){b=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);a=c.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);for(c=0;c=f&&0>=g&&(f=1);b=this.spacing.width;isFinite(b)||(b=0);c=this.spacing.height;isFinite(c)||(c=0);null!==a&&a.Ea("Layout");d=[];switch(this.alignment){case Nq:var h=b,k=c,l=N.alloc(),m=Math.max(this.cellSize.width,1);if(!isFinite(m))for(var n=m=0;nf-1||0g)d.push(new N(0,u,g+h,v)),w=0,r=q,u+=v,v=0;v=Math.max(v,D);switch(p){case Mq:A=-A.width;break;default:A= 0}z.moveTo(r+A,u);switch(p){case Mq:r-=B;break;default:r+=B}w++}d.push(new N(0,u,g+h,v));N.free(l);break;case Fq:k=g;m=f;n=b;p=c;g=N.alloc();q=Math.max(this.cellSize.width,1);f=u=l=0;h=J.alloc();for(r=0;r=l&&(k-=l);l=z=0;B=Math.max(this.cellSize.height,1);A=f=0;D=!0;w=J.alloc();for(M=0;Mm-1||0k){d.push(new N(0,D?y-f:y,k+n,A+f+p));for(S=0;Sl&&(f.width+=f.x-l,f.x=l);N.free(g)}for(h=f=g=e=0;hb?1:0} ma.Object.defineProperties(Ok.prototype,{wrappingWidth:{get:function(){return this.zo},set:function(a){this.zo!==a&&(0n)){var u=n+sn(r);r.pc(u,!0);Dn(r,u,n)}}b.isModified=!0}}finally{b.aa=!0}}}}};pi.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.La(a);for(b=this.nodes.iterator;b.next();)b.value.La(a);for(b=this.links.iterator;b.next();)b.value.La(a)}; pi.prototype.rp=function(){for(var a=this.H.model,b=new H,c=a.nodeDataArray,d=0;d=d)return"[]";var e=new Sa;e.add("[");c&&1d)return;Da(a.Tc,d)}zr(a,"nodeDataArray",fe,"nodeDataArray",a,b,null,d,null);a.qp(b)}t.nA=function(a){if(Aa(a))for(var b=a.length,c=0;cb&&(b=a.length);Ca(a,b,c);zr(this,"",ee,"",a,null,c,null,b)};t.ov=function(a,b){void 0===b&&(b=-1);a===this.Tc&&C("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];Da(a,b);zr(this,"",fe,"",a,c,null,b,null)}; t.Ro=function(a){if(null===a)return"";var b=this.lj;if(""===b)return"";b=En(a,b);if(void 0===b)return"";if("string"===typeof b)return b;C("getCategoryForNodeData found a non-string category for "+a+": "+b)};t.jm=function(a,b){if(null!==a){var c=this.lj;if(""!==c)if(this.lb(a)){var d=En(a,c);void 0===d&&(d="");d!==b&&(Uj(a,c,b),zr(this,"nodeCategory",ce,c,a,d,b))}else Uj(a,c,b)}};t.lm=function(a,b){this.jm(b,this.Ro(a))};t.Tl=function(){return!1};t.Wj=function(){return!1};t.ri=function(){return!1}; t.xs=function(){return!1};t.Xj=function(){return!1};function ri(){return new Z}function ur(a,b){if("function"===typeof b){if(b.className)return b.className;if(b.name)return b.name}else if("object"===typeof b&&null!==b&&b.constructor)return ur(a,b.constructor);return typeof b}function yr(a){return Cr[a]?Cr[a]:void 0!==x.go&&x.go[a]?x.go[a]:null} function En(a,b){if(!a||!b)return null;try{if("function"===typeof b)var c=b(a);else"function"===typeof a.getAttribute?(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){}return c}function Uj(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){}} ma.Object.defineProperties(Z.prototype,{name:{get:function(){return this.xa},set:function(a){var b=this.xa;b!==a&&(this.xa=a,this.g("name",b,a))}},dataFormat:{get:function(){return this.Sm},set:function(a){var b=this.Sm;b!==a&&(this.Sm=a,this.g("dataFormat",b,a))}},isReadOnly:{get:function(){return this.Gg},set:function(a){var b=this.Gg;b!==a&&(this.Gg=a,this.g("isReadOnly",b,a))}},modelData:{ get:function(){return this.j},set:function(a){var b=this.j;b!==a&&(this.j=a,this.g("modelData",b,a),this.La(a))}},undoManager:{get:function(){return this.o},set:function(a){var b=this.o;b!==a&&(null!==b&&b.Rx(this),this.o=a,null!==a&&a.Xw(this))}},skipsUndoManager:{get:function(){return this.Wg},set:function(a){this.Wg=a}},nodeKeyProperty:{get:function(){return this.Th},set:function(a){var b=this.Th; b!==a&&(""===a&&C("Model.nodeKeyProperty may not be the empty string"),0d.indexOf(a.newValue)&&d.splice(c,0,a.newValue));return}}else if(a.change===fe){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;za(a)&&"number"===typeof c&&(d=this.Ac(a),b?(this.$f.add(a),this.md[c]!==a&&this.md.splice(c,0,a),void 0!==d&&this.wb.add(d,a)):(this.$f.remove(a),this.md[c]=== a&&this.md.splice(c,1),void 0!==d&&this.wb.remove(d)));return}if("linkLabelKeys"===a.modelChange){d=this.Ef(a.object);Array.isArray(d)&&"number"===typeof c&&(b?0>d.indexOf(a.newValue)&&d.splice(c,0,a.newValue):(c=d.indexOf(a.newValue),0<=c&&d.splice(c,1)));return}}Z.prototype.changeState.call(this,a,b)}};t=Fr.prototype;t.Vl=function(a){if(void 0!==a){var b=this.Ri;if(null!==b){var c=this.hc(a);null===c&&(c=this.copyNodeData(b),Uj(c,this.nodeKeyProperty,a),this.xf(c))}return a}}; t.yx=function(a){return ar(this,a,!0)};t.wv=function(a,b){ir(this,a,b,!0)};t.Bx=function(a){return ar(this,a,!1)};t.Bv=function(a,b){ir(this,a,b,!1)};function ar(a,b,c){if(null!==b&&(a=c?a.lf:a.mf,""!==a&&(a=En(b,a),void 0!==a))){if(cr(a))return a;C((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}} function ir(a,b,c,d){null===c&&(c=void 0);if(null!==b){var e=d?a.lf:a.mf;if(""!==e)if(c=a.Vl(c),a.Jc(b)){var f=En(b,e);f!==c&&(gr(a,f,b),Uj(b,e,c),null===a.hc(c)&&hr(a,c,b),zr(a,d?"linkFromKey":"linkToKey",ce,e,b,f,c),"string"===typeof e&&a.La(b,e))}else Uj(b,e,c)}}t.zx=function(a){return $q(this,a,!0)};t.xv=function(a,b){jr(this,a,b,!0)};t.Cx=function(a){return $q(this,a,!1)};t.Cv=function(a,b){jr(this,a,b,!1)}; function $q(a,b,c){if(null===b)return"";a=c?a.ej:a.fj;if(""===a)return"";b=En(b,a);return void 0===b?"":b}function jr(a,b,c,d){if(null!==b){var e=d?a.ej:a.fj;if(""!==e)if(a.Jc(b)){var f=En(b,e);void 0===f&&(f="");f!==c&&(Uj(b,e,c),zr(a,d?"linkFromPortId":"linkToPortId",ce,e,b,f,c),"string"===typeof e&&a.La(b,e))}else Uj(b,e,c)}}t.Ef=function(a){if(null===a)return Ir;var b=this.je;if(""===b)return Ir;a=En(a,b);return void 0===a?Ir:a}; t.Ls=function(a,b){if(null!==a){var c=this.je;if(""!==c)if(this.Jc(a)){var d=En(a,c);void 0===d&&(d=Ir);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;fe||(d.splice(e,1),this.Jc(a)&&(gr(this,b,a),zr(this,"linkLabelKeys",fe,c,a,b,null,e,null)))}else void 0!==d&&C(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};t.Ac=function(a){if(null!==a){var b=this.Jh;if(""!==b&&(b=En(a,b),void 0!==b)){if(cr(b))return b;C("Key value for link data "+a+" is not a number or a string: "+b)}}}; t.Ks=function(a,b){if(null!==a){var c=this.Jh;if(""!==c)if(this.Jc(a)){var d=En(a,c);d!==b&&null===this.jh(b)&&(Uj(a,c,b),void 0!==d&&this.wb.remove(d),this.wb.add(b,a),zr(this,"linkKey",ce,c,a,d,b),"string"===typeof c&&this.La(a,c))}else Uj(a,c,b)}};t.jh=function(a){null===a&&C("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&cr(a)?this.wb.I(a):null}; t.Bs=function(a){if(null!==a){var b=this.Jh;if(""!==b){var c=this.Ac(a);if(void 0===c||this.wb.contains(c)){var d=this.cl;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.wb.contains(c))){Uj(a,b,c);return}if("string"===typeof c){for(d=2;this.wb.contains(c+d);)d++;Uj(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.wb.count-1;this.wb.contains(c);)c--;Uj(a,b,c)}}}}};t.Jc=function(a){return null===a?!1:this.$f.contains(a)};t.fi=function(a){null!==a&&(fb(a),this.Jc(a)||er(this,a,!0))}; function er(a,b,c){if(""!==a.linkKeyProperty){var d=a.Ac(b);if(void 0!==d&&a.wb.I(d)===b)return;a.Bs(b);d=a.Ac(b);void 0===d&&C("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");a.wb.add(d,b)}a.$f.add(b);d=null;c&&(d=a.md.length,a.md.splice(d,0,b));zr(a,"linkDataArray",ee,"linkDataArray",a,null,b,null,d);Jr(a,b)}t.Ey=function(a){if(Array.isArray(a))for(var b=a.length,c=0;cd)return;a.md.splice(d,1)}zr(a,"linkDataArray",fe,"linkDataArray",a,b,null,d,null);c=ar(a,b,!0);gr(a,c,b);c=ar(a,b,!1);gr(a,c,b);d=a.Ef(b);if(Array.isArray(d))for(var e=d.length,f=0;f=a.count)1===a.count&&(a=a.first(),a.centerX=0,a.centerY=0);else{var b=new F;b.addAll(a.iterator);a=new F;var c=new F;var d=this.sort(b);var e,f,g=this.Jp;var h=this.arrangement;var k=this.nodeDiameterFormula;var l=this.radius;if(!isFinite(l)||0>=l)l=NaN;var m=this.aspectRatio;if(!isFinite(m)||0>=m)m=1;var n=this.startAngle; isFinite(n)||(n=0);var p=this.sweepAngle;if(!isFinite(p)||360p)p=360;b=this.spacing;isFinite(b)||(b=NaN);h===$r&&k===as?h=Mr:h===$r&&k!==as&&(h=this.arrangement);if((this.direction===Vr||this.direction===Wr)&&this.sorting!==Pr){for(k=0;!(k>=d.length);k+=2){a.add(d.M(k));if(k+1>=d.length)break;c.add(d.M(k+1))}this.direction===Vr?(this.arrangement===$r&&a.reverse(),d=new F,d.addAll(a),d.addAll(c)):(this.arrangement===$r&&c.reverse(),d=new F,d.addAll(c),d.addAll(a))}k=d.length;for(var q=f=e=0;q< d.length;q++){var r=n+p*f*(this.direction===Or?1:-1)/k,u=d.M(q).diameter;isNaN(u)&&(u=cs(d.M(q),r));360>p&&(0===q||q===d.length-1)&&(u/=2);e+=u;f++}if(isNaN(l)||h===$r){isNaN(b)&&(b=6);if(h!==Mr&&h!==$r){f=-Infinity;for(g=0;gl?(l=e,f=l*m):g= q/(360<=p?k:k-1)}this.kw=h;this.lc=l;this.Zm=m;this.lw=n;this.Wp=p;this.Ti=b;this.me=f;this.Jp=g;b=d;d=this.kw;h=this.lc;l=this.lw;m=this.Wp;n=this.Ti;p=this.me;k=this.Jp;if(this.direction!==Vr&&this.direction!==Wr||d!==$r)if(this.direction===Vr||this.direction===Wr){g=0;switch(d){case Zr:g=180*fs(this,h,p,l,k)/Math.PI;break;case Mr:k=b=0;g=a.first();null!==g&&(b=cs(g,Math.PI/2));g=c.first();null!==g&&(k=cs(g,Math.PI/2));g=180*fs(this,h,p,l,n+(b+k)/2)/Math.PI;break;case Yr:g=m/b.length}if(this.direction=== Vr){switch(d){case Zr:gs(this,a,l,Xr);break;case Mr:hs(this,a,l,Xr);break;case Yr:is(this,a,m/2,l,Xr)}switch(d){case Zr:gs(this,c,l+g,Or);break;case Mr:hs(this,c,l+g,Or);break;case Yr:is(this,c,m/2,l+g,Or)}}else{switch(d){case Zr:gs(this,c,l,Xr);break;case Mr:hs(this,c,l,Xr);break;case Yr:is(this,c,m/2,l,Xr)}switch(d){case Zr:gs(this,a,l+g,Or);break;case Mr:hs(this,a,l+g,Or);break;case Yr:is(this,a,m/2,l+g,Or)}}}else switch(d){case Zr:gs(this,b,l,this.direction);break;case Mr:hs(this,b,l,this.direction); break;case Yr:is(this,b,m,l,this.direction);break;case $r:js(this,b,m,l,this.direction)}else js(this,b,m,l-m/2,Or)}this.updateParts();this.network=null;this.isValidLayout=!0};function is(a,b,c,d,e){var f=a.Wp,g=a.lc;a=a.me;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;kc){for(f=d+(e===Or?f:-f);0>f;)f+=360;f%=360;180=m.length-1)break;ms(a,k,l,m,n,e,f)||ns(a,k,l,m,n,e,f);k=f.x;l=f.y}J.free(f);a.mj++;if(!(23Math.abs(q)?Math.abs(k-f)<(m[0].width+m[m.length-1].width)/2&&(g=0):g=0Math.abs(p)? 0:p;k=Math.abs(f)>Math.abs(n)?0n:0a.mj?a.lc-g/(2*Math.PI):5>m.length&&10=n.length-1)break;ms(a,k,l,n,p,e,m)||ns(a,k,l,n,p,e,m);k=m.x;l=m.y}J.free(m);a.mj++;if(!(23a.mj?a.lc-f/(2*Math.PI):a.lc-(0h){f=b-a;if(f<-h)return g.x=f,g.y=l,!1;m=!0}}else if(f=b-a,f<-h){f=b+a;if(f>h)return g.x=f,g.y=l,!1;m=!0}l=Math.sqrt(1-Math.min(1,f*f/(h*h)))*k;0>c!==m&&(l=-l);if(Math.abs(c-l)>(d[e].height+d[e+1].height)/2)return g.x=f,g.y=l,!1;g.x=f;g.y=l;return!0} function ns(a,b,c,d,e,f,g){var h=a.lc,k=a.me,l=0;a=(d[e].height+d[e+1].height)/2+a.Ti;d=!1;if(0<=b!==(f===Or)){if(f=c-a,f<-k){f=c+a;if(f>k){g.x=l;g.y=f;return}d=!0}}else if(f=c+a,f>k){f=c-a;if(f<-k){g.x=l;g.y=f;return}d=!0}l=Math.sqrt(1-Math.min(1,f*f/(k*k)))*h;0>b!==d&&(l=-l);g.x=l;g.y=f}Lr.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()}; Lr.prototype.commitNodes=function(){var a=null!==this.group&&null!==this.group.placeholder&&this.group.isSubGraphExpanded,b=a?this.group.location.copy():null,c=this.actualCenter;a?c=new J(0,0):(c.x=this.arrangementOrigin.x+this.lc,c.y=this.arrangementOrigin.y+this.me);for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;e.x+=c.x;e.y+=c.y;e.commit()}a&&(this.group.Va(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.re(c.re(a)),this.group.move(b),this.Zv=b.re(a))}; Lr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function es(a,b,c,d,e){var f=a.ty;if(.001>Math.abs(a.Zm-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;var g=0;var h=void 0!==d&&void 0!==e?e/(f+1):Math.PI/(2*(f+1));for(var k=0,l=0;l<=f;l++){void 0!==d&&void 0!==e?k=d+l*e/f:k=l*Math.PI/(2*f);var m=Math.sin(k);g+=Math.sqrt(1-a*a*m*m)*h}return void 0!==d&&void 0!==e?(b>c?b:c)*g:4*(b>c?b:c)*g} function ds(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?es(a,1,c,d,e):es(a,1,c))}function fs(a,b,c,d,e){if(.001>Math.abs(a.Zm-1))return e/b;var f=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,g=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var h=0;;h++){var k=Math.sin(d+h*a);g+=(b>c?b:c)*Math.sqrt(1-f*f*k*k)*a;if(g>=e)return h*a}} Lr.prototype.sort=function(a){switch(this.sorting){case Tr:break;case Ur:a.reverse();break;case Rr:a.sort(this.comparer);break;case Sr:a.sort(this.comparer);a.reverse();break;case Pr:return this.ak(os(a));default:C("Invalid sorting type.")}return a}; function os(a){for(var b=[],c=0;ce&&(e=h,f=g)}else for(g=0;ge&&(e=h,f=g);c.add(a.M(f));b[f]=-1;f=a.M(f);for(g=f.sourceEdges;g.next();)e=a.indexOf(g.value.fromVertex),0>e||0<=b[e]&&b[e]++;for(f=f.destinationEdges;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]++}return c} Lr.prototype.ak=function(a){for(var b=[],c=0;cb[c].indexOf(e)&&b[c].push(e);for(d=d.sourceEdges;d.next();)e=a.indexOf(d.value.fromVertex),e!==c&&0>b[c].indexOf(e)&&b[c].push(e)}f=[];for(c=0;cb[c[r]].indexOf(c[r===c.length-1?0:r+1])&&q.push(r===c.length-1?0:r+1);if(0===q.length)for(r=0;rc.indexOf(D)||Bc.indexOf(D)||B=u?B+1:B)),v+=B=u&&B++,z>=u&&z++,B>z&&(A=z,z=B,B=A),z-B<(c.length+2)/2===(Bq||q===m||(r=q>m?q-m:m-q,n+=qg-r?1:-1);c.splice(0>n?m:m+1,0,k);d.splice(h,1);h--}else f=!1;if(f)break;else c.push(d[0]),d.splice(0,1)}for(b=0;b=a?this.ul=a:this.ul=360,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==$r&&a!==Mr&&a!==Zr&&a!==Yr||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==Or&&a!==Xr&&a!==Vr&&a!==Wr||(this.K=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==Tr&&a!==Ur&& a!==Rr&&!Sr&&a!==Pr||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}},spacing:{get:function(){return this.tf},set:function(a){this.tf!==a&&(this.tf=a,this.C())}},nodeDiameterFormula:{get:function(){return this.Nn},set:function(a){this.Nn===a||a!==Qr&&a!==as||(this.Nn=a,this.C())}},actualXRadius:{get:function(){return this.lc}}, actualYRadius:{get:function(){return this.me}},actualSpacing:{get:function(){return this.Ti}},actualCenter:{get:function(){return this.Zv}}}); var Mr=new E(Lr,"ConstantSpacing",0),Zr=new E(Lr,"ConstantDistance",1),Yr=new E(Lr,"ConstantAngle",2),$r=new E(Lr,"Packed",3),Or=new E(Lr,"Clockwise",4),Xr=new E(Lr,"Counterclockwise",5),Vr=new E(Lr,"BidirectionalLeft",6),Wr=new E(Lr,"BidirectionalRight",7),Tr=new E(Lr,"Forwards",8),Ur=new E(Lr,"Reverse",9),Rr=new E(Lr,"Ascending",10),Sr=new E(Lr,"Descending",11),Pr=new E(Lr,"Optimized",12),Qr=new E(Lr,"Pythagorean",13),as=new E(Lr,"Circular",14);Lr.className="CircularLayout";Lr.ConstantSpacing=Mr; Lr.ConstantDistance=Zr;Lr.ConstantAngle=Yr;Lr.Packed=$r;Lr.Clockwise=Or;Lr.Counterclockwise=Xr;Lr.BidirectionalLeft=Vr;Lr.BidirectionalRight=Wr;Lr.Forwards=Tr;Lr.Reverse=Ur;Lr.Ascending=Rr;Lr.Descending=Sr;Lr.Optimized=Pr;Lr.Pythagorean=Qr;Lr.Circular=as;function Nr(){this.Pl=-Infinity;this.tm=this.mk=null} Nr.prototype.compare=function(a,b){if(0this.Pl||Math.abs(a)a&&0h?(e=p.x+p.width/2,f=p.y+p.height/2,l[0]=new J(p.x+p.width+d.width,p.y),l[1]=new J(p.x,p.y+p.height+d.height),h=2):(k=us(l,h,e,f,p.width,p.height,d),n=l[k],q=new J(n.x+p.width+d.width,n.y),p=new J(n.x,n.y+ p.height+d.height),k+1this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().bounds,d=this.network.vertexes.iterator;d.next();){if(d.value.bounds.Yc(c)&&(a++,2a.network.vertexes.count)return!1;a.ah=a.network.vertexes.Fa();a=a.ah;a.sort(function(a,b){return null===a||null===b||a===b?0:b.Vd-a.Vd});for(b=a.length-1;0<=b&&1>=a[b].Vd;)b--;return 1=g))){for(var l=h=0,m=k.count-g;mq&& (q=1);h=K.sqrt((h+q+l*l*4/(g*g))/q);g=(h-1)*m/2;h=(h-1)*n/2;e.bounds=new N(f-p.x-g,k-p.y-h,m+2*g,n+2*h);e.focus=new J(p.x+g,p.y+h)}}a.network=d;return c}function ys(a,b){for(var c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.We){var e=d.We.M(d.sv);d.Vd=e.Rs;var f=e.Sv,g=e.Tv;d.bounds=new N(d.centerX-f,d.centerY-g,e.Ss,e.Qs);d.focus=new J(f,g);d.sv--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} function zs(a,b){var c=b.Hj;if(null!==c&&0!==c.count){var d=b.centerX,e=b.centerY,f=b.width,g=b.height;null!==b.We&&0=n.Vd?k++:(h=!0,l++,g+=Math.atan2(b.centerY-n.centerY,b.centerX-n.centerX))}if(0!==k)for(0>1)+l)*(0===h%2?1:-1);k.centerX=d+m*Math.cos(n);k.centerY=e+m*Math.sin(n);h++}}} function us(a,b,c,d,e,f,g){var h=9E19,k=-1,l=0;a:for(;lm.y&&a[p].x-m.xm.x&&a[p].y-m.yb+f?(c=d+e-g,a=a-b-f,K.sqrt(c*c+a*a)):a+cg+h?a>b+f?(c=d-g-h,a=a-b-f,K.sqrt(c*c+a*a)):a+cb+f?a-(b+f):a+c=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.centerX,e=d,f=c=c.centerY,g=1;gf-c)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerX-b.centerX}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerY-b.centerY});c=a.Zf;var l=d=h=0;for(f= 0;fc||l-k>c){if(e)break}else if(m-q>c||q-m>c){if(!e)break}else{var r=Bs(g,p);1>r?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new Ds),r=d.random(), h=d.random(),k>l?(d=Math.abs(p.bounds.right-g.bounds.x),d=(1+d)*r):kq?(l=Math.abs(p.bounds.bottom-g.bounds.y),l=(1+l)*h):kn?(n=a.randomNumberGenerator,null===n&&(a.randomNumberGenerator=n=new Ds),h=n.random(),n=n.random(),d=(d>k?1:-1)*(1+(f.width>c.width?f.width:c.width))*h,l=(g>m?1:-1)*(1+(f.height>c.height?f.height:c.height))*n):(h=h.stiffness*(n-h.length),d=(k-d)/n*h,l=(m-g)/n*h),c.forceX+=d,c.forceY+=l,f.forceX-=d,f.forceY-=l;for(e=d=0;ea.epsilonDistance*a.epsilonDistance}rs.prototype.moveVertex=function(a){var b=a.forceX,c=a.forceY,d=this.moveLimit;b<-d?b=-d:b>d&&(b=d);c<-d?c=-d:c>d&&(c=d);a.centerX+=b;a.centerY+=c;return b*b+c*c};rs.prototype.moveFixedVertex=function(){};rs.prototype.commitLayout=function(){this.yv();this.commitNodes();this.isRouting&&this.commitLinks()}; rs.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=Sc,b.toSpot=Sc)}};rs.prototype.commitNodes=function(){var a=0,b=0;if(this.arrangesToOrigin){var c=N.alloc();this.computeBounds(this.network,c);b=this.arrangementOrigin;a=b.x-c.x;b=b.y-c.y;N.free(c)}c=N.alloc();for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.bounds),c.x+=a,c.y+=b,e.bounds=c;e.commit()}N.free(c)}; rs.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};rs.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Hk:a};rs.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Gk:a};rs.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Ek:a};rs.prototype.electricalFieldX=function(){return 0};rs.prototype.electricalFieldY=function(){return 0}; rs.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Fk:a};rs.prototype.gravitationalFieldX=function(){return 0};rs.prototype.gravitationalFieldY=function(){return 0};rs.prototype.isFixed=function(a){return a.isFixed}; ma.Object.defineProperties(rs.prototype,{currentIteration:{get:function(){return this.An}},arrangementSpacing:{get:function(){return this.$d},set:function(a){this.$d.D(a)||(this.$d.assign(a),this.C())}},arrangesToOrigin:{get:function(){return this.Bm},set:function(a){this.Bm!==a&&(this.Bm=a,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(a){this.sf!==a&&(this.sf= a,this.C())}},comments:{get:function(){return this.td},set:function(a){this.td!==a&&(this.td=a,this.C())}},maxIterations:{get:function(){return this.dl},set:function(a){this.dl!==a&&0<=a&&(this.dl=a,this.C())}},epsilonDistance:{get:function(){return this.$m},set:function(a){this.$m!==a&&0u&&0u&&0a[this.Md]&&(this.Iq=a[c]-1,this.Md=c),a[c]g)for(var m=g+1;mk;m--)n=d[m],n.near===l&&n.Dj===l.Dj||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;lu||n===u&&q>r)&&h++;wn||u===n&&r>q)&&h++}}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;lu||n===u&&m>w)&&h++,rn||u===n&&w>m)&&h++);f[g*e+g]=h;for(k=g+ 1;k=c)for(h=d[g].destinationEdgesArrayAccess,z=d[k].destinationEdgesArrayAccess,l=0;l=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=0,p=h.near;null!==p&&p.layer===h.layer&&(m+=p.column-1,n++);if(null!==k)for(p=0;p=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=[],p=h.near;null!==p&&p.layer===h.layer&&(n[m]=p.column-1,m++);h=void 0;if(null!==k)for(p=0;p>1,f[g]=0!==(m&1)?n[l]:n[l-1]+n[l]>>1)}Qs(a,b,d);return f}function Ys(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();){var h=g.value;var k=h.toVertex;var l=b.layer-k.layer;h=a.linkMinLength(h);l===h&&Ys(a,k,c,d,e,f)}if(f)for(g=b.sourceEdges;g.next();)h=g.value,k=h.fromVertex,l=k.layer-b.layer,h=a.linkMinLength(h),l===h&&Ys(a,k,c,d,e,f)}} function Zs(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();)Zs(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)Zs(a,b.value.fromVertex,c,d,e,f)}} Gs.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Dk){default:case $s:a=this.network;var b=0,c=a.vertexes.count-1,d=[];d.length=c+1;for(var e=a.vertexes.iterator;e.next();)e.value.valid=!0;for(;null!==at(a);){for(e=bt(a);null!==e;)d[c]=e,c--,e.valid=!1,e=bt(a);for(e=ct(a);null!==e;)d[b]=e,b++,e.valid=!1,e=ct(a);e=null;for(var f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value;if(h.valid){for(var k=0,l=h.destinationEdges;l.next();)l.value.toVertex.valid&& k++;l=0;for(var m=h.sourceEdges;m.next();)m.value.fromVertex.valid&&l++;if(null===e||fb.toVertex.index&&(a.gm(b),b.rev=!0);break;case Hs:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.Ll=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Kn=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&& dt(this,b);for(d.reset();d.next();)b=d.value,-1===b.Ll&&dt(this,b);for(a.reset();a.next();)d=a.value,d.forest||(b=d.fromVertex,c=b.finish,e=d.toVertex,f=e.finish,e.Lld){if(0>d)for(b.reset();b.next();)b.value.layer-=d;d=[];for(b.reset();b.next();)c=b.value,e=d[c.layer],void 0===e?d[c.layer]=[c]:e.push(c);for(c=b=0;cg&&Ys(a,h,0,-1,!0,!1)}for(Ys(a,b,1,-1,!0,!0);0!==b.component;){f=0;d=Infinity;h=0;k=null;for(g=a.network.vertexes.iterator;g.next();){var l=g.value;if(1===l.component){var m=0,n=!1,p=l.sourceEdgesArrayAccess; e=p.length;for(var q=0;qf)&&!m&&(h=g,f=l)}if(0>d){for(c.reset();c.next();)d=c.value,1===d.component&&(d.layer-=e);b.component=0}else h.component=0}}} function Os(a,b,c){return 90===a.K?c&&!b.rev||!c&&b.rev?270:90:180===a.K?c&&!b.rev||!c&&b.rev?0:180:270===a.K?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} Gs.prototype.initializeIndices=function(){switch(this.Qk){default:case kt:for(var a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;b.index=this.tc[c];this.tc[c]++}break;case Js:a=this.network.vertexes.iterator;for(b=this.Ia;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&<(this,c);break;case mt:for(a=this.network.vertexes.iterator,b=0;b<=this.Ia;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&nt(this,c)}}; function lt(a,b){var c=b.layer;b.index=a.tc[c];a.tc[c]++;b=b.destinationEdgesArrayAccess;for(c=!0;c;){c=!1;for(var d=0;df.portFromColOffset&&(c=!0,b[d]=f,b[d+1]=e)}}for(c=0;cf.portToColOffset&&(d=!0,b[c]=f,b[c+1]=e)}for(c=0;c=g;d--)f=pt(this,d,-1)||f;e=this.countCrossings();e>=a?Ts(this,b):(a=e,b=Ss(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=pt(this,d,1)||f;e=this.countCrossings();e>=a?Ts(this,b):(a=e,b=Ss(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=pt(this,d,1)||f;e>=a?Ts(this,b):(a=e,b=Ss(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= pt(this,d,-1)||f;e>=a?Ts(this,b):(a=e,b=Ss(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=pt(this,d,0)||f;e>=a?Ts(this,b):(a=e,b=Ss(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=pt(this,d,0)||f;e>=a?Ts(this,b):(a=e,b=Ss(this))}break;default:case Ks:for(c=this.Ia,g=0,h=a+1;(d=this.countCrossings())=g;d--)f=pt(this,d,-1)||f;e=this.countCrossings();e>=a?Ts(this,b):(a=e,b=Ss(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=pt(this,d,1)||f;e=this.countCrossings();e>=a?Ts(this,b): (a=e,b=Ss(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=pt(this,d,1)||f;e>=a?Ts(this,b):(a=e,b=Ss(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=pt(this,d,-1)||f;e>=a?Ts(this,b):(a=e,b=Ss(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=pt(this,d,0)||f;e>=a?Ts(this,b):(a=e,b=Ss(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=pt(this,d,0)||f;e>=a?Ts(this,b):(a=e,b=Ss(this))}}Ts(this,b)}; function ot(a,b,c){var d=Ps(a,b),e=a.tc[b],f=Xs(a,b,c),g=Ws(a,b,c);for(c=0;cf+1&&(p+=4*(y-f),q+=4*(y-(f+1)))}A=d[f].destinationEdges.iterator;for(A.reset();A.next();)if(y=A.value,z=y.toVertex,y.valid&&z.layer===b){for(y=0;d[y]!==z;)y++;y===f+1&&(q+=1)}A=d[f+1].sourceEdges.iterator;for(A.reset();A.next();)if(y=A.value,z=y.fromVertex,y.valid&&z.layer===b){for(y=0;d[y]!==z;)y++;yf+1&&(p+=4*(y-(f+1)),q+=4*(y-f))}A=d[f+1].destinationEdges.iterator; for(A.reset();A.next();)if(y=A.value,z=y.toVertex,y.valid&&z.layer===b){for(y=0;d[y]!==z;)y++;y===f&&(p+=1)}y=z=0;A=g[d[f].index];var B=h[d[f].index],D=g[d[f+1].index],M=h[d[f+1].index];-1!==A&&(z+=Math.abs(A-r),y+=Math.abs(A-v));-1!==B&&(z+=Math.abs(B-r),y+=Math.abs(B-v));-1!==D&&(z+=Math.abs(D-u),y+=Math.abs(D-w));-1!==M&&(z+=Math.abs(M-u),y+=Math.abs(M-w));if(q>1)+8*d;this.Ra*=8}if(0!==(this.bg&2))for(c=!0;c;){c=!1;for(b=this.Md+1;b<=this.Ia;b++)c= tt(this,b,1)||c;for(b=this.Md-1;0<=b;b--)c=tt(this,b,-1)||c;c=tt(this,this.Md,0)||c}if(0!==(this.bg&4)){for(b=this.Md+1;b<=this.Ia;b++)ut(this,b,1);for(b=this.Md-1;0<=b;b--)ut(this,b,-1);ut(this,this.Md,0)}a&&(vt(this,-1),vt(this,1));if(0!==(this.bg&2))for(c=!0;c;){c=!1;c=tt(this,this.Md,0)||c;for(b=this.Md+1;b<=this.Ia;b++)c=tt(this,b,0)||c;for(b=this.Md-1;0<=b;b--)c=tt(this,b,0)||c}}else wt(this)};function tt(a,b,c){for(var d=!1;xt(a,b,c);)d=!0;return d} function xt(a,b,c){var d,e=Ps(a,b),f=a.tc[b],g=Ws(a,b,-1);if(0c)for(d=0;dd-1||m-e[d-1].column-1>n+a.nodeMinColumnSpace(e[d-1],!1)?q=m-1:q=m;n=d+1>=f||e[d+1].column-m-1>p+a.nodeMinColumnSpace(e[d+1],!0)?m+1:m;var r=p=0,u=0;if(0>=c)for(var w=e[d].sourceEdges.iterator;w.next();){var v=w.value;var y=v.fromVertex; if(v.valid&&y.layer!==b){var z=Rs(v);var A=v.portFromColOffset;v=v.portToColOffset;y=y.column;p+=(Math.abs(m+v-(y+A))+1)*z;r+=(Math.abs(q+v-(y+A))+1)*z;u+=(Math.abs(n+v-(y+A))+1)*z}}if(0<=c)for(w=e[d].destinationEdges.iterator;w.next();)v=w.value,y=v.toVertex,v.valid&&y.layer!==b&&(z=Rs(v),A=v.portFromColOffset,v=v.portToColOffset,y=y.column,p+=(Math.abs(m+A-(y+v))+1)*z,r+=(Math.abs(q+A-(y+v))+1)*z,u+=(Math.abs(n+A-(y+v))+1)*z);v=A=z=0;w=g[e[d].index];y=h[e[d].index];-1!==w&&(z+=Math.abs(w-m),A+= Math.abs(w-q),v+=Math.abs(w-n));-1!==y&&(z+=Math.abs(y-m),A+=Math.abs(y-q),v+=Math.abs(y-n));if(r=g[c]?m=k:l<=g[c]&&(m=l));m!==h&&(f=!0,d[c].column=m)}Qs(a,b,d);a.normalize()} function yt(a,b){for(var c=!0,d=a.network.vertexes.iterator;d.next();){var e=d.value,f=a.nodeMinColumnSpace(e,!0),g=a.nodeMinColumnSpace(e,!1);if(e.column-f<=b&&e.column+g>=b){c=!1;break}}a=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(--c.column,a=!0);return a} function zt(a,b){var c=b+1;var d,e=[],f=[];for(d=0;d<=a.Ia;d++)e[d]=!1,f[d]=!1;for(var g=a.network.vertexes.iterator;g.next();){d=g.value;var h=d.column-a.nodeMinColumnSpace(d,!0),k=d.column+a.nodeMinColumnSpace(d,!1);h<=b&&k>=b&&(e[d.layer]=!0);h<=c&&k>=c&&(f[d.layer]=!0)}h=!0;c=!1;for(d=0;d<=a.Ia;d++)h=h&&!(e[d]&&f[d]);if(h)for(g.reset();g.next();)a=g.value,a.column>b&&(--a.column,c=!0);return c} function vt(a,b){for(var c=0;c<=a.Ra;c++)for(;yt(a,c););a.normalize();for(c=0;cf?Ts(a,e):gb)for(c=a.Ra;0<=c;c--)for(e=Ss(a),f=Vs(a),d=f+1;ff?Ts(a,e):gc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.le);a.le++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Zs(a,b,a.le,-1,!0,!0),a.le++);var f;b=[];for(f=0;fc)for(g=a.Ra;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} function wt(a){for(var b=Ea(),c=a.fl.length,d=0;d<=c;d++)b[d]=[];for(d=a.network.vertexes.iterator;d.next();){var e=d.value;b[c-e.layer][e.index]=e}c=new H;Bt(b,c);var f=null,g=null,h=null,k=null,l=0!==(a.ve&1),m=0!==(a.ve&2),n=0!==(a.ve&4),p=0!==(a.ve&8);l&&(a.verticalAlignment(b,c,!0),f=Ct(a,b,!0,!1));b.reverse();n&&(a.verticalAlignment(b,c,!1),h=Ct(a,b,!1,!1));d=ba(b);for(e=d.next();!e.done;e=d.next())e.value.reverse();p&&(a.verticalAlignment(b,c,!1),k=Ct(a,b,!1,!0));b.reverse();m&&(a.verticalAlignment(b, c,!0),g=Ct(a,b,!0,!0));Ga(b);a.u(f,g,h,k);a.network.vertexes.each(function(a){var b=Ea();l&&b.push(f.get(a));m&&b.push(g.get(a));n&&b.push(h.get(a));p&&b.push(k.get(a));b.sort(function(a,b){return a-b});var c=b.length;c=(b[Math.floor((c-1)/2)]+b[Math.ceil((c-1)/2)])/2;Ga(b);a.zc=c})} function Bt(a,b){for(var c=a.length,d=1;dm)&&b.add(n);f++}e= m}}}Gs.prototype.verticalAlignment=function(a,b,c){Et(a);a=ba(a);for(var d=a.next();!d.done;d=a.next()){var e=-1;d=ba(d.value);for(var f=d.next();!f.done;f=d.next()){f=f.value;var g=c?Dt(f):Ft(f),h=g.length;if(0=b[c].length)&&(g=b[c][0],g.sd===g)){Infinity===g.sd.shift&&(g.sd.shift=0);g=c;h=0;do{for(f=b[g][h];f.align!==f.root;)f=f.align,g++,0a&&C("Could not determine previous vertex in layer");return b[c][a-1]} Gs.prototype.u=function(a){for(var b=[],c=0;cg;g++)if(b[g]){var h=Jt(this,b[g],d,e,g);hg;f={delta:f.delta},g++)b[g]&&(f.delta=0===g||2===g?d[c]-d[g]:e[c]-e[g],0!==f.delta&&b[g].each(function(a){return function(b){b.value+=a.delta}}(f)));Ga(d);Ga(e)}; function Jt(a,b,c,d,e){if(!b||0===b.count)return c[e]=0,d[e]=0,Infinity;var f=Infinity,g=-Infinity;b.each(function(b){var c=b.key;b=b.value;c=90===a.K||270===a.K?c.width:c.height;bg&&(g=b+c)});c[e]=f;d[e]=g;return g-f}Gs.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=Ns(this,!0),b=Ns(this,!1),c=this.network.edges.iterator;c.next();){var d=c.value.link;null!==d&&(d.fromSpot=a,d.toSpot=b)}this.commitNodes();this.Gu();this.isRouting&&this.commitLinks()}; function Ns(a,b){return 270===a.K?b?$c:cd:90===a.K?b?cd:$c:180===a.K?b?ad:bd:b?bd:ad} Gs.prototype.commitNodes=function(){this.he=[];this.Ld=[];this.Kd=[];this.Ta=[];for(var a=0;a<=this.Ia;a++)this.he[a]=0,this.Ld[a]=0,this.Kd[a]=0,this.Ta[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.he[c]=Math.max(this.he[c],this.nodeMinLayerSpace(b,!0));this.Ld[c]=Math.max(this.Ld[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.ie;for(var d=0;d<=this.Ia;d++){var e=c;0>=this.he[d]+this.Ld[d]&&(e=0);0=n.bounds.bottom?(n=n.bounds.y+ n.bounds.height,b.m(u++,A,n+D),b.m(u++,A,n),b.m(u++,A,n-z)):(b.m(u++,A,B+D),b.m(u++,A,B),b.m(u++,A,B-z)):270===this.K?B<=n.bounds.y?(n=n.bounds.y,b.m(u++,A,n-z),b.m(u++,A,n),b.m(u++,A,n+D)):(b.m(u++,A,B-z),b.m(u++,A,B),b.m(u++,A,B+D)):0===this.K&&(A>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.m(u++,n+D,B),b.m(u++,n,B),b.m(u++,n-z,B)):(b.m(u++,A+D,B),b.m(u++,A,B),b.m(u++,A-z,B)));else{b.m(u++,v,y);var M=0;if(180===this.K||0===this.K){if(180===this.K?A>=n.bounds.right:A<=n.bounds.x)M=(0===this.K? -z:D)/2;b.m(u++,v+M,B)}else{if(270===this.K?B>=n.bounds.bottom:B<=n.bounds.y)M=(90===this.K?-z:D)/2;b.m(u++,A,y+M)}b.m(u++,A,B)}}else z=Math.max(10,this.he[w.layer]),D=Math.max(10,this.Ld[w.layer]),p?180===this.K?(b.m(u++,A-z-r,B),b.m(u++,Math.min(A-z+r/2,A),B),b.m(u++,A,B),b.m(u++,A,B),b.m(u++,Math.max(A+D-r/2,A),B),b.m(u++,A+D+r,B)):90===this.K?(b.m(u++,A,B+D+r),b.m(u++,A,Math.max(B+D-r/2,B)),b.m(u++,A,B),b.m(u++,A,B),b.m(u++,A,Math.min(B-z+r/2,B)),b.m(u++,A,B-z-r)):270===this.K?(b.m(u++,A,B-z- r),b.m(u++,A,Math.min(B-z+r/2,B)),b.m(u++,A,B),b.m(u++,A,B),b.m(u++,A,Math.max(B+D-r/2,B)),b.m(u++,A,B+D+r)):(b.m(u++,A+D+r,B),b.m(u++,Math.max(A+D-r/2,A),B),b.m(u++,A,B),b.m(u++,A,B),b.m(u++,Math.min(A-z+r/2,A),B),b.m(u++,A-z-r,B)):b.m(u++,A,B)}n=w}if(null===h||l!==rc||q)if(v=b.i(u-1).x,y=b.i(u-1).y,A=b.i(u).x,B=b.i(u).y,q)r=this.Ld[m.layer],180===this.K||0===this.K?(q=y,q>=m.bounds.y&&q<=m.bounds.bottom&&(180===this.K?A>=m.bounds.x:A<=m.bounds.right)&&(n=m.centerX+(180===this.K?-r:r),q=m.bounds.x&&q<=m.bounds.right&&(270===this.K?B>=m.bounds.y:B<=m.bounds.bottom)&&(n=m.centerY+(270===this.K?-r:r),q=m.bounds.x?(n=m.bounds.x+m.bounds.width,b.L(u- 2,n,y),b.L(u-1,n+D,y)):90===this.K&&B<=m.bounds.bottom?(n=m.bounds.y,b.L(u-2,v,n),b.L(u-1,v,n-z)):270===this.K&&B>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.L(u-2,v,n),b.L(u-1,v,n+D)):0===this.K&&A<=m.bounds.right&&(n=m.bounds.x,b.L(u-2,n,y),b.L(u-1,n-z,y));else{z=Math.max(10,this.he[m.layer]);D=Math.max(10,this.Ld[m.layer]);q=0;if(180===this.K||0===this.K){if(180===this.K?A<=m.bounds.x:A>=m.bounds.right)q=(0===this.K?D:-z)/2;b.m(u++,A+q,y)}else{if(270===this.K?B<=m.bounds.y:B>=m.bounds.bottom)q= (90===this.K?D:-z)/2;b.m(u++,v,B+q)}b.m(u++,A,B)}}else{for(;null!==m&&m!==n;){z=w=null;for(m=m.destinationEdges.iterator;m.next()&&(v=m.value,v.link!==c.link||(w=v.toVertex,z=v.fromVertex,null!==z.node&&(z=null),null!==w.node)););if(null===w)break;w!==n&&(v=b.i(u-1).x,y=b.i(u-1).y,A=w.centerX,B=w.centerY,q?180===this.K||0===this.K?(null!==z?z.centerY:y)!==B&&(z=this.Ta[w.layer]+this.Rf.x,u===b.firstPickIndex+1&&(z=0===this.K?Math.max(z,v):Math.min(z,v)),b.m(u++,z,y),b.m(u++,z,B)):(null!==z?z.centerX: v)!==A&&(z=this.Ta[w.layer]+this.Rf.y,u===b.firstPickIndex+1&&(z=90===this.K?Math.max(z,y):Math.min(z,y)),b.m(u++,v,z),b.m(u++,A,z)):(z=Math.max(10,this.he[w.layer]),D=Math.max(10,this.Ld[w.layer]),p?180===this.K?(b.m(u++,A+D+r,B),b.m(u++,Math.max(A+D-r/2,A),B),b.m(u++,A,B),b.m(u++,A,B),b.m(u++,Math.min(A-z+r/2,A),B),b.m(u++,A-z-r,B)):90===this.K?(b.m(u++,A,B-z-r),b.m(u++,A,Math.min(B-z+r/2,B)),b.m(u++,A,B),b.m(u++,A,B),b.m(u++,A,Math.max(B+D-r/2,B)),b.m(u++,A,B+D+r)):270===this.K?(b.m(u++,A,B+D+ r),b.m(u++,A,Math.max(B+D-r/2,B)),b.m(u++,A,B),b.m(u++,A,B),b.m(u++,A,Math.min(B-z+r/2,B)),b.m(u++,A,B-z-r)):(b.m(u++,A-z-r,B),b.m(u++,Math.min(A-z+r/2,A),B),b.m(u++,A,B),b.m(u++,A,B),b.m(u++,Math.max(A+D-r/2,A),B),b.m(u++,A+D+r,B)):180===this.K?(b.m(u++,A+D,B),b.m(u++,A-z,B)):90===this.K?(b.m(u++,A,B-z),b.m(u++,A,B+D)):270===this.K?(b.m(u++,A,B+D),b.m(u++,A,B-z)):(b.m(u++,A-z,B),b.m(u++,A+D,B))));m=w}q&&(v=b.i(u-1).x,y=b.i(u-1).y,A=b.i(u).x,B=b.i(u).y,180===this.K||0===this.K?y!==B&&(z=0===this.K? Math.min(Math.max((A+v)/2,this.Ta[n.layer]+this.Rf.x),A):Math.max(Math.min((A+v)/2,this.Ta[n.layer]+this.Rf.x),A),b.m(u++,z,y),b.m(u++,z,B)):v!==A&&(z=90===this.K?Math.min(Math.max((B+y)/2,this.Ta[n.layer]+this.Rf.y),B):Math.max(Math.min((B+y)/2,this.Ta[n.layer]+this.Rf.y),B),b.m(u++,v,z),b.m(u++,A,z)))}null!==d&&p&&4<=b.pointsCount&&(null!==g&&(g=l===rc?b.getLinkPointFromPoint(e,g,g.ga(wc),b.i(3),!0):b.i(0),l===rc&&(l=b.i(2),d=b.i(3),90===this.direction||270===this.direction?(b.L(1,(g.x+l.x)/2,l.y), b.L(2,d.x,(l.y+d.y)/2)):(b.L(1,l.x,(g.y+l.y)/2),b.L(2,(l.x+d.x)/2,d.y))),g.w()||g.set(e.actualBounds.center),b.L(0,g.x,g.y)),null!==h&&(e=k===rc?b.getLinkPointFromPoint(f,h,h.ga(wc),b.i(b.pointsCount-4),!1):b.i(b.pointsCount-1),k===rc&&(h=b.i(b.pointsCount-3),k=b.i(b.pointsCount-4),90===this.direction||270===this.direction?(b.L(b.pointsCount-2,(e.x+h.x)/2,h.y),b.L(b.pointsCount-2,k.x,(h.y+k.y)/2)):(b.L(b.pointsCount-2,h.x,(e.y+h.y)/2),b.L(b.pointsCount-3,(h.x+k.x)/2,k.y))),e.w()||e.set(f.actualBounds.center), b.L(b.pointsCount-1,e.x,e.y)));b.zf();c.commit()}}}this.avoidOrthogonalOverlaps()}; Gs.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new F,b=this.network.edges.iterator;b.next();){var c=b.value.link;null!==c&&c.isOrthogonal&&!a.contains(c)&&a.add(c)}if(0f.y&&(m=l.y>f.y?0:g.xf.x&&(m=l.x>f.x?0:g.yb.layer?1:a.rdb.rd?1:a.Icb.Ic?1:0:0};t.Ux=function(a,b){return a instanceof Kt&&b instanceof Kt&&a!==b?a.firstb.first||a.jb.j||a.rdb.rd?1:a.Icb.Ic?1:0:0}; t.Js=function(a,b){return a instanceof Kt&&b instanceof Kt&&a!==b?a.jcb.jc||a.jb.j||a.rdb.rd?1:a.Icb.Ic?1:0:0};t.B=function(a,b){a-=b;return-1a}; t.zi=function(a,b,c,d){var e=a.length,f=d-c;if(!(1>=f))if((0>c||c>=e-1)&&C("not in range 0 <= from < length: "+c),2===f)d=a[c],e=a[c+1],0=e)a.sort(b);else for(c=a.slice(0,d),c.sort(b),b=0;b=e)for(d=a.slice(c),d.sort(b),b=c;b=a.He.length){var d=[];for(var e=0;ea&&(this.bg=a,this.C())}},alignOption:{get:function(){return this.ve},set:function(a){this.ve!==a&&0<=a&&16>a&&(this.ve= a,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(a){this.sf!==a&&(this.sf=a,this.C())}},linkSpacing:{get:function(){return this.Cn},set:function(a){this.Cn!==a&&0<=a&&(this.Cn=a,this.C())}},maxLayer:{get:function(){return this.Ia}},maxIndex:{get:function(){return this.Iq}},maxColumn:{get:function(){return this.Ra}},minIndexLayer:{ get:function(){return this.Hn}},maxIndexLayer:{get:function(){return this.Md}}}); var Hs=new E(Gs,"CycleDepthFirst",0),$s=new E(Gs,"CycleGreedy",1),Ms=new E(Gs,"CycleFromLayers",2),Is=new E(Gs,"LayerOptimalLinkLength",0),et=new E(Gs,"LayerLongestPathSink",1),gt=new E(Gs,"LayerLongestPathSource",2),Js=new E(Gs,"InitDepthFirstOut",0),mt=new E(Gs,"InitDepthFirstIn",1),kt=new E(Gs,"InitNaive",2),qt=new E(Gs,"AggressiveNone",0),Ks=new E(Gs,"AggressiveLess",1),rt=new E(Gs,"AggressiveMore",2),st=8;Gs.className="LayeredDigraphLayout";Gs.CycleDepthFirst=Hs;Gs.CycleGreedy=$s; Gs.CycleFromLayers=Ms;Gs.LayerOptimalLinkLength=Is;Gs.LayerLongestPathSink=et;Gs.LayerLongestPathSource=gt;Gs.InitDepthFirstOut=Js;Gs.InitDepthFirstIn=mt;Gs.InitNaive=kt;Gs.AggressiveNone=qt;Gs.AggressiveLess=Ks;Gs.AggressiveMore=rt;Gs.PackNone=0;Gs.PackExpand=1;Gs.PackStraighten=2;Gs.PackMedian=4;Gs.PackAll=15;Gs.AlignNone=0;Gs.AlignUpperLeft=1;Gs.AlignUpperRight=2;Gs.AlignLowerLeft=4;Gs.AlignLowerRight=8;Gs.AlignAll=15; function Kt(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0;this.link=null;this.j=0}Kt.className="SegInfo";function Ls(a){uq.call(this,a)}la(Ls,uq);Ls.prototype.createVertex=function(){return new Lt(this)};Ls.prototype.createEdge=function(){return new Mt(this)};Ls.className="LayeredDigraphNetwork";function Lt(a){xq.call(this,a);this.$n=this.bo=this.ao=this.co=null;this.Za=this.Ag=this.Ig=-1;this.u=NaN;this.F=null;this.valid=!1;this.finish=this.Ll=NaN;this.Dj=0;this.dv=this.ev=null} la(Lt,xq);function Nt(a,b){return a.index-b.index}function Gt(a,b){if(!a.$n){for(var c=[],d=ba(a.destinationEdgesArrayAccess),e=d.next();!e.done;e=d.next())e=e.value,e.valid&&c.push(e);a.$n=c}a=ba(a.$n);for(c=a.next();!c.done;c=a.next())if(c=c.value,c.toVertex===b)return c;C("Unable to find destination edge to given vertex")}function Dt(a){if(!a.co){for(var b=[],c=ba(a.sourceEdgesArrayAccess),d=c.next();!d.done;d=c.next())d=d.value,d.valid&&b.push(d.fromVertex);b.sort(Nt);a.co=b}return a.co} function Ft(a){if(!a.ao){for(var b=[],c=ba(a.destinationEdgesArrayAccess),d=c.next();!d.done;d=c.next())d=d.value,d.valid&&b.push(d.toVertex);b.sort(Nt);a.ao=b}return a.ao}Lt.prototype.Cl=function(a){xq.prototype.Cl.call(this,a);this.bo=this.co=null};Lt.prototype.Kl=function(a){xq.prototype.Kl.call(this,a);this.bo=this.co=null};Lt.prototype.zl=function(a){xq.prototype.zl.call(this,a);this.$n=this.ao=null};Lt.prototype.Jl=function(a){xq.prototype.Jl.call(this,a);this.$n=this.ao=null}; ma.Object.defineProperties(Lt.prototype,{layer:{get:function(){return this.Ig},set:function(a){this.Ig!==a&&(this.Ig=a)}},column:{get:function(){return this.Ag},set:function(a){this.Ag!==a&&(this.Ag=a)}},index:{get:function(){return this.Za},set:function(a){this.Za!==a&&(this.Za=a)}},component:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},near:{ get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}});Lt.prototype.deleteDestinationEdge=Lt.prototype.Jl;Lt.prototype.addDestinationEdge=Lt.prototype.zl;Lt.prototype.deleteSourceEdge=Lt.prototype.Kl;Lt.prototype.addSourceEdge=Lt.prototype.Cl;Lt.className="LayeredDigraphVertex";function Mt(a){yq.call(this,a);this.j=this.ia=this.Ha=!1;this.V=this.u=NaN;this.F=this.o=0}la(Mt,yq); ma.Object.defineProperties(Mt.prototype,{fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}},valid:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},rev:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},forest:{ get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},portFromPos:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},portToPos:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},portFromColOffset:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},portToColOffset:{get:function(){return this.F}, set:function(a){this.F!==a&&(this.F=a)}}});Mt.className="LayeredDigraphEdge";function Ot(a){ti.call(this);this.Ub=new H;this.Wn=Pt;this.ud=Qt;this.vo=Rt;this.Bq=St;this.$v=[];this.td=!0;this.Rb=Tt;this.$d=(new L(10,10)).freeze();var b=new Ut(this);this.W=new Vt(b);this.Y=new Vt(b);this.ru=[];a&&Object.assign(this,a)}la(Ot,ti); Ot.prototype.cloneProtected=function(a){ti.prototype.cloneProtected.call(this,a);a.Wn=this.Wn;a.vo=this.vo;a.Bq=this.Bq;a.td=this.td;a.Rb=this.Rb;a.$d.assign(this.$d);a.W.copyInheritedPropertiesFrom(this.W);a.Y.copyInheritedPropertiesFrom(this.Y)}; Ot.prototype.qb=function(a){a.classType===Ot?0===a.name.indexOf("Alignment")?this.alignment=a:0===a.name.indexOf("Arrangement")?this.arrangement=a:0===a.name.indexOf("Compaction")?this.compaction=a:0===a.name.indexOf("Path")?this.path=a:0===a.name.indexOf("Sorting")?this.sorting=a:0===a.name.indexOf("Style")?this.treeStyle=a:C("Unknown enum value: "+a):ti.prototype.qb.call(this,a)};Ot.prototype.createNetwork=function(){return new Ut(this)}; Ot.prototype.makeNetwork=function(a){function b(a){if(a instanceof V)return!a.isLinkLabel&&"Comment"!==a.category;if(a instanceof T){var b=a.fromNode;if(null===b||b.isLinkLabel||"Comment"===b.category)return!1;a=a.toNode;return null===a||a.isLinkLabel||"Comment"===a.category?!1:!0}return!1}var c=this.createNetwork();a instanceof Q?(c.lg(a.nodes,!0,b),c.lg(a.links,!0,b)):a instanceof pf?c.lg(a.memberParts,!1,b):c.lg(a.iterator,!1,b);return c}; Ot.prototype.doLayout=function(a){null===this.network&&(this.network=this.makeNetwork(a));this.arrangement!==Wt&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var b=this.diagram;null===b&&a instanceof Q&&(b=a);this.path===Pt&&null!==b?this.ud=b.isTreePathToChildren?Qt:Xt:this.ud=this.path===Pt?Qt:this.path;if(0b.level)return!1;a.removeChild(c.parent,c)}return!0}Ot.prototype.removeChild=function(a,b){if(null!==a&&null!==b){for(var c=a.children,d=0,e=0;ee?Du(this,a,g,X,v,y):Eu(this,a,g,X,v,y);X=y.x;v=y.width;y=y.height;break;case tu:for(A=0;An&&(Sgb&&(Ju(a,-gb,0,ca,na-1),Ku(A,-gb,0),Ku(B,-gb,0),gb=0)}wa.S.h(gb,R);v=Math.max(v,D);y=Math.max(y,z+(0===I?0:r)+db.height);S=D}else{0n&&(Rgb&&(Ju(a,0,-gb,ca,na-1),Ku(A,0,-gb),Ku(B,0,-gb),gb=0);wa.S.h(S,gb);y=Math.max(y,M);v=Math.max(v,z+(0===I?0:r)+db.width);R=M}G++}0l&&(l=0),135u&&(u=0),k===uu&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>v&&(v=Pu(k,d-v,0),g=v.x,h=v.y,v=d,l=0):v=Nu(a,v,l),0>l&&(g-=l,l=0),135y&&(y=Pu(k,0,w-y),g=y.x,h=y.y,y=w,u=0):y=Ou(a,y,u),0>u&&(h-=u,u=0),g+=d+c);if(0e[0].x?e[2].assign(e[1]):e[1].assign(e[2])),e[3].ye[0].x?e[3].assign(e[2]):e[2].assign(e[3])),I[0].h(l+d,0),I[1].h(I[0].x,w),I[2].ye[0].y?e[2].assign(e[1]):e[1].assign(e[2])),e[3].xe[0].y?e[3].assign(e[2]):e[2].assign(e[3])),I[0].h(0,u+w),I[1].h(d,I[0].y),I[2].xd?Du(a,b,e,G,z,A):Eu(a,b,e,G,z,A);G=A.x;z=A.width;A=A.height;break;case tu:for(p=0;pp&&(Dp&&(Mn&&(n=0),135v&&(v=0));b.la.h(n,v);b.Da.h(z,A)}}Ot.prototype.customAlignment=function(a,b,c,d,e){return[b,c,d,e]}; function Du(a,b,c,d,e,f){var g=c.length;if(0===g)return new N(d,0,e,f);if(1===g)return b=c[0],e=b.Da.width,f=b.Da.height,new N(d,0,e,f);for(var h=b.nodeSpacing,k=b.rowSpacing,l=90===Au(b),m=0,n=0,p=0,q=0;ql&&(e-=l),f=Math.max(f,Math.max(q,p)+a+g.height),0>c.S.x&&(d=Ru(b,c.S.x,!1,d,h))):(c.S.h(e+a,d+h/2-c.focus.y-c.la.y),e=Math.max(e,Math.max(r,n)+a+g.width),p=d+h/2-c.focus.y-c.la.y,f=Math.max(f,p+g.height),0>p&&(f-=p),0>c.S.y&&(d=Ru(b,c.S.y,!0,d,h))));return new N(d,0,e,f)} function Eu(a,b,c,d,e,f){var g=c.length;if(0===g)return new N(d,0,e,f);if(1===g)return c=c[0],e=c.Da.width,f=c.Da.height,new N(d,0,e,f);for(var h=b.nodeSpacing,k=b.rowSpacing,l=270===Au(b),m=0,n=0,p=0,q=0;qn&&(e-=n),f=Math.max(f,Math.abs(Math.min(q,p))+a+m.height),0>k.S.x&&(d=Ru(b,k.S.x,!1,d,h))):(k.S.h(-e-m.width-a,d+h/2-k.focus.y-k.la.y),e=Math.max(e,Math.abs(Math.min(r,n))+a+m.width),p=d+h/2-k.focus.y-k.la.y,f=Math.max(f,p+m.height),0>p&&(f-=p),0>k.S.y&&(d=Ru(b,k.S.y,!0,d,h))));for(b=0;bb&&(b=c+a.width),0>c&&(b-=c),b;case Bu:return a.width>b?a.width:b;case Cu:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case qu:case gu:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case tu:return a.width-a.focus.x+a.nodeSpacing/2+b;case uu:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} function Ou(a,b,c){switch(a.alignment){case Mu:case Lu:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case Bu:return a.height>b?a.height:b;case Cu:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case qu:case gu:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case tu:return a.height-a.focus.y+a.nodeSpacing/2+b;case uu:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} function Pu(a,b,c){switch(a){case Lu:b/=2;c/=2;break;case Mu:b/=2;c/=2;break;case Bu:c=b=0;break;case Cu:break;default:C("Unhandled alignment value "+a.toString())}return new J(b,c)}function Gu(a,b,c,d,e,f){b=Pu(b,c,d);Ju(a,b.x,b.y,e,f)}function Ju(a,b,c,d,e){if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].S;f.x+=b;f.y+=c}} function Hu(a,b,c,d){var e=b.parent;switch(a.ud){case Qt:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case Xt:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:C("Unhandled path value "+a.ud.toString())}}function Ku(a,b,c){for(var d=0;dn.length||null===q||2>q.length))for(e=c=0;cl&&f.yf.y&&lb.length||null===c||2>c.length)d=null;else{m=Fu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x+e,l.y);c=Fu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Fu(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=Fu(a,e);for(c=0;cn.length||null===q||2>q.length))for(e=c=0;ck&&f.xf.x&&kb.length||null===c||2>c.length)d=null;else{m=Fu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x,l.y+e);c=Fu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Fu(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=Fu(a,e);for(c=0;c=a?0:135>=a?90:225>=a?180:315>=a?270:0}Ot.prototype.computeLayerSpacing=function(a){var b=Au(a);b=90===b||270===b;var c=a.layerSpacing;if(0=a&&(this.W.nodeIndentPastParent=a,this.C())}},nodeSpacing:{get:function(){return this.W.nodeSpacing},set:function(a){this.W.nodeSpacing!==a&&(this.W.nodeSpacing=a,this.C())}},layerSpacing:{get:function(){return this.W.layerSpacing},set:function(a){this.W.layerSpacing!== a&&(this.W.layerSpacing=a,this.C())}},layerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(a){this.W.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.W.layerSpacingParentOverlap=a,this.C())}},compaction:{get:function(){return this.W.compaction},set:function(a){this.W.compaction===a||a!==xu&&a!==zu||(this.W.compaction=a,this.C())}},breadthLimit:{get:function(){return this.W.breadthLimit}, set:function(a){this.W.breadthLimit!==a&&0<=a&&(this.W.breadthLimit=a,this.C())}},rowSpacing:{get:function(){return this.W.rowSpacing},set:function(a){this.W.rowSpacing!==a&&(this.W.rowSpacing=a,this.C())}},rowIndent:{get:function(){return this.W.rowIndent},set:function(a){this.W.rowIndent!==a&&0<=a&&(this.W.rowIndent=a,this.C())}},commentSpacing:{get:function(){return this.W.commentSpacing},set:function(a){this.W.commentSpacing!== a&&(this.W.commentSpacing=a,this.C())}},commentMargin:{get:function(){return this.W.commentMargin},set:function(a){this.W.commentMargin!==a&&(this.W.commentMargin=a,this.C())}},setsPortSpot:{get:function(){return this.W.setsPortSpot},set:function(a){this.W.setsPortSpot!==a&&(this.W.setsPortSpot=a,this.C())}},portSpot:{get:function(){return this.W.portSpot},set:function(a){this.W.portSpot.D(a)||(this.W.portSpot= a,this.C())}},setsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(a){this.W.setsChildPortSpot!==a&&(this.W.setsChildPortSpot=a,this.C())}},childPortSpot:{get:function(){return this.W.childPortSpot},set:function(a){this.W.childPortSpot.D(a)||(this.W.childPortSpot=a,this.C())}},alternateSorting:{get:function(){return this.Y.sorting},set:function(a){this.Y.sorting===a||a!==lu&&a!==mu&& a!==nu&&!ou||(this.Y.sorting=a,this.C())}},alternateComparer:{get:function(){return this.Y.comparer},set:function(a){this.Y.comparer!==a&&(this.Y.comparer=a,this.C())}},alternateAngle:{get:function(){return this.Y.angle},set:function(a){this.Y.angle===a||0!==a&&90!==a&&180!==a&&270!==a||(this.Y.angle=a,this.C())}},alternateAlignment:{get:function(){return this.Y.alignment},set:function(a){this.Y.alignment!== a&&(this.Y.alignment=a,this.C())}},alternateNodeIndent:{get:function(){return this.Y.nodeIndent},set:function(a){this.Y.nodeIndent!==a&&0<=a&&(this.Y.nodeIndent=a,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.Y.nodeIndentPastParent},set:function(a){this.Y.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.Y.nodeIndentPastParent=a,this.C())}},alternateNodeSpacing:{get:function(){return this.Y.nodeSpacing}, set:function(a){this.Y.nodeSpacing!==a&&(this.Y.nodeSpacing=a,this.C())}},alternateLayerSpacing:{get:function(){return this.Y.layerSpacing},set:function(a){this.Y.layerSpacing!==a&&(this.Y.layerSpacing=a,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.Y.layerSpacingParentOverlap},set:function(a){this.Y.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.Y.layerSpacingParentOverlap=a,this.C())}},alternateCompaction:{ get:function(){return this.Y.compaction},set:function(a){this.Y.compaction===a||a!==xu&&a!==zu||(this.Y.compaction=a,this.C())}},alternateBreadthLimit:{get:function(){return this.Y.breadthLimit},set:function(a){this.Y.breadthLimit!==a&&0<=a&&(this.Y.breadthLimit=a,this.C())}},alternateRowSpacing:{get:function(){return this.Y.rowSpacing},set:function(a){this.Y.rowSpacing!==a&&(this.Y.rowSpacing=a,this.C())}},alternateRowIndent:{ get:function(){return this.Y.rowIndent},set:function(a){this.Y.rowIndent!==a&&0<=a&&(this.Y.rowIndent=a,this.C())}},alternateCommentSpacing:{get:function(){return this.Y.commentSpacing},set:function(a){this.Y.commentSpacing!==a&&(this.Y.commentSpacing=a,this.C())}},alternateCommentMargin:{get:function(){return this.Y.commentMargin},set:function(a){this.Y.commentMargin!==a&&(this.Y.commentMargin=a,this.C())}},alternateSetsPortSpot:{ get:function(){return this.Y.setsPortSpot},set:function(a){this.Y.setsPortSpot!==a&&(this.Y.setsPortSpot=a,this.C())}},alternatePortSpot:{get:function(){return this.Y.portSpot},set:function(a){this.Y.portSpot.D(a)||(this.Y.portSpot=a,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.Y.setsChildPortSpot},set:function(a){this.Y.setsChildPortSpot!==a&&(this.Y.setsChildPortSpot=a,this.C())}},alternateChildPortSpot:{ get:function(){return this.Y.childPortSpot},set:function(a){this.Y.childPortSpot.D(a)||(this.Y.childPortSpot=a,this.C())}}}); var Pt=new E(Ot,"PathDefault",-1),Qt=new E(Ot,"PathDestination",0),Xt=new E(Ot,"PathSource",1),lu=new E(Ot,"SortingForwards",10),mu=new E(Ot,"SortingReverse",11),nu=new E(Ot,"SortingAscending",12),ou=new E(Ot,"SortingDescending",13),Lu=new E(Ot,"AlignmentCenterSubtrees",20),Mu=new E(Ot,"AlignmentCenterChildren",21),Bu=new E(Ot,"AlignmentStart",22),Cu=new E(Ot,"AlignmentEnd",23),qu=new E(Ot,"AlignmentBus",24),gu=new E(Ot,"AlignmentBusBranching",25),tu=new E(Ot,"AlignmentTopLeftBus",26),uu=new E(Ot, "AlignmentBottomRightBus",27),xu=new E(Ot,"CompactionNone",30),zu=new E(Ot,"CompactionBlock",31),Rt=new E(Ot,"StyleLayered",40),ku=new E(Ot,"StyleLastParents",41),ju=new E(Ot,"StyleAlternating",42),iu=new E(Ot,"StyleRootOnly",43),Tt=new E(Ot,"ArrangementVertical",50),Tu=new E(Ot,"ArrangementHorizontal",51),Wt=new E(Ot,"ArrangementFixedRoots",52),St=new E(Ot,"LayerIndividual",60),eu=new E(Ot,"LayerSiblings",61),du=new E(Ot,"LayerUniform",62);Ot.className="TreeLayout";Ot.PathDefault=Pt; Ot.PathDestination=Qt;Ot.PathSource=Xt;Ot.SortingForwards=lu;Ot.SortingReverse=mu;Ot.SortingAscending=nu;Ot.SortingDescending=ou;Ot.AlignmentCenterSubtrees=Lu;Ot.AlignmentCenterChildren=Mu;Ot.AlignmentStart=Bu;Ot.AlignmentEnd=Cu;Ot.AlignmentBus=qu;Ot.AlignmentBusBranching=gu;Ot.AlignmentTopLeftBus=tu;Ot.AlignmentBottomRightBus=uu;Ot.CompactionNone=xu;Ot.CompactionBlock=zu;Ot.StyleLayered=Rt;Ot.StyleLastParents=ku;Ot.StyleAlternating=ju;Ot.StyleRootOnly=iu;Ot.ArrangementVertical=Tt; Ot.ArrangementHorizontal=Tu;Ot.ArrangementFixedRoots=Wt;Ot.LayerIndividual=St;Ot.LayerSiblings=eu;Ot.LayerUniform=du;function Ut(a){uq.call(this,a)}la(Ut,uq);Ut.prototype.createVertex=function(){return new Vt(this)};Ut.prototype.createEdge=function(){return new Vu(this)};Ut.className="TreeNetwork"; function Vt(a){xq.call(this,a);this.V=!1;this.hb=null;this.u=[];this.nb=this.Ha=this.F=this.ia=0;this.td=null;this.S=new J(0,0);this.Da=new L(0,0);this.la=new J(0,0);this.im=this.hm=this.qA=!1;this.kp=this.Yo=null;this.nd=lu;this.hd=Eq;this.Kb=0;this.Jb=Mu;this.Vq=this.Uq=0;this.Wq=20;this.ie=50;this.Aq=0;this.Hp=zu;this.Ap=0;this.nr=25;this.Gp=this.mr=10;this.Fp=20;this.xr=!0;this.dr=Sc;this.wr=!0;this.Dp=Sc}la(Vt,xq); Vt.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.nd=a.sorting,this.hd=a.comparer,this.Kb=a.angle,this.Jb=a.alignment,this.Uq=a.nodeIndent,this.Vq=a.nodeIndentPastParent,this.Wq=a.nodeSpacing,this.ie=a.layerSpacing,this.Aq=a.layerSpacingParentOverlap,this.Hp=a.compaction,this.Ap=a.breadthLimit,this.nr=a.rowSpacing,this.mr=a.rowIndent,this.Gp=a.commentSpacing,this.Fp=a.commentMargin,this.xr=a.setsPortSpot,this.dr=a.portSpot,this.wr=a.setsChildPortSpot,this.Dp=a.childPortSpot)}; ma.Object.defineProperties(Vt.prototype,{initialized:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},parent:{get:function(){return this.hb},set:function(a){this.hb!==a&&(this.hb=a)}},children:{get:function(){return this.u},set:function(a){if(this.u!==a){if(null!==a)for(var b=a.length,c=0;cq.y+c.rowIndent&&(f=Math.min(f,Math.max(n.y,f-b.computeNodeIndent(c))))):c.alignment===Bu?(f=d.top+e.y,0===e.y&&n.yq.x+c.rowIndent&&(f=Math.min(f,Math.max(n.x,f-b.computeNodeIndent(c))))):c.alignment===Bu?(f=d.left+e.x,0===e.x&&n.xq.y+c.rowIndent&&(f=Math.min(f,Math.max(n.y,f-b.computeNodeIndent(c))))):c.alignment===Bu?(f=d.top+e.y,0===e.y&&n.yq.x+c.rowIndent&&(f=Math.min(f,Math.max(n.x,f-b.computeNodeIndent(c))))): c.alignment===Bu?(f=d.left+e.x,0===e.x&&n.x