/*
 * GoJS v1.8.13 JavaScript Library for HTML Diagrams
 * Northwoods Software, https://www.nwoods.com/
 * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
 * Copyright (C) 1998-2018 by Northwoods Software Corporation.  All Rights Reserved.
 * THIS SOFTWARE IS LICENSED.  THE LICENSE AGREEMENT IS AT: https://gojs.net/1.8.13/doc/license.html.
 */
(function(window) {
    var f, ba = {};
    if (!window.document || void 0 === window.document.createElement("canvas").getContext) throw window.console && window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."), Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.");
    if (!Object.defineProperty) throw Error("GoJS requires a newer version of JavaScript");
    Function.prototype.bind || (Function.prototype.bind = function(a) {
        function b() { return g.apply(a, e.concat(d.call(arguments))) }

        function c() {}
        var d = Array.prototype.slice,
            e = d.call(arguments, 1),
            g = this;
        c.prototype = this.prototype;
        b.prototype = new c;
        return b
    });
    (function() {
        for (var a = 0, b = ["ms", "moz", "webkit", "o"], c = 0; c < b.length && !window.requestAnimationFrame; ++c) window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"];
        window.requestAnimationFrame || (window.requestAnimationFrame = function(b) {
            var c = (new Date).getTime(),
                g = Math.max(8, 16 - (c - a)),
                h = window.setTimeout(function() { b(c + g) }, g);
            a = c + g;
            return h
        });
        window.cancelAnimationFrame || (window.cancelAnimationFrame =
            function(a) { window.clearTimeout(a) })
    })();
    var v = {
        Dj: !1,
        WA: !1,
        AF: !1,
        JI: !1,
        lM: !1,
        $F: !1,
        lu: null,
        enableBoundsInfo: function(a) {
            v.Dj = !0;
            a && a.ro()
        },
        disableBoundsInfo: function(a) {
            v.Dj = !1;
            a && (a.dd.De(!0), a.ro())
        },
        xF: function(a, b) {
            void 0 === a && (a = v.lu);
            void 0 === b && (b = a.pm("").rb);
            var c = b.length,
                d = a.dd;
            d.fillStyle = "rgba(255,255,0,.3)";
            for (var e = 0; e < c; e++) {
                var g = b.fa(e),
                    h = g.aa;
                if (g instanceof x) v.xF(a, g.xa);
                else {
                    var k = g.Ni.copy();
                    k.GB(g.Nc);
                    d.save();
                    d.transform(k.m11, k.m12, k.m21, k.m22, k.dx, k.dy);
                    d.fillRect(h.x, h.y, h.width, h.height);
                    d.restore()
                }
            }
        },
        yF: function(a,
            b) {
            a || (a = v.lu);
            b || (b = a.pm("").rb);
            var c = a.dd,
                d = b.length;
            c.fillStyle = "rgba(0,0,255,.3)";
            for (var e = 0; e < d; e++) {
                var g = b.fa(e),
                    h = g.Ga,
                    k = g.Ni;
                g instanceof x ? v.yF(a, g.xa) : (c.save(), c.transform(k.m11, k.m12, k.m21, k.m22, k.dx, k.dy), c.fillRect(h.x, h.y, h.width, h.height), c.restore())
            }
        },
        EI: function(a, b) {
            a || (a = v.lu);
            b || (b = a.pm("").rb);
            var c = a.dd,
                d = b.length;
            c.fillStyle = "rgba(0,0,255,.3)";
            for (var e = 0; e < d; e++) {
                var g = b.fa(e),
                    h = g.Fa,
                    k = g.Ni;
                g instanceof x ? v.EI(a, g.xa) : (c.save(), c.transform(k.m11, k.m12, k.m21, k.m22, k.dx,
                    k.dy), c.fillRect(h.x || 0, h.y || 0, h.width, h.height), c.restore())
            }
        },
        LL: function() {
            v.yF();
            v.xF()
        },
        ML: function(a) {
            a || (a = v.lu);
            var b = a.kd;
            a = a.dd;
            a.strokeStyle = "rgba(0,255,0,.9)";
            a.rect(b.x, b.y, b.width, b.height);
            a.stroke()
        },
        zF: function(a, b) {
            b.fillStyle = "red";
            b.fillRect(0, 0, 8, 8);
            b.lineWidth = 8;
            b.strokeStyle = "rgba(255,255,0,.6)";
            var c = a.wb;
            b.rect(c.x, c.y, c.width, c.height);
            b.stroke();
            b.fillStyle = "rgba(0,255,0,.2)";
            b.fillRect(a.kd.x, a.kd.y, a.kd.width, a.kd.height)
        },
        FI: function(a, b) {
            b instanceof da || (a.lineWidth =
                2, a.strokeStyle = "rgba(255,0,0,.5)", a.rect(b.bc.x, b.bc.y, b.bc.width, b.bc.height), a.stroke(), b instanceof z && (a.strokeStyle = b.stroke, a.lineWidth = b.lb), null !== b.R && b.R.type === fa && (a.lineWidth = 1, a.strokeStyle = "rgba(10,200,10,.6)", b instanceof z && (a.strokeStyle = b.stroke, a.lineWidth = b.lb)))
        },
        GI: function(a, b) {
            a.lineWidth = 1;
            a.strokeStyle = "rgba(0,0,255,.5)";
            a.rect(b.Ga.x, b.Ga.y, b.Ga.width, b.Ga.height);
            a.stroke();
            void 0 !== b.stroke && (a.strokeStyle = b.stroke);
            void 0 !== b.Rg && (a.lineWidth = b.Rg)
        },
        VA: function(a, b,
            c) {
            a.setTransform(1, 0, 0, 1, 0, 0);
            a.scale(b.ud, b.ud);
            a.transform(c.m11, c.m12, c.m21, c.m22, c.dx, c.dy);
            c = b.dc.length;
            for (var d = 0; d < c; d++)
                for (var e = b.dc.fa(d), g = e.rb.length, h = 0; h < g; h++) {
                    var k = e.rb.fa(h);
                    if (void 0 !== k.location && null !== k.location) {
                        if (k.location.H()) {
                            var l = k.location.x,
                                m = k.location.y;
                            a.beginPath();
                            a.strokeStyle = "limegreen";
                            a.lineWidth = 2;
                            a.moveTo(l, m + 6);
                            a.lineTo(l, m);
                            a.lineTo(l + 6, m);
                            a.moveTo(l, m);
                            a.lineTo(l + 10, m + 20);
                            a.stroke()
                        }
                        l = k.position.x;
                        m = k.position.y;
                        a.beginPath();
                        a.strokeStyle = "red";
                        a.lineWidth = 2;
                        a.moveTo(l, m + 6);
                        a.lineTo(l, m);
                        a.lineTo(l + 6, m);
                        a.moveTo(l, m);
                        a.lineTo(l + 20, m + 10);
                        a.stroke()
                    }
                }
            a.setTransform(1, 0, 0, 1, 0, 0)
        },
        NL: function(a, b, c) {
            var d = a.length;
            b.fillStyle = "rgba(255,0,0,.1)";
            for (var e = 0; e < d; e++) {
                var g, h = a[e];
                g = c.Nc;
                var k = h.x,
                    l = h.y,
                    m = k + h.width,
                    n = l + h.height,
                    p = g.m11,
                    q = g.m12,
                    r = g.m21,
                    s = g.m22,
                    u = g.dx,
                    t = g.dy,
                    y = k * p + l * r + u,
                    h = k * q + l * s + t;
                g = m * p + l * r + u;
                var l = m * q + l * s + t,
                    w = k * p + n * r + u,
                    k = k * q + n * s + t,
                    p = m * p + n * r + u,
                    m = m * q + n * s + t,
                    n = y,
                    q = h,
                    n = Math.min(n, g),
                    y = Math.max(y, g),
                    q = Math.min(q, l),
                    h = Math.max(h, l),
                    n =
                    Math.min(n, w),
                    y = Math.max(y, w),
                    q = Math.min(q, k),
                    h = Math.max(h, k),
                    n = Math.min(n, p),
                    y = Math.max(y, p),
                    q = Math.min(q, m),
                    h = Math.max(h, m);
                g = new C(n, q, y - n, h - q);
                b.fillRect(g.x, g.y, g.width, g.height)
            }
        },
        HI: function(a, b, c, d, e) {
            a.fillStyle = "rgba(0,255,0,.2)";
            a.fillRect(b, c, d, e)
        },
        II: function(a, b, c) {
            a.save();
            var d = b.Nc;
            d.reset();
            1 !== b.scale && d.scale(b.scale);
            b = b.position;
            0 === b.x && 0 === b.y || d.translate(-b.x, -b.y);
            a.setTransform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
            c = c.gd.o;
            d = c.length;
            for (b = 0; b < d; b++) {
                var e = c[b];
                a.beginPath();
                a.moveTo(e.x - 4, e.y);
                a.lineTo(e.x + 4, e.y);
                a.moveTo(e.x, e.y - 4);
                a.lineTo(e.x, e.y + 4);
                a.lineWidth = 2;
                a.strokeStyle = "rgba(255,0,0,.9)";
                a.stroke()
            }
            a.restore()
        },
        JL: function(a) { a || (a = v.lu); for (a = a.ao; a.next();) D.trace(a.value.toString()) },
        zM: function(a, b) {
            var c = b.dp(a),
                d = b.cc;
            d.te = b.pC(c);
            d.ha = c;
            return ga(b, d, a)
        },
        uM: function(a, b) { b.Je(a.ha) && (b.dd.fillStyle = "lime", b.dd.fillRect(a.te.x, a.te.y, 1 * b.scale, 1 * b.scale)) },
        vM: function(a) {
            var b = ha(a, !1, null, null);
            if (!b.vq) {
                var c = a.wb,
                    d = a.scale;
                a = a.dd;
                for (var e = 0; e <= b.zn; e++)
                    for (var g =
                            0; g <= b.An; g++) {
                        var h = b.sd[e][g];
                        if (0 !== h) {
                            var k = (e * b.he + b.$f - c.x) * d,
                                l = (g * b.Rd + b.ag - c.y) * d;
                            0 !== h && (a.fillStyle = "rgba(255, 0, 0, .2)", a.fillRect(k, l, b.he * d, b.Rd * d));
                            999999 <= h || (h %= 10, a.fillStyle = "blue", a.fillText(h.toString(), k, l + b.Rd))
                        }
                    }
            }
        },
        dumpReferences: function(a) {
            if (a instanceof E)
                for (a = a.ao; a.next();) {
                    var b = a.value;
                    D.trace(b.toString());
                    for (b = b.Hi; b.next();) v.dumpReferences(b.value)
                } else if (a instanceof F) {
                    D.trace("References for " + a);
                    null !== a.layer && D.trace("  " + a.layer.toString() + ' LayerName: "' +
                        a.Nf + '"');
                    a.to !== a && D.trace("  SelectionObject: " + a.to.toString() + ' SelectionObjectName: "' + a.Py + '"');
                    a.Bf !== a && D.trace("  LocationObject: " + a.Bf.toString() + ' LocationObjectName: "' + a.uy + '"');
                    if (a.lh) {
                        for (var b = "", c = a.lh.j; c.next();) b += c.key + " ";
                        D.trace("  Adornments: " + b)
                    }
                    null !== a.Ka && D.trace("  ContainingGroup: " + a.Ka.toString());
                    if (a instanceof G) {
                        if (0 < a.Od.count) {
                            b = "";
                            for (c = a.Od; c.next();) b += c.value.toString() + ", ";
                            D.trace("  Links: " + b)
                        }
                        null !== a.Xb && D.trace("  LabeledLink: " + a.Xb.toString());
                        if (a instanceof I) {
                            D.trace("  Placeholder: " + a.placeholder);
                            b = "";
                            for (c = a.uc; c.next();) b += c.value.toString() + ", ";
                            D.trace("  Members: " + b);
                            b = "";
                            for (c = a.gn.j; c.next();) b += c.value.toString() + ", ";
                            D.trace("  NestedGroups: " + b);
                            D.trace("  Layout: " + a.Yb)
                        }
                    } else if (a instanceof J) {
                        D.trace("  Path: " + a.path);
                        D.trace("  From: " + a.$ + " " + a.oc + ' "' + a.hg + '"');
                        D.trace("  To: " + a.ba + " " + a.Gc + ' "' + a.jh + '"');
                        b = "";
                        for (a = a.Af; a.next();) b += a.value.toString() + ", ";
                        D.trace("  LabelNodes: " + b)
                    }
                }
        },
        dumpVisualTree: function(a) {
            if (a instanceof E)
                for (a = a.ao; a.next();) {
                    var b = a.value;
                    D.trace(b.toString());
                    for (b = b.Hi; b.next();) v.dumpVisualTree(b.value)
                } else a instanceof F && (b = " ", a.nF && (b += "c"), a.rF && (b += "d"), a.YF && (b += "g"), a.zG && (b += "m"), a.OG && (b += "h"), a.PG && (b += "z"), a.UG && (b += "o"), a.il && (b += "s"), a.kH && (b += "t"), a.$G && (b += "A"), a.hy && (b += "B"), a.tB && (b += "L"), a.ib && (b += "S"), a.dl && (b += "H"), v.sD(a, 1, b))
        },
        sD: function(a, b, c) {
            for (var d = "", e = 0; e < b; e++) d += "  ";
            d += a.toString();
            c && (d += c);
            c = a.name ? ' "' + a.name + '" ' : " ";
            c = a.visible ? c + "v" : c + "!v";
            c = a.tg ? c +
                "p" : c + "!p";
            a.Ue && (c += "m");
            a.Hu && (c += "a");
            d += c;
            if (0 !== a.Sb || 0 !== a.column) d += " [" + a.Sb + "," + a.column + "]";
            d += " " + a.aa.toString();
            a.Ea.H() && (d += " d:" + a.Ea.toString());
            a.Ga.H() && (d += " n:" + a.Ga.toString());
            1 !== a.scale && (d += " s:" + a.scale);
            0 !== a.angle && (d += " a:" + a.angle);
            null !== a.background && (d += " b:" + a.background.toString());
            null !== a.gm && (d += " a:" + a.background.toString());
            a instanceof x && (d += " elts:" + a.xa.count, a.isEnabled || (d += " !ENABLED"), a.yq && (d += " CLIPPING"), 0 !== a.qH && (d += " top:" + a.qH), 0 !== a.sG && (d +=
                " left:" + a.sG), null !== a.el && (d += " itemArray#:" + D.cb(a.el)), a.oG && (d += " cat:" + a.oG), null !== a.data && (d += " data:" + a.data));
            null !== a.yd && (d += ' portId: "' + a.yd + '"');
            D.trace(d);
            if (a instanceof x)
                for (a = a.elements; a.next();) v.sD(a.value, b + 1, "")
        },
        PL: function(a) {
            D.trace("DelayedReferences (" + a.zg.count + ")");
            for (a = a.zg.j; a.next();) {
                for (var b = "", c = a.value.j; c.next();) b += ia(c.value) + ", ";
                D.trace("  " + a.key + ": " + b)
            }
        },
        fF: function(a, b) {
            if (!D.Qa(b) || b instanceof Element || b instanceof CanvasRenderingContext2D || b instanceof ja || b instanceof ma) return "";
            var c = "",
                d;
            for (d in b)
                if ("string" !== typeof d) "" === c && (c = b + "\n"), c += "  " + d + " is not a string property\n";
                else if ("_" !== d.charAt(0) && !(2 >= d.length)) {
                var e = D.xb(b, d);
                if (null !== e && "function" !== typeof e) {
                    if (b.hasOwnProperty(d)) { var g = Object.getPrototypeOf(b); if (g && g.Rw && g.Rw[d]) continue } else if (D.by(b, d)) continue;
                    "" === c && (c = b + "\n");
                    c += '  unknown property "' + d + '" has value: ' + e + " at " + a + "\n"
                }
            }
            return c
        },
        Hx: function(a, b) {
            if (null !== b && void 0 !== b && "number" !== typeof b && "string" !==
                typeof b && "boolean" !== typeof b && "function" !== typeof b)
                if (void 0 !== D.Nd(b)) {
                    if (!v.gx.contains(b))
                        if (v.gx.add(b), v.Fw.add(v.fF(a, b)), b instanceof K || b instanceof L || b instanceof oa)
                            for (var c = b.j; c.next();) v.Hx(a + "[" + c.key + "]", c.value);
                        else
                            for (c in b) {
                                var d = D.xb(b, c);
                                if (void 0 !== d && null !== d && D.Qa(d) && d !== b.Rw) {
                                    if (b instanceof pa) { if (d === b.sf) continue } else if (b instanceof x) { if ("data" === c || d === b.Sd) continue; if ("itemArray" === c || d === b.ej) continue; if (b instanceof F && d === b.Sl) continue } else if (!(b instanceof E))
                                        if (b instanceof qa) { if ("archetypeGroupData" === c || d === b.nz) continue } else if (b instanceof ra) { if ("archetypeLinkData" === c || d === b.pz) continue; if ("archetypeLabelNodeData" === c || d === b.oz) continue } else if (b instanceof ta) { if ("archetypeNodeData" === c || d === b.yl) continue } else if (b instanceof M) { if ("nodeDataArray" === c || d === b.ze) continue; if ("linkDataArray" === c || d === b.df || d === b.ki) continue; if (d === b.Kc) continue; if (d === b.zg) continue } else if (b instanceof ua || b instanceof va || b instanceof wa) continue;
                                    v.Hx(a + "." +
                                        c, d)
                                }
                            }
                } else if (Array.isArray(b))
                for (c = 0; c < b.length; c++) v.Hx(a + "[" + c + "]", b[c]);
            else v.Fw.add(v.fF(a, b))
        },
        checkProperties: function(a) {
            void 0 === v.gx ? v.gx = new L(Object) : v.gx.clear();
            v.Fw = new xa;
            v.Hx("", a);
            a = v.Fw.toString();
            v.Fw = null;
            return a
        }
    };
    ba.Debug = v;
    var D = {
        Ad: 1,
        bd: 2,
        rd: 4,
        qd: 8,
        Xn: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("534.30") && 0 < window.navigator.userAgent.indexOf("Android"),
        Mu: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 9.0"),
        zq: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 10.0"),
        Aq: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Trident/7"),
        rB: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Edge/"),
        Qh: void 0 !== window.navigator && void 0 !==
            window.navigator.platform && 0 <= window.navigator.platform.toUpperCase().indexOf("MAC"),
        iG: void 0 !== window.navigator && void 0 !== window.navigator.platform && null !== window.navigator.platform.match(/(iPhone|iPod|iPad)/i),
        oF: function(a, b, c) {
            var d = -1;
            return function() {
                var e = this,
                    g = arguments; - 1 !== d && D.clearTimeout(d);
                d = D.setTimeout(function() {
                    d = -1;
                    c || a.apply(e, g)
                }, b);
                c && !d && a.apply(e, g)
            }
        },
        setTimeout: function(a, b) { return window.setTimeout(a, b) },
        clearTimeout: function(a) { window.clearTimeout(a) },
        createElement: function(a) { return window.document.createElement(a) },
        k: function(a) { throw Error(a); },
        qa: function(a, b) {
            var c = "The object is frozen, so its properties cannot be set: " + a.toString();
            void 0 !== b && (c += "  to value: " + b);
            D.k(c)
        },
        l: function(a, b, c, d) { a instanceof b || (c = D.getTypeName(c), void 0 !== d && (c += "." + d), D.kc(a, b, c)) },
        h: function(a, b, c, d) { typeof a !== b && (c = D.getTypeName(c), void 0 !== d && (c += "." + d), D.kc(a, b, c)) },
        p: function(a, b, c) {
            "number" === typeof a && isFinite(a) || (b = D.getTypeName(b), void 0 !== c && (b += "." + c), D.k(b + " must be a real number type, and not NaN or Infinity: " +
                a))
        },
        Da: function(a, b, c, d) { a instanceof ya && a.Qe === b || (c = D.getTypeName(c), void 0 !== d && (c += "." + d), D.kc(a, "a constant of class " + D.wf(b), c)) },
        hu: function(a, b) { "string" === typeof a ? za(a) || D.k('Color "' + a + '" is not a valid color string for ' + b) : a instanceof Ba || D.k("Value for " + b + " must be a color string or a Brush, not " + a) },
        kc: function(a, b, c, d) {
            b = D.getTypeName(b);
            c = D.getTypeName(c);
            void 0 !== d && (c += "." + d);
            "string" === typeof a ? D.k(c + " value is not an instance of " + b + ': "' + a + '"') : D.k(c + " value is not an instance of " +
                b + ": " + a)
        },
        ua: function(a, b, c, d) {
            c = D.getTypeName(c);
            void 0 !== d && (c += "." + d);
            D.k(c + " is not in the range " + b + ": " + a)
        },
        zd: function(a) { D.k(D.wf(a) + " constructor cannot take any arguments.") },
        Va: function(a) { D.k("Collection was modified during iteration: " + a.toString() + "\n  Perhaps you should iterate over a copy of the collection,\n  or you could collect items to be removed from the collection after the iteration.") },
        ak: function(a, b) { D.k("No property to set for this enum value: " + b + " on " + a.toString()) },
        trace: function(a) { window.console && window.console.log(a) },
        Qx: {},
        On: function(a, b) {!0 !== D.Qx[a] && (D.Qx[a] = !0, window.console && window.console.log(a + " is deprecated in " + b + ", see the GoJS change log for more information.")) },
        Qa: function(a) { return "object" === typeof a && null !== a },
        isArray: function(a) { return Array.isArray(a) || a instanceof NodeList || a instanceof HTMLCollection },
        qJ: function(a) { return Array.isArray(a) },
        gu: function(a, b, c) { D.isArray(a) || D.kc(a, "Array or NodeList or HTMLCollection", b, c) },
        cb: function(a) { return a.length },
        km: function(a) { return Array.prototype.slice.call(a) },
        La: function(a, b) { Array.isArray(a); return a[b] },
        cF: function(a, b, c) { Array.isArray(a) ? a[b] = c : D.k("Cannot replace an object in an HTMLCollection or NodeList at " + b) },
        hm: function(a, b) {
            if (Array.isArray(a)) return a.indexOf(b);
            for (var c = a.length, d = 0; d < c; d++)
                if (a[d] === b) return d;
            return -1
        },
        Ih: function(a, b, c) { Array.isArray(a) ? b >= a.length ? a.push(c) : a.splice(b, 0, c) : D.k("Cannot insert an object into an HTMLCollection or NodeList: " + c + " at " + b) },
        Vg: function(a,
            b) { Array.isArray(a) ? b >= a.length ? a.pop() : a.splice(b, 1) : D.k("Cannot remove an object from an HTMLCollection or NodeList at " + b) },
        ez: [],
        P: function() { var a = D.ez.pop(); return void 0 === a ? new N : a },
        Fb: function(a, b) {
            var c = D.ez.pop();
            if (void 0 === c) return new N(a, b);
            c.x = a;
            c.y = b;
            return c
        },
        A: function(a) { D.ez.push(a) },
        DC: [],
        Gm: function() { var a = D.DC.pop(); return void 0 === a ? new Ca : a },
        Zk: function(a) { D.DC.push(a) },
        fz: [],
        Sf: function() { var a = D.fz.pop(); return void 0 === a ? new C : a },
        vg: function(a, b, c, d) {
            var e = D.fz.pop();
            if (void 0 === e) return new C(a, b, c, d);
            e.x = a;
            e.y = b;
            e.width = c;
            e.height = d;
            return e
        },
        Lb: function(a) { D.fz.push(a) },
        EC: [],
        hh: function() { var a = D.EC.pop(); return void 0 === a ? new Ea : a },
        lf: function(a) { D.EC.push(a) },
        gz: null,
        v: function() { var a = D.gz; return null !== a ? (D.gz = null, a) : new Fa },
        u: function(a) {
            a.reset();
            D.gz = a
        },
        CC: [],
        mb: function() { var a = D.CC.pop(); return void 0 === a ? [] : a },
        ya: function(a) {
            a.length = 0;
            D.CC.push(a)
        },
        Do: Object.freeze([]),
        Km: 1,
        xc: function(a) { a.__gohashid = D.Km++ },
        sq: function(a) {
            var b = a.__gohashid;
            void 0 === b && (b = D.Km++, a.__gohashid = b);
            return b
        },
        Nd: function(a) { return a.__gohashid },
        ka: function(a, b) {
            b.vz = a;
            ba[a] = b
        },
        Ta: function(a, b) {
            function c() {}
            c.prototype = b.prototype;
            a.prototype = new c;
            a.prototype.constructor = a
        },
        Di: function(a) { a.PH = !0 },
        defineProperty: function(a, b, c, d, e) {
            D.h(a, "function", "Util.defineProperty:classfunc");
            D.h(b, "object", "Util.defineProperty:propobj");
            D.h(c, "function", "Util.defineProperty:getter");
            D.h(d, "function", "Util.defineProperty:setter");
            for (var g in b) {
                b = b[g];
                c = {
                    get: c,
                    set: d,
                    enumerable: !0
                };
                if (void 0 !== e)
                    for (var h in e) c[h] = e[h];
                Object.defineProperty(a.prototype, g, c);
                e = Object.getOwnPropertyDescriptor(a.prototype, g);
                b && e && Object.defineProperty(a.prototype, b, e);
                break
            }
        },
        NK: !1,
        w: function(a, b, c, d) {
            D.h(a, "function", "Util.defineReadOnlyProperty:classfunc");
            D.h(b, "object", "Util.defineReadOnlyProperty:propobj");
            D.h(c, "function", "Util.defineReadOnlyProperty:getter");
            for (var e in b) {
                var g = b[e];
                b = {
                    get: c,
                    set: function(a) {
                        D.k('The property "' + g + '" is read-only and cannot be set to ' +
                            a)
                    },
                    enumerable: !0
                };
                if (void 0 !== d)
                    for (var h in d) b[h] = d[h];
                Object.defineProperty(a.prototype, e, b);
                d = Object.getOwnPropertyDescriptor(a.prototype, e);
                g && d && Object.defineProperty(a.prototype, g, d);
                break
            }
        },
        me: function(a, b) {
            for (var c in b) b[c] = !0;
            a.prototype.Rw = b
        },
        getTypeName: function(a) { return void 0 === a ? "" : "string" === typeof a ? a : "function" === typeof a ? D.wf(a) : null === a ? "*" : "" },
        wf: function(a) {
            if ("function" === typeof a) {
                if (a.vz) return a.vz;
                if (a.name) return a.name;
                var b = a.toString(),
                    c = b.indexOf("("),
                    b = b.substring(9,
                        c).trim();
                if ("" !== b) return a.vz = b
            } else if (D.Qa(a) && a.constructor) return D.wf(a.constructor);
            return typeof a
        },
        s: function(a, b, c) {
            D.h(a, "function", "Util.defineEnumValue:classfunc");
            D.h(b, "string", "Util.defineEnumValue:name");
            D.h(c, "number", "Util.defineEnumValue:num");
            c = new ya(a, b, c);
            Object.freeze(c);
            a[b] = c;
            var d = a.zv;
            d instanceof oa || (d = new oa("string", ya), a.zv = d);
            d.add(b, c);
            return c
        },
        xb: function(a, b) {
            if (!a || !b) return null;
            var c = void 0;
            try {
                "function" === typeof b ? c = b(a) : "function" === typeof a.getAttribute ?
                    (c = a.getAttribute(b), null === c && (c = void 0)) : c = a[b]
            } catch (d) { v && D.trace("property get error: " + d.toString()) }
            return c
        },
        Ua: function(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) { v && D.trace("property set error: " + d.toString()) } },
        nv: function(a, b) {
            D.h(a, "object", "Setting properties requires Objects as arguments");
            D.h(b, "object", "Setting properties requires Objects as arguments");
            var c = a instanceof x,
                d = a instanceof E,
                e;
            for (e in b) {
                "" ===
                e && D.k("Setting properties requires non-empty property names");
                var g = a,
                    h = e;
                if (c || d) {
                    var k = e.indexOf(".");
                    if (0 < k) {
                        var l = e.substring(0, k);
                        if (c) g = a.Md(l);
                        else if (g = a[l], void 0 === g || null === g) g = a.nb[l];
                        D.Qa(g) ? h = e.substr(k + 1) : D.k("Unable to find object named: " + l + " in " + a.toString() + " when trying to set property: " + e)
                    }
                }
                if ("_" !== h[0] && !D.by(g, h))
                    if (d && "ModelChanged" === h) { a.ZH(b[h]); continue } else if (d && "Changed" === h) { a.Bn(b[h]); continue } else if (d && D.by(a.nb, h)) g = a.nb;
                else if (d && Ga(a, h)) { a.xx(h, b[h]); continue } else if (a instanceof M && "Changed" === h) { a.Bn(b[h]); continue } else D.k('Trying to set undefined property "' + h + '" on object: ' + g.toString());
                g[h] = b[e];
                "_" === h[0] && g instanceof O && g.WH(h)
            }
        },
        by: function(a, b) {
            if (a.hasOwnProperty(b)) return !0;
            for (var c = Object.getPrototypeOf(a); c && c !== Function;) {
                if (c.hasOwnProperty(b)) return !0;
                var d = c.Rw;
                if (d && d[b]) return !0;
                c = Object.getPrototypeOf(c)
            }
            return !1
        },
        bK: function(a) {
            for (var b = [], c = 0; 256 > c; c++) b[c] = c;
            for (var d = 0, e = 0, c = 0; 256 > c; c++) d = (d + b[c] + 119) % 256, e = b[c], b[c] = b[d], b[d] = e;
            for (var d = c = 0,
                    g = "", h = 0; h < a.length; h++) c = (c + 1) % 256, d = (d + b[c]) % 256, e = b[c], b[c] = b[d], b[d] = e, g += String.fromCharCode(a.charCodeAt(h) ^ b[(b[c] + b[d]) % 256]);
            return g
        },
        dJ: function(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);
            for (var d = [], e = 0, c = 0; c < a.length; c += 2) d[e++] = b[a.substr(c, 2)];
            a = d.join("");
            return "" === a ? "0" : a
        },
        Wg: function(a) { return D.bK(D.dJ(a)) },
        Im: null,
        adym: "7da71ca0ad381e90",
        vfo: "2be64efdb265",
        qL: "@COLOR1",
        rL: "@COLOR2",
        pF: !1,
        ju: null,
        ku: null
    };
    D.Im = function() {
        var a = window.document.createElement("canvas"),
            b = a.getContext("2d");
        b[D.Wg("7ca11abfd022028846")] = D.Wg("398c3597c01238");
        for (var c = ["5da73c80a36755dc038e4972187c3cae51fd22", "32ab5ff3b26f42dc0ed90f22432913b54ae6247590da4bb21c324ba3a84e385776", "54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387", "74bf19bce72555874c86"], d = 1; 5 > d; d++) b[D.Wg("7ca11abfd7330390")](D.Wg(c[d - 1]), 10, 15 * d + 0);
        b[D.Wg("7ca11abfd022028846")] = D.Wg("39f046ebb36e4b");
        for (d = 1; 5 > d; d++) b[D.Wg("7ca11abfd7330390")](D.Wg(c[d -
            1]), 10, 15 * d + 0);
        if (4 !== c.length || "5" !== c[0][0] || "7" !== c[3][0]) D.s = function(a, b) {
            var c = new ya(a, b, 2);
            Object.freeze(c);
            a[b] = c;
            var d = a.zv;
            d instanceof oa || (d = new oa("string", ya), a.zv = d);
            d.add(b, c);
            return c
        };
        return a
    }();

    function ya(a, b, c) {
        D.xc(this);
        this.OC = a;
        this.$b = b;
        this.TH = c
    }
    D.ka("EnumValue", ya);
    ya.prototype.toString = function() { return D.wf(this.OC) + "." + this.$b };
    D.w(ya, { Qe: "classType" }, function() { return this.OC });
    D.w(ya, { name: "name" }, function() { return this.$b });
    D.w(ya, { value: "value" }, function() { return this.TH });
    var Ha;
    ya.findName = Ha = function(a, b) {
        if (void 0 === b || null === b || "" === b) return null;
        D.h(a, "function", "findName:classfunc");
        D.h(b, "string", "EnumValue.findName:name");
        var c = a.zv;
        return c instanceof oa ? c.oa(b) : null
    };

    function xa() { this.NC = [] }
    xa.prototype.toString = function() { return this.NC.join("") };
    xa.prototype.add = function(a) { "" !== a && this.NC.push(a) };

    function ma() {}

    function Ia(a) {
        void 0 === a && (a = 42);
        this.seed = a;
        this.az = 48271;
        this.yv = 2147483647;
        this.BC = this.yv / this.az;
        this.BH = this.yv % this.az;
        this.AH = 1 / this.yv;
        this.random()
    }
    Ia.prototype.random = function() {
        var a = this.seed % this.BC * this.az - this.seed / this.BC * this.BH;
        this.seed = 0 < a ? a : a + this.yv;
        return this.seed * this.AH
    };

    function Ja() {}
    D.w(Ja, { j: "iterator" }, function() { return this });
    Ja.prototype.reset = Ja.prototype.reset = function() {};
    Ja.prototype.next = Ja.prototype.next = function() { return !1 };
    Ja.prototype.hasNext = function() { return !1 };
    Ja.prototype.first = Ja.prototype.first = function() { return null };
    Ja.prototype.any = function() { return !1 };
    Ja.prototype.all = function() { return !0 };
    Ja.prototype.each = function() { return this };
    Ja.prototype.map = function() { return this };
    Ja.prototype.filter = function() { return this };
    Ja.prototype.concat = function(a) { return a.j };
    D.w(Ja, { count: "count" }, function() { return 0 });
    Ja.prototype.Vf = function() {};
    Ja.prototype.toString = function() { return "EmptyIterator" };
    var Ka = new Ja;

    function Ma(a) {
        this.key = -1;
        this.value = a
    }
    D.me(Ma, { key: !0, value: !0 });
    D.w(Ma, { j: "iterator" }, function() { return this });
    Ma.prototype.reset = Ma.prototype.reset = function() { this.key = -1 };
    Ma.prototype.next = Ma.prototype.next = function() { return -1 === this.key ? (this.key = 0, !0) : !1 };
    Ma.prototype.hasNext = function() { return this.next() };
    Ma.prototype.first = Ma.prototype.first = function() { this.key = 0; return this.value };
    Ma.prototype.any = function(a) { this.key = -1; return a(this.value) };
    Ma.prototype.all = function(a) { this.key = -1; return a(this.value) };
    Ma.prototype.each = function(a) {
        this.key = -1;
        a(this.value);
        return this
    };
    Ma.prototype.map = function(a) { return new Ma(a(this.value)) };
    Ma.prototype.filter = function(a) { return a(this.value) ? new Ma(this.value) : Ka };
    Ma.prototype.concat = function(a) { return new Na(this, a.j) };
    D.w(Ma, { count: "count" }, function() { return 1 });
    Ma.prototype.Vf = function() { this.value = null };
    Ma.prototype.toString = function() { return "SingletonIterator(" + this.value + ")" };

    function Na(a, b) {
        this.Ll = a;
        this.Ml = b;
        this.Av = !1
    }
    D.me(Na, { key: !0, value: !0 });
    D.w(Na, { j: "iterator" }, function() { return this });
    Na.prototype.reset = Na.prototype.reset = function() {
        this.Ll.reset();
        this.Ml.reset();
        this.Av = !1
    };
    Na.prototype.next = Na.prototype.next = function() {
        if (!this.Av) {
            var a = this.Ll;
            if (a.next()) return this.key = a.key, this.value = a.value, !0;
            this.Av = !0
        }
        return this.Av && (a = this.Ml, a.next()) ? (this.key = a.key, this.value = a.value, !0) : !1
    };
    Na.prototype.hasNext = function() { return this.next() };
    Na.prototype.first = Na.prototype.first = function() { this.reset(); return this.next() ? this.value : null };
    Na.prototype.any = function(a) { return this.Ll.any(a) || this.Ml.any(a) ? !0 : !1 };
    Na.prototype.all = function(a) { return this.Ll.all(a) && this.Ml.all(a) ? !0 : !1 };
    Na.prototype.each = function(a) {
        this.Ll.each(a);
        this.Ml.each(a);
        return this
    };
    Na.prototype.map = function(a) { return new Na(this.Ll.map(a), this.Ml.map(a)) };
    Na.prototype.filter = function(a) { return new Na(this.Ll.filter(a), this.Ml.filter(a)) };
    Na.prototype.concat = function(a) { return new Na(this, a.j) };
    D.w(Na, { count: "count" }, function() { return this.Ll.count + this.Ml.count });
    Na.prototype.Vf = function() { this.value = this.key = null };
    Na.prototype.toString = function() { return "ConcatIterator()" };

    function Qa(a) {
        this.Jc = a;
        this.pi = null;
        a.Zb = null;
        this.Za = a.I;
        this.Ic = -1
    }
    D.me(Qa, { key: !0, value: !0 });
    D.w(Qa, { j: "iterator" }, function() { return this });
    D.defineProperty(Qa, { Nq: "predicate" }, function() { return this.pi }, function(a) { this.pi = a });
    Qa.prototype.reset = Qa.prototype.reset = function() {
        var a = this.Jc;
        a.Zb = null;
        this.Za = a.I;
        this.Ic = -1
    };
    Qa.prototype.next = Qa.prototype.next = function() {
        var a = this.Jc;
        if (a.I !== this.Za) {
            if (0 > this.key) return !1;
            D.Va(a)
        }
        var a = a.o,
            b = a.length,
            c = ++this.Ic,
            d = this.pi;
        if (null !== d)
            for (; c < b;) {
                var e = a[c];
                if (d(e)) return this.key = this.Ic = c, this.value = e, !0;
                c++
            } else {
                if (c < b) return this.key = c, this.value = a[c], !0;
                this.Vf()
            }
        return !1
    };
    Qa.prototype.hasNext = function() { return this.next() };
    Qa.prototype.first = Qa.prototype.first = function() {
        var a = this.Jc;
        this.Za = a.I;
        this.Ic = 0;
        var a = a.o,
            b = a.length,
            c = this.pi;
        if (null !== c) {
            for (var d = 0; d < b;) {
                var e = a[d];
                if (c(e)) return this.key = this.Ic = d, this.value = e;
                d++
            }
            return null
        }
        return 0 < b ? (e = a[0], this.key = 0, this.value = e) : null
    };
    Qa.prototype.any = function(a) {
        var b = this.Jc;
        b.Zb = null;
        var c = b.I;
        this.Ic = -1;
        for (var d = b.o, e = d.length, g = this.pi, h = 0; h < e; h++) {
            var k = d[h];
            if (null === g || g(k)) {
                if (a(k)) return !0;
                b.I !== c && D.Va(b)
            }
        }
        return !1
    };
    Qa.prototype.all = function(a) {
        var b = this.Jc;
        b.Zb = null;
        var c = b.I;
        this.Ic = -1;
        for (var d = b.o, e = d.length, g = this.pi, h = 0; h < e; h++) {
            var k = d[h];
            if (null === g || g(k)) {
                if (!a(k)) return !1;
                b.I !== c && D.Va(b)
            }
        }
        return !0
    };
    Qa.prototype.each = function(a) {
        var b = this.Jc;
        b.Zb = null;
        var c = b.I;
        this.Ic = -1;
        for (var d = b.o, e = d.length, g = this.pi, h = 0; h < e; h++) { var k = d[h]; if (null === g || g(k)) a(k), b.I !== c && D.Va(b) }
        return this
    };
    Qa.prototype.map = function(a) {
        var b = this.Jc;
        b.Zb = null;
        var c = b.I;
        this.Ic = -1;
        for (var d = [], e = b.o, g = e.length, h = this.pi, k = 0; k < g; k++) { var l = e[k]; if (null === h || h(l)) d.push(a(l)), b.I !== c && D.Va(b) }
        a = new K;
        a.o = d;
        a.Uc();
        return a.j
    };
    Qa.prototype.filter = function(a) {
        var b = this.Jc;
        b.Zb = null;
        var c = b.I;
        this.Ic = -1;
        for (var d = [], e = b.o, g = e.length, h = this.pi, k = 0; k < g; k++) { var l = e[k]; if (null === h || h(l)) a(l) && d.push(l), b.I !== c && D.Va(b) }
        a = new K(b.da);
        a.o = d;
        a.Uc();
        return a.j
    };
    Qa.prototype.concat = function(a) { this.Jc.Zb = null; return new Na(this, a.j) };
    D.w(Qa, { count: "count" }, function() { var a = this.pi; if (null !== a) { for (var b = 0, c = this.Jc.o, d = c.length, e = 0; e < d; e++) a(c[e]) && b++; return b } return this.Jc.o.length });
    Qa.prototype.Vf = function() {
        this.key = -1;
        this.value = null;
        this.Za = -1;
        this.pi = null;
        this.Jc.Zb = this
    };
    Qa.prototype.toString = function() { return "ListIterator@" + this.Ic + "/" + this.Jc.count };

    function Ua(a) {
        this.Jc = a;
        a.fj = null;
        this.Za = a.I;
        this.Ic = a.o.length
    }
    D.me(Ua, { key: !0, value: !0 });
    D.w(Ua, { j: "iterator" }, function() { return this });
    Ua.prototype.reset = Ua.prototype.reset = function() {
        var a = this.Jc;
        a.fj = null;
        this.Za = a.I;
        this.Ic = a.o.length
    };
    Ua.prototype.next = Ua.prototype.next = function() {
        var a = this.Jc;
        if (a.I !== this.Za) {
            if (0 > this.key) return !1;
            D.Va(a)
        }
        var b = --this.Ic;
        if (0 <= b) return this.key = b, this.value = a.o[b], !0;
        this.Vf();
        return !1
    };
    Ua.prototype.hasNext = function() { return this.next() };
    Ua.prototype.first = Ua.prototype.first = function() {
        var a = this.Jc;
        this.Za = a.I;
        var b = a.o;
        this.Ic = a = b.length - 1;
        return 0 <= a ? (b = b[a], this.key = a, this.value = b) : null
    };
    Ua.prototype.any = function(a) {
        var b = this.Jc;
        b.fj = null;
        var c = b.I,
            d = b.o,
            e = d.length;
        this.Ic = e;
        for (e -= 1; 0 <= e; e--) {
            if (a(d[e])) return !0;
            b.I !== c && D.Va(b)
        }
        return !1
    };
    Ua.prototype.all = function(a) {
        var b = this.Jc;
        b.fj = null;
        var c = b.I,
            d = b.o,
            e = d.length;
        this.Ic = e;
        for (e -= 1; 0 <= e; e--) {
            if (!a(d[e])) return !1;
            b.I !== c && D.Va(b)
        }
        return !0
    };
    Ua.prototype.each = function(a) {
        var b = this.Jc;
        b.fj = null;
        var c = b.I,
            d = b.o,
            e = d.length;
        this.Ic = e;
        for (e -= 1; 0 <= e; e--) a(d[e]), b.I !== c && D.Va(b);
        return this
    };
    Ua.prototype.map = function(a) {
        var b = this.Jc;
        b.fj = null;
        var c = b.I,
            d = [],
            e = b.o,
            g = e.length;
        this.Ic = g;
        for (g -= 1; 0 <= g; g--) d.push(a(e[g])), b.I !== c && D.Va(b);
        a = new K;
        a.o = d;
        a.Uc();
        return a.j
    };
    Ua.prototype.filter = function(a) {
        var b = this.Jc;
        b.fj = null;
        var c = b.I,
            d = [],
            e = b.o,
            g = e.length;
        this.Ic = g;
        for (g -= 1; 0 <= g; g--) {
            var h = e[g];
            a(h) && d.push(h);
            b.I !== c && D.Va(b)
        }
        a = new K(b.da);
        a.o = d;
        a.Uc();
        return a.j
    };
    Ua.prototype.concat = function(a) { this.Jc.fj = null; return new Na(this, a.j) };
    D.w(Ua, { count: "count" }, function() { return this.Jc.o.length });
    Ua.prototype.Vf = function() {
        this.key = -1;
        this.value = null;
        this.Za = -1;
        this.Jc.fj = this
    };
    Ua.prototype.toString = function() { return "ListIteratorBackwards(" + this.Ic + "/" + this.Jc.count + ")" };

    function K(a) {
        D.xc(this);
        this.J = !1;
        this.o = [];
        this.I = 0;
        this.fj = this.Zb = null;
        void 0 === a || null === a ? this.da = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a || "boolean" === a || "function" === a ? this.da = a : D.ua(a, "the string 'object', 'number', 'string', 'boolean', or 'function'", "List constructor: type") : "function" === typeof a ? this.da = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a === Boolean ? "boolean" : a === Function ? "function" : a : D.ua(a, "null, a primitive type name, or a class type",
            "List constructor: type")
    }
    D.ka("List", K);
    K.prototype.nh = function(a) { null !== this.da && ("string" === typeof this.da ? typeof a === this.da && null !== a || D.kc(a, this.da) : a instanceof this.da || D.kc(a, this.da)) };
    K.prototype.Uc = function() {
        var a = this.I;
        a++;
        999999999 < a && (a = 0);
        this.I = a
    };
    K.prototype.freeze = K.prototype.freeze = function() { this.J = !0; return this };
    K.prototype.thaw = K.prototype.Xa = function() { this.J = !1; return this };
    K.prototype.toString = function() { return "List(" + D.getTypeName(this.da) + ")#" + D.Nd(this) };
    K.prototype.add = K.prototype.add = function(a) { null !== a && (v && this.nh(a), this.J && D.qa(this, a), this.o.push(a), this.Uc()) };
    K.prototype.push = K.prototype.push = function(a) { this.add(a) };
    K.prototype.addAll = K.prototype.Vc = function(a) {
        if (null === a) return this;
        this.J && D.qa(this);
        var b = this.o;
        if (D.isArray(a))
            for (var c = D.cb(a), d = 0; d < c; d++) {
                var e = D.La(a, d);
                v && this.nh(e);
                b.push(e)
            } else
                for (a = a.j; a.next();) e = a.value, v && this.nh(e), b.push(e);
        this.Uc();
        return this
    };
    K.prototype.clear = K.prototype.clear = function() {
        this.J && D.qa(this);
        this.o.length = 0;
        this.Uc()
    };
    K.prototype.contains = K.prototype.contains = function(a) {
        if (null === a) return !1;
        v && this.nh(a);
        return -1 !== this.o.indexOf(a)
    };
    K.prototype.has = K.prototype.has = function(a) { return this.contains(a) };
    K.prototype.indexOf = K.prototype.indexOf = function(a) {
        if (null === a) return -1;
        v && this.nh(a);
        return this.o.indexOf(a)
    };
    K.prototype.elt = K.prototype.fa = function(a) {
        v && D.p(a, K, "elt:i");
        var b = this.o;
        (0 > a || a >= b.length) && D.ua(a, "0 <= i < length", K, "elt:i");
        return b[a]
    };
    K.prototype.get = K.prototype.get = function(a) { return this.fa(a) };
    K.prototype.setElt = K.prototype.ug = function(a, b) {
        v && (this.nh(b), D.p(a, K, "setElt:i"));
        var c = this.o;
        (0 > a || a >= c.length) && D.ua(a, "0 <= i < length", K, "setElt:i");
        this.J && D.qa(this, a);
        c[a] = b
    };
    K.prototype.set = K.prototype.set = function(a, b) { this.ug(a, b) };
    K.prototype.first = K.prototype.first = function() { var a = this.o; return 0 === a.length ? null : a[0] };
    K.prototype.last = K.prototype.re = function() {
        var a = this.o,
            b = a.length;
        return 0 < b ? a[b - 1] : null
    };
    K.prototype.pop = K.prototype.pop = function() { this.J && D.qa(this); var a = this.o; return 0 < a.length ? a.pop() : null };
    K.prototype.any = function(a) {
        for (var b = this.o, c = this.I, d = b.length, e = 0; e < d; e++) {
            if (a(b[e])) return !0;
            this.I !== c && D.Va(this)
        }
        return !1
    };
    K.prototype.all = function(a) {
        for (var b = this.o, c = this.I, d = b.length, e = 0; e < d; e++) {
            if (!a(b[e])) return !1;
            this.I !== c && D.Va(this)
        }
        return !0
    };
    K.prototype.each = function(a) { for (var b = this.o, c = this.I, d = b.length, e = 0; e < d; e++) a(b[e]), this.I !== c && D.Va(this); return this };
    K.prototype.map = function(a) {
        for (var b = new K, c = [], d = this.o, e = this.I, g = d.length, h = 0; h < g; h++) c.push(a(d[h])), this.I !== e && D.Va(this);
        b.o = c;
        b.Uc();
        return b
    };
    K.prototype.filter = function(a) {
        for (var b = new K(this.da), c = [], d = this.o, e = this.I, g = d.length, h = 0; h < g; h++) {
            var k = d[h];
            a(k) && c.push(k);
            this.I !== e && D.Va(this)
        }
        b.o = c;
        b.Uc();
        return b
    };
    K.prototype.concat = function(a) { return this.copy().Vc(a) };
    K.prototype.insertAt = K.prototype.be = function(a, b) {
        v && (this.nh(b), D.p(a, K, "insertAt:i"));
        0 > a && D.ua(a, ">= 0", K, "insertAt:i");
        this.J && D.qa(this, a);
        var c = this.o;
        a >= c.length ? c.push(b) : c.splice(a, 0, b);
        this.Uc();
        return !0
    };
    K.prototype.remove = K.prototype["delete"] = K.prototype.remove = function(a) {
        if (null === a) return !1;
        v && this.nh(a);
        this.J && D.qa(this, a);
        var b = this.o;
        a = b.indexOf(a);
        if (-1 === a) return !1;
        a === b.length - 1 ? b.pop() : b.splice(a, 1);
        this.Uc();
        return !0
    };
    K.prototype.removeAt = K.prototype.pd = function(a) {
        v && D.p(a, K, "removeAt:i");
        var b = this.o;
        (0 > a || a >= b.length) && D.ua(a, "0 <= i < length", K, "removeAt:i");
        this.J && D.qa(this, a);
        a === b.length - 1 ? b.pop() : b.splice(a, 1);
        this.Uc()
    };
    K.prototype.removeRange = K.prototype.removeRange = function(a, b) {
        v && (D.p(a, K, "removeRange:from"), D.p(b, K, "removeRange:to"));
        var c = this.o,
            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.J && D.qa(this);
        for (var e = a, g = b + 1; g < d;) c[e++] = c[g++];
        c.length = d - (b - a + 1);
        this.Uc();
        return this
    };
    K.prototype.copy = function() {
        var a = new K(this.da),
            b = this.o;
        0 < b.length && (a.o = Array.prototype.slice.call(b));
        return a
    };
    K.prototype.toArray = K.prototype.Fc = function() { for (var a = this.o, b = this.count, c = Array(b), d = 0; d < b; d++) c[d] = a[d]; return c };
    K.prototype.toSet = K.prototype.pH = function() { for (var a = new L(this.da), b = this.o, c = this.count, d = 0; d < c; d++) a.add(b[d]); return a };
    K.prototype.sort = K.prototype.sort = function(a) {
        v && D.h(a, "function", K, "sort:sortfunc");
        this.J && D.qa(this);
        this.o.sort(a);
        this.Uc();
        return this
    };
    K.prototype.sortRange = K.prototype.Zq = function(a, b, c) {
        var d = this.o,
            e = d.length;
        void 0 === b && (b = 0);
        void 0 === c && (c = e);
        v && (D.h(a, "function", K, "sortRange:sortfunc"), D.p(b, K, "sortRange:from"), D.p(c, K, "sortRange:to"));
        this.J && D.qa(this);
        var g = c - b;
        if (1 >= g) return this;
        (0 > b || b >= e - 1) && D.ua(b, "0 <= from < length", K, "sortRange:from");
        if (2 === g) return c = d[b], e = d[b + 1], 0 < a(c, e) && (d[b] = e, d[b + 1] = c, this.Uc()), this;
        if (0 === b)
            if (c >= e) d.sort(a);
            else
                for (g = d.slice(0, c), g.sort(a), a = 0; a < c; a++) d[a] = g[a];
        else if (c >= e)
            for (g = d.slice(b),
                g.sort(a), a = b; a < e; a++) d[a] = g[a - b];
        else
            for (g = d.slice(b, c), g.sort(a), a = b; a < c; a++) d[a] = g[a - b];
        this.Uc();
        return this
    };
    K.prototype.reverse = K.prototype.reverse = function() {
        this.J && D.qa(this);
        this.o.reverse();
        this.Uc();
        return this
    };
    D.w(K, { count: "count" }, function() { return this.o.length });
    D.w(K, { size: "size" }, function() { return this.o.length });
    D.w(K, { length: "length" }, function() { return this.o.length });
    D.w(K, { j: "iterator" }, function() { if (0 >= this.o.length) return Ka; var a = this.Zb; return null !== a ? (a.reset(), a) : new Qa(this) });
    D.w(K, { $n: "iteratorBackwards" }, function() { if (0 >= this.o.length) return Ka; var a = this.fj; return null !== a ? (a.reset(), a) : new Ua(this) });

    function Va(a) {
        this.ri = a;
        a.Zb = null;
        this.Za = a.I;
        this.bb = null
    }
    D.me(Va, { key: !0, value: !0 });
    D.w(Va, { j: "iterator" }, function() { return this });
    Va.prototype.reset = Va.prototype.reset = function() {
        var a = this.ri;
        a.Zb = null;
        this.Za = a.I;
        this.bb = null
    };
    Va.prototype.next = Va.prototype.next = function() {
        var a = this.ri;
        if (a.I !== this.Za) {
            if (null === this.key) return !1;
            D.Va(a)
        }
        var b = this.bb,
            b = null === b ? a.Ma : b.gb;
        if (null !== b) return this.bb = b, this.value = b.value, this.key = b.key, !0;
        this.Vf();
        return !1
    };
    Va.prototype.hasNext = function() { return this.next() };
    Va.prototype.first = Va.prototype.first = function() {
        var a = this.ri;
        this.Za = a.I;
        a = a.Ma;
        if (null !== a) {
            this.bb = a;
            var b = a.value;
            this.key = a.key;
            return this.value = b
        }
        return null
    };
    Va.prototype.any = function(a) {
        var b = this.ri;
        b.Zb = null;
        var c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) {
            if (a(d.value)) return !0;
            b.I !== c && D.Va(b);
            d = d.gb
        }
        return !1
    };
    Va.prototype.all = function(a) {
        var b = this.ri;
        b.Zb = null;
        var c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) {
            if (!a(d.value)) return !1;
            b.I !== c && D.Va(b);
            d = d.gb
        }
        return !0
    };
    Va.prototype.each = function(a) {
        var b = this.ri;
        b.Zb = null;
        var c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) a(d.value), b.I !== c && D.Va(b), d = d.gb;
        return this
    };
    Va.prototype.map = function(a) {
        var b = this.ri;
        b.Zb = null;
        for (var c = new K, d = b.I, e = b.Ma; null !== e;) c.add(a(e.value)), b.I !== d && D.Va(b), e = e.gb;
        return c.j
    };
    Va.prototype.filter = function(a) {
        var b = this.ri;
        b.Zb = null;
        for (var c = new K(b.da), d = b.I, e = b.Ma; null !== e;) {
            var g = e.value;
            a(g) && c.add(g);
            b.I !== d && D.Va(b);
            e = e.gb
        }
        return c.j
    };
    Va.prototype.concat = function(a) { this.ri.Zb = null; return new Na(this, a.j) };
    D.w(Va, { count: "count" }, function() { return this.ri.Cd });
    Va.prototype.Vf = function() {
        this.value = this.key = null;
        this.Za = -1;
        this.ri.Zb = this
    };
    Va.prototype.toString = function() { return null !== this.bb ? "SetIterator@" + this.bb.value : "SetIterator" };

    function L(a) {
        D.xc(this);
        this.J = !1;
        void 0 === a || null === a ? this.da = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.da = a : D.ua(a, "the string 'object', 'number' or 'string'", "Set constructor: type") : "function" === typeof a ? this.da = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : D.ua(a, "null, a primitive type name, or a class type", "Set constructor: type");
        this.Dd = {};
        this.Cd = 0;
        this.Zb = null;
        this.I = 0;
        this.ii = this.Ma = null
    }
    D.ka("Set", L);
    L.prototype.nh = function(a) { null !== this.da && ("string" === typeof this.da ? typeof a === this.da && null !== a || D.kc(a, this.da) : a instanceof this.da || D.kc(a, this.da)) };
    L.prototype.Uc = function() {
        var a = this.I;
        a++;
        999999999 < a && (a = 0);
        this.I = a
    };
    L.prototype.freeze = L.prototype.freeze = function() { this.J = !0; return this };
    L.prototype.thaw = L.prototype.Xa = function() { this.J = !1; return this };
    L.prototype.toString = function() { return "Set(" + D.getTypeName(this.da) + ")#" + D.Nd(this) };
    L.prototype.add = L.prototype.add = function(a) {
        if (null === a) return !1;
        v && this.nh(a);
        this.J && D.qa(this, a);
        var b = a;
        D.Qa(a) && (b = D.sq(a));
        return void 0 === this.Dd[b] ? (this.Cd++, a = new Wa(a, a), this.Dd[b] = a, b = this.ii, null === b ? this.Ma = a : (a.Ep = b, b.gb = a), this.ii = a, this.Uc(), !0) : !1
    };
    L.prototype.addAll = L.prototype.Vc = function(a) {
        if (null === a) return this;
        this.J && D.qa(this);
        if (D.isArray(a))
            for (var b = D.cb(a), c = 0; c < b; c++) this.add(D.La(a, c));
        else
            for (a = a.j; a.next();) this.add(a.value);
        return this
    };
    L.prototype.contains = L.prototype.contains = function(a) {
        if (null === a) return !1;
        v && this.nh(a);
        var b = a;
        return D.Qa(a) && (b = D.Nd(a), void 0 === b) ? !1 : void 0 !== this.Dd[b]
    };
    L.prototype.has = L.prototype.has = function(a) { return this.contains(a) };
    L.prototype.containsAll = function(a) {
        if (null === a) return !0;
        for (a = a.j; a.next();)
            if (!this.contains(a.value)) return !1;
        return !0
    };
    L.prototype.containsAny = function(a) {
        if (null === a) return !0;
        for (a = a.j; a.next();)
            if (this.contains(a.value)) return !0;
        return !1
    };
    L.prototype.first = L.prototype.first = function() { var a = this.Ma; return null === a ? null : a.value };
    L.prototype.any = function(a) {
        for (var b = this.I, c = this.Ma; null !== c;) {
            if (a(c.value)) return !0;
            this.I !== b && D.Va(this);
            c = c.gb
        }
        return !1
    };
    L.prototype.all = function(a) {
        for (var b = this.I, c = this.Ma; null !== c;) {
            if (!a(c.value)) return !1;
            this.I !== b && D.Va(this);
            c = c.gb
        }
        return !0
    };
    L.prototype.each = function(a) { for (var b = this.I, c = this.Ma; null !== c;) a(c.value), this.I !== b && D.Va(this), c = c.gb; return this };
    L.prototype.map = function(a) { for (var b = new L, c = this.I, d = this.Ma; null !== d;) b.add(a(d.value)), this.I !== c && D.Va(this), d = d.gb; return b };
    L.prototype.filter = function(a) {
        for (var b = new L(this.da), c = this.I, d = this.Ma; null !== d;) {
            var e = d.value;
            a(e) && b.add(e);
            this.I !== c && D.Va(this);
            d = d.gb
        }
        return b
    };
    L.prototype.concat = function(a) { return this.copy().Vc(a) };
    L.prototype.remove = L.prototype["delete"] = L.prototype.remove = function(a) {
        if (null === a) return !1;
        v && this.nh(a);
        this.J && D.qa(this, a);
        var b = a;
        if (D.Qa(a) && (b = D.Nd(a), void 0 === b)) return !1;
        a = this.Dd[b];
        if (void 0 === a) return !1;
        var c = a.gb,
            d = a.Ep;
        null !== c && (c.Ep = d);
        null !== d && (d.gb = c);
        this.Ma === a && (this.Ma = c);
        this.ii === a && (this.ii = d);
        delete this.Dd[b];
        this.Cd--;
        this.Uc();
        return !0
    };
    L.prototype.removeAll = L.prototype.Iy = function(a) {
        if (null === a) return this;
        this.J && D.qa(this);
        if (D.isArray(a))
            for (var b = D.cb(a), c = 0; c < b; c++) this.remove(D.La(a, c));
        else
            for (a = a.j; a.next();) this.remove(a.value);
        return this
    };
    L.prototype.retainAll = function(a) {
        if (null === a || 0 === this.count) return this;
        this.J && D.qa(this);
        var b = new L(this.da);
        b.Vc(a);
        a = [];
        for (var c = this.j; c.next();) {
            var d = c.value;
            b.contains(d) || a.push(d)
        }
        this.Iy(a);
        return this
    };
    L.prototype.clear = L.prototype.clear = function() {
        this.J && D.qa(this);
        this.Dd = {};
        this.Cd = 0;
        this.ii = this.Ma = null;
        this.Uc()
    };
    L.prototype.copy = function() {
        var a = new L(this.da),
            b = this.Dd,
            c;
        for (c in b) a.add(b[c].value);
        return a
    };
    L.prototype.toArray = L.prototype.Fc = function() {
        var a = Array(this.Cd),
            b = this.Dd,
            c = 0,
            d;
        for (d in b) a[c] = b[d].value, c++;
        return a
    };
    L.prototype.toList = function() {
        var a = new K(this.da),
            b = this.Dd,
            c;
        for (c in b) a.add(b[c].value);
        return a
    };
    D.w(L, { count: "count" }, function() { return this.Cd });
    D.w(L, { size: "size" }, function() { return this.Cd });
    D.w(L, { j: "iterator" }, function() { if (0 >= this.Cd) return Ka; var a = this.Zb; return null !== a ? (a.reset(), a) : new Va(this) });

    function Xa(a) {
        this.Na = a;
        this.Za = a.I;
        this.bb = null
    }
    D.me(Xa, { key: !0, value: !0 });
    D.w(Xa, { j: "iterator" }, function() { return this });
    Xa.prototype.reset = Xa.prototype.reset = function() {
        this.Za = this.Na.I;
        this.bb = null
    };
    Xa.prototype.next = Xa.prototype.next = function() {
        var a = this.Na;
        if (a.I !== this.Za) {
            if (null === this.key) return !1;
            D.Va(a)
        }
        var b = this.bb,
            b = null === b ? a.Ma : b.gb;
        if (null !== b) return this.bb = b, this.value = this.key = a = b.key, !0;
        this.Vf();
        return !1
    };
    Xa.prototype.hasNext = function() { return this.next() };
    Xa.prototype.first = Xa.prototype.first = function() {
        var a = this.Na;
        this.Za = a.I;
        a = a.Ma;
        return null !== a ? (this.bb = a, this.value = this.key = a = a.key) : null
    };
    Xa.prototype.any = function(a) {
        var b = this.Na,
            c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) {
            if (a(d.key)) return !0;
            b.I !== c && D.Va(b);
            d = d.gb
        }
        return !1
    };
    Xa.prototype.all = function(a) {
        var b = this.Na,
            c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) {
            if (!a(d.key)) return !1;
            b.I !== c && D.Va(b);
            d = d.gb
        }
        return !0
    };
    Xa.prototype.each = function(a) {
        var b = this.Na,
            c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) a(d.key), b.I !== c && D.Va(b), d = d.gb;
        return this
    };
    Xa.prototype.map = function(a) {
        var b = this.Na,
            c = b.I;
        this.bb = null;
        for (var d = new K, e = b.Ma; null !== e;) d.add(a(e.key)), b.I !== c && D.Va(b), e = e.gb;
        return d.j
    };
    Xa.prototype.filter = function(a) {
        var b = this.Na,
            c = b.I;
        this.bb = null;
        for (var d = new K(b.cf), e = b.Ma; null !== e;) {
            var g = e.key;
            a(g) && d.add(g);
            b.I !== c && D.Va(b);
            e = e.gb
        }
        return d.j
    };
    Xa.prototype.concat = function(a) { return new Na(this, a.j) };
    D.w(Xa, { count: "count" }, function() { return this.Na.Cd });
    Xa.prototype.Vf = function() {
        this.value = this.key = null;
        this.Za = -1
    };
    Xa.prototype.toString = function() { return null !== this.bb ? "MapKeySetIterator@" + this.bb.value : "MapKeySetIterator" };

    function Ya(a) {
        D.xc(this);
        this.J = !0;
        this.Na = a
    }
    D.Ta(Ya, L);
    Ya.prototype.freeze = function() { return this };
    Ya.prototype.Xa = function() { return this };
    Ya.prototype.toString = function() { return "MapKeySet(" + this.Na.toString() + ")" };
    Ya.prototype.add = Ya.prototype.add = function() { D.k("This Set is read-only: " + this.toString()); return !1 };
    Ya.prototype.set = Ya.prototype.set = function() { D.k("This Set is read-only: " + this.toString()); return !1 };
    Ya.prototype.contains = Ya.prototype.contains = function(a) { return this.Na.contains(a) };
    Ya.prototype.has = Ya.prototype.has = function(a) { return this.contains(a) };
    Ya.prototype.remove = Ya.prototype["delete"] = Ya.prototype.remove = function() { D.k("This Set is read-only: " + this.toString()); return !1 };
    Ya.prototype.clear = Ya.prototype.clear = function() { D.k("This Set is read-only: " + this.toString()) };
    Ya.prototype.first = Ya.prototype.first = function() { var a = this.Na.Ma; return null !== a ? a.key : null };
    Ya.prototype.any = function(a) {
        for (var b = this.Na.Ma; null !== b;) {
            if (a(b.key)) return !0;
            b = b.gb
        }
        return !1
    };
    Ya.prototype.all = function(a) {
        for (var b = this.Na.Ma; null !== b;) {
            if (!a(b.key)) return !1;
            b = b.gb
        }
        return !0
    };
    Ya.prototype.each = function(a) { for (var b = this.Na.Ma; null !== b;) a(b.key), b = b.gb; return this };
    Ya.prototype.map = function(a) { for (var b = new L, c = this.Na.Ma; null !== c;) b.add(a(c.key)), c = c.gb; return b };
    Ya.prototype.filter = function(a) {
        for (var b = new L(this.Na.cf), c = this.Na.Ma; null !== c;) {
            var d = c.key;
            a(d) && b.add(d);
            c = c.gb
        }
        return b
    };
    Ya.prototype.concat = function(a) { return this.pH().Vc(a) };
    Ya.prototype.copy = function() { return new Ya(this.Na) };
    Ya.prototype.toSet = Ya.prototype.pH = function() {
        var a = new L(this.Na.cf),
            b = this.Na.Dd,
            c;
        for (c in b) a.add(b[c].key);
        return a
    };
    Ya.prototype.toArray = Ya.prototype.Fc = function() {
        var a = this.Na.Dd,
            b = Array(this.Na.Cd),
            c = 0,
            d;
        for (d in a) b[c] = a[d].key, c++;
        return b
    };
    Ya.prototype.toList = function() {
        var a = new K(this.Na.cf),
            b = this.Na.Dd,
            c;
        for (c in b) a.add(b[c].key);
        return a
    };
    D.w(Ya, { count: "count" }, function() { return this.Na.Cd });
    D.w(Ya, { size: "size" }, function() { return this.Na.Cd });
    D.w(Ya, { j: "iterator" }, function() { return 0 >= this.Na.Cd ? Ka : new Xa(this.Na) });

    function Za(a) {
        this.Na = a;
        a.gj = null;
        this.Za = a.I;
        this.bb = null
    }
    D.me(Za, { key: !0, value: !0 });
    D.w(Za, { j: "iterator" }, function() { return this });
    Za.prototype.reset = Za.prototype.reset = function() {
        var a = this.Na;
        a.gj = null;
        this.Za = a.I;
        this.bb = null
    };
    Za.prototype.next = Za.prototype.next = function() {
        var a = this.Na;
        if (a.I !== this.Za) {
            if (null === this.key) return !1;
            D.Va(a)
        }
        var b = this.bb,
            b = null === b ? a.Ma : b.gb;
        if (null !== b) return this.bb = b, this.value = b.value, this.key = b.key, !0;
        this.Vf();
        return !1
    };
    Za.prototype.hasNext = function() { return this.next() };
    Za.prototype.first = Za.prototype.first = function() {
        var a = this.Na;
        this.Za = a.I;
        a = a.Ma;
        if (null !== a) {
            this.bb = a;
            var b = a.value;
            this.key = a.key;
            return this.value = b
        }
        return null
    };
    Za.prototype.any = function(a) {
        var b = this.Na;
        b.gj = null;
        var c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) {
            if (a(d.value)) return !0;
            b.I !== c && D.Va(b);
            d = d.gb
        }
        return !1
    };
    Za.prototype.all = function(a) {
        var b = this.Na;
        b.gj = null;
        var c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) {
            if (!a(d.value)) return !1;
            b.I !== c && D.Va(b);
            d = d.gb
        }
        return !0
    };
    Za.prototype.each = function(a) {
        var b = this.Na;
        b.gj = null;
        var c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) a(d.value), b.I !== c && D.Va(b), d = d.gb;
        return this
    };
    Za.prototype.map = function(a) {
        var b = this.Na;
        b.gj = null;
        var c = b.I;
        this.bb = null;
        for (var d = new K, e = b.Ma; null !== e;) d.add(a(e.value)), b.I !== c && D.Va(b), e = e.gb;
        return d.j
    };
    Za.prototype.filter = function(a) {
        var b = this.Na;
        b.gj = null;
        var c = b.I;
        this.bb = null;
        for (var d = new K(b.cf), e = b.Ma; null !== e;) {
            var g = e.value;
            a(g) && d.add(g);
            b.I !== c && D.Va(b);
            e = e.gb
        }
        return d.j
    };
    Za.prototype.concat = function(a) { this.Na.gj = null; return new Na(this, a.j) };
    D.w(Za, { count: "count" }, function() { return this.Na.Cd });
    Za.prototype.Vf = function() {
        this.value = this.key = null;
        this.Za = -1;
        this.Na.gj = this
    };
    Za.prototype.toString = function() { return null !== this.bb ? "MapValueSetIterator@" + this.bb.value : "MapValueSetIterator" };

    function Wa(a, b) {
        this.key = a;
        this.value = b;
        this.Ep = this.gb = null
    }
    D.me(Wa, { key: !0, value: !0 });
    Wa.prototype.toString = function() { return "{" + this.key + ":" + this.value + "}" };

    function $a(a) {
        this.Na = a;
        a.Zb = null;
        this.Za = a.I;
        this.bb = null
    }
    D.me($a, { key: !0, value: !0 });
    D.w($a, { j: "iterator" }, function() { return this });
    $a.prototype.reset = $a.prototype.reset = function() {
        var a = this.Na;
        a.Zb = null;
        this.Za = a.I;
        this.bb = null
    };
    $a.prototype.next = $a.prototype.next = function() {
        var a = this.Na;
        if (a.I !== this.Za) {
            if (null === this.key) return !1;
            D.Va(a)
        }
        var b = this.bb,
            b = null === b ? a.Ma : b.gb;
        if (null !== b) return this.bb = b, this.key = b.key, this.value = b.value, !0;
        this.Vf();
        return !1
    };
    $a.prototype.hasNext = function() { return this.next() };
    $a.prototype.first = $a.prototype.first = function() {
        var a = this.Na;
        this.Za = a.I;
        a = a.Ma;
        return null !== a ? (this.bb = a, this.key = a.key, this.value = a.value, a) : null
    };
    $a.prototype.any = function(a) {
        var b = this.Na;
        b.Zb = null;
        var c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) {
            if (a(d)) return !0;
            b.I !== c && D.Va(b);
            d = d.gb
        }
        return !1
    };
    $a.prototype.all = function(a) {
        var b = this.Na;
        b.Zb = null;
        var c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) {
            if (!a(d)) return !1;
            b.I !== c && D.Va(b);
            d = d.gb
        }
        return !0
    };
    $a.prototype.each = function(a) {
        var b = this.Na;
        b.Zb = null;
        var c = b.I;
        this.bb = null;
        for (var d = b.Ma; null !== d;) a(d), b.I !== c && D.Va(b), d = d.gb;
        return this
    };
    $a.prototype.map = function(a) {
        var b = this.Na;
        b.Zb = null;
        var c = b.I;
        this.bb = null;
        for (var d = new K, e = b.Ma; null !== e;) d.add(a(e)), b.I !== c && D.Va(b), e = e.gb;
        return d.j
    };
    $a.prototype.filter = function(a) {
        var b = this.Na;
        b.Zb = null;
        var c = b.I;
        this.bb = null;
        for (var d = new K, e = b.Ma; null !== e;) a(e) && d.add(e), b.I !== c && D.Va(b), e = e.gb;
        return d.j
    };
    $a.prototype.concat = function(a) { this.Na.Zb = null; return new Na(this, a.j) };
    D.w($a, { count: "count" }, function() { return this.Na.Cd });
    $a.prototype.Vf = function() {
        this.value = this.key = null;
        this.Za = -1;
        this.Na.Zb = this
    };
    $a.prototype.toString = function() { return null !== this.bb ? "MapIterator@" + this.bb : "MapIterator" };

    function oa(a, b) {
        D.xc(this);
        this.J = !1;
        void 0 === a || null === a ? this.cf = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.cf = a : D.ua(a, "the string 'object', 'number' or 'string'", "Map constructor: keytype") : "function" === typeof a ? this.cf = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : D.ua(a, "null, a primitive type name, or a class type", "Map constructor: keytype");
        void 0 === b || null === b ? this.Bi = null : "string" === typeof b ? "object" === b || "string" === b || "boolean" === b || "number" ===
            b || "function" === b ? this.Bi = b : D.ua(b, "the string 'object', 'number', 'string', 'boolean', or 'function'", "Map constructor: valtype") : "function" === typeof b ? this.Bi = b === Object ? "object" : b === String ? "string" : b === Number ? "number" : b === Boolean ? "boolean" : b === Function ? "function" : b : D.ua(b, "null, a primitive type name, or a class type", "Map constructor: valtype");
        this.Dd = {};
        this.Cd = 0;
        this.gj = this.Zb = null;
        this.I = 0;
        this.ii = this.Ma = null
    }
    D.ka("Map", oa);

    function bb(a, b) { null !== a.cf && ("string" === typeof a.cf ? typeof b === a.cf && null !== b || D.kc(b, a.cf) : b instanceof a.cf || D.kc(b, a.cf)) }
    oa.prototype.Uc = function() {
        var a = this.I;
        a++;
        999999999 < a && (a = 0);
        this.I = a
    };
    oa.prototype.freeze = oa.prototype.freeze = function() { this.J = !0; return this };
    oa.prototype.thaw = oa.prototype.Xa = function() { this.J = !1; return this };
    oa.prototype.toString = function() { return "Map(" + D.getTypeName(this.cf) + "," + D.getTypeName(this.Bi) + ")#" + D.Nd(this) };
    oa.prototype.add = oa.prototype.add = function(a, b) {
        v && (bb(this, a), null !== this.Bi && ("string" === typeof this.Bi ? typeof b === this.Bi && null !== b || D.kc(b, this.Bi) : b instanceof this.Bi || D.kc(b, this.Bi)));
        this.J && D.qa(this, a);
        var c = a;
        D.Qa(a) && (c = D.sq(a));
        var d = this.Dd[c];
        if (void 0 === d) return this.Cd++, d = new Wa(a, b), this.Dd[c] = d, c = this.ii, null === c ? this.Ma = d : (d.Ep = c, c.gb = d), this.ii = d, this.Uc(), !0;
        d.value = b;
        return !1
    };
    oa.prototype.set = oa.prototype.set = function(a, b) { return this.add(a, b) };
    oa.prototype.addAll = oa.prototype.Vc = function(a) {
        if (null === a) return this;
        if (D.isArray(a))
            for (var b = D.cb(a), c = 0; c < b; c++) {
                var d = D.La(a, c);
                this.add(d.key, d.value)
            } else
                for (a = a.j; a.next();) this.add(a.key, a.value);
        return this
    };
    oa.prototype.first = oa.prototype.first = function() { return this.Ma };
    oa.prototype.any = function(a) {
        for (var b = this.I, c = this.Ma; null !== c;) {
            if (a(c)) return !0;
            this.I !== b && D.Va(this);
            c = c.gb
        }
        return !1
    };
    oa.prototype.all = function(a) {
        for (var b = this.I, c = this.Ma; null !== c;) {
            if (!a(c)) return !1;
            this.I !== b && D.Va(this);
            c = c.gb
        }
        return !0
    };
    oa.prototype.each = function(a) { for (var b = this.I, c = this.Ma; null !== c;) a(c), this.I !== b && D.Va(this), c = c.gb; return this };
    oa.prototype.map = function(a) { for (var b = new oa(this.cf), c = this.I, d = this.Ma; null !== d;) b.add(d.key, a(d)), this.I !== c && D.Va(this), d = d.gb; return b };
    oa.prototype.filter = function(a) { for (var b = new oa(this.cf, this.Bi), c = this.I, d = this.Ma; null !== d;) a(d) && b.add(d.key, d.value), this.I !== c && D.Va(this), d = d.gb; return b };
    oa.prototype.concat = function(a) { return this.copy().Vc(a) };
    oa.prototype.contains = oa.prototype.contains = function(a) { v && bb(this, a); var b = a; return D.Qa(a) && (b = D.Nd(a), void 0 === b) ? !1 : void 0 !== this.Dd[b] };
    oa.prototype.has = oa.prototype.has = function(a) { return this.contains(a) };
    oa.prototype.getValue = oa.prototype.oa = function(a) {
        v && bb(this, a);
        var b = a;
        if (D.Qa(a) && (b = D.Nd(a), void 0 === b)) return null;
        a = this.Dd[b];
        return void 0 === a ? null : a.value
    };
    oa.prototype.get = oa.prototype.get = function(a) { return this.oa(a) };
    oa.prototype.remove = oa.prototype["delete"] = oa.prototype.remove = function(a) {
        if (null === a) return !1;
        v && bb(this, a);
        this.J && D.qa(this, a);
        var b = a;
        if (D.Qa(a) && (b = D.Nd(a), void 0 === b)) return !1;
        a = this.Dd[b];
        if (void 0 === a) return !1;
        var c = a.gb,
            d = a.Ep;
        null !== c && (c.Ep = d);
        null !== d && (d.gb = c);
        this.Ma === a && (this.Ma = c);
        this.ii === a && (this.ii = d);
        delete this.Dd[b];
        this.Cd--;
        this.Uc();
        return !0
    };
    oa.prototype.clear = oa.prototype.clear = function() {
        this.J && D.qa(this);
        this.Dd = {};
        this.Cd = 0;
        this.ii = this.Ma = null;
        this.Uc()
    };
    oa.prototype.copy = function() {
        var a = new oa(this.cf, this.Bi),
            b = this.Dd,
            c;
        for (c in b) {
            var d = b[c];
            a.add(d.key, d.value)
        }
        return a
    };
    oa.prototype.toArray = oa.prototype.Fc = function() {
        var a = this.Dd,
            b = Array(this.Cd),
            c = 0,
            d;
        for (d in a) {
            var e = a[d];
            b[c] = new Wa(e.key, e.value);
            c++
        }
        return b
    };
    oa.prototype.toKeySet = oa.prototype.bk = function() { return new Ya(this) };
    D.w(oa, { count: "count" }, function() { return this.Cd });
    D.w(oa, { size: "size" }, function() { return this.Cd });
    D.w(oa, { j: "iterator" }, function() { if (0 >= this.count) return Ka; var a = this.Zb; return null !== a ? (a.reset(), a) : new $a(this) });
    D.w(oa, { pG: "iteratorKeys" }, function() { return 0 >= this.count ? Ka : new Xa(this) });
    D.w(oa, { qG: "iteratorValues" }, function() { if (0 >= this.count) return Ka; var a = this.gj; return null !== a ? (a.reset(), a) : new Za(this) });

    function N(a, b) {
        void 0 === a ? this.N = this.M = 0 : "number" === typeof a && "number" === typeof b ? (this.M = a, this.N = b) : D.k("Invalid arguments to Point constructor: " + a + ", " + b);
        this.J = !1
    }
    D.ka("Point", N);
    D.Di(N);
    D.me(N, { x: !0, y: !0 });
    N.prototype.assign = function(a) {
        this.M = a.M;
        this.N = a.N
    };
    N.prototype.setTo = N.prototype.n = function(a, b) {
        v && (D.h(a, "number", N, "setTo:x"), D.h(b, "number", N, "setTo:y"));
        this.M = a;
        this.N = b;
        return this
    };
    N.prototype.set = N.prototype.set = function(a) {
        v && D.l(a, N, N, "set:p");
        this.Sa();
        this.M = a.M;
        this.N = a.N;
        return this
    };
    N.prototype.copy = function() {
        var a = new N;
        a.M = this.M;
        a.N = this.N;
        return a
    };
    f = N.prototype;
    f.Oa = function() {
        this.J = !0;
        Object.freeze(this);
        return this
    };
    f.V = function() { return Object.isFrozen(this) ? this : this.copy().freeze() };
    f.freeze = function() { this.J = !0; return this };
    f.Xa = function() {
        Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
        this.J = !1;
        return this
    };
    f.Sa = function(a) {
        if (this.J) {
            var b = "The Point is frozen, so its properties cannot be set: " + this.toString();
            void 0 !== a && (b += "  to value: " + a);
            D.k(b)
        }
    };
    N.parse = function(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 N(c, e)
        }
        return new N
    };
    N.stringify = function(a) { v && D.l(a, N); return a.x.toString() + " " + a.y.toString() };
    N.prototype.toString = function() { return "Point(" + this.x + "," + this.y + ")" };
    N.prototype.equals = N.prototype.O = function(a) { return a instanceof N ? this.M === a.x && this.N === a.y : !1 };
    N.prototype.equalTo = N.prototype.Tx = function(a, b) { return this.M === a && this.N === b };
    N.prototype.equalsApprox = N.prototype.Wc = function(a) { return Q(this.M, a.x) && Q(this.N, a.y) };
    N.prototype.add = N.prototype.add = function(a) {
        v && D.l(a, N, N, "add:p");
        this.Sa();
        this.M += a.x;
        this.N += a.y;
        return this
    };
    N.prototype.subtract = N.prototype.$j = function(a) {
        v && D.l(a, N, N, "subtract:p");
        this.Sa();
        this.M -= a.x;
        this.N -= a.y;
        return this
    };
    N.prototype.offset = N.prototype.offset = function(a, b) {
        v && (D.p(a, N, "offset:dx"), D.p(b, N, "offset:dy"));
        this.Sa();
        this.M += a;
        this.N += b;
        return this
    };
    N.prototype.rotate = N.prototype.rotate = function(a) {
        v && D.p(a, N, "rotate:angle");
        this.Sa();
        if (0 === a) return this;
        var b = this.M,
            c = this.N;
        if (0 === b && 0 === c) return this;
        var d = 0,
            e = 0;
        360 <= a ? a -= 360 : 0 > a && (a += 360);
        90 === a ? (d = 0, e = 1) : 180 === a ? (d = -1, e = 0) : 270 === a ? (d = 0, e = -1) : (a = a * Math.PI / 180, d = Math.cos(a), e = Math.sin(a));
        this.M = d * b - e * c;
        this.N = e * b + d * c;
        return this
    };
    N.prototype.scale = N.prototype.scale = function(a, b) {
        v && (D.p(a, N, "scale:sx"), D.p(b, N, "scale:sy"));
        this.M *= a;
        this.N *= b;
        return this
    };
    N.prototype.distanceSquaredPoint = N.prototype.Kf = function(a) {
        v && D.l(a, N, N, "distanceSquaredPoint:p");
        var b = a.x - this.M;
        a = a.y - this.N;
        return b * b + a * a
    };
    N.prototype.distanceSquared = N.prototype.mq = function(a, b) {
        v && (D.p(a, N, "distanceSquared:px"), D.p(b, N, "distanceSquared:py"));
        var c = a - this.M,
            d = b - this.N;
        return c * c + d * d
    };
    N.prototype.normalize = N.prototype.normalize = function() {
        this.Sa();
        var a = this.M,
            b = this.N,
            c = Math.sqrt(a * a + b * b);
        0 < c && (this.M = a / c, this.N = b / c);
        return this
    };
    N.prototype.directionPoint = N.prototype.Wb = function(a) { v && D.l(a, N, N, "directionPoint:p"); return cb(a.x - this.M, a.y - this.N) };
    N.prototype.direction = N.prototype.direction = function(a, b) { v && (D.p(a, N, "direction:px"), D.p(b, N, "direction:py")); return cb(a - this.M, b - this.N) };

    function cb(a, b) {
        if (0 === a) return 0 < b ? 90 : 0 > b ? 270 : 0;
        if (0 === b) return 0 < a ? 0 : 180;
        if (isNaN(a) || isNaN(b)) return 0;
        var c = 180 * Math.atan(Math.abs(b / a)) / Math.PI;
        0 > a ? c = 0 > b ? c + 180 : 180 - c : 0 > b && (c = 360 - c);
        return c
    }
    N.prototype.projectOntoLineSegment = function(a, b, c, d) {
        v && (D.p(a, N, "projectOntoLineSegment:px"), D.p(b, N, "projectOntoLineSegment:py"), D.p(c, N, "projectOntoLineSegment:qx"), D.p(d, N, "projectOntoLineSegment:qy"));
        fb(a, b, c, d, this.M, this.N, this);
        return this
    };
    N.prototype.projectOntoLineSegmentPoint = function(a, b) {
        v && (D.l(a, N, N, "projectOntoLineSegmentPoint:p"), D.l(b, N, N, "projectOntoLineSegmentPoint:q"));
        fb(a.x, a.y, b.x, b.y, this.M, this.N, this);
        return this
    };
    N.prototype.snapToGrid = function(a, b, c, d) {
        v && (D.p(a, N, "snapToGrid:originx"), D.p(b, N, "snapToGrid:originy"), D.p(c, N, "snapToGrid:cellwidth"), D.p(d, N, "snapToGrid:cellheight"));
        jb(this.M, this.N, a, b, c, d, this);
        return this
    };
    N.prototype.snapToGridPoint = function(a, b) {
        v && (D.l(a, N, N, "snapToGridPoint:p"), D.l(b, Ca, N, "snapToGridPoint:q"));
        jb(this.M, this.N, a.x, a.y, b.width, b.height, this);
        return this
    };
    N.prototype.setRectSpot = N.prototype.uo = function(a, b) {
        v && (D.l(a, C, N, "setRectSpot:r"), D.l(b, S, N, "setRectSpot:spot"));
        this.Sa();
        this.M = a.x + b.x * a.width + b.offsetX;
        this.N = a.y + b.y * a.height + b.offsetY;
        return this
    };
    N.prototype.setSpot = N.prototype.pv = function(a, b, c, d, e) {
        v && (D.p(a, N, "setSpot:x"), D.p(b, N, "setSpot:y"), D.p(c, N, "setSpot:w"), D.p(d, N, "setSpot:h"), (0 > c || 0 > d) && D.k("Point.setSpot:Width and height cannot be negative"), D.l(e, S, N, "setSpot:spot"));
        this.Sa();
        this.M = a + e.x * c + e.offsetX;
        this.N = b + e.y * d + e.offsetY;
        return this
    };
    N.prototype.transform = function(a) {
        v && D.l(a, Ea, N, "transform:t");
        a.vb(this);
        return this
    };

    function kb(a, b) {
        v && D.l(b, Ea, N, "transformInverted:t");
        b.Oh(a);
        return a
    }
    var lb;
    N.distanceLineSegmentSquared = lb = function(a, b, c, d, e, g) {
        v && (D.p(a, N, "distanceLineSegmentSquared:px"), D.p(b, N, "distanceLineSegmentSquared:py"), D.p(c, N, "distanceLineSegmentSquared:ax"), D.p(d, N, "distanceLineSegmentSquared:ay"), D.p(e, N, "distanceLineSegmentSquared:bx"), D.p(g, N, "distanceLineSegmentSquared:by"));
        var h = e - c,
            k = g - d,
            l = h * h + k * k;
        c -= a;
        d -= b;
        var m = -c * h - d * k;
        if (0 >= m || m >= l) return h = e - a, k = g - b, Math.min(c * c + d * d, h * h + k * k);
        a = h * d - k * c;
        return a * a / l
    };
    var ob;
    N.distanceSquared = ob = function(a, b, c, d) {
        v && (D.p(a, N, "distanceSquared:px"), D.p(b, N, "distanceSquared:py"), D.p(c, N, "distanceSquared:qx"), D.p(d, N, "distanceSquared:qy"));
        a = c - a;
        b = d - b;
        return a * a + b * b
    };
    var wb;
    N.direction = wb = function(a, b, c, d) {
        v && (D.p(a, N, "direction:px"), D.p(b, N, "direction:py"), D.p(c, N, "direction:qx"), D.p(d, N, "direction:qy"));
        a = c - a;
        b = d - b;
        if (0 === a) return 0 < b ? 90 : 0 > b ? 270 : 0;
        if (0 === b) return 0 < a ? 0 : 180;
        if (isNaN(a) || isNaN(b)) return 0;
        d = 180 * Math.atan(Math.abs(b / a)) / Math.PI;
        0 > a ? d = 0 > b ? d + 180 : 180 - d : 0 > b && (d = 360 - d);
        return d
    };
    D.defineProperty(N, { x: "x" }, function() { return this.M }, function(a) {
        this.Sa(a);
        v && D.h(a, "number", N, "x");
        this.M = a
    });
    D.defineProperty(N, { y: "y" }, function() { return this.N }, function(a) {
        this.Sa(a);
        v && D.h(a, "number", N, "y");
        this.N = a
    });
    N.prototype.isReal = N.prototype.H = function() { return isFinite(this.x) && isFinite(this.y) };

    function Ca(a, b) {
        void 0 === a ? this.Ha = this.Ia = 0 : "number" === typeof a && (0 <= a || isNaN(a)) && "number" === typeof b && (0 <= b || isNaN(b)) ? (this.Ia = a, this.Ha = b) : D.k("Invalid arguments to Size constructor: " + a + ", " + b);
        this.J = !1
    }
    D.ka("Size", Ca);
    D.Di(Ca);
    D.me(Ca, { width: !0, height: !0 });
    Ca.prototype.assign = function(a) {
        this.Ia = a.Ia;
        this.Ha = a.Ha
    };
    Ca.prototype.setTo = Ca.prototype.n = function(a, b) {
        v && (D.h(a, "number", Ca, "setTo:w"), D.h(b, "number", Ca, "setTo:h"), 0 > a && D.ua(a, ">= 0", Ca, "setTo:w"), 0 > b && D.ua(b, ">= 0", Ca, "setTo:h"));
        this.Ia = a;
        this.Ha = b;
        return this
    };
    Ca.prototype.set = Ca.prototype.set = function(a) {
        v && D.l(a, Ca, Ca, "set:s");
        this.Sa();
        this.Ia = a.Ia;
        this.Ha = a.Ha;
        return this
    };
    Ca.prototype.copy = function() {
        var a = new Ca;
        a.Ia = this.Ia;
        a.Ha = this.Ha;
        return a
    };
    f = Ca.prototype;
    f.Oa = function() {
        this.J = !0;
        Object.freeze(this);
        return this
    };
    f.V = function() { return Object.isFrozen(this) ? this : this.copy().freeze() };
    f.freeze = function() { this.J = !0; return this };
    f.Xa = function() {
        Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
        this.J = !1;
        return this
    };
    f.Sa = function(a) {
        if (this.J) {
            var b = "The Size is frozen, so its properties cannot be set: " + this.toString();
            void 0 !== a && (b += "  to value: " + a);
            D.k(b)
        }
    };
    Ca.parse = function(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 Ca(c, e)
        }
        return new Ca
    };
    Ca.stringify = function(a) { v && D.l(a, Ca); return a.width.toString() + " " + a.height.toString() };
    Ca.prototype.toString = function() { return "Size(" + this.width + "," + this.height + ")" };
    Ca.prototype.equals = Ca.prototype.O = function(a) { return a instanceof Ca ? this.Ia === a.width && this.Ha === a.height : !1 };
    Ca.prototype.equalTo = Ca.prototype.Tx = function(a, b) { return this.Ia === a && this.Ha === b };
    Ca.prototype.equalsApprox = Ca.prototype.Wc = function(a) { return Q(this.Ia, a.width) && Q(this.Ha, a.height) };
    D.defineProperty(Ca, { width: "width" }, function() { return this.Ia }, function(a) {
        this.Sa(a);
        v && D.h(a, "number", Ca, "width");
        0 > a && D.ua(a, ">= 0", Ca, "width");
        this.Ia = a
    });
    D.defineProperty(Ca, { height: "height" }, function() { return this.Ha }, function(a) {
        this.Sa(a);
        v && D.h(a, "number", Ca, "height");
        0 > a && D.ua(a, ">= 0", Ca, "height");
        this.Ha = a
    });
    Ca.prototype.isReal = Ca.prototype.H = function() { return isFinite(this.width) && isFinite(this.height) };

    function C(a, b, c, d) {
        void 0 === a ? this.Ha = this.Ia = this.N = this.M = 0 : a instanceof N ? b instanceof N ? (this.M = Math.min(a.M, b.M), this.N = Math.min(a.N, b.N), this.Ia = Math.abs(a.M - b.M), this.Ha = Math.abs(a.N - b.N)) : b instanceof Ca ? (this.M = a.M, this.N = a.N, this.Ia = b.Ia, this.Ha = b.Ha) : D.k("Incorrect arguments supplied to Rect constructor") : "number" === typeof a && "number" === typeof b && "number" === typeof c && (0 <= c || isNaN(c)) && "number" === typeof d && (0 <= d || isNaN(d)) ? (this.M = a, this.N = b, this.Ia = c, this.Ha = d) : D.k("Invalid arguments to Rect constructor: " +
            a + ", " + b + ", " + c + ", " + d);
        this.J = !1
    }
    D.ka("Rect", C);
    D.Di(C);
    D.me(C, { x: !0, y: !0, width: !0, height: !0 });
    C.prototype.assign = function(a) {
        this.M = a.M;
        this.N = a.N;
        this.Ia = a.Ia;
        this.Ha = a.Ha
    };

    function Cb(a, b, c) {
        a.Ia = b;
        a.Ha = c
    }
    C.prototype.setTo = C.prototype.n = function(a, b, c, d) {
        v && (D.h(a, "number", C, "setTo:x"), D.h(b, "number", C, "setTo:y"), D.h(c, "number", C, "setTo:w"), D.h(d, "number", C, "setTo:h"), 0 > c && D.ua(c, ">= 0", C, "setTo:w"), 0 > d && D.ua(d, ">= 0", C, "setTo:h"));
        this.M = a;
        this.N = b;
        this.Ia = c;
        this.Ha = d;
        return this
    };
    C.prototype.set = C.prototype.set = function(a) {
        v && D.l(a, C, C, "set:r");
        this.Sa();
        this.M = a.M;
        this.N = a.N;
        this.Ia = a.Ia;
        this.Ha = a.Ha;
        return this
    };
    C.prototype.setPoint = C.prototype.gh = function(a) {
        v && D.l(a, N, C, "setPoint:p");
        this.Sa();
        this.M = a.M;
        this.N = a.N;
        return this
    };
    C.prototype.setSize = function(a) {
        v && D.l(a, Ca, C, "setSize:s");
        this.Sa();
        this.Ia = a.Ia;
        this.Ha = a.Ha;
        return this
    };
    C.prototype.copy = function() {
        var a = new C;
        a.M = this.M;
        a.N = this.N;
        a.Ia = this.Ia;
        a.Ha = this.Ha;
        return a
    };
    f = C.prototype;
    f.Oa = function() {
        this.J = !0;
        Object.freeze(this);
        return this
    };
    f.V = function() { return Object.isFrozen(this) ? this : this.copy().freeze() };
    f.freeze = function() { this.J = !0; return this };
    f.Xa = function() {
        Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
        this.J = !1;
        return this
    };
    f.Sa = function(a) {
        if (this.J) {
            var b = "The Rect is frozen, so its properties cannot be set: " + this.toString();
            void 0 !== a && (b += "  to value: " + a);
            D.k(b)
        }
    };
    C.parse = function(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 g = 0;
                "" === a[b];) b++;
            (d = a[b++]) && (g = parseFloat(d));
            for (var h = 0;
                "" === a[b];) b++;
            (d = a[b++]) && (h = parseFloat(d));
            return new C(c, e, g, h)
        }
        return new C
    };
    C.stringify = function(a) { v && D.l(a, C); return a.x.toString() + " " + a.y.toString() + " " + a.width.toString() + " " + a.height.toString() };
    C.prototype.toString = function() { return "Rect(" + this.x + "," + this.y + "," + this.width + "," + this.height + ")" };
    C.prototype.equals = C.prototype.O = function(a) { return a instanceof C ? this.M === a.x && this.N === a.y && this.Ia === a.width && this.Ha === a.height : !1 };
    C.prototype.equalTo = C.prototype.Tx = function(a, b, c, d) { return this.M === a && this.N === b && this.Ia === c && this.Ha === d };
    C.prototype.equalsApprox = C.prototype.Wc = function(a) { return Q(this.M, a.x) && Q(this.N, a.y) && Q(this.Ia, a.width) && Q(this.Ha, a.height) };

    function Db(a, b) { return Eb(a.M, b.x) && Eb(a.N, b.y) && Eb(a.Ia, b.width) && Eb(a.Ha, b.height) }
    C.prototype.containsPoint = C.prototype.Pa = function(a) { v && D.l(a, N, C, "containsPoint:p"); return this.M <= a.x && this.M + this.Ia >= a.x && this.N <= a.y && this.N + this.Ha >= a.y };
    C.prototype.containsRect = C.prototype.Sk = function(a) { v && D.l(a, C, C, "containsRect:r"); return this.M <= a.x && a.x + a.width <= this.M + this.Ia && this.N <= a.y && a.y + a.height <= this.N + this.Ha };
    C.prototype.contains = C.prototype.contains = function(a, b, c, d) { v ? (D.p(a, C, "contains:x"), D.p(b, C, "contains:y"), void 0 === c ? c = 0 : D.p(c, C, "contains:w"), void 0 === d ? d = 0 : D.p(d, C, "contains:h"), (0 > c || 0 > d) && D.k("Rect.contains:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0)); return this.M <= a && a + c <= this.M + this.Ia && this.N <= b && b + d <= this.N + this.Ha };
    C.prototype.reset = function() {
        this.Sa();
        this.Ha = this.Ia = this.N = this.M = 0
    };
    C.prototype.offset = C.prototype.offset = function(a, b) {
        v && (D.p(a, C, "offset:dx"), D.p(b, C, "offset:dy"));
        this.Sa();
        this.M += a;
        this.N += b;
        return this
    };
    C.prototype.inflate = C.prototype.ig = function(a, b) { v && (D.p(a, C, "inflate:w"), D.p(b, C, "inflate:h")); return Gb(this, b, a, b, a) };
    C.prototype.addMargin = C.prototype.yx = function(a) { v && D.l(a, Lb, C, "addMargin:m"); return Gb(this, a.top, a.right, a.bottom, a.left) };
    C.prototype.subtractMargin = C.prototype.zK = function(a) { v && D.l(a, Lb, C, "subtractMargin:m"); return Gb(this, -a.top, -a.right, -a.bottom, -a.left) };
    C.prototype.grow = function(a, b, c, d) { v && (D.p(a, C, "grow:t"), D.p(b, C, "grow:r"), D.p(c, C, "grow:b"), D.p(d, C, "grow:l")); return Gb(this, a, b, c, d) };

    function Gb(a, b, c, d, e) {
        a.Sa();
        var g = a.Ia;
        c + e <= -g ? (a.M += g / 2, a.Ia = 0) : (a.M -= e, a.Ia += c + e);
        c = a.Ha;
        b + d <= -c ? (a.N += c / 2, a.Ha = 0) : (a.N -= b, a.Ha += b + d);
        return a
    }
    C.prototype.intersectRect = function(a) { v && D.l(a, C, C, "intersectRect:r"); return Nb(this, a.x, a.y, a.width, a.height) };
    C.prototype.intersect = C.prototype.bG = function(a, b, c, d) { v && (D.p(a, C, "intersect:x"), D.p(b, C, "intersect:y"), D.p(c, C, "intersect:w"), D.p(d, C, "intersect:h"), (0 > c || 0 > d) && D.k("Rect.intersect:Width and height cannot be negative")); return Nb(this, a, b, c, d) };

    function Nb(a, b, c, d, e) {
        a.Sa();
        var g = Math.max(a.M, b),
            h = Math.max(a.N, c);
        b = Math.min(a.M + a.Ia, b + d);
        c = Math.min(a.N + a.Ha, c + e);
        a.M = g;
        a.N = h;
        a.Ia = Math.max(0, b - g);
        a.Ha = Math.max(0, c - h);
        return a
    }
    C.prototype.intersectsRect = C.prototype.jg = function(a) { v && D.l(a, C, C, "intersectsRect:r"); return this.cG(a.x, a.y, a.width, a.height) };
    C.prototype.intersects = C.prototype.cG = function(a, b, c, d) {
        v && (D.p(a, C, "intersects:x"), D.p(b, C, "intersects:y"), D.p(a, C, "intersects:w"), D.p(b, C, "intersects:h"), (0 > c || 0 > d) && D.k("Rect.intersects:Width and height cannot be negative"));
        var e = this.Ia,
            g = this.M;
        if (Infinity !== e && Infinity !== c && (e += g, c += a, isNaN(c) || isNaN(e) || g > c || a > e)) return !1;
        a = this.Ha;
        c = this.N;
        return Infinity !== a && Infinity !== d && (a += c, d += b, isNaN(d) || isNaN(a) || c > d || b > a) ? !1 : !0
    };

    function Ob(a, b) {
        var c = a.Ia,
            d = b.width + 10 + 10,
            e = a.M,
            g = b.x - 10;
        if (e > d + g || g > c + e) return !1;
        c = a.Ha;
        d = b.height + 10 + 10;
        e = a.N;
        g = b.y - 10;
        return e > d + g || g > c + e ? !1 : !0
    }
    C.prototype.unionPoint = C.prototype.Mi = function(a) { v && D.l(a, N, C, "unionPoint:p"); return Ub(this, a.x, a.y, 0, 0) };
    C.prototype.unionRect = C.prototype.Zh = function(a) { v && D.l(a, C, C, "unionRect:r"); return Ub(this, a.M, a.N, a.Ia, a.Ha) };
    C.prototype.union = C.prototype.uH = function(a, b, c, d) {
        this.Sa();
        v ? (D.p(a, C, "union:x"), D.p(b, C, "union:y"), void 0 === c ? c = 0 : D.p(c, C, "union:w"), void 0 === d ? d = 0 : D.p(d, C, "union:h"), (0 > c || 0 > d) && D.k("Rect.union:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0));
        return Ub(this, a, b, c, d)
    };

    function Ub(a, b, c, d, e) {
        var g = Math.min(a.M, b),
            h = Math.min(a.N, c);
        b = Math.max(a.M + a.Ia, b + d);
        c = Math.max(a.N + a.Ha, c + e);
        a.M = g;
        a.N = h;
        a.Ia = b - g;
        a.Ha = c - h;
        return a
    }
    C.prototype.setSpot = C.prototype.pv = function(a, b, c) {
        v && (D.p(a, C, "setSpot:x"), D.p(b, C, "setSpot:y"), D.l(c, S, C, "setSpot:spot"));
        this.Sa();
        this.M = a - c.offsetX - c.x * this.Ia;
        this.N = b - c.offsetY - c.y * this.Ha;
        return this
    };
    var Vb;
    C.contains = Vb = function(a, b, c, d, e, g, h, k) { v ? (D.p(a, C, "contains:rx"), D.p(b, C, "contains:ry"), D.p(c, C, "contains:rw"), D.p(d, C, "contains:rh"), D.p(e, C, "contains:x"), D.p(g, C, "contains:y"), void 0 === h ? h = 0 : D.p(h, C, "contains:w"), void 0 === k ? k = 0 : D.p(k, C, "contains:h"), (0 > c || 0 > d || 0 > h || 0 > k) && D.k("Rect.contains:Width and height cannot be negative")) : (void 0 === h && (h = 0), void 0 === k && (k = 0)); return a <= e && e + h <= a + c && b <= g && g + k <= b + d };
    C.intersects = function(a, b, c, d, e, g, h, k) {
        v && (D.p(a, C, "intersects:rx"), D.p(b, C, "intersects:ry"), D.p(c, C, "intersects:rw"), D.p(d, C, "intersects:rh"), D.p(e, C, "intersects:x"), D.p(g, C, "intersects:y"), D.p(h, C, "intersects:w"), D.p(k, C, "intersects:h"), (0 > c || 0 > d || 0 > h || 0 > k) && D.k("Rect.intersects:Width and height cannot be negative"));
        c += a;
        h += e;
        if (a > h || e > c) return !1;
        a = d + b;
        k += g;
        return b > k || g > a ? !1 : !0
    };
    D.defineProperty(C, { x: "x" }, function() { return this.M }, function(a) {
        this.Sa(a);
        v && D.h(a, "number", C, "x");
        this.M = a
    });
    D.defineProperty(C, { y: "y" }, function() { return this.N }, function(a) {
        this.Sa(a);
        v && D.h(a, "number", C, "y");
        this.N = a
    });
    D.defineProperty(C, { width: "width" }, function() { return this.Ia }, function(a) {
        this.Sa(a);
        v && D.h(a, "number", C, "width");
        0 > a && D.ua(a, ">= 0", C, "width");
        this.Ia = a
    });
    D.defineProperty(C, { height: "height" }, function() { return this.Ha }, function(a) {
        this.Sa(a);
        v && D.h(a, "number", C, "height");
        0 > a && D.ua(a, ">= 0", C, "height");
        this.Ha = a
    });
    D.defineProperty(C, { left: "left" }, function() { return this.M }, function(a) {
        this.Sa(a);
        v && D.h(a, "number", C, "left");
        this.M = a
    });
    D.defineProperty(C, { top: "top" }, function() { return this.N }, function(a) {
        this.Sa(a);
        v && D.h(a, "number", C, "top");
        this.N = a
    });
    D.defineProperty(C, { right: "right" }, function() { return this.M + this.Ia }, function(a) {
        this.Sa(a);
        v && D.p(a, C, "right");
        this.M += a - (this.M + this.Ia)
    });
    D.defineProperty(C, { bottom: "bottom" }, function() { return this.N + this.Ha }, function(a) {
        this.Sa(a);
        v && D.p(a, C, "top");
        this.N += a - (this.N + this.Ha)
    });
    D.defineProperty(C, { position: "position" }, function() { return new N(this.M, this.N) }, function(a) {
        this.Sa(a);
        v && D.l(a, N, C, "position");
        this.M = a.x;
        this.N = a.y
    });
    D.defineProperty(C, { size: "size" }, function() { return new Ca(this.Ia, this.Ha) }, function(a) {
        this.Sa(a);
        v && D.l(a, Ca, C, "size");
        this.Ia = a.width;
        this.Ha = a.height
    });
    D.defineProperty(C, { jm: "center" }, function() { return new N(this.M + this.Ia / 2, this.N + this.Ha / 2) }, function(a) {
        this.Sa(a);
        v && D.l(a, N, C, "center");
        this.M = a.x - this.Ia / 2;
        this.N = a.y - this.Ha / 2
    });
    D.defineProperty(C, { pa: "centerX" }, function() { return this.M + this.Ia / 2 }, function(a) {
        this.Sa(a);
        v && D.p(a, C, "centerX");
        this.M = a - this.Ia / 2
    });
    D.defineProperty(C, { va: "centerY" }, function() { return this.N + this.Ha / 2 }, function(a) {
        this.Sa(a);
        v && D.p(a, C, "centerY");
        this.N = a - this.Ha / 2
    });
    C.prototype.isReal = C.prototype.H = function() { return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height) };
    C.prototype.isEmpty = function() { return 0 === this.width && 0 === this.height };

    function Lb(a, b, c, d) {
        void 0 === a ? this.vh = this.mh = this.Dh = this.Eh = 0 : void 0 === b ? this.left = this.bottom = this.right = this.top = a : void 0 === c ? (d = b, this.top = a, this.right = b, this.bottom = a, this.left = d) : void 0 !== d ? (this.top = a, this.right = b, this.bottom = c, this.left = d) : D.k("Invalid arguments to Margin constructor: " + a + ", " + b + ", " + c + ", " + d);
        this.J = !1
    }
    D.ka("Margin", Lb);
    D.Di(Lb);
    D.me(Lb, { top: !0, right: !0, bottom: !0, left: !0 });
    Lb.prototype.assign = function(a) {
        this.Eh = a.Eh;
        this.Dh = a.Dh;
        this.mh = a.mh;
        this.vh = a.vh
    };
    Lb.prototype.setTo = Lb.prototype.n = function(a, b, c, d) {
        v && (D.h(a, "number", Lb, "setTo:t"), D.h(b, "number", Lb, "setTo:r"), D.h(c, "number", Lb, "setTo:b"), D.h(d, "number", Lb, "setTo:l"));
        this.Sa();
        this.Eh = a;
        this.Dh = b;
        this.mh = c;
        this.vh = d;
        return this
    };
    Lb.prototype.set = Lb.prototype.set = function(a) {
        v && D.l(a, Lb, Lb, "assign:m");
        this.Sa();
        this.Eh = a.Eh;
        this.Dh = a.Dh;
        this.mh = a.mh;
        this.vh = a.vh;
        return this
    };
    Lb.prototype.copy = function() {
        var a = new Lb;
        a.Eh = this.Eh;
        a.Dh = this.Dh;
        a.mh = this.mh;
        a.vh = this.vh;
        return a
    };
    f = Lb.prototype;
    f.Oa = function() {
        this.J = !0;
        Object.freeze(this);
        return this
    };
    f.V = function() { return Object.isFrozen(this) ? this : this.copy().freeze() };
    f.freeze = function() { this.J = !0; return this };
    f.Xa = function() {
        Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
        this.J = !1;
        return this
    };
    f.Sa = function(a) {
        if (this.J) {
            var b = "The Margin is frozen, so its properties cannot be set: " + this.toString();
            void 0 !== a && (b += "  to value: " + a);
            D.k(b)
        }
    };
    Lb.parse = function(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 Lb;
            for (var e = NaN;
                "" === a[b];) b++;
            (d = a[b++]) && (e = parseFloat(d));
            if (isNaN(e)) return new Lb(c);
            for (var g = NaN;
                "" === a[b];) b++;
            (d = a[b++]) && (g = parseFloat(d));
            if (isNaN(g)) return new Lb(c, e);
            for (var h = NaN;
                "" === a[b];) b++;
            (d = a[b++]) && (h = parseFloat(d));
            return isNaN(h) ? new Lb(c, e) : new Lb(c, e, g, h)
        }
        return new Lb
    };
    Lb.stringify = function(a) { v && D.l(a, Lb); return a.top.toString() + " " + a.right.toString() + " " + a.bottom.toString() + " " + a.left.toString() };
    Lb.prototype.toString = function() { return "Margin(" + this.top + "," + this.right + "," + this.bottom + "," + this.left + ")" };
    Lb.prototype.equals = Lb.prototype.O = function(a) { return a instanceof Lb ? this.Eh === a.top && this.Dh === a.right && this.mh === a.bottom && this.vh === a.left : !1 };
    Lb.prototype.equalTo = Lb.prototype.Tx = function(a, b, c, d) { return this.Eh === a && this.Dh === b && this.mh === c && this.vh === d };
    Lb.prototype.equalsApprox = Lb.prototype.Wc = function(a) { return Q(this.Eh, a.top) && Q(this.Dh, a.right) && Q(this.mh, a.bottom) && Q(this.vh, a.left) };
    D.defineProperty(Lb, { top: "top" }, function() { return this.Eh }, function(a) {
        this.Sa(a);
        v && D.p(a, Lb, "top");
        this.Eh = a
    });
    D.defineProperty(Lb, { right: "right" }, function() { return this.Dh }, function(a) {
        this.Sa(a);
        v && D.p(a, Lb, "right");
        this.Dh = a
    });
    D.defineProperty(Lb, { bottom: "bottom" }, function() { return this.mh }, function(a) {
        this.Sa(a);
        v && D.p(a, Lb, "bottom");
        this.mh = a
    });
    D.defineProperty(Lb, { left: "left" }, function() { return this.vh }, function(a) {
        this.Sa(a);
        v && D.p(a, Lb, "left");
        this.vh = a
    });
    Lb.prototype.isReal = Lb.prototype.H = function() { return isFinite(this.top) && isFinite(this.right) && isFinite(this.bottom) && isFinite(this.left) };

    function Ea() {
        this.m11 = 1;
        this.m21 = this.m12 = 0;
        this.m22 = 1;
        this.dy = this.dx = 0
    }
    D.Di(Ea);
    D.me(Ea, { m11: !0, m12: !0, m21: !0, m22: !0, dx: !0, dy: !0 });
    Ea.prototype.set = Ea.prototype.set = function(a) {
        v && D.l(a, Ea, Ea, "set:t");
        this.m11 = a.m11;
        this.m12 = a.m12;
        this.m21 = a.m21;
        this.m22 = a.m22;
        this.dx = a.dx;
        this.dy = a.dy;
        return this
    };
    Ea.prototype.copy = function() {
        var a = new Ea;
        a.m11 = this.m11;
        a.m12 = this.m12;
        a.m21 = this.m21;
        a.m22 = this.m22;
        a.dx = this.dx;
        a.dy = this.dy;
        return a
    };
    Ea.prototype.toString = function() { return "Transform(" + this.m11 + "," + this.m12 + "," + this.m21 + "," + this.m22 + "," + this.dx + "," + this.dy + ")" };
    Ea.prototype.equals = Ea.prototype.O = function(a) { return a instanceof Ea ? this.m11 === a.m11 && this.m12 === a.m12 && this.m21 === a.m21 && this.m22 === a.m22 && this.dx === a.dx && this.dy === a.dy : !1 };
    Ea.prototype.isIdentity = Ea.prototype.Nu = function() { return 1 === this.m11 && 0 === this.m12 && 0 === this.m21 && 1 === this.m22 && 0 === this.dx && 0 === this.dy };
    Ea.prototype.reset = Ea.prototype.reset = function() {
        this.m11 = 1;
        this.m21 = this.m12 = 0;
        this.m22 = 1;
        this.dy = this.dx = 0;
        return this
    };
    Ea.prototype.multiply = Ea.prototype.multiply = function(a) {
        v && D.l(a, Ea, Ea, "multiply:matrix");
        var b = this.m12 * a.m11 + this.m22 * a.m12,
            c = this.m11 * a.m21 + this.m21 * a.m22,
            d = this.m12 * a.m21 + this.m22 * a.m22,
            e = this.m11 * a.dx + this.m21 * a.dy + this.dx,
            g = this.m12 * a.dx + this.m22 * a.dy + this.dy;
        this.m11 = this.m11 * a.m11 + this.m21 * a.m12;
        this.m12 = b;
        this.m21 = c;
        this.m22 = d;
        this.dx = e;
        this.dy = g;
        return this
    };
    Ea.prototype.multiplyInverted = Ea.prototype.GB = function(a) {
        v && D.l(a, Ea, Ea, "multiplyInverted:matrix");
        var b = 1 / (a.m11 * a.m22 - a.m12 * a.m21),
            c = a.m22 * b,
            d = -a.m12 * b,
            e = -a.m21 * b,
            g = a.m11 * b,
            h = b * (a.m21 * a.dy - a.m22 * a.dx),
            k = b * (a.m12 * a.dx - a.m11 * a.dy);
        a = this.m12 * c + this.m22 * d;
        b = this.m11 * e + this.m21 * g;
        e = this.m12 * e + this.m22 * g;
        g = this.m11 * h + this.m21 * k + this.dx;
        h = this.m12 * h + this.m22 * k + this.dy;
        this.m11 = this.m11 * c + this.m21 * d;
        this.m12 = a;
        this.m21 = b;
        this.m22 = e;
        this.dx = g;
        this.dy = h;
        return this
    };
    Ea.prototype.invert = Ea.prototype.pB = function() {
        var a = 1 / (this.m11 * this.m22 - this.m12 * this.m21),
            b = -this.m12 * a,
            c = -this.m21 * a,
            d = this.m11 * a,
            e = a * (this.m21 * this.dy - this.m22 * this.dx),
            g = a * (this.m12 * this.dx - this.m11 * this.dy);
        this.m11 = this.m22 * a;
        this.m12 = b;
        this.m21 = c;
        this.m22 = d;
        this.dx = e;
        this.dy = g;
        return this
    };
    Ea.prototype.rotate = Ea.prototype.rotate = function(a, b, c) {
        v && (D.p(a, Ea, "rotate:angle"), D.p(b, Ea, "rotate:rx"), D.p(c, Ea, "rotate:ry"));
        360 <= a ? a -= 360 : 0 > a && (a += 360);
        if (0 === a) return this;
        this.translate(b, c);
        var d = 0,
            e = 0;
        90 === a ? (d = 0, e = 1) : 180 === a ? (d = -1, e = 0) : 270 === a ? (d = 0, e = -1) : (e = a * Math.PI / 180, d = Math.cos(e), e = Math.sin(e));
        a = this.m12 * d + this.m22 * e;
        var g = this.m11 * -e + this.m21 * d,
            h = this.m12 * -e + this.m22 * d;
        this.m11 = this.m11 * d + this.m21 * e;
        this.m12 = a;
        this.m21 = g;
        this.m22 = h;
        this.translate(-b, -c);
        return this
    };
    Ea.prototype.translate = Ea.prototype.translate = function(a, b) {
        v && (D.p(a, Ea, "translate:x"), D.p(b, Ea, "translate:y"));
        this.dx += this.m11 * a + this.m21 * b;
        this.dy += this.m12 * a + this.m22 * b;
        return this
    };
    Ea.prototype.scale = Ea.prototype.scale = function(a, b) {
        void 0 === b && (b = a);
        v && (D.p(a, Ea, "translate:sx"), D.p(b, Ea, "translate:sy"));
        this.m11 *= a;
        this.m12 *= a;
        this.m21 *= b;
        this.m22 *= b;
        return this
    };
    Ea.prototype.transformPoint = Ea.prototype.vb = function(a) {
        v && D.l(a, N, Ea, "transformPoint:p");
        var b = a.M,
            c = a.N;
        a.M = b * this.m11 + c * this.m21 + this.dx;
        a.N = b * this.m12 + c * this.m22 + this.dy;
        return a
    };
    Ea.prototype.invertedTransformPoint = Ea.prototype.Oh = function(a) {
        v && D.l(a, N, Ea, "invertedTransformPoint:p");
        var b = 1 / (this.m11 * this.m22 - this.m12 * this.m21),
            c = -this.m12 * b,
            d = this.m11 * b,
            e = b * (this.m12 * this.dx - this.m11 * this.dy),
            g = a.M,
            h = a.N;
        a.M = g * this.m22 * b + h * -this.m21 * b + b * (this.m21 * this.dy - this.m22 * this.dx);
        a.N = g * c + h * d + e;
        return a
    };
    Ea.prototype.transformRect = Ea.prototype.tH = function(a) {
        v && D.l(a, C, Ea, "transformRect:rect");
        var b = a.M,
            c = a.N,
            d = b + a.Ia,
            e = c + a.Ha,
            g = this.m11,
            h = this.m12,
            k = this.m21,
            l = this.m22,
            m = this.dx,
            n = this.dy,
            p = b * g + c * k + m,
            q = b * h + c * l + n,
            r = d * g + c * k + m,
            c = d * h + c * l + n,
            s = b * g + e * k + m,
            b = b * h + e * l + n,
            g = d * g + e * k + m,
            d = d * h + e * l + n,
            e = p,
            h = q,
            p = Math.min(p, r),
            e = Math.max(e, r),
            h = Math.min(h, c),
            q = Math.max(q, c),
            p = Math.min(p, s),
            e = Math.max(e, s),
            h = Math.min(h, b),
            q = Math.max(q, b),
            p = Math.min(p, g),
            e = Math.max(e, g),
            h = Math.min(h, d),
            q = Math.max(q, d);
        a.M = p;
        a.N = h;
        a.Ia =
            e - p;
        a.Ha = q - h;
        return a
    };

    function S(a, b, c, d) {
        void 0 === a ? this.Ng = this.Mg = this.N = this.M = 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.J = !1
    }
    D.ka("Spot", S);
    D.Di(S);
    D.me(S, { x: !0, y: !0, offsetX: !0, offsetY: !0 });
    S.prototype.assign = function(a) {
        this.M = a.M;
        this.N = a.N;
        this.Mg = a.Mg;
        this.Ng = a.Ng
    };
    S.prototype.setTo = S.prototype.n = function(a, b, c, d) {
        v && (Wb(a, "setTo:x"), Wb(b, "setTo:y"), Zb(c, "setTo:offx"), Zb(d, "setTo:offy"));
        this.Sa();
        this.M = a;
        this.N = b;
        this.Mg = c;
        this.Ng = d;
        return this
    };
    S.prototype.set = S.prototype.set = function(a) {
        v && D.l(a, S, S, "set:s");
        this.Sa();
        this.M = a.M;
        this.N = a.N;
        this.Mg = a.Mg;
        this.Ng = a.Ng;
        return this
    };
    S.prototype.copy = function() {
        var a = new S;
        a.M = this.M;
        a.N = this.N;
        a.Mg = this.Mg;
        a.Ng = this.Ng;
        return a
    };
    f = S.prototype;
    f.Oa = function() {
        this.J = !0;
        Object.freeze(this);
        return this
    };
    f.V = function() { return Object.isFrozen(this) ? this : this.copy().freeze() };
    f.freeze = function() { this.J = !0; return this };
    f.Xa = function() {
        Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
        this.J = !1;
        return this
    };
    f.Sa = function(a) {
        if (this.J) {
            var b = "The Spot is frozen, so its properties cannot be set: " + this.toString();
            void 0 !== a && (b += "  to value: " + a);
            D.k(b)
        }
    };

    function bc(a, b) {
        a.M = NaN;
        a.N = NaN;
        a.Mg = b;
        return a
    }

    function Wb(a, b) {
        (isNaN(a) || 1 < a || 0 > a) && D.ua(a, "0 <= " + b + " <= 1", S, b)
    }

    function Zb(a, b) {
        (isNaN(a) || Infinity === a || -Infinity === a) && D.ua(a, "real number, not NaN or Infinity", S, b)
    }
    var cc;
    S.parse = cc = function(a) {
        if ("string" === typeof a) {
            a = a.trim();
            if ("None" === a) return dc;
            if ("TopLeft" === a) return ec;
            if ("Top" === a || "TopCenter" === a || "MiddleTop" === a) return jc;
            if ("TopRight" === a) return kc;
            if ("Left" === a || "LeftCenter" === a || "MiddleLeft" === a) return lc;
            if ("Center" === a) return mc;
            if ("Right" === a || "RightCenter" === a || "MiddleRight" === a) return nc;
            if ("BottomLeft" === a) return tc;
            if ("Bottom" === a || "BottomCenter" === a || "MiddleBottom" === a) return uc;
            if ("BottomRight" === a) return vc;
            if ("TopSide" === a) return wc;
            if ("LeftSide" ===
                a) return xc;
            if ("RightSide" === a) return yc;
            if ("BottomSide" === a) return Dc;
            if ("TopBottomSides" === a) return Ec;
            if ("LeftRightSides" === a) return Jc;
            if ("TopLeftSides" === a) return Kc;
            if ("TopRightSides" === a) return Lc;
            if ("BottomLeftSides" === a) return Mc;
            if ("BottomRightSides" === a) return Nc;
            if ("NotTopSide" === a) return Oc;
            if ("NotLeftSide" === a) return Pc;
            if ("NotRightSide" === a) return Sc;
            if ("NotBottomSide" === a) return Tc;
            if ("AllSides" === a) return Uc;
            if ("Default" === a) return Vc;
            a = a.split(" ");
            for (var b = 0, c = 0;
                "" === a[b];) b++;
            var d = a[b++];
            void 0 !== d && 0 < d.length && (c = parseFloat(d));
            for (var e = 0;
                "" === a[b];) b++;
            d = a[b++];
            void 0 !== d && 0 < d.length && (e = parseFloat(d));
            for (var g = 0;
                "" === a[b];) b++;
            d = a[b++];
            void 0 !== d && 0 < d.length && (g = parseFloat(d));
            for (var h = 0;
                "" === a[b];) b++;
            d = a[b++];
            void 0 !== d && 0 < d.length && (h = parseFloat(d));
            return new S(c, e, g, h)
        }
        return new S
    };
    S.stringify = function(a) { v && D.l(a, S); return a.Xc() ? a.x.toString() + " " + a.y.toString() + " " + a.offsetX.toString() + " " + a.offsetY.toString() : a.toString() };
    S.prototype.toString = function() {
        return this.Xc() ? 0 === this.Mg && 0 === this.Ng ? "Spot(" + this.x + "," + this.y + ")" : "Spot(" + this.x + "," + this.y + "," + this.offsetX + "," + this.offsetY + ")" : this.O(dc) ? "None" : this.O(ec) ? "TopLeft" : this.O(jc) ? "Top" : this.O(kc) ? "TopRight" : this.O(lc) ? "Left" : this.O(mc) ? "Center" : this.O(nc) ? "Right" : this.O(tc) ? "BottomLeft" : this.O(uc) ? "Bottom" : this.O(vc) ? "BottomRight" : this.O(wc) ? "TopSide" : this.O(xc) ? "LeftSide" : this.O(yc) ? "RightSide" : this.O(Dc) ? "BottomSide" : this.O(Ec) ? "TopBottomSides" : this.O(Jc) ?
            "LeftRightSides" : this.O(Kc) ? "TopLeftSides" : this.O(Lc) ? "TopRightSides" : this.O(Mc) ? "BottomLeftSides" : this.O(Nc) ? "BottomRightSides" : this.O(Oc) ? "NotTopSide" : this.O(Pc) ? "NotLeftSide" : this.O(Sc) ? "NotRightSide" : this.O(Tc) ? "NotBottomSide" : this.O(Uc) ? "AllSides" : this.O(Vc) ? "Default" : "None"
    };
    S.prototype.equals = S.prototype.O = function(a) { return a instanceof S ? (this.M === a.x || isNaN(this.M) && isNaN(a.x)) && (this.N === a.y || isNaN(this.N) && isNaN(a.y)) && this.Mg === a.offsetX && this.Ng === a.offsetY : !1 };
    S.prototype.opposite = S.prototype.DG = function() { return new S(.5 - (this.M - .5), .5 - (this.N - .5), -this.Mg, -this.Ng) };
    S.prototype.includesSide = S.prototype.Mj = function(a) {
        if (!this.Pj()) return !1;
        if (!a.Pj())
            if (a.O(Wc)) a = xc;
            else if (a.O(Xc)) a = yc;
        else if (a.O(Yc)) a = wc;
        else if (a.O(Zc)) a = Dc;
        else return !1;
        a = a.offsetY;
        return (this.Ng & a) === a
    };
    D.defineProperty(S, { x: "x" }, function() { return this.M }, function(a) {
        this.Sa(a);
        v && Wb(a, "x");
        this.M = a
    });
    D.defineProperty(S, { y: "y" }, function() { return this.N }, function(a) {
        this.Sa(a);
        v && Wb(a, "y");
        this.N = a
    });
    D.defineProperty(S, { offsetX: "offsetX" }, function() { return this.Mg }, function(a) {
        this.Sa(a);
        v && Zb(a, "offsetX");
        this.Mg = a
    });
    D.defineProperty(S, { offsetY: "offsetY" }, function() { return this.Ng }, function(a) {
        this.Sa(a);
        v && Zb(a, "offsetY");
        this.Ng = a
    });
    S.prototype.isSpot = S.prototype.Xc = function() { return !isNaN(this.x) && !isNaN(this.y) };
    S.prototype.isNoSpot = S.prototype.de = function() { return isNaN(this.x) || isNaN(this.y) };
    S.prototype.isSide = S.prototype.Pj = function() { return isNaN(this.x) && isNaN(this.y) && 1 === this.offsetX && 0 !== this.offsetY };
    S.prototype.isNone = S.prototype.sJ = function() { return isNaN(this.x) && isNaN(this.y) && 0 === this.offsetX && 0 === this.offsetY };
    S.prototype.isDefault = S.prototype.ld = function() { return isNaN(this.x) && isNaN(this.y) && -1 === this.offsetX && 0 === this.offsetY };
    var dc;
    S.None = dc = bc(new S(0, 0, 0, 0), 0).Oa();
    var Vc;
    S.Default = Vc = bc(new S(0, 0, -1, 0), -1).Oa();
    var ec;
    S.TopLeft = ec = (new S(0, 0, 0, 0)).Oa();
    var jc;
    S.TopCenter = jc = (new S(.5, 0, 0, 0)).Oa();
    var kc;
    S.TopRight = kc = (new S(1, 0, 0, 0)).Oa();
    var lc;
    S.LeftCenter = lc = (new S(0, .5, 0, 0)).Oa();
    var mc;
    S.Center = mc = (new S(.5, .5, 0, 0)).Oa();
    var nc;
    S.RightCenter = nc = (new S(1, .5, 0, 0)).Oa();
    var tc;
    S.BottomLeft = tc = (new S(0, 1, 0, 0)).Oa();
    var uc;
    S.BottomCenter = uc = (new S(.5, 1, 0, 0)).Oa();
    var vc;
    S.BottomRight = vc = (new S(1, 1, 0, 0)).Oa();
    var $c;
    S.MiddleTop = $c = jc;
    var ed;
    S.MiddleLeft = ed = lc;
    var fd;
    S.MiddleRight = fd = nc;
    var gd;
    S.MiddleBottom = gd = uc;
    var Yc;
    S.Top = Yc = jc;
    var Wc;
    S.Left = Wc = lc;
    var Xc;
    S.Right = Xc = nc;
    var Zc;
    S.Bottom = Zc = uc;
    var wc;
    S.TopSide = wc = bc(new S(0, 0, 1, D.Ad), 1).Oa();
    var xc;
    S.LeftSide = xc = bc(new S(0, 0, 1, D.bd), 1).Oa();
    var yc;
    S.RightSide = yc = bc(new S(0, 0, 1, D.rd), 1).Oa();
    var Dc;
    S.BottomSide = Dc = bc(new S(0, 0, 1, D.qd), 1).Oa();
    var Ec;
    S.TopBottomSides = Ec = bc(new S(0, 0, 1, D.Ad | D.qd), 1).Oa();
    var Jc;
    S.LeftRightSides = Jc = bc(new S(0, 0, 1, D.bd | D.rd), 1).Oa();
    var Kc;
    S.TopLeftSides = Kc = bc(new S(0, 0, 1, D.Ad | D.bd), 1).Oa();
    var Lc;
    S.TopRightSides = Lc = bc(new S(0, 0, 1, D.Ad | D.rd), 1).Oa();
    var Mc;
    S.BottomLeftSides = Mc = bc(new S(0, 0, 1, D.qd | D.bd), 1).Oa();
    var Nc;
    S.BottomRightSides = Nc = bc(new S(0, 0, 1, D.qd | D.rd), 1).Oa();
    var Oc;
    S.NotTopSide = Oc = bc(new S(0, 0, 1, D.bd | D.rd | D.qd), 1).Oa();
    var Pc;
    S.NotLeftSide = Pc = bc(new S(0, 0, 1, D.Ad | D.rd | D.qd), 1).Oa();
    var Sc;
    S.NotRightSide = Sc = bc(new S(0, 0, 1, D.Ad | D.bd | D.qd), 1).Oa();
    var Tc;
    S.NotBottomSide = Tc = bc(new S(0, 0, 1, D.Ad | D.bd | D.rd), 1).Oa();
    var Uc;
    S.AllSides = Uc = bc(new S(0, 0, 1, D.Ad | D.bd | D.rd | D.qd), 1).Oa();

    function hd() { this.ac = [1, 0, 0, 1, 0, 0] }
    hd.prototype.copy = function() {
        var a = new hd;
        a.ac[0] = this.ac[0];
        a.ac[1] = this.ac[1];
        a.ac[2] = this.ac[2];
        a.ac[3] = this.ac[3];
        a.ac[4] = this.ac[4];
        a.ac[5] = this.ac[5];
        return a
    };
    hd.prototype.translate = function(a, b) {
        this.ac[4] += this.ac[0] * a + this.ac[2] * b;
        this.ac[5] += this.ac[1] * a + this.ac[3] * b
    };
    hd.prototype.scale = function(a, b) {
        this.ac[0] *= a;
        this.ac[1] *= a;
        this.ac[2] *= b;
        this.ac[3] *= b
    };

    function id(a) {
        this.type = a;
        this.r2 = this.y2 = this.x2 = this.r1 = this.y1 = this.x1 = 0;
        this.hF = [];
        this.pattern = null
    }
    id.prototype.addColorStop = function(a, b) { this.hF.push({ offset: a, color: b }) };

    function qd(a, b, c) {
        this.fillStyle = "#000000";
        this.font = "10px sans-serif";
        this.globalAlpha = 1;
        this.lineCap = "butt";
        this.bo = 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.strokeStyle = "#000000";
        this.textAlign = "start";
        this.eq = !1;
        this.Pg = this.Gt = this.Ft = 0;
        this.document = b || document;
        this.BF = c;
        this.ny = null;
        this.path = [];
        this.Mh = new hd;
        this.stack = [];
        this.xf = [];
        this.Rx = a;
        this.XJ = "http://www.w3.org/2000/svg";
        this.width = this.Rx.width;
        this.height = this.Rx.height;
        this.Em = rd(this, "svg", { width: this.width + "px", height: this.height + "px", viewBox: "0 0 " + this.Rx.width + " " + this.Rx.height });
        this.Em.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.w3.org/2000/svg");
        this.Em.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink");
        sd(this, 1, 0, 0, 1, 0, 0);
        a = D.Km++;
        b = rd(this, "clipPath", { id: "mainClip" + a });
        b.appendChild(rd(this, "rect", { x: 0, y: 0, width: this.width, height: this.height }));
        this.Em.appendChild(b);
        this.xf[0].setAttributeNS(null, "clip-path", "url(#mainClip" + a + ")")
    }
    f = qd.prototype;
    f.arc = function(a, b, c, d, e, g) { td(this, a, b, c, d, e, g) };
    f.beginPath = function() { this.path = [] };
    f.bezierCurveTo = function(a, b, c, d, e, g) { this.path.push(["C", a, b, c, d, e, g]) };
    f.clearRect = function() {};
    f.clip = function() { ud(this, "clipPath", this.path, new hd) };
    f.closePath = function() { this.path.push(["z"]) };
    f.createLinearGradient = function(a, b, c, d) {
        var e = new id("linear");
        e.x1 = a;
        e.y1 = b;
        e.x2 = c;
        e.y2 = d;
        return e
    };
    f.createPattern = function() { return null };
    f.createRadialGradient = function(a, b, c, d, e, g) {
        var h = new id("radial");
        h.x1 = a;
        h.y1 = b;
        h.r1 = c;
        h.x2 = d;
        h.y2 = e;
        h.r2 = g;
        return h
    };
    f.drawImage = function(a, b, c, d, e, g, h, k, l) {
        var m = "";
        a instanceof HTMLCanvasElement && (m = a.toDataURL());
        a instanceof HTMLImageElement && (m = a.src);
        void 0 === d && (g = b, h = c, k = d = a.naturalWidth, l = e = a.naturalHeight);
        d = d || 0;
        e = e || 0;
        g = g || 0;
        h = h || 0;
        k = k || 0;
        l = l || 0;
        m = { x: 0, y: 0, width: a.naturalWidth, height: a.naturalHeight, href: m, preserveAspectRatio: "xMidYMid slice" };
        Eb(d, k) && Eb(e, l) || (m.preserveAspectRatio = "none");
        var n = "";
        k /= d;
        l /= e;
        if (0 !== g || 0 !== h) n += " translate(" + g + ", " + h + ")";
        if (1 !== k || 1 !== l) n += " scale(" + k + ", " + l + ")";
        if (0 !==
            b || 0 !== c) n += " translate(" + -b + ", " + -c + ")";
        if (0 !== b || 0 !== c || d !== a.naturalWidth || e !== a.naturalHeight) a = "CLIP" + D.Km++, g = rd(this, "clipPath", { id: a }), g.appendChild(rd(this, "rect", { x: b, y: c, width: d, height: e })), this.Em.appendChild(g), m["clip-path"] = "url(#" + a + ")";
        Ed(this, "image", m, this.Mh, n);
        this.addElement("image", m)
    };
    f.fill = function() { ud(this, "fill", this.path, this.Mh) };
    f.Xg = function() { this.eq ? this.clip() : this.fill() };
    f.fillRect = function(a, b, c, d) { Fd(this, "fill", [a, b, c, d], this.Mh) };
    f.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 };
        Ed(this, "fill", b, this.Mh);
        this.addElement("text", b, a[0])
    };
    f.lineTo = function(a, b) { this.path.push(["L", a, b]) };
    f.moveTo = function(a, b) { this.path.push(["M", a, b]) };
    f.quadraticCurveTo = function(a, b, c, d) { this.path.push(["Q", a, b, c, d]) };
    f.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"]) };
    f.restore = function() {
        this.Mh = 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.bo = a.bo;
        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
    };
    f.save = function() {
        this.stack.push({ fillStyle: this.fillStyle, font: this.font, globalAlpha: this.globalAlpha, lineCap: this.lineCap, bo: this.bo, 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 });
        for (var a = [], b = 0; b < this.path.length; b++) a.push(this.path[b]);
        this.stack.push(a);
        this.stack.push(this.Mh.copy())
    };
    f.setTransform = function(a, b, c, d, e, g) { 1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === g || sd(this, a, b, c, d, e, g) };
    f.scale = function(a, b) { this.Mh.scale(a, b) };
    f.translate = function(a, b) { this.Mh.translate(a, b) };
    f.transform = function() {};
    f.stroke = function() { ud(this, "stroke", this.path, this.Mh) };
    f.Zj = function() { this.eq || this.stroke() };
    f.strokeRect = function(a, b, c, d) { Fd(this, "stroke", [a, b, c, d], this.Mh) };

    function rd(a, b, c, d) {
        a = a.document.createElementNS(a.XJ, b);
        if (D.Qa(c))
            for (var e in c) a.setAttributeNS("href" === e ? "http://www.w3.org/1999/xlink" : "", e, c[e]);
        void 0 !== d && (a.textContent = d);
        return a
    }
    f.addElement = function(a, b, c) {
        a = rd(this, a, b, c);
        0 < this.xf.length ? this.xf[this.xf.length - 1].appendChild(a) : this.Em.appendChild(a);
        return this.ny = a
    };

    function Ed(a, b, c, d, e) {
        1 !== a.globalAlpha && (c.opacity = a.globalAlpha);
        "fill" === b ? (a.fillStyle instanceof id ? c.fill = Gd(a, a.fillStyle) : (/^rgba\(/.test(a.fillStyle) && (b = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle), c.fill = "rgb(" + b[1] + "," + b[2] + "," + b[3] + ")", c["fill-opacity"] = b[4]), c.fill = a.fillStyle), c.stroke = "none") : "stroke" === b && (c.fill = "none", a.strokeStyle instanceof id ? c.stroke = Gd(a, a.strokeStyle) : (/^rgba\(/.test(a.strokeStyle) && (b = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle),
            c.stroke = "rgb(" + b[1] + "," + b[2] + "," + b[3] + ")", c["stroke-opacity"] = b[4]), c.stroke = a.strokeStyle), c["stroke-width"] = a.lineWidth, c["stroke-linecap"] = a.lineCap, c["stroke-linejoin"] = a.lineJoin, c["stroke-miterlimit"] = a.miterLimit);
        a = d.ac;
        a = "matrix(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")";
        void 0 !== e && (a += e);
        c.transform = a
    }

    function Gd(a, b) {
        var c = "GRAD" + D.Km++,
            d;
        if ("linear" === b.type) d = rd(a, "linearGradient", { x1: b.x1, x2: b.x2, y1: b.y1, y2: b.y2, id: c, gradientUnits: "userSpaceOnUse" });
        else if ("radial" === b.type) d = rd(a, "radialGradient", { x1: b.x1, x2: b.x2, y1: b.y1, y2: b.y2, r1: b.r1, r2: b.r2, id: c });
        else if ("pattern" === b.type) {
            var e = b.pattern;
            d = { width: e.width, height: e.height, id: c, patternUnits: "userSpaceOnUse" };
            var g = "";
            e instanceof HTMLCanvasElement && (g = e.toDataURL());
            e instanceof HTMLImageElement && (g = e.src);
            e = {
                x: 0,
                y: 0,
                width: e.width,
                height: e.height,
                href: g
            };
            d = rd(a, "pattern", d);
            d.appendChild(rd(a, "image", e))
        } else throw Error("invalid gradient");
        for (var e = b.hF, g = e.length, h = [], k = 0; k < g; k++) {
            var l = e[k],
                m = l.color,
                l = { offset: l.offset, "stop-color": m };
            /^rgba\(/.test(m) && (m = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(m), l["stop-color"] = "rgb(" + m[1] + "," + m[2] + "," + m[3] + ")", l["stop-opacity"] = m[4]);
            h.push(l)
        }
        h.sort(function(a, b) { return a.offset > b.offset ? 1 : -1 });
        for (k = 0; k < g; k++) d.appendChild(rd(a, "stop", h[k]));
        a.Em.appendChild(d);
        return "url(#" + c + ")"
    }

    function Fd(a, b, c, d) {
        c = { x: c[0], y: c[1], width: c[2], height: c[3] };
        Ed(a, b, c, d);
        a.addElement("rect", c)
    }

    function ud(a, b, c, d) {
        for (var e = [], g = 0; g < c.length; g++) {
            var h = D.km(c[g]),
                k = [h.shift()];
            if ("A" === k[0]) k.push(h.shift() + "," + h.shift(), h.shift(), h.shift() + "," + h.shift(), h.shift() + "," + h.shift());
            else
                for (; h.length;) k.push(h.shift() + "," + h.shift());
            e.push(k.join(" "))
        }
        c = { d: e.join(" ") };
        Ed(a, b, c, d);
        "clipPath" === b ? (b = "CLIP" + D.Km++, d = rd(a, "clipPath", { id: b }), d.appendChild(rd(a, "path", c)), a.Em.appendChild(d), 0 < a.xf.length && a.xf[a.xf.length - 1].setAttributeNS(null, "clip-path", "url(#" + b + ")")) : a.addElement("path",
            c)
    }

    function td(a, b, c, d, e, g, h) {
        var k = Math.abs(e - g);
        if (e !== g) {
            var l = b + d * Math.cos(g);
            g = c + d * Math.sin(g);
            k >= 2 * Math.PI ? (td(a, b, c, d, e, e + Math.PI, h), td(a, b, c, d, e + Math.PI, e + 2 * Math.PI, h), a.path.push(["M", l, g])) : (b += d * Math.cos(e), c += d * Math.sin(e), k = 180 * k / Math.PI, e = h ? 0 : 1, h = 180 <= k === !!h ? 0 : 1, 0 !== a.path.length ? a.path.push(["L", b, c]) : a.path.push(["M", b, c]), a.path.push(["A", d, d, k, h, e, l, g]))
        }
    }

    function sd(a, b, c, d, e, g, h) {
        var k = new hd;
        k.ac = [b, c, d, e, g, h];
        b = {};
        Ed(a, "g", b, k);
        k = a.addElement("g", b);
        a.xf.push(k)
    }
    f.jb = function() {
        if (0 !== this.shadowOffsetX || 0 !== this.shadowOffsetY || 0 !== this.shadowBlur) {
            var a = "SHADOW" + D.Km++,
                b = this.addElement("filter", { id: a, x: "-100%", y: "-100%", width: "300%", height: "300%" }, null),
                c, d, e, g, h;
            c = rd(this, "feGaussianBlur", { "in": "SourceAlpha", result: "blur", IM: this.shadowBlur / 2 });
            d = rd(this, "feFlood", { "in": "blur", result: "flood", "flood-color": this.shadowColor });
            e = rd(this, "feComposite", { "in": "flood", in2: "blur", operator: "in", result: "comp" });
            g = rd(this, "feOffset", {
                "in": "comp",
                result: "offsetBlur",
                dx: this.shadowOffsetX,
                dy: this.shadowOffsetY
            });
            h = rd(this, "feMerge", {});
            h.appendChild(rd(this, "feMergeNode", { "in": "offsetBlur" }));
            h.appendChild(rd(this, "feMergeNode", { "in": "SourceGraphic" }));
            b.appendChild(c);
            b.appendChild(d);
            b.appendChild(e);
            b.appendChild(g);
            b.appendChild(h);
            0 < this.xf.length && this.xf[this.xf.length - 1].setAttributeNS(null, "filter", "url(#" + a + ")")
        }
    };
    f.fC = function(a, b, c) {
        this.Ft = a;
        this.Gt = b;
        this.Pg = c
    };
    f.Cm = function() { this.shadowBlur = this.shadowOffsetY = this.shadowOffsetX = 0 };
    f.wo = function() {
        this.shadowOffsetX = this.Ft;
        this.shadowOffsetY = this.Gt;
        this.shadowBlur = this.Pg
    };
    f.YA = function() { return !1 };
    f.TA = function() {};
    f.De = function() {};
    f.Sy = function() {};
    qd.prototype.rotate = function() {};

    function ja(a, b) {
        this.ownerDocument = void 0 === b ? document : b;
        var c = this.ownerDocument.createElement("canvas");
        c.tabIndex = 0;
        this.$d = c;
        this.Tk = new Hd(c);
        c.ca = a;
        Object.seal(this)
    }
    f = ja.prototype;
    f.toDataURL = function(a, b) { return this.$d.toDataURL(a, b) };
    f.getBoundingClientRect = function() { return this.$d.getBoundingClientRect() };
    f.focus = function() { return this.$d.focus() };
    f.addEventListener = function(a, b, c) { this.$d.addEventListener(a, b, c) };
    f.removeEventListener = function(a, b, c) { this.$d.removeEventListener(a, b, c) };
    D.defineProperty(ja, { width: "width" }, function() { return this.$d.width }, function(a) { this.$d.width = a });
    D.defineProperty(ja, { height: "height" }, function() { return this.$d.height }, function(a) { this.$d.height = a });
    D.w(ja, { style: "style" }, function() { return this.$d.style });

    function Hd(a) {
        a.getContext && a.getContext("2d") || D.k("Browser does not support HTML Canvas Element");
        this.za = a.getContext("2d");
        this.qz = this.sz = this.rz = "";
        this.vr = !1;
        this.Pg = this.Gt = this.Ft = 0;
        Object.seal(this)
    }
    Hd.prototype.Sy = function(a) { this.za.lB = a };
    D.defineProperty(Hd, { fillStyle: "fillStyle" }, function() { return this.za.fillStyle }, function(a) { this.qz !== a && (this.qz = this.za.fillStyle = a) });
    D.defineProperty(Hd, { font: "font" }, function() { return this.za.font }, function(a) { this.rz !== a && (this.rz = this.za.font = a) });
    D.defineProperty(Hd, { globalAlpha: "globalAlpha" }, function() { return this.za.globalAlpha }, function(a) { this.za.globalAlpha = a });
    D.defineProperty(Hd, { lineCap: "lineCap" }, function() { return this.za.lineCap }, function(a) { this.za.lineCap = a });
    D.defineProperty(Hd, { bo: "lineDashOffset" }, function() { return this.za.bo }, function(a) { this.za.bo = a });
    D.defineProperty(Hd, { lineJoin: "lineJoin" }, function() { return this.za.lineJoin }, function(a) { this.za.lineJoin = a });
    D.defineProperty(Hd, { lineWidth: "lineWidth" }, function() { return this.za.lineWidth }, function(a) { this.za.lineWidth = a });
    D.defineProperty(Hd, { miterLimit: "miterLimit" }, function() { return this.za.miterLimit }, function(a) { this.za.miterLimit = a });
    D.defineProperty(Hd, { shadowBlur: "shadowBlur" }, function() { return this.za.shadowBlur }, function(a) { this.za.shadowBlur = a });
    D.defineProperty(Hd, { shadowColor: "shadowColor" }, function() { return this.za.shadowColor }, function(a) { this.za.shadowColor = a });
    D.defineProperty(Hd, { shadowOffsetX: "shadowOffsetX" }, function() { return this.za.shadowOffsetX }, function(a) { this.za.shadowOffsetX = a });
    D.defineProperty(Hd, { shadowOffsetY: "shadowOffsetY" }, function() { return this.za.shadowOffsetY }, function(a) { this.za.shadowOffsetY = a });
    D.defineProperty(Hd, { strokeStyle: "strokeStyle" }, function() { return this.za.strokeStyle }, function(a) { this.sz !== a && (this.sz = this.za.strokeStyle = a) });
    D.defineProperty(Hd, { textAlign: "textAlign" }, function() { return this.za.textAlign }, function(a) { this.za.textAlign = a });
    D.defineProperty(Hd, { lB: "imageSmoothingEnabled" }, function() { return this.za.lB }, function(a) { this.za.lB = a });
    f = Hd.prototype;
    f.arc = function(a, b, c, d, e, g) { this.za.arc(a, b, c, d, e, g) };
    f.beginPath = function() { this.za.beginPath() };
    f.bezierCurveTo = function(a, b, c, d, e, g) { this.za.bezierCurveTo(a, b, c, d, e, g) };
    f.clearRect = function(a, b, c, d) { this.za.clearRect(a, b, c, d) };
    f.clip = function() { this.za.clip() };
    f.closePath = function() { this.za.closePath() };
    f.createLinearGradient = function(a, b, c, d) { return this.za.createLinearGradient(a, b, c, d) };
    f.createPattern = function(a, b) { return this.za.createPattern(a, b) };
    f.createRadialGradient = function(a, b, c, d, e, g) { return this.za.createRadialGradient(a, b, c, d, e, g) };
    f.drawImage = function(a, b, c, d, e, g, h, k, l) { void 0 === d ? this.za.drawImage(a, b, c) : this.za.drawImage(a, b, c, d, e, g, h, k, l) };
    f.fill = function() { this.za.fill() };
    f.fillRect = function(a, b, c, d) { this.za.fillRect(a, b, c, d) };
    f.fillText = function(a, b, c) { this.za.fillText(a, b, c) };
    f.getImageData = function(a, b, c, d) { return this.za.getImageData(a, b, c, d) };
    f.lineTo = function(a, b) { this.za.lineTo(a, b) };
    f.measureText = function(a) { return this.za.measureText(a) };
    f.moveTo = function(a, b) { this.za.moveTo(a, b) };
    f.quadraticCurveTo = function(a, b, c, d) { this.za.quadraticCurveTo(a, b, c, d) };
    f.rect = function(a, b, c, d) { this.za.rect(a, b, c, d) };
    f.restore = function() { this.za.restore() };
    Hd.prototype.rotate = function(a) { this.za.rotate(a) };
    f = Hd.prototype;
    f.save = function() { this.za.save() };
    f.setTransform = function(a, b, c, d, e, g) { this.za.setTransform(a, b, c, d, e, g) };
    f.scale = function(a, b) { this.za.scale(a, b) };
    f.stroke = function() { this.za.stroke() };
    f.transform = function(a, b, c, d, e, g) { 1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === g || this.za.transform(a, b, c, d, e, g) };
    f.translate = function(a, b) { this.za.translate(a, b) };
    f.Xg = function(a) {
        if (a instanceof Ba && a.type === Id) {
            var b = a.Mo;
            a = a.xz;
            a > b ? (this.scale(b / a, 1), this.translate((a - b) / 2, 0)) : b > a && (this.scale(1, a / b), this.translate(0, (b - a) / 2));
            this.vr ? this.clip() : this.fill();
            a > b ? (this.translate(-(a - b) / 2, 0), this.scale(1 / (b / a), 1)) : b > a && (this.translate(0, -(b - a) / 2), this.scale(1, 1 / (a / b)))
        } else this.vr ? this.clip() : this.fill()
    };
    f.Zj = function() { this.vr || this.stroke() };
    D.defineProperty(Hd, { eq: "clipInsteadOfFill" }, function() { return this.vr }, function(a) { this.vr = a });
    f = Hd.prototype;
    f.fC = function(a, b, c) {
        this.Ft = a;
        this.Gt = b;
        this.Pg = c
    };
    f.Cm = function() { this.shadowBlur = this.shadowOffsetY = this.shadowOffsetX = 0 };
    f.wo = function() {
        this.shadowOffsetX = this.Ft;
        this.shadowOffsetY = this.Gt;
        this.shadowBlur = this.Pg
    };
    f.YA = function(a, b) {
        var c = this.za;
        if (void 0 !== c.setLineDash) c.setLineDash(a), c.lineDashOffset = b;
        else if (void 0 !== c.webkitLineDash) c.webkitLineDash = a, c.webkitLineDashOffset = b;
        else return !1;
        return !0
    };
    f.TA = function() {
        var a = this.za;
        void 0 !== a.setLineDash ? (a.setLineDash(D.Do), a.lineDashOffset = 0) : void 0 !== a.webkitLineDash && (a.webkitLineDash = D.Do, a.webkitLineDashOffset = 0)
    };
    f.De = function(a) {
        a && (this.rz = "");
        this.qz = this.sz = ""
    };
    var Jd = (Math.sqrt(2) - 1) / 3 * 4,
        Kd = (new N(0, 0)).Oa(),
        Ld = (new C(0, 0, 0, 0)).Oa(),
        Sd = (new Lb(0, 0, 0, 0)).Oa(),
        Td = (new Lb(2, 2, 2, 2)).Oa(),
        Ud = (new N(6, 6)).Oa(),
        Vd = (new N(-Infinity, -Infinity)).Oa(),
        Wd = (new N(Infinity, Infinity)).Oa(),
        Xd = (new Ca(0, 0)).Oa(),
        Yd = (new Ca(1, 1)).Oa(),
        Zd = (new Ca(6, 6)).Oa(),
        $d = (new Ca(8, 8)).Oa(),
        ae = (new Ca(10, 10)).Oa(),
        ge = (new Ca(Infinity, Infinity)).Oa(),
        he = (new N(NaN, NaN)).Oa(),
        ie = (new Ca(NaN, NaN)).Oa(),
        je = (new C(NaN, NaN, NaN, NaN)).Oa(),
        ke = (new S(.156, .156)).Oa(),
        le = (new S(.844, .844)).Oa(),
        me = new ma,
        ne = new ma,
        oe = null;

    function pe(a) {
        if (0 >= a) return 0;
        var b = oe;
        if (null === b) {
            for (var b = [], c = 0; 2E3 >= c; c++) b[c] = Math.sqrt(c);
            oe = b
        }
        return 1 > a ? (c = 1 / a, 2E3 >= c ? 1 / b[c | 0] : Math.sqrt(a)) : 2E3 >= a ? b[a | 0] : Math.sqrt(a)
    }

    function Q(a, b) { var c = a - b; return .5 > c && -.5 < c }

    function Eb(a, b) { var c = a - b; return 5E-8 > c && -5E-8 < c }

    function qe(a, b, c, d, e, g, h) {
        0 >= e && (e = 1E-6);
        var k = 0,
            l = 0,
            m = 0,
            n = 0;
        a < c ? (l = a, k = c) : (l = c, k = a);
        b < d ? (n = b, m = d) : (n = d, m = b);
        if (a === c) return n <= h && h <= m && a - e <= g && g <= a + e;
        if (b === d) return l <= g && g <= k && b - e <= h && h <= b + e;
        k += e;
        l -= e;
        if (l <= g && g <= k && (m += e, n -= e, n <= h && h <= m))
            if (k - l > m - n)
                if (a - c > e || c - a > e) { if (g = (d - b) / (c - a) * (g - a) + b, g - e <= h && h <= g + e) return !0 } else return !0;
        else if (b - d > e || d - b > e) { if (h = (c - a) / (d - b) * (h - b) + a, h - e <= g && g <= h + e) return !0 } else return !0;
        return !1
    }

    function re(a, b, c, d, e, g, h, k, l, m, n, p) {
        if (qe(a, b, h, k, p, c, d) && qe(a, b, h, k, p, e, g)) return qe(a, b, h, k, p, m, n);
        var q = (a + c) / 2,
            r = (b + d) / 2,
            s = (c + e) / 2,
            u = (d + g) / 2;
        e = (e + h) / 2;
        g = (g + k) / 2;
        d = (q + s) / 2;
        c = (r + u) / 2;
        var s = (s + e) / 2,
            u = (u + g) / 2,
            t = (d + s) / 2,
            y = (c + u) / 2;
        return re(a, b, q, r, d, c, t, y, l, m, n, p) || re(t, y, s, u, e, g, h, k, l, m, n, p)
    }

    function Ae(a, b, c, d, e, g, h, k, l, m) {
        if (qe(a, b, h, k, l, c, d) && qe(a, b, h, k, l, e, g)) Ub(m, a, b, 0, 0), Ub(m, h, k, 0, 0);
        else {
            var n = (a + c) / 2,
                p = (b + d) / 2,
                q = (c + e) / 2,
                r = (d + g) / 2;
            e = (e + h) / 2;
            g = (g + k) / 2;
            d = (n + q) / 2;
            c = (p + r) / 2;
            var q = (q + e) / 2,
                r = (r + g) / 2,
                s = (d + q) / 2,
                u = (c + r) / 2;
            Ae(a, b, n, p, d, c, s, u, l, m);
            Ae(s, u, q, r, e, g, h, k, l, m)
        }
    }

    function Be(a, b, c, d, e, g, h, k, l, m) {
        if (qe(a, b, h, k, l, c, d) && qe(a, b, h, k, l, e, g)) 0 === m.length && (m.push(a), m.push(b)), m.push(h), m.push(k);
        else {
            var n = (a + c) / 2,
                p = (b + d) / 2,
                q = (c + e) / 2,
                r = (d + g) / 2;
            e = (e + h) / 2;
            g = (g + k) / 2;
            d = (n + q) / 2;
            c = (p + r) / 2;
            var q = (q + e) / 2,
                r = (r + g) / 2,
                s = (d + q) / 2,
                u = (c + r) / 2;
            Be(a, b, n, p, d, c, s, u, l, m);
            Be(s, u, q, r, e, g, h, k, l, m)
        }
    }

    function Ce(a, b, c, d, e, g, h, k, l, m, n, p, q, r) {
        var s = 1 - l;
        a = a * s + c * l;
        b = b * s + d * l;
        c = c * s + e * l;
        d = d * s + g * l;
        e = e * s + h * l;
        g = g * s + k * l;
        k = a * s + c * l;
        h = b * s + d * l;
        c = c * s + e * l;
        d = d * s + g * l;
        m.x = a;
        m.y = b;
        n.x = k;
        n.y = h;
        p.x = k * s + c * l;
        p.y = h * s + d * l;
        q.x = c;
        q.y = d;
        r.x = e;
        r.y = g
    }

    function De(a, b, c, d, e, g, h, k, l, m) {
        if (qe(a, b, e, g, m, c, d)) return qe(a, b, e, g, m, k, l);
        var n = (a + c) / 2,
            p = (b + d) / 2;
        c = (c + e) / 2;
        d = (d + g) / 2;
        var q = (n + c) / 2,
            r = (p + d) / 2;
        return De(a, b, n, p, q, r, h, k, l, m) || De(q, r, c, d, e, g, h, k, l, m)
    }

    function Ee(a, b, c, d, e, g, h, k) {
        if (qe(a, b, e, g, h, c, d)) Ub(k, a, b, 0, 0), Ub(k, e, g, 0, 0);
        else {
            var l = (a + c) / 2,
                m = (b + d) / 2;
            c = (c + e) / 2;
            d = (d + g) / 2;
            var n = (l + c) / 2,
                p = (m + d) / 2;
            Ee(a, b, l, m, n, p, h, k);
            Ee(n, p, c, d, e, g, h, k)
        }
    }

    function Fe(a, b, c, d, e, g, h, k) {
        if (qe(a, b, e, g, h, c, d)) 0 === k.length && (k.push(a), k.push(b)), k.push(e), k.push(g);
        else {
            var l = (a + c) / 2,
                m = (b + d) / 2;
            c = (c + e) / 2;
            d = (d + g) / 2;
            var n = (l + c) / 2,
                p = (m + d) / 2;
            Fe(a, b, l, m, n, p, h, k);
            Fe(n, p, c, d, e, g, h, k)
        }
    }

    function Ge(a, b, c, d, e, g, h, k, l, m, n, p, q, r) {
        0 >= q && (q = 1E-6);
        if (qe(a, b, h, k, q, c, d) && qe(a, b, h, k, q, e, g)) {
            var s = (a - h) * (m - p) - (b - k) * (l - n);
            if (0 === s) return !1;
            q = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / s;
            s = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / s;
            if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) { if (h = l = 0, b < k ? (l = b, h = k) : (l = k, h = b), s < l || s > h) return !1 } else if (a < h ? l = a : (l = h, h = a), q < l || q > h) return !1;
            r.x = q;
            r.y = s;
            return !0
        }
        var s = (a + c) / 2,
            u = (b + d) / 2;
        c = (c + e) / 2;
        d = (d + g) / 2;
        e = (e + h) / 2;
        g = (g + k) / 2;
        var t = (s + c) / 2,
            y = (u + d) / 2;
        c = (c + e) / 2;
        d = (d + g) / 2;
        var w = (t + c) / 2,
            A = (y + d) / 2,
            B = (n - l) * (n - l) + (p - m) * (p - m),
            P = !1;
        Ge(a, b, s, u, t, y, w, A, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < B && (B = b, P = !0));
        a = r.x;
        s = r.y;
        Ge(w, A, c, d, e, g, h, k, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < B ? P = !0 : (r.x = a, r.y = s));
        return P
    }

    function He(a, b, c, d, e, g, h, k, l, m, n, p, q) {
        var r = 0;
        0 >= q && (q = 1E-6);
        if (qe(a, b, h, k, q, c, d) && qe(a, b, h, k, q, e, g)) {
            q = (a - h) * (m - p) - (b - k) * (l - n);
            if (0 === q) return r;
            var s = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / q,
                u = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / q;
            if (s >= n) return r;
            if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) { if (a = l = 0, b < k ? (l = b, a = k) : (l = k, a = b), u < l || u > a) return r } else if (a < h ? (l = a, a = h) : l = h, s < l || s > a) return r;
            0 < q ? r++ : 0 > q && r--
        } else {
            var s = (a + c) / 2,
                u = (b + d) / 2,
                t = (c + e) / 2,
                y = (d + g) / 2;
            e = (e + h) / 2;
            g = (g + k) / 2;
            d = (s + t) / 2;
            c = (u + y) / 2;
            var t = (t + e) / 2,
                y = (y + g) / 2,
                w = (d + t) / 2,
                A = (c + y) / 2,
                r = r + He(a, b, s, u, d, c, w, A, l, m, n, p, q),
                r = r + He(w, A, t, y, e, g, h, k, l, m, n, p, q)
        }
        return r
    }

    function fb(a, b, c, d, e, g, h) {
        if (Eb(a, c)) {
            var k = 0;
            c = 0;
            b < d ? (k = b, c = d) : (k = d, c = b);
            d = g;
            if (d < k) return h.x = a, h.y = k, !1;
            if (d > c) return h.x = a, h.y = c, !1;
            h.x = a;
            h.y = d;
            return !0
        }
        if (Eb(b, d)) {
            a < c ? k = a : (k = c, c = a);
            d = e;
            if (d < k) return h.x = k, h.y = b, !1;
            if (d > c) return h.x = c, h.y = b, !1;
            h.x = d;
            h.y = b;
            return !0
        }
        k = ((a - e) * (a - c) + (b - g) * (b - d)) / ((c - a) * (c - a) + (d - b) * (d - b));
        if (-5E-6 > k) return h.x = a, h.y = b, !1;
        if (1.000005 < k) return h.x = c, h.y = d, !1;
        h.x = a + k * (c - a);
        h.y = b + k * (d - b);
        return !0
    }

    function Ie(a, b, c, d, e, g, h, k, l) {
        if (Q(a, c) && Q(b, d)) return l.x = a, l.y = b, !1;
        if (Eb(e, h)) {
            if (Eb(a, c)) return fb(a, b, c, d, e, g, l), !1;
            g = (d - b) / (c - a) * (e - a) + b;
            return fb(a, b, c, d, e, g, l)
        }
        k = (k - g) / (h - e);
        if (Eb(a, c)) {
            g = k * (a - e) + g;
            c = h = 0;
            b < d ? (h = b, c = d) : (h = d, c = b);
            if (g < h) return l.x = a, l.y = h, !1;
            if (g > c) return l.x = a, l.y = c, !1;
            l.x = a;
            l.y = g;
            return !0
        }
        h = (d - b) / (c - a);
        if (Eb(k, h)) return fb(a, b, c, d, e, g, l), !1;
        e = (h * a - k * e + g - b) / (h - k);
        if (Eb(h, 0)) {
            a < c ? h = a : (h = c, c = a);
            if (e < h) return l.x = h, l.y = b, !1;
            if (e > c) return l.x = c, l.y = b, !1;
            l.x = e;
            l.y = b;
            return !0
        }
        g =
            h * (e - a) + b;
        return fb(a, b, c, d, e, g, l)
    }

    function Je(a, b, c, d, e, g, h, k, l) {
        var m = 1E21,
            n = a,
            p = b;
        if (Ie(a, b, a, d, e, g, h, k, l)) {
            var q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g);
            q < m && (m = q, n = l.x, p = l.y)
        }
        Ie(c, b, c, d, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
        Ie(a, b, c, b, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
        Ie(a, d, c, d, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
        l.x = n;
        l.y = p;
        return 1E21 > m
    }

    function Ke(a, b, c, d, e, g, h, k, l) {
        c = a - c;
        var m = e - h,
            n = h = 0;
        0 === c || 0 === m ? 0 === c ? (k = (g - k) / m, h = a, n = k * h + (g - k * e)) : (d = (b - d) / c, h = e, n = d * h + (b - d * a)) : (d = (b - d) / c, k = (g - k) / m, a = b - d * a, h = (g - k * e - a) / (d - k), n = d * h + a);
        l.n(h, n);
        return l
    }

    function Le(a, b, c) {
        var d = b.x,
            e = b.y,
            g = c.x,
            h = c.y,
            k = a.left,
            l = a.right,
            m = a.top,
            n = a.bottom;
        return d === g ? (g = a = 0, e < h ? (a = e, g = h) : (a = h, g = e), k <= d && d <= l && a <= n && g >= m) : e === h ? (d < g ? a = d : (a = g, g = d), m <= e && e <= n && a <= l && g >= k) : a.Pa(b) || a.Pa(c) || Pe(k, m, l, m, d, e, g, h) || Pe(l, m, l, n, d, e, g, h) || Pe(l, n, k, n, d, e, g, h) || Pe(k, n, k, m, d, e, g, h) ? !0 : !1
    }

    function Pe(a, b, c, d, e, g, h, k) { return 0 >= Qe(a, b, c, d, e, g) * Qe(a, b, c, d, h, k) && 0 >= Qe(e, g, h, k, a, b) * Qe(e, g, h, k, c, d) }

    function Qe(a, b, c, d, e, g) {
        c -= a;
        d -= b;
        a = e - a;
        b = g - b;
        g = a * d - b * c;
        0 === g && (g = a * c + b * d, 0 < g && (g = (a - c) * c + (b - d) * d, 0 > g && (g = 0)));
        return 0 > g ? -1 : 0 < g ? 1 : 0
    }

    function Re(a) {
        0 > a && (a += 360);
        360 <= a && (a -= 360);
        return a
    }

    function Se(a, b, c, d) {
        var e = Math.PI;
        d || (b *= e / 180, c *= e / 180);
        var g = b > c ? -1 : 1;
        d = [];
        var h = e / 2,
            k = b;
        c = Math.min(2 * e, Math.abs(c - b));
        if (1E-5 > c) return b = k + g * Math.min(c, h), g = 0 + a * Math.cos(k), k = 0 + a * Math.sin(k), h = 0 + a * Math.cos(b), a = 0 + a * Math.sin(b), b = (g + h) / 2, c = (k + a) / 2, d.push([g, k, b, c, b, c, h, a]), d;
        for (; 1E-5 < c;) {
            b = k + g * Math.min(c, h);
            var e = (b - k) / 2,
                l = a * Math.cos(e),
                m = a * Math.sin(e),
                n = -m,
                p = l * l + n * n,
                q = p + l * l + n * m,
                p = 4 / 3 * (Math.sqrt(2 * p * q) - q) / (l * m - n * l),
                m = l - p * n,
                l = n + p * l,
                n = -l,
                p = e + k,
                e = Math.cos(p),
                p = Math.sin(p);
            d.push([0 + a * Math.cos(k),
                0 + a * Math.sin(k), 0 + m * e - l * p, 0 + m * p + l * e, 0 + m * e - n * p, 0 + m * p + n * e, 0 + a * Math.cos(b), 0 + a * Math.sin(b)
            ]);
            c -= Math.abs(b - k);
            k = b
        }
        return d
    }

    function jb(a, b, c, d, e, g, h) {
        c = Math.floor((a - c) / e) * e + c;
        d = Math.floor((b - d) / g) * g + d;
        var k = c;
        c + e - a < e / 2 && (k = c + e);
        a = d;
        d + g - b < g / 2 && (a = d + g);
        h.n(k, a)
    }

    function Te(a, b) {
        var c = Math.max(a, b),
            d = Math.min(a, b),
            e = 1,
            g = 1;
        do e = c % d, c = g = d, d = e; while (0 < e);
        return g
    }

    function Ue(a, b, c, d) {
        var e = 0 > c,
            g = 0 > d,
            h = 0,
            k = h = 0;
        a < b ? (h = 1, k = 0) : (h = 0, k = 1);
        var l = 0,
            m = 0,
            n = 0,
            p = 0,
            l = 0 === h ? a : b,
            n = 0 === h ? c : d;
        if (0 === h ? e : g) n = -n;
        h = k;
        m = 0 === h ? a : b;
        p = 0 === h ? c : d;
        if (0 === h ? e : g) p = -p;
        a = a = 0;
        if (0 < p)
            if (0 < n) {
                b = l * l;
                a = m * m;
                l *= n;
                c = m * p;
                d = -a + c;
                e = -a + Math.sqrt(l * l + c * c);
                m = d;
                for (g = 0; 9999999999 > g; ++g) {
                    m = .5 * (d + e);
                    if (m === d || m === e) break;
                    k = l / (m + b);
                    h = c / (m + a);
                    k = k * k + h * h - 1;
                    if (0 < k) d = m;
                    else if (0 > k) e = m;
                    else break
                }
                n = b * n / (m + b) - n;
                p = a * p / (m + a) - p;
                a = Math.sqrt(n * n + p * p)
            } else a = Math.abs(p - m);
        else p = l * l - m * m, a = l * n, a < p ? (p = a / p, a = m * Math.sqrt(Math.abs(1 -
            p * p)), n = l * p - n, a = Math.sqrt(n * n + a * a)) : a = Math.abs(n - l);
        return a
    }

    function Ve(a) {
        1 < arguments.length && D.k("Geometry constructor can take at most one optional argument, the Geometry type.");
        D.xc(this);
        this.J = !1;
        void 0 === a ? a = We : v && D.Da(a, Ve, Ve, "constructor:type");
        this.da = a;
        this.Jb = this.Cb = this.Mc = this.Ac = 0;
        this.jk = new K(Xe);
        this.dw = this.jk.I;
        this.Pv = (new C).freeze();
        this.ob = !0;
        this.kr = this.Go = null;
        this.lr = NaN;
        this.xi = ec;
        this.yi = vc;
        this.jp = this.lp = NaN;
        this.Xi = Ye
    }
    D.ka("Geometry", Ve);
    D.Di(Ve);
    Ve.prototype.copy = function() {
        var a = new Ve;
        a.da = this.da;
        a.Ac = this.Ac;
        a.Mc = this.Mc;
        a.Cb = this.Cb;
        a.Jb = this.Jb;
        for (var b = this.jk.o, c = b.length, d = a.jk, e = 0; e < c; e++) {
            var g = b[e].copy();
            d.add(g)
        }
        a.dw = this.dw;
        a.Pv.assign(this.Pv);
        a.ob = this.ob;
        a.Go = this.Go;
        a.kr = this.kr;
        a.lr = this.lr;
        a.xi = this.xi.V();
        a.yi = this.yi.V();
        a.lp = this.lp;
        a.jp = this.jp;
        a.Xi = this.Xi;
        return a
    };
    var Ze;
    Ve.Line = Ze = D.s(Ve, "Line", 0);
    var tf;
    Ve.Rectangle = tf = D.s(Ve, "Rectangle", 1);
    var uf;
    Ve.Ellipse = uf = D.s(Ve, "Ellipse", 2);
    var We;
    Ve.Path = We = D.s(Ve, "Path", 3);
    Ve.prototype.Oa = function() {
        this.freeze();
        Object.freeze(this);
        return this
    };
    Ve.prototype.freeze = function() {
        this.J = !0;
        var a = this.nc;
        a.freeze();
        for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].freeze();
        return this
    };
    Ve.prototype.Xa = function() {
        Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
        this.J = !1;
        var a = this.nc;
        a.Xa();
        for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].Xa();
        return this
    };
    Ve.prototype.equalsApprox = Ve.prototype.Wc = function(a) {
        if (!(a instanceof Ve)) return !1;
        if (this.type !== a.type) return this.type === Ze && a.type === We ? vf(this, a) : a.type === Ze && this.type === We ? vf(a, this) : !1;
        if (this.type === We) {
            var b = this.nc.o;
            a = a.nc.o;
            var c = b.length;
            if (c !== a.length) return !1;
            for (var d = 0; d < c; d++)
                if (!b[d].Wc(a[d])) return !1;
            return !0
        }
        return Q(this.la, a.la) && Q(this.ja, a.ja) && Q(this.F, a.F) && Q(this.G, a.G)
    };

    function vf(a, b) { if (a.type !== Ze || b.type !== We) return !1; if (1 === b.nc.count) { var c = b.nc.fa(0); if (1 === c.Eb.count && Q(a.la, c.la) && Q(a.ja, c.ja) && (c = c.Eb.fa(0), c.type === wf && Q(a.F, c.F) && Q(a.G, c.G))) return !0 } return !1 }
    var xf;
    Ve.stringify = xf = function(a) { return a.toString() };
    Ve.prototype.qc = function(a) { a.Qe === Ve ? this.type = a : D.ak(this, a) };
    Ve.prototype.toString = function(a) {
        void 0 === a && (a = -1);
        switch (this.type) {
            case Ze:
                return 0 > a ? "M" + this.la.toString() + " " + this.ja.toString() + "L" + this.F.toString() + " " + this.G.toString() : "M" + this.la.toFixed(a) + " " + this.ja.toFixed(a) + "L" + this.F.toFixed(a) + " " + this.G.toFixed(a);
            case tf:
                var b = new C(this.la, this.ja, 0, 0);
                b.uH(this.F, this.G, 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 uf:
                b = new C(this.la, this.ja, 0, 0);
                b.uH(this.F, this.G, 0, 0);
                if (0 > a) {
                    var c = b.left.toString() + " " + (b.y + b.height / 2).toString(),
                        d = b.right.toString() + " " + (b.y + b.height / 2).toString();
                    return "M" + c + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + d + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + c
                }
                c = b.left.toFixed(a) + " " + (b.y + b.height / 2).toFixed(a);
                d = b.right.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 " + d + "A" + (b.width / 2).toFixed(a) + " " + (b.height / 2).toFixed(a) + " 0 0 1 " + c;
            case We:
                for (var b = "", c = this.nc.o, d = c.length, e = 0; e < d; e++) {
                    var g = c[e];
                    0 < e && (b += " x ");
                    g.Ku && (b += "F ");
                    b += g.toString(a)
                }
                return b;
            default:
                return this.type.toString()
        }
    };
    Ve.fillPath = function(a) {
        "string" !== typeof a && D.kc(a, "string", Ve, "fillPath:str");
        a = a.split(/[Xx]/);
        for (var b = a.length, c = "", d = 0; d < b; d++) var e = a[d],
            c = null !== e.match(/[Ff]/) ? 0 === d ? c + e : c + ("X" + (" " === e[0] ? "" : " ") + e) : c + ((0 === d ? "" : "X ") + "F" + (" " === e[0] ? "" : " ") + e);
        return c
    };
    var yf;
    Ve.parse = yf = function(a, b) {
        function c() { return t >= P - 1 ? !0 : null !== l[t + 1].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/) }

        function d() { t++; return l[t] }

        function e() {
            var a = new N(parseFloat(d()), parseFloat(d()));
            y === y.toLowerCase() && (a.x = B.x + a.x, a.y = B.y + a.y);
            return a
        }

        function g() { return B = e() }

        function h() { return A = e() }

        function k() { return "c" !== w.toLowerCase() && "s" !== w.toLowerCase() ? B : new N(2 * B.x - A.x, 2 * B.y - A.y) }
        void 0 === b && (b = !1);
        "string" !== typeof a && D.kc(a, "string", Ve, "parse:str");
        a = a.replace(/,/gm, " ");
        a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,
            "$1 $2");
        a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm, "$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(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm, "$1 $3 $4 ");
        a = a.replace(/[\s\r\t\n]+/gm, " ");
        a = a.replace(/^\s+|\s+$/g, "");
        for (var l = a.split(" "), m = 0; m < l.length; m++) {
            var n = l[m];
            if (null !== n.match(/(\.[0-9]*)(\.)/gm)) {
                for (var p = [], q = "", r = !1, s = 0; s < n.length; s++) { var u = n[s]; "." !== u || r ? "." === u ? (p.push(q), q = ".") : q += u : (r = !0, q += u) }
                p.push(q);
                l.splice(m, 1);
                for (n = 0; n < p.length; n++) l.splice(m + n, 0, p[n]);
                m += p.length - 1
            }
        }
        for (var t = -1, y = "", w = "", n = new N(0, 0), A = new N(0, 0), B = new N(0, 0), P = l.length, p = D.v(), r = q = !1, s = !0, m = null; !(t >= P - 1);)
            if (w = y, y = d(), "" !== y) switch (y.toUpperCase()) {
                case "X":
                    s = !0;
                    r = q = !1;
                    break;
                case "M":
                    m = g();
                    null === p.fc || !0 === s ? (T(p, m.x, m.y, q, !1, !r), s = !1) : p.moveTo(m.x, m.y);
                    for (n = B; !c();) m = g(), p.lineTo(m.x, m.y);
                    break;
                case "L":
                    for (; !c();) m =
                        g(), p.lineTo(m.x, m.y);
                    break;
                case "H":
                    for (; !c();) B = m = new N((y === y.toLowerCase() ? B.x : 0) + parseFloat(d()), B.y), p.lineTo(B.x, B.y);
                    break;
                case "V":
                    for (; !c();) B = m = new N(B.x, (y === y.toLowerCase() ? B.y : 0) + parseFloat(d())), p.lineTo(B.x, B.y);
                    break;
                case "C":
                    for (; !c();) {
                        var u = e(),
                            H = h(),
                            m = g();
                        U(p, u.x, u.y, H.x, H.y, m.x, m.y)
                    }
                    break;
                case "S":
                    for (; !c();) u = k(), H = h(), m = g(), U(p, u.x, u.y, H.x, H.y, m.x, m.y);
                    break;
                case "Q":
                    for (; !c();) H = h(), m = g(), zf(p, H.x, H.y, m.x, m.y);
                    break;
                case "T":
                    for (; !c();) A = H = k(), m = g(), zf(p, H.x, H.y, m.x, m.y);
                    break;
                case "B":
                    for (; !c();) {
                        var m = parseFloat(d()),
                            u = parseFloat(d()),
                            H = parseFloat(d()),
                            R = parseFloat(d()),
                            aa = parseFloat(d()),
                            V = aa,
                            ea = !1;
                        c() || (V = parseFloat(d()), c() || (ea = 0 !== parseFloat(d())));
                        y === y.toLowerCase() && (H += B.x, R += B.y);
                        p.arcTo(m, u, H, R, aa, V, ea)
                    }
                    break;
                case "A":
                    for (; !c();) u = Math.abs(parseFloat(d())), H = Math.abs(parseFloat(d())), R = parseFloat(d()), aa = !!parseFloat(d()), V = !!parseFloat(d()), m = g(), Af(p, u, H, R, aa, V, m.x, m.y);
                    break;
                case "Z":
                    m = p.q.nc.o[p.q.nc.length - 1];
                    X(p);
                    B = n;
                    break;
                case "F":
                    u = "";
                    for (m = 1; l[t +
                            m];)
                        if (null !== l[t + m].match(/[Uu]/)) m++;
                        else if (null === l[t + m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)) m++;
                    else { u = l[t + m]; break }
                    u.match(/[Mm]/) ? q = !0 : Bf(p);
                    break;
                case "U":
                    u = "";
                    for (m = 1; l[t + m];)
                        if (null !== l[t + m].match(/[Ff]/)) m++;
                        else if (null === l[t + m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)) m++;
                    else { u = l[t + m]; break }
                    u.match(/[Mm]/) ? r = !0 : p.jb(!1)
            }
        n = p.q;
        D.u(p);
        if (b)
            for (p = n.nc.j; p.next();) m = p.value, m.Ku = !0;
        return n
    };

    function Cf(a, b) {
        for (var c = a.length, d = D.P(), e = 0; e < c; e++) {
            var g = a[e];
            d.x = g[0];
            d.y = g[1];
            b.vb(d);
            g[0] = d.x;
            g[1] = d.y;
            d.x = g[2];
            d.y = g[3];
            b.vb(d);
            g[2] = d.x;
            g[3] = d.y;
            d.x = g[4];
            d.y = g[5];
            b.vb(d);
            g[4] = d.x;
            g[5] = d.y;
            d.x = g[6];
            d.y = g[7];
            b.vb(d);
            g[6] = d.x;
            g[7] = d.y
        }
        D.A(d)
    }
    Ve.prototype.iy = function() {
        if (this.ob || this.dw !== this.nc.I) return !0;
        for (var a = this.nc.o, b = a.length, c = 0; c < b; c++)
            if (a[c].iy()) return !0;
        return !1
    };
    Ve.prototype.Yy = function() {
        this.ob = !1;
        this.kr = this.Go = null;
        this.lr = NaN;
        this.dw = this.nc.I;
        for (var a = this.nc.o, b = a.length, c = 0; c < b; c++) a[c].Yy()
    };
    Ve.prototype.Kh = function() {
        var a = this.Pv;
        a.Xa();
        isNaN(this.lp) || isNaN(this.jp) ? a.n(0, 0, 0, 0) : a.n(0, 0, this.lp, this.jp);
        Df(this, a, !1);
        Ub(a, 0, 0, 0, 0);
        a.freeze()
    };
    Ve.prototype.computeBoundsWithoutOrigin = Ve.prototype.mI = function() {
        var a = new C;
        Df(this, a, !0);
        return a
    };

    function Df(a, b, c) {
        switch (a.type) {
            case Ze:
            case tf:
            case uf:
                c ? b.n(a.Ac, a.Mc, 0, 0) : Ub(b, a.Ac, a.Mc, 0, 0);
                Ub(b, a.Cb, a.Jb, 0, 0);
                break;
            case We:
                var d = a.nc;
                a = d.o;
                for (var d = d.length, e = 0; e < d; e++) {
                    var g = a[e];
                    c && 0 === e ? b.n(g.la, g.ja, 0, 0) : Ub(b, g.la, g.ja, 0, 0);
                    for (var h = g.Eb.o, k = h.length, l = g.la, m = g.ja, n = 0; n < k; n++) {
                        var p = h[n];
                        switch (p.type) {
                            case wf:
                            case Ef:
                                l = p.F;
                                m = p.G;
                                Ub(b, l, m, 0, 0);
                                break;
                            case Ff:
                                Ae(l, m, p.Ec, p.$c, p.Uh, p.Vh, p.F, p.G, .5, b);
                                l = p.F;
                                m = p.G;
                                break;
                            case Gf:
                                Ee(l, m, p.Ec, p.$c, p.F, p.G, .5, b);
                                l = p.F;
                                m = p.G;
                                break;
                            case Hf:
                            case If:
                                var q =
                                    p.type === Hf ? Vf(p, g) : Wf(p, g, l, m),
                                    r = q.length;
                                if (0 === r) {
                                    l = p.pa;
                                    m = p.va;
                                    Ub(b, l, m, 0, 0);
                                    break
                                }
                                for (var p = null, s = 0; s < r; s++) p = q[s], Ae(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], .5, b);
                                null !== p && (l = p[6], m = p[7]);
                                break;
                            default:
                                D.k("Unknown Segment type: " + p.type)
                        }
                    }
                }
                break;
            default:
                D.k("Unknown Geometry type: " + a.type)
        }
    }
    Ve.prototype.normalize = Ve.prototype.normalize = function() {
        this.J && D.qa(this);
        var a = this.mI();
        this.offset(-a.x, -a.y);
        return new N(-a.x, -a.y)
    };
    Ve.prototype.offset = Ve.prototype.offset = function(a, b) {
        this.J && D.qa(this);
        v && (D.p(a, Ve, "offset"), D.p(b, Ve, "offset"));
        this.transform(1, 0, 0, 1, a, b);
        return this
    };
    Ve.prototype.scale = Ve.prototype.scale = function(a, b) {
        this.J && D.qa(this);
        v && (D.p(a, Ve, "scale:x"), D.p(b, Ve, "scale:y"), 0 === a && D.ua(a, "scale must be non-zero", Ve, "scale:x"), 0 === b && D.ua(b, "scale must be non-zero", Ve, "scale:y"));
        this.transform(a, 0, 0, b, 0, 0);
        return this
    };
    Ve.prototype.rotate = Ve.prototype.rotate = function(a, b, c) {
        this.J && D.qa(this);
        void 0 === b && (b = 0);
        void 0 === c && (c = 0);
        v && (D.p(a, Ve, "rotate:angle"), D.p(b, Ve, "rotate:x"), D.p(c, Ve, "rotate:y"));
        var d = D.hh();
        d.reset();
        d.rotate(a, b, c);
        this.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
        D.lf(d);
        return this
    };
    Ve.prototype.transform = Ve.prototype.transform = function(a, b, c, d, e, g) {
        var h = 0,
            k = 0;
        switch (this.type) {
            case Ze:
            case tf:
            case uf:
                h = this.Ac;
                k = this.Mc;
                this.Ac = h * a + k * c + e;
                this.Mc = h * b + k * d + g;
                h = this.Cb;
                k = this.Jb;
                this.Cb = h * a + k * c + e;
                this.Jb = h * b + k * d + g;
                break;
            case We:
                for (var l = this.nc.o, m = l.length, n = 0; n < m; n++) {
                    var p = l[n],
                        h = p.la,
                        k = p.ja;
                    p.la = h * a + k * c + e;
                    p.ja = h * b + k * d + g;
                    for (var p = p.Eb.o, q = p.length, r = 0; r < q; r++) {
                        var s = p[r];
                        switch (s.type) {
                            case wf:
                            case Ef:
                                h = s.F;
                                k = s.G;
                                s.F = h * a + k * c + e;
                                s.G = h * b + k * d + g;
                                break;
                            case Ff:
                                h = s.Ec;
                                k = s.$c;
                                s.Ec =
                                    h * a + k * c + e;
                                s.$c = h * b + k * d + g;
                                h = s.Uh;
                                k = s.Vh;
                                s.Uh = h * a + k * c + e;
                                s.Vh = h * b + k * d + g;
                                h = s.F;
                                k = s.G;
                                s.F = h * a + k * c + e;
                                s.G = h * b + k * d + g;
                                break;
                            case Gf:
                                h = s.Ec;
                                k = s.$c;
                                s.Ec = h * a + k * c + e;
                                s.$c = h * b + k * d + g;
                                h = s.F;
                                k = s.G;
                                s.F = h * a + k * c + e;
                                s.G = h * b + k * d + g;
                                break;
                            case Hf:
                                h = s.pa;
                                k = s.va;
                                s.pa = h * a + k * c + e;
                                s.va = h * b + k * d + g;
                                0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.Me += h);
                                0 > a && (s.Me = 180 - s.Me, s.Df = -s.Df);
                                0 > d && (s.Me = -s.Me, s.Df = -s.Df);
                                s.radiusX *= Math.sqrt(a * a + c * c);
                                void 0 !== s.radiusY && (s.radiusY *= Math.sqrt(b * b + d * d));
                                break;
                            case If:
                                h = s.F;
                                k = s.G;
                                s.F = h *
                                    a + k * c + e;
                                s.G = h * b + k * d + g;
                                0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.ck += h);
                                0 > a && (s.ck = 180 - s.ck, s.wm = !s.wm);
                                0 > d && (s.ck = -s.ck, s.wm = !s.wm);
                                s.radiusX *= Math.sqrt(a * a + c * c);
                                s.radiusY *= Math.sqrt(b * b + d * d);
                                break;
                            default:
                                D.k("Unknown Segment type: " + s.type)
                        }
                    }
                }
        }
        this.ob = !0;
        return this
    };
    Ve.prototype.Pa = function(a, b, c, d) {
        var e = a.x,
            g = a.y,
            h = this.pb.x - 20;
        a = a.y;
        for (var k = 0, l = 0, m = 0, n = 0, p = 0, q = 0, r = this.nc.o, s = r.length, u = 0; u < s; u++) {
            var t = r[u];
            if (t.Ku) {
                if (c && t.Pa(e, g, b)) return !0;
                for (var y = t.Eb, l = t.la, m = t.ja, w = l, A = m, B = y.o, P = 0; P <= y.length; P++) {
                    var H, R;
                    P !== y.length ? (H = B[P], R = H.type, p = H.F, q = H.G) : (R = wf, p = w, q = A);
                    switch (R) {
                        case Ef:
                            n = Xf(e, g, h, a, l, m, w, A);
                            if (isNaN(n)) return !0;
                            k += n;
                            w = p;
                            A = q;
                            break;
                        case wf:
                            n = Xf(e, g, h, a, l, m, p, q);
                            if (isNaN(n)) return !0;
                            k += n;
                            break;
                        case Ff:
                            n = He(l, m, H.Ec, H.$c, H.Uh, H.Vh, p, q, h,
                                a, e, g, .5);
                            k += n;
                            break;
                        case Gf:
                            n = He(l, m, (l + 2 * H.Ec) / 3, (m + 2 * H.$c) / 3, (2 * H.Ec + p) / 3, (2 * H.$c + q) / 3, p, q, h, a, e, g, .5);
                            k += n;
                            break;
                        case Hf:
                        case If:
                            R = H.type === Hf ? Vf(H, t) : Wf(H, t, l, m);
                            var aa = R.length;
                            if (0 === aa) {
                                n = Xf(e, g, h, a, l, m, H.pa, H.va);
                                if (isNaN(n)) return !0;
                                k += n;
                                break
                            }
                            for (var V = null, ea = 0; ea < aa; ea++) {
                                V = R[ea];
                                if (0 === ea) {
                                    n = Xf(e, g, h, a, l, m, V[0], V[1]);
                                    if (isNaN(n)) return !0;
                                    k += n
                                }
                                n = He(V[0], V[1], V[2], V[3], V[4], V[5], V[6], V[7], h, a, e, g, .5);
                                k += n
                            }
                            null !== V && (p = V[6], q = V[7]);
                            break;
                        default:
                            D.k("Unknown Segment type: " + H.type)
                    }
                    l = p;
                    m = q
                }
                if (0 !== k) return !0;
                k = 0
            } else if (t.Pa(e, g, d ? b : b + 2)) return !0
        }
        return 0 !== k
    };

    function Xf(a, b, c, d, e, g, h, k) {
        if (qe(e, g, h, k, .05, a, b)) return NaN;
        var l = (a - c) * (g - k);
        if (0 === l) return 0;
        var m = ((a * d - b * c) * (e - h) - (a - c) * (e * k - g * h)) / l;
        b = (a * d - b * c) * (g - k) / l;
        if (m >= a) return 0;
        if ((e > h ? e - h : h - e) < (g > k ? g - k : k - g)) { if (e = a = 0, g < k ? (a = g, e = k) : (a = k, e = g), b < a || b > e) return 0 } else if (e < h ? (a = e, e = h) : a = h, m < a || m > e) return 0;
        return 0 < l ? 1 : -1
    }

    function Yf(a, b, c, d) {
        a = a.nc.o;
        for (var e = a.length, g = 0; g < e; g++)
            if (a[g].Pa(b, c, d)) return !0;
        return !1
    }
    Ve.prototype.getPointAlongPath = Ve.prototype.XI = function(a, b) {
        0 > a ? a = 0 : 1 < a && (a = 1);
        void 0 === b && (b = new N);
        if (this.type === Ze) return b.n(this.la + a * (this.F - this.la), this.ja + a * (this.G - this.ja)), b;
        for (var c = this.Zx, d = this.uu, e = c.length, g = this.vu * a, h = 0, k = 0; k < e; k++)
            for (var l = d[k], m = l.length, n = 0; n < m; n++) {
                var p = l[n];
                if (h + p >= g) return d = (g - h) / p, c = c[k], k = c[2 * n], e = c[2 * n + 1], b.n(k + (c[2 * n + 2] - k) * d, e + (c[2 * n + 3] - e) * d), b;
                h += p
            }
        b.n(NaN, NaN);
        return b
    };
    Ve.prototype.getAngleAlongPath = Ve.prototype.OF = function(a) {
        0 > a ? a = 0 : 1 < a && (a = 1);
        var b = 0;
        if (this.type === Ze) return b = 180 * Math.atan2(this.G - this.ja, this.F - this.la) / Math.PI;
        for (var b = this.Zx, c = this.uu, d = b.length, e = this.vu * a, g = 0, h = 0; h < d; h++) {
            var k = c[h],
                l = k.length;
            for (a = 0; a < l; a++) {
                var m = k[a];
                if (g + m >= e) return b = b[h], b = 180 * Math.atan2(b[2 * a + 3] - b[2 * a + 1], b[2 * a + 2] - b[2 * a]) / Math.PI;
                g += m
            }
        }
        return NaN
    };
    Ve.prototype.getFractionForPoint = Ve.prototype.TI = function(a) {
        if (this.type === Ze) {
            var b = this.la,
                c = this.ja,
                d = this.F,
                e = this.G;
            if (b !== d || c !== e) {
                var g = a.x;
                a = a.y;
                var h = 0,
                    k = 0;
                return b === d ? (c < e ? (h = c, k = e) : (h = e, k = c), a <= h ? h === c ? 0 : 1 : a >= k ? k === c ? 0 : 1 : Math.abs(a - c) / (k - h)) : c === e ? (b < d ? (h = b, k = d) : (h = d, k = b), g <= h ? h === b ? 0 : 1 : g >= k ? k === b ? 0 : 1 : Math.abs(g - b) / (k - h)) : ((g - b) * (g - b) + (a - c) * (a - c)) / ((d - b) * (d - b) + (e - c) * (e - c))
            }
        } else if (this.type === tf) {
            if (b = this.la, c = this.ja, d = this.F, e = this.G, b !== d || c !== e) {
                var h = d - b,
                    k = e - c,
                    l = 2 * h + 2 * k,
                    g = a.x;
                a = a.y;
                g = Math.min(Math.max(g, b), d);
                a = Math.min(Math.max(a, c), e);
                var b = Math.abs(g - b),
                    d = Math.abs(g - d),
                    c = Math.abs(a - c),
                    e = Math.abs(a - e),
                    m = Math.min(b, d, c, e);
                if (m === c) return g / l;
                if (m === d) return (h + a) / l;
                if (m === e) return (2 * h + k - g) / l;
                if (m === b) return (2 * h + 2 * k - a) / l
            }
        } else {
            for (var e = this.Zx, h = this.uu, k = this.vu, l = D.P(), c = Infinity, b = d = 0, g = e.length, n = m = 0, p = 0; p < g; p++)
                for (var q = e[p], r = h[p], s = q.length, u = 0; u < s; u += 2) {
                    var t = q[u],
                        y = q[u + 1];
                    if (0 !== u) {
                        fb(m, n, t, y, a.x, a.y, l);
                        var w = (l.x - a.x) * (l.x - a.x) + (l.y - a.y) * (l.y - a.y);
                        w < c && (c = w,
                            d = b, d += Math.sqrt((l.x - m) * (l.x - m) + (l.y - n) * (l.y - n)));
                        b += r[(u - 2) / 2]
                    }
                    m = t;
                    n = y
                }
            D.A(l);
            a = d / k;
            return 0 > a ? 0 : 1 < a ? 1 : a
        }
        return 0
    };
    D.w(Ve, { Zx: null }, function() { Zf(this); return this.Go });

    function Zf(a) {
        if (null === a.Go) {
            a.iy() && a.Yy();
            var b = a.Go = [],
                c = a.kr = [],
                d = [],
                e = [];
            if (a.type === Ze) d.push(a.la), d.push(a.ja), d.push(a.F), d.push(a.G), b.push(d), e.push(Math.sqrt((a.la - a.F) * (a.la - a.F) + (a.ja - a.G) * (a.ja - a.G))), c.push(e);
            else if (a.type === tf) d.push(a.la), d.push(a.ja), d.push(a.F), d.push(a.ja), d.push(a.F), d.push(a.G), d.push(a.la), d.push(a.G), d.push(a.la), d.push(a.ja), b.push(d), e.push(Math.abs(a.la - a.F)), e.push(Math.abs(a.ja - a.G)), e.push(Math.abs(a.la - a.F)), e.push(Math.abs(a.ja - a.G)), c.push(e);
            else if (a.type === uf) {
                var g = new Xe;
                g.la = a.F;
                g.ja = (a.ja + a.G) / 2;
                var h = new $f(Hf);
                h.Me = 0;
                h.Df = 360;
                h.pa = (a.la + a.F) / 2;
                h.va = (a.ja + a.G) / 2;
                h.radiusX = Math.abs(a.la - a.F) / 2;
                h.radiusY = Math.abs(a.ja - a.G) / 2;
                g.add(h);
                a = Vf(h, g);
                e = a.length;
                if (0 === e) d.push(h.pa), d.push(h.va);
                else
                    for (var h = g.la, g = g.ja, k = 0; k < e; k++) {
                        var l = a[k];
                        Be(h, g, l[2], l[3], l[4], l[5], l[6], l[7], .5, d);
                        h = l[6];
                        g = l[7]
                    }
                b.push(d);
                c.push(ag(d))
            } else
                for (var m = a.nc.j; m.next();) {
                    var n = m.value,
                        d = [];
                    d.push(n.la);
                    d.push(n.ja);
                    for (var h = n.la, g = n.ja, p = h, q = g, r = n.Eb.o,
                            s = r.length, u = 0; u < s; u++) {
                        var t = r[u];
                        switch (t.da) {
                            case Ef:
                                4 <= d.length && (b.push(d), c.push(ag(d)));
                                d = [];
                                d.push(t.F);
                                d.push(t.G);
                                h = t.F;
                                g = t.G;
                                p = h;
                                q = g;
                                break;
                            case wf:
                                d.push(t.F);
                                d.push(t.G);
                                h = t.F;
                                g = t.G;
                                break;
                            case Ff:
                                Be(h, g, t.Vd, t.ff, t.Ch, t.Og, t.Cb, t.Jb, .5, d);
                                h = t.F;
                                g = t.G;
                                break;
                            case Gf:
                                Fe(h, g, t.Vd, t.ff, t.Cb, t.Jb, .5, d);
                                h = t.F;
                                g = t.G;
                                break;
                            case Hf:
                                a = Vf(t, n);
                                e = a.length;
                                if (0 === e) {
                                    d.push(t.pa);
                                    d.push(t.va);
                                    h = t.pa;
                                    g = t.va;
                                    break
                                }
                                for (k = 0; k < e; k++) l = a[k], Be(h, g, l[2], l[3], l[4], l[5], l[6], l[7], .5, d), h = l[6], g = l[7];
                                break;
                            case If:
                                a =
                                    Wf(t, n, h, g);
                                e = a.length;
                                if (0 === e) {
                                    d.push(t.pa);
                                    d.push(t.va);
                                    h = t.pa;
                                    g = t.va;
                                    break
                                }
                                for (k = 0; k < e; k++) l = a[k], Be(h, g, l[2], l[3], l[4], l[5], l[6], l[7], .5, d), h = l[6], g = l[7];
                                break;
                            default:
                                D.k("Segment not of valid type: " + t.da)
                        }
                        t.hi && (d.push(p), d.push(q))
                    }
                    4 <= d.length && (b.push(d), c.push(ag(d)))
                }
        }
    }
    D.w(Ve, { uu: null }, function() { Zf(this); return this.kr });
    D.w(Ve, { vu: null }, function() {
        var a = this.lr;
        if (isNaN(a)) {
            if (this.type === Ze) var a = Math.abs(this.F - this.la),
                b = Math.abs(this.G - this.ja),
                a = Math.sqrt(a * a + b * b);
            else if (this.type === tf) a = Math.abs(this.F - this.la), b = Math.abs(this.G - this.ja), a = 2 * a + 2 * b;
            else
                for (var b = this.uu, c = b.length, d = a = 0; d < c; d++)
                    for (var e = b[d], g = e.length, h = 0; h < g; h++) a += e[h];
            this.lr = a
        }
        return a
    });

    function ag(a) {
        for (var b = [], c = 0, d = 0, e = a.length, g = 0; g < e; g += 2) {
            var h = a[g],
                k = a[g + 1];
            0 !== g && (c = Math.sqrt(ob(c, d, h, k)), b.push(c));
            c = h;
            d = k
        }
        return b
    }
    D.defineProperty(Ve, { type: "type" }, function() { return this.da }, function(a) { this.da !== a && (v && D.Da(a, Ve, Ve, "type"), this.J && D.qa(this, a), this.da = a, this.ob = !0) });
    D.defineProperty(Ve, { la: "startX" }, function() { return this.Ac }, function(a) { this.Ac !== a && (v && D.p(a, Ve, "startX"), this.J && D.qa(this, a), this.Ac = a, this.ob = !0) });
    D.defineProperty(Ve, { ja: "startY" }, function() { return this.Mc }, function(a) { this.Mc !== a && (v && D.p(a, Ve, "startY"), this.J && D.qa(this, a), this.Mc = a, this.ob = !0) });
    D.defineProperty(Ve, { F: "endX" }, function() { return this.Cb }, function(a) { this.Cb !== a && (v && D.p(a, Ve, "endX"), this.J && D.qa(this, a), this.Cb = a, this.ob = !0) });
    D.defineProperty(Ve, { G: "endY" }, function() { return this.Jb }, function(a) { this.Jb !== a && (v && D.p(a, Ve, "endY"), this.J && D.qa(this, a), this.Jb = a, this.ob = !0) });
    D.defineProperty(Ve, { nc: "figures" }, function() { return this.jk }, function(a) { this.jk !== a && (v && D.l(a, K, Ve, "figures"), this.J && D.qa(this, a), this.jk = a, this.ob = !0) });
    Ve.prototype.add = Ve.prototype.add = function(a) { this.jk.add(a); return this };
    Ve.prototype.setSpots = function(a, b, c, d, e, g, h, k) {
        this.J && D.qa(this);
        this.xi = (new S(a, b, e, g)).freeze();
        this.yi = (new S(c, d, h, k)).freeze();
        return this
    };
    D.defineProperty(Ve, { C: "spot1" }, function() { return this.xi }, function(a) {
        v && D.l(a, S, Ve, "spot1");
        this.J && D.qa(this, a);
        this.xi = a.V()
    });
    D.defineProperty(Ve, { D: "spot2" }, function() { return this.yi }, function(a) {
        v && D.l(a, S, Ve, "spot2");
        this.J && D.qa(this, a);
        this.yi = a.V()
    });
    D.defineProperty(Ve, { le: "defaultStretch" }, function() { return this.Xi }, function(a) {
        v && D.Da(a, O, Ve, "stretch");
        this.J && D.qa(this, a);
        this.Xi = a
    });
    D.w(Ve, { pb: "bounds" }, function() { this.iy() && (this.Yy(), this.Kh()); return this.Pv });

    function Xe(a, b, c, d) {
        D.xc(this);
        this.J = !1;
        void 0 === c && (c = !0);
        this.Xm = c;
        void 0 === d && (d = !0);
        this.mp = d;
        void 0 !== a ? (v && D.p(a, Xe, "sx"), this.Ac = a) : this.Ac = 0;
        void 0 !== b ? (v && D.p(b, Xe, "sy"), this.Mc = b) : this.Mc = 0;
        this.Ip = new K($f);
        this.hx = this.Ip.I;
        this.ob = !0
    }
    D.ka("PathFigure", Xe);
    D.Di(Xe);
    Xe.prototype.copy = function() {
        var a = new Xe;
        a.Xm = this.Xm;
        a.mp = this.mp;
        a.Ac = this.Ac;
        a.Mc = this.Mc;
        for (var b = this.Ip.o, c = b.length, d = a.Ip, e = 0; e < c; e++) {
            var g = b[e].copy();
            d.add(g)
        }
        a.hx = this.hx;
        a.ob = this.ob;
        return a
    };
    Xe.prototype.equalsApprox = Xe.prototype.Wc = function(a) {
        if (!(a instanceof Xe && Q(this.la, a.la) && Q(this.ja, a.ja))) return !1;
        var b = this.Eb.o;
        a = a.Eb.o;
        var c = b.length;
        if (c !== a.length) return !1;
        for (var d = 0; d < c; d++)
            if (!b[d].Wc(a[d])) return !1;
        return !0
    };
    f = Xe.prototype;
    f.toString = function(a) { void 0 === a && (a = -1); for (var b = 0 > a ? "M" + this.la.toString() + " " + this.ja.toString() : "M" + this.la.toFixed(a) + " " + this.ja.toFixed(a), c = this.Eb.o, d = c.length, e = 0; e < d; e++) b += " " + c[e].toString(a); return b };
    f.freeze = function() {
        this.J = !0;
        var a = this.Eb;
        a.freeze();
        for (var b = a.o, a = a.length, c = 0; c < a; c++) b[c].freeze();
        return this
    };
    f.Xa = function() {
        this.J = !1;
        var a = this.Eb;
        a.Xa();
        for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].Xa();
        return this
    };
    f.iy = function() {
        if (this.ob) return !0;
        var a = this.Eb;
        if (this.hx !== a.I) return !0;
        for (var a = a.o, b = a.length, c = 0; c < b; c++)
            if (a[c].ob) return !0;
        return !1
    };
    f.Yy = function() {
        this.ob = !1;
        var a = this.Eb;
        this.hx = a.I;
        for (var a = a.o, b = a.length, c = 0; c < b; c++) {
            var d = a[c];
            d.ob = !1;
            d.$h = null
        }
    };
    D.defineProperty(Xe, { Ku: "isFilled" }, function() { return this.Xm }, function(a) {
        v && D.h(a, "boolean", Xe, "isFilled");
        this.J && D.qa(this, a);
        this.Xm = a
    });
    D.defineProperty(Xe, { dl: "isShadowed" }, function() { return this.mp }, function(a) {
        v && D.h(a, "boolean", Xe, "isShadowed");
        this.J && D.qa(this, a);
        this.mp = a
    });
    D.defineProperty(Xe, { la: "startX" }, function() { return this.Ac }, function(a) {
        v && D.p(a, Xe, "startX");
        this.J && D.qa(this, a);
        this.Ac = a;
        this.ob = !0
    });
    D.defineProperty(Xe, { ja: "startY" }, function() { return this.Mc }, function(a) {
        v && D.p(a, Xe, "startY");
        this.J && D.qa(this, a);
        this.Mc = a;
        this.ob = !0
    });
    D.defineProperty(Xe, { Eb: "segments" }, function() { return this.Ip }, function(a) {
        v && D.l(a, K, Xe, "segments");
        this.J && D.qa(this, a);
        this.Ip = a;
        this.ob = !0
    });
    Xe.prototype.add = Xe.prototype.add = function(a) { this.Ip.add(a); return this };
    Xe.prototype.Pa = function(a, b, c) {
        for (var d = this.la, e = this.ja, g = d, h = e, k = this.Eb.o, l = k.length, m = 0; m < l; m++) {
            var n = k[m];
            switch (n.type) {
                case Ef:
                    g = n.F;
                    h = n.G;
                    d = n.F;
                    e = n.G;
                    break;
                case wf:
                    if (qe(d, e, n.F, n.G, c, a, b)) return !0;
                    d = n.F;
                    e = n.G;
                    break;
                case Ff:
                    if (re(d, e, n.Ec, n.$c, n.Uh, n.Vh, n.F, n.G, .5, a, b, c)) return !0;
                    d = n.F;
                    e = n.G;
                    break;
                case Gf:
                    if (De(d, e, n.Ec, n.$c, n.F, n.G, .5, a, b, c)) return !0;
                    d = n.F;
                    e = n.G;
                    break;
                case Hf:
                case If:
                    var p = n.type === Hf ? Vf(n, this) : Wf(n, this, d, e),
                        q = p.length;
                    if (0 === q) {
                        if (qe(d, e, n.pa, n.va, c, a, b)) return !0;
                        d = n.pa;
                        e = n.va;
                        break
                    }
                    for (var r = null, s = 0; s < q; s++)
                        if (r = p[s], 0 === s && qe(d, e, r[0], r[1], c, a, b) || re(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], .5, a, b, c)) return !0;
                    null !== r && (d = r[6], e = r[7]);
                    break;
                default:
                    D.k("Unknown Segment type: " + n.type)
            }
            if (n.ey && (d !== g || e !== h) && qe(d, e, g, h, c, a, b)) return !0
        }
        return !1
    };

    function $f(a, b, c, d, e, g, h, k) {
        D.xc(this);
        this.J = !1;
        void 0 === a ? a = wf : v && D.Da(a, $f, $f, "constructor:type");
        this.da = a;
        void 0 !== b ? (v && D.p(b, $f, "ex"), this.Cb = b) : this.Cb = 0;
        void 0 !== c ? (v && D.p(c, $f, "ey"), this.Jb = c) : this.Jb = 0;
        void 0 === d && (d = 0);
        void 0 === e && (e = 0);
        void 0 === g && (g = 0);
        void 0 === h && (h = 0);
        a === If ? (a = g % 360, 0 > a && (a += 360), this.Vd = a, this.ff = 0, v && D.p(d, $f, "x1"), this.Ch = Math.max(d, 0), v && D.p(e, $f, "y1"), this.Og = Math.max(e, 0), this.qp = "boolean" === typeof h ? !!h : !1, this.Ko = !!k) : (v && D.p(d, $f, "x1"), this.Vd = d, v && D.p(e,
            $f, "y1"), this.ff = e, v && D.p(g, $f, "x2"), a === Hf && (g = Math.max(g, 0)), this.Ch = g, "number" === typeof h ? (a === Hf && (h = Math.max(h, 0)), this.Og = h) : this.Og = 0, this.Ko = this.qp = !1);
        this.hi = !1;
        this.ob = !0;
        this.$h = null
    }
    D.ka("PathSegment", $f);
    D.Di($f);
    $f.prototype.copy = function() {
        var a = new $f;
        a.da = this.da;
        a.Cb = this.Cb;
        a.Jb = this.Jb;
        a.Vd = this.Vd;
        a.ff = this.ff;
        a.Ch = this.Ch;
        a.Og = this.Og;
        a.qp = this.qp;
        a.Ko = this.Ko;
        a.hi = this.hi;
        a.ob = this.ob;
        return a
    };
    $f.prototype.equalsApprox = $f.prototype.Wc = function(a) {
        if (!(a instanceof $f) || this.type !== a.type || this.ey !== a.ey) return !1;
        switch (this.type) {
            case Ef:
            case wf:
                return Q(this.F, a.F) && Q(this.G, a.G);
            case Ff:
                return Q(this.F, a.F) && Q(this.G, a.G) && Q(this.Ec, a.Ec) && Q(this.$c, a.$c) && Q(this.Uh, a.Uh) && Q(this.Vh, a.Vh);
            case Gf:
                return Q(this.F, a.F) && Q(this.G, a.G) && Q(this.Ec, a.Ec) && Q(this.$c, a.$c);
            case Hf:
                return Q(this.Me, a.Me) && Q(this.Df, a.Df) && Q(this.pa, a.pa) && Q(this.va, a.va) && Q(this.radiusX, a.radiusX) && Q(this.radiusY,
                    a.radiusY);
            case If:
                return this.wm === a.wm && this.jy === a.jy && Q(this.ck, a.ck) && Q(this.F, a.F) && Q(this.G, a.G) && Q(this.radiusX, a.radiusX) && Q(this.radiusY, a.radiusY);
            default:
                return !1
        }
    };
    $f.prototype.qc = function(a) { a.Qe === $f ? this.type = a : D.ak(this, a) };
    $f.prototype.toString = function(a) {
        void 0 === a && (a = -1);
        var b = "";
        switch (this.type) {
            case Ef:
                b = 0 > a ? "M" + this.F.toString() + " " + this.G.toString() : "M" + this.F.toFixed(a) + " " + this.G.toFixed(a);
                break;
            case wf:
                b = 0 > a ? "L" + this.F.toString() + " " + this.G.toString() : "L" + this.F.toFixed(a) + " " + this.G.toFixed(a);
                break;
            case Ff:
                b = 0 > a ? "C" + this.Ec.toString() + " " + this.$c.toString() + " " + this.Uh.toString() + " " + this.Vh.toString() + " " + this.F.toString() + " " + this.G.toString() : "C" + this.Ec.toFixed(a) + " " + this.$c.toFixed(a) + " " + this.Uh.toFixed(a) +
                    " " + this.Vh.toFixed(a) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a);
                break;
            case Gf:
                b = 0 > a ? "Q" + this.Ec.toString() + " " + this.$c.toString() + " " + this.F.toString() + " " + this.G.toString() : "Q" + this.Ec.toFixed(a) + " " + this.$c.toFixed(a) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a);
                break;
            case Hf:
                b = 0 > a ? "B" + this.Me.toString() + " " + this.Df.toString() + " " + this.pa.toString() + " " + this.va.toString() + " " + this.radiusX : "B" + this.Me.toFixed(a) + " " + this.Df.toFixed(a) + " " + this.pa.toFixed(a) + " " + this.va.toFixed(a) + " " + this.radiusX;
                break;
            case If:
                b = 0 > a ? "A" + this.radiusX.toString() + " " + this.radiusY.toString() + " " + this.ck.toString() + " " + (this.jy ? 1 : 0) + " " + (this.wm ? 1 : 0) + " " + this.F.toString() + " " + this.G.toString() : "A" + this.radiusX.toFixed(a) + " " + this.radiusY.toFixed(a) + " " + this.ck.toFixed(a) + " " + (this.jy ? 1 : 0) + " " + (this.wm ? 1 : 0) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a);
                break;
            default:
                b = this.type.toString()
        }
        return b + (this.hi ? "z" : "")
    };
    var Ef;
    $f.Move = Ef = D.s($f, "Move", 0);
    var wf;
    $f.Line = wf = D.s($f, "Line", 1);
    var Ff;
    $f.Bezier = Ff = D.s($f, "Bezier", 2);
    var Gf;
    $f.QuadraticBezier = Gf = D.s($f, "QuadraticBezier", 3);
    var Hf;
    $f.Arc = Hf = D.s($f, "Arc", 4);
    var If;
    $f.SvgArc = If = D.s($f, "SvgArc", 4);
    $f.prototype.freeze = function() { this.J = !0; return this };
    $f.prototype.Xa = function() { this.J = !1; return this };
    $f.prototype.close = $f.prototype.close = function() { this.hi = !0; return this };

    function Vf(a, b) {
        if (null !== a.$h && !1 === b.ob) return a.$h;
        var c = a.radiusX,
            d = a.radiusY;
        void 0 === d && (d = c);
        if (0 === c || 0 === d) return a.$h = [], a.$h;
        var e = a.Vd,
            g = a.ff,
            h = Se(c < d ? c : d, a.Me, a.Me + a.Df, !1);
        if (c !== d) {
            var k = D.hh();
            k.reset();
            c < d ? k.scale(1, d / c) : k.scale(c / d, 1);
            Cf(h, k);
            D.lf(k)
        }
        c = h.length;
        for (d = 0; d < c; d++) k = h[d], k[0] += e, k[1] += g, k[2] += e, k[3] += g, k[4] += e, k[5] += g, k[6] += e, k[7] += g;
        a.$h = h;
        return a.$h
    }

    function Wf(a, b, c, d) {
        function e(a, b, c, d) { return (a * d < b * c ? -1 : 1) * Math.acos((a * c + b * d) / (Math.sqrt(a * a + b * b) * Math.sqrt(c * c + d * d))) }
        if (null !== a.$h && !1 === b.ob) return a.$h;
        b = a.Ch;
        var g = a.Og;
        0 === b && (b = 1E-4);
        0 === g && (g = 1E-4);
        var h = Math.PI / 180 * a.Vd,
            k = a.qp,
            l = a.Ko,
            m = a.Cb,
            n = a.Jb,
            p = Math.cos(h),
            q = Math.sin(h),
            r = p * (c - m) / 2 + q * (d - n) / 2,
            h = -q * (c - m) / 2 + p * (d - n) / 2,
            s = r * r / (b * b) + h * h / (g * g);
        1 < s && (b *= Math.sqrt(s), g *= Math.sqrt(s));
        s = (k === l ? -1 : 1) * Math.sqrt((b * b * g * g - b * b * h * h - g * g * r * r) / (b * b * h * h + g * g * r * r));
        isNaN(s) && (s = 0);
        k = s * b * h / g;
        s = s * -g * r /
            b;
        isNaN(k) && (k = 0);
        isNaN(s) && (s = 0);
        c = (c + m) / 2 + p * k - q * s;
        d = (d + n) / 2 + q * k + p * s;
        n = e(1, 0, (r - k) / b, (h - s) / g);
        p = (r - k) / b;
        m = (h - s) / g;
        r = (-r - k) / b;
        k = (-h - s) / g;
        h = e(p, m, r, k);
        r = (p * r + m * k) / (Math.sqrt(p * p + m * m) * Math.sqrt(r * r + k * k)); - 1 >= r ? h = Math.PI : 1 <= r && (h = 0);
        !l && 0 < h && (h -= 2 * Math.PI);
        l && 0 > h && (h += 2 * Math.PI);
        l = b > g ? 1 : b / g;
        r = b > g ? g / b : 1;
        b = Se(b > g ? b : g, n, n + h, !0);
        g = D.hh();
        g.reset();
        g.translate(c, d);
        g.rotate(a.Vd, 0, 0);
        g.scale(l, r);
        Cf(b, g);
        D.lf(g);
        a.$h = b;
        return a.$h
    }
    D.defineProperty($f, { ey: "isClosed" }, function() { return this.hi }, function(a) { this.hi !== a && (this.hi = a, this.ob = !0) });
    D.defineProperty($f, { type: "type" }, function() { return this.da }, function(a) {
        v && D.Da(a, $f, $f, "type");
        this.J && D.qa(this, a);
        this.da = a;
        this.ob = !0
    });
    D.defineProperty($f, { F: "endX" }, function() { return this.Cb }, function(a) {
        v && D.p(a, $f, "endX");
        this.J && D.qa(this, a);
        this.Cb = a;
        this.ob = !0
    });
    D.defineProperty($f, { G: "endY" }, function() { return this.Jb }, function(a) {
        v && D.p(a, $f, "endY");
        this.J && D.qa(this, a);
        this.Jb = a;
        this.ob = !0
    });
    D.defineProperty($f, { Ec: "point1X" }, function() { return this.Vd }, function(a) {
        v && D.p(a, $f, "point1X");
        this.J && D.qa(this, a);
        this.Vd = a;
        this.ob = !0
    });
    D.defineProperty($f, { $c: "point1Y" }, function() { return this.ff }, function(a) {
        v && D.p(a, $f, "point1Y");
        this.J && D.qa(this, a);
        this.ff = a;
        this.ob = !0
    });
    D.defineProperty($f, { Uh: "point2X" }, function() { return this.Ch }, function(a) {
        v && D.p(a, $f, "point2X");
        this.J && D.qa(this, a);
        this.Ch = a;
        this.ob = !0
    });
    D.defineProperty($f, { Vh: "point2Y" }, function() { return this.Og }, function(a) {
        v && D.p(a, $f, "point2Y");
        this.J && D.qa(this, a);
        this.Og = a;
        this.ob = !0
    });
    D.defineProperty($f, { pa: "centerX" }, function() { return this.Vd }, function(a) {
        v && D.p(a, $f, "centerX");
        this.J && D.qa(this, a);
        this.Vd = a;
        this.ob = !0
    });
    D.defineProperty($f, { va: "centerY" }, function() { return this.ff }, function(a) {
        v && D.p(a, $f, "centerY");
        this.J && D.qa(this, a);
        this.ff = a;
        this.ob = !0
    });
    D.defineProperty($f, { radiusX: "radiusX" }, function() { return this.Ch }, function(a) {
        v && D.p(a, $f, "radiusX");
        0 > a && D.ua(a, ">= zero", $f, "radiusX");
        this.J && D.qa(this, a);
        this.Ch = a;
        this.ob = !0
    });
    D.defineProperty($f, { radiusY: "radiusY" }, function() { return this.Og }, function(a) {
        v && D.p(a, $f, "radiusY");
        0 > a && D.ua(a, ">= zero", $f, "radiusY");
        this.J && D.qa(this, a);
        this.Og = a;
        this.ob = !0
    });
    D.defineProperty($f, { Me: "startAngle" }, function() { return this.Cb }, function(a) { this.Cb !== a && (this.J && D.qa(this, a), v && D.p(a, $f, "startAngle"), a %= 360, 0 > a && (a += 360), this.Cb = a, this.ob = !0) });
    D.defineProperty($f, { Df: "sweepAngle" }, function() { return this.Jb }, function(a) {
        v && D.p(a, $f, "sweepAngle");
        this.J && D.qa(this, a);
        360 < a && (a = 360); - 360 > a && (a = -360);
        this.Jb = a;
        this.ob = !0
    });
    D.defineProperty($f, { wm: "isClockwiseArc" }, function() { return this.Ko }, function(a) {
        this.J && D.qa(this, a);
        this.Ko = a;
        this.ob = !0
    });
    D.defineProperty($f, { jy: "isLargeArc" }, function() { return this.qp }, function(a) {
        this.J && D.qa(this, a);
        this.qp = a;
        this.ob = !0
    });
    D.defineProperty($f, { ck: "xAxisRotation" }, function() { return this.Vd }, function(a) {
        v && D.p(a, $f, "xAxisRotation");
        a %= 360;
        0 > a && (a += 360);
        this.J && D.qa(this, a);
        this.Vd = a;
        this.ob = !0
    });

    function bg() {
        this.ca = null;
        this.AA = (new N(0, 0)).freeze();
        this.Gz = (new N(0, 0)).freeze();
        this.Mv = this.Iw = 0;
        this.Nv = 1;
        this.vw = "";
        this.sx = this.$v = !1;
        this.Yv = this.Ov = 0;
        this.ek = this.hw = this.rw = !1;
        this.$r = null;
        this.px = 0;
        this.Sg = this.ox = null
    }
    D.ka("InputEvent", bg);
    bg.prototype.copy = function() {
        var a = new bg;
        a.ca = this.ca;
        a.AA.assign(this.te);
        a.Gz.assign(this.ha);
        a.Iw = this.Iw;
        a.Mv = this.Mv;
        a.Nv = this.Nv;
        a.vw = this.vw;
        a.$v = this.$v;
        a.sx = this.sx;
        a.Ov = this.Ov;
        a.Yv = this.Yv;
        a.rw = this.rw;
        a.hw = this.hw;
        a.ek = this.ek;
        a.$r = this.$r;
        a.px = this.px;
        a.ox = this.ox;
        a.Sg = this.Sg;
        return a
    };
    bg.prototype.toString = function() {
        var a = "^";
        0 !== this.xd && (a += "M:" + this.xd);
        0 !== this.button && (a += "B:" + this.button);
        "" !== this.key && (a += "K:" + this.key);
        0 !== this.Ee && (a += "C:" + this.Ee);
        0 !== this.Uk && (a += "D:" + this.Uk);
        this.Cc && (a += "h");
        this.bubbles && (a += "b");
        null !== this.ha && (a += "@" + this.ha.toString());
        return a
    };
    D.defineProperty(bg, { g: "diagram" }, function() { return this.ca }, function(a) { this.ca = a });
    D.defineProperty(bg, { te: "viewPoint" }, function() { return this.AA }, function(a) {
        D.l(a, N, bg, "viewPoint");
        this.AA.assign(a)
    });
    D.defineProperty(bg, { ha: "documentPoint" }, function() { return this.Gz }, function(a) {
        D.l(a, N, bg, "documentPoint");
        this.Gz.assign(a)
    });
    bg.prototype.getMultiTouchViewPoint = bg.prototype.$x = function(a, b) {
        var c = this.g;
        if (null === c) return b;
        cg(c, this.event, a, b);
        return b
    };
    bg.prototype.getMultiTouchDocumentPoint = function(a, b) {
        var c = this.g;
        if (null === c) return b;
        cg(c, this.event, a, b);
        b.assign(c.qC(b));
        return b
    };
    D.defineProperty(bg, { xd: "modifiers" }, function() { return this.Iw }, function(a) { this.Iw = a });
    D.defineProperty(bg, { button: "button" }, function() { return this.Mv }, function(a) {
        this.Mv = a;
        if (null === this.event) switch (a) {
            case 0:
                this.buttons = 1;
                break;
            case 1:
                this.buttons = 4;
                break;
            case 2:
                this.buttons = 2
        }
    });
    D.defineProperty(bg, { buttons: "buttons" }, function() { return this.Nv }, function(a) { this.Nv = a });
    D.defineProperty(bg, { key: "key" }, function() { return this.vw }, function(a) { this.vw = a });
    D.defineProperty(bg, { Vk: "down" }, function() { return this.$v }, function(a) { this.$v = a });
    D.defineProperty(bg, { up: "up" }, function() { return this.sx }, function(a) { this.sx = a });
    D.defineProperty(bg, { Ee: "clickCount" }, function() { return this.Ov }, function(a) { this.Ov = a });
    D.defineProperty(bg, { Uk: "delta" }, function() { return this.Yv }, function(a) { this.Yv = a });
    D.defineProperty(bg, { Ou: "isMultiTouch" }, function() { return this.rw }, function(a) { this.rw = a });
    D.defineProperty(bg, { Cc: "handled" }, function() { return this.hw }, function(a) { this.hw = a });
    D.defineProperty(bg, { bubbles: "bubbles" }, function() { return this.ek }, function(a) { this.ek = a });
    D.defineProperty(bg, { event: "event" }, function() { return this.$r }, function(a) { this.$r = a });
    D.w(bg, { Qj: "isTouchEvent" }, function() {
        var a = window.TouchEvent,
            b = this.event;
        return a && b instanceof a ? !0 : (a = window.PointerEvent) && b instanceof a && ("touch" === b.pointerType || "pen" === b.pointerType)
    });
    D.w(bg, { Qh: "isMac" }, function() { return D.Qh });
    D.defineProperty(bg, { timestamp: "timestamp" }, function() { return this.px }, function(a) { this.px = a });
    D.defineProperty(bg, { Qf: "targetDiagram" }, function() { return this.ox }, function(a) { this.ox = a });
    D.defineProperty(bg, { Ne: "targetObject" }, function() { return this.Sg }, function(a) { this.Sg = a });
    D.defineProperty(bg, { control: "control" }, function() { return 0 !== (this.xd & 1) }, function(a) { this.xd = a ? this.xd | 1 : this.xd & -2 });
    D.defineProperty(bg, { shift: "shift" }, function() { return 0 !== (this.xd & 4) }, function(a) { this.xd = a ? this.xd | 4 : this.xd & -5 });
    D.defineProperty(bg, { alt: "alt" }, function() { return 0 !== (this.xd & 2) }, function(a) { this.xd = a ? this.xd | 2 : this.xd & -3 });
    D.defineProperty(bg, { Xu: "meta" }, function() { return 0 !== (this.xd & 8) }, function(a) { this.xd = a ? this.xd | 8 : this.xd & -9 });
    D.defineProperty(bg, { left: "left" }, 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 }, function(a) { this.buttons = a ? this.buttons | 1 : this.buttons & -2 });
    D.defineProperty(bg, { right: "right" }, 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 }, function(a) { this.buttons = a ? this.buttons | 2 : this.buttons & -3 });
    D.defineProperty(bg, { iM: "middle" }, 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 }, function(a) { this.buttons = a ? this.buttons | 4 : this.buttons & -5 });

    function dg() {
        this.ca = null;
        this.$b = "";
        this.Sw = this.mx = null;
        this.sr = !1
    }
    D.ka("DiagramEvent", dg);
    dg.prototype.copy = function() {
        var a = new dg;
        a.ca = this.ca;
        a.$b = this.$b;
        a.mx = this.mx;
        a.Sw = this.Sw;
        a.sr = this.sr;
        return a
    };
    dg.prototype.toString = function() {
        var a = "*" + this.name;
        null !== this.hC && (a += ":" + this.hC.toString());
        null !== this.LB && (a += "(" + this.LB.toString() + ")");
        return a
    };
    D.defineProperty(dg, { g: "diagram" }, function() { return this.ca }, function(a) { this.ca = a });
    D.defineProperty(dg, { name: "name" }, function() { return this.$b }, function(a) { this.$b = a });
    D.defineProperty(dg, { hC: "subject" }, function() { return this.mx }, function(a) { this.mx = a });
    D.defineProperty(dg, { LB: "parameter" }, function() { return this.Sw }, function(a) { this.Sw = a });
    D.defineProperty(dg, { cancel: "cancel" }, function() { return this.sr }, function(a) {
        this.sr !== a && D.On("DiagramEvent.cancel", "2.0");
        this.sr = a
    });

    function eg() {
        this.tr = fg;
        this.nn = this.Hw = "";
        this.Xs = this.Ys = this.ct = this.dt = this.at = this.ca = this.ye = null
    }
    D.ka("ChangedEvent", eg);
    var gg;
    eg.Transaction = gg = D.s(eg, "Transaction", -1);
    var fg;
    eg.Property = fg = D.s(eg, "Property", 0);
    var hg;
    eg.Insert = hg = D.s(eg, "Insert", 1);
    var ig;
    eg.Remove = ig = D.s(eg, "Remove", 2);
    eg.prototype.clear = eg.prototype.clear = function() { this.Xs = this.Ys = this.ct = this.dt = this.at = this.ca = this.ye = null };
    eg.prototype.copy = function() {
        var a = new eg;
        a.tr = this.tr;
        a.Hw = this.Hw;
        a.nn = this.nn;
        a.ye = this.ye;
        a.ca = this.ca;
        a.at = this.at;
        var b = this.dt;
        a.dt = D.Qa(b) && "function" === typeof b.V ? b.V() : b;
        b = this.ct;
        a.ct = D.Qa(b) && "function" === typeof b.V ? b.V() : b;
        b = this.Ys;
        a.Ys = D.Qa(b) && "function" === typeof b.V ? b.V() : b;
        b = this.Xs;
        a.Xs = D.Qa(b) && "function" === typeof b.V ? b.V() : b;
        return a
    };
    eg.prototype.qc = function(a) { a.Qe === eg ? this.Oc = a : D.ak(this, a) };
    eg.prototype.toString = function() {
        var a = "",
            a = this.Oc === gg ? a + "* " : this.Oc === fg ? a + (null !== this.ea ? "!m" : "!d") : a + ((null !== this.ea ? "!m" : "!d") + this.Oc);
        this.propertyName && "string" === typeof this.propertyName && (a += " " + this.propertyName);
        this.Cf && this.Cf !== this.propertyName && (a += " " + this.Cf);
        a += ": ";
        this.Oc === gg ? null !== this.oldValue && (a += " " + this.oldValue) : (null !== this.object && (a += ia(this.object)), null !== this.oldValue && (a += "  old: " + ia(this.oldValue)), null !== this.Wj && (a += " " + this.Wj), null !== this.newValue &&
            (a += "  new: " + ia(this.newValue)), null !== this.Uj && (a += " " + this.Uj));
        return a
    };
    eg.prototype.getValue = eg.prototype.oa = function(a) { return a ? this.oldValue : this.newValue };
    eg.prototype.getParam = function(a) { return a ? this.Wj : this.Uj };
    eg.prototype.canUndo = eg.prototype.canUndo = function() { return null !== this.ea || null !== this.g ? !0 : !1 };
    eg.prototype.undo = eg.prototype.undo = function() { this.canUndo() && (null !== this.ea ? this.ea.Fn(this, !0) : null !== this.g && this.g.Fn(this, !0)) };
    eg.prototype.canRedo = eg.prototype.canRedo = function() { return null !== this.ea || null !== this.g ? !0 : !1 };
    eg.prototype.redo = eg.prototype.redo = function() { this.canRedo() && (null !== this.ea ? this.ea.Fn(this, !1) : null !== this.g && this.g.Fn(this, !1)) };
    D.defineProperty(eg, { ea: "model" }, function() { return this.ye }, function(a) { this.ye = a });
    D.defineProperty(eg, { g: "diagram" }, function() { return this.ca }, function(a) { this.ca = a });
    D.defineProperty(eg, { Oc: "change" }, function() { return this.tr }, function(a) {
        v && D.Da(a, eg, eg, "change");
        this.tr = a
    });
    D.defineProperty(eg, { Cf: "modelChange" }, function() { return this.Hw }, function(a) {
        v && D.h(a, "string", eg, "modelChange");
        this.Hw = a
    });
    D.defineProperty(eg, { propertyName: "propertyName" }, function() { return this.nn }, function(a) {
        v && "string" !== typeof a && D.h(a, "function", eg, "propertyName");
        this.nn = a
    });
    D.w(eg, { nG: "isTransactionFinished" }, function() { return this.tr === gg && ("CommittedTransaction" === this.nn || "FinishedUndo" === this.nn || "FinishedRedo" === this.nn) });
    D.defineProperty(eg, { object: "object" }, function() { return this.at }, function(a) { this.at = a });
    D.defineProperty(eg, { oldValue: "oldValue" }, function() { return this.dt }, function(a) { this.dt = a });
    D.defineProperty(eg, { Wj: "oldParam" }, function() { return this.ct }, function(a) { this.ct = a });
    D.defineProperty(eg, { newValue: "newValue" }, function() { return this.Ys }, function(a) { this.Ys = a });
    D.defineProperty(eg, { Uj: "newParam" }, function() { return this.Xs }, function(a) { this.Xs = a });

    function M(a) {
        1 < arguments.length && D.k("Model constructor can only take one optional argument, the Array of node data.");
        D.xc(this);
        this.Ir = this.$b = "";
        this.dj = !1;
        this.dA = {};
        this.ze = [];
        this.Kc = new oa(null, Object);
        this.Ck = "key";
        this.Po = this.vp = null;
        this.zr = this.Ar = !1;
        this.jr = null;
        this.hn = "category";
        this.zg = new oa(null, L);
        this.yk = null;
        this.vj = !1;
        this.zA = null;
        this.na = new tg;
        void 0 !== a && (this.qg = a)
    }
    D.ka("Model", M);
    M.prototype.cloneProtected = function(a) {
        a.$b = this.$b;
        a.Ir = this.Ir;
        a.dj = this.dj;
        a.Ck = this.Ck;
        a.vp = this.vp;
        a.Po = this.Po;
        a.Ar = this.Ar;
        a.zr = this.zr;
        a.jr = this.jr;
        a.hn = this.hn
    };
    M.prototype.copy = function() {
        var a = new this.constructor;
        this.cloneProtected(a);
        return a
    };
    M.prototype.clear = M.prototype.clear = function() {
        this.ze = [];
        this.Kc.clear();
        this.zg.clear();
        this.na.clear()
    };
    f = M.prototype;
    f.toString = function(a) {
        void 0 === a && (a = 0);
        if (1 < a) return this.kC();
        var b = ("" !== this.name ? this.name : "") + " Model";
        if (0 < a) {
            b += "\n node data:";
            a = this.qg;
            for (var c = D.cb(a), d = 0; d < c; d++) var e = D.La(a, d),
                b = b + (" " + this.zb(e) + ":" + ia(e))
        }
        return b
    };
    f.Ao = function() {
        var a = "";
        "" !== this.name && (a += ',\n  "name": ' + this.quote(this.name));
        "" !== this.nm && (a += ',\n  "dataFormat": ' + this.quote(this.nm));
        this.qb && (a += ',\n  "isReadOnly": ' + this.qb);
        "key" !== this.Vj && "string" === typeof this.Vj && (a += ',\n  "nodeKeyProperty": ' + this.quote(this.Vj));
        this.PA && (a += ',\n  "copiesArrays": true');
        this.OA && (a += ',\n  "copiesArrayObjects": true');
        "category" !== this.oo && "string" === typeof this.oo && (a += ',\n  "nodeCategoryProperty": ' + this.quote(this.oo));
        return a
    };
    f.fv = function(a) {
        a.name && (this.name = a.name);
        a.dataFormat && (this.nm = a.dataFormat);
        a.isReadOnly && (this.qb = a.isReadOnly);
        a.nodeKeyProperty && (this.Vj = a.nodeKeyProperty);
        a.copiesArrays && (this.PA = a.copiesArrays);
        a.copiesArrayObjects && (this.OA = a.copiesArrayObjects);
        a.nodeCategoryProperty && (this.oo = a.nodeCategoryProperty)
    };

    function ug(a) { return ',\n  "modelData": ' + vg(a, a.fl) }

    function wg(a, b) {
        var c = b.modelData;
        D.Qa(c) && (a.iv(c), a.fl = c)
    }
    f.xC = function() {
        var a = this.fl,
            b = !1,
            c;
        for (c in a)
            if (!xg(c, a[c])) { b = !0; break }
        a = "";
        b && (a = ug(this));
        return a + ',\n  "nodeDataArray": ' + yg(this, this.qg, !0)
    };
    f.OB = function(a) {
        wg(this, a);
        a = a.nodeDataArray;
        D.isArray(a) && (this.iv(a), this.qg = a)
    };

    function zg(a, b, c, d) {
        if (b === c) return !0;
        if (typeof b !== typeof c || "function" === typeof b || "function" === typeof c) return !1;
        if (Array.isArray(b) && Array.isArray(c)) {
            if (d.oa(b) === c) return !0;
            d.add(b, c);
            if (b.length !== c.length) return !1;
            for (var e = 0; e < b.length; e++)
                if (!zg(a, b[e], c[e], d)) return !1;
            return !0
        }
        if (D.Qa(b) && D.Qa(c)) {
            if (d.oa(b) === c) return !0;
            d.add(b, c);
            for (e in b) { var g = b[e]; if (!xg(e, g)) { var h = c[e]; if (void 0 === h || !zg(a, g, h, d)) return !1 } }
            for (var k in c)
                if (h = c[k], !xg(k, h) && (g = b[k], void 0 === g || !zg(a, g, h, d))) return !1;
            return !0
        }
        return !1
    }

    function Ag(a, b, c) { a[c] !== b[c] && D.k("Model.computeJsonDifference: Model." + c + ' is not the same in both models: "' + a[c] + '" and "' + b[c] + '"') }
    f.yC = function(a) {
        Ag(this, a, "nodeKeyProperty");
        this instanceof Bg && Ag(this, a, "nodeParentKeyProperty");
        for (var b = new L, c = new L, d = (new L).Vc(this.Kc.pG), e = new oa, g = a.qg, h = 0; h < g.length; h++) {
            var k = g[h],
                l = a.zb(k);
            if (void 0 !== l) {
                d.remove(l);
                var m = this.Ie(l);
                null === m ? (b.add(l), c.add(k)) : zg(this, m, k, e) || c.add(k)
            } else this.zB(k), l = this.zb(k), b.add(l), c.add(k)
        }
        g = "";
        zg(this, this.fl, a.fl, e) || (g += ug(this));
        0 < b.count && (g += this.iz + yg(this, b.Fc(), !0));
        0 < c.count && (g += this.GC + yg(this, c.Fc(), !0));
        0 < d.count && (g += this.kz +
            yg(this, d.Fc(), !0));
        return g
    };
    M.prototype.computeJsonDifference = M.prototype.computeJSONDifference = function(a, b) {
        D.l(a, M, M, "computeJsonDifference:newmodel");
        void 0 === b && (b = this.constructor === M ? "go.Model" : this.constructor === Y ? "go.GraphLinksModel" : this.constructor === Bg ? "go.TreeModel" : D.wf(this));
        return '{ "class": ' + this.quote(b) + ', "incremental": 1' + this.Ao() + this.yC(a) + "}"
    };
    f = M.prototype;
    f.iz = ',\n  "insertedNodeKeys": ';
    f.GC = ',\n  "modifiedNodeData": ';
    f.kz = ',\n  "removedNodeKeys": ';
    f.wC = function(a, b) {
        var c = this,
            d = !1,
            e = new L,
            g = new L,
            h = new L;
        a.fg.each(function(a) { a.ea === c && ("nodeDataArray" === a.Cf ? a.Oc === hg ? e.add(a.newValue) : a.Oc === ig && h.add(a.oldValue) : c.ke(a.object) ? g.add(a.object) : c.fl === a.object && a.Oc === fg && (d = !0)) });
        var k = new L;
        e.each(function(a) {
            k.add(c.zb(a));
            b || g.add(a)
        });
        var l = new L;
        h.each(function(a) {
            l.add(c.zb(a));
            b && g.add(a)
        });
        var m = "";
        d && (m += ug(this));
        0 < k.count && (m += (b ? this.kz : this.iz) + yg(this, k.Fc(), !0));
        0 < g.count && (m += this.GC + yg(this, g.Fc(), !0));
        0 < l.count && (m += (b ?
            this.iz : this.kz) + yg(this, l.Fc(), !0));
        return m
    };
    f.NB = function(a) {
        wg(this, a);
        var b = a.insertedNodeKeys,
            c = a.modifiedNodeData,
            d = new oa;
        if (D.isArray(c))
            for (var e = 0; e < c.length; e++) {
                var g = D.La(c, e),
                    h = this.zb(g);
                void 0 !== h && null !== h && d.set(h, g)
            }
        if (D.isArray(b))
            for (var e = D.cb(b), k = 0; k < e; k++) g = D.La(b, k), h = this.Ie(g), null === h && (h = (h = d.get(g)) ? h : this.copyNodeData({}), this.Ty(h, g), this.dm(h));
        if (D.isArray(c))
            for (e = D.cb(c), k = 0; k < e; k++)
                if (g = D.La(c, k), h = this.zb(g), h = this.Ie(h), null !== h)
                    for (var l in g) "__gohashid" !== l && l !== this.Vj && l !== this.Iq && this.setDataProperty(h,
                        l, g[l]);
        a = a.removedNodeKeys;
        if (D.isArray(a))
            for (e = D.cb(a), k = 0; k < e; k++) g = D.La(a, k), h = this.Ie(g), null !== h && this.Ky(h)
    };
    M.prototype.toIncrementalJson = M.prototype.toIncrementalJSON = function(a, b) {
        D.l(a, eg, M, "toIncrementalJson:e");
        a.Oc !== gg && D.k("Model.toIncrementalJson argument is not a Transaction ChangedEvent:" + a.toString());
        var c = a.object;
        if (!(a.nG && c instanceof Cg)) return '{ "incremental": 0 }';
        void 0 === b && (b = this.constructor === M ? "go.Model" : this.constructor === Y ? "go.GraphLinksModel" : this.constructor === Bg ? "go.TreeModel" : D.wf(this));
        return '{ "class": ' + this.quote(b) + ', "incremental": 1' + this.Ao() + this.wC(c, "FinishedUndo" ===
            a.propertyName) + "}"
    };
    M.prototype.toJson = M.prototype.toJSON = M.prototype.kC = function(a) { void 0 === a && (a = this.constructor === M ? "go.Model" : this.constructor === Y ? "go.GraphLinksModel" : this.constructor === Bg ? "go.TreeModel" : D.wf(this)); return '{ "class": ' + this.quote(a) + this.Ao() + this.xC() + "}" };
    M.prototype.applyIncrementalJson = M.prototype.applyIncrementalJSON = function(a) {
        var b = null;
        if ("string" === typeof a)
            if (window.JSON && window.JSON.parse) try { b = window.JSON.parse(a) } catch (c) { v && D.trace("JSON.parse error: " + c.toString()) } else D.trace("WARNING: no JSON.parse available");
            else "object" === typeof a ? b = a : D.k("Unable to modify a Model from: " + a);
        var d = b.incremental;
        "number" !== typeof d && D.k("Unable to apply non-incremental changes to Model: " + a);
        0 !== d && (this.Nb("applyIncrementalJson"), this.NB(b), this.jd("applyIncrementalJson"))
    };
    M.fromJson = M.fromJSON = function(a, b) {
        void 0 === b && (b = null);
        null !== b && D.l(b, M, M, "fromJson:model");
        var c = null;
        if ("string" === typeof a)
            if (window.JSON && window.JSON.parse) try { c = window.JSON.parse(a) } catch (d) { v && D.trace("JSON.parse error: " + d.toString()) } else D.trace("WARNING: no JSON.parse available");
            else "object" === typeof a ? c = a : D.k("Unable to construct a Model from: " + a);
        if (null === b) {
            var e;
            e = null;
            var g = c["class"];
            if ("string" === typeof g) try {
                var h = null;
                0 === g.indexOf("go.") ? (g = g.substr(3), h = ba[g]) : (h = ba[g],
                    void 0 === h && (h = window[g]));
                "function" === typeof h && (e = new h)
            } catch (k) {}
            null === e || e instanceof M ? b = e : D.k("Unable to construct a Model of declared class: " + c["class"])
        }
        null === b && (b = new Y);
        b.fv(c);
        b.OB(c);
        return b
    };
    M.prototype.replaceJsonObjects = M.prototype.iv = function(a) {
        if (D.isArray(a))
            for (var b = D.cb(a), c = 0; c < b; c++) {
                var d = D.La(a, c);
                D.Qa(d) && D.cF(a, c, this.iv(d))
            } else if (D.Qa(a)) {
                for (c in a)
                    if (d = a[c], D.Qa(d) && (d = this.iv(d), a[c] = d, "points" === c && Array.isArray(d))) {
                        for (var e = 0 === d.length % 2, g = 0; g < d.length; g++)
                            if ("number" !== typeof d[g]) { e = !1; break }
                        if (e) {
                            e = new K(N);
                            for (g = 0; g < d.length / 2; g++) {
                                var h = new N(d[2 * g], d[2 * g + 1]);
                                e.add(h)
                            }
                            e.freeze();
                            a[c] = e
                        }
                    }
                if ("object" === typeof a) {
                    c = a;
                    d = a["class"];
                    if ("NaN" === d) c = NaN;
                    else if ("Date" ===
                        d) c = new Date(a.value);
                    else if ("go.Point" === d) c = new N(Dg(a.x), Dg(a.y));
                    else if ("go.Size" === d) c = new Ca(Dg(a.width), Dg(a.height));
                    else if ("go.Rect" === d) c = new C(Dg(a.x), Dg(a.y), Dg(a.width), Dg(a.height));
                    else if ("go.Margin" === d) c = new Lb(Dg(a.top), Dg(a.right), Dg(a.bottom), Dg(a.left));
                    else if ("go.Spot" === d) c = "string" === typeof a["enum"] ? cc(a["enum"]) : new S(Dg(a.x), Dg(a.y), Dg(a.offsetX), Dg(a.offsetY));
                    else if ("go.Brush" === d) {
                        if (c = new Ba, c.type = Ha(Ba, a.type), "string" === typeof a.color && (c.color = a.color), a.start instanceof S && (c.start = a.start), a.end instanceof S && (c.end = a.end), "number" === typeof a.startRadius && (c.sv = Dg(a.startRadius)), "number" === typeof a.endRadius && (c.ou = Dg(a.endRadius)), a = a.colorStops, D.Qa(a))
                            for (b in a) c.addColorStop(parseFloat(b), a[b])
                    } else "go.Geometry" === d ? (b = null, b = "string" === typeof a.path ? yf(a.path) : new Ve, b.type = Ha(Ve, a.type), "number" === typeof a.startX && (b.la = Dg(a.startX)), "number" === typeof a.startY && (b.ja = Dg(a.startY)), "number" === typeof a.endX && (b.F = Dg(a.endX)), "number" === typeof a.endY && (b.G =
                        Dg(a.endY)), a.spot1 instanceof S && (b.C = a.spot1), a.spot2 instanceof S && (b.D = a.spot2), c = b) : "go.EnumValue" === d && (b = a.classType, 0 === b.indexOf("go.") && (b = b.substr(3)), c = Ha(ba[b], a.name));
                    a = c
                }
            }
        return a
    };
    M.prototype.quote = function(a) {
        for (var b = "", c = a.length, d = 0; d < c; d++) {
            var e = a[d];
            if ('"' === e || "\\" === e) b += "\\" + e;
            else if ("\b" === e) b += "\\b";
            else if ("\f" === e) b += "\\f";
            else if ("\n" === e) b += "\\n";
            else if ("\r" === e) b += "\\r";
            else if ("\t" === e) b += "\\t";
            else var g = a.charCodeAt(d),
                b = 16 > g ? b + ("\\u000" + a.charCodeAt(d).toString(16)) : 32 > g ? b + ("\\u00" + a.charCodeAt(d).toString(16)) : 8232 === g ? b + "\\u2028" : 8233 === g ? b + "\\u2029" : b + e
        }
        return '"' + b + '"'
    };
    M.prototype.writeJsonValue = M.prototype.xv = function(a) { return void 0 === a ? "undefined" : null === a ? "null" : !0 === a ? "true" : !1 === a ? "false" : "string" === typeof a ? this.quote(a) : "number" === typeof a ? Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : isNaN(a) ? '{"class":"NaN"}' : a.toString() : a instanceof Date ? '{"class":"Date", "value":"' + a.toJSON() + '"}' : a instanceof Number ? this.xv(a.valueOf()) : D.isArray(a) ? yg(this, a) : D.Qa(a) ? vg(this, a) : "function" === typeof a ? "null" : a.toString() };

    function yg(a, b, c) {
        void 0 === c && (c = !1);
        var d = D.cb(b);
        if (0 >= d) return "[]";
        var e = new xa;
        e.add("[ ");
        c && 1 < d && e.add("\n");
        for (var g = 0; g < d; g++) {
            var h = D.La(b, g);
            void 0 !== h && (0 < g && (e.add(","), c && e.add("\n")), e.add(a.xv(h)))
        }
        c && 1 < d && e.add("\n");
        e.add(" ]");
        return e.toString()
    }

    function xg(a, b) { return void 0 === b || "__gohashid" === a || "_" === a[0] || "function" === typeof b ? !0 : !1 }

    function Eg(a) { return isNaN(a) ? "NaN" : Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : a }

    function vg(a, b) {
        var c = b;
        if (c instanceof N) b = { "class": "go.Point", x: Eg(c.x), y: Eg(c.y) };
        else if (c instanceof Ca) b = { "class": "go.Size", width: Eg(c.width), height: Eg(c.height) };
        else if (c instanceof C) b = { "class": "go.Rect", x: Eg(c.x), y: Eg(c.y), width: Eg(c.width), height: Eg(c.height) };
        else if (c instanceof Lb) b = { "class": "go.Margin", top: Eg(c.top), right: Eg(c.right), bottom: Eg(c.bottom), left: Eg(c.left) };
        else if (c instanceof S) b = c.Xc() ? { "class": "go.Spot", x: Eg(c.x), y: Eg(c.y), offsetX: Eg(c.offsetX), offsetY: Eg(c.offsetY) } : { "class": "go.Spot", "enum": c.toString() };
        else if (c instanceof Ba) {
            b = { "class": "go.Brush", type: c.type.name };
            if (c.type === Fg) b.color = c.color;
            else if (c.type === Gg || c.type === Id) b.start = c.start, b.end = c.end, c.type === Id && (0 !== c.sv && (b.startRadius = Eg(c.sv)), isNaN(c.ou) || (b.endRadius = Eg(c.ou)));
            if (null !== c.Qk) {
                for (var d = {}, c = c.Qk.j; c.next();) d[c.key] = c.value;
                b.colorStops = d
            }
        } else if (c instanceof Ve) b = { "class": "go.Geometry", type: c.type.name }, 0 !== c.la && (b.startX = Eg(c.la)), 0 !== c.ja && (b.startY = Eg(c.ja)), 0 !== c.F && (b.endX =
            Eg(c.F)), 0 !== c.G && (b.endY = Eg(c.G)), c.C.O(ec) || (b.spot1 = c.C), c.D.O(vc) || (b.spot2 = c.D), c.type === We && (b.path = xf(c));
        else if (c instanceof ya) b = { "class": "go.EnumValue", classType: D.wf(c.Qe), name: c.name };
        else if (c instanceof O || c instanceof E || c instanceof Hg || c instanceof M || c instanceof Zg || c instanceof qa || c instanceof $g || c instanceof ua || c instanceof tg || c instanceof Cg) return D.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: " + c.toString()),
            "{}";
        var d = "{",
            c = !0,
            e;
        for (e in b) {
            var g = D.xb(b, e);
            if (!xg(e, g))
                if (c ? c = !1 : d += ", ", d += '"' + e + '":', "points" === e && g instanceof K && g.da === N) {
                    for (var h = "[", g = g.j; g.next();) {
                        var k = g.value;
                        1 < h.length && (h += ",");
                        h += a.xv(k.x);
                        h += ",";
                        h += a.xv(k.y)
                    }
                    h += "]";
                    d += h
                } else d += a.xv(g)
        }
        return d + "}"
    }

    function Dg(a) { return "number" === typeof a ? a : "NaN" === a ? NaN : "9e9999" === a ? Infinity : "-9e9999" === a ? -Infinity : parseFloat(a) }
    D.defineProperty(M, { name: "name" }, function() { return this.$b }, function(a) {
        var b = this.$b;
        b !== a && (D.h(a, "string", M, "name"), this.$b = a, this.i("name", b, a))
    });
    D.defineProperty(M, { nm: "dataFormat" }, function() { return this.Ir }, function(a) {
        var b = this.Ir;
        b !== a && (D.h(a, "string", M, "dataFormat"), this.Ir = a, this.i("dataFormat", b, a))
    });
    D.defineProperty(M, { qb: "isReadOnly" }, function() { return this.dj }, function(a) {
        var b = this.dj;
        b !== a && (D.h(a, "boolean", M, "isReadOnly"), this.dj = a, this.i("isReadOnly", b, a))
    });
    D.defineProperty(M, { fl: "modelData" }, function() { return this.dA }, function(a) {
        var b = this.dA;
        b !== a && (D.h(a, "object", M, "modelData"), this.dA = a, this.i("modelData", b, a), this.Ob(a))
    });
    M.prototype.addChangedListener = M.prototype.Bn = function(a) {
        D.h(a, "function", M, "addChangedListener:listener");
        null === this.yk && (this.yk = new K("function"));
        this.yk.add(a)
    };
    M.prototype.removeChangedListener = M.prototype.gv = function(a) {
        D.h(a, "function", M, "removeChangedListener:listener");
        null !== this.yk && (this.yk.remove(a), 0 === this.yk.count && (this.yk = null))
    };
    M.prototype.Gx = function(a) {
        this.kb || this.na.ZF(a);
        if (null !== this.yk)
            for (var b = this.yk, c = b.length, d = 0; d < c; d++) b.fa(d)(a)
    };
    M.prototype.raiseChangedEvent = M.prototype.od = function(a, b, c, d, e, g, h) { ah(this, "", a, b, c, d, e, g, h) };
    M.prototype.raiseChanged = M.prototype.i = function(a, b, c, d, e) { ah(this, "", fg, a, this, b, c, d, e) };
    M.prototype.raiseDataChanged = M.prototype.MB = function(a, b, c, d, e, g) { ah(this, "", fg, b, a, c, d, e, g) };

    function ah(a, b, c, d, e, g, h, k, l) {
        void 0 === k && (k = null);
        void 0 === l && (l = null);
        var m = new eg;
        m.ea = a;
        m.Oc = c;
        m.Cf = b;
        m.propertyName = d;
        m.object = e;
        m.oldValue = g;
        m.Wj = k;
        m.newValue = h;
        m.Uj = l;
        a.Gx(m)
    }
    D.defineProperty(M, { na: "undoManager" }, function() { return this.zA }, function(a) {
        var b = this.zA;
        b !== a && (D.l(a, tg, M, "undoManager"), null !== b && b.fK(this), this.zA = a, null !== a && a.YH(this))
    });
    D.defineProperty(M, { kb: "skipsUndoManager" }, function() { return this.vj }, function(a) {
        D.h(a, "boolean", M, "skipsUndoManager");
        this.vj = a
    });
    M.prototype.Fn = function(a, b) {
        if (null !== a && a.ea === this)
            if (a.Oc === fg) {
                var c = a.object,
                    d = a.propertyName,
                    e = a.oa(b);
                D.Ua(c, d, e)
            } else a.Oc === hg ? (c = a.Uj, "nodeDataArray" === a.Cf ? (d = a.newValue, D.Qa(d) && "number" === typeof c && (e = this.zb(d), b ? (D.La(this.ze, c) === d && D.Vg(this.ze, c), void 0 !== e && this.Kc.remove(e)) : (D.La(this.ze, c) !== d && D.Ih(this.ze, c, d), void 0 !== e && this.Kc.add(e, d)))) : "" === a.Cf ? (d = a.object, !D.isArray(d) && a.propertyName && (d = D.xb(a.object, a.propertyName)), D.isArray(d) && "number" === typeof c && (e = a.newValue,
                b ? D.Vg(d, c) : D.Ih(d, c, e))) : D.k("unknown ChangedEvent.Insert modelChange: " + a.toString())) : a.Oc === ig ? (c = a.Wj, "nodeDataArray" === a.Cf ? (d = a.oldValue, D.Qa(d) && "number" === typeof c && (e = this.zb(d), b ? (D.La(this.ze, c) !== d && D.Ih(this.ze, c, d), void 0 !== e && this.Kc.add(e, d)) : (D.La(this.ze, c) === d && D.Vg(this.ze, c), void 0 !== e && this.Kc.remove(e)))) : "" === a.Cf ? (d = a.object, !D.isArray(d) && a.propertyName && (d = D.xb(a.object, a.propertyName)), D.isArray(d) && "number" === typeof c && (e = a.oldValue, b ? D.Ih(d, c, e) : D.Vg(d, c))) : D.k("unknown ChangedEvent.Remove modelChange: " +
                a.toString())) : a.Oc !== gg && D.k("unknown ChangedEvent: " + a.toString())
    };
    M.prototype.startTransaction = M.prototype.Nb = function(a) { return this.na.Nb(a) };
    M.prototype.commitTransaction = M.prototype.jd = function(a) { return this.na.jd(a) };
    M.prototype.rollbackTransaction = M.prototype.Am = function() { return this.na.Am() };
    M.prototype.commit = function(a, b) {
        var c = b;
        void 0 === c && (c = "");
        var d = this.kb;
        null === c && (this.kb = !0, c = "");
        this.na.Nb(c);
        var e = !1;
        try { a(this), e = !0 } finally { e ? this.na.jd(c) : this.na.Am(), this.kb = d }
    };
    M.prototype.updateTargetBindings = M.prototype.Ob = function(a, b) {
        void 0 === b && (b = "");
        ah(this, "SourceChanged", gg, b, a, null, null)
    };
    D.defineProperty(M, { Vj: "nodeKeyProperty" }, function() { return this.Ck }, function(a) {
        var b = this.Ck;
        b !== a && (bh(a, M, "nodeKeyProperty"), "" === a && D.k("Model.nodeKeyProperty may not be the empty string"), 0 < this.Kc.count && D.k("Cannot set Model.nodeKeyProperty when there is existing node data"), this.Ck = a, this.i("nodeKeyProperty", b, a))
    });

    function bh(a, b, c) { "string" !== typeof a && "function" !== typeof a && D.kc(a, "string or function", b, c) }
    M.prototype.getKeyForNodeData = M.prototype.zb = function(a) {
        if (null !== a) {
            var b = this.Ck;
            if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
                if (ch(b)) return b;
                D.k("Key value for node data " + a + " is not a number or a string: " + b)
            }
        }
    };
    M.prototype.setKeyForNodeData = M.prototype.Ty = function(a, b) {
        void 0 !== b && null !== b && ch(b) || D.kc(b, "number or string", M, "setKeyForNodeData:key");
        if (null !== a) {
            var c = this.Ck;
            if ("" !== c)
                if (this.ke(a)) {
                    var d = D.xb(a, c);
                    d !== b && null === this.Ie(b) && (D.Ua(a, c, b), this.Kc.remove(d), this.Kc.add(b, a), ah(this, "nodeKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c), this.hv(d, b))
                } else D.Ua(a, c, b)
        }
    };
    D.defineProperty(M, { bM: "makeUniqueKeyFunction" }, function() { return this.vp }, function(a) {
        var b = this.vp;
        b !== a && (null !== a && D.h(a, "function", M, "makeUniqueKeyFunction"), this.vp = a, this.i("makeUniqueKeyFunction", b, a))
    });

    function ch(a) { return "number" === typeof a || "string" === typeof a }
    M.prototype.containsNodeData = M.prototype.ke = function(a) { var b = this.zb(a); return void 0 === b ? !1 : this.Kc.oa(b) === a };
    M.prototype.findNodeDataForKey = M.prototype.Ie = function(a) { null === a && D.k("Model.findNodeDataForKey:key must not be null"); return void 0 !== a && ch(a) ? this.Kc.oa(a) : null };
    D.defineProperty(M, { qg: "nodeDataArray" }, function() { return this.ze }, function(a) {
        var b = this.ze;
        if (b !== a) {
            D.gu(a, M, "nodeDataArray");
            this.Kc.clear();
            this.sC();
            for (var c = D.cb(a), d = 0; d < c; d++) {
                var e = D.La(a, d);
                if (!D.Qa(e)) { D.k("Model.nodeDataArray must only contain Objects, not: " + e); return }
                D.sq(e)
            }
            this.ze = a;
            for (var g = new K(Object), d = 0; d < c; d++) {
                var e = D.La(a, d),
                    h = this.zb(e);
                void 0 === h ? g.add(e) : null !== this.Kc.oa(h) ? g.add(e) : this.Kc.add(h, e)
            }
            for (d = g.j; d.next();) e = d.value, this.zB(e), g = this.zb(e), void 0 !== g &&
                this.Kc.add(g, e);
            ah(this, "nodeDataArray", fg, "nodeDataArray", this, b, a);
            for (d = 0; d < c; d++) e = D.La(a, d), this.Qq(e), this.Pq(e);
            this.gF();
            D.qJ(a) || (this.qb = !0)
        }
    });
    M.prototype.makeNodeDataKeyUnique = M.prototype.zB = function(a) {
        if (null !== a) {
            var b = this.Ck;
            if ("" !== b) {
                var c = this.zb(a);
                if (void 0 === c || this.Kc.contains(c)) {
                    var d = this.vp;
                    if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.Kc.contains(c))) { D.Ua(a, b, c); return }
                    if ("string" === typeof c) {
                        for (d = 2; this.Kc.contains(c + d);) d++;
                        D.Ua(a, b, c + d)
                    } else if (void 0 === c || "number" === typeof c) {
                        for (d = -this.Kc.count - 1; this.Kc.contains(d);) d--;
                        D.Ua(a, b, d)
                    } else D.k("Model.getKeyForNodeData returned something other than a string or a number: " +
                        c)
                }
            }
        }
    };
    M.prototype.addNodeData = M.prototype.dm = function(a) { null !== a && (D.sq(a), this.ke(a) || dh(this, a, !0)) };

    function dh(a, b, c) { var d = a.zb(b); if (void 0 === d || a.Kc.oa(d) !== b) a.zB(b), d = a.zb(b), void 0 === d ? D.k("Model.makeNodeDataKeyUnique failed on " + b + ".  Data not added to Model.") : (a.Kc.add(d, b), d = null, c && (d = D.cb(a.ze), D.Ih(a.ze, d, b)), ah(a, "nodeDataArray", hg, "nodeDataArray", a, null, b, null, d), a.Qq(b), a.Pq(b)) }
    M.prototype.addNodeDataCollection = function(a) {
        if (D.isArray(a))
            for (var b = D.cb(a), c = 0; c < b; c++) this.dm(D.La(a, c));
        else
            for (a = a.j; a.next();) this.dm(a.value)
    };
    M.prototype.removeNodeData = M.prototype.Ky = function(a) { null !== a && eh(this, a, !0) };

    function eh(a, b, c) {
        var d = a.zb(b);
        void 0 !== d && a.Kc.remove(d);
        d = null;
        if (c) {
            d = D.hm(a.ze, b);
            if (0 > d) return;
            D.Vg(a.ze, d)
        }
        ah(a, "nodeDataArray", ig, "nodeDataArray", a, b, null, d, null);
        a.wv(b)
    }
    M.prototype.removeNodeDataCollection = function(a) {
        if (D.isArray(a))
            for (var b = D.cb(a), c = 0; c < b; c++) this.Ky(D.La(a, c));
        else
            for (a = a.j; a.next();) this.Ky(a.value)
    };
    f = M.prototype;
    f.hv = function(a, b) {
        var c = fh(this, a);
        c instanceof L && this.zg.add(b, c)
    };
    f.sC = function() {};
    f.Qq = function() {};
    f.Pq = function() {};
    f.wv = function() {};

    function gh(a, b, c) {
        if (void 0 !== b) {
            var d = a.zg.oa(b);
            null === d && (d = new L(Object), a.zg.add(b, d));
            d.add(c)
        }
    }

    function hh(a, b, c) {
        if (void 0 !== b) {
            var d = a.zg.oa(b);
            d instanceof L && (void 0 === c || null === c ? a.zg.remove(b) : (d.remove(c), 0 === d.count && a.zg.remove(b)))
        }
    }

    function fh(a, b) { if (void 0 === b) return null; var c = a.zg.oa(b); return c instanceof L ? c : null }
    M.prototype.clearUnresolvedReferences = M.prototype.gF = function(a) { void 0 === a ? this.zg.clear() : this.zg.remove(a) };
    D.defineProperty(M, { uL: "copyNodeDataFunction" }, function() { return this.Po }, function(a) {
        var b = this.Po;
        b !== a && (null !== a && D.h(a, "function", M, "copyNodeDataFunction"), this.Po = a, this.i("copyNodeDataFunction", b, a))
    });
    D.defineProperty(M, { PA: "copiesArrays" }, function() { return this.Ar }, function(a) {
        var b = this.Ar;
        b !== a && (null !== a && D.h(a, "boolean", M, "copiesArrays"), this.Ar = a, this.i("copiesArrays", b, a))
    });
    D.defineProperty(M, { OA: "copiesArrayObjects" }, function() { return this.zr }, function(a) {
        var b = this.zr;
        b !== a && (null !== a && D.h(a, "boolean", M, "copiesArrayObjects"), this.zr = a, this.i("copiesArrayObjects", b, a))
    });
    M.prototype.copyNodeData = function(a) {
        if (null === a) return null;
        var b = null,
            b = this.Po,
            b = null !== b ? b(a, this) : ih(this, a, !0);
        D.Qa(b) && D.xc(b);
        return b
    };

    function ih(a, b, c) {
        if (a.PA && Array.isArray(b)) {
            var d = [];
            for (c = 0; c < b.length; c++) {
                var e = ih(a, b[c], a.OA);
                d.push(e)
            }
            D.xc(d);
            return d
        }
        if (c && D.Qa(b)) {
            c = (c = b.constructor) ? new c : {};
            for (d in b)
                if ("__gohashid" !== d) {
                    var e = D.xb(b, d),
                        g;
                    g = e;
                    g instanceof O || g instanceof E || g instanceof Hg || g instanceof jh || g instanceof kh || g instanceof Zg || g instanceof qa || g instanceof $g || g instanceof bg || g instanceof dg ? ("_" !== d[0] && D.trace('Warning: found GraphObject or Diagram reference when copying model data on property "' +
                        d + '" of data object: ' + b.toString() + "  \nModel data should not have any references to a Diagram or any part of a diagram, such as: " + g.toString()), g = !0) : g = g instanceof M || g instanceof tg || g instanceof Cg || g instanceof eg ? !0 : !1;
                    g || (e = ih(a, e, !1));
                    D.Ua(c, d, e)
                }
            D.xc(c);
            return c
        }
        return b instanceof N ? b.copy() : b instanceof Ca ? b.copy() : b instanceof C ? b.copy() : b instanceof S ? b.copy() : b instanceof Lb ? b.copy() : b
    }
    D.defineProperty(M, { $H: "afterCopyFunction" }, function() { return this.jr }, function(a) {
        var b = this.jr;
        b !== a && (null !== a && D.h(a, "function", M, "afterCopyFunction"), this.jr = a, this.i("afterCopyFunction", b, a))
    });
    var lh = !1;
    M.prototype.set = function(a, b, c) { this.setDataProperty(a, b, c) };
    M.prototype.set = M.prototype.setDataProperty = function(a, b, c) {
        v && (D.h(a, "object", M, "setDataProperty:data"), D.h(b, "string", M, "setDataProperty:propname"), "" === b && D.k("Model.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
        if (this.ke(a))
            if (b === this.Vj) this.Ty(a, c);
            else { if (b === this.oo) { this.Ry(a, c); return } }
        else !lh && a instanceof O && (lh = !0, D.trace('Model.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), D.trace("  Is that really your intent?"));
        var d = D.xb(a,
            b);
        d !== c && (D.Ua(a, b, c), this.MB(a, b, d, c))
    };
    M.prototype.addArrayItem = function(a, b) { this.mB(a, -1, b) };
    M.prototype.insertArrayItem = M.prototype.mB = function(a, b, c) {
        v && (D.gu(a, M, "insertArrayItem:arr"), D.p(b, M, "insertArrayItem:idx"));
        a === this.ze && D.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");
        0 > b && (b = D.cb(a));
        D.Ih(a, b, c);
        ah(this, "", hg, "", a, null, c, null, b)
    };
    M.prototype.removeArrayItem = M.prototype.IG = function(a, b) {
        void 0 === b && (b = -1);
        v && (D.gu(a, M, "removeArrayItem:arr"), D.p(b, M, "removeArrayItem:idx"));
        a === this.ze && D.k("Model.removeArrayItem should not be called on the Model.nodeDataArray"); - 1 === b && (b = D.cb(a) - 1);
        var c = D.La(a, b);
        D.Vg(a, b);
        ah(this, "", ig, "", a, c, null, b, null)
    };
    D.defineProperty(M, { oo: "nodeCategoryProperty" }, function() { return this.hn }, function(a) {
        var b = this.hn;
        b !== a && (bh(a, M, "nodeCategoryProperty"), this.hn = a, this.i("nodeCategoryProperty", b, a))
    });
    M.prototype.getCategoryForNodeData = M.prototype.eB = function(a) {
        if (null === a) return "";
        var b = this.hn;
        if ("" === b) return "";
        b = D.xb(a, b);
        if (void 0 === b) return "";
        if ("string" === typeof b) return b;
        D.k("getCategoryForNodeData found a non-string category for " + a + ": " + b);
        return ""
    };
    M.prototype.setCategoryForNodeData = M.prototype.Ry = function(a, b) {
        D.h(b, "string", M, "setCategoryForNodeData:cat");
        if (null !== a) {
            var c = this.hn;
            if ("" !== c)
                if (this.ke(a)) {
                    var d = D.xb(a, c);
                    void 0 === d && (d = "");
                    d !== b && (D.Ua(a, c, b), ah(this, "nodeCategory", fg, c, a, d, b))
                } else D.Ua(a, c, b)
        }
    };

    function Y(a, b) {
        M.call(this);
        2 < arguments.length && D.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");
        this.df = [];
        this.ki = new L(Object);
        this.td = new oa(null, Object);
        this.Ol = "";
        this.yl = this.Oo = this.wp = null;
        this.li = "from";
        this.mi = "to";
        this.dn = this.cn = "";
        this.bn = "category";
        this.Kg = "";
        this.zp = "isGroup";
        this.Ah = "group";
        this.Br = !1;
        void 0 !== a && (this.qg = a);
        void 0 !== b && (this.$g = b)
    }
    D.Ta(Y, M);
    D.ka("GraphLinksModel", Y);
    Y.prototype.cloneProtected = function(a) {
        M.prototype.cloneProtected.call(this, a);
        a.Ol = this.Ol;
        a.wp = this.wp;
        a.Oo = this.Oo;
        a.li = this.li;
        a.mi = this.mi;
        a.cn = this.cn;
        a.dn = this.dn;
        a.bn = this.bn;
        a.Kg = this.Kg;
        a.zp = this.zp;
        a.Ah = this.Ah;
        a.Br = this.Br
    };
    Y.prototype.clear = Y.prototype.clear = function() {
        M.prototype.clear.call(this);
        this.df = [];
        this.td.clear();
        this.ki.clear()
    };
    f = Y.prototype;
    f.toString = function(a) {
        void 0 === a && (a = 0);
        if (2 <= a) return this.kC();
        var b = ("" !== this.name ? this.name : "") + " GraphLinksModel";
        if (0 < a) {
            b += "\n node data:";
            a = this.qg;
            for (var c = D.cb(a), d = 0, d = 0; d < c; d++) var e = D.La(a, d),
                b = b + (" " + this.zb(e) + ":" + ia(e));
            b += "\n link data:";
            a = this.$g;
            c = D.cb(a);
            for (d = 0; d < c; d++) e = D.La(a, d), b += " " + this.tm(e) + "--\x3e" + this.um(e)
        }
        return b
    };
    f.Ao = function() {
        var a = M.prototype.Ao.call(this),
            b = "";
        "category" !== this.Su && "string" === typeof this.Su && (b += ',\n  "linkCategoryProperty": ' + this.quote(this.Su));
        "" !== this.Tj && "string" === typeof this.Tj && (b += ',\n  "linkKeyProperty": ' + this.quote(this.Tj));
        "from" !== this.co && "string" === typeof this.co && (b += ',\n  "linkFromKeyProperty": ' + this.quote(this.co));
        "to" !== this.eo && "string" === typeof this.eo && (b += ',\n  "linkToKeyProperty": ' + this.quote(this.eo));
        "" !== this.Tu && "string" === typeof this.Tu && (b += ',\n  "linkFromPortIdProperty": ' +
            this.quote(this.Tu));
        "" !== this.Vu && "string" === typeof this.Vu && (b += ',\n  "linkToPortIdProperty": ' + this.quote(this.Vu));
        "" !== this.Uu && "string" === typeof this.Uu && (b += ',\n  "linkLabelKeysProperty": ' + this.quote(this.Uu));
        "isGroup" !== this.Iq && "string" === typeof this.Iq && (b += ',\n  "nodeIsGroupProperty": ' + this.quote(this.Iq));
        "group" !== this.bv && "string" === typeof this.bv && (b += ',\n  "nodeGroupKeyProperty": ' + this.quote(this.bv));
        return a + b
    };
    f.fv = function(a) {
        M.prototype.fv.call(this, a);
        a.linkKeyProperty && (this.Tj = a.linkKeyProperty);
        a.linkFromKeyProperty && (this.co = a.linkFromKeyProperty);
        a.linkToKeyProperty && (this.eo = a.linkToKeyProperty);
        a.linkFromPortIdProperty && (this.Tu = a.linkFromPortIdProperty);
        a.linkToPortIdProperty && (this.Vu = a.linkToPortIdProperty);
        a.linkCategoryProperty && (this.Su = a.linkCategoryProperty);
        a.linkLabelKeysProperty && (this.Uu = a.linkLabelKeysProperty);
        a.nodeIsGroupProperty && (this.Iq = a.nodeIsGroupProperty);
        a.nodeGroupKeyProperty &&
            (this.bv = a.nodeGroupKeyProperty)
    };
    f.xC = function() {
        var a = M.prototype.xC.call(this),
            b = ',\n  "linkDataArray": ' + yg(this, this.$g, !0);
        return a + b
    };
    f.OB = function(a) {
        M.prototype.OB.call(this, a);
        a = a.linkDataArray;
        D.isArray(a) && (this.iv(a), this.$g = a)
    };
    f.yC = function(a) {
        if (!(a instanceof Y)) return D.k("Model.computeJsonDifference: newmodel must be a GraphLinksModel"), "";
        "" === this.Tj && D.k("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed.");
        var b = M.prototype.yC.call(this, a);
        Ag(this, a, "linkKeyProperty");
        Ag(this, a, "linkFromKeyProperty");
        Ag(this, a, "linkToKeyProperty");
        Ag(this, a, "linkLabelKeysProperty");
        Ag(this, a, "nodeIsGroupProperty");
        Ag(this, a, "nodeGroupKeyProperty");
        for (var c = new L, d = new L, e = (new L).Vc(this.td.pG),
                g = new oa, h = a.$g, k = 0; k < h.length; k++) {
            var l = h[k],
                m = a.mf(l);
            if (void 0 !== m) {
                e.remove(m);
                var n = this.oq(m);
                null === n ? (c.add(m), d.add(l)) : zg(this, n, l, g) || d.add(l)
            } else this.vy(l), m = this.mf(l), c.add(m), d.add(l)
        }
        a = b;
        0 < c.count && (a += this.hz + yg(this, c.Fc(), !0));
        0 < d.count && (a += this.FC + yg(this, d.Fc(), !0));
        0 < e.count && (a += this.jz + yg(this, e.Fc(), !0));
        return a
    };
    f.hz = ',\n  "insertedLinkKeys": ';
    f.FC = ',\n  "modifiedLinkData": ';
    f.jz = ',\n  "removedLinkKeys": ';
    f.wC = function(a, b) {
        "" === this.Tj && D.k("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");
        var c = M.prototype.wC.call(this, a, b),
            d = this,
            e = new L,
            g = new L,
            h = new L;
        a.fg.each(function(a) { a.ea === d && ("linkDataArray" === a.Cf ? a.Oc === hg ? e.add(a.newValue) : a.Oc === ig && h.add(a.oldValue) : d.Lh(a.object) && g.add(a.object)) });
        var k = new L;
        e.each(function(a) {
            k.add(d.mf(a));
            b || g.add(a)
        });
        var l = new L;
        h.each(function(a) {
            l.add(d.mf(a));
            b && g.add(a)
        });
        0 < k.count && (c += (b ? this.jz : this.hz) +
            yg(this, k.Fc(), !0));
        0 < g.count && (c += this.FC + yg(this, g.Fc(), !0));
        0 < l.count && (c += (b ? this.hz : this.jz) + yg(this, l.Fc(), !0));
        return c
    };
    f.NB = function(a) {
        M.prototype.NB.call(this, a);
        var b = a.insertedLinkKeys,
            c = a.modifiedLinkData,
            d = new oa;
        if (D.isArray(c))
            for (var e = 0; e < c.length; e++) {
                var g = D.La(c, e),
                    h = this.mf(g);
                void 0 !== h && null !== h && d.set(h, g)
            }
        if (D.isArray(b))
            for (var e = D.cb(b), k = 0; k < e; k++) g = D.La(b, k), h = this.oq(g), null === h && (h = (h = d.get(g)) ? h : this.Kx({}), this.cH(h, g), this.au(h));
        if (D.isArray(c))
            for (e = D.cb(c), k = 0; k < e; k++)
                if (g = D.La(c, k), h = this.mf(g), h = this.oq(h), null !== h)
                    for (var l in g) "__gohashid" !== l && l !== this.Tj && this.setDataProperty(h,
                        l, g[l]);
        a = a.removedLinkKeys;
        if (D.isArray(a))
            for (e = D.cb(a), k = 0; k < e; k++) g = D.La(a, k), h = this.oq(g), null !== h && this.Jy(h)
    };
    f.Fn = function(a, b) {
        if (a.Oc === hg) {
            var c = a.Uj;
            if ("linkDataArray" === a.Cf) {
                var d = a.newValue;
                if (D.Qa(d) && "number" === typeof c) {
                    var e = this.mf(d);
                    b ? (this.ki.remove(d), D.La(this.df, c) === d && D.Vg(this.df, c), void 0 !== e && this.td.remove(e)) : (this.ki.add(d), D.La(this.df, c) !== d && D.Ih(this.df, c, d), void 0 !== e && this.td.add(e, d))
                }
                return
            }
            if ("linkLabelKeys" === a.Cf) {
                d = this.$k(a.object);
                D.isArray(d) && "number" === typeof c && (b ? (c = D.hm(d, a.newValue), 0 <= c && D.Vg(d, c)) : 0 > D.hm(d, a.newValue) && D.Ih(d, c, a.newValue));
                return
            }
        } else if (a.Oc ===
            ig) {
            c = a.Wj;
            if ("linkDataArray" === a.Cf) {
                d = a.oldValue;
                D.Qa(d) && "number" === typeof c && (e = this.mf(d), b ? (this.ki.add(d), D.La(this.df, c) !== d && D.Ih(this.df, c, d), void 0 !== e && this.td.add(e, d)) : (this.ki.remove(d), D.La(this.df, c) === d && D.Vg(this.df, c), void 0 !== e && this.td.remove(e)));
                return
            }
            if ("linkLabelKeys" === a.Cf) {
                d = this.$k(a.object);
                D.isArray(d) && "number" === typeof c && (b ? 0 > D.hm(d, a.newValue) && D.Ih(d, c, a.newValue) : (c = D.hm(d, a.newValue), 0 <= c && D.Vg(d, c)));
                return
            }
        }
        M.prototype.Fn.call(this, a, b)
    };
    D.defineProperty(Y, { GA: "archetypeNodeData" }, function() { return this.yl }, function(a) {
        var b = this.yl;
        b !== a && (null !== a && D.l(a, Object, Y, "archetypeNodeData"), this.yl = a, this.i("archetypeNodeData", b, a))
    });
    Y.prototype.fo = function(a) {
        if (void 0 !== a) {
            var b = this.yl;
            if (null !== b) {
                var c = this.Ie(a);
                null === c && (c = this.copyNodeData(b), D.Ua(c, this.Ck, a), this.dm(c))
            }
            return a
        }
    };
    D.defineProperty(Y, { co: "linkFromKeyProperty" }, function() { return this.li }, function(a) {
        var b = this.li;
        b !== a && (bh(a, Y, "linkFromKeyProperty"), this.li = a, this.i("linkFromKeyProperty", b, a))
    });
    Y.prototype.getFromKeyForLinkData = Y.prototype.tm = function(a) {
        if (null !== a) {
            var b = this.li;
            if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
                if (ch(b)) return b;
                D.k("FromKey value for link data " + a + " is not a number or a string: " + b)
            }
        }
    };
    Y.prototype.setFromKeyForLinkData = Y.prototype.YB = function(a, b) {
        null === b && (b = void 0);
        void 0 === b || ch(b) || D.kc(b, "number or string", Y, "setFromKeyForLinkData:key");
        if (null !== a) {
            var c = this.li;
            if ("" !== c)
                if (b = this.fo(b), this.Lh(a)) {
                    var d = D.xb(a, c);
                    d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "linkFromKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
                } else D.Ua(a, c, b)
        }
    };
    D.defineProperty(Y, { eo: "linkToKeyProperty" }, function() { return this.mi }, function(a) {
        var b = this.mi;
        b !== a && (bh(a, Y, "linkToKeyProperty"), this.mi = a, this.i("linkToKeyProperty", b, a))
    });
    Y.prototype.getToKeyForLinkData = Y.prototype.um = function(a) {
        if (null !== a) {
            var b = this.mi;
            if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
                if (ch(b)) return b;
                D.k("ToKey value for link data " + a + " is not a number or a string: " + b)
            }
        }
    };
    Y.prototype.setToKeyForLinkData = Y.prototype.dC = function(a, b) {
        null === b && (b = void 0);
        void 0 === b || ch(b) || D.kc(b, "number or string", Y, "setToKeyForLinkData:key");
        if (null !== a) {
            var c = this.mi;
            if ("" !== c)
                if (b = this.fo(b), this.Lh(a)) {
                    var d = D.xb(a, c);
                    d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "linkToKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
                } else D.Ua(a, c, b)
        }
    };
    D.defineProperty(Y, { Tu: "linkFromPortIdProperty" }, function() { return this.cn }, function(a) {
        var b = this.cn;
        b !== a && (bh(a, Y, "linkFromPortIdProperty"), a !== this.co && a !== this.eo || D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: " + a), this.cn = a, this.i("linkFromPortIdProperty", b, a))
    });
    Y.prototype.getFromPortIdForLinkData = Y.prototype.UI = function(a) {
        if (null === a) return "";
        var b = this.cn;
        if ("" === b) return "";
        a = D.xb(a, b);
        return void 0 === a ? "" : a
    };
    Y.prototype.setFromPortIdForLinkData = Y.prototype.ZB = function(a, b) {
        D.h(b, "string", Y, "setFromPortIdForLinkData:portname");
        if (null !== a) {
            var c = this.cn;
            if ("" !== c)
                if (this.Lh(a)) {
                    var d = D.xb(a, c);
                    void 0 === d && (d = "");
                    d !== b && (D.Ua(a, c, b), ah(this, "linkFromPortId", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
                } else D.Ua(a, c, b)
        }
    };
    D.defineProperty(Y, { Vu: "linkToPortIdProperty" }, function() { return this.dn }, function(a) {
        var b = this.dn;
        b !== a && (bh(a, Y, "linkToPortIdProperty"), a !== this.co && a !== this.eo || D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: " + a), this.dn = a, this.i("linkToPortIdProperty", b, a))
    });
    Y.prototype.getToPortIdForLinkData = Y.prototype.YI = function(a) {
        if (null === a) return "";
        var b = this.dn;
        if ("" === b) return "";
        a = D.xb(a, b);
        return void 0 === a ? "" : a
    };
    Y.prototype.setToPortIdForLinkData = Y.prototype.eC = function(a, b) {
        D.h(b, "string", Y, "setToPortIdForLinkData:portname");
        if (null !== a) {
            var c = this.dn;
            if ("" !== c)
                if (this.Lh(a)) {
                    var d = D.xb(a, c);
                    void 0 === d && (d = "");
                    d !== b && (D.Ua(a, c, b), ah(this, "linkToPortId", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
                } else D.Ua(a, c, b)
        }
    };
    D.defineProperty(Y, { Uu: "linkLabelKeysProperty" }, function() { return this.Kg }, function(a) {
        var b = this.Kg;
        b !== a && (bh(a, Y, "linkLabelKeysProperty"), this.Kg = a, this.i("linkLabelKeysProperty", b, a))
    });
    Y.prototype.getLabelKeysForLinkData = Y.prototype.$k = function(a) {
        if (null === a) return D.Do;
        var b = this.Kg;
        if ("" === b) return D.Do;
        a = D.xb(a, b);
        return void 0 === a ? D.Do : a
    };
    Y.prototype.setLabelKeysForLinkData = Y.prototype.dH = function(a, b) {
        D.gu(b, Y, "setLabelKeysForLinkData:arr");
        if (null !== a) {
            var c = this.Kg;
            if ("" !== c)
                if (this.Lh(a)) {
                    var d = D.xb(a, c);
                    void 0 === d && (d = D.Do);
                    if (d !== b) {
                        for (var e = D.cb(d), g = 0; g < e; g++) {
                            var h = D.La(d, g);
                            hh(this, h, a)
                        }
                        D.Ua(a, c, b);
                        e = D.cb(b);
                        for (g = 0; g < e; g++) h = D.La(b, g), null === this.Ie(h) && gh(this, h, a);
                        ah(this, "linkLabelKeys", fg, c, a, d, b);
                        "string" === typeof c && this.Ob(a, c)
                    }
                } else D.Ua(a, c, b)
        }
    };
    Y.prototype.addLabelKeyForLinkData = Y.prototype.VE = function(a, b) {
        if (null !== b && void 0 !== b && (ch(b) || D.kc(b, "number or string", Y, "addLabelKeyForLinkData:key"), null !== a)) {
            var c = this.Kg;
            if ("" !== c) {
                var d = D.xb(a, c);
                if (void 0 === d) c = [], c.push(b), this.dH(a, c);
                else if (D.isArray(d)) {
                    var e = D.hm(d, b);
                    0 <= e || (e = D.cb(d), D.Ih(d, Infinity, b), this.Lh(a) && (null === this.Ie(b) && gh(this, b, a), ah(this, "linkLabelKeys", hg, c, a, null, b, null, e)))
                } else D.k(c + " property is not an Array; cannot addLabelKeyForLinkData: " + a)
            }
        }
    };
    Y.prototype.removeLabelKeyForLinkData = Y.prototype.eK = function(a, b) {
        if (null !== b && void 0 !== b && (ch(b) || D.kc(b, "number or string", Y, "removeLabelKeyForLinkData:key"), null !== a)) {
            var c = this.Kg;
            if ("" !== c) {
                var d = D.xb(a, c);
                if (D.isArray(d)) {
                    var e = D.hm(d, b);
                    0 > e || (D.Vg(d, e), this.Lh(a) && (hh(this, b, a), ah(this, "linkLabelKeys", ig, c, a, b, null, e, null)))
                } else void 0 !== d && D.k(c + " property is not an Array; cannot removeLabelKeyforLinkData: " + a)
            }
        }
    };
    D.defineProperty(Y, { $g: "linkDataArray" }, function() { return this.df }, function(a) {
        var b = this.df;
        if (b !== a) {
            D.gu(a, Y, "linkDataArray");
            this.td.clear();
            for (var c = D.cb(a), d = 0; d < c; d++) {
                var e = D.La(a, d);
                if (!D.Qa(e)) { D.k("GraphLinksModel.linkDataArray must only contain Objects, not: " + e); return }
                D.sq(e)
            }
            this.df = a;
            if ("" !== this.Tj) {
                for (var g = new K(Object), d = 0; d < c; d++) {
                    var e = D.La(a, d),
                        h = this.mf(e);
                    void 0 === h ? g.add(e) : null !== this.td.oa(h) ? g.add(e) : this.td.add(h, e)
                }
                for (d = g.j; d.next();) e = d.value, this.vy(e), g = this.mf(e),
                    void 0 !== g && this.td.add(g, e)
            }
            g = new L(Object);
            for (d = 0; d < c; d++) e = D.La(a, d), g.add(e);
            this.ki = g;
            ah(this, "linkDataArray", fg, "linkDataArray", this, b, a);
            for (d = 0; d < c; d++) e = D.La(a, d), mh(this, e)
        }
    });
    D.defineProperty(Y, { Tj: "linkKeyProperty" }, function() { return this.Ol }, function(a) {
        var b = this.Ol;
        if (b !== a) {
            bh(a, Y, "linkKeyProperty");
            this.Ol = a;
            this.td.clear();
            for (var c = D.cb(this.$g), d = 0; d < c; d++) {
                var e = D.La(this.$g, d),
                    g = this.mf(e);
                void 0 === g && (this.vy(e), g = this.mf(e));
                void 0 !== g && this.td.add(g, e)
            }
            this.i("linkKeyProperty", b, a)
        }
    });
    Y.prototype.getKeyForLinkData = Y.prototype.mf = function(a) {
        if (null !== a) {
            var b = this.Ol;
            if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
                if (ch(b)) return b;
                D.k("Key value for link data " + a + " is not a number or a string: " + b)
            }
        }
    };
    Y.prototype.setKeyForLinkData = Y.prototype.cH = function(a, b) {
        void 0 !== b && null !== b && ch(b) || D.kc(b, "number or string", Y, "setKeyForLinkData:key");
        if (null !== a) {
            var c = this.Ol;
            if ("" !== c)
                if (this.Lh(a)) {
                    var d = D.xb(a, c);
                    d !== b && null === this.oq(b) && (D.Ua(a, c, b), this.td.remove(d), this.td.add(b, a), ah(this, "linkKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
                } else D.Ua(a, c, b)
        }
    };
    D.defineProperty(Y, { cM: "makeUniqueLinkKeyFunction" }, function() { return this.wp }, function(a) {
        var b = this.wp;
        b !== a && (null !== a && D.h(a, "function", Y, "makeUniqueLinkKeyFunction"), this.wp = a, this.i("makeUniqueLinkKeyFunction", b, a))
    });
    Y.prototype.findLinkDataForKey = Y.prototype.oq = function(a) { null === a && D.k("GraphLinksModel.findLinkDataForKey:key must not be null"); return void 0 !== a && ch(a) ? this.td.oa(a) : null };
    Y.prototype.makeLinkDataKeyUnique = Y.prototype.vy = function(a) {
        if (null !== a) {
            var b = this.Ol;
            if ("" !== b) {
                var c = this.mf(a);
                if (void 0 === c || this.td.contains(c)) {
                    var d = this.wp;
                    if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.td.contains(c))) { D.Ua(a, b, c); return }
                    if ("string" === typeof c) {
                        for (d = 2; this.td.contains(c + d);) d++;
                        D.Ua(a, b, c + d)
                    } else if (void 0 === c || "number" === typeof c) {
                        for (d = -this.td.count - 1; this.td.contains(d);) d--;
                        D.Ua(a, b, d)
                    } else D.k("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: " +
                        c)
                }
            }
        }
    };
    Y.prototype.containsLinkData = Y.prototype.Lh = function(a) { return null === a ? !1 : this.ki.contains(a) };
    Y.prototype.addLinkData = Y.prototype.au = function(a) { null !== a && (D.sq(a), this.Lh(a) || nh(this, a, !0)) };

    function nh(a, b, c) {
        if ("" !== a.Tj) {
            var d = a.mf(b);
            if (void 0 !== d && a.td.oa(d) === b) return;
            a.vy(b);
            d = a.mf(b);
            if (void 0 === d) { D.k("GraphLinksModel.makeLinkDataKeyUnique failed on " + b + ". Data not added to model."); return }
            a.td.add(d, b)
        }
        a.ki.add(b);
        d = null;
        c && (d = D.cb(a.df), D.Ih(a.df, d, b));
        ah(a, "linkDataArray", hg, "linkDataArray", a, null, b, null, d);
        mh(a, b)
    }
    Y.prototype.addLinkDataCollection = function(a) {
        if (D.isArray(a))
            for (var b = D.cb(a), c = 0; c < b; c++) this.au(D.La(a, c));
        else
            for (a = a.j; a.next();) this.au(a.value)
    };
    Y.prototype.removeLinkData = Y.prototype.Jy = function(a) { null !== a && oh(this, a, !0) };

    function oh(a, b, c) {
        a.ki.remove(b);
        var d = a.mf(b);
        void 0 !== d && a.td.remove(d);
        d = null;
        if (c) {
            d = D.hm(a.df, b);
            if (0 > d) return;
            D.Vg(a.df, d)
        }
        ah(a, "linkDataArray", ig, "linkDataArray", a, b, null, d, null);
        c = a.tm(b);
        hh(a, c, b);
        c = a.um(b);
        hh(a, c, b);
        d = a.$k(b);
        if (D.isArray(d))
            for (var e = D.cb(d), g = 0; g < e; g++) c = D.La(d, g), hh(a, c, b)
    }
    Y.prototype.removeLinkDataCollection = function(a) {
        if (D.isArray(a))
            for (var b = D.cb(a), c = 0; c < b; c++) this.Jy(D.La(a, c));
        else
            for (a = a.j; a.next();) this.Jy(a.value)
    };

    function mh(a, b) {
        var c = a.tm(b),
            c = a.fo(c);
        null === a.Ie(c) && gh(a, c, b);
        c = a.um(b);
        c = a.fo(c);
        null === a.Ie(c) && gh(a, c, b);
        var d = a.$k(b);
        if (D.isArray(d))
            for (var e = D.cb(d), g = 0; g < e; g++) c = D.La(d, g), null === a.Ie(c) && gh(a, c, b)
    }
    D.defineProperty(Y, { tL: "copyLinkDataFunction" }, function() { return this.Oo }, function(a) {
        var b = this.Oo;
        b !== a && (null !== a && D.h(a, "function", Y, "copyLinkDataFunction"), this.Oo = a, this.i("copyLinkDataFunction", b, a))
    });
    Y.prototype.copyLinkData = Y.prototype.Kx = function(a) {
        if (null === a) return null;
        var b = null,
            b = this.Oo,
            b = null !== b ? b(a, this) : ih(this, a, !0);
        D.Qa(b) && (D.xc(b), "" !== this.li && D.Ua(b, this.li, void 0), "" !== this.mi && D.Ua(b, this.mi, void 0), "" !== this.Kg && D.Ua(b, this.Kg, []));
        return b
    };
    D.defineProperty(Y, { Iq: "nodeIsGroupProperty" }, function() { return this.zp }, function(a) {
        var b = this.zp;
        b !== a && (bh(a, Y, "nodeIsGroupProperty"), this.zp = a, this.i("nodeIsGroupProperty", b, a))
    });
    Y.prototype.isGroupForNodeData = Y.prototype.sB = function(a) { if (null === a) return !1; var b = this.zp; return "" === b ? !1 : D.xb(a, b) ? !0 : !1 };
    D.defineProperty(Y, { bv: "nodeGroupKeyProperty" }, function() { return this.Ah }, function(a) {
        var b = this.Ah;
        b !== a && (bh(a, Y, "nodeGroupKeyProperty"), this.Ah = a, this.i("nodeGroupKeyProperty", b, a))
    });
    D.defineProperty(Y, { Jn: "copiesGroupKeyOfNodeData" }, function() { return this.Br }, function(a) { this.Br !== a && (D.h(a, "boolean", Y, "copiesGroupKeyOfNodeData"), this.Br = a) });
    Y.prototype.getGroupKeyForNodeData = Y.prototype.Sn = function(a) {
        if (null !== a) {
            var b = this.Ah;
            if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
                if (ch(b)) return b;
                D.k("GroupKey value for node data " + a + " is not a number or a string: " + b)
            }
        }
    };
    Y.prototype.setGroupKeyForNodeData = Y.prototype.$B = function(a, b) {
        null === b && (b = void 0);
        void 0 === b || ch(b) || D.kc(b, "number or string", Y, "setGroupKeyForNodeData:key");
        if (null !== a) {
            var c = this.Ah;
            if ("" !== c)
                if (this.ke(a)) {
                    var d = D.xb(a, c);
                    d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "nodeGroupKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
                } else D.Ua(a, c, b)
        }
    };
    Y.prototype.copyNodeData = function(a) {
        if (null === a) return null;
        a = M.prototype.copyNodeData.call(this, a);
        this.Jn || "" === this.Ah || void 0 === D.xb(a, this.Ah) || D.Ua(a, this.Ah, void 0);
        return a
    };
    Y.prototype.setDataProperty = function(a, b, c) {
        v && (D.h(a, "object", Y, "setDataProperty:data"), D.h(b, "string", Y, "setDataProperty:propname"), "" === b && D.k("GraphLinksModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
        if (this.ke(a))
            if (b === this.Vj) this.Ty(a, c);
            else {
                if (b === this.oo) { this.Ry(a, c); return }
                if (b === this.bv) { this.$B(a, c); return }
                b === this.Iq && D.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: " + b)
            }
        else if (this.Lh(a)) {
            if (b ===
                this.co) { this.YB(a, c); return }
            if (b === this.eo) { this.dC(a, c); return }
            if (b === this.Tu) { this.ZB(a, c); return }
            if (b === this.Vu) { this.eC(a, c); return }
            if (b === this.Tj) { this.cH(a, c); return }
            if (b === this.Su) { this.bH(a, c); return }
            if (b === this.Uu) { this.dH(a, c); return }
        } else !lh && a instanceof O && (lh = !0, D.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), D.trace("  Is that really your intent?"));
        var d = D.xb(a, b);
        d !== c && (D.Ua(a, b, c), this.MB(a, b, d, c))
    };
    f = Y.prototype;
    f.hv = function(a, b) {
        M.prototype.hv.call(this, a, b);
        for (var c = this.Kc.j; c.next();) this.SB(c.value, a, b);
        for (c = this.ki.j; c.next();) {
            var d = c.value,
                e = a,
                g = b;
            if (this.tm(d) === e) {
                var h = this.li;
                D.Ua(d, h, g);
                ah(this, "linkFromKey", fg, h, d, e, g);
                "string" === typeof h && this.Ob(d, h)
            }
            this.um(d) === e && (h = this.mi, D.Ua(d, h, g), ah(this, "linkToKey", fg, h, d, e, g), "string" === typeof h && this.Ob(d, h));
            h = this.$k(d);
            if (D.isArray(h))
                for (var k = D.cb(h), l = this.Kg, m = 0; m < k; m++) D.La(h, m) === e && (D.cF(h, m, g), ah(this, "linkLabelKeys", hg, l, d, e, g, m,
                    m))
        }
    };
    f.SB = function(a, b, c) {
        if (this.Sn(a) === b) {
            var d = this.Ah;
            D.Ua(a, d, c);
            ah(this, "nodeGroupKey", fg, d, a, b, c);
            "string" === typeof d && this.Ob(a, d)
        }
    };
    f.sC = function() {
        M.prototype.sC.call(this);
        for (var a = this.$g, b = D.cb(a), c = 0; c < b; c++) {
            var d = D.La(a, c);
            mh(this, d)
        }
    };
    f.Qq = function(a) {
        M.prototype.Qq.call(this, a);
        a = this.zb(a);
        var b = fh(this, a);
        if (null !== b) {
            for (var c = new K(Object), b = b.j; b.next();) {
                var d = b.value;
                if (this.ke(d)) {
                    if (this.Sn(d) === a) {
                        var e = this.Ah;
                        ah(this, "nodeGroupKey", fg, e, d, a, a);
                        "string" === typeof e && this.Ob(d, e);
                        c.add(d)
                    }
                } else if (this.tm(d) === a && (e = this.li, ah(this, "linkFromKey", fg, e, d, a, a), "string" === typeof e && this.Ob(d, e), c.add(d)), this.um(d) === a && (e = this.mi, ah(this, "linkToKey", fg, e, d, a, a), "string" === typeof e && this.Ob(d, e), c.add(d)), e = this.$k(d), D.isArray(e))
                    for (var g =
                            D.cb(e), h = this.Kg, k = 0; k < g; k++) D.La(e, k) === a && (ah(this, "linkLabelKeys", hg, h, d, a, a, k, k), c.add(d))
            }
            for (c = c.j; c.next();) hh(this, a, c.value)
        }
    };
    f.Pq = function(a) {
        M.prototype.Pq.call(this, a);
        var b = this.Sn(a);
        null === this.Ie(b) && gh(this, b, a)
    };
    f.wv = function(a) {
        M.prototype.wv.call(this, a);
        var b = this.Sn(a);
        hh(this, b, a)
    };
    D.defineProperty(Y, { Su: "linkCategoryProperty" }, function() { return this.bn }, function(a) {
        var b = this.bn;
        b !== a && (bh(a, Y, "linkCategoryProperty"), this.bn = a, this.i("linkCategoryProperty", b, a))
    });
    Y.prototype.getCategoryForLinkData = Y.prototype.Bu = function(a) {
        if (null === a) return "";
        var b = this.bn;
        if ("" === b) return "";
        b = D.xb(a, b);
        if (void 0 === b) return "";
        if ("string" === typeof b) return b;
        D.k("getCategoryForLinkData found a non-string category for " + a + ": " + b);
        return ""
    };
    Y.prototype.setCategoryForLinkData = Y.prototype.bH = function(a, b) {
        D.h(b, "string", Y, "setCategoryForLinkData:cat");
        if (null !== a) {
            var c = this.bn;
            if ("" !== c)
                if (this.Lh(a)) {
                    var d = D.xb(a, c);
                    void 0 === d && (d = "");
                    d !== b && (D.Ua(a, c, b), ah(this, "linkCategory", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
                } else D.Ua(a, c, b)
        }
    };

    function Bg(a) {
        1 < arguments.length && D.k("TreeModel constructor can only take one optional argument, the Array of node data.");
        M.call(this);
        this.Bh = "parent";
        this.Cr = !1;
        this.ln = "parentLinkCategory";
        void 0 !== a && (this.qg = a)
    }
    D.Ta(Bg, M);
    D.ka("TreeModel", Bg);
    Bg.prototype.cloneProtected = function(a) {
        M.prototype.cloneProtected.call(this, a);
        a.Bh = this.Bh;
        a.Cr = this.Cr;
        a.ln = this.ln
    };
    Bg.prototype.toString = function(a) {
        void 0 === a && (a = 0);
        if (2 <= a) return this.kC();
        var b = ("" !== this.name ? this.name : "") + " TreeModel";
        if (0 < a) {
            b += "\n node data:";
            a = this.qg;
            for (var c = D.cb(a), d = 0; d < c; d++) var e = D.La(a, d),
                b = b + (" " + this.zb(e) + ":" + ia(e))
        }
        return b
    };
    Bg.prototype.Ao = function() {
        var a = M.prototype.Ao.call(this),
            b = "";
        "parent" !== this.cv && "string" === typeof this.cv && (b += ',\n  "nodeParentKeyProperty": ' + this.quote(this.cv));
        return a + b
    };
    Bg.prototype.fv = function(a) {
        M.prototype.fv.call(this, a);
        a.nodeParentKeyProperty && (this.cv = a.nodeParentKeyProperty)
    };
    Bg.prototype.fo = function(a) { return a };
    D.defineProperty(Bg, { cv: "nodeParentKeyProperty" }, function() { return this.Bh }, function(a) {
        var b = this.Bh;
        b !== a && (bh(a, Bg, "nodeParentKeyProperty"), this.Bh = a, this.i("nodeParentKeyProperty", b, a))
    });
    D.defineProperty(Bg, { Kn: "copiesParentKeyOfNodeData" }, function() { return this.Cr }, function(a) { this.Cr !== a && (D.h(a, "boolean", Bg, "copiesParentKeyOfNodeData"), this.Cr = a) });
    Bg.prototype.getParentKeyForNodeData = Bg.prototype.Un = function(a) {
        if (null !== a) {
            var b = this.Bh;
            if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
                if (ch(b)) return b;
                D.k("ParentKey value for node data " + a + " is not a number or a string: " + b)
            }
        }
    };
    Bg.prototype.setParentKeyForNodeData = Bg.prototype.Ii = function(a, b) {
        null === b && (b = void 0);
        void 0 === b || ch(b) || D.kc(b, "number or string", Bg, "setParentKeyForNodeData:key");
        if (null !== a) {
            var c = this.Bh;
            if ("" !== c)
                if (b = this.fo(b), this.ke(a)) {
                    var d = D.xb(a, c);
                    d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "nodeParentKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
                } else D.Ua(a, c, b)
        }
    };
    D.defineProperty(Bg, { wM: "parentLinkCategoryProperty" }, function() { return this.ln }, function(a) {
        var b = this.ln;
        b !== a && (bh(a, Bg, "parentLinkCategoryProperty"), this.ln = a, this.i("parentLinkCategoryProperty", b, a))
    });
    Bg.prototype.getParentLinkCategoryForNodeData = Bg.prototype.WI = function(a) {
        if (null === a) return "";
        var b = this.ln;
        if ("" === b) return "";
        b = D.xb(a, b);
        if (void 0 === b) return "";
        if ("string" === typeof b) return b;
        D.k("getParentLinkCategoryForNodeData found a non-string category for " + a + ": " + b);
        return ""
    };
    Bg.prototype.setParentLinkCategoryForNodeData = Bg.prototype.rK = function(a, b) {
        D.h(b, "string", Bg, "setParentLinkCategoryForNodeData:cat");
        if (null !== a) {
            var c = this.ln;
            if ("" !== c)
                if (this.ke(a)) {
                    var d = D.xb(a, c);
                    void 0 === d && (d = "");
                    d !== b && (D.Ua(a, c, b), ah(this, "parentLinkCategory", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
                } else D.Ua(a, c, b)
        }
    };
    Bg.prototype.copyNodeData = function(a) {
        if (null === a) return null;
        a = M.prototype.copyNodeData.call(this, a);
        this.Kn || "" === this.Bh || void 0 === D.xb(a, this.Bh) || D.Ua(a, this.Bh, void 0);
        return a
    };
    Bg.prototype.setDataProperty = function(a, b, c) {
        v && (D.h(a, "object", Bg, "setDataProperty:data"), D.h(b, "string", Bg, "setDataProperty:propname"), "" === b && D.k("TreeModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
        if (this.ke(a))
            if (b === this.Vj) this.Ty(a, c);
            else { if (b === this.oo) { this.Ry(a, c); return } if (b === this.cv) { this.Ii(a, c); return } }
        else !lh && a instanceof O && (lh = !0, D.trace('TreeModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), D.trace("  Is that really your intent?"));
        var d = D.xb(a, b);
        d !== c && (D.Ua(a, b, c), this.MB(a, b, d, c))
    };
    f = Bg.prototype;
    f.hv = function(a, b) { M.prototype.hv.call(this, a, b); for (var c = this.Kc.j; c.next();) this.SB(c.value, a, b) };
    f.SB = function(a, b, c) {
        if (this.Un(a) === b) {
            var d = this.Bh;
            D.Ua(a, d, c);
            ah(this, "nodeParentKey", fg, d, a, b, c);
            "string" === typeof d && this.Ob(a, d)
        }
    };
    f.Qq = function(a) {
        M.prototype.Qq.call(this, a);
        a = this.zb(a);
        var b = fh(this, a);
        if (null !== b) {
            for (var c = new K(Object), b = b.j; b.next();) {
                var d = b.value;
                if (this.ke(d) && this.Un(d) === a) {
                    var e = this.Bh;
                    ah(this, "nodeParentKey", fg, e, d, a, a);
                    "string" === typeof e && this.Ob(d, e);
                    c.add(d)
                }
            }
            for (c = c.j; c.next();) hh(this, a, c.value)
        }
    };
    f.Pq = function(a) {
        M.prototype.Pq.call(this, a);
        var b = this.Un(a),
            b = this.fo(b);
        null === this.Ie(b) && gh(this, b, a)
    };
    f.wv = function(a) {
        M.prototype.wv.call(this, a);
        var b = this.Un(a);
        hh(this, b, a)
    };

    function ph(a, b, c) {
        D.xc(this);
        this.J = !1;
        void 0 === a ? a = "" : D.h(a, "string", ph, "constructor:targetprop");
        void 0 === b ? b = a : D.h(b, "string", ph, "constructor:sourceprop");
        void 0 === c ? c = null : null !== c && D.h(c, "function", ph, "constructor:conv");
        this.xE = -1;
        this.Sg = null;
        this.Up = a;
        this.Tp = this.Pt = 0;
        this.jx = null;
        this.us = !1;
        this.Kp = b;
        this.yr = c;
        this.Os = qh;
        this.rr = null;
        this.Pz = new L
    }
    D.ka("Binding", ph);
    ph.prototype.copy = function() {
        var a = new ph;
        a.Up = this.Up;
        a.Pt = this.Pt;
        a.Tp = this.Tp;
        a.jx = this.jx;
        a.us = this.us;
        a.Kp = this.Kp;
        a.yr = this.yr;
        a.Os = this.Os;
        a.rr = this.rr;
        return a
    };
    var qh;
    ph.OneWay = qh = D.s(ph, "OneWay", 1);
    var rh;
    ph.TwoWay = rh = D.s(ph, "TwoWay", 2);
    ph.parseEnum = function(a, b) {
        D.h(a, "function", ph, "parseEnum:ctor");
        D.Da(b, a, ph, "parseEnum:defval");
        return function(c) { c = Ha(a, c); return null === c ? b : c }
    };
    ph.prototype.qc = function(a) { a.Qe === ph ? this.mode = a : D.ak(this, a) };
    var ia;
    ph.toString = ia = function(a) {
        var b = a;
        D.Qa(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()
    };
    ph.prototype.toString = function() { return "Binding(" + this.tv + ":" + this.gH + (-1 !== this.Fm ? " " + this.Fm : "") + " " + this.mode.name + ")" };
    ph.prototype.freeze = function() { this.J = !0; return this };
    ph.prototype.Xa = function() { this.J = !1; return this };
    D.defineProperty(ph, { Fm: null }, function() { return this.xE }, function(a) {
        this.J && D.qa(this);
        D.h(a, "number", ph, "targetId");
        this.xE = a
    });
    D.defineProperty(ph, { tv: "targetProperty" }, function() { return this.Up }, function(a) {
        this.J && D.qa(this);
        D.h(a, "string", ph, "targetProperty");
        this.Up = a
    });
    D.defineProperty(ph, { $q: "sourceName" }, function() { return this.jx }, function(a) {
        this.J && D.qa(this);
        null !== a && D.h(a, "string", ph, "sourceName");
        this.jx = a;
        null !== a && (this.us = !1)
    });
    D.defineProperty(ph, { ly: "isToModel" }, function() { return this.us }, function(a) {
        this.J && D.qa(this);
        D.h(a, "boolean", ph, "isToModel");
        this.us = a
    });
    D.defineProperty(ph, { gH: "sourceProperty" }, function() { return this.Kp }, function(a) {
        this.J && D.qa(this);
        D.h(a, "string", ph, "sourceProperty");
        this.Kp = a
    });
    D.defineProperty(ph, { pI: "converter" }, function() { return this.yr }, function(a) {
        this.J && D.qa(this);
        null !== a && D.h(a, "function", ph, "converter");
        this.yr = a
    });
    D.defineProperty(ph, { eI: "backConverter" }, function() { return this.rr }, function(a) {
        this.J && D.qa(this);
        null !== a && D.h(a, "function", ph, "backConverter");
        this.rr = a
    });
    D.defineProperty(ph, { mode: "mode" }, function() { return this.Os }, function(a) {
        this.J && D.qa(this);
        D.Da(a, ph, ph, "mode");
        this.Os = a
    });
    ph.prototype.makeTwoWay = ph.prototype.GJ = function(a) {
        void 0 === a && (a = null);
        null !== a && D.h(a, "function", ph, "makeTwoWay");
        this.mode = rh;
        this.eI = a;
        return this
    };
    ph.prototype.ofObject = ph.prototype.yy = function(a) {
        void 0 === a && (a = "");
        v && D.h(a, "string", ph, "ofObject:srcname");
        this.$q = a;
        this.ly = !1;
        return this
    };
    ph.prototype.ofModel = function() {
        this.$q = null;
        this.ly = !0;
        return this
    };

    function sh(a, b, c) { a = a.$q; var d = null; return d = null === a || "" === a ? b : "/" === a ? c.Y : "." === a ? c : ".." === a ? c.R : b.Md(a) }
    ph.prototype.updateTarget = ph.prototype.wH = function(a, b, c) {
        var d = this.Kp;
        if (void 0 === c || "" === d || d === c) {
            c = this.Up;
            var e = this.yr;
            if (null === e && "" === c) D.trace("Binding error: target property is the empty string: " + this.toString());
            else {
                v && "string" === typeof c && ("function" !== typeof a.setAttribute && 0 < c.length && "_" !== c[0] && !D.by(a, c) ? D.trace("Binding error: undefined target property: " + c + " on " + a.toString()) : "name" === c && a instanceof O && D.trace("Binding error: cannot modify GraphObject.name on " + a.toString()));
                var g = b;
                "" !== d && (g = D.xb(b, d));
                if (void 0 !== g)
                    if (null === e) "" !== c && D.Ua(a, c, g);
                    else try {
                        if ("" !== c) {
                            var h = e(g, a);
                            v && void 0 === h && D.trace('Binding warning: conversion function returned undefined when setting target property "' + c + '" on ' + a.toString() + ", function is: " + e);
                            D.Ua(a, c, h)
                        } else e(g, a)
                    } catch (k) { v && D.trace("Binding error: " + k.toString() + ' setting target property "' + c + '" on ' + a.toString() + " with conversion function: " + e) }
            }
        }
    };
    ph.prototype.updateSource = ph.prototype.Wy = function(a, b, c, d) {
        if (this.Os === rh) {
            var e = this.Up;
            if (void 0 === c || e === c) {
                c = this.Kp;
                var g = this.rr,
                    h = a;
                "" !== e && (h = D.xb(a, e));
                if (void 0 !== h && !this.Pz.contains(a)) try {
                    this.Pz.add(a);
                    var k = null !== d ? d.g : null,
                        l = null !== k ? k.ea : null;
                    if (null === g)
                        if ("" !== c) null !== l ? (v && l.Vj === c && l.ke(b) && D.trace("Binding error: cannot have TwoWay Binding on node data key property: " + this.toString()), l.setDataProperty(b, c, h)) : D.Ua(b, c, h);
                        else {
                            if (null !== l && null !== d && 0 <= d.Qu && null !== d.R &&
                                Array.isArray(d.R.el)) {
                                var m = d.Qu,
                                    n = d.R.el;
                                l.IG(n, m);
                                l.mB(n, m, h)
                            }
                        }
                    else try {
                        if ("" !== c) {
                            var p = g(h, b, l);
                            null !== l ? (v && (l.Vj === c && l.ke(b) && D.trace("Binding error: cannot have TwoWay Binding on node data key property: " + this.toString()), void 0 === p && D.trace('Binding warning: conversion function returned undefined when setting source property "' + c + '" on ' + b.toString() + ", function is: " + g)), l.setDataProperty(b, c, p)) : D.Ua(b, c, p)
                        } else p = g(h, b, l), void 0 !== p && null !== l && null !== d && 0 <= d.Qu && null !== d.R && Array.isArray(d.R.el) &&
                            (m = d.Qu, n = d.R.el, l.IG(n, m), l.mB(n, m, p))
                    } catch (q) { v && D.trace("Binding error: " + q.toString() + ' setting source property "' + c + '" on ' + b.toString() + " with conversion function: " + g) }
                } finally { this.Pz.remove(a) }
            }
        }
    };

    function Cg() {
        this.CH = (new K(eg)).freeze();
        this.$b = "";
        this.DD = !1
    }
    D.ka("Transaction", Cg);
    Cg.prototype.toString = function(a) {
        var b = "Transaction: " + this.name + " " + this.fg.count.toString() + (this.Iu ? "" : ", incomplete");
        if (void 0 !== a && 0 < a) {
            a = this.fg.count;
            for (var c = 0; c < a; c++) {
                var d = this.fg.fa(c);
                null !== d && (b += "\n  " + d.toString())
            }
        }
        return b
    };
    Cg.prototype.clear = Cg.prototype.clear = function() {
        var a = this.fg;
        a.Xa();
        for (var b = a.count - 1; 0 <= b; b--) {
            var c = a.fa(b);
            null !== c && c.clear()
        }
        a.clear();
        a.freeze()
    };
    Cg.prototype.canUndo = Cg.prototype.canUndo = function() { return this.Iu };
    Cg.prototype.undo = Cg.prototype.undo = function() {
        if (this.canUndo())
            for (var a = this.fg.count - 1; 0 <= a; a--) {
                var b = this.fg.fa(a);
                null !== b && b.undo()
            }
    };
    Cg.prototype.canRedo = Cg.prototype.canRedo = function() { return this.Iu };
    Cg.prototype.redo = Cg.prototype.redo = function() {
        if (this.canRedo())
            for (var a = this.fg.count, b = 0; b < a; b++) {
                var c = this.fg.fa(b);
                null !== c && c.redo()
            }
    };
    D.w(Cg, { fg: "changes" }, function() { return this.CH });
    D.defineProperty(Cg, { name: "name" }, function() { return this.$b }, function(a) { this.$b = a });
    D.defineProperty(Cg, { Iu: "isComplete" }, function() { return this.DD }, function(a) { this.DD = a });

    function tg() {
        this.eA = new L(M);
        this.rf = !1;
        this.GH = (new K(Cg)).freeze();
        this.rh = -1;
        this.SD = 999;
        this.uh = !1;
        this.Xv = null;
        this.am = 0;
        this.uz = !1;
        v && (this.uz = !0);
        this.zh = (new K("string")).freeze();
        this.yp = new K("number");
        this.Qz = !0;
        this.$z = !1
    }
    D.ka("UndoManager", tg);
    tg.prototype.toString = function(a) {
        for (var b = "UndoManager " + this.Lj + "<" + this.history.count + "<=" + this.vG, b = b + "[", c = this.AG.count, d = 0; d < c; d++) 0 < d && (b += " "), b += this.AG.fa(d);
        b += "]";
        if (void 0 !== a && 0 < a)
            for (c = this.history.count, d = 0; d < c; d++) b += "\n " + this.history.fa(d).toString(a - 1);
        return b
    };
    tg.prototype.clear = tg.prototype.clear = function() {
        var a = this.history;
        a.Xa();
        for (var b = a.count - 1; 0 <= b; b--) {
            var c = a.fa(b);
            null !== c && c.clear()
        }
        a.clear();
        this.rh = -1;
        a.freeze();
        this.uh = !1;
        this.Xv = null;
        this.am = 0;
        this.zh.Xa();
        this.zh.clear();
        this.zh.freeze();
        this.yp.clear()
    };
    tg.prototype.addModel = tg.prototype.YH = function(a) { this.eA.add(a) };
    tg.prototype.removeModel = tg.prototype.fK = function(a) { this.eA.remove(a) };
    tg.prototype.startTransaction = tg.prototype.Nb = function(a) {
        void 0 === a && (a = "");
        null === a && (a = "");
        if (this.ub) return !1;
        !0 === this.Qz && (this.Qz = !1, this.am++, this.vd("StartingFirstTransaction", a, this.Gj), 0 < this.am && this.am--);
        this.isEnabled && (this.zh.Xa(), this.zh.add(a), this.zh.freeze(), null === this.Gj ? this.yp.add(0) : this.yp.add(this.Gj.fg.count));
        this.am++;
        var b = 1 === this.Ki;
        b && this.vd("StartedTransaction", a, this.Gj);
        return b
    };
    tg.prototype.commitTransaction = tg.prototype.jd = function(a) { void 0 === a && (a = ""); return th(this, !0, a) };
    tg.prototype.rollbackTransaction = tg.prototype.Am = function() { return th(this, !1, "") };

    function th(a, b, c) {
        if (a.ub) return !1;
        a.IA && 1 > a.Ki && D.trace("Ending transaction without having started a transaction: " + c);
        var d = 1 === a.Ki;
        d && b && a.vd("CommittingTransaction", c, a.Gj);
        var e = 0;
        if (0 < a.Ki && (a.am--, a.isEnabled)) {
            var g = a.zh.count;
            0 < g && ("" === c && (c = a.zh.fa(0)), a.zh.Xa(), a.zh.pd(g - 1), a.zh.freeze());
            g = a.yp.count;
            0 < g && (e = a.yp.fa(g - 1), a.yp.pd(g - 1))
        }
        g = a.Gj;
        if (d) {
            if (b) {
                a.$z = !1;
                if (a.isEnabled && null !== g) {
                    b = g;
                    b.Iu = !0;
                    b.name = c;
                    d = a.history;
                    d.Xa();
                    for (e = d.count - 1; e > a.Lj; e--) g = d.fa(e), null !== g && g.clear(),
                        d.pd(e), a.$z = !0;
                    e = a.vG;
                    0 === e && (e = 1);
                    0 < e && d.count >= e && (g = d.fa(0), null !== g && g.clear(), d.pd(0), a.rh--);
                    d.add(b);
                    a.rh++;
                    d.freeze();
                    g = b
                }
                a.vd("CommittedTransaction", c, g)
            } else {
                a.uh = !0;
                try { a.isEnabled && null !== g && (g.Iu = !0, g.undo()) } finally { a.vd("RolledBackTransaction", c, g), a.uh = !1 }
                null !== g && g.clear()
            }
            a.Xv = null;
            return !0
        }
        if (a.isEnabled && !b && null !== g) {
            a = e;
            c = g.fg;
            for (b = c.count - 1; b >= a; b--) d = c.fa(b), null !== d && d.undo(), c.Xa(), c.pd(b);
            c.freeze()
        }
        return !1
    }
    tg.prototype.canUndo = tg.prototype.canUndo = function() { if (!this.isEnabled || 0 < this.Ki) return !1; var a = this.sH; return null !== a && a.canUndo() ? !0 : !1 };
    tg.prototype.undo = tg.prototype.undo = function() { if (this.canUndo()) { var a = this.sH; try { this.uh = !0, this.vd("StartingUndo", "Undo", a), this.rh--, a.undo() } catch (b) { D.trace("undo error: " + b.toString()) } finally { this.vd("FinishedUndo", "Undo", a), this.uh = !1 } } };
    tg.prototype.canRedo = tg.prototype.canRedo = function() { if (!this.isEnabled || 0 < this.Ki) return !1; var a = this.rH; return null !== a && a.canRedo() ? !0 : !1 };
    tg.prototype.redo = tg.prototype.redo = function() { if (this.canRedo()) { var a = this.rH; try { this.uh = !0, this.vd("StartingRedo", "Redo", a), this.rh++, a.redo() } catch (b) { D.trace("redo error: " + b.toString()) } finally { this.vd("FinishedRedo", "Redo", a), this.uh = !1 } } };
    tg.prototype.vd = function(a, b, c) {
        void 0 === c && (c = null);
        var d = new eg;
        d.Oc = gg;
        d.propertyName = a;
        d.object = c;
        d.oldValue = b;
        for (a = this.QJ; a.next();) b = a.value, d.ea = b, b.Gx(d)
    };
    tg.prototype.handleChanged = tg.prototype.ZF = function(a) {
        if (this.isEnabled && !this.ub && !this.skipsEvent(a)) {
            var b = this.Gj;
            null === b && (this.Xv = b = new Cg);
            var c = a.copy(),
                b = b.fg;
            b.Xa();
            b.add(c);
            b.freeze();
            this.IA && 0 >= this.Ki && !this.Qz && (a = a.g, null !== a && !1 === a.Zn || D.trace("Change not within a transaction: " + c.toString()))
        }
    };
    tg.prototype.skipsEvent = function(a) {
        if (null === a || 0 > a.Oc.value) return !0;
        a = a.object;
        if (a instanceof O) { if (a = a.layer, null !== a && a.Yc) return !0 } else if (a instanceof Hg && a.Yc) return !0;
        return !1
    };
    D.w(tg, { QJ: "models" }, function() { return this.eA.j });
    D.defineProperty(tg, { isEnabled: "isEnabled" }, function() { return this.rf }, function(a) { this.rf = a });
    D.w(tg, { sH: "transactionToUndo" }, function() { return 0 <= this.Lj && this.Lj <= this.history.count - 1 ? this.history.fa(this.Lj) : null });
    D.w(tg, { rH: "transactionToRedo" }, function() { return this.Lj < this.history.count - 1 ? this.history.fa(this.Lj + 1) : null });
    D.w(tg, { ub: "isUndoingRedoing" }, function() { return this.uh });
    D.w(tg, { history: "history" }, function() { return this.GH });
    D.defineProperty(tg, { vG: "maxHistoryLength" }, function() { return this.SD }, function(a) { this.SD = a });
    D.w(tg, { Lj: "historyIndex" }, function() { return this.rh });
    D.w(tg, { Gj: "currentTransaction" }, function() { return this.Xv });
    D.w(tg, { Ki: "transactionLevel" }, function() { return this.am });
    D.w(tg, { jG: "isInTransaction" }, function() { return 0 < this.am });
    D.defineProperty(tg, { IA: "checksTransactionLevel" }, function() { return this.uz }, function(a) { this.uz = a });
    D.w(tg, { AG: "nestedTransactionNames" }, function() { return this.zh });

    function qa() {
        0 < arguments.length && D.zd(qa);
        D.xc(this);
        this.ca = null;
        this.QC = !1;
        this.kD = this.RC = !0;
        this.TC = this.UC = this.lD = this.VC = !1;
        this.Rl = this.nz = null;
        this.PE = 1.05;
        this.hD = 1;
        this.aA = NaN;
        this.PD = null;
        this.DA = NaN;
        this.CA = Ld;
        this.uj = null;
        this.nE = 0
    }
    D.ka("CommandHandler", qa);
    var Nh = null,
        Oh = "";
    qa.prototype.toString = function() { return "CommandHandler" };
    D.w(qa, { g: "diagram" }, function() { return this.ca });
    qa.prototype.ad = function(a) {
        v && null !== a && D.l(a, E, qa, "setDiagram");
        this.ca = a
    };
    qa.prototype.doKeyDown = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.U,
                c = D.Qh ? b.Xu : b.control,
                d = b.shift,
                e = b.alt,
                g = b.key;
            !c || "C" !== g && "Insert" !== g ? c && "X" === g || d && "Del" === g ? this.canCutSelection() && this.cutSelection() : c && "V" === g || d && "Insert" === g ? this.canPasteSelection() && this.pasteSelection() : c && "Y" === g || e && d && "Backspace" === g ? this.canRedo() && this.redo() : c && "Z" === g || e && "Backspace" === g ? this.canUndo() && this.undo() : "Del" === g || "Backspace" === g ? this.canDeleteSelection() && this.deleteSelection() : c && "A" === g ? this.canSelectAll() &&
                this.selectAll() : "Esc" === g ? this.canStopCommand() && this.stopCommand() : "Up" === g ? a.Ce && (c ? a.scroll("pixel", "up") : a.scroll("line", "up")) : "Down" === g ? a.Ce && (c ? a.scroll("pixel", "down") : a.scroll("line", "down")) : "Left" === g ? a.Be && (c ? a.scroll("pixel", "left") : a.scroll("line", "left")) : "Right" === g ? a.Be && (c ? a.scroll("pixel", "right") : a.scroll("line", "right")) : "PageUp" === g ? d && a.Be ? a.scroll("page", "left") : a.Ce && a.scroll("page", "up") : "PageDown" === g ? d && a.Be ? a.scroll("page", "right") : a.Ce && a.scroll("page", "down") : "Home" ===
                g ? c && a.Ce ? a.scroll("document", "up") : !c && a.Be && a.scroll("document", "left") : "End" === g ? c && a.Ce ? a.scroll("document", "down") : !c && a.Be && a.scroll("document", "right") : " " === g ? this.canScrollToPart() && this.scrollToPart() : "Subtract" === g ? this.canDecreaseZoom() && this.decreaseZoom() : "Add" === g ? this.canIncreaseZoom() && this.increaseZoom() : c && "0" === g ? this.canResetZoom() && this.resetZoom() : d && "Z" === g ? this.canZoomToFit() && this.zoomToFit() : c && !d && "G" === g ? this.canGroupSelection() && this.groupSelection() : c && d && "G" === g ? this.canUngroupSelection() &&
                this.ungroupSelection() : b.event && 113 === b.event.which ? this.canEditTextBlock() && this.editTextBlock() : b.event && 93 === b.event.which ? this.canShowContextMenu() && this.showContextMenu() : b.bubbles = !0 : this.canCopySelection() && this.copySelection()
        }
    };
    qa.prototype.doKeyUp = function() {
        var a = this.g;
        null !== a && (a.U.bubbles = !0)
    };
    qa.prototype.stopCommand = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.eb;
            b instanceof Ph && a.Jf && a.Ix();
            null !== b && b.doCancel()
        }
    };
    qa.prototype.canStopCommand = function() { return !0 };
    qa.prototype.selectAll = function() {
        var a = this.g;
        if (null !== a) {
            a.ra();
            try {
                a.sc = "wait";
                a.Ja("ChangingSelection");
                for (var b = a.Hi; b.next();) b.value.ib = !0;
                for (var c = a.rg; c.next();) c.value.ib = !0;
                for (var d = a.links; d.next();) d.value.ib = !0
            } finally { a.Ja("ChangedSelection"), a.sc = "" }
        }
    };
    qa.prototype.canSelectAll = function() { var a = this.g; return null !== a && a.Jf };
    qa.prototype.deleteSelection = function() {
        var a = this.g;
        if (null !== a && !a.Ja("SelectionDeleting", a.selection)) try {
            a.sc = "wait";
            a.Nb("Delete");
            a.Ja("ChangingSelection");
            for (var b = new L(F), c = a.selection.j; c.next();) Qh(b, c.value, !0, this.yI ? Infinity : 0, this.vF, function(a) { return a.canDelete() });
            a.RB(b, !0);
            a.Ja("SelectionDeleted", b)
        } finally { a.Ja("ChangedSelection"), a.jd("Delete"), a.sc = "" }
    };
    qa.prototype.canDeleteSelection = function() { var a = this.g; return null === a || a.qb || a.Mf || !a.Cn || 0 === a.selection.count ? !1 : !0 };

    function Qh(a, b, c, d, e, g) {
        void 0 === g && (g = null);
        if (!(a.contains(b) || null !== g && !g(b) || b instanceof da))
            if (a.add(b), b instanceof G) {
                if (c && b instanceof I)
                    for (var h = b.uc; h.next();) Qh(a, h.value, c, d, e, g);
                if (e)
                    for (h = b.Od; h.next();) {
                        var k = h.value;
                        if (!a.contains(k)) {
                            var l = k.$,
                                m = k.ba;
                            null !== l && a.contains(l) && null !== m && a.contains(m) ? Qh(a, k, c, d, e, g) : null !== l && null !== m || Qh(a, k, c, d, e, g)
                        }
                    }
                if (1 < d)
                    for (b = b.KF(); b.next();) Qh(a, b.value, c, d - 1, e, g)
            } else if (b instanceof J)
            for (b = b.Af; b.next();) Qh(a, b.value, c, d, e, g)
    }
    qa.prototype.hq = function(a, b, c) {
        var d = new oa(F, F);
        for (a = a.j; a.next();) Rh(this, a.value, b, d, c);
        if (null !== b) {
            c = b.ea;
            a = !1;
            null !== b.nb.Ge && (a = b.nb.Ge.Ij);
            for (var e = new L(J), g = new oa(J, J), h = d.j; h.next();) {
                var k = h.value;
                if (k instanceof J) {
                    var l = k;
                    a || null !== l.$ && null !== l.ba || e.add(l)
                } else if (c instanceof Bg && k instanceof G && null !== k.data) {
                    var l = c,
                        m = k,
                        k = h.key,
                        n = k.Yk();
                    null !== n && (n = d.oa(n), null !== n ? (l.Ii(m.data, l.zb(n.data)), l = b.gg(m.data), k = k.Qn(), null !== k && null !== l && g.add(k, l)) : l.Ii(m.data, void 0))
                }
            }
            0 < e.count &&
                b.RB(e, !1);
            if (0 < g.count)
                for (c = g.j; c.next();) d.add(c.key, c.value)
        }
        if (null !== b && null !== this.g && (b = b.ea, c = b.$H, null !== c)) {
            var p = new oa;
            d.each(function(a) { null !== a.key.data && p.add(a.key.data, a.value.data) });
            c(p, b, this.g.ea)
        }
        for (b = d.j; b.next();) b.value.Ob();
        return d
    };

    function Rh(a, b, c, d, e) {
        if (null === b || e && !b.canCopy()) return null;
        if (d.contains(b)) return d.oa(b);
        var g = null,
            h = b.data;
        if (null !== h && null !== c) {
            var k = c.ea;
            b instanceof J ? k instanceof Y && (h = k.Kx(h), D.Qa(h) && (k.au(h), g = c.gg(h))) : (h = k.copyNodeData(h), D.Qa(h) && (k.dm(h), g = c.Nh(h)))
        } else Sh(b), g = b.copy(), null !== g && (null !== c ? c.add(g) : null !== h && null !== a.g && a.qI && (k = a.g.ea, h = g instanceof J && k instanceof Y ? k.Kx(h) : k.copyNodeData(h), D.Qa(h) && (g.data = h)));
        if (!(g instanceof F)) return null;
        g.ib = !1;
        g.Zg = !1;
        d.add(b, g);
        if (b instanceof G) {
            for (h = b.Od; h.next();) {
                k = h.value;
                if (k.$ === b) {
                    var l = d.oa(k);
                    null !== l && (l.$ = g)
                }
                k.ba === b && (l = d.oa(k), null !== l && (l.ba = g))
            }
            if (b instanceof I && g instanceof I)
                for (h = g, b = b.uc; b.next();) k = Rh(a, b.value, c, d, e), k instanceof J || null === k || (k.Ka = h)
        } else if (b instanceof J && g instanceof J)
            for (h = b.$, null !== h && (h = d.oa(h), null !== h && (g.$ = h)), h = b.ba, null !== h && (h = d.oa(h), null !== h && (g.ba = h)), b = b.Af; b.next();) h = Rh(a, b.value, c, d, e), null !== h && h instanceof G && (h.Xb = g);
        return g
    }
    qa.prototype.copySelection = function() {
        var a = this.g;
        if (null !== a) {
            for (var b = new L(F), a = a.selection.j; a.next();) Qh(b, a.value, !0, this.tI ? Infinity : 0, this.rI, function(a) { return a.canCopy() });
            this.copyToClipboard(b)
        }
    };
    qa.prototype.canCopySelection = function() { var a = this.g; return null !== a && a.Pk && a.EA && 0 !== a.selection.count ? !0 : !1 };
    qa.prototype.cutSelection = function() {
        this.copySelection();
        this.deleteSelection()
    };
    qa.prototype.canCutSelection = function() { var a = this.g; return null !== a && !a.qb && !a.Mf && a.Pk && a.Cn && a.EA && 0 !== a.selection.count ? !0 : !1 };
    qa.prototype.copyToClipboard = function(a) {
        var b = this.g;
        if (null !== b) {
            var c = null;
            if (null === a) Nh = null, Oh = "";
            else {
                var c = b.ea,
                    d = !1,
                    e = !1,
                    g = null;
                try {
                    if (c instanceof Bg) {
                        var h = c,
                            d = h.Kn;
                        h.Kn = this.mF
                    }
                    c instanceof Y && (h = c, e = h.Jn, h.Jn = this.lF);
                    g = b.hq(a, null, !0)
                } finally { c instanceof Bg && (c.Kn = d), c instanceof Y && (c.Jn = e), c = new K(F), c.Vc(g), Nh = c, Oh = b.ea.nm }
            }
            b.Ja("ClipboardChanged", c)
        }
    };
    qa.prototype.pasteFromClipboard = function() {
        var a = new L(F),
            b = Nh;
        if (null === b) return a;
        var c = this.g;
        if (null === c || Oh !== c.ea.nm) return a;
        var d = c.ea,
            e = !1,
            g = !1,
            h = null;
        try {
            if (d instanceof Bg) {
                var k = d,
                    e = k.Kn;
                k.Kn = this.mF
            }
            d instanceof Y && (k = d, g = k.Jn, k.Jn = this.lF);
            h = c.hq(b, c, !1)
        } finally { for (d instanceof Bg && (d.Kn = e), d instanceof Y && (d.Jn = g), b = h.j; b.next();) c = b.value, d = b.key, c.location.H() || (d.location.H() ? c.location = d.location : !c.position.H() && d.position.H() && (c.position = d.position)), a.add(c) }
        return a
    };
    qa.prototype.pasteSelection = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null !== b) try {
            b.sc = "wait";
            b.Nb("Paste");
            b.Ja("ChangingSelection");
            var c = this.pasteFromClipboard();
            0 < c.count && Th(b);
            for (var d = c.j; d.next();) d.value.ib = !0;
            b.Ja("ChangedSelection");
            if (null !== a) {
                var e = b.computePartsBounds(b.selection);
                if (e.H()) {
                    var g = b.nb.Ge;
                    null === g && (g = new Uh, g.ad(b));
                    var h = g.computeEffectiveCollection(b.selection);
                    g.moveParts(h, new N(a.x - e.pa, a.y - e.va), !1)
                }
            }
            b.Ja("ClipboardPasted", c)
        } finally {
            b.jd("Paste"), b.sc =
                ""
        }
    };
    qa.prototype.canPasteSelection = function() { var a = this.g; return null === a || a.qb || a.Mf || !a.Zp || !a.EA || null === Nh || Oh !== a.ea.nm ? !1 : !0 };
    qa.prototype.undo = function() {
        var a = this.g;
        null !== a && a.na.undo()
    };
    qa.prototype.canUndo = function() { var a = this.g; return null === a || a.qb || a.Mf ? !1 : a.YE && a.na.canUndo() };
    qa.prototype.redo = function() {
        var a = this.g;
        null !== a && a.na.redo()
    };
    qa.prototype.canRedo = function() { var a = this.g; return null === a || a.qb || a.Mf ? !1 : a.YE && a.na.canRedo() };
    qa.prototype.decreaseZoom = function(a) {
        void 0 === a && (a = 1 / this.$y);
        D.p(a, qa, "decreaseZoom:factor");
        var b = this.g;
        null !== b && b.im === Vh && (a *= b.scale, a < b.Sh || a > b.Rh || (b.scale = a))
    };
    qa.prototype.canDecreaseZoom = function(a) {
        void 0 === a && (a = 1 / this.$y);
        D.p(a, qa, "canDecreaseZoom:factor");
        var b = this.g;
        if (null === b || b.im !== Vh) return !1;
        a *= b.scale;
        return a < b.Sh || a > b.Rh ? !1 : b.Fx
    };
    qa.prototype.increaseZoom = function(a) {
        void 0 === a && (a = this.$y);
        D.p(a, qa, "increaseZoom:factor");
        var b = this.g;
        null !== b && b.im === Vh && (a *= b.scale, a < b.Sh || a > b.Rh || (b.scale = a))
    };
    qa.prototype.canIncreaseZoom = function(a) {
        void 0 === a && (a = this.$y);
        D.p(a, qa, "canIncreaseZoom:factor");
        var b = this.g;
        if (null === b || b.im !== Vh) return !1;
        a *= b.scale;
        return a < b.Sh || a > b.Rh ? !1 : b.Fx
    };
    qa.prototype.resetZoom = function(a) {
        void 0 === a && (a = this.Ox);
        D.p(a, qa, "resetZoom:newscale");
        var b = this.g;
        null === b || a < b.Sh || a > b.Rh || (b.scale = a)
    };
    qa.prototype.canResetZoom = function(a) {
        void 0 === a && (a = this.Ox);
        D.p(a, qa, "canResetZoom:newscale");
        var b = this.g;
        return null === b || a < b.Sh || a > b.Rh ? !1 : b.Fx
    };
    qa.prototype.zoomToFit = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.scale,
                c = a.position;
            b === this.DA && !isNaN(this.aA) && a.kd.O(this.CA) ? (a.scale = this.aA, a.position = this.PD, this.DA = NaN, this.CA = Ld) : (this.aA = b, this.PD = c.copy(), a.zoomToFit(), this.DA = a.scale, this.CA = a.kd.copy())
        }
    };
    qa.prototype.canZoomToFit = function() { var a = this.g; return null === a ? !1 : a.Fx };
    qa.prototype.scrollToPart = function(a) {
        void 0 === a && (a = null);
        null !== a && D.l(a, F, qa, "part");
        var b = this.g;
        if (null !== b) {
            if (null === a) {
                try { null !== this.uj && (this.uj.next() ? a = this.uj.value : this.uj = null) } catch (c) { this.uj = null }
                null === a && (0 < b.vm.count ? this.uj = b.vm.j : 0 < b.selection.count && (this.uj = b.selection.j), null !== this.uj && this.uj.next() && (a = this.uj.value))
            }
            if (null !== a) {
                var d = b.Ra;
                d.po("Scroll To Part");
                var e = this.nK;
                if (0 < e) {
                    var g = Wh(this, a, [a]),
                        h = function() {
                            b.Nb();
                            for (var a = g.pop(); 0 < g.length && a instanceof G && a.Dc && (!(a instanceof I) || a.md);) a = g.pop();
                            0 < g.length ? (a instanceof F && b.WG(a.aa), a instanceof G && !a.Dc && (a.Dc = !0), a instanceof I && !a.md && (a.md = !0)) : (a instanceof F && b.eF(a.aa), b.QB("LayoutCompleted", k));
                            b.jd("Scroll To Part")
                        },
                        k = function() { setTimeout(h, (d.isEnabled ? d.duration : 0) + e) };
                    b.xx("LayoutCompleted", k);
                    h()
                } else {
                    var l = b.position.copy();
                    b.eF(a.aa);
                    l.Wc(b.position) && d.Yh()
                }
            }
        }
    };

    function Wh(a, b, c) {
        if (b.isVisible()) return c;
        if (b instanceof da) Wh(a, b.If, c);
        else if (b instanceof J) {
            var d = b.$;
            null !== d && Wh(a, d, c);
            b = b.ba;
            null !== b && Wh(a, b, c)
        } else b instanceof G && (d = b.Xb, null !== d && Wh(a, d, c), d = b.Yk(), null !== d && (d.Dc || d.br || c.push(d), Wh(a, d, c))), b = b.Ka, null !== b && (b.md || b.Zy || c.push(b), Wh(a, b, c));
        return c
    }
    qa.prototype.canScrollToPart = function(a) {
        void 0 === a && (a = null);
        if (null !== a && !(a instanceof F)) return !1;
        a = this.g;
        return null === a || 0 === a.selection.count && 0 === a.vm.count ? !1 : a.Be && a.Ce
    };
    qa.prototype.collapseTree = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null !== b) try {
            b.Nb("Collapse Tree");
            b.Ra.po("Collapse Tree");
            var c = new K(G);
            if (null !== a && a.Dc) a.collapseTree(), c.add(a);
            else
                for (var d = b.selection.j; d.next();) {
                    var e = d.value;
                    e instanceof G && (a = e, a.Dc && (a.collapseTree(), c.add(a)))
                }
            b.Ja("TreeCollapsed", c)
        } finally { b.jd("Collapse Tree") }
    };
    qa.prototype.canCollapseTree = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null === b || b.qb) return !1;
        if (null !== a) { if (!(a instanceof G && a.Dc)) return !1; if (0 < a.Yx().count) return !0 } else
            for (a = b.selection.j; a.next();)
                if (b = a.value, b instanceof G && b.Dc && 0 < b.Yx().count) return !0; return !1
    };
    qa.prototype.expandTree = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null !== b) try {
            b.Nb("Expand Tree");
            b.Ra.po("Expand Tree");
            var c = new K(G);
            if (null === a || a.Dc)
                for (var d = b.selection.j; d.next();) {
                    var e = d.value;
                    e instanceof G && (a = e, a.Dc || (a.expandTree(), c.add(a)))
                } else a.expandTree(), c.add(a);
            b.Ja("TreeExpanded", c)
        } finally { b.jd("Expand Tree") }
    };
    qa.prototype.canExpandTree = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null === b || b.qb) return !1;
        if (null !== a) { if (!(a instanceof G) || a.Dc) return !1; if (0 < a.Yx().count) return !0 } else
            for (a = b.selection.j; a.next();)
                if (b = a.value, b instanceof G && !b.Dc && 0 < b.Yx().count) return !0; return !1
    };
    qa.prototype.groupSelection = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.ea;
            if (b instanceof Y) {
                var c = this.ZE;
                if (null !== c) {
                    var d = null;
                    try {
                        a.sc = "wait";
                        a.Nb("Group");
                        a.Ja("ChangingSelection");
                        for (var e = new K(F), g = a.selection.j; g.next();) {
                            var h = g.value;
                            h.qe() && h.canGroup() && e.add(h)
                        }
                        for (var k = new K(F), l = e.j; l.next();) {
                            for (var m = l.value, g = !1, n = e.j; n.next();)
                                if (m.Fi(n.value)) { g = !0; break }
                            g || k.add(m)
                        }
                        if (0 < k.count) {
                            var p = k.first().Ka;
                            if (null !== p)
                                for (; null !== p;) {
                                    for (var e = !1, q = k.j; q.next();)
                                        if (!q.value.Fi(p)) {
                                            e = !0;
                                            break
                                        }
                                    if (e) p = p.Ka;
                                    else break
                                }
                            if (c instanceof I) Sh(c), d = c.copy(), null !== d && a.add(d);
                            else if (b.sB(c)) {
                                var r = b.copyNodeData(c);
                                D.Qa(r) && (b.dm(r), d = a.Xx(r))
                            }
                            if (null !== d) {
                                null !== p && this.isValidMember(p, d) && (d.Ka = p);
                                for (var s = k.j; s.next();) {
                                    var u = s.value;
                                    this.isValidMember(d, u) && (u.Ka = d)
                                }
                                a.select(d)
                            }
                        }
                        a.Ja("ChangedSelection");
                        a.Ja("SelectionGrouped", d)
                    } finally { a.jd("Group"), a.sc = "" }
                }
            }
        }
    };
    qa.prototype.canGroupSelection = function() { var a = this.g; if (null === a || a.qb || a.Mf || !a.Zp || !a.Ax || !(a.ea instanceof Y) || null === this.ZE) return !1; for (a = a.selection.j; a.next();) { var b = a.value; if (b.qe() && b.canGroup()) return !0 } return !1 };

    function Xh(a) {
        var b = D.mb();
        for (a = a.j; a.next();) {
            var c = a.value;
            c instanceof J || b.push(c)
        }
        a = new L(F);
        for (var c = b.length, d = 0; d < c; d++) {
            for (var e = b[d], g = !0, h = 0; h < c; h++)
                if (e.Fi(b[h])) { g = !1; break }
            g && a.add(e)
        }
        D.ya(b);
        return a
    }
    qa.prototype.isValidMember = function(a, b) {
        if (null === b || a === b || b instanceof J) return !1;
        if (null !== a) { if (a === b || a.Fi(b)) return !1; var c = a.BB; if (null !== c && !c(a, b) || null === a.data && null !== b.data || null !== a.data && null === b.data) return !1 }
        c = this.BB;
        return null !== c ? c(a, b) : !0
    };
    qa.prototype.ungroupSelection = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null !== b) {
            var c = b.ea;
            if (c instanceof Y) try {
                b.sc = "wait";
                b.Nb("Ungroup");
                b.Ja("ChangingSelection");
                var d = new K(I);
                if (null !== a) d.add(a);
                else
                    for (var e = b.selection.j; e.next();) {
                        var g = e.value;
                        g instanceof I && (a = g, a.canUngroup() && d.add(a))
                    }
                if (0 < d.count) {
                    b.Ix();
                    for (var h = d.j; h.next();) {
                        var k = h.value;
                        k.expandSubGraph();
                        var l = k.Ka,
                            m = null !== l && null !== l.data ? c.zb(l.data) : void 0,
                            n = new K(F);
                        n.Vc(k.uc);
                        for (var p = n.j; p.next();) {
                            var q =
                                p.value;
                            q.ib = !0;
                            if (!(q instanceof J)) {
                                var r = q.data;
                                null !== r ? c.$B(r, m) : q.Ka = l
                            }
                        }
                        b.remove(k)
                    }
                }
                b.Ja("ChangedSelection");
                b.Ja("SelectionUngrouped", d, n)
            } finally { b.jd("Ungroup"), b.sc = "" }
        }
    };
    qa.prototype.canUngroupSelection = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null === b || b.qb || b.Mf || !b.Cn || !b.Ex || !(b.ea instanceof Y)) return !1;
        if (null !== a) { if (!(a instanceof I)) return !1; if (a.canUngroup()) return !0 } else
            for (a = b.selection.j; a.next();)
                if (b = a.value, b instanceof I && b.canUngroup()) return !0; return !1
    };
    qa.prototype.addTopLevelParts = function(a, b) {
        for (var c = !0, d = Xh(a).j; d.next();) {
            var e = d.value;
            null !== e.Ka && (!b || this.isValidMember(null, e) ? e.Ka = null : c = !1)
        }
        return c
    };
    qa.prototype.collapseSubGraph = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null !== b) try {
            b.Nb("Collapse SubGraph");
            b.Ra.po("Collapse SubGraph");
            var c = new K(I);
            if (null !== a && a.md) a.collapseSubGraph(), c.add(a);
            else
                for (var d = b.selection.j; d.next();) {
                    var e = d.value;
                    e instanceof I && (a = e, a.md && (a.collapseSubGraph(), c.add(a)))
                }
            b.Ja("SubGraphCollapsed", c)
        } finally { b.jd("Collapse SubGraph") }
    };
    qa.prototype.canCollapseSubGraph = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null === b || b.qb) return !1;
        if (null !== a) return a instanceof I && a.md ? !0 : !1;
        for (a = b.selection.j; a.next();)
            if (b = a.value, b instanceof I && b.md) return !0;
        return !1
    };
    qa.prototype.expandSubGraph = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null !== b) try {
            b.Nb("Expand SubGraph");
            b.Ra.po("Expand SubGraph");
            var c = new K(I);
            if (null === a || a.md)
                for (var d = b.selection.j; d.next();) {
                    var e = d.value;
                    e instanceof I && (a = e, a.md || (a.expandSubGraph(), c.add(a)))
                } else a.expandSubGraph(), c.add(a);
            b.Ja("SubGraphExpanded", c)
        } finally { b.jd("Expand SubGraph") }
    };
    qa.prototype.canExpandSubGraph = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null === b || b.qb) return !1;
        if (null !== a) return a instanceof I && !a.md ? !0 : !1;
        for (a = b.selection.j; a.next();)
            if (b = a.value, b instanceof I && !b.md) return !0;
        return !1
    };
    qa.prototype.editTextBlock = function(a) {
        void 0 === a && (a = null);
        null !== a && D.l(a, pa, qa, "editTextBlock");
        var b = this.g;
        if (null !== b) {
            var c = b.nb.iC;
            if (null !== c) {
                if (null === a) {
                    a = null;
                    for (var d = b.selection.j; d.next();) { var e = d.value; if (e.canEdit()) { a = e; break } }
                    if (null === a) return;
                    a = a.qu(function(a) { return a instanceof pa && a.XA })
                }
                null !== a && (b.eb = null, c.ih = a, b.eb = c)
            }
        }
    };
    qa.prototype.canEditTextBlock = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null === b || b.qb || b.Mf || !b.Dx || null === b.nb.iC) return !1;
        if (null !== a) {
            if (!(a instanceof pa)) return !1;
            a = a.Y;
            if (null !== a && a.canEdit()) return !0
        } else
            for (b = b.selection.j; b.next();)
                if (a = b.value, a.canEdit() && (a = a.qu(function(a) { return a instanceof pa && a.XA }), null !== a)) return !0; return !1
    };
    qa.prototype.showContextMenu = function(a) {
        var b = this.g;
        if (null !== b) {
            var c = b.nb.NA;
            if (null !== c && (void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b), a = c.findObjectWithContextMenu(a), null !== a)) {
                var d = new bg,
                    e = null;
                a instanceof O ? e = a.fb(mc) : b.rJ || (e = b.wb, e = new N(e.x + e.width / 2, e.y + e.height / 2));
                null !== e && (d.g = b, d.te = b.pC(e), d.ha = e, d.left = !1, d.right = !0, d.up = !0, b.U = d);
                b.eb = c;
                Yh(c, !1, a)
            }
        }
    };
    qa.prototype.canShowContextMenu = function(a) {
        var b = this.g;
        if (null === b) return !1;
        var c = b.nb.NA;
        if (null === c) return !1;
        void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b);
        return null === c.findObjectWithContextMenu(a) ? !1 : !0
    };
    D.defineProperty(qa, { qI: "copiesClipboardData" }, function() { return this.QC }, function(a) {
        D.h(a, "boolean", qa, "copiesClipboardData");
        this.QC = a
    });
    D.defineProperty(qa, { rI: "copiesConnectedLinks" }, function() { return this.RC }, function(a) {
        D.h(a, "boolean", qa, "copiesConnectedLinks");
        this.RC = a
    });
    D.defineProperty(qa, { vF: "deletesConnectedLinks" }, function() { return this.kD }, function(a) {
        D.h(a, "boolean", qa, "deletesConnectedLinks");
        this.kD = a
    });
    D.defineProperty(qa, { tI: "copiesTree" }, function() { return this.VC }, function(a) {
        D.h(a, "boolean", qa, "copiesTree");
        this.VC = a
    });
    D.defineProperty(qa, { yI: "deletesTree" }, function() { return this.lD }, function(a) {
        D.h(a, "boolean", qa, "deletesTree");
        this.lD = a
    });
    D.defineProperty(qa, { mF: "copiesParentKey" }, function() { return this.UC }, function(a) {
        D.h(a, "boolean", qa, "copiesParentKey");
        this.UC = a
    });
    D.defineProperty(qa, { lF: "copiesGroupKey" }, function() { return this.TC }, function(a) {
        D.h(a, "boolean", qa, "copiesGroupKey");
        this.TC = a
    });
    D.defineProperty(qa, { ZE: "archetypeGroupData" }, function() { return this.nz }, function(a) {
        null !== a && D.l(a, Object, qa, "archetypeGroupData");
        var b = this.g;
        null !== b && (b = b.ea, b instanceof Y && (a instanceof I || b.sB(a) || D.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: " + a)));
        this.nz = a
    });
    D.defineProperty(qa, { BB: "memberValidation" }, function() { return this.Rl }, function(a) {
        null !== a && D.h(a, "function", qa, "memberValidation");
        this.Rl = a
    });
    D.defineProperty(qa, { Ox: "defaultScale" }, function() { return this.hD }, function(a) {
        D.p(a, qa, "defaultScale");
        0 < a || D.k("defaultScale must be larger than zero, not: " + a);
        this.hD = a
    });
    D.defineProperty(qa, { $y: "zoomFactor" }, function() { return this.PE }, function(a) {
        D.p(a, qa, "zoomFactor");
        1 < a || D.k("zoomFactor must be larger than 1.0, not: " + a);
        this.PE = a
    });
    D.defineProperty(qa, { nK: "scrollToPartPause" }, function() { return this.nE }, function(a) {
        D.p(a, qa, "scrollToPartPause");
        this.nE = a
    });

    function Zg() {
        0 < arguments.length && D.zd(Zg);
        D.xc(this);
        this.ca = null;
        this.$b = "";
        this.rf = !0;
        this.BD = !1;
        this.JE = null;
        this.vx = -1
    }
    D.ka("Tool", Zg);
    Zg.prototype.ad = function(a) {
        v && null !== a && D.l(a, E, Zg, "setDiagram");
        this.ca = a
    };
    Zg.prototype.toString = function() { return "" !== this.name ? this.name + " Tool" : D.wf(Object.getPrototypeOf(this)) };
    Zg.prototype.updateAdornments = function() {};
    Zg.prototype.canStart = function() { return this.isEnabled };
    Zg.prototype.doStart = function() {};
    Zg.prototype.doActivate = function() { this.wa = !0 };
    Zg.prototype.doDeactivate = function() { this.wa = !1 };
    Zg.prototype.doStop = function() {};
    Zg.prototype.doCancel = function() { this.stopTool() };
    Zg.prototype.stopTool = function() {
        var a = this.g;
        null !== a && a.eb === this && (a.eb = null, a.sc = "")
    };
    Zg.prototype.doMouseDown = function() {!this.wa && this.canStart() && this.doActivate() };
    Zg.prototype.doMouseMove = function() {};
    Zg.prototype.doMouseUp = function() { this.stopTool() };
    Zg.prototype.doMouseWheel = function() {};
    Zg.prototype.canStartMultiTouch = function() { return !0 };
    Zg.prototype.standardPinchZoomStart = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.U,
                c = b.$x(0, D.Fb(NaN, NaN)),
                d = b.$x(1, D.Fb(NaN, NaN));
            if (c.H() && d.H() && (this.doCancel(), a.Cu("hasGestureZoom"))) {
                a.aE = a.scale;
                var e = d.x - c.x,
                    g = d.y - c.y;
                a.sE = Math.sqrt(e * e + g * g);
                b.bubbles = !1
            }
            D.A(c);
            D.A(d)
        }
    };
    Zg.prototype.standardPinchZoomMove = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.U,
                c = b.$x(0, D.Fb(NaN, NaN)),
                d = b.$x(1, D.Fb(NaN, NaN));
            if (c.H() && d.H() && (this.doCancel(), a.Cu("hasGestureZoom"))) {
                var e = d.x - c.x,
                    g = d.y - c.y,
                    g = Math.sqrt(e * e + g * g) / a.sE,
                    e = new N((Math.min(d.x, c.x) + Math.max(d.x, c.x)) / 2, (Math.min(d.y, c.y) + Math.max(d.y, c.y)) / 2),
                    g = a.aE * g,
                    h = a.yb;
                if (g !== a.scale && h.canResetZoom(g)) {
                    var k = a.Jm;
                    a.Jm = e;
                    h.resetZoom(g);
                    a.Jm = k
                }
                b.bubbles = !1
            }
            D.A(c);
            D.A(d)
        }
    };
    Zg.prototype.doKeyDown = function() {
        var a = this.g;
        null !== a && "Esc" === a.U.key && this.doCancel()
    };
    Zg.prototype.doKeyUp = function() {};
    Zg.prototype.startTransaction = Zg.prototype.Nb = function(a) {
        void 0 === a && (a = this.name);
        this.Tf = null;
        var b = this.g;
        return null === b ? !1 : b.Nb(a)
    };
    Zg.prototype.stopTransaction = Zg.prototype.kl = function() { var a = this.g; return null === a ? !1 : null === this.Tf ? a.Am() : a.jd(this.Tf) };
    Zg.prototype.standardMouseSelect = function() {
        var a = this.g;
        if (null !== a && a.Jf) {
            var b = a.U,
                c = a.su(b.ha, !1);
            if (null !== c)
                if (D.Qh ? b.Xu : b.control) {
                    a.Ja("ChangingSelection");
                    for (b = c; null !== b && !b.canSelect();) b = b.Ka;
                    null !== b && (b.ib = !b.ib);
                    a.Ja("ChangedSelection")
                } else if (b.shift) {
                if (!c.ib) {
                    a.Ja("ChangingSelection");
                    for (b = c; null !== b && !b.canSelect();) b = b.Ka;
                    null !== b && (b.ib = !0);
                    a.Ja("ChangedSelection")
                }
            } else {
                if (!c.ib) {
                    for (b = c; null !== b && !b.canSelect();) b = b.Ka;
                    null !== b && a.select(b)
                }
            } else !b.left || (D.Qh ? b.Xu : b.control) ||
                b.shift || a.Ix()
        }
    };
    Zg.prototype.standardMouseClick = function(a, b) {
        void 0 === a && (a = null);
        void 0 === b && (b = function(a) { return !a.layer.Yc });
        var c = this.g;
        if (null === c) return !1;
        var d = c.U,
            e = c.Je(d.ha, a, b);
        d.Ne = e;
        Zh(e, d, c);
        return d.Cc
    };

    function Zh(a, b, c) {
        b.Cc = !1;
        if (null === a || a.Ju()) {
            var d = 0;
            b.left ? d = 1 === b.Ee ? 1 : 2 === b.Ee ? 2 : 1 : b.right && 1 === b.Ee && (d = 3);
            var e = "";
            if (null !== a) {
                switch (d) {
                    case 1:
                        e = "ObjectSingleClicked";
                        break;
                    case 2:
                        e = "ObjectDoubleClicked";
                        break;
                    case 3:
                        e = "ObjectContextClicked"
                }
                0 !== d && c.Ja(e, a)
            } else {
                switch (d) {
                    case 1:
                        e = "BackgroundSingleClicked";
                        break;
                    case 2:
                        e = "BackgroundDoubleClicked";
                        break;
                    case 3:
                        e = "BackgroundContextClicked"
                }
                0 !== d && c.Ja(e)
            }
            if (null !== a)
                for (; null !== a;) {
                    c = null;
                    switch (d) {
                        case 1:
                            c = a.click;
                            break;
                        case 2:
                            c = a.nu ? a.nu :
                                a.click;
                            break;
                        case 3:
                            c = a.MA
                    }
                    if (null !== c && (c(b, a), b.Cc)) break;
                    a = a.R
                } else {
                    a = null;
                    switch (d) {
                        case 1:
                            a = c.click;
                            break;
                        case 2:
                            a = c.nu ? c.nu : c.click;
                            break;
                        case 3:
                            a = c.MA
                    }
                    null !== a && a(b)
                }
        }
    }
    Zg.prototype.standardMouseOver = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.U;
            if (null !== b.g && !0 !== a.Ra.zc) {
                var c = a.kb;
                a.kb = !0;
                var d = a.th ? a.Je(b.ha, null, null) : null;
                b.Ne = d;
                var e = !1;
                if (d !== a.Qo) {
                    var g = a.Qo,
                        h = g;
                    a.Qo = d;
                    this.doCurrentObjectChanged(g, d);
                    for (b.Cc = !1; null !== g;) {
                        var k = g.Zu;
                        if (null !== k) {
                            if (d === g) break;
                            if (null !== d && d.xm(g)) break;
                            k(b, g, d);
                            e = !0;
                            if (b.Cc) break
                        }
                        g = g.R
                    }
                    g = h;
                    for (b.Cc = !1; null !== d;) {
                        k = d.Yu;
                        if (null !== k) {
                            if (g === d) break;
                            if (null !== g && g.xm(d)) break;
                            k(b, d, g);
                            e = !0;
                            if (b.Cc) break
                        }
                        d = d.R
                    }
                    d = a.Qo
                }
                if (null !==
                    d) {
                    g = d;
                    for (h = ""; null !== g;) {
                        h = g.cursor;
                        if ("" !== h) break;
                        g = g.R
                    }
                    a.sc = h;
                    b.Cc = !1;
                    for (g = d; null !== g;) {
                        d = g.FB;
                        if (null !== d && (d(b, g), e = !0, b.Cc)) break;
                        g = g.R
                    }
                } else a.sc = "", d = a.FB, null !== d && (d(b), e = !0);
                e && a.Ve();
                a.kb = c
            }
        }
    };
    Zg.prototype.doCurrentObjectChanged = function() {};
    Zg.prototype.standardMouseWheel = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.U,
                c = b.Uk;
            if (0 !== c && a.kd.H()) {
                var d = a.yb,
                    e = a.nb.$u;
                if ((e === $h && !b.shift || e === ai && b.control) && (0 < c ? d.canIncreaseZoom() : d.canDecreaseZoom())) e = a.Jm, a.Jm = b.te, 0 < c ? d.increaseZoom() : d.decreaseZoom(), a.Jm = e, b.bubbles = !1;
                else if (e === $h && b.shift || e === ai && !b.control) {
                    var d = a.position.copy(),
                        e = 0 < c ? c : -c,
                        g = b.event.deltaMode,
                        h = b.event.deltaX,
                        k = b.event.deltaY,
                        l = "pixel";
                    if (D.zq || D.Aq || D.rB) g = 1, 0 < h && (h = 3), 0 > h && (h = -3), 0 < k && (k = 3), 0 > k && (k = -3);
                    if (void 0 === g || void 0 === h || void 0 === k || 0 === h && 0 === k || b.shift) !b.shift && a.Ce ? (g = a.mv, e = 3 * e * g, 0 < c ? a.scroll("pixel", "up", e) : a.scroll("pixel", "down", e)) : b.shift && a.Be && (g = a.lv, e = 3 * e * g, 0 < c ? a.scroll("pixel", "left", e) : a.scroll("pixel", "right", e));
                    else {
                        switch (g) {
                            case 0:
                                l = "pixel";
                                break;
                            case 1:
                                l = "line";
                                break;
                            case 2:
                                l = "page";
                                break;
                            default:
                                l = "pixel"
                        }
                        0 !== h && a.Be && (0 < h ? a.scroll(l, "left", -h) : a.scroll(l, "right", h));
                        0 !== k && a.Ce && (0 < k ? a.scroll(l, "up", -k) : a.scroll(l, "down", k))
                    }
                    a.position.O(d) || (b.bubbles = !1)
                }
            }
        }
    };
    Zg.prototype.standardWaitAfter = function(a, b) {
        D.h(a, "number", Zg, "standardWaitAfter:delay");
        this.cancelWaitAfter();
        var c = this,
            d = b.copy();
        this.vx = D.setTimeout(function() { c.doWaitAfter(d) }, a)
    };
    Zg.prototype.cancelWaitAfter = function() {
        -1 !== this.vx && D.clearTimeout(this.vx);
        this.vx = -1
    };
    Zg.prototype.doWaitAfter = function() {};
    Zg.prototype.findToolHandleAt = function(a, b) {
        var c = this.g;
        if (null === c) return null;
        c = c.Je(a, function(a) { for (; null !== a && !(a.R instanceof da);) a = a.R; return a });
        return null === c ? null : c.Y.Kd === b ? c : null
    };
    Zg.prototype.isBeyondDragSize = function(a, b) {
        var c = this.g;
        if (null === c) return !1;
        void 0 === a && (a = c.Pc.te);
        void 0 === b && (b = c.U.te);
        var d = c.nb.CI,
            e = d.width,
            d = d.height;
        c.Pc.Qj && (e += 6, d += 6);
        return Math.abs(b.x - a.x) > e || Math.abs(b.y - a.y) > d
    };
    D.w(Zg, { g: "diagram" }, function() { return this.ca });
    D.defineProperty(Zg, { name: "name" }, function() { return this.$b }, function(a) {
        D.h(a, "string", Zg, "name");
        this.$b = a
    });
    D.defineProperty(Zg, { isEnabled: "isEnabled" }, function() { return this.rf }, function(a) {
        D.h(a, "boolean", Zg, "isEnabled");
        this.rf = a
    });
    D.defineProperty(Zg, { wa: "isActive" }, function() { return this.BD }, function(a) {
        D.h(a, "boolean", Zg, "isActive");
        this.BD = a
    });
    D.defineProperty(Zg, { Tf: "transactionResult" }, function() { return this.JE }, function(a) {
        null !== a && D.h(a, "string", Zg, "transactionResult");
        this.JE = a
    });

    function Uh() {
        Zg.call(this);
        0 < arguments.length && D.zd(Uh);
        this.name = "Dragging";
        this.SC = this.FD = !0;
        this.os = this.qD = !1;
        this.KD = !0;
        this.Rz = (new Ca(NaN, NaN)).freeze();
        this.Sz = ec;
        this.Tz = (new N(NaN, NaN)).freeze();
        this.pD = !1;
        this.Mw = this.Lw = this.Hz = this.PC = this.oD = this.$C = this.sj = null;
        this.Vr = this.HD = !1;
        this.Np = new N(NaN, NaN);
        this.kx = new N;
        this.nx = !1;
        this.ED = !0;
        this.Wo = 100;
        this.ik = [];
        this.FH = (new L(F)).freeze()
    }
    D.Ta(Uh, Zg);
    D.ka("DraggingTool", Uh);
    D.defineProperty(Uh, { gG: "isCopyEnabled" }, function() { return this.FD }, function(a) {
        D.h(a, "boolean", Uh, "isCopyEnabled");
        this.FD = a
    });
    D.defineProperty(Uh, { sI: "copiesEffectiveCollection" }, function() { return this.SC }, function(a) {
        D.h(a, "boolean", Uh, "copiesEffectiveCollection");
        this.SC = a
    });
    D.defineProperty(Uh, { DI: "dragsTree" }, function() { return this.qD }, function(a) {
        D.h(a, "boolean", Uh, "dragsTree");
        this.qD = a
    });
    D.defineProperty(Uh, { Lu: "isGridSnapEnabled" }, function() { return this.os }, function(a) {
        D.h(a, "boolean", Uh, "isGridSnapEnabled");
        this.os = a
    });
    D.defineProperty(Uh, { mJ: "isComplexRoutingRealtime" }, function() { return this.ED }, function(a) {
        D.h(a, "boolean", Uh, "isComplexRoutingRealtime");
        this.ED = a
    });
    D.defineProperty(Uh, { oJ: "isGridSnapRealtime" }, function() { return this.KD }, function(a) {
        D.h(a, "boolean", Uh, "isGridSnapRealtime");
        this.KD = a
    });
    D.defineProperty(Uh, { XF: "gridSnapCellSize" }, function() { return this.Rz }, function(a) {
        D.l(a, Ca, Uh, "gridSnapCellSize");
        this.Rz.O(a) || (this.Rz = a = a.V())
    });
    D.defineProperty(Uh, { ZI: "gridSnapCellSpot" }, function() { return this.Sz }, function(a) {
        D.l(a, S, Uh, "gridSnapCellSpot");
        this.Sz.O(a) || (this.Sz = a = a.V())
    });
    D.defineProperty(Uh, { $I: "gridSnapOrigin" }, function() { return this.Tz }, function(a) {
        D.l(a, N, Uh, "gridSnapOrigin");
        this.Tz.O(a) || (this.Tz = a = a.V())
    });
    D.defineProperty(Uh, { Ij: "dragsLink" }, function() { return this.pD }, function(a) {
        D.h(a, "boolean", Uh, "dragsLink");
        this.pD = a
    });
    D.defineProperty(Uh, { Mn: "currentPart" }, function() { return this.$C }, function(a) {
        null !== a && D.l(a, F, Uh, "currentPart");
        this.$C = a
    });
    D.defineProperty(Uh, { mc: "copiedParts" }, function() { return this.PC }, function(a) { this.PC = a });
    D.defineProperty(Uh, { hc: "draggedParts" }, function() { return this.oD }, function(a) { this.oD = a });
    D.w(Uh, { KL: "draggingParts" }, function() { return null !== this.mc ? this.mc.bk() : null !== this.hc ? this.hc.bk() : this.FH });
    D.defineProperty(Uh, { wd: "draggedLink" }, function() { return this.Hz }, function(a) {
        null !== a && D.l(a, J, Uh, "draggedLink");
        this.Hz !== a && (this.Hz = a, null !== a ? (this.Lw = a.oc, this.Mw = a.Gc) : this.Mw = this.Lw = null)
    });
    D.defineProperty(Uh, { gy: "isDragOutStarted" }, function() { return this.HD }, function(a) { this.HD = a });
    D.defineProperty(Uh, { jl: "startPoint" }, function() { return this.kx }, function(a) {
        D.l(a, N, Uh, "startPoint");
        this.kx.O(a) || (this.kx = a = a.V())
    });
    D.defineProperty(Uh, { qF: "delay" }, function() { return this.Wo }, function(a) {
        D.h(a, "number", Uh, "delay");
        this.Wo = a
    });
    Uh.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; if (null === a || a.qb && !a.du || !a.fm && !a.Pk && !a.du || !a.Jf) return !1; var b = a.U; return !b.left || a.eb !== this && (!this.isBeyondDragSize() || b.Qj && b.timestamp - a.Pc.timestamp < this.Wo) ? !1 : null !== this.findDraggablePart() };
    Uh.prototype.findDraggablePart = function() {
        var a = this.g;
        if (null === a) return null;
        a = a.su(a.Pc.ha, !1);
        if (null === a) return null;
        for (; null !== a && !a.canSelect();) a = a.Ka;
        return null !== a && (a.canMove() || a.canCopy()) ? a : null
    };
    Uh.prototype.standardMouseSelect = function() {
        var a = this.g;
        if (null !== a && a.Jf) {
            var b = a.su(a.Pc.ha, !1);
            if (null !== b) {
                for (; null !== b && !b.canSelect();) b = b.Ka;
                this.Mn = b;
                this.Mn.ib || (a.Ja("ChangingSelection"), b = a.U, (D.Qh ? b.Xu : b.control) || b.shift || Th(a), this.Mn.ib = !0, a.Ja("ChangedSelection"))
            }
        }
    };
    Uh.prototype.doActivate = function() {
        var a = this.g;
        if (null !== a) {
            null === this.Mn && this.standardMouseSelect();
            var b = this.Mn;
            null !== b && (b.canMove() || b.canCopy()) && (this.wa = !0, this.Np.set(a.position), bi(this, a.selection), this.ik.length = 0, this.hc = this.computeEffectiveCollection(a.selection), a.rv = !0, ci(this, this.hc), this.Nb("Drag"), this.jl = a.Pc.ha, a.of = !0, a.du && (this.gy = !0, this.Vr = !1, di = this, ei = this.g, this.doSimulatedDragOut()))
        }
    };

    function bi(a, b) {
        if (a.Ij) {
            var c = a.g;
            null !== c && c.Dn && (c.ea instanceof Y && 1 === b.count && b.first() instanceof J ? (a.wd = b.first(), a.wd.canRelinkFrom() && a.wd.canRelinkTo() && a.wd.iu(), a.sj = c.nb.HG, null === a.sj && (a.sj = new fi, a.sj.ad(c))) : (a.wd = null, a.sj = null))
        }
    }
    Uh.prototype.computeEffectiveCollection = function(a) {
        var b = null !== this.g && this.g.eb === this,
            c = new oa(F);
        if (null === a) return c;
        for (var d = a.j; d.next();) gi(this, c, d.value, b);
        if (null !== this.wd && this.Ij) return c;
        for (d = a.j; d.next();) a = d.value, a instanceof J && (b = a.$, null === b || c.contains(b) ? (b = a.ba, null === b || c.contains(b) || c.remove(a)) : c.remove(a));
        return c
    };

    function hi(a, b) { return void 0 === b ? new qi(Kd) : a.Lu ? new qi(new N(Math.round(b.x), Math.round(b.y))) : new qi(b.copy()) }

    function gi(a, b, c, d) {
        if (!b.contains(c) && (!d || c.canMove() || c.canCopy()))
            if (c instanceof G) {
                b.add(c, hi(a, c.location));
                if (c instanceof I)
                    for (var e = c.uc; e.next();) gi(a, b, e.value, d);
                for (e = c.Od; e.next();) {
                    var g = e.value;
                    if (!b.contains(g)) {
                        var h = g.$,
                            k = g.ba;
                        null !== h && b.contains(h) && null !== k && b.contains(k) && gi(a, b, g, d)
                    }
                }
                if (a.DI)
                    for (c = c.KF(); c.next();) gi(a, b, c.value, d)
            } else if (c instanceof J)
            for (g = c, b.add(g, hi(a)), c = g.Af; c.next();) gi(a, b, c.value, d);
        else c instanceof da || b.add(c, hi(a, c.location))
    }
    Uh.prototype.doDeactivate = function() {
        this.wa = !1;
        var a = this.g;
        null !== a && Di(a);
        Ei(this);
        Fi(this, this.hc);
        this.hc = this.Mn = null;
        this.Vr = this.gy = !1;
        if (0 < Gi.count) {
            for (var b = Gi.length, c = 0; c < b; c++) {
                var d = Gi.fa(c);
                Hi(d);
                Ii(d);
                Ei(d);
                null !== d.g && Di(d.g)
            }
            Gi.clear()
        }
        Hi(this);
        this.Np.n(NaN, NaN);
        di = ei = null;
        Ii(this);
        a.of = !1;
        a.sc = "";
        a.rv = !1;
        this.kl()
    };

    function Ei(a) {
        var b = a.g;
        if (null !== b) {
            var c = b.kb;
            b.kb = !0;
            Ji(a, b.U, null);
            b.kb = c
        }
        a.ik.length = 0
    }

    function Ki() {
        var a = di;
        Ii(a);
        Li(a);
        var b = a.g;
        null !== b && a.Np.H() && (b.position = a.Np);
        null !== b && Di(b)
    }
    Uh.prototype.doCancel = function() {
        Ii(this);
        Li(this);
        var a = this.g;
        null !== a && this.Np.H() && (a.position = this.Np);
        this.stopTool()
    };

    function ci(a, b) {
        if (null !== b) {
            a.nx = !0;
            for (var c = b.j; c.next();) {
                var d = c.key;
                d instanceof J && (d.Ji = !0)
            }
        }
    }

    function Fi(a, b) {
        if (null !== b) {
            for (var c = b.j; c.next();) {
                var d = c.key;
                d instanceof J && (d.Ji = !1, Mi(d) && d.ec())
            }
            a.nx = !1
        }
    }
    Uh.prototype.doKeyDown = function() {
        var a = this.g;
        null !== a && (a = a.U, null !== a && this.wa && ("Esc" === a.key ? this.doCancel() : this.doMouseMove()))
    };
    Uh.prototype.doKeyUp = function() {
        var a = this.g;
        null !== a && null !== a.U && this.wa && this.doMouseMove()
    };

    function Ni(a, b) {
        for (var c = Infinity, d = Infinity, e = -Infinity, g = -Infinity, h = a.j; h.next();) {
            var k = h.value;
            if (k.qe() && k.isVisible()) {
                var l = k.location,
                    k = l.x,
                    l = l.y;
                isNaN(k) || isNaN(l) || (k < c && (c = k), l < d && (d = l), k > e && (e = k), l > g && (g = l))
            }
        }
        Infinity === c ? b.n(0, 0, 0, 0) : b.n(c, d, e - c, g - d)
    }

    function Oi(a, b) {
        if (null === a.mc) {
            var c = a.g;
            if (!(null === c || b && (c.qb || c.Mf)) && null !== a.hc) {
                var d = c.na;
                d.isEnabled && d.jG ? null !== d.Gj && 0 < d.Gj.fg.count && (c.na.Am(), c.Nb("Drag")) : Li(a);
                c.kb = !b;
                c.hr = !b;
                a.jl = c.Pc.ha;
                d = a.sI ? a.hc.bk() : c.selection;
                d = c.hq(d, c, !0);
                for (c = d.j; c.next();) c.value.location = c.key.location;
                c = D.Sf();
                Ni(d, c);
                D.Lb(c);
                for (var c = new oa(F), e = a.hc.j; e.next();) {
                    var g = e.key;
                    g.qe() && g.canCopy() && (g = d.oa(g), null !== g && (g.kf(), c.add(g, hi(a, g.location))))
                }
                for (d = d.j; d.next();) e = d.value, e instanceof
                J && e.canCopy() && c.add(e, hi(a));
                a.mc = c;
                bi(a, c.bk());
                null !== a.wd && (c = a.wd, d = c.so, c.gl(a.jl.x - (d.x + d.width / 2), a.jl.y - (d.y + d.height / 2)))
            }
        }
    }

    function Ii(a) {
        var b = a.g;
        if (null !== b) {
            if (null !== a.mc && (b.RB(a.mc.bk(), !1), a.mc = null, null !== a.hc))
                for (var c = a.hc.j; c.next();) c.key instanceof J && (c.value.point = new N(0, 0));
            b.kb = !1;
            b.hr = !1;
            a.jl = b.Pc.ha
        }
    }

    function Hi(a) {
        if (null !== a.wd) {
            if (a.Ij && null !== a.sj) {
                var b = a.sj;
                null !== b.g && (b.g.remove(b.fe), b.g.remove(b.ge))
            }
            a.wd = null;
            a.sj = null
        }
    }

    function Pi(a, b, c) {
        var d = a.g;
        if (null !== d) {
            var e = a.jl,
                g = D.P();
            g.assign(d.U.ha);
            a.moveParts(b, g.$j(e), c);
            D.A(g)
        }
    }
    Uh.prototype.moveParts = function(a, b, c) {
        if (null !== a && (D.l(a, oa, Uh, "moveParts:parts"), 0 !== a.count)) {
            var d = D.P(),
                e = D.P();
            e.assign(b);
            isNaN(e.x) && (e.x = 0);
            isNaN(e.y) && (e.y = 0);
            (b = this.nx) || ci(this, a);
            for (var g = new K(Qi), h = new K(Wa), k = a.j; k.next();) {
                var l = k.key;
                if (l.qe()) {
                    var m = Ri(this, l, a);
                    if (null !== m) g.add(new Qi(l, k.value, m));
                    else if (!c || l.canMove()) {
                        m = k.value.point;
                        d.assign(m);
                        var n = new N,
                            p = this.computeMove(l, d.add(e), a, n);
                        l.location = p;
                        k.value.eH = n.$j(m)
                    }
                } else k.key instanceof J && h.add(k.bb)
            }
            for (c = g.j; c.next();) g =
                c.value, m = g.info.point, d.assign(m), g.Zc.location = d.add(g.aJ.eH);
            c = D.P();
            m = D.P();
            for (h = h.j; h.next();)
                if (k = h.value, g = k.key, g instanceof J)
                    if (g.Ji) l = g.$, n = g.ba, null !== this.wd && this.Ij ? (k = k.value.point, a.add(g, hi(this, e)), l = e.x - k.x, k = e.y - k.y, g.gl(l, k)) : (null !== l && (c.assign(l.location), p = a.oa(l), null !== p && c.$j(p.point)), null !== n && (m.assign(n.location), p = a.oa(n), null !== p && m.$j(p.point)), null !== l && null !== n ? c.Wc(m) ? (k = k.value.point, l = d, l.assign(c), l.$j(k), a.add(g, hi(this, c)), g.gl(l.x, l.y)) : (g.Ji = !1, g.ec()) :
                        (k = k.value.point, n = null !== l ? c : null !== n ? m : e, a.add(g, hi(this, n)), l = n.x - k.x, k = n.y - k.y, g.gl(l, k)));
                    else if (null === g.$ || null === g.ba) k = k.value.point, a.add(g, hi(this, e)), l = e.x - k.x, k = e.y - k.y, g.gl(l, k);
            D.A(d);
            D.A(e);
            D.A(c);
            D.A(m);
            b || (Si(this.g), Fi(this, a))
        }
    };

    function Ri(a, b, c) {
        b = b.Ka;
        if (null !== b) {
            a = Ri(a, b, c);
            if (null !== a) return a;
            a = c.oa(b);
            if (null !== a) return a
        }
        return null
    }

    function Li(a) {
        if (null !== a.hc) {
            for (var b = a.g, c = a.hc.j; c.next();) {
                var d = c.key;
                d.qe() && (d.location = c.value.point)
            }
            for (c = a.hc.j; c.next();)
                if (d = c.key, d instanceof J && d.Ji) {
                    var e = c.value.point;
                    a.hc.add(d, hi(a));
                    d.gl(-e.x, -e.y)
                }
            b.lg()
        }
    }
    Uh.prototype.computeMove = function(a, b, c, d) {
        void 0 === d && (d = new N);
        d.assign(b);
        if (null === a) return d;
        void 0 === c && (c = null);
        var e = b;
        if (this.Lu && (this.oJ || null === c || null !== this.g && this.g.U.up) && (e = D.P(), c = e, c.assign(b), null !== a)) {
            var g = this.g;
            if (null !== g) {
                var h = g.Vn,
                    k = this.XF,
                    g = k.width,
                    k = k.height,
                    l = this.$I,
                    m = l.x,
                    l = l.y,
                    n = this.ZI;
                if (null !== h) {
                    var p = h.ay;
                    isNaN(g) && (g = p.width);
                    isNaN(k) && (k = p.height);
                    h = h.WF;
                    isNaN(m) && (m = h.x);
                    isNaN(l) && (l = h.y)
                }
                h = D.Fb(0, 0);
                h.pv(0, 0, g, k, n);
                jb(b.x, b.y, m + h.x, l + h.y, g, k, c);
                D.A(h)
            }
        }
        c =
            null !== a.wF ? a.wF(a, b, e) : e;
        k = a.PJ;
        g = k.x;
        isNaN(g) && (g = a.location.x);
        k = k.y;
        isNaN(k) && (k = a.location.y);
        h = a.JJ;
        m = h.x;
        isNaN(m) && (m = a.location.x);
        h = h.y;
        isNaN(h) && (h = a.location.y);
        d.n(Math.max(g, Math.min(c.x, m)), Math.max(k, Math.min(c.y, h)));
        e !== b && D.A(e);
        return d
    };

    function Ti(a, b) { if (null === b) return !0; var c = b.Y; return null === c || c instanceof da || c.layer.Yc || a.hc && a.hc.contains(c) || a.mc && a.mc.contains(c) ? !0 : !1 }

    function Ui(a, b) {
        var c = a.g;
        if (null !== c) {
            a.Ij && (null !== a.wd && (a.wd.$ = null, a.wd.ba = null), Vi(a, !1));
            var d = Wi(c, b, null, function(b) { return !Ti(a, b) }),
                e = c.U;
            e.Ne = d;
            var g = c.kb,
                h = !1;
            try {
                c.kb = !0;
                h = Ji(a, e, d);
                if (!a.wa && null === di) return;
                if (null === d) {
                    var k = c.TJ;
                    null !== k && (k(e), h = !0)
                }
                if (!a.wa && null === di) return;
                a.doDragOver(b, d);
                if (!a.wa && null === di) return
            } finally { c.kb = g, h && c.lg() }(c.Be || c.Ce) && c.UA(e.te)
        }
    }

    function Ji(a, b, c) {
        var d = !1,
            e = a.ik.length,
            g = 0 < e ? a.ik[0] : null;
        if (c === g) return !1;
        b.Cc = !1;
        for (var h = 0; h < e; h++) {
            var k = a.ik[h],
                l = k.SJ;
            if (null !== l && (l(b, k, c), d = !0, b.Cc)) break
        }
        a.ik.length = 0;
        if (!a.wa && null === di || null === c) return d;
        for (b.Cc = !1; null !== c;) a.ik.push(c), c = Xi(c);
        e = a.ik.length;
        for (h = 0; h < e && (k = a.ik[h], l = k.RJ, null === l || (l(b, k, g), d = !0, !b.Cc)); h++);
        return d
    }

    function Xi(a) { var b = a.R; return null !== b ? b : a instanceof F && !(a instanceof I) && (a = a.Ka, null !== a && a.cJ) ? a : null }

    function Yi(a, b, c) {
        var d = a.sj;
        if (null === d) return null;
        var e = a.g.Pn(b, d.FG, function(a) { return d.findValidLinkablePort(a, c) });
        a = D.P();
        for (var g = Infinity, h = null, e = e.j; e.next();) {
            var k = e.value;
            if (null !== k.Y) {
                var l = k.fb(mc, a),
                    l = b.Kf(l);
                l < g && (h = k, g = l)
            }
        }
        D.A(a);
        return h
    }

    function Vi(a, b) {
        var c = a.wd;
        if (null !== c && !(2 > c.ta)) {
            var d = a.g;
            if (null !== d && !d.qb) {
                var e = a.sj;
                if (null !== e) {
                    var g = null,
                        h = null;
                    null === c.$ && (g = Yi(a, c.m(0), !1), null !== g && (h = g.Y));
                    var k = null,
                        l = null;
                    null === c.ba && (k = Yi(a, c.m(c.ta - 1), !0), null !== k && (l = k.Y));
                    e.isValidLink(h, g, l, k) ? b ? (c.iq = c.m(0), c.jq = c.m(c.ta - 1), c.Ji = !1, c.$ = h, null !== g && (c.hg = g.yd), c.ba = l, null !== k && (c.jh = k.yd), c.oc !== a.Lw && d.Ja("LinkRelinked", c, a.Lw), c.Gc !== a.Mw && d.Ja("LinkRelinked", c, a.Mw)) : Zi(e, h, g, l, k) : Zi(e, null, null, null, null)
                }
            }
        }
    }
    Uh.prototype.doDragOver = function() {};

    function $i(a, b) {
        var c = a.g;
        if (null !== c) {
            a.Ij && Vi(a, !0);
            Ei(a);
            var d = Wi(c, b, null, function(b) { return !Ti(a, b) }),
                e = c.U;
            e.Ne = d;
            if (null !== d) {
                e.Cc = !1;
                for (var g = d; null !== g;) {
                    var h = g.CB;
                    if (null !== h && (h(e, g), e.Cc)) break;
                    g = Xi(g)
                }
            } else g = c.CB, null !== g && g(e);
            if (a.wa || null !== di) {
                for (e = (a.mc || a.hc).j; e.next();) g = e.key, g instanceof G && g.Od.each(function(a) { a.Ji = !1 });
                a.doDropOnto(b, d);
                if (a.wa || null !== di) {
                    d = D.Sf();
                    for (e = c.selection.j; e.next();) g = e.value, g instanceof G && aj(c, g.getAvoidableRect(d));
                    D.Lb(d)
                }
            }
        }
    }

    function aj(a, b) {
        var c = !1;
        a.wb.Sk(b) && (c = !0);
        c = a.$A(b, function(a) { return a.Y }, function(a) { return a instanceof J }, !0, function(a) { return a instanceof J }, c);
        if (0 !== c.count)
            for (c = c.j; c.next();) {
                var d = c.value;
                d.Nj && d.ec()
            }
    }
    Uh.prototype.doDropOnto = function() {};
    Uh.prototype.doMouseMove = function() {
        if (this.wa) {
            var a = this.g;
            null !== a && null !== this.Mn && null !== this.hc && (this.mayCopy() ? (a.sc = "copy", Oi(this, !1), ci(this, this.mc), Pi(this, this.mc, !1), Fi(this, this.mc)) : this.mayMove() ? (Ii(this), Pi(this, this.hc, !0)) : this.mayDragOut() ? (a.sc = "no-drop", Oi(this, !1), Pi(this, this.mc, !1)) : Ii(this), Ui(this, a.U.ha))
        }
    };
    Uh.prototype.doMouseUp = function() {
        if (this.wa) {
            var a = this.g;
            if (null !== a) {
                var b = !1,
                    c = this.mayCopy();
                c && null !== this.mc ? (Ii(this), Oi(this, !0), ci(this, this.mc), Pi(this, this.mc, !1), Fi(this, this.mc), null !== this.mc && a.ZG(this.mc.bk())) : (b = !0, Ii(this), this.mayMove() && (Pi(this, this.hc, !0), Ui(this, a.U.ha)));
                this.Vr = !0;
                $i(this, a.U.ha);
                if (this.wa) {
                    this.mc = null;
                    if (b && null !== this.hc)
                        for (b = this.hc.j; b.next();) {
                            var d = b.key;
                            d instanceof G && (d = d.Ka, null === d || null === d.placeholder || this.hc.contains(d) || d.placeholder.K())
                        }
                    a.Qc();
                    Fi(this, this.hc);
                    this.Tf = c ? "Copy" : "Move";
                    a.Ja(c ? "SelectionCopied" : "SelectionMoved", a.selection)
                }
                this.stopTool()
            }
        }
    };
    Uh.prototype.mayCopy = function() { if (!this.gG) return !1; var a = this.g; if (null === a || a.qb || a.Mf || !a.Zp || !a.Pk || (D.Qh ? !a.U.alt : !a.U.control)) return !1; for (a = a.selection.j; a.next();) { var b = a.value; if (b.qe() && b.canCopy()) return !0 } return null !== this.wd && this.Ij && this.wd.canCopy() ? !0 : !1 };
    Uh.prototype.mayDragOut = function() { if (!this.gG) return !1; var a = this.g; if (null === a || !a.du || !a.Pk || a.fm) return !1; for (a = a.selection.j; a.next();) { var b = a.value; if (b.qe() && b.canCopy()) return !0 } return null !== this.wd && this.Ij && this.wd.canCopy() ? !0 : !1 };
    Uh.prototype.mayMove = function() { var a = this.g; if (null === a || a.qb || !a.fm) return !1; for (a = a.selection.j; a.next();) { var b = a.value; if (b.qe() && b.canMove()) return !0 } return null !== this.wd && this.Ij && this.wd.canMove() ? !0 : !1 };
    var Gi = new K(Uh),
        di = null,
        ei = null;
    Uh.prototype.getDraggingSource = function() { return di };
    Uh.prototype.mayDragIn = function() { var a = this.g; if (null === a || !a.XE || a.qb || a.Mf || !a.Zp) return !1; var b = di; return null === b || null === b.g || b.g.ea.nm !== a.ea.nm ? !1 : !0 };
    Uh.prototype.doSimulatedDragEnter = function() {
        if (this.mayDragIn()) {
            var a = this.g;
            a.Ra.Yh();
            bj(a);
            a.Ra.Yh();
            a = di;
            null !== a && null !== a.g && (a.g.sc = "copy")
        }
    };
    Uh.prototype.doSimulatedDragLeave = function() {
        var a = di;
        null !== a && a.doSimulatedDragOut();
        this.doCancel()
    };
    Uh.prototype.doSimulatedDragOver = function() {
        var a = this.g;
        if (null !== a) {
            var b = di;
            null !== b && null !== b.hc && this.mayDragIn() && (a.sc = "copy", cj(this, b.hc.bk(), !1), Pi(this, this.mc, !1), Ui(this, a.U.ha))
        }
    };
    Uh.prototype.doSimulatedDrop = function() {
        var a = this.g;
        if (null !== a) {
            var b = di;
            if (null !== b) {
                var c = b.g;
                b.Vr = !0;
                Ii(this);
                this.mayDragIn() && (this.Nb("Drop"), cj(this, b.hc.bk(), !0), Pi(this, this.mc, !1), null !== this.mc && a.ZG(this.mc.bk()), $i(this, a.U.ha), a.Qc(), b = a.selection, null !== this.mc ? this.Tf = "ExternalCopy" : b = new L(F), this.mc = null, a.doFocus(), a.Ja("ExternalObjectsDropped", b, c), this.kl())
            }
        }
    };

    function cj(a, b, c) {
        if (null === a.mc) {
            var d = a.g;
            if (null !== d && !d.qb && !d.Mf) {
                d.kb = !c;
                d.hr = !c;
                a.jl = d.U.ha;
                c = d.hq(b, d, !0);
                var e = D.Sf();
                Ni(b, e);
                var d = e.x + e.width / 2,
                    g = e.y + e.height / 2;
                D.Lb(e);
                var e = a.kx,
                    h = new oa(F),
                    k = D.P();
                for (b = b.j; b.next();) {
                    var l = b.value,
                        m = c.oa(l);
                    l.qe() && l.canCopy() ? (l = l.location, k.n(e.x - (d - l.x), e.y - (g - l.y)), m.location = k, m.kf(), h.add(m, hi(a, k))) : l instanceof J && l.canCopy() && (m.gl(e.x - d, e.y - g), h.add(m, hi(a)))
                }
                D.A(k);
                a.mc = h;
                bi(a, h.bk());
                null !== a.wd && (c = a.wd, d = c.so, c.gl(a.jl.x - (d.x + d.width /
                    2), a.jl.y - (d.y + d.height / 2)))
            }
        }
    }
    Uh.prototype.doSimulatedDragOut = function() {
        var a = this.g;
        null !== a && (this.mayCopy() || this.mayMove() ? a.sc = "" : a.sc = "no-drop")
    };

    function qi(a) {
        this.point = a;
        this.eH = Kd
    }
    D.ka("DraggingInfo", qi);

    function Qi(a, b, c) {
        this.Zc = a;
        this.info = b;
        this.aJ = c
    }

    function dj() {
        0 < arguments.length && D.zd(dj);
        Zg.call(this);
        this.jE = 100;
        this.ND = !1;
        var a = new J,
            b = new z;
        b.Ue = !0;
        b.stroke = "blue";
        a.add(b);
        b = new z;
        b.ar = "Standard";
        b.fill = "blue";
        b.stroke = "blue";
        a.add(b);
        a.Nf = "Tool";
        this.DE = a;
        a = new G;
        b = new z;
        b.yd = "";
        b.Kb = "Rectangle";
        b.fill = null;
        b.stroke = "magenta";
        b.lb = 2;
        b.Ea = Yd;
        a.add(b);
        a.il = !1;
        a.Nf = "Tool";
        this.BE = a;
        this.CE = b;
        a = new G;
        b = new z;
        b.yd = "";
        b.Kb = "Rectangle";
        b.fill = null;
        b.stroke = "magenta";
        b.lb = 2;
        b.Ea = Yd;
        a.add(b);
        a.il = !1;
        a.Nf = "Tool";
        this.EE = a;
        this.FE = b;
        this.iE = this.hE =
            this.dE = this.cE = this.eE = null;
        this.JD = !0;
        this.SH = new oa(O, "boolean");
        this.kE = this.Pl = this.yE = null
    }
    D.Ta(dj, Zg);
    D.ka("LinkingBaseTool", dj);
    dj.prototype.doStop = function() {
        var a = this.g;
        null !== a && Di(a);
        this.fh = this.eh = this.dh = this.bh = this.vc = null;
        this.Xy.clear();
        this.Rf = null
    };
    D.defineProperty(dj, { FG: "portGravity" }, function() { return this.jE }, function(a) {
        D.h(a, "number", dj, "portGravity");
        0 <= a && (this.jE = a)
    });
    D.defineProperty(dj, { Cq: "isUnconnectedLinkValid" }, function() { return this.ND }, function(a) {
        D.h(a, "boolean", dj, "isUnconnectedLinkValid");
        this.ND = a
    });
    D.defineProperty(dj, { Ef: "temporaryLink" }, function() { return this.DE }, function(a) {
        D.l(a, J, dj, "temporaryLink");
        this.DE = a
    });
    D.defineProperty(dj, { fe: "temporaryFromNode" }, function() { return this.BE }, function(a) {
        D.l(a, G, dj, "temporaryFromNode");
        this.BE = a
    });
    D.defineProperty(dj, { xo: "temporaryFromPort" }, function() { return this.CE }, function(a) {
        D.l(a, O, dj, "temporaryFromPort");
        this.CE = a
    });
    D.defineProperty(dj, { ge: "temporaryToNode" }, function() { return this.EE }, function(a) {
        D.l(a, G, dj, "temporaryToNode");
        this.EE = a
    });
    D.defineProperty(dj, { yo: "temporaryToPort" }, function() { return this.FE }, function(a) {
        D.l(a, O, dj, "temporaryToPort");
        this.FE = a
    });
    D.defineProperty(dj, { vc: "originalLink" }, function() { return this.eE }, function(a) {
        null !== a && D.l(a, J, dj, "originalLink");
        this.eE = a
    });
    D.defineProperty(dj, { bh: "originalFromNode" }, function() { return this.cE }, function(a) {
        null !== a && D.l(a, G, dj, "originalFromNode");
        this.cE = a
    });
    D.defineProperty(dj, { dh: "originalFromPort" }, function() { return this.dE }, function(a) {
        null !== a && D.l(a, O, dj, "originalFromPort");
        this.dE = a
    });
    D.defineProperty(dj, { eh: "originalToNode" }, function() { return this.hE }, function(a) {
        null !== a && D.l(a, G, dj, "originalToNode");
        this.hE = a
    });
    D.defineProperty(dj, { fh: "originalToPort" }, function() { return this.iE }, function(a) {
        null !== a && D.l(a, O, dj, "originalToPort");
        this.iE = a
    });
    D.defineProperty(dj, { ce: "isForwards" }, function() { return this.JD }, function(a) {
        D.h(a, "boolean", dj, "isForwards");
        this.JD = a
    });
    D.w(dj, { Xy: "validPortsCache" }, function() { return this.SH });
    D.defineProperty(dj, { Rf: "targetPort" }, function() { return this.yE }, function(a) {
        null !== a && D.l(a, O, dj, "targetPort");
        this.yE = a
    });
    dj.prototype.copyPortProperties = function(a, b, c, d, e) {
        if (null !== a && null !== b && null !== c && null !== d) {
            d.Ea = b.aa.size;
            e ? (d.Hb = b.Hb, d.Hm = b.Hm) : (d.Gb = b.Gb, d.rm = b.rm);
            c.Of = mc;
            var g = D.P();
            c.location = b.fb(mc, g);
            D.A(g);
            d.angle = b.sm();
            null !== this.Ey && this.Ey(a, b, c, d, e)
        }
    };
    dj.prototype.setNoTargetPortProperties = function(a, b, c) {
        null !== b && (b.Ea = Yd, b.Gb = dc, b.Hb = dc);
        null !== a && null !== this.g && (a.location = this.g.U.ha);
        null !== this.Ey && this.Ey(null, null, a, b, c)
    };
    dj.prototype.doMouseDown = function() { this.wa && this.doMouseMove() };
    dj.prototype.doMouseMove = function() {
        if (this.wa) {
            var a = this.g;
            if (null !== a) {
                this.Rf = this.findTargetPort(this.ce);
                if (null !== this.Rf && this.Rf.Y instanceof G) {
                    var b = this.Rf.Y;
                    this.ce ? this.copyPortProperties(b, this.Rf, this.ge, this.yo, !0) : this.copyPortProperties(b, this.Rf, this.fe, this.xo, !1)
                } else this.ce ? this.setNoTargetPortProperties(this.ge, this.yo, !0) : this.setNoTargetPortProperties(this.fe, this.xo, !1);
                (a.Be || a.Ce) && a.UA(a.U.te)
            }
        }
    };
    dj.prototype.findValidLinkablePort = function(a, b) {
        if (null === a) return null;
        var c = a.Y;
        if (!(c instanceof G)) return null;
        for (; null !== a;) {
            var d = b ? a.nH : a.MF;
            if (!0 === d && (null !== a.yd || a instanceof G) && (b ? this.isValidTo(c, a) : this.isValidFrom(c, a))) return a;
            if (!1 === d) break;
            a = a.R
        }
        return null
    };
    dj.prototype.findTargetPort = function(a) {
        var b = this.g,
            c = b.U.ha,
            d = this.FG;
        0 >= d && (d = .1);
        for (var e = this, g = b.Pn(c, d, function(b) { return e.findValidLinkablePort(b, a) }, null, !0), d = Infinity, b = null, g = g.j; g.next();) {
            var h = g.value,
                k = h.Y;
            if (k instanceof G) {
                var l = h.fb(mc, D.P()),
                    m = c.x - l.x,
                    n = c.y - l.y;
                D.A(l);
                l = m * m + n * n;
                l < d && (m = this.Xy.oa(h), null !== m ? m && (b = h, d = l) : a && this.isValidLink(this.bh, this.dh, k, h) || !a && this.isValidLink(k, h, this.eh, this.fh) ? (this.Xy.add(h, !0), b = h, d = l) : this.Xy.add(h, !1))
            }
        }
        return null !== b && (c = b.Y,
            c instanceof G && (null === c.layer || c.layer.eu)) ? b : null
    };
    dj.prototype.isValidFrom = function(a, b) {
        if (null === a || null === b) return this.Cq;
        if (null !== this.g && this.g.eb === this && (null !== a.layer && !a.layer.eu || !0 !== b.MF)) return !1;
        var c = b.cB;
        if (Infinity > c) {
            if (null !== this.vc && a === this.bh && b === this.dh) return !0;
            var d = b.yd;
            null === d && (d = "");
            if (a.Wx(d).count >= c) return !1
        }
        return !0
    };
    dj.prototype.isValidTo = function(a, b) {
        if (null === a || null === b) return this.Cq;
        if (null !== this.g && this.g.eb === this && (null !== a.layer && !a.layer.eu || !0 !== b.nH)) return !1;
        var c = b.EK;
        if (Infinity > c) {
            if (null !== this.vc && a === this.eh && b === this.fh) return !0;
            var d = b.yd;
            null === d && (d = "");
            if (a.Yg(d).count >= c) return !1
        }
        return !0
    };
    dj.prototype.isInSameNode = function(a, b) {
        if (null === a || null === b) return !1;
        if (a === b) return !0;
        var c = a.Y,
            d = b.Y;
        return null !== c && c === d
    };
    dj.prototype.isLinked = function(a, b) {
        if (null === a || null === b) return !1;
        var c = a.Y;
        if (!(c instanceof G)) return !1;
        var d = a.yd;
        null === d && (d = "");
        var e = b.Y;
        if (!(e instanceof G)) return !1;
        var g = b.yd;
        null === g && (g = "");
        for (e = e.Yg(g); e.next();)
            if (g = e.value, g.$ === c && g.hg === d) return !0;
        return !1
    };
    dj.prototype.isValidLink = function(a, b, c, d) {
        if (!this.isValidFrom(a, b) || !this.isValidTo(c, d) || !(null === b || null === d || (b.RI && d.DK || !this.isInSameNode(b, d)) && (b.QI && d.CK || !this.isLinked(b, d))) || null !== this.vc && (null !== a && this.isLabelDependentOnLink(a, this.vc) || null !== c && this.isLabelDependentOnLink(c, this.vc)) || null !== a && null !== c && (null === a.data && null !== c.data || null !== a.data && null === c.data) || !this.isValidCycle(a, c, this.vc)) return !1;
        if (null !== a) { var e = a.sy; if (null !== e && !e(a, b, c, d, this.vc)) return !1 }
        if (null !==
            c && (e = c.sy, null !== e && !e(a, b, c, d, this.vc))) return !1;
        e = this.sy;
        return null !== e ? e(a, b, c, d, this.vc) : !0
    };
    dj.prototype.isLabelDependentOnLink = function(a, b) {
        if (null === a) return !1;
        var c = a.Xb;
        if (null === c) return !1;
        if (c === b) return !0;
        var d = new L(G);
        d.add(a);
        return ej(this, c, b, d)
    };

    function ej(a, b, c, d) {
        if (b === c) return !0;
        var e = b.$;
        if (null !== e && e.Lf && (d.add(e), ej(a, e.Xb, c, d))) return !0;
        b = b.ba;
        return null !== b && b.Lf && (d.add(b), ej(a, b.Xb, c, d)) ? !0 : !1
    }
    dj.prototype.isValidCycle = function(a, b, c) {
        void 0 === c && (c = null);
        if (null === a || null === b) return this.Cq;
        var d = null !== this.g ? this.g.KK : fj;
        if (d !== fj) {
            if (d === gj) { d = c || this.Ef; if (null !== d && !d.jc) return !0; for (d = b.Od; d.next();) { var e = d.value; if (e !== c && e.jc && e.ba === b) return !1 } return !hj(this, a, b, c, !0) }
            if (d === ij) {
                d = c || this.Ef;
                if (null !== d && !d.jc) return !0;
                for (d = a.Od; d.next();)
                    if (e = d.value, e !== c && e.jc && e.$ === a) return !1;
                return !hj(this, a, b, c, !0)
            }
            if (d === jj) return a === b ? a = !0 : (d = new L(G), d.add(b), a = kj(this, d, a, b, c)), !a;
            if (d === lj) return !hj(this, a, b, c, !1);
            if (d === mj) return a === b ? a = !0 : (d = new L(G), d.add(b), a = nj(this, d, a, b, c)), !a
        }
        return !0
    };

    function hj(a, b, c, d, e) { if (b === c) return !0; if (null === b || null === c) return !1; for (var g = b.Od; g.next();) { var h = g.value; if (h !== d && (!e || h.jc) && h.ba === b && (h = h.$, h !== b && hj(a, h, c, d, e))) return !0 } return !1 }

    function kj(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 g = c.Od; g.next();) { var h = g.value; if (h !== e && h.ba === c && (h = h.$, h !== c && kj(a, b, h, d, e))) return !0 }
        return !1
    }

    function nj(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 g = c.Od; g.next();) {
            var h = g.value;
            if (h !== e) {
                var k = h.$,
                    h = h.ba,
                    k = k === c ? h : k;
                if (k !== c && nj(a, b, k, d, e)) return !0
            }
        }
        return !1
    }
    D.defineProperty(dj, { sy: "linkValidation" }, function() { return this.Pl }, function(a) {
        null !== a && D.h(a, "function", dj, "linkValidation");
        this.Pl = a
    });
    D.defineProperty(dj, { Ey: "portTargeted" }, function() { return this.kE }, function(a) {
        null !== a && D.h(a, "function", dj, "portTargeted");
        this.kE = a
    });

    function ra() {
        0 < arguments.length && D.zd(ra);
        dj.call(this);
        this.name = "Linking";
        this.pz = {};
        this.oz = null;
        this.ga = oj;
        this.tE = null
    }
    D.Ta(ra, dj);
    D.ka("LinkingTool", ra);
    var oj;
    ra.Either = oj = D.s(ra, "Either", 0);
    var pj;
    ra.ForwardsOnly = pj = D.s(ra, "ForwardsOnly", 0);
    var qj;
    ra.BackwardsOnly = qj = D.s(ra, "BackwardsOnly", 0);
    D.defineProperty(ra, { aF: "archetypeLinkData" }, function() { return this.pz }, function(a) {
        null !== a && D.l(a, Object, ra, "archetypeLinkData");
        a instanceof O && D.l(a, J, ra, "archetypeLinkData");
        this.pz = a
    });
    D.defineProperty(ra, { $E: "archetypeLabelNodeData" }, function() { return this.oz }, function(a) {
        null !== a && D.l(a, Object, ra, "archetypeLabelNodeData");
        a instanceof O && D.l(a, G, ra, "archetypeLabelNodeData");
        this.oz = a
    });
    D.defineProperty(ra, { direction: "direction" }, function() { return this.ga }, function(a) {
        D.Da(a, ra, ra, "direction");
        this.ga = a
    });
    D.defineProperty(ra, { hH: "startObject" }, function() { return this.tE }, function(a) {
        null !== a && D.l(a, O, ra, "startObject");
        this.tE = a
    });
    ra.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; if (null === a || a.qb || a.Mf || !a.eu) return !1; var b = a.ea; return (b instanceof Y || b instanceof Bg) && a.U.left && (a.eb === this || this.isBeyondDragSize()) ? null !== this.findLinkablePort() : !1 };
    ra.prototype.findLinkablePort = function() {
        var a = this.g;
        if (null === a) return null;
        var b = this.hH;
        null === b && (b = a.Je(a.Pc.ha, null, null));
        if (null === b || !(b.Y instanceof G)) return null;
        a = this.direction;
        if (a === oj || a === pj) { var c = this.findValidLinkablePort(b, !1); if (null !== c) return this.ce = !0, c }
        if (a === oj || a === qj)
            if (c = this.findValidLinkablePort(b, !0), null !== c) return this.ce = !1, c;
        return null
    };
    ra.prototype.doActivate = function() {
        var a = this.g;
        if (null !== a) {
            var b = this.findLinkablePort();
            null !== b && (this.Nb(this.name), a.of = !0, a.sc = "pointer", this.ce ? (null === this.ge || this.ge.location.H() || (this.ge.location = a.U.ha), this.dh = b, b = this.dh.Y, b instanceof G && (this.bh = b), this.copyPortProperties(this.bh, this.dh, this.fe, this.xo, !1)) : (null === this.fe || this.fe.location.H() || (this.fe.location = a.U.ha), this.fh = b, b = this.fh.Y, b instanceof G && (this.eh = b), this.copyPortProperties(this.eh, this.fh, this.ge, this.yo, !0)),
                a.add(this.fe), a.add(this.ge), null !== this.Ef && (null !== this.fe && (this.Ef.$ = this.fe), null !== this.ge && (this.Ef.ba = this.ge), this.Ef.jc = this.isNewTreeLink(), this.Ef.ec(), a.add(this.Ef)), this.wa = !0)
        }
    };
    ra.prototype.doDeactivate = function() {
        this.wa = !1;
        var a = this.g;
        null !== a && (a.remove(this.Ef), a.remove(this.fe), a.remove(this.ge), a.of = !1, a.sc = "", this.kl())
    };
    ra.prototype.doStop = function() {
        dj.prototype.doStop.call(this);
        this.hH = null
    };
    ra.prototype.doMouseUp = function() {
        if (this.wa) {
            var a = this.g;
            if (null === a) return;
            var b = this.Tf = null,
                c = null,
                d = null,
                e = null,
                g = this.Rf = this.findTargetPort(this.ce);
            if (null !== g) {
                var h = g.Y;
                h instanceof G && (this.ce ? (null !== this.bh && (b = this.bh, c = this.dh), d = h, e = g) : (b = h, c = g, null !== this.eh && (d = this.eh, e = this.fh)))
            } else this.ce ? null !== this.bh && this.Cq && (b = this.bh, c = this.dh) : null !== this.eh && this.Cq && (d = this.eh, e = this.fh);
            null !== b || null !== d ? (h = this.insertLink(b, c, d, e), null !== h ? (null === g && (this.ce ? h.jq = a.U.ha : h.iq =
                a.U.ha), a.Jf && a.select(h), this.Tf = this.name, a.Ja("LinkDrawn", h)) : (a.ea.gF(), this.doNoLink(b, c, d, e))) : this.ce ? this.doNoLink(this.bh, this.dh, null, null) : this.doNoLink(null, null, this.eh, this.fh)
        }
        this.stopTool()
    };
    ra.prototype.isNewTreeLink = function() {
        var a = this.aF;
        if (null === a) return !0;
        if (a instanceof J) return a.jc;
        var b = this.g;
        if (null === b) return !0;
        a = b.Bu(a);
        b = rj(b, a);
        return null !== b ? b.jc : !0
    };
    ra.prototype.insertLink = function(a, b, c, d) {
        var e = this.g;
        if (null === e) return null;
        var g = e.ea;
        if (g instanceof Bg) {
            var h = a;
            b = c;
            e.ee || (h = c, b = a);
            if (null !== h && null !== b) return g.Ii(b.data, g.zb(h.data)), b.Qn()
        } else if (g instanceof Y)
            if (h = "", null !== a && (null === b && (b = a), h = b.yd, null === h && (h = "")), b = "", null !== c && (null === d && (d = c), b = d.yd, null === b && (b = "")), d = this.aF, d instanceof J) {
                if (Sh(d), g = d.copy(), null !== g) return g.$ = a, g.hg = h, g.ba = c, g.jh = b, e.add(g), a = this.$E, a instanceof G && (Sh(a), a = a.copy(), null !== a && (a.Xb = g, e.add(a))),
                    g
            } else if (null !== d && (d = g.Kx(d), D.Qa(d))) return null !== a && g.YB(d, g.zb(a.data)), g.ZB(d, h), null !== c && g.dC(d, g.zb(c.data)), g.eC(d, b), g.au(d), a = this.$E, null === a || a instanceof G || (a = g.copyNodeData(a), D.Qa(a) && (g.dm(a), a = g.zb(a), void 0 !== a && g.VE(d, a))), g = e.gg(d);
        return null
    };
    ra.prototype.doNoLink = function() {};

    function fi() {
        0 < arguments.length && D.zd(fi);
        dj.call(this);
        this.name = "Relinking";
        var a = new z;
        a.Kb = "Diamond";
        a.Ea = $d;
        a.fill = "lightblue";
        a.stroke = "dodgerblue";
        a.cursor = "pointer";
        a.We = 0;
        this.vD = a;
        a = new z;
        a.Kb = "Diamond";
        a.Ea = $d;
        a.fill = "lightblue";
        a.stroke = "dodgerblue";
        a.cursor = "pointer";
        a.We = -1;
        this.GE = a;
        this.pc = null;
        this.fE = new C
    }
    D.Ta(fi, dj);
    D.ka("RelinkingTool", fi);
    fi.prototype.updateAdornments = function(a) {
        if (null !== a && a instanceof J) {
            var b = "RelinkFrom",
                c = null;
            if (a.ib && null !== this.g && !this.g.qb) {
                var d = a.to;
                null !== d && a.canRelinkFrom() && a.aa.H() && a.isVisible() && d.aa.H() && d.Sj() && (c = a.nq(b), null === c && (c = this.makeAdornment(d, !1), a.cm(b, c)))
            }
            null === c && a.Xj(b);
            b = "RelinkTo";
            c = null;
            a.ib && null !== this.g && !this.g.qb && (d = a.to, null !== d && a.canRelinkTo() && a.aa.H() && a.isVisible() && d.aa.H() && d.Sj() && (c = a.nq(b), null === c && (c = this.makeAdornment(d, !0), a.cm(b, c))));
            null === c && a.Xj(b)
        }
    };
    fi.prototype.makeAdornment = function(a, b) {
        var c = new da;
        c.type = sj;
        var d = b ? this.BK : this.OI;
        null !== d && c.add(d.copy());
        c.Bb = a;
        return c
    };
    D.defineProperty(fi, { OI: "fromHandleArchetype" }, function() { return this.vD }, function(a) {
        null !== a && D.l(a, O, fi, "fromHandleArchetype");
        this.vD = a
    });
    D.defineProperty(fi, { BK: "toHandleArchetype" }, function() { return this.GE }, function(a) {
        null !== a && D.l(a, O, fi, "toHandleArchetype");
        this.GE = a
    });
    D.w(fi, { handle: "handle" }, function() { return this.pc });
    fi.prototype.canStart = function() {
        if (!this.isEnabled) return !1;
        var a = this.g;
        if (null === a || a.qb || a.Mf || !a.Dn) return !1;
        var b = a.ea;
        if (!(b instanceof Y || b instanceof Bg) || !a.U.left) return !1;
        b = this.findToolHandleAt(a.Pc.ha, "RelinkFrom");
        null === b && (b = this.findToolHandleAt(a.Pc.ha, "RelinkTo"));
        return null !== b
    };
    fi.prototype.doActivate = function() {
        var a = this.g;
        if (null !== a) {
            if (null === this.vc) {
                var b = this.findToolHandleAt(a.Pc.ha, "RelinkFrom");
                null === b && (b = this.findToolHandleAt(a.Pc.ha, "RelinkTo"));
                if (null === b) return;
                var c = b.Y;
                if (!(c instanceof da && c.If instanceof J)) return;
                this.pc = b;
                this.ce = null === c || "RelinkTo" === c.Kd;
                this.vc = c.If
            }
            this.Nb(this.name);
            a.of = !0;
            a.sc = "pointer";
            this.dh = this.vc.oc;
            this.bh = this.vc.$;
            this.fh = this.vc.Gc;
            this.eh = this.vc.ba;
            this.fE.set(this.vc.aa);
            null !== this.vc && 0 < this.vc.ta && (null ===
                this.vc.$ && (null !== this.xo && (this.xo.Ea = Xd), null !== this.fe && (this.fe.location = this.vc.m(0))), null === this.vc.ba && (null !== this.yo && (this.yo.Ea = Xd), null !== this.ge && (this.ge.location = this.vc.m(this.vc.ta - 1))));
            this.copyPortProperties(this.bh, this.dh, this.fe, this.xo, !1);
            this.copyPortProperties(this.eh, this.fh, this.ge, this.yo, !0);
            a.add(this.fe);
            a.add(this.ge);
            null !== this.Ef && (null !== this.fe && (this.Ef.$ = this.fe), null !== this.ge && (this.Ef.ba = this.ge), this.copyLinkProperties(this.vc, this.Ef), this.Ef.ec(), a.add(this.Ef));
            this.wa = !0
        }
    };
    fi.prototype.copyLinkProperties = function(a, b) {
        if (null !== a && null !== b) {
            b.Yp = a.Yp;
            b.QA = a.QA;
            var c = a.jf;
            if (c === tj || c === uj) c = vj;
            b.jf = c;
            b.Nx = a.Nx;
            b.jc = a.jc;
            b.points = a.points;
            b.My = a.My;
            b.Yq = a.Yq;
            b.Gb = a.Gb;
            b.rm = a.rm;
            b.zu = a.zu;
            b.Au = a.Au;
            b.Hb = a.Hb;
            b.Hm = a.Hm;
            b.uv = a.uv;
            b.vv = a.vv
        }
    };
    fi.prototype.doDeactivate = function() {
        this.wa = !1;
        var a = this.g;
        null !== a && (a.remove(this.Ef), a.remove(this.fe), a.remove(this.ge), a.of = !1, a.sc = "", this.kl())
    };
    fi.prototype.doStop = function() {
        dj.prototype.doStop.call(this);
        this.pc = null
    };
    fi.prototype.doMouseUp = function() {
        if (this.wa) {
            var a = this.g;
            if (null === a) return;
            this.Tf = null;
            var b = this.bh,
                c = this.dh,
                d = this.eh,
                e = this.fh,
                g = this.vc;
            this.Rf = this.findTargetPort(this.ce);
            if (null !== this.Rf) {
                var h = this.Rf.Y;
                h instanceof G && (this.ce ? (d = h, e = this.Rf) : (b = h, c = this.Rf))
            } else this.Cq ? this.ce ? e = d = null : c = b = null : g = null;
            null !== g ? (this.reconnectLink(g, this.ce ? d : b, this.ce ? e : c, this.ce), null === this.Rf && (this.ce ? g.jq = a.U.ha : g.iq = a.U.ha, g.ec()), a.Jf && (g.ib = !0), this.Tf = this.name, a.Ja("LinkRelinked", g, this.ce ?
                this.fh : this.dh)) : this.doNoRelink(this.vc, this.ce);
            Oj(this.vc, this.fE)
        }
        this.stopTool()
    };
    fi.prototype.reconnectLink = function(a, b, c, d) {
        if (null === this.g) return !1;
        c = null !== c && null !== c.yd ? c.yd : "";
        d ? (a.ba = b, a.jh = c) : (a.$ = b, a.hg = c);
        return !0
    };
    fi.prototype.doNoRelink = function() {};

    function Zi(a, b, c, d, e) { null !== a.g && (null !== b ? (a.copyPortProperties(b, c, a.fe, a.xo, !1), a.g.add(a.fe)) : a.g.remove(a.fe), null !== d ? (a.copyPortProperties(d, e, a.ge, a.yo, !0), a.g.add(a.ge)) : a.g.remove(a.ge)) }

    function Pj() {
        0 < arguments.length && D.zd(Pj);
        Zg.call(this);
        this.name = "LinkReshaping";
        var a = new z;
        a.Kb = "Rectangle";
        a.Ea = Zd;
        a.fill = "lightblue";
        a.stroke = "dodgerblue";
        this.Fl = a;
        a = new z;
        a.Kb = "Diamond";
        a.Ea = Zd;
        a.fill = "lightblue";
        a.stroke = "dodgerblue";
        this.TD = a;
        this.lE = 3;
        this.lz = this.pc = null;
        this.Bp = new N;
        this.Ow = null
    }
    D.Ta(Pj, Zg);
    D.ka("LinkReshapingTool", Pj);
    var Qj;
    Pj.None = Qj = D.s(Pj, "None", 0);
    var Rj;
    Pj.Horizontal = Rj = D.s(Pj, "Horizontal", 1);
    var Sj;
    Pj.Vertical = Sj = D.s(Pj, "Vertical", 2);
    var Tj;
    Pj.All = Tj = D.s(Pj, "All", 3);
    Pj.prototype.getReshapingBehavior = Pj.prototype.RF = function(a) { return a && a.kA ? a.kA : Qj };
    Pj.prototype.setReshapingBehavior = Pj.prototype.ov = function(a, b) {
        D.l(a, O, Pj, "setReshapingBehavior:obj");
        D.Da(b, Pj, Pj, "setReshapingBehavior:behavior");
        a.kA = b
    };
    Pj.prototype.updateAdornments = function(a) {
        if (null !== a && a instanceof J) {
            if (a.ib && null !== this.g && !this.g.qb) { var b = a.path; if (null !== b && a.canReshape() && a.aa.H() && a.isVisible() && b.aa.H() && b.Sj()) { var c = a.nq(this.name); if (null === c || c.$D !== a.ta || c.OE !== a.jv) c = this.makeAdornment(b), null !== c && (c.$D = a.ta, c.OE = a.jv, a.cm(this.name, c)); if (null !== c) { c.location = a.position; return } } }
            a.Xj(this.name)
        }
    };
    Pj.prototype.makeAdornment = function(a) {
        var b = a.Y,
            c = b.ta,
            d = b.ic,
            e = null;
        if (null !== b.points && 1 < c) {
            e = new da;
            e.type = sj;
            var c = b.tu,
                g = b.oy,
                h = d ? 1 : 0;
            if (b.jv && b.jf !== Uj)
                for (var k = c + h; k < g - h; k++) {
                    var l = this.makeResegmentHandle(a, k);
                    null !== l && (l.We = k, l.WB = .5, l.cB = 999, e.add(l))
                }
            for (k = c + 1; k < g; k++)
                if (l = this.makeHandle(a, k), null !== l) {
                    l.We = k;
                    if (k !== c)
                        if (k === c + 1 && d) {
                            var h = b.m(c),
                                m = b.m(c + 1);
                            Q(h.x, m.x) && Q(h.y, m.y) && (m = b.m(c - 1));
                            Q(h.x, m.x) ? (this.ov(l, Sj), l.cursor = "n-resize") : Q(h.y, m.y) && (this.ov(l, Rj), l.cursor = "w-resize")
                        } else k ===
                            g - 1 && d ? (h = b.m(g - 1), m = b.m(g), Q(h.x, m.x) && Q(h.y, m.y) && (h = b.m(g + 1)), Q(h.x, m.x) ? (this.ov(l, Sj), l.cursor = "n-resize") : Q(h.y, m.y) && (this.ov(l, Rj), l.cursor = "w-resize")) : k !== g && (this.ov(l, Tj), l.cursor = "move");
                    e.add(l)
                }
            e.Bb = a
        }
        return e
    };
    Pj.prototype.makeHandle = function() { var a = this.Eu; return null === a ? null : a.copy() };
    D.defineProperty(Pj, { Eu: "handleArchetype" }, function() { return this.Fl }, function(a) {
        null !== a && D.l(a, O, Pj, "handleArchetype");
        this.Fl = a
    });
    Pj.prototype.makeResegmentHandle = function() { var a = this.OJ; return null === a ? null : a.copy() };
    D.defineProperty(Pj, { OJ: "midHandleArchetype" }, function() { return this.TD }, function(a) {
        null !== a && D.l(a, O, Pj, "midHandleArchetype");
        this.TD = a
    });
    D.w(Pj, { handle: "handle" }, function() { return this.pc });
    D.w(Pj, { cu: "adornedLink" }, function() { return this.lz });
    Pj.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; return null !== a && !a.qb && a.Bx && a.U.left ? null !== this.findToolHandleAt(a.Pc.ha, this.name) : !1 };
    Pj.prototype.doActivate = function() {
        var a = this.g;
        if (null !== a && (this.pc = this.findToolHandleAt(a.Pc.ha, this.name), null !== this.pc)) {
            var b = this.pc.Y.If;
            if (b instanceof J) {
                this.lz = b;
                a.of = !0;
                this.Nb(this.name);
                if (b.jv && 999 === this.pc.cB) {
                    var c = b.points.copy(),
                        d = this.pc.fb(mc);
                    c.be(this.pc.We + 1, d);
                    b.ic && c.be(this.pc.We + 1, d);
                    b.points = c;
                    b.pe();
                    this.pc = this.findToolHandleAt(a.Pc.ha, this.name);
                    if (null === this.pc) { this.doDeactivate(); return }
                }
                this.Bp = b.m(this.pc.We);
                this.Ow = b.points.copy();
                this.wa = !0
            }
        }
    };
    Pj.prototype.doDeactivate = function() {
        this.kl();
        this.lz = this.pc = null;
        var a = this.g;
        null !== a && (a.of = !1);
        this.wa = !1
    };
    Pj.prototype.doCancel = function() {
        var a = this.cu;
        null !== a && (a.points = this.Ow);
        this.stopTool()
    };
    Pj.prototype.doMouseMove = function() {
        var a = this.g;
        this.wa && null !== a && (a = this.computeReshape(a.U.ha), this.reshape(a))
    };
    Pj.prototype.doMouseUp = function() {
        var a = this.g;
        if (this.wa && null !== a) {
            var b = this.computeReshape(a.U.ha);
            this.reshape(b);
            b = this.cu;
            if (null !== b && b.jv) {
                var c = this.handle.We,
                    d = b.m(c - 1),
                    e = b.m(c),
                    g = b.m(c + 1);
                if (b.ic) {
                    if (c > b.tu + 1 && c < b.oy - 1) {
                        var h = b.m(c - 2);
                        if (Math.abs(d.x - e.x) < this.Wh && Math.abs(d.y - e.y) < this.Wh && (Vj(this, h, d, e, g, !0) || Vj(this, h, d, e, g, !1))) {
                            var k = b.points.copy();
                            Vj(this, h, d, e, g, !0) ? (k.ug(c - 2, new N(h.x, (g.y + h.y) / 2)), k.ug(c + 1, new N(g.x, (g.y + h.y) / 2))) : (k.ug(c - 2, new N((g.x + h.x) / 2, h.y)), k.ug(c + 1,
                                new N((g.x + h.x) / 2, g.y)));
                            k.pd(c);
                            k.pd(c - 1);
                            b.points = k;
                            b.pe()
                        } else h = b.m(c + 2), Math.abs(e.x - g.x) < this.Wh && Math.abs(e.y - g.y) < this.Wh && (Vj(this, d, e, g, h, !0) || Vj(this, d, e, g, h, !1)) && (k = b.points.copy(), Vj(this, d, e, g, h, !0) ? (k.ug(c - 1, new N(d.x, (d.y + h.y) / 2)), k.ug(c + 2, new N(h.x, (d.y + h.y) / 2))) : (k.ug(c - 1, new N((d.x + h.x) / 2, d.y)), k.ug(c + 2, new N((d.x + h.x) / 2, h.y))), k.pd(c + 1), k.pd(c), b.points = k, b.pe())
                    }
                } else h = D.P(), fb(d.x, d.y, g.x, g.y, e.x, e.y, h) && h.Kf(e) < this.Wh * this.Wh && (k = b.points.copy(), k.pd(c), b.points = k, b.pe()),
                    D.A(h)
            }
            a.Qc();
            this.Tf = this.name;
            a.Ja("LinkReshaped", this.cu, this.Ow)
        }
        this.stopTool()
    };

    function Vj(a, b, c, d, e, g) { return g ? Math.abs(b.y - c.y) < a.Wh && Math.abs(c.y - d.y) < a.Wh && Math.abs(d.y - e.y) < a.Wh : Math.abs(b.x - c.x) < a.Wh && Math.abs(c.x - d.x) < a.Wh && Math.abs(d.x - e.x) < a.Wh }
    D.defineProperty(Pj, { Wh: "resegmentingDistance" }, function() { return this.lE }, function(a) {
        D.h(a, "number", Pj, "resegmentingDistance");
        this.lE = a
    });
    Pj.prototype.reshape = function(a) {
        var b = this.cu;
        b.Dm();
        var c = this.handle.We,
            d = this.RF(this.handle);
        if (b.ic)
            if (c === b.tu + 1) c = b.tu + 1, d === Sj ? (b.ia(c, b.m(c - 1).x, a.y), b.ia(c + 1, b.m(c + 2).x, a.y)) : d === Rj && (b.ia(c, a.x, b.m(c - 1).y), b.ia(c + 1, a.x, b.m(c + 2).y));
            else if (c === b.oy - 1) c = b.oy - 1, d === Sj ? (b.ia(c - 1, b.m(c - 2).x, a.y), b.ia(c, b.m(c + 1).x, a.y)) : d === Rj && (b.ia(c - 1, a.x, b.m(c - 2).y), b.ia(c, a.x, b.m(c + 1).y));
        else {
            var d = c,
                e = b.m(d),
                g = b.m(d - 1),
                h = b.m(d + 1);
            Q(g.x, e.x) && Q(e.y, h.y) ? (Q(g.x, b.m(d - 2).x) && !Q(g.y, b.m(d - 2).y) ? (b.B(d, a.x,
                g.y), c++, d++) : b.ia(d - 1, a.x, g.y), Q(h.y, b.m(d + 2).y) && !Q(h.x, b.m(d + 2).x) ? b.B(d + 1, h.x, a.y) : b.ia(d + 1, h.x, a.y)) : Q(g.y, e.y) && Q(e.x, h.x) ? (Q(g.y, b.m(d - 2).y) && !Q(g.x, b.m(d - 2).x) ? (b.B(d, g.x, a.y), c++, d++) : b.ia(d - 1, g.x, a.y), Q(h.x, b.m(d + 2).x) && !Q(h.y, b.m(d + 2).y) ? b.B(d + 1, a.x, h.y) : b.ia(d + 1, a.x, h.y)) : Q(g.x, e.x) && Q(e.x, h.x) ? (Q(g.x, b.m(d - 2).x) && !Q(g.y, b.m(d - 2).y) ? (b.B(d, a.x, g.y), c++, d++) : b.ia(d - 1, a.x, g.y), Q(h.x, b.m(d + 2).x) && !Q(h.y, b.m(d + 2).y) ? b.B(d + 1, a.x, h.y) : b.ia(d + 1, a.x, h.y)) : Q(g.y, e.y) && Q(e.y, h.y) && (Q(g.y, b.m(d -
                2).y) && !Q(g.x, b.m(d - 2).x) ? (b.B(d, g.x, a.y), c++, d++) : b.ia(d - 1, g.x, a.y), Q(h.y, b.m(d + 2).y) && !Q(h.x, b.m(d + 2).x) ? b.B(d + 1, h.x, a.y) : b.ia(d + 1, h.x, a.y));
            b.ia(c, a.x, a.y)
        } else b.ia(c, a.x, a.y), e = b.$, g = b.oc, null !== e && (d = e.findVisibleNode(), null !== d && d !== e && (e = d, g = e.port)), 1 === c && b.computeSpot(!0, g).de() && (d = g.fb(mc, D.P()), e = b.getLinkPointFromPoint(e, g, d, a, !0, D.P()), b.ia(0, e.x, e.y), D.A(d), D.A(e)), e = b.ba, g = b.Gc, null !== e && (d = e.findVisibleNode(), null !== d && d !== e && (e = d, g = e.port)), c === b.ta - 2 && b.computeSpot(!1, g).de() &&
            (d = g.fb(mc, D.P()), e = b.getLinkPointFromPoint(e, g, d, a, !1, D.P()), b.ia(b.ta - 1, e.x, e.y), D.A(d), D.A(e));
        b.Ej()
    };
    Pj.prototype.computeReshape = function(a) {
        var b = this.cu,
            c = this.handle.We;
        switch (this.RF(this.handle)) {
            case Tj:
                return a;
            case Sj:
                return b = b.m(c), new N(b.x, a.y);
            case Rj:
                return b = b.m(c), new N(a.x, b.y);
            default:
            case Qj:
                return b.m(c)
        }
    };
    D.w(Pj, { qM: "originalPoint" }, function() { return this.Bp });
    D.w(Pj, { rM: "originalPoints" }, function() { return this.Ow });

    function Wj() {
        0 < arguments.length && D.zd(Wj);
        Zg.call(this);
        this.name = "Resizing";
        this.oi = (new Ca(1, 1)).freeze();
        this.ni = (new Ca(9999, 9999)).freeze();
        this.fk = (new Ca(NaN, NaN)).freeze();
        this.os = !1;
        this.Tc = null;
        var a = new z;
        a.Gh = mc;
        a.Kb = "Rectangle";
        a.Ea = Zd;
        a.fill = "lightblue";
        a.stroke = "dodgerblue";
        a.lb = 1;
        a.cursor = "pointer";
        this.Fl = a;
        this.pc = null;
        this.Bp = new N;
        this.bE = new Ca;
        this.gE = new N;
        this.Oz = new Ca(0, 0);
        this.Nz = new Ca(Infinity, Infinity);
        this.Mz = new Ca(1, 1);
        this.ZD = !0
    }
    D.Ta(Wj, Zg);
    D.ka("ResizingTool", Wj);
    Wj.prototype.updateAdornments = function(a) {
        if (!(null === a || a instanceof J)) {
            if (a.ib && null !== this.g && !this.g.qb) {
                var b = a.RG;
                if (null !== b && a.canResize() && a.aa.H() && a.isVisible() && b.aa.H() && b.Sj()) {
                    var c = a.nq(this.name);
                    if (null === c || c.Bb !== b) c = this.makeAdornment(b);
                    if (null !== c) {
                        var d = b.sm();
                        c.angle = d;
                        var e = b.fb(c.Of, D.P()),
                            g = b.Jj();
                        c.location = e;
                        D.A(e);
                        e = c.placeholder;
                        if (null !== e) {
                            var b = b.Ga,
                                h = D.Gm();
                            h.n(b.width * g, b.height * g);
                            e.Ea = h;
                            D.Zk(h)
                        }
                        this.updateResizeHandles(c, d);
                        a.cm(this.name, c);
                        return
                    }
                }
            }
            a.Xj(this.name)
        }
    };
    Wj.prototype.makeAdornment = function(a) {
        var b = null,
            b = a.Y.QG;
        if (null === b) {
            b = new da;
            b.type = Xj;
            b.Of = mc;
            var c = new Yj;
            c.Ue = !0;
            b.add(c);
            b.add(this.makeHandle(a, ec));
            b.add(this.makeHandle(a, kc));
            b.add(this.makeHandle(a, vc));
            b.add(this.makeHandle(a, tc));
            b.add(this.makeHandle(a, $c));
            b.add(this.makeHandle(a, fd));
            b.add(this.makeHandle(a, gd));
            b.add(this.makeHandle(a, ed))
        } else if (Sh(b), b = b.copy(), null === b) return null;
        b.Bb = a;
        return b
    };
    Wj.prototype.makeHandle = function(a, b) {
        var c = this.Eu;
        if (null === c) return null;
        c = c.copy();
        c.alignment = b;
        return c
    };
    Wj.prototype.updateResizeHandles = function(a, b) {
        if (null !== a)
            if (!a.alignment.ld() && ("pointer" === a.cursor || 0 < a.cursor.indexOf("resize"))) a: {
                var c = a.alignment;c.de() && (c = mc);
                var d = b;
                if (0 >= c.x) d = 0 >= c.y ? d + 225 : 1 <= c.y ? d + 135 : d + 180;
                else if (1 <= c.x) 0 >= c.y ? d += 315 : 1 <= c.y && (d += 45);
                else if (0 >= c.y) d += 270;
                else if (1 <= c.y) d += 90;
                else break a;0 > d ? d += 360 : 360 <= d && (d -= 360);a.cursor = 22.5 > d ? "e-resize" : 67.5 > d ? "se-resize" : 112.5 > d ? "s-resize" : 157.5 > d ? "sw-resize" : 202.5 > d ? "w-resize" : 247.5 > d ? "nw-resize" : 292.5 > d ? "n-resize" : 337.5 > d ?
                    "ne-resize" : "e-resize"
            }
            else if (a instanceof x)
            for (c = a.elements; c.next();) this.updateResizeHandles(c.value, b)
    };
    D.defineProperty(Wj, { Eu: "handleArchetype" }, function() { return this.Fl }, function(a) {
        null !== a && D.l(a, O, Wj, "handleArchetype");
        this.Fl = a
    });
    D.w(Wj, { handle: "handle" }, function() { return this.pc });
    D.defineProperty(Wj, { Bb: "adornedObject" }, function() { return this.Tc }, function(a) {
        null !== a && D.l(a, O, Wj, "adornedObject");
        this.Tc = a
    });
    Wj.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; return null !== a && !a.qb && a.fu && a.U.left ? null !== this.findToolHandleAt(a.Pc.ha, this.name) : !1 };
    Wj.prototype.doActivate = function() {
        var a = this.g;
        null !== a && (this.pc = this.findToolHandleAt(a.Pc.ha, this.name), null !== this.pc && (this.Tc = this.pc.Y.Bb, this.Bp.set(this.Bb.fb(this.handle.alignment.DG())), this.gE.set(this.Tc.Y.location), this.bE.set(this.Tc.Ea), this.Mz = this.computeCellSize(), this.Oz = this.computeMinSize(), this.Nz = this.computeMaxSize(), a.of = !0, this.ZD = a.Ra.isEnabled, a.Ra.isEnabled = !1, this.Nb(this.name), this.wa = !0))
    };
    Wj.prototype.doDeactivate = function() {
        var a = this.g;
        null !== a && (this.kl(), this.Tc = this.pc = null, this.wa = a.of = !1, a.Ra.isEnabled = this.ZD)
    };
    Wj.prototype.doCancel = function() {
        null !== this.Bb && (this.Bb.Ea = this.EG, this.Bb.Y.location = this.YJ);
        this.stopTool()
    };
    Wj.prototype.doMouseMove = function() {
        var a = this.g;
        if (this.wa && null !== a) {
            var b = this.Oz,
                c = this.Nz,
                d = this.Mz,
                e = this.Bb.PF(a.U.ha, D.P()),
                g = this.computeReshape(),
                b = this.computeResize(e, this.handle.alignment, b, c, d, g);
            this.resize(b);
            a.lg();
            D.A(e)
        }
    };
    Wj.prototype.doMouseUp = function() {
        var a = this.g;
        if (this.wa && null !== a) {
            var b = this.Oz,
                c = this.Nz,
                d = this.Mz,
                e = this.Bb.PF(a.U.ha, D.P()),
                g = this.computeReshape(),
                b = this.computeResize(e, this.handle.alignment, b, c, d, g);
            this.resize(b);
            D.A(e);
            a.Qc();
            this.Tf = this.name;
            a.Ja("PartResized", this.Bb, this.EG)
        }
        this.stopTool()
    };
    Wj.prototype.resize = function(a) {
        var b = this.g;
        if (null !== b) {
            var c = this.Bb,
                d = c.Y;
            c.Ea = a.size;
            d.kf();
            a = this.Bb.fb(this.handle.alignment.DG());
            d instanceof I ? (c = new K(F), c.add(d), b.moveParts(c, this.Bp.copy().$j(a), !0)) : d.location = d.location.copy().$j(a).add(this.Bp)
        }
    };
    Wj.prototype.computeResize = function(a, b, c, d, e, g) {
        b.de() && (b = mc);
        var h = this.Bb.Ga,
            k = h.x,
            l = h.y,
            m = h.x + h.width,
            n = h.y + h.height,
            p = 1;
        if (!g) {
            var p = h.width,
                q = h.height;
            0 >= p && (p = 1);
            0 >= q && (q = 1);
            p = q / p
        }
        q = D.P();
        jb(a.x, a.y, k, l, e.width, e.height, q);
        a = h.copy();
        0 >= b.x ? 0 >= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = Math.max(n - a.y, c.height), g || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : (a.width =
            a.height / p, a.x = m - a.width))) : 1 <= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (b = a.height / a.width, p < b ? a.height = p * a.width : (a.width = a.height / p, a.x = m - a.width))) : (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = m - a.x, g || (a.height = p * a.width, a.y = l + .5 * (n - l - a.height))) : 1 <= b.x ? 0 >= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height),
            a.height = Math.max(n - a.y, c.height), g || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : a.width = a.height / p)) : 1 <= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (b = a.height / a.width, p < b ? a.height = p * a.width : a.width = a.height / p)) : (a.width = Math.max(Math.min(q.x - k, d.width), c.width), g || (a.height = p * a.width, a.y = l + .5 * (n - l - a.height))) : 0 >= b.y ? (a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = n - a.y, g || (a.width = a.height / p, a.x =
            k + .5 * (m - k - a.width))) : 1 <= b.y && (a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (a.width = a.height / p, a.x = k + .5 * (m - k - a.width)));
        D.A(q);
        return a
    };
    Wj.prototype.computeReshape = function() {
        var a = Zj;
        this.Bb instanceof z && (a = ak(this.Bb));
        return !(a === bk || a === ck || null !== this.g && this.g.U.shift)
    };
    Wj.prototype.computeMinSize = function() {
        var a = this.Bb.ah.copy(),
            b = this.ah;
        !isNaN(b.width) && b.width > a.width && (a.width = b.width);
        !isNaN(b.height) && b.height > a.height && (a.height = b.height);
        return a
    };
    Wj.prototype.computeMaxSize = function() {
        var a = this.Bb.pf.copy(),
            b = this.pf;
        !isNaN(b.width) && b.width < a.width && (a.width = b.width);
        !isNaN(b.height) && b.height < a.height && (a.height = b.height);
        return a
    };
    Wj.prototype.computeCellSize = function() {
        var a = new Ca(NaN, NaN),
            b = this.Bb.Y;
        if (null !== b) { var c = b.gK;!isNaN(c.width) && 0 < c.width && (a.width = c.width);!isNaN(c.height) && 0 < c.height && (a.height = c.height) }
        c = this.bq;
        isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width);
        isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height);
        b = this.g;
        (isNaN(a.width) || isNaN(a.height)) && b && (c = b.nb.Ge, null !== c && c.Lu && (c = c.XF, isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width), isNaN(a.height) && !isNaN(c.height) &&
            0 < c.height && (a.height = c.height)), b = b.Vn, null !== b && b.visible && this.Lu && (c = b.ay, isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width), isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height)));
        if (isNaN(a.width) || 0 === a.width || Infinity === a.width) a.width = 1;
        if (isNaN(a.height) || 0 === a.height || Infinity === a.height) a.height = 1;
        return a
    };
    D.defineProperty(Wj, { ah: "minSize" }, function() { return this.oi }, function(a) {
        D.l(a, Ca, Wj, "minSize");
        if (!this.oi.O(a)) {
            var b = a.width;
            isNaN(b) && (b = 0);
            a = a.height;
            isNaN(a) && (a = 0);
            this.oi.n(b, a)
        }
    });
    D.defineProperty(Wj, { pf: "maxSize" }, function() { return this.ni }, function(a) {
        D.l(a, Ca, Wj, "maxSize");
        if (!this.ni.O(a)) {
            var b = a.width;
            isNaN(b) && (b = Infinity);
            a = a.height;
            isNaN(a) && (a = Infinity);
            this.ni.n(b, a)
        }
    });
    D.defineProperty(Wj, { bq: "cellSize" }, function() { return this.fk }, function(a) {
        D.l(a, Ca, Wj, "cellSize");
        this.fk.O(a) || this.fk.assign(a)
    });
    D.defineProperty(Wj, { Lu: "isGridSnapEnabled" }, function() { return this.os }, function(a) {
        D.h(a, "boolean", Wj, "isGridSnapEnabled");
        this.os = a
    });
    D.w(Wj, { EG: "originalDesiredSize" }, function() { return this.bE });
    D.w(Wj, { YJ: "originalLocation" }, function() { return this.gE });

    function dk() {
        0 < arguments.length && D.zd(dk);
        Zg.call(this);
        this.name = "Rotating";
        this.rE = 45;
        this.qE = 2;
        this.Tc = null;
        var a = new z;
        a.Kb = "Ellipse";
        a.Ea = $d;
        a.fill = "lightblue";
        a.stroke = "dodgerblue";
        a.lb = 1;
        a.cursor = "pointer";
        this.Fl = a;
        this.pc = null;
        this.Nw = 0;
        this.mE = new N
    }
    D.Ta(dk, Zg);
    D.ka("RotatingTool", dk);
    dk.prototype.updateAdornments = function(a) {
        if (null !== a) {
            if (a instanceof J) { var b = a.TB; if (b === a || b === a.path || b.Ue) return }
            if (a.ib && null !== this.g && !this.g.qb && (b = a.TB, null !== b && a.canRotate() && a.aa.H() && a.isVisible() && b.aa.H() && b.Sj())) {
                var c = a.nq(this.name);
                if (null === c || c.Bb !== b) c = this.makeAdornment(b);
                if (null !== c) {
                    c.angle = b.sm();
                    var d = null,
                        e = null;
                    b === a || b === a.Bf ? (d = a.Bf, e = a.Of) : (d = b, e = mc);
                    for (var g = d.Ga, e = D.Fb(g.width * e.x + e.offsetX, g.height * e.y + e.offsetY); null !== d && d !== b;) d.transform.vb(e), d = d.R;
                    var d =
                        e.y,
                        g = Math.max(e.x - b.Ga.width, 0),
                        h = D.P();
                    c.location = b.fb(new S(1, 0, 50 + g, d), h);
                    D.A(h);
                    D.A(e);
                    a.cm(this.name, c);
                    return
                }
            }
            a.Xj(this.name)
        }
    };
    dk.prototype.makeAdornment = function(a) {
        var b = null,
            b = a.Y.iK;
        if (null === b) {
            b = new da;
            b.type = ek;
            b.Of = mc;
            var c = this.Eu;
            null !== c && b.add(c.copy())
        } else if (Sh(b), b = b.copy(), null === b) return null;
        b.Bb = a;
        return b
    };
    D.defineProperty(dk, { Eu: "handleArchetype" }, function() { return this.Fl }, function(a) {
        null !== a && D.l(a, O, dk, "handleArchetype");
        this.Fl = a
    });
    D.w(dk, { handle: "handle" }, function() { return this.pc });
    D.defineProperty(dk, { Bb: "adornedObject" }, function() { return this.Tc }, function(a) {
        null !== a && D.l(a, O, dk, "adornedObject");
        this.Tc = a
    });
    dk.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; return null !== a && !a.qb && a.Cx && a.U.left ? null !== this.findToolHandleAt(a.Pc.ha, this.name) : !1 };
    dk.prototype.doActivate = function() {
        var a = this.g;
        if (null !== a && (this.pc = this.findToolHandleAt(a.Pc.ha, this.name), null !== this.pc)) {
            this.Tc = this.pc.Y.Bb;
            var b = this.Tc.Y,
                c = b.Bf;
            this.mE = this.Tc === b || this.Tc === c ? c.fb(b.Of) : this.Tc.fb(mc);
            this.Nw = this.Tc.angle;
            a.of = !0;
            a.SA = !0;
            this.Nb(this.name);
            this.wa = !0
        }
    };
    dk.prototype.doDeactivate = function() {
        var a = this.g;
        null !== a && (this.kl(), this.Tc = this.pc = null, this.wa = a.of = !1)
    };
    dk.prototype.doCancel = function() {
        var a = this.g;
        null !== a && (a.SA = !1);
        this.rotate(this.Nw);
        this.stopTool()
    };
    dk.prototype.doMouseMove = function() {
        var a = this.g;
        this.wa && null !== a && (a = this.computeRotate(a.U.ha), this.rotate(a))
    };
    dk.prototype.doMouseUp = function() {
        var a = this.g;
        if (this.wa && null !== a) {
            a.SA = !1;
            var b = this.computeRotate(a.U.ha);
            this.rotate(b);
            a.Qc();
            this.Tf = this.name;
            a.Ja("PartRotated", this.Tc, this.Nw)
        }
        this.stopTool()
    };
    dk.prototype.rotate = function(a) {
        v && D.p(a, dk, "rotate:newangle");
        null !== this.Tc && (this.Tc.angle = a)
    };
    dk.prototype.computeRotate = function(a) {
        a = this.mE.Wb(a);
        var b = this.Tc.R;
        null !== b && (a -= b.sm(), 360 <= a ? a -= 360 : 0 > a && (a += 360));
        var b = Math.min(Math.abs(this.vK), 180),
            c = Math.min(Math.abs(this.uK), b / 2);
        (null === this.g || !this.g.U.shift) && 0 < b && 0 < c && (a % b < c ? a = Math.floor(a / b) * b : a % b > b - c && (a = (Math.floor(a / b) + 1) * b));
        360 <= a ? a -= 360 : 0 > a && (a += 360);
        return a
    };
    D.defineProperty(dk, { vK: "snapAngleMultiple" }, function() { return this.rE }, function(a) {
        D.h(a, "number", dk, "snapAngleMultiple");
        this.rE = a
    });
    D.defineProperty(dk, { uK: "snapAngleEpsilon" }, function() { return this.qE }, function(a) {
        D.h(a, "number", dk, "snapAngleEpsilon");
        this.qE = a
    });
    D.w(dk, { pM: "originalAngle" }, function() { return this.Nw });

    function fk() {
        Zg.call(this);
        0 < arguments.length && D.zd(fk);
        this.name = "ClickSelecting"
    }
    D.Ta(fk, Zg);
    D.ka("ClickSelectingTool", fk);
    fk.prototype.canStart = function() { return !this.isEnabled || null === this.g || this.isBeyondDragSize() ? !1 : !0 };
    fk.prototype.doMouseUp = function() {
        this.wa && (this.standardMouseSelect(), !this.standardMouseClick() && null !== this.g && this.g.U.Qj && this.g.nb.doToolTip());
        this.stopTool()
    };

    function gk() {
        Zg.call(this);
        0 < arguments.length && D.zd(gk);
        this.name = "Action";
        this.Eo = null
    }
    D.Ta(gk, Zg);
    D.ka("ActionTool", gk);
    gk.prototype.canStart = function() {
        if (!this.isEnabled) return !1;
        var a = this.g;
        if (null === a) return !1;
        var b = a.U,
            c = a.Je(b.ha, function(a) { for (; null !== a.R && !a.Hu;) a = a.R; return a });
        if (null !== c) {
            if (!c.Hu) return !1;
            this.Eo = c;
            a.Qo = a.Je(b.ha, null, null);
            return !0
        }
        return !1
    };
    gk.prototype.doMouseDown = function() {
        if (this.wa) {
            var a = this.g.U,
                b = this.Eo;
            null !== b && (a.Ne = b, null !== b.RE && b.RE(a, b))
        } else this.canStart() && this.doActivate()
    };
    gk.prototype.doMouseMove = function() {
        if (this.wa) {
            var a = this.g.U,
                b = this.Eo;
            null !== b && (a.Ne = b, null !== b.SE && b.SE(a, b))
        }
    };
    gk.prototype.doMouseUp = function() {
        if (this.wa) {
            var a = this.g,
                b = a.U,
                c = this.Eo;
            if (null === c) return;
            b.Ne = c;
            null !== c.TE && c.TE(b, c);
            this.isBeyondDragSize() || Zh(c, b, a)
        }
        this.stopTool()
    };
    gk.prototype.doCancel = function() {
        var a = this.g;
        if (null !== a) {
            var a = a.U,
                b = this.Eo;
            if (null === b) return;
            a.Ne = b;
            null !== b.QE && b.QE(a, b)
        }
        this.stopTool()
    };
    gk.prototype.doStop = function() { this.Eo = null };

    function ta() {
        Zg.call(this);
        0 < arguments.length && D.zd(ta);
        this.name = "ClickCreating";
        this.yl = null;
        this.GD = !0;
        this.uD = new N(0, 0)
    }
    D.Ta(ta, Zg);
    D.ka("ClickCreatingTool", ta);
    ta.prototype.canStart = function() { if (!this.isEnabled || null === this.GA) return !1; var a = this.g; if (null === a || a.qb || a.Mf || !a.Zp || !a.U.left || this.isBeyondDragSize()) return !1; if (this.nJ) { if (1 === a.U.Ee && (this.uD = a.U.te.copy()), 2 !== a.U.Ee || this.isBeyondDragSize(this.uD)) return !1 } else if (1 !== a.U.Ee) return !1; return a.eb !== this && null !== a.su(a.U.ha, !0) ? !1 : !0 };
    ta.prototype.doMouseUp = function() {
        var a = this.g;
        this.wa && null !== a && this.insertPart(a.U.ha);
        this.stopTool()
    };
    ta.prototype.insertPart = function(a) {
        var b = this.g;
        if (null === b) return null;
        var c = this.GA;
        if (null === c) return null;
        this.Nb(this.name);
        var d = null;
        c instanceof F ? c.qe() && (Sh(c), d = c.copy(), null !== d && b.add(d)) : null !== c && (c = b.ea.copyNodeData(c), D.Qa(c) && (b.ea.dm(c), d = b.Nh(c)));
        null !== d && (d.location = a, b.Jf && b.select(d));
        b.Qc();
        this.Tf = this.name;
        b.Ja("PartCreated", d);
        this.kl();
        return d
    };
    D.defineProperty(ta, { GA: "archetypeNodeData" }, function() { return this.yl }, function(a) {
        null !== a && D.l(a, Object, ta, "archetypeNodeData");
        this.yl = a
    });
    D.defineProperty(ta, { nJ: "isDoubleClick" }, function() { return this.GD }, function(a) {
        D.h(a, "boolean", ta, "isDoubleClick");
        this.GD = a
    });

    function hk() { this.LE = this.RD = this.Vz = this.qA = null }
    D.ka("HTMLInfo", hk);
    D.defineProperty(hk, { yB: "mainElement" }, function() { return this.RD }, function(a) {
        null !== a && D.l(a, HTMLElement, hk, "mainElement");
        this.RD = a
    });
    D.defineProperty(hk, { show: "show" }, function() { return this.qA }, function(a) { this.qA !== a && (null !== a && D.h(a, "function", hk, "show"), this.qA = a) });
    D.defineProperty(hk, { Wn: "hide" }, function() { return this.Vz }, function(a) { this.Vz !== a && (null !== a && D.h(a, "function", hk, "hide"), this.Vz = a) });
    D.defineProperty(hk, { uC: "valueFunction" }, function() { return this.LE }, function(a) { this.LE = a });

    function ik(a, b, c) {
        this.text = a;
        this.iF = b;
        this.visible = c
    }

    function jk() {
        Zg.call(this);
        0 < arguments.length && D.zd(jk);
        this.name = "ContextMenu";
        this.ZC = this.yz = this.WC = null;
        this.XD = new N;
        this.Az = this.Sm = null;
        var a = this;
        this.xA = function() { a.stopTool() };
        kk(this)
    }
    D.Ta(jk, Zg);
    D.ka("ContextMenuTool", jk);

    function kk(a) {
        var b = new hk;
        b.show = function(a, b, c) { c.showDefaultContextMenu() };
        b.Wn = function(a, b) { b.hideDefaultContextMenu() };
        a.Sm = b;
        a.xA = function() { a.stopTool() };
        if (!1 === D.pF) {
            var b = D.createElement("div"),
                c = D.createElement("div");
            b.style.cssText = "top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px";
            c.style.cssText = "z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";
            var d = D.createElement("style");
            window.document.getElementsByTagName("head")[0].appendChild(d);
            d.sheet.insertRule(".goCXul { list-style: none; }", 0);
            d.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }", 0);
            d.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }", 0);
            b.addEventListener("contextmenu", lk, !1);
            b.addEventListener("selectstart", lk, !1);
            c.addEventListener("contextmenu", lk, !1);
            window.document.body && (window.document.body.appendChild(b), window.document.body.appendChild(c));
            D.ku = b;
            D.ju = c;
            D.pF = !0
        }
    }

    function lk(a) { a.preventDefault(); return !1 }
    jk.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; return null === a || this.isBeyondDragSize() || !a.U.right ? !1 : null !== this.Sm && a.U.Qj || null !== this.findObjectWithContextMenu() ? !0 : !1 };
    jk.prototype.doStart = function() {
        var a = this.g;
        null !== a && this.XD.set(a.Pc.ha)
    };
    jk.prototype.doStop = function() {
        this.hideContextMenu();
        this.Mx = null
    };
    jk.prototype.findObjectWithContextMenu = function(a) {
        void 0 === a && (a = null);
        var b = this.g;
        if (null === b) return null;
        var c = b.U,
            d = null;
        a instanceof E || (d = a instanceof O ? a : b.Je(c.ha, null, function(a) { return !a.layer.Yc }));
        if (null !== d) {
            for (a = d; null !== a;) {
                if (null !== a.contextMenu) return a;
                a = a.R
            }
            if (null !== this.Sm && b.U.Qj) return d.Y
        } else if (null !== b.contextMenu) return b;
        return null
    };
    jk.prototype.doActivate = function() {};
    jk.prototype.doMouseDown = function() {
        Zg.prototype.doMouseDown.call(this);
        null !== this.g && this.g.nb.qf.contains(this) && mk(this)
    };
    jk.prototype.doMouseUp = function() { mk(this) };

    function mk(a) {
        var b = a.g;
        if (null !== b)
            if (a.wa) {
                var c = a.lm;
                if (null !== c) {
                    if (!(c instanceof hk)) {
                        var d = b.Je(b.U.ha, null, null);
                        null !== d && d.xm(c) && a.standardMouseClick(null, null)
                    }
                    a.stopTool();
                    a.canStart() && (b.eb = a, a.doMouseUp())
                }
            } else a.canStart() && (Yh(a, !0), a.wa || a.stopTool())
    }

    function Yh(a, b, c) {
        void 0 === c && (c = null);
        b && a.standardMouseSelect();
        if (!a.standardMouseClick())
            if (a.wa = !0, b = a.Sm, null === c && (c = a.findObjectWithContextMenu()), null !== c) {
                var d = c.contextMenu;
                null !== d ? (a.Mx = c instanceof O ? c : null, a.showContextMenu(d, a.Mx)) : null !== b && a.showContextMenu(b, a.Mx)
            } else null !== b && a.showContextMenu(b, null)
    }
    jk.prototype.doMouseMove = function() { this.wa && null !== this.g && this.g.nb.doMouseMove() };
    jk.prototype.showContextMenu = function(a, b) {
        !v || a instanceof da || a instanceof hk || D.k("showContextMenu:contextMenu must be an Adornment or HTMLInfo.");
        null !== b && D.l(b, O, jk, "showContextMenu:obj");
        var c = this.g;
        if (null !== c) {
            a !== this.lm && this.hideContextMenu();
            if (a instanceof da) {
                a.Nf = "Tool";
                a.il = !1;
                a.scale = 1 / c.scale;
                a.Kd = this.name;
                null !== a.placeholder && (a.placeholder.scale = c.scale);
                c.add(a);
                if (null !== b) {
                    var c = null,
                        d = b.qm();
                    null !== d && (c = d.data);
                    a.Bb = b;
                    a.data = c
                } else a.data = c.ea;
                a.kf();
                this.positionContextMenu(a,
                    b)
            } else a instanceof hk && a.show(b, c, this);
            this.lm = a
        }
    };
    jk.prototype.positionContextMenu = function(a) {
        if (null === a.placeholder) {
            var b = this.g;
            if (null !== b) {
                var c = b.U.ha.copy(),
                    d = a.Fa,
                    e = b.wb;
                b.U.Qj && (c.x -= d.width);
                c.x + d.width > e.right && (c.x -= d.width + 5);
                c.x < e.x && (c.x = e.x);
                c.y + d.height > e.bottom && (c.y -= d.height + 5);
                c.y < e.y && (c.y = e.y);
                a.position = c
            }
        }
    };
    jk.prototype.hideContextMenu = function() {
        var a = this.g;
        if (null !== a) {
            var b = this.lm;
            null !== b && (b instanceof da ? (a.remove(b), null !== this.yz && this.yz.Xj(b.Kd), b.data = null, b.Bb = null) : b instanceof hk && (null !== b.Wn ? b.Wn(a, this) : null !== b.yB && (b.yB.style.display = "none")), this.lm = null, this.standardMouseOver())
        }
    };

    function nk(a) {
        if (null === a.g) return null;
        a = new K(ik);
        a.add(new ik("Copy", function(a) { a.yb.copySelection() }, function(a) { return a.yb.canCopySelection() }));
        a.add(new ik("Cut", function(a) { a.yb.cutSelection() }, function(a) { return a.yb.canCutSelection() }));
        a.add(new ik("Delete", function(a) { a.yb.deleteSelection() }, function(a) { return a.yb.canDeleteSelection() }));
        a.add(new ik("Paste", function(a) { a.yb.pasteSelection(a.U.ha) }, function(a) { return a.yb.canPasteSelection() }));
        a.add(new ik("Select All", function(a) { a.yb.selectAll() },
            function(a) { return a.yb.canSelectAll() }));
        a.add(new ik("Undo", function(a) { a.yb.undo() }, function(a) { return a.yb.canUndo() }));
        a.add(new ik("Redo", function(a) { a.yb.redo() }, function(a) { return a.yb.canRedo() }));
        a.add(new ik("Scroll To Part", function(a) { a.yb.scrollToPart() }, function(a) { return a.yb.canScrollToPart() }));
        a.add(new ik("Zoom To Fit", function(a) { a.yb.zoomToFit() }, function(a) { return a.yb.canZoomToFit() }));
        a.add(new ik("Reset Zoom", function(a) { a.yb.resetZoom() }, function(a) { return a.yb.canResetZoom() }));
        a.add(new ik("Group Selection", function(a) { a.yb.groupSelection() }, function(a) { return a.yb.canGroupSelection() }));
        a.add(new ik("Ungroup Selection", function(a) { a.yb.ungroupSelection() }, function(a) { return a.yb.canUngroupSelection() }));
        a.add(new ik("Edit Text", function(a) { a.yb.editTextBlock() }, function(a) { return a.yb.canEditTextBlock() }));
        return a
    }
    jk.prototype.showDefaultContextMenu = function() {
        var a = this.g;
        if (null !== a) {
            null === this.Az && (this.Az = nk(this));
            D.ku.innerHTML = "";
            D.ju.addEventListener("click", this.xA, !1);
            var b = this,
                c = D.createElement("ul");
            c.className = "goCXul";
            D.ku.appendChild(c);
            c.innerHTML = "";
            for (var d = this.Az.j; d.next();) {
                var e = d.value,
                    g = e.visible;
                if ("function" === typeof e.iF && ("function" !== typeof g || g(a))) {
                    g = D.createElement("li");
                    g.className = "goCXli";
                    var h = D.createElement("a");
                    h.className = "goCXa";
                    h.href = "#";
                    h.DH = e.iF;
                    h.addEventListener("click",
                        function(c) {
                            this.DH(a);
                            b.stopTool();
                            c.preventDefault();
                            return !1
                        }, !1);
                    h.textContent = e.text;
                    g.appendChild(h);
                    c.appendChild(g)
                }
            }
            D.ku.style.display = "block";
            D.ju.style.display = "block"
        }
    };
    jk.prototype.hideDefaultContextMenu = function() { null !== this.lm && this.lm === this.Sm && (D.ku.style.display = "none", D.ju.style.display = "none", D.ju.removeEventListener("click", this.xA, !1), this.lm = null) };
    D.defineProperty(jk, { lm: "currentContextMenu" }, function() { return this.WC }, function(a) {
        !v || null === a || a instanceof da || a instanceof hk || D.k("ContextMenuTool.currentContextMenu must be an Adornment or HTMLInfo.");
        this.WC = a;
        this.yz = a instanceof da ? a.If : null
    });
    D.defineProperty(jk, { IL: "defaultTouchContextMenu" }, function() { return this.Sm }, function(a) {
        !v || null === a || a instanceof da || a instanceof hk || D.k("ContextMenuTool.defaultTouchContextMenu must be an Adornment or HTMLInfo.");
        this.Sm = a
    });
    D.defineProperty(jk, { Mx: "currentObject" }, function() { return this.ZC }, function(a) {
        null !== a && D.l(a, O, jk, "currentObject");
        this.ZC = a
    });
    D.w(jk, { kM: "mouseDownPoint" }, function() { return this.XD });

    function ok() {
        Zg.call(this);
        0 < arguments.length && D.zd(ok);
        this.name = "DragSelecting";
        this.Wo = 175;
        this.MD = !1;
        var a = new F;
        a.Nf = "Tool";
        a.il = !1;
        var b = new z;
        b.name = "SHAPE";
        b.Kb = "Rectangle";
        b.fill = null;
        b.stroke = "magenta";
        a.add(b);
        this.Om = a
    }
    D.Ta(ok, Zg);
    D.ka("DragSelectingTool", ok);
    ok.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; if (null === a || !a.Jf) return !1; var b = a.U; return !b.left || a.eb !== this && (!this.isBeyondDragSize() || b.timestamp - a.Pc.timestamp < this.qF || null !== a.su(b.ha, !0)) ? !1 : !0 };
    ok.prototype.doActivate = function() {
        var a = this.g;
        null !== a && (this.wa = !0, a.of = !0, a.kb = !0, a.add(this.Jh), this.doMouseMove())
    };
    ok.prototype.doDeactivate = function() {
        var a = this.g;
        null !== a && (Di(a), a.remove(this.Jh), a.kb = !1, this.wa = a.of = !1)
    };
    ok.prototype.doMouseMove = function() {
        var a = this.g;
        if (null !== a && this.wa && null !== this.Jh) {
            var b = this.computeBoxBounds(),
                c = this.Jh.Md("SHAPE");
            null === c && (c = this.Jh.Ld());
            c.Ea = b.size;
            this.Jh.position = b.position;
            (a.Be || a.Ce) && a.UA(a.U.te)
        }
    };
    ok.prototype.doMouseUp = function() {
        if (this.wa) {
            var a = this.g;
            a.remove(this.Jh);
            try { a.sc = "wait", this.selectInRect(this.computeBoxBounds()) } finally { a.sc = "" }
        }
        this.stopTool()
    };
    ok.prototype.computeBoxBounds = function() { var a = this.g; return null === a ? new C(0, 0, 0, 0) : new C(a.Pc.ha, a.U.ha) };
    ok.prototype.selectInRect = function(a) {
        var b = this.g;
        if (null !== b) {
            var c = b.U;
            b.Ja("ChangingSelection");
            a = b.Xk(a, null, function(a) { return a instanceof F ? a.canSelect() : !1 }, this.uJ);
            if (D.Qh ? c.Xu : c.control)
                if (c.shift)
                    for (a = a.j; a.next();) c = a.value, c.ib && (c.ib = !1);
                else
                    for (a = a.j; a.next();) c = a.value, c.ib = !c.ib;
            else {
                if (!c.shift) {
                    for (var c = new K(F), d = b.selection.j; d.next();) {
                        var e = d.value;
                        a.contains(e) || c.add(e)
                    }
                    for (c = c.j; c.next();) c.value.ib = !1
                }
                for (a = a.j; a.next();) c = a.value, c.ib || (c.ib = !0)
            }
            b.Ja("ChangedSelection")
        }
    };
    D.defineProperty(ok, { qF: "delay" }, function() { return this.Wo }, function(a) {
        D.h(a, "number", ok, "delay");
        this.Wo = a
    });
    D.defineProperty(ok, { uJ: "isPartialInclusion" }, function() { return this.MD }, function(a) {
        D.h(a, "boolean", ok, "isPartialInclusion");
        this.MD = a
    });
    D.defineProperty(ok, { Jh: "box" }, function() { return this.Om }, function(a) {
        null !== a && D.l(a, F, ok, "box");
        this.Om = a
    });

    function pk() {
        Zg.call(this);
        0 < arguments.length && D.zd(pk);
        this.name = "Panning";
        this.hA = new N;
        this.ek = !1;
        var a = this;
        this.vE = function() {
            window.document.removeEventListener("scroll", a.vE, !1);
            a.stopTool()
        }
    }
    D.Ta(pk, Zg);
    D.ka("PanningTool", pk);
    pk.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; return null === a || !a.Be && !a.Ce || !a.U.left || a.eb !== this && !this.isBeyondDragSize() ? !1 : !0 };
    pk.prototype.doActivate = function() {
        var a = this.g;
        null !== a && (this.ek ? (a.U.bubbles = !0, window.document.addEventListener("scroll", this.vE, !1)) : (a.sc = "move", a.of = !0, this.hA = a.position.copy()), this.wa = !0)
    };
    pk.prototype.doDeactivate = function() {
        var a = this.g;
        null !== a && (a.sc = "", this.wa = a.of = !1)
    };
    pk.prototype.doCancel = function() {
        var a = this.g;
        null !== a && (a.position = this.hA, a.of = !1);
        this.stopTool()
    };
    pk.prototype.doMouseMove = function() { this.move() };
    pk.prototype.doMouseUp = function() {
        this.move();
        this.stopTool()
    };
    pk.prototype.move = function() {
        var a = this.g;
        if (this.wa && a)
            if (this.ek) a.U.bubbles = !0;
            else {
                var b = a.position,
                    c = a.Pc.ha,
                    d = a.U.ha,
                    e = b.x + c.x - d.x,
                    c = b.y + c.y - d.y;
                a.Be || (e = b.x);
                a.Ce || (c = b.y);
                a.position = new N(e, c)
            }
    };
    D.defineProperty(pk, { bubbles: "bubbles" }, function() { return this.ek }, function(a) {
        D.h(a, "boolean", pk, "bubbles");
        this.ek = a
    });
    D.w(pk, { sM: "originalPosition" }, function() { return this.hA });

    function qk() {
        0 < arguments.length && D.zd(qk);
        Zg.call(this);
        this.name = "TextEditing";
        this.vA = this.Ik = null;
        this.uE = rk;
        this.Zl = null;
        this.Za = sk;
        this.bt = null;
        this.UD = 1;
        this.oE = !0;
        var a = new hk;
        this.aD = null;
        this.iD = a;
        this.Bz = null;
        tk(this, a)
    }
    D.ka("TextEditingTool", qk);
    D.Ta(qk, Zg);
    var uk;
    qk.LostFocus = uk = D.s(qk, "LostFocus", 0);
    var vk;
    qk.MouseDown = vk = D.s(qk, "MouseDown", 1);
    var wk;
    qk.Tab = wk = D.s(qk, "Tab", 2);
    var xk;
    qk.Enter = xk = D.s(qk, "Enter", 3);
    qk.SingleClick = D.s(qk, "SingleClick", 0);
    var rk;
    qk.SingleClickSelected = rk = D.s(qk, "SingleClickSelected", 1);
    var yk;
    qk.DoubleClick = yk = D.s(qk, "DoubleClick", 2);
    var sk;
    qk.StateNone = sk = D.s(qk, "StateNone", 0);
    var zk;
    qk.StateActive = zk = D.s(qk, "StateActive", 1);
    var Ak;
    qk.StateEditing = Ak = D.s(qk, "StateEditing", 2);
    var Bk;
    qk.StateValidating = Bk = D.s(qk, "StateValidating", 3);
    var Ck;
    qk.StateInvalid = Ck = D.s(qk, "StateInvalid", 4);
    var Dk;
    qk.StateValidated = Dk = D.s(qk, "StateValidated", 5);

    function tk(a, b) {
        var c = D.createElement("textarea");
        a.Bz = c;
        c.addEventListener("input", function() {
            if (null !== a.ih) {
                var b = a.LJ(this.value),
                    c = this.AK;
                this.style.width = 20 + b.Fa.width * c + "px";
                this.style.height = 10 + b.Fa.height * c + "px";
                this.rows = b.wB
            }
        }, !1);
        c.addEventListener("keydown", function(b) {
            if (null !== a.ih) {
                var c = b.which;
                13 === c ? (!1 === a.ih.ky && b.preventDefault(), a.acceptText(xk)) : 9 === c ? (a.acceptText(wk), b.preventDefault()) : 27 === c && (a.doCancel(), null !== a.g && a.g.doFocus())
            }
        }, !1);
        c.addEventListener("focus", function() { Ek(a) }, !1);
        c.addEventListener("blur", function() { Fk(a) }, !1);
        b.uC = function() { return c.value };
        b.yB = c;
        b.show = function(a, b, g) {
            if (g.state === Ck) c.style.border = "3px solid red", c.focus();
            else {
                var h = a.fb(mc),
                    k = b.position,
                    l = b.scale,
                    m = a.Jj() * l;
                m < g.yG && (m = g.yG);
                var n = a.Ga.width * m + 6,
                    p = a.Ga.height * m + 2,
                    q = (h.x - k.x) * l,
                    h = (h.y - k.y) * l;
                c.value = a.text;
                b.Hj.style.font = a.font;
                c.style.position = " absolute";
                c.style.zIndex = "100";
                c.style.font = "inherit";
                c.style.fontSize = " " + 100 * m + "%";
                c.style.lineHeight = " normal";
                c.style.width = " " + n + "px";
                c.style.height = " " + p + "px";
                c.style.left = " " + ((q - n / 2 | 0) - 1) + "px";
                c.style.top = " " + ((h - p / 2 | 0) - 1) + "px";
                c.style.text = "align: " + a.textAlign + "";
                c.style.margin = " 0";
                c.style.padding = " 1px";
                c.style.border = " 0";
                c.style.outline = " none";
                c.style.white = "space: pre-wrap";
                c.style.overflow = " hidden";
                c.AK = m;
                b.Hj.appendChild(c);
                c.focus();
                g.Qy && (c.select(), c.setSelectionRange(0, 9999))
            }
        };
        b.Wn = function(a) { a.Hj.removeChild(c) }
    }
    D.defineProperty(qk, { ih: "textBlock" }, function() { return this.vA }, function(a) {
        null !== a && D.l(a, pa, qk, "textBlock");
        this.vA = a
    });
    D.defineProperty(qk, { Fj: "currentTextEditor" }, function() { return this.aD }, function(a) { this.aD = a });
    D.defineProperty(qk, { xI: "defaultTextEditor" }, function() { return this.iD }, function(a) {
        !v || a instanceof HTMLElement || a instanceof hk || D.k("TextEditingTool.defaultTextEditor must be an Element or HTMLInfo.");
        this.iD = a
    });
    D.defineProperty(qk, { iH: "starting" }, function() { return this.uE }, function(a) {
        D.Da(a, qk, qk, "starting");
        this.uE = a
    });
    qk.prototype.canStart = function() {
        if (!this.isEnabled) return !1;
        var a = this.g;
        if (null === a || a.qb || !a.U.left || this.isBeyondDragSize()) return !1;
        var b = a.Je(a.U.ha);
        if (!(null !== b && b instanceof pa && b.XA && b.Y.canEdit())) return !1;
        b = b.Y;
        return null === b || this.iH === rk && !b.ib || this.iH === yk && 2 > a.U.Ee ? !1 : !0
    };
    qk.prototype.doStart = function() { this.wa || null === this.ih || this.doActivate() };
    qk.prototype.doActivate = function() {
        if (!this.wa) {
            var a = this.g;
            if (null !== a) {
                var b = this.ih;
                null === b && (b = a.Je(a.U.ha));
                if (null !== b && b instanceof pa && (this.ih = b, null !== b.Y)) {
                    this.wa = !0;
                    this.Za = zk;
                    var c = this.xI;
                    null !== b.mH && (c = b.mH);
                    this.Ik = this.ih.copy();
                    var d = new C(this.ih.fb(ec), this.ih.fb(vc));
                    a.WG(d);
                    if (c instanceof hk) c.show(b, a, this);
                    else {
                        c.style.position = "absolute";
                        c.style.zIndex = "100";
                        c.textEditingTool = this;
                        if ("function" === typeof c.onActivate) c.onActivate();
                        a.Hj.appendChild(c);
                        "function" === typeof c.focus &&
                            c.focus();
                        "function" === typeof c.select && this.Qy && (c.select(), c.setSelectionRange(0, 9999))
                    }
                    this.Fj = c
                }
            }
        }
    };
    qk.prototype.doCancel = function() {
        null !== this.bt && this.Fj instanceof HTMLElement && (this.Fj.style.border = this.bt, this.bt = null);
        this.stopTool()
    };
    qk.prototype.doMouseUp = function() {!this.wa && this.canStart() && this.doActivate() };
    qk.prototype.doMouseDown = function() { this.wa && this.acceptText(vk) };
    qk.prototype.acceptText = function(a) {
        switch (a) {
            case vk:
                if (this.Za === Dk) this.Fj instanceof HTMLElement && this.Fj.focus();
                else if (this.Za === zk || this.Za === Ck || this.Za === Ak) this.Za = Bk, Gk(this);
                break;
            case uk:
            case xk:
            case wk:
                if (xk === a && !0 === this.vA.ky) break;
                if (this.Za === zk || this.Za === Ck || this.Za === Ak) this.Za = Bk, Gk(this)
        }
    };

    function Gk(a) {
        var b = a.ih,
            c = a.g,
            d = a.Fj;
        if (null !== b && null !== d) {
            var e = b.text,
                g = "";
            d instanceof hk ? null !== d.uC && (g = d.uC()) : (g = d.value, g = "function" === typeof g ? g() : g);
            a.isValidText(b, e, g) ? (a.Nb(a.name), a.Za = Dk, a.Tf = a.name, b.text = g, null !== b.lH && b.lH(b, e, g), null !== c && c.Ja("TextEdited", b, e), a.kl(), a.stopTool(), null !== c && c.doFocus()) : (a.Za = Ck, null !== b.ZA && b.ZA(a, e, g), d instanceof hk ? d.show(b, c, a) : (null === a.bt && (a.bt = d.style.border, d.style.border = "3px solid red"), "function" === typeof d.focus && d.focus()))
        }
    }
    qk.prototype.doDeactivate = function() {
        var a = this.g;
        if (null !== a) {
            this.Za = sk;
            this.ih = null;
            if (null !== this.Fj) {
                var b = this.Fj;
                if (b instanceof hk) b.Wn(a, this);
                else {
                    if ("function" === typeof b.onDeactivate) b.onDeactivate();
                    null !== b && a.Hj.removeChild(b)
                }
            }
            this.wa = !1
        }
    };
    qk.prototype.doFocus = function() {
        v && D.On("TextEditingTool.doFocus", "2.0");
        Ek(this)
    };
    qk.prototype.doBlur = function() {
        v && D.On("TextEditingTool.doBlur", "2.0");
        Fk(this)
    };

    function Ek(a) {
        if (null !== a.Fj && a.state !== sk) {
            var b = a.Bz;
            a.Za === zk && (a.Za = Ak);
            "function" === typeof b.select && a.Qy && (b.select(), b.setSelectionRange(0, 9999))
        }
    }

    function Fk(a) { if (null !== a.Fj && a.state !== sk) { var b = a.Bz; "function" === typeof b.focus && b.focus(); "function" === typeof b.select && a.Qy && (b.select(), b.setSelectionRange(0, 9999)) } }
    qk.prototype.isValidText = function(a, b, c) {
        D.l(a, pa, qk, "isValidText:textblock");
        var d = this.jC;
        if (null !== d && !d(a, b, c)) return !1;
        d = a.jC;
        return null === d || d(a, b, c) ? !0 : !1
    };
    D.defineProperty(qk, { jC: "textValidation" }, function() { return this.Zl }, function(a) {
        null !== a && D.h(a, "function", qk, "textValidation");
        this.Zl = a
    });
    D.defineProperty(qk, { yG: "minimumEditorScale" }, function() { return this.UD }, function(a) {
        null !== a && D.h(a, "number", qk, "minimumEditorScale");
        this.UD = a
    });
    D.defineProperty(qk, { Qy: "selectsTextOnActivate" }, function() { return this.oE }, function(a) {
        null !== a && D.h(a, "boolean", qk, "selectsTextOnActivate");
        this.oE = a
    });
    D.defineProperty(qk, { state: "state" }, function() { return this.Za }, function(a) { this.Za !== a && (D.Da(a, qk, qk, "starting"), this.Za = a) });
    qk.prototype.measureTemporaryTextBlock = qk.prototype.LJ = function(a) {
        var b = this.Ik;
        b.text = a;
        Hk(b, this.ih.rp, Infinity);
        return b
    };

    function Ph() {
        Zg.call(this);
        this.name = "ToolManager";
        this.IH = new K(Zg);
        this.JH = new K(Zg);
        this.KH = new K(Zg);
        this.yD = this.zD = 850;
        this.nD = (new Ca(2, 2)).Oa();
        this.HE = 5E3;
        this.YD = ai;
        this.wD = Ik;
        this.Wv = this.bD = null;
        this.yn = -1
    }
    D.Ta(Ph, Zg);
    D.ka("ToolManager", Ph);
    var ai;
    Ph.WheelScroll = ai = D.s(Ph, "WheelScroll", 0);
    var $h;
    Ph.WheelZoom = $h = D.s(Ph, "WheelZoom", 1);
    Ph.WheelNone = D.s(Ph, "WheelNone", 2);
    var Ik;
    Ph.GestureZoom = Ik = D.s(Ph, "GestureZoom", 3);
    var Vk;
    Ph.GestureCancel = Vk = D.s(Ph, "GestureCancel", 4);
    var Wk;
    Ph.GestureNone = Wk = D.s(Ph, "GestureNone", 5);
    D.defineProperty(Ph, { $u: "mouseWheelBehavior" }, function() { return this.YD }, function(a) {
        D.Da(a, Ph, Ph, "mouseWheelBehavior");
        this.YD = a
    });
    D.defineProperty(Ph, { rq: "gestureBehavior" }, function() { return this.wD }, function(a) {
        D.Da(a, Ph, Ph, "gestureBehavior");
        this.wD = a
    });
    Ph.prototype.initializeStandardTools = function() {
        this.UH = new gk;
        this.HG = new fi;
        this.DJ = new Pj;
        this.TG = new Wj;
        this.kK = new dk;
        this.uG = new ra;
        this.Ge = new Uh;
        this.BI = new ok;
        this.ZJ = new pk;
        this.NA = new jk;
        this.iC = new qk;
        this.gI = new ta;
        this.hI = new fk
    };
    Ph.prototype.updateAdornments = function(a) {
        var b = this.mm;
        if (b instanceof da && this.Wv === a) {
            var c = b.Bb;
            (null !== a ? c.Y === a : null === c) ? this.showToolTip(b, c): this.hideToolTip()
        }
    };
    Ph.prototype.doMouseDown = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.U;
            b.Qj && this.rq === Vk && (b.bubbles = !1);
            if (b.Ou) { this.cancelWaitAfter(); if (this.rq === Wk) { b.bubbles = !0; return } if (this.rq === Vk) return; if (a.eb.canStartMultiTouch()) { a.eb.standardPinchZoomStart(); return } }
            var c = a.na;
            c.IA && 0 !== c.Ki && D.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");
            for (var c = this.qf.length, d = 0; d < c; d++) {
                var e = this.qf.fa(d);
                null === e.g && e.ad(this.g);
                if (e.canStart()) {
                    a.doFocus();
                    a.eb = e;
                    a.eb === e && (e.wa || e.doActivate(), e.doMouseDown());
                    return
                }
            }
            1 === a.U.button && (this.$u === ai ? this.$u = $h : this.$u === $h && (this.$u = ai));
            this.doActivate();
            this.standardWaitAfter(this.aG, b)
        }
    };
    Ph.prototype.doMouseMove = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.U;
            if (b.Ou) { if (this.rq === Wk) { b.bubbles = !0; return } if (this.rq === Vk) return; if (a.eb.canStartMultiTouch()) { a.eb.standardPinchZoomMove(); return } }
            if (this.wa)
                for (var c = this.mg.length, d = 0; d < c; d++) {
                    var e = this.mg.fa(d);
                    null === e.g && e.ad(this.g);
                    if (e.canStart()) {
                        a.doFocus();
                        a.eb = e;
                        a.eb === e && (e.wa || e.doActivate(), e.doMouseMove());
                        return
                    }
                }
            Xk(this, a);
            a = b.event;
            null === a || "mousemove" !== a.type && "pointermove" !== a.type && a.cancelable || (b.bubbles = !0)
        }
    };

    function Xk(a, b) {
        a.standardMouseOver();
        a.isBeyondDragSize() && a.standardWaitAfter(a.wa ? a.aG : a.fJ, b.U)
    }
    Ph.prototype.doCurrentObjectChanged = function(a, b) {
        var c = this.mm;
        null === c || null !== b && c instanceof da && (b === c || b.xm(c)) || this.hideToolTip()
    };
    Ph.prototype.doWaitAfter = function(a) {
        var b = this.g;
        null !== b && b.Ib && (this.doMouseHover(), this.wa || this.doToolTip(), a.Qj && !b.U.Cc && (a = a.copy(), a.button = 2, a.buttons = 2, b.U = a, b.Sp = !0, b.doMouseUp()))
    };
    Ph.prototype.doMouseHover = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.U;
            null === b.Ne && (b.Ne = a.Je(b.ha, null, null));
            var c = b.Ne;
            if (null !== c)
                for (b.Cc = !1; null !== c;) {
                    a = this.wa ? c.DB : c.EB;
                    if (null !== a && (a(b, c), b.Cc)) break;
                    c = c.R
                } else c = this.wa ? a.DB : a.EB, null !== c && c(b)
        }
    };
    Ph.prototype.doToolTip = function() {
        var a = this.g;
        if (null !== a) {
            var b = a.U;
            null === b.Ne && (b.Ne = a.Je(b.ha, null, null));
            b = b.Ne;
            if (null !== b) {
                if (a = this.mm, !(a instanceof da) || b !== a && !b.xm(a)) {
                    for (; null !== b;) {
                        a = b.lC;
                        if (null !== a) { this.showToolTip(a, b); return }
                        b = b.R
                    }
                    this.hideToolTip()
                }
            } else a = a.lC, null !== a ? this.showToolTip(a, null) : this.hideToolTip()
        }
    };
    Ph.prototype.showToolTip = function(a, b) {
        !v || a instanceof da || a instanceof hk || D.k("showToolTip:tooltip must be an Adornment or HTMLInfo.");
        null !== b && D.l(b, O, Ph, "showToolTip:obj");
        var c = this.g;
        if (null !== c) {
            a !== this.mm && this.hideToolTip();
            if (a instanceof da) {
                a.Nf = "Tool";
                a.il = !1;
                a.scale = 1 / c.scale;
                a.Kd = "ToolTip";
                null !== a.placeholder && (a.placeholder.scale = c.scale);
                c.add(a);
                if (null !== b) {
                    var c = null,
                        d = b.qm();
                    null !== d && (c = d.data);
                    a.Bb = b;
                    a.data = c
                } else a.data = c.ea;
                a.kf();
                this.positionToolTip(a, b)
            } else a instanceof
            hk && a !== this.mm && a.show(b, c, this);
            this.mm = a; - 1 !== this.yn && (D.clearTimeout(this.yn), this.yn = -1);
            c = this.FK;
            if (0 < c && Infinity !== c) {
                var e = this;
                this.yn = D.setTimeout(function() { e.hideToolTip() }, c)
            }
        }
    };
    Ph.prototype.positionToolTip = function(a) {
        if (null === a.placeholder) {
            var b = this.g;
            if (null !== b) {
                var c = b.U.ha.copy(),
                    d = a.Fa,
                    e = b.wb;
                b.U.Qj && (c.x -= d.width);
                c.x + d.width > e.right && (c.x -= d.width + 5);
                c.x < e.x && (c.x = e.x);
                c.y = c.y + 20 + d.height > e.bottom ? c.y - (d.height + 5) : c.y + 20;
                c.y < e.y && (c.y = e.y);
                a.position = c
            }
        }
    };
    Ph.prototype.hideToolTip = function() {
        -1 !== this.yn && (D.clearTimeout(this.yn), this.yn = -1);
        var a = this.g;
        if (null !== a) {
            var b = this.mm;
            null !== b && (b instanceof da ? (a.remove(b), null !== this.Wv && this.Wv.Xj(b.Kd), b.data = null, b.Bb = null) : b instanceof hk && null !== b.Wn && b.Wn(a, this), this.mm = null)
        }
    };
    D.defineProperty(Ph, { mm: "currentToolTip" }, function() { return this.bD }, function(a) {
        !v || null === a || a instanceof da || a instanceof hk || D.k("ToolManager.currentToolTip must be an Adornment or HTMLInfo.");
        this.bD = a;
        this.Wv = null !== a && a instanceof da ? a.If : null
    });
    Ph.prototype.doMouseUp = function() {
        this.cancelWaitAfter();
        var a = this.g;
        if (null !== a) {
            if (this.wa)
                for (var b = this.ng.length, c = 0; c < b; c++) {
                    var d = this.ng.fa(c);
                    null === d.g && d.ad(this.g);
                    if (d.canStart()) {
                        a.doFocus();
                        a.eb = d;
                        a.eb === d && (d.wa || d.doActivate(), d.doMouseUp());
                        return
                    }
                }
            a.doFocus();
            this.doDeactivate()
        }
    };
    Ph.prototype.doMouseWheel = function() { this.standardMouseWheel() };
    Ph.prototype.doKeyDown = function() {
        var a = this.g;
        null !== a && a.yb.doKeyDown()
    };
    Ph.prototype.doKeyUp = function() {
        var a = this.g;
        null !== a && a.yb.doKeyUp()
    };
    Ph.prototype.doCancel = function() {
        null !== di && di.doCancel();
        Zg.prototype.doCancel.call(this)
    };
    Ph.prototype.findTool = function(a) {
        D.h(a, "string", Ph, "findTool:name");
        for (var b = this.qf.length, c = 0; c < b; c++) { var d = this.qf.fa(c); if (d.name === a) return d }
        b = this.mg.length;
        for (c = 0; c < b; c++)
            if (d = this.mg.fa(c), d.name === a) return d;
        b = this.ng.length;
        for (c = 0; c < b; c++)
            if (d = this.ng.fa(c), d.name === a) return d;
        return null
    };
    Ph.prototype.replaceTool = function(a, b) {
        D.h(a, "string", Ph, "replaceTool:name");
        null !== b && (D.l(b, Zg, Ph, "replaceTool:newtool"), b.g && b.g !== this.g && D.k("Cannot share tools between Diagrams: " + b.toString()), b.ad(this.g));
        for (var c = this.qf.length, d = 0; d < c; d++) { var e = this.qf.fa(d); if (e.name === a) return null !== b ? this.qf.ug(d, b) : this.qf.pd(d), e }
        c = this.mg.length;
        for (d = 0; d < c; d++)
            if (e = this.mg.fa(d), e.name === a) return null !== b ? this.mg.ug(d, b) : this.mg.pd(d), e;
        c = this.ng.length;
        for (d = 0; d < c; d++)
            if (e = this.ng.fa(d), e.name ===
                a) return null !== b ? this.ng.ug(d, b) : this.ng.pd(d), e;
        return null
    };

    function Yk(a, b, c, d) {
        D.h(b, "string", Ph, "replaceStandardTool:name");
        D.l(d, K, Ph, "replaceStandardTool:list");
        null !== c && (D.l(c, Zg, Ph, "replaceStandardTool:newtool"), c.g && c.g !== a.g && D.k("Cannot share tools between Diagrams: " + c.toString()), c.name = b, c.ad(a.g));
        a.findTool(b) ? a.replaceTool(b, c) : null !== c && d.add(c)
    }
    D.w(Ph, { qf: "mouseDownTools" }, function() { return this.IH });
    D.w(Ph, { mg: "mouseMoveTools" }, function() { return this.JH });
    D.w(Ph, { ng: "mouseUpTools" }, function() { return this.KH });
    D.defineProperty(Ph, { fJ: "hoverDelay" }, function() { return this.zD }, function(a) {
        D.h(a, "number", Ph, "hoverDelay");
        this.zD = a
    });
    D.defineProperty(Ph, { aG: "holdDelay" }, function() { return this.yD }, function(a) {
        D.h(a, "number", Ph, "holdDelay");
        this.yD = a
    });
    D.defineProperty(Ph, { CI: "dragSize" }, function() { return this.nD }, function(a) {
        D.l(a, Ca, Ph, "dragSize");
        this.nD = a.V()
    });
    D.defineProperty(Ph, { FK: "toolTipDuration" }, function() { return this.HE }, function(a) {
        D.h(a, "number", Ph, "toolTipDuration");
        this.HE = a
    });
    D.defineProperty(Ph, { UH: "actionTool" }, function() { return this.findTool("Action") }, function(a) { Yk(this, "Action", a, this.qf) });
    D.defineProperty(Ph, { HG: "relinkingTool" }, function() { return this.findTool("Relinking") }, function(a) { Yk(this, "Relinking", a, this.qf) });
    D.defineProperty(Ph, { DJ: "linkReshapingTool" }, function() { return this.findTool("LinkReshaping") }, function(a) { Yk(this, "LinkReshaping", a, this.qf) });
    D.defineProperty(Ph, { TG: "resizingTool" }, function() { return this.findTool("Resizing") }, function(a) { Yk(this, "Resizing", a, this.qf) });
    D.defineProperty(Ph, { kK: "rotatingTool" }, function() { return this.findTool("Rotating") }, function(a) { Yk(this, "Rotating", a, this.qf) });
    D.defineProperty(Ph, { uG: "linkingTool" }, function() { return this.findTool("Linking") }, function(a) { Yk(this, "Linking", a, this.mg) });
    D.defineProperty(Ph, { Ge: "draggingTool" }, function() { return this.findTool("Dragging") }, function(a) { Yk(this, "Dragging", a, this.mg) });
    D.defineProperty(Ph, { BI: "dragSelectingTool" }, function() { return this.findTool("DragSelecting") }, function(a) { Yk(this, "DragSelecting", a, this.mg) });
    D.defineProperty(Ph, { ZJ: "panningTool" }, function() { return this.findTool("Panning") }, function(a) { Yk(this, "Panning", a, this.mg) });
    D.defineProperty(Ph, { NA: "contextMenuTool" }, function() { return this.findTool("ContextMenu") }, function(a) { Yk(this, "ContextMenu", a, this.ng) });
    D.defineProperty(Ph, { iC: "textEditingTool" }, function() { return this.findTool("TextEditing") }, function(a) { Yk(this, "TextEditing", a, this.ng) });
    D.defineProperty(Ph, { gI: "clickCreatingTool" }, function() { return this.findTool("ClickCreating") }, function(a) { Yk(this, "ClickCreating", a, this.ng) });
    D.defineProperty(Ph, { hI: "clickSelectingTool" }, function() { return this.findTool("ClickSelecting") }, function(a) { Yk(this, "ClickSelecting", a, this.ng) });

    function kh() {
        this.cD = cl;
        this.Nr = this.Pr = this.ca = null;
        this.Mm = this.Qr = this.Rr = 0;
        this.Ho = this.zc = this.np = this.sk = !1;
        this.Kl = this.rf = !0;
        this.Uv = this.Tv = this.YC = null;
        this.XC = 0;
        this.Vv = null;
        this.Jv = new L("string");
        this.Jz = 600;
        this.LH = new N(0, 0);
        this.MC = this.LC = this.KE = !1;
        this.jn = new oa(O, dl)
    }
    D.ka("AnimationManager", kh);
    kh.prototype.ad = function(a) { this.ca = a };

    function cl(a, b, c, d) { a /= d / 2; return 1 > a ? c / 2 * a * a + b : -c / 2 * (--a * (a - 2) - 1) + b }
    D.w(kh, { lL: "animationReasons" }, function() { return this.Jv });
    kh.prototype.canStart = function() { return !0 };
    kh.prototype.prepareAutomaticAnimation = kh.prototype.po = function(a) { this.rf && (this.Kl || this.ca.Zn) && (this.Jv.add(a), this.canStart(a) && (this.sk && this.Yh(), this.zc = !0)) };

    function el(a) {
        if (a.rf && (a.Jv.clear(), a.zc))
            if (!a.Ho) a.zc = !1;
            else if (0 === a.Mm) {
            var b = +new Date;
            a.Mm = b;
            requestAnimationFrame(function() {
                if (!1 !== a.zc && !a.sk && a.Mm === b) {
                    var c = a.ca;
                    c.Kj("temporaryPixelRatio") && (c.Hk = 1);
                    fl(c);
                    a.zc = !1;
                    c.Ja("AnimationStarting");
                    gl(a, b)
                }
            })
        }
    }

    function hl(a, b, c, d, e, g) {
        if (a.zc && (v && D.l(b, O, kh, "addPropToAnimation:obj"), !("position" === c && d.O(e) || b instanceof F && !b.eG))) {
            var h = a.jn;
            if (h.contains(b)) {
                var h = h.oa(b),
                    k = h.start,
                    l = h.end;
                void 0 === k[c] && (k[c] = il(d));
                h.Lx && void 0 !== l[c] ? h.pu[c] = il(e) : (g || (h.pu[c] = il(e)), l[c] = il(e));
                g && 0 === c.indexOf("position:") && b instanceof F && (h.pu.location = il(b.location))
            } else k = new ma, l = new ma, k[c] = il(d), l[c] = il(e), d = l, e = k.position, e instanceof N && !e.H() && a.Jv.contains("Expand SubGraph") && e.assign(d.position), k =
                new dl(k, l, g), g && 0 === c.indexOf("position:") && b instanceof F && (k.pu.location = il(b.location)), h.add(b, k);
            a.Ho = !0
        }
    }

    function il(a) { return a instanceof N ? a.copy() : a instanceof Ca ? a.copy() : a }

    function gl(a, b) {
        var c;

        function d() {
            if (!1 !== g.sk && g.Mm === b) {
                var a = +new Date,
                    c = a > s ? m : a - r;
                jl(g);
                kl(g, e, q, h, c, m);
                g.Tv && g.Tv();
                bj(e);
                ll(g);
                a > s ? ml(g) : requestAnimationFrame(d)
            }
        }
        void 0 === c && (c = new ma);
        var e = a.ca;
        if (null !== e) {
            var g = a,
                h = c.QL || a.cD,
                k = c.nM || null,
                l = c.oM || null,
                m = c.duration || a.Jz,
                n = a.LH;
            for (c = a.jn.j; c.next();) {
                var p = c.value.start.position;
                p instanceof N && (p.H() || p.assign(n))
            }
            a.YC = h;
            a.Tv = k;
            a.Uv = l;
            a.XC = m;
            a.Vv = a.jn;
            var q = a.Vv;
            for (c = q.j; c.next();) k = c.value.end, k["position:placeholder"] && (l = c.key.findVisibleNode(),
                l instanceof I && null !== l.placeholder && (l = l.placeholder, n = l.fb(ec), n.x += l.padding.left, n.y += l.padding.top, k["position:placeholder"] = n));
            a.sk = !0;
            jl(a);
            kl(a, e, q, h, 0, m);
            bj(a.ca);
            ll(a);
            var r = +new Date,
                s = r + m;
            g.Mm === b && requestAnimationFrame(function() { d() })
        }
    }

    function jl(a) {
        if (!a.np) {
            var b = a.ca;
            a.KE = b.kb;
            a.LC = b.Xe;
            a.MC = b.rv;
            b.kb = !0;
            b.Xe = !0;
            b.rv = !0;
            a.np = !0
        }
    }

    function ll(a) {
        var b = a.ca;
        b.kb = a.KE;
        b.Xe = a.LC;
        b.rv = a.MC;
        a.np = !1
    }

    function kl(a, b, c, d, e, g) {
        for (c = c.j; c.next();) {
            var h = c.key,
                k = c.value,
                l = k.start,
                k = k.end,
                m;
            for (m in k)
                if (("position" !== m || !k["position:placeholder"] && !k["position:node"]) && void 0 !== nl[m]) nl[m](h, l[m], k[m], d, e, g)
        }
        d = b.qB;
        b.qB = !0;
        m = a.cD;
        0 !== a.Rr && 0 !== a.Qr && (c = a.Rr, b.Db = m(e, c, a.Qr - c, g));
        null !== a.Pr && null !== a.Nr && (c = a.Pr, a = a.Nr, b.sb = new N(m(e, c.x, a.x - c.x, g), m(e, c.y, a.y - c.y, g)));
        b.qB = d
    }
    kh.prototype.stopAnimation = kh.prototype.Yh = function() {
        !0 === this.zc && (this.zc = !1, this.Mm = 0, this.Ho && this.ca.Ve());
        this.sk && this.rf && ml(this)
    };

    function ml(a) {
        a.sk = !1;
        a.Ho = !1;
        jl(a);
        for (var b = a.ca, c = a.YC, d = a.XC, e = a.Vv.j; e.next();) {
            var g = e.key,
                h = e.value,
                k = h.start,
                l = h.end,
                m = h.pu,
                n;
            for (n in l)
                if (void 0 !== nl[n]) {
                    var p = n;
                    !h.Lx || "position:node" !== p && "position:placeholder" !== p || (p = "position");
                    nl[p](g, k[n], void 0 !== m[n] ? m[n] : h.Lx ? k[n] : l[n], c, d, d)
                }
            h.Lx && void 0 !== m.location && g instanceof F && (g.location = m.location);
            h.Hy && g instanceof F && g.Pd(!1)
        }
        for (c = a.ca.links; c.next();) d = c.value, null !== d.Hp && (d.points = d.Hp, d.Hp = null);
        b.ty.clear();
        b.Hk = null;
        b.Qc();
        b.ra();
        b.lg();
        ol(b);
        ll(a);
        a.Uv && a.Uv();
        a.Mm = 0;
        a.Vv = null;
        a.Uv = null;
        a.Tv = null;
        a.Pr = null;
        a.Nr = null;
        a.Rr = 0;
        a.Qr = 0;
        a.jn = new oa(O, dl);
        b.Ja("AnimationFinished");
        b.Ve()
    }

    function pl(a, b, c) {
        var d = b.aa,
            e = c.aa,
            g = null;
        c instanceof I && (g = c.placeholder);
        null !== g ? (d = g.fb(ec), d.x += g.padding.left, d.y += g.padding.top, hl(a, b, "position", d, b.position, !1)) : hl(a, b, "position", new N(e.x + e.width / 2 - d.width / 2, e.y + e.height / 2 - d.height / 2), b.position, !1);
        hl(a, b, "scale", .01, b.scale, !1);
        if (b instanceof I)
            for (b = b.uc; b.next();) g = b.value, g instanceof G && pl(a, g, c)
    }

    function ql(a, b, c) {
        if (b.isVisible()) {
            var d = null;
            c instanceof I && (d = c.placeholder);
            null !== d ? hl(a, b, "position:placeholder", b.position, d, !0) : hl(a, b, "position:node", b.position, c, !0);
            hl(a, b, "scale", b.scale, .01, !0);
            a.zc && (d = a.jn, d.contains(b) && (d.oa(b).Hy = !0));
            if (b instanceof I)
                for (b = b.uc; b.next();) d = b.value, d instanceof G && ql(a, d, c)
        }
    }

    function rl(a, b, c) { a.zc && (null === a.Pr && b.H() && null === a.Nr && (a.Pr = b.copy()), a.Nr = c.copy(), a.Ho = !0) }

    function sl(a, b, c) { a.zc && a.ca.Zn && (0 === a.Rr && 0 === a.Qr && (a.Rr = b), a.Qr = c, a.Ho = !0) }
    D.defineProperty(kh, { isEnabled: "isEnabled" }, function() { return this.rf }, function(a) {
        D.h(a, "boolean", kh, "isEnabled");
        this.rf = a
    });
    D.defineProperty(kh, { duration: "duration" }, function() { return this.Jz }, function(a) {
        D.h(a, "number", kh, "duration");
        1 > a && D.ua(a, ">= 1", kh, "duration");
        this.Jz = a
    });
    D.w(kh, { nf: "isAnimating" }, function() { return this.sk });
    D.w(kh, { vJ: "isTicking" }, function() { return this.np });
    D.defineProperty(kh, { kG: "isInitial" }, function() { return this.Kl }, function(a) {
        D.h(a, "boolean", kh, "isInitial");
        this.Kl = a
    });

    function dl(a, b, c) {
        this.start = a;
        this.end = b;
        this.pu = new ma;
        this.Lx = c;
        this.Hy = !1
    }
    var nl = {
        opacity: function(a, b, c, d, e, g) { a.opacity = d(e, b, c - b, g) },
        position: function(a, b, c, d, e, g) { e !== g ? a.Uy(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) : a.position = new N(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) },
        "position:node": function(a, b, c, d, e, g) {
            var h = a.aa,
                k = c.aa;
            c = k.x + k.width / 2 - h.width / 2;
            h = k.y + k.height / 2 - h.height / 2;
            e !== g ? a.Uy(d(e, b.x, c - b.x, g), d(e, b.y, h - b.y, g)) : a.position = new N(d(e, b.x, c - b.x, g), d(e, b.y, h - b.y, g))
        },
        "position:placeholder": function(a, b, c, d, e, g) {
            e !== g ? a.Uy(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) :
                a.position = new N(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g))
        },
        scale: function(a, b, c, d, e, g) { a.scale = d(e, b, c - b, g) },
        visible: function(a, b, c, d, e, g) { a.visible = e !== g ? b : c }
    };

    function Hg() {
        0 < arguments.length && D.zd(Hg);
        D.xc(this);
        this.ca = null;
        this.rb = new K(F);
        this.$b = "";
        this.Lc = 1;
        this.Zz = !1;
        this.Ul = this.BA = this.ul = this.tl = this.sl = this.rl = this.pl = this.ql = this.ol = this.wl = this.nl = this.vl = this.ml = this.ll = !0;
        this.Wz = !1;
        this.Pw = []
    }
    D.ka("Layer", Hg);
    Hg.prototype.ad = function(a) { this.ca = a };
    Hg.prototype.toString = function(a) {
        void 0 === a && (a = 0);
        var b = 'Layer "' + this.name + '"';
        if (0 >= a) return b;
        for (var c = 0, d = 0, e = 0, g = 0, h = 0, k = this.rb.j; k.next();) {
            var l = k.value;
            l instanceof I ? e++ : l instanceof G ? d++ : l instanceof J ? g++ : l instanceof da ? h++ : c++
        }
        k = "";
        0 < c && (k += c + " Parts ");
        0 < d && (k += d + " Nodes ");
        0 < e && (k += e + " Groups ");
        0 < g && (k += g + " Links ");
        0 < h && (k += h + " Adornments ");
        if (1 < a)
            for (a = this.rb.j; a.next();) c = a.value, k += "\n    " + c.toString(), d = c.data, null !== d && D.Nd(d) && (k += " #" + D.Nd(d)), c instanceof G ? k += " " +
                ia(d) : c instanceof J && (k += " " + ia(c.$) + " " + ia(c.ba));
        return b + " " + this.rb.count + ": " + k
    };
    Hg.prototype.findObjectAt = Hg.prototype.Je = function(a, b, c) {
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        if (!1 === this.Ul) return null;
        v && !a.H() && D.k("findObjectAt: Point must have a real value, not: " + a.toString());
        var d = !1;
        null !== this.g && this.g.wb.Pa(a) && (d = !0);
        for (var e = D.P(), g = this.rb.o, h = g.length; h--;) { var k = g[h]; if ((!0 !== d || !1 !== tl(k)) && k.isVisible() && (e.assign(a), kb(e, k.Hh), k = k.Je(e, b, c), null !== k && (null !== b && (k = b(k)), null !== k && (null === c || c(k))))) return D.A(e), k }
        D.A(e);
        return null
    };
    Hg.prototype.findObjectsAt = Hg.prototype.ru = function(a, b, c, d) {
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        d instanceof K || d instanceof L || (d = new L(O));
        if (!1 === this.Ul) return d;
        v && !a.H() && D.k("findObjectsAt: Point must have a real value, not: " + a.toString());
        var e = !1;
        null !== this.g && this.g.wb.Pa(a) && (e = !0);
        for (var g = D.P(), h = this.rb.o, k = h.length; k--;) {
            var l = h[k];
            if ((!0 !== e || !1 !== tl(l)) && l.isVisible()) {
                g.assign(a);
                kb(g, l.Hh);
                var m = l;
                l.ru(g, b, c, d) && (null !== b && (m = b(m)), null === m || null !== c && !c(m) || (d instanceof L && d.add(m), d instanceof K && d.add(m)))
            }
        }
        D.A(g);
        return d
    };
    Hg.prototype.findObjectsIn = Hg.prototype.Xk = function(a, b, c, d, e) {
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        void 0 === d && (d = !1);
        e instanceof K || e instanceof L || (e = new L(O));
        if (!1 === this.Ul) return e;
        v && !a.H() && D.k("findObjectsIn: Rect must have a real value, not: " + a.toString());
        var g = !1;
        null !== this.g && this.g.wb.Sk(a) && (g = !0);
        for (var h = this.rb.o, k = h.length; k--;) {
            var l = h[k];
            if ((!0 !== g || !1 !== tl(l)) && l.isVisible()) {
                var m = l;
                l.Xk(a, b, c, d, e) && (null !== b && (m = b(m)), null === m || null !== c && !c(m) || (e instanceof L && e.add(m),
                    e instanceof K && e.add(m)))
            }
        }
        return e
    };
    Hg.prototype.$A = function(a, b, c, d, e, g, h) {
        if (!1 === this.Ul) return e;
        for (var k = this.rb.o, l = k.length; l--;) {
            var m = k[l];
            if ((!0 !== h || !1 !== tl(m)) && g(m) && m.isVisible()) {
                var n = m;
                m.Xk(a, b, c, d, e) && (null !== b && (n = b(n)), null === n || null !== c && !c(n) || (e instanceof L && e.add(n), e instanceof K && e.add(n)))
            }
        }
        return e
    };
    Hg.prototype.findObjectsNear = Hg.prototype.Pn = function(a, b, c, d, e, g) {
        void 0 === c && (c = null);
        void 0 === d && (d = null);
        void 0 === e && (e = !0);
        if (!1 !== e && !0 !== e) {
            if (e instanceof K || e instanceof L) g = e;
            e = !0
        }
        g instanceof K || g instanceof L || (g = new L(O));
        if (!1 === this.Ul) return g;
        v && !a.H() && D.k("findObjectsNear: Point must have a real value, not: " + a.toString());
        var h = !1;
        null !== this.g && this.g.wb.Pa(a) && (h = !0);
        for (var k = D.P(), l = D.P(), m = this.rb.o, n = m.length; n--;) {
            var p = m[n];
            if ((!0 !== h || !1 !== tl(p)) && p.isVisible()) {
                k.assign(a);
                kb(k, p.Hh);
                l.n(a.x + b, a.y);
                kb(l, p.Hh);
                var q = p;
                p.Pn(k, l, c, d, e, g) && (null !== c && (q = c(q)), null === q || null !== d && !d(q) || (g instanceof L && g.add(q), g instanceof K && g.add(q)))
            }
        }
        D.A(k);
        D.A(l);
        return g
    };
    f = Hg.prototype;
    f.Pf = function(a, b) {
        if (this.visible) {
            var c;
            c = void 0 === b ? a.wb : b;
            for (var d = this.rb.o, e = d.length, g = 0; g < e; g++) {
                var h = d[g];
                h.QD = g;
                if (!(h instanceof J && !1 === h.Uf)) {
                    if (h instanceof da) { var k = h; if (null !== k.If) continue }
                    if (Ob(h.aa, c))
                        for (h.Pf(!0), ul(h), h = h.zx; h.next();) k = h.value, Hk(k, Infinity, Infinity), k.rc(), k.Pf(!0);
                    else h.Pf(!1), null !== h.zx && 0 < h.zx.count && ul(h)
                }
            }
        }
    };
    f.He = function(a, b, c) {
        if (this.visible && 0 !== this.Lc && (void 0 === c && (c = !0), c || !this.Yc)) {
            c = this.rb.o;
            var d = c.length;
            if (0 !== d) {
                1 !== this.Lc && (a.globalAlpha = this.Lc);
                var e = this.Pw;
                e.length = 0;
                for (var g = b.scale, h = 0; h < d; h++) {
                    var k = c[h];
                    if (tl(k)) {
                        if (k instanceof J) {
                            var l = k;
                            l.ic && e.push(l);
                            if (!1 === l.Uf) continue
                        }
                        l = k.aa;
                        1 < l.width * g || 1 < l.height * g ? k.He(a, b) : vl(k, a)
                    }
                }
                a.globalAlpha = 1
            }
        }
    };

    function wl(a, b, c, d) {
        if (a.visible && 0 !== a.Lc) {
            1 !== a.Lc && (b.globalAlpha = a.Lc);
            var e = a.Pw;
            e.length = 0;
            var g = c.scale;
            a = a.rb.o;
            for (var h = a.length, k = d.length, l = 0; l < h; l++) {
                var m = a[l];
                if (tl(m)) {
                    if (m instanceof J) {
                        var n = m;
                        n.ic && e.push(n);
                        if (!1 === n.Uf) continue
                    }
                    var n = xl(m, m.aa),
                        p;
                    a: {
                        p = n;
                        for (var q = d, r = k, s = 2 / g, u = 4 / g, t = 0; t < r; t++) { var y = q[t]; if (0 !== y.width && 0 !== y.height && p.cG(y.x - s, y.y - s, y.width + u, y.height + u)) { p = !0; break a } }
                        p = !1
                    }
                    p && (1 < n.width * g || 1 < n.height * g ? m.He(b, c) : vl(m, b))
                }
            }
            b.globalAlpha = 1
        }
    }
    f.i = function(a, b, c, d, e) {
        var g = this.g;
        null !== g && g.od(fg, a, this, b, c, d, e)
    };
    f.uq = function(a, b, c) {
        var d = this.rb;
        b.xw = this;
        if (a >= d.count) a = d.count;
        else if (d.fa(a) === b) return -1;
        d.be(a, b);
        b.Fu(c);
        d = this.g;
        null !== d && (c ? d.ra() : d.uq(b));
        yl(this, a, b);
        return a
    };
    f.yf = function(a, b, c) {
        if (!c && b.layer !== this && null !== b.layer) return b.layer.yf(a, b, c);
        var d = this.rb;
        if (0 > a || a >= d.length) { if (a = d.indexOf(b), 0 > a) return -1 } else if (d.fa(a) !== b && (a = d.indexOf(b), 0 > a)) return -1;
        b.Gu(c);
        d.pd(a);
        d = this.g;
        null !== d && (c ? d.ra() : d.yf(b));
        b.xw = null;
        return a
    };

    function yl(a, b, c) {
        b = zl(a, b, c);
        if (c instanceof I && null !== c && isNaN(c.Co)) {
            if (0 !== c.uc.count) { for (var d = -1, e = a.rb.o, g = e.length, h = 0; h < g; h++) { var k = e[h]; if (k === c && (b = h, 0 <= d)) break; if (0 > d && k.Ka === c && (d = h, 0 <= b)) break }!(0 > d) && d < b && (e = a.rb, e.pd(b), e.be(d, c)) }
            c = c.Ka;
            null !== c && yl(a, -1, c)
        }
    }

    function zl(a, b, c) {
        var d = c.Co;
        if (isNaN(d)) return b;
        a = a.rb;
        var e = a.count;
        if (1 >= e) return b;
        0 > b && (b = a.indexOf(c));
        if (0 > b) return -1;
        for (var g = b - 1, h = NaN; 0 <= g;) {
            h = a.fa(g).Co;
            if (!isNaN(h)) break;
            g--
        }
        for (var k = b + 1, l = NaN; k < e;) {
            l = a.fa(k).Co;
            if (!isNaN(l)) break;
            k++
        }
        if (!isNaN(h) && h > d)
            for (;;) {
                if (-1 === g || h <= d) {
                    g++;
                    if (g === b) break;
                    a.pd(b);
                    a.be(g, c);
                    return g
                }
                for (h = NaN; 0 <= --g && (h = a.fa(g).Co, isNaN(h)););
            } else if (!isNaN(l) && l < d)
                for (;;) {
                    if (k === e || l >= d) {
                        k--;
                        if (k === b) break;
                        a.pd(b);
                        a.be(k, c);
                        return k
                    }
                    for (l = NaN; ++k < e && (l = a.fa(k).Co,
                            isNaN(l)););
                }
        return b
    }
    f.clear = function() { for (var a = this.rb.Fc(), b = a.length, c = 0; c < b; c++) a[c].Pf(!1), this.yf(-1, a[c], !1) };
    D.w(Hg, { Hi: "parts" }, function() { return this.rb.j });
    D.w(Hg, { xM: "partsBackwards" }, function() { return this.rb.$n });
    D.w(Hg, { g: "diagram" }, function() { return this.ca });
    D.defineProperty(Hg, { name: "name" }, function() { return this.$b }, function(a) {
        D.h(a, "string", Hg, "name");
        var b = this.$b;
        if (b !== a) {
            var c = this.g;
            if (null !== c)
                for ("" === b && D.k("Cannot rename default Layer to: " + a), c = c.ao; c.next();) c.value.name === a && D.k("Layer.name is already present in this diagram: " + a);
            this.$b = a;
            this.i("name", b, a);
            for (a = this.rb.j; a.next();) a.value.Nf = this.$b
        }
    });
    D.defineProperty(Hg, { opacity: "opacity" }, function() { return this.Lc }, function(a) {
        var b = this.Lc;
        b !== a && (D.h(a, "number", Hg, "opacity"), (0 > a || 1 < a) && D.ua(a, "0 <= value <= 1", Hg, "opacity"), this.Lc = a, this.i("opacity", b, a), a = this.g, null !== a && a.ra())
    });
    D.defineProperty(Hg, { Yc: "isTemporary" }, function() { return this.Zz }, function(a) {
        var b = this.Zz;
        b !== a && (D.h(a, "boolean", Hg, "isTemporary"), this.Zz = a, this.i("isTemporary", b, a))
    });
    D.defineProperty(Hg, { visible: "visible" }, function() { return this.BA }, function(a) {
        var b = this.BA;
        if (b !== a) {
            D.h(a, "boolean", Hg, "visible");
            this.BA = a;
            this.i("visible", b, a);
            for (b = this.rb.j; b.next();) b.value.Pd(a);
            a = this.g;
            null !== a && a.ra()
        }
    });
    D.defineProperty(Hg, { tg: "pickable" }, function() { return this.Ul }, function(a) {
        var b = this.Ul;
        b !== a && (D.h(a, "boolean", Hg, "pickable"), this.Ul = a, this.i("pickable", b, a))
    });
    D.defineProperty(Hg, { fG: "isBoundsIncluded" }, function() { return this.Wz }, function(a) { this.Wz !== a && (this.Wz = a, null !== this.g && this.g.Qc()) });
    D.defineProperty(Hg, { Pk: "allowCopy" }, function() { return this.ll }, function(a) {
        var b = this.ll;
        b !== a && (D.h(a, "boolean", Hg, "allowCopy"), this.ll = a, this.i("allowCopy", b, a))
    });
    D.defineProperty(Hg, { Cn: "allowDelete" }, function() { return this.ml }, function(a) {
        var b = this.ml;
        b !== a && (D.h(a, "boolean", Hg, "allowDelete"), this.ml = a, this.i("allowDelete", b, a))
    });
    D.defineProperty(Hg, { Dx: "allowTextEdit" }, function() { return this.vl }, function(a) {
        var b = this.vl;
        b !== a && (D.h(a, "boolean", Hg, "allowTextEdit"), this.vl = a, this.i("allowTextEdit", b, a))
    });
    D.defineProperty(Hg, { Ax: "allowGroup" }, function() { return this.nl }, function(a) {
        var b = this.nl;
        b !== a && (D.h(a, "boolean", Hg, "allowGroup"), this.nl = a, this.i("allowGroup", b, a))
    });
    D.defineProperty(Hg, { Ex: "allowUngroup" }, function() { return this.wl }, function(a) {
        var b = this.wl;
        b !== a && (D.h(a, "boolean", Hg, "allowUngroup"), this.wl = a, this.i("allowUngroup", b, a))
    });
    D.defineProperty(Hg, { eu: "allowLink" }, function() { return this.ol }, function(a) {
        var b = this.ol;
        b !== a && (D.h(a, "boolean", Hg, "allowLink"), this.ol = a, this.i("allowLink", b, a))
    });
    D.defineProperty(Hg, { Dn: "allowRelink" }, function() { return this.ql }, function(a) {
        var b = this.ql;
        b !== a && (D.h(a, "boolean", Hg, "allowRelink"), this.ql = a, this.i("allowRelink", b, a))
    });
    D.defineProperty(Hg, { fm: "allowMove" }, function() { return this.pl }, function(a) {
        var b = this.pl;
        b !== a && (D.h(a, "boolean", Hg, "allowMove"), this.pl = a, this.i("allowMove", b, a))
    });
    D.defineProperty(Hg, { Bx: "allowReshape" }, function() { return this.rl }, function(a) {
        var b = this.rl;
        b !== a && (D.h(a, "boolean", Hg, "allowReshape"), this.rl = a, this.i("allowReshape", b, a))
    });
    D.defineProperty(Hg, { fu: "allowResize" }, function() { return this.sl }, function(a) {
        var b = this.sl;
        b !== a && (D.h(a, "boolean", Hg, "allowResize"), this.sl = a, this.i("allowResize", b, a))
    });
    D.defineProperty(Hg, { Cx: "allowRotate" }, function() { return this.tl }, function(a) {
        var b = this.tl;
        b !== a && (D.h(a, "boolean", Hg, "allowRotate"), this.tl = a, this.i("allowRotate", b, a))
    });
    D.defineProperty(Hg, { Jf: "allowSelect" }, function() { return this.ul }, function(a) {
        var b = this.ul;
        b !== a && (D.h(a, "boolean", Hg, "allowSelect"), this.ul = a, this.i("allowSelect", b, a))
    });

    function E(a) {
        function b() {
            window.document.removeEventListener("DOMContentLoaded", b, !1);
            Al(c)
        }
        1 < arguments.length && D.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");
        D.xc(this);
        Bl = [];
        this.ed = !0;
        this.JC = new kh;
        this.JC.ad(this);
        this.Xd = 17;
        this.rs = !1;
        this.lA = "default";
        var c = this;
        null !== window.document.body ? Al(this) : window.document.addEventListener("DOMContentLoaded", b, !1);
        this.dc = new K(Hg);
        this.Tb = this.Pb = 0;
        this.Ek = this.Ub = this.dd = this.Ib = null;
        this.NG();
        this.kp =
            null;
        this.MG();
        this.sb = (new N(NaN, NaN)).freeze();
        this.Db = 1;
        this.mw = (new N(NaN, NaN)).freeze();
        this.nw = NaN;
        this.Gw = 1E-4;
        this.Dw = 100;
        this.Nc = new Ea;
        this.wx = (new N(NaN, NaN)).freeze();
        this.ew = (new C(NaN, NaN, NaN, NaN)).freeze();
        this.Zw = (new Lb(0, 0, 0, 0)).freeze();
        this.$w = Cl;
        this.ex = !0;
        this.Ww = this.Uw = null;
        this.Nm = Vh;
        this.No = Vc;
        this.Il = Vh;
        this.hp = Vc;
        this.ow = this.lw = ec;
        this.Oe = !0;
        this.ms = !1;
        this.Gg = new L(F);
        this.Cl = new oa(J, C);
        this.Ur = !0;
        this.pr = 250;
        this.Io = -1;
        this.Lv = (new Lb(16, 16, 16, 16)).freeze();
        this.Sr =
            this.cg = !1;
        this.bp = !0;
        this.aj = new bg;
        this.Hd = new bg;
        this.cc = new bg;
        this.xh = this.Qi = null;
        this.Sp = !1;
        this.Ez = this.Fz = null;
        this.mz = window.PointerEvent && (D.zq || D.Aq || D.rB) && window.navigator && !1 !== window.navigator.msPointerEnabled;
        Dl(this);
        this.Ap = new L(G);
        this.$l = new L(I);
        this.tp = new L(J);
        this.rb = new L(F);
        this.tw = !0;
        this.qx = El;
        this.CD = !1;
        this.tx = fj;
        this.zz = this.Cz = this.wA = null;
        this.Sv = "";
        this.Mr = "auto";
        this.Ui = this.wj = this.kj = this.Jw = this.lj = this.mj = this.nj = this.Ti = this.Yi = this.Ri = null;
        this.fA = !1;
        this.jA = {};
        this.Dp = [null, null];
        this.wz = null;
        this.hr = this.Dz = this.rA = this.pE = this.vj = !1;
        this.OD = !0;
        this.Yz = this.je = !1;
        this.ye = null;
        var d = this;
        this.VD = function(a) { if (a.ea === d.ea && d.$a) { d.$a = !1; try { var b = a.Oc; "" === a.Cf && b === fg && Fl(d, a.object, a.propertyName) } finally { d.$a = !0 } } };
        this.WD = function(a) { Gl(d, a) };
        this.NE = !0;
        this.rh = -2;
        this.Vi = new oa(Object, F);
        this.gk = new oa(Object, J);
        this.Zm = new oa(Object, Array);
        this.Cp = new oa("string", Array);
        this.iA = new K(Hl);
        this.dj = !1;
        this.ml = this.ll = this.Bv = this.rf = !0;
        this.Dv = this.Cv = !1;
        this.Iv = this.Gv = this.ul = this.tl = this.sl = this.rl = this.pl = this.ql = this.ol = this.Fv = this.wl = this.nl = this.vl = !0;
        this.th = this.LD = !1;
        this.Hv = this.Ev = this.jw = this.iw = !0;
        this.bx = this.Yw = 16;
        this.nA = this.Xw = !1;
        this.yt = this.ax = null;
        this.oA = this.pA = 0;
        this.tf = (new Lb(5)).freeze();
        this.ix = (new L(F)).freeze();
        this.Ew = 999999999;
        this.kw = (new L(F)).freeze();
        this.Jl = this.Wm = this.rk = !0;
        this.Gl = this.qk = !1;
        this.we = null;
        this.xl = !0;
        this.sh = !1;
        this.HH = new L(J);
        this.AD = new L(Il);
        this.Wd = null;
        this.aE = 1;
        this.sE = 0;
        this.Fh = { scale: 1, position: new N, bounds: new C, isScroll: !1 };
        this.ME = (new C(NaN, NaN, NaN, NaN)).freeze();
        this.Zv = (new C(NaN, NaN, NaN, NaN)).freeze();
        this.uw = !1;
        this.aw = null;
        this.Qw = new L(Jl);
        Kl(this);
        this.zw = this.gw = this.Kw = this.fD = this.eD = this.gD = this.xk = this.El = this.oj = null;
        Ll(this);
        this.Ed = null;
        this.fw = !1;
        this.Qo = null;
        this.nb = new Ph;
        this.nb.initializeStandardTools();
        this.eb = this.mu = this.nb;
        this.yb = new qa;
        this.ea = new Y;
        this.vj = !0;
        this.Yb = new $g;
        this.vj = !1;
        this.rD = this.Iz = null;
        this.ud = 1;
        this.Hk = null;
        var e = D.vfo.split(".");
        !0 !== D.Qx.licenseKey && "1" === e[0] && 7 > parseInt(e[1], 10) && (D.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version " + D.vfo + ". This license key will do nothing until you upgrade to GoJS 1.7 or later."), D.Qx.licenseKey = !0);
        this.ji = 1;
        this.wk = 0;
        this.ww = new N;
        this.yA = 500;
        this.Kv = new N;
        this.Ht = null;
        this.uk = !1;
        this.preventDefault = this.Gy = this.Lq = this.Mq = this.Kq = this.Jq = this.ko = this.mo = this.lo = this.io = this.jo = this.vC = this.mC = this.nC = this.oC = this.Wl = this.ut =
            this.Vl = this.tt = null;
        this.qw = !1;
        this.Hl = new Ml;
        void 0 !== a && Nl(this, a);
        this.ed = !1
    }
    D.ka("Diagram", E);
    E.prototype.clear = E.prototype.clear = function() {
        var a = null;
        null !== this.Ed && (a = this.Ed.Y);
        this.ea.clear();
        for (var b = this.dc.length, c = 0; c < b; c++) this.dc.o[c].clear();
        this.Gg.clear();
        this.Cl.clear();
        this.Ap.clear();
        this.$l.clear();
        this.tp.clear();
        this.rb.clear();
        this.Vi.clear();
        this.gk.clear();
        this.Zm.clear();
        this.ix.Xa();
        this.ix.clear();
        this.ix.freeze();
        this.kw.Xa();
        this.kw.clear();
        this.kw.freeze();
        Nh = this.Qo = null;
        Oh = "";
        this.Zv = (new C(NaN, NaN, NaN, NaN)).freeze();
        null !== a && (this.add(a), this.rb.remove(a));
        this.ra()
    };
    E.prototype.reset = E.prototype.reset = function() {
        this.ed = !0;
        this.clear();
        this.dc = new K(Hg);
        this.NG();
        this.MG();
        this.sb = (new N(NaN, NaN)).freeze();
        this.Db = 1;
        this.mw = (new N(NaN, NaN)).freeze();
        this.nw = NaN;
        this.Gw = 1E-4;
        this.Dw = 100;
        this.wx = (new N(NaN, NaN)).freeze();
        this.ew = (new C(NaN, NaN, NaN, NaN)).freeze();
        this.Zw = (new Lb(0, 0, 0, 0)).freeze();
        this.$w = Cl;
        this.ex = !0;
        this.Ww = this.Uw = null;
        this.Nm = Vh;
        this.No = Vc;
        this.Il = Vh;
        this.hp = Vc;
        this.ow = this.lw = ec;
        this.pr = 250;
        this.Lv = (new Lb(16, 16, 16, 16)).freeze();
        this.tw = !0;
        this.qx = El;
        this.tx = fj;
        this.Mr = "auto";
        this.Ui = this.wj = this.kj = this.Jw = this.lj = this.mj = this.nj = this.Ti = this.Yi = this.Ri = null;
        this.dj = !1;
        this.ml = this.ll = this.Bv = this.rf = !0;
        this.Dv = this.Cv = !1;
        this.Hv = this.Ev = this.jw = this.iw = this.Iv = this.Gv = this.ul = this.tl = this.sl = this.rl = this.pl = this.ql = this.ol = this.Fv = this.wl = this.nl = this.vl = !0;
        this.bx = this.Yw = 16;
        this.tf = (new Lb(5)).freeze();
        this.Ew = 999999999;
        this.we = null;
        this.uw = !1;
        Ll(this);
        this.Ed = null;
        this.nb = new Ph;
        this.nb.initializeStandardTools();
        this.eb = this.mu =
            this.nb;
        this.yb = new qa;
        this.vj = !0;
        Kl(this);
        this.Yb = new $g;
        this.vj = !1;
        this.ea = new Y;
        this.sh = !1;
        this.bp = !0;
        this.ed = this.cg = !1;
        this.ra();
        this.xh = this.Qi = null;
        Dl(this);
        this.Sv = ""
    };

    function Ll(a) {
        a.oj = new oa("string", F);
        var b = new G,
            c = new pa;
        c.bind(new ph("text", "", ia));
        b.add(c);
        a.gD = b;
        a.oj.add("", b);
        b = new G;
        c = new pa;
        c.stroke = "brown";
        c.bind(new ph("text", "", ia));
        b.add(c);
        a.oj.add("Comment", b);
        b = new G;
        b.il = !1;
        b.HA = !1;
        c = new z;
        c.Kb = "Ellipse";
        c.fill = "black";
        c.stroke = null;
        c.Ea = (new Ca(3, 3)).Oa();
        b.add(c);
        a.oj.add("LinkLabel", b);
        a.El = new oa("string", I);
        b = new I;
        b.Py = "GROUPPANEL";
        b.type = Ol;
        c = new pa;
        c.font = "bold 12pt sans-serif";
        c.bind(new ph("text", "", ia));
        b.add(c);
        c = new x(Pl);
        c.name =
            "GROUPPANEL";
        var d = new z;
        d.Kb = "Rectangle";
        d.fill = "rgba(128,128,128,0.2)";
        d.stroke = "black";
        c.add(d);
        d = new Yj;
        d.padding = (new Lb(5, 5, 5, 5)).Oa();
        c.add(d);
        b.add(c);
        a.eD = b;
        a.El.add("", b);
        a.xk = new oa("string", J);
        b = new J;
        c = new z;
        c.Ue = !0;
        b.add(c);
        c = new z;
        c.ar = "Standard";
        c.fill = "black";
        c.stroke = null;
        c.lb = 0;
        b.add(c);
        a.fD = b;
        a.xk.add("", b);
        b = new J;
        c = new z;
        c.Ue = !0;
        c.stroke = "brown";
        b.add(c);
        a.xk.add("Comment", b);
        b = new da;
        b.type = Pl;
        c = new z;
        c.fill = null;
        c.stroke = "dodgerblue";
        c.lb = 3;
        b.add(c);
        c = new Yj;
        c.margin = (new Lb(1.5,
            1.5, 1.5, 1.5)).Oa();
        b.add(c);
        a.Kw = b;
        a.gw = b;
        b = new da;
        b.type = sj;
        c = new z;
        c.Ue = !0;
        c.fill = null;
        c.stroke = "dodgerblue";
        c.lb = 3;
        b.add(c);
        a.zw = b
    }

    function Al(a) {
        var b = D.createElement("p");
        b.style.width = "100%";
        b.style.height = "200px";
        b.style.boxSizing = "content-box";
        var c = D.createElement("div");
        c.style.position = "absolute";
        c.style.visibility = "hidden";
        c.style.width = "200px";
        c.style.height = "150px";
        c.style.overflow = "hidden";
        c.style.boxSizing = "content-box";
        c.appendChild(b);
        window.document.body.appendChild(c);
        var d = b.offsetWidth;
        c.style.overflow = "scroll";
        b = b.offsetWidth;
        d === b && (b = c.clientWidth);
        window.document.body.removeChild(c);
        c = d - b;
        0 !== c || D.iG ||
            (c = 11);
        a.Xd = c;
        c = D.createElement("div");
        c.dir = "rtl";
        c.style.cssText = "font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;";
        c.textContent = "A";
        window.document.body.appendChild(c);
        d = "reverse";
        0 < c.scrollLeft ? d = "default" : (c.scrollLeft = 1, 0 === c.scrollLeft && (d = "negative"));
        window.document.body.removeChild(c);
        a.lA = d
    }
    E.prototype.qc = function(a) { a.Qe === E ? this.im = a : D.ak(this, a) };
    E.prototype.toString = function(a) {
        void 0 === a && (a = 0);
        var b = "";
        this.Hj && this.Hj.id && (b = this.Hj.id);
        b = 'Diagram "' + b + '"';
        if (0 >= a) return b;
        for (var c = this.dc.j; c.next();) b += "\n  " + c.value.toString(a - 1);
        return b
    };
    E.fromDiv = function(a) { var b = a; "string" === typeof a && (b = window.document.getElementById(a)); return b instanceof HTMLDivElement && b.ca instanceof E ? b.ca : null };
    D.defineProperty(E, { Hj: "div" }, function() { return this.Ub }, function(a) {
        null !== a && D.l(a, HTMLDivElement, E, "div");
        if (this.Ub !== a) {
            Bl = [];
            var b = this.Ub;
            null !== b ? (b.ca = void 0, b.innerHTML = "", null !== this.Ib && (this.Ib.removeEventListener("touchstart", this.oC, !1), this.Ib.removeEventListener("touchmove", this.nC, !1), this.Ib.removeEventListener("touchend", this.mC, !1), this.Ib.$d.ca = null), b = this.nb, null !== b && (b.qf.each(function(a) { a.cancelWaitAfter() }), b.mg.each(function(a) { a.cancelWaitAfter() }), b.ng.each(function(a) { a.cancelWaitAfter() })),
                b.cancelWaitAfter(), this.eb.doCancel(), this.dd = this.Ib = null, window.removeEventListener("resize", this.vC, !1), window.removeEventListener("mousemove", this.jo, !0), window.removeEventListener("mousedown", this.io, !0), window.removeEventListener("mouseup", this.lo, !0), window.removeEventListener("wheel", this.mo, !0), window.removeEventListener("mouseout", this.ko, !0)) : this.sh = !1;
            this.Ub = null;
            if (null !== a) {
                if (b = a.ca) b.Hj = null;
                Nl(this, a);
                this.ro()
            }
        }
    });

    function Ql(a) {
        var b = a.Ib;
        a.mz ? (b.addEventListener("pointerdown", a.Jq, !1), b.addEventListener("pointermove", a.Kq, !1), b.addEventListener("pointerup", a.Mq, !1), b.addEventListener("pointerout", a.Lq, !1)) : (b.addEventListener("touchstart", a.oC, !1), b.addEventListener("touchmove", a.nC, !1), b.addEventListener("touchend", a.mC, !1), b.addEventListener("mousemove", a.jo, !1), b.addEventListener("mousedown", a.io, !1), b.addEventListener("mouseup", a.lo, !1), b.addEventListener("mouseout", a.ko, !1));
        b.addEventListener("wheel",
            a.mo, !1);
        b.addEventListener("keydown", a.xJ, !1);
        b.addEventListener("keyup", a.yJ, !1);
        b.addEventListener("selectstart", function(a) { a.preventDefault(); return !1 }, !1);
        b.addEventListener("contextmenu", function(a) { a.preventDefault(); return !1 }, !1);
        b.addEventListener("gesturechange", function(b) { a.nb.rq === Vk && b.preventDefault() }, !1);
        window.addEventListener("resize", a.vC, !1)
    }
    E.prototype.computePixelRatio = function() { if (null !== this.Hk) return this.Hk; var a = this.dd; return (window.devicePixelRatio || 1) / (a.za.webkitBackingStorePixelRatio || a.za.mozBackingStorePixelRatio || a.za.msBackingStorePixelRatio || a.za.oBackingStorePixelRatio || a.za.backingStorePixelRatio || 1) };
    E.prototype.doMouseMove = function() { this.eb.doMouseMove() };
    E.prototype.doMouseDown = function() { this.eb.doMouseDown() };
    E.prototype.doMouseUp = function() { this.eb.doMouseUp() };
    E.prototype.doMouseWheel = function() { this.eb.doMouseWheel() };
    E.prototype.doKeyDown = function() { this.eb.doKeyDown() };
    E.prototype.doKeyUp = function() { this.eb.doKeyUp() };
    E.prototype.doFocus = function() { this.focus() };
    E.prototype.focus = E.prototype.focus = function() {
        if (this.Ib)
            if (this.oK) this.Ib.focus();
            else {
                var a = window.scrollX || window.pageXOffset,
                    b = window.scrollY || window.pageYOffset;
                this.Ib.focus();
                window.scrollTo(a, b)
            }
    };

    function fl(a) {
        if (null !== a.Ib) {
            var b = a.Ub;
            if (0 !== b.clientWidth && 0 !== b.clientHeight) {
                var c = a.Gl ? a.Xd : 0,
                    d = a.qk ? a.Xd : 0,
                    e = a.ud;
                a.ud = a.computePixelRatio();
                a.ud !== e && (a.ms = !0, a.Ve());
                if (b.clientWidth !== a.Pb + c || b.clientHeight !== a.Tb + d) a.Wm = !0, a.Oe = !0, b = a.Yb, null !== b && b.my && a.im === Vh && (a.Sr = !0, b.L()), a.je || a.Ve()
            }
        }
    }

    function Kl(a) {
        var b = new Hg;
        b.name = "Background";
        a.$t(b);
        b = new Hg;
        b.name = "";
        a.$t(b);
        b = new Hg;
        b.name = "Foreground";
        a.$t(b);
        b = new Hg;
        b.name = "Adornment";
        b.Yc = !0;
        a.$t(b);
        b = new Hg;
        b.name = "Tool";
        b.Yc = !0;
        b.fG = !0;
        a.$t(b);
        b = new Hg;
        b.name = "Grid";
        b.Jf = !1;
        b.tg = !1;
        b.Yc = !0;
        a.XH(b, a.pm("Background"))
    }

    function Rl(a) {
        a.Ed = new x(Sl);
        a.Ed.name = "GRID";
        var b = new z;
        b.Kb = "LineH";
        b.stroke = "lightgray";
        b.lb = .5;
        b.interval = 1;
        a.Ed.add(b);
        b = new z;
        b.Kb = "LineH";
        b.stroke = "gray";
        b.lb = .5;
        b.interval = 5;
        a.Ed.add(b);
        b = new z;
        b.Kb = "LineH";
        b.stroke = "gray";
        b.lb = 1;
        b.interval = 10;
        a.Ed.add(b);
        b = new z;
        b.Kb = "LineV";
        b.stroke = "lightgray";
        b.lb = .5;
        b.interval = 1;
        a.Ed.add(b);
        b = new z;
        b.Kb = "LineV";
        b.stroke = "gray";
        b.lb = .5;
        b.interval = 5;
        a.Ed.add(b);
        b = new z;
        b.Kb = "LineV";
        b.stroke = "gray";
        b.lb = 1;
        b.interval = 10;
        a.Ed.add(b);
        b = new F;
        b.add(a.Ed);
        b.Nf = "Grid";
        b.Co = 0;
        b.hy = !1;
        b.eG = !1;
        b.tg = !1;
        b.uy = "GRID";
        a.add(b);
        a.rb.remove(b);
        a.Ed.visible = !1
    }

    function Tl() { this.ca.isEnabled ? this.ca.AI(this) : Ul(this.ca) }

    function Vl(a) { this.ca.isEnabled ? (this.ca.nA = !0, this.ca.pA = a.target.scrollTop, this.ca.oA = a.target.scrollLeft) : Ul(this.ca) }
    E.prototype.diagramScroll = E.prototype.AI = function(a) {
        if (this.nA && null !== this.Ib) {
            this.Xw = !0;
            var b = this.kd,
                c = this.wb,
                d = this.Ny,
                e = b.x - d.left,
                g = b.y - d.top,
                h = b.width + d.left + d.right,
                k = b.height + d.top + d.bottom,
                l = b.right + d.right,
                d = b.bottom + d.bottom,
                m = c.x,
                b = c.y,
                n = c.width,
                p = c.height,
                q = c.right,
                r = c.bottom,
                c = this.scale,
                s;
            s = a.scrollLeft;
            if (this.rs) switch (this.lA) {
                case "negative":
                    s = s + a.scrollWidth - a.clientWidth;
                    break;
                case "reverse":
                    s = a.scrollWidth - s - a.clientWidth
            }
            var u = s;
            n < h || p < k ? (s = D.Fb(this.position.x, this.position.y),
                this.Be && this.oA !== u && (s.x = u / c + e, this.oA = u), this.Ce && this.pA !== a.scrollTop && (s.y = a.scrollTop / c + g, this.pA = a.scrollTop), this.position = s, D.A(s), this.Wm = this.Xw = !1) : (s = D.P(), a.NH && this.Be && (e < m && (this.position = s.n(u + e, this.position.y)), l > q && (this.position = s.n(-(this.ax.scrollWidth - this.Pb) + u - this.Pb / c + l, this.position.y))), a.OH && this.Ce && (g < b && (this.position = s.n(this.position.x, a.scrollTop + g)), d > r && (this.position = s.n(this.position.x, -(this.ax.scrollHeight - this.Tb) + a.scrollTop - this.Tb / c + d))), D.A(s), Wl(this),
                this.Wm = this.Xw = !1, b = this.kd, c = this.wb, l = b.right, q = c.right, d = b.bottom, r = c.bottom, e = b.x, m = c.x, g = b.y, b = c.y, n >= h && e >= m && l <= q && (this.yt.style.width = "1px"), p >= k && g >= b && d <= r && (this.yt.style.height = "1px"))
        }
    };
    E.prototype.computeBounds = E.prototype.Kh = function() { 0 < this.Gg.count && Si(this); return Xl(this) };

    function Xl(a) {
        if (a.LF.H()) {
            var b = a.LF.copy();
            b.yx(a.padding);
            return b
        }
        for (var c = !0, d = a.dc.o, e = d.length, g = 0; g < e; g++) {
            var h = d[g];
            if (h.visible && (!h.Yc || h.fG))
                for (var h = h.rb.o, k = h.length, l = 0; l < k; l++) {
                    var m = h[l];
                    m.hy && m.isVisible() && (m = m.aa, m.H() && (c ? (c = !1, b = m.copy()) : b.Zh(m)))
                }
        }
        c && (b = new C(0, 0, 0, 0));
        b.yx(a.padding);
        return b
    }
    E.prototype.computePartsBounds = function(a, b) { void 0 === b && (b = !1); for (var c = null, d = a.j; d.next();) { var e = d.value;!b && e instanceof J || (e.kf(), null === c ? c = e.aa.copy() : c.Zh(e.aa)) } return null === c ? new C(NaN, NaN, 0, 0) : c };

    function Yl(a, b) {
        if ((b || a.sh) && !a.ed && null !== a.Ib && !a.Ra.nf && a.kd.H()) {
            a.ed = !0;
            var c = a.Nm;
            b && a.Il !== Vh && (c = a.Il);
            var d = c !== Vh ? Zl(a, c) : a.scale,
                c = a.wb.copy(),
                e = a.Pb / d,
                g = a.Tb / d,
                h = null,
                k = a.Ra;
            k.zc && (h = a.sb.copy());
            a.position.Xa();
            var l = a.No;
            b && !l.Xc() && a.hp.Xc() && (l = a.hp);
            $l(a, a.sb, a.kd, e, g, l, b);
            a.position.freeze();
            null !== h && rl(k, h, a.sb);
            e = a.scale;
            a.scale = d;
            a.ed = !1;
            d = a.wb;
            d.Wc(c) || a.dv(c, d, e, a.scale, !1)
        }
    }

    function Zl(a, b) {
        var c = a.yb.Ox;
        if (null === a.Ib) return c;
        a.rk && am(a, a.Kh());
        var d = a.kd;
        if (!d.H()) return c;
        var e = d.width,
            d = d.height,
            g = a.Pb,
            h = a.Tb,
            k = g / e,
            l = h / d;
        return b === bm ? (e = Math.min(l, k), e > c && (e = c), e < a.Sh && (e = a.Sh), e > a.Rh && (e = a.Rh), e) : b === cm ? (e = l > k ? (h - a.Xd) / d : (g - a.Xd) / e, e > c && (e = c), e < a.Sh && (e = a.Sh), e > a.Rh && (e = a.Rh), e) : a.scale
    }
    E.prototype.zoomToFit = E.prototype.zoomToFit = function() { this.scale = Zl(this, bm) };
    E.prototype.zoomToRect = function(a, b) {
        void 0 === b && (b = bm);
        var c = a.width,
            d = a.height;
        if (!(0 === c || 0 === d || isNaN(c) && isNaN(d))) {
            var e = 1;
            if (b === bm || b === cm)
                if (isNaN(c)) e = this.wb.height * this.scale / d;
                else if (isNaN(d)) e = this.wb.width * this.scale / c;
            else var e = this.Pb,
                g = this.Tb,
                e = b === cm ? g / d > e / c ? (g - (this.qk ? this.Xd : 0)) / d : (e - (this.Gl ? this.Xd : 0)) / c : Math.min(g / d, e / c);
            this.scale = e;
            this.position = new N(a.x, a.y)
        }
    };
    D.defineProperty(E, { qB: null }, function() { return this.ed }, function(a) { this.ed = a });
    E.prototype.alignDocument = function(a, b) {
        this.rk && am(this, this.Kh());
        var c = this.kd,
            d = this.wb;
        this.position = new N(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))
    };

    function $l(a, b, c, d, e, g, h) {
        var k = b.x,
            l = b.y;
        if (h || a.VB === Cl) g.Xc() && (d > c.width && (k = c.x + (g.x * c.width + g.offsetX) - (g.x * d - g.offsetX)), e > c.height && (l = c.y + (g.y * c.height + g.offsetY) - (g.y * e - g.offsetY))), g = a.Ny, h = d - c.width, d < c.width + g.left + g.right ? (k = Math.min(k + d / 2, c.right + Math.max(h, g.right) - d / 2), k = Math.max(k, c.left - Math.max(h, g.left) + d / 2), k -= d / 2) : k > c.left ? k = c.left : k < c.right - d && (k = c.right - d), d = e - c.height, e < c.height + g.top + g.bottom ? (l = Math.min(l + e / 2, c.bottom + Math.max(d, g.bottom) - e / 2), l = Math.max(l, c.top - Math.max(d,
            g.top) + e / 2), l -= e / 2) : l > c.top ? l = c.top : l < c.bottom - e && (l = c.bottom - e);
        b.x = isFinite(k) ? k : -a.padding.left;
        b.y = isFinite(l) ? l : -a.padding.top;
        null !== a.GG && (a = a.GG(a, b), b.x = a.x, b.y = a.y)
    }
    E.prototype.findPartAt = E.prototype.su = function(a, b) { var c = b ? Wi(this, a, function(a) { return a.Y }, function(a) { return a.canSelect() }) : Wi(this, a, function(a) { return a.Y }); return c instanceof F ? c : null };
    E.prototype.findObjectAt = E.prototype.Je = function(a, b, c) {
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        Si(this);
        for (var d = this.dc.$n; d.next();) { var e = d.value; if (e.visible && (e = e.Je(a, b, c), null !== e)) return e }
        return null
    };

    function Wi(a, b, c, d) {
        void 0 === c && (c = null);
        void 0 === d && (d = null);
        Si(a);
        for (a = a.dc.$n; a.next();) { var e = a.value; if (e.visible && !e.Yc && (e = e.Je(b, c, d), null !== e)) return e }
        return null
    }
    E.prototype.findObjectsAt = E.prototype.ru = function(a, b, c, d) {
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        d instanceof K || d instanceof L || (d = new L(O));
        Si(this);
        for (var e = this.dc.$n; e.next();) {
            var g = e.value;
            g.visible && g.ru(a, b, c, d)
        }
        return d
    };
    E.prototype.findObjectsIn = E.prototype.Xk = function(a, b, c, d, e) {
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        void 0 === d && (d = !1);
        e instanceof K || e instanceof L || (e = new L(O));
        Si(this);
        for (var g = this.dc.$n; g.next();) {
            var h = g.value;
            h.visible && h.Xk(a, b, c, d, e)
        }
        return e
    };
    E.prototype.$A = function(a, b, c, d, e, g) {
        var h = new L(O);
        Si(this);
        for (var k = this.dc.$n; k.next();) {
            var l = k.value;
            l.visible && l.$A(a, b, c, d, h, e, g)
        }
        return h
    };
    E.prototype.findObjectsNear = E.prototype.Pn = function(a, b, c, d, e, g) {
        void 0 === c && (c = null);
        void 0 === d && (d = null);
        void 0 === e && (e = !0);
        if (!1 !== e && !0 !== e) {
            if (e instanceof K || e instanceof L) g = e;
            e = !0
        }
        g instanceof K || g instanceof L || (g = new L(O));
        Si(this);
        for (var h = this.dc.$n; h.next();) {
            var k = h.value;
            k.visible && k.Pn(a, b, c, d, e, g)
        }
        return g
    };
    E.prototype.acceptEvent = function(a) {
        var b = this.Hd;
        this.Hd = this.cc;
        this.cc = b;
        dm(this, this, a, b, a instanceof MouseEvent);
        return b
    };

    function dm(a, b, c, d, e) {
        d.g = b;
        d.event = c;
        e ? em(a, c, d) : (d.te = b.cc.te, d.ha = b.cc.ha);
        a = 0;
        c.ctrlKey && (a += 1);
        c.altKey && (a += 2);
        c.shiftKey && (a += 4);
        c.metaKey && (a += 8);
        d.xd = a;
        d.button = c.button;
        void 0 === c.buttons || D.Mu || (d.buttons = c.buttons);
        D.Qh && 0 === c.button && c.ctrlKey && (d.button = 2);
        d.Vk = !1;
        d.up = !1;
        d.Ee = 1;
        d.Uk = 0;
        d.Cc = !1;
        d.bubbles = !1;
        d.timestamp = Date.now();
        d.Ou = !1;
        d.Qf = fm(c);
        d.Ne = null
    }

    function fm(a) {
        var b = a.target.ca;
        if (!b) {
            var c = a.path;
            c || "function" !== typeof a.lI || (c = a.lI());
            c && c[0] && (b = c[0].ca)
        }
        return b ? b : null
    }

    function gm(a, b, c, d) {
        var e = a.Hd;
        a.Hd = a.cc;
        a.cc = e;
        e.g = a;
        em(a, c, e);
        e.button = 0;
        e.buttons = 1;
        c = 0;
        b.ctrlKey && (c += 1);
        b.altKey && (c += 2);
        b.shiftKey && (c += 4);
        b.metaKey && (c += 8);
        e.xd = c;
        e.Vk = !0;
        e.up = !1;
        e.Ee = 1;
        e.Uk = 0;
        e.Cc = !1;
        e.bubbles = !0;
        e.event = b;
        e.timestamp = Date.now();
        e.Ou = d;
        e.Qf = fm(b);
        e.Ne = null;
        d || (a.aj = e.copy());
        di = null;
        return e
    }

    function hm(a, b, c, d) {
        var e = a.Hd;
        a.Hd = a.cc;
        a.cc = e;
        var g = null;
        e.g = a;
        null !== c ? ((g = window.document.elementFromPoint(c.clientX, c.clientY)) && g.ca ? g = g.ca : (c = void 0 !== b.targetTouches ? b.targetTouches[0] : b, g = a), e.Qf = g, em(a, c, e)) : null !== a.Hd ? (e.ha = a.Hd.ha, e.te = a.Hd.te, e.Qf = a.Hd.Qf) : null !== a.aj && (e.ha = a.aj.ha, e.te = a.aj.te, e.Qf = a.aj.Qf);
        e.button = 0;
        e.buttons = 1;
        a = 0;
        b.ctrlKey && (a += 1);
        b.altKey && (a += 2);
        b.shiftKey && (a += 4);
        b.metaKey && (a += 8);
        e.xd = a;
        e.Vk = !1;
        e.up = !1;
        e.Ee = 1;
        e.Uk = 0;
        e.Cc = !1;
        e.bubbles = !1;
        e.event = b;
        e.timestamp =
            Date.now();
        e.Ou = d;
        e.Ne = null;
        return e
    }

    function ga(a, b, c) {
        if (b.bubbles) return v && v.$F && D.trace("NOT handled " + c.type + " " + b.toString()), !0;
        v && v.$F && D.trace("handled " + c.type + " " + a.eb.name + " " + b.toString());
        void 0 !== c.stopPropagation && c.stopPropagation();
        c.preventDefault();
        c.cancelBubble = !0;
        return !1
    }
    E.prototype.xJ = function(a) {
        if (!this.ca.isEnabled) return !1;
        var b = this.ca.cc;
        dm(this.ca, this.ca, a, b, !1);
        b.key = String.fromCharCode(a.which);
        b.Vk = !0;
        switch (a.which) {
            case 8:
                b.key = "Backspace";
                break;
            case 33:
                b.key = "PageUp";
                break;
            case 34:
                b.key = "PageDown";
                break;
            case 35:
                b.key = "End";
                break;
            case 36:
                b.key = "Home";
                break;
            case 37:
                b.key = "Left";
                break;
            case 38:
                b.key = "Up";
                break;
            case 39:
                b.key = "Right";
                break;
            case 40:
                b.key = "Down";
                break;
            case 45:
                b.key = "Insert";
                break;
            case 46:
                b.key = "Del";
                break;
            case 48:
                b.key = "0";
                break;
            case 187:
            case 61:
            case 107:
                b.key =
                    "Add";
                break;
            case 189:
            case 173:
            case 109:
                b.key = "Subtract";
                break;
            case 27:
                b.key = "Esc"
        }
        this.ca.doKeyDown();
        return ga(this.ca, b, a)
    };
    E.prototype.yJ = function(a) {
        if (!this.ca.isEnabled) return !1;
        var b = this.ca.cc;
        dm(this.ca, this.ca, a, b, !1);
        b.key = String.fromCharCode(a.which);
        b.up = !0;
        switch (a.which) {
            case 8:
                b.key = "Backspace";
                break;
            case 33:
                b.key = "PageUp";
                break;
            case 34:
                b.key = "PageDown";
                break;
            case 35:
                b.key = "End";
                break;
            case 36:
                b.key = "Home";
                break;
            case 37:
                b.key = "Left";
                break;
            case 38:
                b.key = "Up";
                break;
            case 39:
                b.key = "Right";
                break;
            case 40:
                b.key = "Down";
                break;
            case 45:
                b.key = "Insert";
                break;
            case 46:
                b.key = "Del"
        }
        this.ca.doKeyUp();
        return ga(this.ca, b, a)
    };
    E.prototype.dp = function(a) {
        var b = this.Ib;
        if (null === b) return new N(0, 0);
        var c = this.Pb,
            d = this.Tb,
            b = b.getBoundingClientRect(),
            c = a.clientX - c / b.width * b.left;
        a = a.clientY - d / b.height * b.top;
        return null !== this.Nc ? (a = new N(c, a), kb(a, this.Nc), a) : new N(c, a)
    };

    function em(a, b, c) {
        var d = a.Ib,
            e = a.Pb,
            g = a.Tb,
            h = 0,
            k = 0;
        null !== d && (d = d.getBoundingClientRect(), h = b.clientX - e / d.width * d.left, k = b.clientY - g / d.height * d.top);
        c.te.n(h, k);
        null !== a.Nc ? (b = D.Fb(h, k), a.Nc.Oh(b), c.ha.assign(b), D.A(b)) : c.ha.n(h, k)
    }

    function cg(a, b, c, d) {
        var e = null;
        if (void 0 !== b.targetTouches) {
            if (2 > b.targetTouches.length) return;
            e = b.targetTouches[c]
        } else if (null !== a.Dp[0]) e = a.Dp[c];
        else return;
        c = a.Ib;
        b = a.Pb;
        a = a.Tb;
        var g = 0,
            h = 0;
        null !== c && null !== e && (c = c.getBoundingClientRect(), g = e.clientX - b / c.width * c.left, h = e.clientY - a / c.height * c.top);
        d.n(g, h)
    }
    E.prototype.invalidateDocumentBounds = E.prototype.Qc = function() { this.rk || (this.rk = !0, this.Ve(!0)) };

    function ol(a) {
        a.je || Si(a);
        a.rk && am(a, a.Kh())
    }
    E.prototype.redraw = E.prototype.ro = function() { this.ed || this.je || (this.ra(), im(this), Wl(this), this.Qc(), this.lg()) };
    E.prototype.isUpdateRequested = function() { return this.cg };
    E.prototype.delayInitialization = function(a) {
        void 0 === a && (a = null);
        var b = this.Ra,
            c = b.isEnabled;
        b.Yh();
        b.isEnabled = !1;
        bj(this);
        this.sh = !1;
        b.isEnabled = c;
        null !== a && D.setTimeout(a, 1)
    };
    E.prototype.requestUpdate = E.prototype.Ve = function(a) {
        void 0 === a && (a = !1);
        if (!0 !== this.cg && !(this.ed || !1 === a && this.je)) {
            this.cg = !0;
            var b = this;
            requestAnimationFrame(function() { b.cg && b.lg() })
        }
    };
    E.prototype.maybeUpdate = E.prototype.lg = function() { if (!this.bp || this.cg) this.bp && (this.bp = !1), bj(this) };

    function jm(a, b) { a.Ra.nf || a.ed || !a.Wm || Ul(a) || (b && Si(a), Yl(a, !1)) }

    function bj(a) {
        if (!a.je && (a.cg = !1, null !== a.Ub)) {
            a.je = !0;
            var b = a.Ra,
                c = a.iA;
            if (!b.np && 0 !== c.length) {
                for (var d = c.o, e = d.length, g = 0; g < e; g++) {
                    var h = d[g];
                    km(h, !1);
                    h.K()
                }
                c.clear()
            }
            c = a.AD;
            0 < c.count && (c.each(function(a) { a.tC() }), c.clear());
            d = c = !1;
            b.nf && (d = !0, c = a.kb, a.kb = !0);
            b.zc || fl(a);
            jm(a, !1);
            null !== a.Ed && (a.Ed.visible && !a.fw && (lm(a), a.fw = !0), !a.Ed.visible && a.fw && (a.fw = !1));
            Si(a);
            e = !1;
            if (!a.sh || a.xl) a.sh ? mm(a, !a.Sr) : (a.Nb("Initial Layout"), !1 === b.isEnabled && b.Yh(), mm(a, !1)), e = !0;
            a.Sr = !1;
            Si(a);
            a.rA || b.nf ||
                ol(a);
            jm(a, !0);
            e && (a.sh || pm(a), a.Ja("LayoutCompleted"));
            Si(a);
            e && !a.sh && (a.sh = !0, a.jd("Initial Layout"), a.kb || a.na.clear(), D.setTimeout(function() { a.Gi = !1 }, 1));
            xm(a);
            el(b);
            a.He(a.dd);
            d && (a.kb = c);
            a.je = !1
        }
    }
    D.w(E, { Zn: null }, function() { return this.sh });

    function pm(a) {
        var b = a.dc.o;
        a.Pf(b, b.length, a);
        a.Il !== Vh ? a.scale = Zl(a, a.Il) : a.Nm !== Vh ? a.scale = Zl(a, a.Nm) : (b = a.jJ, isFinite(b) && 0 < b && (a.scale = b));
        b = a.iJ;
        if (b.H()) a.position = b;
        else {
            b = D.P();
            b.uo(a.kd, a.hJ);
            var c = a.wb,
                c = D.vg(0, 0, c.width, c.height),
                d = D.P();
            d.uo(c, a.kJ);
            d.n(b.x - d.x, b.y - d.y);
            a.position = d;
            D.Lb(c);
            D.A(d);
            D.A(b);
            im(a);
            jm(a, !0);
            Yl(a, !0)
        }
        a.Ja("InitialLayoutCompleted");
        lm(a)
    }

    function Si(a) {
        if ((a.je || !a.Ra.nf) && 0 !== a.Gg.count) {
            for (var b = 0; 23 > b; b++) {
                var c = a.Gg.j;
                if (null === c || 0 === a.Gg.count) break;
                a.Gg = new L(F);
                a.tC(c, a.Gg);
                v && 22 === b && D.trace("failure to validate parts")
            }
            a.rg.each(function(a) { a instanceof I && 0 !== (a.Ca & 65536) !== !1 && (a.Ca ^= 65536) })
        }
    }
    E.prototype.tC = function(a, b) { for (a.reset(); a.next();) { var c = a.value;!c.qe() || c instanceof I || (c.ym() ? (Hk(c, Infinity, Infinity), c.rc()) : b.add(c)) } for (a.reset(); a.next();) c = a.value, c instanceof I && c.isVisible() && Mm(this, c); for (a.reset(); a.next();) c = a.value, c instanceof J && c.isVisible() && (c.ym() ? (Hk(c, Infinity, Infinity), c.rc()) : b.add(c)); for (a.reset(); a.next();) c = a.value, c instanceof da && c.isVisible() && (c.ym() ? (Hk(c, Infinity, Infinity), c.rc()) : b.add(c)) };

    function Mm(a, b) {
        for (var c = D.mb(), d = D.mb(), e = b.uc; e.next();) {
            var g = e.value;
            g.isVisible() && (g instanceof I ? (Nm(g) || Om(g) || Pm(g)) && Mm(a, g) : g instanceof J ? g.$ === b || g.ba === b ? d.push(g) : c.push(g) : (Hk(g, Infinity, Infinity), g.rc()))
        }
        for (var e = c.length, h = 0; h < e; h++) g = c[h], Hk(g, Infinity, Infinity), g.rc();
        D.ya(c);
        Hk(b, Infinity, Infinity);
        b.rc();
        e = d.length;
        for (h = 0; h < e; h++) g = d[h], Hk(g, Infinity, Infinity), g.rc();
        D.ya(d)
    }
    E.prototype.Pf = function(a, b, c, d) {
        var e = this.Ra;
        if (this.Jl || e.nf)
            for (e = 0; e < b; e++) a[e].Pf(c, d)
    };
    E.prototype.He = function(a, b) {
        void 0 === b && (b = null);
        null === this.Ub && D.k("No div specified");
        var c = this.Ib;
        null === c && D.k("No canvas specified");
        var d = this.Ra;
        if (!d.zc && (Qm(this), "0" !== this.Ub.style.opacity)) {
            var e = a !== this.dd,
                g = this.dc.o,
                h = g.length,
                k = this;
            this.Pf(g, h, k);
            if (e) a.De(!0), Wl(this);
            else if (!this.Oe && null === b && !d.sk) return;
            var h = this.sb,
                l = this.Db,
                m = Math.round(h.x * l) / l,
                n = Math.round(h.y * l) / l,
                d = this.Nc;
            d.reset();
            1 !== l && d.scale(l);
            0 === h.x && 0 === h.y || d.translate(-m, -n);
            l = this.ud;
            D.Xn ? (c.width = c.width,
                a.De(!0), a.scale(l, l)) : (a.setTransform(1, 0, 0, 1, 0, 0), a.scale(l, l), a.clearRect(0, 0, this.Pb, this.Tb));
            a.setTransform(1, 0, 0, 1, 0, 0);
            a.scale(l, l);
            a.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
            v && v.Dj && v.zF(this, a);
            c = null !== b ? function(c) {
                var d = b;
                if (c.visible && 0 !== c.Lc) {
                    var e = c.rb.o,
                        g = e.length;
                    if (0 !== g) {
                        1 !== c.Lc && (a.globalAlpha = c.Lc);
                        c = c.Pw;
                        c.length = 0;
                        for (var h = k.scale, l = 0; l < g; l++) {
                            var m = e[l];
                            if (tl(m) && !d.contains(m)) {
                                if (m instanceof J) {
                                    var n = m;
                                    n.ic && c.push(n);
                                    if (!1 === n.Uf) continue
                                }
                                n = m.aa;
                                1 < n.width * h || 1 <
                                    n.height * h ? m.He(a, k) : vl(m, a)
                            }
                        }
                        a.globalAlpha = 1
                    }
                }
            } : function(b) { b.He(a, k) };
            Rm(this, a);
            h = g.length;
            for (m = 0; m < h; m++) a.setTransform(1, 0, 0, 1, 0, 0), a.scale(l, l), a.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy), c(g[m]);
            this.Hl ? this.Hl.Im(this) && this.aw() : this.dp = function() { return new N(0, 0) };
            v && (v.WA || v.Dj) && v.VA(a, this, d);
            e ? (this.dd.De(!0), Wl(this)) : this.Oe = this.Jl = !1
        }
    };

    function Sm(a, b, c, d, e) {
        null === a.Ub && D.k("No div specified");
        var g = a.Ib;
        null === g && D.k("No canvas specified");
        if (!a.Ra.zc) {
            var h = a.dd;
            if (a.Oe) {
                Qm(a);
                var k = a.ud;
                D.Xn ? (g.width = g.width, h.De(!0)) : (h.setTransform(1, 0, 0, 1, 0, 0), h.clearRect(0, 0, a.Pb * k, a.Tb * k));
                h.Sy(!1);
                h.drawImage(a.Iz.$d, 0 < d ? 0 : Math.round(-d), 0 < e ? 0 : Math.round(-e));
                e = a.sb;
                var g = a.Db,
                    l = Math.round(e.x * g) / g,
                    m = Math.round(e.y * g) / g;
                d = a.Nc;
                d.reset();
                1 !== g && d.scale(g);
                0 === e.x && 0 === e.y || d.translate(-l, -m);
                h.save();
                h.beginPath();
                e = c.length;
                for (g = 0; g <
                    e; g++) l = c[g], 0 !== l.width && 0 !== l.height && h.rect(Math.floor(l.x), Math.floor(l.y), Math.ceil(l.width), Math.ceil(l.height));
                h.clip();
                h.setTransform(1, 0, 0, 1, 0, 0);
                h.scale(k, k);
                h.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
                v && v.Dj && v.zF(a, h);
                c = a.dc.o;
                e = c.length;
                a.Pf(c, e, a);
                Rm(a, h);
                for (g = 0; g < e; g++) wl(c[g], h, a, b);
                h.restore();
                h.De(!0);
                v && (v.WA || v.Dj) && v.VA(h, a, d);
                a.Hl ? a.Hl.Im(a) && a.aw() : a.dp = function() { return new N(0, 0) };
                a.Jl = !1;
                a.Oe = !1;
                a.Gy()
            }
        }
    }

    function Tm(a, b, c, d, e, g, h, k, l, m) {
        null === a.Ub && D.k("No div specified");
        null === a.Ib && D.k("No canvas specified");
        void 0 === h && (h = null);
        void 0 === k && (k = null);
        void 0 === l && (l = !1);
        void 0 === m && (m = !1);
        Qm(a);
        a.dd.De(!0);
        Wl(a);
        a.Yz = !0;
        var n = a.Db;
        a.Db = e;
        var p = a.dc.o,
            q = p.length;
        try {
            var r = new C(g.x, g.y, d.width / e, d.height / e),
                s = r.copy();
            s.yx(c);
            lm(a, s);
            Si(a);
            a.Pf(p, q, a, r);
            var u = a.ud;
            b.setTransform(1, 0, 0, 1, 0, 0);
            b.scale(u, u);
            b.clearRect(0, 0, d.width, d.height);
            null !== k && "" !== k && (b.fillStyle = k, b.fillRect(0, 0, d.width, d.height));
            var t = D.hh();
            t.reset();
            t.translate(c.left, c.top);
            t.scale(e);
            0 === g.x && 0 === g.y || t.translate(-g.x, -g.y);
            b.setTransform(t.m11, t.m12, t.m21, t.m22, t.dx, t.dy);
            D.lf(t);
            Rm(a, b);
            var y;
            if (null !== h) {
                var w = new L(F),
                    A = h.j;
                for (A.reset(); A.next();) { var B = A.value;!1 === m && "Grid" === B.layer.name || null === B || w.add(B) }
                y = function(c) {
                    var d = l;
                    if (c.visible && 0 !== c.Lc && (void 0 === d && (d = !0), d || !c.Yc)) {
                        var d = c.rb.o,
                            e = d.length;
                        if (0 !== e) {
                            1 !== c.Lc && (b.globalAlpha = c.Lc);
                            c = c.Pw;
                            c.length = 0;
                            for (var g = a.scale, h = 0; h < e; h++) {
                                var k = d[h];
                                if (tl(k) &&
                                    w.contains(k)) {
                                    if (k instanceof J) {
                                        var m = k;
                                        m.ic && c.push(m);
                                        if (!1 === m.Uf) continue
                                    }
                                    m = k.aa;
                                    1 < m.width * g || 1 < m.height * g ? k.He(b, a) : vl(k, b)
                                }
                            }
                            b.globalAlpha = 1
                        }
                    }
                }
            } else if (!l && m) {
                var P = a.Vn.Y,
                    H = P.layer;
                y = function(c) { c === H ? P.He(b, a) : c.He(b, a, l) }
            } else y = function(c) { c.He(b, a, l) };
            for (c = 0; c < q; c++) y(p[c]);
            a.Yz = !1;
            a.Hl ? a.Hl.Im(a) && a.aw() : a.dp = function() { return new N(0, 0) }
        } finally { a.Db = n, a.dd.De(!0), Wl(a), a.Pf(p, q, a), lm(a) }
    }
    E.prototype.getRenderingHint = E.prototype.Kj = function(a) { return this.Ek[a] };
    E.prototype.setRenderingHint = E.prototype.sK = function(a, b) {
        this.Ek[a] = b;
        this.ro()
    };
    E.prototype.resetRenderingHints = E.prototype.NG = function() {
        this.Ek = new ma;
        this.Ek.drawShadows = !0;
        this.Ek.textGreeking = !0;
        this.Ek.viewportOptimizations = D.iG || D.zq || D.Aq ? !1 : !0;
        this.Ek.temporaryPixelRatio = !0;
        this.Ek.pictureRatioOptimization = !0
    };

    function Rm(a, b) {
        var c = a.Ek;
        null !== c && (void 0 !== c.imageSmoothingEnabled && b.Sy(!!c.imageSmoothingEnabled), c = c.defaultFont, void 0 !== c && null !== c && (b.font = c))
    }
    E.prototype.getInputOption = E.prototype.Cu = function(a) { return this.kp[a] };
    E.prototype.setInputOption = function(a, b) { this.kp[a] = b };
    E.prototype.resetInputOptions = E.prototype.MG = function() {
        this.kp = new ma;
        this.kp.extraTouchArea = 10;
        this.kp.extraTouchThreshold = 10;
        this.kp.hasGestureZoom = !0
    };
    E.prototype.setProperties = function(a) { D.nv(this, a) };

    function xm(a) {
        if (0 === a.na.Ki && 0 !== a.Cl.count) {
            for (; 0 < a.Cl.count;) {
                var b = a.Cl;
                a.Cl = new oa(J, C);
                for (b = b.j; b.next();) {
                    var c = b.key;
                    Oj(c, b.value);
                    c.Te()
                }
            }
            a.ra()
        }
    }
    E.prototype.ra = function(a) {
        void 0 === a && (a = null);
        if (null === a) this.Oe = !0, this.Ve();
        else {
            var b = this.wb;
            null !== a && a.H() && b.jg(a) && (this.Oe = !0, this.Ve())
        }
        for (b = this.Qw.j; b.next();) b.value.ra(a)
    };
    E.prototype.dG = function(a, b) {
        if (!0 !== this.Oe) {
            this.Oe = !0;
            var c = !0 === this.Kj("temporaryPixelRatio");
            if (!0 === this.Kj("viewportOptimizations") && this.VB !== Um && this.Ny.Tx(0, 0, 0, 0) && b.width === a.width && b.height === a.height) {
                var d = this.scale,
                    e = D.Sf(),
                    g = Math.max(a.x, b.x),
                    h = Math.max(a.y, b.y),
                    k = Math.min(a.x + a.width, b.x + b.width),
                    l = Math.min(a.y + a.height, b.y + b.height);
                e.x = g;
                e.y = h;
                e.width = Math.max(0, k - g) * d;
                e.height = Math.max(0, l - h) * d;
                if (0 < e.width && 0 < e.height) {
                    if (!this.je && (this.cg = !1, null !== this.Ub)) {
                        this.je = !0;
                        xm(this);
                        this.kd.H() || am(this, this.Kh());
                        var m = this.Ib;
                        if (null !== m) {
                            var n = this.ud,
                                h = this.Pb * n,
                                k = this.Tb * n,
                                g = this.scale * n,
                                d = Math.round(Math.round(b.x * g) - Math.round(a.x * g)),
                                g = Math.round(Math.round(b.y * g) - Math.round(a.y * g)),
                                l = this.Iz,
                                p = this.rD;
                            l.width !== h && (l.width = h);
                            l.height !== k && (l.height = k);
                            p.clearRect(0, 0, h, k);
                            var l = 190 * this.ud,
                                q = 70 * this.ud,
                                r = Math.max(d, 0),
                                s = Math.max(g, 0),
                                u = Math.floor(h - r),
                                t = Math.floor(k - s);
                            p.Sy(!1);
                            p.drawImage(m.$d, r, s, u, t, 0, 0, u, t);
                            this.Hl.Im(this) && p.clearRect(0, 0, l, q);
                            var m = D.mb(),
                                p =
                                D.mb(),
                                t = Math.abs(d),
                                u = Math.abs(g),
                                y = 0 === r ? 0 : h - t,
                                r = D.Fb(y, 0),
                                t = D.Fb(t + y, k);
                            p.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y)));
                            var w = this.Nc;
                            w.reset();
                            w.scale(n, n);
                            1 !== this.Db && w.scale(this.Db);
                            n = this.sb;
                            (0 !== n.x || 0 !== n.y) && isFinite(n.x) && isFinite(n.y) && w.translate(-n.x, -n.y);
                            kb(r, w);
                            kb(t, w);
                            m.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y)));
                            y = 0 === s ? 0 : k - u;
                            r.n(0, y);
                            t.n(h, u + y);
                            p.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x -
                                t.x), Math.abs(r.y - t.y)));
                            kb(r, w);
                            kb(t, w);
                            m.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y)));
                            this.Hl.Im(this) && (h = 0 < d ? 0 : -d, k = 0 < g ? 0 : -g, r.n(h, k), t.n(l + h, q + k), p.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))), kb(r, w), kb(t, w), m.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))));
                            D.A(r);
                            D.A(t);
                            jm(this, !1);
                            Sm(this, m, p, d, g);
                            D.ya(m);
                            D.ya(p);
                            this.je = !1
                        }
                    }
                } else this.lg();
                D.Lb(e);
                c && (this.Hk = 1, this.lg(),
                    this.Hk = null, this.Gy())
            } else c ? (this.Hk = 1, this.lg(), this.Hk = null, this.Gy()) : this.lg()
        }
    };

    function im(a) {!1 === a.Wm && (a.Wm = !0) }

    function Wl(a) {!1 === a.Jl && (a.Jl = !0) }

    function Qm(a) {!1 !== a.ms && (a.ms = !1, Vm(a, a.Pb, a.Tb)) }

    function Vm(a, b, c) {
        var d = a.Ib,
            e = a.ud,
            g = b * e,
            e = c * e;
        if (d.width !== g || d.height !== e) d.width = g, d.height = e, d.style.width = b + "px", d.style.height = c + "px", a.Oe = !0, a.dd.De(!0)
    }

    function Ul(a) {
        var b = a.Ib;
        if (null === b) return !0;
        var c = a.Ub,
            d = a.Pb,
            e = a.Tb,
            g = a.ME.copy();
        if (!g.H()) return !0;
        var h = !1,
            k = a.Gl ? a.Xd : 0,
            l = a.qk ? a.Xd : 0,
            m = c.clientWidth || d + k,
            c = c.clientHeight || e + l;
        if (m !== d + k || c !== e + l) a.Gl = !1, a.qk = !1, l = k = 0, a.Pb = m, a.Tb = c, h = a.ms = !0;
        a.Wm = !1;
        var n = a.wb,
            p = a.kd,
            q = 0,
            r = 0,
            s = 0,
            u = 0,
            m = n.width,
            c = n.height,
            t = a.Ny;
        a.LA.Xc() ? (p.width > m && (q = t.left, r = t.right), p.height > c && (s = t.top, u = t.bottom)) : (q = t.left, r = t.right, s = t.top, u = t.bottom);
        var t = p.width + q + r,
            y = p.height + s + u,
            q = p.x - q,
            w = n.x,
            r = p.right + r,
            A = n.right +
            k,
            s = p.y - s,
            B = n.y,
            u = p.bottom + u,
            n = n.bottom + l,
            P = "1px",
            H = "1px",
            p = a.scale,
            R = !(t < m + k),
            aa = !(y < c + l);
        a.VB === Cl && (R || aa) && (R && a.jB && a.Be && (P = 1, q + 1 < w && (P = Math.max((w - q) * p + a.Pb, P)), r > A + 1 && (P = Math.max((r - A) * p + a.Pb, P)), m + k + 1 < t && (P = Math.max((t - m + k) * p + a.Pb, P)), P = P.toString() + "px"), aa && a.kB && a.Ce && (H = 1, s + 1 < B && (H = Math.max((B - s) * p + a.Tb, H)), u > n + 1 && (H = Math.max((u - n) * p + a.Tb, H)), c + l + 1 < y && (H = Math.max((y - c + l) * p + a.Tb, H)), H = H.toString() + "px"));
        var R = "1px" !== P,
            V = "1px" !== H;
        R && V || !R && !V || (aa = !(y < c + l), V && (A -= a.Xd), R && (n -= a.Xd),
            t < m + k || !a.jB || !a.Be || (P = 1, q + 1 < w && (P = Math.max((w - q) * p + a.Pb, P)), r > A + 1 && (P = Math.max((r - A) * p + a.Pb, P)), m + 1 < t && (P = Math.max((t - m) * p + a.Pb, P)), P = P.toString() + "px"), R = "1px" !== P, k = R !== a.qk ? a.Tb - a.Xd : a.Tb, aa && a.kB && a.Ce && (H = 1, s + 1 < B && (H = Math.max((B - s) * p + k, H)), u > n + 1 && (H = Math.max((u - n) * p + k, H)), c + 1 < y && (H = Math.max((y - c) * p + k, H)), H = H.toString() + "px"), V = "1px" !== H);
        if (a.Xw && R === a.qk && V === a.Gl) return d === a.Pb && e === a.Tb || a.lg(), !1;
        R !== a.qk && (a.Tb = "1px" === P ? a.Tb + a.Xd : Math.max(a.Tb - a.Xd, 1), h = !0);
        a.qk = R;
        a.yt.style.width = P;
        V !== a.Gl && (a.Pb = "1px" === H ? a.Pb + a.Xd : Math.max(a.Pb - a.Xd, 1), h = !0, a.rs && (k = D.P(), V ? (b.style.left = a.Xd + "px", a.position = k.n(a.sb.x + a.Xd / a.scale, a.sb.y)) : (b.style.left = "0px", a.position = k.n(a.sb.x - a.Xd / a.scale, a.sb.y)), D.A(k)));
        a.Gl = V;
        a.yt.style.height = H;
        b = a.ax;
        k = b.scrollLeft;
        a.jB && a.Be && (m + 1 < t ? k = (a.position.x - q) * p : q + 1 < w ? k = b.scrollWidth - b.clientWidth : r > A + 1 && (k = a.position.x * p));
        if (a.rs) switch (a.lA) {
            case "negative":
                k = -(b.scrollWidth - k - b.clientWidth);
                break;
            case "reverse":
                k = b.scrollWidth - k - b.clientWidth
        }
        b.scrollLeft =
            k;
        a.kB && a.Ce && (c + 1 < y ? b.scrollTop = (a.position.y - s) * p : s + 1 < B ? b.scrollTop = b.scrollHeight - b.clientHeight : u > n + 1 && (b.scrollTop = a.position.y * p));
        h && (a.ms = !0);
        m = a.Pb;
        c = a.Tb;
        b.style.width = m + (a.Gl ? a.Xd : 0) + "px";
        b.style.height = c + (a.qk ? a.Xd : 0) + "px";
        a.nA = !1;
        return d !== m || e !== c || a.Ra.zc ? (n = a.wb, a.dv(g, n, p, a.scale, h), !1) : !0
    }
    E.prototype.add = E.prototype.add = function(a) {
        D.l(a, F, E, "add:part");
        var b = a.g;
        if (b !== this) {
            null !== b && D.k("Cannot add part " + a.toString() + " to " + this.toString() + ". It is already a part of " + b.toString());
            this.hr && (a.Nl = "Tool");
            var c = a.Nf,
                b = this.pm(c);
            null === b && (b = this.pm(""));
            null === b && D.k('Cannot add a Part when unable find a Layer named "' + c + '" and there is no default Layer');
            a.layer !== b && (c = b.uq(99999999, a, a.g === this), 0 <= c && this.od(hg, "parts", b, null, a, null, c), b.Yc || this.Qc(), a.L(Wm), c = a.py, null !==
                c && c(a, null, b))
        }
    };
    E.prototype.uq = function(a) {
        if (a instanceof G) {
            if (this.Ap.add(a), a instanceof I) {
                var b = a.Ka;
                null === b ? this.$l.add(a) : b.gn.add(a);
                b = a.Yb;
                null !== b && (b.g = this)
            }
        } else a instanceof J ? this.tp.add(a) : a instanceof da || this.rb.add(a);
        var c = this;
        Xm(a, function(a) { Ym(c, a) });
        (a instanceof da || a instanceof I && null !== a.Rb) && a.K();
        b = a.data;
        null !== b && (a instanceof da || (a instanceof J ? this.gk.add(b, a) : this.Vi.add(b, a)), Xm(a, function(a) { Zm(c, a) }));
        !0 !== Om(a) && !0 !== Pm(a) || this.Gg.add(a);
        $m(a, !0, this);
        an(a) ? (a.aa.H() &&
            this.ra(xl(a, a.aa)), this.Qc()) : a.isVisible() && a.aa.H() && this.ra(xl(a, a.aa));
        this.Ve()
    };
    E.prototype.yf = function(a) {
        a.iu();
        if (a instanceof G) {
            if (this.Ap.remove(a), a instanceof I) {
                var b = a.Ka;
                null === b ? this.$l.remove(a) : b.gn.remove(a);
                b = a.Yb;
                null !== b && (b.g = null)
            }
        } else a instanceof J ? this.tp.remove(a) : a instanceof da || this.rb.remove(a);
        var c = this;
        Xm(a, function(a) { bn(c, a) });
        b = a.data;
        null !== b && (a instanceof da || (a instanceof J ? this.gk.remove(b) : this.Vi.remove(b)), Xm(a, function(a) { cn(c, a) }));
        this.Gg.remove(a);
        an(a) ? (a.aa.H() && this.ra(xl(a, a.aa)), this.Qc()) : a.isVisible() && a.aa.H() && this.ra(xl(a,
            a.aa));
        this.Ve()
    };
    E.prototype.remove = E.prototype.remove = function(a) {
        D.l(a, F, E, "remove:part");
        dn(this, a, !0)
    };

    function dn(a, b, c) {
        var d = b.layer;
        null !== d && d.g === a && (b.ib = !1, b.Zg = !1, b.L(en), c && b.Nn(), c = d.yf(-1, b, !1), 0 <= c && a.od(ig, "parts", d, b, null, c, null), a = b.py, null !== a && a(b, d, null))
    }
    E.prototype.removeParts = E.prototype.RB = function(a, b) {
        if (D.isArray(a))
            for (var c = D.cb(a), d = 0; d < c; d++) {
                var e = D.La(a, d);
                b && !e.canDelete() || this.remove(e)
            } else
                for (e = new L(F), e.Vc(a), c = e.j; c.next();) e = c.value, b && !e.canDelete() || this.remove(e)
    };
    E.prototype.copyParts = E.prototype.hq = function(a, b, c) { return this.yb.hq(a, b, c) };
    E.prototype.moveParts = E.prototype.moveParts = function(a, b, c) {
        D.l(b, N, E, "moveParts:offset");
        var d = this.nb;
        if (null !== d) {
            d = d.Ge;
            null === d && (d = new Uh, d.ad(this));
            var e = new oa(F);
            if (null !== a) a = a.j;
            else {
                for (a = this.Hi; a.next();) gi(d, e, a.value, c);
                for (a = this.rg; a.next();) gi(d, e, a.value, c);
                a = this.links
            }
            for (; a.next();) gi(d, e, a.value, c);
            d.moveParts(e, b, c)
        }
    };

    function fn(a, b, c) {
        D.l(b, Hg, E, "addLayer:layer");
        null !== b.g && b.g !== a && D.k("Cannot share a Layer with another Diagram: " + b + " of " + b.g);
        null === c ? null !== b.g && D.k("Cannot add an existing Layer to this Diagram again: " + b) : (D.l(c, Hg, E, "addLayer:existingLayer"), c.g !== a && D.k("Existing Layer must be in this Diagram: " + c + " not in " + c.g), b === c && D.k("Cannot move a Layer before or after itself: " + b));
        if (b.g !== a) {
            b = b.name;
            a = a.dc;
            c = a.count;
            for (var d = 0; d < c; d++) a.fa(d).name === b && D.k("Cannot add Layer with the name '" +
                b + "'; a Layer with the same name is already present in this Diagram.")
        }
    }
    E.prototype.addLayer = E.prototype.$t = function(a) {
        fn(this, a, null);
        a.ad(this);
        var b = this.dc,
            c = b.count - 1;
        if (!a.Yc)
            for (; 0 <= c && b.fa(c).Yc;) c--;
        b.be(c + 1, a);
        null !== this.ye && this.od(hg, "layers", this, null, a, null, c + 1);
        this.ra();
        this.Qc()
    };
    E.prototype.addLayerBefore = E.prototype.XH = function(a, b) {
        fn(this, a, b);
        a.ad(this);
        var c = this.dc,
            d = c.indexOf(a);
        0 <= d && (c.remove(a), null !== this.ye && this.od(ig, "layers", this, a, null, d, null));
        for (var e = c.count, g = 0; g < e; g++)
            if (c.fa(g) === b) { c.be(g, a); break }
        null !== this.ye && this.od(hg, "layers", this, null, a, null, g);
        this.ra();
        0 > d && this.Qc()
    };
    E.prototype.addLayerAfter = function(a, b) {
        fn(this, a, b);
        a.ad(this);
        var c = this.dc,
            d = c.indexOf(a);
        0 <= d && (c.remove(a), null !== this.ye && this.od(ig, "layers", this, a, null, d, null));
        for (var e = c.count, g = 0; g < e; g++)
            if (c.fa(g) === b) { c.be(g + 1, a); break }
        null !== this.ye && this.od(hg, "layers", this, null, a, null, g + 1);
        this.ra();
        0 > d && this.Qc()
    };
    E.prototype.removeLayer = function(a) {
        D.l(a, Hg, E, "removeLayer:layer");
        a.g !== this && D.k("Cannot remove a Layer from another Diagram: " + a + " of " + a.g);
        if ("" !== a.name) {
            var b = this.dc,
                c = b.indexOf(a);
            if (b.remove(a)) {
                for (b = a.rb.copy().j; b.next();) {
                    var d = b.value,
                        e = d.Nf;
                    d.Nf = e !== a.name ? e : ""
                }
                null !== this.ye && this.od(ig, "layers", this, a, null, c, null);
                this.ra();
                this.Qc()
            }
        }
    };
    E.prototype.findLayer = E.prototype.pm = function(a) { for (var b = this.ao; b.next();) { var c = b.value; if (c.name === a) return c } return null };
    E.prototype.addModelChangedListener = E.prototype.ZH = function(a) {
        D.h(a, "function", E, "addModelChangedListener:listener");
        null === this.xh && (this.xh = new K("function"));
        this.xh.add(a);
        this.ea.Bn(a)
    };
    E.prototype.removeModelChangedListener = function(a) {
        D.h(a, "function", E, "removeModelChangedListener:listener");
        null !== this.xh && (this.xh.remove(a), 0 === this.xh.count && (this.xh = null));
        this.ea.gv(a)
    };
    E.prototype.addChangedListener = E.prototype.Bn = function(a) {
        D.h(a, "function", E, "addChangedListener:listener");
        null === this.Qi && (this.Qi = new K("function"));
        this.Qi.add(a)
    };
    E.prototype.removeChangedListener = E.prototype.gv = function(a) {
        D.h(a, "function", E, "removeChangedListener:listener");
        null !== this.Qi && (this.Qi.remove(a), 0 === this.Qi.count && (this.Qi = null))
    };
    E.prototype.Gx = function(a) {
        this.kb || this.na.ZF(a);
        a.Oc !== gg && (this.Gi = !0);
        if (null !== this.Qi)
            for (var b = this.Qi, c = b.length, d = 0; d < c; d++) b.fa(d)(a)
    };
    E.prototype.raiseChangedEvent = E.prototype.od = function(a, b, c, d, e, g, h) {
        void 0 === g && (g = null);
        void 0 === h && (h = null);
        var k = new eg;
        k.g = this;
        k.Oc = a;
        k.propertyName = b;
        k.object = c;
        k.oldValue = d;
        k.Wj = g;
        k.newValue = e;
        k.Uj = h;
        this.Gx(k)
    };
    E.prototype.raiseChanged = E.prototype.i = function(a, b, c, d, e) { this.od(fg, a, this, b, c, d, e) };
    D.w(E, { Ra: "animationManager" }, function() { return this.JC });
    D.w(E, { na: "undoManager" }, function() { return this.ye.na });
    D.defineProperty(E, { kb: "skipsUndoManager" }, function() { return this.vj }, function(a) {
        D.h(a, "boolean", E, "skipsUndoManager");
        this.vj = a;
        this.ye.vj = a
    });
    D.defineProperty(E, { SA: "delaysLayout" }, function() { return this.Dz }, function(a) { this.Dz = a });
    E.prototype.Fn = function(a, b) {
        if (null !== a && a.g === this) {
            var c = this.Xe;
            try {
                this.Xe = !0;
                var d = a.Oc,
                    e;
                if (d === fg) {
                    var g = a.object,
                        h = a.propertyName,
                        k = a.oa(b);
                    D.Ua(g, h, k);
                    if (g instanceof O) {
                        var l, m = g.Y;
                        null !== m && m.pe()
                    }
                    this.Gi = !0
                } else if (d === hg) {
                    var n = a.object,
                        p = a.Uj,
                        g = a.newValue;
                    if (n instanceof x)
                        if ("number" === typeof p && g instanceof O) {
                            l = g;
                            var q = n;
                            b ? q.yf(p) : q.be(p, l);
                            m = n.Y;
                            null !== m && m.pe()
                        } else {
                            if ("number" === typeof p && g instanceof jh) {
                                var r = g,
                                    q = n;
                                b ? r.Ke ? q.LG(p) : q.JG(p) : (e = r.Ke ? q.oe(r.index) : q.ne(r.index),
                                    e.gq(r))
                            }
                        }
                    else if (n instanceof Hg) {
                        var s = !0 === a.Wj;
                        if ("number" === typeof p && g instanceof F) {
                            var m = g,
                                u = n;
                            b ? (m.ib = !1, m.Zg = !1, m.pe(), u.yf(s ? p : -1, m, s)) : u.uq(p, m, s)
                        }
                    } else if (n instanceof E) {
                        if ("number" === typeof p && g instanceof Hg) {
                            var t = g;
                            b ? this.dc.pd(p) : (d = t, d.ad(this), this.dc.be(p, d))
                        }
                    } else D.k("unknown ChangedEvent.Insert object: " + a.toString());
                    this.Gi = !0
                } else d === ig ? (n = a.object, p = a.Wj, g = a.oldValue, n instanceof x ? "number" === typeof p && g instanceof O ? (q = n, b ? q.be(p, g) : q.yf(p)) : "number" === typeof p && g instanceof jh && (r = g, q = n, b ? (e = r.Ke ? q.oe(r.index) : q.ne(r.index), e.gq(r)) : r.Ke ? q.LG(p) : q.JG(p)) : n instanceof Hg ? (s = !0 === a.Uj, "number" === typeof p && g instanceof F && (m = g, u = n, b ? u.uq(p, m, s) : (m.ib = !1, m.Zg = !1, m.pe(), u.yf(s ? p : -1, m, s)))) : n instanceof E ? "number" === typeof p && g instanceof Hg && (t = g, b ? (d = t, d.ad(this), this.dc.be(p, d)) : this.dc.pd(p)) : D.k("unknown ChangedEvent.Remove object: " + a.toString()), this.Gi = !0) : d !== gg && D.k("unknown ChangedEvent: " + a.toString())
            } finally { this.Xe = c }
        }
    };
    E.prototype.startTransaction = E.prototype.Nb = function(a) { return this.na.Nb(a) };
    E.prototype.commitTransaction = E.prototype.jd = function(a) { return this.na.jd(a) };
    E.prototype.rollbackTransaction = E.prototype.Am = function() { return this.na.Am() };
    E.prototype.commit = function(a, b) {
        var c = b;
        void 0 === c && (c = "");
        var d = this.kb;
        null === c && (this.kb = !0, c = "");
        this.na.Nb(c);
        var e = !1;
        try { a(this), e = !0 } finally { e ? this.na.jd(c) : this.na.Am(), this.kb = d }
    };
    E.prototype.updateAllTargetBindings = E.prototype.vH = function(a) { void 0 === a && (a = ""); for (var b = this.Hi; b.next();) b.value.Ob(a); for (b = this.rg; b.next();) b.value.Ob(a); for (b = this.links; b.next();) b.value.Ob(a) };
    E.prototype.updateAllRelationshipsFromData = E.prototype.JK = function() {
        for (var a = this.ea, b = new L, c = a.qg, d = 0; d < c.length; d++) {
            var e = c[d];
            b.add(e)
        }
        var g = [];
        this.rg.each(function(a) { null === a.data || b.contains(a.data) || g.push(a.data) });
        this.Hi.each(function(a) { null === a.data || b.contains(a.data) || g.push(a.data) });
        g.forEach(function(b) { eh(a, b, !1) });
        for (d = 0; d < c.length; d++) {
            var e = c[d],
                h = this.Nh(e);
            null === h && dh(a, e, !1)
        }
        if (a instanceof Y) {
            for (var k = new L, c = a.$g, d = 0; d < c.length; d++) e = c[d], k.add(e);
            var l = [];
            this.links.each(function(a) {
                null ===
                    a.data || k.contains(a.data) || l.push(a.data)
            });
            l.forEach(function(b) { oh(a, b, !1) });
            for (d = 0; d < c.length; d++) e = c[d], h = this.gg(e), null === h && nh(a, e, !1)
        }
        for (d = this.Hi; d.next();) h = d.value, h.updateRelationshipsFromData();
        for (d = this.rg; d.next();) d.value.updateRelationshipsFromData();
        for (d = this.links; d.next();) h = d.value, h.updateRelationshipsFromData()
    };

    function gn(a, b, c) {
        if (a.ed || a.je) a.Db = c, c = a.Ra, c.zc && sl(c, b, a.Db);
        else if (a.ed = !0, null === a.Ib) a.Db = c;
        else {
            var d = a.wb.copy(),
                e = a.Pb,
                g = a.Tb;
            d.width = a.Pb / b;
            d.height = a.Tb / b;
            var h = a.Jm.x,
                k = a.Jm.y,
                l = a.LA;
            isNaN(h) && (l.Pj() ? l.Mj(xc) ? h = 0 : l.Mj(yc) && (h = e - 1) : h = l.Xc() ? l.x * (e - 1) : e / 2);
            isNaN(k) && (l.Pj() ? l.Mj(wc) ? k = 0 : l.Mj(Dc) && (k = g - 1) : k = l.Xc() ? l.y * (g - 1) : g / 2);
            null !== a.VG && (c = a.VG(a, c));
            c < a.Sh && (c = a.Sh);
            c > a.Rh && (c = a.Rh);
            e = D.Fb(a.sb.x + h / b - h / c, a.sb.y + k / b - k / c);
            a.position = e;
            D.A(e);
            a.Db = c;
            a.dv(d, a.wb, b, c, !1);
            a.ed = !1;
            Yl(a, !1);
            c = a.Ra;
            c.zc && sl(c, b, a.Db);
            a.ra();
            im(a)
        }
    }
    E.prototype.dv = function(a, b, c, d, e) { a.O(b) || (void 0 === e && (e = !1), e || im(this), Wl(this), d = this.Yb, null === d || !d.my || this.im !== Vh || e || a.width === b.width && a.height === b.height || d.L(), d = this.eb, !0 === this.th && d instanceof Ph && (this.U.ha = this.qC(this.U.te), Xk(d, this)), this.ed || this.dG(a, b), lm(this), this.Fh.scale = c, this.Fh.position.x = a.x, this.Fh.position.y = a.y, this.Fh.bounds.set(a), this.Fh.isScroll = e, this.Ja("ViewportBoundsChanged", this.Fh, a), this.uB && this.links.each(function(a) { a.Nj && a.aa.jg(b) && a.ec() })) };

    function lm(a, b) {
        void 0 === b && (b = null);
        var c = a.Ed;
        if (null !== c && c.visible) {
            for (var d = D.Gm(), e = 1, g = 1, h = c.xa.o, k = h.length, l = 0; l < k; l++) {
                var m = h[l],
                    n = m.interval;
                2 > n || (hn(m.Kb) ? g = g * n / Te(g, n) : e = e * n / Te(e, n))
            }
            h = c.ay;
            d.n(g * h.width, e * h.height);
            h = g = l = k = 0;
            if (null !== b) k = b.width, l = b.height, g = b.x, h = b.y;
            else {
                e = D.Sf();
                g = a.wb;
                e.n(g.x, g.y, g.width, g.height);
                for (h = a.Qw.j; h.next();) g = h.value.wb, g.H() && Ub(e, g.x, g.y, g.width, g.height);
                if (!e.H()) { D.Lb(e); return }
                k = e.width;
                l = e.height;
                g = e.x;
                h = e.y;
                D.Lb(e)
            }
            c.width = k + 2 * d.width;
            c.height =
                l + 2 * d.height;
            e = D.P();
            jb(g, h, 0, 0, d.width, d.height, e);
            e.offset(-d.width, -d.height);
            D.Zk(d);
            c.Y.location = e;
            D.A(e)
        }
    }
    E.prototype.clearSelection = E.prototype.Ix = function() {
        var a = 0 < this.selection.count;
        a && this.Ja("ChangingSelection");
        Th(this);
        a && this.Ja("ChangedSelection")
    };

    function Th(a) {
        a = a.selection;
        if (0 < a.count) {
            for (var b = a.Fc(), c = b.length, d = 0; d < c; d++) b[d].ib = !1;
            a.Xa();
            a.clear();
            a.freeze()
        }
    }
    E.prototype.select = E.prototype.select = function(a) { null !== a && (D.l(a, F, E, "select:part"), a.layer.g === this && (!a.ib || 1 < this.selection.count) && (this.Ja("ChangingSelection"), Th(this), a.ib = !0, this.Ja("ChangedSelection"))) };
    E.prototype.selectCollection = E.prototype.ZG = function(a) {
        this.Ja("ChangingSelection");
        Th(this);
        if (D.isArray(a))
            for (var b = D.cb(a), c = 0; c < b; c++) {
                var d = D.La(a, c);
                d instanceof F || D.k("Diagram.selectCollection given something that is not a Part: " + d);
                d.ib = !0
            } else
                for (a = a.j; a.next();) d = a.value, d instanceof F || D.k("Diagram.selectCollection given something that is not a Part: " + d), d.ib = !0;
        this.Ja("ChangedSelection")
    };
    E.prototype.clearHighlighteds = E.prototype.fI = function() {
        var a = this.vm;
        if (0 < a.count) {
            for (var b = a.Fc(), c = b.length, d = 0; d < c; d++) b[d].Zg = !1;
            a.Xa();
            a.clear();
            a.freeze()
        }
    };
    E.prototype.highlight = function(a) { null !== a && a.layer.g === this && (D.l(a, F, E, "highlight:part"), !a.Zg || 1 < this.vm.count) && (this.fI(), a.Zg = !0) };
    E.prototype.highlightCollection = function(a) { for (var b = (new L(F)).Vc(a), c = this.vm.copy().Iy(b).j; c.next();) a = c.value, a.Zg = !1; for (b = b.j; b.next();) a = b.value, a instanceof F || D.k("Diagram.highlightCollection given something that is not a Part: " + a), a.Zg = !0 };
    E.prototype.scroll = E.prototype.scroll = function(a, b, c) {
        void 0 === c && (c = 1);
        var d = "up" === b || "down" === b,
            e = 0;
        if ("pixel" === a) e = c;
        else if ("line" === a) e = c * (d ? this.mv : this.lv);
        else if ("page" === a) a = d ? this.wb.height : this.wb.width, a *= this.scale, 0 !== a && (e = Math.max(a - (d ? this.mv : this.lv), 0), e *= c);
        else {
            if ("document" === a) {
                e = this.kd;
                d = this.wb;
                c = D.P();
                "up" === b ? this.position = c.n(d.x, e.y) : "left" === b ? this.position = c.n(e.x, d.y) : "down" === b ? this.position = c.n(d.x, e.bottom - d.height) : "right" === b && (this.position = c.n(e.right - d.width,
                    d.y));
                D.A(c);
                return
            }
            D.k("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: " + a)
        }
        e /= this.scale;
        c = this.position.copy();
        "up" === b ? c.y = this.position.y - e : "down" === b ? c.y = this.position.y + e : "left" === b ? c.x = this.position.x - e : "right" === b ? c.x = this.position.x + e : D.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: " + b);
        this.position = c
    };
    E.prototype.scrollToRect = E.prototype.WG = function(a) {
        var b = this.wb;
        b.Sk(a) || (a = a.jm, a.x -= b.width / 2, a.y -= b.height / 2, this.position = a)
    };
    E.prototype.centerRect = E.prototype.eF = function(a) {
        var b = this.wb;
        a = a.jm;
        a.x -= b.width / 2;
        a.y -= b.height / 2;
        this.position = a
    };
    E.prototype.transformDocToView = E.prototype.pC = function(a) {
        var b = this.Nc;
        b.reset();
        1 !== this.Db && b.scale(this.Db);
        var c = this.sb;
        (0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y);
        return a.copy().transform(this.Nc)
    };
    E.prototype.transformViewToDoc = E.prototype.qC = function(a) {
        var b = this.Nc;
        b.reset();
        1 !== this.Db && b.scale(this.Db);
        var c = this.sb;
        (0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y);
        return kb(a.copy(), this.Nc)
    };
    var Vh;
    E.None = Vh = D.s(E, "None", 0);
    var bm;
    E.Uniform = bm = D.s(E, "Uniform", 1);
    var cm;
    E.UniformToFill = cm = D.s(E, "UniformToFill", 2);
    var fj;
    E.CycleAll = fj = D.s(E, "CycleAll", 10);
    var jj;
    E.CycleNotDirected = jj = D.s(E, "CycleNotDirected", 11);
    var lj;
    E.CycleNotDirectedFast = lj = D.s(E, "CycleNotDirectedFast", 12);
    var mj;
    E.CycleNotUndirected = mj = D.s(E, "CycleNotUndirected", 13);
    var gj;
    E.CycleDestinationTree = gj = D.s(E, "CycleDestinationTree", 14);
    var ij;
    E.CycleSourceTree = ij = D.s(E, "CycleSourceTree", 15);
    var Cl;
    E.DocumentScroll = Cl = D.s(E, "DocumentScroll", 1);
    var Um;
    E.InfiniteScroll = Um = D.s(E, "InfiniteScroll", 2);
    var El;
    E.TreeParentCollapsed = El = D.s(E, "TreeParentCollapsed", 21);
    var jn;
    E.AllParentsCollapsed = jn = D.s(E, "AllParentsCollapsed", 22);
    var kn;
    E.AnyParentsCollapsed = kn = D.s(E, "AnyParentsCollapsed", 23);
    D.defineProperty(E, { KK: "validCycle" }, function() { return this.tx }, function(a) {
        var b = this.tx;
        b !== a && (D.Da(a, E, E, "validCycle"), this.tx = a, this.i("validCycle", b, a))
    });
    D.w(E, { ao: "layers" }, function() { return this.dc.j });
    D.defineProperty(E, { Mf: "isModelReadOnly" }, function() { var a = this.ye; return null === a ? !1 : a.qb }, function(a) {
        var b = this.ye;
        null !== b && (b.qb = a)
    });
    D.defineProperty(E, { qb: "isReadOnly" }, function() { return this.dj }, function(a) {
        var b = this.dj;
        b !== a && (D.h(a, "boolean", E, "isReadOnly"), this.dj = a, this.i("isReadOnly", b, a))
    });
    D.defineProperty(E, { isEnabled: "isEnabled" }, function() { return this.rf }, function(a) {
        var b = this.rf;
        b !== a && (D.h(a, "boolean", E, "isEnabled"), this.rf = a, this.i("isEnabled", b, a))
    });
    D.defineProperty(E, { EA: "allowClipboard" }, function() { return this.Bv }, function(a) {
        var b = this.Bv;
        b !== a && (D.h(a, "boolean", E, "allowClipboard"), this.Bv = a, this.i("allowClipboard", b, a))
    });
    D.defineProperty(E, { Pk: "allowCopy" }, function() { return this.ll }, function(a) {
        var b = this.ll;
        b !== a && (D.h(a, "boolean", E, "allowCopy"), this.ll = a, this.i("allowCopy", b, a))
    });
    D.defineProperty(E, { Cn: "allowDelete" }, function() { return this.ml }, function(a) {
        var b = this.ml;
        b !== a && (D.h(a, "boolean", E, "allowDelete"), this.ml = a, this.i("allowDelete", b, a))
    });
    D.defineProperty(E, { du: "allowDragOut" }, function() { return this.Cv }, function(a) {
        var b = this.Cv;
        b !== a && (D.h(a, "boolean", E, "allowDragOut"), this.Cv = a, this.i("allowDragOut", b, a))
    });
    D.defineProperty(E, { XE: "allowDrop" }, function() { return this.Dv }, function(a) {
        var b = this.Dv;
        b !== a && (D.h(a, "boolean", E, "allowDrop"), this.Dv = a, this.i("allowDrop", b, a))
    });
    D.defineProperty(E, { Dx: "allowTextEdit" }, function() { return this.vl }, function(a) {
        var b = this.vl;
        b !== a && (D.h(a, "boolean", E, "allowTextEdit"), this.vl = a, this.i("allowTextEdit", b, a))
    });
    D.defineProperty(E, { Ax: "allowGroup" }, function() { return this.nl }, function(a) {
        var b = this.nl;
        b !== a && (D.h(a, "boolean", E, "allowGroup"), this.nl = a, this.i("allowGroup", b, a))
    });
    D.defineProperty(E, { Ex: "allowUngroup" }, function() { return this.wl }, function(a) {
        var b = this.wl;
        b !== a && (D.h(a, "boolean", E, "allowUngroup"), this.wl = a, this.i("allowUngroup", b, a))
    });
    D.defineProperty(E, { Zp: "allowInsert" }, function() { return this.Fv }, function(a) {
        var b = this.Fv;
        b !== a && (D.h(a, "boolean", E, "allowInsert"), this.Fv = a, this.i("allowInsert", b, a))
    });
    D.defineProperty(E, { eu: "allowLink" }, function() { return this.ol }, function(a) {
        var b = this.ol;
        b !== a && (D.h(a, "boolean", E, "allowLink"), this.ol = a, this.i("allowLink", b, a))
    });
    D.defineProperty(E, { Dn: "allowRelink" }, function() { return this.ql }, function(a) {
        var b = this.ql;
        b !== a && (D.h(a, "boolean", E, "allowRelink"), this.ql = a, this.i("allowRelink", b, a))
    });
    D.defineProperty(E, { fm: "allowMove" }, function() { return this.pl }, function(a) {
        var b = this.pl;
        b !== a && (D.h(a, "boolean", E, "allowMove"), this.pl = a, this.i("allowMove", b, a))
    });
    D.defineProperty(E, { Bx: "allowReshape" }, function() { return this.rl }, function(a) {
        var b = this.rl;
        b !== a && (D.h(a, "boolean", E, "allowReshape"), this.rl = a, this.i("allowReshape", b, a))
    });
    D.defineProperty(E, { fu: "allowResize" }, function() { return this.sl }, function(a) {
        var b = this.sl;
        b !== a && (D.h(a, "boolean", E, "allowResize"), this.sl = a, this.i("allowResize", b, a))
    });
    D.defineProperty(E, { Cx: "allowRotate" }, function() { return this.tl }, function(a) {
        var b = this.tl;
        b !== a && (D.h(a, "boolean", E, "allowRotate"), this.tl = a, this.i("allowRotate", b, a))
    });
    D.defineProperty(E, { Jf: "allowSelect" }, function() { return this.ul }, function(a) {
        var b = this.ul;
        b !== a && (D.h(a, "boolean", E, "allowSelect"), this.ul = a, this.i("allowSelect", b, a))
    });
    D.defineProperty(E, { YE: "allowUndo" }, function() { return this.Gv }, function(a) {
        var b = this.Gv;
        b !== a && (D.h(a, "boolean", E, "allowUndo"), this.Gv = a, this.i("allowUndo", b, a))
    });
    D.defineProperty(E, { Fx: "allowZoom" }, function() { return this.Iv }, function(a) {
        var b = this.Iv;
        b !== a && (D.h(a, "boolean", E, "allowZoom"), this.Iv = a, this.i("allowZoom", b, a))
    });
    D.defineProperty(E, { kB: "hasVerticalScrollbar" }, function() { return this.jw }, function(a) {
        var b = this.jw;
        b !== a && (D.h(a, "boolean", E, "hasVerticalScrollbar"), this.jw = a, im(this), this.ra(), this.i("hasVerticalScrollbar", b, a), Yl(this, !1))
    });
    D.defineProperty(E, { jB: "hasHorizontalScrollbar" }, function() { return this.iw }, function(a) {
        var b = this.iw;
        b !== a && (D.h(a, "boolean", E, "hasHorizontalScrollbar"), this.iw = a, im(this), this.ra(), this.i("hasHorizontalScrollbar", b, a), Yl(this, !1))
    });
    D.defineProperty(E, { Be: "allowHorizontalScroll" }, function() { return this.Ev }, function(a) {
        var b = this.Ev;
        b !== a && (D.h(a, "boolean", E, "allowHorizontalScroll"), this.Ev = a, this.i("allowHorizontalScroll", b, a), Yl(this, !1))
    });
    D.defineProperty(E, { Ce: "allowVerticalScroll" }, function() { return this.Hv }, function(a) {
        var b = this.Hv;
        b !== a && (D.h(a, "boolean", E, "allowVerticalScroll"), this.Hv = a, this.i("allowVerticalScroll", b, a), Yl(this, !1))
    });
    D.defineProperty(E, { lv: "scrollHorizontalLineChange" }, function() { return this.Yw }, function(a) {
        var b = this.Yw;
        b !== a && (D.h(a, "number", E, "scrollHorizontalLineChange"), 0 > a && D.ua(a, ">= 0", E, "scrollHorizontalLineChange"), this.Yw = a, this.i("scrollHorizontalLineChange", b, a))
    });
    D.defineProperty(E, { mv: "scrollVerticalLineChange" }, function() { return this.bx }, function(a) {
        var b = this.bx;
        b !== a && (D.h(a, "number", E, "scrollVerticalLineChange"), 0 > a && D.ua(a, ">= 0", E, "scrollVerticalLineChange"), this.bx = a, this.i("scrollVerticalLineChange", b, a))
    });
    D.defineProperty(E, { U: "lastInput" }, function() { return this.cc }, function(a) {
        v && D.l(a, bg, E, "lastInput");
        this.cc = a
    });
    D.defineProperty(E, { Pc: "firstInput" }, function() { return this.aj }, function(a) {
        v && D.l(a, bg, E, "firstInput");
        this.aj = a
    });
    D.defineProperty(E, { sc: "currentCursor" }, function() { return this.Sv }, function(a) {
        "" === a && (a = this.Mr);
        var b = this.Sv;
        if (b !== a) {
            D.h(a, "string", E, "currentCursor");
            var c = this.Ib,
                d = this.Ub;
            null !== c && (this.Sv = a, c.style.cursor = a, d.style.cursor = a, c.style.cursor === b && (c.style.cursor = "-webkit-" + a, d.style.cursor = "-webkit-" + a, c.style.cursor === b && (c.style.cursor = "-moz-" + a, d.style.cursor = "-moz-" + a, c.style.cursor === b && (c.style.cursor = a, d.style.cursor = a))))
        }
    });
    D.defineProperty(E, { zL: "defaultCursor" }, function() { return this.Mr }, function(a) {
        "" === a && (a = "auto");
        var b = this.Mr;
        b !== a && (D.h(a, "string", E, "defaultCursor"), this.Mr = a, this.i("defaultCursor", b, a))
    });
    D.defineProperty(E, { click: "click" }, function() { return this.Ri }, function(a) {
        var b = this.Ri;
        b !== a && (null !== a && D.h(a, "function", E, "click"), this.Ri = a, this.i("click", b, a))
    });
    D.defineProperty(E, { nu: "doubleClick" }, function() { return this.Yi }, function(a) {
        var b = this.Yi;
        b !== a && (null !== a && D.h(a, "function", E, "doubleClick"), this.Yi = a, this.i("doubleClick", b, a))
    });
    D.defineProperty(E, { MA: "contextClick" }, function() { return this.Ti }, function(a) {
        var b = this.Ti;
        b !== a && (null !== a && D.h(a, "function", E, "contextClick"), this.Ti = a, this.i("contextClick", b, a))
    });
    D.defineProperty(E, { FB: "mouseOver" }, function() { return this.nj }, function(a) {
        var b = this.nj;
        b !== a && (null !== a && D.h(a, "function", E, "mouseOver"), this.nj = a, this.i("mouseOver", b, a))
    });
    D.defineProperty(E, { EB: "mouseHover" }, function() { return this.mj }, function(a) {
        var b = this.mj;
        b !== a && (null !== a && D.h(a, "function", E, "mouseHover"), this.mj = a, this.i("mouseHover", b, a))
    });
    D.defineProperty(E, { DB: "mouseHold" }, function() { return this.lj }, function(a) {
        var b = this.lj;
        b !== a && (null !== a && D.h(a, "function", E, "mouseHold"), this.lj = a, this.i("mouseHold", b, a))
    });
    D.defineProperty(E, { TJ: "mouseDragOver" }, function() { return this.Jw }, function(a) {
        var b = this.Jw;
        b !== a && (null !== a && D.h(a, "function", E, "mouseDragOver"), this.Jw = a, this.i("mouseDragOver", b, a))
    });
    D.defineProperty(E, { CB: "mouseDrop" }, function() { return this.kj }, function(a) {
        var b = this.kj;
        b !== a && (null !== a && D.h(a, "function", E, "mouseDrop"), this.kj = a, this.i("mouseDrop", b, a))
    });
    D.defineProperty(E, { lC: "toolTip" }, function() { return this.wj }, function(a) {
        var b = this.wj;
        b !== a && (!v || null === a || a instanceof da || a instanceof hk || D.k("Diagram.toolTip must be an Adornment or HTMLInfo."), this.wj = a, this.i("toolTip", b, a))
    });
    D.defineProperty(E, { contextMenu: "contextMenu" }, function() { return this.Ui }, function(a) {
        var b = this.Ui;
        b !== a && (!v || a instanceof da || a instanceof hk || D.k("Diagram.contextMenu must be an Adornment or HTMLInfo."), this.Ui = a, this.i("contextMenu", b, a))
    });
    D.defineProperty(E, { yb: "commandHandler" }, function() { return this.wz }, function(a) {
        var b = this.wz;
        b !== a && (D.l(a, qa, E, "commandHandler"), null !== a.g && D.k("Cannot share CommandHandlers between Diagrams: " + a.toString()), null !== b && b.ad(null), this.wz = a, a.ad(this))
    });
    D.defineProperty(E, { nb: "toolManager" }, function() { return this.wA }, function(a) {
        var b = this.wA;
        b !== a && (D.l(a, Ph, E, "toolManager"), null !== a.g && D.k("Cannot share ToolManagers between Diagrams: " + a.toString()), null !== b && b.ad(null), this.wA = a, a.ad(this))
    });
    D.defineProperty(E, { mu: "defaultTool" }, function() { return this.Cz }, function(a) {
        var b = this.Cz;
        b !== a && (D.l(a, Zg, E, "defaultTool"), this.Cz = a, this.eb === b && (this.eb = a))
    });
    D.defineProperty(E, { eb: "currentTool" }, function() { return this.zz }, function(a) {
        var b = this.zz;
        null !== b && (b.wa && b.doDeactivate(), b.cancelWaitAfter(), b.doStop());
        null === a && (a = this.mu);
        null !== a && (D.l(a, Zg, E, "currentTool"), this.zz = a, a.ad(this), a.doStart())
    });
    D.w(E, { selection: "selection" }, function() { return this.ix });
    D.defineProperty(E, { KJ: "maxSelectionCount" }, function() { return this.Ew }, function(a) {
        var b = this.Ew;
        if (b !== a)
            if (D.h(a, "number", E, "maxSelectionCount"), 0 <= a && !isNaN(a)) {
                if (this.Ew = a, this.i("maxSelectionCount", b, a), !this.na.ub && (a = this.selection.count - a, 0 < a)) {
                    this.Ja("ChangingSelection");
                    for (var b = this.selection.Fc(), c = 0; c < a; c++) b[c].ib = !1;
                    this.Ja("ChangedSelection")
                }
            } else D.ua(a, ">= 0", E, "maxSelectionCount")
    });
    D.defineProperty(E, { WJ: "nodeSelectionAdornmentTemplate" }, function() { return this.Kw }, function(a) {
        var b = this.Kw;
        b !== a && (D.l(a, da, E, "nodeSelectionAdornmentTemplate"), this.Kw = a, this.i("nodeSelectionAdornmentTemplate", b, a))
    });
    D.defineProperty(E, { bJ: "groupSelectionAdornmentTemplate" }, function() { return this.gw }, function(a) {
        var b = this.gw;
        b !== a && (D.l(a, da, E, "groupSelectionAdornmentTemplate"), this.gw = a, this.i("groupSelectionAdornmentTemplate", b, a))
    });
    D.defineProperty(E, { EJ: "linkSelectionAdornmentTemplate" }, function() { return this.zw }, function(a) {
        var b = this.zw;
        b !== a && (D.l(a, da, E, "linkSelectionAdornmentTemplate"), this.zw = a, this.i("linkSelectionAdornmentTemplate", b, a))
    });
    D.w(E, { vm: "highlighteds" }, function() { return this.kw });
    D.defineProperty(E, { Gi: "isModified" }, function() { var a = this.na; return a.isEnabled ? null !== a.Gj ? !0 : this.qw && this.rh !== a.Lj : this.qw }, function(a) {
        if (this.qw !== a) {
            D.h(a, "boolean", E, "isModified");
            this.qw = a;
            var b = this.na;
            !a && b.isEnabled && (this.rh = b.Lj);
            a || ln(this)
        }
    });

    function ln(a) {
        var b = a.Gi;
        a.NE !== b && (a.NE = b, a.Ja("Modified"))
    }
    D.defineProperty(E, { ea: "model" }, function() { return this.ye }, function(a) {
        var b = this.ye;
        if (b !== a) {
            D.l(a, M, E, "model");
            this.eb.doCancel();
            null !== b && b.na !== a.na && b.na.jG && D.k("Do not replace a Diagram.model while a transaction is in progress.");
            this.Ra.Yh();
            this.Ix();
            this.sh = !1;
            this.bp = !0;
            this.rh = -2;
            this.cg = !1;
            var c = this.je;
            this.je = !0;
            this.Ra.po("Model");
            null !== b && (null !== this.xh && this.xh.each(function(a) { b.gv(a) }), b.gv(this.WD), b instanceof Y && mn(this, b.$g), mn(this, b.qg));
            this.ye = a;
            a.Bn(this.VD);
            nn(this,
                a.qg);
            a instanceof Y && on(this, a.$g);
            a.gv(this.VD);
            a.Bn(this.WD);
            null !== this.xh && this.xh.each(function(b) { a.Bn(b) });
            this.je = c;
            this.ed || this.ra();
            null !== b && (a.na.isEnabled = b.na.isEnabled)
        }
    });
    D.defineProperty(E, { $a: null }, function() { return this.OD }, function(a) { this.OD = a });
    D.w(E, { ty: null }, function() { return this.HH });

    function Gl(a, b) {
        if (b.ea === a.ea) {
            var c = b.Oc,
                d = b.propertyName;
            if (c === gg && "S" === d[0])
                if ("StartingFirstTransaction" === d) c = a.nb, c.qf.each(function(b) { b.ad(a) }), c.mg.each(function(b) { b.ad(a) }), c.ng.each(function(b) { b.ad(a) }), a.je || a.sh || (a.Sr = !0, a.bp && (a.cg = !0));
                else if ("StartingUndo" === d || "StartingRedo" === d) {
                var e = a.Ra;
                e.nf && !a.kb && e.Yh();
                a.Ja("ChangingSelection")
            } else "StartedTransaction" === d && (e = a.Ra, e.nf && !a.kb && e.Yh());
            else if (a.$a) {
                a.$a = !1;
                try {
                    var g = b.Cf;
                    if ("" !== g)
                        if (c === fg) {
                            if ("linkFromKey" === g) {
                                var h =
                                    b.object,
                                    k = a.gg(h);
                                if (null !== k) {
                                    var l = b.newValue,
                                        m = a.Se(l);
                                    k.$ = m
                                }
                            } else if ("linkToKey" === g) h = b.object, k = a.gg(h), null !== k && (l = b.newValue, m = a.Se(l), k.ba = m);
                            else if ("linkFromPortId" === g) { if (h = b.object, k = a.gg(h), null !== k) { var n = b.newValue; "string" === typeof n && (k.hg = n) } } else if ("linkToPortId" === g) h = b.object, k = a.gg(h), null !== k && (n = b.newValue, "string" === typeof n && (k.jh = n));
                            else if ("nodeGroupKey" === g) {
                                var h = b.object,
                                    p = a.Nh(h);
                                if (null !== p) {
                                    var q = b.newValue;
                                    if (void 0 !== q) {
                                        var r = a.Se(q);
                                        p.Ka = r instanceof I ? r :
                                            null
                                    } else p.Ka = null
                                }
                            } else if ("linkLabelKeys" === g) {
                                if (h = b.object, k = a.gg(h), null !== k) {
                                    var s = b.oldValue,
                                        u = b.newValue;
                                    if (D.isArray(s))
                                        for (var t = D.cb(s), y = 0; y < t; y++) {
                                            var w = D.La(s, y),
                                                m = a.Se(w);
                                            null !== m && (m.Xb = null)
                                        }
                                    if (D.isArray(u))
                                        for (t = D.cb(u), y = 0; y < t; y++) w = D.La(u, y), m = a.Se(w), null !== m && (m.Xb = k)
                                }
                            } else if ("nodeParentKey" === g) {
                                var A = b.object,
                                    B = a.Se(b.newValue),
                                    P = a.Xx(A);
                                if (null !== P) {
                                    var H = P.Qn();
                                    null !== H ? null === B ? a.remove(H) : a.ee ? H.$ = B : H.ba = B : pn(a, B, P)
                                }
                            } else if ("parentLinkCategory" === g) {
                                var A = b.object,
                                    P =
                                    a.Xx(A),
                                    R = b.newValue;
                                null !== P && "string" === typeof R && (H = P.Qn(), null !== H && (H.Kd = R))
                            } else if ("nodeCategory" === g) {
                                var h = b.object,
                                    aa = a.Nh(h),
                                    R = b.newValue;
                                null !== aa && "string" === typeof R && (aa.Kd = R)
                            } else if ("linkCategory" === g) {
                                var h = b.object,
                                    V = a.gg(h),
                                    R = b.newValue;
                                null !== V && "string" === typeof R && (V.Kd = R)
                            } else if ("nodeDataArray" === g) {
                                var ea = b.oldValue;
                                mn(a, ea);
                                var la = b.newValue;
                                nn(a, la)
                            } else "linkDataArray" === g && (ea = b.oldValue, mn(a, ea), la = b.newValue, on(a, la));
                            a.Gi = !0
                        } else c === hg ? (la = b.newValue, "nodeDataArray" ===
                            g && D.Qa(la) ? qn(a, la) : "linkDataArray" === g && D.Qa(la) ? rn(a, la) : "linkLabelKeys" === g && ch(la) && (k = a.gg(b.object), m = a.Se(la), null !== k && null !== m && (m.Xb = k)), a.Gi = !0) : c === ig ? (ea = b.oldValue, "nodeDataArray" === g && D.Qa(ea) ? sn(a, ea) : "linkDataArray" === g && D.Qa(ea) ? sn(a, ea) : "linkLabelKeys" === g && ch(ea) && (m = a.Se(ea), null !== m && (m.Xb = null)), a.Gi = !0) : c === gg && ("SourceChanged" === g ? null !== b.object ? Fl(a, b.object, b.propertyName) : (a.JK(), a.vH()) : "ModelDisplaced" === g && a.zm());
                    else if (c === fg) {
                        var Da = b.propertyName,
                            h = b.object;
                        if (h ===
                            a.ea) { if ("nodeKeyProperty" === Da || "nodeCategoryProperty" === Da || "linkFromKeyProperty" === Da || "linkToKeyProperty" === Da || "linkFromPortIdProperty" === Da || "linkToPortIdProperty" === Da || "linkLabelKeysProperty" === Da || "nodeIsGroupProperty" === Da || "nodeGroupKeyProperty" === Da || "nodeParentKeyProperty" === Da || "linkCategoryProperty" === Da) a.na.ub || a.zm() } else Fl(a, h, Da);
                        a.Gi = !0
                    } else if (c === hg || c === ig) tn(a, b), a.Gi = !0;
                    else if (c === gg) {
                        if ("FinishedUndo" === d || "FinishedRedo" === d) a.Ja("ChangedSelection"), Si(a);
                        e = a.Ra;
                        "RolledBackTransaction" ===
                        d && e.Yh();
                        a.Sr = !0;
                        a.lg();
                        0 === a.na.Ki && el(e);
                        "CommittedTransaction" === d && a.na.$z && (a.rh = Math.min(a.rh, a.na.Lj - 1));
                        var La = b.nG;
                        La && (ln(a), a.ty.clear());
                        !a.fA && La && (a.fA = !0, D.setTimeout(function() {
                            a.eb.standardMouseOver();
                            a.fA = !1
                        }, 10))
                    }
                } finally { a.$a = !0 }
            }
        }
    }

    function Fl(a, b, c) {
        if ("string" === typeof c) {
            var d = a.Nh(b);
            if (null !== d) d.Ob(c), a.ea instanceof Bg && (d = a.gg(b), null !== d && d.Ob(c));
            else {
                for (var d = null, e = a.Zm.j; e.next();) {
                    for (var g = e.value, h = 0; h < g.length; h++) {
                        var k = g[h].MI(b);
                        null !== k && (null === d && (d = D.mb()), d.push(k))
                    }
                    if (null !== d) break
                }
                if (null !== d) {
                    for (e = 0; e < d.length; e++) d[e].Ob(c);
                    D.ya(d)
                }
            }
            b === a.ea.fl && a.vH(c)
        }
    }
    D.defineProperty(E, { Xe: "skipsModelSourceBindings" }, function() { return this.pE }, function(a) { this.pE = a });
    D.defineProperty(E, { rv: null }, function() { return this.rA }, function(a) { this.rA = a });

    function tn(a, b) {
        var c = b.Oc === hg,
            d = c ? b.Uj : b.Wj,
            e = c ? b.newValue : b.oldValue,
            g = a.Zm.oa(b.object);
        if (Array.isArray(g))
            for (var h = 0; h < g.length; h++) {
                var k = g[h];
                if (c) un(k, e, d);
                else {
                    var l = d;
                    if (!(0 > l)) {
                        var m = l;
                        vn(k) && m++;
                        k.yf(m, !0);
                        wn(k, m, l)
                    }
                }
            }
    }

    function Zm(a, b) {
        var c = b.ej;
        if (D.isArray(c)) {
            var d = a.Zm.oa(c);
            if (null === d) d = [], d.push(b), a.Zm.add(c, d);
            else {
                for (c = 0; c < d.length; c++)
                    if (d[c] === b) return;
                d.push(b)
            }
        }
    }

    function cn(a, b) {
        var c = b.ej;
        if (D.isArray(c)) {
            var d = a.Zm.oa(c);
            if (null !== d)
                for (var e = 0; e < d.length; e++)
                    if (d[e] === b) {
                        d.splice(e, 1);
                        0 === d.length && a.Zm.remove(c);
                        break
                    }
        }
    }

    function Ym(a, b) {
        for (var c = b.xa.o, d = c.length, e = 0; e < d; e++) {
            var g = c[e];
            g instanceof Hl && xn(a, g)
        }
    }

    function xn(a, b) {
        var c = b.element;
        if (null !== c && c instanceof HTMLImageElement) {
            var d = b.af;
            null !== d && (d.ep instanceof Event && null !== b.bf && b.bf(b, d.ep), !0 === d.ps && (null !== b.zi && b.zi(b, d.mA), null !== b.g && b.g.iA.add(b)));
            c = c.src;
            d = a.Cp.oa(c);
            if (null === d) d = [], d.push(b), a.Cp.add(c, d);
            else {
                for (c = 0; c < d.length; c++)
                    if (d[c] === b) return;
                d.push(b)
            }
        }
    }

    function bn(a, b) {
        for (var c = b.xa.o, d = c.length, e = 0; e < d; e++) {
            var g = c[e];
            g instanceof Hl && yn(a, g)
        }
    }

    function yn(a, b) {
        var c = b.element;
        if (null !== c && c instanceof HTMLImageElement) {
            var c = c.src,
                d = a.Cp.oa(c);
            if (null !== d)
                for (var e = 0; e < d.length; e++)
                    if (d[e] === b) {
                        d.splice(e, 1);
                        0 === d.length && a.Cp.remove(c);
                        break
                    }
        }
    }
    E.prototype.rebuildParts = E.prototype.zm = function() {
        for (var a = this.JB.j; a.next();) {
            var b = a.value,
                c = a.key;
            (!b.qe() || b instanceof I) && D.k('Invalid node template in Diagram.nodeTemplateMap: template for "' + c + '" must be a Node or a simple Part, not a Group or Link: ' + b)
        }
        for (a = this.iB.j; a.next();) b = a.value, c = a.key, b instanceof I || D.k('Invalid group template in Diagram.groupTemplateMap: template for "' + c + '" must be a Group, not a normal Node or Link: ' + b);
        for (a = this.xB.j; a.next();) b = a.value, c = a.key, b instanceof
        J || D.k('Invalid link template in Diagram.linkTemplateMap: template for "' + c + '" must be a Link, not a normal Node or simple Part: ' + b);
        a = D.mb();
        for (b = this.selection.j; b.next();)(c = b.value.data) && a.push(c);
        for (var b = D.mb(), d = this.vm.j; d.next();)(c = d.value.data) && b.push(c);
        c = D.mb();
        for (d = this.rg.j; d.next();) {
            var e = d.value;
            null !== e.data && (c.push(e.data), c.push(e.location))
        }
        for (d = this.links.j; d.next();) e = d.value, null !== e.data && (c.push(e.data), c.push(e.location));
        for (d = this.Hi.j; d.next();) e = d.value, null !==
            e.data && (c.push(e.data), c.push(e.location));
        d = this.ea;
        d instanceof Y && mn(this, d.$g);
        mn(this, d.qg);
        nn(this, d.qg);
        d instanceof Y && on(this, d.$g);
        for (d = 0; d < a.length; d++) e = this.Nh(a[d]), null !== e && (e.ib = !0);
        for (d = 0; d < b.length; d++) e = this.Nh(b[d]), null !== e && (e.Zg = !0);
        for (d = 0; d < c.length; d += 2) e = this.Nh(c[d]), null !== e && (e.location = c[d + 1]);
        D.ya(a);
        D.ya(b);
        D.ya(c)
    };

    function nn(a, b) {
        if (null !== b) {
            for (var c = a.ea, d = c instanceof Y, e = D.cb(b), g = 0; g < e; g++) {
                var h = D.La(b, g);
                c.ke(h) ? qn(a, h, !1) : d && rn(a, h)
            }
            if (d || c instanceof Bg) {
                for (g = 0; g < e; g++) h = D.La(b, g), c.ke(h) && zn(a, h);
                if (d)
                    for (c = a.links; c.next();) An(c.value)
            }
            Bn(a, !1)
        }
    }

    function qn(a, b, c) {
        if (void 0 !== b && null !== b && !a.na.ub && !a.Vi.contains(b)) {
            void 0 === c && (c = !0);
            var d = a.eB(b),
                e = Cn(a, b, d);
            if (null !== e && (Sh(e), e = e.copy(), null !== e)) {
                var g = a.Xe;
                a.Xe = !0;
                e.Pi = d;
                e.Sd = b;
                a.add(e);
                e.Sd = null;
                e.data = b;
                c && zn(a, b);
                a.Xe = g
            }
        }
    }
    E.prototype.eB = function(a) { return this.ea.eB(a) };
    var Dn = !1,
        En = !1;

    function Cn(a, b, c) {
        var d = !1,
            e = a.ea;
        e instanceof Y && (d = e.sB(b));
        d ? (b = a.iB.oa(c), null === b && (b = a.iB.oa(""), null === b && (En || (En = !0, D.trace('No Group template found for category "' + c + '"'), D.trace("  Using default group template")), b = a.eD))) : (b = a.JB.oa(c), null === b && (b = a.JB.oa(""), null === b && (Dn || (Dn = !0, D.trace('No Node template found for category "' + c + '"'), D.trace("  Using default node template")), b = a.gD)));
        return b
    }

    function zn(a, b) {
        var c = a.ea;
        if (c instanceof Y || c instanceof Bg) {
            var d = c.zb(b);
            if (void 0 !== d) {
                var e = fh(c, d),
                    g = a.Nh(b);
                if (null !== e && null !== g) {
                    for (e = e.j; e.next();) {
                        var h = e.value;
                        if (c instanceof Y) {
                            var k = c;
                            if (k.ke(h)) {
                                if (g instanceof I && k.Sn(h) === d) {
                                    var l = g,
                                        h = a.Nh(h);
                                    null !== h && (h.Ka = l)
                                }
                            } else {
                                var m = a.gg(h);
                                if (null !== m && g instanceof G && (l = g, k.tm(h) === d && (m.$ = l), k.um(h) === d && (m.ba = l), h = k.$k(h), D.isArray(h)))
                                    for (k = 0; k < D.cb(h); k++)
                                        if (D.La(h, k) === d) { l.Xb = m; break }
                            }
                        } else c instanceof Bg && (m = c, m.ke(h) && g instanceof G && (l = g, m.Un(h) === d && (h = a.Xx(h), pn(a, l, h))))
                    }
                    hh(c, d)
                }
                c instanceof Y ? (c = c.Sn(b), void 0 !== c && (c = a.Se(c), c instanceof I && (g.Ka = c))) : c instanceof Bg && (c = c.Un(b), void 0 !== c && g instanceof G && (l = g, g = a.Se(c), pn(a, g, l)))
            }
        }
    }

    function pn(a, b, c) {
        if (null !== b && null !== c) {
            var d = a.nb.uG,
                e = b,
                g = c;
            if (a.ee)
                for (b = g.Od; b.next();) { if (b.value.ba === g) return } else
                    for (e = c, g = b, b = e.Od; b.next();)
                        if (b.value.$ === e) return;
            if (null === d || !hj(d, e, g, null, !0))
                if (d = a.Bu(c.data), b = rj(a, d), null !== b && (Sh(b), b = b.copy(), null !== b)) {
                    var h = a.Xe;
                    a.Xe = !0;
                    b.Pi = d;
                    b.Sd = c.data;
                    b.$ = e;
                    b.ba = g;
                    a.add(b);
                    b.Sd = null;
                    b.data = c.data;
                    a.Xe = h
                }
        }
    }

    function on(a, b) {
        if (null !== b) {
            for (var c = D.cb(b), d = 0; d < c; d++) {
                var e = D.La(b, d);
                rn(a, e)
            }
            Bn(a, !1)
        }
    }

    function rn(a, b) {
        if (void 0 !== b && null !== b && !a.na.ub && !a.gk.contains(b)) {
            var c = a.Bu(b),
                d = rj(a, c);
            if (null !== d && (Sh(d), d = d.copy(), null !== d)) {
                var e = a.Xe;
                a.Xe = !0;
                d.Pi = c;
                d.Sd = b;
                var c = a.ea,
                    g = c.UI(b);
                "" !== g && (d.hg = g);
                g = c.tm(b);
                void 0 !== g && (g = a.Se(g), g instanceof G && (d.$ = g));
                g = c.YI(b);
                "" !== g && (d.jh = g);
                g = c.um(b);
                void 0 !== g && (g = a.Se(g), g instanceof G && (d.ba = g));
                c = c.$k(b);
                if (D.isArray(c))
                    for (var g = D.cb(c), h = 0; h < g; h++) {
                        var k = D.La(c, h),
                            k = a.Se(k);
                        null !== k && (k.Xb = d)
                    }
                a.add(d);
                d.Sd = null;
                d.data = b;
                a.Xe = e
            }
        }
    }
    E.prototype.Bu = function(a) {
        var b = this.ea,
            c = "";
        b instanceof Y ? c = b.Bu(a) : b instanceof Bg && (c = b.WI(a));
        return c
    };
    var Fn = !1;

    function rj(a, b) {
        var c = a.xB.oa(b);
        null === c && (c = a.xB.oa(""), null === c && (Fn || (Fn = !0, D.trace('No Link template found for category "' + b + '"'), D.trace("  Using default link template")), c = a.fD));
        return c
    }

    function mn(a, b) {
        for (var c = D.cb(b), d = 0; d < c; d++) {
            var e = D.La(b, d);
            sn(a, e)
        }
    }

    function sn(a, b) {
        if (void 0 !== b && null !== b) {
            var c = a.Nh(b);
            if (null !== c) {
                dn(a, c, !1);
                var d = a.ea;
                if (d instanceof Y && c instanceof G) {
                    var e = d.zb(c.data);
                    if (void 0 !== e) {
                        for (var g = c.Od; g.next();) gh(d, e, g.value.data);
                        c.Lf && (g = c.Xb, null !== g && gh(d, e, g.data));
                        if (c instanceof I)
                            for (c = c.uc; c.next();) g = c.value.data, d.ke(g) && gh(d, e, g)
                    }
                } else if (d instanceof Bg && c instanceof G) {
                    g = a.gg(c.data);
                    if (null !== g) {
                        g.ib = !1;
                        g.Zg = !1;
                        var h = g.layer;
                        if (null !== h) {
                            var k = h.yf(-1, g, !1);
                            0 <= k && a.od(ig, "parts", h, g, null, k, null);
                            k = g.py;
                            null !==
                                k && k(g, h, null)
                        }
                    }
                    g = a.ee;
                    for (c = c.Od; c.next();) h = c.value, h = (g ? h.ba : h.$).data, d.ke(h) && gh(d, e, h)
                }
            }
        }
    }
    E.prototype.findPartForKey = E.prototype.NI = function(a) { if (null === a || void 0 === a) return null; var b = this.ea.Ie(a); return null !== b ? this.Vi.oa(b) : this.ea instanceof Y && (b = this.ea.oq(a), null !== b) ? this.gk.oa(b) : null };
    E.prototype.findNodeForKey = E.prototype.Se = function(a) {
        if (null === a || void 0 === a) return null;
        a = this.ea.Ie(a);
        if (null === a) return null;
        a = this.Vi.oa(a);
        return a instanceof G ? a : null
    };
    E.prototype.findPartForData = E.prototype.Nh = function(a) { if (null === a) return null; var b = this.Vi.oa(a); return null !== b ? b : b = this.gk.oa(a) };
    E.prototype.findNodeForData = E.prototype.Xx = function(a) {
        if (null === a) return null;
        a = this.Vi.oa(a);
        return a instanceof G ? a : null
    };
    E.prototype.findLinkForData = E.prototype.gg = function(a) { return null === a ? null : this.gk.oa(a) };
    E.prototype.findNodesByExample = function(a) {
        for (var b = new L(G), c = this.Ap.j; c.next();) {
            var d = c.value,
                e = d.data;
            if (null !== e)
                for (var g = 0; g < arguments.length; g++) { var h = arguments[g]; if (D.Qa(h) && Gn(this, e, h)) { b.add(d); break } }
        }
        return b.j
    };
    E.prototype.findLinksByExample = function(a) {
        for (var b = new L(J), c = this.tp.j; c.next();) {
            var d = c.value,
                e = d.data;
            if (null !== e)
                for (var g = 0; g < arguments.length; g++) { var h = arguments[g]; if (D.Qa(h) && Gn(this, e, h)) { b.add(d); break } }
        }
        return b.j
    };

    function Gn(a, b, c) {
        for (var d in c) {
            var e = b[d],
                g = c[d];
            if (D.isArray(g)) {
                if (!D.isArray(e) || e.length < g.length) return !1;
                for (var h = 0; h < e.length; h++) {
                    var k = e[h],
                        l = g[h];
                    if (void 0 !== l && !Hn(a, k, l)) return !1
                }
            } else if (!Hn(a, e, g)) return !1
        }
        return !0
    }

    function Hn(a, b, c) { if ("function" === typeof c) { if (!c(b)) return !1 } else if (c instanceof RegExp) { if (!b || !c.test(b.toString())) return !1 } else if (D.Qa(b) && D.Qa(c)) { if (!Gn(a, b, c)) return !1 } else if (b !== c) return !1; return !0 }
    D.defineProperty(E, { mM: "nodeTemplate" }, function() { return this.oj.oa("") }, function(a) {
        var b = this.oj.oa("");
        b !== a && (D.l(a, F, E, "nodeTemplate"), this.oj.add("", a), this.i("nodeTemplate", b, a), this.na.ub || this.zm())
    });
    D.defineProperty(E, { JB: "nodeTemplateMap" }, function() { return this.oj }, function(a) {
        var b = this.oj;
        b !== a && (D.l(a, oa, E, "nodeTemplateMap"), this.oj = a, this.i("nodeTemplateMap", b, a), this.na.ub || this.zm())
    });
    D.defineProperty(E, { SL: "groupTemplate" }, function() { return this.El.oa("") }, function(a) {
        var b = this.El.oa("");
        b !== a && (D.l(a, I, E, "groupTemplate"), this.El.add("", a), this.i("groupTemplate", b, a), this.na.ub || this.zm())
    });
    D.defineProperty(E, { iB: "groupTemplateMap" }, function() { return this.El }, function(a) {
        var b = this.El;
        b !== a && (D.l(a, oa, E, "groupTemplateMap"), this.El = a, this.i("groupTemplateMap", b, a), this.na.ub || this.zm())
    });
    D.defineProperty(E, { aM: "linkTemplate" }, function() { return this.xk.oa("") }, function(a) {
        var b = this.xk.oa("");
        b !== a && (D.l(a, J, E, "linkTemplate"), this.xk.add("", a), this.i("linkTemplate", b, a), this.na.ub || this.zm())
    });
    D.defineProperty(E, { xB: "linkTemplateMap" }, function() { return this.xk }, function(a) {
        var b = this.xk;
        b !== a && (D.l(a, oa, E, "linkTemplateMap"), this.xk = a, this.i("linkTemplateMap", b, a), this.na.ub || this.zm())
    });
    D.defineProperty(E, { rJ: null }, function() { return this.th }, function(a) { this.th = a });
    D.defineProperty(E, { of: "isMouseCaptured" }, function() { return this.LD }, function(a) {
        var b = this.Ib;
        null !== b && (a ? (this.U.bubbles = !1, this.mz ? (b.removeEventListener("pointermove", this.Kq, !1), b.removeEventListener("pointerdown", this.Jq, !1), b.removeEventListener("pointerup", this.Mq, !1), b.removeEventListener("pointerout", this.Lq, !1), window.addEventListener("pointermove", this.Kq, !0), window.addEventListener("pointerdown", this.Jq, !0), window.addEventListener("pointerup", this.Mq, !0), window.addEventListener("pointerout",
            this.Lq, !0)) : (b.removeEventListener("mousemove", this.jo, !1), b.removeEventListener("mousedown", this.io, !1), b.removeEventListener("mouseup", this.lo, !1), b.removeEventListener("mouseout", this.ko, !1), window.addEventListener("mousemove", this.jo, !0), window.addEventListener("mousedown", this.io, !0), window.addEventListener("mouseup", this.lo, !0), window.addEventListener("mouseout", this.ko, !0)), b.removeEventListener("wheel", this.mo, !1), window.addEventListener("wheel", this.mo, !0), window.addEventListener("selectstart",
            this.preventDefault, !1)) : (this.mz ? (window.removeEventListener("pointermove", this.Kq, !0), window.removeEventListener("pointerdown", this.Jq, !0), window.removeEventListener("pointerup", this.Mq, !0), window.removeEventListener("pointerout", this.Lq, !0), b.addEventListener("pointermove", this.Kq, !1), b.addEventListener("pointerdown", this.Jq, !1), b.addEventListener("pointerup", this.Mq, !1), b.addEventListener("pointerout", this.Lq, !1)) : (window.removeEventListener("mousemove", this.jo, !0), window.removeEventListener("mousedown",
            this.io, !0), window.removeEventListener("mouseup", this.lo, !0), window.removeEventListener("mouseout", this.ko, !0), b.addEventListener("mousemove", this.jo, !1), b.addEventListener("mousedown", this.io, !1), b.addEventListener("mouseup", this.lo, !1), b.addEventListener("mouseout", this.ko, !1)), window.removeEventListener("wheel", this.mo, !0), window.removeEventListener("selectstart", this.preventDefault, !1), b.addEventListener("wheel", this.mo, !1)), this.LD = a)
    });
    D.defineProperty(E, { position: "position" }, function() { return this.sb }, function(a) {
        var b = this.sb;
        if (!b.O(a)) {
            D.l(a, N, E, "position");
            var c = this.wb.copy();
            a = a.copy();
            if (!this.ed && null !== this.Ib) {
                this.ed = !0;
                var d = this.scale;
                $l(this, a, this.kd, this.Pb / d, this.Tb / d, this.No, !1);
                this.ed = !1
            }
            this.sb = a.V();
            a = this.Ra;
            a.zc && rl(a, b, this.sb);
            this.ed || this.dv(c, this.wb, this.Db, this.Db, !1)
        }
    });
    D.defineProperty(E, { iJ: "initialPosition" }, function() { return this.mw }, function(a) { this.mw.O(a) || (D.l(a, N, E, "initialPosition"), this.mw = a.V()) });
    D.defineProperty(E, { jJ: "initialScale" }, function() { return this.nw }, function(a) { this.nw !== a && (D.h(a, "number", E, "initialScale"), this.nw = a) });
    D.defineProperty(E, { Vn: "grid" }, function() { null === this.Ed && Rl(this); return this.Ed }, function(a) {
        var b = this.Ed;
        if (b !== a) {
            null === b && (Rl(this), b = this.Ed);
            D.l(a, x, E, "grid");
            a.type !== Sl && D.k("Diagram.grid must be a Panel of type Panel.Grid");
            var c = b.R;
            null !== c && c.remove(b);
            this.Ed = a;
            a.name = "GRID";
            null !== c && c.add(a);
            lm(this);
            this.ra();
            this.i("grid", b, a)
        }
    });
    D.w(E, { wb: "viewportBounds" }, function() {
        var a = this.ME;
        if (null === this.Ib) return a;
        var b = this.sb,
            c = this.Db;
        a.n(b.x, b.y, Math.max(this.Pb, 0) / c, Math.max(this.Tb, 0) / c);
        return a
    });
    D.defineProperty(E, { LF: "fixedBounds" }, function() { return this.ew }, function(a) {
        var b = this.ew;
        b.O(a) || (D.l(a, C, E, "fixedBounds"), (v && Infinity === a.width || -Infinity === a.width || Infinity === a.height || -Infinity === a.height) && D.k("fixedBounds width/height must not be Infinity"), this.ew = a = a.V(), this.Qc(), this.i("fixedBounds", b, a))
    });
    D.defineProperty(E, { Ny: "scrollMargin" }, function() { return this.Zw }, function(a) {
        "number" === typeof a ? a = new Lb(a) : D.l(a, Lb, E, "scrollMargin");
        var b = this.Zw;
        b.O(a) || (this.Zw = a = a.V(), this.i("scrollMargin", b, a), this.ro())
    });
    D.defineProperty(E, { VB: "scrollMode" }, function() { return this.$w }, function(a) {
        var b = this.$w;
        b !== a && (D.Da(a, E, E, "scrollMode"), this.$w = a, a === Cl && Yl(this, !1), this.i("scrollMode", b, a))
    });
    D.defineProperty(E, { oK: "scrollsPageOnFocus" }, function() { return this.ex }, function(a) {
        var b = this.ex;
        b !== a && (D.h(a, "boolean", E, "scrollsPageOnFocus"), this.ex = a, this.i("scrollsPageOnFocus", b, a))
    });
    D.defineProperty(E, { GG: "positionComputation" }, function() { return this.Uw }, function(a) {
        var b = this.Uw;
        b !== a && (null !== a && D.h(a, "function", E, "positionComputation"), this.Uw = a, Yl(this, !1), this.i("positionComputation", b, a))
    });
    D.defineProperty(E, { VG: "scaleComputation" }, function() { return this.Ww }, function(a) {
        var b = this.Ww;
        b !== a && (null !== a && D.h(a, "function", E, "scaleComputation"), this.Ww = a, gn(this, this.scale, this.scale), this.i("scaleComputation", b, a))
    });
    D.w(E, { kd: "documentBounds" }, function() { return this.Zv });

    function am(a, b) {
        a.rk = !1;
        var c = a.Zv;
        c.O(b) || (b = b.V(), a.Zv = b, Yl(a, !1), a.Ja("DocumentBoundsChanged", null, c.copy()), im(a))
    }
    D.defineProperty(E, { uB: "isVirtualized" }, function() { return this.uw }, function(a) {
        var b = this.uw;
        b !== a && (D.h(a, "boolean", E, "isVirtualized"), this.uw = a, this.i("isVirtualized", b, a))
    });
    D.defineProperty(E, { scale: "scale" }, function() { return this.Db }, function(a) {
        var b = this.Db;
        D.p(a, E, "scale");
        b !== a && gn(this, b, a)
    });
    D.defineProperty(E, { im: "autoScale" }, function() { return this.Nm }, function(a) {
        var b = this.Nm;
        b !== a && (D.Da(a, E, E, "autoScale"), this.Nm = a, this.i("autoScale", b, a), a !== Vh && Yl(this, !1))
    });
    D.defineProperty(E, { VL: "initialAutoScale" }, function() { return this.Il }, function(a) {
        var b = this.Il;
        b !== a && (D.Da(a, E, E, "initialAutoScale"), this.Il = a, this.i("initialAutoScale", b, a))
    });
    D.defineProperty(E, { kJ: "initialViewportSpot" }, function() { return this.ow }, function(a) {
        var b = this.ow;
        b !== a && (D.l(a, S, E, "initialViewportSpot"), a.Xc() || D.k("initialViewportSpot must be a specific Spot: " + a), this.ow = a, this.i("initialViewportSpot", b, a))
    });
    D.defineProperty(E, { hJ: "initialDocumentSpot" }, function() { return this.lw }, function(a) {
        var b = this.lw;
        b !== a && (D.l(a, S, E, "initialDocumentSpot"), a.Xc() || D.k("initialViewportSpot must be a specific Spot: " + a), this.lw = a, this.i("initialDocumentSpot", b, a))
    });
    D.defineProperty(E, { Sh: "minScale" }, function() { return this.Gw }, function(a) {
        D.p(a, E, "minScale");
        var b = this.Gw;
        b !== a && (0 < a ? (this.Gw = a, this.i("minScale", b, a), a > this.scale && (this.scale = a)) : D.ua(a, "> 0", E, "minScale"))
    });
    D.defineProperty(E, { Rh: "maxScale" }, function() { return this.Dw }, function(a) {
        D.p(a, E, "maxScale");
        var b = this.Dw;
        b !== a && (0 < a ? (this.Dw = a, this.i("maxScale", b, a), a < this.scale && (this.scale = a)) : D.ua(a, "> 0", E, "maxScale"))
    });
    D.defineProperty(E, { Jm: "zoomPoint" }, function() { return this.wx }, function(a) { this.wx.O(a) || (D.l(a, N, E, "zoomPoint"), this.wx = a = a.V()) });
    D.defineProperty(E, { LA: "contentAlignment" }, function() { return this.No }, function(a) {
        var b = this.No;
        b.O(a) || (D.l(a, S, E, "contentAlignment"), this.No = a = a.V(), this.i("contentAlignment", b, a), Yl(this, !1))
    });
    D.defineProperty(E, { WL: "initialContentAlignment" }, function() { return this.hp }, function(a) {
        var b = this.hp;
        b.O(a) || (D.l(a, S, E, "initialContentAlignment"), this.hp = a = a.V(), this.i("initialContentAlignment", b, a))
    });
    D.defineProperty(E, { padding: "padding" }, function() { return this.tf }, function(a) {
        "number" === typeof a ? a = new Lb(a) : D.l(a, Lb, E, "padding");
        var b = this.tf;
        b.O(a) || (this.tf = a = a.V(), this.Qc(), this.i("padding", b, a))
    });
    D.w(E, { rg: "nodes" }, function() { return this.Ap.j });
    D.w(E, { links: "links" }, function() { return this.tp.j });
    D.w(E, { Hi: "parts" }, function() { return this.rb.j });
    E.prototype.findTopLevelNodesAndLinks = function() {
        for (var a = new L(F), b = this.Ap.j; b.next();) {
            var c = b.value;
            c.Bq && a.add(c)
        }
        for (b = this.tp.j; b.next();) c = b.value, c.Bq && a.add(c);
        return a.j
    };
    E.prototype.findTopLevelGroups = function() { return this.$l.j };
    D.defineProperty(E, { Yb: "layout" }, function() { return this.we }, function(a) {
        var b = this.we;
        b !== a && (D.l(a, $g, E, "layout"), null !== b && (b.g = null, b.group = null), this.we = a, a.g = this, a.group = null, this.xl = !0, this.i("layout", b, a), this.Ve())
    });
    E.prototype.layoutDiagram = function(a) {
        Si(this);
        a && Bn(this, !0);
        mm(this, !1)
    };

    function Bn(a, b) {
        for (var c = a.$l.j; c.next();) In(a, c.value, b);
        null !== a.Yb && (b ? a.Yb.zf = !1 : a.Yb.L())
    }

    function In(a, b, c) {
        if (null !== b) {
            for (var d = b.gn.j; d.next();) In(a, d.value, c);
            null !== b.Yb && (c ? b.Yb.zf = !1 : b.Yb.L())
        }
    }

    function mm(a, b) {
        if (a.xl && !a.Dz) {
            var c = a.$a;
            a.$a = !0;
            try {
                var d = a.na.Ki;
                0 === d && a.Nb("Layout");
                var e = a.Ra;
                1 >= d && !e.nf && !e.zc && (b || e.po("Layout"));
                a.xl = !1;
                for (var g = a.$l.j; g.next();) Jn(a, g.value, b, d);
                var h = a.Yb;
                h.zf || (!b || h.mG || 0 === d ? (h.doLayout(a), Si(a), h.zf = !0) : a.xl = !0)
            } finally { 0 === d && a.jd("Layout"), a.xl = !h.zf, a.$a = c }
        }
    }

    function Jn(a, b, c, d) {
        if (null !== b) {
            for (var e = b.gn.j; e.next();) Jn(a, e.value, c, d);
            e = b.Yb;
            null === e || e.zf || (!c || e.mG || 0 === d ? (b.no = !b.location.H(), e.doLayout(b), b.L(Kn), Mm(a, b), e.zf = !0) : a.xl = !0)
        }
    }
    D.defineProperty(E, { ee: "isTreePathToChildren" }, function() { return this.tw }, function(a) {
        var b = this.tw;
        if (b !== a && (D.h(a, "boolean", E, "isTreePathToChildren"), this.tw = a, this.i("isTreePathToChildren", b, a), !this.na.ub))
            for (a = this.rg; a.next();) Ln(a.value)
    });
    E.prototype.findTreeRoots = function() {
        for (var a = new K(G), b = this.rg; b.next();) {
            var c = b.value;
            c.Bq && null === c.Qn() && a.add(c)
        }
        return a.j
    };
    D.defineProperty(E, { rC: "treeCollapsePolicy" }, function() { return this.qx }, function(a) {
        var b = this.qx;
        b !== a && (a !== El && a !== jn && a !== kn && D.k("Unknown Diagram.treeCollapsePolicy: " + a), this.qx = a, this.i("treeCollapsePolicy", b, a))
    });
    D.defineProperty(E, { Ph: null }, function() { return this.CD }, function(a) { this.CD = a });

    function Dl(a) {
        function b(a) {
            var b = a.toLowerCase(),
                h = new K("function");
            c.add(a, h);
            c.add(b, h);
            d.add(a, a);
            d.add(b, a)
        }
        var c = new oa("string", K),
            d = new oa("string", "string");
        b("AnimationStarting");
        b("AnimationFinished");
        b("BackgroundSingleClicked");
        b("BackgroundDoubleClicked");
        b("BackgroundContextClicked");
        b("ClipboardChanged");
        b("ClipboardPasted");
        b("DocumentBoundsChanged");
        b("ExternalObjectsDropped");
        b("InitialLayoutCompleted");
        b("LayoutCompleted");
        b("LinkDrawn");
        b("LinkRelinked");
        b("LinkReshaped");
        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");
        a.Fz = c;
        a.Ez = d
    }

    function Ga(a, b) { var c = a.Ez.oa(b); return null !== c ? c : a.Ez.oa(b.toLowerCase()) }

    function Mn(a, b) {
        var c = a.Fz.oa(b);
        if (null !== c) return c;
        c = a.Fz.oa(b.toLowerCase());
        if (null !== c) return c;
        D.k("Unknown DiagramEvent name: " + b);
        return null
    }
    E.prototype.addDiagramListener = E.prototype.xx = function(a, b) {
        D.h(a, "string", E, "addDiagramListener:name");
        D.h(b, "function", E, "addDiagramListener:listener");
        var c = Mn(this, a);
        null !== c && c.add(b)
    };
    E.prototype.removeDiagramListener = E.prototype.QB = function(a, b) {
        D.h(a, "string", E, "removeDiagramListener:name");
        D.h(b, "function", E, "addDiagramListener:listener");
        var c = Mn(this, a);
        null !== c && c.remove(b)
    };
    E.prototype.raiseDiagramEvent = E.prototype.Ja = function(a, b, c) {
        v && D.h(a, "string", E, "raiseDiagramEvent:name");
        var d = Mn(this, a),
            e = new dg;
        e.g = this;
        a = Ga(this, a);
        null !== a && (e.name = a);
        void 0 !== b && (e.hC = b);
        void 0 !== c && (e.LB = c);
        b = d.length;
        if (1 === b) d = d.fa(0), d(e);
        else if (0 !== b)
            for (c = d.Fc(), a = 0; a < b; a++) d = c[a], d(e);
        return e.cancel
    };
    E.prototype.isUnoccupied = E.prototype.Dq = function(a, b) { void 0 === b && (b = null); return ha(this, !1, null, b).Dq(a.x, a.y, a.width, a.height) };
    E.prototype.computeOccupiedArea = function() { return this.uB ? this.wb.copy() : this.rk ? Xl(this) : this.kd.copy() };

    function ha(a, b, c, d) {
        null === a.Wd && (a.Wd = new Nn);
        if (a.Wd.vq || a.Wd.group !== c || a.Wd.gC !== d) {
            if (null === c) {
                b = a.computeOccupiedArea();
                b.ig(100, 100);
                a.Wd.initialize(b);
                b = D.Sf();
                for (var e = a.rg; e.next();) {
                    var g = e.value,
                        h = g.layer;
                    null !== h && h.visible && !h.Yc && On(a, g, d, b)
                }
            } else
                for (0 < c.uc.count && (b = a.computePartsBounds(c.uc, !1), b.ig(20, 20), a.Wd.initialize(b)), b = D.Sf(), e = c.uc; e.next();) g = e.value, g instanceof G && On(a, g, d, b);
            D.Lb(b);
            a.Wd.group = c;
            a.Wd.gC = d;
            a.Wd.vq = !1
        } else b && Pn(a.Wd);
        return a.Wd
    }

    function On(a, b, c, d) {
        if (b !== c)
            if (b.isVisible() && b.HA && !b.Lf) {
                c = b.getAvoidableRect(d);
                d = a.Wd.cq;
                b = a.Wd.aq;
                for (var e = c.x + c.width, g = c.y + c.height, h = c.x; h < e; h += d) {
                    for (var k = c.y; k < g; k += b) Qn(a.Wd, h, k);
                    Qn(a.Wd, h, g)
                }
                for (k = c.y; k < g; k += b) Qn(a.Wd, e, k);
                Qn(a.Wd, e, g)
            } else if (b instanceof I)
            for (b = b.uc; b.next();) e = b.value, e instanceof G && On(a, e, c, d)
    }
    E.invalidatePositionArray = E.prototype.oB = function(a) { null !== this.Wd && !this.Wd.vq && (void 0 === a && (a = null), null === a || a.HA && !a.Lf) && (this.Wd.vq = !0) };
    E.prototype.simulatedMouseMove = function(a, b, c) {
        if (null !== di) {
            var d = di.g;
            c instanceof E || (c = null);
            var e = ei;
            c !== e && (null !== e && e !== d && null !== e.nb.Ge && (Di(e), di.gy = !1, e.nb.Ge.doSimulatedDragLeave()), ei = c, null !== c && c !== d && null !== c.nb.Ge && (Ki(), e = c.nb.Ge, Gi.contains(e) || Gi.add(e), c.nb.Ge.doSimulatedDragEnter()));
            if (null === c || c === d || !c.XE || c.qb || !c.Zp) return !1;
            d = c.nb.Ge;
            null !== d && (null !== a ? b = c.dp(a) : null === b && (b = new N), c.cc.ha = b, c.cc.Vk = !1, c.cc.up = !1, d.doSimulatedDragOver());
            return !0
        }
        return !1
    };
    E.prototype.simulatedMouseUp = function(a, b, c, d) {
        if (null !== di) {
            null === d && (d = b);
            b = ei;
            var e = di.g;
            if (d !== b) {
                if (null !== b && b !== e && null !== b.nb.Ge) return Di(b), di.gy = !1, b.nb.Ge.doSimulatedDragLeave(), !1;
                ei = d;
                null !== d && null !== d.nb.Ge && (Ki(), b = d.nb.Ge, Gi.contains(b) || Gi.add(b), d.nb.Ge.doSimulatedDragEnter())
            }
            if (null === d) return di.doCancel(), !0;
            if (d !== this) return null !== a && (c = d.dp(a)), d.cc.ha = c, d.cc.Vk = !1, d.cc.up = !0, a = d.nb.Ge, null !== a && a.doSimulatedDrop(), a = di, null !== a && (d = a.mayCopy(), a.Tf = d ? "Copy" : "Move", a.stopTool()), !0
        }
        return !1
    };
    D.defineProperty(E, { oL: "autoScrollInterval" }, function() { return this.pr }, function(a) {
        var b = this.pr;
        D.p(a, E, "scale");
        b !== a && (this.pr = a, this.i("autoScrollInterval", b, a))
    });
    D.defineProperty(E, { dF: "autoScrollRegion" }, function() { return this.Lv }, function(a) {
        "number" === typeof a ? a = new Lb(a) : D.l(a, Lb, E, "autoScrollRegion");
        var b = this.Lv;
        b.O(a) || (this.Lv = a = a.V(), this.Qc(), this.i("autoScrollRegion", b, a))
    });
    E.prototype.doAutoScroll = E.prototype.UA = function(a) {
        this.Kv.assign(a);
        Rn(this, this.Kv).Wc(this.position) ? Di(this) : Sn(this)
    };

    function Sn(a) {
        -1 === a.Io && (a.Io = D.setTimeout(function() {
            if (-1 !== a.Io) {
                Di(a);
                var b = a.U.event;
                if (null !== b) {
                    var c = Rn(a, a.Kv);
                    c.Wc(a.position) || (a.position = c, a.U.ha = a.qC(a.Kv), c = fm(b), a.simulatedMouseMove(b, null, c) || a.doMouseMove(), a.rk = !0, am(a, a.Kh()), a.Oe = !0, a.lg(), Sn(a))
                }
            }
        }, a.pr))
    }

    function Di(a) {-1 !== a.Io && (D.clearTimeout(a.Io), a.Io = -1) }

    function Rn(a, b) {
        var c = a.position,
            d = a.dF;
        if (0 >= d.top && 0 >= d.left && 0 >= d.right && 0 >= d.bottom) return c;
        var e = a.wb,
            g = a.scale,
            e = D.vg(0, 0, e.width * g, e.height * g),
            h = D.Fb(0, 0);
        if (b.x >= e.x && b.x < e.x + d.left) {
            var k = Math.max(a.lv, 1),
                k = k | 0;
            h.x -= k;
            b.x < e.x + d.left / 2 && (h.x -= k);
            b.x < e.x + d.left / 4 && (h.x -= 4 * k)
        } else b.x <= e.x + e.width && b.x > e.x + e.width - d.right && (k = Math.max(a.lv, 1), k |= 0, h.x += k, b.x > e.x + e.width - d.right / 2 && (h.x += k), b.x > e.x + e.width - d.right / 4 && (h.x += 4 * k));
        b.y >= e.y && b.y < e.y + d.top ? (k = Math.max(a.mv, 1), k |= 0, h.y -= k, b.y < e.y +
            d.top / 2 && (h.y -= k), b.y < e.y + d.top / 4 && (h.y -= 4 * k)) : b.y <= e.y + e.height && b.y > e.y + e.height - d.bottom && (k = Math.max(a.mv, 1), k |= 0, h.y += k, b.y > e.y + e.height - d.bottom / 2 && (h.y += k), b.y > e.y + e.height - d.bottom / 4 && (h.y += 4 * k));
        h.Wc(Kd) || (c = new N(c.x + h.x / g, c.y + h.y / g));
        D.Lb(e);
        D.A(h);
        return c
    }
    E.prototype.makeSvg = E.prototype.makeSVG = function(a) {
        void 0 === a && (a = new ma);
        a.context = "svg";
        a = Tn(this, a);
        return null !== a ? a.Em : null
    };
    E.prototype.makeImage = function(a) {
        void 0 === a && (a = new ma);
        var b = (a.document || document).createElement("img");
        b.src = this.FJ(a);
        return b
    };
    E.prototype.makeImageData = E.prototype.FJ = function(a) {
        void 0 === a && (a = new ma);
        var b = Tn(this, a);
        if (null !== b) {
            var c = a.returnType,
                c = void 0 === c ? "string" : c.toLowerCase();
            switch (c) {
                case "imagedata":
                    return b.Tk.getImageData(0, 0, b.width, b.height);
                case "blob":
                    b = b.$d;
                    c = a.callback;
                    if ("function" !== typeof c) { D.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.'); break }
                    if ("function" === typeof b.toBlob) return b.toBlob(c, a.type, a.details), "toBlob";
                    if ("function" ===
                        typeof b.msToBlob) return c(b.msToBlob()), "msToBlob";
                    c(null);
                    break;
                default:
                    return b.toDataURL(a.type, a.details)
            }
        }
        return ""
    };
    var Un = !1;

    function Tn(a, b) {
        a.Ra.Yh();
        a.lg();
        if (null === a.Ib) return null;
        "object" !== typeof b && D.k("properties argument must be an Object.");
        var c = !1,
            d = b.size || null,
            e = b.scale || null;
        void 0 !== b.scale && isNaN(b.scale) && (e = "NaN");
        var g = b.maxSize;
        void 0 === b.maxSize && (c = !0, g = "svg" === b.context ? new Ca(Infinity, Infinity) : new Ca(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);
        n = b.showGrid;
        void 0 === n && (n = r);
        null !== d && isNaN(d.width) && isNaN(d.height) && (d = null);
        "number" === typeof l ? l = new Lb(l) : l instanceof Lb || (l = new Lb(0));
        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.dd.De(!0);
        var s = new ja(null, p),
            u = s.Tk;
        if (!(d || e || k || h)) {
            s.width = a.Pb + Math.ceil(l.left + l.right);
            s.height = a.Tb + Math.ceil(l.top + l.bottom);
            if ("svg" === b.context) return u = new qd(s.$d, p, q), Tm(a, u, l, new Ca(s.width, s.height),
                a.Db, a.sb, k, m, r, n), u;
            a.Ur = !1;
            Tm(a, u, l, new Ca(s.width, s.height), a.Db, a.sb, k, m, r, n);
            a.Ur = !0;
            return s
        }
        var t = a.yb.Ox,
            y = new N(0, 0),
            w = a.kd.copy();
        w.zK(a.padding);
        if (r)
            for (var A = !0, A = a.dc.o, B = A.length, P = 0; P < B; P++) {
                var H = A[P];
                if (H.visible && H.Yc)
                    for (var H = H.rb.o, R = H.length, aa = 0; aa < R; aa++) {
                        var V = H[aa];
                        V.hy && V.isVisible() && (V = V.aa, V.H() && w.Zh(V))
                    }
            }
        y.x = w.x;
        y.y = w.y;
        if (null !== k) {
            var ea, A = !0,
                B = k.j;
            for (B.reset(); B.next();) V = B.value, V instanceof F && (H = V.layer, null !== H && !H.visible || null !== H && !r && H.Yc || !V.isVisible() ||
                (V = V.aa, V.H() && (A ? (A = !1, ea = V.copy()) : ea.Zh(V))));
            A && (ea = new C(0, 0, 0, 0));
            w.width = ea.width;
            w.height = ea.height;
            y.x = ea.x;
            y.y = ea.y
        }
        null !== h && h.H() && (y = h, e || (e = t));
        A = V = 0;
        null !== l && (V = l.left + l.right, A = l.top + l.bottom);
        P = B = 0;
        null !== d && (B = d.width, P = d.height, isFinite(B) && (B = Math.max(0, B - V)), isFinite(P) && (P = Math.max(0, P - A)));
        ea = h = 0;
        null !== d && null !== e ? ("NaN" === e && (e = t), d.H() ? (h = B, ea = P) : isNaN(P) ? (h = B, ea = w.height * e) : (h = w.width * e, ea = P)) : null !== d ? d.H() ? (e = Math.min(B / w.width, P / w.height), h = B, ea = P) : isNaN(P) ? (e = B / w.width,
            h = B, ea = w.height * e) : (e = P / w.height, h = w.width * e, ea = P) : null !== e ? "NaN" === e && g.H() ? (e = Math.min((g.width - V) / w.width, (g.height - A) / w.height), e > t ? (e = t, h = w.width, ea = w.height) : (h = g.width, ea = g.height)) : (h = w.width * e, ea = w.height * e) : (e = t, h = w.width, ea = w.height);
        null !== l ? (h += V, ea += A) : l = new Lb(0);
        null !== g && (d = g.width, g = g.height, "svg" !== b.context && c && !Un && (h > d || ea > g) && (D.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. (" + Math.ceil(h) + "x" + Math.ceil(ea) + " vs 2000x2000) Consider increasing the max size."),
            Un = !0), isNaN(d) && (d = 2E3), isNaN(g) && (g = 2E3), isFinite(d) && (h = Math.min(h, d)), isFinite(g) && (ea = Math.min(ea, g)));
        s.width = Math.ceil(h);
        s.height = Math.ceil(ea);
        if ("svg" === b.context) return u = new qd(s.$d, p, q), Tm(a, u, l, new Ca(Math.ceil(h), Math.ceil(ea)), e, y, k, m, r, n), u;
        a.Ur = !1;
        Tm(a, u, l, new Ca(Math.ceil(h), Math.ceil(ea)), e, y, k, m, r, n);
        a.Ur = !0;
        return s
    }
    E.inherit = function(a, b) {
        D.h(a, "function", E, "inherit");
        D.h(b, "function", E, "inherit");
        b.PH && D.k("Cannot inherit from " + D.wf(b));
        D.Ta(a, b)
    };

    function Ml() {
        this.wE = null;
        this.RH = "63ad05bbe23a1786468a4c741b6d2";
        this.Zi = this.RH === this._tk ? !0 : null
    }
    Ml.prototype.Im = function(a) {
        a.dd.setTransform(a.ud, 0, 0, a.ud, 0, 0);
        if (null === this.Zi) {
            var b = "f",
                c = window[D.Wg("76a715b2f73f148a")][D.Wg("72ba13b5")];
            a = D.Wg;
            this.Zi = !0;
            if (window[a("7da7")] && window[a("7da7")][a("76a115b6ed251eaf4692")]) {
                var d = window[a("7da7")][a("76a115b6ed251eaf4692")],
                    d = a(d).split(a("39e9"));
                if (!(6 > d.length)) {
                    var e = a(d[1]).split(".");
                    if ("7da71ca0" === d[4]) {
                        var g = a(D[a("6cae19")]).split(".");
                        if (e[0] > g[0] || e[0] === g[0] && e[1] >= g[1]) {
                            g = c[a("76ad18b4f73e")];
                            for (e = c[a("73a612b6fb191d")](a("35e7")) +
                                2; e < g; e++) b += c[e];
                            c = b[a("73a612b6fb191d")](a(d[2]));
                            0 > c && a(d[2]) !== a("7da71ca0ad381e90") && (c = b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));
                            0 > c && (c = b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));
                            if (this.Zi = !(0 <= c && c < b[a("73a612b6fb191d")](a("35"))))
                                if (b = a(d[2]), "#" === b[0]) {
                                    c = window.document[a("79ba13b2f7333e8846865a7d00")]("div");
                                    for (e = d[0].replace(/[A-Za-z]/g, ""); 4 > e.length;) e += "9";
                                    e = e.substr(e.length - 4);
                                    d = "" + ["gsh", "gsf"][parseInt(e.substr(0, 1), 10) % 2];
                                    d += ["Header", "Background", "Display", "Feedback"][parseInt(e.substr(0,
                                        1), 10) % 4];
                                    c[a("79a417a0f0181a8946")] = d;
                                    if (window.document[a("78a712aa")]) {
                                        if (window.document[a("78a712aa")][a("7bb806b6ed32388c4a875b")](c), e = window[a("7dad0290ec3b0b91578e5b40007031bf")](c)[a("7dad0283f1390b81519f4645156528bf")](a("78a704b7e62456904c9b12701b6532a8")), window.document[a("78a712aa")][a("68ad1bbcf533388c4a875b")](c), e)
                                            if (-1 !== e.indexOf(parseInt(b[1] + b[2], 16)) && -1 !== e.indexOf(parseInt(b[3] + b[4], 16))) this.Zi = !1;
                                            else if (D.Mu || D.zq || D.Aq || D.rB)
                                            for (d = "." + d, e = 0; e < document.styleSheets.length; e++) {
                                                a =
                                                    document.styleSheets[e].rules || document.styleSheets[e].cssRules;
                                                for (var h in a)
                                                    if (d === a[h].selectorText) { this.Zi = !1; break }
                                            }
                                    } else this.Zi = null, this.Zi = !1
                                }
                        }
                    }
                }
            } else {
                g = c[a("76ad18b4f73e")];
                for (e = c[a("73a612b6fb191d")](a("35e7")) + 2; e < g; e++) b += c[e];
                c = b[a("73a612b6fb191d")](a("7da71ca0ad381e90"));
                this.Zi = !(0 <= c && c < b[a("73a612b6fb191d")](a("35")))
            }
        }
        return 0 < this.Zi && this !== this.wE ? !0 : !1
    };
    Ml.prototype.t = function() { this.wE = null };

    function Nl(a, b) {
        void 0 !== b && null !== b || D.k("Diagram setup requires an argument DIV.");
        null !== a.Ub && D.k("Diagram has already completed setup.");
        "string" === typeof b ? a.Ub = window.document.getElementById(b) : b instanceof HTMLDivElement ? a.Ub = b : D.k("No DIV or DIV id supplied: " + b);
        null === a.Ub && D.k("Invalid DIV id; could not get element with id: " + b);
        void 0 !== a.Ub.ca && D.k("Invalid div id; div already has a Diagram associated with it.");
        "static" === window.getComputedStyle(a.Ub, null).position && (a.Ub.style.position =
            "relative");
        a.Ub.style["-webkit-tap-highlight-color"] = "rgba(255, 255, 255, 0)";
        a.Ub.style["-ms-touch-action"] = "none";
        a.Ub.innerHTML = "";
        a.Ub.ca = a;
        var c = new ja(a);
        c.$d.innerHTML = "This text is displayed if your browser does not support the Canvas HTML element.";
        void 0 !== c.style && (c.style.position = "absolute", c.style.top = "0px", c.style.left = "0px", "rtl" === window.getComputedStyle(a.Ub, null).getPropertyValue("direction") && (a.rs = !0), c.style.zIndex = "2", c.style.QM = "none", c.style.webkitUserSelect = "none", c.style.MozUserSelect =
            "none");
        a.Pb = a.Ub.clientWidth || 1;
        a.Tb = a.Ub.clientHeight || 1;
        a.Ib = c;
        a.dd = c.Tk;
        var d = a.dd;
        a.ud = a.computePixelRatio();
        Vm(a, a.Pb, a.Tb);
        // a.aw = d[D.Wg("7eba17a4ca3b1a8346")][D.Wg("78a118b7")](d, D.Im, 4, 4);
        a.aw = function() { return true; };
        a.Ub.insertBefore(c.$d, a.Ub.firstChild);
        c = new ja(null);
        c.width = 1;
        c.height = 1;
        a.Iz = c;
        a.rD = c.Tk;
        var c = D.createElement("div"),
            e = D.createElement("div");
        c.style.position = "absolute";
        c.style.overflow = "auto";
        c.style.width = a.Pb + "px";
        c.style.height = a.Tb + "px";
        c.style.zIndex = "1";
        e.style.position = "absolute";
        e.style.width =
            "1px";
        e.style.height = "1px";
        a.Ub.appendChild(c);
        c.appendChild(e);
        c.onscroll = Tl;
        c.onmousedown = Vl;
        c.ontouchstart = Vl;
        c.ca = a;
        c.NH = !0;
        c.OH = !0;
        a.ax = c;
        a.yt = e;
        a.Gy = D.oF(function() {
            a.Hk = null;
            a.ra()
        }, 300, !1);
        a.vC = D.oF(function() { fl(a) }, 250, !1);
        a.preventDefault = function(a) { a.preventDefault(); return !1 };
        a.jo = function(b) {
            if (a.isEnabled) {
                a.th = !0;
                var c = a.Hd;
                D.Xn && c.Qj ? (b.preventDefault(), b.simulated = !0, a.Ht = b) : (a.Hd = a.cc, a.cc = c, dm(a, a, b, c, !0), a.simulatedMouseMove(b, null, b.target.ca) || (a.doMouseMove(), a.eb.isBeyondDragSize() &&
                    (a.ji = 0), ga(a, c, b)))
            }
        };
        a.io = function(b) {
            if (a.isEnabled) {
                a.th = !0;
                var c = a.Hd;
                if (D.Xn && null !== a.Ht) a.Ht = b, b.preventDefault();
                else if (D.Xn && 400 > b.timeStamp - a.wk) b.preventDefault();
                else if (a.uk) b.preventDefault();
                else {
                    a.Hd = a.cc;
                    a.cc = c;
                    dm(a, a, b, c, !0);
                    c.Vk = !0;
                    c.Ee = b.detail;
                    if (D.zq || D.Aq) b.timeStamp - a.wk < a.yA && !a.eb.isBeyondDragSize() ? a.ji++ : a.ji = 1, a.wk = b.timeStamp, c.Ee = a.ji;
                    a.aj = c;
                    !0 === c.$r.simulated ? (b.preventDefault(), b.simulated = !0) : (di = null, a.doMouseDown(), a.aj = a.aj.copy(), 1 === b.button ? b.preventDefault() :
                        ga(a, c, b))
                }
            }
        };
        a.lo = function(b) {
            if (a.isEnabled)
                if (a.uk && 2 === b.button) b.preventDefault();
                else if (a.uk && 0 === b.button && (a.uk = !1), a.Sp) b.preventDefault();
            else {
                a.th = !0;
                var c = a.Hd;
                if (D.Xn) {
                    if (400 > b.timeStamp - a.wk) { b.preventDefault(); return }
                    a.wk = b.timeStamp
                }
                if (D.Xn && null !== a.Ht) a.Ht = null, b.preventDefault();
                else {
                    a.Hd = a.cc;
                    a.cc = c;
                    dm(a, a, b, c, !0);
                    c.up = !0;
                    c.Ee = b.detail;
                    if (D.zq || D.Aq) c.Ee = a.ji;
                    c.bubbles = b.bubbles;
                    c.Qf = fm(b);
                    a.simulatedMouseUp(b, null, new N, c.Qf) || (a.doMouseUp(), Di(a), ga(a, c, b))
                }
            }
        };
        a.mo = function(b) {
            if (a.isEnabled) {
                var c =
                    a.Hd;
                a.Hd = a.cc;
                a.cc = c;
                dm(a, a, b, c, !0);
                c.bubbles = !0;
                var d = 0,
                    e = 0;
                void 0 !== b.wheelDelta && (e = 0 < b.wheelDelta ? 1 : -1);
                void 0 !== b.wheelDeltaY && (e = 0 < b.wheelDeltaY ? 1 : -1);
                void 0 !== b.wheelDeltaX && (d = 0 < b.wheelDeltaX ? 1 : -1);
                void 0 !== b.deltaY && (e = 0 < b.deltaY ? 1 : -1);
                void 0 !== b.deltaX && (d = 0 < b.deltaX ? 1 : -1);
                c.Uk = 0 === e ? -d : -e;
                a.doMouseWheel();
                ga(a, c, b)
            }
        };
        a.ko = function() {
            if (a.isEnabled) {
                a.th = !1;
                var b = a.eb;
                b.cancelWaitAfter();
                b.standardMouseOver()
            }
        };
        a.oC = function(b) {
            if (a.isEnabled) {
                a.Sp = !1;
                a.uk = !0;
                var c = gm(a, b, b.targetTouches[0],
                    1 < b.touches.length);
                a.doMouseDown();
                ga(a, c, b)
            }
        };
        a.nC = function(b) {
            if (a.isEnabled) {
                var c = null;
                0 < b.targetTouches.length ? c = b.targetTouches[0] : 0 < b.changedTouches.length && (c = b.changedTouches[0]);
                var d = hm(a, b, c, 1 < b.touches.length);
                a.simulatedMouseMove(c ? c : b, null, d.Qf) || a.doMouseMove();
                ga(a, d, b)
            }
        };
        a.mC = function(b) {
            if (a.isEnabled)
                if (a.Sp) b.preventDefault();
                else if (!(1 < b.touches.length)) {
                var c = null,
                    d = null;
                0 < b.targetTouches.length ? d = b.targetTouches[0] : 0 < b.changedTouches.length && (d = b.changedTouches[0]);
                var e =
                    a.Hd;
                a.Hd = a.cc;
                a.cc = e;
                e.g = a;
                e.Ee = 1;
                if (null !== d) {
                    c = window.document.elementFromPoint(d.clientX, d.clientY);
                    null !== c && c.ca instanceof E && c.ca !== a && em(c.ca, d, e);
                    em(a, d, e);
                    var m = d.screenX,
                        n = d.screenY,
                        p = a.ww;
                    b.timeStamp - a.wk < a.yA && !(25 < Math.abs(p.x - m) || 25 < Math.abs(p.y - n)) ? a.ji++ : a.ji = 1;
                    e.Ee = a.ji;
                    a.wk = b.timeStamp;
                    a.ww.n(m, n)
                }
                m = 0;
                b.ctrlKey && (m += 1);
                b.altKey && (m += 2);
                b.shiftKey && (m += 4);
                b.metaKey && (m += 8);
                e.xd = m;
                e.button = 0;
                e.buttons = 1;
                e.Vk = !1;
                e.up = !0;
                e.Uk = 0;
                e.Cc = !1;
                e.bubbles = !1;
                e.event = b;
                e.timestamp = Date.now();
                e.Qf = null === c ? fm(b) : c.ca ? c.ca : null;
                e.Ne = null;
                a.simulatedMouseUp(d ? d : b, null, new N, e.Qf) || a.doMouseUp();
                ga(a, e, b);
                a.uk = !1
            }
        };
        a.Jq = function(b) {
            if (a.isEnabled) {
                a.th = !0;
                var c = a.jA;
                void 0 === c[b.pointerId] && (c[b.pointerId] = b);
                var c = a.Dp,
                    d = !1;
                if (null !== c[0] && c[0].pointerId === b.pointerId) c[0] = b;
                else if (null !== c[1] && c[1].pointerId === b.pointerId) c[1] = b, d = !0;
                else if (null === c[0]) c[0] = b;
                else if (null === c[1]) c[1] = b, d = !0;
                else { b.preventDefault(); return }
                if ("touch" === b.pointerType || "pen" === b.pointerType) a.Sp = !1, a.uk = !0;
                c = gm(a, b, b, d);
                "touch" !== b.pointerType && (c.button = b.button, void 0 === b.buttons || D.Mu || (c.buttons = b.buttons), D.Qh && 0 === b.button && b.ctrlKey && (c.button = 2));
                a.doMouseDown();
                1 === b.button ? b.preventDefault() : ga(a, c, b)
            }
        };
        a.Kq = function(b) {
            if (a.isEnabled) {
                a.th = !0;
                var c = a.Dp;
                if (null !== c[0] && c[0].pointerId === b.pointerId) c[0] = b;
                else {
                    if (null !== c[1] && c[1].pointerId === b.pointerId) { c[1] = b; return }
                    if (null === c[0]) c[0] = b;
                    else return
                }
                c[0].pointerId === b.pointerId && (c = hm(a, b, b, null !== c[1]), "touch" !== b.pointerType && (c.button =
                    b.button, void 0 === b.buttons || D.Mu || (c.buttons = b.buttons), D.Qh && 0 === b.button && b.ctrlKey && (c.button = 2)), a.simulatedMouseMove(b, null, c.Qf) || (a.doMouseMove(), ga(a, c, b)))
            }
        };
        a.Mq = function(b) {
            if (a.isEnabled) {
                a.th = !0;
                var c = "touch" === b.pointerType || "pen" === b.pointerType,
                    d = a.jA;
                if (c && a.Sp) delete d[b.pointerId], b.preventDefault();
                else if (d = a.Dp, null !== d[0] && d[0].pointerId === b.pointerId) {
                    d[0] = null;
                    d = a.Hd;
                    a.Hd = a.cc;
                    a.cc = d;
                    var e = window.document.elementFromPoint(b.clientX, b.clientY);
                    null !== e && e.ca instanceof E &&
                        e.ca !== a && em(e.ca, b, d);
                    em(a, b, d);
                    d.g = a;
                    var m = a.ww,
                        n = c ? 25 : 10;
                    b.timeStamp - a.wk < a.yA && !(Math.abs(m.x - b.screenX) > n || Math.abs(m.y - b.screenY) > n) ? a.ji++ : a.ji = 1;
                    d.Ee = a.ji;
                    a.wk = b.timeStamp;
                    a.ww.n(b.screenX, b.screenY);
                    m = 0;
                    b.ctrlKey && (m += 1);
                    b.altKey && (m += 2);
                    b.shiftKey && (m += 4);
                    b.metaKey && (m += 8);
                    d.xd = m;
                    d.button = b.button;
                    void 0 === b.buttons || D.Mu || (d.buttons = b.buttons);
                    D.Qh && 0 === b.button && b.ctrlKey && (d.button = 2);
                    d.Vk = !1;
                    d.up = !0;
                    d.Uk = 0;
                    d.Cc = !1;
                    d.bubbles = !0;
                    d.event = b;
                    d.timestamp = Date.now();
                    d.Qf = null === e ? fm(b) : e.ca ?
                        e.ca : null;
                    d.Ne = null;
                    a.simulatedMouseUp(b, null, new N, d.Qf) || (a.doMouseUp(), Di(a), ga(a, d, b), c && (a.uk = !1))
                } else null !== d[1] && d[1].pointerId === b.pointerId && (d[1] = null)
            }
        };
        a.Lq = function(b) {
            if (a.isEnabled) {
                a.th = !1;
                var c = a.jA;
                c[b.pointerId] && delete c[b.pointerId];
                c = a.Dp;
                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.eb, b.cancelWaitAfter(), b.standardMouseOver())
            }
        };
        d.De(!0);
        Ql(a)
    }

    function Vn(a) {
        1 < arguments.length && D.k("Palette constructor can only take one optional argument, the DIV HTML element or its id.");
        E.call(this, a);
        this.du = !0;
        this.fm = !1;
        this.qb = !0;
        this.LA = jc;
        this.Yb = new Wn
    }
    D.Ta(Vn, E);
    D.ka("Palette", Vn);

    function Jl(a) {
        1 < arguments.length && D.k("Overview constructor can only take one optional argument, the DIV HTML element or its id.");
        E.call(this, a);
        this.Ra.isEnabled = !1;
        this.ed = !0;
        this.Dk = null;
        this.bw = !0;
        this.sK("drawShadows", !1);
        var b = new F,
            c = new z;
        c.stroke = "magenta";
        c.lb = 2;
        c.fill = "transparent";
        c.name = "BOXSHAPE";
        b.il = !0;
        b.Py = "BOXSHAPE";
        b.uy = "BOXSHAPE";
        b.SG = "BOXSHAPE";
        b.cursor = "move";
        b.add(c);
        this.Om = b;
        c = new da;
        c.type = Xj;
        c.Of = mc;
        var d = new Yj;
        d.Ue = !0;
        c.add(d);
        d = new z;
        d.Gh = mc;
        d.Kb = "Rectangle";
        d.Ea = new Ca(64,
            64);
        d.cursor = "se-resize";
        d.alignment = vc;
        c.add(d);
        b.QG = c;
        this.Cn = this.Pk = !1;
        this.Jf = this.fu = !0;
        this.dF = new Lb(0, 0, 0, 0);
        this.tA = new ja(null);
        this.QH = this.tA.Tk;
        this.nb.Ge = new Xn;
        this.nb.TG = new Yn;
        var e = this;
        this.click = function() {
            var a = e.Dk;
            if (null !== a) {
                var b = a.wb,
                    c = e.U.ha;
                a.position = new N(c.x - b.width / 2, c.y - b.height / 2)
            }
        };
        this.CG = function() { Zn(e) };
        this.BG = function() { null !== e.Dk && (e.Qc(), e.ra()) };
        this.im = bm;
        this.ed = !1
    }
    D.Ta(Jl, E);
    D.ka("Overview", Jl);

    function $n(a) {
        a.ed || a.je || !1 !== a.cg || (a.cg = !0, requestAnimationFrame(function() {
            if (a.cg && !a.je && (a.cg = !1, null !== a.Ub)) {
                a.je = !0;
                Si(a);
                a.kd.H() || am(a, a.Kh());
                null === a.Ub && D.k("No div specified");
                null === a.Ib && D.k("No canvas specified");
                if (a.Oe) {
                    var b = a.Dk;
                    if (null !== b && !b.Ra.nf && !b.Ra.zc) {
                        var b = a.dd,
                            c = a.tA;
                        b.setTransform(1, 0, 0, 1, 0, 0);
                        b.clearRect(0, 0, a.Ib.width, a.Ib.height);
                        b.drawImage(c.$d, 0, 0);
                        c = a.Nc;
                        c.reset();
                        1 !== a.scale && c.scale(a.scale);
                        0 === a.position.x && 0 === a.position.y || c.translate(-a.position.x, -a.position.y);
                        b.scale(a.ud, a.ud);
                        b.transform(c.m11, c.m12, c.m21, c.m22, c.dx, c.dy);
                        for (var c = a.dc.o, d = c.length, e = 0; e < d; e++) c[e].He(b, a);
                        a.Jl = !1;
                        a.Oe = !1
                    }
                }
                a.je = !1
            }
        }))
    }
    Jl.prototype.computePixelRatio = function() { return 1 };
    Jl.prototype.He = function() {
        null === this.Ub && D.k("No div specified");
        null === this.Ib && D.k("No canvas specified");
        if (this.Oe) {
            var a = this.Dk;
            if (null !== a && !a.Ra.nf) {
                Qm(this);
                var b = a.Vn;
                (null !== b && b.visible && isNaN(b.width) || isNaN(b.height)) && lm(a);
                var c = this.Ib,
                    b = this.dd,
                    d = this.tA,
                    e = this.QH;
                d.width = c.width;
                d.height = c.height;
                b.De(!0);
                b.setTransform(1, 0, 0, 1, 0, 0);
                b.clearRect(0, 0, c.width, c.height);
                var g = this.Nc;
                g.reset();
                1 !== this.scale && g.scale(this.scale);
                0 === this.position.x && 0 === this.position.y || g.translate(-this.position.x, -this.position.y);
                b.scale(this.ud, this.ud);
                b.transform(g.m11, g.m12, g.m21, g.m22, g.dx, g.dy);
                for (var h = this.bw, k = this.wb, l = a.dc.o, m = l.length, a = 0; a < m; a++) {
                    var n = l[a],
                        p = b,
                        q = k,
                        r = h;
                    if (n.visible && 0 !== n.Lc && (void 0 === r && (r = !0), r || !n.Yc)) {
                        1 !== n.Lc && (p.globalAlpha = n.Lc);
                        for (var r = this.scale, n = n.rb.o, s = n.length, u = 0; u < s; u++) {
                            var t = n[u],
                                y = t.aa;
                            y.jg(q) && (1 < y.width * r || 1 < y.height * r ? t.He(p, this) : vl(t, p))
                        }
                        p.globalAlpha = 1
                    }
                }
                e.drawImage(c.$d, 0, 0);
                v && v.Dj && (e.fillStyle = "red", e.fillRect(0, d.height / 2, d.width, 4));
                c = this.dc.o;
                d = c.length;
                for (a = 0; a < d; a++) c[a].He(b, this);
                v && (v.WA || v.Dj) && v.VA(b, this, g);
                this.Oe = this.Jl = !1
            }
        }
    };
    D.defineProperty(Jl, { KB: "observed" }, function() { return this.Dk }, function(a) {
        var b = this.Dk;
        null !== a && D.l(a, E, Jl, "observed");
        a instanceof Jl && D.k("Overview.observed Diagram may not be an Overview itself: " + a);
        b !== a && (null !== b && (this.remove(this.Jh), b.QB("ViewportBoundsChanged", this.CG), b.QB("DocumentBoundsChanged", this.BG), b.Qw.remove(this)), this.Dk = a, null !== a && (a.xx("ViewportBoundsChanged", this.CG), a.xx("DocumentBoundsChanged", this.BG), a.Qw.add(this), this.add(this.Jh), Zn(this)), this.Qc(), this.i("observed",
            b, a))
    });
    D.defineProperty(Jl, { Jh: "box" }, function() { return this.Om }, function(a) {
        var b = this.Om;
        b !== a && (this.Om = a, this.remove(b), this.add(this.Om), Zn(this), this.i("box", b, a))
    });
    D.defineProperty(Jl, { OL: "drawsTemporaryLayers" }, function() { return this.bw }, function(a) { this.bw !== a && (this.bw = a, this.ro()) });

    function Zn(a) {
        var b = a.Jh;
        if (null !== b) {
            var c = a.Dk;
            if (null !== c) {
                a.Oe = !0;
                var c = c.wb,
                    d = b.to,
                    e = D.Gm();
                e.n(c.width, c.height);
                d.Ea = e;
                D.Zk(e);
                a = 2 / a.scale;
                d instanceof z && (d.lb = a);
                b.location = new N(c.x - a / 2, c.y - a / 2)
            }
        }
    }
    Jl.prototype.Kh = function() { var a = this.Dk; return null === a ? Ld : a.kd };
    Jl.prototype.dG = function() {!0 !== this.Oe && (this.Oe = !0, $n(this)) };
    Jl.prototype.dv = function(a, b, c, d, e) { this.ed || (Wl(this), this.ra(), im(this), this.Qc(), Zn(this), this.Fh.scale = c, this.Fh.position.x = a.x, this.Fh.position.y = a.y, this.Fh.bounds.set(a), this.Fh.isScroll = e, this.Ja("ViewportBoundsChanged", this.Fh, a)) };

    function Xn() {
        Uh.call(this);
        this.Tl = null
    }
    D.Ta(Xn, Uh);
    Xn.prototype.canStart = function() {
        if (!this.isEnabled) return !1;
        var a = this.g;
        if (null === a || !a.fm || !a.Jf) return !1;
        var b = a.KB;
        if (null === b) return !1;
        if (null === this.findDraggablePart()) {
            var c = b.wb;
            this.Tl = new N(c.width / 2, c.height / 2);
            a = a.Pc.ha;
            b.position = new N(a.x - this.Tl.x, a.y - this.Tl.y)
        }
        return !0
    };
    Xn.prototype.doActivate = function() {
        this.Tl = null;
        Uh.prototype.doActivate.call(this)
    };
    Xn.prototype.moveParts = function() {
        var a = this.g,
            b = a.KB;
        if (null !== b) {
            var c = a.Jh;
            if (null !== c) {
                if (null === this.Tl) {
                    var d = a.Pc.ha,
                        c = c.location;
                    this.Tl = new N(d.x - c.x, d.y - c.y)
                }
                a = a.U.ha;
                b.position = new N(a.x - this.Tl.x, a.y - this.Tl.y)
            }
        }
    };

    function Yn() { Wj.call(this) }
    D.Ta(Yn, Wj);
    Yn.prototype.resize = function(a) {
        var b = this.g.KB;
        if (null !== b) {
            var c = b.wb.copy();
            b.position = a.position;
            (c.width !== a.width || c.height !== a.height) && 0 < a.width && 0 < a.height && (b.scale = Math.min(c.width / a.width, c.height / a.height))
        }
    };

    function ao() { this.pg = this.nd = this.Qd = this.Rc = 0 }

    function Ba(a) {
        1 < arguments.length && D.k("Brush constructor can take at most one optional argument, the Brush type.");
        D.xc(this);
        this.J = !1;
        void 0 === a ? (this.da = Fg, this.Lo = "black") : "string" === typeof a ? (this.da = Fg, v && !za(a) && D.k('Color "' + a + '" is not a valid color string for Brush constructor'), this.Lo = a) : (v && D.Da(a, Ba, Ba, "constructor:type"), this.da = a, this.Lo = "black");
        var b = this.da;
        b === Gg ? (this.Mp = jc, this.Zo = uc) : this.Zo = b === Id ? this.Mp = mc : this.Mp = dc;
        this.lx = 0;
        this.cw = NaN;
        this.qh = this.Tw = this.ph = null;
        this.xz =
            this.Mo = 0
    }
    D.ka("Brush", Ba);
    var Fg;
    Ba.Solid = Fg = D.s(Ba, "Solid", 0);
    var Gg;
    Ba.Linear = Gg = D.s(Ba, "Linear", 1);
    var Id;
    Ba.Radial = Id = D.s(Ba, "Radial", 2);
    var bo;
    Ba.Pattern = bo = D.s(Ba, "Pattern", 4);
    var co;
    Ba.Lab = co = D.s(Ba, "Lab", 5);
    var eo;
    Ba.HSL = eo = D.s(Ba, "HSL", 6);
    Ba.prototype.copy = function() {
        var a = new Ba;
        a.da = this.da;
        a.Lo = this.Lo;
        a.Mp = this.Mp.V();
        a.Zo = this.Zo.V();
        a.lx = this.lx;
        a.cw = this.cw;
        null !== this.ph && (a.ph = this.ph.copy());
        a.Tw = this.Tw;
        return a
    };
    f = Ba.prototype;
    f.Oa = function() {
        this.freeze();
        Object.freeze(this);
        return this
    };
    f.freeze = function() {
        this.J = !0;
        null !== this.ph && this.ph.freeze();
        return this
    };
    f.Xa = function() {
        Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
        this.J = !1;
        null !== this.ph && this.ph.Xa();
        return this
    };
    f.qc = function(a) { a.Qe === Ba ? this.type = a : D.ak(this, a) };
    f.toString = function() {
        var a = "Brush(";
        if (this.type === Fg) a += this.color;
        else if (a = this.type === Gg ? a + "Linear " : this.type === Id ? a + "Radial " : this.type === bo ? a + "Pattern " : a + "(unknown) ", a += this.start + " " + this.end, null !== this.Qk)
            for (var b = this.Qk.j; b.next();) a += " " + b.key + ":" + b.value;
        return a + ")"
    };
    Ba.prototype.addColorStop = Ba.prototype.addColorStop = function(a, b) {
        this.J && D.qa(this);
        ("number" !== typeof a || !isFinite(a) || 1 < a || 0 > a) && D.ua(a, "0 <= loc <= 1", Ba, "addColorStop:loc");
        D.h(b, "string", Ba, "addColorStop:color");
        v && !za(b) && D.k('Color "' + b + '" is not a valid color string for Brush.addColorStop');
        null === this.ph && (this.ph = new oa("number", "string"));
        this.ph.add(a, b);
        this.da === Fg && (this.type = Gg);
        this.qh = null
    };
    D.defineProperty(Ba, { type: "type" }, function() { return this.da }, function(a) {
        this.J && D.qa(this, a);
        D.Da(a, Ba, Ba, "type");
        this.da = a;
        this.start.de() && (a === Gg ? this.start = jc : a === Id && (this.start = mc));
        this.end.de() && (a === Gg ? this.end = uc : a === Id && (this.end = mc));
        this.qh = null
    });
    D.defineProperty(Ba, { color: "color" }, function() { return this.Lo }, function(a) {
        this.J && D.qa(this, a);
        v && !za(a) && D.k('Color "' + a + '" is not a valid color string for Brush.color');
        this.Lo = a;
        this.qh = null
    });
    D.defineProperty(Ba, { start: "start" }, function() { return this.Mp }, function(a) {
        this.J && D.qa(this, a);
        D.l(a, S, Ba, "start");
        this.Mp = a.V();
        this.qh = null
    });
    D.defineProperty(Ba, { end: "end" }, function() { return this.Zo }, function(a) {
        this.J && D.qa(this, a);
        D.l(a, S, Ba, "end");
        this.Zo = a.V();
        this.qh = null
    });
    D.defineProperty(Ba, { sv: "startRadius" }, function() { return this.lx }, function(a) {
        this.J && D.qa(this, a);
        D.p(a, Ba, "startRadius");
        0 > a && D.ua(a, ">= zero", Ba, "startRadius");
        this.lx = a;
        this.qh = null
    });
    D.defineProperty(Ba, { ou: "endRadius" }, function() { return this.cw }, function(a) {
        this.J && D.qa(this, a);
        D.p(a, Ba, "endRadius");
        0 > a && D.ua(a, ">= zero", Ba, "endRadius");
        this.cw = a;
        this.qh = null
    });
    D.defineProperty(Ba, { Qk: "colorStops" }, function() { return this.ph }, function(a) {
        this.J && D.qa(this, a);
        v && D.l(a, oa, Ba, "colorStops");
        this.ph = a;
        this.qh = null
    });
    D.defineProperty(Ba, { pattern: "pattern" }, function() { return this.Tw }, function(a) {
        this.J && D.qa(this, a);
        this.Tw = a;
        this.qh = null
    });
    Ba.randomColor = function(a, b) {
        void 0 === a && (a = 128);
        v && (D.p(a, Ba, "randomColor:min"), (0 > a || 255 < a) && D.ua(a, "0 <= min <= 255", Ba, "randomColor:min"));
        void 0 === b && (b = Math.max(a, 255));
        v && (D.p(b, Ba, "randomColor:max"), (b < a || 255 < b) && D.ua(b, "min <= max <= 255", Ba, "randomColor:max"));
        var c = Math.abs(b - a),
            d = Math.floor(a + Math.random() * c).toString(16),
            e = Math.floor(a + Math.random() * c).toString(16),
            c = Math.floor(a + Math.random() * c).toString(16);
        2 > d.length && (d = "0" + d);
        2 > e.length && (e = "0" + e);
        2 > c.length && (c = "0" + c);
        return "#" +
            d + e + c
    };
    var fo = (new ja(null)).Tk,
        za;
    Ba.isValidColor = za = function(a) {
        if ("black" === a) return !0;
        if ("" === a) return !1;
        v && D.h(a, "string", Ba, "isValidColor");
        fo.fillStyle = "#000000";
        var b = fo.fillStyle;
        fo.fillStyle = a;
        if (fo.fillStyle !== b) return !0;
        fo.fillStyle = "#FFFFFF";
        b = fo.fillStyle;
        fo.fillStyle = a;
        return fo.fillStyle !== b
    };
    var ho = new ao,
        io = new ao,
        jo = new ao,
        ko = new ao;
    Ba.lighten = function(a) { return lo(a) };
    Ba.prototype.lightenBy = function(a, b) {
        this.J && D.qa(this);
        var c = void 0 === a || "number" !== typeof a ? .2 : a,
            d = void 0 === b ? co : b;
        if (this.type === Fg) mo(this.color), this.color = no(c, d);
        else if ((this.type === Gg || this.type === Id) && null !== this.Qk)
            for (var e = this.Qk.j; e.next();) mo(e.value), this.addColorStop(e.key, no(c, d));
        return this
    };
    var lo;
    Ba.lightenBy = lo = function(a, b, c) {
        b = void 0 === b || "number" !== typeof b ? .2 : b;
        c = void 0 === c ? co : c;
        mo(a);
        return no(b, c)
    };
    Ba.darken = function(a) { return oo(a) };
    Ba.prototype.darkenBy = function(a, b) {
        this.J && D.qa(this);
        var c = void 0 === a || "number" !== typeof a ? .2 : a,
            d = void 0 === b ? co : b;
        if (this.type === Fg) mo(this.color), this.color = no(-c, d);
        else if ((this.type === Gg || this.type === Id) && null !== this.Qk)
            for (var e = this.Qk.j; e.next();) mo(e.value), this.addColorStop(e.key, no(-c, d));
        return this
    };
    var oo;
    Ba.darkenBy = oo = function(a, b, c) {
        b = void 0 === b || "number" !== typeof b ? .2 : b;
        c = void 0 === c ? co : c;
        mo(a);
        return no(-b, c)
    };

    function no(a, b) {
        switch (b) {
            case co:
                var c = 100 * po(ho.Rc),
                    d = 100 * po(ho.Qd),
                    e = 100 * po(ho.nd);
                jo.Rc = .4124564 * c + .3575761 * d + .1804375 * e;
                jo.Qd = .2126729 * c + .7151522 * d + .072175 * e;
                jo.nd = .0193339 * c + .119192 * d + .9503041 * e;
                jo.pg = ho.pg;
                c = qo(jo.Rc / ro[0]);
                d = qo(jo.Qd / ro[1]);
                e = qo(jo.nd / ro[2]);
                ko.Rc = 116 * d - 16;
                ko.Qd = 500 * (c - d);
                ko.nd = 200 * (d - e);
                ko.pg = jo.pg;
                ko.Rc = Math.min(100, Math.max(0, ko.Rc + 100 * a));
                c = (ko.Rc + 16) / 116;
                d = c - ko.nd / 200;
                jo.Rc = ro[0] * so(ko.Qd / 500 + c);
                jo.Qd = ro[1] * (ko.Rc > to * uo ? Math.pow(c, 3) : ko.Rc / to);
                jo.nd = ro[2] * so(d);
                jo.pg =
                    ko.pg;
                c = -.969266 * jo.Rc + 1.8760108 * jo.Qd + .041556 * jo.nd;
                d = .0556434 * jo.Rc + -.2040259 * jo.Qd + 1.0572252 * jo.nd;
                ho.Rc = 255 * vo((3.2404542 * jo.Rc + -1.5371385 * jo.Qd + -.4985314 * jo.nd) / 100);
                ho.Qd = 255 * vo(c / 100);
                ho.nd = 255 * vo(d / 100);
                ho.pg = jo.pg;
                ho.Rc = Math.round(ho.Rc);
                255 < ho.Rc ? ho.Rc = 255 : 0 > ho.Rc && (ho.Rc = 0);
                ho.Qd = Math.round(ho.Qd);
                255 < ho.Qd ? ho.Qd = 255 : 0 > ho.Qd && (ho.Qd = 0);
                ho.nd = Math.round(ho.nd);
                255 < ho.nd ? ho.nd = 255 : 0 > ho.nd && (ho.nd = 0);
                return "rgba(" + ho.Rc + ", " + ho.Qd + ", " + ho.nd + ", " + ho.pg + ")";
            case eo:
                var e = ho.Rc / 255,
                    g = ho.Qd /
                    255,
                    h = ho.nd / 255,
                    k = Math.max(e, g, h),
                    d = Math.min(e, g, h),
                    l = k - d,
                    d = (k + d) / 2;
                if (0 === l) c = e = 0;
                else {
                    switch (k) {
                        case e:
                            c = (g - h) / l % 6;
                            break;
                        case g:
                            c = (h - e) / l + 2;
                            break;
                        case h:
                            c = (e - g) / l + 4
                    }
                    c *= 60;
                    0 > c && (c += 360);
                    e = l / (1 - Math.abs(2 * d - 1))
                }
                io.Rc = Math.round(c);
                io.Qd = Math.round(100 * e);
                io.nd = Math.round(100 * d);
                io.pg = ho.pg;
                io.nd = Math.min(100, Math.max(0, io.nd + 100 * a));
                return "hsla(" + io.Rc + ", " + io.Qd + "%, " + io.nd + "%, " + io.pg + ")";
            default:
                return D.k("Unknown color space: " + b), "rgba(0, 0, 0, 1)"
        }
    }

    function mo(a) {
        fo.clearRect(0, 0, 1, 1);
        fo.fillStyle = "#000000";
        var b = fo.fillStyle;
        fo.fillStyle = a;
        fo.fillStyle !== b ? (fo.fillRect(0, 0, 1, 1), a = fo.getImageData(0, 0, 1, 1).data, ho.Rc = a[0], ho.Qd = a[1], ho.nd = a[2], ho.pg = a[3] / 255) : (fo.fillStyle = "#FFFFFF", b = fo.fillStyle, fo.fillStyle = a, fo.fillStyle === b && v && D.k('Color "' + a + '" is not a valid color string for RGBA color conversion'), ho.Rc = 0, ho.Qd = 0, ho.nd = 0, ho.pg = 1)
    }

    function po(a) { a /= 255; return .04045 >= a ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4) }

    function vo(a) { return .0031308 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - .055 }
    var uo = 216 / 24389,
        to = 24389 / 27,
        ro = [95.047, 100, 108.883];

    function qo(a) { return a > uo ? Math.pow(a, 1 / 3) : (to * a + 16) / 116 }

    function so(a) { var b = a * a * a; return b > uo ? b : (116 * a - 16) / to }

    function O() {
        D.xc(this);
        this.S = 4225027;
        this.Lc = 1;
        this.rj = null;
        this.$b = "";
        this.lc = this.Mb = null;
        this.sb = (new N(NaN, NaN)).freeze();
        this.$e = ie;
        this.oi = Xd;
        this.ni = ge;
        this.Nc = new Ea;
        this.Ni = new Ea;
        this.ij = new Ea;
        this.Db = this.Xo = 1;
        this.wg = 0;
        this.Qg = wo;
        this.en = Sd;
        this.Fd = (new C(NaN, NaN, NaN, NaN)).freeze();
        this.bc = (new C(NaN, NaN, NaN, NaN)).freeze();
        this.fd = (new C(0, 0, NaN, NaN)).freeze();
        this.Z = this.it = this.jt = null;
        this.Lm = this.ue = Vc;
        this.vt = 0;
        this.tj = 1;
        this.wr = 0;
        this.Si = 1;
        this.Lt = null;
        this.zt = -Infinity;
        this.qn =
            0;
        this.rn = Kd;
        this.sn = vj;
        this.Fr = "";
        this.Hc = this.ma = null;
        this.Jo = -1;
        this.wn = this.yg = this.Bl = this.Lp = null;
        this.kA = Qj;
        this.mn = null
    }
    D.Di(O);
    D.ka("GraphObject", O);
    O.prototype.cloneProtected = function(a) {
        a.S = this.S | 6144;
        a.Lc = this.Lc;
        a.$b = this.$b;
        a.Mb = this.Mb;
        a.lc = this.lc;
        a.sb.assign(this.sb);
        a.$e = this.$e.V();
        a.oi = this.oi.V();
        a.ni = this.ni.V();
        a.ij = this.ij.copy();
        a.Db = this.Db;
        a.wg = this.wg;
        a.Qg = this.Qg;
        a.en = this.en.V();
        a.Fd.assign(this.Fd);
        a.bc.assign(this.bc);
        a.fd.assign(this.fd);
        a.it = this.it;
        null !== this.Z && (a.Z = this.Z.copy());
        a.ue = this.ue.V();
        a.Lm = this.Lm.V();
        a.vt = this.vt;
        a.tj = this.tj;
        a.wr = this.wr;
        a.Si = this.Si;
        a.Lt = this.Lt;
        a.zt = this.zt;
        a.qn = this.qn;
        a.rn = this.rn.V();
        a.sn = this.sn;
        a.Fr = this.Fr;
        null !== this.ma && (a.ma = this.ma.copy());
        a.Hc = this.Hc;
        a.Jo = this.Jo;
        null !== this.Bl && (a.Bl = D.km(this.Bl));
        null !== this.yg && (a.yg = this.yg.copy());
        a.wn = this.wn
    };
    O.prototype.addCopyProperty = O.prototype.WH = function(a) {
        var b = this.Bl;
        if (D.isArray(b))
            for (var c = 0; c < b.length; c++) { if (b[c] === a) return } else this.Bl = b = [];
        b.push(a)
    };
    O.prototype.Ei = function(a) {
        a.jt = null;
        a.mn = null;
        a.K()
    };
    O.prototype.clone = function() {
        var a = new this.constructor;
        this.cloneProtected(a);
        if (null !== this.Bl)
            for (var b = 0; b < this.Bl.length; b++) {
                var c = this.Bl[b];
                a[c] = this[c]
            }
        return a
    };
    O.prototype.copy = function() { return this.clone() };
    O.prototype.qc = function(a) { a.Qe === J ? 0 === a.name.indexOf("Orient") ? this.Uq = a : D.k("Unknown Link enum value for GraphObject.segmentOrientation property: " + a) : a.Qe === O ? this.stretch = a : D.ak(this, a) };
    O.prototype.toString = function() { return D.wf(Object.getPrototypeOf(this)) + "#" + D.Nd(this) };
    var Zj;
    O.None = Zj = D.s(O, "None", 0);
    var wo;
    O.Default = wo = D.s(O, "Default", 0);
    var xo;
    O.Vertical = xo = D.s(O, "Vertical", 4);
    var yo;
    O.Horizontal = yo = D.s(O, "Horizontal", 5);
    var Ye;
    O.Fill = Ye = D.s(O, "Fill", 3);
    var bk;
    O.Uniform = bk = D.s(O, "Uniform", 1);
    var ck;
    O.UniformToFill = ck = D.s(O, "UniformToFill", 2);
    var zo;
    O.FlipVertical = zo = D.s(O, "FlipVertical", 1);
    var Ao;
    O.FlipHorizontal = Ao = D.s(O, "FlipHorizontal", 2);
    var Bo;
    O.FlipBoth = Bo = D.s(O, "FlipBoth", 3);

    function Co(a) { null === a.ma && (a.ma = new Do) }
    O.prototype.ae = function() {
        if (null === this.Z) {
            var a = new Eo;
            a.ok = dc;
            a.Mk = dc;
            a.mk = 10;
            a.Kk = 10;
            a.lk = Fo;
            a.Jk = Fo;
            a.nk = 0;
            a.Lk = 0;
            this.Z = a
        }
    };

    function Go(a, b, c, d, e, g, h) {
        var k = .001,
            l = g.length;
        a.moveTo(b, c);
        d -= b;
        k = e - c;
        0 === d && (d = .001);
        e = k / d;
        for (var m = Math.sqrt(d * d + k * k), n = 0, p = !0, q = 0 === h ? !1 : !0; .1 <= m;) {
            if (q) {
                k = g[n++ % l];
                for (k -= h; 0 > k;) k += g[n++ % l], p = !p;
                q = !1
            } else k = g[n++ % l];
            k > m && (k = m);
            var r = Math.sqrt(k * k / (1 + e * e));
            0 > d && (r = -r);
            b += r;
            c += e * r;
            p ? a.lineTo(b, c) : a.moveTo(b, c);
            m -= k;
            p = !p
        }
    }
    O.prototype.raiseChangedEvent = O.prototype.od = function(a, b, c, d, e, g, h) {
        var k = this.Y;
        if (null !== k && (k.qo(a, b, c, d, e, g, h), Ho(this) && c === this && a === fg && Io(this, k, b), c === k && 0 !== (k.S & 16777216) && null !== k.data))
            for (a = this.xa.o, c = a.length, d = 0; d < c; d++) e = a[d], e instanceof x && Xm(e, function(a) { null !== a.data && 0 !== (a.S & 16777216) && a.Ob(b) })
    };

    function Io(a, b, c) {
        var d = a.qm();
        if (null !== d)
            for (var e = a.Hc.j; e.next();) {
                var g = e.value,
                    h = null;
                if (null !== g.$q) {
                    h = sh(g, d, a);
                    if (null === h) continue;
                    g.Wy(a, h, c, null)
                } else if (g.ly) {
                    var k = b.g;
                    null === k || k.Xe || g.Wy(a, k.ea.fl, c, d)
                } else {
                    var l = d.data;
                    if (null === l) continue;
                    k = b.g;
                    null === k || k.Xe || g.Wy(a, l, c, d)
                }
                h === a && (k = d.Vx(g.Fm), null !== k && g.wH(k, h, c))
            }
    }
    O.prototype.Vx = function(a) { return this.Jo === a ? this : null };
    O.prototype.raiseChanged = O.prototype.i = function(a, b, c) { this.od(fg, a, this, b, c) };

    function Jo(a, b, c, d, e) {
        var g = a.Fd,
            h = a.ij;
        h.reset();
        Ko(a, h, b, c, d, e);
        a.ij = h;
        g.x = b;
        g.y = c;
        g.width = d;
        g.height = e;
        h.Nu() || h.tH(g)
    }

    function Lo(a, b, c, d) {
        if (!1 === a.tg) return !1;
        d.multiply(a.transform);
        return c ? a.jg(b, d) : a.In(b, d)
    }
    O.prototype.JF = function(a, b, c) {
        if (!1 === this.tg) return !1;
        var d = this.Ga;
        b = a.Kf(b);
        var e = !1;
        c && (e = lb(a.x, a.y, 0, 0, 0, d.height) < b || lb(a.x, a.y, 0, d.height, d.width, d.height) < b || lb(a.x, a.y, d.width, d.height, d.width, 0) < b || lb(a.x, a.y, d.width, 0, 0, 0) < b);
        c || (e = lb(a.x, a.y, 0, 0, 0, d.height) < b && lb(a.x, a.y, 0, d.height, d.width, d.height) < b && lb(a.x, a.y, d.width, d.height, d.width, 0) < b && lb(a.x, a.y, d.width, 0, 0, 0) < b);
        return e
    };
    O.prototype.kh = function() { return !0 };
    O.prototype.containsPoint = O.prototype.Pa = function(a) {
        v && D.l(a, N, O, "containsPoint:p");
        var b = D.P();
        b.assign(a);
        this.transform.vb(b);
        var c = this.aa;
        if (!c.H()) return D.A(b), !1;
        var d = this.g;
        if (null !== d && d.uk) {
            var e = d.Cu("extraTouchThreshold"),
                g = d.Cu("extraTouchArea"),
                h = g / 2,
                k = this.Ga,
                d = this.Jj() * d.scale,
                l = 1 / d;
            if (k.width * d < e && k.height * d < e) return a = Vb(c.x - h * l, c.y - h * l, c.width + g * l, c.height + g * l, b.x, b.y), D.A(b), a
        }
        if (this instanceof da || this instanceof z ? Vb(c.x - 5, c.y - 5, c.width + 10, c.height + 10, b.x, b.y) : c.Pa(b)) return e = !1, e = this.yg && !this.yg.Pa(b) ? !1 : null !== this.lc && c.Pa(b) ? !0 : null !== this.Mb && this.fd.Pa(a) ? !0 : this.Rk(a), D.A(b), e;
        D.A(b);
        return !1
    };
    O.prototype.Rk = function(a) { var b = this.Ga; return Vb(0, 0, b.width, b.height, a.x, a.y) };
    O.prototype.containsRect = O.prototype.Sk = function(a) {
        v && D.l(a, C, O, "containsRect:r");
        if (0 === this.angle) return this.aa.Sk(a);
        var b = this.Ga,
            b = D.vg(0, 0, b.width, b.height),
            c = this.transform,
            d = !1,
            e = D.Fb(a.x, a.y);
        b.Pa(c.Oh(e)) && (e.n(a.x, a.bottom), b.Pa(c.Oh(e)) && (e.n(a.right, a.bottom), b.Pa(c.Oh(e)) && (e.n(a.right, a.y), b.Pa(c.Oh(e)) && (d = !0))));
        D.A(e);
        D.Lb(b);
        return d
    };
    O.prototype.containedInRect = O.prototype.In = function(a, b) {
        v && D.l(a, C, O, "containedInRect:r");
        if (void 0 === b) return a.Sk(this.aa);
        var c = this.Ga,
            d = !1,
            e = D.Fb(0, 0);
        a.Pa(b.vb(e)) && (e.n(0, c.height), a.Pa(b.vb(e)) && (e.n(c.width, c.height), a.Pa(b.vb(e)) && (e.n(c.width, 0), a.Pa(b.vb(e)) && (d = !0))));
        D.A(e);
        return d
    };
    O.prototype.intersectsRect = O.prototype.jg = function(a, b) {
        v && D.l(a, C, O, "intersectsRect:r");
        if (void 0 === b && (b = this.transform, 0 === this.angle)) return a.jg(this.aa);
        var c = this.Ga,
            d = b,
            e = D.Fb(0, 0),
            g = D.Fb(0, c.height),
            h = D.Fb(c.width, c.height),
            k = D.Fb(c.width, 0),
            l = !1;
        if (a.Pa(d.vb(e)) || a.Pa(d.vb(g)) || a.Pa(d.vb(h)) || a.Pa(d.vb(k))) l = !0;
        else {
            var c = D.vg(0, 0, c.width, c.height),
                m = D.Fb(a.x, a.y);
            c.Pa(d.Oh(m)) ? l = !0 : (m.n(a.x, a.bottom), c.Pa(d.Oh(m)) ? l = !0 : (m.n(a.right, a.bottom), c.Pa(d.Oh(m)) ? l = !0 : (m.n(a.right, a.y), c.Pa(d.Oh(m)) &&
                (l = !0))));
            D.A(m);
            D.Lb(c);
            !l && (Le(a, e, g) || Le(a, g, h) || Le(a, h, k) || Le(a, k, e)) && (l = !0)
        }
        D.A(e);
        D.A(g);
        D.A(h);
        D.A(k);
        return l
    };
    O.prototype.getDocumentPoint = O.prototype.fb = function(a, b) {
        void 0 === b && (b = new N);
        if (a instanceof S) {
            a.de() && D.k("getDocumentPoint:s Spot must be specific: " + a.toString());
            var c = this.Ga;
            b.n(a.x * c.width + a.offsetX, a.y * c.height + a.offsetY)
        } else b.set(a);
        this.Hh.vb(b);
        return b
    };
    O.prototype.getDocumentAngle = O.prototype.sm = function() {
        var a;
        a = this.Hh;
        1 === a.m11 && 0 === a.m12 ? a = 0 : (a = 180 * Math.atan2(a.m12, a.m11) / Math.PI, 0 > a && (a += 360));
        return a
    };
    O.prototype.getDocumentScale = O.prototype.Jj = function() { if (0 !== (this.S & 4096) === !1) return this.Xo; var a = this.Db; return null !== this.R ? a * this.R.Jj() : a };
    O.prototype.getLocalPoint = O.prototype.PF = function(a, b) {
        void 0 === b && (b = new N);
        b.assign(a);
        this.Hh.Oh(b);
        return b
    };
    O.prototype.getNearestIntersectionPoint = O.prototype.QF = function(a, b, c) { return this.Tn(a.x, a.y, b.x, b.y, c) };
    f = O.prototype;
    f.Tn = function(a, b, c, d, e) {
        var g = this.transform,
            h = 1 / (g.m11 * g.m22 - g.m12 * g.m21),
            k = g.m22 * h,
            l = -g.m12 * h,
            m = -g.m21 * h,
            n = g.m11 * h,
            p = h * (g.m21 * g.dy - g.m22 * g.dx),
            q = h * (g.m12 * g.dx - g.m11 * g.dy);
        if (null !== this.gm) return g = this.aa, Je(g.left, g.top, g.right, g.bottom, a, b, c, d, e);
        h = a * k + b * m + p;
        a = a * l + b * n + q;
        b = c * k + d * m + p;
        c = c * l + d * n + q;
        e.n(0, 0);
        d = this.Ga;
        c = Je(0, 0, d.width, d.height, h, a, b, c, e);
        e.transform(g);
        return c
    };

    function Hk(a, b, c, d, e) {
        if (!1 !== Nm(a)) {
            var g = a.margin,
                h = g.right + g.left,
                g = g.top + g.bottom;
            b = Math.max(b - h, 0);
            c = Math.max(c - g, 0);
            e = e || 0;
            d = Math.max((d || 0) - h, 0);
            e = Math.max(e - g, 0);
            var h = a.angle,
                g = 0,
                g = a.Ea,
                k = 0;
            a instanceof z && (k = a.lb);
            90 === h || 270 === h ? (b = isFinite(g.height) ? g.height + k : b, c = isFinite(g.width) ? g.width + k : c) : (b = isFinite(g.width) ? g.width + k : b, c = isFinite(g.height) ? g.height + k : c);
            var g = d || 0,
                k = e || 0,
                l = a instanceof x;
            switch (Mo(a, !0)) {
                case Zj:
                    k = g = 0;
                    l && (c = b = Infinity);
                    break;
                case Ye:
                    isFinite(b) && b > d && (g = b);
                    isFinite(c) &&
                        c > e && (k = c);
                    break;
                case yo:
                    isFinite(b) && b > d && (g = b);
                    k = 0;
                    l && (c = Infinity);
                    break;
                case xo:
                    isFinite(c) && c > e && (k = c), g = 0, l && (b = Infinity)
            }
            var l = a.pf,
                m = a.ah;
            g > l.width && m.width < l.width && (g = l.width);
            k > l.height && m.height < l.height && (k = l.height);
            d = Math.max(g / a.scale, m.width);
            e = Math.max(k / a.scale, m.height);
            l.width < d && (d = Math.min(m.width, d));
            l.height < e && (e = Math.min(m.height, e));
            b = Math.min(l.width, b);
            c = Math.min(l.height, c);
            b = Math.max(d, b);
            c = Math.max(e, c);
            if (90 === h || 270 === h) g = b, b = c, c = g, g = d, d = e, e = g;
            a.Fd.Xa();
            a.ho(b, c,
                d, e);
            a.Fd.freeze();
            a.Fd.H() || D.k("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.Fd.toString());
            km(a, !1)
        }
    }
    f.ho = function() {};
    f.Oj = function() { return !1 };
    f.rc = function(a, b, c, d, e) {
        this.cj();
        var g = D.Sf();
        g.assign(this.bc);
        this.bc.Xa();
        if (!1 === Om(this)) {
            var h = this.bc;
            h.x = a;
            h.y = b;
            h.width = c;
            h.height = d
        } else this.Cj(a, b, c, d);
        this.bc.freeze();
        this.yg = void 0 === e ? null : e;
        c = !1;
        void 0 !== e ? c = !0 : null !== this.R && (e = this.R.fd, d = this.Fa, null !== this.gm && (d = this.bc), c = b + d.height, d = a + d.width, c = !(0 <= a + .05 && d <= e.width + .05 && 0 <= b + .05 && c <= e.height + .05), this instanceof pa && (a = this.fd, this.Cw > a.height || this.sf.Pe > a.width)) && (c = !0);
        this.S = c ? this.S | 256 : this.S & -257;
        this.bc.H() ||
            D.k("Non-real actualBounds has been set. Object " + this + ", actualBounds: " + this.bc.toString());
        this.zy(g, this.bc);
        No(this, !1);
        D.Lb(g)
    };
    f.Cj = function() {};

    function Oo(a, b, c, d, e) {
        var g = a.aa;
        g.x = b;
        g.y = c;
        g.width = d;
        g.height = e;
        if (!a.Ea.H()) {
            g = a.Fd;
            c = a.margin;
            b = c.right + c.left;
            var h = c.top + c.bottom;
            c = g.width + b;
            g = g.height + h;
            d += b;
            e += h;
            b = Mo(a, !0);
            c === d && g === e && (b = Zj);
            switch (b) {
                case Zj:
                    if (c > d || g > e) km(a, !0), Hk(a, c > d ? d : c, g > e ? e : g);
                    break;
                case Ye:
                    km(a, !0);
                    Hk(a, d, e, 0, 0);
                    break;
                case yo:
                    km(a, !0);
                    Hk(a, d, g, 0, 0);
                    break;
                case xo:
                    km(a, !0), Hk(a, c, e, 0, 0)
            }
        }
    }
    f.zy = function(a, b) {
        var c = this.Y;
        null !== c && null !== c.g && (c.to !== this && c.RG !== this && c.TB !== this || Po(c, !0), this.ra(), Db(a, b) || (c.cl(), this.$s(c)))
    };
    f.$s = function(a) { null !== this.yd && (Po(a, !0), a instanceof G && Qo(a, this)) };
    D.defineProperty(O, { vo: "shadowVisible" }, function() { return this.wn }, function(a) {
        var b = this.wn;
        b !== a && (v && null !== a && D.h(a, "boolean", O, "shadowVisible"), this.wn = a, this.ra(), this.i("shadowVisible", b, a))
    });
    O.prototype.He = function(a, b) {
        if (this.visible) {
            var c = this.bc;
            if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y)) {
                var d = this.opacity,
                    e = 1;
                if (1 !== d) {
                    if (0 === d) return;
                    e = a.globalAlpha;
                    a.globalAlpha = e * d
                }
                if (a instanceof qd) a: {
                    if (this.visible) {
                        var g = null,
                            h = a.ny;
                        if (this instanceof x && (this.type === Ro || this.type === So)) To(this, a, b);
                        else {
                            var k = this.bc;
                            if (0 !== k.width && 0 !== k.height && !isNaN(k.x) && !isNaN(k.y)) {
                                var l = this.transform,
                                    m = this.R;
                                0 !== (this.S & 4096) === !0 && Uo(this);
                                var c = 0 !== (this.S & 256),
                                    n = !1;
                                this instanceof
                                pa && (a.font = this.font);
                                if (c) {
                                    n = m.kh() ? m.Ga : m.aa;
                                    if (null !== this.yg) var p = this.yg,
                                        q = p.x,
                                        r = p.y,
                                        s = p.width,
                                        p = p.height;
                                    else q = Math.max(k.x, n.x), r = Math.max(k.y, n.y), s = Math.min(k.right, n.right) - q, p = Math.min(k.bottom, n.bottom) - r;
                                    if (q > k.width + k.x || k.x > n.width + n.x || r > k.height + k.y || k.y > n.height + n.y) break a;
                                    n = !0;
                                    sd(a, 1, 0, 0, 1, 0, 0);
                                    a.save();
                                    a.beginPath();
                                    a.rect(q, r, s, p);
                                    a.clip()
                                }
                                if (this.Oj()) { var u = this; if (!u.isVisible()) break a }
                                a.Mh.ac = [1, 0, 0, 1, 0, 0];
                                this instanceof pa && 1 < this.wB && sd(a, 1, 0, 0, 1, 0, 0);
                                q = !1;
                                this.Oj() &&
                                    this.dl && b.Kj("drawShadows") && (r = this.vn, a.fC(r.x * b.scale * b.ud, r.y * b.scale * b.ud, u.Pg), a.wo(), a.shadowColor = u.un);
                                u = !1;
                                this.Y && b.Kj("drawShadows") && (u = this.Y.dl);
                                !0 === this.vo ? (a.wo(), !1 === q && u && (sd(a, 1, 0, 0, 1, 0, 0), a.jb(), q = !0)) : !1 === this.vo && a.Cm();
                                null !== this.lc && (Vo(this, a, this.lc, !0, !0), !1 === q && u && (sd(a, 1, 0, 0, 1, 0, 0), a.jb(), q = !0), this.lc instanceof Ba && this.lc.type === Id ? (a.beginPath(), a.rect(k.x, k.y, k.width, k.height), a.Xg(this.lc)) : a.fillRect(k.x, k.y, k.width, k.height));
                                this instanceof x ? sd(a, l.m11,
                                    l.m12, l.m21, l.m22, l.dx, l.dy) : a.Mh.ac = [l.m11, l.m12, l.m21, l.m22, l.dx, l.dy];
                                null !== this.Mb && (!1 === q && u && (sd(a, 1, 0, 0, 1, 0, 0), a.jb(), q = !0), s = this.Ga, l = k = 0, r = s.width, s = s.height, p = 0, this instanceof z && (s = this.ab.pb, k = s.x, l = s.y, r = s.width, s = s.height, p = this.Rg), Vo(this, a, this.Mb, !0, !1), this.Mb instanceof Ba && this.Mb.type === Id ? (a.beginPath(), a.rect(k - p / 2, l - p / 2, r + p, s + p), a.Xg(this.Mb)) : a.fillRect(k - p / 2, l - p / 2, r + p, s + p));
                                u && (null !== this.Mb || null !== this.lc || null !== m && 0 !== (m.S & 512) || null !== m && (m.type === Pl || m.type ===
                                    Xj) && m.Ld() !== this) ? (Wo(this, !0), null === this.vo && a.Cm()) : Wo(this, !1);
                                this.Wk(a, b);
                                u && 0 !== (this.S & 512) === !0 && a.wo();
                                this.Oj() && u && a.Cm();
                                c && (a.restore(), n && a.xf.pop());
                                this instanceof x && (g = a.xf.pop());
                                !0 === q && a.xf.pop();
                                this instanceof pa && 1 < this.wB && (g = a.xf.pop());
                                null !== a.BF && (null === g && (h === a.ny ? (sd(a, 1, 0, 0, 1, 0, 0), g = a.xf.pop()) : g = a.ny), a.BF(this, g))
                            }
                        }
                    }
                }
                else {
                    if (this instanceof x && (this.type === Ro || this.type === So)) {
                        To(this, a, b);
                        1 !== d && (a.globalAlpha = e);
                        return
                    }
                    this instanceof J && this.Wu(!1);
                    v && v.Dj &&
                        v.FI(a, this);
                    g = this.transform;
                    h = this.R;
                    0 !== (this.S & 4096) === !0 && Uo(this);
                    m = 0 !== (this.S & 256);
                    a.eq && (m = !1);
                    this instanceof pa && (a.font = this.font);
                    if (m) {
                        v && v.AF && D.trace("clip" + this.toString());
                        n = h.kh() ? h.Ga : h.aa;
                        null !== this.yg ? (q = this.yg, k = q.x, l = q.y, u = q.width, q = q.height) : (k = Math.max(c.x, n.x), l = Math.max(c.y, n.y), u = Math.min(c.right, n.right) - k, q = Math.min(c.bottom, n.bottom) - l);
                        if (k > c.width + c.x || c.x > n.width + n.x || l > c.height + c.y || c.y > n.height + n.y) { 1 !== d && (a.globalAlpha = e); return }
                        v && v.AF && v.HI(a, k, l, u, q);
                        a.save();
                        a.beginPath();
                        a.rect(k, l, u, q);
                        a.clip()
                    }
                    if (this.Oj()) {
                        if (!this.isVisible()) { 1 !== d && (a.globalAlpha = e); return }
                        this.dl && b.Kj("drawShadows") && (n = this.vn, a.fC(n.x * b.scale * b.ud, n.y * b.scale * b.ud, this.Pg), a.wo(), a.shadowColor = this.un)
                    }
                    n = !1;
                    this.Y && b.Kj("drawShadows") && (n = this.Y.dl);
                    !0 === this.vo ? a.wo() : !1 === this.vo && a.Cm();
                    null !== this.lc && (Vo(this, a, this.lc, !0, !0), this.lc instanceof Ba && this.lc.type === Id ? (a.beginPath(), a.rect(c.x, c.y, c.width, c.height), a.Xg(this.lc)) : a.fillRect(c.x, c.y, c.width, c.height));
                    g.Nu() ||
                        a.transform(g.m11, g.m12, g.m21, g.m22, g.dx, g.dy);
                    n && (null !== h && 0 !== (h.S & 512) || null !== h && (h.type === Pl || h.type === Xj) && h.Ld() !== this) && null === this.vo && a.Cm();
                    null !== this.Mb && (u = this.Ga, k = c = 0, l = u.width, u = u.height, q = 0, this instanceof z && (u = this.ab.pb, c = u.x, k = u.y, l = u.width, u = u.height, q = this.Rg), Vo(this, a, this.Mb, !0, !1), this.Mb instanceof Ba && this.Mb.type === Id ? (a.beginPath(), a.rect(c - q / 2, k - q / 2, l + q, u + q), a.Xg(this.Mb)) : a.fillRect(c - q / 2, k - q / 2, l + q, u + q));
                    v && v.Dj && v.GI(a, this);
                    n && (null !== this.Mb || null !== this.lc ||
                        null !== h && 0 !== (h.S & 512) || null !== h && (h.type === Pl || h.type === Xj) && h.Ld() !== this) ? (Wo(this, !0), null === this.vo && a.Cm()) : Wo(this, !1);
                    this.Wk(a, b);
                    n && 0 !== (this.S & 512) === !0 && a.wo();
                    this.Oj() && n && a.Cm();
                    m ? (a.restore(), this instanceof x ? a.De(!0) : a.De(!1)) : g.Nu() || (h = 1 / (g.m11 * g.m22 - g.m12 * g.m21), a.transform(g.m22 * h, -g.m12 * h, -g.m21 * h, g.m11 * h, h * (g.m21 * g.dy - g.m22 * g.dx), h * (g.m12 * g.dx - g.m11 * g.dy)))
                }
                1 !== d && (a.globalAlpha = e)
            }
        }
    };

    function To(a, b, c) {
        var d = a.bc;
        0 === d.width || 0 === d.height || isNaN(d.x) || isNaN(d.y) || (null !== a.lc && (Vo(a, b, a.lc, !0, !0), a.lc instanceof Ba && a.lc.type === Id ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), b.Xg(a.lc)) : b.fillRect(d.x, d.y, d.width, d.height)), null !== a.Mb && (Vo(a, b, a.Mb, !0, !1), a.Mb instanceof Ba && a.Mb.type === Id ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), b.Xg(a.Mb)) : b.fillRect(d.x, d.y, d.width, d.height)), a.Wk(b, c))
    }
    O.prototype.Wk = function() {};

    function Vo(a, b, c, d, e) {
        if (null !== c) {
            var g = 1,
                h = 1;
            if ("string" === typeof c) d ? b.fillStyle = c : b.strokeStyle = c;
            else if (c.type === Fg) d ? b.fillStyle = c.color : b.strokeStyle = c.color;
            else {
                var k, h = a.Ga,
                    g = h.width,
                    h = h.height;
                if (e) var l = a.aa,
                    g = l.width,
                    h = l.height;
                var m = b instanceof Hd;
                if (m && c.qh && (c.type === bo || c.Mo === g && c.xz === h)) k = c.qh;
                else {
                    var n = l = 0,
                        p = 0,
                        q = 0,
                        r = 0,
                        s = 0,
                        s = r = 0;
                    e && (l = a.aa, g = l.width, h = l.height, r = l.x, s = l.y);
                    l = c.start.x * g + c.start.offsetX;
                    n = c.start.y * h + c.start.offsetY;
                    p = c.end.x * g + c.end.offsetX;
                    q = c.end.y * h + c.end.offsetY;
                    l += r;
                    p += r;
                    n += s;
                    q += s;
                    if (c.type === Gg) k = b.createLinearGradient(l, n, p, q);
                    else if (c.type === Id) s = isNaN(c.ou) ? Math.max(g, h) / 2 : c.ou, isNaN(c.sv) ? (r = 0, s = Math.max(g, h) / 2) : r = c.sv, k = b.createRadialGradient(l, n, r, p, q, s);
                    else if (c.type === bo) try { k = b.createPattern(c.pattern, "repeat") } catch (u) { k = null } else D.kc(c.type, "Brush type");
                    if (c.type !== bo && (e = c.Qk, null !== e))
                        for (e = e.j; e.next();) k.addColorStop(e.key, e.value);
                    if (m && (c.qh = k, null !== k && (c.Mo = g, c.xz = h), null === k && c.type === bo && -1 !== c.Mo)) {
                        c.Mo = -1;
                        var t = a.g;
                        null !== t &&
                            -1 === c.Mo && D.setTimeout(function() { t.ro() }, 600)
                    }
                }
                d ? b.fillStyle = k : b.strokeStyle = k
            }
        }
    }
    O.prototype.isContainedBy = O.prototype.xm = function(a) {
        if (a instanceof x) a: {
            if (this !== a && null !== a)
                for (var b = this.R; null !== b;) {
                    if (b === a) { a = !0; break a }
                    b = b.R
                }
            a = !1
        }
        else a = !1;
        return a
    };
    O.prototype.isVisibleObject = O.prototype.Sj = function() { if (!this.visible) return !1; var a = this.R; return null !== a ? a.Sj() : !0 };
    O.prototype.isEnabledObject = O.prototype.Ju = function() { for (var a = this instanceof x ? this : this.R; null !== a && a.isEnabled;) a = a.R; return null === a };
    D.defineProperty(O, { CF: "enabledChanged" }, function() { return null !== this.ma ? this.ma.Yr : null }, function(a) {
        Co(this);
        var b = this.ma.Yr;
        b !== a && (null !== a && D.h(a, "function", O, "enabledChanged"), this.ma.Yr = a, this.i("enabledChanged", b, a))
    });

    function Uo(a) {
        if (0 !== (a.S & 2048) === !0) {
            var b = a.Nc;
            b.reset();
            if (!a.bc.H() || !a.Fd.H()) { Xo(a, !1); return }
            b.translate(a.bc.x, a.bc.y);
            b.translate(-a.Fa.x, -a.Fa.y);
            var c = a.Ga;
            Ko(a, b, c.x, c.y, c.width, c.height);
            Xo(a, !1);
            Yo(a, !0)
        }
        0 !== (a.S & 4096) === !0 && (b = a.R, null === b ? (a.Ni.set(a.Nc), a.Xo = a.scale, Yo(a, !1)) : null !== b.Hh && (c = a.Ni, c.reset(), b.kh() ? c.multiply(b.Ni) : null !== b.R && c.multiply(b.R.Ni), c.multiply(a.Nc), a.Xo = a.scale * b.Xo, Yo(a, !1)))
    }

    function Ko(a, b, c, d, e, g) {
        1 !== a.scale && b.scale(a.scale);
        if (0 !== a.angle) {
            var h = mc;
            a.Oj() && a.Of.Xc() && (h = a.Of);
            var k = D.P();
            if (a instanceof F && a.Bf !== a)
                for (c = a.Bf, d = c.Ga, k.pv(d.x, d.y, d.width, d.height, h), c.ij.vb(k), k.offset(-c.Fa.x, -c.Fa.y), h = c.R; null !== h && h !== a;) h.ij.vb(k), k.offset(-h.Fa.x, -h.Fa.y), h = h.R;
            else k.pv(c, d, e, g, h);
            b.rotate(a.angle, k.x, k.y);
            D.A(k)
        }
    }
    f = O.prototype;
    f.K = function(a) {
        void 0 === a && (a = !1);
        if (!0 !== Nm(this)) {
            km(this, !0);
            No(this, !0);
            var b = this.R;
            null === b || a || b.K()
        }
    };
    f.xq = function() {!0 !== Nm(this) && (km(this, !0), No(this, !0)) };

    function Zo(a) {
        if (!1 === Om(a)) {
            var b = a.R;
            null !== b ? b.K() : a.Oj() && (b = a.g, null !== b && (b.Gg.add(a), a instanceof G && a.kg(), b.Ve()));
            No(a, !0)
        }
    }
    f.cj = function() { 0 !== (this.S & 2048) === !1 && (Xo(this, !0), Yo(this, !0)) };
    f.nB = function() { Yo(this, !0) };
    f.ra = function() {
        var a = this.Y;
        null !== a && a.ra()
    };

    function Mo(a, b) {
        var c = a.stretch,
            d = a.R;
        if (null !== d && d.da === fa) return $o(a, d.oe(a.Sb), d.ne(a.column), b);
        if (null !== d && d.da === Pl && d.Ld() === a) return ap(a, Ye, b);
        if (c === wo) {
            if (null !== d) {
                if (d.da === Xj && d.Ld() === a) return ap(a, Ye, b);
                c = d.le;
                return c === wo ? ap(a, Zj, b) : ap(a, c, b)
            }
            return ap(a, Zj, b)
        }
        return ap(a, c, b)
    }

    function $o(a, b, c, d) {
        var e = a.stretch;
        if (e !== wo) return ap(a, e, d);
        var g = e = null;
        switch (b.stretch) {
            case xo:
                g = !0;
                break;
            case Ye:
                g = !0
        }
        switch (c.stretch) {
            case yo:
                e = !0;
                break;
            case Ye:
                e = !0
        }
        b = a.R.le;
        null === e && (e = b === yo || b === Ye);
        null === g && (g = b === xo || b === Ye);
        return !0 === e && !0 === g ? ap(a, Ye, d) : !0 === e ? ap(a, yo, d) : !0 === g ? ap(a, xo, d) : ap(a, Zj, d)
    }

    function ap(a, b, c) {
        if (c) return b;
        if (b === Zj) return Zj;
        c = a.Ea;
        if (c.H()) return Zj;
        a = a.angle;
        if (!isNaN(c.width))
            if (90 !== a && 270 !== a) { if (b === yo) return Zj; if (b === Ye) return xo } else { if (b === xo) return Zj; if (b === Ye) return yo }
        if (!isNaN(c.height))
            if (90 !== a && 270 !== a) { if (b === xo) return Zj; if (b === Ye) return yo } else { if (b === yo) return Zj; if (b === Ye) return xo }
        return b
    }
    D.defineProperty(O, { Uq: "segmentOrientation" }, function() { return this.sn }, function(a) {
        var b = this.sn;
        b !== a && (v && D.Da(a, J, O, "segmentOrientation"), this.sn = a, this.K(), this.i("segmentOrientation", b, a), a === vj && (this.angle = 0))
    });
    D.defineProperty(O, { We: "segmentIndex" }, function() { return this.zt }, function(a) {
        v && D.h(a, "number", O, "segmentIndex");
        a = Math.round(a);
        var b = this.zt;
        b !== a && (this.zt = a, this.K(), this.i("segmentIndex", b, a))
    });
    D.defineProperty(O, { WB: "segmentFraction" }, function() { return this.qn }, function(a) {
        v && D.h(a, "number", O, "segmentFraction");
        isNaN(a) ? a = 0 : 0 > a ? a = 0 : 1 < a && (a = 1);
        var b = this.qn;
        b !== a && (this.qn = a, this.K(), this.i("segmentFraction", b, a))
    });
    D.defineProperty(O, { XB: "segmentOffset" }, function() { return this.rn }, function(a) {
        var b = this.rn;
        b.O(a) || (v && D.l(a, N, O, "segmentOffset"), this.rn = a = a.V(), this.K(), this.i("segmentOffset", b, a))
    });
    D.defineProperty(O, { stretch: "stretch" }, function() { return this.Qg }, function(a) {
        var b = this.Qg;
        b !== a && (v && D.Da(a, O, O, "stretch"), this.Qg = a, this.K(), this.i("stretch", b, a))
    });
    D.defineProperty(O, { name: "name" }, function() { return this.$b }, function(a) {
        var b = this.$b;
        b !== a && (v && D.h(a, "string", O, "name"), this.$b = a, null !== this.Y && (this.Y.Sl = null), this.i("name", b, a))
    });
    D.defineProperty(O, { opacity: "opacity" }, function() { return this.Lc }, function(a) {
        var b = this.Lc;
        b !== a && (D.h(a, "number", O, "opacity"), (0 > a || 1 < a) && D.ua(a, "0 <= value <= 1", O, "opacity"), this.Lc = a, this.i("opacity", b, a), a = this.g, b = this.Y, null !== a && null !== b && a.ra(xl(b, b.aa)))
    });
    D.defineProperty(O, { visible: "visible" }, function() { return 0 !== (this.S & 1) }, function(a) {
        var b = 0 !== (this.S & 1);
        b !== a && (v && D.h(a, "boolean", O, "visible"), this.S ^= 1, this.i("visible", b, a), b = this.R, null !== b ? b.K() : this.Oj() && this.Pd(a), this.ra(), bp(this))
    });
    D.defineProperty(O, { tg: "pickable" }, function() { return 0 !== (this.S & 2) }, function(a) {
        var b = 0 !== (this.S & 2);
        b !== a && (v && D.h(a, "boolean", O, "pickable"), this.S ^= 2, this.i("pickable", b, a))
    });
    D.defineProperty(O, { QI: "fromLinkableDuplicates" }, function() { return 0 !== (this.S & 4) }, function(a) {
        var b = 0 !== (this.S & 4);
        b !== a && (v && D.h(a, "boolean", O, "fromLinkableDuplicates"), this.S ^= 4, this.i("fromLinkableDuplicates", b, a))
    });
    D.defineProperty(O, { RI: "fromLinkableSelfNode" }, function() { return 0 !== (this.S & 8) }, function(a) {
        var b = 0 !== (this.S & 8);
        b !== a && (v && D.h(a, "boolean", O, "fromLinkableSelfNode"), this.S ^= 8, this.i("fromLinkableSelfNode", b, a))
    });
    D.defineProperty(O, { CK: "toLinkableDuplicates" }, function() { return 0 !== (this.S & 16) }, function(a) {
        var b = 0 !== (this.S & 16);
        b !== a && (v && D.h(a, "boolean", O, "toLinkableDuplicates"), this.S ^= 16, this.i("toLinkableDuplicates", b, a))
    });
    D.defineProperty(O, { DK: "toLinkableSelfNode" }, function() { return 0 !== (this.S & 32) }, function(a) {
        var b = 0 !== (this.S & 32);
        b !== a && (v && D.h(a, "boolean", O, "toLinkableSelfNode"), this.S ^= 32, this.i("toLinkableSelfNode", b, a))
    });
    D.defineProperty(O, { Ue: "isPanelMain" }, function() { return 0 !== (this.S & 64) }, function(a) {
        var b = 0 !== (this.S & 64);
        b !== a && (v && D.h(a, "boolean", O, "isPanelMain"), this.S ^= 64, this.K(), this.i("isPanelMain", b, a))
    });
    D.defineProperty(O, { Hu: "isActionable" }, function() { return 0 !== (this.S & 128) }, function(a) {
        var b = 0 !== (this.S & 128);
        b !== a && (v && D.h(a, "boolean", O, "isActionable"), this.S ^= 128, this.i("isActionable", b, a))
    });
    D.defineProperty(O, { gm: "areaBackground" }, function() { return this.lc }, function(a) {
        var b = this.lc;
        b !== a && (v && null !== a && D.hu(a, "GraphObject.areaBackground"), a instanceof Ba && a.freeze(), this.lc = a, this.ra(), this.i("areaBackground", b, a))
    });
    D.defineProperty(O, { background: "background" }, function() { return this.Mb }, function(a) {
        var b = this.Mb;
        b !== a && (v && null !== a && D.hu(a, "GraphObject.background"), a instanceof Ba && a.freeze(), this.Mb = a, this.ra(), this.i("background", b, a))
    });

    function Wo(a, b) { a.S = b ? a.S | 512 : a.S & -513 }

    function Ho(a) { return 0 !== (a.S & 1024) }

    function cp(a, b) { a.S = b ? a.S | 1024 : a.S & -1025 }

    function Xo(a, b) { a.S = b ? a.S | 2048 : a.S & -2049 }

    function Yo(a, b) { a.S = b ? a.S | 4096 : a.S & -4097 }

    function Nm(a) { return 0 !== (a.S & 8192) }

    function km(a, b) { a.S = b ? a.S | 8192 : a.S & -8193 }

    function Om(a) { return 0 !== (a.S & 16384) }

    function No(a, b) { a.S = b ? a.S | 16384 : a.S & -16385 }
    D.w(O, { Y: "part" }, function() {
        if (this.Oj()) return this;
        if (null !== this.mn) return this.mn;
        var a;
        for (a = this.R; a;) {
            if (a instanceof F) return this.mn = a;
            a = a.R
        }
        return null
    });
    D.w(O, { R: "panel" }, function() { return this.rj });
    O.prototype.Bm = function(a) { this.rj = a };
    D.w(O, { layer: "layer" }, function() { var a = this.Y; return null !== a ? a.layer : null }, { configurable: !0 });
    D.w(O, { g: "diagram" }, function() { var a = this.Y; return null !== a ? a.g : null }, { configurable: !0 });
    D.defineProperty(O, { position: "position" }, function() { return this.sb }, function(a) {
        v && D.l(a, N, O, "position");
        var b = a.x,
            c = a.y,
            d = this.sb,
            e = d.x,
            g = d.y;
        (e === b || isNaN(e) && isNaN(b)) && (g === c || isNaN(g) && isNaN(c)) ? this.cC(): (a = a.V(), this.bC(a, d) && this.i("position", d, a))
    });
    O.prototype.cC = function() {};
    O.prototype.bC = function(a) {
        this.sb = a;
        Zo(this);
        this.cj();
        return !0
    };
    O.prototype.Uy = function(a, b) {
        this.sb.n(a, b);
        this.cj()
    };
    D.w(O, { aa: "actualBounds" }, function() { return this.bc });
    D.defineProperty(O, { scale: "scale" }, function() { return this.Db }, function(a) {
        var b = this.Db;
        b !== a && (v && D.p(a, O, "scale"), 0 >= a && D.k("GraphObject.scale for " + this + " must be greater than zero, not: " + a), this.Db = a, this.cj(), this.K(), this.i("scale", b, a))
    });
    D.defineProperty(O, { angle: "angle" }, function() { return this.wg }, function(a) {
        var b = this.wg;
        b !== a && (v && D.p(a, O, "angle"), a %= 360, 0 > a && (a += 360), b !== a && (this.wg = a, bp(this), this.K(), this.cj(), this.i("angle", b, a)))
    });
    D.defineProperty(O, { Ea: "desiredSize" }, function() { return this.$e }, function(a) {
        v && D.l(a, Ca, O, "desiredSize");
        var b = a.width,
            c = a.height,
            d = this.$e,
            e = d.width,
            g = d.height;
        (e === b || isNaN(e) && isNaN(b)) && (g === c || isNaN(g) && isNaN(c)) || (this.$e = a = a.V(), this.K(), this instanceof z && this.Te(), this.i("desiredSize", d, a), Ho(this) && (a = this.Y, null !== a && (Io(this, a, "width"), Io(this, a, "height"))))
    });
    D.defineProperty(O, { width: "width" }, function() { return this.$e.width }, function(a) {
        var b = this.$e.width;
        b === a || isNaN(b) && isNaN(a) || (v && D.h(a, "number", O, "width"), b = this.$e, this.$e = a = (new Ca(a, this.$e.height)).freeze(), this.K(), this instanceof z && this.Te(), this.i("desiredSize", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "width")))
    });
    D.defineProperty(O, { height: "height" }, function() { return this.$e.height }, function(a) {
        var b = this.$e.height;
        b === a || isNaN(b) && isNaN(a) || (v && D.h(a, "number", O, "height"), b = this.$e, this.$e = a = (new Ca(this.$e.width, a)).freeze(), this.K(), this instanceof z && this.Te(), this.i("desiredSize", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "height")))
    });
    D.defineProperty(O, { ah: "minSize" }, function() { return this.oi }, function(a) {
        var b = this.oi;
        b.O(a) || (v && D.l(a, Ca, O, "minSize"), a = a.copy(), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), a.freeze(), this.oi = a, this.K(), this.i("minSize", b, a))
    });
    D.defineProperty(O, { pf: "maxSize" }, function() { return this.ni }, function(a) {
        var b = this.ni;
        b.O(a) || (v && D.l(a, Ca, O, "maxSize"), a = a.copy(), isNaN(a.width) && (a.width = Infinity), isNaN(a.height) && (a.height = Infinity), a.freeze(), this.ni = a, this.K(), this.i("maxSize", b, a))
    });
    D.w(O, { Fa: "measuredBounds" }, function() { return this.Fd });
    D.w(O, { Ga: "naturalBounds" }, function() { return this.fd }, { configurable: !0 });
    D.defineProperty(O, { margin: "margin" }, function() { return this.en }, function(a) {
        "number" === typeof a ? a = new Lb(a) : v && D.l(a, Lb, O, "margin");
        var b = this.en;
        b.O(a) || (this.en = a = a.V(), this.K(), this.i("margin", b, a))
    });
    D.w(O, { transform: null }, function() { 0 !== (this.S & 2048) === !0 && Uo(this); return this.Nc });
    D.w(O, { Hh: null }, function() { 0 !== (this.S & 4096) === !0 && Uo(this); return this.Ni });
    D.defineProperty(O, { alignment: "alignment" }, function() { return this.ue }, function(a) {
        var b = this.ue;
        b.O(a) || (v && D.l(a, S, O, "alignment"), a.de() && !a.ld() && D.k("GraphObject.alignment for " + this + " must be a real Spot or Spot.Default, not: " + a), this.ue = a = a.V(), Zo(this), this.i("alignment", b, a))
    });
    D.defineProperty(O, { column: "column" }, function() { return this.wr }, function(a) {
        v && D.p(a, O, "column");
        a = Math.round(a);
        var b = this.wr;
        b !== a && (0 > a && D.ua(a, ">= 0", O, "column"), this.wr = a, this.K(), this.i("column", b, a))
    });
    D.defineProperty(O, { kI: "columnSpan" }, function() { return this.Si }, function(a) {
        v && D.h(a, "number", O, "columnSpan");
        a = Math.round(a);
        var b = this.Si;
        b !== a && (1 > a && D.ua(a, ">= 1", O, "columnSpan"), this.Si = a, this.K(), this.i("columnSpan", b, a))
    });
    D.defineProperty(O, { Sb: "row" }, function() { return this.vt }, function(a) {
        v && D.p(a, O, "row");
        a = Math.round(a);
        var b = this.vt;
        b !== a && (0 > a && D.ua(a, ">= 0", O, "row"), this.vt = a, this.K(), this.i("row", b, a))
    });
    D.defineProperty(O, { rowSpan: "rowSpan" }, function() { return this.tj }, function(a) {
        v && D.h(a, "number", O, "rowSpan");
        a = Math.round(a);
        var b = this.tj;
        b !== a && (1 > a && D.ua(a, ">= 1", O, "rowSpan"), this.tj = a, this.K(), this.i("rowSpan", b, a))
    });
    D.defineProperty(O, { Vy: "spanAllocation" }, function() { return this.Lt }, function(a) {
        var b = this.Lt;
        b !== a && (null !== a && D.h(a, "function", O, "spanAllocation"), this.Lt = a, this.K(), this.i("spanAllocation", b, a))
    });
    D.defineProperty(O, { Gh: "alignmentFocus" }, function() { return this.Lm }, function(a) {
        var b = this.Lm;
        b.O(a) || (v && D.l(a, S, O, "alignmentFocus"), !a.de() || a.ld() || a.O(dc) && this instanceof G || D.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: " + a), this.Lm = a = a.V(), this.K(), this.i("alignmentFocus", b, a))
    });
    D.defineProperty(O, { yd: "portId" }, function() { return this.it }, function(a) {
        var b = this.it;
        if (b !== a) {
            v && null !== a && D.h(a, "string", O, "portId");
            var c = this.Y;
            null === c || c instanceof G || (D.k("Cannot set portID on a Link: " + a), c = null);
            null !== b && null !== c && dp(c, this);
            this.it = a;
            if (null !== a && c) {
                c.bl = !0;
                null === c.Ae && ep(c);
                var d = this.yd;
                null !== d && c.Ae.add(d, this)
            }
            this.i("portId", b, a)
        }
    });

    function fp(a) {
        var b = a.Y;
        if (b instanceof G && (null !== a.yd || a === b.port)) {
            var c = b.g;
            null === c || c.na.ub || Qo(b, a)
        }
    }

    function bp(a) {
        var b = a.g;
        null === b || b.na.ub || (a instanceof x ? a instanceof G ? a.kg() : gp(a, a, function(a) { fp(a) }) : fp(a))
    }
    D.defineProperty(O, { Hb: "toSpot" }, function() { return null !== this.Z ? this.Z.Mk : dc }, function(a) {
        this.ae();
        var b = this.Z.Mk;
        b.O(a) || (v && D.l(a, S, O, "toSpot"), a = a.V(), this.Z.Mk = a, this.i("toSpot", b, a), fp(this))
    });
    D.defineProperty(O, { Hm: "toEndSegmentLength" }, function() { return null !== this.Z ? this.Z.Kk : 10 }, function(a) {
        this.ae();
        var b = this.Z.Kk;
        b !== a && (v && D.h(a, "number", O, "toEndSegmentLength"), 0 > a && D.ua(a, ">= 0", O, "toEndSegmentLength"), this.Z.Kk = a, this.i("toEndSegmentLength", b, a), fp(this))
    });
    D.defineProperty(O, { uv: "toEndSegmentDirection" }, function() { return null !== this.Z ? this.Z.Jk : Fo }, function(a) {
        this.ae();
        var b = this.Z.Jk;
        b !== a && (D.On("GraphObject.toEndSegmentDirection", "2.0"), v && D.Da(a, G, O, "toEndSegmentDirection"), this.Z.Jk = a, this.i("toEndSegmentDirection", b, a), fp(this))
    });
    D.defineProperty(O, { vv: "toShortLength" }, function() { return null !== this.Z ? this.Z.Lk : 0 }, function(a) {
        this.ae();
        var b = this.Z.Lk;
        b !== a && (v && D.h(a, "number", O, "toShortLength"), this.Z.Lk = a, this.i("toShortLength", b, a), fp(this))
    });
    D.defineProperty(O, { nH: "toLinkable" }, function() { return null !== this.Z ? this.Z.St : null }, function(a) {
        this.ae();
        var b = this.Z.St;
        b !== a && (v && null !== a && D.h(a, "boolean", O, "toLinkable"), this.Z.St = a, this.i("toLinkable", b, a))
    });
    D.defineProperty(O, { EK: "toMaxLinks" }, function() { return null !== this.Z ? this.Z.Tt : Infinity }, function(a) {
        this.ae();
        var b = this.Z.Tt;
        b !== a && (v && D.h(a, "number", O, "toMaxLinks"), 0 > a && D.ua(a, ">= 0", O, "toMaxLinks"), this.Z.Tt = a, this.i("toMaxLinks", b, a))
    });
    D.defineProperty(O, { Gb: "fromSpot" }, function() { return null !== this.Z ? this.Z.ok : dc }, function(a) {
        this.ae();
        var b = this.Z.ok;
        b.O(a) || (v && D.l(a, S, O, "fromSpot"), a = a.V(), this.Z.ok = a, this.i("fromSpot", b, a), fp(this))
    });
    D.defineProperty(O, { rm: "fromEndSegmentLength" }, function() { return null !== this.Z ? this.Z.mk : 10 }, function(a) {
        this.ae();
        var b = this.Z.mk;
        b !== a && (v && D.h(a, "number", O, "fromEndSegmentLength"), 0 > a && D.ua(a, ">= 0", O, "fromEndSegmentLength"), this.Z.mk = a, this.i("fromEndSegmentLength", b, a), fp(this))
    });
    D.defineProperty(O, { zu: "fromEndSegmentDirection" }, function() { return null !== this.Z ? this.Z.lk : Fo }, function(a) {
        this.ae();
        var b = this.Z.lk;
        b !== a && (D.On("GraphObject.fromEndSegmentDirection", "2.0"), v && D.Da(a, G, O, "fromEndSegmentDirection"), this.Z.lk = a, this.i("fromEndSegmentDirection", b, a), fp(this))
    });
    D.defineProperty(O, { Au: "fromShortLength" }, function() { return null !== this.Z ? this.Z.nk : 0 }, function(a) {
        this.ae();
        var b = this.Z.nk;
        b !== a && (v && D.h(a, "number", O, "fromShortLength"), this.Z.nk = a, this.i("fromShortLength", b, a), fp(this))
    });
    D.defineProperty(O, { MF: "fromLinkable" }, function() { return null !== this.Z ? this.Z.as : null }, function(a) {
        this.ae();
        var b = this.Z.as;
        b !== a && (v && null !== a && D.h(a, "boolean", O, "fromLinkable"), this.Z.as = a, this.i("fromLinkable", b, a))
    });
    D.defineProperty(O, { cB: "fromMaxLinks" }, function() { return null !== this.Z ? this.Z.bs : Infinity }, function(a) {
        this.ae();
        var b = this.Z.bs;
        b !== a && (v && D.h(a, "number", O, "fromMaxLinks"), 0 > a && D.ua(a, ">= 0", O, "fromMaxLinks"), this.Z.bs = a, this.i("fromMaxLinks", b, a))
    });
    D.defineProperty(O, { cursor: "cursor" }, function() { return this.Fr }, function(a) {
        var b = this.Fr;
        b !== a && (D.h(a, "string", O, "cursor"), this.Fr = a, this.i("cursor", b, a))
    });
    D.defineProperty(O, { click: "click" }, function() { return null !== this.ma ? this.ma.Ri : null }, function(a) {
        Co(this);
        var b = this.ma.Ri;
        b !== a && (null !== a && D.h(a, "function", O, "click"), this.ma.Ri = a, this.i("click", b, a))
    });
    D.defineProperty(O, { nu: "doubleClick" }, function() { return null !== this.ma ? this.ma.Yi : null }, function(a) {
        Co(this);
        var b = this.ma.Yi;
        b !== a && (null !== a && D.h(a, "function", O, "doubleClick"), this.ma.Yi = a, this.i("doubleClick", b, a))
    });
    D.defineProperty(O, { MA: "contextClick" }, function() { return null !== this.ma ? this.ma.Ti : null }, function(a) {
        Co(this);
        var b = this.ma.Ti;
        b !== a && (null !== a && D.h(a, "function", O, "contextClick"), this.ma.Ti = a, this.i("contextClick", b, a))
    });
    D.defineProperty(O, { Yu: "mouseEnter" }, function() { return null !== this.ma ? this.ma.Rs : null }, function(a) {
        Co(this);
        var b = this.ma.Rs;
        b !== a && (null !== a && D.h(a, "function", O, "mouseEnter"), this.ma.Rs = a, this.i("mouseEnter", b, a))
    });
    D.defineProperty(O, { Zu: "mouseLeave" }, function() { return null !== this.ma ? this.ma.Ss : null }, function(a) {
        Co(this);
        var b = this.ma.Ss;
        b !== a && (null !== a && D.h(a, "function", O, "mouseLeave"), this.ma.Ss = a, this.i("mouseLeave", b, a))
    });
    D.defineProperty(O, { FB: "mouseOver" }, function() { return null !== this.ma ? this.ma.nj : null }, function(a) {
        Co(this);
        var b = this.ma.nj;
        b !== a && (null !== a && D.h(a, "function", O, "mouseOver"), this.ma.nj = a, this.i("mouseOver", b, a))
    });
    D.defineProperty(O, { EB: "mouseHover" }, function() { return null !== this.ma ? this.ma.mj : null }, function(a) {
        Co(this);
        var b = this.ma.mj;
        b !== a && (null !== a && D.h(a, "function", O, "mouseHover"), this.ma.mj = a, this.i("mouseHover", b, a))
    });
    D.defineProperty(O, { DB: "mouseHold" }, function() { return null !== this.ma ? this.ma.lj : null }, function(a) {
        Co(this);
        var b = this.ma.lj;
        b !== a && (null !== a && D.h(a, "function", O, "mouseHold"), this.ma.lj = a, this.i("mouseHold", b, a))
    });
    D.defineProperty(O, { RJ: "mouseDragEnter" }, function() { return null !== this.ma ? this.ma.Ps : null }, function(a) {
        Co(this);
        var b = this.ma.Ps;
        b !== a && (null !== a && D.h(a, "function", O, "mouseDragEnter"), this.ma.Ps = a, this.i("mouseDragEnter", b, a))
    });
    D.defineProperty(O, { SJ: "mouseDragLeave" }, function() { return null !== this.ma ? this.ma.Qs : null }, function(a) {
        Co(this);
        var b = this.ma.Qs;
        b !== a && (null !== a && D.h(a, "function", O, "mouseDragLeave"), this.ma.Qs = a, this.i("mouseDragLeave", b, a))
    });
    D.defineProperty(O, { CB: "mouseDrop" }, function() { return null !== this.ma ? this.ma.kj : null }, function(a) {
        Co(this);
        var b = this.ma.kj;
        b !== a && (null !== a && D.h(a, "function", O, "mouseDrop"), this.ma.kj = a, this.i("mouseDrop", b, a))
    });
    D.defineProperty(O, { RE: "actionDown" }, function() { return null !== this.ma ? this.ma.er : null }, function(a) {
        Co(this);
        var b = this.ma.er;
        b !== a && (null !== a && D.h(a, "function", O, "actionDown"), this.ma.er = a, this.i("actionDown", b, a))
    });
    D.defineProperty(O, { SE: "actionMove" }, function() { return null !== this.ma ? this.ma.fr : null }, function(a) {
        Co(this);
        var b = this.ma.fr;
        b !== a && (null !== a && D.h(a, "function", O, "actionMove"), this.ma.fr = a, this.i("actionMove", b, a))
    });
    D.defineProperty(O, { TE: "actionUp" }, function() { return null !== this.ma ? this.ma.gr : null }, function(a) {
        Co(this);
        var b = this.ma.gr;
        b !== a && (null !== a && D.h(a, "function", O, "actionUp"), this.ma.gr = a, this.i("actionUp", b, a))
    });
    D.defineProperty(O, { QE: "actionCancel" }, function() { return null !== this.ma ? this.ma.dr : null }, function(a) {
        Co(this);
        var b = this.ma.dr;
        b !== a && (null !== a && D.h(a, "function", O, "actionCancel"), this.ma.dr = a, this.i("actionCancel", b, a))
    });
    D.defineProperty(O, { lC: "toolTip" }, function() { return null !== this.ma ? this.ma.wj : null }, function(a) {
        Co(this);
        var b = this.ma.wj;
        b !== a && (!v || null === a || a instanceof da || a instanceof hk || D.k("GraphObject.toolTip must be an Adornment or HTMLInfo."), this.ma.wj = a, this.i("toolTip", b, a))
    });
    D.defineProperty(O, { contextMenu: "contextMenu" }, function() { return null !== this.ma ? this.ma.Ui : null }, function(a) {
        Co(this);
        var b = this.ma.Ui;
        b !== a && (!v || a instanceof da || a instanceof hk || D.k("GraphObject.contextMenu must be an Adornment or HTMLInfo."), this.ma.Ui = a, this.i("contextMenu", b, a))
    });
    O.prototype.bind = O.prototype.bind = function(a) {
        a.Sg = this;
        var b = this.qm();
        null !== b && hp(b) && D.k("Cannot add a Binding to a template that has already been copied: " + a);
        null === this.Hc && (this.Hc = new K(ph));
        this.Hc.add(a)
    };
    O.prototype.findTemplateBinder = O.prototype.qm = function() {
        for (var a = this instanceof x ? this : this.R; null !== a;) {
            if (null !== a.zl) return a;
            a = a.R
        }
        return null
    };
    O.prototype.setProperties = function(a) { D.nv(this, a) };
    var ip;
    O.make = ip = function(a, b) {
        var c = arguments,
            d = null,
            e = null;
        if ("function" === typeof a) e = a;
        else if ("string" === typeof a) { var g = jp.oa(a); "function" === typeof g ? (c = D.km(arguments), d = g(c), D.Qa(d) || D.k('GraphObject.make invoked object builder "' + a + '", but it did not return an Object')) : e = ba[a] }
        null === d && (void 0 !== e && null !== e && e.constructor || D.k("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: " + a), d = new e);
        g = 1;
        if (d instanceof E && 1 < c.length) {
            var h = d,
                e = c[1];
            if ("string" ===
                typeof e || e instanceof HTMLDivElement) Nl(h, e), g++
        }
        for (; g < c.length; g++) e = c[g], void 0 === e ? D.k("Undefined value at argument " + g + " for object being constructed by GraphObject.make: " + d) : kp(d, e);
        return d
    };

    function kp(a, b) {
        if ("string" === typeof b)
            if (a instanceof pa) a.text = b;
            else if (a instanceof z) a.Kb = b;
        else if (a instanceof Hl) a.source = b;
        else if (a instanceof x) {
            var c = Ha(x, b);
            null !== c ? a.type = c : D.k("Unknown Panel type as an argument to GraphObject.make: " + b)
        } else a instanceof Ba ? (c = Ha(Ba, b), null !== c ? a.type = c : D.k("Unknown Brush type as an argument to GraphObject.make: " + b)) : a instanceof Ve ? (c = Ha(Ve, b), null !== c ? a.type = c : D.k("Unknown Geometry type as an argument to GraphObject.make: " + b)) : a instanceof $f ?
            (c = Ha($f, b), null !== c ? a.type = c : D.k("Unknown PathSegment type as an argument to GraphObject.make: " + b)) : D.k("Unable to use a string as an argument to GraphObject.make: " + b);
        else if (b instanceof O) c = b, a instanceof x || D.k("A GraphObject can only be added to a Panel, not to: " + a), a.add(c);
        else if (b instanceof jh) {
            var d = b,
                c = a,
                e;
            d.Ke && c.getRowDefinition ? e = c.getRowDefinition(d.index) : !d.Ke && c.getColumnDefinition ? e = c.getColumnDefinition(d.index) : D.k("A RowColumnDefinition can only be added to a Panel, not to: " +
                a);
            e.gq(d)
        } else if (b instanceof ya) "function" === typeof a.qc ? a.qc(b) : D.ak(a, b);
        else if (b instanceof ph) a instanceof O ? a.bind(b) : a instanceof jh ? a.bind(b) : D.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: " + a);
        else if (b instanceof Xe) a instanceof Ve ? a.nc.add(b) : D.k("A PathFigure can only be added to a Geometry, not to: " + a);
        else if (b instanceof $f) a instanceof Xe ? a.Eb.add(b) : D.k("A PathSegment can only be added to a PathFigure, not to: " + a);
        else if (b instanceof $g) a instanceof
        E ? a.Yb = b : a instanceof I ? a.Yb = b : D.k("A Layout can only be assigned to a Diagram or a Group, not to: " + a);
        else if (Array.isArray(b))
            for (c = 0; c < b.length; c++) kp(a, b[c]);
        else if ("object" === typeof b && null !== b)
            if (a instanceof Ba) {
                e = new ma;
                for (c in b) d = parseFloat(c), isNaN(d) ? e[c] = b[c] : a.addColorStop(d, b[c]);
                D.nv(a, e)
            } else if (a instanceof jh) {
            void 0 !== b.row ? (e = b.row, (void 0 === e || null === e || Infinity === e || isNaN(e) || 0 > e) && D.k("Must specify non-negative integer row for RowColumnDefinition " + b + ", not: " + e), a.Ke = !0,
                a.index = e) : void 0 !== b.column && (e = b.column, (void 0 === e || null === e || Infinity === e || isNaN(e) || 0 > e) && D.k("Must specify non-negative integer column for RowColumnDefinition " + b + ", not: " + e), a.Ke = !1, a.index = e);
            e = new ma;
            for (c in b) "row" !== c && "column" !== c && (e[c] = b[c]);
            D.nv(a, e)
        } else D.nv(a, b);
        else D.k('Unknown initializer "' + b + '" for object being constructed by GraphObject.make: ' + a)
    }
    var jp = new oa("string", "function");
    O.getBuilders = function() {
        var a = new oa("string", "function"),
            b;
        for (b in jp)
            if (b !== b.toLowerCase()) { var c = jp.oa(b); "function" === typeof c && a.add(b, c) }
        a.freeze();
        return a
    };
    var lp;
    O.defineBuilder = lp = function(a, b) {
        D.h(a, "string", O, "defineBuilder:name");
        D.h(b, "function", O, "defineBuilder:func");
        var c = a.toLowerCase();
        "" !== a && "none" !== c && a !== c || D.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: " + a);
        jp.add(a, b)
    };
    var mp;
    O.takeBuilderArgument = mp = function(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 };
    lp("Button", function() {
        var a = new Ba(Gg);
        a.addColorStop(0, "white");
        a.addColorStop(1, "lightgray");
        var b = new Ba(Gg);
        b.addColorStop(0, "white");
        b.addColorStop(1, "dodgerblue");
        a = ip(x, Pl, {
            Hu: !0,
            CF: function(a, b) {
                var e = a.Md("ButtonBorder");
                null !== e && (e.fill = b ? a._buttonFillNormal : a._buttonFillDisabled)
            },
            _buttonFillNormal: a,
            _buttonStrokeNormal: "gray",
            _buttonFillOver: b,
            _buttonStrokeOver: "blue",
            _buttonFillDisabled: "darkgray"
        }, ip(z, {
            name: "ButtonBorder",
            Kb: "Rectangle",
            C: new S(0, 0, 2.761423749153968, 2.761423749153968),
            D: new S(1, 1, -2.761423749153968, -2.761423749153968),
            fill: a,
            stroke: "gray"
        }));
        a.Yu = function(a, b) {
            if (b.Ju()) {
                var e = b.Md("ButtonBorder");
                if (e instanceof z) {
                    var g = b._buttonFillOver;
                    b._buttonFillNormal = e.fill;
                    e.fill = g;
                    g = b._buttonStrokeOver;
                    b._buttonStrokeNormal = e.stroke;
                    e.stroke = g
                }
            }
        };
        a.Zu = function(a, b) {
            if (b.Ju()) {
                var e = b.Md("ButtonBorder");
                e instanceof z && (e.fill = b._buttonFillNormal, e.stroke = b._buttonStrokeNormal)
            }
        };
        return a
    });
    lp("TreeExpanderButton", function() {
        var a = ip("Button", { _treeExpandedFigure: "MinusLine", _treeCollapsedFigure: "PlusLine" }, ip(z, { name: "ButtonIcon", Kb: "MinusLine", Ea: Zd }, (new ph("figure", "isTreeExpanded", function(a, c) { var d = c.R; return a ? d._treeExpandedFigure : d._treeCollapsedFigure })).yy()), { visible: !1 }, (new ph("visible", "isTreeLeaf", function(a) { return !a })).yy());
        a.click = function(a, c) {
            var d = c.Y;
            d instanceof da && (d = d.If);
            if (d instanceof G) {
                var e = d.g;
                if (null !== e) {
                    e = e.yb;
                    if (d.Dc) { if (!e.canCollapseTree(d)) return } else if (!e.canExpandTree(d)) return;
                    a.Cc = !0;
                    d.Dc ? e.collapseTree(d) : e.expandTree(d)
                }
            }
        };
        return a
    });
    lp("SubGraphExpanderButton", function() {
        var a = ip("Button", { _subGraphExpandedFigure: "MinusLine", _subGraphCollapsedFigure: "PlusLine" }, ip(z, { name: "ButtonIcon", Kb: "MinusLine", Ea: Zd }, (new ph("figure", "isSubGraphExpanded", function(a, c) { var d = c.R; return a ? d._subGraphExpandedFigure : d._subGraphCollapsedFigure })).yy()));
        a.click = function(a, c) {
            var d = c.Y;
            d instanceof da && (d = d.If);
            if (d instanceof I) {
                var e = d.g;
                if (null !== e) {
                    e = e.yb;
                    if (d.md) { if (!e.canCollapseSubGraph(d)) return } else if (!e.canExpandSubGraph(d)) return;
                    a.Cc = !0;
                    d.md ? e.collapseSubGraph(d) : e.expandSubGraph(d)
                }
            }
        };
        return a
    });
    lp("ToolTip", function() {
        var a = new da(Pl),
            b = new z;
        b.name = "Border";
        b.fill = "#FFFFE0";
        b.stroke = "#CCCCCC";
        a.add(b);
        return a
    });
    lp("ContextMenu", function() { return new da(Ol) });
    lp("ContextMenuButton", function() {
        var a = ip("Button");
        a.stretch = yo;
        var b = a.Md("ButtonBorder");
        b instanceof z && (b.Kb = "Rectangle", b.C = new S(0, 0, 2, 3), b.D = new S(1, 1, -2, -2));
        return a
    });
    lp("PanelExpanderButton", function(a) {
        var b = mp(a, "COLLAPSIBLE"),
            c = ip("Button", { _buttonExpandedFigure: "TriangleUp", _buttonCollapsedFigure: "TriangleDown" }, ip(z, "TriangleUp", { name: "ButtonIcon", Ea: new Ca(6, 4) }, (new ph("figure", "visible", function(a) { return a ? c._buttonExpandedFigure : c._buttonCollapsedFigure })).yy(b)));
        a = c.Md("ButtonBorder");
        a instanceof z && (a.stroke = null, a.fill = "transparent");
        c.click = function(a, c) {
            var g = c.g;
            if (null !== g && !g.qb) {
                var h = c.qm();
                null === h && (h = c.Y);
                null !== h && (h = h.Md(b), null !== h &&
                    (g.Nb("Collapse/Expand Panel"), h.visible = !h.visible, g.jd("Collapse/Expand Panel")))
            }
        };
        return c
    });
    lp("CheckBoxButton", function(a) {
        var b = mp(a);
        a = ip("Button", { "ButtonBorder.fill": "white", "ButtonBorder.stroke": "gray", width: 14, height: 14 }, ip(z, { name: "ButtonIcon", SI: "M0 4 L3 9 9 0", lb: 2, stretch: Ye, dB: bk, visible: !1 }, "" !== b ? (new ph("visible", b)).GJ() : []));
        a.click = function(a, d) {
            var e = a.g;
            if (!(null === e || e.qb || "" !== b && e.ea.qb)) {
                a.Cc = !0;
                var g = d.Md("ButtonIcon");
                e.Nb("checkbox");
                g.visible = !g.visible;
                "function" === typeof d._doClick && d._doClick(a, d);
                e.jd("checkbox")
            }
        };
        return a
    });
    lp("CheckBox", function(a) {
        a = mp(a);
        a = ip("CheckBoxButton", a, { name: "Button", margin: new Lb(0, 1, 0, 0) });
        var b = ip(x, "Horizontal", a, { Hu: !0, margin: 1, _buttonFillNormal: a._buttonFillNormal, _buttonStrokeNormal: a._buttonStrokeNormal, _buttonFillOver: a._buttonFillOver, _buttonStrokeOver: a._buttonStrokeOver, _buttonFillDisabled: a._buttonFillDisabled, Yu: a.Yu, Zu: a.Zu, click: a.click, _buttonClick: a.click });
        a.Yu = null;
        a.Zu = null;
        a.click = null;
        return b
    });

    function Do() { this.Yr = this.Ui = this.wj = this.dr = this.gr = this.fr = this.er = this.kj = this.Qs = this.Ps = this.lj = this.mj = this.nj = this.Ss = this.Rs = this.Ti = this.Yi = this.Ri = null }
    Do.prototype.copy = function() {
        var a = new Do;
        a.Ri = this.Ri;
        a.Yi = this.Yi;
        a.Ti = this.Ti;
        a.Rs = this.Rs;
        a.Ss = this.Ss;
        a.nj = this.nj;
        a.mj = this.mj;
        a.lj = this.lj;
        a.Ps = this.Ps;
        a.Qs = this.Qs;
        a.kj = this.kj;
        a.er = this.er;
        a.fr = this.fr;
        a.gr = this.gr;
        a.dr = this.dr;
        a.wj = this.wj;
        a.Ui = this.Ui;
        a.Yr = this.Yr;
        return a
    };

    function x(a) {
        O.call(this);
        void 0 === a ? this.da = ek : (D.Da(a, x, x, "type"), this.da = a);
        this.xa = new K(O);
        this.tf = Sd;
        this.da === Sl && (this.Yn = !0);
        this.Jr = Vc;
        this.Xi = wo;
        this.da === fa && np(this);
        this.Wp = bk;
        this.js = ae;
        this.ks = Kd;
        this.fs = 0;
        this.es = 100;
        this.hs = 10;
        this.gs = 0;
        this.zl = this.Sd = this.pk = this.Tm = this.Vm = null;
        this.xs = NaN;
        this.Ig = this.ej = null;
        this.op = "category";
        this.Hg = null;
        this.yj = new C(NaN, NaN, NaN, NaN);
        this.Ik = this.wt = this.Xl = null;
        this.dk = ""
    }
    D.Ta(x, O);
    D.Di(x);
    D.ka("Panel", x);

    function np(a) {
        a.hk = Sd;
        a.fi = 1;
        a.Wi = null;
        a.Rm = null;
        a.ei = 1;
        a.di = null;
        a.Qm = null;
        a.hd = [];
        a.cd = [];
        a.pn = op;
        a.Pm = op;
        a.xj = 0;
        a.hj = 0
    }
    x.prototype.cloneProtected = function(a) {
        O.prototype.cloneProtected.call(this, a);
        a.da = this.da;
        a.tf = this.tf.V();
        a.Jr = this.Jr.V();
        a.Xi = this.Xi;
        if (a.da === fa) {
            a.hk = this.hk.V();
            a.fi = this.fi;
            a.Wi = this.Wi;
            a.Rm = this.Rm;
            a.ei = this.ei;
            a.di = this.di;
            a.Qm = this.Qm;
            var b = [];
            if (0 < this.hd.length)
                for (var c = this.hd, d = c.length, e = 0; e < d; e++)
                    if (void 0 !== c[e]) {
                        var g = c[e].copy();
                        g.Bm(a);
                        b[e] = g
                    }
            a.hd = b;
            b = [];
            if (0 < this.cd.length)
                for (c = this.cd, d = c.length, e = 0; e < d; e++) void 0 !== c[e] && (g = c[e].copy(), g.Bm(a), b[e] = g);
            a.cd = b;
            a.pn = this.pn;
            a.Pm = this.Pm;
            a.xj = this.xj;
            a.hj = this.hj
        }
        a.Wp = this.Wp;
        a.js = this.js.V();
        a.ks = this.ks.V();
        a.fs = this.fs;
        a.es = this.es;
        a.hs = this.hs;
        a.gs = this.gs;
        a.Vm = this.Vm;
        a.pk = this.pk;
        a.Sd = this.Sd;
        a.zl = this.zl;
        a.xs = this.xs;
        a.ej = this.ej;
        a.Ig = this.Ig;
        a.op = this.op;
        a.yj.assign(this.yj);
        a.dk = this.dk;
        null !== this.wt && (a.wt = this.wt)
    };
    x.prototype.Ei = function(a) {
        O.prototype.Ei.call(this, a);
        a.xa = this.xa;
        for (var b = a.xa.o, c = b.length, d = 0; d < c; d++) b[d].rj = a;
        a.Xl = null
    };
    x.prototype.copy = function() {
        var a = O.prototype.copy.call(this);
        if (null !== a) {
            for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) {
                var e = b[d].copy(),
                    g = a;
                e.Bm(g);
                e.mn = null;
                var h = g.xa,
                    k = h.count;
                h.be(k, e);
                h = g.Y;
                if (null !== h) {
                    h.Sl = null;
                    null !== e.yd && h instanceof G && (h.bl = !0);
                    var l = g.g;
                    null !== l && l.na.ub || h.od(hg, "elements", g, null, e, null, k)
                }
            }
            return a
        }
        return null
    };
    x.prototype.qc = function(a) { a.Qe === x ? this.type = a : O.prototype.qc.call(this, a) };
    x.prototype.toString = function() { return "Panel(" + this.type + ")#" + D.Nd(this) };
    var ek;
    x.Position = ek = D.s(x, "Position", 0);
    x.Horizontal = D.s(x, "Horizontal", 1);
    var Ol;
    x.Vertical = Ol = D.s(x, "Vertical", 2);
    var Xj;
    x.Spot = Xj = D.s(x, "Spot", 3);
    var Pl;
    x.Auto = Pl = D.s(x, "Auto", 4);
    var fa;
    x.Table = fa = D.s(x, "Table", 5);
    x.Viewbox = D.s(x, "Viewbox", 6);
    var Ro;
    x.TableRow = Ro = D.s(x, "TableRow", 7);
    var So;
    x.TableColumn = So = D.s(x, "TableColumn", 8);
    var sj;
    x.Link = sj = D.s(x, "Link", 9);
    var Sl;
    x.Grid = Sl = D.s(x, "Grid", 10);
    var pp;
    x.Graduated = pp = D.s(x, "Graduated", 11);
    D.defineProperty(x, { type: "type" }, function() { return this.da }, function(a) {
        var b = this.da;
        b !== a && (v && D.Da(a, x, x, "type"), b !== Ro && b !== So || D.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: " + a), this.da = a, this.da === Sl ? this.Yn = !0 : this.da === fa && np(this), this.K(), this.i("type", b, a))
    });
    D.w(x, { elements: "elements" }, function() { return this.xa.j });
    D.w(x, { Ga: "naturalBounds" }, function() { return this.fd });
    D.defineProperty(x, { padding: "padding" }, function() { return this.tf }, function(a) {
        "number" === typeof a ? (0 > a && D.ua(a, ">= 0", x, "padding"), a = new Lb(a)) : (D.l(a, Lb, x, "padding"), 0 > a.left && D.ua(a.left, ">= 0", x, "padding:value.left"), 0 > a.right && D.ua(a.right, ">= 0", x, "padding:value.right"), 0 > a.top && D.ua(a.top, ">= 0", x, "padding:value.top"), 0 > a.bottom && D.ua(a.bottom, ">= 0", x, "padding:value.bottom"));
        var b = this.tf;
        b.O(a) || (this.tf = a = a.V(), this.K(), this.i("padding", b, a))
    });
    D.defineProperty(x, { om: "defaultAlignment" }, function() { return this.Jr }, function(a) {
        var b = this.Jr;
        b.O(a) || (v && D.l(a, S, x, "defaultAlignment"), this.Jr = a = a.V(), this.K(), this.i("defaultAlignment", b, a))
    });
    D.defineProperty(x, { le: "defaultStretch" }, function() { return this.Xi }, function(a) {
        var b = this.Xi;
        b !== a && (D.Da(a, O, x, "defaultStretch"), this.Xi = a, this.K(), this.i("defaultStretch", b, a))
    });
    D.defineProperty(x, { FL: "defaultSeparatorPadding" }, function() { return void 0 === this.hk ? Sd : this.hk }, function(a) {
        if (void 0 !== this.hk) {
            "number" === typeof a ? a = new Lb(a) : v && D.l(a, Lb, x, "defaultSeparatorPadding");
            var b = this.hk;
            b.O(a) || (this.hk = a = a.V(), this.K(), this.i("defaultSeparatorPadding", b, a))
        }
    });
    D.defineProperty(x, { DL: "defaultRowSeparatorStroke" }, function() { return void 0 === this.Wi ? null : this.Wi }, function(a) {
        var b = this.Wi;
        b !== a && (null === a || "string" === typeof a || a instanceof Ba) && (a instanceof Ba && a.freeze(), this.Wi = a, this.ra(), this.i("defaultRowSeparatorStroke", b, a))
    });
    D.defineProperty(x, { EL: "defaultRowSeparatorStrokeWidth" }, function() { return void 0 === this.fi ? 1 : this.fi }, function(a) {
        if (void 0 !== this.fi) {
            var b = this.fi;
            b !== a && isFinite(a) && 0 <= a && (this.fi = a, this.K(), this.i("defaultRowSeparatorStrokeWidth", b, a))
        }
    });
    D.defineProperty(x, { CL: "defaultRowSeparatorDashArray" }, function() { return void 0 === this.Rm ? null : this.Rm }, function(a) {
        if (void 0 !== this.Rm) {
            var b = this.Rm;
            if (b !== a) {
                null === a || Array.isArray(a) || D.kc(a, "Array", x, "defaultRowSeparatorDashArray:value");
                if (null !== a) {
                    for (var c = a.length, d = 0, e = 0; e < c; e++) {
                        var g = a[e];
                        "number" === typeof g && 0 <= g && isFinite(g) || D.k("defaultRowSeparatorDashArray value " + g + " at index " + e + " must be a positive number or zero.");
                        d += g
                    }
                    if (0 === d) {
                        if (null === b) return;
                        a = null
                    }
                }
                this.Rm = a;
                this.ra();
                this.i("defaultRowSeparatorDashArray", b, a)
            }
        }
    });
    D.defineProperty(x, { xL: "defaultColumnSeparatorStroke" }, function() { return void 0 === this.di ? null : this.di }, function(a) {
        if (void 0 !== this.di) {
            var b = this.di;
            b !== a && (null === a || "string" === typeof a || a instanceof Ba) && (a instanceof Ba && a.freeze(), this.di = a, this.ra(), this.i("defaultColumnSeparatorStroke", b, a))
        }
    });
    D.defineProperty(x, { yL: "defaultColumnSeparatorStrokeWidth" }, function() { return void 0 === this.ei ? 1 : this.ei }, function(a) {
        if (void 0 !== this.ei) {
            var b = this.ei;
            b !== a && isFinite(a) && 0 <= a && (this.ei = a, this.K(), this.i("defaultColumnSeparatorStrokeWidth", b, a))
        }
    });
    D.defineProperty(x, { wL: "defaultColumnSeparatorDashArray" }, function() { return void 0 === this.Qm ? null : this.Qm }, function(a) {
        if (void 0 !== this.Qm) {
            var b = this.Qm;
            if (b !== a) {
                null === a || Array.isArray(a) || D.kc(a, "Array", x, "defaultColumnSeparatorDashArray:value");
                if (null !== a) {
                    for (var c = a.length, d = 0, e = 0; e < c; e++) {
                        var g = a[e];
                        "number" === typeof g && 0 <= g && isFinite(g) || D.k("defaultColumnSeparatorDashArray value " + g + " at index " + e + " must be a positive number or zero.");
                        d += g
                    }
                    if (0 === d) {
                        if (null === b) return;
                        a = null
                    }
                }
                this.Qm =
                    a;
                this.ra();
                this.i("defaultColumnSeparatorDashArray", b, a)
            }
        }
    });
    D.defineProperty(x, { SM: "viewboxStretch" }, function() { return this.Wp }, function(a) {
        var b = this.Wp;
        b !== a && (D.Da(a, O, x, "viewboxStretch"), this.Wp = a, this.K(), this.i("viewboxStretch", b, a))
    });
    D.defineProperty(x, { ay: "gridCellSize" }, function() { return this.js }, function(a) {
        var b = this.js;
        if (!b.O(a)) {
            D.l(a, Ca, x, "gridCellSize");
            a.H() && 0 !== a.width && 0 !== a.height || D.k("Invalid Panel.gridCellSize: " + a);
            this.js = a.V();
            var c = this.g;
            null !== c && this === c.Vn && lm(c);
            this.ra();
            this.i("gridCellSize", b, a)
        }
    });
    D.defineProperty(x, { WF: "gridOrigin" }, function() { return this.ks }, function(a) {
        var b = this.ks;
        if (!b.O(a)) {
            D.l(a, N, x, "gridOrigin");
            a.H() || D.k("Invalid Panel.gridOrigin: " + a);
            this.ks = a.V();
            var c = this.g;
            null !== c && this === c.Vn && lm(c);
            this.ra();
            this.i("gridOrigin", b, a)
        }
    });
    D.defineProperty(x, { al: "graduatedMin" }, function() { return this.fs }, function(a) {
        D.p(a, x, "graduatedMin");
        var b = this.fs;
        b !== a && (this.fs = a, this.K(), this.i("graduatedMin", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "graduatedRange")))
    });
    D.defineProperty(x, { gB: "graduatedMax" }, function() { return this.es }, function(a) {
        D.p(a, x, "graduatedMax");
        var b = this.es;
        b !== a && (this.es = a, this.K(), this.i("graduatedMax", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "graduatedRange")))
    });
    D.w(x, { Du: "graduatedRange" }, function() { return this.gB - this.al });
    D.defineProperty(x, { hB: "graduatedTickUnit" }, function() { return this.hs }, function(a) {
        D.p(a, x, "graduatedTickUnit");
        var b = this.hs;
        b !== a && 0 < a && (this.hs = a, this.K(), this.i("graduatedTickUnit", b, a))
    });
    D.defineProperty(x, { VF: "graduatedTickBase" }, function() { return this.gs }, function(a) {
        D.p(a, x, "graduatedTickBase");
        var b = this.gs;
        b !== a && (this.gs = a, this.K(), this.i("graduatedTickBase", b, a))
    });
    f = x.prototype;
    f.$s = function(a) { O.prototype.$s.call(this, a); for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) b[d].$s(a) };
    f.Wk = function(a, b) {
        if (this.da === Sl) {
            var c = this.Jj() * b.scale;
            0 >= c && (c = 1);
            var d = this.ay,
                e = d.width,
                d = d.height,
                g = this.Ga,
                h = g.width,
                g = g.height,
                k = Math.ceil(h / e),
                l = Math.ceil(g / d),
                m = this.WF;
            a.save();
            a.beginPath();
            a.rect(0, 0, h, g);
            a.clip();
            for (var n = [], p = this.xa.o, q = p.length, r = 0; r < q; r++) {
                var s = p[r],
                    u = [];
                n.push(u);
                if (s.visible)
                    for (var s = hn(s.Kb), t = r + 1; t < q; t++) {
                        var y = p[t];
                        y.visible && hn(y.Kb) === s && (y = y.interval, 2 <= y && u.push(y))
                    }
            }
            p = this.xa.o;
            q = p.length;
            for (r = 0; r < q; r++) {
                var w = p[r];
                if (w.visible && (u = w.interval, !(2 >
                        e * u * c))) {
                    s = w.opacity;
                    t = 1;
                    if (1 !== s) {
                        if (0 === s) continue;
                        t = a.globalAlpha;
                        a.globalAlpha = t * s
                    }
                    var y = n[r],
                        A = !1,
                        B = !0,
                        P = w.jH;
                    null !== P && (A = !0, B = a.YA(P, w.Hf));
                    if ("LineV" === w.Kb && null !== w.stroke) {
                        a.lineWidth = w.lb;
                        Vo(this, a, w.stroke, !1, !1);
                        a.beginPath();
                        for (var H = Math.floor(-m.x / e), R = H; R <= H + k; R++) {
                            var aa = R * e + m.x;
                            0 <= aa && aa <= h && qp(R, u, y) && (A && !B ? Go(a, aa, 0, aa, g, P, w.Hf) : (a.moveTo(aa, 0), a.lineTo(aa, g)))
                        }
                        a.stroke()
                    } else if ("LineH" === w.Kb && null !== w.stroke) {
                        a.lineWidth = w.lb;
                        Vo(this, a, w.stroke, !1, !1);
                        a.beginPath();
                        for (R =
                            H = Math.floor(-m.y / d); R <= H + l; R++) aa = R * d + m.y, 0 <= aa && aa <= g && qp(R, u, y) && (A && !B ? Go(a, 0, aa, h, aa, P, w.Hf) : (a.moveTo(0, aa), a.lineTo(h, aa)));
                        a.stroke()
                    } else if ("BarV" === w.Kb && null !== w.fill)
                        for (Vo(this, a, w.fill, !0, !1), w = w.width, isNaN(w) && (w = e), R = H = Math.floor(-m.x / e); R <= H + k; R++) aa = R * e + m.x, 0 <= aa && aa <= h && qp(R, u, y) && a.fillRect(aa, 0, w, g);
                    else if ("BarH" === w.Kb && null !== w.fill)
                        for (Vo(this, a, w.fill, !0, !1), w = w.height, isNaN(w) && (w = d), R = H = Math.floor(-m.y / d); R <= H + l; R++) aa = R * d + m.y, 0 <= aa && aa <= g && qp(R, u, y) && a.fillRect(0, aa,
                            h, w);
                    A && a.TA();
                    1 !== s && (a.globalAlpha = t)
                }
            }
            a.restore();
            a.De(!1)
        } else if (this.da === pp) {
            e = this.Ga;
            c = e.width;
            e = e.height;
            a.save();
            a.beginPath();
            a.rect(-1, -1, c + 1, e + 1);
            a.clip();
            c = this.Ld();
            c.He(a, b);
            e = this.Jj() * b.scale;
            0 >= e && (e = 1);
            d = c.aa;
            h = this.xa.o;
            g = this.Vm;
            k = h.length;
            for (l = 0; l < k; l++)
                if (q = h[l], m = g[l], n = m.length, q.visible && q !== c && 0 !== m.length)
                    if (q instanceof z) {
                        if (!(2 > this.hB * q.interval * c.vf.vu / this.Du * e))
                            for (r = q.Fa, u = q.lb * q.scale, s = q.Gh, s.de() && (s = jc), p = 0; p < n; p++) t = q, y = m[p][0], A = d, H = m[p][1], R = r, w = u, B = s,
                                P = t.Nc, P.reset(), P.translate(y.x + A.x, y.y + A.y), P.rotate(H + t.angle, 0, 0), P.translate(-R.width * B.x + B.offsetX + w / 2, -R.height * B.y + B.offsetY + w / 2), P.scale(t.scale, t.scale), Xo(t, !1), t.Ni.set(t.Nc), t.Xo = t.scale, Yo(t, !1), q.He(a, b), q.Nc.reset()
                    } else if (q instanceof pa)
                for (null === this.Ik && (this.Ik = new pa), r = this.Ik, rp(q, r), p = 0; p < n; p++) y = m[p], 3 < y.length && (s = y[6], r.Yd = y[2], r.wg = y[3], r.xe = y[4], r.sf = y[5], r.fd = y[8], r.rc(s.x, s.y, s.width, s.height), q = r, u = d, t = y[7], y = y[8], A = q.Nc, A.reset(), A.translate(s.x + u.x, s.y + u.y), A.translate(-t.x, -t.y), Ko(q, A, y.x, y.y, y.width, y.height), Xo(q, !1), q.Ni.set(q.Nc), q.Xo = q.scale, Yo(q, !1), r.He(a, b));
            a.restore();
            a.De(!0)
        } else {
            this.da === fa && (a.lineCap = "butt", sp(this, a, !0, this.hd, !0), sp(this, a, !1, this.cd, !0), tp(this, a, !0, this.hd), tp(this, a, !1, this.cd), sp(this, a, !0, this.hd, !1), sp(this, a, !1, this.cd, !1));
            if (c = this.yq) a.save(), v && this.type !== Xj && D.trace("Warning: Panel.isClipping set on non-Spot Panel: " + this.toString());
            e = this.Ld();
            d = this.xa.o;
            h = d.length;
            for (g = 0; g < h; g++) k = d[g], c && k === e && (a.eq = !0), k.He(a,
                b), c && k === e && (a.eq = !1);
            c && (a.restore(), a.De(!0));
            v && v.JI && this instanceof J && v.II(a, b, this)
        }
    };

    function rp(a, b) {
        b.S = a.S | 6144;
        b.Lc = a.Lc;
        b.Mb = a.Mb;
        b.lc = a.lc;
        b.$e = a.$e.V();
        b.oi = a.oi.V();
        b.ni = a.ni.V();
        b.ij = a.ij.copy();
        b.Db = a.Db;
        b.wg = a.wg;
        b.Qg = a.Qg;
        b.en = a.en.V();
        b.ue = a.ue.V();
        b.Lm = a.Lm.V();
        b.qn = a.qn;
        b.rn = a.rn.V();
        b.sn = a.sn;
        null !== a.yg && (b.yg = a.yg.copy());
        b.wn = a.wn;
        a instanceof pa && (b.Yd = a.Yd, b.Bc = a.Bc, b.Bg = a.Bg, b.Yl = a.Yl, b.Ag = a.Ag, b.bm = a.bm, b.Ym = a.Ym, b.vk = a.vk, b.tk = a.tk, b.pj = a.pj, b.Aj = a.Aj, b.sf.kk = null, b.vi = a.vi, b.wi = a.wi, b.wh = a.wh, b.rp = a.rp, b.Fg = a.Fg, b.Eg = a.Eg, b.Dg = a.Dg, b.Um = a.Um)
    }

    function tp(a, b, c, d) {
        for (var e = d.length, g = a.aa, h = !0, k = 0; k < e; k++) {
            var l = d[k];
            if (void 0 !== l)
                if (h) h = !1;
                else if (0 !== l.hb) {
                if (c) { if (l.position > g.height) continue } else if (l.position > g.width) continue;
                var m = l.Wq;
                isNaN(m) && (m = c ? a.fi : a.ei);
                var n = l.Vq;
                null === n && (n = c ? a.Wi : a.di);
                0 !== m && null !== n && (Vo(a, b, n, !1, !1), b.beginPath(), n = l.position + m, c ? n > g.height && (m -= n - g.height) : n > g.width && (m -= n - g.width), l = l.position + m / 2, b.lineWidth = m, n = a.padding, c ? (l += n.top, m = n.left, n = g.width - n.right, b.moveTo(m, l), b.lineTo(n, l)) : (l += n.left,
                    m = n.top, n = g.height - n.bottom, b.moveTo(l, m), b.lineTo(l, n)), b.stroke())
            }
        }
    }

    function sp(a, b, c, d, e) {
        for (var g = d.length, h = a.aa, k = 0; k < g; k++) {
            var l = d[k];
            if (void 0 !== l && null !== l.background && l.RA !== e && 0 !== l.hb) {
                var m = c ? h.height : h.width;
                if (!(l.position > m)) {
                    var n = l.hf(),
                        p = l.Wq;
                    isNaN(p) && (p = c ? a.fi : a.ei);
                    var q = l.Vq;
                    null === q && (q = c ? a.Wi : a.di);
                    null === q && (p = 0);
                    n -= p;
                    p = l.position + p;
                    n += l.hb;
                    p + n > m && (n = m - p);
                    0 >= n || (m = a.padding, Vo(a, b, l.background, !0, !1), c ? b.fillRect(m.left, p + m.top, h.width - (m.left + m.right), n) : b.fillRect(p + m.left, m.top, n, h.height - (m.top + m.bottom)))
                }
            }
        }
    }

    function qp(a, b, c) {
        if (0 !== a % b) return !1;
        b = c.length;
        for (var d = 0; d < b; d++)
            if (0 === a % c[d]) return !1;
        return !0
    }

    function hn(a) { return "LineV" === a || "BarV" === a }
    f.Tn = function(a, b, c, d, e) {
        var g = this.kh(),
            h = this.transform,
            k = 1 / (h.m11 * h.m22 - h.m12 * h.m21),
            l = h.m22 * k,
            m = -h.m12 * k,
            n = -h.m21 * k,
            p = h.m11 * k,
            q = k * (h.m21 * h.dy - h.m22 * h.dx),
            r = k * (h.m12 * h.dx - h.m11 * h.dy);
        if (null !== this.gm) return h = this.aa, Je(h.left, h.top, h.right, h.bottom, a, b, c, d, e);
        if (null !== this.background) g = a * l + b * n + q, k = a * m + b * p + r, a = c * l + d * n + q, l = c * m + d * p + r, e.n(0, 0), c = this.Ga, c = Je(0, 0, c.width, c.height, g, k, a, l, e), e.transform(h);
        else {
            g || (l = 1, n = m = 0, p = 1, r = q = 0);
            k = a * l + b * n + q;
            a = a * m + b * p + r;
            l = c * l + d * n + q;
            d = c * m + d * p + r;
            e.n(l, d);
            m = (l -
                k) * (l - k) + (d - a) * (d - a);
            c = !1;
            p = this.xa.o;
            r = p.length;
            n = D.P();
            q = null;
            b = Infinity;
            var s = null;
            this.yq && (s = D.P(), q = this.Ld(), (c = q.Tn(k, a, l, d, s)) && (b = (k - s.x) * (k - s.x) + (a - s.y) * (a - s.y)));
            for (var u = 0; u < r; u++) {
                var t = p[u];
                t.visible && t !== q && t.Tn(k, a, l, d, n) && (c = !0, t = (k - n.x) * (k - n.x) + (a - n.y) * (a - n.y), t < m && (m = t, e.set(n)))
            }
            this.yq && (b > m && e.set(s), D.A(s));
            D.A(n);
            g && e.transform(h)
        }
        return c
    };
    f.K = function(a) {
        O.prototype.K.call(this, a);
        a = null;
        if (this.da === Pl || this.da === sj) a = this.Ld();
        for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) {
            var e = b[d];
            (e === a || e.Ue) && e.K(!0);
            if (!e.Ea.H()) {
                var g = Mo(e, !1);
                (e instanceof Yj || e instanceof x || e instanceof pa || g !== Zj) && e.K(!0)
            }
        }
    };
    f.xq = function() {
        if (!1 === Nm(this)) {
            km(this, !0);
            No(this, !0);
            for (var a = this.xa.o, b = a.length, c = 0; c < b; c++) a[c].xq()
        }
    };
    f.cj = function() {
        if (0 !== (this.S & 2048) === !1) {
            Xo(this, !0);
            Yo(this, !0);
            for (var a = this.xa.o, b = a.length, c = 0; c < b; c++) a[c].nB()
        }
    };
    f.nB = function() { Yo(this, !0); for (var a = this.xa.o, b = a.length, c = 0; c < b; c++) a[c].nB() };
    f.ho = function(a, b, c, d) {
        var e = this.yj;
        e.width = 0;
        e.height = 0;
        var g = this.Ea,
            h = this.ah;
        void 0 === c && (c = h.width, d = h.height);
        c = Math.max(c, h.width);
        d = Math.max(d, h.height);
        var k = this.pf;
        isNaN(g.width) || (a = Math.min(g.width, k.width));
        isNaN(g.height) || (b = Math.min(g.height, k.height));
        a = Math.max(c, a);
        b = Math.max(d, b);
        var l = this.padding;
        a = Math.max(a - l.left - l.right, 0);
        b = Math.max(b - l.top - l.bottom, 0);
        var m = this.xa.o;
        if (0 !== m.length) {
            var n = this.da.$b;
            switch (n) {
                case "Position":
                    var p = a,
                        q = b,
                        r = c,
                        s = d,
                        u = m.length;
                    e.x = 0;
                    e.y =
                        0;
                    e.width = 0;
                    e.height = 0;
                    for (var t = Rp(this), y = 0; y < u; y++) {
                        var w = m[y];
                        if (w.visible || w === t) {
                            var A = w.margin,
                                B = A.right + A.left,
                                P = A.top + A.bottom;
                            Hk(w, p, q, r, s);
                            var H = w.Fa,
                                R = Math.max(H.width + B, 0),
                                aa = Math.max(H.height + P, 0),
                                V = w.position.x,
                                ea = w.position.y;
                            isFinite(V) || (V = 0);
                            isFinite(ea) || (ea = 0);
                            if (w instanceof z) {
                                var la = w;
                                if (la.hG) var Da = la.lb / 2,
                                    V = V - Da,
                                    ea = ea - Da
                            }
                            Ub(e, V, ea, R, aa)
                        }
                    }
                    break;
                case "Vertical":
                    for (var La = a, gb = c, Aa = m.length, W = D.mb(), xb = Rp(this), Pb = 0; Pb < Aa; Pb++) {
                        var Sa = m[Pb];
                        if (Sa.visible || Sa === xb) {
                            var Qc =
                                Mo(Sa, !1);
                            if (Qc !== Zj && Qc !== xo) W.push(Sa);
                            else {
                                var Ra = Sa.margin,
                                    jg = Ra.right + Ra.left,
                                    kg = Ra.top + Ra.bottom;
                                Hk(Sa, La, Infinity, gb, 0);
                                var vd = Sa.Fa,
                                    wd = Math.max(vd.width + jg, 0),
                                    Rc = Math.max(vd.height + kg, 0);
                                e.width = Math.max(e.width, wd);
                                e.height += Rc
                            }
                        }
                    }
                    var uh = W.length;
                    if (0 !== uh) {
                        this.Ea.width ? La = Math.min(this.Ea.width, this.pf.width) : 0 !== e.width && (La = Math.min(e.width, this.pf.width));
                        for (Pb = 0; Pb < uh; Pb++)
                            if (Sa = W[Pb], Sa.visible || Sa === xb) Ra = Sa.margin, jg = Ra.right + Ra.left, kg = Ra.top + Ra.bottom, Hk(Sa, La, Infinity, gb, 0), vd =
                                Sa.Fa, wd = Math.max(vd.width + jg, 0), Rc = Math.max(vd.height + kg, 0), e.width = Math.max(e.width, wd), e.height += Rc;
                        D.ya(W)
                    }
                    break;
                case "Horizontal":
                    for (var $e = b, hb = d, ub = m.length, sa = D.mb(), na = Rp(this), ab = 0; ab < ub; ab++) {
                        var Oa = m[ab];
                        if (Oa.visible || Oa === na) {
                            var pb = Mo(Oa, !1);
                            if (pb !== Zj && pb !== yo) sa.push(Oa);
                            else {
                                var Md = Oa.margin,
                                    Jf = Md.right + Md.left,
                                    se = Md.top + Md.bottom;
                                Hk(Oa, Infinity, $e, 0, hb);
                                var be = Oa.Fa,
                                    jd = Math.max(be.width + Jf, 0),
                                    vh = Math.max(be.height + se, 0);
                                e.width += jd;
                                e.height = Math.max(e.height, vh)
                            }
                        }
                    }
                    var Kf = sa.length;
                    if (0 !== Kf) {
                        this.Ea.height ? $e = Math.min(this.Ea.height, this.pf.height) : 0 !== e.height && ($e = Math.min(e.height, this.pf.height));
                        for (ab = 0; ab < Kf; ab++)
                            if (Oa = sa[ab], Oa.visible || Oa === na) Md = Oa.margin, Jf = Md.right + Md.left, se = Md.top + Md.bottom, Hk(Oa, Infinity, $e, 0, hb), be = Oa.Fa, jd = Math.max(be.width + Jf, 0), vh = Math.max(be.height + se, 0), e.width += jd, e.height = Math.max(e.height, vh);
                        D.ya(sa)
                    }
                    break;
                case "Spot":
                    a: {
                        var Ig = a,
                            Hb = b,
                            oc = c,
                            xd = d,
                            wh = m.length,
                            qb = this.Ld(),
                            Pa = qb.margin,
                            Qb = 0,
                            Lf = 0,
                            Jg = Pa.right + Pa.left,
                            xh = Pa.top + Pa.bottom;
                        Hk(qb, Ig, Hb, oc, xd);
                        for (var ib = qb.Fa, zc = ib.width, $b = ib.height, te = Math.max(zc + Jg, 0), Ac = Math.max($b + xh, 0), Bc = this.yq, vb = D.vg(-Pa.left, -Pa.top, te, Ac), pc = !0, yb = Rp(this), Fc = 0; Fc < wh; Fc++) {
                            var db = m[Fc];
                            if (db !== qb && (db.visible || db === yb)) {
                                Pa = db.margin;
                                Qb = Pa.right + Pa.left;
                                Lf = Pa.top + Pa.bottom;
                                Hk(db, Ig, Hb, 0, 0);
                                var ib = db.Fa,
                                    te = Math.max(ib.width + Qb, 0),
                                    Ac = Math.max(ib.height + Lf, 0),
                                    Ta = db.alignment;
                                Ta.ld() && (Ta = this.om);
                                Ta.Xc() || (Ta = mc);
                                var Mb = db.Gh;
                                Mb.ld() && (Mb = mc);
                                var yd = null;
                                db instanceof x && "" !== db.dk && (db.rc(0,
                                    0, ib.width, ib.height), yd = db.Md(db.dk), yd === db && (yd = null));
                                var lg, af;
                                if (null !== yd) {
                                    for (var bf = yd.Ga, wj = yd.margin, Rb = D.Fb(Mb.x * bf.width + Mb.offsetX - wj.left, Mb.y * bf.height + Mb.offsetY - wj.top); yd !== db;) yd.transform.vb(Rb), yd = yd.R;
                                    lg = Ta.x * zc + Ta.offsetX - Rb.x;
                                    af = Ta.y * $b + Ta.offsetY - Rb.y;
                                    D.A(Rb)
                                } else lg = Ta.x * zc + Ta.offsetX - (Mb.x * ib.width - Mb.offsetX) - Pa.left, af = Ta.y * $b + Ta.offsetY - (Mb.y * ib.height - Mb.offsetY) - Pa.top;
                                pc ? (pc = !1, e.x = lg, e.y = af, e.width = te, e.height = Ac) : Ub(e, lg, af, te, Ac)
                            }
                        }
                        pc ? e.assign(vb) : Bc ? e.bG(vb.x,
                            vb.y, vb.width, vb.height) : Ub(e, vb.x, vb.y, vb.width, vb.height);D.Lb(vb);
                        var qc = qb.stretch;qc === wo && (qc = Mo(qb, !1));
                        switch (qc) {
                            case Zj:
                                break a;
                            case Ye:
                                if (!isFinite(Ig) && !isFinite(Hb)) break a;
                                break;
                            case yo:
                                if (!isFinite(Ig)) break a;
                                break;
                            case xo:
                                if (!isFinite(Hb)) break a
                        }
                        ib = qb.Fa;zc = ib.width;$b = ib.height;te = Math.max(zc + Jg, 0);Ac = Math.max($b + xh, 0);Pa = qb.margin;vb = D.vg(-Pa.left, -Pa.top, te, Ac);
                        for (Fc = 0; Fc < wh; Fc++) db = m[Fc],
                        db === qb || !db.visible && db !== yb || (Pa = db.margin, Qb = Pa.right + Pa.left, Lf = Pa.top + Pa.bottom, ib =
                            db.Fa, te = Math.max(ib.width + Qb, 0), Ac = Math.max(ib.height + Lf, 0), Ta = db.alignment, Ta.ld() && (Ta = this.om), Ta.Xc() || (Ta = mc), Mb = db.Gh, Mb.ld() && (Mb = mc), pc ? (pc = !1, e.x = Ta.x * zc + Ta.offsetX - (Mb.x * ib.width - Mb.offsetX) - Pa.left, e.y = Ta.y * $b + Ta.offsetY - (Mb.y * ib.height - Mb.offsetY) - Pa.top, e.width = te, e.height = Ac) : Ub(e, Ta.x * zc + Ta.offsetX - (Mb.x * ib.width - Mb.offsetX) - Pa.left, Ta.y * $b + Ta.offsetY - (Mb.y * ib.height - Mb.offsetY) - Pa.top, te, Ac));pc ? e.assign(vb) : Bc ? e.bG(vb.x, vb.y, vb.width, vb.height) : Ub(e, vb.x, vb.y, vb.width, vb.height);
                        D.Lb(vb)
                    }
                    break;
                case "Auto":
                    var fc = a,
                        kd = b,
                        mb = c,
                        Sb = d,
                        ue = m.length,
                        zb = this.Ld(),
                        ce = zb.margin,
                        yh = fc,
                        zh = kd,
                        Kg = ce.right + ce.left,
                        ld = ce.top + ce.bottom;
                    Hk(zb, fc, kd, mb, Sb);
                    var Nd = zb.Fa,
                        gc = 0,
                        Ab = null;
                    zb instanceof z && (Ab = zb, gc = Ab.lb * Ab.scale);
                    var zd = Math.max(Nd.width + Kg, 0),
                        nb = Math.max(Nd.height + ld, 0),
                        hc = Sp(zb),
                        ii = hc.x * zd + hc.offsetX,
                        ad = hc.y * nb + hc.offsetY,
                        Ib = Tp(zb),
                        ve = Ib.x * zd + Ib.offsetX,
                        cf = Ib.y * nb + Ib.offsetY;
                    isFinite(fc) && (yh = Math.max(Math.abs(ii - ve) - gc, 0));
                    isFinite(kd) && (zh = Math.max(Math.abs(ad - cf) - gc, 0));
                    var bd =
                        D.Gm();
                    bd.n(0, 0);
                    for (var Mf = Rp(this), Nf = 0; Nf < ue; Nf++) {
                        var Ah = m[Nf];
                        if (Ah !== zb && (Ah.visible || Ah === Mf)) {
                            var ce = Ah.margin,
                                Jk = ce.right + ce.left,
                                Bb = ce.top + ce.bottom;
                            Hk(Ah, yh, zh, 0, 0);
                            Nd = Ah.Fa;
                            zd = Math.max(Nd.width + Jk, 0);
                            nb = Math.max(Nd.height + Bb, 0);
                            bd.n(Math.max(zd, bd.width), Math.max(nb, bd.height))
                        }
                    }
                    if (1 === ue) e.width = zd, e.height = nb, D.Zk(bd);
                    else {
                        var hc = Sp(zb),
                            Ib = Tp(zb),
                            de = 0,
                            md = 0;
                        Ib.x !== hc.x && Ib.y !== hc.y && (de = bd.width / Math.abs(Ib.x - hc.x), md = bd.height / Math.abs(Ib.y - hc.y));
                        D.Zk(bd);
                        gc = 0;
                        null !== Ab && (gc = Ab.lb *
                            Ab.scale, ak(Ab) === bk && (de = md = Math.max(de, md)));
                        var de = de + (Math.abs(hc.offsetX) + Math.abs(Ib.offsetX) + gc),
                            md = md + (Math.abs(hc.offsetY) + Math.abs(Ib.offsetY) + gc),
                            Me = zb.stretch;
                        Me === wo && (Me = Mo(zb, !1));
                        switch (Me) {
                            case Zj:
                                Sb = mb = 0;
                                break;
                            case Ye:
                                isFinite(fc) && (de = fc);
                                isFinite(kd) && (md = kd);
                                break;
                            case yo:
                                isFinite(fc) && (de = fc);
                                Sb = 0;
                                break;
                            case xo:
                                mb = 0, isFinite(kd) && (md = kd)
                        }
                        zb.xq();
                        Hk(zb, de, md, mb, Sb);
                        e.width = zb.Fa.width + Kg;
                        e.height = zb.Fa.height + ld
                    }
                    break;
                case "Table":
                    for (var ji = a, ki = b, xj = c, yj = d, Jb = m.length, Bh = D.mb(),
                            Ch = D.mb(), ka = 0; ka < Jb; ka++) {
                        var ca = m[ka],
                            ic = ca instanceof x ? ca : null;
                        if (null === ic || ic.type !== Ro && ic.type !== So || !ca.visible) Bh.push(ca);
                        else {
                            v && (ic.Ea.H() && D.k(ic.toString() + " TableRow/TableColumn Panels cannot set a desiredSize: " + ic.Ea.toString()), ic.ah.O(Xd) || D.k(ic.toString() + " TableRow/TableColumn Panels cannot set a minSize: " + ic.ah.toString()), ic.pf.O(ge) || D.k(ic.toString() + " TableRow/TableColumn Panels cannot set a maxSize: " + ic.pf.toString()));
                            Ch.push(ic);
                            for (var mg = ic.xa.o, li = mg.length, Kb =
                                    0; Kb < li; Kb++) {
                                var mi = mg[Kb];
                                ic.type === Ro ? mi.Sb = ca.Sb : ic.type === So && (mi.column = ca.column);
                                Bh.push(mi)
                            }
                        }
                    }
                    Jb = Bh.length;
                    0 === Jb && (this.oe(0), this.ne(0));
                    for (var Xb = [], ka = 0; ka < Jb; ka++) ca = Bh[ka], km(ca, !0), No(ca, !0), Xb[ca.Sb] || (Xb[ca.Sb] = []), Xb[ca.Sb][ca.column] || (Xb[ca.Sb][ca.column] = []), Xb[ca.Sb][ca.column].push(ca);
                    D.ya(Bh);
                    for (var df = D.mb(), Ne = D.mb(), ef = D.mb(), we = { count: 0 }, xe = { count: 0 }, cd = ji, Od = ki, Dh = this.hd, Jb = Dh.length, ka = 0; ka < Jb; ka++) {
                        var Z = Dh[ka];
                        void 0 !== Z && (Z.hb = 0)
                    }
                    Dh = this.cd;
                    Jb = Dh.length;
                    for (ka =
                        0; ka < Jb; ka++) Z = Dh[ka], void 0 !== Z && (Z.hb = 0);
                    for (var nd = Xb.length, ng = 0, ka = 0; ka < nd; ka++) Xb[ka] && (ng = Math.max(ng, Xb[ka].length));
                    for (var ni = Math.min(this.xj, nd - 1), Eh = Math.min(this.hj, ng - 1), rc = 0, nd = Xb.length, Fh = Rp(this), ka = 0; ka < nd; ka++)
                        if (Xb[ka])
                            for (var ng = Xb[ka].length, rb = this.oe(ka), Kb = rb.hb = 0; Kb < ng; Kb++)
                                if (Xb[ka][Kb]) {
                                    var sb = this.ne(Kb);
                                    void 0 === df[Kb] && (sb.hb = 0, df[Kb] = !0);
                                    for (var nm = Xb[ka][Kb], ff = nm.length, Kk = 0; Kk < ff; Kk++)
                                        if (ca = nm[Kk], ca.visible || ca === Fh) {
                                            var oi = 1 < ca.tj || 1 < ca.Si;
                                            oi && (ka < ni || Kb < Eh ||
                                                Ne.push(ca));
                                            var Cc = ca.margin,
                                                Of = Cc.right + Cc.left,
                                                og = Cc.top + Cc.bottom,
                                                Tb = $o(ca, rb, sb, !1),
                                                gf = ca.Ea,
                                                Lk = !isNaN(gf.height),
                                                om = !isNaN(gf.width) && Lk;
                                            oi || Tb === Zj || om || ka < ni || Kb < Eh || (void 0 !== we[Kb] || Tb !== Ye && Tb !== yo || (we[Kb] = -1, we.count++), void 0 !== xe[ka] || Tb !== Ye && Tb !== xo || (xe[ka] = -1, xe.count++), ef.push(ca));
                                            Hk(ca, Infinity, Infinity, 0, 0);
                                            if (!(ka < ni || Kb < Eh)) {
                                                var Pf = ca.Fa,
                                                    hf = Math.max(Pf.width + Of, 0),
                                                    jf = Math.max(Pf.height + og, 0);
                                                if (1 === ca.tj && (Tb === Zj || Tb === yo)) {
                                                    var Z = this.oe(ka),
                                                        sc = Z.hf(),
                                                        rc = Math.max(jf - Z.hb,
                                                            0);
                                                    rc + sc > Od && (rc = Math.max(Od - sc, 0));
                                                    var pg = 0 === Z.hb;
                                                    Z.hb += rc;
                                                    Od = Math.max(Od - (rc + (pg ? sc : 0)), 0)
                                                }
                                                1 !== ca.Si || Tb !== Zj && Tb !== xo || (Z = this.ne(Kb), sc = Z.hf(), rc = Math.max(hf - Z.hb, 0), rc + sc > cd && (rc = Math.max(cd - sc, 0)), pg = 0 === Z.hb, Z.hb += rc, cd = Math.max(cd - (rc + (pg ? sc : 0)), 0));
                                                oi && ca.xq()
                                            }
                                        }
                                }
                    D.ya(df);
                    for (var Gc = 0, Fb = 0, Jb = this.fq, ka = 0; ka < Jb; ka++) {
                        var pi = this.cd[ka];
                        void 0 !== pi && (Gc += pi.Ya, 0 !== pi.Ya && (Gc += pi.hf()))
                    }
                    Jb = this.Tq;
                    for (ka = 0; ka < Jb; ka++) {
                        var Lg = this.hd[ka];
                        void 0 !== Lg && (Fb += Lg.Ya, 0 !== Lg.Ya && (Fb += Lg.hf()))
                    }
                    for (var cd =
                            Math.max(ji - Gc, 0), zj = Od = Math.max(ki - Fb, 0), up = cd, Jb = ef.length, ka = 0; ka < Jb; ka++) {
                        var ca = ef[ka],
                            rb = this.oe(ca.Sb),
                            sb = this.ne(ca.column),
                            Mg = ca.Fa,
                            Cc = ca.margin,
                            Of = Cc.right + Cc.left,
                            og = Cc.top + Cc.bottom;
                        we[ca.column] = 0 === sb.hb && void 0 !== we[ca.column] ? Math.max(Mg.width + Of, we[ca.column]) : null;
                        xe[ca.Sb] = 0 === rb.hb && void 0 !== xe[ca.Sb] ? Math.max(Mg.height + og, xe[ca.Sb]) : null
                    }
                    var Qf = 0,
                        Ng = 0,
                        Og;
                    for (Og in xe) "count" !== Og && (Qf += xe[Og]);
                    for (Og in we) "count" !== Og && (Ng += we[Og]);
                    for (var tb = D.Gm(), ka = 0; ka < Jb; ka++)
                        if (ca = ef[ka],
                            ca.visible || ca === Fh) {
                            var rb = this.oe(ca.Sb),
                                sb = this.ne(ca.column),
                                ac = 0;
                            isFinite(sb.width) ? ac = sb.width : (ac = isFinite(cd) && null !== we[ca.column] ? 0 === Ng ? sb.hb + cd : we[ca.column] / Ng * up : null !== we[ca.column] ? cd : sb.hb || cd, ac = Math.max(0, ac - sb.hf()));
                            var Hc = 0;
                            isFinite(rb.height) ? Hc = rb.height : (Hc = isFinite(Od) && null !== xe[ca.Sb] ? 0 === Qf ? rb.hb + Od : xe[ca.Sb] / Qf * zj : null !== xe[ca.Sb] ? Od : rb.hb || Od, Hc = Math.max(0, Hc - rb.hf()));
                            tb.n(Math.max(sb.Th, Math.min(ac, sb.se)), Math.max(rb.Th, Math.min(Hc, rb.se)));
                            Tb = $o(ca, rb, sb, !1);
                            switch (Tb) {
                                case yo:
                                    tb.height =
                                        Math.max(tb.height, rb.hb + Od);
                                    break;
                                case xo:
                                    tb.width = Math.max(tb.width, sb.hb + cd)
                            }
                            Cc = ca.margin;
                            Of = Cc.right + Cc.left;
                            og = Cc.top + Cc.bottom;
                            ca.xq();
                            Hk(ca, tb.width, tb.height, sb.Th, rb.Th);
                            Pf = ca.Fa;
                            hf = Math.max(Pf.width + Of, 0);
                            jf = Math.max(Pf.height + og, 0);
                            isFinite(cd) && (hf = Math.min(hf, tb.width));
                            isFinite(Od) && (jf = Math.min(jf, tb.height));
                            var kf = 0,
                                kf = rb.hb;
                            rb.hb = Math.max(rb.hb, jf);
                            rc = rb.hb - kf;
                            Od = Math.max(Od - rc, 0);
                            kf = sb.hb;
                            sb.hb = Math.max(sb.hb, hf);
                            rc = sb.hb - kf;
                            cd = Math.max(cd - rc, 0)
                        }
                    D.ya(ef);
                    var Pd = D.Gm(),
                        Jb = Ne.length;
                    if (0 !== Jb)
                        for (var Ad = D.mb(), lf = D.mb(), ka = 0; ka < nd; ka++)
                            if (Xb[ka])
                                for (ng = Xb[ka].length, rb = this.oe(ka), Ad[ka] = rb.hb, Kb = 0; Kb < ng; Kb++) Xb[ka][Kb] && (sb = this.ne(Kb), lf[Kb] = sb.hb);
                    for (ka = 0; ka < Jb; ka++)
                        if (ca = Ne[ka], ca.visible || ca === Fh) {
                            rb = this.oe(ca.Sb);
                            sb = this.ne(ca.column);
                            tb.n(Math.max(sb.Th, Math.min(ji, sb.se)), Math.max(rb.Th, Math.min(ki, rb.se)));
                            Tb = $o(ca, rb, sb, !1);
                            switch (Tb) {
                                case Ye:
                                    0 !== lf[sb.index] && (tb.width = Math.min(tb.width, lf[sb.index]));
                                    0 !== Ad[rb.index] && (tb.height = Math.min(tb.height, Ad[rb.index]));
                                    break;
                                case yo:
                                    0 !== lf[sb.index] && (tb.width = Math.min(tb.width, lf[sb.index]));
                                    break;
                                case xo:
                                    0 !== Ad[rb.index] && (tb.height = Math.min(tb.height, Ad[rb.index]))
                            }
                            isFinite(sb.width) && (tb.width = sb.width);
                            isFinite(rb.height) && (tb.height = rb.height);
                            Pd.n(0, 0);
                            for (var eb = 1; eb < ca.tj && !(ca.Sb + eb >= this.Tq); eb++) Z = this.oe(ca.Sb + eb), rc = Tb === Ye || Tb === xo ? Math.max(Z.Th, 0 === Ad[ca.Sb + eb] ? Z.se : Math.min(Ad[ca.Sb + eb], Z.se)) : Math.max(Z.Th, isNaN(Z.uf) ? Z.se : Math.min(Z.uf, Z.se)), Pd.height += rc;
                            for (eb = 1; eb < ca.Si && !(ca.column + eb >= this.fq); eb++) Z =
                                this.ne(ca.column + eb), rc = Tb === Ye || Tb === yo ? Math.max(Z.Th, 0 === lf[ca.column + eb] ? Z.se : Math.min(lf[ca.column + eb], Z.se)) : Math.max(Z.Th, isNaN(Z.uf) ? Z.se : Math.min(Z.uf, Z.se)), Pd.width += rc;
                            tb.width += Pd.width;
                            tb.height += Pd.height;
                            Cc = ca.margin;
                            Of = Cc.right + Cc.left;
                            og = Cc.top + Cc.bottom;
                            Hk(ca, tb.width, tb.height, xj, yj);
                            for (var Pf = ca.Fa, hf = Math.max(Pf.width + Of, 0), jf = Math.max(Pf.height + og, 0), mf = 0, eb = 0; eb < ca.tj && !(ca.Sb + eb >= this.Tq); eb++) Z = this.oe(ca.Sb + eb), mf += Z.total || 0;
                            if (mf < jf) {
                                var od = jf - mf,
                                    Pg = jf - mf;
                                if (null !== ca.Vy)
                                    for (var nf =
                                            ca.Vy, eb = 0; eb < ca.tj && !(0 >= od) && !(ca.Sb + eb >= this.Tq); eb++) {
                                        var Z = this.oe(ca.Sb + eb),
                                            Ic = Z.Ya || 0,
                                            Rf = nf(ca, Z, Pg);
                                        v && "number" !== typeof Rf && D.k(ca + " spanAllocation does not return a number: " + Rf);
                                        Z.hb = Math.min(Z.se, Ic + Rf);
                                        Z.Ya !== Ic && (od -= Z.Ya - Ic)
                                    }
                                for (; 0 < od;) {
                                    Ic = Z.Ya || 0;
                                    isNaN(Z.height) && Z.se > Ic && (Z.hb = Math.min(Z.se, Ic + od), Z.Ya !== Ic && (od -= Z.Ya - Ic));
                                    if (0 === Z.index) break;
                                    Z = this.oe(Z.index - 1)
                                }
                            }
                            for (var Oe = 0, eb = 0; eb < ca.Si && !(ca.column + eb >= this.fq); eb++) Z = this.ne(ca.column + eb), Oe += Z.total || 0;
                            if (Oe < hf) {
                                od = hf - Oe;
                                Pg = hf - Oe;
                                if (null !== ca.Vy)
                                    for (nf = ca.Vy, eb = 0; eb < ca.Si && !(0 >= od) && !(ca.column + eb >= this.fq); eb++) Z = this.ne(ca.column + eb), Ic = Z.Ya || 0, Rf = nf(ca, Z, Pg), v && "number" !== typeof Rf && D.k(ca + " spanAllocation does not return a number: " + Rf), Z.hb = Math.min(Z.se, Ic + Rf), Z.Ya !== Ic && (od -= Z.Ya - Ic);
                                for (; 0 < od;) {
                                    Ic = Z.Ya || 0;
                                    isNaN(Z.width) && Z.se > Ic && (Z.hb = Math.min(Z.se, Ic + od), Z.Ya !== Ic && (od -= Z.Ya - Ic));
                                    if (0 === Z.index) break;
                                    Z = this.ne(Z.index - 1)
                                }
                            }
                        }
                    D.ya(Ne);
                    D.Zk(Pd);
                    D.Zk(tb);
                    void 0 !== Ad && D.ya(Ad);
                    void 0 !== lf && D.ya(lf);
                    for (var Qg =
                            0, Rg = 0, Tb = Mo(this, !0), Aj = this.Ea, Mk = this.pf, ye = Fb = Gc = 0, dd = 0, Jb = this.fq, ka = 0; ka < Jb; ka++) void 0 !== this.cd[ka] && (Z = this.ne(ka), isFinite(Z.width) ? (ye += Z.width, ye += Z.hf()) : Up(Z) === Vp ? (ye += Z.Ya, ye += Z.hf()) : 0 !== Z.Ya && (Gc += Z.Ya, Gc += Z.hf()));
                    var Qg = isFinite(Aj.width) ? Math.min(Aj.width, Mk.width) : Tb !== Zj && isFinite(ji) ? ji : Gc,
                        Qg = Math.max(Qg, this.ah.width),
                        Qg = Math.max(Qg - ye, 0),
                        Nk = Math.max(Qg / Gc, 1);
                    isFinite(Nk) || (Nk = 1);
                    for (ka = 0; ka < Jb; ka++) void 0 !== this.cd[ka] && (Z = this.ne(ka), isFinite(Z.width) || Up(Z) === Vp || (Z.hb =
                        Z.Ya * Nk), Z.position = e.width, 0 !== Z.Ya && (e.width += Z.Ya, e.width += Z.hf()));
                    Jb = this.Tq;
                    for (ka = 0; ka < Jb; ka++) void 0 !== this.hd[ka] && (Z = this.oe(ka), isFinite(Z.height) ? (dd += Z.height, dd += Z.hf()) : Up(Z) === Vp ? (dd += Z.Ya, dd += Z.hf()) : 0 !== Z.Ya && (Fb += Z.Ya, 0 !== Z.Ya && (Fb += Z.hf())));
                    var Rg = isFinite(Aj.height) ? Math.min(Aj.height, Mk.height) : Tb !== Zj && isFinite(ki) ? ki : Fb,
                        Rg = Math.max(Rg, this.ah.height),
                        Rg = Math.max(Rg - dd, 0),
                        Gh = Math.max(Rg / Fb, 1);
                    isFinite(Gh) || (Gh = 1);
                    for (ka = 0; ka < Jb; ka++) void 0 !== this.hd[ka] && (Z = this.oe(ka), isFinite(Z.height) ||
                        Up(Z) === Vp || (Z.hb = Z.Ya * Gh), Z.position = e.height, 0 !== Z.Ya && (e.height += Z.Ya, 0 !== Z.Ya && (e.height += Z.hf())));
                    Jb = Ch.length;
                    for (ka = 0; ka < Jb; ka++) {
                        var pd = Ch[ka];
                        pd.type === Ro ? (ac = e.width, Z = this.oe(pd.Sb), Hc = Z.hb) : (Z = this.ne(pd.column), ac = Z.hb, Hc = e.height);
                        pd.Fd.n(0, 0, ac, Hc);
                        km(pd, !1);
                        Xb[pd.Sb] || (Xb[pd.Sb] = []);
                        Xb[pd.Sb][pd.column] || (Xb[pd.Sb][pd.column] = []);
                        Xb[pd.Sb][pd.column].push(pd)
                    }
                    D.ya(Ch);
                    this.wt = Xb;
                    break;
                case "Viewbox":
                    var Bj = a,
                        qm = b,
                        rt = c,
                        st = d;
                    1 < m.length && D.k("Viewbox Panel cannot contain more than one GraphObject.");
                    var of = m[0];
                    of.Db = 1;
                    of.xq();
                    Hk(of, Infinity, Infinity, rt, st);
                    var Ok = of.Fa,
                        rm = of.margin,
                        tt = rm.right + rm.left,
                        ut = rm.top + rm.bottom;
                    if (isFinite(Bj) || isFinite(qm)) {
                        var jw = of.scale,
                            sm = Ok.width,
                            tm = Ok.height,
                            vt = Math.max(Bj - tt, 0),
                            wt = Math.max(qm - ut, 0),
                            Pk = 1;
                        this.Wp === bk ? 0 !== sm && 0 !== tm && (Pk = Math.min(vt / sm, wt / tm)) : 0 !== sm && 0 !== tm && (Pk = Math.max(vt / sm, wt / tm));
                        0 === Pk && (Pk = 1E-4);
                        of.Db *= Pk;
                        jw !== of.scale && (km(of, !0), Hk(of, Infinity, Infinity, rt, st))
                    }
                    Ok = of.Fa;
                    e.width = isFinite(Bj) ? Bj : Math.max(Ok.width + tt, 0);
                    e.height = isFinite(qm) ?
                        qm : Math.max(Ok.height + ut, 0);
                    break;
                case "Link":
                    var xt = m.length;
                    if (this instanceof da || this instanceof J) {
                        var ri = null;
                        this instanceof J && (ri = this);
                        this instanceof da && (ri = this.If);
                        if (ri instanceof J) {
                            var Qk = ri;
                            if (0 === xt) {
                                var um = this.Ga;
                                Cb(um, 0, 0);
                                var ze = this.Fa;
                                ze.n(0, 0, 0, 0)
                            } else {
                                var vm = this instanceof da ? null : ri.path,
                                    Sg = ri.so,
                                    pf = this.yj;
                                pf.assign(Sg);
                                pf.x = 0;
                                pf.y = 0;
                                var Hh = Qk.points,
                                    si = ri.ta;
                                this.Wu(!1);
                                var yt = Sg.width,
                                    zt = Sg.height;
                                this.jj.n(Sg.x, Sg.y);
                                null === this.oh && (this.oh = new K(C));
                                this.oh.clear();
                                null !== vm && (Wp(vm, yt, zt, this), ze = vm.Fa, pf.Zh(ze), this.oh.add(ze));
                                for (var Tg = D.hh(), Rk = D.P(), Ug = D.P(), vp = 0; vp < xt; vp++) {
                                    var Yb = m[vp];
                                    if (Yb !== vm)
                                        if (Yb.Ue && Yb instanceof z) Wp(Yb, yt, zt, this), ze = Yb.Fa, pf.Zh(ze), this.oh.add(ze);
                                        else if (2 > si) Hk(Yb, Infinity, Infinity), ze = Yb.Fa, pf.Zh(ze), this.oh.add(ze);
                                    else {
                                        var Bd = Yb.We,
                                            Bt = Yb.WB,
                                            wp = Yb.Gh;
                                        wp.de() && (wp = mc);
                                        var qg = Yb.Uq,
                                            kw = Yb.XB,
                                            Sk = 0,
                                            Tk = 0,
                                            wm = 0;
                                        if (Bd < -si || Bd >= si) {
                                            var Ct = Qk.xG,
                                                Sf = Qk.wG;
                                            qg !== vj && (wm = Qk.computeAngle(Yb, qg, Sf), Yb.wg = wm);
                                            Sk = Ct.x - Sg.x;
                                            Tk = Ct.y - Sg.y
                                        } else {
                                            var Qd,
                                                qf;
                                            if (0 <= Bd) Qd = Hh.fa(Bd), qf = Bd < si - 1 ? Hh.fa(Bd + 1) : Qd;
                                            else {
                                                var ti = si + Bd;
                                                Qd = Hh.fa(ti);
                                                qf = 0 < ti ? Hh.fa(ti - 1) : Qd
                                            }
                                            if (Qd.Wc(qf)) {
                                                var ui, vi;
                                                0 <= Bd ? (ui = 0 < Bd ? Hh.fa(Bd - 1) : Qd, vi = Bd < si - 2 ? Hh.fa(Bd + 2) : qf) : (ui = ti < si - 1 ? Hh.fa(ti + 1) : Qd, vi = 1 < ti ? Hh.fa(ti - 2) : qf);
                                                var Dt = ui.Kf(Qd),
                                                    Et = qf.Kf(vi),
                                                    Sf = Dt > Et + 10 ? 0 <= Bd ? ui.Wb(Qd) : Qd.Wb(ui) : Et > Dt + 10 ? 0 <= Bd ? qf.Wb(vi) : vi.Wb(qf) : 0 <= Bd ? ui.Wb(vi) : vi.Wb(ui)
                                            } else Sf = 0 <= Bd ? Qd.Wb(qf) : qf.Wb(Qd);
                                            qg !== vj && (wm = Qk.computeAngle(Yb, qg, Sf), Yb.wg = wm);
                                            Sk = Qd.x + (qf.x - Qd.x) * Bt - Sg.x;
                                            Tk = Qd.y + (qf.y - Qd.y) * Bt - Sg.y
                                        }
                                        Hk(Yb,
                                            Infinity, Infinity);
                                        var ze = Yb.Fa,
                                            um = Yb.Ga,
                                            Uk = 0;
                                        Yb instanceof z && (Uk = Yb.lb);
                                        var wi = um.width + Uk,
                                            Cj = um.height + Uk;
                                        Tg.reset();
                                        Tg.translate(-ze.x, -ze.y);
                                        Tg.scale(Yb.scale, Yb.scale);
                                        Tg.rotate(qg === vj ? Yb.angle : Sf, wi / 2, Cj / 2);
                                        qg !== Xp && qg !== Yp || Tg.rotate(90, wi / 2, Cj / 2);
                                        qg !== Zp && qg !== $p || Tg.rotate(-90, wi / 2, Cj / 2);
                                        qg === aq && (45 < Sf && 135 > Sf || 225 < Sf && 315 > Sf) && Tg.rotate(-Sf, wi / 2, Cj / 2);
                                        var Dj = new C(0, 0, wi, Cj);
                                        Rk.uo(Dj, wp);
                                        Tg.vb(Rk);
                                        var lw = -Rk.x + Uk / 2 * Yb.scale,
                                            mw = -Rk.y + Uk / 2 * Yb.scale;
                                        Ug.assign(kw);
                                        isNaN(Ug.x) && (Ug.x = 0 <= Bd ?
                                            wi / 2 + 3 : -(wi / 2 + 3));
                                        isNaN(Ug.y) && (Ug.y = -(Cj / 2 + 3));
                                        Ug.rotate(Sf);
                                        Sk += Ug.x;
                                        Tk += Ug.y;
                                        Dj.set(ze);
                                        Dj.x = Sk + lw;
                                        Dj.y = Tk + mw;
                                        this.oh.add(Dj);
                                        pf.Zh(Dj)
                                    }
                                }
                                if (this instanceof J)
                                    for (var Ft = this.Af; Ft.next();) Hk(Ft.value, Infinity, Infinity);
                                this.yj = pf;
                                var xp = this.jj;
                                xp.n(xp.x + pf.x, xp.y + pf.y);
                                Cb(e, pf.width || 0, pf.height || 0);
                                D.lf(Tg);
                                D.A(Rk);
                                D.A(Ug)
                            }
                        }
                    }
                    break;
                case "Grid":
                    break;
                case "Graduated":
                    var nw = a,
                        ow = b,
                        pw = c,
                        qw = d,
                        Vg = this.Ld();
                    this.Tm = [];
                    var Ej = Vg.margin,
                        rw = Ej.right + Ej.left,
                        sw = Ej.top + Ej.bottom;
                    Hk(Vg, nw, ow, pw, qw);
                    var Gt =
                        Vg.Fa,
                        tw = Gt.height,
                        uw = Math.max(Gt.width + rw, 0),
                        vw = Math.max(tw + sw, 0),
                        Ht = new C(-Ej.left, -Ej.top, uw, vw);
                    this.Tm.push(Ht);
                    e.assign(Ht);
                    for (var Zk = Vg.vf, It = Vg.lb, yp = Zk.Zx, Fj = Zk.uu, xi = Zk.vu, ww = yp.length, zp = 0, Ap = 0, Gj = D.mb(), Bp = 0; Bp < ww; Bp++) {
                        for (var Cp = yp[Bp], Jt = [], Ap = zp = 0, xw = Cp.length, Hj = 0; Hj < xw; Hj += 2) {
                            var Kt = Cp[Hj],
                                Lt = Cp[Hj + 1];
                            if (0 !== Hj) {
                                var Cd = 180 * Math.atan2(Lt - Ap, Kt - zp) / Math.PI;
                                0 > Cd && (Cd += 360);
                                Jt.push(Cd)
                            }
                            zp = Kt;
                            Ap = Lt
                        }
                        Gj.push(Jt)
                    }
                    var Mt;
                    if (null === this.pk) {
                        for (var Nt = [], Dp = this.xa.o, Ot = Dp.length, Ep = 0; Ep <
                            Ot; Ep++) {
                            var $k = Dp[Ep],
                                Pt = [];
                            Nt.push(Pt);
                            if ($k.visible)
                                for (var yw = $k.interval, Fp = 0; Fp < Ot; Fp++) {
                                    var al = Dp[Fp];
                                    if (al.visible && $k !== al && !($k instanceof z && !(al instanceof z) || $k instanceof pa && !(al instanceof pa))) {
                                        var Qt = al.interval;
                                        Qt > yw && Pt.push(Qt)
                                    }
                                }
                        }
                        this.pk = Nt
                    }
                    Mt = this.pk;
                    var Rt = this.xa.o,
                        zw = Rt.length,
                        Ih = 0,
                        St = 0,
                        Tt = xi;
                    this.Vm = [];
                    for (var ym = [], zm = 0; zm < zw; zm++) {
                        var Jh = Rt[zm],
                            ym = [];
                        if (Jh.visible && Jh !== Vg) {
                            var Ut = Jh.interval,
                                Vt = this.hB;
                            if (!(2 > Vt * Ut * xi / this.Du)) {
                                var ee = this.VF,
                                    Wt = Mt[zm],
                                    yi = Fj[0][0],
                                    Tf =
                                    0,
                                    Dd = 0,
                                    St = xi * Jh.UF - 1E-4,
                                    Tt = xi * Jh.SF + 1E-4,
                                    Ij = Vt * Ut;
                                if (ee < this.al) var zi = (this.al - ee) / Ij,
                                    zi = 0 === zi % 1 ? zi : Math.floor(zi + 1),
                                    ee = ee + zi * Ij;
                                else ee > this.al + Ij && (zi = Math.floor((ee - this.al) / Ij), ee -= zi * Ij);
                                for (; ee <= this.gB;) {
                                    var Gp;
                                    a: {
                                        for (var Aw = Wt.length, Hp = 0; Hp < Aw; Hp++)
                                            if (Eb((ee - this.VF) % (Wt[Hp] * this.hB), 0)) { Gp = !1; break a }
                                        Gp = !0
                                    }
                                    if (Gp && (Ih = (ee - this.al) * xi / this.Du, Ih > xi && (Ih = xi), St <= Ih && Ih <= Tt)) {
                                        for (var Cd = Gj[Tf][Dd], Jj = Fj[Tf][Dd]; Tf < Fj.length;) {
                                            for (; Ih > yi && Dd < Fj[Tf].length - 1;) Dd++, Cd = Gj[Tf][Dd], Jj = Fj[Tf][Dd],
                                                yi += Jj;
                                            if (Ih <= yi) break;
                                            Tf++;
                                            Dd = 0;
                                            Cd = Gj[Tf][Dd];
                                            Jj = Fj[Tf][Dd];
                                            yi += Jj
                                        }
                                        var Rd = yp[Tf],
                                            Xt = Rd[2 * Dd],
                                            Yt = Rd[2 * Dd + 1],
                                            Am = (Ih - (yi - Jj)) / Jj,
                                            Ip = new N(Xt + (Rd[2 * Dd + 2] - Xt) * Am + It / 2 - Zk.pb.x, Yt + (Rd[2 * Dd + 3] - Yt) * Am + It / 2 - Zk.pb.y);
                                        Ip.scale(Vg.scale, Vg.scale);
                                        var rg = Cd,
                                            Kj = Gj[Tf];
                                        1E-4 > Am ? 0 < Dd ? rg = Kj[Dd - 1] : Eb(Rd[0], Rd[Rd.length - 2]) && Eb(Rd[1], Rd[Rd.length - 1]) && (rg = Kj[Kj.length - 1]) : .9999 < Am && (Dd + 1 < Kj.length ? rg = Kj[Dd + 1] : Eb(Rd[0], Rd[Rd.length - 2]) && Eb(Rd[1], Rd[Rd.length - 1]) && (rg = Kj[0]));
                                        Cd !== rg && (180 < Math.abs(Cd - rg) && (Cd < rg ? Cd +=
                                            360 : rg += 360), Cd = (Cd + rg) / 2 % 360);
                                        if (Jh instanceof pa) {
                                            var Bm = "",
                                                Bm = null !== Jh.TF ? Jh.TF(ee) : (+ee.toFixed(2)).toString();
                                            v && D.h(Bm, "string");
                                            "" !== Bm && ym.push([Ip, Cd, Bm])
                                        } else ym.push([Ip, Cd])
                                    }
                                    ee += Ij
                                }
                            }
                        }
                        this.Vm.push(ym)
                    }
                    D.ya(Gj);
                    for (var Bw = this.Vm, Cw = m.length, Cm = 0; Cm < Cw; Cm++) {
                        var Ai = m[Cm],
                            Jp = Bw[Cm];
                        if (Ai.visible && Ai !== Vg && 0 !== Jp.length) {
                            if (Ai instanceof z) {
                                var Kh = Ai,
                                    Zt = Jp,
                                    Dw = e,
                                    Kp = Kh.Gh;
                                Kp.de() && (Kp = jc);
                                var Ew = Kh.angle;
                                Kh.wg = 0;
                                Hk(Kh, Infinity, Infinity);
                                Kh.wg = Ew;
                                var $t = Kh.Fa,
                                    Lp = $t.width,
                                    Mp = $t.height,
                                    au = D.vg(0,
                                        0, Lp, Mp),
                                    fe = D.P();
                                fe.uo(au, Kp);
                                D.Lb(au);
                                for (var Dm = -fe.x, Em = -fe.y, Bi = new C, Fw = Zt.length, Fm = 0; Fm < Fw; Fm++)
                                    for (var Np = Zt[Fm], bu = Np[0].x, cu = Np[0].y, du = Np[1], Gm = 0; 4 > Gm; Gm++) {
                                        switch (Gm) {
                                            case 0:
                                                fe.n(Dm, Em);
                                                break;
                                            case 1:
                                                fe.n(Dm + Lp, Em);
                                                break;
                                            case 2:
                                                fe.n(Dm, Em + Mp);
                                                break;
                                            case 3:
                                                fe.n(Dm + Lp, Em + Mp)
                                        }
                                        fe.rotate(du + Kh.angle);
                                        fe.offset(bu, cu);
                                        0 === Fm && 0 === Gm ? Bi.n(fe.x, fe.y, 0, 0) : Bi.Mi(fe);
                                        fe.offset(-bu, -cu);
                                        fe.rotate(-du - Kh.angle)
                                    }
                                D.A(fe);
                                this.Tm.push(Bi);
                                Ub(Dw, Bi.x, Bi.y, Bi.width, Bi.height)
                            } else if (Ai instanceof pa) {
                                var Hm =
                                    Ai,
                                    eu = Jp,
                                    Gw = e;
                                null === this.Ik && (this.Ik = new pa);
                                var Uf = this.Ik;
                                rp(Hm, Uf);
                                var Op = Hm.Gh;
                                Op.de() && (Op = jc);
                                for (var Lh = Hm.Uq, Hw = Hm.XB, Ci = null, Im = 0, Jm = 0, Wg = 0, Pp = 0, Iw = eu.length, Km = 0; Km < Iw; Km++) {
                                    var sg = eu[Km],
                                        Im = sg[0].x,
                                        Jm = sg[0].y,
                                        Wg = sg[1];
                                    Lh !== vj && (Pp = J.computeAngle(Lh, Wg), Uf.wg = Pp);
                                    Uf.text = sg[2];
                                    Hk(Uf, Infinity, Infinity);
                                    var Mh = Uf.Fa,
                                        Lj = Uf.Ga,
                                        Mj = Lj.width,
                                        Nj = Lj.height,
                                        Xg = D.hh();
                                    Xg.reset();
                                    Xg.translate(-Mh.x, -Mh.y);
                                    Xg.scale(Uf.scale, Uf.scale);
                                    Xg.rotate(Lh === vj ? Uf.angle : Wg, Mj / 2, Nj / 2);
                                    Lh !== Xp && Lh !== Yp || Xg.rotate(90,
                                        Mj / 2, Nj / 2);
                                    Lh !== Zp && Lh !== $p || Xg.rotate(-90, Mj / 2, Nj / 2);
                                    Lh === aq && (45 < Wg && 135 > Wg || 225 < Wg && 315 > Wg) && Xg.rotate(-Wg, Mj / 2, Nj / 2);
                                    var fu = D.vg(0, 0, Mj, Nj),
                                        bl = D.P();
                                    bl.uo(fu, Op);
                                    Xg.vb(bl);
                                    var Jw = -bl.x,
                                        Kw = -bl.y,
                                        Yg = D.P();
                                    Yg.assign(Hw);
                                    isNaN(Yg.x) && (Yg.x = Mj / 2 + 3);
                                    isNaN(Yg.y) && (Yg.y = -(Nj / 2 + 3));
                                    Yg.rotate(Wg);
                                    var Im = Im + (Yg.x + Jw),
                                        Jm = Jm + (Yg.y + Kw),
                                        Qp = new C(Im, Jm, Mh.width, Mh.height),
                                        Lw = new C(Mh.x, Mh.y, Mh.width, Mh.height),
                                        Mw = new C(Lj.x, Lj.y, Lj.width, Lj.height),
                                        gu = new bq;
                                    gu.gq(Uf.sf);
                                    sg.push(Pp);
                                    sg.push(Uf.xe);
                                    sg.push(gu);
                                    sg.push(Qp);
                                    sg.push(Lw);
                                    sg.push(Mw);
                                    0 === Km ? Ci = Qp.copy() : Ci.Zh(Qp);
                                    D.A(Yg);
                                    D.A(bl);
                                    D.Lb(fu);
                                    D.lf(Xg)
                                }
                                this.Tm.push(Ci);
                                Ub(Gw, Ci.x, Ci.y, Ci.width, Ci.height)
                            }
                            km(Ai, !1)
                        }
                    }
                    break;
                case "TableRow":
                case "TableColumn":
                    D.k(this.toString() + " is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");
                    break;
                default:
                    D.k("Unknown panel type: " + n)
            }
        }
        var rf = e.width,
            sf = e.height,
            Lm = this.padding,
            Nw = Lm.top + Lm.bottom,
            rf = rf + (Lm.left + Lm.right),
            sf = sf + Nw;
        isFinite(g.width) && (rf =
            g.width);
        isFinite(g.height) && (sf = g.height);
        rf = Math.min(k.width, rf);
        sf = Math.min(k.height, sf);
        rf = Math.max(h.width, rf);
        sf = Math.max(h.height, sf);
        rf = Math.max(c, rf);
        sf = Math.max(d, sf);
        e.width = rf;
        e.height = sf;
        Cb(this.fd, rf, sf);
        Jo(this, 0, 0, rf, sf)
    };
    x.prototype.findMainElement = x.prototype.Ld = function() {
        if (null === this.Xl) {
            var a = this.xa.o,
                b = a.length;
            if (0 === b) return null;
            for (var c = 0; c < b; c++) { var d = a[c]; if (!0 === d.Ue) return this.Xl = d }
            this.Xl = a[0]
        }
        return this.Xl
    };

    function Rp(a) { return null !== a.Y ? a.Y.Bf : null }
    x.prototype.Cj = function(a, b, c, d) {
        var e = this.yj,
            g = this.xa.o,
            h = D.vg(0, 0, 0, 0);
        if (0 === g.length) {
            var k = this.aa;
            k.x = a;
            k.y = b;
            k.width = c;
            k.height = d
        } else {
            if (!this.Ea.H()) {
                var l = Mo(this, !0),
                    m = this.Fd,
                    n = m.width,
                    p = m.height,
                    q = this.margin,
                    r = q.left + q.right,
                    s = q.top + q.bottom;
                n === c && p === d && (l = Zj);
                switch (l) {
                    case Zj:
                        if (n > c || p > d) this.K(), Hk(this, n > c ? c : n, p > d ? d : p);
                        break;
                    case Ye:
                        this.K(!0);
                        Hk(this, c + r, d + s, 0, 0);
                        break;
                    case yo:
                        this.K(!0);
                        Hk(this, c + r, p + s, 0, 0);
                        break;
                    case xo:
                        this.K(!0), Hk(this, n + r, d + s, 0, 0)
                }
            }
            k = this.aa;
            k.x = a;
            k.y =
                b;
            k.width = c;
            k.height = d;
            var u = this.da.$b;
            switch (u) {
                case "Position":
                    for (var t = g.length, y = e.x - this.padding.left, w = e.y - this.padding.top, A = 0; A < t; A++) {
                        var B = g[A],
                            P = B.Fa,
                            H = B.margin,
                            R = B.position.x,
                            aa = B.position.y;
                        h.x = isNaN(R) ? -y : R - y;
                        h.y = isNaN(aa) ? -w : aa - w;
                        if (B instanceof z) {
                            var V = B;
                            if (V.hG) {
                                var ea = V.lb / 2;
                                h.x -= ea;
                                h.y -= ea
                            }
                        }
                        h.x += H.left;
                        h.y += H.top;
                        h.width = P.width;
                        h.height = P.height;
                        B.visible && B.rc(h.x, h.y, h.width, h.height)
                    }
                    break;
                case "Vertical":
                    for (var la = g.length, Da = this.padding.left, La = this.lG, gb = La ? e.height :
                            this.padding.top, Aa = 0; Aa < la; Aa++) {
                        var W = Da,
                            xb = g[Aa];
                        if (xb.visible) {
                            var Pb = xb.Fa,
                                Sa = xb.margin,
                                Qc = Sa.left + Sa.right,
                                Ra = Da + this.padding.right,
                                jg = Pb.width,
                                kg = Mo(xb, !1);
                            if (isNaN(xb.Ea.width) && kg === Ye || kg === yo) jg = Math.max(e.width - Qc - Ra, 0);
                            var vd = jg + Qc + Ra,
                                wd = xb.alignment;
                            wd.ld() && (wd = this.om);
                            wd.Xc() || (wd = mc);
                            La && (gb -= Pb.height + Sa.bottom + Sa.top);
                            xb.rc(W + wd.offsetX + Sa.left + (e.width * wd.x - vd * wd.x), gb + wd.offsetY + Sa.top, jg, Pb.height);
                            La || (gb += Pb.height + Sa.bottom + Sa.top)
                        }
                    }
                    break;
                case "Horizontal":
                    for (var Rc = g.length,
                            uh = this.padding.top, $e = this.lG, hb = $e ? e.width : this.padding.left, ub = 0; ub < Rc; ub++) {
                        var sa = uh,
                            na = g[ub];
                        if (na.visible) {
                            var ab = na.Fa,
                                Oa = na.margin,
                                pb = Oa.top + Oa.bottom,
                                Md = uh + this.padding.bottom,
                                Jf = ab.height,
                                se = Mo(na, !1);
                            if (isNaN(na.Ea.height) && se === Ye || se === xo) Jf = Math.max(e.height - pb - Md, 0);
                            var be = Jf + pb + Md,
                                jd = na.alignment;
                            jd.ld() && (jd = this.om);
                            jd.Xc() || (jd = mc);
                            $e && (hb -= ab.width + Oa.left + Oa.right);
                            na.rc(hb + jd.offsetX + Oa.left, sa + jd.offsetY + Oa.top + (e.height * jd.y - be * jd.y), ab.width, Jf);
                            $e || (hb += ab.width + Oa.left +
                                Oa.right)
                        }
                    }
                    break;
                case "Spot":
                    var vh = g.length,
                        Kf = this.Ld(),
                        Ig = Kf.Fa,
                        Hb = Ig.width,
                        oc = Ig.height,
                        xd = this.padding,
                        wh = xd.left,
                        qb = xd.top;
                    h.x = wh - e.x;
                    h.y = qb - e.y;
                    Kf.rc(h.x, h.y, Hb, oc);
                    for (var Pa = 0; Pa < vh; Pa++) {
                        var Qb = g[Pa];
                        if (Qb !== Kf) {
                            var Lf = Qb.Fa,
                                Jg = Lf.width,
                                xh = Lf.height,
                                ib = Qb.alignment;
                            ib.ld() && (ib = this.om);
                            ib.Xc() || (ib = mc);
                            var zc = Qb.Gh;
                            zc.ld() && (zc = mc);
                            var $b = null;
                            Qb instanceof x && "" !== Qb.dk && ($b = Qb.Md(Qb.dk), $b === Qb && ($b = null));
                            if (null !== $b) {
                                for (var te = $b.Ga, Ac = D.Fb(zc.x * te.width + zc.offsetX, zc.y * te.height +
                                        zc.offsetY); $b !== Qb;) $b.transform.vb(Ac), $b = $b.R;
                                h.x = ib.x * Hb + ib.offsetX - Ac.x;
                                h.y = ib.y * oc + ib.offsetY - Ac.y;
                                D.A(Ac)
                            } else h.x = ib.x * Hb + ib.offsetX - (zc.x * Jg - zc.offsetX), h.y = ib.y * oc + ib.offsetY - (zc.y * xh - zc.offsetY);
                            h.x -= e.x;
                            h.y -= e.y;
                            Qb.visible && Qb.rc(wh + h.x, qb + h.y, Jg, xh)
                        }
                    }
                    break;
                case "Auto":
                    var Bc = g.length,
                        vb = this.Ld(),
                        pc = vb.Fa,
                        yb = D.Sf();
                    yb.n(0, 0, 1, 1);
                    var Fc = vb.margin,
                        db = Fc.left,
                        Ta = Fc.top,
                        Mb = this.padding,
                        yd = Mb.left,
                        lg = Mb.top;
                    h.x = db;
                    h.y = Ta;
                    h.width = pc.width;
                    h.height = pc.height;
                    vb.rc(yd + h.x, lg + h.y, h.width, h.height);
                    var af = Sp(vb),
                        bf = Tp(vb),
                        wj = 0 + af.y * pc.height + af.offsetY,
                        Rb = 0 + bf.x * pc.width + bf.offsetX,
                        qc = 0 + bf.y * pc.height + bf.offsetY;
                    yb.x = 0 + af.x * pc.width + af.offsetX;
                    yb.y = wj;
                    Ub(yb, Rb, qc, 0, 0);
                    yb.x += db + yd;
                    yb.y += Ta + lg;
                    for (var fc = 0; fc < Bc; fc++) {
                        var kd = g[fc];
                        if (kd !== vb) {
                            var mb = kd.Fa,
                                Fc = kd.margin,
                                Sb = Math.max(mb.width + Fc.right + Fc.left, 0),
                                ue = Math.max(mb.height + Fc.top + Fc.bottom, 0),
                                zb = kd.alignment;
                            zb.ld() && (zb = this.om);
                            zb.Xc() || (zb = mc);
                            h.x = yb.width * zb.x + zb.offsetX - Sb * zb.x + Fc.left + yb.x;
                            h.y = yb.height * zb.y + zb.offsetY - ue * zb.y + Fc.top +
                                yb.y;
                            h.width = yb.width;
                            h.height = yb.height;
                            kd.visible && (Vb(yb.x, yb.y, yb.width, yb.height, h.x, h.y, mb.width, mb.height) ? kd.rc(h.x, h.y, mb.width, mb.height) : kd.rc(h.x, h.y, mb.width, mb.height, new C(yb.x, yb.y, yb.width, yb.height)))
                        }
                    }
                    D.Lb(yb);
                    break;
                case "Table":
                    for (var ce = g.length, yh = this.padding, zh = yh.left, Kg = yh.top, ld = this.wt, Nd = 0, gc = 0, Ab = ld.length, zd = 0, nb = 0; nb < Ab; nb++) ld[nb] && (zd = Math.max(zd, ld[nb].length));
                    for (var hc = Math.min(this.xj, Ab - 1); hc !== Ab && (void 0 === this.hd[hc] || 0 === this.hd[hc].Ya);) hc++;
                    for (var hc =
                            Math.min(hc, Ab - 1), ii = -this.hd[hc].sb, ad = Math.min(this.hj, zd - 1); ad !== zd && (void 0 === this.cd[ad] || 0 === this.cd[ad].Ya);) ad++;
                    for (var ad = Math.min(ad, zd - 1), Ib = -this.cd[ad].sb, ve = D.Gm(), nb = 0; nb < Ab; nb++)
                        if (ld[nb]) {
                            var zd = ld[nb].length,
                                cf = this.oe(nb),
                                gc = cf.sb + ii + Kg;
                            0 !== cf.Ya && (gc += cf.jF());
                            for (var bd = 0; bd < zd; bd++)
                                if (ld[nb][bd]) {
                                    var Mf = this.ne(bd),
                                        Nd = Mf.sb + Ib + zh;
                                    0 !== Mf.Ya && (Nd += Mf.jF());
                                    for (var Nf = ld[nb][bd], Ah = Nf.length, Jk = 0; Jk < Ah; Jk++) {
                                        var Bb = Nf[Jk],
                                            de = Bb.Fa,
                                            md = Bb instanceof x ? Bb : null;
                                        if (null === md || md.type !==
                                            Ro && md.type !== So) {
                                            ve.n(0, 0);
                                            for (var Me = 1; Me < Bb.rowSpan && !(nb + Me >= this.Tq); Me++) {
                                                var ji = this.oe(nb + Me);
                                                ve.height += ji.total
                                            }
                                            for (Me = 1; Me < Bb.kI && !(bd + Me >= this.fq); Me++) {
                                                var ki = this.ne(bd + Me);
                                                ve.width += ki.total
                                            }
                                            var xj = Mf.Ya + ve.width,
                                                yj = cf.Ya + ve.height;
                                            h.x = Nd;
                                            h.y = gc;
                                            h.width = xj;
                                            h.height = yj;
                                            var Jb = Nd,
                                                Bh = gc,
                                                Ch = xj,
                                                ka = yj;
                                            Nd + xj > e.width && (Ch = Math.max(e.width - Nd, 0));
                                            gc + yj > e.height && (ka = Math.max(e.height - gc, 0));
                                            var ca = Bb.alignment,
                                                ic = 0,
                                                mg = 0,
                                                li = 0,
                                                Kb = 0;
                                            if (ca.ld()) {
                                                ca = this.om;
                                                ca.Xc() || (ca = mc);
                                                var ic = ca.x,
                                                    mg = ca.y,
                                                    li =
                                                    ca.offsetX,
                                                    Kb = ca.offsetY,
                                                    mi = Mf.alignment,
                                                    Xb = cf.alignment;
                                                mi.Xc() && (ic = mi.x, li = mi.offsetX);
                                                Xb.Xc() && (mg = Xb.y, Kb = Xb.offsetY)
                                            } else ic = ca.x, mg = ca.y, li = ca.offsetX, Kb = ca.offsetY;
                                            if (isNaN(ic) || isNaN(mg)) mg = ic = .5, Kb = li = 0;
                                            var df = de.width,
                                                Ne = de.height,
                                                ef = Bb.margin,
                                                we = ef.left + ef.right,
                                                xe = ef.top + ef.bottom,
                                                cd = $o(Bb, cf, Mf, !1);
                                            !isNaN(Bb.Ea.width) || cd !== Ye && cd !== yo || (df = Math.max(xj - we, 0));
                                            !isNaN(Bb.Ea.height) || cd !== Ye && cd !== xo || (Ne = Math.max(yj - xe, 0));
                                            var Od = Bb.pf,
                                                Dh = Bb.ah,
                                                df = Math.min(Od.width, df),
                                                Ne = Math.min(Od.height,
                                                    Ne),
                                                df = Math.max(Dh.width, df),
                                                Ne = Math.max(Dh.height, Ne),
                                                Z = Ne + xe;
                                            h.x += h.width * ic - (df + we) * ic + li + ef.left;
                                            h.y += h.height * mg - Z * mg + Kb + ef.top;
                                            Bb.visible && (Vb(Jb, Bh, Ch, ka, h.x, h.y, de.width, de.height) ? Bb.rc(h.x, h.y, df, Ne) : Bb.rc(h.x, h.y, df, Ne, new C(Jb, Bh, Ch, ka)))
                                        } else {
                                            Bb.cj();
                                            Bb.bc.Xa();
                                            var nd = Bb.bc,
                                                ng = D.vg(nd.x, nd.y, nd.width, nd.height);
                                            nd.x = md.type === Ro ? zh : Nd;
                                            nd.y = md.type === So ? Kg : gc;
                                            nd.width = de.width;
                                            nd.height = de.height;
                                            Bb.bc.freeze();
                                            No(Bb, !1);
                                            if (!Db(ng, nd)) {
                                                var ni = Bb.Y;
                                                null !== ni && (ni.cl(), Bb.$s(ni))
                                            }
                                            D.Lb(ng)
                                        }
                                    }
                                }
                        }
                    D.Zk(ve);
                    for (nb = 0; nb < ce; nb++) Bb = g[nb], md = Bb instanceof x ? Bb : null, null === md || md.type !== Ro && md.type !== So || (nd = Bb.bc, Bb.fd.Xa(), Bb.fd.n(0, 0, nd.width, nd.height), Bb.fd.freeze());
                    break;
                case "Viewbox":
                    var Eh = g[0],
                        rc = Eh.Fa,
                        Fh = Eh.margin,
                        rb = Fh.top + Fh.bottom,
                        sb = Math.max(rc.width + (Fh.right + Fh.left), 0),
                        nm = Math.max(rc.height + rb, 0),
                        ff = Eh.alignment;
                    ff.ld() && (ff = this.om);
                    ff.Xc() || (ff = mc);
                    h.x = e.width * ff.x - sb * ff.x + ff.offsetX;
                    h.y = e.height * ff.y - nm * ff.y + ff.offsetY;
                    h.width = rc.width;
                    h.height = rc.height;
                    Eh.rc(h.x, h.y, h.width, h.height);
                    break;
                case "Link":
                    var Kk = g.length;
                    if (this instanceof da || this instanceof J) {
                        var oi = null;
                        this instanceof J && (oi = this);
                        this instanceof da && (oi = this.If);
                        var Cc = oi,
                            Of = this instanceof da ? null : Cc.path;
                        if (null !== this.oh) {
                            var og = this.oh.o,
                                Tb = 0;
                            if (null !== Of && Tb < this.oh.count) {
                                var gf = og[Tb];
                                Tb++;
                                Of.rc(gf.x - this.yj.x, gf.y - this.yj.y, gf.width, gf.height)
                            }
                            for (var Lk = 0; Lk < Kk; Lk++) {
                                var om = g[Lk];
                                om !== Of && Tb < this.oh.count && (gf = og[Tb], Tb++, om.rc(gf.x - this.yj.x, gf.y - this.yj.y, gf.width, gf.height))
                            }
                        }
                        var Pf = Cc.points,
                            hf =
                            Pf.count;
                        if (2 <= hf && this instanceof J)
                            for (var jf = this.Af; jf.next();) {
                                var sc = jf.value,
                                    pg = hf,
                                    Gc = Pf,
                                    Fb = sc.We,
                                    pi = sc.WB,
                                    Lg = sc.Gh,
                                    zj = sc.Uq,
                                    up = sc.XB,
                                    Mg = 0,
                                    Qf = 0,
                                    Ng = 0;
                                if (Fb < -pg || Fb >= pg) {
                                    var Og = this.xG,
                                        tb = this.wG;
                                    zj !== vj && (Ng = this.computeAngle(sc, zj, tb), sc.angle = Ng);
                                    Mg = Og.x;
                                    Qf = Og.y
                                } else {
                                    var ac = void 0,
                                        Hc = void 0;
                                    if (0 <= Fb) ac = Gc.o[Fb], Hc = Fb < pg - 1 ? Gc.o[Fb + 1] : ac;
                                    else var kf = pg + Fb,
                                        ac = Gc.o[kf],
                                        Hc = 0 < kf ? Gc.o[kf - 1] : ac;
                                    if (ac.Wc(Hc)) {
                                        var Pd = void 0,
                                            Ad = void 0;
                                        0 <= Fb ? (Pd = 0 < Fb ? Gc.o[Fb - 1] : ac, Ad = Fb < pg - 2 ? Gc.o[Fb + 2] : Hc) : (Pd = kf < pg -
                                            1 ? Gc.o[kf + 1] : ac, Ad = 1 < kf ? Gc.o[kf - 2] : Hc);
                                        var lf = Pd.Kf(ac),
                                            eb = Hc.Kf(Ad),
                                            tb = lf > eb + 10 ? 0 <= Fb ? Pd.Wb(ac) : ac.Wb(Pd) : eb > lf + 10 ? 0 <= Fb ? Hc.Wb(Ad) : Ad.Wb(Hc) : 0 <= Fb ? Pd.Wb(Ad) : Ad.Wb(Pd)
                                    } else tb = 0 <= Fb ? ac.Wb(Hc) : Hc.Wb(ac);
                                    zj !== vj && (Ng = this.computeAngle(sc, zj, tb), sc.angle = Ng);
                                    Mg = ac.x + (Hc.x - ac.x) * pi;
                                    Qf = ac.y + (Hc.y - ac.y) * pi
                                }
                                if (Lg.O(dc)) sc.location = new N(Mg, Qf);
                                else {
                                    Lg.de() && (Lg = mc);
                                    var mf = D.hh();
                                    mf.reset();
                                    mf.scale(sc.scale, sc.scale);
                                    mf.rotate(sc.angle, 0, 0);
                                    var od = sc.Ga,
                                        Pg = D.vg(0, 0, od.width, od.height),
                                        nf = D.P();
                                    nf.uo(Pg,
                                        Lg);
                                    mf.vb(nf);
                                    var Ic = -nf.x,
                                        Rf = -nf.y,
                                        Oe = up.copy();
                                    isNaN(Oe.x) && (Oe.x = 0 <= Fb ? nf.x + 3 : -(nf.x + 3));
                                    isNaN(Oe.y) && (Oe.y = -(nf.y + 3));
                                    Oe.rotate(tb);
                                    Mg += Oe.x;
                                    Qf += Oe.y;
                                    mf.tH(Pg);
                                    var Ic = Ic + Pg.x,
                                        Rf = Rf + Pg.y,
                                        Qg = D.Fb(Mg + Ic, Qf + Rf);
                                    sc.move(Qg);
                                    D.A(Qg);
                                    D.A(nf);
                                    D.Lb(Pg);
                                    D.lf(mf)
                                }
                            }
                        this.Wu(!1)
                    }
                    break;
                case "Grid":
                    break;
                case "Graduated":
                    if (null !== this.Tm) {
                        var Rg = this.Ld(),
                            Aj = this.Vm,
                            Mk = this.Tm,
                            ye = 0,
                            dd = Mk[ye];
                        ye++;
                        Rg.rc(dd.x - e.x, dd.y - e.y, dd.width, dd.height);
                        for (var Nk = g.length, Gh = 0; Gh < Nk; Gh++) {
                            var pd = g[Gh],
                                Bj = Aj[Gh];
                            pd.visible &&
                                pd !== Rg && 0 !== Bj.length && (dd = Mk[ye], ye++, pd.rc(dd.x - e.x, dd.y - e.y, dd.width, dd.height))
                        }
                        this.Tm = null
                    }
                    break;
                case "TableRow":
                case "TableColumn":
                    D.k(this.toString() + " is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel.");
                    break;
                default:
                    D.k("Unknown panel type: " + u)
            }
            D.Lb(h)
        }
    };
    x.prototype.Rk = function(a) {
        var b = this.Ga,
            c = Rp(this);
        if (Vb(0, 0, b.width, b.height, a.x, a.y)) {
            for (var b = this.xa.o, d = b.length, e = D.Fb(0, 0); d--;) {
                var g = b[d];
                if (g.visible || g === c)
                    if (kb(e.set(a), g.transform), g.Pa(e)) return D.A(e), !0
            }
            D.A(e);
            return null === this.Mb && null === this.lc ? !1 : !0
        }
        return !1
    };
    x.prototype.Vx = function(a) { if (this.Jo === a) return this; for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) { var e = b[d].Vx(a); if (null !== e) return e } return null };

    function gp(a, b, c) { c(a, b); if (b instanceof x) { b = b.xa.o; for (var d = b.length, e = 0; e < d; e++) gp(a, b[e], c) } }

    function Xm(a, b) { cq(a, a, b) }

    function cq(a, b, c) {
        c(b);
        b = b.xa.o;
        for (var d = b.length, e = 0; e < d; e++) {
            var g = b[e];
            g instanceof x && cq(a, g, c)
        }
    }
    x.prototype.walkVisualTree = x.prototype.LK = function(a) { dq(this, this, a) };

    function dq(a, b, c) { c(b); if (b instanceof x) { b = b.xa.o; for (var d = b.length, e = 0; e < d; e++) dq(a, b[e], c) } }
    x.prototype.findInVisualTree = x.prototype.qu = function(a) { return eq(this, this, a) };

    function eq(a, b, c) { if (c(b)) return b; if (b instanceof x) { b = b.xa.o; for (var d = b.length, e = 0; e < d; e++) { var g = eq(a, b[e], c); if (null !== g) return g } } return null }
    x.prototype.findObject = x.prototype.Md = function(a) {
        if (this.name === a) return this;
        for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) {
            var e = b[d];
            if (e.name === a) return e;
            if (e instanceof x)
                if (null === e.ej && null === e.Ig) { if (e = e.Md(a), null !== e) return e } else if (vn(e) && (e = e.xa.first(), null !== e && (e = e.Md(a), null !== e))) return e
        }
        return null
    };

    function fq(a) {
        a = a.xa.o;
        for (var b = a.length, c = 0, d = 0; d < b; d++) {
            var e = a[d];
            if (e instanceof x) c = Math.max(c, fq(e));
            else if (e instanceof z) {
                a: {
                    if (null !== !e.bg) switch (e.$o) {
                        case "None":
                        case "Square":
                        case "Ellipse":
                        case "Circle":
                        case "LineH":
                        case "LineV":
                        case "FramedRectangle":
                        case "RoundedRectangle":
                        case "Line1":
                        case "Line2":
                        case "Border":
                        case "Cube1":
                        case "Cube2":
                        case "Junction":
                        case "Cylinder1":
                        case "Cylinder2":
                        case "Cylinder3":
                        case "Cylinder4":
                        case "PlusLine":
                        case "XLine":
                        case "ThinCross":
                        case "ThickCross":
                            e =
                                0;
                            break a
                    }
                    e = e.Rg / 2 * e.xn * e.Jj()
                }
                c = Math.max(c, e)
            }
        }
        return c
    }
    f = x.prototype;
    f.kh = function() { return !(this.type === Ro || this.type === So) };
    f.Je = function(a, b, c) {
        if (!1 === this.tg) return null;
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        if (Om(this)) return null;
        var d = this.Ga,
            e = 1 / this.Jj(),
            g = this.kh(),
            h = g ? a : kb(D.Fb(a.x, a.y), this.transform),
            k = this.g,
            l = 10,
            m = 5;
        null !== k && (l = k.Cu("extraTouchArea"), m = l / 2);
        if (Vb(-(m * e), -(m * e), d.width + l * e, d.height + l * e, h.x, h.y)) {
            if (!this.Yn) {
                var e = this.xa.o,
                    n = e.length,
                    k = D.P(),
                    m = (l = this.yq) ? this.Ld() : null;
                if (l && (m.kh() ? kb(k.set(a), m.transform) : k.set(a), !m.Pa(k))) return D.A(k), g || D.A(h), null;
                for (var p = Rp(this); n--;) {
                    var q =
                        e[n];
                    if (q.visible || q === p)
                        if (q.kh() ? kb(k.set(a), q.transform) : k.set(a), !l || q !== m) {
                            var r = null;
                            q instanceof x ? r = q.Je(k, b, c) : !0 === q.tg && q.Pa(k) && (r = q);
                            if (null !== r && (null !== b && (r = b(r)), null !== r && (null === c || c(r)))) return D.A(k), g || D.A(h), r
                        }
                }
                D.A(k)
            }
            if (null === this.background && null === this.gm) return g || D.A(h), null;
            a = Vb(0, 0, d.width, d.height, h.x, h.y) ? this : null;
            g || D.A(h);
            return a
        }
        g || D.A(h);
        return null
    };
    f.ru = function(a, b, c, d) {
        if (!1 === this.tg) return !1;
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        d instanceof K || d instanceof L || (d = new K(O));
        var e = this.Ga,
            g = this.kh(),
            h = g ? a : kb(D.Fb(a.x, a.y), this.transform);
        if (Vb(0, 0, e.width, e.height, h.x, h.y)) {
            if (!this.Yn) {
                for (var e = this.xa.o, k = e.length, l = D.P(), m = Rp(this); k--;) {
                    var n = e[k];
                    if (n.visible || n === m) {
                        n.kh() ? kb(l.set(a), n.transform) : l.set(a);
                        var p = n,
                            n = n instanceof x ? n : null;
                        (null !== n ? n.ru(l, b, c, d) : p.Pa(l)) && !1 !== p.tg && (null !== b && (p = b(p)), null === p || null !== c && !c(p) ||
                            d.add(p))
                    }
                }
                D.A(l)
            }
            g || D.A(h);
            return null !== this.background || null !== this.gm
        }
        g || D.A(h);
        return !1
    };
    f.Xk = function(a, b, c, d, e, g) {
        if (!1 === this.tg) return !1;
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        var h = g;
        void 0 === g && (h = D.hh(), h.reset());
        h.multiply(this.transform);
        if (this.In(a, h)) return gq(this, b, c, e), void 0 === g && D.lf(h), !0;
        if (this.jg(a, h)) {
            if (!this.Yn)
                for (var k = Rp(this), l = this.xa.o, m = l.length; m--;) {
                    var n = l[m];
                    if (n.visible || n === k) {
                        var p = n.aa,
                            q = this.Ga;
                        if (!(p.x > q.width || p.y > q.height || 0 > p.x + p.width || 0 > p.y + p.height)) {
                            p = n;
                            n = n instanceof x ? n : null;
                            q = D.hh();
                            q.set(h);
                            if (null !== n ? n.Xk(a, b, c, d, e, q) : Lo(p, a, d,
                                    q)) null !== b && (p = b(p)), null === p || null !== c && !c(p) || e.add(p);
                            D.lf(q)
                        }
                    }
                }
            void 0 === g && D.lf(h);
            return d
        }
        void 0 === g && D.lf(h);
        return !1
    };

    function gq(a, b, c, d) {
        for (var e = a.xa.o, g = e.length; g--;) {
            var h = e[g];
            if (h.visible) {
                var k = h.aa,
                    l = a.Ga;
                k.x > l.width || k.y > l.height || 0 > k.x + k.width || 0 > k.y + k.height || (h instanceof x && gq(h, b, c, d), null !== b && (h = b(h)), null === h || null !== c && !c(h) || d.add(h))
            }
        }
    }
    f.Pn = function(a, b, c, d, e, g) {
        if (!1 === this.tg) return !1;
        void 0 === c && (c = null);
        void 0 === d && (d = null);
        var h = this.Ga,
            k = this.kh(),
            l = k ? a : kb(D.Fb(a.x, a.y), this.transform),
            m = k ? b : kb(D.Fb(b.x, b.y), this.transform),
            n = l.Kf(m),
            p = 0 < l.x && l.x < h.width && 0 < l.y && l.y < h.height || lb(l.x, l.y, 0, 0, 0, h.height) < n || lb(l.x, l.y, 0, h.height, h.width, h.height) < n || lb(l.x, l.y, h.width, h.height, h.width, 0) < n || lb(l.x, l.y, h.width, 0, 0, 0) < n,
            h = 0 < l.x && l.x < h.width && 0 < l.y && l.y < h.height && lb(l.x, l.y, 0, 0, 0, h.height) < n && lb(l.x, l.y, 0, h.height, h.width, h.height) <
            n && lb(l.x, l.y, h.width, h.height, h.width, 0) < n && lb(l.x, l.y, h.width, 0, 0, 0) < n;
        k || (D.A(l), D.A(m));
        if (p) {
            if (!this.Yn) {
                for (var l = D.P(), m = D.P(), n = Rp(this), q = this.xa.o, r = q.length; r--;) {
                    var s = q[r];
                    if (s.visible || s === n) {
                        var u = s.aa,
                            t = this.Ga;
                        if (!k || !(u.x > t.width || u.y > t.height || 0 > u.x + u.width || 0 > u.y + u.height))
                            if (s.kh() ? (u = s.transform, kb(l.set(a), u), kb(m.set(b), u)) : (l.set(a), m.set(b)), u = s, s = s instanceof x ? s : null, null !== s ? s.Pn(l, m, c, d, e, g) : u.JF(l, m, e)) null !== c && (u = c(u)), null === u || null !== d && !d(u) || g.add(u)
                    }
                }
                D.A(l);
                D.A(m)
            }
            return e ? p : h
        }
        return !1
    };

    function Sp(a) {
        var b = null;
        a instanceof z && (b = a.C, b === Vc && (b = null), a = a.vf, null !== a && null === b && (b = a.C));
        null === b && (b = ec);
        return b
    }

    function Tp(a) {
        var b = null;
        a instanceof z && (b = a.D, b === Vc && (b = null), a = a.vf, null !== a && null === b && (b = a.D));
        null === b && (b = vc);
        return b
    }
    x.prototype.add = x.prototype.add = function(a) {
        D.l(a, O, x, "add:element");
        this.be(this.xa.count, a)
    };
    x.prototype.elt = x.prototype.fa = function(a) { return this.xa.fa(a) };
    x.prototype.insertAt = x.prototype.be = function(a, b) {
        b instanceof F && D.k("Cannot add a Part to a Panel: " + b + "; use a Panel instead");
        if (this === b || this.xm(b)) this === b && D.k("Cannot make a Panel contain itself: " + this.toString()), D.k("Cannot make a Panel indirectly contain itself: " + this.toString() + " already contains " + b.toString());
        var c = b.R;
        null !== c && c !== this && D.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: " + b.toString() + ", already contained by " + c.toString() + ", cannot be shared by this Panel: " +
            this.toString());
        this.da !== Sl || b instanceof z || D.k("Can only add Shapes to a Grid Panel, not: " + b);
        this.da !== pp || b instanceof z || b instanceof pa || D.k("Can only add Shapes or TextBlocks to a Graduated Panel, not: " + b);
        b.Bm(this);
        b.mn = null;
        if (null !== this.el) {
            var d = b.data;
            null !== d && "object" === typeof d && (null === this.Hg && (this.Hg = new oa(Object, x)), this.Hg.add(d, b))
        }
        var e = this.xa,
            d = -1;
        if (c === this) {
            for (var g = -1, h = this.xa.o, k = h.length, l = 0; l < k; l++)
                if (h[l] === b) { g = l; break }
            if (-1 !== g) {
                if (g === a || g + 1 >= e.count &&
                    a >= e.count) return;
                e.pd(g);
                d = g
            } else D.k("element " + b.toString() + " has panel " + c.toString() + " but is not contained by it.")
        }
        if (0 > a || a > e.count) a = e.count;
        e.be(a, b);
        if (0 === a || b.Ue) this.Xl = null;
        this.K();
        b.K();
        null !== b.yd ? this.bl = !0 : b instanceof x && !0 === b.bl && (this.bl = !0);
        this.pk = null;
        c = this.Y;
        null !== c && (c.Sl = null, c.zk = NaN, this.bl && c instanceof G && (c.bl = !0), c.bl && c instanceof G && (c.Ae = null), e = this.g, null !== e && e.na.ub || (-1 !== d && c.od(ig, "elements", this, b, null, d, null), c.od(hg, "elements", this, null, b, null, a),
            this.Ju() || hq(this, b, !1)))
    };
    D.defineProperty(x, { bl: null }, function() { return 0 !== (this.S & 8388608) }, function(a) { 0 !== (this.S & 8388608) !== a && (this.S ^= 8388608) });

    function iq(a, b) { a.S = b ? a.S | 16777216 : a.S & -16777217 }
    x.prototype.remove = x.prototype.remove = function(a) {
        D.l(a, O, x, "remove:element");
        for (var b = this.xa.o, c = b.length, d = -1, e = 0; e < c; e++)
            if (b[e] === a) { d = e; break } - 1 !== d && this.yf(d, !0)
    };
    x.prototype.removeAt = x.prototype.pd = function(a) {
        v && D.p(a, x, "removeAt:idx");
        0 <= a && this.yf(a, !0)
    };
    x.prototype.yf = function(a, b) {
        var c = this.xa,
            d = c.fa(a);
        d.mn = null;
        d.Bm(null);
        if (null !== this.Hg) { var e = d.data; "object" === typeof e && this.Hg.remove(e) }
        c.pd(a);
        km(this, !1);
        this.K();
        this.Xl === d && (this.Xl = null);
        this.pk = null;
        var g = this.Y;
        null !== g && (g.Sl = null, g.zk = NaN, g.pe(), g instanceof G && (d instanceof x ? gp(d, d, function(a, c) { dp(g, c, b) }) : dp(g, d, b)), c = this.g, null !== c && c.na.ub || g.od(ig, "elements", this, d, null, a, null))
    };
    D.w(x, { Tq: "rowCount" }, function() { return void 0 === this.hd ? 0 : this.hd.length });
    x.prototype.getRowDefinition = x.prototype.oe = function(a) {
        v && D.p(a, x, "getRowDefinition:idx");
        0 > a && D.ua(a, ">= 0", x, "getRowDefinition:idx");
        a = Math.round(a);
        var b = this.hd;
        if (void 0 === b[a]) {
            var c = new jh;
            c.Bm(this);
            c.Ke = !0;
            c.index = a;
            b[a] = c
        }
        return b[a]
    };
    x.prototype.removeRowDefinition = x.prototype.LG = function(a) {
        v && D.p(a, x, "removeRowDefinition:idx");
        0 > a && D.ua(a, ">= 0", x, "removeRowDefinition:idx");
        a = Math.round(a);
        var b = this.hd;
        this.od(ig, "coldefs", this, b[a], null, a, null);
        b[a] && delete b[a];
        this.K()
    };
    D.w(x, { fq: "columnCount" }, function() { return void 0 === this.cd ? 0 : this.cd.length });
    x.prototype.getColumnDefinition = x.prototype.ne = function(a) {
        v && D.p(a, x, "getColumnDefinition:idx");
        0 > a && D.ua(a, ">= 0", x, "getColumnDefinition:idx");
        a = Math.round(a);
        var b = this.cd;
        if (void 0 === b[a]) {
            var c = new jh;
            c.Bm(this);
            c.Ke = !1;
            c.index = a;
            b[a] = c
        }
        return b[a]
    };
    x.prototype.removeColumnDefinition = x.prototype.JG = function(a) {
        v && D.p(a, x, "removeColumnDefinition:idx");
        0 > a && D.ua(a, ">= 0", x, "removeColumnDefinition:idx");
        a = Math.round(a);
        var b = this.cd;
        this.od(ig, "coldefs", this, b[a], null, a, null);
        b[a] && delete b[a];
        this.K()
    };
    D.defineProperty(x, { mK: "rowSizing" }, function() { return void 0 === this.pn ? op : this.pn }, function(a) {
        if (void 0 !== this.pn) {
            var b = this.pn;
            b !== a && (a !== op && a !== Vp && D.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: " + a), this.pn = a, this.K(), this.i("rowSizing", b, a))
        }
    });
    D.defineProperty(x, { jI: "columnSizing" }, function() { return void 0 === this.Pm ? op : this.Pm }, function(a) {
        if (void 0 !== this.Pm) {
            var b = this.Pm;
            b !== a && (a !== op && a !== Vp && D.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: " + a), this.Pm = a, this.K(), this.i("columnSizing", b, a))
        }
    });
    D.defineProperty(x, { qH: "topIndex" }, function() { return void 0 === this.xj ? 0 : this.xj }, function(a) {
        if (void 0 !== this.xj) {
            var b = this.xj;
            b !== a && ((!isFinite(a) || 0 > a) && D.k("Panel.topIndex must be greater than zero and a real number, not: " + a), this.xj = a, this.K(), this.i("topIndex", b, a))
        }
    });
    D.defineProperty(x, { sG: "leftIndex" }, function() { return void 0 === this.hj ? 0 : this.hj }, function(a) {
        if (void 0 !== this.hj) {
            var b = this.hj;
            b !== a && ((!isFinite(a) || 0 > a) && D.k("Panel.leftIndex must be greater than zero and a real number, not: " + a), this.hj = a, this.K(), this.i("leftIndex", b, a))
        }
    });
    x.prototype.findRowForLocalY = function(a) { if (0 > a || this.type !== fa) return -1; for (var b = 0, c = this.hd, d = c.length, e = this.xj; e < d; e++) { var g = c[e]; if (void 0 !== g && (b += g.total, a < b)) break } return e };
    x.prototype.findColumnForLocalX = function(a) { if (0 > a || this.type !== fa) return -1; for (var b = 0, c = this.cd, d = c.length, e = this.hj; e < d; e++) { var g = c[e]; if (void 0 !== g && (b += g.total, a < b)) break } return e };
    x.prototype.graduatedPointForValue = function(a, b) {
        void 0 === b && (b = new N(NaN, NaN));
        if (this.type !== pp) return b.n(NaN, NaN), b;
        a = Math.min(Math.max(a, this.al), this.gB);
        var c = (a - this.al) / this.Du,
            d = this.Ld();
        d.vf.XI(c, b);
        return d.transform.vb(b)
    };
    x.prototype.graduatedValueForPoint = function(a) {
        if (this.type !== pp) return NaN;
        var b = this.Ld(),
            c = b.vf;
        b.transform.Oh(a);
        return c.TI(a) * this.Du + this.al
    };
    D.defineProperty(x, { data: "data" }, function() { return this.Sd }, function(a) {
        var b = this.Sd;
        if (b !== a) {
            var c = this instanceof F && !(this instanceof da);
            c && D.h(a, "object", x, "data");
            Sh(this);
            this.Sd = a;
            var d = this.g;
            null !== d && (c ? this instanceof J ? (null !== b && d.gk.remove(b), null !== a && d.gk.add(a, this)) : this instanceof F && (null !== b && d.Vi.remove(b), null !== a && d.Vi.add(a, this)) : (c = this.R, null !== c && null !== c.Hg && (null !== b && c.Hg.remove(b), null !== a && c.Hg.add(a, this))));
            this.i("data", b, a);
            null !== d && d.na.ub || null !== a && this.Ob()
        }
    });
    D.defineProperty(x, { Qu: "itemIndex" }, function() { return this.xs }, function(a) {
        var b = this.xs;
        b !== a && (this.xs = a, this.i("itemIndex", b, a))
    });

    function hp(a) { a = a.zl; return null !== a && a.J }

    function Sh(a) {
        var b = a.zl;
        if (null === b) null !== a.data && D.k("Template cannot have .data be non-null: " + a), a.zl = b = new K(ph);
        else if (b.J) return;
        var c = new K(O);
        iq(a, !1);
        gp(a, a, function(a, d) {
            var e = d.Hc;
            if (null !== e)
                for (cp(d, !1), e = e.j; e.next();) {
                    var g = e.value;
                    g.mode === rh && cp(d, !0);
                    var h = g.$q;
                    null !== h && ("/" === h && iq(a, !0), h = sh(g, a, d), null !== h && (c.add(h), null === h.Lp && (h.Lp = new K(ph)), h.Lp.add(g)));
                    b.add(g)
                }
            if (d instanceof x && d.type === fa) {
                if (0 < d.hd.length)
                    for (e = d.hd, g = e.length, h = 0; h < g; h++) {
                        var k = e[h];
                        if (void 0 !==
                            k && null !== k.Hc)
                            for (var l = k.Hc.j; l.next();) {
                                var t = l.value;
                                t.Sg = k;
                                t.Pt = 2;
                                t.Tp = k.index;
                                b.add(t)
                            }
                    }
                if (0 < d.cd.length)
                    for (e = d.cd, g = e.length, h = 0; h < g; h++)
                        if (k = e[h], void 0 !== k && null !== k.Hc)
                            for (l = k.Hc.j; l.next();) t = l.value, t.Sg = k, t.Pt = 1, t.Tp = k.index, b.add(t)
            }
        });
        for (var d = c.j; d.next();) {
            var e = d.value;
            if (null !== e.Lp) {
                cp(e, !0);
                for (var g = e.Lp.j; g.next();) {
                    var h = g.value;
                    null === e.Hc && (e.Hc = new K(ph));
                    e.Hc.add(h)
                }
            }
            e.Lp = null
        }
        for (d = b.j; d.next();)
            if (e = d.value, g = e.Sg, null !== g) {
                e.Sg = null;
                var k = e.tv,
                    l = k.indexOf(".");
                0 < l &&
                    g instanceof x && (h = k.substring(0, l), k = k.substr(l + 1), l = g.Md(h), null !== l ? (g = l, e.tv = k) : D.trace('Warning: unable to find GraphObject named "' + h + '" for Binding: ' + e.toString()));
                g instanceof jh ? (e.Fm = D.Nd(g.R), g.R.Jo = e.Fm) : (e.Fm = D.Nd(g), g.Jo = e.Fm)
            }
        b.freeze();
        a instanceof F && (a.qe() && a.kf(), v && !jq && gp(a, a, function(a, c) {
            if (c instanceof x && (c.type === Pl || c.type === Xj || c.type === pp) && 1 >= c.elements.count && !(c instanceof F)) {
                if (1 === c.elements.count) {
                    var d = null !== c.el;
                    if (!d)
                        for (var e = b.j; e.next();)
                            if ("itemArray" ===
                                e.value.tv) { d = !0; break }
                }
                d || (D.trace("Auto, Spot, or Graduated Panel should not have zero or one elements: " + c.toString() + " in " + a.toString()), jq = !0)
            }
        }))
    }
    var jq = !1;
    x.prototype.copyTemplate = function() {
        var a = this.copy();
        a.LK(function(a) {
            a instanceof x && (a.zl = null, a.Sd = null);
            var c = a.Hc;
            null !== c && (a.Hc = null, c.each(function(c) { a.bind(c.copy()) }))
        });
        return a
    };
    x.prototype.updateTargetBindings = x.prototype.Ob = function(a) {
        var b = this.zl;
        if (null !== b)
            for (void 0 === a && (a = ""), b = b.j; b.next();) {
                var c = b.value,
                    d = c.gH;
                if ("" === a || "" === d || d === a)
                    if (d = c.tv, null !== c.pI || "" !== d) {
                        var d = this.data,
                            e = c.$q;
                        if (null !== e) d = "" === e ? this : "/" === e ? this : "." === e ? this : ".." === e ? this : this.Md(e);
                        else {
                            var g = this.g;
                            null !== g && c.ly && (d = g.ea.fl)
                        }
                        if (null === d) v && D.trace("Binding error: missing GraphObject named " + e + " in " + this.toString());
                        else {
                            var g = this,
                                h = c.Fm;
                            if (-1 !== h) { if (g = this.Vx(h), null === g) continue } else null !==
                                c.Sg && (g = c.Sg);
                            "/" === e ? d = g.Y : "." === e ? d = g : ".." === e && (d = g.R);
                            e = c.Pt;
                            if (0 !== e) {
                                if (!(g instanceof x)) continue;
                                h = g;
                                1 === e ? g = h.ne(c.Tp) : 2 === e && (g = h.oe(c.Tp))
                            }
                            void 0 !== g && c.wH(g, d)
                        }
                    }
            }
    };
    D.defineProperty(x, { el: "itemArray" }, function() { return this.ej }, function(a) {
        var b = this.ej;
        if (b !== a) {
            v && null !== a && !D.isArray(a) && D.k("Panel.itemArray must be an Array-like object or null, not: " + a);
            var c = this.g;
            null !== c && null !== b && cn(c, this);
            this.ej = a;
            null !== c && null !== a && Zm(c, this);
            this.i("itemArray", b, a);
            null !== c && c.na.ub || this.PB()
        }
    });

    function vn(a) { return a.type === Xj || a.type === Pl || a.type === sj || a.type === fa && 0 < a.xa.length && (a = a.xa.fa(0), a.Ue && a instanceof x && (a.type === Ro || a.type === So)) ? !0 : !1 }
    x.prototype.rebuildItemElements = x.prototype.PB = function() {
        var a = 0;
        for (vn(this) && (a = 1); this.xa.length > a;) this.yf(this.xa.length - 1, !1);
        a = this.el;
        if (null !== a)
            for (var b = D.cb(a), c = 0; c < b; c++) un(this, D.La(a, c), c)
    };
    x.prototype.findItemPanelForData = x.prototype.MI = function(a) {
        if (void 0 === a || null === a || null === this.Hg) return null;
        D.h(a, "object", x, "findItemPanelForData");
        return this.Hg.oa(a)
    };

    function un(a, b, c) {
        if (!(void 0 === b || null === b || 0 > c)) {
            var d;
            d = kq(a, b);
            var e = a.wJ,
                g = null;
            null !== e && (g = e.oa(d));
            null === g && (lq || (lq = !0, D.trace('No item template Panel found for category "' + d + '" on ' + a), D.trace("  Using default item template."), d = new x, e = new pa, e.bind(new ph("text", "", ia)), d.add(e), mq = d), g = mq);
            d = g;
            null !== d && (Sh(d), d = d.copy(), 0 !== (d.S & 16777216) && (e = a.qm(), null !== e && iq(e, !0)), "object" === typeof b && (null === a.Hg && (a.Hg = new oa(Object, x)), a.Hg.add(b, d)), e = c, vn(a) && e++, a.be(e, d), d.Sd = b, wn(a, e,
                c), d.Sd = null, d.data = b)
        }
    }

    function wn(a, b, c) {
        for (a = a.xa; b < a.length;) {
            var d = a.fa(b);
            if (d instanceof x) {
                var e = b,
                    g = c;
                d.type === Ro ? d.Sb = e : d.type === So && (d.column = e);
                d.Qu = g
            }
            b++;
            c++
        }
    }
    D.defineProperty(x, { ZL: "itemTemplate" }, function() { return null === this.Ig ? null : this.Ig.oa("") }, function(a) {
        if (null === this.Ig) {
            if (null === a) return;
            this.Ig = new oa("string", x)
        }
        var b = this.Ig.oa("");
        b !== a && (D.l(a, x, x, "itemTemplate"), (a instanceof F || a.Ue) && D.k("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: " + a), this.Ig.add("", a), this.i("itemTemplate", b, a), a = this.g, null !== a && a.na.ub || this.PB())
    });
    D.defineProperty(x, { wJ: "itemTemplateMap" }, function() { return this.Ig }, function(a) {
        var b = this.Ig;
        if (b !== a) {
            D.l(a, oa, x, "itemTemplateMap");
            for (var c = a.j; c.next();) {
                var d = c.value;
                (d instanceof F || d.Ue) && D.k("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: " + d)
            }
            this.Ig = a;
            this.i("itemTemplateMap", b, a);
            a = this.g;
            null !== a && a.na.ub || this.PB()
        }
    });
    D.defineProperty(x, { oG: "itemCategoryProperty" }, function() { return this.op }, function(a) {
        var b = this.op;
        b !== a && ("string" !== typeof a && "function" !== typeof a && D.kc(a, "string or function", x, "itemCategoryProperty"), this.op = a, this.i("itemCategoryProperty", b, a))
    });

    function kq(a, b) {
        if (null === b) return "";
        var c = a.op,
            d = "";
        if ("function" === typeof c) d = c(b);
        else if ("string" === typeof c && "object" === typeof b) {
            if ("" === c) return "";
            d = D.xb(b, c)
        } else return "";
        if (void 0 === d) return "";
        if ("string" === typeof d) return d;
        D.k("Panel.getCategoryForItemData found a non-string category for " + b + ": " + d);
        return ""
    }
    var lq = !1,
        mq = null;
    D.defineProperty(x, { Yn: "isAtomic" }, function() { return 0 !== (this.S & 1048576) }, function(a) {
        var b = 0 !== (this.S & 1048576);
        b !== a && (D.h(a, "boolean", x, "isAtomic"), this.S ^= 1048576, this.i("isAtomic", b, a))
    });
    D.defineProperty(x, { yq: "isClipping" }, function() { return 0 !== (this.S & 2097152) }, function(a) {
        var b = 0 !== (this.S & 2097152);
        b !== a && (D.h(a, "boolean", x, "isClipping"), this.S ^= 2097152, this.K(), this.i("isClipping", b, a))
    });
    D.defineProperty(x, { lG: "isOpposite" }, function() { return 0 !== (this.S & 33554432) }, function(a) {
        var b = 0 !== (this.S & 33554432);
        b !== a && (D.h(a, "boolean", x, "isOpposite"), this.S ^= 33554432, this.K(), this.i("isOpposite", b, a))
    });
    D.defineProperty(x, { isEnabled: "isEnabled" }, function() { return 0 !== (this.S & 4194304) }, function(a) {
        var b = 0 !== (this.S & 4194304);
        if (b !== a) {
            D.h(a, "boolean", x, "isEnabled");
            var c = null === this.R || this.R.Ju();
            this.S ^= 4194304;
            this.i("isEnabled", b, a);
            b = this.g;
            null !== b && b.na.ub || c && hq(this, this, a)
        }
    });

    function hq(a, b, c) {
        var d = b.CF;
        null !== d && d(b, c);
        if (b instanceof x) {
            b = b.xa.o;
            for (var d = b.length, e = 0; e < d; e++) {
                var g = b[e];
                c && g instanceof x && !g.isEnabled || hq(a, g, c)
            }
        }
    }
    D.defineProperty(x, { RK: "alignmentFocusName" }, function() { return this.dk }, function(a) {
        var b = this.dk;
        b !== a && (v && D.h(a, "string", x, "alignmentFocusName"), this.dk = a, this.K(), this.i("alignmentFocusName", b, a))
    });

    function jh() {
        D.xc(this);
        this.rj = null;
        this.sw = !0;
        this.Ic = 0;
        this.uf = NaN;
        this.Bk = 0;
        this.Ak = Infinity;
        this.ue = Vc;
        this.sb = this.Ya = 0;
        this.Hc = null;
        this.It = nq;
        this.Qg = wo;
        this.Dt = this.Fk = null;
        this.Et = NaN;
        this.Mb = this.qi = null;
        this.Er = !1
    }
    D.ka("RowColumnDefinition", jh);
    jh.prototype.copy = function() {
        var a = new jh;
        a.sw = this.sw;
        a.Ic = this.Ic;
        a.uf = this.uf;
        a.Bk = this.Bk;
        a.Ak = this.Ak;
        a.ue = this.ue;
        a.Ya = this.Ya;
        a.sb = this.sb;
        a.Qg = this.Qg;
        a.It = this.It;
        a.Fk = null === this.Fk ? null : this.Fk.V();
        a.Dt = this.Dt;
        a.Et = this.Et;
        a.qi = null;
        null !== this.qi && (a.qi = D.km(this.qi));
        a.Mb = this.Mb;
        a.Er = this.Er;
        a.Hc = this.Hc;
        return a
    };
    jh.prototype.gq = function(a) {
        D.l(a, jh, jh, "copyFrom:pd");
        a.Ke ? this.height = a.height : this.width = a.width;
        this.Th = a.Th;
        this.se = a.se;
        this.alignment = a.alignment;
        this.stretch = a.stretch;
        this.qv = a.qv;
        this.Fk = null === a.Fk ? null : a.Fk.V();
        this.Vq = a.Vq;
        this.Wq = a.Wq;
        this.qi = null;
        a.qi && (this.qi = D.km(a.qi));
        this.background = a.background;
        this.RA = a.RA;
        this.Hc = a.Hc
    };
    jh.prototype.qc = function(a) { a.Qe === jh ? this.qv = a : D.ak(this, a) };
    jh.prototype.toString = function() { return "RowColumnDefinition " + (this.Ke ? "(Row " : "(Column ") + this.index + ") #" + D.Nd(this) };
    var nq;
    jh.Default = nq = D.s(jh, "Default", 0);
    var Vp;
    jh.None = Vp = D.s(jh, "None", 1);
    var op;
    jh.ProportionalExtra = op = D.s(jh, "ProportionalExtra", 2);
    jh.prototype.Bm = function(a) { this.rj = a };
    jh.prototype.computeEffectiveSpacingTop = jh.prototype.jF = function() {
        var a = 0,
            b = this.rj,
            c = 0,
            d = this.Ke;
        if (null !== b)
            for (var e = d ? b.hd.length : b.cd.length, g = 0; g < e; g++) { var h = d ? b.hd[g] : b.cd[g]; if (void 0 !== h) { c = h.index; break } }
        this.index !== c && (c = this.Vq, null === c && null !== b && (c = this.Ke ? b.Wi : b.di), null !== c && (a = this.Wq, isNaN(a) && (a = null !== b ? this.Ke ? b.fi : b.ei : 0)));
        c = this.aH;
        if (null === c)
            if (null !== b) c = b.hk;
            else return a;
        return a + (this.Ke ? c.top : c.left)
    };
    jh.prototype.computeEffectiveSpacing = jh.prototype.hf = function() {
        var a = 0,
            b = this.rj,
            c = 0,
            d = this.Ke;
        if (null !== b)
            for (var e = d ? b.hd.length : b.cd.length, g = 0; g < e; g++) { var h = d ? b.hd[g] : b.cd[g]; if (void 0 !== h) { c = h.index; break } }
        this.index !== c && (c = this.Vq, null === c && null !== b && (c = d ? b.Wi : b.di), null !== c && (a = this.Wq, isNaN(a) && (a = null !== b ? d ? b.fi : b.ei : 0)));
        d = this.aH;
        if (null === d)
            if (null !== b) d = b.hk;
            else return a;
        return a + (this.Ke ? d.top + d.bottom : d.left + d.right)
    };
    jh.prototype.vd = function(a, b, c, d, e) {
        var g = this.rj;
        if (null !== g && (g.od(fg, a, this, b, c, d, e), null !== this.Hc && (b = g.g, null !== b && !b.Xe && (g = g.qm(), null !== g && (b = g.data, null !== b)))))
            for (c = this.Hc.j; c.next();) c.value.Wy(this, b, a, g)
    };
    D.w(jh, { R: "panel" }, function() { return this.rj });
    D.defineProperty(jh, { Ke: "isRow" }, function() { return this.sw }, function(a) { this.sw = a });
    D.defineProperty(jh, { index: "index" }, function() { return this.Ic }, function(a) { this.Ic = a });
    D.defineProperty(jh, { height: "height" }, function() { return this.uf }, function(a) {
        var b = this.uf;
        b !== a && (v && D.h(a, "number", jh, "height"), 0 > a && D.ua(a, ">= 0", jh, "height"), this.uf = a, this.hb = this.Ya, null !== this.R && this.R.K(), this.vd("height", b, a))
    });
    D.defineProperty(jh, { width: "width" }, function() { return this.uf }, function(a) {
        var b = this.uf;
        b !== a && (v && D.h(a, "number", jh, "width"), 0 > a && D.ua(a, ">= 0", jh, "width"), this.uf = a, this.hb = this.Ya, null !== this.R && this.R.K(), this.vd("width", b, a))
    });
    D.defineProperty(jh, { Th: "minimum" }, function() { return this.Bk }, function(a) {
        var b = this.Bk;
        b !== a && (v && D.h(a, "number", jh, "minimum"), (0 > a || !isFinite(a)) && D.ua(a, ">= 0", jh, "minimum"), this.Bk = a, this.hb = this.Ya, null !== this.R && this.R.K(), this.vd("minimum", b, a))
    });
    D.defineProperty(jh, { se: "maximum" }, function() { return this.Ak }, function(a) {
        var b = this.Ak;
        b !== a && (v && D.h(a, "number", jh, "maximum"), 0 > a && D.ua(a, ">= 0", jh, "maximum"), this.Ak = a, this.hb = this.Ya, null !== this.R && this.R.K(), this.vd("maximum", b, a))
    });
    D.defineProperty(jh, { alignment: "alignment" }, function() { return this.ue }, function(a) {
        var b = this.ue;
        b.O(a) || (v && D.l(a, S, jh, "alignment"), this.ue = a.V(), null !== this.R && this.R.K(), this.vd("alignment", b, a))
    });
    D.defineProperty(jh, { stretch: "stretch" }, function() { return this.Qg }, function(a) {
        var b = this.Qg;
        b !== a && (v && D.Da(a, O, jh, "stretch"), this.Qg = a, null !== this.R && this.R.K(), this.vd("stretch", b, a))
    });
    D.defineProperty(jh, { aH: "separatorPadding" }, function() { return this.Fk }, function(a) {
        "number" === typeof a ? a = new Lb(a) : null !== a && v && D.l(a, Lb, jh, "separatorPadding");
        var b = this.Fk;
        null !== a && null !== b && b.O(a) || (null !== a && (a = a.V()), this.Fk = a, null !== this.R && this.R.K(), this.vd("separatorPadding", b, a))
    });
    D.defineProperty(jh, { Vq: "separatorStroke" }, function() { return this.Dt }, function(a) {
        var b = this.Dt;
        b !== a && (null === a || "string" === typeof a || a instanceof Ba) && (a instanceof Ba && a.freeze(), this.Dt = a, null !== this.R && this.R.K(), this.vd("separatorStroke", b, a))
    });
    D.defineProperty(jh, { Wq: "separatorStrokeWidth" }, function() { return this.Et }, function(a) {
        var b = this.Et;
        b !== a && (this.Et = a, null !== this.R && this.R.K(), this.vd("separatorStrokeWidth", b, a))
    });
    D.defineProperty(jh, { EM: "separatorDashArray" }, function() { return this.qi }, function(a) {
        var b = this.qi;
        if (b !== a) {
            null === a || Array.isArray(a) || D.kc(a, "Array", jh, "separatorDashArray:value");
            if (null !== a) {
                for (var c = a.length, d = 0, e = 0; e < c; e++) {
                    var g = a[e];
                    "number" === typeof g && 0 <= g && isFinite(g) || D.k("separatorDashArray value " + g + " at index " + e + " must be a positive number or zero.");
                    d += g
                }
                if (0 === d) {
                    if (null === b) return;
                    a = null
                }
            }
            this.qi = a;
            null !== this.R && this.R.ra();
            this.vd("separatorDashArray", b, a)
        }
    });
    D.defineProperty(jh, { background: "background" }, function() { return this.Mb }, function(a) {
        var b = this.Mb;
        b !== a && (null === a || "string" === typeof a || a instanceof Ba) && (a instanceof Ba && a.freeze(), this.Mb = a, null !== this.R && this.R.ra(), this.vd("background", b, a))
    });
    D.defineProperty(jh, { RA: "coversSeparators" }, function() { return this.Er }, function(a) {
        var b = this.Er;
        b !== a && (D.h(a, "boolean", jh, "coversSeparators"), this.Er = a, null !== this.R && this.R.ra(), this.vd("coversSeparators", b, a))
    });
    D.defineProperty(jh, { qv: "sizing" }, function() { return this.It }, function(a) {
        var b = this.It;
        b !== a && (v && D.Da(a, jh, jh, "sizing"), this.It = a, null !== this.R && this.R.K(), this.vd("sizing", b, a))
    });

    function Up(a) { if (a.qv === nq) { var b = a.rj; return a.Ke ? b.mK : b.jI } return a.qv }
    D.defineProperty(jh, { hb: "actual" }, function() { return this.Ya }, function(a) { this.Ya = isNaN(this.uf) ? Math.max(Math.min(this.Ak, a), this.Bk) : Math.max(Math.min(this.Ak, this.uf), this.Bk) });
    D.defineProperty(jh, { total: "total" }, function() { return this.Ya + this.hf() }, function(a) {
        this.Ya = isNaN(this.uf) ? Math.max(Math.min(this.Ak, a), this.Bk) : Math.max(Math.min(this.Ak, this.uf), this.Bk);
        this.Ya = Math.max(0, this.Ya - this.hf())
    });
    D.defineProperty(jh, { position: "position" }, function() { return this.sb }, function(a) { this.sb = a });
    jh.prototype.bind = jh.prototype.bind = function(a) {
        a.Sg = this;
        var b = this.R;
        if (null !== b) {
            var c = b.qm();
            null !== c && hp(c) && D.k("Cannot add a Binding to a RowColumnDefinition that is already frozen: " + a + " on " + b)
        }
        null === this.Hc && (this.Hc = new K(ph));
        this.Hc.add(a)
    };

    function z() {
        O.call(this);
        this.bg = this.ab = null;
        this.$o = "None";
        this.ds = wo;
        this.Bc = this.Ud = "black";
        this.Rg = 1;
        this.Op = "butt";
        this.Qp = "miter";
        this.xn = 10;
        this.Pp = null;
        this.Hf = 0;
        this.yi = this.xi = Vc;
        this.ft = this.et = NaN;
        this.ns = !1;
        this.ht = null;
        this.cp = this.Vp = "None";
        this.Fg = 1;
        this.Eg = 0;
        this.Dg = 1
    }
    D.Ta(z, O);
    D.ka("Shape", z);
    z.prototype.cloneProtected = function(a) {
        O.prototype.cloneProtected.call(this, a);
        a.ab = this.ab;
        a.$o = this.$o;
        a.ds = this.ds;
        a.bg = this.bg;
        a.Ud = this.Ud;
        a.Bc = this.Bc;
        a.Rg = this.Rg;
        a.Op = this.Op;
        a.Qp = this.Qp;
        a.xn = this.xn;
        null !== this.Pp && (a.Pp = D.km(this.Pp));
        a.Hf = this.Hf;
        a.xi = this.xi.V();
        a.yi = this.yi.V();
        a.et = this.et;
        a.ft = this.ft;
        a.ns = this.ns;
        a.ht = this.ht;
        a.Vp = this.Vp;
        a.cp = this.cp;
        a.Fg = this.Fg;
        a.Eg = this.Eg;
        a.Dg = this.Dg
    };
    z.prototype.qc = function(a) { a === Zj || a === bk || a === ck || a === wo ? this.dB = a : O.prototype.qc.call(this, a) };
    z.prototype.toString = function() { return "Shape(" + ("None" !== this.Kb ? this.Kb : "None" !== this.ar ? this.ar : this.bB) + ")#" + D.Nd(this) };

    function oq(a, b, c, d) {
        var e = c.length;
        if (!(4 > e)) {
            for (var g = d.Fa, h = Math.max(1, g.width), g = g.height, k = c[0], l = c[1], m = 0, n = 0, p = 0, q = 0, r = 0, s = 0, u = q = 0, t = D.mb(), y = 2; y < e; y += 2) m = c[y], n = c[y + 1], p = m - k, q = n - l, 0 === p && (p = .001), r = q / p, s = Math.atan2(q, p), q = Math.sqrt(p * p + q * q), t.push([p, s, r, q]), u += q, k = m, l = n;
            k = c[0];
            l = c[1];
            p = d.Fa.width;
            d instanceof z && (p -= d.lb);
            1 > p && (p = 1);
            for (var e = c = p, m = h / 2, n = 0 === m ? !1 : !0, y = 0, q = t[y], p = q[0], s = q[1], r = q[2], q = q[3], w = 0; .1 <= u;) {
                0 === w && (n ? (e = c, e -= m, u -= m, n = !1) : e = c, 0 === e && (e = 1));
                if (e > u) { D.ya(t); return }
                e >
                    q ? (w = e - q, e = q) : w = 0;
                var A = Math.sqrt(e * e / (1 + r * r));
                0 > p && (A = -A);
                k += A;
                l += r * A;
                a.translate(k, l);
                a.rotate(s);
                a.translate(-(h / 2), -(g / 2));
                0 === w && d.Wk(a, b);
                a.translate(h / 2, g / 2);
                a.rotate(-s);
                a.translate(-k, -l);
                u -= e;
                q -= e;
                if (0 !== w) {
                    y++;
                    if (y === t.length) { D.ya(t); return }
                    q = t[y];
                    p = q[0];
                    s = q[1];
                    r = q[2];
                    q = q[3];
                    e = w
                }
            }
            D.ya(t)
        }
    }
    z.prototype.Wk = function(a, b) {
        if (null !== this.Bc || null !== this.Ud) {
            null !== this.Ud && Vo(this, a, this.Ud, !0, !1);
            null !== this.Bc && Vo(this, a, this.Bc, !1, !1);
            var c = this.Rg;
            if (0 === c) {
                var d = this.Y;
                d instanceof da && d.type === sj && "Selection" === d.Kd && d.Bb instanceof z && d.If.Ld() === d.Bb && (c = d.Bb.lb)
            }
            a.lineWidth = c;
            a.lineJoin = this.Qp;
            a.lineCap = this.Op;
            a.miterLimit = this.xn;
            var e = !1;
            this.Y && b.Kj("drawShadows") && (e = this.Y.dl);
            var g = !0;
            null !== this.Bc && null === this.Ud && (g = !1);
            var d = !1,
                h = !0,
                k = this.jH;
            null !== k && (d = !0, h = a.YA(k,
                this.Hf));
            var l = this.ab;
            if (null !== l) {
                if (l.da === Ze) a.beginPath(), d && !h ? Go(a, l.Ac, l.Mc, l.Cb, l.Jb, k, this.Hf) : (a.moveTo(l.Ac, l.Mc), a.lineTo(l.Cb, l.Jb)), null !== this.Ud && a.Xg(this.Ud), 0 !== c && null !== this.Bc && a.Zj();
                else if (l.da === tf) {
                    var m = l.Ac,
                        n = l.Mc,
                        p = l.Cb,
                        q = l.Jb,
                        l = Math.min(m, p),
                        r = Math.min(n, q),
                        m = Math.abs(p - m),
                        n = Math.abs(q - n);
                    null !== this.Ud && (a.beginPath(), a.rect(l, r, m, n), a.Xg(this.Ud));
                    if (null !== this.Bc) {
                        var s = p = 0,
                            u = 0;
                        g && e && (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY =
                            0, a.shadowBlur = 0);
                        d && !h ? (h = D.mb(), h.push(l), h.push(r), h.push(l + m), h.push(r), h.push(l + m), h.push(r + n), h.push(l), h.push(r + n), h.push(l), h.push(r), a.beginPath(), pq(a, h, k, this.Hf), a.Zj(), D.ya(h)) : 0 !== c && (a.beginPath(), a.rect(l, r, m, n), a.Zj());
                        g && e && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u)
                    }
                } else if (l.da === uf) m = l.Ac, n = l.Mc, p = l.Cb, q = l.Jb, l = Math.abs(p - m) / 2, r = Math.abs(q - n) / 2, m = Math.min(m, p) + l, n = Math.min(n, q) + r, a.beginPath(), a.moveTo(m, n - r), a.bezierCurveTo(m + Jd * l, n - r, m + l, n - Jd * r, m + l, n), a.bezierCurveTo(m +
                    l, n + Jd * r, m + Jd * l, n + r, m, n + r), a.bezierCurveTo(m - Jd * l, n + r, m - l, n + Jd * r, m - l, n), a.bezierCurveTo(m - l, n - Jd * r, m - Jd * l, n - r, m, n - r), a.closePath(), null !== this.Ud && a.Xg(this.Ud), d && !h && (h = D.mb(), Be(m, n - r, m + Jd * l, n - r, m + l, n - Jd * r, m + l, n, .5, h), Be(m + l, n, m + l, n + Jd * r, m + Jd * l, n + r, m, n + r, .5, h), Be(m, n + r, m - Jd * l, n + r, m - l, n + Jd * r, m - l, n, .5, h), Be(m - l, n, m - l, n - Jd * r, m - Jd * l, n - r, m, n - r, .5, h), a.beginPath(), pq(a, h, k, this.Hf), D.ya(h)), 0 !== c && null !== this.Bc && (g && e ? (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY =
                    0, a.shadowBlur = 0, a.Zj(), a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u) : a.Zj());
                else if (l.da === We) {
                    r = l.jk;
                    n = r.length;
                    for (q = 0; q < n; q++) {
                        m = r.o[q];
                        a.beginPath();
                        a.moveTo(m.la, m.ja);
                        for (var p = m.Eb.o, s = p.length, t = null, u = 0; u < s; u++) {
                            var y = p[u];
                            switch (y.da) {
                                case Ef:
                                    a.moveTo(y.F, y.G);
                                    break;
                                case wf:
                                    a.lineTo(y.F, y.G);
                                    break;
                                case Ff:
                                    a.bezierCurveTo(y.Vd, y.ff, y.Ch, y.Og, y.Cb, y.Jb);
                                    break;
                                case Gf:
                                    a.quadraticCurveTo(y.Vd, y.ff, y.Cb, y.Jb);
                                    break;
                                case Hf:
                                    if (y.radiusX === y.radiusY) t = Math.PI / 180, a.arc(y.Vd, y.ff, y.radiusX,
                                        y.Me * t, (y.Me + y.Df) * t, 0 > y.Df);
                                    else {
                                        var t = Vf(y, m),
                                            w = t.length;
                                        if (0 === w) { a.lineTo(y.pa, y.va); break }
                                        for (var A = 0; A < w; A++) {
                                            var B = t[A];
                                            0 === A && a.lineTo(B[0], B[1]);
                                            a.bezierCurveTo(B[2], B[3], B[4], B[5], B[6], B[7])
                                        }
                                    }
                                    break;
                                case If:
                                    A = w = 0;
                                    if (null !== t && t.type === Hf) {
                                        t = Vf(t, m);
                                        B = t.length;
                                        if (0 === B) { a.lineTo(y.pa, y.va); break }
                                        t = t[B - 1] || null;
                                        null !== t && (w = t[6], A = t[7])
                                    } else w = null !== t ? t.F : m.la, A = null !== t ? t.G : m.ja;
                                    t = Wf(y, m, w, A);
                                    w = t.length;
                                    if (0 === w) { a.lineTo(y.pa, y.va); break }
                                    for (A = 0; A < w; A++) B = t[A], a.bezierCurveTo(B[2], B[3],
                                        B[4], B[5], B[6], B[7]);
                                    break;
                                default:
                                    D.k("Segment not of valid type: " + y.da)
                            }
                            y.hi && a.closePath();
                            t = y
                        }
                        e ? (u = s = p = 0, m.mp ? (!0 === m.Xm && null !== this.Ud ? (a.Xg(this.Ud), g = !0) : g = !1, 0 !== c && null !== this.Bc && (g && (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), d && !h || a.Zj(), g && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u))) : (g && (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), !0 === m.Xm && null !== this.Ud &&
                            a.Xg(this.Ud), 0 !== c && null !== this.Bc && (d && !h || a.Zj()), g && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u))) : (!0 === m.Xm && null !== this.Ud && a.Xg(this.Ud), 0 === c || null === this.Bc || d && !h || a.Zj())
                    }
                    if (d && !h)
                        for (c = g, g = l.jk, h = g.length, l = 0; l < h; l++) {
                            r = g.o[l];
                            a.beginPath();
                            n = D.mb();
                            n.push(r.la);
                            n.push(r.ja);
                            q = r.la;
                            m = r.ja;
                            p = q;
                            s = m;
                            u = r.Eb.o;
                            y = u.length;
                            for (t = 0; t < y; t++) {
                                w = u[t];
                                switch (w.da) {
                                    case Ef:
                                        pq(a, n, k, this.Hf);
                                        n.length = 0;
                                        n.push(w.F);
                                        n.push(w.G);
                                        q = w.F;
                                        m = w.G;
                                        p = q;
                                        s = m;
                                        break;
                                    case wf:
                                        n.push(w.F);
                                        n.push(w.G);
                                        q = w.F;
                                        m = w.G;
                                        break;
                                    case Ff:
                                        Be(q, m, w.Vd, w.ff, w.Ch, w.Og, w.Cb, w.Jb, .5, n);
                                        q = w.F;
                                        m = w.G;
                                        break;
                                    case Gf:
                                        Fe(q, m, w.Vd, w.ff, w.Cb, w.Jb, .5, n);
                                        q = w.F;
                                        m = w.G;
                                        break;
                                    case Hf:
                                        A = Vf(w, r);
                                        B = A.length;
                                        if (0 === B) {
                                            n.push(w.pa);
                                            n.push(w.va);
                                            q = w.pa;
                                            m = w.va;
                                            break
                                        }
                                        for (var P = 0; P < B; P++) {
                                            var H = A[P];
                                            Be(q, m, H[2], H[3], H[4], H[5], H[6], H[7], .5, n);
                                            q = H[6];
                                            m = H[7]
                                        }
                                        break;
                                    case If:
                                        A = Wf(w, r, q, m);
                                        B = A.length;
                                        if (0 === B) {
                                            n.push(w.pa);
                                            n.push(w.va);
                                            q = w.pa;
                                            m = w.va;
                                            break
                                        }
                                        for (P = 0; P < B; P++) H = A[P], Be(q, m, H[2], H[3], H[4], H[5], H[6], H[7], .5, n), q = H[6], m = H[7];
                                        break;
                                    default:
                                        D.k("Segment not of valid type: " +
                                            w.da)
                                }
                                w.hi && (n.push(p), n.push(s), pq(a, n, k, this.Hf))
                            }
                            pq(a, n, k, this.Hf);
                            D.ya(n);
                            null !== this.Bc && (q = n = r = 0, c && e && (r = a.shadowOffsetX, n = a.shadowOffsetY, q = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), a.Zj(), c && e && (a.shadowOffsetX = r, a.shadowOffsetY = n, a.shadowBlur = q))
                        }
                }
                d && a.TA();
                if (null !== this.By) {
                    d = this.By;
                    Hk(d, Infinity, Infinity);
                    k = d.Fa;
                    d.rc(0, 0, k.width, k.height);
                    c = this.vf;
                    a.save();
                    a.beginPath();
                    k = D.mb();
                    if (c.type === Ze) k.push(c.la), k.push(c.ja), k.push(c.F), k.push(c.G), oq(a, b, k, d);
                    else if (c.type ===
                        We)
                        for (h = c.nc.j; h.next();) {
                            l = h.value;
                            k.length = 0;
                            k.push(l.la);
                            k.push(l.ja);
                            g = l.la;
                            r = l.ja;
                            n = g;
                            q = r;
                            m = l.Eb.o;
                            p = m.length;
                            for (s = 0; s < p; s++) {
                                u = m[s];
                                switch (u.da) {
                                    case Ef:
                                        oq(a, b, k, d);
                                        k.length = 0;
                                        k.push(u.F);
                                        k.push(u.G);
                                        g = u.F;
                                        r = u.G;
                                        n = g;
                                        q = r;
                                        break;
                                    case wf:
                                        k.push(u.F);
                                        k.push(u.G);
                                        g = u.F;
                                        r = u.G;
                                        break;
                                    case Ff:
                                        Be(g, r, u.Vd, u.ff, u.Ch, u.Og, u.Cb, u.Jb, .5, k);
                                        g = u.F;
                                        r = u.G;
                                        break;
                                    case Gf:
                                        Fe(g, r, u.Vd, u.ff, u.Cb, u.Jb, .5, k);
                                        g = u.F;
                                        r = u.G;
                                        break;
                                    case Hf:
                                        c = Vf(u, l);
                                        e = c.length;
                                        if (0 === e) {
                                            k.push(u.pa);
                                            k.push(u.va);
                                            g = u.pa;
                                            r = u.va;
                                            break
                                        }
                                        for (y =
                                            0; y < e; y++) t = c[y], Be(g, r, t[2], t[3], t[4], t[5], t[6], t[7], .5, k), g = t[6], r = t[7];
                                        break;
                                    case If:
                                        c = Wf(u, l, g, r);
                                        e = c.length;
                                        if (0 === e) {
                                            k.push(u.pa);
                                            k.push(u.va);
                                            g = u.pa;
                                            r = u.va;
                                            break
                                        }
                                        for (y = 0; y < e; y++) t = c[y], Be(g, r, t[2], t[3], t[4], t[5], t[6], t[7], .5, k), g = t[6], r = t[7];
                                        break;
                                    default:
                                        D.k("Segment not of valid type: " + u.da)
                                }
                                u.hi && (k.push(n), k.push(q), oq(a, b, k, d))
                            }
                            oq(a, b, k, d)
                        } else if (c.type === tf) k.push(c.la), k.push(c.ja), k.push(c.F), k.push(c.ja), k.push(c.F), k.push(c.G), k.push(c.la), k.push(c.G), k.push(c.la), k.push(c.ja),
                            oq(a, b, k, d);
                        else if (c.type === uf) {
                        h = new Xe;
                        h.la = c.F;
                        h.ja = (c.ja + c.G) / 2;
                        g = new $f(Hf);
                        g.Me = 0;
                        g.Df = 360;
                        g.pa = (c.la + c.F) / 2;
                        g.va = (c.ja + c.G) / 2;
                        g.radiusX = Math.abs(c.la - c.F) / 2;
                        g.radiusY = Math.abs(c.ja - c.G) / 2;
                        h.add(g);
                        c = Vf(g, h);
                        e = c.length;
                        if (0 === e) k.push(g.pa), k.push(g.va);
                        else
                            for (g = h.la, r = h.ja, y = 0; y < e; y++) t = c[y], Be(g, r, t[2], t[3], t[4], t[5], t[6], t[7], .5, k), g = t[6], r = t[7];
                        oq(a, b, k, d)
                    }
                    D.ya(k);
                    a.restore();
                    a.De(!1)
                }
            }
        }
    };

    function pq(a, b, c, d) {
        var e = b.length;
        if (!(4 > e)) {
            var g = .001,
                h = c.length,
                k = b[0],
                l = b[1];
            if (4 === e) Go(a, k, l, b[2], b[3], c, d);
            else {
                a.moveTo(k, l);
                for (var m = g = 0, n = 0, p = 0, q = 0, r = p = 0, s = D.mb(), u = 2; u < e; u += 2) g = b[u], m = b[u + 1], n = g - k, p = m - l, 0 === n && (n = .001), q = p / n, p = Math.sqrt(n * n + p * p), s.push([n, q, p]), r += p, k = g, l = m;
                k = b[0];
                l = b[1];
                b = 0;
                for (var e = !0, g = c[b % h], m = 0 !== d, u = 0, p = s[u], n = p[0], q = p[1], p = p[2], t = 0; .1 <= r;) {
                    0 === t && (g = c[b % h], b++, m && (d %= g, g -= d, m = !1));
                    g > r && (g = r);
                    g > p ? (t = g - p, g = p) : t = 0;
                    var y = Math.sqrt(g * g / (1 + q * q));
                    0 > n && (y = -y);
                    k += y;
                    l +=
                        q * y;
                    e ? a.lineTo(k, l) : a.moveTo(k, l);
                    r -= g;
                    p -= g;
                    if (0 !== t) {
                        u++;
                        if (u === s.length) { D.ya(s); return }
                        p = s[u];
                        n = p[0];
                        q = p[1];
                        p = p[2];
                        g = t
                    } else e = !e
                }
                D.ya(s)
            }
        }
    }
    z.prototype.getDocumentPoint = z.prototype.fb = function(a, b) {
        void 0 === b && (b = new N);
        if (a instanceof S) {
            a.de() && D.k("getDocumentPoint Spot must be a real, specific Spot, not: " + a.toString());
            var c = this.Ga,
                d = this.lb;
            b.n(a.x * (c.width + d) - d / 2 + c.x + a.offsetX, a.y * (c.height + d) - d / 2 + c.y + a.offsetY)
        } else b.set(a);
        this.Hh.vb(b);
        return b
    };
    z.prototype.Rk = function(a, b) {
        var c = this.vf;
        if (null === c || null === this.fill && null === this.stroke) return !1;
        var d = c.pb,
            e = this.lb / 2;
        c.type !== Ze || b || (e += 2);
        var g = D.Sf();
        g.assign(d);
        g.ig(e + 2, e + 2);
        if (!g.Pa(a)) return D.Lb(g), !1;
        d = e + 1E-4;
        if (c.type === Ze) {
            if (null === this.stroke) return !1;
            d = (c.F - c.la) * (a.x - c.la) + (c.G - c.ja) * (a.y - c.ja);
            if (0 > (c.la - c.F) * (a.x - c.F) + (c.ja - c.G) * (a.y - c.G) || 0 > d) return !1;
            D.Lb(g);
            return qe(c.la, c.ja, c.F, c.G, e, a.x, a.y)
        }
        if (c.type === tf) {
            var h = c.la,
                k = c.ja,
                l = c.F,
                c = c.G;
            g.x = Math.min(h, l);
            g.y = Math.min(k,
                c);
            g.width = Math.abs(l - h);
            g.height = Math.abs(c - k);
            if (null === this.fill) {
                g.ig(-d, -d);
                if (g.Pa(a)) return D.Lb(g), !1;
                g.ig(d, d)
            }
            null !== this.stroke && g.ig(e, e);
            d = g.Pa(a);
            D.Lb(g);
            return d
        }
        if (c.type === uf) {
            var h = c.la,
                k = c.ja,
                l = c.F,
                c = c.G,
                e = Math.min(h, l),
                m = Math.min(k, c),
                h = Math.abs(l - h) / 2,
                k = Math.abs(c - k) / 2,
                e = a.x - (e + h),
                m = a.y - (m + k);
            if (null === this.fill) {
                h -= d;
                k -= d;
                if (0 >= h || 0 >= k || 1 >= e * e / (h * h) + m * m / (k * k)) return D.Lb(g), !1;
                h += d;
                k += d
            }
            null !== this.stroke && (h += d, k += d);
            D.Lb(g);
            return 0 >= h || 0 >= k ? !1 : 1 >= e * e / (h * h) + m * m / (k * k)
        }
        if (c.type ===
            We) return D.Lb(g), null === this.fill ? Yf(c, a.x, a.y, e) : c.Pa(a, e, 1 < this.lb, b);
        D.k("Unknown Geometry type: " + c.type);
        return !1
    };
    z.prototype.ho = function(a, b, c, d) {
        var e = this.Ea,
            g = this.Rg;
        a = Math.max(a, 0);
        b = Math.max(b, 0);
        var h;
        if (null !== this.bg) h = this.vf.pb;
        else {
            var k = this.Kb,
                l = me[k];
            if (void 0 === l) { var m = qq[k]; "string" === typeof m && (m = qq[m]); "function" === typeof m ? (l = m(null, 100, 100), me[k] = l) : D.k("Unsupported Figure: " + k) }
            h = l.pb
        }
        var k = h.width,
            l = h.height,
            m = h.width,
            n = h.height;
        switch (Mo(this, !0)) {
            case Zj:
                d = c = 0;
                break;
            case Ye:
                m = Math.max(a - g, 0);
                n = Math.max(b - g, 0);
                break;
            case yo:
                m = Math.max(a - g, 0);
                d = 0;
                break;
            case xo:
                c = 0, n = Math.max(b - g, 0)
        }
        isFinite(e.width) &&
            (m = e.width);
        isFinite(e.height) && (n = e.height);
        e = this.pf;
        h = this.ah;
        c = Math.max(c, h.width) - g;
        d = Math.max(d, h.height) - g;
        m = Math.min(e.width, m);
        n = Math.min(e.height, n);
        m = isFinite(m) ? Math.max(c, m) : Math.max(k, c);
        n = isFinite(n) ? Math.max(d, n) : Math.max(l, d);
        c = ak(this);
        switch (c) {
            case Zj:
                break;
            case Ye:
                k = m;
                l = n;
                break;
            case bk:
                c = Math.min(m / k, n / l);
                isFinite(c) || (c = 1);
                k *= c;
                l *= c;
                break;
            default:
                D.k(c + " is not a valid geometryStretch.")
        }
        null !== this.bg ? (k = Math.max(k, .01), l = Math.max(l, .01), h = null !== this.bg ? this.bg : this.ab, e = k,
            d = l, c = h.copy(), h = h.pb, e /= h.width, d /= h.height, isFinite(e) || (e = 1), isFinite(d) || (d = 1), 1 === e && 1 === d || c.scale(e, d), v && c.freeze(), this.ab = c) : null !== this.ab && Eb(this.ab.lp, a - g) && Eb(this.ab.jp, b - g) || (this.ab = z.makeGeometry(this, k, l));
        h = this.ab.pb;
        Infinity === a || Infinity === b ? Jo(this, h.x - g / 2, h.y - g / 2, 0 === a && 0 === k ? 0 : h.width + g, 0 === b && 0 === l ? 0 : h.height + g) : Jo(this, -(g / 2), -(g / 2), m + g, n + g)
    };

    function Wp(a, b, c, d) {
        if (!1 !== Nm(a)) {
            a.Fd.Xa();
            var e = a.Rg;
            0 === e && d instanceof da && d.type === sj && d.Bb instanceof z && (e = d.Bb.lb);
            e *= a.Db;
            d instanceof J && null !== d.ab ? (b = d.ab.pb, Jo(a, b.x - e / 2, b.y - e / 2, b.width + e, b.height + e)) : Jo(a, -(e / 2), -(e / 2), b + e, c + e);
            a.Fd.freeze();
            a.Fd.H() || D.k("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.Fd.toString());
            km(a, !1)
        }
    }

    function ak(a) { var b = a.dB; return null !== a.bg ? b === wo ? Ye : b : b === wo ? me[a.Kb].le : b }
    z.prototype.Cj = function(a, b, c, d) { Oo(this, a, b, c, d) };
    z.prototype.getNearestIntersectionPoint = z.prototype.QF = function(a, b, c) { return this.Tn(a.x, a.y, b.x, b.y, c) };
    z.prototype.Tn = function(a, b, c, d, e) {
        var g = this.transform,
            h = 1 / (g.m11 * g.m22 - g.m12 * g.m21),
            k = g.m22 * h,
            l = -g.m12 * h,
            m = -g.m21 * h,
            n = g.m11 * h,
            p = h * (g.m21 * g.dy - g.m22 * g.dx),
            q = h * (g.m12 * g.dx - g.m11 * g.dy),
            g = a * k + b * m + p,
            h = a * l + b * n + q,
            k = c * k + d * m + p,
            l = c * l + d * n + q,
            m = this.lb / 2,
            p = this.ab;
        null === p && (Hk(this, Infinity, Infinity), p = this.ab);
        q = p.pb;
        n = !1;
        if (p.type === Ze)
            if (1.5 >= this.lb) n = Ie(p.Ac, p.Mc, p.Cb, p.Jb, g, h, k, l, e);
            else {
                var r = 0,
                    s = 0;
                p.Ac === p.Cb ? (r = m, s = 0) : (b = (p.Jb - p.Mc) / (p.Cb - p.Ac), s = m / Math.sqrt(1 + b * b), r = s * b);
                d = D.mb();
                b = new N;
                Ie(p.Ac +
                    r, p.Mc + s, p.Cb + r, p.Jb + s, g, h, k, l, b) && d.push(b);
                b = new N;
                Ie(p.Ac - r, p.Mc - s, p.Cb - r, p.Jb - s, g, h, k, l, b) && d.push(b);
                b = new N;
                Ie(p.Ac + r, p.Mc + s, p.Ac - r, p.Mc - s, g, h, k, l, b) && d.push(b);
                b = new N;
                Ie(p.Cb + r, p.Jb + s, p.Cb - r, p.Jb - s, g, h, k, l, b) && d.push(b);
                b = d.length;
                if (0 === b) return D.ya(d), !1;
                n = !0;
                s = Infinity;
                for (r = 0; r < b; r++) {
                    var k = d[r],
                        u = (k.x - g) * (k.x - g) + (k.y - h) * (k.y - h);
                    u < s && (s = u, e.x = k.x, e.y = k.y)
                }
                D.ya(d)
            }
        else if (p.type === tf) b = q.x - m, n = Je(b, q.y - m, q.x + q.width + m, q.y + q.height + m, g, h, k, l, e);
        else if (p.type === uf) a: if (b = q.copy().ig(m,
                    m), 0 === b.width) n = Ie(b.x, b.y, b.x, b.y + b.height, g, h, k, l, e);
            else if (0 === b.height) n = Ie(b.x, b.y, b.x + b.width, b.y, g, h, k, l, e);
        else {
            a = b.width / 2;
            var t = b.height / 2;
            d = b.x + a;
            b = b.y + t;
            c = 9999;
            g !== k && (c = (h - l) / (g - k));
            if (9999 > Math.abs(c)) {
                n = h - b - c * (g - d);
                if (0 > a * a * c * c + t * t - n * n) {
                    e.x = NaN;
                    e.y = NaN;
                    n = !1;
                    break a
                }
                m = Math.sqrt(a * a * c * c + t * t - n * n);
                k = (-(a * a * c * n) + a * t * m) / (t * t + a * a * c * c) + d;
                a = (-(a * a * c * n) - a * t * m) / (t * t + a * a * c * c) + d;
                l = c * (k - d) + n + b;
                b = c * (a - d) + n + b;
                d = Math.abs((g - k) * (g - k)) + Math.abs((h - l) * (h - l));
                h = Math.abs((g - a) * (g - a)) + Math.abs((h - b) * (h -
                    b));
                d < h ? (e.x = k, e.y = l) : (e.x = a, e.y = b)
            } else {
                k = t * t;
                l = g - d;
                k -= k / (a * a) * l * l;
                if (0 > k) {
                    e.x = NaN;
                    e.y = NaN;
                    n = !1;
                    break a
                }
                m = Math.sqrt(k);
                l = b + m;
                b -= m;
                d = Math.abs(l - h);
                h = Math.abs(b - h);
                d < h ? (e.x = g, e.y = l) : (e.x = g, e.y = b)
            }
            n = !0
        } else if (p.type === We) {
            var y = 0,
                w = 0,
                A = u = 0,
                q = D.P(),
                r = k - g,
                s = l - h,
                s = r * r + s * s;
            e.x = k;
            e.y = l;
            for (r = 0; r < p.nc.count; r++)
                for (var B = p.nc.o[r], P = B.Eb, y = B.la, w = B.ja, H = y, R = w, aa = 0; aa < P.count; aa++) {
                    var V = P.o[aa],
                        ea = V.type,
                        u = V.F,
                        A = V.G,
                        la = !1;
                    switch (ea) {
                        case Ef:
                            H = u;
                            R = A;
                            break;
                        case wf:
                            la = rq(y, w, u, A, g, h, k, l, q);
                            break;
                        case Ff:
                            var la =
                                V.Ec,
                                ea = V.$c,
                                Da = V.Uh,
                                La = V.Vh,
                                la = Ge(y, w, la, ea, Da, La, u, A, g, h, k, l, .5, q);
                            break;
                        case Gf:
                            la = (y + 2 * V.Ec) / 3;
                            ea = (w + 2 * V.$c) / 3;
                            Da = (2 * V.Ec + u) / 3;
                            La = (2 * V.Ec + u) / 3;
                            la = Ge(y, w, la, ea, Da, La, u, A, g, h, k, l, .5, q);
                            break;
                        case Hf:
                        case If:
                            ea = V.type === Hf ? Vf(V, B) : Wf(V, B, y, w);
                            Da = ea.length;
                            if (0 === Da) { la = rq(y, w, V.pa, V.va, g, h, k, l, q); break }
                            for (A = 0; A < Da; A++) t = ea[A], 0 === A && rq(y, w, t[0], t[1], g, h, k, l, q) && (u = sq(g, h, q, s, e), u < s && (s = u, n = !0)), Ge(t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], g, h, k, l, .5, q) && (u = sq(g, h, q, s, e), u < s && (s = u, n = !0));
                            u = t[6];
                            A =
                                t[7];
                            break;
                        default:
                            D.k("Unknown Segment type: " + ea)
                    }
                    y = u;
                    w = A;
                    la && (u = sq(g, h, q, s, e), u < s && (s = u, n = !0));
                    V.ey && (u = H, A = R, rq(y, w, u, A, g, h, k, l, q) && (u = sq(g, h, q, s, e), u < s && (s = u, n = !0)))
                }
            g = c - a;
            h = d - b;
            b = Math.sqrt(g * g + h * h);
            0 !== b && (g /= b, h /= b);
            e.x -= g * m;
            e.y -= h * m;
            D.A(q)
        } else D.k("Unknown Geometry type: " + p.type);
        if (!n) return !1;
        this.transform.vb(e);
        return !0
    };

    function sq(a, b, c, d, e) {
        a = c.x - a;
        b = c.y - b;
        b = a * a + b * b;
        return b < d ? (e.x = c.x, e.y = c.y, b) : d
    }

    function rq(a, b, c, d, e, g, h, k, l) {
        var m = !1,
            n = (e - h) * (b - d) - (g - k) * (a - c);
        if (0 === n) return !1;
        l.x = ((e * k - g * h) * (a - c) - (e - h) * (a * d - b * c)) / n;
        l.y = ((e * k - g * h) * (b - d) - (g - k) * (a * d - b * c)) / n;
        (a > c ? a - c : c - a) < (b > d ? b - d : d - b) ? (e = b < d ? b : d, a = b < d ? d : b, (l.y > e || Eb(l.y, e)) && (l.y < a || Eb(l.y, a)) && (m = !0)) : (e = a < c ? a : c, a = a < c ? c : a, (l.x > e || Eb(l.x, e)) && (l.x < a || Eb(l.x, a)) && (m = !0));
        return m
    }
    z.prototype.containedInRect = z.prototype.In = function(a, b) {
        if (void 0 === b) return a.Sk(this.aa);
        var c = this.ab;
        null === c && (Hk(this, Infinity, Infinity), c = this.ab);
        var c = c.pb,
            d = this.lb / 2,
            e = !1,
            g = D.P();
        g.n(c.x - d, c.y - d);
        a.Pa(b.vb(g)) && (g.n(c.x - d, c.bottom + d), a.Pa(b.vb(g)) && (g.n(c.right + d, c.bottom + d), a.Pa(b.vb(g)) && (g.n(c.right + d, c.y - d), a.Pa(b.vb(g)) && (e = !0))));
        D.A(g);
        return e
    };
    z.prototype.intersectsRect = z.prototype.jg = function(a, b) {
        if (this.In(a, b) || void 0 === b && (b = this.transform, a.Sk(this.aa))) return !0;
        var c = D.hh();
        c.set(b);
        c.pB();
        var d = a.left,
            e = a.right,
            g = a.top,
            h = a.bottom,
            k = D.P();
        k.n(d, g);
        c.vb(k);
        if (this.Rk(k, !0)) return D.A(k), !0;
        k.n(e, g);
        c.vb(k);
        if (this.Rk(k, !0)) return D.A(k), !0;
        k.n(d, h);
        c.vb(k);
        if (this.Rk(k, !0)) return D.A(k), !0;
        k.n(e, h);
        c.vb(k);
        if (this.Rk(k, !0)) return D.A(k), !0;
        var l = D.P(),
            m = D.P();
        c.set(b);
        c.GB(this.transform);
        c.pB();
        l.x = e;
        l.y = g;
        l.transform(c);
        k.x = d;
        k.y =
            g;
        k.transform(c);
        var n = !1;
        tq(this, k, l, m) ? n = !0 : (k.x = e, k.y = h, k.transform(c), tq(this, k, l, m) ? n = !0 : (l.x = d, l.y = h, l.transform(c), tq(this, k, l, m) ? n = !0 : (k.x = d, k.y = g, k.transform(c), tq(this, k, l, m) && (n = !0))));
        D.A(k);
        D.lf(c);
        D.A(l);
        D.A(m);
        return n
    };

    function tq(a, b, c, d) {
        if (!a.QF(b, c, d)) return !1;
        a = b.x;
        b = b.y;
        var e = c.x;
        c = c.y;
        var g = d.x;
        d = d.y;
        if (a === e) {
            var h = 0;
            a = 0;
            b < c ? (h = b, a = c) : (h = c, a = b);
            return d >= h && d <= a
        }
        a < e ? (h = a, a = e) : h = e;
        return g >= h && g <= a
    }
    z.prototype.JF = function(a, b, c) {
        function d(a, b) {
            for (var c = a.length, d = 0; d < c; d += 2)
                if (b.mq(a[d], a[d + 1]) > e) return !0;
            return !1
        }
        if (c && null !== this.fill && this.Rk(a, !0)) return !0;
        var e = a.Kf(b);
        b = e;
        1.5 < this.lb && (e = this.lb / 2 + Math.sqrt(e), e *= e);
        var g = this.ab;
        if (null === g && (Hk(this, Infinity, Infinity), g = this.ab, null === g)) return !1;
        if (!c) {
            var h = g.pb,
                k = h.x,
                l = h.y,
                m = h.x + h.width,
                h = h.y + h.height;
            if (ob(a.x, a.y, k, l) <= e && ob(a.x, a.y, m, l) <= e && ob(a.x, a.y, k, h) <= e && ob(a.x, a.y, m, h) <= e) return !0
        }
        k = g.Ac;
        l = g.Mc;
        m = g.Cb;
        h = g.Jb;
        if (g.type ===
            Ze) { if (c = lb(a.x, a.y, k, l, m, h), g = (k - m) * (a.x - m) + (l - h) * (a.y - h), c <= (0 <= (m - k) * (a.x - k) + (h - l) * (a.y - l) && 0 <= g ? e : b)) return !0 } else {
            if (g.type === tf) return b = !1, c && (b = lb(a.x, a.y, k, l, k, h) <= e || lb(a.x, a.y, k, l, m, l) <= e || lb(a.x, a.y, m, l, m, h) <= e || lb(a.x, a.y, k, h, m, h) <= e), b;
            if (g.type === uf) {
                b = a.x - (k + m) / 2;
                var g = a.y - (l + h) / 2,
                    n = Math.abs(m - k) / 2,
                    p = Math.abs(h - l) / 2;
                if (0 === n || 0 === p) return c = lb(a.x, a.y, k, l, m, h), c <= e ? !0 : !1;
                if (c) { if (a = Ue(n, p, b, g), a * a <= e) return !0 } else return ob(b, g, -n, 0) >= e || ob(b, g, 0, -p) >= e || ob(b, g, 0, p) >= e || ob(b, g, n, 0) >=
                    e ? !1 : !0
            } else if (g.type === We) {
                h = g.pb;
                k = h.x;
                l = h.y;
                m = h.x + h.width;
                h = h.y + h.height;
                if (a.x > m && a.x < k && a.y > h && a.y < l && lb(a.x, a.y, k, l, k, h) > e && lb(a.x, a.y, k, l, m, l) > e && lb(a.x, a.y, m, h, k, h) > e && lb(a.x, a.y, m, h, m, l) > e) return !1;
                b = Math.sqrt(e);
                if (c) { if (null === this.fill ? Yf(g, a.x, a.y, b) : g.Pa(a, b, !0)) return !0 } else {
                    c = g.nc;
                    for (b = 0; b < c.count; b++) {
                        k = c.o[b];
                        n = k.la;
                        p = k.ja;
                        if (a.mq(n, p) > e) return !1;
                        l = k.Eb.o;
                        m = l.length;
                        for (h = 0; h < m; h++) {
                            var q = l[h];
                            switch (q.type) {
                                case Ef:
                                case wf:
                                    n = q.F;
                                    p = q.G;
                                    if (a.mq(n, p) > e) return !1;
                                    break;
                                case Ff:
                                    g = D.mb();
                                    Be(n, p, q.Ec, q.$c, q.Uh, q.Vh, q.F, q.G, .8, g);
                                    n = d(g, a);
                                    D.ya(g);
                                    if (n) return !1;
                                    n = q.F;
                                    p = q.G;
                                    if (a.mq(n, p) > e) return !1;
                                    break;
                                case Gf:
                                    g = D.mb();
                                    Fe(n, p, q.Ec, q.$c, q.F, q.G, .8, g);
                                    n = d(g, a);
                                    D.ya(g);
                                    if (n) return !1;
                                    n = q.F;
                                    p = q.G;
                                    if (a.mq(n, p) > e) return !1;
                                    break;
                                case Hf:
                                case If:
                                    var r = q.type === Hf ? Vf(q, k) : Wf(q, k, n, p),
                                        s = r.length;
                                    if (0 === s) {
                                        n = q.pa;
                                        p = q.va;
                                        if (a.mq(n, p) > e) return !1;
                                        break
                                    }
                                    q = null;
                                    g = D.mb();
                                    for (b = 0; b < s; b++)
                                        if (q = r[b], g.length = 0, Be(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7], .8, g), d(g, a)) return D.ya(g), !1;
                                    D.ya(g);
                                    null !== q && (n =
                                        q[6], p = q[7]);
                                    break;
                                default:
                                    D.k("Unknown Segment type: " + q.type)
                            }
                        }
                    }
                    return !0
                }
            }
        }
        return !1
    };
    D.defineProperty(z, { vf: "geometry" }, function() { return null !== this.ab ? this.ab : this.bg }, function(a) {
        var b = this.ab;
        if (b !== a) {
            null !== a ? (v && D.l(a, Ve, z, "geometry"), this.bg = this.ab = a.freeze()) : this.bg = this.ab = null;
            var c = this.Y;
            null !== c && (c.zk = NaN);
            this.K();
            this.i("geometry", b, a);
            Ho(this) && (a = this.Y, null !== a && Io(this, a, "geometryString"))
        }
    });
    D.defineProperty(z, { SI: "geometryString" }, function() { return null === this.vf ? "" : this.vf.toString() }, function(a) {
        a = yf(a);
        var b = a.normalize();
        this.vf = a;
        this.position = a = D.Fb(-b.x, -b.y);
        D.A(a)
    });
    D.defineProperty(z, { hG: "isGeometryPositioned" }, function() { return this.ns }, function(a) {
        v && D.h(a, "boolean", z, "isGeometryPositioned");
        var b = this.ns;
        b !== a && (this.ns = a, this.K(), this.i("isGeometryPositioned", b, a))
    });
    z.prototype.Te = function() { this.ab = null };
    D.defineProperty(z, { fill: "fill" }, function() { return this.Ud }, function(a) {
        var b = this.Ud;
        b !== a && (v && null !== a && D.hu(a, "Shape.fill"), a instanceof Ba && a.freeze(), this.Ud = a, this.ra(), this.i("fill", b, a))
    });
    D.defineProperty(z, { stroke: "stroke" }, function() { return this.Bc }, function(a) {
        var b = this.Bc;
        b !== a && (v && null !== a && D.hu(a, "Shape.stroke"), a instanceof Ba && a.freeze(), this.Bc = a, this.ra(), this.i("stroke", b, a))
    });
    D.defineProperty(z, { lb: "strokeWidth" }, function() { return this.Rg }, function(a) {
        var b = this.Rg;
        if (b !== a)
            if (v && D.p(a, z, "strokeWidth"), 0 <= a) {
                this.Rg = a;
                this.K();
                var c = this.Y;
                null !== c && (c.zk = NaN);
                this.i("strokeWidth", b, a)
            } else D.ua(a, "value >= 0", z, "strokeWidth:value")
    });
    D.defineProperty(z, { JM: "strokeCap" }, function() { return this.Op }, function(a) {
        var b = this.Op;
        b !== a && ("string" !== typeof a || "butt" !== a && "round" !== a && "square" !== a ? D.ua(a, '"butt", "round", or "square"', z, "strokeCap") : (this.Op = a, this.ra(), this.i("strokeCap", b, a)))
    });
    D.defineProperty(z, { LM: "strokeJoin" }, function() { return this.Qp }, function(a) {
        var b = this.Qp;
        b !== a && ("string" !== typeof a || "miter" !== a && "bevel" !== a && "round" !== a ? D.ua(a, '"miter", "bevel", or "round"', z, "strokeJoin") : (this.Qp = a, this.ra(), this.i("strokeJoin", b, a)))
    });
    D.defineProperty(z, { MM: "strokeMiterLimit" }, function() { return this.xn }, function(a) {
        var b = this.xn;
        if (b !== a)
            if (v && D.p(a, z, "strokeMiterLimit"), 1 <= a) {
                this.xn = a;
                this.ra();
                var c = this.Y;
                null !== c && (c.zk = NaN);
                this.i("strokeMiterLimit", b, a)
            } else D.ua(a, "value >= 1", z, "strokeWidth:value")
    });
    D.defineProperty(z, { jH: "strokeDashArray" }, function() { return this.Pp }, function(a) {
        var b = this.Pp;
        if (b !== a) {
            null === a || Array.isArray(a) || D.kc(a, "Array", z, "strokeDashArray:value");
            if (null !== a) {
                for (var c = a.length, d = 0, e = 0; e < c; e++) {
                    var g = a[e];
                    "number" === typeof g && 0 <= g && isFinite(g) || D.k("strokeDashArray:value " + g + " at index " + e + " must be a positive number or zero.");
                    d += g
                }
                if (0 === d) {
                    if (null === b) return;
                    a = null
                }
            }
            this.Pp = a;
            this.ra();
            this.i("strokeDashArray", b, a)
        }
    });
    D.defineProperty(z, { KM: "strokeDashOffset" }, function() { return this.Hf }, function(a) {
        var b = this.Hf;
        b !== a && (v && D.p(a, z, "strokeDashOffset"), 0 <= a && (this.Hf = a, this.ra(), this.i("strokeDashOffset", b, a)))
    });
    D.defineProperty(z, { Kb: "figure" }, function() { return this.$o }, function(a) {
        var b = this.$o;
        if (b !== a) {
            v && D.h(a, "string", z, "figure");
            var c = qq[a];
            "function" === typeof c ? c = a : (c = qq[a.toLowerCase()]) || D.k("Unknown Shape.figure: " + a);
            b !== c && (a = this.Y, null !== a && (a.zk = NaN), this.$o = c, this.bg = null, this.Te(), this.K(), this.i("figure", b, c))
        }
    });
    D.defineProperty(z, { ar: "toArrow" }, function() { return this.Vp }, function(a) {
        var b = this.Vp;
        !0 === a ? a = "Standard" : !1 === a && (a = "");
        if (b !== a) {
            v && D.h(a, "string", z, "toArrow");
            var c = uq(a);
            null === c ? D.k("Unknown Shape.toArrow: " + a) : b !== c && (this.Vp = c, this.bg = null, this.Te(), this.K(), vq(this), this.i("toArrow", b, c))
        }
    });
    D.defineProperty(z, { bB: "fromArrow" }, function() { return this.cp }, function(a) {
        var b = this.cp;
        !0 === a ? a = "Standard" : !1 === a && (a = "");
        if (b !== a) {
            v && D.h(a, "string", z, "fromArrow");
            var c = uq(a);
            null === c ? D.k("Unknown Shape.fromArrow: " + a) : b !== c && (this.cp = c, this.bg = null, this.Te(), this.K(), vq(this), this.i("fromArrow", b, c))
        }
    });

    function vq(a) {
        var b = a.g;
        null !== b && b.na.ub || (a.Uq = wq, "None" !== a.Vp ? (a.We = -1, a.Gh = fd) : "None" !== a.cp && (a.We = 0, a.Gh = new S(1 - fd.x, fd.y)))
    }
    D.defineProperty(z, { C: "spot1" }, function() { return this.xi }, function(a) {
        D.l(a, S, z, "spot1");
        var b = this.xi;
        b.O(a) || (this.xi = a = a.V(), this.K(), this.i("spot1", b, a))
    });
    D.defineProperty(z, { D: "spot2" }, function() { return this.yi }, function(a) {
        D.l(a, S, z, "spot2");
        var b = this.yi;
        b.O(a) || (this.yi = a = a.V(), this.K(), this.i("spot2", b, a))
    });
    D.defineProperty(z, { Sc: "parameter1" }, function() { return this.et }, function(a) {
        var b = this.et;
        b !== a && (this.et = a, this.Te(), this.K(), this.i("parameter1", b, a))
    });
    D.defineProperty(z, { ev: "parameter2" }, function() { return this.ft }, function(a) {
        var b = this.ft;
        b !== a && (this.ft = a, this.Te(), this.K(), this.i("parameter2", b, a))
    });
    D.w(z, { Ga: "naturalBounds" }, function() { if (null !== this.ab) return this.fd.assign(this.ab.pb), this.fd; var a = this.Ea; return new C(0, 0, a.width, a.height) });
    D.defineProperty(z, { By: "pathPattern" }, function() { return this.ht }, function(a) {
        var b = this.ht;
        b !== a && (v && D.l(a, O, z, "pathPattern"), this.ht = a, this.ra(), this.i("pathPattern", b, a))
    });
    D.defineProperty(z, { yM: "pathObject" }, function() { return this.By }, function(a) { this.By = a });
    D.defineProperty(z, { dB: "geometryStretch" }, function() { return this.ds }, function(a) {
        var b = this.ds;
        b !== a && (D.Da(a, O, z, "geometryStretch"), this.ds = a, this.i("geometryStretch", b, a))
    });
    D.defineProperty(z, { interval: "interval" }, function() { return this.Fg }, function(a) {
        var b = this.Fg;
        v && D.p(a, z, "interval");
        a = Math.floor(a);
        if (b !== a && 0 <= a) {
            this.Fg = a;
            var c = this.g;
            null !== c && this.R === c.Vn && lm(c);
            this.K();
            c = this.R;
            null !== c && c.type === pp && (c.pk = null);
            this.i("interval", b, a)
        }
    });
    D.defineProperty(z, { UF: "graduatedStart" }, function() { return this.Eg }, function(a) {
        var b = this.Eg;
        v && D.p(a, z, "graduatedStart");
        b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.Eg = a, this.K(), this.i("graduatedStart", b, a))
    });
    D.defineProperty(z, { SF: "graduatedEnd" }, function() { return this.Dg }, function(a) {
        var b = this.Dg;
        v && D.p(a, z, "graduatedEnd");
        b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.Dg = a, this.K(), this.i("graduatedEnd", b, a))
    });
    z.makeGeometry = function(a, b, c) {
        var d = null;
        if ("None" !== a.ar) d = ne[a.ar];
        else if ("None" !== a.bB) d = ne[a.bB];
        else {
            var e = qq[a.Kb];
            "string" === typeof e && (e = qq[e]);
            void 0 === e && D.k("Unknown Shape.figure: " + a.Kb);
            d = e(a, b, c);
            d.lp = b;
            d.jp = c
        }
        null === d && (e = qq.Rectangle, "function" === typeof e && (d = e(a, b, c)));
        return d
    };
    z.getFigureGenerators = function() {
        var a = new oa("string", "function"),
            b;
        for (b in qq)
            if (b !== b.toLowerCase()) { var c = qq[b]; "function" === typeof c && a.add(b, c) }
        a.freeze();
        return a
    };
    z.defineFigureGenerator = function(a, b) {
        D.h(a, "string", z, "defineFigureGenerator:name");
        "string" === typeof b ? "" !== b && qq[b] || D.k("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: " + b) : D.h(b, "function", z, "defineFigureGenerator:func");
        var c = a.toLowerCase();
        "" !== a && "none" !== c && a !== c || D.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: " + a);
        qq[a] = b;
        qq[c] = a
    };
    z.getArrowheadGeometries = function() {
        var a = new oa("string", Ve),
            b;
        for (b in xq)
            if (void 0 === ne[b]) {
                var c = yf(xq[b], !1);
                ne[b] = c;
                c = b.toLowerCase();
                c !== b && (ne[c] = b)
            }
        for (b in ne) b !== b.toLowerCase() && (c = ne[b], c instanceof Ve && a.add(b, c));
        a.freeze();
        return a
    };
    z.defineArrowheadGeometry = function(a, b) {
        D.h(a, "string", z, "defineArrowheadGeometry:name");
        var c = null;
        "string" === typeof b ? (D.h(b, "string", z, "defineArrowheadGeometry:pathstr"), c = yf(b, !1)) : (D.l(b, Ve, z, "defineArrowheadGeometry:pathstr"), c = b);
        var d = a.toLowerCase();
        "" !== a && "none" !== d && a !== d || D.k("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: " + a);
        ne[a] = c;
        ne[d] = a
    };

    function pa() {
        O.call(this);
        this.Yd = "";
        this.Bc = "black";
        this.Bg = "13px sans-serif";
        this.Yl = "start";
        this.Ag = Zj;
        this.bm = Yc;
        this.Ym = !0;
        this.tk = this.vk = !1;
        this.pj = yq;
        this.Aj = zq;
        this.Cw = this.xe = 0;
        this.bA = this.cA = null;
        this.sf = new bq;
        this.Xr = !1;
        this.bf = this.ur = this.Qt = this.Zl = this.Rt = null;
        this.wi = this.vi = 0;
        this.wh = Infinity;
        this.rp = 0;
        this.Fg = 1;
        this.Eg = 0;
        this.Dg = 1;
        this.Um = null
    }
    D.Ta(pa, O);
    D.ka("TextBlock", pa);
    var Aq = /[ \u200b\u00ad]/;
    pa.prototype.cloneProtected = function(a) {
        O.prototype.cloneProtected.call(this, a);
        a.Yd = this.Yd;
        a.Bc = this.Bc;
        a.Bg = this.Bg;
        a.Yl = this.Yl;
        a.Ag = this.Ag;
        a.bm = this.bm;
        a.Ym = this.Ym;
        a.vk = this.vk;
        a.tk = this.tk;
        a.pj = this.pj;
        a.Aj = this.Aj;
        a.xe = this.xe;
        a.Cw = this.Cw;
        a.cA = this.cA;
        a.bA = this.bA;
        a.sf.gq(this.sf);
        a.Xr = this.Xr;
        a.Rt = this.Rt;
        a.Zl = this.Zl;
        a.Qt = this.Qt;
        a.ur = this.ur;
        a.bf = this.bf;
        a.vi = this.vi;
        a.wi = this.wi;
        a.wh = this.wh;
        a.rp = this.rp;
        a.Fg = this.Fg;
        a.Eg = this.Eg;
        a.Dg = this.Dg;
        a.Um = this.Um
    };
    pa.prototype.qc = function(a) { a.Qe === pa ? this.yH = a : O.prototype.qc.call(this, a) };
    pa.prototype.toString = function() { return 22 < this.Yd.length ? 'TextBlock("' + this.Yd.substring(0, 20) + '"...)' : 'TextBlock("' + this.Yd + '")' };
    var Bq = new ma,
        Cq = 0,
        Dq = new ma,
        Eq = 0,
        Fq = "...",
        Gq = "",
        Hq = (new ja(null)).Tk;
    pa.getEllipsis = function() { return Fq };
    pa.setEllipsis = function(a) {
        Fq = a;
        Dq = new ma;
        Eq = 0
    };
    var Iq;
    pa.None = Iq = D.s(pa, "None", 0);
    var Jq;
    pa.WrapFit = Jq = D.s(pa, "WrapFit", 1);
    var zq;
    pa.WrapDesiredSize = zq = D.s(pa, "WrapDesiredSize", 2);
    var Kq;
    pa.WrapBreakAll = Kq = D.s(pa, "WrapBreakAll", 3);
    var yq;
    pa.OverflowClip = yq = D.s(pa, "OverflowClip", 0);
    var Lq;
    pa.OverflowEllipsis = Lq = D.s(pa, "OverflowEllipsis", 1);
    pa.prototype.K = function() {
        O.prototype.K.call(this);
        this.bA = this.cA = null
    };
    D.defineProperty(pa, { font: "font" }, function() { return this.Bg }, function(a) {
        var b = this.Bg;
        b !== a && (v && (D.h(a, "string", pa, "font"), Mq(a) || D.k('Not a valid font: "' + a + '"')), this.Bg = a, this.sf.kk = null, this.K(), this.i("font", b, a))
    });
    var Mq;
    pa.isValidFont = Mq = function(a) {
        var b = Hq.font;
        if (a === b || "10px sans-serif" === a) return !0;
        Hq.font = "10px sans-serif";
        var c;
        Hq.font = a;
        var d = Hq.font;
        if ("10px sans-serif" !== d) return Hq.font = b, !0;
        Hq.font = "19px serif";
        c = Hq.font;
        Hq.font = a;
        d = Hq.font;
        Hq.font = b;
        return d !== c
    };
    D.defineProperty(pa, { text: "text" }, function() { return this.Yd }, function(a) {
        var b = this.Yd;
        a = null !== a && void 0 !== a ? a.toString() : "";
        b !== a && (this.Yd = a, this.K(), this.i("text", b, a))
    });
    D.defineProperty(pa, { textAlign: "textAlign" }, function() { return this.Yl }, function(a) {
        var b = this.Yl;
        b !== a && (v && D.h(a, "string", pa, "textAlign"), "start" === a || "end" === a || "left" === a || "right" === a || "center" === a ? (this.Yl = a, this.ra(), this.i("textAlign", b, a)) : D.ua(a, '"start", "end", "left", "right", or "center"', pa, "textAlign"))
    });
    D.defineProperty(pa, { wu: "flip" }, function() { return this.Ag }, function(a) {
        var b = this.Ag;
        b !== a && (D.Da(a, O, pa, "flip"), this.Ag = a, this.ra(), this.i("flip", b, a))
    });
    D.defineProperty(pa, { RM: "verticalAlignment" }, function() { return this.bm }, function(a) {
        var b = this.bm;
        b.O(a) || (v && D.l(a, S, pa, "verticalAlignment"), a.de() && D.k("TextBlock.verticalAlignment for " + this + " must be a real Spot, not:" + a), this.bm = a = a.V(), Zo(this), this.i("verticalAlignment", b, a))
    });
    D.w(pa, { Ga: "naturalBounds" }, function() {
        if (!this.fd.H()) {
            var a = Nq(this, this.Yd, this.sf, 999999).width,
                b = Oq(this, a, this.sf),
                c = this.Ea;
            isNaN(c.width) || (a = c.width);
            isNaN(c.height) || (b = c.height);
            Cb(this.fd, a, b)
        }
        return this.fd
    });
    D.defineProperty(pa, { ky: "isMultiline" }, function() { return this.Ym }, function(a) {
        var b = this.Ym;
        b !== a && (v && D.h(a, "boolean", pa, "isMultiline"), this.Ym = a, this.K(), this.i("isMultiline", b, a))
    });
    D.defineProperty(pa, { YL: "isUnderline" }, function() { return this.vk }, function(a) {
        var b = this.vk;
        b !== a && (v && D.h(a, "boolean", pa, "isUnderline"), this.vk = a, this.ra(), this.i("isUnderline", b, a))
    });
    D.defineProperty(pa, { XL: "isStrikethrough" }, function() { return this.tk }, function(a) {
        var b = this.tk;
        b !== a && (v && D.h(a, "boolean", pa, "isStrikethrough"), this.tk = a, this.ra(), this.i("isStrikethrough", b, a))
    });
    D.defineProperty(pa, { yH: "wrap" }, function() { return this.Aj }, function(a) {
        var b = this.Aj;
        b !== a && (v && D.Da(a, pa, pa, "wrap"), this.Aj = a, this.K(), this.i("wrap", b, a))
    });
    D.defineProperty(pa, { overflow: "overflow" }, function() { return this.pj }, function(a) {
        var b = this.pj;
        b !== a && (v && D.Da(a, pa, pa, "overflow"), this.pj = a, this.K(), this.i("overflow", b, a))
    });
    D.defineProperty(pa, { stroke: "stroke" }, function() { return this.Bc }, function(a) {
        var b = this.Bc;
        b !== a && (v && null !== a && D.hu(a, "TextBlock.stroke"), a instanceof Ba && a.freeze(), this.Bc = a, this.ra(), this.i("stroke", b, a))
    });
    D.w(pa, { wB: "lineCount" }, function() { return this.xe });
    D.defineProperty(pa, { XA: "editable" }, function() { return this.Xr }, function(a) {
        var b = this.Xr;
        b !== a && (v && D.h(a, "boolean", pa, "editable"), this.Xr = a, this.i("editable", b, a))
    });
    D.defineProperty(pa, { mH: "textEditor" }, function() { return this.Rt }, function(a) {
        var b = this.Rt;
        b !== a && (!v || a instanceof HTMLElement || a instanceof hk || D.k("TextEditingTool.defaultTextEditor must be an HTMLElement or HTMLInfo."), this.Rt = a, this.i("textEditor", b, a))
    });
    D.defineProperty(pa, { ZA: "errorFunction" }, function() { return this.bf }, function(a) {
        var b = this.bf;
        b !== a && (null !== a && D.h(a, "function", pa, "errorFunction"), this.bf = a, this.i("errorFunction", b, a))
    });
    D.defineProperty(pa, { interval: "interval" }, function() { return this.Fg }, function(a) {
        var b = this.Fg;
        v && D.p(a, pa, "interval");
        a = Math.floor(a);
        if (b !== a && 0 <= a) {
            this.Fg = a;
            this.K();
            var c = this.R;
            null !== c && c.type === pp && (c.pk = null);
            this.i("interval", b, a)
        }
    });
    D.defineProperty(pa, { UF: "graduatedStart" }, function() { return this.Eg }, function(a) {
        var b = this.Eg;
        v && D.p(a, pa, "graduatedStart");
        b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.Eg = a, this.K(), this.i("graduatedStart", b, a))
    });
    D.defineProperty(pa, { SF: "graduatedEnd" }, function() { return this.Dg }, function(a) {
        var b = this.Dg;
        v && D.p(a, pa, "graduatedEnd");
        b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.Dg = a, this.K(), this.i("graduatedEnd", b, a))
    });
    D.defineProperty(pa, { TF: "graduatedFunction" }, function() { return this.Um }, function(a) {
        var b = this.Um;
        b !== a && (null !== a && D.h(a, "function", pa, "graduatedFunction"), this.Um = a, this.K(), this.i("graduatedFunction", b, a))
    });
    pa.prototype.Wk = function(a, b) {
        if (null !== this.Bc && 0 !== this.Yd.length && null !== this.Bg) {
            var c = this.Ga.width,
                d = this.Ga.height,
                e = Pq(this),
                g = a.textAlign = this.Yl,
                h = b.rs;
            "start" === g && (g = h ? "right" : "left");
            "end" === g && (g = h ? "left" : "right");
            Vo(this, a, this.Bc, !0, !1);
            (this.vk || this.tk) && Vo(this, a, this.Bc, !1, !1);
            var k = 0,
                h = !1,
                l = D.Fb(0, 0);
            this.Hh.vb(l);
            var m = D.Fb(0, e);
            this.Hh.vb(m);
            var n = l.Kf(m);
            D.A(l);
            D.A(m);
            l = b.scale;
            8 > n * l * l && (h = !0);
            b.dd !== a && (h = !1);
            !1 === b.Kj("textGreeking") && (h = !1);
            n = this.vi;
            l = this.wi;
            switch (this.wu) {
                case Ao:
                    a.translate(c,
                        0);
                    a.scale(-1, 1);
                    break;
                case zo:
                    a.translate(0, d);
                    a.scale(1, -1);
                    break;
                case Bo:
                    a.translate(c, d), a.scale(-1, -1)
            }
            var m = this.xe,
                p = (n + e + l) * m;
            d > p && (k = this.bm, k = k.y * d - k.y * p + k.offsetY);
            for (var p = this.sf, q = 0; q < m; q++) {
                var r = p.Ff[q],
                    s = p.Ze[q];
                r > c && (r = c);
                var k = k + n,
                    u = s,
                    s = a,
                    t = k,
                    y = c,
                    w = e,
                    A = g,
                    B = 0;
                h ? ("left" === A ? B = 0 : "right" === A ? B = y - r : "center" === A && (B = (y - r) / 2), s.fillRect(0 + B, t + .25 * w, r, 1)) : ("left" === A ? B = 0 : "right" === A ? B = y : "center" === A && (B = y / 2), s.fillText(u, 0 + B, t + w - .25 * w), u = w / 20 | 0, 0 === u && (u = 1), "right" === A ? B -= r : "center" ===
                    A && (B -= r / 2), this.vk && (s.beginPath(), s.lineWidth = u, s.moveTo(0 + B, t + w - .2 * w), s.lineTo(0 + B + r, t + w - .2 * w), s.stroke()), this.tk && (s.beginPath(), s.lineWidth = u, t = t + w - w / 2.2 | 0, 0 !== u % 2 && (t += .5), s.moveTo(0 + B, t), s.lineTo(0 + B + r, t), s.stroke()));
                k += e + l
            }
            switch (this.wu) {
                case Ao:
                    a.scale(-1, 1);
                    a.translate(-c, 0);
                    break;
                case zo:
                    a.scale(1, -1);
                    a.translate(0, -d);
                    break;
                case Bo:
                    a.scale(-1, -1), a.translate(-c, -d)
            }
        }
    };
    pa.prototype.ho = function(a, b, c, d) {
        this.rp = a;
        var e = this.sf;
        e.reset();
        var g = 0,
            h = 0;
        if (isNaN(this.Ea.width)) {
            g = this.Yd.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
            if (0 === g.length) g = 0;
            else if (this.ky) {
                for (var k = h = 0, l = !1; !l;) {
                    var m = g.indexOf("\n", k); - 1 === m && (m = g.length, l = !0);
                    k = Qq(g.substr(k, m - k).replace(/^\s+|\s+$/g, ""), this.Bg);
                    k > h && (h = k);
                    k = m + 1
                }
                g = h
            } else h = g.indexOf("\n", 0), 0 <= h && (g = g.substr(0, h)), g = k = Qq(g, this.Bg);
            g = Math.min(g, a / this.scale);
            g = Math.max(8, g)
        } else g = this.Ea.width;
        null !== this.R && (g = Math.min(g,
            this.R.pf.width));
        h = Oq(this, g, e);
        m = h = isNaN(this.Ea.height) ? Math.min(h, b / this.scale) : this.Ea.height;
        if (0 !== e.Pe && 1 !== e.Ze.length && this.pj === Lq && (b = this.Bg, l = this.pj === Lq ? Rq(b) : 0, k = this.vi + this.wi, k = Math.max(0, Pq(this) + k), m = Math.min(this.IJ - 1, Math.max(Math.floor(m / k + .01) - 1, 0)), !(m + 1 >= e.Ze.length))) {
            k = e.Ze[m];
            for (l = Math.max(1, a - l); Qq(k, b) > l && 1 < k.length;) k = k.substr(0, k.length - 1);
            k += Fq;
            b = Qq(k, b);
            e.Ze[m] = k;
            e.Ze = e.Ze.slice(0, m + 1);
            e.Ff[m] = b;
            e.Ff = e.Ff.slice(0, m + 1);
            e.zj = e.Ze.length;
            e.Pe = Math.max(e.Pe, b);
            this.xe =
                e.zj
        }
        if (this.yH === Jq || isNaN(this.Ea.width)) g = isNaN(a) ? e.Pe : Math.min(a, e.Pe), isNaN(this.Ea.width) && (g = Math.max(8, g));
        g = Math.max(c, g);
        h = Math.max(d, h);
        Cb(this.fd, g, h);
        Jo(this, 0, 0, g, h)
    };
    pa.prototype.Cj = function(a, b, c, d) { Oo(this, a, b, c, d) };

    function Nq(a, b, c, d) {
        b = b.replace(/^\s+|\s+$/g, "");
        var e = 0,
            g = 0,
            h = 0,
            k = a.Bg,
            g = a.vi + a.wi,
            l = Math.max(0, Pq(a) + g),
            h = a.pj === Lq ? Rq(k) : 0;
        if (a.xe >= a.wh) return new Ca(0, l);
        if (a.Aj === Iq) {
            c.zj = 1;
            g = Qq(b, k);
            if (0 === h || g <= d) return c.Pe = Math.max(c.Pe, g), c.Ff.push(c.Pe), c.Ze.push(b), new Ca(g, l);
            var m = Sq(a, b);
            b = b.substr(m.length);
            for (var n = Sq(a, b), g = Qq(m + n, k); 0 < n.length && g <= d;) m += n, b = b.substr(n.length), n = Sq(a, b), g = Qq((m + n).replace(/^\s+|\s+$/g, ""), k);
            m += n.replace(/^\s+|\s+$/g, "");
            for (d = Math.max(1, d - h); Qq(m, k) > d && 1 < m.length;) m =
                m.substr(0, m.length - 1);
            m += Fq;
            h = Qq(m, k);
            c.Ff.push(h);
            c.Pe = h;
            c.Ze.push(m);
            return new Ca(h, l)
        }
        var p = 0;
        0 === b.length && (p = 1, c.Ff.push(0), c.Ze.push(b));
        for (; 0 < b.length;) {
            m = Sq(a, b);
            for (b = b.substr(m.length); Qq(m, k) > d;) {
                n = 1;
                g = Qq(m.substr(0, n), k);
                for (h = 0; g <= d;) n++, h = g, g = Qq(m.substr(0, n), k);
                1 === n ? (c.Ff[a.xe + p] = g, e = Math.max(e, g)) : (c.Ff[a.xe + p] = h, e = Math.max(e, h));
                n--;
                1 > n && (n = 1);
                c.Ze[a.xe + p] = m.substr(0, n);
                p++;
                m = m.substr(n);
                if (a.xe + p > a.wh) break
            }
            n = Sq(a, b);
            for (g = Qq(m + n, k); 0 < n.length && g <= d;) m += n, b = b.substr(n.length),
                n = Sq(a, b), g = Qq((m + n).replace(/^\s+|\s+$/g, ""), k);
            m = m.replace(/^\s+|\s+$/g, "");
            if ("" !== m && ("\u00ad" === m[m.length - 1] && (m = m.substring(0, m.length - 1) + "\u2010"), 0 === n.length ? (c.Ff.push(g), e = Math.max(e, g)) : (h = Qq(m, k), c.Ff.push(h), e = Math.max(e, h)), c.Ze.push(m), p++, a.xe + p > a.wh)) break
        }
        c.zj = Math.min(a.wh, p);
        c.Pe = Math.max(c.Pe, e);
        return new Ca(c.Pe, l * c.zj)
    }

    function Sq(a, b) { if (a.Aj === Kq) return b.substr(0, 1); for (var c = b.length, d = 0; d < c && !Aq.test(b.charAt(d));) d++; for (; d < c && Aq.test(b.charAt(d));) d++; return d >= c ? b : b.substr(0, d) }

    function Qq(a, b) { Gq !== b && (Gq = Hq.font = b); return Hq.measureText(a).width }

    function Pq(a) {
        if (null !== a.sf.kk) return a.sf.kk;
        var b = a.Bg;
        Gq !== b && (Gq = Hq.font = b);
        var c = 0;
        void 0 !== Bq[b] && 5E3 > Cq ? c = Bq[b] : (c = 1.3 * Hq.measureText("M").width, Bq[b] = c, Cq++);
        return a.sf.kk = c
    }

    function Rq(a) {
        Gq !== a && (Gq = Hq.font = a);
        var b = 0;
        void 0 !== Dq[a] && 5E3 > Eq ? b = Dq[a] : (b = Hq.measureText(Fq).width, Dq[a] = b, Eq++);
        return b
    }

    function Oq(a, b, c) {
        var d = a.Yd.replace(/\r\n/g, "\n").replace(/\r/g, "\n"),
            e = a.vi + a.wi,
            e = Math.max(0, Pq(a) + e);
        if (0 === d.length) return c.Pe = 0, a.xe = 1, e;
        if (!a.ky) {
            var g = d.indexOf("\n", 0);
            0 <= g && (d = d.substr(0, g))
        }
        for (var g = 0, h = a.xe = 0, k = -1, l = !1; !l;) k = d.indexOf("\n", h), -1 === k && (k = d.length, l = !0), h <= k && (h = d.substr(h, k - h), a.Aj !== Iq ? (c.zj = 0, h = Nq(a, h, c, b), g += h.height, a.xe += c.zj) : (Nq(a, h, c, b), g += e, a.xe++), a.xe === a.wh && (l = !0)), h = k + 1;
        return a.Cw = g
    }
    D.defineProperty(pa, { jC: "textValidation" }, function() { return this.Zl }, function(a) {
        var b = this.Zl;
        b !== a && (null !== a && D.h(a, "function", pa, "textValidation"), this.Zl = a, this.i("textValidation", b, a))
    });
    D.defineProperty(pa, { lH: "textEdited" }, function() { return this.Qt }, function(a) {
        var b = this.Qt;
        b !== a && (null !== a && D.h(a, "function", pa, "textEdited"), this.Qt = a, this.i("textEdited", b, a))
    });
    D.defineProperty(pa, { GM: "spacingAbove" }, function() { return this.vi }, function(a) {
        var b = this.vi;
        b !== a && (v && D.h(a, "number", pa, "spacingAbove"), this.vi = a, this.i("spacingAbove", b, a))
    });
    D.defineProperty(pa, { HM: "spacingBelow" }, function() { return this.wi }, function(a) {
        var b = this.wi;
        b !== a && (v && D.h(a, "number", pa, "spacingBelow"), this.wi = a, this.i("spacingBelow", b, a))
    });
    D.defineProperty(pa, { IJ: "maxLines" }, function() { return this.wh }, function(a) {
        var b = this.wh;
        b !== a && (v && D.h(a, "number", pa, "maxLines"), a = Math.floor(a), 0 >= a && D.ua(a, "> 0", pa, "maxLines"), this.wh = a, this.i("maxLines", b, a), this.K())
    });
    D.w(pa, { hM: "metrics" }, function() { return this.sf });
    D.defineProperty(pa, { pL: "choices" }, function() { return this.ur }, function(a) {
        var b = this.ur;
        b !== a && (null === a || Array.isArray(a) || D.kc(a, "Array", pa, "choices:value"), this.ur = a, this.i("choices", b, a))
    });

    function bq() {
        this.Pe = this.zj = 0;
        this.Ff = [];
        this.Ze = [];
        this.kk = null
    }
    bq.prototype.reset = function() {
        this.Pe = this.zj = 0;
        this.kk = null;
        this.Ff = [];
        this.Ze = []
    };
    bq.prototype.gq = function(a) {
        this.zj = a.zj;
        this.kk = a.kk;
        this.Pe = a.Pe;
        this.Ff = D.km(a.Ff);
        this.Ze = D.km(a.Ze)
    };
    D.w(bq, { mL: "arrSize" }, function() { return this.Ff });
    D.w(bq, { nL: "arrText" }, function() { return this.Ze });
    D.w(bq, { gM: "maxLineWidth" }, function() { return this.Pe });
    D.w(bq, { RL: "fontHeight" }, function() { return this.kk });

    function Hl() {
        O.call(this);
        this.af = null;
        this.Kt = "";
        this.Gk = je;
        this.gp = Ye;
        this.zi = this.bf = null;
        this.fp = mc;
        this.Ag = Zj;
        this.Rp = null;
        this.Xz = !1;
        this.ap = !0;
        this.Aw = !1;
        this.Jp = null
    }
    D.Ta(Hl, O);
    D.ka("Picture", Hl);
    Hl.prototype.cloneProtected = function(a) {
        O.prototype.cloneProtected.call(this, a);
        a.element = this.af;
        a.Kt = this.Kt;
        a.Gk = this.Gk.V();
        a.gp = this.gp;
        a.Ag = this.Ag;
        a.bf = this.bf;
        a.zi = this.zi;
        a.fp = this.fp.V();
        a.ap = this.ap;
        a.Jp = this.Jp
    };
    Hl.prototype.qc = function(a) { a === Zj || a === bk || a === ck ? this.gJ = a : O.prototype.qc.call(this, a) };
    Hl.prototype.toString = function() { return "Picture(" + this.source + ")#" + D.Nd(this) };
    var Tq = new ma,
        Uq = 0,
        Bl = [];

    function Vq() {
        var a = Bl;
        if (0 === a.length)
            for (var b = window.document.getElementsByTagName("canvas"), c = b.length, d = 0; d < c; d++) {
                var e = b[d];
                e.parentElement && e.parentElement.ca && a.push(e.parentElement.ca)
            }
        return a
    }
    var Wq;
    Hl.clearCache = Wq = function(a) {
        void 0 === a && (a = "");
        D.h(a, "string", Hl, "clearCache:url");
        "" !== a ? Tq[a] && (delete Tq[a], Uq--) : (Tq = new ma, Uq = 0)
    };
    D.defineProperty(Hl, { element: "element" }, function() { return this.af }, function(a) {
        var b = this.af;
        if (b !== a) {
            null === a || a instanceof HTMLImageElement || a instanceof HTMLVideoElement || a instanceof HTMLCanvasElement || D.k("Picture.element must be an instance of Image, Canvas, or Video, not: " + a);
            this.Xz = a instanceof HTMLCanvasElement;
            this.af = a;
            if (null !== a)
                if (a instanceof HTMLCanvasElement || !0 === a.complete) a.ep instanceof Event && null !== this.bf && this.bf(this, a.ep), !0 === a.ps && null !== this.zi && this.zi(this, a.mA),
                    a.ps = !0, this.Ea.H() || (km(this, !1), this.K());
                else {
                    var c = this;
                    a.xD || (a.addEventListener("load", function(b) {
                        Xq(a, b);
                        c.Ea.H() || (km(c, !1), c.K())
                    }), a.addEventListener("error", function(b) { Yq(a, b) }), a.xD = !0)
                }
            this.i("element", b, a);
            this.ra()
        }
    });
    D.defineProperty(Hl, { source: "source" }, function() { return this.Kt }, function(a) {
        var b = this.Kt;
        if (b !== a) {
            D.h(a, "string", Hl, "source");
            this.Kt = a;
            var c = Tq,
                d = this.g;
            if (void 0 !== c[a]) var e = c[a].$p[0].source;
            else {
                30 < Uq && (Wq(), c = Tq);
                var e = D.createElement("img"),
                    g = this;
                e.addEventListener("load", function(a) {
                    Xq(e, a);
                    g.Ea.H() || (km(g, !1), g.K())
                });
                e.addEventListener("error", function(a) { Yq(e, a) });
                e.xD = !0;
                var h = this.Jp;
                null !== h && (e.crossOrigin = h(this));
                e.src = a;
                c[a] = new Zq(e);
                Uq++
            }
            null !== d && yn(d, this);
            this.element = e;
            null !== d && xn(d, this);
            this.K();
            this.ra();
            this.i("source", b, a)
        }
    });

    function Xq(a, b) {
        a.ps = !0;
        a.ep = !1;
        for (var c = null, d = Vq(), e = d.length, g = 0; g < e; g++) {
            var h = d[g],
                k = h.Cp.oa(a.src);
            if (null !== k)
                for (var l = k.length, m = 0; m < l; m++) c = k[m], h.iA.add(c), h.Ve(), null === a.mA && (a.mA = b, null !== c.zi && c.zi(c, b))
        }
    }

    function Yq(a, b) {
        a.ep = b;
        for (var c = null, d = Vq(), e = d.length, g = 0; g < e; g++)
            if (c = d[g].Cp.oa(a.src), null !== c) {
                for (var h = c.length, k = D.mb(), l = 0; l < h; l++) k.push(c[l]);
                for (l = 0; l < h; l++) c = k[l], null !== c.bf && c.bf(c, b);
                D.ya(k)
            }
    }
    D.defineProperty(Hl, { FM: "sourceCrossOrigin" }, function() { return this.Jp }, function(a) {
        if (this.Jp !== a && (null !== a && D.h(a, "function", Hl, "sourceCrossOrigin"), this.Jp = a, null !== this.element)) {
            var b = this.element.src;
            null === a && "string" === typeof b ? this.element.crossOrigin = null : null !== a && (this.element.crossOrigin = a(this));
            this.element.src = b
        }
    });
    D.defineProperty(Hl, { Yj: "sourceRect" }, function() { return this.Gk }, function(a) {
        var b = this.Gk;
        b.O(a) || (D.l(a, C, Hl, "sourceRect"), this.Gk = a = a.V(), this.ra(), this.i("sourceRect", b, a))
    });
    D.defineProperty(Hl, { gJ: "imageStretch" }, function() { return this.gp }, function(a) {
        var b = this.gp;
        b !== a && (D.Da(a, O, Hl, "imageStretch"), this.gp = a, this.ra(), this.i("imageStretch", b, a))
    });
    D.defineProperty(Hl, { wu: "flip" }, function() { return this.Ag }, function(a) {
        var b = this.Ag;
        b !== a && (D.Da(a, O, Hl, "flip"), this.Ag = a, this.ra(), this.i("flip", b, a))
    });
    D.defineProperty(Hl, { TL: "imageAlignment" }, function() { return this.fp }, function(a) {
        D.l(a, S, Hl, "imageAlignment");
        var b = this.fp;
        b.O(a) || (this.fp = a = a.V(), this.K(), this.i("imageAlignment", b, a))
    });
    D.defineProperty(Hl, { ZA: "errorFunction" }, function() { return this.bf }, function(a) {
        var b = this.bf;
        b !== a && (null !== a && D.h(a, "function", Hl, "errorFunction"), this.bf = a, this.i("errorFunction", b, a))
    });
    D.defineProperty(Hl, { PM: "successFunction" }, function() { return this.zi }, function(a) {
        var b = this.zi;
        b !== a && (null !== a && D.h(a, "function", Hl, "successFunction"), this.zi = a, this.i("successFunction", b, a))
    });
    Hl.prototype.Wk = function(a, b) {
        var c = this.af;
        if (null !== c) {
            var d = c.src;
            null !== d && "" !== d || D.k('Element has no source ("src") attribute: ' + c);
            if (!(c.ep instanceof Event) && !1 !== c.ps) {
                var d = this.Ga,
                    e = 0,
                    g = 0,
                    h = this.Xz,
                    k = h ? +c.width : c.naturalWidth,
                    h = h ? +c.height : c.naturalHeight;
                void 0 === k && c.videoWidth && (k = c.videoWidth);
                void 0 === h && c.videoHeight && (h = c.videoHeight);
                k = k || d.width;
                h = h || d.height;
                if (0 !== k && 0 !== h) {
                    var l = k,
                        m = h;
                    this.Yj.H() && (e = this.Gk.x, g = this.Gk.y, k = this.Gk.width, h = this.Gk.height);
                    var n = k,
                        p = h,
                        q = this.gp,
                        r = this.fp;
                    switch (q) {
                        case Zj:
                            if (this.Yj.H()) break;
                            n >= d.width && (e = e + 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 Ye:
                            n = d.width;
                            p = d.height;
                            break;
                        case bk:
                        case ck:
                            var s = 0;
                            q === bk ? (s = Math.min(d.height / p, d.width / n), n *= s, p *= s) : q === ck && (s = Math.max(d.height / p, d.width / n), n *= s, p *= s, n >= d.width && (e = (e + 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)
                    }
                    var q = this.Jj() * b.scale,
                        u = k * h / (n * q * p * q),
                        s = Tq[this.source],
                        q = null;
                    if (c.ps && void 0 !== s && 16 < u) {
                        2 > s.$p.length && ($q(s, 4, l, m), $q(s, 16, l, m));
                        for (var l = s.$p, m = l.length, q = l[0], t = 0; t < m; t++)
                            if (l[t].Oq * l[t].Oq < u) q = l[t];
                            else break
                    }
                    if (!b.Ur) {
                        if (null === this.Rp)
                            if (null === this.af) this.Rp = !1;
                            else {
                                l = (new ja(null)).Tk;
                                l.drawImage(this.af, 0, 0);
                                try { l.getImageData(0, 0, 1, 1).data[3] && (this.Rp = !1), this.Rp = !1 } catch (y) { this.Rp = !0 }
                            }
                        if (this.Rp) return
                    }
                    l = 0;
                    n < d.width && (l = r.offsetX + (d.width * r.x - n * r.x));
                    m = 0;
                    p <
                        d.height && (m = r.offsetY + (d.height * r.y - p * r.y));
                    switch (this.wu) {
                        case Ao:
                            a.translate(Math.min(d.width, n), 0);
                            a.scale(-1, 1);
                            break;
                        case zo:
                            a.translate(0, Math.min(d.height, p));
                            a.scale(1, -1);
                            break;
                        case Bo:
                            a.translate(Math.min(d.width, n), Math.min(d.height, p)), a.scale(-1, -1)
                    }
                    if (b.Kj("pictureRatioOptimization") && !b.Yz && void 0 !== s && null !== q && 1 !== q.Oq) {
                        a.save();
                        s = q.Oq;
                        try { a.drawImage(q.source, e / s, g / s, Math.min(q.source.width, k / s), Math.min(q.source.height, h / s), l, m, Math.min(d.width, n), Math.min(d.height, p)) } catch (w) {
                            v &&
                                this.ap && D.trace(w.toString()), this.ap = !1
                        }
                        a.restore()
                    } else try { a.drawImage(c, e, g, k, h, l, m, Math.min(d.width, n), Math.min(d.height, p)) } catch (A) { v && this.ap && D.trace(A.toString()), this.ap = !1 }
                    switch (this.wu) {
                        case Ao:
                            a.scale(-1, 1);
                            a.translate(-Math.min(d.width, n), 0);
                            break;
                        case zo:
                            a.scale(1, -1);
                            a.translate(0, -Math.min(d.height, p));
                            break;
                        case Bo:
                            a.scale(-1, -1), a.translate(-Math.min(d.width, n), -Math.min(d.height, p))
                    }
                }
            }
        }
    };
    D.w(Hl, { Ga: "naturalBounds" }, function() { return this.fd });
    Hl.prototype.ho = function(a, b, c, d) {
        var e = this.Ea,
            g = Mo(this, !0),
            h = this.af,
            k = this.Xz;
        if (k || !this.Aw && h && h.complete) this.Aw = !0;
        null === h && (isFinite(e.width) || (a = 0), isFinite(e.height) || (b = 0));
        isFinite(e.width) || g === Ye || g === yo ? (isFinite(a) || (a = this.Yj.H() ? this.Yj.width : k ? +h.width : h.naturalWidth), c = 0) : null !== h && !1 !== this.Aw && (a = this.Yj.H() ? this.Yj.width : k ? +h.width : h.naturalWidth);
        isFinite(e.height) || g === Ye || g === xo ? (isFinite(b) || (b = this.Yj.H() ? this.Yj.height : k ? +h.height : h.naturalHeight), d = 0) : null !== h && !1 !==
            this.Aw && (b = this.Yj.H() ? this.Yj.height : k ? +h.height : h.naturalHeight);
        isFinite(e.width) && (a = e.width);
        isFinite(e.height) && (b = e.height);
        e = this.pf;
        g = this.ah;
        c = Math.max(c, g.width);
        d = Math.max(d, g.height);
        a = Math.min(e.width, a);
        b = Math.min(e.height, b);
        a = Math.max(c, a);
        b = Math.max(d, b);
        null === h || h.complete || (isFinite(a) || (a = 0), isFinite(b) || (b = 0));
        Cb(this.fd, a, b);
        Jo(this, 0, 0, a, b)
    };
    Hl.prototype.Cj = function(a, b, c, d) { Oo(this, a, b, c, d) };

    function Zq(a) { this.$p = [new ar(a, 1)] }

    function $q(a, b, c, d) {
        var e = new ja(null),
            g = e.Tk,
            h = 1 / b;
        e.width = c / b;
        e.height = d / b;
        b = new ar(e.$d, b);
        c = a.$p[a.$p.length - 1];
        g.setTransform(h * c.Oq, 0, 0, h * c.Oq, 0, 0);
        g.drawImage(c.source, 0, 0);
        a.$p.push(b)
    }

    function ar(a, b) {
        this.source = a;
        this.Oq = b
    }

    function Fa() {
        this.q = new Ve;
        this.fc = null
    }
    f = Fa.prototype;
    f.reset = function() {
        this.q = new Ve;
        this.fc = null
    };

    function T(a, b, c, d, e, g) {
        null === a.q && D.k("StreamGeometryContext has been closed");
        void 0 !== e && !0 === e ? (null === a.fc && D.k("Need to call beginFigure first"), d = new $f(Ef), d.F = b, d.G = c, a.fc.Eb.add(d)) : (a.fc = new Xe, a.fc.la = b, a.fc.ja = c, a.fc.Ku = d, a.q.nc.add(a.fc));
        void 0 !== g && (a.fc.mp = g)
    }

    function X(a) {
        null === a.q && D.k("StreamGeometryContext has been closed");
        null === a.fc && D.k("Need to call beginFigure first");
        var b = a.fc.Eb.length;
        0 < b && a.fc.Eb.fa(b - 1).close()
    }

    function Bf(a) {
        null === a.q && D.k("StreamGeometryContext has been closed");
        null === a.fc && D.k("Need to call beginFigure first");
        0 < a.fc.Eb.length && (a.fc.Ku = !0)
    }
    f.jb = function(a) {
        null === this.q && D.k("StreamGeometryContext has been closed");
        null === this.fc && D.k("Need to call beginFigure first");
        this.fc.dl = a
    };
    f.moveTo = function(a, b, c) {
        void 0 === c && (c = !1);
        null === this.q && D.k("StreamGeometryContext has been closed");
        null === this.fc && D.k("Need to call beginFigure first");
        var d = new $f(Ef);
        d.F = a;
        d.G = b;
        c && d.close();
        this.fc.Eb.add(d)
    };
    f.lineTo = function(a, b, c) {
        void 0 === c && (c = !1);
        null === this.q && D.k("StreamGeometryContext has been closed");
        null === this.fc && D.k("Need to call beginFigure first");
        var d = new $f(wf);
        d.F = a;
        d.G = b;
        c && d.close();
        this.fc.Eb.add(d)
    };

    function U(a, b, c, d, e, g, h, k) {
        void 0 === k && (k = !1);
        null === a.q && D.k("StreamGeometryContext has been closed");
        null === a.fc && D.k("Need to call beginFigure first");
        var l = new $f(Ff);
        l.Ec = b;
        l.$c = c;
        l.Uh = d;
        l.Vh = e;
        l.F = g;
        l.G = h;
        k && l.close();
        a.fc.Eb.add(l)
    }

    function zf(a, b, c, d, e) {
        var g;
        void 0 === g && (g = !1);
        null === a.q && D.k("StreamGeometryContext has been closed");
        null === a.fc && D.k("Need to call beginFigure first");
        var h = new $f(Gf);
        h.Ec = b;
        h.$c = c;
        h.F = d;
        h.G = e;
        g && h.close();
        a.fc.Eb.add(h)
    }
    f.arcTo = function(a, b, c, d, e, g, h) {
        void 0 === g && (g = 0);
        void 0 === h && (h = !1);
        null === this.q && D.k("StreamGeometryContext has been closed");
        null === this.fc && D.k("Need to call beginFigure first");
        var k = new $f(Hf);
        k.Me = a;
        k.Df = b;
        k.pa = c;
        k.va = d;
        k.radiusX = e;
        k.radiusY = 0 !== g ? g : e;
        h && k.close();
        this.fc.Eb.add(k)
    };

    function Af(a, b, c, d, e, g, h, k) {
        var l;
        void 0 === l && (l = !1);
        null === a.q && D.k("StreamGeometryContext has been closed");
        null === a.fc && D.k("Need to call beginFigure first");
        b = new $f(If, h, k, b, c, d, e, g);
        l && b.close();
        a.fc.Eb.add(b)
    }

    function br(a) {
        a = cr(a);
        var b = D.mb();
        b[0] = a[0];
        for (var c = 1, d = 1; d < a.length;) b[c] = a[d], b[c + 1] = a[d], b[c + 2] = a[d + 1], d += 2, c += 3;
        D.ya(a);
        return b
    }

    function cr(a) {
        var b = dr(a),
            c = D.mb(),
            d = Math.floor(b.length / 2),
            e = b.length - 1;
        a = 0 === a % 2 ? 2 : 1;
        for (var g = 0; g < e; g++) {
            var h = b[g],
                k = b[g + 1],
                l = b[(d + g - 1) % e],
                m = b[(d + g + a) % e];
            c[2 * g] = h;
            c[2 * g + 1] = Ke(h.x, h.y, l.x, l.y, k.x, k.y, m.x, m.y, new N)
        }
        c[c.length] = c[0];
        D.ya(b);
        return c
    }

    function dr(a) {
        for (var b = D.mb(), c = 1.5 * Math.PI, d = 0, e = 0; e < a; e++) d = 2 * Math.PI / a * e + c, b[e] = new N(.5 + .5 * Math.cos(d), .5 + .5 * Math.sin(d));
        b.push(b[0]);
        return b
    }
    var qq = {
            None: "Rectangle",
            Rectangle: function(a, b, c) {
                a = new Ve;
                a.type = tf;
                a.la = 0;
                a.ja = 0;
                a.F = b;
                a.G = c;
                return a
            },
            Square: function(a, b, c) {
                a = new Ve;
                a.le = bk;
                a.type = tf;
                a.la = 0;
                a.ja = 0;
                a.F = Math.min(b, c);
                a.G = Math.min(b, c);
                return a
            },
            Ellipse: function(a, b, c) {
                a = new Ve;
                a.type = uf;
                a.la = 0;
                a.ja = 0;
                a.F = b;
                a.G = c;
                a.C = ke;
                a.D = le;
                return a
            },
            Circle: function(a, b, c) {
                a = new Ve;
                a.le = bk;
                a.type = uf;
                a.la = 0;
                a.ja = 0;
                a.F = Math.min(b, c);
                a.G = Math.min(b, c);
                a.C = ke;
                a.D = le;
                return a
            },
            Connector: "Ellipse",
            TriangleRight: function(a, b, c) {
                a = new Ve;
                var d = new Xe,
                    e = new $f;
                e.F = b;
                e.G = .5 * c;
                d.Eb.add(e);
                b = new $f;
                b.F = 0;
                b.G = c;
                d.Eb.add(b.close());
                a.nc.add(d);
                a.C = new S(0, .25);
                a.D = new S(.5, .75);
                return a
            },
            TriangleDown: function(a, b, c) {
                a = new Ve;
                var d = new Xe,
                    e = new $f;
                e.F = b;
                e.G = 0;
                d.Eb.add(e);
                e = new $f;
                e.F = .5 * b;
                e.G = c;
                d.Eb.add(e.close());
                a.nc.add(d);
                a.C = new S(.25, 0);
                a.D = new S(.75, .5);
                return a
            },
            TriangleLeft: function(a, b, c) {
                a = new Ve;
                var d = new Xe;
                d.la = b;
                d.ja = c;
                var e = new $f;
                e.F = 0;
                e.G = .5 * c;
                d.Eb.add(e);
                c = new $f;
                c.F = b;
                c.G = 0;
                d.Eb.add(c.close());
                a.nc.add(d);
                a.C = new S(.5, .25);
                a.D = new S(1,
                    .75);
                return a
            },
            TriangleUp: function(a, b, c) {
                a = new Ve;
                var d = new Xe;
                d.la = b;
                d.ja = c;
                var e = new $f;
                e.F = 0;
                e.G = c;
                d.Eb.add(e);
                c = new $f;
                c.F = .5 * b;
                c.G = 0;
                d.Eb.add(c.close());
                a.nc.add(d);
                a.C = new S(.25, .5);
                a.D = new S(.75, 1);
                return a
            },
            Line1: function(a, b, c) {
                a = new Ve;
                a.type = Ze;
                a.la = 0;
                a.ja = 0;
                a.F = b;
                a.G = c;
                return a
            },
            Line2: function(a, b, c) {
                a = new Ve;
                a.type = Ze;
                a.la = b;
                a.ja = 0;
                a.F = 0;
                a.G = c;
                return a
            },
            MinusLine: "LineH",
            LineH: function(a, b, c) {
                a = new Ve;
                a.type = Ze;
                a.la = 0;
                a.ja = c / 2;
                a.F = b;
                a.G = c / 2;
                return a
            },
            LineV: function(a, b, c) {
                a = new Ve;
                a.type =
                    Ze;
                a.la = b / 2;
                a.ja = 0;
                a.F = b / 2;
                a.G = c;
                return a
            },
            BarH: "Rectangle",
            BarV: "Rectangle",
            Curve1: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                U(a, Jd * b, 0, 1 * b, (1 - Jd) * c, b, c);
                b = a.q;
                D.u(a);
                return b
            },
            Curve2: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                U(a, 0, Jd * c, (1 - Jd) * b, c, b, c);
                b = a.q;
                D.u(a);
                return b
            },
            Curve3: function(a, b, c) {
                a = D.v();
                T(a, 1 * b, 0, !1);
                U(a, 1 * b, Jd * c, Jd * b, 1 * c, 0, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            Curve4: function(a, b, c) {
                a = D.v();
                T(a, 1 * b, 0, !1);
                U(a, (1 - Jd) * b, 0, 0, (1 - Jd) * c, 0, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            Alternative: "Triangle",
            Merge: "Triangle",
            Triangle: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, 0 * c, !0);
                a.lineTo(0 * b, 1 * c);
                a.lineTo(1 * b, 1 * c, !0);
                b = a.q;
                b.C = new S(.25, .5);
                b.D = new S(.75, 1);
                D.u(a);
                return b
            },
            Decision: "Diamond",
            Diamond: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, 0, !0);
                a.lineTo(0, .5 * c);
                a.lineTo(.5 * b, 1 * c);
                a.lineTo(1 * b, .5 * c, !0);
                b = a.q;
                b.C = new S(.25, .25);
                b.D = new S(.75, .75);
                D.u(a);
                return b
            },
            Pentagon: function(a, b, c) {
                var d = dr(5);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 5 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.2, .22);
                b.D = new S(.8,
                    .9);
                D.u(a);
                return b
            },
            DataTransmission: "Hexagon",
            Hexagon: function(a, b, c) {
                var d = dr(6);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 6 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.07, .25);
                b.D = new S(.93, .75);
                D.u(a);
                return b
            },
            Heptagon: function(a, b, c) {
                var d = dr(7);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 7 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.2, .15);
                b.D = new S(.8, .85);
                D.u(a);
                return b
            },
            Octagon: function(a, b, c) {
                var d = dr(8);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 8 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.15, .15);
                b.D = new S(.85, .85);
                D.u(a);
                return b
            },
            Nonagon: function(a, b, c) {
                var d = dr(9);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 9 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.17, .13);
                b.D = new S(.82, .82);
                D.u(a);
                return b
            },
            Decagon: function(a, b, c) {
                var d = dr(10);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 10 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.16, .16);
                b.D = new S(.84, .84);
                D.u(a);
                return b
            },
            Dodecagon: function(a, b, c) {
                var d = dr(12);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 12 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.16, .16);
                b.D = new S(.84, .84);
                D.u(a);
                return b
            },
            FivePointedStar: function(a, b, c) {
                var d = cr(5);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 10 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.312, .383);
                b.D = new S(.693, .765);
                D.u(a);
                return b
            },
            SixPointedStar: function(a, b, c) {
                var d = cr(6);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 12 > e; e++) a.lineTo(d[e].x *
                    b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.17, .251);
                b.D = new S(.833, .755);
                D.u(a);
                return b
            },
            SevenPointedStar: function(a, b, c) {
                var d = cr(7);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 14 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.363, .361);
                b.D = new S(.641, .709);
                D.u(a);
                return b
            },
            EightPointedStar: function(a, b, c) {
                var d = cr(8);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 16 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.252, .255);
                b.D = new S(.75, .75);
                D.u(a);
                return b
            },
            NinePointedStar: function(a,
                b, c) {
                var d = cr(9);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 18 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.355, .361);
                b.D = new S(.645, .651);
                D.u(a);
                return b
            },
            TenPointedStar: function(a, b, c) {
                var d = cr(10);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; 20 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.281, .261);
                b.D = new S(.723, .748);
                D.u(a);
                return b
            },
            FivePointedBurst: function(a, b, c) {
                var d = br(5);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; e < d.length; e += 3) U(a, d[e].x *
                    b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.312, .383);
                b.D = new S(.693, .765);
                D.u(a);
                return b
            },
            SixPointedBurst: function(a, b, c) {
                var d = br(6);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; e < d.length; e += 3) U(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.17, .251);
                b.D = new S(.833, .755);
                D.u(a);
                return b
            },
            SevenPointedBurst: function(a, b, c) {
                var d = br(7);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; e < d.length; e += 3) U(a, d[e].x *
                    b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.363, .361);
                b.D = new S(.641, .709);
                D.u(a);
                return b
            },
            EightPointedBurst: function(a, b, c) {
                var d = br(8);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; e < d.length; e += 3) U(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.252, .255);
                b.D = new S(.75, .75);
                D.u(a);
                return b
            },
            NinePointedBurst: function(a, b, c) {
                var d = br(9);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; e < d.length; e += 3) U(a, d[e].x *
                    b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.355, .361);
                b.D = new S(.645, .651);
                D.u(a);
                return b
            },
            TenPointedBurst: function(a, b, c) {
                var d = br(10);
                a = D.v();
                T(a, d[0].x * b, d[0].y * c, !0);
                for (var e = 1; e < d.length; e += 3) U(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
                D.ya(d);
                X(a);
                b = a.q;
                b.C = new S(.281, .261);
                b.D = new S(.723, .748);
                D.u(a);
                return b
            },
            Cloud: function(a, b, c) {
                a = D.v();
                T(a, .08034461 * b, .1944299 * c, !0);
                U(a, -.09239631 * b, .07836421 * c, .1406031 * b, -.0542823 * c, .2008615 *
                    b, .05349299 * c);
                U(a, .2450511 * b, -.00697547 * c, .3776197 * b, -.01112067 * c, .4338609 * b, .074219 * c);
                U(a, .4539471 * b, 0, .6066018 * b, -.02526587 * c, .6558228 * b, .07004196 * c);
                U(a, .6914277 * b, -.01904177 * c, .8921095 * b, -.01220843 * c, .8921095 * b, .08370865 * c);
                U(a, 1.036446 * b, .04105738 * c, 1.020377 * b, .3022052 * c, .9147671 * b, .3194596 * c);
                U(a, 1.04448 * b, .360238 * c, .992256 * b, .5219009 * c, .9082935 * b, .562044 * c);
                U(a, 1.032337 * b, .5771781 * c, 1.018411 * b, .8120651 * c, .9212406 * b, .8217117 * c);
                U(a, 1.028411 * b, .9571472 * c, .8556702 * b, 1.052487 * c, .7592566 * b, .9156953 *
                    c);
                U(a, .7431877 * b, 1.009325 * c, .5624123 * b, 1.021761 * c, .5101666 * b, .9310455 * c);
                U(a, .4820677 * b, 1.031761 * c, .3030112 * b, 1.002796 * c, .2609328 * b, .9344623 * c);
                U(a, .2329994 * b, 1.01518 * c, .03213784 * b, 1.01518 * c, .08034461 * b, .870098 * c);
                U(a, -.02812061 * b, .9032597 * c, -.01205169 * b, .6835638 * c, .06829292 * b, .6545475 * c);
                U(a, -.01812061 * b, .6089503 * c, -.00606892 * b, .4555777 * c, .06427569 * b, .4265613 * c);
                U(a, -.01606892 * b, .3892545 * c, -.01205169 * b, .1944299 * c, .08034461 * b, .1944299 * c);
                X(a);
                b = a.q;
                b.C = new S(.1, .1);
                b.D = new S(.9, .9);
                D.u(a);
                return b
            },
            Gate: "Crescent",
            Crescent: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !0);
                U(a, 1 * b, 0, 1 * b, 1 * c, 0, 1 * c);
                U(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0);
                X(a);
                b = a.q;
                b.C = new S(.511, .19);
                b.D = new S(.776, .76);
                D.u(a);
                return b
            },
            FramedRectangle: function(a, b, c) {
                var d = D.v(),
                    e = a ? a.Sc : NaN;
                a = a ? a.ev : NaN;
                isNaN(e) && (e = .1);
                isNaN(a) && (a = .1);
                T(d, 0, 0, !0);
                d.lineTo(1 * b, 0);
                d.lineTo(1 * b, 1 * c);
                d.lineTo(0, 1 * c, !0);
                T(d, e * b, a * c, !1, !0);
                d.lineTo(e * b, (1 - a) * c);
                d.lineTo((1 - e) * b, (1 - a) * c);
                d.lineTo((1 - e) * b, a * c, !0);
                b = d.q;
                b.C = new S(e, a);
                b.D = new S(1 - e, 1 - a);
                D.u(d);
                return b
            },
            Delay: "HalfEllipse",
            HalfEllipse: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !0);
                U(a, Jd * b, 0, 1 * b, (.5 - Jd / 2) * c, 1 * b, .5 * c);
                U(a, 1 * b, (.5 + Jd / 2) * c, Jd * b, 1 * c, 0, 1 * c);
                X(a);
                b = a.q;
                b.C = new S(0, .2);
                b.D = new S(.75, .8);
                D.u(a);
                return b
            },
            Heart: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, 1 * c, !0);
                U(a, .1 * b, .8 * c, 0, .5 * c, 0 * b, .3 * c);
                U(a, 0 * b, 0, .45 * b, 0, .5 * b, .3 * c);
                U(a, .55 * b, 0, 1 * b, 0, 1 * b, .3 * c);
                U(a, b, .5 * c, .9 * b, .8 * c, .5 * b, 1 * c);
                X(a);
                b = a.q;
                b.C = new S(.15, .29);
                b.D = new S(.86, .68);
                D.u(a);
                return b
            },
            Spade: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, 0, !0);
                a.lineTo(.51 * b, .01 * c);
                U(a, .6 * b, .2 * c, b, .25 * c, b, .5 * c);
                U(a, b, .8 * c, .6 * b, .8 * c, .55 * b, .7 * c);
                U(a, .5 * b, .75 * c, .55 * b, .95 * c, .75 * b, c);
                a.lineTo(.25 * b, c);
                U(a, .45 * b, .95 * c, .5 * b, .75 * c, .45 * b, .7 * c);
                U(a, .4 * b, .8 * c, 0, .8 * c, 0, .5 * c);
                U(a, 0, .25 * c, .4 * b, .2 * c, .49 * b, .01 * c);
                X(a);
                b = a.q;
                b.C = new S(.19, .26);
                b.D = new S(.8, .68);
                D.u(a);
                return b
            },
            Club: function(a, b, c) {
                a = D.v();
                T(a, .4 * b, .6 * c, !0);
                U(a, .5 * b, .75 * c, .45 * b, .95 * c, .15 * b, 1 * c);
                a.lineTo(.85 * b, c);
                U(a, .55 * b, .95 * c, .5 * b, .75 * c, .6 * b, .6 * c);
                var d = .2,
                    e = .3,
                    g = 0,
                    h = 4 * (Math.SQRT2 - 1) / 3 * d;
                U(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) *
                    b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
                U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
                U(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
                U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e + .05) * b, (.5 - h + g - .02) * c, .65 * b, .36771243 * c);
                d = .2;
                e = 0;
                g = -.3;
                h = 4 * (Math.SQRT2 - 1) / 3 * d;
                U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
                U(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
                U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
                U(a, (.5 - d +
                    e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, .35 * b, .36771243 * c);
                d = .2;
                e = -.3;
                g = 0;
                h = 4 * (Math.SQRT2 - 1) / 3 * d;
                U(a, (.5 + d + e - .05) * b, (.5 - h + g - .02) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
                U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
                U(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
                U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, .4 * b, .6 * c);
                X(a);
                b = a.q;
                b.C = new S(.06, .39);
                b.D = new S(.93, .58);
                D.u(a);
                return b
            },
            Ring: function(a, b, c) {
                a = D.v();
                var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
                T(a, b, .5 *
                    c, !0);
                U(a, b, (.5 - d) * c, (.5 + d) * b, 0, .5 * b, 0);
                U(a, (.5 - d) * b, 0, 0, (.5 - d) * c, 0, .5 * c);
                U(a, 0, (.5 + d) * c, (.5 - d) * b, c, .5 * b, c);
                U(a, (.5 + d) * b, c, b, (.5 + d) * c, b, .5 * c);
                d = 4 * (Math.SQRT2 - 1) / 3 * .4;
                T(a, .5 * b, .1 * c, !0, !0);
                U(a, (.5 + d) * b, .1 * c, .9 * b, (.5 - d) * c, .9 * b, .5 * c);
                U(a, .9 * b, (.5 + d) * c, (.5 + d) * b, .9 * c, .5 * b, .9 * c);
                U(a, (.5 - d) * b, .9 * c, .1 * b, (.5 + d) * c, .1 * b, .5 * c);
                U(a, .1 * b, (.5 - d) * c, (.5 - d) * b, .1 * c, .5 * b, .1 * c);
                b = a.q;
                b.C = new S(.146, .146);
                b.D = new S(.853, .853);
                b.le = bk;
                D.u(a);
                return b
            },
            YinYang: function(a, b, c) {
                var d = .5;
                a = D.v();
                d = .5;
                T(a, .5 * b, 0, !0);
                a.arcTo(270,
                    180, .5 * b, .5 * b, .5 * b);
                U(a, 1 * b, d * c, 0, d * c, d * b, 0, !0);
                var d = .1,
                    e = .25;
                T(a, (.5 + d) * b, e * c, !0, !0);
                a.arcTo(0, -360, .5 * b, c * e, d * b);
                X(a);
                T(a, .5 * b, 0, !1);
                a.arcTo(270, -180, .5 * b, .5 * b, .5 * b);
                a.jb(!1);
                e = .75;
                T(a, (.5 + d) * b, e * c, !0);
                a.arcTo(0, 360, .5 * b, c * e, d * b);
                X(a);
                b = a.q;
                b.le = bk;
                D.u(a);
                return b
            },
            Peace: function(a, b, c) {
                a = D.v();
                var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
                T(a, b, .5 * c, !0);
                U(a, b, (.5 - d) * c, (.5 + d) * b, 0, .5 * b, 0);
                U(a, (.5 - d) * b, 0, 0, (.5 - d) * c, 0, .5 * c);
                U(a, 0, (.5 + d) * c, (.5 - d) * b, c, .5 * b, c);
                U(a, (.5 + d) * b, c, b, (.5 + d) * c, b, .5 * c);
                d = 4 * (Math.SQRT2 - 1) / 3 * .4;
                T(a, .5 * b, .1 * c, !0, !0);
                U(a, (.5 + d) * b, .1 * c, .9 * b, (.5 - d) * c, .9 * b, .5 * c);
                U(a, .9 * b, (.5 + d) * c, (.5 + d) * b, .9 * c, .5 * b, .9 * c);
                U(a, (.5 - d) * b, .9 * c, .1 * b, (.5 + d) * c, .1 * b, .5 * c);
                U(a, .1 * b, (.5 - d) * c, (.5 - d) * b, .1 * c, .5 * b, .1 * c);
                var d = .07,
                    e = 0,
                    g = -.707 * .11,
                    h = 4 * (Math.SQRT2 - 1) / 3 * d;
                T(a, (.5 + d + e) * b, (.5 + g) * c, !0);
                U(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
                U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
                U(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
                U(a, (.5 + h + e) * b, (.5 + d + g) *
                    c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
                d = .07;
                e = -.707 * .11;
                g = .707 * .11;
                h = 4 * (Math.SQRT2 - 1) / 3 * d;
                T(a, (.5 + d + e) * b, (.5 + g) * c, !0);
                U(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
                U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
                U(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
                U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
                d = .07;
                e = .707 * .11;
                g = .707 * .11;
                h = 4 * (Math.SQRT2 - 1) / 3 * d;
                T(a, (.5 + d + e) * b, (.5 + g) * c, !0);
                U(a, (.5 + d + e) * b, (.5 - h +
                    g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
                U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
                U(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
                U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
                b = a.q;
                b.C = new S(.146, .146);
                b.D = new S(.853, .853);
                b.le = bk;
                D.u(a);
                return b
            },
            NotAllowed: function(a, b, c) {
                var d = .5 * Jd,
                    e = .5;
                a = D.v();
                T(a, .5 * b, (.5 - e) * c, !0);
                U(a, (.5 - d) * b, (.5 - e) * c, (.5 - e) * b, (.5 - d) * c, (.5 - e) * b, .5 * c);
                U(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b,
                    (.5 + e) * c);
                U(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 + e) * b, .5 * c);
                U(a, (.5 + e) * b, (.5 - d) * c, (.5 + d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
                var e = .4,
                    d = .4 * Jd,
                    g = D.P(),
                    h = D.P(),
                    k = D.P(),
                    l = D.P();
                Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .42, g, h, k, l, l);
                var m = D.P(),
                    n = D.P(),
                    p = D.P();
                Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .58, l, l, p, m, n);
                var q = D.P(),
                    r = D.P(),
                    s = D.P();
                Ce(.5, .5 + e, .5 - d, .5 + e, .5 - e, .5 + d, .5 - e, .5, .42, q, r, s, l, l);
                var u = D.P(),
                    t = D.P(),
                    y = D.P();
                Ce(.5, .5 + e, .5 - d, .5 + e, .5 - e, .5 + d, .5 - e, .5, .58, l, l, y, u, t);
                T(a, y.x * b, y.y * c, !0, !0);
                U(a, u.x * b,
                    u.y * c, t.x * b, t.y * c, (.5 - e) * b, .5 * c);
                U(a, (.5 - e) * b, (.5 - d) * c, (.5 - d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
                U(a, g.x * b, g.y * c, h.x * b, h.y * c, k.x * b, k.y * c);
                a.lineTo(y.x * b, y.y * c);
                X(a);
                T(a, s.x * b, s.y * c, !0, !0);
                a.lineTo(p.x * b, p.y * c);
                U(a, m.x * b, m.y * c, n.x * b, n.y * c, (.5 + e) * b, .5 * c);
                U(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
                U(a, q.x * b, q.y * c, r.x * b, r.y * c, s.x * b, s.y * c);
                X(a);
                D.A(g);
                D.A(h);
                D.A(k);
                D.A(l);
                D.A(m);
                D.A(n);
                D.A(p);
                D.A(q);
                D.A(r);
                D.A(s);
                D.A(u);
                D.A(t);
                D.A(y);
                b = a.q;
                D.u(a);
                b.le = bk;
                return b
            },
            Fragile: function(a, b, c) {
                a = D.v();
                T(a,
                    0, 0, !0);
                a.lineTo(.25 * b, 0);
                a.lineTo(.2 * b, .15 * c);
                a.lineTo(.3 * b, .25 * c);
                a.lineTo(.29 * b, .33 * c);
                a.lineTo(.35 * b, .25 * c);
                a.lineTo(.3 * b, .15 * c);
                a.lineTo(.4 * b, 0);
                a.lineTo(1 * b, 0);
                U(a, 1 * b, .25 * c, .75 * b, .5 * c, .55 * b, .5 * c);
                a.lineTo(.55 * b, .9 * c);
                a.lineTo(.7 * b, .9 * c);
                a.lineTo(.7 * b, 1 * c);
                a.lineTo(.3 * b, 1 * c);
                a.lineTo(.3 * b, .9 * c);
                a.lineTo(.45 * b, .9 * c);
                a.lineTo(.45 * b, .5 * c);
                U(a, .25 * b, .5 * c, 0, .25 * c, 0, 0);
                X(a);
                b = a.q;
                b.C = new S(.25, 0);
                b.D = new S(.75, .4);
                D.u(a);
                return b
            },
            HourGlass: function(a, b, c) {
                a = D.v();
                T(a, .65 * b, .5 * c, !0);
                a.lineTo(1 * b,
                    1 * c);
                a.lineTo(0, 1 * c);
                a.lineTo(.35 * b, .5 * c);
                a.lineTo(0, 0);
                a.lineTo(1 * b, 0);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            Lightning: function(a, b, c) {
                a = D.v();
                T(a, 0 * b, .55 * c, !0);
                a.lineTo(.75 * b, 0);
                a.lineTo(.25 * b, .45 * c);
                a.lineTo(.9 * b, .48 * c);
                a.lineTo(.4 * b, 1 * c);
                a.lineTo(.65 * b, .55 * c);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            Parallelogram1: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) && (a = .1);
                var d = D.v();
                T(d, a * b, 0, !0);
                d.lineTo(1 * b, 0);
                d.lineTo((1 - a) * b, 1 * c);
                d.lineTo(0, 1 * c);
                X(d);
                b = d.q;
                b.C = new S(a, 0);
                b.D = new S(1 - a, 1);
                D.u(d);
                return b
            },
            Input: "Output",
            Output: function(a,
                b, c) {
                a = D.v();
                T(a, 0, 1 * c, !0);
                a.lineTo(.1 * b, 0);
                a.lineTo(1 * b, 0);
                a.lineTo(.9 * b, 1 * c);
                X(a);
                b = a.q;
                b.C = new S(.1, 0);
                b.D = new S(.9, 1);
                D.u(a);
                return b
            },
            Parallelogram2: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) && (a = .25);
                var d = D.v();
                T(d, a * b, 0, !0);
                d.lineTo(1 * b, 0);
                d.lineTo((1 - a) * b, 1 * c);
                d.lineTo(0, 1 * c);
                X(d);
                b = d.q;
                b.C = new S(a, 0);
                b.D = new S(1 - a, 1);
                D.u(d);
                return b
            },
            ThickCross: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) && (a = .25);
                var d = D.v();
                T(d, (.5 - a / 2) * b, 0, !0);
                d.lineTo((.5 + a / 2) * b, 0);
                d.lineTo((.5 + a / 2) * b, (.5 - a / 2) * c);
                d.lineTo(1 * b, (.5 -
                    a / 2) * c);
                d.lineTo(1 * b, (.5 + a / 2) * c);
                d.lineTo((.5 + a / 2) * b, (.5 + a / 2) * c);
                d.lineTo((.5 + a / 2) * b, 1 * c);
                d.lineTo((.5 - a / 2) * b, 1 * c);
                d.lineTo((.5 - a / 2) * b, (.5 + a / 2) * c);
                d.lineTo(0, (.5 + a / 2) * c);
                d.lineTo(0, (.5 - a / 2) * c);
                d.lineTo((.5 - a / 2) * b, (.5 - a / 2) * c);
                X(d);
                b = d.q;
                b.C = new S(.5 - a / 2, .5 - a / 2);
                b.D = new S(.5 + a / 2, .5 + a / 2);
                D.u(d);
                return b
            },
            ThickX: function(a, b, c) {
                a = .25 / Math.SQRT2;
                var d = D.v();
                T(d, .3 * b, 0, !0);
                d.lineTo(.5 * b, .2 * c);
                d.lineTo(.7 * b, 0);
                d.lineTo(1 * b, .3 * c);
                d.lineTo(.8 * b, .5 * c);
                d.lineTo(1 * b, .7 * c);
                d.lineTo(.7 * b, 1 * c);
                d.lineTo(.5 * b, .8 *
                    c);
                d.lineTo(.3 * b, 1 * c);
                d.lineTo(0, .7 * c);
                d.lineTo(.2 * b, .5 * c);
                d.lineTo(0, .3 * c);
                X(d);
                b = d.q;
                b.C = new S(.5 - a, .5 - a);
                b.D = new S(.5 + a, .5 + a);
                D.u(d);
                return b
            },
            ThinCross: function(a, b, c) {
                var d = a ? a.Sc : NaN;
                isNaN(d) && (d = .1);
                a = D.v();
                T(a, (.5 - d / 2) * b, 0, !0);
                a.lineTo((.5 + d / 2) * b, 0);
                a.lineTo((.5 + d / 2) * b, (.5 - d / 2) * c);
                a.lineTo(1 * b, (.5 - d / 2) * c);
                a.lineTo(1 * b, (.5 + d / 2) * c);
                a.lineTo((.5 + d / 2) * b, (.5 + d / 2) * c);
                a.lineTo((.5 + d / 2) * b, 1 * c);
                a.lineTo((.5 - d / 2) * b, 1 * c);
                a.lineTo((.5 - d / 2) * b, (.5 + d / 2) * c);
                a.lineTo(0, (.5 + d / 2) * c);
                a.lineTo(0, (.5 - d / 2) * c);
                a.lineTo((.5 -
                    d / 2) * b, (.5 - d / 2) * c);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            ThinX: function(a, b, c) {
                a = D.v();
                T(a, .1 * b, 0, !0);
                a.lineTo(.5 * b, .4 * c);
                a.lineTo(.9 * b, 0);
                a.lineTo(1 * b, .1 * c);
                a.lineTo(.6 * b, .5 * c);
                a.lineTo(1 * b, .9 * c);
                a.lineTo(.9 * b, 1 * c);
                a.lineTo(.5 * b, .6 * c);
                a.lineTo(.1 * b, 1 * c);
                a.lineTo(0, .9 * c);
                a.lineTo(.4 * b, .5 * c);
                a.lineTo(0, .1 * c);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            RightTriangle: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !0);
                a.lineTo(1 * b, 1 * c);
                a.lineTo(0, 1 * c);
                X(a);
                b = a.q;
                b.C = new S(0, .5);
                b.D = new S(.5, 1);
                D.u(a);
                return b
            },
            RoundedIBeam: function(a, b, c) {
                a =
                    D.v();
                T(a, 0, 0, !0);
                a.lineTo(1 * b, 0);
                U(a, .5 * b, .25 * c, .5 * b, .75 * c, 1 * b, 1 * c);
                a.lineTo(0, 1 * c);
                U(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            RoundedRectangle: function(a, b, c) {
                var d = a ? a.Sc : NaN;
                isNaN(d) && (d = 5);
                d = Math.min(d, b / 3);
                d = Math.min(d, c / 3);
                a = d * Jd;
                var e = D.v();
                T(e, d, 0, !0);
                e.lineTo(b - d, 0);
                U(e, b - a, 0, b, a, b, d);
                e.lineTo(b, c - d);
                U(e, b, c - a, b - a, c, b - d, c);
                e.lineTo(d, c);
                U(e, a, c, 0, c - a, 0, c - d);
                e.lineTo(0, d);
                U(e, 0, a, a, 0, d, 0);
                X(e);
                b = e.q;
                1 < a ? (b.C = new S(0, 0, a, a), b.D = new S(1, 1, -a, -a)) : (b.C = ec, b.D = vc);
                D.u(e);
                return b
            },
            Border: function(a, b, c) {
                var d = a ? a.Sc : NaN;
                isNaN(d) && (d = 5);
                d = Math.min(d, b / 3);
                d = Math.min(d, c / 3);
                a = D.v();
                T(a, d, 0, !0);
                a.lineTo(b - d, 0);
                U(a, b - 0, 0, b, 0, b, d);
                a.lineTo(b, c - d);
                U(a, b, c - 0, b - 0, c, b - d, c);
                a.lineTo(d, c);
                U(a, 0, c, 0, c - 0, 0, c - d);
                a.lineTo(0, d);
                U(a, 0, 0, 0, 0, d, 0);
                X(a);
                b = a.q;
                b.C = ec;
                b.D = vc;
                D.u(a);
                return b
            },
            SquareIBeam: function(a, b, c) {
                var d = a ? a.Sc : NaN;
                isNaN(d) && (d = .2);
                a = D.v();
                T(a, 0, 0, !0);
                a.lineTo(1 * b, 0);
                a.lineTo(1 * b, d * c);
                a.lineTo((.5 + d / 2) * b, d * c);
                a.lineTo((.5 + d / 2) * b, (1 - d) * c);
                a.lineTo(1 * b, (1 - d) * c);
                a.lineTo(1 * b, 1 *
                    c);
                a.lineTo(0, 1 * c);
                a.lineTo(0, (1 - d) * c);
                a.lineTo((.5 - d / 2) * b, (1 - d) * c);
                a.lineTo((.5 - d / 2) * b, d * c);
                a.lineTo(0, d * c);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            Trapezoid: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) && (a = .2);
                var d = D.v();
                T(d, a * b, 0, !0);
                d.lineTo((1 - a) * b, 0);
                d.lineTo(1 * b, 1 * c);
                d.lineTo(0, 1 * c);
                X(d);
                b = d.q;
                b.C = new S(a, 0);
                b.D = new S(1 - a, 1);
                D.u(d);
                return b
            },
            ManualLoop: "ManualOperation",
            ManualOperation: function(a, b, c) {
                var d = a ? a.Sc : NaN;
                isNaN(d) && (d = 0);
                a = D.v();
                T(a, d, 0, !0);
                a.lineTo(0, 0);
                a.lineTo(1 * b, 0);
                a.lineTo(.9 * b, 1 * c);
                a.lineTo(.1 *
                    b, 1 * c);
                X(a);
                b = a.q;
                b.C = new S(.1, 0);
                b.D = new S(.9, 1);
                D.u(a);
                return b
            },
            GenderMale: function(a, b, c) {
                a = D.v();
                var d = .4 * Jd,
                    e = .4,
                    g = D.P(),
                    h = D.P(),
                    k = D.P(),
                    l = D.P();
                T(a, (.5 - e) * b, .5 * c, !0);
                U(a, (.5 - e) * b, (.5 - d) * c, (.5 - d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
                Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .44, k, l, h, g, g);
                U(a, k.x * b, k.y * c, l.x * b, l.y * c, h.x * b, h.y * c);
                var m = D.Fb(h.x, h.y);
                Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .56, g, g, h, k, l);
                var n = D.Fb(h.x, h.y);
                a.lineTo((.1 * m.x + .855) * b, .1 * m.y * c);
                a.lineTo(.85 * b, .1 * m.y * c);
                a.lineTo(.85 * b, 0);
                a.lineTo(1 *
                    b, 0);
                a.lineTo(1 * b, .15 * c);
                a.lineTo((.1 * n.x + .9) * b, .15 * c);
                a.lineTo((.1 * n.x + .9) * b, (.1 * n.y + .05 * .9) * c);
                a.lineTo(n.x * b, n.y * c);
                U(a, k.x * b, k.y * c, l.x * b, l.y * c, (.5 + e) * b, .5 * c);
                U(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
                U(a, (.5 - d) * b, (.5 + e) * c, (.5 - e) * b, (.5 + d) * c, (.5 - e) * b, .5 * c);
                e = .35;
                d = .35 * Jd;
                T(a, .5 * b, (.5 - e) * c, !0, !0);
                U(a, (.5 - d) * b, (.5 - e) * c, (.5 - e) * b, (.5 - d) * c, (.5 - e) * b, .5 * c);
                U(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
                U(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 + e) * b, .5 * c);
                U(a, (.5 + e) * b, (.5 - d) * c, (.5 +
                    d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
                T(a, (.5 - e) * b, .5 * c, !0);
                D.A(g);
                D.A(h);
                D.A(k);
                D.A(l);
                D.A(m);
                D.A(n);
                b = a.q;
                b.C = new S(.202, .257);
                b.D = new S(.692, .839);
                b.le = bk;
                D.u(a);
                return b
            },
            GenderFemale: function(a, b, c) {
                a = D.v();
                var d = .375,
                    e = 0,
                    g = -.125,
                    h = 4 * (Math.SQRT2 - 1) / 3 * d;
                T(a, (.525 + e) * b, (.5 + d + g) * c, !0);
                U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
                U(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
                U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
                U(a, (.5 - d + e) * b,
                    (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.475 + e) * b, (.5 + d + g) * c);
                a.lineTo(.475 * b, .85 * c);
                a.lineTo(.425 * b, .85 * c);
                a.lineTo(.425 * b, .9 * c);
                a.lineTo(.475 * b, .9 * c);
                a.lineTo(.475 * b, 1 * c);
                a.lineTo(.525 * b, 1 * c);
                a.lineTo(.525 * b, .9 * c);
                a.lineTo(.575 * b, .9 * c);
                a.lineTo(.575 * b, .85 * c);
                a.lineTo(.525 * b, .85 * c);
                X(a);
                d = .325;
                e = 0;
                g = -.125;
                h = 4 * (Math.SQRT2 - 1) / 3 * d;
                T(a, (.5 + d + e) * b, (.5 + g) * c, !0, !0);
                U(a, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
                U(a, (.5 - h + e) * b, (.5 + d + g) * c, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
                U(a, (.5 -
                    d + e) * b, (.5 - h + g) * c, (.5 - h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
                U(a, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
                T(a, (.525 + e) * b, (.5 + d + g) * c, !0);
                b = a.q;
                b.C = new S(.232, .136);
                b.D = new S(.782, .611);
                b.le = bk;
                D.u(a);
                return b
            },
            PlusLine: function(a, b, c) {
                a = D.v();
                T(a, 0, .5 * c, !1);
                a.lineTo(1 * b, .5 * c);
                a.moveTo(.5 * b, 0);
                a.lineTo(.5 * b, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            XLine: function(a, b, c) {
                a = D.v();
                T(a, 0, 1 * c, !1);
                a.lineTo(1 * b, 0);
                a.moveTo(0, 0);
                a.lineTo(1 * b, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            AsteriskLine: function(a, b, c) {
                a =
                    D.v();
                var d = .2 / Math.SQRT2;
                T(a, d * b, (1 - d) * c, !1);
                a.lineTo((1 - d) * b, d * c);
                a.moveTo(d * b, d * c);
                a.lineTo((1 - d) * b, (1 - d) * c);
                a.moveTo(0 * b, .5 * c);
                a.lineTo(1 * b, .5 * c);
                a.moveTo(.5 * b, 0 * c);
                a.lineTo(.5 * b, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            CircleLine: function(a, b, c) {
                var d = .5 * Jd;
                a = D.v();
                T(a, 1 * b, .5 * c, !1);
                U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
                U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
                U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
                b = a.q;
                b.C = new S(.146, .146);
                b.D = new S(.853, .853);
                b.le = bk;
                D.u(a);
                return b
            },
            Pie: function(a,
                b, c) {
                a = D.v();
                var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
                T(a, (.5 * Math.SQRT2 / 2 + .5) * b, (.5 - .5 * Math.SQRT2 / 2) * c, !0);
                U(a, .7 * b, 0 * c, .5 * b, 0 * c, .5 * b, 0 * c);
                U(a, (.5 - d + 0) * b, 0 * c, 0 * b, (.5 - d + 0) * c, 0 * b, .5 * c);
                U(a, 0 * b, (.5 + d + 0) * c, (.5 - d + 0) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 + d + 0) * b, 1 * c, 1 * b, (.5 + d + 0) * c, 1 * b, .5 * c);
                a.lineTo(.5 * b, .5 * c);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            PiePiece: function(a, b, c) {
                var d = Jd / Math.SQRT2 * .5,
                    e = Math.SQRT2 / 2,
                    g = 1 - Math.SQRT2 / 2;
                a = D.v();
                T(a, b, c, !0);
                U(a, b, (1 - d) * c, (e + d) * b, (g + d) * c, e * b, g * c);
                a.lineTo(0, c);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            StopSign: function(a,
                b, c) {
                a = 1 / (Math.SQRT2 + 2);
                var d = D.v();
                T(d, a * b, 0, !0);
                d.lineTo((1 - a) * b, 0);
                d.lineTo(1 * b, a * c);
                d.lineTo(1 * b, (1 - a) * c);
                d.lineTo((1 - a) * b, 1 * c);
                d.lineTo(a * b, 1 * c);
                d.lineTo(0, (1 - a) * c);
                d.lineTo(0, a * c);
                X(d);
                b = d.q;
                b.C = new S(a / 2, a / 2);
                b.D = new S(1 - a / 2, 1 - a / 2);
                D.u(d);
                return b
            },
            LogicImplies: function(a, b, c) {
                var d = a ? a.Sc : NaN;
                isNaN(d) && (d = .2);
                a = D.v();
                T(a, (1 - d) * b, 0 * c, !1);
                a.lineTo(1 * b, .5 * c);
                a.lineTo((1 - d) * b, c);
                a.moveTo(0, .5 * c);
                a.lineTo(b, .5 * c);
                b = a.q;
                b.C = ec;
                b.D = new S(.8, .5);
                D.u(a);
                return b
            },
            LogicIff: function(a, b, c) {
                var d = a ? a.Sc :
                    NaN;
                isNaN(d) && (d = .2);
                a = D.v();
                T(a, (1 - d) * b, 0 * c, !1);
                a.lineTo(1 * b, .5 * c);
                a.lineTo((1 - d) * b, c);
                a.moveTo(0, .5 * c);
                a.lineTo(b, .5 * c);
                a.moveTo(d * b, 0);
                a.lineTo(0, .5 * c);
                a.lineTo(d * b, c);
                b = a.q;
                b.C = new S(.2, 0);
                b.D = new S(.8, .5);
                D.u(a);
                return b
            },
            LogicNot: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                a.lineTo(1 * b, 0);
                a.lineTo(1 * b, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            LogicAnd: function(a, b, c) {
                a = D.v();
                T(a, 0, 1 * c, !1);
                a.lineTo(.5 * b, 0);
                a.lineTo(1 * b, 1 * c);
                b = a.q;
                b.C = new S(.25, .5);
                b.D = new S(.75, 1);
                D.u(a);
                return b
            },
            LogicOr: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                a.lineTo(.5 * b, 1 * c);
                a.lineTo(1 * b, 0);
                b = a.q;
                b.C = new S(.219, 0);
                b.D = new S(.78, .409);
                D.u(a);
                return b
            },
            LogicXor: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, 0, !1);
                a.lineTo(.5 * b, 1 * c);
                a.moveTo(0, .5 * c);
                a.lineTo(1 * b, .5 * c);
                var d = .5 * Jd;
                U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
                U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
                U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
                b = a.q;
                b.le = bk;
                D.u(a);
                return b
            },
            LogicTruth: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                a.lineTo(1 * b, 0);
                a.moveTo(.5 * b, 0);
                a.lineTo(.5 * b, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            LogicFalsity: function(a, b, c) {
                a = D.v();
                T(a, 0, 1 * c, !1);
                a.lineTo(1 * b, 1 * c);
                a.moveTo(.5 * b, 1 * c);
                a.lineTo(.5 * b, 0);
                b = a.q;
                D.u(a);
                return b
            },
            LogicThereExists: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                a.lineTo(1 * b, 0);
                a.lineTo(1 * b, .5 * c);
                a.lineTo(0, .5 * c);
                a.moveTo(1 * b, .5 * c);
                a.lineTo(1 * b, 1 * c);
                a.lineTo(0, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            LogicForAll: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                a.lineTo(.5 * b, 1 * c);
                a.lineTo(1 * b, 0);
                a.moveTo(.25 * b, .5 * c);
                a.lineTo(.75 * b, .5 * c);
                b = a.q;
                b.C = new S(.25, 0);
                b.D = new S(.75, .5);
                D.u(a);
                return b
            },
            LogicIsDefinedAs: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                a.lineTo(b, 0);
                a.moveTo(0, .5 * c);
                a.lineTo(b, .5 * c);
                a.moveTo(0, c);
                a.lineTo(b, c);
                b = a.q;
                b.C = new S(.01, .01);
                b.D = new S(.99, .49);
                D.u(a);
                return b
            },
            LogicIntersect: function(a, b, c) {
                var d = .5 * Jd;
                a = D.v();
                T(a, 0, 1 * c, !1);
                a.lineTo(0, .5 * c);
                U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
                U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
                a.lineTo(1 * b, 1 * c);
                b = a.q;
                b.C = new S(0, .5);
                b.D = vc;
                D.u(a);
                return b
            },
            LogicUnion: function(a, b, c) {
                var d = .5 * Jd;
                a = D.v();
                T(a, 1 * b, 0, !1);
                a.lineTo(1 * b, .5 * c);
                U(a,
                    1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
                a.lineTo(0, 0);
                b = a.q;
                b.C = ec;
                b.D = new S(1, .5);
                D.u(a);
                return b
            },
            Arrow: function(a, b, c) {
                var d = a ? a.Sc : NaN,
                    e = a ? a.ev : NaN;
                isNaN(d) && (d = .3);
                isNaN(e) && (e = .3);
                a = D.v();
                T(a, 0, (.5 - e / 2) * c, !0);
                a.lineTo((1 - d) * b, (.5 - e / 2) * c);
                a.lineTo((1 - d) * b, 0);
                a.lineTo(1 * b, .5 * c);
                a.lineTo((1 - d) * b, 1 * c);
                a.lineTo((1 - d) * b, (.5 + e / 2) * c);
                a.lineTo(0, (.5 + e / 2) * c);
                X(a);
                b = a.q;
                b.C = new S(0, .5 - e / 2);
                d = Ke(0, .5 + e / 2, 1, .5 + e / 2, 1 - d, 1, 1, .5, D.P());
                b.D = new S(d.x, d.y);
                D.A(d);
                D.u(a);
                return b
            },
            ISOProcess: "Chevron",
            Chevron: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !0);
                a.lineTo(.5 * b, 0);
                a.lineTo(1 * b, .5 * c);
                a.lineTo(.5 * b, 1 * c);
                a.lineTo(0, 1 * c);
                a.lineTo(.5 * b, .5 * c);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            DoubleArrow: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !0);
                a.lineTo(.3 * b, .214 * c);
                a.lineTo(.3 * b, 0);
                a.lineTo(1 * b, .5 * c);
                a.lineTo(.3 * b, 1 * c);
                a.lineTo(.3 * b, .786 * c);
                a.lineTo(0, 1 * c);
                X(a);
                T(a, .3 * b, .214 * c, !1);
                a.lineTo(.3 * b, .786 * c);
                a.jb(!1);
                b = a.q;
                D.u(a);
                return b
            },
            DoubleEndArrow: function(a, b, c) {
                a = D.v();
                T(a, 1 * b, .5 * c, !0);
                a.lineTo(.7 * b, 1 * c);
                a.lineTo(.7 * b, .7 * c);
                a.lineTo(.3 * b, .7 * c);
                a.lineTo(.3 * b, 1 * c);
                a.lineTo(0, .5 * c);
                a.lineTo(.3 * b, 0);
                a.lineTo(.3 * b, .3 * c);
                a.lineTo(.7 * b, .3 * c);
                a.lineTo(.7 * b, 0);
                X(a);
                b = a.q;
                c = Ke(0, .5, .3, 0, 0, .3, .3, .3, D.P());
                b.C = new S(c.x, c.y);
                c = Ke(.7, 1, 1, .5, .7, .7, 1, .7, c);
                b.D = new S(c.x, c.y);
                D.A(c);
                D.u(a);
                return b
            },
            IBeamArrow: function(a, b, c) {
                a = D.v();
                T(a, 1 * b, .5 * c, !0);
                a.lineTo(.7 * b, 1 * c);
                a.lineTo(.7 * b, .7 * c);
                a.lineTo(.2 * b, .7 * c);
                a.lineTo(.2 * b, 1 * c);
                a.lineTo(0, 1 * c);
                a.lineTo(0, 0);
                a.lineTo(.2 * b, 0);
                a.lineTo(.2 * b, .3 * c);
                a.lineTo(.7 * b, .3 * c);
                a.lineTo(.7 * b, 0);
                X(a);
                b = a.q;
                b.C = new S(0, .3);
                c = Ke(.7, 1, 1, .5, .7, .7, 1, .7, D.P());
                b.D = new S(c.x, c.y);
                D.A(c);
                D.u(a);
                return b
            },
            Pointer: function(a, b, c) {
                a = D.v();
                T(a, 1 * b, .5 * c, !0);
                a.lineTo(0, 1 * c);
                a.lineTo(.2 * b, .5 * c);
                a.lineTo(0, 0);
                X(a);
                b = a.q;
                b.C = new S(.2, .35);
                c = Ke(.2, .65, 1, .65, 0, 1, 1, .5, D.P());
                b.D = new S(c.x, c.y);
                D.A(c);
                D.u(a);
                return b
            },
            RoundedPointer: function(a, b, c) {
                a = D.v();
                T(a, 1 * b, .5 * c, !0);
                a.lineTo(0, 1 * c);
                U(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0);
                X(a);
                b = a.q;
                b.C = new S(.4, .35);
                c = Ke(.2, .65, 1, .65, 0, 1, 1, .5, D.P());
                b.D = new S(c.x,
                    c.y);
                D.A(c);
                D.u(a);
                return b
            },
            SplitEndArrow: function(a, b, c) {
                a = D.v();
                T(a, 1 * b, .5 * c, !0);
                a.lineTo(.7 * b, 1 * c);
                a.lineTo(.7 * b, .7 * c);
                a.lineTo(0, .7 * c);
                a.lineTo(.2 * b, .5 * c);
                a.lineTo(0, .3 * c);
                a.lineTo(.7 * b, .3 * c);
                a.lineTo(.7 * b, 0);
                X(a);
                b = a.q;
                b.C = new S(.2, .3);
                c = Ke(.7, 1, 1, .5, .7, .7, 1, .7, D.P());
                b.D = new S(c.x, c.y);
                D.A(c);
                D.u(a);
                return b
            },
            MessageToUser: "SquareArrow",
            SquareArrow: function(a, b, c) {
                a = D.v();
                T(a, 1 * b, .5 * c, !0);
                a.lineTo(.7 * b, 1 * c);
                a.lineTo(0, 1 * c);
                a.lineTo(0, 0);
                a.lineTo(.7 * b, 0);
                X(a);
                b = a.q;
                b.C = ec;
                b.D = new S(.7, 1);
                D.u(a);
                return b
            },
            Cone1: function(a, b, c) {
                var d = .5 * Jd,
                    e = .1 * Jd;
                a = D.v();
                T(a, 0, .9 * c, !0);
                a.lineTo(.5 * b, 0);
                a.lineTo(1 * b, .9 * c);
                U(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
                X(a);
                b = a.q;
                b.C = new S(.25, .5);
                b.D = new S(.75, .97);
                D.u(a);
                return b
            },
            Cone2: function(a, b, c) {
                a = D.v();
                T(a, 0, .9 * c, !0);
                U(a, (1 - .85 / .9) * b, 1 * c, .85 / .9 * b, 1 * c, 1 * b, .9 * c);
                a.lineTo(.5 * b, 0);
                a.lineTo(0, .9 * c);
                X(a);
                T(a, 0, .9 * c, !1);
                U(a, (1 - .85 / .9) * b, .8 * c, .85 / .9 * b, .8 * c, 1 * b, .9 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(.25, .5);
                b.D = new S(.75, .82);
                D.u(a);
                return b
            },
            Cube1: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, 1 * c, !0);
                a.lineTo(1 * b, .85 * c);
                a.lineTo(1 * b, .15 * c);
                a.lineTo(.5 * b, 0 * c);
                a.lineTo(0 * b, .15 * c);
                a.lineTo(0 * b, .85 * c);
                X(a);
                T(a, .5 * b, 1 * c, !1);
                a.lineTo(.5 * b, .3 * c);
                a.lineTo(0, .15 * c);
                a.moveTo(.5 * b, .3 * c);
                a.lineTo(1 * b, .15 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(0, .3);
                b.D = new S(.5, .85);
                D.u(a);
                return b
            },
            Cube2: function(a, b, c) {
                a = D.v();
                T(a, 0, .3 * c, !0);
                a.lineTo(0 * b, 1 * c);
                a.lineTo(.7 * b, c);
                a.lineTo(1 * b, .7 * c);
                a.lineTo(1 * b, 0 * c);
                a.lineTo(.3 * b, 0 * c);
                X(a);
                T(a, 0, .3 * c, !1);
                a.lineTo(.7 * b, .3 * c);
                a.lineTo(1 * b,
                    0 * c);
                a.moveTo(.7 * b, .3 * c);
                a.lineTo(.7 * b, 1 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(0, .3);
                b.D = new S(.7, 1);
                D.u(a);
                return b
            },
            MagneticData: "Cylinder1",
            Cylinder1: function(a, b, c) {
                var d = .5 * Jd,
                    e = .1 * Jd;
                a = D.v();
                T(a, 0, .1 * c, !0);
                U(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
                U(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
                a.lineTo(b, .9 * c);
                U(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
                a.lineTo(0, .1 * c);
                T(a, 0, .1 * c, !1);
                U(a, 0, (.1 + e) * c, (.5 - d) * b, .2 * c, .5 * b, .2 * c);
                U(a, (.5 + d) * b, .2 * c, 1 * b, (.1 + e) * c, 1 * b, .1 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(0,
                    .2);
                b.D = new S(1, .9);
                D.u(a);
                return b
            },
            Cylinder2: function(a, b, c) {
                var d = .5 * Jd,
                    e = .1 * Jd;
                a = D.v();
                T(a, 0, .9 * c, !0);
                a.lineTo(0, .1 * c);
                U(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
                U(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
                a.lineTo(1 * b, .9 * c);
                U(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
                T(a, 0, .9 * c, !1);
                U(a, 0, (.9 - e) * c, (.5 - d) * b, .8 * c, .5 * b, .8 * c);
                U(a, (.5 + d) * b, .8 * c, 1 * b, (.9 - e) * c, 1 * b, .9 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(0, .1);
                b.D = new S(1, .8);
                D.u(a);
                return b
            },
            Cylinder3: function(a, b, c) {
                var d = .1 * Jd,
                    e = .5 * Jd;
                a = D.v();
                T(a, .1 * b, 0, !0);
                a.lineTo(.9 * b, 0);
                U(a, (.9 + d) * b, 0, 1 * b, (.5 - e) * c, 1 * b, .5 * c);
                U(a, 1 * b, (.5 + e) * c, (.9 + d) * b, 1 * c, .9 * b, 1 * c);
                a.lineTo(.1 * b, 1 * c);
                U(a, (.1 - d) * b, 1 * c, 0, (.5 + e) * c, 0, .5 * c);
                U(a, 0, (.5 - e) * c, (.1 - d) * b, 0, .1 * b, 0);
                T(a, .1 * b, 0, !1);
                U(a, (.1 + d) * b, 0, .2 * b, (.5 - e) * c, .2 * b, .5 * c);
                U(a, .2 * b, (.5 + e) * c, (.1 + d) * b, 1 * c, .1 * b, 1 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(.2, 0);
                b.D = new S(.9, 1);
                D.u(a);
                return b
            },
            DirectData: "Cylinder4",
            Cylinder4: function(a, b, c) {
                var d = .1 * Jd,
                    e = .5 * Jd;
                a = D.v();
                T(a, .9 * b, 0, !0);
                U(a, (.9 + d) * b, 0, 1 * b, (.5 - e) * c, 1 * b, .5 * c);
                U(a, 1 * b, (.5 +
                    e) * c, (.9 + d) * b, 1 * c, .9 * b, 1 * c);
                a.lineTo(.1 * b, 1 * c);
                U(a, (.1 - d) * b, 1 * c, 0, (.5 + e) * c, 0, .5 * c);
                U(a, 0, (.5 - e) * c, (.1 - d) * b, 0, .1 * b, 0);
                a.lineTo(.9 * b, 0);
                T(a, .9 * b, 0, !1);
                U(a, (.9 - d) * b, 0, .8 * b, (.5 - e) * c, .8 * b, .5 * c);
                U(a, .8 * b, (.5 + e) * c, (.9 - d) * b, 1 * c, .9 * b, 1 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(.1, 0);
                b.D = new S(.8, 1);
                D.u(a);
                return b
            },
            Prism1: function(a, b, c) {
                a = D.v();
                T(a, .25 * b, .25 * c, !0);
                a.lineTo(.75 * b, 0);
                a.lineTo(b, .5 * c);
                a.lineTo(.5 * b, c);
                a.lineTo(0, c);
                X(a);
                T(a, .25 * b, .25 * c, !1);
                a.lineTo(.5 * b, c);
                a.jb(!1);
                b = a.q;
                b.C = new S(.408, .172);
                b.D = new S(.833,
                    .662);
                D.u(a);
                return b
            },
            Prism2: function(a, b, c) {
                a = D.v();
                T(a, 0, .25 * c, !0);
                a.lineTo(.75 * b, 0);
                a.lineTo(1 * b, .25 * c);
                a.lineTo(.75 * b, .75 * c);
                a.lineTo(0, 1 * c);
                X(a);
                T(a, 0, c, !1);
                a.lineTo(.25 * b, .5 * c);
                a.lineTo(b, .25 * c);
                a.moveTo(0, .25 * c);
                a.lineTo(.25 * b, .5 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(.25, .5);
                b.D = new S(.75, .75);
                D.u(a);
                return b
            },
            Pyramid1: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, 0, !0);
                a.lineTo(b, .75 * c);
                a.lineTo(.5 * b, 1 * c);
                a.lineTo(0, .75 * c);
                X(a);
                T(a, .5 * b, 0, !1);
                a.lineTo(.5 * b, 1 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(.25, .367);
                b.D = new S(.75,
                    .875);
                D.u(a);
                return b
            },
            Pyramid2: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, 0, !0);
                a.lineTo(b, .85 * c);
                a.lineTo(.5 * b, 1 * c);
                a.lineTo(0, .85 * c);
                X(a);
                T(a, .5 * b, 0, !1);
                a.lineTo(.5 * b, .7 * c);
                a.lineTo(0, .85 * c);
                a.moveTo(.5 * b, .7 * c);
                a.lineTo(1 * b, .85 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(.25, .367);
                b.D = new S(.75, .875);
                D.u(a);
                return b
            },
            Actor: function(a, b, c) {
                var d = .2 * Jd,
                    e = .1 * Jd,
                    g = .5,
                    h = .1;
                a = D.v();
                T(a, g * b, (h + .1) * c, !0);
                U(a, (g - d) * b, (h + .1) * c, (g - .2) * b, (h + e) * c, (g - .2) * b, h * c);
                U(a, (g - .2) * b, (h - e) * c, (g - d) * b, (h - .1) * c, g * b, (h - .1) * c);
                U(a, (g + d) * b, (h - .1) * c,
                    (g + .2) * b, (h - e) * c, (g + .2) * b, h * c);
                U(a, (g + .2) * b, (h + e) * c, (g + d) * b, (h + .1) * c, g * b, (h + .1) * c);
                d = .05;
                e = Jd * d;
                T(a, .5 * b, .2 * c, !0);
                a.lineTo(.95 * b, .2 * c);
                g = .95;
                h = .25;
                U(a, (g + e) * b, (h - d) * c, (g + d) * b, (h - e) * c, (g + d) * b, h * c);
                a.lineTo(1 * b, .6 * c);
                a.lineTo(.85 * b, .6 * c);
                a.lineTo(.85 * b, .35 * c);
                d = .025;
                e = Jd * d;
                g = .825;
                h = .35;
                U(a, (g + d) * b, (h - e) * c, (g + e) * b, (h - d) * c, g * b, (h - d) * c);
                U(a, (g - e) * b, (h - d) * c, (g - d) * b, (h - e) * c, (g - d) * b, h * c);
                a.lineTo(.8 * b, 1 * c);
                a.lineTo(.55 * b, 1 * c);
                a.lineTo(.55 * b, .7 * c);
                d = .05;
                e = Jd * d;
                g = .5;
                h = .7;
                U(a, (g + d) * b, (h - e) * c, (g + e) * b, (h - d) * c,
                    g * b, (h - d) * c);
                U(a, (g - e) * b, (h - d) * c, (g - d) * b, (h - e) * c, (g - d) * b, h * c);
                a.lineTo(.45 * b, 1 * c);
                a.lineTo(.2 * b, 1 * c);
                a.lineTo(.2 * b, .35 * c);
                d = .025;
                e = Jd * d;
                g = .175;
                h = .35;
                U(a, (g + d) * b, (h - e) * c, (g + e) * b, (h - d) * c, g * b, (h - d) * c);
                U(a, (g - e) * b, (h - d) * c, (g - d) * b, (h - e) * c, (g - d) * b, h * c);
                a.lineTo(.15 * b, .6 * c);
                a.lineTo(0 * b, .6 * c);
                a.lineTo(0 * b, .25 * c);
                d = .05;
                e = Jd * d;
                g = .05;
                h = .25;
                U(a, (g - d) * b, (h - e) * c, (g - e) * b, (h - d) * c, g * b, (h - d) * c);
                a.lineTo(.5 * b, .2 * c);
                b = a.q;
                b.C = new S(.2, .2);
                b.D = new S(.8, .65);
                D.u(a);
                return b
            },
            Card: function(a, b, c) {
                a = D.v();
                T(a, 1 * b, 0 * c, !0);
                a.lineTo(1 * b, 1 * c);
                a.lineTo(0 * b, 1 * c);
                a.lineTo(0 * b, .2 * c);
                a.lineTo(.2 * b, 0 * c);
                X(a);
                b = a.q;
                b.C = new S(0, .2);
                b.D = vc;
                D.u(a);
                return b
            },
            Collate: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, .5 * c, !0);
                a.lineTo(0, 0);
                a.lineTo(1 * b, 0);
                a.lineTo(.5 * b, .5 * c);
                T(a, .5 * b, .5 * c, !0);
                a.lineTo(1 * b, 1 * c);
                a.lineTo(0, 1 * c);
                a.lineTo(.5 * b, .5 * c);
                b = a.q;
                b.C = new S(.25, 0);
                b.D = new S(.75, .25);
                D.u(a);
                return b
            },
            CreateRequest: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) && (a = .1);
                var d = D.v();
                T(d, 0, 0, !0);
                d.lineTo(1 * b, 0);
                d.lineTo(1 * b, 1 * c);
                d.lineTo(0, 1 * c);
                X(d);
                T(d, 0,
                    a * c, !1);
                d.lineTo(1 * b, a * c);
                d.moveTo(0, (1 - a) * c);
                d.lineTo(1 * b, (1 - a) * c);
                d.jb(!1);
                b = d.q;
                b.C = new S(0, a);
                b.D = new S(1, 1 - a);
                D.u(d);
                return b
            },
            Database: function(a, b, c) {
                a = D.v();
                var d = .5 * Jd,
                    e = .1 * Jd;
                T(a, 1 * b, .1 * c, !0);
                a.lineTo(1 * b, .9 * c);
                U(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
                a.lineTo(0, .1 * c);
                U(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
                U(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
                T(a, 1 * b, .1 * c, !1);
                U(a, 1 * b, (.1 + e) * c, (.5 + d) * b, .2 * c, .5 * b, .2 * c);
                U(a, (.5 - d) * b, .2 * c, 0, (.1 + e) * c, 0, .1 * c);
                a.moveTo(1 * b, .2 * c);
                U(a, 1 * b, (.2 + e) * c, (.5 + d) * b, .3 * c, .5 * b, .3 * c);
                U(a, (.5 - d) * b, .3 * c, 0, (.2 + e) * c, 0, .2 * c);
                a.moveTo(1 * b, .3 * c);
                U(a, 1 * b, (.3 + e) * c, (.5 + d) * b, .4 * c, .5 * b, .4 * c);
                U(a, (.5 - d) * b, .4 * c, 0, (.3 + e) * c, 0, .3 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(0, .4);
                b.D = new S(1, .9);
                D.u(a);
                return b
            },
            StoredData: "DataStorage",
            DataStorage: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !0);
                a.lineTo(.75 * b, 0);
                U(a, 1 * b, 0, 1 * b, 1 * c, .75 * b, 1 * c);
                a.lineTo(0, 1 * c);
                U(a, .25 * b, .9 * c, .25 * b, .1 * c, 0, 0);
                X(a);
                b = a.q;
                b.C = new S(.226, 0);
                b.D = new S(.81, 1);
                D.u(a);
                return b
            },
            DiskStorage: function(a, b, c) {
                a =
                    D.v();
                var d = .5 * Jd,
                    e = .1 * Jd;
                T(a, 1 * b, .1 * c, !0);
                a.lineTo(1 * b, .9 * c);
                U(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
                a.lineTo(0, .1 * c);
                U(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
                U(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
                T(a, 1 * b, .1 * c, !1);
                U(a, 1 * b, (.1 + e) * c, (.5 + d) * b, .2 * c, .5 * b, .2 * c);
                U(a, (.5 - d) * b, .2 * c, 0, (.1 + e) * c, 0, .1 * c);
                a.moveTo(1 * b, .2 * c);
                U(a, 1 * b, (.2 + e) * c, (.5 + d) * b, .3 * c, .5 * b, .3 * c);
                U(a, (.5 - d) * b, .3 * c, 0, (.2 + e) * c, 0, .2 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(0, .3);
                b.D = new S(1, .9);
                D.u(a);
                return b
            },
            Display: function(a,
                b, c) {
                a = D.v();
                T(a, .25 * b, 0, !0);
                a.lineTo(.75 * b, 0);
                U(a, 1 * b, 0, 1 * b, 1 * c, .75 * b, 1 * c);
                a.lineTo(.25 * b, 1 * c);
                a.lineTo(0, .5 * c);
                X(a);
                b = a.q;
                b.C = new S(.25, 0);
                b.D = new S(.75, 1);
                D.u(a);
                return b
            },
            DividedEvent: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) ? a = .2 : .15 > a && (a = .15);
                var d = D.v(),
                    e = .2 * Jd;
                T(d, 0, .2 * c, !0);
                U(d, 0, (.2 - e) * c, (.2 - e) * b, 0, .2 * b, 0);
                d.lineTo(.8 * b, 0);
                U(d, (.8 + e) * b, 0, 1 * b, (.2 - e) * c, 1 * b, .2 * c);
                d.lineTo(1 * b, .8 * c);
                U(d, 1 * b, (.8 + e) * c, (.8 + e) * b, 1 * c, .8 * b, 1 * c);
                d.lineTo(.2 * b, 1 * c);
                U(d, (.2 - e) * b, 1 * c, 0, (.8 + e) * c, 0, .8 * c);
                d.lineTo(0, .2 * c);
                T(d, 0, a * c, !1);
                d.lineTo(1 * b, a * c);
                d.jb(!1);
                b = d.q;
                b.C = new S(0, a);
                b.D = new S(1, 1 - a);
                D.u(d);
                return b
            },
            DividedProcess: function(a, b, c) {
                a = a ? a.Sc : NaN;
                if (isNaN(a) || .1 > a) a = .1;
                var d = D.v();
                T(d, 0, 0, !0);
                d.lineTo(1 * b, 0);
                d.lineTo(1 * b, 1 * c);
                d.lineTo(0, 1 * c);
                X(d);
                T(d, 0, a * c, !1);
                d.lineTo(1 * b, a * c);
                d.jb(!1);
                b = d.q;
                b.C = new S(0, a);
                b.D = vc;
                D.u(d);
                return b
            },
            Document: function(a, b, c) {
                c /= .8;
                a = D.v();
                T(a, 0, .7 * c, !0);
                a.lineTo(0, 0);
                a.lineTo(1 * b, 0);
                a.lineTo(1 * b, .7 * c);
                U(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c);
                X(a);
                b = a.q;
                b.C = ec;
                b.D = new S(1, .6);
                D.u(a);
                return b
            },
            ExternalOrganization: function(a, b, c) {
                a = a ? a.Sc : NaN;
                if (isNaN(a) || .2 > a) a = .2;
                var d = D.v();
                T(d, 0, 0, !0);
                d.lineTo(1 * b, 0);
                d.lineTo(1 * b, 1 * c);
                d.lineTo(0, 1 * c);
                X(d);
                T(d, a * b, 0, !1);
                d.lineTo(0, a * c);
                d.moveTo(1 * b, a * c);
                d.lineTo((1 - a) * b, 0);
                d.moveTo(0, (1 - a) * c);
                d.lineTo(a * b, 1 * c);
                d.moveTo((1 - a) * b, 1 * c);
                d.lineTo(1 * b, (1 - a) * c);
                d.jb(!1);
                b = d.q;
                b.C = new S(a / 2, a / 2);
                b.D = new S(1 - a / 2, 1 - a / 2);
                D.u(d);
                return b
            },
            ExternalProcess: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, 0, !0);
                a.lineTo(1 * b, .5 * c);
                a.lineTo(.5 * b, 1 * c);
                a.lineTo(0, .5 * c);
                X(a);
                T(a, .1 * b, .4 * c, !1);
                a.lineTo(.1 * b, .6 * c);
                a.moveTo(.9 * b, .6 * c);
                a.lineTo(.9 * b, .4 * c);
                a.moveTo(.6 * b, .1 * c);
                a.lineTo(.4 * b, .1 * c);
                a.moveTo(.4 * b, .9 * c);
                a.lineTo(.6 * b, .9 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(.25, .25);
                b.D = new S(.75, .75);
                D.u(a);
                return b
            },
            File: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !0);
                a.lineTo(.75 * b, 0);
                a.lineTo(1 * b, .25 * c);
                a.lineTo(1 * b, 1 * c);
                a.lineTo(0, 1 * c);
                X(a);
                T(a, .75 * b, 0, !1);
                a.lineTo(.75 * b, .25 * c);
                a.lineTo(1 * b, .25 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(0, .25);
                b.D = vc;
                D.u(a);
                return b
            },
            Interrupt: function(a, b, c) {
                a = D.v();
                T(a, 1 * b,
                    .5 * c, !0);
                a.lineTo(0, 1 * c);
                a.lineTo(0, 0);
                a.lineTo(1 * b, .5 * c);
                T(a, 1 * b, .5 * c, !1);
                a.lineTo(1 * b, 1 * c);
                T(a, 1 * b, .5 * c, !1);
                a.lineTo(1 * b, 0);
                b = a.q;
                b.C = new S(0, .25);
                b.D = new S(.5, .75);
                D.u(a);
                return b
            },
            InternalStorage: function(a, b, c) {
                var d = a ? a.Sc : NaN;
                a = a ? a.ev : NaN;
                isNaN(d) && (d = .1);
                isNaN(a) && (a = .1);
                var e = D.v();
                T(e, 0, 0, !0);
                e.lineTo(1 * b, 0);
                e.lineTo(1 * b, 1 * c);
                e.lineTo(0, 1 * c);
                X(e);
                T(e, d * b, 0, !1);
                e.lineTo(d * b, 1 * c);
                e.moveTo(0, a * c);
                e.lineTo(1 * b, a * c);
                e.jb(!1);
                b = e.q;
                b.C = new S(d, a);
                b.D = vc;
                D.u(e);
                return b
            },
            Junction: function(a, b,
                c) {
                a = D.v();
                var d = 1 / Math.SQRT2,
                    e = (1 - 1 / Math.SQRT2) / 2,
                    g = .5 * Jd;
                T(a, 1 * b, .5 * c, !0);
                U(a, 1 * b, (.5 + g) * c, (.5 + g) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - g) * b, 1 * c, 0, (.5 + g) * c, 0, .5 * c);
                U(a, 0, (.5 - g) * c, (.5 - g) * b, 0, .5 * b, 0);
                U(a, (.5 + g) * b, 0, 1 * b, (.5 - g) * c, 1 * b, .5 * c);
                T(a, (e + d) * b, (e + d) * c, !1);
                a.lineTo(e * b, e * c);
                a.moveTo(e * b, (e + d) * c);
                a.lineTo((e + d) * b, e * c);
                a.jb(!1);
                b = a.q;
                b.le = bk;
                D.u(a);
                return b
            },
            LinedDocument: function(a, b, c) {
                c /= .8;
                a = D.v();
                T(a, 0, .7 * c, !0);
                a.lineTo(0, 0);
                a.lineTo(1 * b, 0);
                a.lineTo(1 * b, .7 * c);
                U(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c);
                X(a);
                T(a, .1 *
                    b, 0, !1);
                a.lineTo(.1 * b, .75 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(.1, 0);
                b.D = new S(1, .6);
                D.u(a);
                return b
            },
            LoopLimit: function(a, b, c) {
                a = D.v();
                T(a, 0, 1 * c, !0);
                a.lineTo(0, .25 * c);
                a.lineTo(.25 * b, 0);
                a.lineTo(.75 * b, 0);
                a.lineTo(1 * b, .25 * c);
                a.lineTo(1 * b, 1 * c);
                X(a);
                b = a.q;
                b.C = new S(0, .25);
                b.D = vc;
                D.u(a);
                return b
            },
            SequentialData: "MagneticTape",
            MagneticTape: function(a, b, c) {
                a = D.v();
                var d = .5 * Jd;
                T(a, .5 * b, 1 * c, !0);
                U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
                U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
                U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
                U(a, 1 * b, (.5 +
                    d) * c, (.5 + d) * b, .9 * c, .6 * b, .9 * c);
                a.lineTo(1 * b, .9 * c);
                a.lineTo(1 * b, 1 * c);
                a.lineTo(.5 * b, 1 * c);
                b = a.q;
                b.C = new S(.15, .15);
                b.D = new S(.85, .8);
                D.u(a);
                return b
            },
            ManualInput: function(a, b, c) {
                a = D.v();
                T(a, 1 * b, 0, !0);
                a.lineTo(1 * b, 1 * c);
                a.lineTo(0, 1 * c);
                a.lineTo(0, .25 * c);
                X(a);
                b = a.q;
                b.C = new S(0, .25);
                b.D = vc;
                D.u(a);
                return b
            },
            MessageFromUser: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) && (a = .7);
                var d = D.v();
                T(d, 0, 0, !0);
                d.lineTo(1 * b, 0);
                d.lineTo(a * b, .5 * c);
                d.lineTo(1 * b, 1 * c);
                d.lineTo(0, 1 * c);
                X(d);
                b = d.q;
                b.C = ec;
                b.D = new S(a, 1);
                D.u(d);
                return b
            },
            MicroformProcessing: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) && (a = .25);
                var d = D.v();
                T(d, 0, 0, !0);
                d.lineTo(.5 * b, a * c);
                d.lineTo(1 * b, 0);
                d.lineTo(1 * b, 1 * c);
                d.lineTo(.5 * b, (1 - a) * c);
                d.lineTo(0, 1 * c);
                X(d);
                b = d.q;
                b.C = new S(0, a);
                b.D = new S(1, 1 - a);
                D.u(d);
                return b
            },
            MicroformRecording: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !0);
                a.lineTo(.75 * b, .25 * c);
                a.lineTo(1 * b, .15 * c);
                a.lineTo(1 * b, .85 * c);
                a.lineTo(.75 * b, .75 * c);
                a.lineTo(0, 1 * c);
                X(a);
                b = a.q;
                b.C = new S(0, .25);
                b.D = new S(1, .75);
                D.u(a);
                return b
            },
            MultiDocument: function(a, b, c) {
                c /= .8;
                a = D.v();
                T(a, b, 0, !0);
                a.lineTo(b, .5 * c);
                U(a, .96 * b, .47 * c, .93 * b, .45 * c, .9 * b, .44 * c);
                a.lineTo(.9 * b, .6 * c);
                U(a, .86 * b, .57 * c, .83 * b, .55 * c, .8 * b, .54 * c);
                a.lineTo(.8 * b, .7 * c);
                U(a, .4 * b, .4 * c, .4 * b, 1 * c, 0, .7 * c);
                a.lineTo(0, .2 * c);
                a.lineTo(.1 * b, .2 * c);
                a.lineTo(.1 * b, .1 * c);
                a.lineTo(.2 * b, .1 * c);
                a.lineTo(.2 * b, 0);
                X(a);
                T(a, .1 * b, .2 * c, !1);
                a.lineTo(.8 * b, .2 * c);
                a.lineTo(.8 * b, .54 * c);
                a.moveTo(.2 * b, .1 * c);
                a.lineTo(.9 * b, .1 * c);
                a.lineTo(.9 * b, .44 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(0, .25);
                b.D = new S(.8, .77);
                D.u(a);
                return b
            },
            MultiProcess: function(a, b, c) {
                a = D.v();
                T(a, .1 * b, .1 * c, !0);
                a.lineTo(.2 * b, .1 * c);
                a.lineTo(.2 * b, 0);
                a.lineTo(1 * b, 0);
                a.lineTo(1 * b, .8 * c);
                a.lineTo(.9 * b, .8 * c);
                a.lineTo(.9 * b, .9 * c);
                a.lineTo(.8 * b, .9 * c);
                a.lineTo(.8 * b, 1 * c);
                a.lineTo(0, 1 * c);
                a.lineTo(0, .2 * c);
                a.lineTo(.1 * b, .2 * c);
                X(a);
                T(a, .2 * b, .1 * c, !1);
                a.lineTo(.9 * b, .1 * c);
                a.lineTo(.9 * b, .8 * c);
                a.moveTo(.1 * b, .2 * c);
                a.lineTo(.8 * b, .2 * c);
                a.lineTo(.8 * b, .9 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(0, .2);
                b.D = new S(.8, 1);
                D.u(a);
                return b
            },
            OfflineStorage: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) && (a = .1);
                var d = 1 - a,
                    e = D.v();
                T(e, 0, 0, !0);
                e.lineTo(1 *
                    b, 0);
                e.lineTo(.5 * b, 1 * c);
                X(e);
                T(e, .5 * a * b, a * c, !1);
                e.lineTo((1 - .5 * a) * b, a * c);
                e.jb(!1);
                b = e.q;
                b.C = new S(d / 4 + .5 * a, a);
                b.D = new S(3 * d / 4 + .5 * a, a + .5 * d);
                D.u(e);
                return b
            },
            OffPageConnector: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !0);
                a.lineTo(.75 * b, 0);
                a.lineTo(1 * b, .5 * c);
                a.lineTo(.75 * b, 1 * c);
                a.lineTo(0, 1 * c);
                X(a);
                b = a.q;
                b.C = ec;
                b.D = new S(.75, 1);
                D.u(a);
                return b
            },
            Or: function(a, b, c) {
                a = D.v();
                var d = .5 * Jd;
                T(a, 1 * b, .5 * c, !0);
                U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
                U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
                U(a,
                    (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
                T(a, 1 * b, .5 * c, !1);
                a.lineTo(0, .5 * c);
                a.moveTo(.5 * b, 1 * c);
                a.lineTo(.5 * b, 0);
                a.jb(!1);
                b = a.q;
                b.le = bk;
                D.u(a);
                return b
            },
            PaperTape: function(a, b, c) {
                c /= .8;
                a = D.v();
                T(a, 0, .7 * c, !0);
                a.lineTo(0, .3 * c);
                U(a, .5 * b, .6 * c, .5 * b, 0, 1 * b, .3 * c);
                a.lineTo(1 * b, .7 * c);
                U(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c);
                X(a);
                b = a.q;
                b.C = new S(0, .49);
                b.D = new S(1, .75);
                D.u(a);
                return b
            },
            PrimitiveFromCall: function(a, b, c) {
                var d = a ? a.Sc : NaN;
                a = a ? a.ev : NaN;
                isNaN(d) && (d = .1);
                isNaN(a) && (a = .3);
                var e = D.v();
                T(e, 0, 0, !0);
                e.lineTo(1 * b, 0);
                e.lineTo((1 -
                    a) * b, .5 * c);
                e.lineTo(1 * b, 1 * c);
                e.lineTo(0, 1 * c);
                X(e);
                b = e.q;
                b.C = new S(d, 0);
                b.D = new S(1 - a, 1);
                D.u(e);
                return b
            },
            PrimitiveToCall: function(a, b, c) {
                var d = a ? a.Sc : NaN;
                a = a ? a.ev : NaN;
                isNaN(d) && (d = .1);
                isNaN(a) && (a = .3);
                var e = D.v();
                T(e, 0, 0, !0);
                e.lineTo((1 - a) * b, 0);
                e.lineTo(1 * b, .5 * c);
                e.lineTo((1 - a) * b, 1 * c);
                e.lineTo(0, 1 * c);
                X(e);
                b = e.q;
                b.C = new S(d, 0);
                b.D = new S(1 - a, 1);
                D.u(e);
                return b
            },
            Subroutine: "Procedure",
            Procedure: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) && (a = .1);
                var d = D.v();
                T(d, 0, 0, !0);
                d.lineTo(1 * b, 0);
                d.lineTo(1 * b, 1 * c);
                d.lineTo(0,
                    1 * c);
                X(d);
                T(d, (1 - a) * b, 0, !1);
                d.lineTo((1 - a) * b, 1 * c);
                d.moveTo(a * b, 0);
                d.lineTo(a * b, 1 * c);
                d.jb(!1);
                b = d.q;
                b.C = new S(a, 0);
                b.D = new S(1 - a, 1);
                D.u(d);
                return b
            },
            Process: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) && (a = .1);
                var d = D.v();
                T(d, 0, 0, !0);
                d.lineTo(1 * b, 0);
                d.lineTo(1 * b, 1 * c);
                d.lineTo(0, 1 * c);
                X(d);
                T(d, a * b, 0, !1);
                d.lineTo(a * b, 1 * c);
                d.jb(!1);
                b = d.q;
                b.C = new S(a, 0);
                b.D = vc;
                D.u(d);
                return b
            },
            Sort: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, 0, !0);
                a.lineTo(1 * b, .5 * c);
                a.lineTo(.5 * b, 1 * c);
                a.lineTo(0, .5 * c);
                X(a);
                T(a, 0, .5 * c, !1);
                a.lineTo(1 * b, .5 *
                    c);
                a.jb(!1);
                b = a.q;
                b.C = new S(.25, .25);
                b.D = new S(.75, .5);
                D.u(a);
                return b
            },
            Start: function(a, b, c) {
                a = D.v();
                T(a, .25 * b, 0, !0);
                T(a, .25 * b, 0, !0);
                a.arcTo(270, 180, .75 * b, .5 * c, .25 * b, .5 * c);
                a.arcTo(90, 180, .25 * b, .5 * c, .25 * b, .5 * c);
                T(a, .25 * b, 0, !1);
                a.lineTo(.25 * b, 1 * c);
                a.moveTo(.75 * b, 0);
                a.lineTo(.75 * b, 1 * c);
                a.jb(!1);
                b = a.q;
                b.C = new S(.25, 0);
                b.D = new S(.75, 1);
                D.u(a);
                return b
            },
            Terminator: function(a, b, c) {
                a = D.v();
                T(a, .25 * b, 0, !0);
                a.arcTo(270, 180, .75 * b, .5 * c, .25 * b, .5 * c);
                a.arcTo(90, 180, .25 * b, .5 * c, .25 * b, .5 * c);
                b = a.q;
                b.C = new S(.23, 0);
                b.D = new S(.77, 1);
                D.u(a);
                return b
            },
            TransmittalTape: function(a, b, c) {
                a = a ? a.Sc : NaN;
                isNaN(a) && (a = .1);
                var d = D.v();
                T(d, 0, 0, !0);
                d.lineTo(1 * b, 0);
                d.lineTo(1 * b, 1 * c);
                d.lineTo(.75 * b, (1 - a) * c);
                d.lineTo(0, (1 - a) * c);
                X(d);
                b = d.q;
                b.C = ec;
                b.D = new S(1, 1 - a);
                D.u(d);
                return b
            },
            AndGate: function(a, b, c) {
                a = D.v();
                var d = .5 * Jd;
                T(a, 0, 0, !0);
                a.lineTo(.5 * b, 0);
                U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
                U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                a.lineTo(0, 1 * c);
                X(a);
                b = a.q;
                b.C = ec;
                b.D = new S(.55, 1);
                D.u(a);
                return b
            },
            Buffer: function(a, b, c) {
                a = D.v();
                T(a,
                    0, 0, !0);
                a.lineTo(1 * b, .5 * c);
                a.lineTo(0, 1 * c);
                X(a);
                b = a.q;
                b.C = new S(0, .25);
                b.D = new S(.5, .75);
                D.u(a);
                return b
            },
            Clock: function(a, b, c) {
                a = D.v();
                var d = .5 * Jd;
                T(a, 1 * b, .5 * c, !0);
                U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
                U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
                U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
                T(a, 1 * b, .5 * c, !1);
                a.lineTo(1 * b, .5 * c);
                T(a, .8 * b, .75 * c, !1);
                a.lineTo(.8 * b, .25 * c);
                a.lineTo(.6 * b, .25 * c);
                a.lineTo(.6 * b, .75 * c);
                a.lineTo(.4 * b, .75 * c);
                a.lineTo(.4 * b, .25 * c);
                a.lineTo(.2 * b, .25 * c);
                a.lineTo(.2 *
                    b, .75 * c);
                a.jb(!1);
                b = a.q;
                b.le = bk;
                D.u(a);
                return b
            },
            Ground: function(a, b, c) {
                a = D.v();
                T(a, .5 * b, 0, !1);
                a.lineTo(.5 * b, .4 * c);
                a.moveTo(.2 * b, .6 * c);
                a.lineTo(.8 * b, .6 * c);
                a.moveTo(.3 * b, .8 * c);
                a.lineTo(.7 * b, .8 * c);
                a.moveTo(.4 * b, 1 * c);
                a.lineTo(.6 * b, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            Inverter: function(a, b, c) {
                a = D.v();
                var d = .1 * Jd;
                T(a, .8 * b, .5 * c, !0);
                a.lineTo(0, 1 * c);
                a.lineTo(0, 0);
                a.lineTo(.8 * b, .5 * c);
                T(a, 1 * b, .5 * c, !0);
                U(a, 1 * b, (.5 + d) * c, (.9 + d) * b, .6 * c, .9 * b, .6 * c);
                U(a, (.9 - d) * b, .6 * c, .8 * b, (.5 + d) * c, .8 * b, .5 * c);
                U(a, .8 * b, (.5 - d) * c, (.9 - d) * b, .4 *
                    c, .9 * b, .4 * c);
                U(a, (.9 + d) * b, .4 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
                b = a.q;
                b.C = new S(0, .25);
                b.D = new S(.4, .75);
                D.u(a);
                return b
            },
            NandGate: function(a, b, c) {
                a = D.v();
                var d = .5 * Jd,
                    e = .4 * Jd,
                    g = .1 * Jd;
                T(a, .8 * b, .5 * c, !0);
                U(a, .8 * b, (.5 + e) * c, (.4 + d) * b, 1 * c, .4 * b, 1 * c);
                a.lineTo(0, 1 * c);
                a.lineTo(0, 0);
                a.lineTo(.4 * b, 0);
                U(a, (.4 + d) * b, 0, .8 * b, (.5 - e) * c, .8 * b, .5 * c);
                T(a, 1 * b, .5 * c, !0);
                U(a, 1 * b, (.5 + g) * c, (.9 + g) * b, .6 * c, .9 * b, .6 * c);
                U(a, (.9 - g) * b, .6 * c, .8 * b, (.5 + g) * c, .8 * b, .5 * c);
                U(a, .8 * b, (.5 - g) * c, (.9 - g) * b, .4 * c, .9 * b, .4 * c);
                U(a, (.9 + g) * b, .4 * c, 1 * b, (.5 - g) * c, 1 * b, .5 *
                    c);
                b = a.q;
                b.C = new S(0, .05);
                b.D = new S(.55, .95);
                D.u(a);
                return b
            },
            NorGate: function(a, b, c) {
                a = D.v();
                var d = .5,
                    e = Jd * d,
                    g = 0,
                    h = .5;
                T(a, .8 * b, .5 * c, !0);
                U(a, .7 * b, (h + e) * c, (g + e) * b, (h + d) * c, 0, 1 * c);
                U(a, .25 * b, .75 * c, .25 * b, .25 * c, 0, 0);
                U(a, (g + e) * b, (h - d) * c, .7 * b, (h - e) * c, .8 * b, .5 * c);
                d = .1;
                e = .1 * Jd;
                g = .9;
                h = .5;
                T(a, (g - d) * b, h * c, !0);
                U(a, (g - d) * b, (h - e) * c, (g - e) * b, (h - d) * c, g * b, (h - d) * c);
                U(a, (g + e) * b, (h - d) * c, (g + d) * b, (h - e) * c, (g + d) * b, h * c);
                U(a, (g + d) * b, (h + e) * c, (g + e) * b, (h + d) * c, g * b, (h + d) * c);
                U(a, (g - e) * b, (h + d) * c, (g - d) * b, (h + e) * c, (g - d) * b, h * c);
                b = a.q;
                b.C =
                    new S(.2, .25);
                b.D = new S(.6, .75);
                D.u(a);
                return b
            },
            OrGate: function(a, b, c) {
                a = D.v();
                var d = .5 * Jd;
                T(a, 0, 0, !0);
                U(a, (0 + d + d) * b, 0 * c, .8 * b, (.5 - d) * c, 1 * b, .5 * c);
                U(a, .8 * b, (.5 + d) * c, (0 + d + d) * b, 1 * c, 0, 1 * c);
                U(a, .25 * b, .75 * c, .25 * b, .25 * c, 0, 0);
                X(a);
                b = a.q;
                b.C = new S(.2, .25);
                b.D = new S(.75, .75);
                D.u(a);
                return b
            },
            XnorGate: function(a, b, c) {
                a = D.v();
                var d = .5,
                    e = Jd * d,
                    g = .2,
                    h = .5;
                T(a, .1 * b, 0, !1);
                U(a, .35 * b, .25 * c, .35 * b, .75 * c, .1 * b, 1 * c);
                T(a, .8 * b, .5 * c, !0);
                U(a, .7 * b, (h + e) * c, (g + e) * b, (h + d) * c, .2 * b, 1 * c);
                U(a, .45 * b, .75 * c, .45 * b, .25 * c, .2 * b, 0);
                U(a, (g + e) *
                    b, (h - d) * c, .7 * b, (h - e) * c, .8 * b, .5 * c);
                d = .1;
                e = .1 * Jd;
                g = .9;
                h = .5;
                T(a, (g - d) * b, h * c, !0);
                U(a, (g - d) * b, (h - e) * c, (g - e) * b, (h - d) * c, g * b, (h - d) * c);
                U(a, (g + e) * b, (h - d) * c, (g + d) * b, (h - e) * c, (g + d) * b, h * c);
                U(a, (g + d) * b, (h + e) * c, (g + e) * b, (h + d) * c, g * b, (h + d) * c);
                U(a, (g - e) * b, (h + d) * c, (g - d) * b, (h + e) * c, (g - d) * b, h * c);
                b = a.q;
                b.C = new S(.4, .25);
                b.D = new S(.65, .75);
                D.u(a);
                return b
            },
            XorGate: function(a, b, c) {
                a = D.v();
                var d = .5 * Jd;
                T(a, .1 * b, 0, !1);
                U(a, .35 * b, .25 * c, .35 * b, .75 * c, .1 * b, 1 * c);
                T(a, .2 * b, 0, !0);
                U(a, (.2 + d) * b, 0 * c, .9 * b, (.5 - d) * c, 1 * b, .5 * c);
                U(a, .9 * b, (.5 + d) *
                    c, (.2 + d) * b, 1 * c, .2 * b, 1 * c);
                U(a, .45 * b, .75 * c, .45 * b, .25 * c, .2 * b, 0);
                X(a);
                b = a.q;
                b.C = new S(.4, .25);
                b.D = new S(.8, .75);
                D.u(a);
                return b
            },
            Capacitor: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                a.lineTo(0, 1 * c);
                a.moveTo(1 * b, 0);
                a.lineTo(1 * b, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            Resistor: function(a, b, c) {
                a = D.v();
                T(a, 0, .5 * c, !1);
                a.lineTo(.1 * b, 0);
                a.lineTo(.2 * b, 1 * c);
                a.lineTo(.3 * b, 0);
                a.lineTo(.4 * b, 1 * c);
                a.lineTo(.5 * b, 0);
                a.lineTo(.6 * b, 1 * c);
                a.lineTo(.7 * b, .5 * c);
                b = a.q;
                D.u(a);
                return b
            },
            Inductor: function(a, b, c) {
                a = D.v();
                var d = .1 * Jd,
                    e = .1;
                T(a, (e - .5 *
                    d) * b, c, !1);
                U(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
                e = .3;
                U(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c);
                U(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
                e = .5;
                U(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c);
                U(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
                e = .7;
                U(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c);
                U(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
                e = .9;
                U(a, (e + .1) * b, 0, (e + d) * b, c, (e + .5 * d) * b, c);
                b = a.q;
                D.u(a);
                return b
            },
            ACvoltageSource: function(a, b, c) {
                a = D.v();
                var d = .5 * Jd;
                T(a, 0 * b, .5 * c, !1);
                U(a, 0 * b, (.5 - d) * c, (.5 - d) * b, 0 * c, .5 * b, 0 * c);
                U(a, (.5 + d) * b, 0 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
                U(a, 1 * b, (.5 + d) *
                    c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0 * b, (.5 + d) * c, 0 * b, .5 * c);
                a.moveTo(.1 * b, .5 * c);
                U(a, .5 * b, 0 * c, .5 * b, 1 * c, .9 * b, .5 * c);
                b = a.q;
                b.le = bk;
                D.u(a);
                return b
            },
            DCvoltageSource: function(a, b, c) {
                a = D.v();
                T(a, 0, .75 * c, !1);
                a.lineTo(0, .25 * c);
                a.moveTo(1 * b, 0);
                a.lineTo(1 * b, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            Diode: function(a, b, c) {
                a = D.v();
                T(a, 1 * b, 0, !1);
                a.lineTo(1 * b, .5 * c);
                a.lineTo(0, 1 * c);
                a.lineTo(0, 0);
                a.lineTo(1 * b, .5 * c);
                a.lineTo(1 * b, 1 * c);
                b = a.q;
                b.C = new S(0, .25);
                b.D = new S(.5, .75);
                D.u(a);
                return b
            },
            Wifi: function(a, b, c) {
                var d = b,
                    e = c;
                b *= .38;
                c *= .6;
                a = D.v();
                var g = .8 * Jd,
                    h = .8,
                    k = 0,
                    l = .5,
                    d = (d - b) / 2,
                    e = (e - c) / 2;
                T(a, k * b + d, (l + h) * c + e, !0);
                U(a, (k - g) * b + d, (l + h) * c + e, (k - h) * b + d, (l + g) * c + e, (k - h) * b + d, l * c + e);
                U(a, (k - h) * b + d, (l - g) * c + e, (k - g) * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
                U(a, k * b + d, (l - h) * c + e, (k - h + .5 * g) * b + d, (l - g) * c + e, (k - h + .5 * g) * b + d, l * c + e);
                U(a, (k - h + .5 * g) * b + d, (l + g) * c + e, k * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
                X(a);
                g = .4 * Jd;
                h = .4;
                k = .2;
                l = .5;
                T(a, k * b + d, (l + h) * c + e, !0);
                U(a, (k - g) * b + d, (l + h) * c + e, (k - h) * b + d, (l + g) * c + e, (k - h) * b + d, l * c + e);
                U(a, (k - h) * b + d, (l - g) * c + e, (k - g) * b + d, (l - h) * c + e, k *
                    b + d, (l - h) * c + e);
                U(a, k * b + d, (l - h) * c + e, (k - h + .5 * g) * b + d, (l - g) * c + e, (k - h + .5 * g) * b + d, l * c + e);
                U(a, (k - h + .5 * g) * b + d, (l + g) * c + e, k * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
                X(a);
                g = .2 * Jd;
                h = .2;
                l = k = .5;
                T(a, (k - h) * b + d, l * c + e, !0);
                U(a, (k - h) * b + d, (l - g) * c + e, (k - g) * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
                U(a, (k + g) * b + d, (l - h) * c + e, (k + h) * b + d, (l - g) * c + e, (k + h) * b + d, l * c + e);
                U(a, (k + h) * b + d, (l + g) * c + e, (k + g) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
                U(a, (k - g) * b + d, (l + h) * c + e, (k - h) * b + d, (l + g) * c + e, (k - h) * b + d, l * c + e);
                g = .4 * Jd;
                h = .4;
                k = .8;
                l = .5;
                T(a, k * b + d, (l - h) * c + e, !0);
                U(a, (k + g) * b + d, (l -
                    h) * c + e, (k + h) * b + d, (l - g) * c + e, (k + h) * b + d, l * c + e);
                U(a, (k + h) * b + d, (l + g) * c + e, (k + g) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
                U(a, k * b + d, (l + h) * c + e, (k + h - .5 * g) * b + d, (l + g) * c + e, (k + h - .5 * g) * b + d, l * c + e);
                U(a, (k + h - .5 * g) * b + d, (l - g) * c + e, k * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
                X(a);
                g = .8 * Jd;
                h = .8;
                k = 1;
                l = .5;
                T(a, k * b + d, (l - h) * c + e, !0);
                U(a, (k + g) * b + d, (l - h) * c + e, (k + h) * b + d, (l - g) * c + e, (k + h) * b + d, l * c + e);
                U(a, (k + h) * b + d, (l + g) * c + e, (k + g) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
                U(a, k * b + d, (l + h) * c + e, (k + h - .5 * g) * b + d, (l + g) * c + e, (k + h - .5 * g) * b + d, l * c + e);
                U(a, (k + h - .5 * g) * b + d, (l - g) * c +
                    e, k * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            Email: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !0);
                a.lineTo(1 * b, 0);
                a.lineTo(1 * b, 1 * c);
                a.lineTo(0, 1 * c);
                a.lineTo(0, 0);
                X(a);
                T(a, 0, 0, !1);
                a.lineTo(.5 * b, .6 * c);
                a.lineTo(1 * b, 0);
                a.moveTo(0, 1 * c);
                a.lineTo(.45 * b, .54 * c);
                a.moveTo(1 * b, 1 * c);
                a.lineTo(.55 * b, .54 * c);
                a.jb(!1);
                b = a.q;
                D.u(a);
                return b
            },
            Ethernet: function(a, b, c) {
                a = D.v();
                T(a, .35 * b, 0, !0);
                a.lineTo(.65 * b, 0);
                a.lineTo(.65 * b, .4 * c);
                a.lineTo(.35 * b, .4 * c);
                a.lineTo(.35 * b, 0);
                X(a);
                T(a, .1 * b, 1 * c, !0, !0);
                a.lineTo(.4 * b, 1 * c);
                a.lineTo(.4 * b, .6 * c);
                a.lineTo(.1 * b, .6 * c);
                a.lineTo(.1 * b, 1 * c);
                X(a);
                T(a, .6 * b, 1 * c, !0, !0);
                a.lineTo(.9 * b, 1 * c);
                a.lineTo(.9 * b, .6 * c);
                a.lineTo(.6 * b, .6 * c);
                a.lineTo(.6 * b, 1 * c);
                X(a);
                T(a, 0, .5 * c, !1);
                a.lineTo(1 * b, .5 * c);
                a.moveTo(.5 * b, .5 * c);
                a.lineTo(.5 * b, .4 * c);
                a.moveTo(.75 * b, .5 * c);
                a.lineTo(.75 * b, .6 * c);
                a.moveTo(.25 * b, .5 * c);
                a.lineTo(.25 * b, .6 * c);
                a.jb(!1);
                b = a.q;
                D.u(a);
                return b
            },
            Power: function(a, b, c) {
                a = D.v();
                var d = .4 * Jd,
                    e = .4,
                    g = D.P(),
                    h = D.P(),
                    k = D.P(),
                    l = D.P();
                Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .5, g, g, h, k, l);
                var m = D.Fb(h.x,
                    h.y);
                T(a, h.x * b, h.y * c, !0);
                U(a, k.x * b, k.y * c, l.x * b, l.y * c, (.5 + e) * b, .5 * c);
                U(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
                U(a, (.5 - d) * b, (.5 + e) * c, (.5 - e) * b, (.5 + d) * c, (.5 - e) * b, .5 * c);
                Ce(.5 - e, .5, .5 - e, .5 - d, .5 - d, .5 - e, .5, .5 - e, .5, k, l, h, g, g);
                U(a, k.x * b, k.y * c, l.x * b, l.y * c, h.x * b, h.y * c);
                d = .3 * Jd;
                e = .3;
                Ce(.5 - e, .5, .5 - e, .5 - d, .5 - d, .5 - e, .5, .5 - e, .5, k, l, h, g, g);
                a.lineTo(h.x * b, h.y * c);
                U(a, l.x * b, l.y * c, k.x * b, k.y * c, (.5 - e) * b, .5 * c);
                U(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
                U(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 +
                    e) * b, .5 * c);
                Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .5, g, g, h, k, l);
                U(a, l.x * b, l.y * c, k.x * b, k.y * c, h.x * b, h.y * c);
                X(a);
                T(a, .45 * b, 0, !0);
                a.lineTo(.45 * b, .5 * c);
                a.lineTo(.55 * b, .5 * c);
                a.lineTo(.55 * b, 0);
                X(a);
                D.A(g);
                D.A(h);
                D.A(k);
                D.A(l);
                D.A(m);
                b = a.q;
                b.C = new S(.25, .55);
                b.D = new S(.75, .8);
                D.u(a);
                return b
            },
            Fallout: function(a, b, c) {
                a = D.v();
                var d = .5 * Jd;
                T(a, 0 * b, .5 * c, !0);
                U(a, 0 * b, (.5 - d) * c, (.5 - d) * b, 0 * c, .5 * b, 0 * c);
                U(a, (.5 + d) * b, 0 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
                U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0 * b, (.5 + d) * c, 0 * b,
                    .5 * c);
                var e = d = 0;
                T(a, (.3 + d) * b, (.8 + e) * c, !0, !0);
                a.lineTo((.5 + d) * b, (.5 + e) * c);
                a.lineTo((.1 + d) * b, (.5 + e) * c);
                a.lineTo((.3 + d) * b, (.8 + e) * c);
                d = .4;
                e = 0;
                X(a);
                T(a, (.3 + d) * b, (.8 + e) * c, !0, !0);
                a.lineTo((.5 + d) * b, (.5 + e) * c);
                a.lineTo((.1 + d) * b, (.5 + e) * c);
                a.lineTo((.3 + d) * b, (.8 + e) * c);
                d = .2;
                e = -.3;
                X(a);
                T(a, (.3 + d) * b, (.8 + e) * c, !0, !0);
                a.lineTo((.5 + d) * b, (.5 + e) * c);
                a.lineTo((.1 + d) * b, (.5 + e) * c);
                a.lineTo((.3 + d) * b, (.8 + e) * c);
                X(a);
                b = a.q;
                b.le = bk;
                D.u(a);
                return b
            },
            IrritationHazard: function(a, b, c) {
                a = D.v();
                T(a, .2 * b, 0 * c, !0);
                a.lineTo(.5 * b, .3 * c);
                a.lineTo(.8 *
                    b, 0 * c);
                a.lineTo(1 * b, .2 * c);
                a.lineTo(.7 * b, .5 * c);
                a.lineTo(1 * b, .8 * c);
                a.lineTo(.8 * b, 1 * c);
                a.lineTo(.5 * b, .7 * c);
                a.lineTo(.2 * b, 1 * c);
                a.lineTo(0 * b, .8 * c);
                a.lineTo(.3 * b, .5 * c);
                a.lineTo(0 * b, .2 * c);
                X(a);
                b = a.q;
                b.C = new S(.3, .3);
                b.D = new S(.7, .7);
                D.u(a);
                return b
            },
            ElectricalHazard: function(a, b, c) {
                a = D.v();
                T(a, .37 * b, 0 * c, !0);
                a.lineTo(.5 * b, .11 * c);
                a.lineTo(.77 * b, .04 * c);
                a.lineTo(.33 * b, .49 * c);
                a.lineTo(1 * b, .37 * c);
                a.lineTo(.63 * b, .86 * c);
                a.lineTo(.77 * b, .91 * c);
                a.lineTo(.34 * b, 1 * c);
                a.lineTo(.34 * b, .78 * c);
                a.lineTo(.44 * b, .8 * c);
                a.lineTo(.65 *
                    b, .56 * c);
                a.lineTo(0 * b, .68 * c);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            FireHazard: function(a, b, c) {
                a = D.v();
                T(a, .1 * b, 1 * c, !0);
                U(a, -.25 * b, .63 * c, .45 * b, .44 * c, .29 * b, 0 * c);
                U(a, .48 * b, .17 * c, .54 * b, .35 * c, .51 * b, .42 * c);
                U(a, .59 * b, .29 * c, .58 * b, .28 * c, .59 * b, .18 * c);
                U(a, .8 * b, .34 * c, .88 * b, .43 * c, .75 * b, .6 * c);
                U(a, .87 * b, .48 * c, .88 * b, .43 * c, .88 * b, .31 * c);
                U(a, 1.17 * b, .76 * c, .82 * b, .8 * c, .9 * b, 1 * c);
                X(a);
                b = a.q;
                b.C = new S(.05, .645);
                b.D = new S(.884, .908);
                D.u(a);
                return b
            },
            BpmnActivityLoop: function(a, b, c) {
                a = D.v();
                var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
                T(a, .65 * b, 1 * c, !1);
                U(a, (1 - d + 0) * b, 1 * c, 1 * b, (.5 + d + 0) * c, 1 * b, .5 * c);
                U(a, 1 * b, (.5 - d + 0) * c, (.5 + d + 0) * b, 0 * c, .5 * b, 0 * c);
                U(a, (.5 - d + 0) * b, 0 * c, 0 * b, (.5 - d + 0) * c, 0 * b, .5 * c);
                U(a, 0 * b, (.5 + d + 0) * c, (.5 - d + 0) * b, 1 * c, .35 * b, .98 * c);
                a.moveTo(.25 * b, .8 * c);
                a.lineTo(.35 * b, 1 * c);
                a.lineTo(.1 * b, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            BpmnActivityParallel: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                a.lineTo(0, 1 * c);
                a.moveTo(.5 * b, 0);
                a.lineTo(.5 * b, 1 * c);
                a.moveTo(1 * b, 0);
                a.lineTo(1 * b, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            BpmnActivitySequential: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                a.lineTo(1 *
                    b, 0);
                a.moveTo(0, .5 * c);
                a.lineTo(1 * b, .5 * c);
                a.moveTo(0, 1 * c);
                a.lineTo(1 * b, 1 * c);
                b = a.q;
                D.u(a);
                return b
            },
            BpmnActivityAdHoc: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                T(a, 1 * b, 1 * c, !1);
                T(a, 0, .5 * c, !1);
                U(a, .2 * b, .35 * c, .3 * b, .35 * c, .5 * b, .5 * c);
                U(a, .7 * b, .65 * c, .8 * b, .65 * c, 1 * b, .5 * c);
                b = a.q;
                D.u(a);
                return b
            },
            BpmnActivityCompensation: function(a, b, c) {
                a = D.v();
                T(a, 0, .5 * c, !0);
                a.lineTo(.5 * b, 0);
                a.lineTo(.5 * b, .5 * c);
                a.lineTo(1 * b, 1 * c);
                a.lineTo(1 * b, 0);
                a.lineTo(.5 * b, .5 * c);
                a.lineTo(.5 * b, 1 * c);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            BpmnTaskMessage: function(a,
                b, c) {
                a = D.v();
                T(a, 0, .2 * c, !0);
                a.lineTo(1 * b, .2 * c);
                a.lineTo(1 * b, .8 * c);
                a.lineTo(0, .8 * c);
                a.lineTo(0, .8 * c);
                X(a);
                T(a, 0, .2 * c, !1);
                a.lineTo(.5 * b, .5 * c);
                a.lineTo(1 * b, .2 * c);
                a.jb(!1);
                b = a.q;
                D.u(a);
                return b
            },
            BpmnTaskScript: function(a, b, c) {
                a = D.v();
                T(a, .7 * b, 1 * c, !0);
                a.lineTo(.3 * b, 1 * c);
                U(a, .6 * b, .5 * c, 0, .5 * c, .3 * b, 0);
                a.lineTo(.7 * b, 0);
                U(a, .4 * b, .5 * c, 1 * b, .5 * c, .7 * b, 1 * c);
                X(a);
                T(a, .45 * b, .73 * c, !1);
                a.lineTo(.7 * b, .73 * c);
                a.moveTo(.38 * b, .5 * c);
                a.lineTo(.63 * b, .5 * c);
                a.moveTo(.31 * b, .27 * c);
                a.lineTo(.56 * b, .27 * c);
                a.jb(!1);
                b = a.q;
                D.u(a);
                return b
            },
            BpmnTaskUser: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                T(a, .335 * b, (1 - .555) * c, !0);
                a.lineTo(.335 * b, .595 * c);
                a.lineTo(.665 * b, .595 * c);
                a.lineTo(.665 * b, (1 - .555) * c);
                U(a, .88 * b, .46 * c, .98 * b, .54 * c, 1 * b, .68 * c);
                a.lineTo(1 * b, 1 * c);
                a.lineTo(0, 1 * c);
                a.lineTo(0, .68 * c);
                U(a, .02 * b, .54 * c, .12 * b, .46 * c, .335 * b, (1 - .555) * c);
                a.lineTo(.365 * b, .405 * c);
                var d = .5 - .285,
                    e = Math.PI / 4,
                    g = 4 * (1 - Math.cos(e)) / (3 * Math.sin(e)),
                    e = g * d,
                    g = g * d;
                U(a, (.5 - (e + d) / 2) * b, (d + (d + g) / 2) * c, (.5 - d) * b, (d + g) * c, (.5 - d) * b, d * c);
                U(a, (.5 - d) * b, (d - g) * c, (.5 - e) * b, (d - d) * c, .5 * b, (d - d) * c);
                U(a, (.5 + e) * b, (d - d) * c, (.5 + d) * b, (d - g) * c, (.5 + d) * b, d * c);
                U(a, (.5 + d) * b, (d + g) * c, (.5 + (e + d) / 2) * b, (d + (d + g) / 2) * c, .635 * b, .405 * c);
                a.lineTo(.635 * b, .405 * c);
                a.lineTo(.665 * b, (1 - .555) * c);
                a.lineTo(.665 * b, .595 * c);
                a.lineTo(.335 * b, .595 * c);
                T(a, .2 * b, 1 * c, !1);
                a.lineTo(.2 * b, .8 * c);
                T(a, .8 * b, 1 * c, !1);
                a.lineTo(.8 * b, .8 * c);
                b = a.q;
                D.u(a);
                return b
            },
            BpmnEventConditional: function(a, b, c) {
                a = D.v();
                T(a, .1 * b, 0, !0);
                a.lineTo(.9 * b, 0);
                a.lineTo(.9 * b, 1 * c);
                a.lineTo(.1 * b, 1 * c);
                X(a);
                T(a, .2 * b, .2 * c, !1);
                a.lineTo(.8 * b, .2 * c);
                a.moveTo(.2 * b, .4 * c);
                a.lineTo(.8 *
                    b, .4 * c);
                a.moveTo(.2 * b, .6 * c);
                a.lineTo(.8 * b, .6 * c);
                a.moveTo(.2 * b, .8 * c);
                a.lineTo(.8 * b, .8 * c);
                a.jb(!1);
                b = a.q;
                D.u(a);
                return b
            },
            BpmnEventError: function(a, b, c) {
                a = D.v();
                T(a, 0, 1 * c, !0);
                a.lineTo(.33 * b, 0);
                a.lineTo(.66 * b, .5 * c);
                a.lineTo(1 * b, 0);
                a.lineTo(.66 * b, 1 * c);
                a.lineTo(.33 * b, .5 * c);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            BpmnEventEscalation: function(a, b, c) {
                a = D.v();
                T(a, 0, 0, !1);
                T(a, 1 * b, 1 * c, !1);
                T(a, .1 * b, 1 * c, !0);
                a.lineTo(.5 * b, 0);
                a.lineTo(.9 * b, 1 * c);
                a.lineTo(.5 * b, .5 * c);
                X(a);
                b = a.q;
                D.u(a);
                return b
            },
            BpmnEventTimer: function(a, b, c) {
                a =
                    D.v();
                var d = .5 * Jd;
                T(a, 1 * b, .5 * c, !0);
                U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
                U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
                U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
                U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
                T(a, .5 * b, 0, !1);
                a.lineTo(.5 * b, .15 * c);
                a.moveTo(.5 * b, 1 * c);
                a.lineTo(.5 * b, .85 * c);
                a.moveTo(0, .5 * c);
                a.lineTo(.15 * b, .5 * c);
                a.moveTo(1 * b, .5 * c);
                a.lineTo(.85 * b, .5 * c);
                a.moveTo(.5 * b, .5 * c);
                a.lineTo(.58 * b, .1 * c);
                a.moveTo(.5 * b, .5 * c);
                a.lineTo(.78 * b, .54 * c);
                a.jb(!1);
                b = a.q;
                b.le = bk;
                D.u(a);
                return b
            }
        },
        er;
    for (er in qq) qq[er.toLowerCase()] = er;
    var xq = {
        "": "",
        Standard: "F1 m 0,0 l 8,4 -8,4 2,-4 z",
        Backward: "F1 m 8,0 l -2,4 2,4 -8,-4 z",
        Triangle: "F1 m 0,0 l 8,4.62 -8,4.62 z",
        BackwardTriangle: "F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",
        Boomerang: "F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",
        BackwardBoomerang: "F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",
        SidewaysV: "m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",
        BackwardV: "m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",
        OpenTriangle: "m 0,0 l 8,4 -8,4",
        BackwardOpenTriangle: "m 8,0 l -8,4 8,4",
        OpenTriangleLine: "m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",
        BackwardOpenTriangleLine: "m 8,0 l  -8,4 8,4 m -8.5,0 l 0,-8",
        OpenTriangleTop: "m 0,0 l 8,4 m 0,4",
        BackwardOpenTriangleTop: "m 8,0 l -8,4 m 0,4",
        OpenTriangleBottom: "m 0,8 l 8,-4",
        BackwardOpenTriangleBottom: "m 0,4 l 8,4",
        HalfTriangleTop: "F1 m 0,0 l 0,4 8,0 z m 0,8",
        BackwardHalfTriangleTop: "F1 m 8,0 l 0,4 -8,0 z m 0,8",
        HalfTriangleBottom: "F1 m 0,4 l 0,4 8,-4 z",
        BackwardHalfTriangleBottom: "F1 m 8,4 l 0,4 -8,-4 z",
        ForwardSemiCircle: "m 4,0 b 270 180 0 4 4",
        BackwardSemiCircle: "m 4,8 b 90 180 0 -4 4",
        Feather: "m 0,0 l 3,4 -3,4",
        BackwardFeather: "m 3,0 l -3,4 3,4",
        DoubleFeathers: "m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",
        BackwardDoubleFeathers: "m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",
        TripleFeathers: "m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",
        BackwardTripleFeathers: "m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",
        ForwardSlash: "m 0,8 l 5,-8",
        BackSlash: "m 0,0 l 5,8",
        DoubleForwardSlash: "m 0,8 l 4,-8 m -2,8 l 4,-8",
        DoubleBackSlash: "m 0,0 l 4,8 m -2,-8 l 4,8",
        TripleForwardSlash: "m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",
        TripleBackSlash: "m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",
        Fork: "m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",
        BackwardFork: "m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",
        LineFork: "m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",
        BackwardLineFork: "m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",
        CircleFork: "F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
        BackwardCircleFork: "F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",
        CircleLineFork: "F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
        BackwardCircleLineFork: "F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",
        Circle: "F1 m 8,4 b 0 360 -4 0 4 z",
        Block: "F1 m 0,0 l 0,8 8,0 0,-8 z",
        StretchedDiamond: "F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",
        Diamond: "F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",
        Chevron: "F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",
        StretchedChevron: "F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",
        NormalArrow: "F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",
        X: "m 0,0 l 8,8 m 0,-8 l -8,8",
        TailedNormalArrow: "F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",
        DoubleTriangle: "F1 m 0,0 l 4,4 -4,4 0,-8 z  m 4,0 l 4,4 -4,4 0,-8 z",
        BigEndArrow: "F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",
        ConcaveTailArrow: "F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",
        RoundedTriangle: "F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",
        SimpleArrow: "F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",
        AccelerationArrow: "F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",
        BoxArrow: "F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",
        TriangleLine: "F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",
        CircleEndedArrow: "F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",
        DynamicWidthArrow: "F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",
        EquilibriumArrow: "m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",
        FastForward: "F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",
        Kite: "F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",
        HalfArrowTop: "F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",
        HalfArrowBottom: "F1 m 0,8 l 4,-4 4,0 -8,4 z",
        OpposingDirectionDoubleArrow: "F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",
        PartialDoubleTriangle: "F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",
        LineCircle: "F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",
        DoubleLineCircle: "F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",
        TripleLineCircle: "F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",
        CircleLine: "F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",
        DiamondCircle: "F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",
        PlusCircle: "F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",
        OpenRightTriangleTop: "m 8,0 l 0,4 -8,0 m 0,4",
        OpenRightTriangleBottom: "m 8,8 l 0,-4 -8,0",
        Line: "m 0,0 l 0,8",
        DoubleLine: "m 0,0 l 0,8 m 2,0 l 0,-8",
        TripleLine: "m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",
        PentagonArrow: "F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"
    };

    function uq(a) {
        var b = ne[a];
        if (void 0 === b) {
            var c = a.toLowerCase();
            if ("none" === c) return "None";
            b = ne[c];
            if (void 0 === b) {
                var d = null,
                    e;
                for (e in xq)
                    if (e.toLowerCase() === c) { d = e; break }
                if (null !== d) return a = yf(xq[d], !1), ne[d] = a, c !== d && (ne[c] = d), d
            }
        }
        return "string" === typeof b ? b : b instanceof Ve ? a : null
    }

    function F(a) {
        x.call(this, a);
        this.T = 2408959;
        this.Nl = this.Pi = "";
        this.rt = this.ot = this.At = this.zs = null;
        this.Ct = "";
        this.lh = this.ls = this.Bt = this.tn = null;
        this.qt = "";
        this.Fp = null;
        this.pt = ie;
        this.st = "";
        this.Gp = null;
        this.Yd = "";
        this.xw = this.xr = this.Al = null;
        this.jj = (new N(NaN, NaN)).freeze();
        this.Es = "";
        this.Ql = null;
        this.Fs = ec;
        this.Ns = Vd;
        this.Gs = Wd;
        this.Tr = null;
        this.As = fr;
        this.vn = Ud;
        this.un = "gray";
        this.Pg = 4;
        this.QD = -1;
        this.Zt = NaN;
        this.EH = new C;
        this.Sl = null;
        this.zk = NaN
    }
    D.Ta(F, x);
    D.ka("Part", F);
    F.prototype.cloneProtected = function(a) {
        x.prototype.cloneProtected.call(this, a);
        a.T = this.T & -4097 | 49152;
        a.Pi = this.Pi;
        a.Nl = this.Nl;
        a.zs = this.zs;
        a.At = this.At;
        a.ot = this.ot;
        a.rt = this.rt;
        a.Ct = this.Ct;
        a.Bt = this.Bt;
        a.ls = this.ls;
        a.lh = null;
        a.qt = this.qt;
        a.pt = this.pt.V();
        a.st = this.st;
        a.Yd = this.Yd;
        a.xr = this.xr;
        a.jj.assign(this.jj);
        a.Es = this.Es;
        a.Fs = this.Fs.V();
        a.Ns = this.Ns.V();
        a.Gs = this.Gs.V();
        a.Tr = this.Tr;
        a.As = this.As;
        a.vn = this.vn.V();
        a.un = this.un;
        a.Pg = this.Pg;
        a.Zt = this.Zt
    };
    F.prototype.Ei = function(a) {
        x.prototype.Ei.call(this, a);
        a.cl();
        a.tn = null;
        a.Fp = null;
        a.Gp = null;
        a.Ql = null;
        a.Sl = null
    };
    F.prototype.toString = function() {
        var a = D.wf(Object.getPrototypeOf(this)) + "#" + D.Nd(this);
        null !== this.data && (a += "(" + ia(this.data) + ")");
        return a
    };
    F.LayoutNone = 0;
    var Wm;
    F.LayoutAdded = Wm = 1;
    var en;
    F.LayoutRemoved = en = 2;
    F.LayoutShown = 4;
    F.LayoutHidden = 8;
    F.LayoutNodeSized = 16;
    var Kn;
    F.LayoutGroupLayout = Kn = 32;
    F.LayoutNodeReplaced = 64;
    var fr;
    F.LayoutStandard = fr = Wm | en | 28 | Kn | 64;
    F.LayoutAll = 16777215;
    F.prototype.qo = function(a, b, c, d, e, g, h) {
        var k = this.g;
        null !== k && (a === hg && "elements" === b ? e instanceof x ? Xm(e, function(a) {
            Zm(k, a);
            Ym(k, a)
        }) : e instanceof Hl && xn(k, e) : a === ig && "elements" === b && (e instanceof x ? Xm(e, function(a) {
            cn(k, a);
            bn(k, a)
        }) : e instanceof Hl && yn(k, e)), k.od(a, b, c, d, e, g, h))
    };
    F.prototype.updateTargetBindings = F.prototype.Ob = function(a) {
        x.prototype.Ob.call(this, a);
        if (null !== this.data) {
            a = this.xa.o;
            for (var b = a.length, c = 0; c < b; c++) {
                var d = a[c];
                d instanceof x && Xm(d, function(a) { null !== a.data && a.Ob() })
            }
        }
    };
    F.prototype.updateRelationshipsFromData = function() {
        var a = this.data;
        if (null !== a) {
            var b = this.g;
            if (null !== b) {
                var c = b.ea;
                c instanceof Y && (a = c.Sn(a), b = b.NI(a), null === b || b instanceof I) && (this.Ka = b)
            }
        }
    };
    D.w(F, { key: "key" }, function() { var a = this.g; return null === a ? void 0 : a.ea.zb(this.data) }, { configurable: !0 });
    D.w(F, { zx: "adornments" }, function() { return null === this.lh ? Ka : this.lh.qG });
    F.prototype.findAdornment = F.prototype.nq = function(a) { v && D.h(a, "string", F, "findAdornment:category"); var b = this.lh; return null === b ? null : b.oa(a) };
    F.prototype.addAdornment = F.prototype.cm = function(a, b) {
        if (null !== b) {
            v && (D.h(a, "string", F, "addAdornment:category"), D.l(b, da, F, "addAdornment:ad"));
            var c = null,
                d = this.lh;
            null !== d && (c = d.oa(a));
            if (c !== b) {
                if (null !== c) {
                    var e = c.g;
                    null !== e && e.remove(c)
                }
                null === d && (this.lh = d = new oa("string", da));
                b.Pi !== a && (b.Kd = a);
                d.add(a, b);
                c = this.g;
                null !== c && (c.add(b), b.data = this.data)
            }
        }
    };
    F.prototype.removeAdornment = F.prototype.Xj = function(a) {
        v && D.h(a, "string", F, "removeAdornment:category");
        var b = this.lh;
        if (null !== b) {
            var c = b.oa(a);
            if (null !== c) {
                var d = c.g;
                null !== d && d.remove(c)
            }
            b.remove(a);
            0 === b.count && (this.lh = null)
        }
    };
    F.prototype.clearAdornments = F.prototype.iu = function() {
        var a = this.lh;
        if (null !== a) {
            for (var b = D.mb(), a = a.j; a.next();) b.push(a.key);
            for (var a = b.length, c = 0; c < a; c++) this.Xj(b[c]);
            D.ya(b)
        }
    };
    F.prototype.updateAdornments = function() {
        var a = this.g;
        if (null !== a) {
            a: {
                if (this.ib && this.$G) {
                    var b = this.to;
                    if (!(null !== b && this.aa.H() && this.isVisible() && b.Sj() && b.aa.H())) break a;
                    var c = this.nq("Selection");
                    if (null === c) {
                        c = this.pK;
                        null === c && (c = this instanceof J ? a.EJ : this instanceof I ? a.bJ : a.WJ);
                        if (!(c instanceof da)) break a;
                        Sh(c);
                        c = c.copy();
                        null !== c && (c.Bb = b)
                    }
                    if (null !== c) {
                        var d = c.placeholder;
                        if (null !== d) {
                            var e = b.Jj(),
                                g = 0;
                            b instanceof z && (g = b.lb);
                            var h = D.Gm();
                            h.n((b.Ga.width + g) * e, (b.Ga.height + g) * e);
                            d.Ea =
                                h;
                            D.Zk(h)
                        }
                        c.angle = b.sm();
                        c.type !== sj && (d = D.P(), c.location = b.fb(ec, d), D.A(d));
                        this.cm("Selection", c);
                        break a
                    }
                }
                this.Xj("Selection")
            }
            gr(this, a);
            for (a = this.zx; a.next();) b = a.value,
            b.Ob(),
            b.K()
        }
    };

    function gr(a, b) {
        b.nb.qf.each(function(b) { b.isEnabled && b.updateAdornments(a) });
        b.nb.updateAdornments(a)
    }
    D.w(F, { layer: "layer" }, function() { return this.xw });
    D.w(F, { g: "diagram" }, function() { var a = this.xw; return null !== a ? a.g : null });
    D.defineProperty(F, { Nf: "layerName" }, function() { return this.Nl }, function(a) {
        var b = this.Nl;
        if (b !== a) {
            D.h(a, "string", F, "layerName");
            var c = this.g;
            if (null === c || null !== c.pm(a) && !c.hr)
                if (this.Nl = a, null !== c && c.Qc(), this.i("layerName", b, a), b = this.layer, null !== b && b.name !== a && (c = b.g, null !== c && (a = c.pm(a), null !== a && a !== b))) {
                    var d = b.yf(-1, this, !0);
                    0 <= d && c.od(ig, "parts", b, this, null, d, !0);
                    d = a.uq(99999999, this, !0);
                    b.visible !== a.visible && this.Pd(a.visible);
                    0 <= d && c.od(hg, "parts", a, null, this, !0, d);
                    d = this.py;
                    if (null !==
                        d) {
                        var e = c.$a;
                        c.$a = !0;
                        d(this, b, a);
                        c.$a = e
                    }
                }
        }
    });
    D.defineProperty(F, { py: "layerChanged" }, function() { return this.zs }, function(a) {
        var b = this.zs;
        b !== a && (null !== a && D.h(a, "function", F, "layerChanged"), this.zs = a, this.i("layerChanged", b, a))
    });
    D.defineProperty(F, { Co: "zOrder" }, function() { return this.Zt }, function(a) {
        var b = this.Zt;
        if (b !== a) {
            D.h(a, "number", F, "zOrder");
            this.Zt = a;
            var c = this.layer;
            null !== c && yl(c, -1, this);
            this.i("zOrder", b, a);
            a = this.g;
            null !== a && a.ra()
        }
    });
    F.prototype.invalidateAdornments = F.prototype.pe = function() {
        var a = this.g;
        null !== a && (Wl(a), 0 !== (this.T & 16384) !== !0 && (this.T |= 16384, a.Ve()))
    };

    function ul(a) { 0 !== (a.T & 16384) !== !1 && (a.updateAdornments(), a.T &= -16385) }

    function hr(a) {
        if (!1 === Pm(a)) {
            var b = a.g;
            null !== b && (b.Gg.add(a), b.Ve());
            ir(a, !0);
            a.cj()
        }
    }

    function jr(a) {
        a.T |= 2097152;
        if (!1 !== Pm(a)) {
            var b = a.position,
                c = a.location;
            c.H() && b.H() || kr(a, b, c);
            var c = a.bc,
                d = c.copy();
            c.Xa();
            c.x = b.x;
            c.y = b.y;
            c.freeze();
            a.zy(d, c);
            ir(a, !1)
        }
    }
    D.w(F, { Bf: "locationObject" }, function() { if (null === this.Ql) { var a = this.uy; "" !== a ? (a = this.Md(a), this.Ql = null !== a ? a : this) : this.Ql = this instanceof da ? this.type !== sj && null !== this.placeholder ? this.placeholder : this : this } return this.Ql.visible ? this.Ql : this });
    D.defineProperty(F, { PJ: "minLocation" }, function() { return this.Ns }, function(a) {
        var b = this.Ns;
        b.O(a) || (v && D.l(a, N, F, "minLocation"), this.Ns = a = a.V(), this.i("minLocation", b, a))
    });
    D.defineProperty(F, { JJ: "maxLocation" }, function() { return this.Gs }, function(a) {
        var b = this.Gs;
        b.O(a) || (v && D.l(a, N, F, "maxLocation"), this.Gs = a = a.V(), this.i("maxLocation", b, a))
    });
    D.defineProperty(F, { uy: "locationObjectName" }, function() { return this.Es }, function(a) {
        var b = this.Es;
        b !== a && (v && D.h(a, "string", F, "locationObjectName"), this.Es = a, this.Ql = null, this.K(), this.i("locationObjectName", b, a))
    });
    D.defineProperty(F, { Of: "locationSpot" }, function() { return this.Fs }, function(a) {
        var b = this.Fs;
        b.O(a) || (v && (D.l(a, S, F, "locationSpot"), a.Xc() || D.k("Part.locationSpot must be a specific Spot value, not: " + a)), this.Fs = a = a.V(), this.K(), this.i("locationSpot", b, a))
    });
    F.prototype.move = function(a) { this.position = a };
    F.prototype.moveTo = F.prototype.moveTo = function(a, b) {
        var c = D.Fb(a, b);
        this.move(c);
        D.A(c)
    };
    F.prototype.isVisible = function() {
        if (!this.visible) return !1;
        var a = this.layer;
        if (null !== a && !a.visible) return !1;
        a = this.g;
        if (null !== a && (a = a.Ra, a.nf && (a = a.jn.oa(this), null !== a && a.Hy))) return !0;
        a = this.Ka;
        return null === a || a.md && a.isVisible() ? !0 : !1
    };
    F.prototype.Pd = function(a) {
        var b = this.g;
        a ? (this.L(4), this.pe(), null !== b && b.Gg.add(this)) : (this.L(8), this.iu());
        this.cl();
        null !== b && (b.Qc(), b.ra())
    };
    F.prototype.findObject = F.prototype.Md = function(a) {
        if (this.name === a) return this;
        var b = this.Sl;
        null === b && (this.Sl = b = new ma);
        if (void 0 !== b[a]) return b[a];
        for (var c = this.xa.o, d = c.length, e = 0; e < d; e++) {
            var g = c[e];
            if (g.name === a) return b[a] = g;
            if (g instanceof x)
                if (null === g.ej && null === g.Ig) { if (g = g.Md(a), null !== g) return b[a] = g } else if (vn(g) && (g = g.xa.first(), null !== g && g.name === a)) return b[a] = g
        }
        return b[a] = null
    };

    function lr(a, b, c, d) {
        void 0 === d && (d = new N);
        c = c.de() ? mc : c;
        var e = b.Ga;
        d.n(e.width * c.x + c.offsetX, e.height * c.y + c.offsetY);
        if (null === b || b === a) return d;
        b.transform.vb(d);
        for (b = b.R; null !== b && b !== a;) b.transform.vb(d), b = b.R;
        a.ij.vb(d);
        d.offset(-a.Fd.x, -a.Fd.y);
        return d
    }
    F.prototype.ensureBounds = F.prototype.kf = function() {
        Hk(this, Infinity, Infinity);
        this.rc()
    };

    function xl(a, b) {
        var c = a.EH,
            d;
        isNaN(a.zk) && (a.zk = fq(a));
        d = a.zk;
        var e = 2 * d;
        if (!a.dl) return c.n(b.x - 1 - d, b.y - 1 - d, b.width + 2 + e, b.height + 2 + e), c;
        d = b.x;
        var e = b.y,
            g = b.width,
            h = b.height,
            k = a.shadowBlur,
            l = a.tK,
            g = g + k,
            h = h + k;
        d -= k / 2;
        e -= k / 2;
        0 < l.x ? g += l.x : (d += l.x, g -= l.x);
        0 < l.y ? h += l.y : (e += l.y, h -= l.y);
        c.n(d - 1, e - 1, g + 2, h + 2);
        return c
    }
    F.prototype.rc = function() {
        this.cj();
        if (!1 === Om(this)) jr(this);
        else {
            var a = this.bc,
                b = D.Sf();
            b.assign(a);
            a.Xa();
            var c = tl(this);
            this.Cj(0, 0, this.Fd.width, this.Fd.height);
            var d = this.position;
            kr(this, d, this.location);
            a.x = d.x;
            a.y = d.y;
            a.freeze();
            this.zy(b, a);
            No(this, !1);
            b.O(a) ? this.Pf(c) : !this.qe() || Q(b.width, a.width) && Q(b.height, a.height) || 0 <= this.QD && this.L(16);
            D.Lb(b);
            ir(this, !1)
        }
    };
    F.prototype.zy = function(a, b) {
        var c = this.g;
        if (null !== c) {
            var d = !1;
            if (!1 === c.rk && a.H()) {
                var e = c.kd,
                    g = c.padding,
                    h = e.x + g.left,
                    k = e.y + g.top,
                    l = e.width - 2 * g.right,
                    e = e.height - 2 * g.bottom;
                a.x > h && a.y > k && a.right < l && a.bottom < e && b.x > h && b.y > k && b.right < l && b.bottom < e && (d = !0)
            }
            0 !== (this.T & 65536) !== !0 && a.O(b) || $m(this, d, c);
            c.ra();
            Db(a, b) || (this instanceof G && !c.na.ub && this.kg(), this.cl())
        }
    };
    D.defineProperty(F, { location: "location" }, function() { return this.jj }, function(a) {
        v && D.l(a, N, F, "location");
        var b = a.x,
            c = a.y,
            d = this.jj,
            e = d.x,
            g = d.y;
        (e === b || isNaN(e) && isNaN(b)) && (g === c || isNaN(g) && isNaN(c)) || (a = a.V(), b = a, this instanceof J ? b = !1 : (this.jj = b, this.T |= 2097152, !1 === Om(this) && (hr(this), c = this.sb, c.H() && (e = c.copy(), c.n(c.x + (b.x - d.x), c.y + (b.y - d.y)), mr(this, this.g, c, e), this.i("position", e, c))), b = !0), b && this.i("location", d, a))
    });
    f = F.prototype;
    f.bC = function(a, b) {
        if (this instanceof J || !a.H()) return !1;
        var c = this.g;
        if (null !== c && (mr(this, c, a, b), !0 === c.na.ub)) return !0;
        this.sb = a;
        this.T &= -2097153;
        c = this.jj;
        if (c.H()) {
            var d = c.copy();
            c.n(c.x + (a.x - b.x), c.y + (a.y - b.y));
            this.i("location", d, c)
        }!1 === Pm(this) && !1 === Om(this) && (hr(this), jr(this));
        return !0
    };

    function mr(a, b, c, d) { null === b || a instanceof da || (b = b.Ra, b.zc && hl(b, a, "position", d.copy(), c.copy(), !1)) }
    f.Uy = function(a, b) {
        var c = this.jj,
            d = this.sb;
        Pm(this) || Om(this) ? c.n(NaN, NaN) : c.n(c.x + a - d.x, c.y + b - d.y);
        d.n(a, b);
        hr(this)
    };
    f.cC = function() {
        this.T &= -2097153;
        hr(this)
    };

    function kr(a, b, c) {
        var d = D.P(),
            e = a.Of,
            g = a.Bf;
        e.de() && D.k("determineOffset: Part's locationSpot must be real: " + e.toString());
        var h = g.Ga,
            k = g instanceof z ? g.lb : 0;
        d.pv(0, 0, h.width + k, h.height + k, e);
        if (g !== a)
            for (d.offset(-k / 2, -k / 2), g.transform.vb(d), e = g.R; null !== e && e !== a;) e.transform.vb(d), e = e.R;
        a.ij.vb(d);
        d.offset(-a.Fd.x, -a.Fd.y);
        e = a.g;
        g = c.H();
        h = b.H();
        g && h ? 0 !== (a.T & 2097152) ? nr(a, b, c, e, d) : or(a, b, c, e, d) : g ? nr(a, b, c, e, d) : h && or(a, b, c, e, d);
        a.T |= 2097152;
        D.A(d);
        a.cj()
    }

    function nr(a, b, c, d, e) {
        var g = b.x,
            h = b.y;
        b.n(c.x - e.x, c.y - e.y);
        null !== d && (c = d.Ra, (e = c.sk) || !c.zc || a instanceof da || hl(c, a, "position", new N(g, h), b, !1), e || b.x === g && b.y === h || (c = d.kb, d.kb = !0, a.i("position", new N(g, h), b), d.kb = c))
    }

    function or(a, b, c, d, e) {
        var g = c.copy();
        c.n(b.x + e.x, b.y + e.y);
        c.O(g) || null === d || (b = d.kb, d.kb = !0, a.i("location", g, c), d.kb = b)
    }

    function $m(a, b, c) {
        Po(a, !1);
        a instanceof G && c.oB(a);
        a.layer.Yc || b || c.Qc();
        b = a.bc;
        var d = c.wb;
        d.H() ? (tl(a) ? Ob(b, d) || a.Pf(!1) : b.jg(d) && a.Pf(!0), a.updateAdornments()) : c.Jl = !0
    }
    f.ym = function() { return !0 };

    function vl(a, b) {
        var c = a.bc;
        if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y) && a.isVisible()) {
            var d = a.transform;
            null !== a.lc && (Vo(a, b, a.lc, !0, !0), b.fillRect(c.x, c.y, c.width, c.height));
            null === a.lc && null === a.Mb && (Vo(a, b, "rgba(0,0,0,0.4)", !0, !1), b.fillRect(c.x, c.y, c.width, c.height));
            null !== a.Mb && (d.Nu() || b.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy), c = a.Ga, Vo(a, b, a.Mb, !0, !1), b.fillRect(0, 0, c.width, c.height), d.Nu() || (c = 1 / (d.m11 * d.m22 - d.m12 * d.m21), b.transform(d.m22 * c, -d.m12 * c, -d.m21 * c, d.m11 * c, c * (d.m21 *
                d.dy - d.m22 * d.dx), c * (d.m12 * d.dx - d.m11 * d.dy))))
        }
    }
    f.qe = function() { return !0 };
    f.Oj = function() { return !0 };
    D.defineProperty(F, { Kd: "category" }, function() { return this.Pi }, function(a) {
        var b = this.Pi;
        if (b !== a) {
            D.h(a, "string", F, "category");
            var c = this.g,
                d = this.data,
                e = null;
            if (null !== c && null !== d && !(this instanceof da)) {
                var g = c.ea.na;
                g.isEnabled && !g.ub && (e = this.clone(), e.xa.Vc(this.xa))
            }
            this.Pi = a;
            this.i("category", b, a);
            null === c || null === d || this instanceof da ? (e = this.If, null !== e && (a = e.lh, null !== a && a.remove(b), e.cm(this.Kd, this))) : (g = c.ea, g.na.ub || (this instanceof J ? (g instanceof Y ? g.bH(d, a) : g instanceof Bg && g.rK(d,
                a), c = rj(c, a), null !== c && (Sh(c), c = c.copy(), null !== c && pr(this, c, b, a))) : (null !== g && g.Ry(d, a), c = Cn(c, d, a), null !== c && (Sh(c), c = c.copy(), null === c || c instanceof J || (c.location = this.location, pr(this, c, b, a)))), null !== e && (b = this.clone(), b.xa.Vc(this.xa), this.i("self", e, b))))
        }
    });
    D.defineProperty(F, { self: "self" }, function() { return this }, function(a) { pr(this, a, this.Kd, a.Kd) });
    var qr = !1;

    function pr(a, b, c, d) {
        b.constructor === a.constructor || qr || (qr = !0, D.trace('Should not change the class of the Part when changing category from "' + c + '" to "' + d + '"'), D.trace("  Old class: " + D.wf(a) + ", new class: " + D.wf(b) + ", part: " + a.toString()));
        a.iu();
        var e = a.data;
        c = a.Nf;
        var g = a.ib,
            h = a.Zg,
            k = !0,
            l = !0,
            m = !1;
        if (a instanceof G) var n = a,
            k = n.Rj,
            l = n.Dc,
            m = n.br;
        b.Ei(a);
        b.cloneProtected(a);
        a.Pi = d;
        a.K();
        a.ra();
        b = a.g;
        d = !0;
        null !== b && (d = b.kb, b.kb = !0);
        a.Sd = e;
        null !== e && a.Ob();
        null !== b && (b.kb = d);
        e = a.Nf;
        e !== c && (a.Nl = c,
            a.Nf = e);
        a instanceof G && (n = a, n.Rj = k, n.Dc = l, n.br = m, n.qe() && n.L(64));
        a.ib = g;
        a.Zg = h
    }
    F.prototype.canCopy = function() {
        if (!this.nF) return !1;
        var a = this.layer;
        if (null === a) return !0;
        if (!a.Pk) return !1;
        a = a.g;
        return null === a ? !0 : a.Pk ? !0 : !1
    };
    F.prototype.canDelete = function() {
        if (!this.rF) return !1;
        var a = this.layer;
        if (null === a) return !0;
        if (!a.Cn) return !1;
        a = a.g;
        return null === a ? !0 : a.Cn ? !0 : !1
    };
    F.prototype.canEdit = function() {
        if (!this.kH) return !1;
        var a = this.layer;
        if (null === a) return !0;
        if (!a.Dx) return !1;
        a = a.g;
        return null === a ? !0 : a.Dx ? !0 : !1
    };
    F.prototype.canGroup = function() {
        if (!this.YF) return !1;
        var a = this.layer;
        if (null === a) return !0;
        if (!a.Ax) return !1;
        a = a.g;
        return null === a ? !0 : a.Ax ? !0 : !1
    };
    F.prototype.canMove = function() {
        if (!this.zG) return !1;
        var a = this.layer;
        if (null === a) return !0;
        if (!a.fm) return !1;
        a = a.g;
        return null === a ? !0 : a.fm ? !0 : !1
    };
    F.prototype.canReshape = function() {
        if (!this.OG) return !1;
        var a = this.layer;
        if (null === a) return !0;
        if (!a.Bx) return !1;
        a = a.g;
        return null === a ? !0 : a.Bx ? !0 : !1
    };
    F.prototype.canResize = function() {
        if (!this.PG) return !1;
        var a = this.layer;
        if (null === a) return !0;
        if (!a.fu) return !1;
        a = a.g;
        return null === a ? !0 : a.fu ? !0 : !1
    };
    F.prototype.canRotate = function() {
        if (!this.UG) return !1;
        var a = this.layer;
        if (null === a) return !0;
        if (!a.Cx) return !1;
        a = a.g;
        return null === a ? !0 : a.Cx ? !0 : !1
    };
    F.prototype.canSelect = function() {
        if (!this.il) return !1;
        var a = this.layer;
        if (null === a) return !0;
        if (!a.Jf) return !1;
        a = a.g;
        return null === a ? !0 : a.Jf ? !0 : !1
    };
    D.defineProperty(F, { nF: "copyable" }, function() { return 0 !== (this.T & 1) }, function(a) {
        var b = 0 !== (this.T & 1);
        b !== a && (v && D.h(a, "boolean", F, "copyable"), this.T ^= 1, this.i("copyable", b, a))
    });
    D.defineProperty(F, { rF: "deletable" }, function() { return 0 !== (this.T & 2) }, function(a) {
        var b = 0 !== (this.T & 2);
        b !== a && (v && D.h(a, "boolean", F, "deletable"), this.T ^= 2, this.i("deletable", b, a))
    });
    D.defineProperty(F, { kH: "textEditable" }, function() { return 0 !== (this.T & 4) }, function(a) {
        var b = 0 !== (this.T & 4);
        b !== a && (v && D.h(a, "boolean", F, "textEditable"), this.T ^= 4, this.i("textEditable", b, a), this.pe())
    });
    D.defineProperty(F, { YF: "groupable" }, function() { return 0 !== (this.T & 8) }, function(a) {
        var b = 0 !== (this.T & 8);
        b !== a && (v && D.h(a, "boolean", F, "groupable"), this.T ^= 8, this.i("groupable", b, a))
    });
    D.defineProperty(F, { zG: "movable" }, function() { return 0 !== (this.T & 16) }, function(a) {
        var b = 0 !== (this.T & 16);
        b !== a && (v && D.h(a, "boolean", F, "movable"), this.T ^= 16, this.i("movable", b, a))
    });
    D.defineProperty(F, { $G: "selectionAdorned" }, function() { return 0 !== (this.T & 32) }, function(a) {
        var b = 0 !== (this.T & 32);
        b !== a && (v && D.h(a, "boolean", F, "selectionAdorned"), this.T ^= 32, this.i("selectionAdorned", b, a), this.pe())
    });
    D.defineProperty(F, { hy: "isInDocumentBounds" }, function() { return 0 !== (this.T & 64) }, function(a) {
        var b = 0 !== (this.T & 64);
        if (b !== a) {
            v && D.h(a, "boolean", F, "isInDocumentBounds");
            this.T ^= 64;
            var c = this.g;
            null !== c && c.Qc();
            this.i("isInDocumentBounds", b, a)
        }
    });
    D.defineProperty(F, { tB: "isLayoutPositioned" }, function() { return 0 !== (this.T & 128) }, function(a) {
        var b = 0 !== (this.T & 128);
        b !== a && (v && D.h(a, "boolean", F, "isLayoutPositioned"), this.T ^= 128, this.i("isLayoutPositioned", b, a), this.L(a ? 4 : 8))
    });
    D.defineProperty(F, { il: "selectable" }, function() { return 0 !== (this.T & 256) }, function(a) {
        var b = 0 !== (this.T & 256);
        b !== a && (v && D.h(a, "boolean", F, "selectable"), this.T ^= 256, this.i("selectable", b, a), this.pe())
    });
    D.defineProperty(F, { OG: "reshapable" }, function() { return 0 !== (this.T & 512) }, function(a) {
        var b = 0 !== (this.T & 512);
        b !== a && (v && D.h(a, "boolean", F, "reshapable"), this.T ^= 512, this.i("reshapable", b, a), this.pe())
    });
    D.defineProperty(F, { PG: "resizable" }, function() { return 0 !== (this.T & 1024) }, function(a) {
        var b = 0 !== (this.T & 1024);
        b !== a && (v && D.h(a, "boolean", F, "resizable"), this.T ^= 1024, this.i("resizable", b, a), this.pe())
    });
    D.defineProperty(F, { UG: "rotatable" }, function() { return 0 !== (this.T & 2048) }, function(a) {
        var b = 0 !== (this.T & 2048);
        b !== a && (v && D.h(a, "boolean", F, "rotatable"), this.T ^= 2048, this.i("rotatable", b, a), this.pe())
    });
    D.defineProperty(F, { ib: "isSelected" }, function() { return 0 !== (this.T & 4096) }, function(a) {
        var b = 0 !== (this.T & 4096);
        if (b !== a) {
            v && D.h(a, "boolean", F, "isSelected");
            var c = this.g;
            if (!a || this.canSelect() && !(null !== c && c.selection.count >= c.KJ)) {
                this.T ^= 4096;
                var d = !1;
                if (null !== c) {
                    d = c.kb;
                    c.kb = !0;
                    var e = c.selection;
                    e.Xa();
                    a ? e.add(this) : e.remove(this);
                    e.freeze()
                }
                this.i("isSelected", b, a);
                this.pe();
                a = this.qK;
                null !== a && a(this);
                null !== c && (c.Ve(), c.kb = d)
            }
        }
    });
    D.defineProperty(F, { Zg: "isHighlighted" }, function() { return 0 !== (this.T & 524288) }, function(a) {
        var b = 0 !== (this.T & 524288);
        if (b !== a) {
            v && D.h(a, "boolean", F, "isHighlighted");
            this.T ^= 524288;
            var c = this.g;
            null !== c && (c = c.vm, c.Xa(), a ? c.add(this) : c.remove(this), c.freeze());
            this.i("isHighlighted", b, a);
            this.ra();
            a = this.eJ;
            null !== a && a(this)
        }
    });
    D.defineProperty(F, { dl: "isShadowed" }, function() { return 0 !== (this.T & 8192) }, function(a) {
        var b = 0 !== (this.T & 8192);
        b !== a && (v && D.h(a, "boolean", F, "isShadowed"), this.T ^= 8192, this.i("isShadowed", b, a), this.ra())
    });

    function Pm(a) { return 0 !== (a.T & 32768) }

    function ir(a, b) { a.T = b ? a.T | 32768 : a.T & -32769 }

    function Po(a, b) { a.T = b ? a.T | 65536 : a.T & -65537 }

    function tl(a) { return 0 !== (a.T & 131072) }
    F.prototype.Pf = function(a) { this.T = a ? this.T | 131072 : this.T & -131073 };

    function rr(a, b) { a.T = b ? a.T | 1048576 : a.T & -1048577 }
    D.defineProperty(F, { eG: "isAnimated" }, function() { return 0 !== (this.T & 262144) }, function(a) {
        var b = 0 !== (this.T & 262144);
        b !== a && (v && D.h(a, "boolean", F, "isAnimated"), this.T ^= 262144, this.i("isAnimated", b, a))
    });
    D.defineProperty(F, { eJ: "highlightedChanged" }, function() { return this.ls }, function(a) {
        var b = this.ls;
        b !== a && (null !== a && D.h(a, "function", F, "highlightedChanged"), this.ls = a, this.i("highlightedChanged", b, a))
    });
    D.defineProperty(F, { Py: "selectionObjectName" }, function() { return this.Ct }, function(a) {
        var b = this.Ct;
        b !== a && (v && D.h(a, "string", F, "selectionObjectName"), this.Ct = a, this.tn = null, this.i("selectionObjectName", b, a))
    });
    D.defineProperty(F, { pK: "selectionAdornmentTemplate" }, function() { return this.At }, function(a) {
        var b = this.At;
        b !== a && (v && D.l(a, da, F, "selectionAdornmentTemplate"), this instanceof J && (a.type = sj), this.At = a, this.i("selectionAdornmentTemplate", b, a))
    });
    D.w(F, { to: "selectionObject" }, function() {
        if (null === this.tn) {
            var a = this.Py;
            null !== a && "" !== a ? (a = this.Md(a), this.tn = null !== a ? a : this) : this instanceof J ? (a = this.path, this.tn = null !== a ? a : this) : this.tn = this
        }
        return this.tn
    });
    D.defineProperty(F, { qK: "selectionChanged" }, function() { return this.Bt }, function(a) {
        var b = this.Bt;
        b !== a && (null !== a && D.h(a, "function", F, "selectionChanged"), this.Bt = a, this.i("selectionChanged", b, a))
    });
    D.defineProperty(F, { QG: "resizeAdornmentTemplate" }, function() { return this.ot }, function(a) {
        var b = this.ot;
        b !== a && (v && D.l(a, da, F, "resizeAdornmentTemplate"), this.ot = a, this.i("resizeAdornmentTemplate", b, a))
    });
    D.defineProperty(F, { SG: "resizeObjectName" }, function() { return this.qt }, function(a) {
        var b = this.qt;
        b !== a && (v && D.h(a, "string", F, "resizeObjectName"), this.qt = a, this.Fp = null, this.i("resizeObjectName", b, a))
    });
    D.w(F, { RG: "resizeObject" }, function() {
        if (null === this.Fp) {
            var a = this.SG;
            null !== a && "" !== a ? (a = this.Md(a), this.Fp = null !== a ? a : this) : this.Fp = this
        }
        return this.Fp
    });
    D.defineProperty(F, { gK: "resizeCellSize" }, function() { return this.pt }, function(a) {
        var b = this.pt;
        b.O(a) || (v && D.l(a, Ca, F, "resizeCellSize"), this.pt = a = a.V(), this.i("resizeCellSize", b, a))
    });
    D.defineProperty(F, { iK: "rotateAdornmentTemplate" }, function() { return this.rt }, function(a) {
        var b = this.rt;
        b !== a && (v && D.l(a, da, F, "rotateAdornmentTemplate"), this.rt = a, this.i("rotateAdornmentTemplate", b, a))
    });
    D.defineProperty(F, { jK: "rotateObjectName" }, function() { return this.st }, function(a) {
        var b = this.st;
        b !== a && (v && D.h(a, "string", F, "rotateObjectName"), this.st = a, this.Gp = null, this.i("rotateObjectName", b, a))
    });
    D.w(F, { TB: "rotateObject" }, function() {
        if (null === this.Gp) {
            var a = this.jK;
            null !== a && "" !== a ? (a = this.Md(a), this.Gp = null !== a ? a : this) : this.Gp = this
        }
        return this.Gp
    });
    D.defineProperty(F, { text: "text" }, function() { return this.Yd }, function(a) {
        var b = this.Yd;
        b !== a && (v && D.h(a, "string", F, "text"), this.Yd = a, this.i("text", b, a))
    });
    D.defineProperty(F, { Ka: "containingGroup" }, function() { return this.Al }, function(a) {
        if (this.qe()) {
            var b = this.Al;
            if (b !== a) {
                v && null !== a && D.l(a, I, F, "containingGroup");
                null === a || this !== a && !a.Fi(this) || (this === a && D.k("Cannot make a Group a member of itself: " + this.toString()), D.k("Cannot make a Group indirectly contain itself: " + this.toString() + " already contains " + a.toString()));
                this.L(en);
                var c = this.g;
                null !== b ? sr(b, this) : this instanceof I && null !== c && c.$l.remove(this);
                this.Al = a;
                null !== a ? tr(a, this) : this instanceof
                I && null !== c && c.$l.add(this);
                this.L(Wm);
                if (null !== c) {
                    var d = this.data,
                        e = c.ea;
                    null !== d && e instanceof Y && e.$B(d, e.zb(null !== a ? a.data : null))
                }
                d = this.kF;
                null !== d && (e = !0, null !== c && (e = c.$a, c.$a = !0), d(this, b, a), null !== c && (c.$a = e));
                if (this instanceof I)
                    for (c = new L(F), Qh(c, this, !0, 0, !0), c = c.j; c.next();)
                        if (d = c.value, d instanceof G)
                            for (d = d.Od; d.next();) An(d.value);
                if (this instanceof G) {
                    for (d = this.Od; d.next();) An(d.value);
                    c = this.Xb;
                    null !== c && An(c)
                }
                this.i("containingGroup", b, a);
                null !== a && (b = a.layer, null !== b && yl(b, -1, a))
            }
        } else D.k("cannot set the Part.containingGroup of a Link or Adornment")
    });
    f = F.prototype;
    f.cl = function() {
        var a = this.Ka;
        null !== a && (a.K(), null !== a.Rb && a.Rb.K(), a.kg())
    };
    f.ra = function() {
        var a = this.g;
        null !== a && !Om(this) && !Pm(this) && this.isVisible() && this.bc.H() && a.ra(xl(this, this.bc))
    };
    f.K = function() {
        x.prototype.K.call(this);
        var a = this.g;
        null !== a && (a.Gg.add(this), this instanceof G && null !== this.Xb && Zo(this.Xb), a.Ve(!0))
    };
    f.Fu = function(a) { a || (a = this.Al, null !== a && tr(a, this)) };
    f.Gu = function(a) { a || (a = this.Al, null !== a && sr(a, this)) };
    f.Nn = function() {
        var a = this.data;
        if (null !== a) {
            var b = this.g;
            null !== b && (b = b.ea, null !== b && b.Ky(a))
        }
    };
    D.defineProperty(F, { kF: "containingGroupChanged" }, function() { return this.xr }, function(a) {
        var b = this.xr;
        b !== a && (null !== a && D.h(a, "function", F, "containingGroupChanged"), this.xr = a, this.i("containingGroupChanged", b, a))
    });
    F.prototype.findSubGraphLevel = function() { return ur(this, this) };

    function ur(a, b) { var c = b.Ka; return null !== c ? 1 + ur(a, c) : b instanceof G && (c = b.Xb, null !== c) ? ur(a, c) : 0 }
    F.prototype.findTopLevelPart = function() { return vr(this, this) };

    function vr(a, b) { var c = b.Ka; return null !== c ? vr(a, c) : b instanceof G && (c = b.Xb, null !== c) ? vr(a, c) : b }
    D.w(F, { Bq: "isTopLevel" }, function() { return null !== this.Ka || this instanceof G && null !== this.Xb ? !1 : !0 });
    F.prototype.isMemberOf = F.prototype.Fi = function(a) { return a instanceof I ? wr(this, this, a) : !1 };

    function wr(a, b, c) { if (b === c || null === c) return !1; var d = b.Ka; return null === d || d !== c && !wr(a, d, c) ? b instanceof G && (b = b.Xb, null !== b) ? wr(a, b, c) : !1 : !0 }
    F.prototype.findCommonContainingGroup = F.prototype.LI = function(a) {
        if (null === a) return null;
        v && D.l(a, F, F, "findCommonContainingGroup:other");
        if (this === a) return this.Ka;
        for (var b = this; null !== b;) {
            b instanceof I && rr(b, !0);
            if (b instanceof G) {
                var c = b.Xb;
                null !== c && (b = c)
            }
            b = b.Ka
        }
        for (var d = null, b = a; null !== b;) {
            if (0 !== (b.T & 1048576)) { d = b; break }
            b instanceof G && (c = b.Xb, null !== c && (b = c));
            b = b.Ka
        }
        for (b = this; null !== b;) b instanceof I && rr(b, !1), b instanceof G && (c = b.Xb, null !== c && (b = c)), b = b.Ka;
        return d
    };
    D.defineProperty(F, { AJ: "layoutConditions" }, function() { return this.As }, function(a) {
        var b = this.As;
        b !== a && (v && D.h(a, "number", F, "layoutConditions"), this.As = a, this.i("layoutConditions", b, a))
    });
    F.prototype.canLayout = function() { if (!this.tB || !this.isVisible()) return !1; var a = this.layer; return null !== a && a.Yc || this instanceof G && this.Lf ? !1 : !0 };
    F.prototype.invalidateLayout = F.prototype.L = function(a) {
        void 0 === a && (a = 16777215);
        var b;
        this.tB && 0 !== (a & this.AJ) ? (b = this.layer, null !== b && b.Yc || this instanceof G && this.Lf ? b = !1 : (b = this.g, b = null !== b && b.na.ub ? !1 : !0)) : b = !1;
        if (b)
            if (b = this.Al, null !== b) {
                var c = b.Yb;
                null !== c ? c.L() : b.L(a)
            } else a = this.g, null !== a && (c = a.Yb, null !== c && c.L())
    };

    function an(a) {
        if (!a.isVisible()) return !1;
        a = a.layer;
        return null !== a && a.Yc ? !1 : !0
    }
    D.defineProperty(F, { wF: "dragComputation" }, function() { return this.Tr }, function(a) {
        var b = this.Tr;
        b !== a && (null !== a && D.h(a, "function", F, "dragComputation"), this.Tr = a, this.i("dragComputation", b, a))
    });
    D.defineProperty(F, { tK: "shadowOffset" }, function() { return this.vn }, function(a) {
        var b = this.vn;
        b.O(a) || (v && D.l(a, N, F, "shadowOffset"), this.vn = a = a.V(), this.ra(), this.i("shadowOffset", b, a))
    });
    D.defineProperty(F, { shadowColor: "shadowColor" }, function() { return this.un }, function(a) {
        var b = this.un;
        b !== a && (v && D.h(a, "string", F, "shadowColor"), this.un = a, this.ra(), this.i("shadowColor", b, a))
    });
    D.defineProperty(F, { shadowBlur: "shadowBlur" }, function() { return this.Pg }, function(a) {
        var b = this.Pg;
        b !== a && (v && D.h(a, "number", F, "shadowBlur"), this.Pg = a, this.ra(), this.i("shadowBlur", b, a))
    });

    function da(a) {
        0 === arguments.length ? F.call(this, ek) : F.call(this, a);
        this.T &= -257;
        this.Nl = "Adornment";
        this.Tc = null;
        this.$D = 0;
        this.OE = !1;
        this.Rb = this.oh = null
    }
    D.Ta(da, F);
    D.ka("Adornment", da);
    da.prototype.toString = function() { var a = this.If; return "Adornment(" + this.Kd + ")" + (null !== a ? a.toString() : "") };
    da.prototype.updateRelationshipsFromData = function() {};
    da.prototype.Wu = function(a) {
        var b = this.Bb.Y,
            c = this.Bb;
        if (b instanceof J && c instanceof z) {
            var d = b.path,
                c = d.vf;
            b.Wu(a);
            c = d.vf;
            a = this.xa.o;
            b = a.length;
            for (d = 0; d < b; d++) {
                var e = a[d];
                e.Ue && e instanceof z && (e.ab = c)
            }
        }
    };
    D.w(da, { placeholder: "placeholder" }, function() { return this.Rb });
    D.defineProperty(da, { Bb: "adornedObject" }, function() { return this.Tc }, function(a) {
        v && null !== a && D.l(a, O, F, "adornedObject:value");
        var b = this.If,
            c = null;
        null !== a && (c = a.Y);
        null === b || null !== a && b === c || b.Xj(this.Kd);
        this.Tc = a;
        null !== c && c.cm(this.Kd, this)
    });
    D.w(da, { If: "adornedPart" }, function() { var a = this.Tc; return null !== a ? a.Y : null });
    da.prototype.ym = function() {
        var a = this.Tc;
        if (null === a) return !0;
        a = a.Y;
        return null === a || !Om(a)
    };
    da.prototype.qe = function() { return !1 };
    D.w(da, { Ka: "containingGroup" }, function() { return null });
    da.prototype.qo = function(a, b, c, d, e, g, h) {
        if (a === hg && "elements" === b)
            if (e instanceof Yj) {
                var k = e;
                null === this.Rb ? this.Rb = k : this.Rb !== k && D.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")
            } else e instanceof x && (k = e.qu(function(a) { return a instanceof Yj }), k instanceof Yj && (null === this.Rb ? this.Rb = k : this.Rb !== k && D.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")));
        else a === ig && "elements" === b && null !== this.Rb && (d === this.Rb ? this.Rb = null : d instanceof x &&
            this.Rb.xm(d) && (this.Rb = null));
        F.prototype.qo.call(this, a, b, c, d, e, g, h)
    };
    da.prototype.updateAdornments = function() {};
    da.prototype.Nn = function() {};

    function G(a) {
        F.call(this, a);
        this.Ca = 13;
        this.yc = new K(J);
        this.Vt = this.pp = this.Pl = this.Cs = this.Bs = null;
        this.qr = Td;
        this.Ae = this.ai = null;
        this.kt = xr;
        this.Nk = !1
    }
    D.Ta(G, F);
    D.ka("Node", G);
    G.prototype.cloneProtected = function(a) {
        F.prototype.cloneProtected.call(this, a);
        a.Ca = this.Ca;
        a.Ca = this.Ca & -17;
        a.Bs = this.Bs;
        a.Cs = this.Cs;
        a.Pl = this.Pl;
        a.Vt = this.Vt;
        a.qr = this.qr.V();
        a.kt = this.kt
    };
    G.prototype.Ei = function(a) {
        F.prototype.Ei.call(this, a);
        a.kg();
        a.ai = this.ai;
        a.Ae = null
    };
    var yr;
    G.DirectionDefault = yr = D.s(G, "DirectionDefault", 0);
    G.DirectionAbsolute = D.s(G, "DirectionAbsolute", 1);
    var zr;
    G.DirectionRotatedNode = zr = D.s(G, "DirectionRotatedNode", 2);
    var Fo;
    G.DirectionRotatedNodeOrthogonal = Fo = D.s(G, "DirectionRotatedNodeOrthogonal", 3);
    G.SpreadingNone = D.s(G, "SpreadingNone", 10);
    var xr;
    G.SpreadingEvenly = xr = D.s(G, "SpreadingEvenly", 11);
    var Ar;
    G.SpreadingPacked = Ar = D.s(G, "SpreadingPacked", 12);

    function Br(a, b) { null !== b && (null === a.ai && (a.ai = new L(Il)), a.ai.add(b)) }

    function Cr(a, b, c, d) { if (null === b || null === a.ai) return null; for (var e = a.ai.j; e.next();) { var g = e.value; if (g.Hq === a && g.av === b && g.Cy === c && g.Dy === d || g.Hq === b && g.av === a && g.Cy === d && g.Dy === c) return g } return null }
    G.prototype.invalidateLinkBundle = function(a, b, c) {
        if (void 0 === b || null === b) b = "";
        if (void 0 === c || null === c) c = "";
        a = Cr(this, a, b, c);
        null !== a && a.wq()
    };
    G.prototype.qo = function(a, b, c, d, e, g, h) {
        a === hg && "elements" === b ? this.Ae = null : a === ig && "elements" === b && (this.Ae = null);
        F.prototype.qo.call(this, a, b, c, d, e, g, h)
    };
    G.prototype.invalidateConnectedLinks = G.prototype.kg = function(a) {
        void 0 === a && (a = null);
        for (var b = this.Od; b.next();) {
            var c = b.value;
            null !== a && a.contains(c) || (Dr(this, c.oc), Dr(this, c.Gc), c.ec())
        }
    };

    function Qo(a, b) { for (var c = a.Od; c.next();) { var d = c.value; if (d.oc === b || d.Gc === b) Dr(a, d.oc), Dr(a, d.Gc), d.ec() } }

    function Dr(a, b) {
        if (null !== b) {
            var c = b.jt;
            null !== c && c.wq();
            c = a.Ka;
            null === c || c.md || Dr(c, c.port)
        }
    }
    G.prototype.ym = function() { return !0 };
    D.defineProperty(G, { $J: "portSpreading" }, function() { return this.kt }, function(a) {
        var b = this.kt;
        b !== a && (v && D.Da(a, G, G, "portSpreading"), this.kt = a, this.i("portSpreading", b, a), a = this.g, null !== a && a.na.ub || this.kg())
    });
    D.defineProperty(G, { HA: "avoidable" }, function() { return 0 !== (this.Ca & 8) }, function(a) {
        var b = 0 !== (this.Ca & 8);
        if (b !== a) {
            v && D.h(a, "boolean", G, "avoidable");
            this.Ca ^= 8;
            var c = this.g;
            null !== c && c.oB(this);
            this.i("avoidable", b, a)
        }
    });
    D.defineProperty(G, { dI: "avoidableMargin" }, function() { return this.qr }, function(a) {
        "number" === typeof a ? a = new Lb(a) : D.l(a, Lb, G, "avoidableMargin");
        var b = this.qr;
        if (!b.O(a)) {
            this.qr = a = a.V();
            var c = this.g;
            null !== c && c.oB(this);
            this.i("avoidableMargin", b, a)
        }
    });
    G.prototype.getAvoidableRect = function(a) {
        a.set(this.aa);
        a.yx(this.dI);
        return a
    };
    G.prototype.findVisibleNode = function() { for (var a = this; null !== a && !a.isVisible();) a = a.Ka; return a };
    G.prototype.isVisible = function() {
        if (!F.prototype.isVisible.call(this)) return !1;
        var a = !0,
            b = El,
            c = this.g;
        if (null !== c) {
            a = c.Ra;
            if (a.nf && (a = a.jn.oa(this), null !== a && a.Hy)) return !0;
            a = c.ee;
            b = c.rC
        }
        if (b === El) { if (c = this.Yk(), null !== c && !c.Dc) return !1 } else if (b === jn) { if (c = a ? this.HF() : this.IF(), 0 < c.count && c.all(function(a) { return !a.Dc })) return !1 } else if (b === kn && (c = a ? this.HF() : this.IF(), 0 < c.count && c.any(function(a) { return !a.Dc }))) return !1;
        c = this.Xb;
        return null !== c ? c.isVisible() : !0
    };
    G.prototype.Pd = function(a) { F.prototype.Pd.call(this, a); for (var b = this.Od; b.next();) b.value.Pd(a) };
    D.w(G, { Od: "linksConnected" }, function() { return this.yc.j });
    G.prototype.findLinksConnected = G.prototype.FF = function(a) {
        void 0 === a && (a = null);
        if (null === a) return this.yc.j;
        v && D.h(a, "string", G, "findLinksConnected:pid");
        var b = new Qa(this.yc),
            c = this;
        b.Nq = function(b) { return b.$ === c && b.hg === a || b.ba === c && b.jh === a };
        return b
    };
    G.prototype.findLinksOutOf = G.prototype.Wx = function(a) {
        void 0 === a && (a = null);
        v && null !== a && D.h(a, "string", G, "findLinksOutOf:pid");
        var b = new Qa(this.yc),
            c = this;
        b.Nq = function(b) { return b.$ !== c ? !1 : null === a ? !0 : b.hg === a };
        return b
    };
    G.prototype.findLinksInto = G.prototype.Yg = function(a) {
        void 0 === a && (a = null);
        v && null !== a && D.h(a, "string", G, "findLinksInto:pid");
        var b = new Qa(this.yc),
            c = this;
        b.Nq = function(b) { return b.ba !== c ? !1 : null === a ? !0 : b.jh === a };
        return b
    };
    G.prototype.findNodesConnected = G.prototype.GF = function(a) {
        void 0 === a && (a = null);
        v && null !== a && D.h(a, "string", G, "findNodesConnected:pid");
        for (var b = null, c = null, d = this.yc.j; d.next();) { var e = d.value; if (e.$ === this) { if (null === a || e.hg === a) e = e.ba, null !== b ? b.add(e) : null !== c && c !== e ? (b = new L(G), b.add(c), b.add(e)) : c = e } else e.ba !== this || null !== a && e.jh !== a || (e = e.$, null !== b ? b.add(e) : null !== c && c !== e ? (b = new L(G), b.add(c), b.add(e)) : c = e) }
        return null !== b ? b.j : null !== c ? new Ma(c) : Ka
    };
    G.prototype.findNodesOutOf = G.prototype.IF = function(a) {
        void 0 === a && (a = null);
        v && null !== a && D.h(a, "string", G, "findNodesOutOf:pid");
        for (var b = null, c = null, d = this.yc.j; d.next();) {
            var e = d.value;
            e.$ !== this || null !== a && e.hg !== a || (e = e.ba, null !== b ? b.add(e) : null !== c && c !== e ? (b = new L(G), b.add(c), b.add(e)) : c = e)
        }
        return null !== b ? b.j : null !== c ? new Ma(c) : Ka
    };
    G.prototype.findNodesInto = G.prototype.HF = function(a) {
        void 0 === a && (a = null);
        v && null !== a && D.h(a, "string", G, "findNodesInto:pid");
        for (var b = null, c = null, d = this.yc.j; d.next();) {
            var e = d.value;
            e.ba !== this || null !== a && e.jh !== a || (e = e.$, null !== b ? b.add(e) : null !== c && c !== e ? (b = new L(G), b.add(c), b.add(e)) : c = e)
        }
        return null !== b ? b.j : null !== c ? new Ma(c) : Ka
    };
    G.prototype.findLinksBetween = function(a, b, c) {
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        v && (D.l(a, G, G, "findLinksBetween:othernode"), null !== b && D.h(b, "string", G, "findLinksBetween:pid"), null !== c && D.h(c, "string", G, "findLinksBetween:otherpid"));
        var d = new Qa(this.yc),
            e = this;
        d.Nq = function(d) { return (d.$ !== e || d.ba !== a || null !== b && d.hg !== b || null !== c && d.jh !== c) && (d.$ !== a || d.ba !== e || null !== c && d.hg !== c || null !== b && d.jh !== b) ? !1 : !0 };
        return d
    };
    G.prototype.findLinksTo = function(a, b, c) {
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        v && (D.l(a, G, G, "findLinksTo:othernode"), null !== b && D.h(b, "string", G, "findLinksTo:pid"), null !== c && D.h(c, "string", G, "findLinksTo:otherpid"));
        var d = new Qa(this.yc),
            e = this;
        d.Nq = function(d) { return d.$ !== e || d.ba !== a || null !== b && d.hg !== b || null !== c && d.jh === c ? !1 : !0 };
        return d
    };
    D.defineProperty(G, { BJ: "linkConnected" }, function() { return this.Bs }, function(a) {
        var b = this.Bs;
        b !== a && (null !== a && D.h(a, "function", G, "linkConnected"), this.Bs = a, this.i("linkConnected", b, a))
    });
    D.defineProperty(G, { CJ: "linkDisconnected" }, function() { return this.Cs }, function(a) {
        var b = this.Cs;
        b !== a && (null !== a && D.h(a, "function", G, "linkDisconnected"), this.Cs = a, this.i("linkDisconnected", b, a))
    });
    D.defineProperty(G, { sy: "linkValidation" }, function() { return this.Pl }, function(a) {
        var b = this.Pl;
        b !== a && (null !== a && D.h(a, "function", G, "linkValidation"), this.Pl = a, this.i("linkValidation", b, a))
    });

    function Er(a, b, c) {
        Dr(a, c);
        var d = a.yc.contains(b);
        d || a.yc.add(b);
        if (!d || b.$ === b.ba) {
            var e = a.BJ;
            if (null !== e) {
                var g = !0,
                    h = a.g;
                null !== h && (g = h.$a, h.$a = !0);
                e(a, b, c);
                null !== h && (h.$a = g)
            }
        }!d && b.jc && (c = b.$, b = b.ba, null !== c && null !== b && c !== b && (d = !0, h = a.g, null !== h && (d = h.ee), a = d ? b : c, e = d ? c : b, a.Nk || (a.Nk = e), !e.Rj || null !== h && h.na.ub || (d ? c === e && (e.Rj = !1) : b === e && (e.Rj = !1))))
    }

    function Fr(a, b, c) {
        Dr(a, c);
        var d = a.yc.remove(b);
        if (d || b.ba === b.$) {
            var e = a.CJ,
                g = a.g;
            if (null !== e) {
                var h = !0;
                null !== g && (h = g.$a, g.$a = !0);
                e(a, b, c);
                null !== g && (g.$a = h)
            }
        }
        d && b.jc && (c = !0, null !== g && (c = g.ee), a = c ? b.ba : b.$, b = c ? b.$ : b.ba, null !== a && (a.Nk = !1), null === b || b.Rj || (0 === b.yc.count ? (b.Nk = null, null !== g && g.na.ub || (b.Rj = !0)) : Ln(b)))
    }

    function Ln(a) {
        a.Nk = !1;
        if (0 !== a.yc.count) {
            var b = !0,
                c = a.g;
            if (null === c || !c.na.ub) {
                null !== c && (b = c.ee);
                for (c = a.yc.j; c.next();) {
                    var d = c.value;
                    if (d.jc)
                        if (b) { if (d.$ === a) { a.Rj = !1; return } } else if (d.ba === a) { a.Rj = !1; return }
                }
                a.Rj = !0
            }
        }
    }
    G.prototype.updateRelationshipsFromData = function() {
        F.prototype.updateRelationshipsFromData.call(this);
        var a = this.data;
        if (null !== a) {
            var b = this.g;
            if (null !== b) {
                var c = b.ea;
                c instanceof Bg && (a = c.Un(a), a = b.Se(a), c = this.Yk(), a !== c && (c = this.Qn(), null !== a ? null !== c ? b.ee ? c.$ = a : c.ba = a : pn(b, a, this) : null !== c && dn(b, c, !1)))
            }
        }
    };
    G.prototype.Fu = function(a) {
        F.prototype.Fu.call(this, a);
        a || (Ln(this), a = this.pp, null !== a && Gr(a, this))
    };
    G.prototype.Gu = function(a) {
        F.prototype.Gu.call(this, a);
        a || (a = this.pp, null !== a && null !== a.Gf && (a.Gf.remove(this), a.K()))
    };
    G.prototype.Nn = function() {
        if (0 < this.yc.count) {
            var a = this.g;
            if (null !== a)
                for (var b = a.yb.vF, c = this.yc.copy().j; c.next();) {
                    var d = c.value;
                    b ? a.remove(d) : (d.$ === this && (d.$ = null), d.ba === this && (d.ba = null))
                }
        }
        this.Xb = null;
        F.prototype.Nn.call(this)
    };
    D.w(G, { Lf: "isLinkLabel" }, function() { return null !== this.pp });
    D.defineProperty(G, { Xb: "labeledLink" }, function() { return this.pp }, function(a) {
        var b = this.pp;
        if (b !== a) {
            v && null !== a && D.l(a, J, G, "labeledLink");
            var c = this.g,
                d = this.data;
            if (null !== b) {
                null !== b.Gf && (b.Gf.remove(this), b.K());
                if (null !== c && null !== d && !c.na.ub) {
                    var e = b.data,
                        g = c.ea;
                    if (null !== e && g instanceof Y) {
                        var h = g.zb(d);
                        void 0 !== h && g.eK(e, h)
                    }
                }
                this.Ka = null
            }
            this.pp = a;
            null !== a && (Gr(a, this), null === c || null === d || c.na.ub || (e = a.data, g = c.ea, null !== e && g instanceof Y && (h = g.zb(d), void 0 !== h && g.VE(e, h))), this.Ka = a.Ka);
            Zo(this);
            this.i("labeledLink", b, a)
        }
    });
    G.prototype.findPort = G.prototype.aB = function(a) {
        v && D.h(a, "string", G, "findPort:pid");
        if (null === this.Ae) {
            if ("" === a && !1 === this.bl) return this;
            ep(this)
        }
        var b = this.Ae.oa(a);
        return null !== b || "" !== a && (b = this.Ae.oa(""), null !== b) ? b : this
    };
    D.w(G, { port: "port" }, function() { return this.aB("") });
    D.w(G, { ports: "ports" }, function() { null === this.Ae && ep(this); return this.Ae.qG });

    function ep(a) {
        null === a.Ae ? a.Ae = new oa("string", O) : a.Ae.clear();
        gp(a, a, function(a, c) {
            var d = c.yd;
            null !== d && a.Ae.add(d, c)
        });
        0 === a.Ae.count && a.Ae.add("", a)
    }

    function dp(a, b, c) {
        var d = b.yd;
        if (null !== d && (null !== a.Ae && a.Ae.remove(d), b = a.g, null !== b && c)) {
            c = null;
            for (d = a.FF(d); d.next();) a = d.value, null === c && (c = D.mb()), c.push(a);
            if (null !== c) {
                for (d = 0; d < c.length; d++) a = c[d], b.remove(a);
                D.ya(c)
            }
        }
    }
    G.prototype.isInTreeOf = function(a) {
        if (null === a || a === this) return !1;
        var b = !0,
            c = this.g;
        null !== c && (b = c.ee);
        c = this;
        if (b)
            for (; c !== a;) {
                for (var b = null, d = c.yc.j; d.next();) { var e = d.value; if (e.jc && (b = e.$, b !== c && b !== this)) break }
                if (b === this || null === b || b === c) return !1;
                c = b
            } else
                for (; c !== a;) {
                    b = null;
                    for (d = c.yc.j; d.next() && (e = d.value, !e.jc || (b = e.ba, b === c || b === this)););
                    if (b === this || null === b || b === c) return !1;
                    c = b
                }
        return !0
    };
    G.prototype.findTreeRoot = function() {
        var a = !0,
            b = this.g;
        null !== b && (a = b.ee);
        b = this;
        if (a)
            for (;;) {
                for (var a = null, c = b.yc.j; c.next();) { var d = c.value; if (d.jc && (a = d.$, a !== b && a !== this)) break }
                if (a === this) return this;
                if (null === a || a === b) return b;
                b = a
            } else
                for (;;) {
                    a = null;
                    for (c = b.yc.j; c.next() && (d = c.value, !d.jc || (a = d.ba, a === b || a === this)););
                    if (a === this) return this;
                    if (null === a || a === b) return b;
                    b = a
                }
    };
    G.prototype.findCommonTreeParent = function(a) {
        if (null === a) return null;
        v && D.l(a, G, G, "findCommonTreeParent:other");
        if (this === a) return this;
        for (var b = this; null !== b;) rr(b, !0), b = b.Yk();
        for (var c = null, b = a; null !== b;) {
            if (0 !== (b.T & 1048576)) { c = b; break }
            b = b.Yk()
        }
        for (b = this; null !== b;) rr(b, !1), b = b.Yk();
        return c
    };
    G.prototype.findTreeParentLink = G.prototype.Qn = function() {
        var a = !0,
            b = this.g;
        null !== b && (a = b.ee);
        b = this.yc.j;
        if (a)
            for (; b.next();) { if (a = b.value, a.jc && a.$ !== this) return a } else
                for (; b.next();)
                    if (a = b.value, a.jc && a.ba !== this) return a;
        return null
    };
    G.prototype.findTreeParentNode = G.prototype.Yk = function() {
        var a = this.Nk;
        if (null === a) return null;
        if (a instanceof G) return a;
        var b = !0,
            a = this.g;
        null !== a && (b = a.ee);
        a = this.yc.j;
        if (b)
            for (; a.next();) { if (b = a.value, b.jc && (b = b.$, b !== this)) return this.Nk = b } else
                for (; a.next();)
                    if (b = a.value, b.jc && (b = b.ba, b !== this)) return this.Nk = b;
        return this.Nk = null
    };
    G.prototype.findTreeParentChain = function() {
        function a(b, d) {
            if (null !== b) {
                d.add(b);
                var e = b.Qn();
                null !== e && (d.add(e), a(b.Yk(), d))
            }
        }
        var b = new L(F);
        a(this, b);
        return b
    };
    G.prototype.findTreeLevel = function() { return Hr(this, this) };

    function Hr(a, b) { var c = b.Yk(); return null === c ? 0 : 1 + Hr(a, c) }
    G.prototype.findTreeChildrenLinks = G.prototype.Yx = function() {
        var a = !0,
            b = this.g;
        null !== b && (a = b.ee);
        var b = new Qa(this.yc),
            c = this;
        b.Nq = a ? function(a) { return a.jc && a.$ === c ? !0 : !1 } : function(a) { return a.jc && a.ba === c ? !0 : !1 };
        return b
    };
    G.prototype.findTreeChildrenNodes = G.prototype.KF = function() {
        var a = !0,
            b = this.g;
        null !== b && (a = b.ee);
        var c = b = null,
            d = this.yc.j;
        if (a)
            for (; d.next();) a = d.value, a.jc && a.$ === this && (a = a.ba, null !== b ? b.add(a) : null !== c && c !== a ? (b = new K(G), b.add(c), b.add(a)) : c = a);
        else
            for (; d.next();) a = d.value, a.jc && a.ba === this && (a = a.$, null !== b ? b.add(a) : null !== c && c !== a ? (b = new K(G), b.add(c), b.add(a)) : c = a);
        return null !== b ? b.j : null !== c ? new Ma(c) : Ka
    };
    G.prototype.findTreeParts = function(a) {
        void 0 === a && (a = Infinity);
        D.h(a, "number", G, "findTreeParts:level");
        var b = new L(F);
        Qh(b, this, !1, a, !0);
        return b
    };
    G.prototype.collapseTree = G.prototype.collapseTree = function(a) {
        void 0 === a && (a = 1);
        D.p(a, G, "collapseTree:level");
        1 > a && (a = 1);
        var b = this.g;
        if (null !== b && !b.Ph) {
            b.Ph = !0;
            var c = new L(G);
            c.add(this);
            Ir(this, c, b.ee, a, b.Ra, this, b.rC === El);
            b.Ph = !1
        }
    };

    function Ir(a, b, c, d, e, g, h) {
        if (1 < d)
            for (var k = c ? a.Wx() : a.Yg(); k.next();) {
                var l = k.value;
                l.jc && (l = l.fB(a), null === l || l === a || b.contains(l) || (b.add(l), Ir(l, b, c, d - 1, e, g, h)))
            } else Jr(a, b, c, e, g, h)
    }

    function Jr(a, b, c, d, e, g) {
        for (var h = e === a ? !0 : a.Dc, k = c ? a.Wx() : a.Yg(); k.next();) {
            var l = k.value;
            l.jc && (l = l.fB(a), null === l || l === a || b.contains(l) || (b.add(l), h && (g && ql(d, l, e), l.cl(), l.Pd(!1)), l.Dc && (l.br = l.Dc, Jr(l, b, c, d, e, g))))
        }
        a.Dc = !1
    }
    G.prototype.expandTree = G.prototype.expandTree = function(a) {
        void 0 === a && (a = 2);
        D.p(a, G, "expandTree:level");
        2 > a && (a = 2);
        var b = this.g;
        if (null !== b && !b.Ph) {
            b.Ph = !0;
            var c = new L(G);
            c.add(this);
            Kr(this, c, b.ee, a, b.Ra, this, b.rC === El);
            b.Ph = !1
        }
    };

    function Kr(a, b, c, d, e, g, h) {
        for (var k = g === a ? !1 : a.Dc, l = c ? a.Wx() : a.Yg(); l.next();) {
            var m = l.value;
            m.jc && (k || m.Uf || m.ec(), m = m.fB(a), null !== m && m !== a && !b.contains(m) && (b.add(m), k || (m.Pd(!0), m.cl(), h && pl(e, m, g)), 2 < d || m.br)) && (m.br = !1, Kr(m, b, c, d - 1, e, g, h))
        }
        a.Dc = !0
    }
    D.defineProperty(G, { Dc: "isTreeExpanded" }, function() { return 0 !== (this.Ca & 1) }, function(a) {
        var b = 0 !== (this.Ca & 1);
        if (b !== a) {
            v && D.h(a, "boolean", G, "isTreeExpanded");
            this.Ca ^= 1;
            var c = this.g;
            this.i("isTreeExpanded", b, a);
            b = this.GK;
            if (null !== b) {
                var d = !0;
                null !== c && (d = c.$a, c.$a = !0);
                b(this);
                null !== c && (c.$a = d)
            }
            null !== c && c.na.ub ? this.Pd(a) : a ? this.expandTree() : this.collapseTree()
        }
    });
    D.defineProperty(G, { br: "wasTreeExpanded" }, function() { return 0 !== (this.Ca & 2) }, function(a) {
        var b = 0 !== (this.Ca & 2);
        b !== a && (v && D.h(a, "boolean", G, "wasTreeExpanded"), this.Ca ^= 2, this.i("wasTreeExpanded", b, a))
    });
    D.defineProperty(G, { GK: "treeExpandedChanged" }, function() { return this.Vt }, function(a) {
        var b = this.Vt;
        b !== a && (null !== a && D.h(a, "function", G, "treeExpandedChanged"), this.Vt = a, this.i("treeExpandedChanged", b, a))
    });
    D.defineProperty(G, { Rj: "isTreeLeaf" }, function() { return 0 !== (this.Ca & 4) }, function(a) {
        var b = 0 !== (this.Ca & 4);
        b !== a && (v && D.h(a, "boolean", G, "isTreeLeaf"), this.Ca ^= 4, this.i("isTreeLeaf", b, a))
    });

    function J() {
        F.call(this, sj);
        this.gc = 8;
        this.Cg = null;
        this.gi = "";
        this.Tg = this.cs = null;
        this.Ai = "";
        this.Ut = null;
        this.ir = vj;
        this.Dr = 0;
        this.Gr = vj;
        this.Hr = NaN;
        this.on = Lr;
        this.Jt = .5;
        this.Gf = null;
        this.gd = (new K(N)).freeze();
        this.oh = this.jD = this.dD = this.Oi = this.$i = this.ab = this.Vw = this.Hp = this.ef = null;
        this.uA = new N;
        this.Z = this.AE = this.zE = null
    }
    D.Ta(J, F);
    D.ka("Link", J);
    J.prototype.cloneProtected = function(a) {
        F.prototype.cloneProtected.call(this, a);
        a.gc = this.gc & -113;
        a.gi = this.gi;
        a.cs = this.cs;
        a.Ai = this.Ai;
        a.Ut = this.Ut;
        a.ir = this.ir;
        a.Dr = this.Dr;
        a.Gr = this.Gr;
        a.Hr = this.Hr;
        a.on = this.on;
        a.Jt = this.Jt;
        null !== this.Z && (a.Z = this.Z.copy())
    };
    J.prototype.Ei = function(a) {
        F.prototype.Ei.call(this, a);
        this.gi = a.gi;
        this.Ai = a.Ai;
        a.ef = null;
        a.ec();
        a.Oi = this.Oi
    };
    J.prototype.qc = function(a) { a.Qe === J ? 2 === (a.value & 2) ? this.My = a : a === Uj || a === uj || a === tj ? this.jf = a : a === Mr || a === Nr || a === Or ? this.Yp = a : a !== Lr && a !== vj && D.k("Unknown Link enum value for a Link property: " + a) : F.prototype.qc.call(this, a) };
    var Lr;
    J.Normal = Lr = D.s(J, "Normal", 1);
    J.Orthogonal = D.s(J, "Orthogonal", 2);
    J.AvoidsNodes = D.s(J, "AvoidsNodes", 6);
    var Pr;
    J.AvoidsNodesStraight = Pr = D.s(J, "AvoidsNodesStraight", 7);
    var vj;
    J.None = vj = D.s(J, "None", 0);
    var Uj;
    J.Bezier = Uj = D.s(J, "Bezier", 9);
    var uj;
    J.JumpGap = uj = D.s(J, "JumpGap", 10);
    var tj;
    J.JumpOver = tj = D.s(J, "JumpOver", 11);
    var Mr;
    J.End = Mr = D.s(J, "End", 17);
    var Nr;
    J.Scale = Nr = D.s(J, "Scale", 18);
    var Or;
    J.Stretch = Or = D.s(J, "Stretch", 19);
    var wq;
    J.OrientAlong = wq = D.s(J, "OrientAlong", 21);
    var Xp;
    J.OrientPlus90 = Xp = D.s(J, "OrientPlus90", 22);
    var Zp;
    J.OrientMinus90 = Zp = D.s(J, "OrientMinus90", 23);
    var Qr;
    J.OrientOpposite = Qr = D.s(J, "OrientOpposite", 24);
    var Rr;
    J.OrientUpright = Rr = D.s(J, "OrientUpright", 25);
    var Yp;
    J.OrientPlus90Upright = Yp = D.s(J, "OrientPlus90Upright", 26);
    var $p;
    J.OrientMinus90Upright = $p = D.s(J, "OrientMinus90Upright", 27);
    var aq;
    J.OrientUpright45 = aq = D.s(J, "OrientUpright45", 28);
    f = J.prototype;
    f.ae = function() { null === this.Z && (this.Z = new Eo) };
    f.ym = function() {
        var a = this.$;
        if (null !== a) {
            var b = a.findVisibleNode();
            null !== b && (a = b);
            if (Om(a) || Pm(a)) return !1
        }
        a = this.ba;
        return null !== a && (b = a.findVisibleNode(), null !== b && (a = b), Om(a) || Pm(a)) ? !1 : !0
    };
    f.bC = function() { return !1 };
    f.cC = function() {};
    f.qe = function() { return !1 };
    J.prototype.computeAngle = function(a, b, c) { return J.computeAngle(b, c) };
    J.computeAngle = function(a, b) {
        var c = 0;
        switch (a) {
            default:
                case vj:
                c = 0;
            break;
            case wq:
                    c = b;
                break;
            case Xp:
                    c = b + 90;
                break;
            case Zp:
                    c = b - 90;
                break;
            case Qr:
                    c = b + 180;
                break;
            case Rr:
                    c = Re(b);90 < c && 270 > c && (c -= 180);
                break;
            case Yp:
                    c = Re(b + 90);90 < c && 270 > c && (c -= 180);
                break;
            case $p:
                    c = Re(b - 90);90 < c && 270 > c && (c -= 180);
                break;
            case aq:
                    c = Re(b);
                if (45 < c && 135 > c || 225 < c && 315 > c) return 0;90 < c && 270 > c && (c -= 180)
        }
        return Re(c)
    };
    D.defineProperty(J, { $: "fromNode" }, function() { return this.Cg }, function(a) {
        var b = this.Cg;
        if (b !== a) {
            v && null !== a && D.l(a, G, J, "fromNode");
            var c = this.oc;
            null !== b && (this.Tg !== b && Fr(b, this, c), Sr(this), this.L(en));
            this.Cg = a;
            null !== a && this.Pd(a.isVisible());
            this.$i = null;
            this.ec();
            var d = this.g;
            if (null !== d) {
                var e = this.data,
                    g = d.ea;
                if (null !== e)
                    if (g instanceof Y) {
                        var h = null !== a ? a.data : null;
                        g.YB(e, g.zb(h))
                    } else g instanceof Bg && (h = null !== a ? a.data : null, d.ee ? g.Ii(e, g.zb(h)) : (null !== b && g.Ii(b.data, void 0), g.Ii(h, g.zb(null !==
                        this.Tg ? this.Tg.data : null))))
            }
            e = this.oc;
            g = this.NF;
            null !== g && (h = !0, null !== d && (h = d.$a, d.$a = !0), g(this, c, e), null !== d && (d.$a = h));
            null !== a && (this.Tg !== a && Er(a, this, e), Tr(this), this.L(Wm));
            this.i("fromNode", b, a);
            An(this)
        }
    });
    D.defineProperty(J, { hg: "fromPortId" }, function() { return this.gi }, function(a) {
        var b = this.gi;
        if (b !== a) {
            v && D.h(a, "string", J, "fromPortId");
            var c = this.$,
                d = this.oc;
            null !== d && Dr(c, d);
            Sr(this);
            this.gi = a;
            var e = this.oc;
            null !== e && Dr(c, e);
            c = this.g;
            if (null !== c) {
                var g = this.data,
                    h = c.ea;
                null !== g && h instanceof Y && h.ZB(g, a)
            }
            d !== e && (this.$i = null, this.ec(), g = this.NF, null !== g && (h = !0, null !== c && (h = c.$a, c.$a = !0), g(this, d, e), null !== c && (c.$a = h)));
            Tr(this);
            this.i("fromPortId", b, a)
        }
    });
    D.w(J, { oc: "fromPort" }, function() { var a = this.Cg; return null === a ? null : a.aB(this.gi) });
    D.defineProperty(J, { NF: "fromPortChanged" }, function() { return this.cs }, function(a) {
        var b = this.cs;
        b !== a && (null !== a && D.h(a, "function", J, "fromPortChanged"), this.cs = a, this.i("fromPortChanged", b, a))
    });
    D.defineProperty(J, { ba: "toNode" }, function() { return this.Tg }, function(a) {
        var b = this.Tg;
        if (b !== a) {
            v && null !== a && D.l(a, G, J, "toNode");
            var c = this.Gc;
            null !== b && (this.Cg !== b && Fr(b, this, c), Sr(this), this.L(en));
            this.Tg = a;
            null !== a && this.Pd(a.isVisible());
            this.$i = null;
            this.ec();
            var d = this.g;
            if (null !== d) {
                var e = this.data,
                    g = d.ea;
                if (null !== e)
                    if (g instanceof Y) {
                        var h = null !== a ? a.data : null;
                        g.dC(e, g.zb(h))
                    } else g instanceof Bg && (h = null !== a ? a.data : null, d.ee ? (null !== b && g.Ii(b.data, void 0), g.Ii(h, g.zb(null !== this.Cg ? this.Cg.data :
                        null))) : g.Ii(e, g.zb(h)))
            }
            e = this.Gc;
            g = this.oH;
            null !== g && (h = !0, null !== d && (h = d.$a, d.$a = !0), g(this, c, e), null !== d && (d.$a = h));
            null !== a && (this.Cg !== a && Er(a, this, e), Tr(this), this.L(Wm));
            this.i("toNode", b, a);
            An(this)
        }
    });
    D.defineProperty(J, { jh: "toPortId" }, function() { return this.Ai }, function(a) {
        var b = this.Ai;
        if (b !== a) {
            v && D.h(a, "string", J, "toPortId");
            var c = this.ba,
                d = this.Gc;
            null !== d && Dr(c, d);
            Sr(this);
            this.Ai = a;
            var e = this.Gc;
            null !== e && Dr(c, e);
            c = this.g;
            if (null !== c) {
                var g = this.data,
                    h = c.ea;
                null !== g && h instanceof Y && h.eC(g, a)
            }
            d !== e && (this.$i = null, this.ec(), g = this.oH, null !== g && (h = !0, null !== c && (h = c.$a, c.$a = !0), g(this, d, e), null !== c && (c.$a = h)));
            Tr(this);
            this.i("toPortId", b, a)
        }
    });
    D.w(J, { Gc: "toPort" }, function() { var a = this.Tg; return null === a ? null : a.aB(this.Ai) });
    D.defineProperty(J, { oH: "toPortChanged" }, function() { return this.Ut }, function(a) {
        var b = this.Ut;
        b !== a && (null !== a && D.h(a, "function", J, "toPortChanged"), this.Ut = a, this.i("toPortChanged", b, a))
    });
    D.defineProperty(J, { Gb: "fromSpot" }, function() { return null !== this.Z ? this.Z.ok : Vc }, function(a) {
        this.ae();
        var b = this.Z.ok;
        b.O(a) || (v && D.l(a, S, J, "fromSpot"), a = a.V(), this.Z.ok = a, this.i("fromSpot", b, a), this.ec())
    });
    D.defineProperty(J, { rm: "fromEndSegmentLength" }, function() { return null !== this.Z ? this.Z.mk : NaN }, function(a) {
        this.ae();
        var b = this.Z.mk;
        b !== a && (v && D.h(a, "number", J, "fromEndSegmentLength"), 0 > a && D.ua(a, ">= 0", J, "fromEndSegmentLength"), this.Z.mk = a, this.i("fromEndSegmentLength", b, a), this.ec())
    });
    D.defineProperty(J, { zu: "fromEndSegmentDirection" }, function() { return null !== this.Z ? this.Z.lk : yr }, function(a) {
        this.ae();
        var b = this.Z.lk;
        b !== a && (D.On("Link.fromEndSegmentDirection", "2.0"), v && D.Da(a, G, J, "fromEndSegmentDirection"), this.Z.lk = a, this.i("fromEndSegmentDirection", b, a), this.ec())
    });
    D.defineProperty(J, { Au: "fromShortLength" }, function() { return null !== this.Z ? this.Z.nk : NaN }, function(a) {
        this.ae();
        var b = this.Z.nk;
        b !== a && (v && D.h(a, "number", J, "fromShortLength"), this.Z.nk = a, this.i("fromShortLength", b, a), this.ec())
    });
    D.defineProperty(J, { Hb: "toSpot" }, function() { return null !== this.Z ? this.Z.Mk : Vc }, function(a) {
        this.ae();
        var b = this.Z.Mk;
        b.O(a) || (v && D.l(a, S, J, "toSpot"), a = a.V(), this.Z.Mk = a, this.i("toSpot", b, a), this.ec())
    });
    D.defineProperty(J, { Hm: "toEndSegmentLength" }, function() { return null !== this.Z ? this.Z.Kk : NaN }, function(a) {
        this.ae();
        var b = this.Z.Kk;
        b !== a && (v && D.h(a, "number", J, "toEndSegmentLength"), 0 > a && D.ua(a, ">= 0", J, "toEndSegmentLength"), this.Z.Kk = a, this.i("toEndSegmentLength", b, a), this.ec())
    });
    D.defineProperty(J, { uv: "toEndSegmentDirection" }, function() { return null !== this.Z ? this.Z.Jk : yr }, function(a) {
        this.ae();
        var b = this.Z.Jk;
        b !== a && (D.On("Link.toEndSegmentDirection", "2.0"), v && D.Da(a, G, J, "toEndSegmentDirection"), this.Z.Jk = a, this.i("toEndSegmentDirection", b, a), this.ec())
    });
    D.defineProperty(J, { vv: "toShortLength" }, function() { return null !== this.Z ? this.Z.Lk : NaN }, function(a) {
        this.ae();
        var b = this.Z.Lk;
        b !== a && (v && D.h(a, "number", J, "toShortLength"), this.Z.Lk = a, this.i("toShortLength", b, a), this.ec())
    });

    function An(a) {
        var b = a.$,
            c = a.ba,
            d = null,
            b = d = null !== b ? null !== c ? b.LI(c) : b.Ka : null !== c ? c.Ka : null,
            c = a.Al;
        if (c !== b) {
            null !== c && sr(c, a);
            a.Al = b;
            null !== b && tr(b, a);
            var e = a.kF;
            if (null !== e) {
                var g = !0,
                    h = a.g;
                null !== h && (g = h.$a, h.$a = !0);
                e(a, c, b);
                null !== h && (h.$a = g)
            }!a.Uf || a.zE !== c && a.AE !== c || a.ec()
        }
        if (a.pJ)
            for (a = a.Af; a.next();) a.value.Ka = d
    }
    J.prototype.cl = function() {
        var a = this.Ka;
        null !== a && this.$ !== a && this.ba !== a && a.Jx && F.prototype.cl.call(this)
    };
    J.prototype.getOtherNode = J.prototype.fB = function(a) { v && D.l(a, G, J, "getOtherNode:node"); var b = this.$; return a === b ? this.ba : b };
    J.prototype.getOtherPort = function(a) { v && D.l(a, O, J, "getOtherPort:port"); var b = this.oc; return a === b ? this.Gc : b };
    D.w(J, { pJ: "isLabeledLink" }, function() { return null === this.Gf ? !1 : 0 < this.Gf.count });
    D.w(J, { Af: "labelNodes" }, function() { return null === this.Gf ? Ka : this.Gf.j });

    function Gr(a, b) {
        null === a.Gf && (a.Gf = new L(G));
        a.Gf.add(b);
        a.K()
    }
    J.prototype.Fu = function(a) {
        F.prototype.Fu.call(this, a);
        Ur(this) && Oj(this, this.aa);
        if (!a) {
            a = this.Cg;
            var b = null;
            null !== a && (b = this.oc, Er(a, this, b));
            var c = this.Tg,
                d = null;
            null !== c && (d = this.Gc, c === a && d === b || Er(c, this, d));
            Tr(this)
        }
    };
    J.prototype.Gu = function(a) {
        F.prototype.Gu.call(this, a);
        Ur(this) && Oj(this, this.aa);
        if (!a) {
            a = this.Cg;
            var b = null;
            null !== a && (b = this.oc, Fr(a, this, b));
            var c = this.Tg,
                d = null;
            null !== c && (d = this.Gc, c === a && d === b || Fr(c, this, d));
            Sr(this)
        }
    };
    J.prototype.Nn = function() {
        this.Uf = !0;
        if (null !== this.Gf) {
            var a = this.g;
            if (null !== a)
                for (var b = this.Gf.copy().j; b.next();) a.remove(b.value)
        }
        b = this.data;
        null !== b && (a = this.g, null !== a && (a = a.ea, a instanceof Y ? a.Jy(b) : a instanceof Bg && a.Ii(b, void 0)))
    };
    J.prototype.updateRelationshipsFromData = function() {
        var a = this.data;
        if (null !== a) {
            var b = this.g;
            if (null !== b) {
                var c = b.ea;
                if (c instanceof Y) {
                    var d = c.tm(a);
                    this.$ = d = b.Se(d);
                    d = c.um(a);
                    this.ba = d = b.Se(d);
                    a = c.$k(a);
                    if (0 < a.length || 0 < this.Af.count) {
                        if (1 === a.length && 1 === this.Af.count) {
                            var d = a[0],
                                e = this.Af.first();
                            if (c.zb(e.data) === d) return
                        }
                        var d = (new L).Vc(a),
                            g = new L;
                        this.Af.each(function(a) { null !== a.data && (a = c.zb(a.data), void 0 !== a && g.add(a)) });
                        a = g.copy();
                        a.Iy(d);
                        d = d.copy();
                        d.Iy(g);
                        if (0 < a.count || 0 < d.count) {
                            var h =
                                this;
                            a.each(function(a) {
                                a = b.Se(a);
                                null !== a && a.Xb === h && (a.Xb = null)
                            });
                            d.each(function(a) {
                                a = b.Se(a);
                                null !== a && a.Xb !== h && (a.Xb = h)
                            })
                        }
                    }
                }
            }
        }
    };
    J.prototype.move = function(a) {
        var b = this.position,
            c = b.x;
        isNaN(c) && (c = 0);
        b = b.y;
        isNaN(b) && (b = 0);
        c = a.x - c;
        b = a.y - b;
        F.prototype.move.call(this, a);
        this.gl(c, b);
        for (a = this.Af; a.next();) {
            var d = a.value,
                e = d.position;
            d.moveTo(e.x + c, e.y + b)
        }
    };
    D.defineProperty(J, { cK: "relinkableFrom" }, function() { return 0 !== (this.gc & 1) }, function(a) {
        var b = 0 !== (this.gc & 1);
        b !== a && (v && D.h(a, "boolean", J, "relinkableFrom"), this.gc ^= 1, this.i("relinkableFrom", b, a), this.pe())
    });
    D.defineProperty(J, { dK: "relinkableTo" }, function() { return 0 !== (this.gc & 2) }, function(a) {
        var b = 0 !== (this.gc & 2);
        b !== a && (v && D.h(a, "boolean", J, "relinkableTo"), this.gc ^= 2, this.i("relinkableTo", b, a), this.pe())
    });
    J.prototype.canRelinkFrom = function() {
        if (!this.cK) return !1;
        var a = this.layer;
        if (null === a) return !0;
        if (!a.Dn) return !1;
        a = a.g;
        return null === a || a.Dn ? !0 : !1
    };
    J.prototype.canRelinkTo = function() {
        if (!this.dK) return !1;
        var a = this.layer;
        if (null === a) return !0;
        if (!a.Dn) return !1;
        a = a.g;
        return null === a || a.Dn ? !0 : !1
    };
    D.defineProperty(J, { jv: "resegmentable" }, function() { return 0 !== (this.gc & 4) }, function(a) {
        var b = 0 !== (this.gc & 4);
        b !== a && (v && D.h(a, "boolean", J, "resegmentable"), this.gc ^= 4, this.i("resegmentable", b, a), this.pe())
    });
    D.defineProperty(J, { jc: "isTreeLink" }, function() { return 0 !== (this.gc & 8) }, function(a) {
        var b = 0 !== (this.gc & 8);
        b !== a && (v && D.h(a, "boolean", J, "isTreeLink"), this.gc ^= 8, this.i("isTreeLink", b, a), null !== this.$ && Ln(this.$), null !== this.ba && Ln(this.ba))
    });
    D.w(J, { path: "path" }, function() { var a = this.Ld(); return a instanceof z ? a : null });
    D.w(J, { so: "routeBounds" }, function() {
        this.zo();
        var a = new C;
        var b = Infinity,
            c = Infinity,
            d = this.ta;
        if (0 === d) a.n(NaN, NaN, 0, 0);
        else {
            if (1 === d) d = this.m(0), b = Math.min(d.x, b), c = Math.min(d.y, c), a.n(d.x, d.y, 0, 0);
            else if (2 === d) {
                var e = this.m(0),
                    g = this.m(1),
                    b = Math.min(e.x, g.x),
                    c = Math.min(e.y, g.y);
                a.n(e.x, e.y, 0, 0);
                a.Mi(g)
            } else if (this.computeCurve() === Uj && 3 <= d && !this.ic)
                if (e = this.m(0), b = e.x, c = e.y, a.n(b, c, 0, 0), 3 === d) d = this.m(1), b = Math.min(d.x, b), c = Math.min(d.y, c), g = this.m(2), b = Math.min(g.x, b), c = Math.min(g.y, c), Ae(e.x,
                    e.y, d.x, d.y, d.x, d.y, g.x, g.y, .5, a);
                else
                    for (var h = 3; h < d; h += 3) {
                        var k = this.m(h - 2);
                        h + 3 >= d && (h = d - 1);
                        var l = this.m(h - 1),
                            g = this.m(h);
                        Ae(e.x, e.y, k.x, k.y, l.x, l.y, g.x, g.y, .5, a);
                        b = Math.min(g.x, b);
                        c = Math.min(g.y, c);
                        e = g
                    } else
                        for (e = this.m(0), g = this.m(1), b = Math.min(e.x, g.x), c = Math.min(e.y, g.y), a.n(e.x, e.y, 0, 0), a.Mi(g), h = 2; h < d; h++) e = this.m(h), b = Math.min(e.x, b), c = Math.min(e.y, c), a.Mi(e);
            this.uA.n(b - a.x, c - a.y)
        }
        return this.Vw = a
    });
    D.w(J, { xG: "midPoint" }, function() { this.zo(); return this.computeMidPoint(new N) });
    J.prototype.computeMidPoint = function(a) {
        var b = this.ta;
        if (0 === b) return a.assign(he), a;
        if (1 === b) return a.assign(this.m(0)), a;
        if (2 === b) {
            var c = this.m(0),
                d = this.m(1);
            a.n((c.x + d.x) / 2, (c.y + d.y) / 2);
            return a
        }
        if (this.computeCurve() === Uj && 3 <= b && !this.ic) {
            if (3 === b) return this.m(1);
            var c = (b - 1) / 3 | 0,
                e = 3 * (c / 2 | 0);
            if (1 === c % 2) {
                var c = this.m(e),
                    d = this.m(e + 1),
                    g = this.m(e + 2),
                    e = this.m(e + 3),
                    b = d.x,
                    h = d.y,
                    d = g.x,
                    k = g.y,
                    g = (b + d) / 2,
                    l = (h + k) / 2,
                    h = ((c.y + h) / 2 + l) / 2,
                    k = (l + (k + e.y) / 2) / 2;
                a.x = (((c.x + b) / 2 + g) / 2 + (g + (d + e.x) / 2) / 2) / 2;
                a.y = (h + k) / 2
            } else a.assign(this.m(e));
            return a
        }
        e = 0;
        g = D.mb();
        for (h = 0; h < b - 1; h++) c = 0, c = this.m(h), d = this.m(h + 1), Eb(c.x, d.x) ? (c = d.y - c.y, 0 > c && (c = -c)) : Eb(c.y, d.y) ? (c = d.x - c.x, 0 > c && (c = -c)) : c = Math.sqrt(c.Kf(d)), g.push(c), e += c;
        for (d = h = c = 0; c < e / 2 && h < b;) {
            d = g[h];
            if (c + d > e / 2) break;
            c += d;
            h++
        }
        D.ya(g);
        b = this.m(h);
        g = this.m(h + 1);
        b.x === g.x ? b.y > g.y ? a.n(b.x, b.y - (e / 2 - c)) : a.n(b.x, b.y + (e / 2 - c)) : b.y === g.y ? b.x > g.x ? a.n(b.x - (e / 2 - c), b.y) : a.n(b.x + (e / 2 - c), b.y) : (c = (e / 2 - c) / d, a.n(b.x + c * (g.x - b.x), b.y + c * (g.y - b.y)));
        return a
    };
    D.w(J, { wG: "midAngle" }, function() { this.zo(); return this.computeMidAngle() });
    J.prototype.computeMidAngle = function() {
        var a = this.ta;
        if (2 > a) return NaN;
        if (this.computeCurve() === Uj && 4 <= a && !this.ic) {
            var b = (a - 1) / 3 | 0,
                c = 3 * (b / 2 | 0);
            if (1 === b % 2) {
                var c = Math.floor(c),
                    b = this.m(c),
                    d = this.m(c + 1),
                    a = this.m(c + 2),
                    c = this.m(c + 3),
                    e = d.x,
                    d = d.y,
                    g = a.x,
                    a = a.y,
                    h = (e + g) / 2,
                    k = (d + a) / 2;
                return wb(((b.x + e) / 2 + h) / 2, ((b.y + d) / 2 + k) / 2, (h + (g + c.x) / 2) / 2, (k + (a + c.y) / 2) / 2)
            }
            if (0 < c && c + 1 < a) return b = this.m(c - 1), d = this.m(c + 1), b.Wb(d)
        }
        c = a / 2 | 0;
        if (0 === a % 2) return b = this.m(c - 1), d = this.m(c), 4 <= a && b.Wc(d) ? (b = this.m(c - 2), a = this.m(c + 1),
            c = b.Kf(d), e = d.Kf(a), c > e + 10 ? b.Wb(d) : e > c + 10 ? d.Wb(a) : b.Wb(a)) : null === this.ab || this.ic ? b.Wb(d) : this.ab.OF(.5);
        if (null !== this.ab && !this.ic) return this.ab.OF(.5);
        b = this.m(c - 1);
        d = this.m(c);
        a = this.m(c + 1);
        c = b.Kf(d);
        e = d.Kf(a);
        return c > e + 10 ? b.Wb(d) : e > c + 10 ? d.Wb(a) : b.Wb(a)
    };
    D.defineProperty(J, { points: "points" }, function() { return this.gd }, function(a) {
        var b = this.gd;
        if (b !== a) {
            var c = null;
            if (Array.isArray(a)) {
                var d = 0 === a.length % 2;
                if (d)
                    for (var e = 0; e < a.length; e++)
                        if ("number" !== typeof a[e] || isNaN(a[e])) { d = !1; break }
                if (d)
                    for (c = new K(N), d = 0; d < a.length / 2; d++) e = (new N(a[2 * d], a[2 * d + 1])).freeze(), c.add(e);
                else {
                    e = !0;
                    for (d = 0; d < a.length; d++) { var g = a[d]; if (!D.Qa(g) || "number" !== typeof g.x || isNaN(g.x) || "number" !== typeof g.y || isNaN(g.y)) { e = !1; break } }
                    if (e)
                        for (c = new K(N), d = 0; d < a.length; d++) e =
                            a[d], c.add((new N(e.x, e.y)).freeze());
                    else D.k("Link.points array must contain only an even number of numbers or objects with x and y properties, not: " + a)
                }
            } else if (a instanceof K)
                for (c = a.copy(), a = c.j; a.next();) a.value.freeze();
            else D.k("Link.points value is not an instance of List or Array: " + a);
            c.freeze();
            this.gd = c;
            this.Te();
            this.K();
            Vr(this);
            a = this.g;
            null !== a && (a.Zn || a.na.ub || a.ty.add(this), a.Ra.zc && (this.Hp = c));
            this.i("points", b, c)
        }
    });
    D.w(J, { ta: "pointsCount" }, function() { return this.gd.count });
    J.prototype.getPoint = J.prototype.m = function(a) { return this.gd.o[a] };
    J.prototype.setPoint = J.prototype.gh = function(a, b) {
        v && (D.l(b, N, J, "setPoint"), b.H() || D.k("Link.setPoint called with a Point that does not have real numbers: " + b.toString()));
        null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
        this.gd.ug(a, b)
    };
    J.prototype.setPointAt = J.prototype.ia = function(a, b, c) {
        v && (D.p(b, J, "setPointAt:x"), D.p(c, J, "setPointAt:y"));
        null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
        this.gd.ug(a, new N(b, c))
    };
    J.prototype.insertPoint = function(a, b) {
        v && (D.l(b, N, J, "insertPoint"), b.H() || D.k("Link.insertPoint called with a Point that does not have real numbers: " + b.toString()));
        null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
        this.gd.be(a, b)
    };
    J.prototype.insertPointAt = J.prototype.B = function(a, b, c) {
        v && (D.p(b, J, "insertPointAt:x"), D.p(c, J, "insertPointAt:y"));
        null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
        this.gd.be(a, new N(b, c))
    };
    J.prototype.addPoint = J.prototype.Ci = function(a) {
        v && (D.l(a, N, J, "addPoint"), a.H() || D.k("Link.addPoint called with a Point that does not have real numbers: " + a.toString()));
        null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
        this.gd.add(a)
    };
    J.prototype.addPointAt = J.prototype.Bj = function(a, b) {
        v && (D.p(a, J, "insertPointAt:x"), D.p(b, J, "insertPointAt:y"));
        null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
        this.gd.add(new N(a, b))
    };
    J.prototype.removePoint = J.prototype.KG = function(a) {
        null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
        this.gd.pd(a)
    };
    J.prototype.clearPoints = J.prototype.dq = function() {
        null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
        this.gd.clear()
    };
    J.prototype.movePoints = J.prototype.gl = function(a, b) {
        if (0 !== a || 0 !== b) {
            for (var c = this.Uf, d = new K(N), e = this.gd.j; e.next();) {
                var g = e.value;
                d.add((new N(g.x + a, g.y + b)).freeze())
            }
            d.freeze();
            e = this.gd;
            this.gd = d;
            this.K();
            c && Vr(this);
            c = this.g;
            null !== c && c.Ra.zc && (this.Hp = d);
            this.i("points", e, d)
        }
    };
    J.prototype.startRoute = J.prototype.Dm = function() { null === this.ef && (this.ef = this.gd, this.gd = this.gd.copy()) };
    J.prototype.commitRoute = J.prototype.Ej = function() {
        if (null !== this.ef) {
            for (var a = this.ef, b = this.gd, c = Infinity, d = Infinity, e = a.o, g = e.length, h = 0; h < g; h++) var k = e[h],
                c = Math.min(k.x, c),
                d = Math.min(k.y, d);
            for (var l = Infinity, m = Infinity, n = b.o, p = n.length, h = 0; h < p; h++) k = n[h], l = Math.min(k.x, l), m = Math.min(k.y, m), k.freeze();
            b.freeze();
            if (p === g)
                for (h = 0; h < p; h++) {
                    if (g = e[h], k = n[h], g.x - c !== k.x - l || g.y - d !== k.y - m) {
                        this.K();
                        this.Te();
                        break
                    }
                } else this.K(), this.Te();
            this.ef = null;
            c = this.g;
            null !== c && c.Ra.zc && (this.Hp = b);
            Vr(this);
            this.i("points", a, b)
        }
    };
    J.prototype.rollbackRoute = J.prototype.hK = function() { null !== this.ef && (this.gd = this.ef, this.ef = null) };

    function Vr(a) { 0 === a.gd.count ? a.Uf = !1 : (a.Uf = !0, a.iq = a.m(0), a.jq = a.m(a.ta - 1), Wr(a, !1)) }
    J.prototype.invalidateRoute = J.prototype.ec = function() {
        if (!this.Ji) {
            var a = this.g;
            a && (a.ty.contains(this) || a.na.ub || a.Ra.vJ && !a.Ra.nf) || (a = this.path, null !== a && (this.Uf = !1, this.K(), a.K()))
        }
    };
    D.defineProperty(J, { Uf: null }, function() { return 0 !== (this.gc & 16) }, function(a) { 0 !== (this.gc & 16) !== a && (this.gc ^= 16) });
    D.defineProperty(J, { Ji: "suspendsRouting" }, function() { return 0 !== (this.gc & 32) }, function(a) { 0 !== (this.gc & 32) !== a && (this.gc ^= 32) });
    D.defineProperty(J, { KA: null }, function() { return 0 !== (this.gc & 64) }, function(a) { 0 !== (this.gc & 64) !== a && (this.gc ^= 64) });
    D.defineProperty(J, { iq: "defaultFromPoint" }, function() { return this.dD }, function(a) { this.dD = a.copy() });
    D.defineProperty(J, { jq: "defaultToPoint" }, function() { return this.jD }, function(a) { this.jD = a.copy() });
    J.prototype.updateRoute = J.prototype.zo = function() { if (!this.Uf && !this.KA) { var a = !0; try { this.KA = !0, this.Dm(), a = this.computePoints() } finally { this.KA = !1, a ? this.Ej() : this.hK() } } };
    J.prototype.computePoints = function() {
        var a = this.g;
        if (null === a) return !1;
        var b = this.$,
            c = null;
        null === b ? (a.Vl || (a.tt = new z, a.tt.Ea = Xd, a.tt.lb = 0, a.Vl = new G, a.Vl.add(a.tt), a.Vl.kf()), this.iq && (a.Vl.position = a.Vl.location = this.iq, a.Vl.kf(), b = a.Vl, c = a.tt)) : c = this.oc;
        if (null !== c && !b.isVisible()) {
            var d = b.findVisibleNode();
            null !== d && d !== b ? (b = d, c = d.port) : b = d
        }
        this.zE = b;
        if (null === b || !b.location.H()) return !1;
        for (; !(null === c || c.aa.H() && c.Sj());) c = c.R;
        if (null === c) return !1;
        var e = this.ba,
            g = null;
        null === e ? (a.Wl || (a.ut =
            new z, a.ut.Ea = Xd, a.ut.lb = 0, a.Wl = new G, a.Wl.add(a.ut), a.Wl.kf()), this.jq && (a.Wl.position = a.Wl.location = this.jq, a.Wl.kf(), e = a.Wl, g = a.ut)) : g = this.Gc;
        null === g || e.isVisible() || (a = e.findVisibleNode(), null !== a && a !== e ? (e = a, g = a.port) : e = a);
        this.AE = e;
        if (null === e || !e.location.H()) return !1;
        for (; !(null === g || g.aa.H() && g.Sj());) g = g.R;
        if (null === g) return !1;
        var h = this.ta,
            d = this.computeSpot(!0, c),
            a = this.computeSpot(!1, g),
            k = d === dc,
            l = a === dc,
            m = c === g && null !== c,
            n = this.ic,
            p = this.jf === Uj;
        this.$i = m && !n ? p = !0 : !1;
        var q = this.Yp ===
            vj || m;
        if (!n && !m && k && l) {
            if (k = !1, !q && 3 <= h && (q = this.getLinkPoint(b, c, d, !0, !1, e, g), l = this.getLinkPoint(e, g, a, !1, !1, b, c), k = this.adjustPoints(0, q, h - 1, l)) && (q = this.getLinkPoint(b, c, d, !0, !1, e, g), l = this.getLinkPoint(e, g, a, !1, !1, b, c), this.adjustPoints(0, q, h - 1, l)), !k)
                if (this.dq(), p) {
                    var h = this.getLinkPoint(b, c, d, !0, !1, e, g),
                        q = this.getLinkPoint(e, g, a, !1, !1, b, c),
                        k = q.x - h.x,
                        l = q.y - h.y,
                        m = this.computeCurviness(),
                        p = n = 0,
                        r = h.x + k / 3,
                        s = h.y + l / 3,
                        u = r,
                        t = s;
                    Q(l, 0) ? t = 0 < k ? t - m : t + m : (n = -k / l, p = Math.sqrt(m * m / (n * n + 1)), 0 > m && (p = -p), u = (0 >
                        l ? -1 : 1) * p + r, t = n * (u - r) + s);
                    var r = h.x + 2 * k / 3,
                        s = h.y + 2 * l / 3,
                        y = r,
                        w = s;
                    Q(l, 0) ? w = 0 < k ? w - m : w + m : (y = (0 > l ? -1 : 1) * p + r, w = n * (y - r) + s);
                    this.dq();
                    this.Ci(h);
                    this.Bj(u, t);
                    this.Bj(y, w);
                    this.Ci(q);
                    this.gh(0, this.getLinkPoint(b, c, d, !0, !1, e, g));
                    this.gh(3, this.getLinkPoint(e, g, a, !1, !1, b, c))
                } else d = this.getLinkPoint(b, c, d, !0, !1, e, g), a = this.getLinkPoint(e, g, a, !1, !1, b, c), this.hasCurviness() ? (q = a.x - d.x, e = a.y - d.y, g = this.computeCurviness(), b = d.x + q / 2, c = d.y + e / 2, h = b, k = c, Q(e, 0) ? k = 0 < q ? k - g : k + g : (q = -q / e, h = Math.sqrt(g * g / (q * q + 1)), 0 > g && (h = -h),
                    h = (0 > e ? -1 : 1) * h + b, k = q * (h - b) + c), this.Ci(d), this.Bj(h, k)) : this.Ci(d), this.Ci(a)
        } else {
            p = this.Nj;
            q && (n && p || m) && this.dq();
            var A = m ? this.computeCurviness() : 0,
                p = this.getLinkPoint(b, c, d, !0, n, e, g),
                r = u = s = 0;
            if (n || !k || m)
                if (t = this.computeEndSegmentLength(b, c, d, !0), r = this.getLinkDirection(b, c, p, d, !0, n, e, g), m && (k || d.O(a) || !n && 1 === d.x + a.x && 1 === d.y + a.y) && (r -= n ? 90 : 30, 0 > A && (r -= 180)), 0 > r ? r += 360 : 360 <= r && (r -= 360), m && (t += Math.abs(A) * (n ? 1 : 2)), 0 === r ? s = t : 90 === r ? u = t : 180 === r ? s = -t : 270 === r ? u = -t : (s = t * Math.cos(r * Math.PI / 180), u = t *
                        Math.sin(r * Math.PI / 180)), d.de() && m) {
                    var B = c.fb(mc, D.P()),
                        P = D.Fb(B.x + 1E3 * s, B.y + 1E3 * u);
                    this.getLinkPointFromPoint(b, c, B, P, !0, p);
                    D.A(B);
                    D.A(P)
                }
            var t = this.getLinkPoint(e, g, a, !1, n, b, c),
                H = w = y = 0;
            if (n || !l || m) B = this.computeEndSegmentLength(e, g, a, !1), H = this.getLinkDirection(e, g, t, a, !1, n, b, c), m && (l || d.O(a) || !n && 1 === d.x + a.x && 1 === d.y + a.y) && (H += n ? 0 : 30, 0 > A && (H += 180)), 0 > H ? H += 360 : 360 <= H && (H -= 360), m && (B += Math.abs(A) * (n ? 1 : 2)), 0 === H ? y = B : 90 === H ? w = B : 180 === H ? y = -B : 270 === H ? w = -B : (y = B * Math.cos(H * Math.PI / 180), w = B * Math.sin(H *
                Math.PI / 180)), a.de() && m && (B = g.fb(mc, D.P()), P = D.Fb(B.x + 1E3 * y, B.y + 1E3 * w), this.getLinkPointFromPoint(e, g, B, P, !1, t), D.A(B), D.A(P));
            a = p;
            if (n || !k || m) a = new N(p.x + s, p.y + u);
            d = t;
            if (n || !l || m) d = new N(t.x + y, t.y + w);
            !q && !n && k && 3 < h && this.adjustPoints(0, p, h - 2, d) ? this.gh(h - 1, t) : !q && !n && l && 3 < h && this.adjustPoints(1, a, h - 1, t) ? this.gh(0, p) : !q && (n ? 6 <= h : 4 < h) && this.adjustPoints(1, a, h - 2, d) ? (this.gh(0, p), this.gh(h - 1, t)) : (this.dq(), this.Ci(p), (n || !k || m) && this.Ci(a), n && this.addOrthoPoints(a, r, d, H, b, e), (n || !l || m) && this.Ci(d), this.Ci(t))
        }
        return !0
    };

    function Xr(a, b) { Math.abs(b.x - a.x) > Math.abs(b.y - a.y) ? (b.x = b.x >= a.x ? a.x + 9E9 : a.x - 9E9, b.y = a.y) : (b.y = b.y >= a.y ? a.y + 9E9 : a.y - 9E9, b.x = a.x); return b }
    J.prototype.getLinkPointFromPoint = function(a, b, c, d, e, g) {
        void 0 === g && (g = new N);
        if (null === a || null === b) return g.assign(c), g;
        a.isVisible() || (e = a.findVisibleNode(), null !== e && e !== a && (b = e.port));
        var h = e = 0,
            k = 0,
            l = 0;
        a = null;
        e = b.R;
        null === e || e.kh() || (e = e.R);
        if (null === e) e = d.x, h = d.y, k = c.x, l = c.y;
        else {
            a = e.Hh;
            e = 1 / (a.m11 * a.m22 - a.m12 * a.m21);
            var k = a.m22 * e,
                l = -a.m12 * e,
                m = -a.m21 * e,
                n = a.m11 * e,
                p = e * (a.m21 * a.dy - a.m22 * a.dx),
                q = e * (a.m12 * a.dx - a.m11 * a.dy);
            e = d.x * k + d.y * m + p;
            h = d.x * l + d.y * n + q;
            k = c.x * k + c.y * m + p;
            l = c.x * l + c.y * n + q
        }
        b.Tn(e, h, k, l,
            g);
        null !== a && g.transform(a);
        return g
    };

    function Yr(a, b) {
        var c = b.jt;
        null === c && (c = new Zr, c.port = b, c.Zc = b.Y, b.jt = c);
        return $r(c, a)
    }
    J.prototype.getLinkPoint = function(a, b, c, d, e, g, h, k) {
        void 0 === k && (k = new N);
        if (c.Xc()) return b.fb(c, k), k;
        if (c.Pj()) {
            var l = Yr(this, b);
            if (null !== l) {
                k.assign(l.Eq);
                if (e && this.My === Pr) {
                    var m = Yr(this, h);
                    if (null !== m && l.Ln < m.Ln) {
                        var l = D.P(),
                            m = D.P(),
                            n = new C(b.fb(ec, l), b.fb(vc, m)),
                            p = this.computeSpot(!d, h);
                        a = this.getLinkPoint(g, h, p, !d, e, a, b, m);
                        (c.Mj(xc) || c.Mj(yc)) && a.y >= n.y && a.y <= n.y + n.height ? k.y = a.y : (c.Mj(wc) || c.Mj(Dc)) && a.x >= n.x && a.x <= n.x + n.width && (k.x = a.x);
                        D.A(l);
                        D.A(m)
                    }
                }
                return k
            }
        }
        c = b.fb(mc, D.P());
        l = g = null;
        this.ta > (e ? 6 : 2) ? (l = d ? this.m(1) : this.m(this.ta - 2), e && (l = Xr(c, l.copy()))) : (g = D.P(), l = h.fb(mc, g), e && (l = Xr(c, l)), D.A(g));
        this.getLinkPointFromPoint(a, b, c, l, d, k);
        D.A(c);
        return k
    };
    J.prototype.getLinkDirection = function(a, b, c, d, e, g, h, k) {
        a: if (d.Xc()) c = d.x > d.y ? d.x > 1 - d.y ? 0 : d.x < 1 - d.y ? 270 : 315 : d.x < d.y ? d.x > 1 - d.y ? 90 : d.x < 1 - d.y ? 180 : 135 : .5 > d.x ? 225 : .5 < d.x ? 45 : 0;
            else {
                if (d.Pj()) {
                    var l = Yr(this, b);
                    if (null !== l) switch (l.Le) {
                        case D.Ad:
                            c = 270;
                            break a;
                        case D.bd:
                            c = 180;
                            break a;
                        default:
                        case D.rd:
                            c = 0;
                            break a;
                        case D.qd:
                            c = 90;
                            break a
                    }
                }
                var l = b.fb(mc, D.P()),
                    m = null,
                    n = null;
                this.ta > (g ? 6 : 2) ? (n = e ? this.m(1) : this.m(this.ta - 2), n = g ? Xr(l, n.copy()) : c) : (m = D.P(), n = k.fb(mc, m), D.A(m));
                c = 0;
                c = Math.abs(n.x - l.x) > Math.abs(n.y -
                    l.y) ? n.x >= l.x ? 0 : 180 : n.y >= l.y ? 90 : 270;
                D.A(l)
            }d.de() && h.Fi(a) && (c += 180, 360 <= c && (c -= 360));a = yr;a = e ? this.zu : this.uv;a === yr && (a = e ? b.zu : b.uv);
        switch (a) {
            case zr:
                b = b.sm();
                c += b;
                360 <= c && (c -= 360);
                break;
            case yr:
            case Fo:
                if (d.sJ()) break;
                b = b.sm();
                if (0 === b) break;
                45 <= b && 135 > b ? c += 90 : 135 <= b && 225 > b ? c += 180 : 225 <= b && 315 > b && (c += 270);
                360 <= c && (c -= 360)
        }
        return c
    };
    J.prototype.computeEndSegmentLength = function(a, b, c, d) {
        if (null !== b && c.Pj() && (a = Yr(this, b), null !== a)) return a.Sx;
        a = NaN;
        a = d ? this.rm : this.Hm;
        null !== b && isNaN(a) && (a = d ? b.rm : b.Hm);
        isNaN(a) && (a = 10);
        return a
    };
    J.prototype.computeSpot = function(a, b) {
        var c;
        if (a)
            if (c = b ? b : this.oc, null === c) c = mc;
            else {
                var d = this.Gb;
                d.ld() && null !== c && (d = c.Gb);
                c = d === Vc ? dc : d
            }
        else c = b ? b : this.Gc, null === c ? c = mc : (d = this.Hb, d.ld() && null !== c && (d = c.Hb), c = d === Vc ? dc : d);
        return c
    };
    J.prototype.computeOtherPoint = function(a, b) {
        var c = b.fb(mc),
            d;
        d = b.jt;
        d = null !== d ? $r(d, this) : null;
        null !== d && (c = d.Eq);
        return c
    };
    J.prototype.computeShortLength = function(a) {
        if (a) {
            if (a = this.Au, isNaN(a)) {
                var b = this.oc;
                null !== b && (a = b.Au)
            }
        } else a = this.vv, isNaN(a) && (b = this.Gc, null !== b && (a = b.vv));
        return isNaN(a) ? 0 : a
    };
    J.prototype.Xk = function(a, b, c, d, e, g) {
        if (!1 === this.tg) return !1;
        void 0 === b && (b = null);
        void 0 === c && (c = null);
        var h = g;
        void 0 === g && (h = D.hh(), h.reset());
        h.multiply(this.transform);
        if (this.In(a, h)) return gq(this, b, c, e), void 0 === g && D.lf(h), !0;
        if (this.jg(a, h)) {
            var k = !1;
            if (!this.Yn)
                for (var l = this.xa.o, m = l.length; m--;) {
                    var n = l[m];
                    if (n.visible || n === this.Bf) {
                        var p = n.aa,
                            q = this.Ga;
                        if (!(p.x > q.width || p.y > q.height || 0 > p.x + p.width || 0 > p.y + p.height)) {
                            p = D.hh();
                            p.set(h);
                            if (n instanceof x) k = n.Xk(a, b, c, d, e, p);
                            else if (this.path ===
                                n) {
                                if (n instanceof z) {
                                    var k = n,
                                        r = a,
                                        s = d,
                                        q = p;
                                    if (!1 === k.tg) k = !1;
                                    else if (q.multiply(k.transform), s) b: {
                                        var u = r,
                                            t = q;
                                        if (k.In(u, t)) k = !0;
                                        else {
                                            if (void 0 === t && (t = k.transform, u.Sk(k.aa))) { k = !0; break b }
                                            var q = u.left,
                                                r = u.right,
                                                s = u.top,
                                                u = u.bottom,
                                                y = D.P(),
                                                w = D.P(),
                                                A = D.P(),
                                                B = D.hh();
                                            B.set(t);
                                            B.GB(k.transform);
                                            B.pB();
                                            w.x = r;
                                            w.y = s;
                                            w.transform(B);
                                            y.x = q;
                                            y.y = s;
                                            y.transform(B);
                                            t = !1;
                                            tq(k, y, w, A) ? t = !0 : (y.x = r, y.y = u, y.transform(B), tq(k, y, w, A) ? t = !0 : (w.x = q, w.y = u, w.transform(B), tq(k, y, w, A) ? t = !0 : (y.x = q, y.y = s, y.transform(B), tq(k, y, w, A) &&
                                                (t = !0))));
                                            D.lf(B);
                                            D.A(y);
                                            D.A(w);
                                            D.A(A);
                                            k = t
                                        }
                                    }
                                    else k = k.In(r, q)
                                }
                            } else k = Lo(n, a, d, p);
                            k && (null !== b && (n = b(n)), n && (null === c || c(n)) && (e instanceof L && e.add(n), e instanceof K && e.add(n)));
                            D.lf(p)
                        }
                    }
                }
            void 0 === g && D.lf(h);
            return k || null !== this.background || null !== this.gm
        }
        void 0 === g && D.lf(h);
        return !1
    };
    D.w(J, { ic: "isOrthogonal" }, function() { return 2 === (this.on.value & 2) });
    D.w(J, { Nj: "isAvoiding" }, function() { return 4 === (this.on.value & 4) });
    J.prototype.computeCurve = function() {
        if (null === this.$i) {
            var a = this.oc,
                b = this.ic;
            this.$i = null !== a && a === this.Gc && !b
        }
        return this.$i ? Uj : this.jf
    };
    J.prototype.computeCorner = function() { if (this.jf === Uj) return 0; var a = this.QA; if (isNaN(a) || 0 > a) a = 10; return a };
    J.prototype.findMidLabel = function() {
        for (var a = this.path, b = this.xa.o, c = b.length, d = 0; d < c; d++) { var e = b[d]; if (e !== a && !e.Ue && (-Infinity === e.We || isNaN(e.We))) return e }
        for (a = this.Af; a.next();)
            if (b = a.value, -Infinity === b.We || isNaN(b.We)) return b;
        return null
    };
    J.prototype.computeSpacing = function() {
        if (!this.isVisible()) return 0;
        var a;
        a = Math.max(14, this.computeThickness());
        var b = this.oc,
            c = this.Gc;
        if (null !== b && null !== c) {
            var d = this.findMidLabel();
            if (null !== d) {
                var e = d.Ga,
                    g = d.margin,
                    h = isNaN(e.width) ? 30 : e.width * d.scale + g.left + g.right,
                    e = isNaN(e.height) ? 14 : e.height * d.scale + g.top + g.bottom,
                    d = d.Uq;
                d === wq || d === Rr || d === Qr ? a = Math.max(a, e) : d === Zp || d === $p || d === Xp || d === Yp ? a = Math.max(a, h) : (b = b.fb(mc).Wb(c.fb(mc)) / 180 * Math.PI, a = Math.max(a, Math.abs(Math.sin(b) * h) + Math.abs(Math.cos(b) *
                    e) + 1));
                this.jf === Uj && (a *= 1.333)
            }
        }
        return a
    };
    J.prototype.arrangeBundledLinks = function(a, b) {
        if (b)
            for (var c = 0; c < a.length; c++) {
                var d = a[c];
                d.Yp === vj && d.ec()
            }
    };
    J.prototype.computeCurviness = function() {
        var a = this.Nx;
        if (isNaN(a)) {
            var a = 16,
                b = this.Oi;
            if (null !== b) {
                for (var c = D.mb(), d = 0, e = b.links, g = 0; g < e.length; g++) {
                    var h = e[g],
                        h = h.computeSpacing();
                    c.push(h);
                    d += h
                }
                d = -d / 2;
                for (g = 0; g < e.length; g++) {
                    h = e[g];
                    if (h === this) { a = d + c[g] / 2; break }
                    d += c[g]
                }
                b.Hq === this.$ && (a = -a);
                D.ya(c)
            }
        }
        return a
    };
    J.prototype.computeThickness = function() { if (!this.isVisible()) return 0; var a = this.path; return null !== a ? Math.max(a.lb, 1) : 1 };
    J.prototype.hasCurviness = function() { return !isNaN(this.Nx) || null !== this.Oi };
    J.prototype.adjustPoints = function(a, b, c, d) {
        var e = this.Yp;
        if (this.ic) {
            if (e === Nr) return !1;
            e === Or && (e = Mr)
        }
        switch (e) {
            case Nr:
                var g = this.m(a),
                    h = this.m(c);
                if (!g.Wc(b) || !h.Wc(d)) {
                    var e = g.x,
                        g = g.y,
                        k = h.x - e,
                        l = h.y - g,
                        m = Math.sqrt(k * k + l * l);
                    if (!Eb(m, 0)) {
                        var n = 0;
                        Eb(k, 0) ? n = 0 > l ? -Math.PI / 2 : Math.PI / 2 : (n = Math.atan(l / Math.abs(k)), 0 > k && (n = Math.PI - n));
                        var h = b.x,
                            p = b.y,
                            l = d.x - h,
                            q = d.y - p,
                            r = Math.sqrt(l * l + q * q),
                            k = 0;
                        Eb(l, 0) ? k = 0 > q ? -Math.PI / 2 : Math.PI / 2 : (k = Math.atan(q / Math.abs(l)), 0 > l && (k = Math.PI - k));
                        m = r / m;
                        n = k - n;
                        this.gh(a, b);
                        for (a +=
                            1; a < c; a++) b = this.m(a), k = b.x - e, l = b.y - g, b = Math.sqrt(k * k + l * l), Eb(b, 0) || (q = 0, Eb(k, 0) ? q = 0 > l ? -Math.PI / 2 : Math.PI / 2 : (q = Math.atan(l / Math.abs(k)), 0 > k && (q = Math.PI - q)), k = q + n, b *= m, this.ia(a, h + b * Math.cos(k), p + b * Math.sin(k)));
                        this.gh(c, d)
                    }
                }
                return !0;
            case Or:
                g = this.m(a);
                p = this.m(c);
                if (!g.Wc(b) || !p.Wc(d)) {
                    var e = g.x,
                        g = g.y,
                        h = p.x,
                        p = p.y,
                        m = (h - e) * (h - e) + (p - g) * (p - g),
                        k = b.x,
                        n = b.y,
                        l = d.x,
                        q = d.y,
                        r = 0,
                        s = 1;
                    0 !== l - k ? (r = (q - n) / (l - k), s = Math.sqrt(1 + 1 / (r * r))) : r = 9E9;
                    this.gh(a, b);
                    for (a += 1; a < c; a++) {
                        b = this.m(a);
                        var u = b.x,
                            t = b.y,
                            y = .5;
                        0 !== m && (y =
                            ((e - u) * (e - h) + (g - t) * (g - p)) / m);
                        var w = e + y * (h - e),
                            A = g + y * (p - g);
                        b = Math.sqrt((u - w) * (u - w) + (t - A) * (t - A));
                        t < r * (u - w) + A && (b = -b);
                        0 < r && (b = -b);
                        u = k + y * (l - k);
                        y = n + y * (q - n);
                        0 !== r ? (b = u + b / s, this.ia(a, b, y - (b - u) / r)) : this.ia(a, u, y + b)
                    }
                    this.gh(c, d)
                }
                return !0;
            case Mr:
                a: {
                    if (this.ic && (e = this.m(a), g = this.m(a + 1), h = this.m(a + 2), k = g.x, n = g.y, p = k, m = n, Q(e.y, g.y) ? Q(g.x, h.x) ? n = b.y : Q(g.y, h.y) && (k = b.x) : Q(e.x, g.x) && (Q(g.y, h.y) ? k = b.x : Q(g.x, h.x) && (n = b.y)), this.ia(a + 1, k, n), e = this.m(c), g = this.m(c - 1), h = this.m(c - 2), k = g.x, n = g.y, l = k, q = n, Q(e.y, g.y) ? Q(g.x,
                            h.x) ? n = d.y : Q(g.y, h.y) && (k = d.x) : Q(e.x, g.x) && (Q(g.y, h.y) ? k = d.x : Q(g.x, h.x) && (n = d.y)), this.ia(c - 1, k, n), Mi(this))) {
                        this.ia(a + 1, p, m);
                        this.ia(c - 1, l, q);
                        c = !1;
                        break a
                    }
                    this.gh(a, b);this.gh(c, d);c = !0
                }
                return c;
            default:
                return !1
        }
    };
    J.prototype.addOrthoPoints = function(a, b, c, d, e, g) {
        b = -45 <= b && 45 > b ? 0 : 45 <= b && 135 > b ? 90 : 135 <= b && 225 > b ? 180 : 270;
        d = -45 <= d && 45 > d ? 0 : 45 <= d && 135 > d ? 90 : 135 <= d && 225 > d ? 180 : 270;
        var h = e.aa.copy(),
            k = g.aa.copy();
        if (h.H() && k.H()) {
            h.ig(8, 8);
            k.ig(8, 8);
            h.Mi(a);
            k.Mi(c);
            var l, m;
            if (0 === b)
                if (c.x > a.x || 270 === d && c.y < a.y && k.right > a.x || 90 === d && c.y > a.y && k.right > a.x) l = new N(c.x, a.y), m = new N(c.x, (a.y + c.y) / 2), 180 === d ? (l.x = this.computeMidOrthoPosition(a.x, c.x, !1), m.x = l.x, m.y = c.y) : 270 === d && c.y < a.y || 90 === d && c.y > a.y ? (l.x = a.x < k.left ? this.computeMidOrthoPosition(a.x,
                    k.left, !1) : a.x < k.right && (270 === d && a.y < k.top || 90 === d && a.y > k.bottom) ? this.computeMidOrthoPosition(a.x, c.x, !1) : k.right, m.x = l.x, m.y = c.y) : 0 === d && a.x < k.left && a.y > k.top && a.y < k.bottom && (l.x = a.x, l.y = a.y < c.y ? Math.min(c.y, k.top) : Math.max(c.y, k.bottom), m.y = l.y);
                else {
                    l = new N(a.x, c.y);
                    m = new N((a.x + c.x) / 2, c.y);
                    if (180 === d || 90 === d && c.y < h.top || 270 === d && c.y > h.bottom) 180 === d && (k.Pa(a) || h.Pa(c)) ? l.y = this.computeMidOrthoPosition(a.y, c.y, !0) : c.y < a.y && (180 === d || 90 === d) ? l.y = this.computeMidOrthoPosition(h.top, Math.max(c.y,
                        k.bottom), !0) : c.y > a.y && (180 === d || 270 === d) && (l.y = this.computeMidOrthoPosition(h.bottom, Math.min(c.y, k.top), !0)), m.x = c.x, m.y = l.y;
                    if (l.y > h.top && l.y < h.bottom)
                        if (c.x >= h.left && c.x <= a.x || a.x <= k.right && a.x >= c.x) { if (90 === d || 270 === d) l = new N(Math.max((a.x + c.x) / 2, a.x), a.y), m = new N(l.x, c.y) } else l.y = 270 === d || (0 === d || 180 === d) && c.y < a.y ? Math.min(c.y, 0 === d ? h.top : Math.min(h.top, k.top)) : Math.max(c.y, 0 === d ? h.bottom : Math.max(h.bottom, k.bottom)), m.x = c.x, m.y = l.y
                }
            else if (180 === b)
                if (c.x < a.x || 270 === d && c.y < a.y && k.left < a.x ||
                    90 === d && c.y > a.y && k.left < a.x) l = new N(c.x, a.y), m = new N(c.x, (a.y + c.y) / 2), 0 === d ? (l.x = this.computeMidOrthoPosition(a.x, c.x, !1), m.x = l.x, m.y = c.y) : 270 === d && c.y < a.y || 90 === d && c.y > a.y ? (l.x = a.x > k.right ? this.computeMidOrthoPosition(a.x, k.right, !1) : a.x > k.left && (270 === d && a.y < k.top || 90 === d && a.y > k.bottom) ? this.computeMidOrthoPosition(a.x, c.x, !1) : k.left, m.x = l.x, m.y = c.y) : 180 === d && a.x > k.right && a.y > k.top && a.y < k.bottom && (l.x = a.x, l.y = a.y < c.y ? Math.min(c.y, k.top) : Math.max(c.y, k.bottom), m.y = l.y);
                else {
                    l = new N(a.x, c.y);
                    m = new N((a.x +
                        c.x) / 2, c.y);
                    if (0 === d || 90 === d && c.y < h.top || 270 === d && c.y > h.bottom) 0 === d && (k.Pa(a) || h.Pa(c)) ? l.y = this.computeMidOrthoPosition(a.y, c.y, !0) : c.y < a.y && (0 === d || 90 === d) ? l.y = this.computeMidOrthoPosition(h.top, Math.max(c.y, k.bottom), !0) : c.y > a.y && (0 === d || 270 === d) && (l.y = this.computeMidOrthoPosition(h.bottom, Math.min(c.y, k.top), !0)), m.x = c.x, m.y = l.y;
                    if (l.y > h.top && l.y < h.bottom)
                        if (c.x <= h.right && c.x >= a.x || a.x >= k.left && a.x <= c.x) { if (90 === d || 270 === d) l = new N(Math.min((a.x + c.x) / 2, a.x), a.y), m = new N(l.x, c.y) } else l.y = 270 ===
                            d || (0 === d || 180 === d) && c.y < a.y ? Math.min(c.y, 180 === d ? h.top : Math.min(h.top, k.top)) : Math.max(c.y, 180 === d ? h.bottom : Math.max(h.bottom, k.bottom)), m.x = c.x, m.y = l.y
                }
            else if (90 === b)
                if (c.y > a.y || 180 === d && c.x < a.x && k.bottom > a.y || 0 === d && c.x > a.x && k.bottom > a.y) l = new N(a.x, c.y), m = new N((a.x + c.x) / 2, c.y), 270 === d ? (l.y = this.computeMidOrthoPosition(a.y, c.y, !0), m.x = c.x, m.y = l.y) : 180 === d && c.x < a.x || 0 === d && c.x > a.x ? (l.y = a.y < k.top ? this.computeMidOrthoPosition(a.y, k.top, !0) : a.y < k.bottom && (180 === d && a.x < k.left || 0 === d && a.x > k.right) ?
                    this.computeMidOrthoPosition(a.y, c.y, !0) : k.bottom, m.x = c.x, m.y = l.y) : 90 === d && a.y < k.top && a.x > k.left && a.x < k.right && (l.x = a.x < c.x ? Math.min(c.x, k.left) : Math.max(c.x, k.right), l.y = a.y, m.x = l.x);
                else {
                    l = new N(c.x, a.y);
                    m = new N(c.x, (a.y + c.y) / 2);
                    if (270 === d || 0 === d && c.x < h.left || 180 === d && c.x > h.right) 270 === d && (k.Pa(a) || h.Pa(c)) ? l.x = this.computeMidOrthoPosition(a.x, c.x, !1) : c.x < a.x && (270 === d || 0 === d) ? l.x = this.computeMidOrthoPosition(h.left, Math.max(c.x, k.right), !1) : c.x > a.x && (270 === d || 180 === d) && (l.x = this.computeMidOrthoPosition(h.right,
                        Math.min(c.x, k.left), !1)), m.x = l.x, m.y = c.y;
                    if (l.x > h.left && l.x < h.right)
                        if (c.y >= h.top && c.y <= a.y || a.y <= k.bottom && a.y >= c.y) { if (0 === d || 180 === d) l = new N(a.x, Math.max((a.y + c.y) / 2, a.y)), m = new N(c.x, l.y) } else l.x = 180 === d || (90 === d || 270 === d) && c.x < a.x ? Math.min(c.x, 90 === d ? h.left : Math.min(h.left, k.left)) : Math.max(c.x, 90 === d ? h.right : Math.max(h.right, k.right)), m.x = l.x, m.y = c.y
                }
            else if (c.y < a.y || 180 === d && c.x < a.x && k.top < a.y || 0 === d && c.x > a.x && k.top < a.y) l = new N(a.x, c.y), m = new N((a.x + c.x) / 2, c.y), 90 === d ? (l.y = this.computeMidOrthoPosition(a.y,
                c.y, !0), m.x = c.x, m.y = l.y) : 180 === d && c.x < a.x || 0 === d && c.x >= a.x ? (l.y = a.y > k.bottom ? this.computeMidOrthoPosition(a.y, k.bottom, !0) : a.y > k.top && (180 === d && a.x < k.left || 0 === d && a.x > k.right) ? this.computeMidOrthoPosition(a.y, c.y, !0) : k.top, m.x = c.x, m.y = l.y) : 270 === d && a.y > k.bottom && a.x > k.left && a.x < k.right && (l.x = a.x < c.x ? Math.min(c.x, k.left) : Math.max(c.x, k.right), l.y = a.y, m.x = l.x);
            else {
                l = new N(c.x, a.y);
                m = new N(c.x, (a.y + c.y) / 2);
                if (90 === d || 0 === d && c.x < h.left || 180 === d && c.x > h.right) 90 === d && (k.Pa(a) || h.Pa(c)) ? l.x = this.computeMidOrthoPosition(a.x,
                    c.x, !1) : c.x < a.x && (90 === d || 0 === d) ? l.x = this.computeMidOrthoPosition(h.left, Math.max(c.x, k.right), !1) : c.x > a.x && (90 === d || 180 === d) && (l.x = this.computeMidOrthoPosition(h.right, Math.min(c.x, k.left), !1)), m.x = l.x, m.y = c.y;
                if (l.x > h.left && l.x < h.right)
                    if (c.y <= h.bottom && c.y >= a.y || a.y >= k.top && a.y <= c.y) { if (0 === d || 180 === d) l = new N(a.x, Math.min((a.y + c.y) / 2, a.y)), m = new N(c.x, l.y) } else l.x = 180 === d || (90 === d || 270 === d) && c.x < a.x ? Math.min(c.x, 270 === d ? h.left : Math.min(h.left, k.left)) : Math.max(c.x, 270 === d ? h.right : Math.max(h.right,
                        k.right)), m.x = l.x, m.y = c.y
            }
            var n = l,
                p = m;
            if (this.Nj) {
                var q = this.g,
                    r;
                (r = null === q) || (q.Ra.nf ? r = !1 : (r = q.eb, r = r instanceof Uh ? !r.nx || r.mJ : !0), r = !r);
                if (r || h.Pa(c) && !g.Fi(e) || k.Pa(a) && !e.Fi(g) || e === g || this.layer.Yc) b = !1;
                else {
                    var s = ha(q, !0, this.Ka, null);
                    if (s.Dq(Math.min(a.x, n.x), Math.min(a.y, n.y), Math.abs(a.x - n.x), Math.abs(a.y - n.y)) && s.Dq(Math.min(n.x, p.x), Math.min(n.y, p.y), Math.abs(n.x - p.x), Math.abs(n.y - p.y)) && s.Dq(Math.min(p.x, c.x), Math.min(p.y, c.y), Math.abs(p.x - c.x), Math.abs(p.y - c.y))) b = !1;
                    else {
                        e = a;
                        g = c;
                        var u = r = null;
                        if (q.uB) {
                            q = s.pb.copy();
                            q.ig(-s.cq, -s.aq);
                            var t = D.P();
                            as(s, a.x, a.y) || (Je(q.x, q.y, q.x + q.width, q.y + q.height, a.x, a.y, n.x, n.y, t) ? (r = a = t.copy(), b = t.Wb(n)) : Je(q.x, q.y, q.x + q.width, q.y + q.height, n.x, n.y, p.x, p.y, t) ? (r = a = t.copy(), b = t.Wb(p)) : Je(q.x, q.y, q.x + q.width, q.y + q.height, p.x, p.y, c.x, c.y, t) && (r = a = t.copy(), b = t.Wb(c)));
                            as(s, c.x, c.y) || (Je(q.x, q.y, q.x + q.width, q.y + q.height, c.x, c.y, p.x, p.y, t) ? (u = c = t.copy(), d = p.Wb(t)) : Je(q.x, q.y, q.x + q.width, q.y + q.height, p.x, p.y, n.x, n.y, t) ? (u = c = t.copy(), d = n.Wb(t)) : Je(q.x,
                                q.y, q.x + q.width, q.y + q.height, n.x, n.y, a.x, a.y, t) && (u = c = t.copy(), d = a.Wb(t)));
                            D.A(t)
                        }
                        h = h.copy().Zh(k);
                        k = s.fH;
                        h.ig(s.cq * k, s.aq * k);
                        bs(s, a, b, c, d, h);
                        k = cs(s, c.x, c.y);
                        !s.abort && 999999 <= k && (Pn(s), k = s.rG, h.ig(s.cq * k, s.aq * k), bs(s, a, b, c, d, h), k = cs(s, c.x, c.y));
                        !s.abort && 999999 <= k && s.xH && (Pn(s), bs(s, a, b, c, d, s.pb), k = cs(s, c.x, c.y));
                        if (!s.abort && 999999 > k && 0 !== cs(s, c.x, c.y)) {
                            ds(this, s, c.x, c.y, d, !0);
                            h = this.m(2);
                            if (4 > this.ta) 0 === b || 180 === b ? (h.x = a.x, h.y = c.y) : (h.x = c.x, h.y = a.y), this.ia(2, h.x, h.y), this.B(3, h.x, h.y);
                            else if (c =
                                this.m(3), 0 === b || 180 === b) Q(h.x, c.x) ? (h = 0 === b ? Math.max(h.x, a.x) : Math.min(h.x, a.x), this.ia(2, h, a.y), this.ia(3, h, c.y)) : Q(h.y, c.y) ? (Math.abs(a.y - h.y) <= s.aq / 2 && (this.ia(2, h.x, a.y), this.ia(3, c.x, a.y)), this.B(2, h.x, a.y)) : this.ia(2, a.x, h.y);
                            else if (90 === b || 270 === b) Q(h.y, c.y) ? (h = 90 === b ? Math.max(h.y, a.y) : Math.min(h.y, a.y), this.ia(2, a.x, h), this.ia(3, c.x, h)) : Q(h.x, c.x) ? (Math.abs(a.x - h.x) <= s.cq / 2 && (this.ia(2, a.x, h.y), this.ia(3, a.x, c.y)), this.B(2, a.x, h.y)) : this.ia(2, h.x, a.y);
                            null !== r && (a = this.m(1), c = this.m(2),
                                a.x !== c.x && a.y !== c.y ? 0 === b || 180 === b ? this.B(2, a.x, c.y) : this.B(2, c.x, a.y) : 0 === b || 180 === b ? this.B(2, e.x, r.y) : this.B(2, r.x, e.y));
                            null !== u && (0 === d || 180 === d ? this.Bj(g.x, u.y) : this.Bj(u.x, g.y));
                            b = !0
                        } else b = !1
                    }
                }
            } else b = !1;
            b || (this.Ci(l), this.Ci(m))
        }
    };
    J.prototype.computeMidOrthoPosition = function(a, b) { if (this.hasCurviness()) { var c = this.computeCurviness(); return (a + b) / 2 + c } return (a + b) / 2 };

    function Mi(a) {
        if (null === a.g || !a.Nj) return !1;
        var b = a.points.o,
            c = b.length;
        if (4 > c) return !1;
        a = ha(a.g, !0, a.Ka, null);
        for (var d = 1; d < c - 2; d++) {
            var e = b[d],
                g = b[d + 1];
            if (!a.Dq(Math.min(e.x, g.x), Math.min(e.y, g.y), Math.abs(e.x - g.x), Math.abs(e.y - g.y))) return !0
        }
        return !1
    }

    function ds(a, b, c, d, e, g) {
        var h = b.cq,
            k = b.aq,
            l = cs(b, c, d),
            m = c,
            n = d;
        for (0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k; 1 < l && cs(b, m, n) === l - 1;) c = m, d = n, 0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k, l -= 1;
        if (g) {
            if (1 < l)
                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;
        1 < l && (g = e, m = c, n = d, 0 === e ? (g = 90, n += k) : 90 === e ? (g = 180, m -= h) : 180 === e ? (g = 270, n -= k) : 270 === e && (g = 0, m += h), cs(b, m, n) === l - 1 ? ds(a, b, m, n, g, !1) : (m = c, n = d, 0 === e ? (g = 270, n -= k) : 90 ===
            e ? (g = 0, m += h) : 180 === e ? (g = 90, n += k) : 270 === e && (g = 180, m -= h), cs(b, m, n) === l - 1 && ds(a, b, m, n, g, !1)));
        a.Bj(c, d)
    }
    J.prototype.findClosestSegment = function(a) {
        v && D.l(a, N, J, "findClosestSegment:p");
        var b = a.x;
        a = a.y;
        for (var c = this.m(0), d = this.m(1), e = lb(b, a, c.x, c.y, d.x, d.y), g = 0, h = 1; h < this.ta - 1; h++) {
            var c = this.m(h + 1),
                k = lb(b, a, d.x, d.y, c.x, c.y),
                d = c;
            k < e && (g = h, e = k)
        }
        return g
    };
    J.prototype.Te = function() { this.ab = null };
    D.w(J, { vf: "geometry" }, function() { null === this.ab && (this.zo(), this.ab = this.makeGeometry()); return this.ab });
    J.prototype.Wu = function(a) {
        if (!a) {
            if (!1 === this.Uf) return;
            a = this.Ld();
            if (null !== this.ab && (null === a || null !== a.vf)) return
        }
        this.ab = this.makeGeometry();
        a = this.path;
        if (null !== a) {
            a.ab = this.ab;
            for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) {
                var e = b[d];
                e !== a && e.Ue && e instanceof z && (e.ab = this.ab)
            }
        }
    };
    J.prototype.makeGeometry = function() {
        var a = this.ta;
        if (2 > a) return new Ve(Ze);
        var b = !1,
            c = this.g;
        null !== c && Ur(this) && c.Cl.contains(this) && null !== this.Vw && (b = !0);
        var d = c = 0,
            e = this.m(0).copy(),
            g = e.copy(),
            c = this.gd.o,
            h = this.computeCurve();
        if (h === Uj && 3 <= a && !Eb(this.Yq, 0))
            if (3 === a) var k = this.m(1),
                c = Math.min(e.x, k.x),
                d = Math.min(e.y, k.y),
                k = this.m(2),
                c = Math.min(c, k.x),
                d = Math.min(d, k.y);
            else {
                if (this.ic)
                    for (k = 0; k < a; k++) d = c[k], g.x = Math.min(d.x, g.x), g.y = Math.min(d.y, g.y);
                else
                    for (k = 3; k < a; k += 3) k + 3 >= a && (k = a - 1), c = this.m(k),
                        g.x = Math.min(c.x, g.x), g.y = Math.min(c.y, g.y);
                c = g.x;
                d = g.y
            }
        else {
            for (k = 0; k < a; k++) d = c[k], g.x = Math.min(d.x, g.x), g.y = Math.min(d.y, g.y);
            c = g.x;
            d = g.y
        }
        c -= this.uA.x;
        d -= this.uA.y;
        e.x -= c;
        e.y -= d;
        if (2 !== a || Ur(this)) {
            var l = D.v();
            0 !== this.computeShortLength(!0) && (e = es(this, e, !0, g));
            T(l, e.x, e.y, !1, !1);
            if (h === Uj && 3 <= a && !Eb(this.Yq, 0))
                if (3 === a) k = this.m(1), a = k.x - c, b = k.y - d, k = this.m(2).copy(), k.x -= c, k.y -= d, 0 !== this.computeShortLength(!1) && (k = es(this, k, !1, g)), U(l, a, b, a, b, k.x, k.y);
                else if (this.ic) {
                for (var g = new N(c, d), e = this.m(1).copy(),
                        h = new N(c, d), a = new N(c, d), b = this.m(0), m = null, n = this.Yq / 3, k = 1; k < this.ta - 1; k++) {
                    var m = this.m(k),
                        p = b,
                        q = m,
                        r = this.m(fs(this, m, k, !1));
                    if (!Eb(p.x, q.x) || !Eb(q.x, r.x))
                        if (!Eb(p.y, q.y) || !Eb(q.y, r.y)) {
                            var s = n,
                                u = h,
                                t = a;
                            isNaN(s) && (s = this.Yq / 3);
                            var y = p.x,
                                p = p.y,
                                w = q.x,
                                q = q.y,
                                A = r.x,
                                r = r.y,
                                B = s * gs(y, p, w, q),
                                s = s * gs(w, q, A, r);
                            Eb(p, q) && Eb(w, A) && (w > y ? r > q ? (u.x = w - B, u.y = q - B, t.x = w + s, t.y = q + s) : (u.x = w - B, u.y = q + B, t.x = w + s, t.y = q - s) : r > q ? (u.x = w + B, u.y = q - B, t.x = w - s, t.y = q + s) : (u.x = w + B, u.y = q + B, t.x = w - s, t.y = q - s));
                            Eb(y, w) && Eb(q, r) && (q > p ? (A > w ? (u.x =
                                w - B, u.y = q - B, t.x = w + s) : (u.x = w + B, u.y = q - B, t.x = w - s), t.y = q + s) : (A > w ? (u.x = w - B, u.y = q + B, t.x = w + s) : (u.x = w + B, u.y = q + B, t.x = w - s), t.y = q - s));
                            if (Eb(y, w) && Eb(w, A) || Eb(p, q) && Eb(q, r)) y = .5 * (y + A), p = .5 * (p + r), u.x = y, u.y = p, t.x = y, t.y = p;
                            1 === k ? (e.x = .5 * (b.x + m.x), e.y = .5 * (b.y + m.y)) : 2 === k && Eb(b.x, this.m(0).x) && Eb(b.y, this.m(0).y) && (e.x = .5 * (b.x + m.x), e.y = .5 * (b.y + m.y));
                            U(l, e.x - c, e.y - d, h.x - c, h.y - d, m.x - c, m.y - d);
                            g.set(h);
                            e.set(a);
                            b = m
                        }
                }
                k = b.x;
                b = b.y;
                g = this.m(this.ta - 1);
                0 !== this.computeShortLength(!1) && (g = es(this, g.copy(), !1, Kd));
                k = .5 * (k + g.x);
                b = .5 * (b + g.y);
                U(l, a.x - c, a.y - d, k - c, b - d, g.x - c, g.y - d)
            } else
                for (k = 3; k < a; k += 3) b = this.m(k - 2), k + 3 >= a && (k = a - 1), g = this.m(k - 1), e = this.m(k), k === a - 1 && 0 !== this.computeShortLength(!1) && (e = es(this, e.copy(), !1, Kd)), U(l, b.x - c, b.y - d, g.x - c, g.y - d, e.x - c, e.y - d);
            else {
                g = D.P();
                g.assign(this.m(0));
                k = 1;
                for (e = 0; k < a;) {
                    k = fs(this, g, k, 1 < k);
                    u = this.m(k);
                    if (k >= a - 1) {
                        if (!g.O(u)) 0 !== this.computeShortLength(!1) && (u = es(this, u.copy(), !1, Kd)), hs(this, l, -c, -d, g, u, b);
                        else if (0 === e)
                            for (k = 1; k < a;) u = this.m(k++), hs(this, l, -c, -d, g, u, b), g.assign(u);
                        break
                    }
                    e = fs(this, u, k + 1, k < a - 3);
                    k = l;
                    h = -c;
                    m = -d;
                    n = g;
                    t = this.m(e);
                    y = g;
                    p = b;
                    Q(n.y, u.y) && Q(u.x, t.x) ? (s = this.computeCorner(), s = Math.min(s, Math.abs(u.x - n.x) / 2), s = w = Math.min(s, Math.abs(t.y - u.y) / 2), Q(s, 0) ? (hs(this, k, h, m, n, u, p), y.assign(u)) : (q = u.x, A = u.y, r = q, B = A, q = u.x > n.x ? u.x - s : u.x + s, B = t.y > u.y ? u.y + w : u.y - w, hs(this, k, h, m, n, new N(q, A), p), zf(k, u.x + h, u.y + m, r + h, B + m), y.n(r, B))) : Q(n.x, u.x) && Q(u.y, t.y) ? (s = this.computeCorner(), w = Math.min(s, Math.abs(u.y - n.y) / 2), w = s = Math.min(w, Math.abs(t.x - u.x) / 2), Q(s, 0) ? (hs(this, k, h, m, n, u,
                        p), y.assign(u)) : (q = u.x, B = A = u.y, A = u.y > n.y ? u.y - w : u.y + w, r = t.x > u.x ? u.x + s : u.x - s, hs(this, k, h, m, n, new N(q, A), p), zf(k, u.x + h, u.y + m, r + h, B + m), y.n(r, B))) : (hs(this, k, h, m, n, u, p), y.assign(u));
                    k = e
                }
                D.A(g)
            }
            c = l.q;
            D.u(l)
        } else l = this.m(1).copy(), l.x -= c, l.y -= d, 0 !== this.computeShortLength(!0) && (e = es(this, e, !0, g)), 0 !== this.computeShortLength(!1) && (l = es(this, l, !1, g)), c = new Ve(Ze), c.la = e.x, c.ja = e.y, c.F = l.x, c.G = l.y;
        return c
    };

    function gs(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 Eb(a, 0) ? b : Eb(b, 0) ? a : Math.sqrt(a * a + b * b)
    }

    function es(a, b, c, d) {
        var e = a.ta;
        if (2 > e) return b;
        if (c) {
            var g = a.m(1);
            c = g.x - d.x;
            d = g.y - d.y;
            g = gs(b.x, b.y, c, d);
            if (0 === g) return b;
            e = 2 === e ? .5 * g : g;
            a = a.computeShortLength(!0);
            a > e && (a = e);
            c = a * (c - b.x) / g;
            a = a * (d - b.y) / g;
            b.x += c;
            b.y += a
        } else {
            g = a.m(e - 2);
            c = g.x - d.x;
            d = g.y - d.y;
            g = gs(b.x, b.y, c, d);
            if (0 === g) return b;
            e = 2 === e ? .5 * g : g;
            a = a.computeShortLength(!1);
            a > e && (a = e);
            c = a * (b.x - c) / g;
            a = a * (b.y - d) / g;
            b.x -= c;
            b.y -= a
        }
        return b
    }

    function fs(a, b, c, d) {
        for (var e = a.ta, g = b; Eb(b.x, g.x) && Eb(b.y, g.y);) {
            if (c >= e) return e - 1;
            g = a.m(c++)
        }
        if (!Eb(b.x, g.x) && !Eb(b.y, g.y)) return c - 1;
        for (var h = g; Eb(b.x, g.x) && Eb(g.x, h.x) && (!d || (b.y >= g.y ? g.y >= h.y : g.y <= h.y)) || Eb(b.y, g.y) && Eb(g.y, h.y) && (!d || (b.x >= g.x ? g.x >= h.x : g.x <= h.x));) {
            if (c >= e) return e - 1;
            h = a.m(c++)
        }
        return c - 2
    }

    function hs(a, b, c, d, e, g, h) {
        if (!h && Ur(a)) {
            h = [];
            var k = 0;
            a.isVisible() && (k = is(a, e, g, h));
            var l = e.x,
                l = e.y;
            if (0 < k)
                if (Q(e.y, g.y))
                    if (e.x < g.x)
                        for (var m = 0; m < k;) {
                            var n = Math.max(e.x, Math.min(h[m++] - 5, g.x - 10));
                            b.lineTo(n + c, g.y + d);
                            for (var l = n + c, p = Math.min(n + 10, g.x); m < k;) {
                                var q = h[m];
                                if (q < p + 10) m++, p = Math.min(q + 5, g.x);
                                else break
                            }
                            q = (n + p) / 2 + c;
                            q = g.y - 10 + d;
                            n = p + c;
                            p = g.y + d;
                            a.jf === uj ? T(b, n, p, !1, !1) : U(b, l, q, n, q, n, p)
                        } else
                            for (m = k - 1; 0 <= m;) {
                                n = Math.min(e.x, Math.max(h[m--] + 5, g.x + 10));
                                b.lineTo(n + c, g.y + d);
                                l = n + c;
                                for (p = Math.max(n - 10,
                                        g.x); 0 <= m;)
                                    if (q = h[m], q > p - 10) m--, p = Math.max(q - 5, g.x);
                                    else break;
                                q = g.y - 10 + d;
                                n = p + c;
                                p = g.y + d;
                                a.jf === uj ? T(b, n, p, !1, !1) : U(b, l, q, n, q, n, p)
                            } else if (Q(e.x, g.x))
                                if (e.y < g.y)
                                    for (m = 0; m < k;) {
                                        n = Math.max(e.y, Math.min(h[m++] - 5, g.y - 10));
                                        b.lineTo(g.x + c, n + d);
                                        l = n + d;
                                        for (p = Math.min(n + 10, g.y); m < k;)
                                            if (q = h[m], q < p + 10) m++, p = Math.min(q + 5, g.y);
                                            else break;
                                        q = g.x - 10 + c;
                                        n = g.x + c;
                                        p += d;
                                        a.jf === uj ? T(b, n, p, !1, !1) : U(b, q, l, q, p, n, p)
                                    } else
                                        for (m = k - 1; 0 <= m;) {
                                            n = Math.min(e.y, Math.max(h[m--] + 5, g.y + 10));
                                            b.lineTo(g.x + c, n + d);
                                            l = n + d;
                                            for (p = Math.max(n - 10, g.y); 0 <=
                                                m;)
                                                if (q = h[m], q > p - 10) m--, p = Math.max(q - 5, g.y);
                                                else break;
                                            q = g.x - 10 + c;
                                            n = g.x + c;
                                            p += d;
                                            a.jf === uj ? T(b, n, p, !1, !1) : U(b, q, l, q, p, n, p)
                                        }
        }
        b.lineTo(g.x + c, g.y + d)
    }

    function is(a, b, c, d) {
        var e = a.g;
        if (null === e || b.O(c)) return 0;
        for (e = e.ao; e.next();) {
            var g = e.value;
            if (null !== g && g.visible)
                for (var g = g.rb.o, h = g.length, k = 0; k < h; k++) {
                    var l = g[k];
                    if (l instanceof J) {
                        if (l === a) return 0 < d.length && d.sort(function(a, b) { return a - b }), d.length;
                        if (l.isVisible() && Ur(l)) {
                            var m = l.so;
                            m.H() && a.so.jg(m) && !a.usesSamePort(l) && (m = l.path, null !== m && m.Sj() && js(b, c, d, l))
                        }
                    }
                }
        }
        0 < d.length && d.sort(function(a, b) { return a - b });
        return d.length
    }

    function js(a, b, c, d) {
        for (var e = Q(a.y, b.y), g = d.ta, h = d.m(0), k = D.P(), l = 1; l < g; l++) {
            var m = d.m(l);
            if (l < g - 1) { var n = d.m(l + 1); if (h.y === m.y && m.y === n.y) { if (m.x > h.x && n.x > m.x || m.x < h.x && n.x < m.x) m = n, l++ } else h.x === m.x && m.x === n.x && (m.y > h.y && n.y > m.y || m.y < h.y && n.y < m.y) && (m = n, l++) }
            a: {
                var n = k,
                    p = a.x,
                    q = a.y,
                    r = b.x,
                    s = b.y,
                    u = h.x,
                    h = h.y,
                    t = m.x,
                    y = m.y;
                if (!Q(p, r)) {
                    if (Q(q, s) && Q(u, t) && Math.min(p, r) < u && Math.max(p, r) > u && Math.min(h, y) < q && Math.max(h, y) > q && !Q(h, y)) {
                        n.x = u;
                        n.y = q;
                        n = !0;
                        break a
                    }
                } else if (!Q(q, s) && Q(h, y) && Math.min(q, s) < h && Math.max(q,
                        s) > h && Math.min(u, t) < p && Math.max(u, t) > p && !Q(u, t)) {
                    n.x = p;
                    n.y = h;
                    n = !0;
                    break a
                }
                n.x = 0;n.y = 0;n = !1
            }
            n && (e ? c.push(k.x) : c.push(k.y));
            h = m
        }
        D.A(k)
    }
    D.w(J, { tu: "firstPickIndex" }, function() {
        var a;
        2 >= this.ta ? a = 0 : ((a = this.ic) || (a = this.computeSpot(!0) !== dc), a = a ? 1 : 0);
        return a
    });
    D.w(J, { oy: "lastPickIndex" }, function() {
        var a = this.ta;
        if (0 === a) a = 0;
        else if (2 >= a) a -= 1;
        else {
            var b;
            (b = this.ic) || (b = this.computeSpot(!1) !== dc);
            a = b ? a - 2 : a - 1
        }
        return a
    });

    function Ur(a) { a = a.jf; return a === tj || a === uj }

    function Wr(a, b) {
        if (b || Ur(a)) {
            var c = a.g;
            null === c || c.Cl.contains(a) || null === a.Vw || c.Cl.add(a, a.Vw)
        }
    }

    function Oj(a, b) {
        var c = a.layer;
        if (null !== c && c.visible && !c.Yc) {
            var d = c.g;
            if (null !== d)
                for (var e = !1, d = d.ao; d.next();) {
                    var g = d.value;
                    if (g.visible)
                        if (g === c)
                            for (var e = !0, h = !1, g = g.rb.o, k = g.length, l = 0; l < k; l++) {
                                var m = g[l];
                                m instanceof J && (m === a ? h = !0 : h && ks(a, m, b))
                            } else if (e)
                                for (g = g.rb.o, k = g.length, l = 0; l < k; l++) m = g[l], m instanceof J && ks(a, m, b)
                }
        }
    }

    function ks(a, b, c) {
        if (null !== b && null !== b.ab && Ur(b)) {
            var d = b.so;
            d.H() && (a.so.jg(d) || c.jg(d)) && (a.usesSamePort(b) || b.Te())
        }
    }
    J.prototype.usesSamePort = function(a) {
        var b = this.ta,
            c = a.ta;
        if (0 < b && 0 < c) {
            var d = this.m(0),
                e = a.m(0);
            if (d.Wc(e)) return !0;
            b = this.m(b - 1);
            a = a.m(c - 1);
            if (b.Wc(a) || d.Wc(a) || b.Wc(e)) return !0
        } else if (this.$ === a.$ || this.ba === a.ba || this.$ === a.ba || this.ba === a.$) return !0;
        return !1
    };
    J.prototype.isVisible = function() {
        if (!F.prototype.isVisible.call(this)) return !1;
        var a = this.Ka,
            b = !0,
            c = this.g;
        null !== c && (b = c.ee);
        var d = this.$;
        if (null !== d) {
            if (this.jc && b && !d.Dc) return !1;
            if (d === a) return !0;
            for (c = d; null !== c;) {
                if (c.Xb === this) return !0;
                c = c.Ka
            }
            c = d.findVisibleNode();
            if (null === c || c === a) return !1
        }
        d = this.ba;
        if (null !== d) {
            if (this.jc && !b && !d.Dc) return !1;
            if (d === a) return !0;
            for (c = d; null !== c;) {
                if (c.Xb === this) return !0;
                c = c.Ka
            }
            b = d.findVisibleNode();
            if (null === b || b === a) return !1
        }
        return !0
    };
    J.prototype.Pd = function(a) {
        F.prototype.Pd.call(this, a);
        null !== this.Oi && this.Oi.wq();
        if (null !== this.Gf)
            for (var b = this.Gf.j; b.next();) b.value.Pd(a)
    };
    D.defineProperty(J, { Yp: "adjusting" }, function() { return this.ir }, function(a) {
        var b = this.ir;
        b !== a && (v && D.Da(a, J, J, "adjusting"), this.ir = a, this.i("adjusting", b, a))
    });
    D.defineProperty(J, { QA: "corner" }, function() { return this.Dr }, function(a) {
        var b = this.Dr;
        b !== a && (v && D.h(a, "number", J, "corner"), this.Dr = a, this.Te(), this.i("corner", b, a))
    });
    D.defineProperty(J, { jf: "curve" }, function() { return this.Gr }, function(a) {
        var b = this.Gr;
        b !== a && (v && D.Da(a, J, J, "curve"), this.Gr = a, this.ec(), this.Te(), Wr(this, b === uj || b === tj || a === uj || a === tj), this.i("curve", b, a))
    });
    D.defineProperty(J, { Nx: "curviness" }, function() { return this.Hr }, function(a) {
        var b = this.Hr;
        b !== a && (v && D.h(a, "number", J, "curviness"), this.Hr = a, this.ec(), this.Te(), this.i("curviness", b, a))
    });
    D.defineProperty(J, { My: "routing" }, function() { return this.on }, function(a) {
        var b = this.on;
        b !== a && (v && D.Da(a, J, J, "routing"), this.on = a, this.$i = null, this.ec(), Wr(this, 2 === (b.value & 2) || 2 === (a.value & 2)), this.i("routing", b, a))
    });
    D.defineProperty(J, { Yq: "smoothness" }, function() { return this.Jt }, function(a) {
        var b = this.Jt;
        b !== a && (v && D.h(a, "number", J, "smoothness"), this.Jt = a, this.Te(), this.i("smoothness", b, a))
    });

    function Tr(a) {
        var b = a.Cg;
        if (null !== b) {
            var c = a.Tg;
            if (null !== c) {
                var d = a.gi;
                a = a.Ai;
                for (var e = null, g = null, h = b.yc.o, k = h.length, l = 0; l < k; l++) { var m = h[l]; if (m.Cg === b && m.gi === d && m.Tg === c && m.Ai === a || m.Cg === c && m.gi === a && m.Tg === b && m.Ai === d) null === g ? g = m : (null === e && (e = [], e.push(g)), e.push(m)) }
                if (null !== e) {
                    g = Cr(b, c, d, a);
                    null === g && (g = new Il, g.Hq = b, g.Cy = d, g.av = c, g.Dy = a, Br(b, g), Br(c, g));
                    g.links = e;
                    for (l = 0; l < e.length; l++) m = e[l], m.Oi = g;
                    g.wq()
                }
            }
        }
    }

    function Sr(a) {
        var b = a.Oi;
        null !== b && (a.Oi = null, a = b.links.indexOf(a), 0 <= a && (D.Vg(b.links, a), b.wq()))
    }
    D.w(J, { key: "key" }, function() { var a = this.g; return null !== a && a.ea instanceof Y ? a.ea.mf(this.data) : void 0 }, { configurable: !0 });

    function Il() {
        D.xc(this);
        this.uh = this.pw = !1;
        this.Dy = this.av = this.Cy = this.Hq = null;
        this.links = []
    }
    Il.prototype.wq = function() {
        if (!this.pw) {
            var a = this.links;
            0 < a.length && (a = a[0].g, null !== a && (a.AD.add(this), this.uh = a.na.ub))
        }
        this.pw = !0
    };
    Il.prototype.tC = function() {
        if (this.pw) {
            this.pw = !1;
            var a = this.links;
            if (0 < a.length) {
                var b = a[0],
                    c = b.g,
                    c = null === c || c.Zn && !this.uh;
                this.uh = !1;
                b.arrangeBundledLinks(a, c);
                1 === a.length && (b.Oi = null, a.length = 0)
            }
            0 === a.length && (a = this.Hq, null !== this && null !== a.ai && a.ai.remove(this), a = this.av, null !== this && null !== a.ai && a.ai.remove(this))
        }
    };
    D.me(Il, { Hq: !0, Cy: !0, av: !0, Dy: !0, links: !0, spacing: !0 });

    function Nn() {
        D.xc(this);
        this.gC = this.group = null;
        this.vq = !0;
        this.abort = !1;
        this.ag = this.$f = 1;
        this.Is = this.Hs = -1;
        this.Rd = this.he = 8;
        this.sd = null;
        this.xH = !1;
        this.fH = 22;
        this.rG = 111
    }
    D.me(Nn, { group: !0, gC: !0, vq: !0, abort: !0, xH: !0, fH: !0, rG: !0 });
    Nn.prototype.initialize = function(a) {
        if (!(0 >= a.width || 0 >= a.height)) {
            var b = a.y,
                c = a.x + a.width,
                d = a.y + a.height;
            this.$f = Math.floor((a.x - this.he) / this.he) * this.he;
            this.ag = Math.floor((b - this.Rd) / this.Rd) * this.Rd;
            this.Hs = Math.ceil((c + 2 * this.he) / this.he) * this.he;
            this.Is = Math.ceil((d + 2 * this.Rd) / this.Rd) * this.Rd;
            a = 1 + (Math.ceil((this.Hs - this.$f) / this.he) | 0);
            b = 1 + (Math.ceil((this.Is - this.ag) / this.Rd) | 0);
            if (null === this.sd || this.zn < a - 1 || this.An < b - 1) {
                c = [];
                for (d = 0; d <= a; d++) c[d] = [];
                this.sd = c;
                this.zn = a - 1;
                this.An = b - 1
            }
            if (null !==
                this.sd)
                for (a = 0; a <= this.zn; a++)
                    for (b = 0; b <= this.An; b++) this.sd[a][b] = 1E6
        }
    };
    D.w(Nn, { pb: null }, function() { return new C(this.$f, this.ag, this.Hs - this.$f, this.Is - this.ag) });
    D.defineProperty(Nn, { cq: null }, function() { return this.he }, function(a) { 0 < a && a !== this.he && (this.he = a, this.initialize(this.pb)) });
    D.defineProperty(Nn, { aq: null }, function() { return this.Rd }, function(a) { 0 < a && a !== this.Rd && (this.Rd = a, this.initialize(this.pb)) });

    function as(a, b, c) { return a.$f <= b && b <= a.Hs && a.ag <= c && c <= a.Is }

    function cs(a, b, c) {
        if (!as(a, b, c)) return 1E6;
        b -= a.$f;
        b /= a.he;
        c -= a.ag;
        c /= a.Rd;
        return a.sd[b | 0][c | 0]
    }

    function Qn(a, b, c) { as(a, b, c) && (b -= a.$f, b /= a.he, c -= a.ag, c /= a.Rd, a.sd[b | 0][c | 0] = 0) }

    function Pn(a) {
        if (null !== a.sd)
            for (var b = 0; b <= a.zn; b++)
                for (var c = 0; c <= a.An; c++) 1 <= a.sd[b][c] && (a.sd[b][c] = 1E6)
    }
    Nn.prototype.Dq = function(a, b, c, d) {
        if (a > this.Hs || a + c < this.$f || b > this.Is || b + d < this.ag) return !0;
        a = (a - this.$f) / this.he | 0;
        b = (b - this.ag) / this.Rd | 0;
        c = Math.max(0, c) / this.he + 1 | 0;
        var e = Math.max(0, d) / this.Rd + 1 | 0;
        0 > a && (c += a, a = 0);
        0 > b && (e += b, b = 0);
        if (0 > c || 0 > e) return !0;
        d = Math.min(a + c - 1, this.zn) | 0;
        for (c = Math.min(b + e - 1, this.An) | 0; a <= d; a++)
            for (e = b; e <= c; e++)
                if (0 === this.sd[a][e]) return !1;
        return !0
    };

    function ls(a, b, c, d, e, g, h, k, l) {
        if (!(b < g || b > h || c < k || c > l)) {
            var m, n;
            m = b | 0;
            n = c | 0;
            var p = a.sd[m][n];
            if (1 <= p && 999999 > p)
                for (e ? n += d : m += d, p += 1; g <= m && m <= h && k <= n && n <= l && !(p >= a.sd[m][n]);) a.sd[m][n] = p, p += 1, e ? n += d : m += d;
            m = e ? n : m;
            if (e)
                if (0 < d)
                    for (c += d; c < m; c += d) ls(a, b, c, 1, !e, g, h, k, l), ls(a, b, c, -1, !e, g, h, k, l);
                else
                    for (c += d; c > m; c += d) ls(a, b, c, 1, !e, g, h, k, l), ls(a, b, c, -1, !e, g, h, k, l);
            else if (0 < d)
                for (b += d; b < m; b += d) ls(a, b, c, 1, !e, g, h, k, l), ls(a, b, c, -1, !e, g, h, k, l);
            else
                for (b += d; b > m; b += d) ls(a, b, c, 1, !e, g, h, k, l), ls(a, b, c, -1, !e, g, h,
                    k, l)
        }
    }

    function ms(a, b, c, d, e, g, h, k, l) {
        b |= 0;
        c |= 0;
        var m = 0,
            n = 1;
        for (a.sd[b][c] = n; 0 === m && b > g && b < h && c > k && c < l;) n += 1, a.sd[b][c] = n, e ? c += d : b += d, m = a.sd[b][c]
    }

    function ns(a, b, c, d, e, g, h, k, l) {
        b |= 0;
        c |= 0;
        var m = 0;
        for (a.sd[b][c] = 999999; 0 === m && b > g && b < h && c > k && c < l;) a.sd[b][c] = 999999, e ? c += d : b += d, m = a.sd[b][c]
    }

    function bs(a, b, c, d, e, g) {
        if (null !== a.sd) {
            a.abort = !1;
            var h = b.x,
                k = b.y;
            if (as(a, h, k) && (h -= a.$f, h /= a.he, k -= a.ag, k /= a.Rd, b = d.x, d = d.y, as(a, b, d)))
                if (b -= a.$f, b /= a.he, d -= a.ag, d /= a.Rd, 1 >= Math.abs(h - b) && 1 >= Math.abs(k - d)) a.abort = !0;
                else {
                    var l = g.x,
                        m = g.y,
                        n = g.x + g.width,
                        p = g.y + g.height,
                        l = l - a.$f,
                        l = l / a.he,
                        m = m - a.ag,
                        m = m / a.Rd,
                        n = n - a.$f,
                        n = n / a.he,
                        p = p - a.ag,
                        p = p / a.Rd;
                    g = Math.max(0, Math.min(a.zn, l | 0));
                    n = Math.min(a.zn, Math.max(0, n | 0));
                    m = Math.max(0, Math.min(a.An, m | 0));
                    p = Math.min(a.An, Math.max(0, p | 0));
                    h |= 0;
                    k |= 0;
                    b |= 0;
                    d |= 0;
                    l = 0 === c ||
                        90 === c ? 1 : -1;
                    c = 90 === c || 270 === c;
                    0 === a.sd[h][k] ? (ms(a, h, k, l, c, g, n, m, p), ms(a, h, k, 1, !c, g, n, m, p), ms(a, h, k, -1, !c, g, n, m, p)) : ms(a, h, k, l, c, h, k, h, k);
                    0 === a.sd[b][d] ? (ns(a, b, d, 0 === e || 90 === e ? 1 : -1, 90 === e || 270 === e, g, n, m, p), ns(a, b, d, 1, !(90 === e || 270 === e), g, n, m, p), ns(a, b, d, -1, !(90 === e || 270 === e), g, n, m, p)) : ns(a, b, d, l, c, b, d, b, d);
                    a.abort || (ls(a, h, k, 1, !1, g, n, m, p), ls(a, h, k, -1, !1, g, n, m, p), ls(a, h, k, 1, !0, g, n, m, p), ls(a, h, k, -1, !0, g, n, m, p))
                }
        }
    }

    function Zr() {
        D.xc(this);
        this.port = this.Zc = null;
        this.og = [];
        this.Gq = !1
    }
    D.me(Zr, { Zc: !0, port: !0, og: !0, Gq: !0 });
    Zr.prototype.toString = function() {
        for (var a = this.og, b = this.Zc.toString() + " " + a.length.toString() + ":", c = 0; c < a.length; c++) {
            var d = a[c];
            null !== d && (b += "\n  " + d.toString())
        }
        return b
    };

    function os(a, b, c, d) {
        b = b.offsetY;
        switch (b) {
            case D.qd:
                return 90;
            case D.bd:
                return 180;
            case D.Ad:
                return 270;
            case D.rd:
                return 0
        }
        switch (b) {
            case D.qd | D.Ad:
                return 180 < c ? 270 : 90;
            case D.bd | D.rd:
                return 90 < c && 270 >= c ? 180 : 0
        }
        a = 180 * Math.atan2(a.height, a.width) / Math.PI;
        switch (b) {
            case D.bd | D.Ad:
                return c > a && c <= 180 + a ? 180 : 270;
            case D.Ad | D.rd:
                return c > 180 - a && c <= 360 - a ? 270 : 0;
            case D.rd | D.qd:
                return c > a && c <= 180 + a ? 90 : 0;
            case D.qd | D.bd:
                return c > 180 - a && c <= 360 - a ? 180 : 90;
            case D.bd | D.Ad | D.rd:
                return 90 < c && c <= 180 + a ? 180 : c > 180 + a && c <= 360 -
                    a ? 270 : 0;
            case D.Ad | D.rd | D.qd:
                return 180 < c && c <= 360 - a ? 270 : c > a && 180 >= c ? 90 : 0;
            case D.rd | D.qd | D.bd:
                return c > a && c <= 180 - a ? 90 : c > 180 - a && 270 >= c ? 180 : 0;
            case D.qd | D.bd | D.Ad:
                return c > 180 - a && c <= 180 + a ? 180 : c > 180 + a ? 270 : 90
        }
        d && b !== (D.bd | D.Ad | D.rd | D.qd) && (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
    }
    Zr.prototype.wq = function() { this.og.length = 0 };

    function $r(a, b) {
        var c = a.og;
        if (0 === c.length) {
            a: if (!a.Gq) {
                c = a.Gq;
                a.Gq = !0;
                var d, e = null,
                    g = a.Zc,
                    g = g instanceof I ? g : null;
                if (null === g || g.md) d = a.Zc.FF(a.port.yd);
                else {
                    if (!g.aa.H()) { a.Gq = c; break a }
                    e = g;
                    d = e.EF()
                }
                var h = a.og.length = 0,
                    k = a.port.fb(ec, D.P()),
                    l = a.port.fb(vc, D.P()),
                    g = D.vg(k.x, k.y, 0, 0);
                g.Mi(l);
                D.A(k);
                D.A(l);
                k = D.Fb(g.x + g.width / 2, g.y + g.height / 2);
                l = a.port.sm();
                for (d = d.j; d.next();) {
                    var m = d.value;
                    if (m.isVisible() && m.oc !== m.Gc) {
                        var n = m.oc === a.port || m.$.Fi(e),
                            p = m.computeSpot(n, a.port);
                        if (p.Pj() && (n = n ? m.Gc :
                                m.oc, null !== n)) {
                            var q = n.Y;
                            if (null !== q) {
                                var r = q.findVisibleNode();
                                null !== r && r !== q && (q = r, n = q.port);
                                n = m.computeOtherPoint(q, n);
                                q = k.Wb(n);
                                q -= l;
                                0 > q && (q += 360);
                                p = os(g, p, q, m.ic);
                                r = 0;
                                0 === p ? (r = D.rd, 180 < q && (q -= 360)) : r = 90 === p ? D.qd : 180 === p ? D.bd : D.Ad;
                                p = a.og[h];
                                void 0 === p ? (p = new ps(m, q, r), a.og[h] = p) : (p.link = m, p.angle = q, p.Le = r);
                                p.Ay.set(n);
                                h++
                            }
                        }
                    }
                }
                D.A(k);
                a.og.sort(Zr.prototype.VJ);
                e = a.og.length;
                k = -1;
                for (h = l = 0; h < e; h++) p = a.og[h], void 0 !== p && (p.Le !== k && (k = p.Le, l = 0), p.tq = l, l++);
                k = -1;
                l = 0;
                for (h = e - 1; 0 <= h; h--) p = a.og[h], void 0 !==
                    p && (p.Le !== k && (k = p.Le, l = p.tq + 1), p.Ln = l);
                h = a.og;
                p = a.port;
                e = a.Zc.$J;
                k = D.P();
                l = D.P();
                d = D.P();
                m = D.P();
                p.fb(ec, k);
                p.fb(kc, l);
                p.fb(vc, d);
                p.fb(tc, m);
                r = q = n = p = 0;
                if (e === Ar)
                    for (var s = 0; s < h.length; s++) {
                        var u = h[s];
                        if (null !== u) {
                            var t = u.link.computeThickness();
                            switch (u.Le) {
                                case D.qd:
                                    q += t;
                                    break;
                                case D.bd:
                                    r += t;
                                    break;
                                case D.Ad:
                                    p += t;
                                    break;
                                default:
                                case D.rd:
                                    n += t
                            }
                        }
                    }
                for (var y = 0, w = 0, A = 1, s = 0; s < h.length; s++)
                    if (u = h[s], null !== u) {
                        var B, P;
                        if (y !== u.Le) {
                            y = u.Le;
                            switch (y) {
                                case D.qd:
                                    B = d;
                                    P = m;
                                    break;
                                case D.bd:
                                    B = m;
                                    P = k;
                                    break;
                                case D.Ad:
                                    B =
                                        k;
                                    P = l;
                                    break;
                                default:
                                case D.rd:
                                    B = l, P = d
                            }
                            var H = P.x - B.x;
                            P = P.y - B.y;
                            switch (y) {
                                case D.qd:
                                    q > Math.abs(H) ? (A = Math.abs(H) / q, q = Math.abs(H)) : A = 1;
                                    break;
                                case D.bd:
                                    r > Math.abs(P) ? (A = Math.abs(P) / r, r = Math.abs(P)) : A = 1;
                                    break;
                                case D.Ad:
                                    p > Math.abs(H) ? (A = Math.abs(H) / p, p = Math.abs(H)) : A = 1;
                                    break;
                                default:
                                case D.rd:
                                    n > Math.abs(P) ? (A = Math.abs(P) / n, n = Math.abs(P)) : A = 1
                            }
                            w = 0
                        }
                        var R = u.Eq;
                        if (e === Ar) {
                            t = u.link.computeThickness();
                            t *= A;
                            R.set(B);
                            switch (y) {
                                case D.qd:
                                    R.x = B.x + H / 2 + q / 2 - w - t / 2;
                                    break;
                                case D.bd:
                                    R.y = B.y + P / 2 + r / 2 - w - t / 2;
                                    break;
                                case D.Ad:
                                    R.x =
                                        B.x + H / 2 - p / 2 + w + t / 2;
                                    break;
                                default:
                                case D.rd:
                                    R.y = B.y + P / 2 - n / 2 + w + t / 2
                            }
                            w += t
                        } else t = .5, e === xr && (t = (u.tq + 1) / (u.Ln + 1)), R.x = B.x + H * t, R.y = B.y + P * t
                    }
                D.A(k);
                D.A(l);
                D.A(d);
                D.A(m);
                B = a.og;
                for (H = 0; H < B.length; H++) P = B[H], null !== P && (P.Sx = a.computeEndSegmentLength(P));
                a.Gq = c;
                D.Lb(g)
            }c = a.og
        }
        for (g = 0; g < c.length; g++)
            if (B = c[g], null !== B && B.link === b) return B;
        return null
    }
    Zr.prototype.VJ = function(a, b) { return a === b ? 0 : null === a ? -1 : null === b ? 1 : a.Le < b.Le ? -1 : a.Le > b.Le ? 1 : a.angle < b.angle ? -1 : a.angle > b.angle ? 1 : 0 };
    Zr.prototype.computeEndSegmentLength = function(a) {
        var b = a.link,
            c = b.computeEndSegmentLength(this.Zc, this.port, dc, b.oc === this.port),
            d = a.tq;
        if (0 > d) return c;
        var e = a.Ln;
        if (1 >= e || !b.ic) return c;
        var b = a.Ay,
            g = a.Eq;
        if (a.Le === D.bd || a.Le === D.qd) d = e - 1 - d;
        return ((a = a.Le === D.bd || a.Le === D.rd) ? b.y < g.y : b.x < g.x) ? c + 8 * d : (a ? b.y === g.y : b.x === g.x) ? c : c + 8 * (e - 1 - d)
    };

    function ps(a, b, c) {
        this.link = a;
        this.angle = b;
        this.Le = c;
        this.Ay = new N;
        this.Ln = this.tq = 0;
        this.Eq = new N;
        this.Sx = 0
    }
    D.me(ps, { link: !0, angle: !0, Le: !0, Ay: !0, tq: !0, Ln: !0, Eq: !0, Sx: !0 });
    ps.prototype.toString = function() { return this.link.toString() + " " + this.angle.toString() + " " + this.Le.toString() + ":" + this.tq.toString() + "/" + this.Ln.toString() + " " + this.Eq.toString() + " " + this.Sx.toString() + " " + this.Ay.toString() };

    function Eo() {
        this.Mk = this.ok = Vc;
        this.Kk = this.mk = NaN;
        this.Jk = this.lk = yr;
        this.Lk = this.nk = NaN;
        this.St = this.as = null;
        this.Tt = this.bs = Infinity
    }
    Eo.prototype.copy = function() {
        var a = new Eo;
        a.ok = this.ok.V();
        a.Mk = this.Mk.V();
        a.mk = this.mk;
        a.Kk = this.Kk;
        a.lk = this.lk;
        a.Jk = this.Jk;
        a.nk = this.nk;
        a.Lk = this.Lk;
        a.as = this.as;
        a.St = this.St;
        a.bs = this.bs;
        a.Tt = this.Tt;
        return a
    };

    function I(a) {
        G.call(this, a);
        this.Ca |= 4608;
        this.Ks = new L(F);
        this.gn = new L(I);
        this.Rb = this.Nt = this.Rl = this.Ls = this.Js = null;
        this.we = new $g;
        this.we.group = this
    }
    D.Ta(I, G);
    D.ka("Group", I);
    I.prototype.cloneProtected = function(a) {
        G.prototype.cloneProtected.call(this, a);
        this.Ca &= -32769;
        a.Js = this.Js;
        a.Ls = this.Ls;
        a.Rl = this.Rl;
        a.Nt = this.Nt;
        var b = a.qu(function(a) { return a instanceof Yj });
        a.Rb = b instanceof Yj ? b : null;
        null !== this.we ? (a.we = this.we.copy(), a.we.group = a) : (null !== a.we && (a.we.group = null), a.we = null)
    };
    I.prototype.Ei = function(a) {
        G.prototype.Ei.call(this, a);
        var b = a.pq();
        for (a = a.uc; a.next();) {
            var c = a.value;
            c.K();
            c.L(8);
            c.iu();
            if (c instanceof G) c.kg(b);
            else if (c instanceof J)
                for (c = c.Af; c.next();) c.value.kg(b)
        }
    };
    I.prototype.qo = function(a, b, c, d, e, g, h) {
        if (a === hg && "elements" === b)
            if (e instanceof Yj) {
                var k = e;
                null === this.Rb ? this.Rb = k : this.Rb !== k && D.k("Cannot insert a second Placeholder into the visual tree of a Group.")
            } else e instanceof x && (k = e.qu(function(a) { return a instanceof Yj }), k instanceof Yj && (null === this.Rb ? this.Rb = k : this.Rb !== k && D.k("Cannot insert a second Placeholder into the visual tree of a Group.")));
        else a === ig && "elements" === b && null !== this.Rb && (d === this.Rb ? this.Rb = null : d instanceof x && this.Rb.xm(d) &&
            (this.Rb = null));
        G.prototype.qo.call(this, a, b, c, d, e, g, h)
    };
    I.prototype.Cj = function(a, b, c, d) {
        this.Ql = this.Rb;
        x.prototype.Cj.call(this, a, b, c, d)
    };
    I.prototype.ym = function() { if (!G.prototype.ym.call(this)) return !1; for (var a = this.uc; a.next();) { var b = a.value; if (b instanceof G) { if (b.isVisible() && Om(b)) return !1 } else if (b instanceof J && b.isVisible() && Om(b) && b.$ !== this && b.ba !== this) return !1 } return !0 };
    D.w(I, { placeholder: "placeholder" }, function() { return this.Rb });
    D.defineProperty(I, { nI: "computesBoundsAfterDrag" }, function() { return 0 !== (this.Ca & 2048) }, function(a) {
        var b = 0 !== (this.Ca & 2048);
        b !== a && (D.h(a, "boolean", I, "computesBoundsAfterDrag"), this.Ca ^= 2048, this.i("computesBoundsAfterDrag", b, a))
    });
    D.defineProperty(I, { Jx: "computesBoundsIncludingLinks" }, function() { return 0 !== (this.Ca & 4096) }, function(a) {
        D.h(a, "boolean", I, "computesBoundsIncludingLinks");
        var b = 0 !== (this.Ca & 4096);
        b !== a && (this.Ca ^= 4096, this.i("computesBoundsIncludingLinks", b, a))
    });
    D.defineProperty(I, { oI: "computesBoundsIncludingLocation" }, function() { return 0 !== (this.Ca & 8192) }, function(a) {
        D.h(a, "boolean", I, "computesBoundsIncludingLocation");
        var b = 0 !== (this.Ca & 8192);
        b !== a && (this.Ca ^= 8192, this.i("computesBoundsIncludingLocation", b, a))
    });
    D.defineProperty(I, { cJ: "handlesDragDropForMembers" }, function() { return 0 !== (this.Ca & 16384) }, function(a) {
        D.h(a, "boolean", I, "handlesDragDropForMembers");
        var b = 0 !== (this.Ca & 16384);
        b !== a && (this.Ca ^= 16384, this.i("handlesDragDropForMembers", b, a))
    });
    D.w(I, { uc: "memberParts" }, function() { return this.Ks.j });

    function tr(a, b) {
        if (a.Ks.add(b)) {
            b instanceof I && a.gn.add(b);
            var c = a.MJ;
            if (null !== c) {
                var d = !0,
                    e = a.g;
                null !== e && (d = e.$a, e.$a = !0);
                c(a, b);
                null !== e && (e.$a = d)
            }
            a.isVisible() && a.md || b.Pd(!1)
        }
        b instanceof J && !a.Jx || (c = a.Rb, null === c && (c = a), c.K())
    }

    function sr(a, b) {
        if (a.Ks.remove(b)) {
            b instanceof I && a.gn.remove(b);
            var c = a.NJ;
            if (null !== c) {
                var d = !0,
                    e = a.g;
                null !== e && (d = e.$a, e.$a = !0);
                c(a, b);
                null !== e && (e.$a = d)
            }
            a.isVisible() && a.md || b.Pd(!0)
        }
        b instanceof J && !a.Jx || (c = a.Rb, null === c && (c = a), c.K())
    }
    I.prototype.Nn = function() {
        if (0 < this.Ks.count) {
            var a = this.g;
            if (null !== a)
                for (var b = this.Ks.copy().j; b.next();) a.remove(b.value)
        }
        G.prototype.Nn.call(this)
    };
    D.defineProperty(I, { Yb: "layout" }, function() { return this.we }, function(a) {
        var b = this.we;
        b !== a && (null !== a && D.l(a, $g, I, "layout"), null !== b && (b.g = null, b.group = null), this.we = a, null !== a && (a.g = this.g, a.group = this), this.i("layout", b, a))
    });
    D.defineProperty(I, { MJ: "memberAdded" }, function() { return this.Js }, function(a) {
        var b = this.Js;
        b !== a && (null !== a && D.h(a, "function", I, "memberAdded"), this.Js = a, this.i("memberAdded", b, a))
    });
    D.defineProperty(I, { NJ: "memberRemoved" }, function() { return this.Ls }, function(a) {
        var b = this.Ls;
        b !== a && (null !== a && D.h(a, "function", I, "memberRemoved"), this.Ls = a, this.i("memberRemoved", b, a))
    });
    D.defineProperty(I, { BB: "memberValidation" }, function() { return this.Rl }, function(a) {
        var b = this.Rl;
        b !== a && (null !== a && D.h(a, "function", I, "memberValidation"), this.Rl = a, this.i("memberValidation", b, a))
    });
    I.prototype.canAddMembers = function(a) {
        var b = this.g;
        if (null === b) return !1;
        b = b.yb;
        for (a = Xh(a).j; a.next();)
            if (!b.isValidMember(this, a.value)) return !1;
        return !0
    };
    I.prototype.addMembers = function(a, b) { var c = this.g; if (null === c) return !1; for (var c = c.yb, d = !0, e = Xh(a).j; e.next();) { var g = e.value;!b || c.isValidMember(this, g) ? g.Ka = this : d = !1 } return d };
    D.defineProperty(I, { IK: "ungroupable" }, function() { return 0 !== (this.Ca & 256) }, function(a) {
        var b = 0 !== (this.Ca & 256);
        b !== a && (D.h(a, "boolean", I, "ungroupable"), this.Ca ^= 256, this.i("ungroupable", b, a))
    });
    I.prototype.canUngroup = function() {
        if (!this.IK) return !1;
        var a = this.layer;
        if (null !== a && !a.Ex) return !1;
        a = a.g;
        return null === a || a.Ex ? !0 : !1
    };
    I.prototype.kg = function(a) {
        void 0 === a && (a = null);
        var b = 0 !== (this.Ca & 65536);
        G.prototype.kg.call(this, a);
        if (!b)
            for (0 !== (this.Ca & 65536) !== !0 && (this.Ca ^= 65536), b = this.EF(); b.next();) {
                var c = b.value;
                if (null === a || !a.contains(c)) {
                    var d = c.$;
                    null !== d && d !== this && d.Fi(this) && !d.isVisible() ? (Dr(d, c.oc), Dr(d, c.Gc), c.ec()) : (d = c.ba, null !== d && d !== this && d.Fi(this) && !d.isVisible() && (Dr(d, c.oc), Dr(d, c.Gc), c.ec()))
                }
            }
    };
    I.prototype.findExternalLinksConnected = I.prototype.EF = function() {
        var a = this.pq();
        a.add(this);
        for (var b = new L(J), c = a.j; c.next();) {
            var d = c.value;
            if (d instanceof G)
                for (d = d.Od; d.next();) {
                    var e = d.value;
                    a.contains(e) || b.add(e)
                }
        }
        return b.j
    };
    I.prototype.findExternalNodesConnected = function() {
        var a = this.pq();
        a.add(this);
        for (var b = new L(G), c = a.j; c.next();) {
            var d = c.value;
            if (d instanceof G)
                for (d = d.Od; d.next();) {
                    var e = d.value,
                        g = e.$;
                    a.contains(g) && g !== this || b.add(g);
                    e = e.ba;
                    a.contains(e) && e !== this || b.add(e)
                }
        }
        return b.j
    };
    I.prototype.findContainingGroupChain = function() {
        function a(b, d) { null !== b && (d.add(b), a(b.Ka, d)) }
        var b = new L(I);
        a(this, b);
        return b
    };
    I.prototype.findSubGraphParts = I.prototype.pq = function() {
        var a = new L(F);
        Qh(a, this, !0, 0, !0);
        a.remove(this);
        return a
    };
    I.prototype.Pd = function(a) { G.prototype.Pd.call(this, a); for (var b = this.uc; b.next();) b.value.Pd(a) };
    I.prototype.collapseSubGraph = I.prototype.collapseSubGraph = function() {
        var a = this.g;
        if (null !== a && !a.Ph) {
            a.Ph = !0;
            var b = this.pq();
            qs(this, b, a.Ra, this);
            a.Ph = !1
        }
    };

    function qs(a, b, c, d) {
        for (var e = a.uc; e.next();) {
            var g = e.value;
            g.Pd(!1);
            if (g instanceof I) {
                var h = g;
                h.md && (h.Zy = h.md, qs(h, b, c, d))
            }
            if (g instanceof G) g.kg(b), ql(c, g, d);
            else if (g instanceof J)
                for (g = g.Af; g.next();) g.value.kg(b)
        }
        a.md = !1
    }
    I.prototype.expandSubGraph = I.prototype.expandSubGraph = function() {
        var a = this.g;
        if (null !== a && !a.Ph) {
            a.Ph = !0;
            var b = this.pq();
            rs(this, b, a.Ra, this);
            a.Ph = !1
        }
    };

    function rs(a, b, c, d) {
        for (var e = a.uc; e.next();) {
            var g = e.value;
            g.Pd(!0);
            if (g instanceof I) {
                var h = g;
                h.Zy && (h.Zy = !1, rs(h, b, c, d))
            }
            if (g instanceof G) g.kg(b), pl(c, g, d);
            else if (g instanceof J)
                for (g = g.Af; g.next();) g.value.kg(b)
        }
        a.md = !0
    }
    D.defineProperty(I, { md: "isSubGraphExpanded" }, function() { return 0 !== (this.Ca & 512) }, function(a) {
        var b = 0 !== (this.Ca & 512);
        if (b !== a) {
            D.h(a, "boolean", I, "isSubGraphExpanded");
            this.Ca ^= 512;
            var c = this.g;
            this.i("isSubGraphExpanded", b, a);
            b = this.yK;
            if (null !== b) {
                var d = !0;
                null !== c && (d = c.$a, c.$a = !0);
                b(this);
                null !== c && (c.$a = d)
            }
            null !== c && c.na.ub ? null !== this.Rb && this.Rb.K() : a ? this.expandSubGraph() : this.collapseSubGraph()
        }
    });
    D.defineProperty(I, { Zy: "wasSubGraphExpanded" }, function() { return 0 !== (this.Ca & 1024) }, function(a) {
        var b = 0 !== (this.Ca & 1024);
        b !== a && (D.h(a, "boolean", I, "wasSubGraphExpanded"), this.Ca ^= 1024, this.i("wasSubGraphExpanded", b, a))
    });
    D.defineProperty(I, { yK: "subGraphExpandedChanged" }, function() { return this.Nt }, function(a) {
        var b = this.Nt;
        b !== a && (null !== a && D.h(a, "function", I, "subGraphExpandedChanged"), this.Nt = a, this.i("subGraphExpandedChanged", b, a))
    });
    I.prototype.move = function(a) {
        var b = this.position,
            c = b.x;
        isNaN(c) && (c = 0);
        b = b.y;
        isNaN(b) && (b = 0);
        var c = a.x - c,
            b = a.y - b,
            d = D.Fb(c, b);
        G.prototype.move.call(this, a);
        a = new L(J);
        for (var e = this.pq().j; e.next();) {
            var g = e.value;
            g instanceof J && (g.Ji && a.add(g), g.Ji = !0)
        }
        for (e.reset(); e.next();)
            if (g = e.value, !(g instanceof J || g instanceof G && g.Lf)) {
                var h = g.position,
                    k = g.location;
                h.H() ? (d.x = h.x + c, d.y = h.y + b, g.position = d) : k.H() && (d.x = k.x + c, d.y = k.y + b, g.location = d)
            }
        for (e.reset(); e.next();)
            if (g = e.value, g instanceof J && (g.Ji =
                    a.contains(g), g.Uf || g.$ !== this && g.ba !== this)) h = g.position, d.x = h.x + c, d.y = h.y + b, g.move(d), Mi(g) && g.ec();
        D.A(d)
    };
    D.defineProperty(I, { no: null }, function() { return 0 !== (this.Ca & 32768) }, function(a) { 0 !== (this.Ca & 32768) !== a && (this.Ca ^= 32768) });

    function Yj() {
        O.call(this);
        this.tf = Sd;
        this.xt = new C(NaN, NaN, NaN, NaN)
    }
    D.Ta(Yj, O);
    D.ka("Placeholder", Yj);
    Yj.prototype.cloneProtected = function(a) {
        O.prototype.cloneProtected.call(this, a);
        a.tf = this.tf.V();
        a.xt = this.xt.copy()
    };
    Yj.prototype.Rk = function(a) { if (null === this.background && null === this.gm) return !1; var b = this.Ga; return Vb(0, 0, b.width, b.height, a.x, a.y) };
    Yj.prototype.ho = function() {
        var a = this.Y;
        null !== a && (a instanceof I || a instanceof da) || D.k("Placeholder is not inside a Group or Adornment.");
        if (a instanceof I) {
            var b = this.computeBorder(this.xt),
                c = this.fd;
            Cb(c, b.width || 0, b.height || 0);
            Jo(this, 0, 0, c.width, c.height);
            for (var d = a.uc, c = !1; d.next();)
                if (d.value.isVisible()) { c = !0; break }
            d = a.g;
            !c || null === d || d.Ra.nf || isNaN(b.x) || isNaN(b.y) || (c = D.P(), c.uo(b, a.Of), a.location = new N(c.x, c.y), D.A(c))
        } else {
            var b = this.Ea,
                c = this.fd,
                d = this.padding,
                e = d.left + d.right,
                g = d.top +
                d.bottom;
            if (b.H()) Cb(c, b.width + e || 0, b.height + g || 0), Jo(this, -d.left, -d.top, c.width, c.height);
            else {
                var h = a.Bb,
                    k = h.fb(ec, D.P()),
                    b = D.vg(k.x, k.y, 0, 0);
                b.Mi(h.fb(vc, k));
                b.Mi(h.fb(kc, k));
                b.Mi(h.fb(tc, k));
                a.jj.n(b.x, b.y);
                Cb(c, b.width + e || 0, b.height + g || 0);
                Jo(this, -d.left, -d.top, c.width, c.height);
                D.A(k);
                D.Lb(b)
            }
        }
    };
    Yj.prototype.Cj = function(a, b, c, d) {
        var e = this.aa;
        e.x = a;
        e.y = b;
        e.width = c;
        e.height = d
    };
    Yj.prototype.computeBorder = function(a) {
        var b = this.Y;
        if (b instanceof I) { var c = b; if (c.nI && this.xt.H()) { var d = c.g; if (null !== d && (d = d.eb, d instanceof Uh && !d.Vr && null !== d.hc && !d.hc.contains(c))) return a.assign(this.xt), a } }
        var c = D.Sf(),
            d = this.computeMemberBounds(c),
            e = this.padding;
        a.n(d.x - e.left, d.y - e.top, Math.max(d.width + e.left + e.right, 0), Math.max(d.height + e.top + e.bottom, 0));
        D.Lb(c);
        b instanceof I && (c = b, c.oI && c.location.H() && a.Mi(c.location));
        return a
    };
    Yj.prototype.computeMemberBounds = function(a) {
        if (!(this.Y instanceof I)) return a.n(0, 0, 0, 0), a;
        for (var b = this.Y, c = Infinity, d = Infinity, e = -Infinity, g = -Infinity, h = b.uc; h.next();) {
            var k = h.value;
            if (k.isVisible()) {
                if (k instanceof J) { var l = k; if (!b.Jx) continue; if (Nm(l)) continue; if (l.$ === b || l.ba === b) continue }
                k = k.aa;
                k.left < c && (c = k.left);
                k.top < d && (d = k.top);
                k.right > e && (e = k.right);
                k.bottom > g && (g = k.bottom)
            }
        }
        isFinite(c) && isFinite(d) ? a.n(c, d, e - c, g - d) : (b = b.location, c = this.padding, a.n(b.x + c.left, b.y + c.top, 0, 0));
        return a
    };
    D.defineProperty(Yj, { padding: "padding" }, function() { return this.tf }, function(a) {
        "number" === typeof a ? a = new Lb(a) : D.l(a, Lb, Yj, "padding");
        var b = this.tf;
        b.O(a) || (this.tf = a = a.V(), this.i("padding", b, a))
    });

    function $g() {
        0 < arguments.length && D.zd($g);
        D.xc(this);
        this.Uz = this.ca = null;
        this.Kl = this.qs = !0;
        this.ws = !1;
        this.mr = (new N(0, 0)).freeze();
        this.ss = this.ts = !0;
        this.mD = "";
        this.vs = !1;
        this.gA = null
    }
    D.ka("Layout", $g);
    $g.prototype.cloneProtected = function(a) {
        a.qs = this.qs;
        a.Kl = this.Kl;
        a.ws = this.ws;
        a.mr.assign(this.mr);
        a.ts = this.ts;
        a.ss = this.ss;
        a.mD = this.mD;
        a.vs = !0
    };
    $g.prototype.copy = function() {
        var a = new this.constructor;
        this.cloneProtected(a);
        return a
    };
    $g.prototype.qc = function(a) { D.ak(this, a) };
    $g.prototype.toString = function() {
        var a = D.wf(Object.getPrototypeOf(this)),
            a = a + "(";
        null !== this.group && (a += " in " + this.group);
        null !== this.g && (a += " for " + this.g);
        return a + ")"
    };
    D.defineProperty($g, { g: "diagram" }, function() { return this.ca }, function(a) {
        null !== a && D.l(a, E, $g, "diagram");
        this.ca = a
    });
    D.defineProperty($g, { group: "group" }, function() { return this.Uz }, function(a) { this.Uz !== a && (null !== a && D.l(a, I, $g, "group"), this.Uz = a, null !== a && (this.ca = a.g)) });
    D.defineProperty($g, { tJ: "isOngoing" }, function() { return this.qs }, function(a) { this.qs !== a && (D.h(a, "boolean", $g, "isOngoing"), this.qs = a) });
    D.defineProperty($g, { kG: "isInitial" }, function() { return this.Kl }, function(a) {
        D.h(a, "boolean", $g, "isInitial");
        this.Kl = a;
        a || (this.vs = !0)
    });
    D.defineProperty($g, { my: "isViewportSized" }, function() { return this.ws }, function(a) { this.ws !== a && (D.h(a, "boolean", $g, "isViewportSized"), (this.ws = a) && this.L()) });
    D.defineProperty($g, { Pu: "isRouting" }, function() { return this.ts }, function(a) { this.ts !== a && (D.h(a, "boolean", $g, "isRouting"), this.ts = a) });
    D.defineProperty($g, { mG: "isRealtime" }, function() { return this.ss }, function(a) { this.ss !== a && (D.h(a, "boolean", $g, "isRealtime"), this.ss = a) });
    D.defineProperty($g, { zf: "isValidLayout" }, function() { return this.vs }, function(a) { this.vs !== a && (D.h(a, "boolean", $g, "isValidLayout"), this.vs = a, a || (a = this.g, null !== a && (a.xl = !0))) });
    $g.prototype.invalidateLayout = $g.prototype.L = function() { if (this.zf) { var a = this.g; if (null !== a && !a.na.ub) { var b = a.Ra;!b.np && (b.nf && b.Yh(), this.tJ && a.Zn || this.kG && !a.Zn) && (this.zf = !1, a.Ve()) } } };
    D.defineProperty($g, { network: "network" }, function() { return this.gA }, function(a) {
        var b = this.gA;
        b !== a && (null !== a && D.l(a, ua, $g, "network"), null !== b && (b.Yb = null), this.gA = a, null !== a && (a.Yb = this))
    });
    $g.prototype.createNetwork = function() { return new ua };
    $g.prototype.makeNetwork = function(a) {
        var b = this.createNetwork();
        b.Yb = this;
        a instanceof E ? (b.Ok(a.rg, !0), b.Ok(a.links, !0)) : a instanceof I ? b.Ok(a.uc) : b.Ok(a.j);
        return b
    };
    $g.prototype.updateParts = function() {
        var a = this.g;
        if (null === a && null !== this.network)
            for (var b = this.network.vertexes.j; b.next();) { var c = b.value.Zc; if (null !== c && (a = c.g, null !== a)) break }
        this.zf = !0;
        try { null !== a && a.Nb("Layout"), this.commitLayout() } finally { null !== a && a.jd("Layout") }
    };
    $g.prototype.commitLayout = function() {
        for (var a = this.network.vertexes.j; a.next();) a.value.commit();
        if (this.Pu)
            for (a = this.network.edges.j; a.next();) a.value.commit()
    };
    $g.prototype.doLayout = function(a) {
        null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
        var b = new L(F);
        a instanceof E ? (ss(this, b, a.rg, !0, this.no, !0, !1, !0), ss(this, b, a.Hi, !0, this.no, !0, !1, !0)) : a instanceof I ? ss(this, b, a.uc, !1, this.no, !0, !1, !0) : b.Vc(a.j);
        var c = b.count;
        if (0 < c) {
            a = this.g;
            null !== a && a.Nb("Layout");
            c = Math.ceil(Math.sqrt(c));
            this.Zd = this.initialOrigin(this.Zd);
            for (var d = this.Zd.x, e = d, g = this.Zd.y, h = 0, k = 0, b = b.j; b.next();) {
                var l =
                    b.value;
                l.kf();
                var m = l.Fa,
                    n = m.width,
                    m = m.height;
                l.moveTo(e, g);
                l instanceof I && (l.no = !1);
                e += Math.max(n, 50) + 20;
                k = Math.max(k, Math.max(m, 50));
                h >= c - 1 ? (h = 0, e = d, g += k + 20, k = 0) : h++
            }
            null !== a && a.jd("Layout")
        }
        this.zf = !0
    };
    $g.prototype.no = function(a) { return !a.location.H() || a instanceof I && a.no ? !0 : !1 };

    function ss(a, b, c, d, e, g, h, k) {
        for (c = c.j; c.next();) {
            var l = c.value;
            d && !l.Bq || null !== e && !e(l) || !l.canLayout() || (g && l instanceof G ? l.Lf || (l instanceof I ? null === l.Yb ? ss(a, b, l.uc, !1, e, g, h, k) : (ts(l), b.add(l)) : (ts(l), b.add(l))) : h && l instanceof J ? b.add(l) : !k || !l.qe() || l instanceof G || (ts(l), b.add(l)))
        }
    }

    function ts(a) {
        var b = a.aa;
        (0 === b.width || 0 === b.height || isNaN(b.width) || isNaN(b.height)) && a.kf()
    }
    $g.prototype.collectParts = $g.prototype.iI = function(a) {
        var b = new L(F);
        a instanceof E ? (ss(this, b, a.rg, !0, null, !0, !0, !0), ss(this, b, a.links, !0, null, !0, !0, !0), ss(this, b, a.Hi, !0, null, !0, !0, !0)) : a instanceof I ? ss(this, b, a.uc, !1, null, !0, !0, !0) : ss(this, b, a.j, !1, null, !0, !0, !0);
        return b
    };
    D.defineProperty($g, { Zd: "arrangementOrigin" }, function() { return this.mr }, function(a) {
        D.l(a, N, $g, "arrangementOrigin");
        this.mr.O(a) || (this.mr.assign(a), this.L())
    });
    $g.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.fb(ec), (isNaN(c.x) || isNaN(c.y)) && c.set(a), c.x += b.padding.left, c.y += b.padding.top);
            return c
        }
        return a
    };

    function ua() {
        D.xc(this);
        this.we = null;
        if (this.vertexes)
            for (var a = this.vertexes.j; a.next();) {
                var b = a.value;
                b.clear();
                b.network = null
            }
        if (this.edges)
            for (a = this.edges.j; a.next();) b = a.value, b.clear(), b.network = null;
        this.vertexes = new L(va);
        this.edges = new L(wa);
        this.xy = new oa(G, va);
        this.qy = new oa(J, wa)
    }
    D.ka("LayoutNetwork", ua);
    ua.prototype.clear = function() {
        if (this.vertexes)
            for (var a = this.vertexes.j; a.next();) {
                var b = a.value;
                b.clear();
                b.network = null
            }
        if (this.edges)
            for (a = this.edges.j; a.next();) b = a.value, b.clear(), b.network = null;
        this.vertexes = new L(va);
        this.edges = new L(wa);
        this.xy = new oa(G, va);
        this.qy = new oa(J, wa)
    };
    ua.prototype.toString = function(a) {
        void 0 === a && (a = 0);
        var b = "LayoutNetwork" + (null !== this.Yb ? "(" + this.Yb.toString() + ")" : "");
        if (0 >= a) return b;
        b += " vertexes: " + this.vertexes.count + " edges: " + this.edges.count;
        if (1 < a) { for (var c = this.vertexes.j; c.next();) b += "\n    " + c.value.toString(a - 1); for (c = this.edges.j; c.next();) b += "\n    " + c.value.toString(a - 1) }
        return b
    };
    D.defineProperty(ua, { Yb: "layout" }, function() { return this.we }, function(a) {
        v && null !== a && D.l(a, $g, ua, "layout");
        this.we = a
    });
    ua.prototype.createVertex = function() { return new va };
    ua.prototype.createEdge = function() { return new wa };
    ua.prototype.addParts = ua.prototype.Ok = function(a, b, c) {
        if (null !== a) {
            void 0 === b && (b = !1);
            D.h(b, "boolean", ua, "addParts:toplevelonly");
            void 0 === c && (c = null);
            null === c && (c = function(a) {
                if (a instanceof G) return !a.Lf;
                if (a instanceof J) {
                    var b = a.$;
                    if (null === b || b.Lf) return !1;
                    a = a.ba;
                    return null === a || a.Lf ? !1 : !0
                }
                return !1
            });
            for (a = a.j; a.next();) {
                var d = a.value;
                if (d instanceof G && (!b || d.Bq) && d.canLayout() && c(d))
                    if (d instanceof I && null === d.Yb) this.Ok(d.uc, !1);
                    else if (null === this.Rn(d)) {
                    var e = this.createVertex();
                    e.Zc = d;
                    this.em(e)
                }
            }
            for (a.reset(); a.next();)
                if (d = a.value, d instanceof J && (!b || d.Bq) && d.canLayout() && c(d) && null === this.Ux(d)) {
                    var g = d.$,
                        e = d.ba;
                    null !== g && null !== e && g !== e && (g = this.findGroupVertex(g), e = this.findGroupVertex(e), null !== g && null !== e && this.Fq(g, e, d))
                }
        }
    };
    ua.prototype.findGroupVertex = function(a) {
        if (null === a) return null;
        var b = a.findVisibleNode();
        if (null === b) return null;
        a = this.Rn(b);
        if (null !== a) return a;
        for (b = b.Ka; null !== b;) {
            a = this.Rn(b);
            if (null !== a) return a;
            b = b.Ka
        }
        return null
    };
    ua.prototype.addVertex = ua.prototype.em = function(a) {
        if (null !== a) {
            v && D.l(a, va, ua, "addVertex:vertex");
            this.vertexes.add(a);
            var b = a.Zc;
            null !== b && this.xy.add(b, a);
            a.network = this
        }
    };
    ua.prototype.addNode = ua.prototype.bu = function(a) {
        if (null === a) return null;
        v && D.l(a, G, ua, "addNode:node");
        var b = this.Rn(a);
        null === b && (b = this.createVertex(), b.Zc = a, this.em(b));
        return b
    };
    ua.prototype.deleteVertex = ua.prototype.uF = function(a) {
        if (null !== a && (v && D.l(a, va, ua, "deleteVertex:vertex"), us(this, a))) {
            for (var b = a.Ye, c = b.count - 1; 0 <= c; c--) {
                var d = b.fa(c);
                this.kq(d)
            }
            b = a.Re;
            for (c = b.count - 1; 0 <= c; c--) d = b.fa(c), this.kq(d)
        }
    };

    function us(a, b) {
        if (null === b) return !1;
        var c = a.vertexes.remove(b);
        c && (a.xy.remove(b.Zc), b.network = null);
        return c
    }
    ua.prototype.deleteNode = function(a) { null !== a && (v && D.l(a, G, ua, "deleteNode:node"), a = this.Rn(a), null !== a && this.uF(a)) };
    ua.prototype.findVertex = ua.prototype.Rn = function(a) {
        if (null === a) return null;
        v && D.l(a, G, ua, "findVertex:node");
        return this.xy.oa(a)
    };
    ua.prototype.addEdge = ua.prototype.Xp = function(a) {
        if (null !== a) {
            v && D.l(a, wa, ua, "addEdge:edge");
            this.edges.add(a);
            var b = a.link;
            null !== b && null === this.Ux(b) && this.qy.add(b, a);
            b = a.toVertex;
            null !== b && b.WE(a);
            b = a.fromVertex;
            null !== b && b.UE(a);
            a.network = this
        }
    };
    ua.prototype.addLink = function(a) {
        if (null === a) return null;
        v && D.l(a, J, ua, "addLink:link");
        var b = a.$,
            c = a.ba,
            d = this.Ux(a);
        null === d ? (d = this.createEdge(), d.link = a, null !== b && (d.fromVertex = this.bu(b)), null !== c && (d.toVertex = this.bu(c)), this.Xp(d)) : (d.fromVertex = null !== b ? this.bu(b) : null, d.toVertex = null !== c ? this.bu(c) : null);
        return d
    };
    ua.prototype.deleteEdge = ua.prototype.kq = function(a) {
        if (null !== a) {
            v && D.l(a, wa, ua, "deleteEdge:edge");
            var b = a.toVertex;
            null !== b && b.tF(a);
            b = a.fromVertex;
            null !== b && b.sF(a);
            vs(this, a)
        }
    };

    function vs(a, b) { null !== b && a.edges.remove(b) && (a.qy.remove(b.link), b.network = null) }
    ua.prototype.deleteLink = function(a) { null !== a && (v && D.l(a, J, ua, "deleteLink:link"), a = this.Ux(a), null !== a && this.kq(a)) };
    ua.prototype.findEdge = ua.prototype.Ux = function(a) {
        if (null === a) return null;
        v && D.l(a, J, ua, "findEdge:link");
        return this.qy.oa(a)
    };
    ua.prototype.linkVertexes = ua.prototype.Fq = function(a, b, c) {
        if (null === a || null === b) return null;
        v && (D.l(a, va, ua, "linkVertexes:fromVertex"), D.l(b, va, ua, "linkVertexes:toVertex"), null !== c && D.l(c, J, ua, "linkVertexes:link"));
        if (a.network === this && b.network === this) {
            var d = this.createEdge();
            d.link = c;
            d.fromVertex = a;
            d.toVertex = b;
            this.Xp(d);
            return d
        }
        return null
    };
    ua.prototype.reverseEdge = ua.prototype.Ly = function(a) {
        if (null !== a) {
            v && D.l(a, wa, ua, "reverseEdge:edge");
            var b = a.fromVertex,
                c = a.toVertex;
            null !== b && null !== c && (b.sF(a), c.tF(a), a.Ly(), b.WE(a), c.UE(a))
        }
    };
    ua.prototype.deleteSelfEdges = ua.prototype.Px = function() {
        for (var a = D.mb(), b = this.edges.j; b.next();) {
            var c = b.value;
            c.fromVertex === c.toVertex && a.push(c)
        }
        b = a.length;
        for (c = 0; c < b; c++) this.kq(a[c]);
        D.ya(a)
    };
    ua.prototype.deleteArtificialVertexes = function() {
        for (var a = D.mb(), b = this.vertexes.j; b.next();) {
            var c = b.value;
            null === c.Zc && a.push(c)
        }
        for (var c = a.length, d = 0; d < c; d++) this.uF(a[d]);
        b = D.mb();
        for (c = this.edges.j; c.next();) d = c.value, null === d.link && b.push(d);
        c = b.length;
        for (d = 0; d < c; d++) this.kq(b[d]);
        D.ya(a);
        D.ya(b)
    };

    function ws(a) {
        for (var b = D.mb(), c = a.edges.j; c.next();) {
            var d = c.value;
            null !== d.fromVertex && null !== d.toVertex || b.push(d)
        }
        c = b.length;
        for (d = 0; d < c; d++) a.kq(b[d]);
        D.ya(b)
    }
    ua.prototype.splitIntoSubNetworks = ua.prototype.xK = function() {
        this.deleteArtificialVertexes();
        ws(this);
        this.Px();
        for (var a = new K(ua), b = !0; b;)
            for (var b = !1, c = this.vertexes.j; c.next();) {
                var d = c.value;
                if (0 < d.Ye.count || 0 < d.Re.count) {
                    b = this.Yb.createNetwork();
                    a.add(b);
                    xs(this, b, d);
                    b = !0;
                    break
                }
            }
        a.sort(function(a, b) { return null === a || null === b || a === b ? 0 : b.vertexes.count - a.vertexes.count });
        return a
    };

    function xs(a, b, c) {
        if (null !== c && c.network !== b) {
            us(a, c);
            b.em(c);
            for (var d = c.wc; d.next();) {
                var e = d.value;
                e.network !== b && (vs(a, e), b.Xp(e), xs(a, b, e.fromVertex))
            }
            for (d = c.tc; d.next();) c = d.value, c.network !== b && (vs(a, c), b.Xp(c), xs(a, b, c.toVertex))
        }
    }
    ua.prototype.findAllParts = function() { for (var a = new L(F), b = this.vertexes.j; b.next();) a.add(b.value.Zc); for (b = this.edges.j; b.next();) a.add(b.value.link); return a };

    function va() {
        D.xc(this);
        this.network = null;
        this.Q = (new C(0, 0, 10, 10)).freeze();
        this.W = (new N(5, 5)).freeze();
        this.Gd = this.Sd = null;
        this.Ye = new K(wa);
        this.Re = new K(wa)
    }
    D.ka("LayoutVertex", va);
    va.prototype.clear = function() {
        this.Gd = this.Sd = null;
        this.Ye = new K(wa);
        this.Re = new K(wa)
    };
    va.prototype.toString = function(a) {
        void 0 === a && (a = 0);
        var b = "LayoutVertex#" + D.Nd(this);
        if (0 < a && (b += null !== this.Zc ? "(" + this.Zc.toString() + ")" : "", 1 < a)) {
            a = "";
            for (var c = !0, d = this.Ye.j; d.next();) {
                var e = d.value;
                c ? c = !1 : a += ",";
                a += e.toString(0)
            }
            e = "";
            c = !0;
            for (d = this.Re.j; d.next();) {
                var g = d.value;
                c ? c = !1 : e += ",";
                e += g.toString(0)
            }
            b += " sources: " + a + " destinations: " + e
        }
        return b
    };
    D.defineProperty(va, { data: "data" }, function() { return this.Sd }, function(a) {
        this.Sd = a;
        if (null !== a) {
            var b = a.bounds;
            a = b.x;
            var c = b.y,
                d = b.width,
                b = b.height;
            this.W.n(d / 2, b / 2);
            this.Q.n(a, c, d, b)
        }
    });
    D.defineProperty(va, { Zc: "node" }, function() { return this.Gd }, function(a) {
        if (this.Gd !== a) {
            v && null !== a && D.l(a, G, va, "node");
            this.Gd = a;
            a.kf();
            var b = a.aa,
                c = b.x,
                d = b.y,
                e = b.width,
                b = b.height;
            isNaN(c) && (c = 0);
            isNaN(d) && (d = 0);
            this.Q.n(c, d, e, b);
            if (!(a instanceof I) && (a = a.Bf.fb(mc), a.H())) { this.W.n(a.x - c, a.y - d); return }
            this.W.n(e / 2, b / 2)
        }
    });
    D.defineProperty(va, { pb: "bounds" }, function() { return this.Q }, function(a) { this.Q.O(a) || (v && D.l(a, C, va, "bounds"), this.Q.assign(a)) });
    D.defineProperty(va, { focus: "focus" }, function() { return this.W }, function(a) { this.W.O(a) || (v && D.l(a, N, va, "focus"), this.W.assign(a)) });
    D.defineProperty(va, { pa: "centerX" }, function() { return this.Q.x + this.W.x }, function(a) {
        var b = this.Q;
        b.x + this.W.x !== a && (v && D.p(a, va, "centerX"), b.Xa(), b.x = a - this.W.x, b.freeze())
    });
    D.defineProperty(va, { va: "centerY" }, function() { return this.Q.y + this.W.y }, function(a) {
        var b = this.Q;
        b.y + this.W.y !== a && (v && D.p(a, va, "centerY"), b.Xa(), b.y = a - this.W.y, b.freeze())
    });
    D.defineProperty(va, { xu: "focusX" }, function() { return this.W.x }, function(a) {
        var b = this.W;
        b.x !== a && (b.Xa(), b.x = a, b.freeze())
    });
    D.defineProperty(va, { yu: "focusY" }, function() { return this.W.y }, function(a) {
        var b = this.W;
        b.y !== a && (b.Xa(), b.y = a, b.freeze())
    });
    D.defineProperty(va, { x: "x" }, function() { return this.Q.x }, function(a) {
        var b = this.Q;
        b.x !== a && (b.Xa(), b.x = a, b.freeze())
    });
    D.defineProperty(va, { y: "y" }, function() { return this.Q.y }, function(a) {
        var b = this.Q;
        b.y !== a && (b.Xa(), b.y = a, b.freeze())
    });
    D.defineProperty(va, { width: "width" }, function() { return this.Q.width }, function(a) {
        var b = this.Q;
        b.width !== a && (b.Xa(), b.width = a, b.freeze())
    });
    D.defineProperty(va, { height: "height" }, function() { return this.Q.height }, function(a) {
        var b = this.Q;
        b.height !== a && (b.Xa(), b.height = a, b.freeze())
    });
    va.prototype.commit = function() {
        var a = this.Sd;
        if (null !== a) {
            var b = this.pb,
                c = a.bounds;
            D.Qa(c) ? (c.x = b.x, c.y = b.y, c.width = b.width, c.height = b.height) : a.bounds = b.copy()
        } else if (a = this.Zc, null !== a) {
            b = this.pb;
            if (!(a instanceof I)) {
                var c = a.aa,
                    d = a.Bf.fb(mc);
                if (c.H() && d.H()) { a.moveTo(b.x + this.xu - (d.x - c.x), b.y + this.yu - (d.y - c.y)); return }
            }
            a.moveTo(b.x, b.y)
        }
    };
    va.prototype.addSourceEdge = va.prototype.WE = function(a) { null !== a && (v && D.l(a, wa, va, "addSourceEdge:edge"), this.Ye.contains(a) || this.Ye.add(a)) };
    va.prototype.deleteSourceEdge = va.prototype.tF = function(a) { null !== a && (v && D.l(a, wa, va, "deleteSourceEdge:edge"), this.Ye.remove(a)) };
    va.prototype.addDestinationEdge = va.prototype.UE = function(a) { null !== a && (v && D.l(a, wa, va, "addDestinationEdge:edge"), this.Re.contains(a) || this.Re.add(a)) };
    va.prototype.deleteDestinationEdge = va.prototype.sF = function(a) { null !== a && (v && D.l(a, wa, va, "deleteDestinationEdge:edge"), this.Re.remove(a)) };
    D.w(va, { wK: "sourceVertexes" }, function() { for (var a = new L(va), b = this.wc; b.next();) a.add(b.value.fromVertex); return a.j });
    D.w(va, { zI: "destinationVertexes" }, function() { for (var a = new L(va), b = this.tc; b.next();) a.add(b.value.toVertex); return a.j });
    D.w(va, { vertexes: "vertexes" }, function() { for (var a = new L(va), b = this.wc; b.next();) a.add(b.value.fromVertex); for (b = this.tc; b.next();) a.add(b.value.toVertex); return a.j });
    D.w(va, { wc: "sourceEdges" }, function() { return this.Ye.j });
    D.w(va, { tc: "destinationEdges" }, function() { return this.Re.j });
    D.w(va, { edges: "edges" }, function() { for (var a = new K(wa), b = this.wc; b.next();) a.add(b.value); for (b = this.tc; b.next();) a.add(b.value); return a.j });
    D.w(va, { KI: "edgesCount" }, function() { return this.Ye.count + this.Re.count });
    var ys;
    va.standardComparer = ys = function(a, b) {
        v && D.l(a, va, va, "standardComparer:m");
        v && D.l(b, va, va, "standardComparer:n");
        var c = a.Gd,
            d = b.Gd;
        return c ? d ? (c = c.text, d = d.text, c < d ? -1 : c > d ? 1 : 0) : 1 : null !== d ? -1 : 0
    };
    va.smartComparer = function(a, b) {
        v && D.l(a, va, va, "smartComparer:m");
        v && D.l(b, va, va, "smartComparer:n");
        if (null !== a) {
            if (null !== b) {
                var c = a.Gd,
                    d = b.Gd;
                if (null !== c) {
                    if (null !== d) {
                        for (var c = c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e = 0; e < c.length; e++)
                            if ("" !== d[e] && void 0 !== d[e]) {
                                var g = parseFloat(c[e]),
                                    h = parseFloat(d[e]);
                                if (isNaN(g)) { if (!isNaN(h)) return 1; if (0 !== c[e].localeCompare(d[e])) return c[e].localeCompare(d[e]) } else {
                                    if (isNaN(h)) return -1;
                                    if (0 !== g - h) return g - h
                                }
                            } else if ("" !== c[e]) return 1;
                        return "" !== d[e] && void 0 !== d[e] ? -1 : 0
                    }
                    return 1
                }
                return null !== d ? -1 : 0
            }
            return 1
        }
        return null !== b ? -1 : 0
    };

    function wa() {
        D.xc(this);
        this.toVertex = this.fromVertex = this.link = this.data = this.network = null
    }
    D.ka("LayoutEdge", wa);
    wa.prototype.clear = function() { this.toVertex = this.fromVertex = this.link = this.data = null };
    wa.prototype.toString = function(a) {
        void 0 === a && (a = 0);
        var b = "LayoutEdge#" + D.Nd(this);
        0 < a && (b += null !== this.link ? "(" + this.link.toString() + ")" : "", 1 < a && (b += " " + (this.fromVertex ? this.fromVertex.toString() : "null") + " --\x3e " + (this.toVertex ? this.toVertex.toString() : "null")));
        return b
    };
    wa.prototype.Ly = function() {
        var a = this.fromVertex;
        this.fromVertex = this.toVertex;
        this.toVertex = a
    };
    wa.prototype.commit = function() {};
    wa.prototype.getOtherVertex = wa.prototype.VI = function(a) { v && D.l(a, va, wa, "getOtherVertex:v"); return this.toVertex === a ? this.fromVertex : this.fromVertex === a ? this.toVertex : null };

    function Wn() {
        0 < arguments.length && D.zd(Wn);
        $g.call(this);
        this.my = !0;
        this.Xt = this.Yt = NaN;
        this.fk = (new Ca(NaN, NaN)).freeze();
        this.ui = (new Ca(10, 10)).freeze();
        this.ue = zs;
        this.Bd = As;
        this.ti = Bs;
        this.ci = Cs
    }
    D.Ta(Wn, $g);
    D.ka("GridLayout", Wn);
    Wn.prototype.cloneProtected = function(a) {
        $g.prototype.cloneProtected.call(this, a);
        a.Yt = this.Yt;
        a.Xt = this.Xt;
        a.fk.assign(this.fk);
        a.ui.assign(this.ui);
        a.ue = this.ue;
        a.Bd = this.Bd;
        a.ti = this.ti;
        a.ci = this.ci
    };
    Wn.prototype.qc = function(a) { a.Qe === Wn ? a === Bs || a === Ds || a === Es || a === Fs ? this.sorting = a : a === As || a === Gs ? this.eg = a : a === zs || a === Hs ? this.alignment = a : D.k("Unknown enum value: " + a) : $g.prototype.qc.call(this, a) };
    Wn.prototype.doLayout = function(a) {
        null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
        this.Zd = this.initialOrigin(this.Zd);
        var b = this.g;
        a = this.iI(a);
        for (var c = a.copy().j; c.next();) {
            var d = c.value;
            if (d instanceof J) { var e = d; if (null !== e.$ || null !== e.ba) { a.remove(e); continue } }
            d.kf();
            if (d instanceof I)
                for (d = d.uc; d.next();) a.remove(d.value)
        }
        e = a.Fc();
        if (0 !== e.length) {
            switch (this.sorting) {
                case Fs:
                    e.reverse();
                    break;
                case Bs:
                    e.sort(this.comparer);
                    break;
                case Ds:
                    e.sort(this.comparer), e.reverse()
            }
            var g = this.MK;
            isNaN(g) && (g = 0);
            var h = this.zH,
                h = isNaN(h) && null !== b ? Math.max(b.wb.width - b.padding.left - b.padding.right, 0) : Math.max(this.zH, 0);
            0 >= g && 0 >= h && (g = 1);
            a = this.spacing.width;
            isFinite(a) || (a = 0);
            c = this.spacing.height;
            isFinite(c) || (c = 0);
            null !== b && b.Nb("Layout");
            d = [];
            switch (this.alignment) {
                case Hs:
                    var k = a,
                        l = c,
                        m = Math.max(this.bq.width, 1);
                    if (!isFinite(m))
                        for (var n = m = 0; n < e.length; n++) var p = e[n],
                            q = p.Fa,
                            m = Math.max(m, q.width);
                    var m = Math.max(m + k, 1),
                        r = Math.max(this.bq.height,
                            1);
                    if (!isFinite(r))
                        for (n = r = 0; n < e.length; n++) p = e[n], q = p.Fa, r = Math.max(r, q.height);
                    for (var r = Math.max(r + l, 1), s = this.eg, u = this.Zd.x, t = u, y = this.Zd.y, w = 0, A = 0, n = 0; n < e.length; n++) {
                        var p = e[n],
                            q = p.Fa,
                            B = Math.ceil((q.width + k) / m) * m,
                            P = Math.ceil((q.height + l) / r) * r,
                            H = 0;
                        switch (s) {
                            case Gs:
                                H = Math.abs(t - q.width);
                                break;
                            default:
                                H = t + q.width
                        }
                        if (0 < g && w > g - 1 || 0 < h && 0 < w && H > h) d.push(new C(0, y, h + k, A)), w = 0, t = u, y += A, A = 0;
                        A = Math.max(A, P);
                        P = 0;
                        switch (s) {
                            case Gs:
                                P = -q.width;
                                break;
                            default:
                                P = 0
                        }
                        p.moveTo(t + P, y);
                        switch (s) {
                            case Gs:
                                t -= B;
                                break;
                            default:
                                t += B
                        }
                        w++
                    }
                    d.push(new C(0, y, h + k, A));
                    break;
                case zs:
                    k = g;
                    l = a;
                    m = c;
                    n = Math.max(this.bq.width, 1);
                    p = y = B = 0;
                    q = D.P();
                    for (g = 0; g < e.length; g++) r = e[g], s = r.Fa, u = lr(r, r.Bf, r.Of, q), B = Math.max(B, u.x), y = Math.max(y, s.width - u.x), p = Math.max(p, u.y);
                    t = this.eg;
                    switch (t) {
                        case Gs:
                            B += l;
                            break;
                        default:
                            y += l
                    }
                    var n = isFinite(n) ? Math.max(n + l, 1) : Math.max(B + y, 1),
                        R = y = this.Zd.x,
                        w = this.Zd.y,
                        A = 0;
                    h >= B && (h -= B);
                    for (var B = P = 0, H = Math.max(this.bq.height, 1), aa = p = 0, V = !0, ea = D.P(), g = 0; g < e.length; g++) {
                        r = e[g];
                        s = r.Fa;
                        u = lr(r, r.Bf, r.Of, q);
                        if (0 < A) switch (t) {
                            case Gs:
                                R =
                                    (R - y - (s.width - u.x)) / n;
                                R = Eb(Math.round(R), R) ? Math.round(R) : Math.floor(R);
                                R = R * n + y;
                                break;
                            default:
                                R = (R - y + u.x) / n, R = Eb(Math.round(R), R) ? Math.round(R) : Math.ceil(R), R = R * n + y
                        } else switch (t) {
                            case Gs:
                                P = R + u.x + s.width;
                                break;
                            default:
                                P = R - u.x
                        }
                        var la = 0;
                        switch (t) {
                            case Gs:
                                la = -(R + u.x) + P;
                                break;
                            default:
                                la = R + s.width - u.x - P
                        }
                        if (0 < k && A > k - 1 || 0 < h && 0 < A && la > h) {
                            d.push(new C(0, V ? w - p : w, h + l, aa + p + m));
                            for (R = 0; R < A && g !== A; R++) {
                                var la = e[g - A + R],
                                    Da = lr(la, la.Bf, la.Of, ea);
                                la.moveTo(la.position.x, la.position.y + p - Da.y)
                            }
                            aa += m;
                            w = V ? w + aa : w + (aa + p);
                            A = aa = p = 0;
                            R = y;
                            V = !1
                        }
                        R === y && (B = t === Gs ? Math.max(B, s.width - u.x) : Math.min(B, -u.x));
                        p = Math.max(p, u.y);
                        aa = Math.max(aa, s.height - u.y);
                        isFinite(H) && (aa = Math.max(aa, Math.max(s.height, H) - u.y));
                        V ? r.moveTo(R - u.x, w - u.y) : r.moveTo(R - u.x, w);
                        switch (t) {
                            case Gs:
                                R -= u.x + l;
                                break;
                            default:
                                R += s.width - u.x + l
                        }
                        A++
                    }
                    d.push(new C(0, w, h + l, (V ? aa : aa + p) + m));
                    for (R = 0; R < A && g !== A; R++) la = e[g - A + R], Da = lr(la, la.Bf, la.Of, q), la.moveTo(la.position.x, la.position.y + p - Da.y);
                    D.A(q);
                    D.A(ea);
                    if (t === Gs)
                        for (g = 0; g < d.length; g++) e = d[g], e.width += B, e.x -= B;
                    else
                        for (g =
                            0; g < d.length; g++) e = d[g], e.x > B && (e.width += e.x - B, e.x = B)
            }
            for (k = g = h = e = 0; k < d.length; k++) l = d[k], e = Math.min(e, l.x), h = Math.min(h, l.y), g = Math.max(g, l.x + l.width);
            this.eg === Gs ? this.commitLayers(d, new N(e + a / 2 - (g + e), h - c / 2)) : this.commitLayers(d, new N(e - a / 2, h - c / 2));
            null !== b && b.jd("Layout");
            this.zf = !0
        }
    };
    Wn.prototype.commitLayers = function() {};
    D.defineProperty(Wn, { zH: "wrappingWidth" }, function() { return this.Yt }, function(a) { this.Yt !== a && (D.h(a, "number", Wn, "wrappingWidth"), 0 < a || isNaN(a)) && (this.Yt = a, this.my = isNaN(a), this.L()) });
    D.defineProperty(Wn, { MK: "wrappingColumn" }, function() { return this.Xt }, function(a) { this.Xt !== a && (D.h(a, "number", Wn, "wrappingColumn"), 0 < a || isNaN(a)) && (this.Xt = a, this.L()) });
    D.defineProperty(Wn, { bq: "cellSize" }, function() { return this.fk }, function(a) {
        D.l(a, Ca, Wn, "cellSize");
        this.fk.O(a) || (this.fk.assign(a), this.L())
    });
    D.defineProperty(Wn, { spacing: "spacing" }, function() { return this.ui }, function(a) {
        D.l(a, Ca, Wn, "spacing");
        this.ui.O(a) || (this.ui.assign(a), this.L())
    });
    D.defineProperty(Wn, { alignment: "alignment" }, function() { return this.ue }, function(a) { this.ue !== a && (D.Da(a, Wn, Wn, "alignment"), a === zs || a === Hs) && (this.ue = a, this.L()) });
    D.defineProperty(Wn, { eg: "arrangement" }, function() { return this.Bd }, function(a) { this.Bd !== a && (D.Da(a, Wn, Wn, "arrangement"), a === As || a === Gs) && (this.Bd = a, this.L()) });
    D.defineProperty(Wn, { sorting: "sorting" }, function() { return this.ti }, function(a) { this.ti !== a && (D.Da(a, Wn, Wn, "sorting"), a === Es || a === Fs || a === Bs || a === Ds) && (this.ti = a, this.L()) });
    D.defineProperty(Wn, { comparer: "comparer" }, function() { return this.ci }, function(a) { this.ci !== a && (D.h(a, "function", Wn, "comparer"), this.ci = a, this.L()) });
    var Cs;
    Wn.standardComparer = Cs = function(a, b) {
        v && D.l(a, F, Wn, "standardComparer:a");
        v && D.l(b, F, Wn, "standardComparer:b");
        var c = a.text,
            d = b.text;
        return c < d ? -1 : c > d ? 1 : 0
    };
    Wn.smartComparer = function(a, b) {
        v && D.l(a, F, Wn, "standardComparer:a");
        v && D.l(b, F, Wn, "standardComparer:b");
        if (null !== a) {
            if (null !== b) {
                for (var c = a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e = 0; e < c.length; e++)
                    if ("" !== d[e] && void 0 !== d[e]) {
                        var g = parseFloat(c[e]),
                            h = parseFloat(d[e]);
                        if (isNaN(g)) { if (!isNaN(h)) return 1; if (0 !== c[e].localeCompare(d[e])) return c[e].localeCompare(d[e]) } else {
                            if (isNaN(h)) return -1;
                            if (0 !== g - h) return g - h
                        }
                    } else if ("" !== c[e]) return 1;
                return "" !== d[e] && void 0 !== d[e] ? -1 : 0
            }
            return 1
        }
        return null !== b ? -1 : 0
    };
    var Hs;
    Wn.Position = Hs = D.s(Wn, "Position", 0);
    var zs;
    Wn.Location = zs = D.s(Wn, "Location", 1);
    var As;
    Wn.LeftToRight = As = D.s(Wn, "LeftToRight", 2);
    var Gs;
    Wn.RightToLeft = Gs = D.s(Wn, "RightToLeft", 3);
    var Es;
    Wn.Forward = Es = D.s(Wn, "Forward", 4);
    var Fs;
    Wn.Reverse = Fs = D.s(Wn, "Reverse", 5);
    var Bs;
    Wn.Ascending = Bs = D.s(Wn, "Ascending", 6);
    var Ds;
    Wn.Descending = Ds = D.s(Wn, "Descending", 7);

    function Is() {
        0 < arguments.length && D.zd(Is);
        $g.call(this);
        this.Lz = this.Yo = this.Td = 0;
        this.Wr = 360;
        this.Kz = Js;
        this.Dl = 0;
        this.HC = new N;
        this.tD = Js;
        this.Qv = this.dg = this.IE = 0;
        this.ux = new Ks;
        this.Rv = this.kn = 0;
        this.MH = 600;
        this.lt = NaN;
        this.or = 1;
        this.Mt = 0;
        this.Ot = 360;
        this.Bd = Js;
        this.ga = Ls;
        this.ti = Ms;
        this.ci = ys;
        this.ui = 6;
        this.Zs = Ns
    }
    D.Ta(Is, $g);
    D.ka("CircularLayout", Is);
    Is.prototype.cloneProtected = function(a) {
        $g.prototype.cloneProtected.call(this, a);
        a.lt = this.lt;
        a.or = this.or;
        a.Mt = this.Mt;
        a.Ot = this.Ot;
        a.Bd = this.Bd;
        a.ga = this.ga;
        a.ti = this.ti;
        a.ci = this.ci;
        a.ui = this.ui;
        a.Zs = this.Zs
    };
    Is.prototype.qc = function(a) {
        if (a.Qe === Is)
            if (a === Os || a === Ps || a === Qs || a === Rs || a === Ms) this.sorting = a;
            else if (a === Ss || a === Ts || a === Ls || a === Us) this.direction = a;
        else if (a === Vs || a === Ws || a === Js || a === Xs) this.eg = a;
        else { if (a === Ys || a === Ns) this.wy = a } else $g.prototype.qc.call(this, a)
    };
    Is.prototype.createNetwork = function() { return new Zs };
    Is.prototype.doLayout = function(a) {
        null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
        null === this.network && (this.network = this.makeNetwork(a));
        this.Zd = this.initialOrigin(this.Zd);
        a = this.network.vertexes;
        if (1 >= a.count) 1 === a.count && (a = a.first(), a.pa = 0, a.va = 0);
        else {
            var b = new K($s);
            b.Vc(a.j);
            a = new K($s);
            var c = new K($s),
                d;
            d = this.sort(b);
            var e = this.Kz,
                g = this.tD,
                h = this.Td,
                k = this.Yo,
                l = this.Lz,
                m = this.Wr,
                b = this.Dl,
                n = this.IE,
                p = this.dg,
                q = this.Qv,
                e = this.eg,
                g = this.wy,
                h = this.aK;
            if (!isFinite(h) || 0 >= h) h = NaN;
            k = this.cI;
            if (!isFinite(k) || 0 >= k) k = 1;
            l = this.Me;
            isFinite(l) || (l = 0);
            m = this.Df;
            if (!isFinite(m) || 360 < m || 1 > m) m = 360;
            b = this.spacing;
            isFinite(b) || (b = NaN);
            e === Xs && g === Ys ? e = Js : e === Xs && g !== Ys && (g = Ys, e = this.eg);
            if ((this.direction === Ss || this.direction === Ts) && this.sorting !== Ms) {
                for (var r = 0; !(r >= d.length); r += 2) {
                    a.add(d.fa(r));
                    if (r + 1 >= d.length) break;
                    c.add(d.fa(r + 1))
                }
                this.direction === Ss ? (this.eg === Xs && a.reverse(), d = new K($s), d.Vc(a), d.Vc(c)) : (this.eg === Xs &&
                    c.reverse(), d = new K($s), d.Vc(c), d.Vc(a))
            }
            for (var s = d.length, u = n = 0, r = 0; r < d.length; r++) {
                var p = l + m * u * (this.direction === Ls ? 1 : -1) / s,
                    t = d.fa(r).diameter;
                isNaN(t) && (t = at(d.fa(r), p));
                360 > m && (0 === r || r === d.length - 1) && (t /= 2);
                n += t;
                u++
            }
            if (isNaN(h) || e === Xs) {
                isNaN(b) && (b = 6);
                if (e !== Js && e !== Xs) {
                    t = -Infinity;
                    for (r = 0; r < s; r++) {
                        var q = d.fa(r),
                            y = d.fa(r === s - 1 ? 0 : r + 1);
                        isNaN(q.diameter) && at(q, 0);
                        isNaN(y.diameter) && at(y, 0);
                        t = Math.max(t, (q.diameter + y.diameter) / 2)
                    }
                    q = t + b;
                    e === Vs ? (p = 2 * Math.PI / s, h = (t + b) / p) : h = bt(this, q * (360 <= m ? s : s - 1),
                        k, l * Math.PI / 180, m * Math.PI / 180)
                } else h = bt(this, n + (360 <= m ? s : s - 1) * (e !== Xs ? b : 1.6 * b), k, l * Math.PI / 180, m * Math.PI / 180);
                p = h * k
            } else if (p = h * k, u = ct(this, h, p, l * Math.PI / 180, m * Math.PI / 180), isNaN(b)) { if (e === Js || e === Xs) b = (u - n) / (360 <= m ? s : s - 1) } else if (e === Js || e === Xs) r = (u - n) / (360 <= m ? s : s - 1), r < b ? (h = bt(this, n + b * (360 <= m ? s : s - 1), k, l * Math.PI / 180, m * Math.PI / 180), p = h * k) : b = r;
            else {
                t = -Infinity;
                for (r = 0; r < s; r++) q = d.fa(r), y = d.fa(r === s - 1 ? 0 : r + 1), isNaN(q.diameter) && at(q, 0), isNaN(y.diameter) && at(y, 0), t = Math.max(t, (q.diameter + y.diameter) /
                    2);
                q = t + b;
                r = bt(this, q * (360 <= m ? s : s - 1), k, l * Math.PI / 180, m * Math.PI / 180);
                r > h ? (h = r, p = h * k) : q = u / (360 <= m ? s : s - 1)
            }
            this.Kz = e;
            this.tD = g;
            this.Td = h;
            this.Yo = k;
            this.Lz = l;
            this.Wr = m;
            this.Dl = b;
            this.IE = n;
            this.dg = p;
            this.Qv = q;
            b = d;
            d = this.Kz;
            e = this.Td;
            g = this.Lz;
            k = this.Wr;
            l = this.Dl;
            m = this.dg;
            n = this.Qv;
            if (this.direction !== Ss && this.direction !== Ts || d !== Xs)
                if (this.direction === Ss || this.direction === Ts) {
                    h = 0;
                    switch (d) {
                        case Ws:
                            h = 180 * dt(this, e, m, g, n) / Math.PI;
                            break;
                        case Js:
                            n = b = 0;
                            h = a.first();
                            null !== h && (b = at(h, Math.PI / 2));
                            h = c.first();
                            null !==
                                h && (n = at(h, Math.PI / 2));
                            h = 180 * dt(this, e, m, g, l + (b + n) / 2) / Math.PI;
                            break;
                        case Vs:
                            h = k / b.length
                    }
                    if (this.direction === Ss) {
                        switch (d) {
                            case Ws:
                                et(this, a, g, Us);
                                break;
                            case Js:
                                ft(this, a, g, Us);
                                break;
                            case Vs:
                                gt(this, a, k / 2, g, Us)
                        }
                        switch (d) {
                            case Ws:
                                et(this, c, g + h, Ls);
                                break;
                            case Js:
                                ft(this, c, g + h, Ls);
                                break;
                            case Vs:
                                gt(this, c, k / 2, g + h, Ls)
                        }
                    } else {
                        switch (d) {
                            case Ws:
                                et(this, c, g, Us);
                                break;
                            case Js:
                                ft(this, c, g, Us);
                                break;
                            case Vs:
                                gt(this, c, k / 2, g, Us)
                        }
                        switch (d) {
                            case Ws:
                                et(this, a, g + h, Ls);
                                break;
                            case Js:
                                ft(this, a, g + h, Ls);
                                break;
                            case Vs:
                                gt(this,
                                    a, k / 2, g + h, Ls)
                        }
                    }
                } else switch (d) {
                    case Ws:
                        et(this, b, g, this.direction);
                        break;
                    case Js:
                        ft(this, b, g, this.direction);
                        break;
                    case Vs:
                        gt(this, b, k, g, this.direction);
                        break;
                    case Xs:
                        ht(this, b, k, g, this.direction)
                } else ht(this, b, k, g - k / 2, Ls)
        }
        this.updateParts();
        this.network = null;
        this.zf = !0
    };

    function gt(a, b, c, d, e) {
        var g = a.Wr,
            h = a.Td;
        a = a.dg;
        d = d * Math.PI / 180;
        c = c * Math.PI / 180;
        for (var k = b.length, l = 0; l < k; l++) {
            var m = d + (e === Ls ? l * c / (360 <= g ? k : k - 1) : -(l * c) / k),
                n = b.fa(l),
                p = h * Math.tan(m) / a,
                p = Math.sqrt((h * h + a * a * p * p) / (1 + p * p));
            n.pa = p * Math.cos(m);
            n.va = p * Math.sin(m);
            n.actualAngle = 180 * m / Math.PI
        }
    }

    function ft(a, b, c, d) {
        var e = a.Td,
            g = a.dg,
            h = a.Dl;
        c = c * Math.PI / 180;
        for (var k = b.length, l = 0; l < k; l++) {
            var m = b.fa(l),
                n = b.fa(l === k - 1 ? 0 : l + 1),
                p = g * Math.sin(c);
            m.pa = e * Math.cos(c);
            m.va = p;
            m.actualAngle = 180 * c / Math.PI;
            isNaN(m.diameter) && at(m, 0);
            isNaN(n.diameter) && at(n, 0);
            m = dt(a, e, g, d === Ls ? c : -c, (m.diameter + n.diameter) / 2 + h);
            c += d === Ls ? m : -m
        }
    }

    function et(a, b, c, d) {
        var e = a.Td,
            g = a.dg,
            h = a.Qv;
        c = c * Math.PI / 180;
        for (var k = b.length, l = 0; l < k; l++) {
            var m = b.fa(l);
            m.pa = e * Math.cos(c);
            m.va = g * Math.sin(c);
            m.actualAngle = 180 * c / Math.PI;
            m = dt(a, e, g, d === Ls ? c : -c, h);
            c += d === Ls ? m : -m
        }
    }

    function ht(a, b, c, d, e) {
        var g = a.Rv,
            g = a.Wr;
        a.kn = 0;
        a.ux = new Ks;
        if (360 > c) {
            for (g = d + (e === Ls ? g : -g); 0 > g;) g += 360;
            g %= 360;
            180 < g && (g -= 360);
            g *= Math.PI / 180;
            a.Rv = g;
            it(a, b, c, d, e)
        } else jt(a, b, c, d, e);
        a.ux.commit(b)
    }

    function jt(a, b, c, d, e) {
        var g = a.Td,
            h = a.Dl,
            k = a.Yo,
            l = g * Math.cos(d * Math.PI / 180),
            m = a.dg * Math.sin(d * Math.PI / 180),
            n = b.Fc();
        if (3 === n.length) n[0].pa = g, n[0].va = 0, n[1].pa = n[0].pa - n[0].width / 2 - n[1].width / 2 - h, n[1].y = n[0].y, n[2].pa = (n[0].pa + n[1].pa) / 2, n[2].y = n[0].y - n[2].height - h;
        else if (4 === n.length) n[0].pa = g, n[0].va = 0, n[2].pa = -n[0].pa, n[2].va = n[0].va, n[1].pa = 0, n[1].y = Math.min(n[0].y, n[2].y) - n[1].height - h, n[3].pa = 0, n[3].y = Math.max(n[0].y + n[0].height + h, n[2].y + n[2].height + h);
        else {
            for (var g = D.P(), p = 0; p < n.length; p++) {
                n[p].pa =
                    l;
                n[p].va = m;
                if (p >= n.length - 1) break;
                kt(a, l, m, n, p, e, g) || lt(a, l, m, n, p, e, g);
                l = g.x;
                m = g.y
            }
            D.A(g);
            a.kn++;
            if (!(23 < a.kn)) {
                var l = n[0].pa,
                    m = n[0].va,
                    g = n[n.length - 1].pa,
                    p = n[n.length - 1].va,
                    q = Math.abs(l - g) - ((n[0].width + n[n.length - 1].width) / 2 + h),
                    r = Math.abs(m - p) - ((n[0].height + n[n.length - 1].height) / 2 + h),
                    h = 0;
                1 > Math.abs(r) ? Math.abs(l - g) < (n[0].width + n[n.length - 1].width) / 2 && (h = 0) : h = 0 < r ? r : 1 > Math.abs(q) ? 0 : q;
                q = !1;
                q = Math.abs(g) > Math.abs(p) ? 0 < g !== m > p : 0 < p !== l < g;
                if (q = e === Ls ? q : !q) h = -Math.abs(h), h = Math.min(h, -n[n.length - 1].width),
                    h = Math.min(h, -n[n.length - 1].height);
                a.ux.compare(h, n);
                1 < Math.abs(h) && (a.Td = 8 > a.kn ? a.Td - h / (2 * Math.PI) : 5 > n.length && 10 < h ? a.Td / 2 : a.Td - (0 < h ? 1.7 : -2.3), a.dg = a.Td * k, jt(a, b, c, d, e))
            }
        }
    }

    function it(a, b, c, d, e) {
        for (var g = a.Td, h = a.dg, k = a.Yo, l = g * Math.cos(d * Math.PI / 180), m = h * Math.sin(d * Math.PI / 180), n = D.P(), p = b.Fc(), q = 0; q < p.length; q++) {
            p[q].pa = l;
            p[q].va = m;
            if (q >= p.length - 1) break;
            kt(a, l, m, p, q, e, n) || lt(a, l, m, p, q, e, n);
            l = n.x;
            m = n.y
        }
        D.A(n);
        a.kn++;
        if (!(23 < a.kn)) {
            l = Math.atan2(m, l);
            l = e === Ls ? a.Rv - l : l - a.Rv;
            l = Math.abs(l) < Math.abs(l - 2 * Math.PI) ? l : l - 2 * Math.PI;
            g = l * (g + h) / 2;
            h = a.ux;
            if (Math.abs(g) < Math.abs(h.qq))
                for (h.qq = g, h.Bo = [], h.cr = [], l = 0; l < p.length; l++) h.Bo[l] = p[l].pb.x, h.cr[l] = p[l].pb.y;
            1 < Math.abs(g) &&
                (a.Td = 8 > a.kn ? a.Td - g / (2 * Math.PI) : a.Td - (0 < g ? 1.7 : -2.3), a.dg = a.Td * k, it(a, b, c, d, e))
        }
    }

    function kt(a, b, c, d, e, g, h) {
        var k = a.Td,
            l = a.dg,
            m = 0,
            n = 0;
        a = (d[e].width + d[e + 1].width) / 2 + a.Dl;
        var p = !1;
        if (0 <= c !== (g === Ls)) {
            if (m = b + a, m > k) {
                m = b - a;
                if (m < -k) return h.x = m, h.y = n, !1;
                p = !0
            }
        } else if (m = b - a, m < -k) {
            m = b + a;
            if (m > k) return h.x = m, h.y = n, !1;
            p = !0
        }
        n = Math.sqrt(1 - Math.min(1, m * m / (k * k))) * l;
        0 > c !== p && (n = -n);
        if (Math.abs(c - n) > (d[e].height + d[e + 1].height) / 2) return h.x = m, h.y = n, !1;
        h.x = m;
        h.y = n;
        return !0
    }

    function lt(a, b, c, d, e, g, h) {
        var k = a.Td,
            l = a.dg,
            m = 0,
            n = 0;
        a = (d[e].height + d[e + 1].height) / 2 + a.Dl;
        d = !1;
        if (0 <= b !== (g === Ls)) {
            if (n = c - a, n < -l) {
                n = c + a;
                if (n > l) {
                    h.x = m;
                    h.y = n;
                    return
                }
                d = !0
            }
        } else if (n = c + a, n > l) {
            n = c - a;
            if (n < -l) {
                h.x = m;
                h.y = n;
                return
            }
            d = !0
        }
        m = Math.sqrt(1 - Math.min(1, n * n / (l * l))) * k;
        0 > b !== d && (m = -m);
        h.x = m;
        h.y = n
    }
    Is.prototype.commitLayout = function() {
        this.commitNodes();
        this.Pu && this.commitLinks()
    };
    Is.prototype.commitNodes = function() {
        var a = this.VH,
            b = null !== this.group && null !== this.group.placeholder && this.group.md,
            c = b ? this.group.location.copy() : null;
        b ? a = new N(0, 0) : (a.x = this.Zd.x + this.Td, a.y = this.Zd.y + this.dg);
        for (var d = this.network.vertexes.j; d.next();) {
            var e = d.value;
            e.x += a.x;
            e.y += a.y;
            e.commit()
        }
        b && (this.group.kf(), a = this.group.position.copy(), b = this.group.location.copy(), c = c.$j(b.$j(a)), this.group.move(c), this.HC = c.$j(a))
    };
    Is.prototype.commitLinks = function() { for (var a = this.network.edges.j; a.next();) a.value.commit() };

    function ct(a, b, c, d, e) {
        var g = a.MH;
        if (.001 > Math.abs(a.Yo - 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;
        for (var h = 0, k = 0, k = void 0 !== d && void 0 !== e ? e / (g + 1) : Math.PI / (2 * (g + 1)), l = 0, m = 0; m <= g; m++) l = void 0 !== d && void 0 !== e ? d + m * e / g : m * Math.PI / (2 * g), l = Math.sin(l), h += Math.sqrt(1 - a * a * l * l) * k;
        return void 0 !== d && void 0 !== e ? (b > c ? b : c) * h : 4 * (b > c ? b : c) * h
    }

    function bt(a, b, c, d, e) {
        var g = 0,
            g = void 0 !== d && void 0 !== e ? ct(a, 1, c, d, e) : ct(a, 1, c);
        return b / g
    }

    function dt(a, b, c, d, e) {
        if (.001 > Math.abs(a.Yo - 1)) return e / b;
        var g = b > c ? Math.sqrt(b * b - c * c) / b : Math.sqrt(c * c - b * b) / c,
            h = 0;
        a = 2 * Math.PI / (700 * a.network.vertexes.count);
        b > c && (d += Math.PI / 2);
        for (var k = 0;; k++) {
            var l = Math.sin(d + k * a),
                h = h + (b > c ? b : c) * Math.sqrt(1 - g * g * l * l) * a;
            if (h >= e) return k * a
        }
    }
    Is.prototype.sort = function(a) {
        switch (this.sorting) {
            case Qs:
                break;
            case Rs:
                a.reverse();
                break;
            case Os:
                a.sort(this.comparer);
                break;
            case Ps:
                a.sort(this.comparer);
                a.reverse();
                break;
            case Ms:
                for (var b = [], c = 0; c < a.length; c++) b.push(0);
                for (var d = new K($s), c = 0; c < a.length; c++) {
                    var e = -1,
                        g = -1;
                    if (0 === c)
                        for (var h = 0; h < a.length; h++) {
                            var k = a.fa(h).KI;
                            k > e && (e = k, g = h)
                        } else
                            for (h = 0; h < a.length; h++) k = b[h], k > e && (e = k, g = h);
                    d.add(a.fa(g));
                    b[g] = -1;
                    g = a.fa(g);
                    e = 0;
                    for (h = g.wc; h.next();) e = a.indexOf(h.value.fromVertex), 0 > e || 0 <= b[e] &&
                        b[e]++;
                    for (g = g.tc; g.next();) e = a.indexOf(g.value.toVertex), 0 > e || 0 <= b[e] && b[e]++
                }
                a = [];
                for (g = 0; g < d.length; g++) {
                    b = d.fa(g);
                    a[g] = [];
                    for (var l = 0, c = b.tc; c.next();) l = d.indexOf(c.value.toVertex), l !== g && 0 > a[g].indexOf(l) && a[g].push(l);
                    for (b = b.wc; b.next();) l = d.indexOf(b.value.fromVertex), l !== g && 0 > a[g].indexOf(l) && a[g].push(l)
                }
                h = [];
                for (g = 0; g < a.length; g++) h[g] = 0;
                for (var b = [], k = [], m = [], c = [], e = new K($s), n = 0, g = 0; g < a.length; g++) {
                    var p = a[g].length;
                    if (1 === p) c.push(g);
                    else if (0 === p) e.add(d.fa(g));
                    else {
                        if (0 === n) b.push(g);
                        else {
                            for (var q = Infinity, r = Infinity, s = -1, u = [], p = 0; p < b.length; p++) 0 > a[b[p]].indexOf(b[p === b.length - 1 ? 0 : p + 1]) && u.push(p === b.length - 1 ? 0 : p + 1);
                            if (0 === u.length)
                                for (p = 0; p < b.length; p++) u.push(p);
                            for (p = 0; p < u.length; p++) {
                                var t = u[p],
                                    y, l = a[g];
                                y = k;
                                for (var w = m, A = h, B = t, P = b, H = 0, R = 0; R < y.length; R++) {
                                    var aa = A[y[R]],
                                        V = A[w[R]],
                                        ea = 0,
                                        la = 0;
                                    aa < V ? (ea = aa, la = V) : (ea = V, la = aa);
                                    if (ea < B && B <= la)
                                        for (aa = 0; aa < l.length; aa++) V = l[aa], 0 > P.indexOf(V) || ea < A[V] && A[V] < la || ea === A[V] || la === A[V] || H++;
                                    else
                                        for (aa = 0; aa < l.length; aa++) V = l[aa], 0 > P.indexOf(V) ||
                                            ea < A[V] && A[V] < la && ea !== A[V] && la !== A[V] && H++
                                }
                                y = H;
                                for (A = w = 0; A < a[g].length; A++) l = b.indexOf(a[g][A]), 0 <= l && (l = Math.abs(t - (l >= t ? l + 1 : l)), w += l < b.length + 1 - l ? l : b.length + 1 - l);
                                for (A = 0; A < k.length; A++) l = h[k[A]], B = h[m[A]], l >= t && l++, B >= t && B++, l > B && (P = B, B = l, l = P), B - l < (b.length + 2) / 2 === (l < t && t <= B) && w++;
                                if (y < q || y === q && w < r) q = y, r = w, s = t
                            }
                            b.splice(s, 0, g);
                            for (p = 0; p < b.length; p++) h[b[p]] = p;
                            for (p = 0; p < a[g].length; p++) q = a[g][p], 0 <= b.indexOf(q) && (k.push(g), m.push(q))
                        }
                        n++
                    }
                }
                g = !1;
                for (h = b.length;;) {
                    g = !0;
                    for (k = 0; k < c.length; k++)
                        if (m =
                            c[k], n = a[m][0], l = b.indexOf(n), 0 <= l) {
                            for (r = p = 0; r < a[n].length; r++) q = a[n][r], q = b.indexOf(q), 0 > q || q === l || (s = q > l ? q - l : l - q, p += q < l !== s > h - s ? 1 : -1);
                            b.splice(0 > p ? l : l + 1, 0, m);
                            c.splice(k, 1);
                            k--
                        } else g = !1;
                    if (g) break;
                    else b.push(c[0]), c.splice(0, 1)
                }
                for (g = 0; g < b.length; g++) e.add(d.fa(b[g]));
                return e;
            default:
                D.k("Invalid sorting type.")
        }
        return a
    };
    D.defineProperty(Is, { aK: "radius" }, function() { return this.lt }, function(a) { this.lt !== a && (D.h(a, "number", Is, "radius"), 0 < a || isNaN(a)) && (this.lt = a, this.L()) });
    D.defineProperty(Is, { cI: "aspectRatio" }, function() { return this.or }, function(a) { this.or !== a && (D.h(a, "number", Is, "aspectRatio"), 0 < a && (this.or = a, this.L())) });
    D.defineProperty(Is, { Me: "startAngle" }, function() { return this.Mt }, function(a) { this.Mt !== a && (D.h(a, "number", Is, "startAngle"), this.Mt = a, this.L()) });
    D.defineProperty(Is, { Df: "sweepAngle" }, function() { return this.Ot }, function(a) { this.Ot !== a && (D.h(a, "number", Is, "sweepAngle"), this.Ot = 0 < a && 360 >= a ? a : 360, this.L()) });
    D.defineProperty(Is, { eg: "arrangement" }, function() { return this.Bd }, function(a) { this.Bd !== a && (D.Da(a, Is, Is, "arrangement"), a === Xs || a === Js || a === Ws || a === Vs) && (this.Bd = a, this.L()) });
    D.defineProperty(Is, { direction: "direction" }, function() { return this.ga }, function(a) { this.ga !== a && (D.Da(a, Is, Is, "direction"), a === Ls || a === Us || a === Ss || a === Ts) && (this.ga = a, this.L()) });
    D.defineProperty(Is, { sorting: "sorting" }, function() { return this.ti }, function(a) { this.ti !== a && (D.Da(a, Is, Is, "sorting"), a === Qs || a === Rs || a === Os || Ps || a === Ms) && (this.ti = a, this.L()) });
    D.defineProperty(Is, { comparer: "comparer" }, function() { return this.ci }, function(a) { this.ci !== a && (D.h(a, "function", Is, "comparer"), this.ci = a, this.L()) });
    D.defineProperty(Is, { spacing: "spacing" }, function() { return this.ui }, function(a) { this.ui !== a && (D.h(a, "number", Is, "spacing"), this.ui = a, this.L()) });
    D.defineProperty(Is, { wy: "nodeDiameterFormula" }, function() { return this.Zs }, function(a) { this.Zs !== a && (D.Da(a, Is, Is, "nodeDiameterFormula"), a === Ns || a === Ys) && (this.Zs = a, this.L()) });
    D.w(Is, { PK: "actualXRadius" }, function() { return this.Td });
    D.w(Is, { QK: "actualYRadius" }, function() { return this.dg });
    D.w(Is, { OK: "actualSpacing" }, function() { return this.Dl });
    D.w(Is, { VH: "actualCenter" }, function() { return this.HC });
    var Js;
    Is.ConstantSpacing = Js = D.s(Is, "ConstantSpacing", 0);
    var Ws;
    Is.ConstantDistance = Ws = D.s(Is, "ConstantDistance", 1);
    var Vs;
    Is.ConstantAngle = Vs = D.s(Is, "ConstantAngle", 2);
    var Xs;
    Is.Packed = Xs = D.s(Is, "Packed", 3);
    var Ls;
    Is.Clockwise = Ls = D.s(Is, "Clockwise", 4);
    var Us;
    Is.Counterclockwise = Us = D.s(Is, "Counterclockwise", 5);
    var Ss;
    Is.BidirectionalLeft = Ss = D.s(Is, "BidirectionalLeft", 6);
    var Ts;
    Is.BidirectionalRight = Ts = D.s(Is, "BidirectionalRight", 7);
    var Qs;
    Is.Forwards = Qs = D.s(Is, "Forwards", 8);
    var Rs;
    Is.Reverse = Rs = D.s(Is, "Reverse", 9);
    var Os;
    Is.Ascending = Os = D.s(Is, "Ascending", 10);
    var Ps;
    Is.Descending = Ps = D.s(Is, "Descending", 11);
    var Ms;
    Is.Optimized = Ms = D.s(Is, "Optimized", 12);
    var Ns;
    Is.Pythagorean = Ns = D.s(Is, "Pythagorean", 13);
    var Ys;
    Is.Circular = Ys = D.s(Is, "Circular", 14);

    function Ks() {
        this.qq = -Infinity;
        this.cr = this.Bo = null
    }
    Ks.prototype.compare = function(a, b) {
        if (0 < a && 0 > this.qq || Math.abs(a) < Math.abs(this.qq) && !(0 > a && 0 < this.qq)) {
            this.qq = a;
            this.Bo = [];
            this.cr = [];
            for (var c = 0; c < b.length; c++) this.Bo[c] = b[c].pb.x, this.cr[c] = b[c].pb.y
        }
    };
    Ks.prototype.commit = function(a) {
        if (null !== this.Bo && null !== this.cr)
            for (var b = 0; b < this.Bo.length; b++) {
                var c = a.fa(b);
                c.x = this.Bo[b];
                c.y = this.cr[b]
            }
    };

    function Zs() { ua.call(this) }
    D.Ta(Zs, ua);
    D.ka("CircularNetwork", Zs);
    Zs.prototype.createVertex = function() { return new $s };
    Zs.prototype.createEdge = function() { return new mt };

    function $s() {
        va.call(this);
        this.actualAngle = this.diameter = NaN
    }
    D.Ta($s, va);
    D.ka("CircularVertex", $s);

    function at(a, b) {
        var c = a.network;
        if (null === c) return NaN;
        c = c.Yb;
        if (null === c) return NaN;
        if (c.eg === Xs)
            if (c.wy === Ys) a.diameter = Math.max(a.width, a.height);
            else {
                var c = Math.abs(Math.sin(b)),
                    d = Math.abs(Math.cos(b));
                if (0 === c) return a.width;
                if (0 === d) return a.height;
                a.diameter = Math.min(a.height / c, a.width / d)
            }
        else a.diameter = c.wy === Ys ? Math.max(a.width, a.height) : Math.sqrt(a.width * a.width + a.height * a.height);
        return a.diameter
    }

    function mt() { wa.call(this) }
    D.Ta(mt, wa);
    D.ka("CircularEdge", mt);

    function nt() {
        0 < arguments.length && D.zd(nt);
        $g.call(this);
        this.Ug = null;
        this.ys = 0;
        this.xg = (new Ca(100, 100)).freeze();
        this.nr = !1;
        this.si = !0;
        this.bi = !1;
        this.xp = 100;
        this.Zr = 1;
        this.bj = 1E3;
        this.Ts = 10;
        this.mt = Math;
        this.Vo = .05;
        this.Uo = 50;
        this.So = 150;
        this.To = 0;
        this.Lr = 10;
        this.Kr = 5
    }
    D.Ta(nt, $g);
    D.ka("ForceDirectedLayout", nt);
    nt.prototype.cloneProtected = function(a) {
        $g.prototype.cloneProtected.call(this, a);
        a.xg.assign(this.xg);
        a.nr = this.nr;
        a.si = this.si;
        a.bi = this.bi;
        a.xp = this.xp;
        a.Zr = this.Zr;
        a.bj = this.bj;
        a.Ts = this.Ts;
        a.mt = this.mt;
        a.Vo = this.Vo;
        a.Uo = this.Uo;
        a.So = this.So;
        a.To = this.To;
        a.Lr = this.Lr;
        a.Kr = this.Kr
    };
    nt.prototype.createNetwork = function() { return new ot };
    nt.prototype.doLayout = function(a) {
        null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
        null === this.network && (this.network = this.makeNetwork(a));
        a = this.AB;
        if (0 < this.network.vertexes.count) {
            this.network.Px();
            for (var b = this.network.vertexes.j; b.next();) {
                var c = b.value;
                c.charge = this.electricalCharge(c);
                c.mass = this.gravitationalMass(c)
            }
            for (b = this.network.edges.j; b.next();) c = b.value, c.stiffness = this.springStiffness(c), c.length = this.springLength(c);
            this.FA();
            this.ys = 0;
            if (this.needsClusterLayout()) {
                b = this.network;
                for (c = b.xK().j; c.next();) {
                    this.network = c.value;
                    for (var d = this.network.vertexes.j; d.next();) {
                        var e = d.value;
                        e.sg = e.vertexes.count;
                        e.hl = 1;
                        e.Hn = null;
                        e.Xh = null
                    }
                    pt(this, 0, a)
                }
                this.network = b;
                c.reset();
                v && D.l(b, ot, nt, "arrangeConnectedGraphs:singletons");
                for (var d = this.bF, g = c.count, h = !0, k = e = 0, l = D.mb(), m = 0; m < g + b.vertexes.count + 2; m++) l[m] = null;
                g = 0;
                c.reset();
                for (var n = D.Sf(); c.next();)
                    if (m = c.value, this.Kh(m, n), h) h = !1, e = n.x + n.width / 2, k = n.y + n.height /
                        2, l[0] = new N(n.x + n.width + d.width, n.y), l[1] = new N(n.x, n.y + n.height + d.height), g = 2;
                    else {
                        var p = qt(l, g, e, k, n.width, n.height, d),
                            q = l[p],
                            r = new N(q.x + n.width + d.width, q.y),
                            s = new N(q.x, q.y + n.height + d.height);
                        p + 1 < g && l.splice(p + 1, 0, null);
                        l[p] = r;
                        l[p + 1] = s;
                        g++;
                        p = q.x - n.x;
                        q = q.y - n.y;
                        for (m = m.vertexes.j; m.next();) r = m.value, r.pa += p, r.va += q
                    }
                D.Lb(n);
                for (m = b.vertexes.j; m.next();) h = m.value, n = h.pb, 2 > g ? (e = n.x + n.width / 2, k = n.y + n.height / 2, l[0] = new N(n.x + n.width + d.width, n.y), l[1] = new N(n.x, n.y + n.height + d.height), g = 2) : (p = qt(l, g,
                    e, k, n.width, n.height, d), q = l[p], r = new N(q.x + n.width + d.width, q.y), s = new N(q.x, q.y + n.height + d.height), p + 1 < g && l.splice(p + 1, 0, null), l[p] = r, l[p + 1] = s, g++, h.pa = q.x + h.width / 2, h.va = q.y + h.height / 2);
                D.ya(l);
                for (c.reset(); c.next();) { d = c.value; for (e = d.vertexes.j; e.next();) b.em(e.value); for (d = d.edges.j; d.next();) b.Xp(d.value) }
            }
            At(this, a);
            this.updateParts()
        }
        this.xp = a;
        this.network = null;
        this.zf = !0
    };
    nt.prototype.needsClusterLayout = function() {
        if (3 > this.network.vertexes.count) return !1;
        for (var a = 0, b = 0, c = this.network.vertexes.first().pb, d = this.network.vertexes.j; d.next();) {
            if (d.value.pb.jg(c) && (a++, 2 < a)) return !0;
            if (10 < b) break;
            b++
        }
        return !1
    };
    nt.prototype.Kh = function(a, b) {
        for (var c = !0, d = a.vertexes.j; d.next();) {
            var e = d.value;
            c ? (c = !1, b.set(e.pb)) : b.Zh(e.pb)
        }
        return b
    };

    function hu(a, b, c) { v && (D.p(b, nt, "computeClusterLayoutIterations:level"), D.p(c, nt, "computeClusterLayoutIterations:maxiter")); return Math.max(Math.min(a.network.vertexes.count, c * (b + 1) / 11), 10) }

    function pt(a, b, c) {
        v && (D.p(b, nt, "layoutClusters:level"), D.p(c, nt, "layoutClusters:maxiter"));
        if (iu(a, b)) {
            var d = a.bj;
            a.bj *= 1 + 1 / (b + 1);
            var e = ju(a, b),
                g = Math.max(0, hu(a, b, c));
            a.AB += g;
            pt(a, b + 1, c);
            At(a, g);
            ku(a, e, b);
            c = a.Ug;
            null === c ? c = new K(lu) : c.clear();
            c.Vc(e.vertexes);
            c.sort(function(a, b) { return null === a || null === b || a === b ? 0 : b.sg - a.sg });
            for (e = c.j; e.next();) mu(a, e.value, b);
            a.bj = d
        }
    }

    function iu(a, b) {
        v && D.p(b, nt, "hasClusters:level");
        if (10 < b || 3 > a.network.vertexes.count) return !1;
        null === a.Ug ? a.Ug = new K(lu) : a.Ug.clear();
        a.Ug.Vc(a.network.vertexes);
        var c = a.Ug;
        c.sort(function(a, b) { return null === a || null === b || a === b ? 0 : b.sg - a.sg });
        for (var d = c.count - 1; 0 <= d && 1 >= c.fa(d).sg;) d--;
        return 1 < c.count - d
    }

    function ju(a, b) {
        v && D.p(b, nt, "pushSubNetwork:level");
        for (var c = a.network, d = new ot, e = a.Ug.j; e.next();) {
            var g = e.value;
            if (1 < g.sg) {
                d.em(g);
                var h = new nu;
                h.cz = g.sg;
                h.dz = g.width;
                h.bz = g.height;
                h.zC = g.W.x;
                h.AC = g.W.y;
                null === g.Xh && (g.Xh = new K(nu));
                g.Xh.add(h);
                g.UB = g.Xh.count - 1
            } else break
        }
        for (var k = c.edges.j; k.next();)
            if (h = k.value, e = h.fromVertex, g = h.toVertex, e.network === d && g.network === d) d.Xp(h);
            else if (e.network === d) {
            var l = e.Hn;
            null === l && (l = new K(lu), e.Hn = l);
            l.add(g);
            e.sg--;
            e.hl += g.hl
        } else g.network === d && (l =
            g.Hn, null === l && (l = new K(lu), g.Hn = l), l.add(e), g.sg--, g.hl += e.hl);
        for (e = d.edges.j; e.next();) g = e.value, g.length *= Math.max(1, pe((g.fromVertex.hl + g.toVertex.hl) / (4 * b + 1)));
        for (e = d.vertexes.j; e.next();)
            if (g = e.value, l = g.Hn, null !== l && 0 < l.count && (h = g.Xh.fa(g.Xh.count - 1), h = h.cz - g.sg, !(0 >= h))) {
                for (var m = 0, n = 0, p = l.count - h; p < l.count; p++) {
                    for (var q = l.fa(p), r = null, k = q.edges.j; k.next();) { var s = k.value; if (s.VI(q) === g) { r = s; break } }
                    null !== r && (n += r.length, m += q.width * q.height)
                }
                k = g.pa;
                l = g.va;
                p = g.width;
                q = g.height;
                r = g.W;
                s =
                    p * q;
                1 > s && (s = 1);
                m = pe((m + s + n * n * 4 / (h * h)) / s);
                h = (m - 1) * p / 2;
                m = (m - 1) * q / 2;
                g.pb = new C(k - r.x - h, l - r.y - m, p + 2 * h, q + 2 * m);
                g.focus = new N(r.x + h, r.y + m)
            }
        a.network = d;
        return c
    }

    function ku(a, b, c) {
        v && (D.l(b, ot, nt, "popNetwork:oldnet"), D.p(c, nt, "popNetwork:level"));
        for (c = a.network.vertexes.j; c.next();) {
            var d = c.value;
            d.network = b;
            if (null !== d.Xh) {
                var e = d.Xh.fa(d.UB);
                d.sg = e.cz;
                var g = e.zC,
                    h = e.AC;
                d.pb = new C(d.pa - g, d.va - h, e.dz, e.bz);
                d.focus = new N(g, h);
                d.UB--
            }
        }
        for (c = a.network.edges.j; c.next();) c.value.network = b;
        a.network = b
    }

    function mu(a, b, c) {
        v && (D.l(b, lu, nt, "surroundNode:oldnet"), D.p(c, nt, "surroundNode:level"));
        var d = b.Hn;
        if (null !== d && 0 !== d.count) {
            c = b.pa;
            var e = b.va,
                g = b.width,
                h = b.height;
            null !== b.Xh && 0 < b.Xh.count && (h = b.Xh.fa(0), g = h.dz, h = h.bz);
            for (var g = pe(g * g + h * h) / 2, k = !1, l = h = 0, m = 0, n = b.vertexes.j; n.next();) {
                var p = n.value;
                1 >= p.sg ? l++ : (k = !0, m++, h += Math.atan2(b.va - p.va, b.pa - p.pa))
            }
            if (0 !== l)
                for (0 < m && (h /= m), m = b = 0, b = k ? 2 * Math.PI / (l + 1) : 2 * Math.PI / l, 0 === l % 2 && (m = b / 2), 1 < d.count && d.sort(function(a, b) {
                        return null === a || null === b || a ===
                            b ? 0 : b.width * b.height - a.width * a.height
                    }), k = 0 === l % 2 ? 0 : 1, d = d.j; d.next();)
                    if (l = d.value, !(1 < l.sg || a.isFixed(l))) {
                        n = null;
                        for (p = l.edges.j; p.next();) { n = p.value; break }
                        var p = l.width,
                            q = l.height,
                            p = pe(p * p + q * q) / 2,
                            n = g + n.length + p,
                            p = h + (b * (k / 2 >> 1) + m) * (0 === k % 2 ? 1 : -1);
                        l.pa = c + n * Math.cos(p);
                        l.va = e + n * Math.sin(p);
                        k++
                    }
        }
    }

    function qt(a, b, c, d, e, g, h) {
        var k = 9E19,
            l = -1,
            m = 0;
        a: for (; m < b; m++) {
            var n = a[m],
                p = n.x - c,
                q = n.y - d,
                p = p * p + q * q;
            if (p < k) {
                for (q = m - 1; 0 <= q; q--)
                    if (a[q].y > n.y && a[q].x - n.x < e + h.width) continue a;
                for (q = m + 1; q < b; q++)
                    if (a[q].x > n.x && a[q].y - n.y < g + h.height) continue a;
                l = m;
                k = p
            }
        }
        return l
    }
    nt.prototype.FA = function() {
        if (this.comments)
            for (var a = this.network.vertexes.j; a.next();) this.addComments(a.value)
    };
    nt.prototype.addComments = function(a) {
        var b = a.Zc;
        if (null !== b)
            for (b = b.GF(); b.next();) {
                var c = b.value;
                if ("Comment" === c.Kd && c.isVisible()) {
                    var d = this.network.Rn(c);
                    null === d && (d = this.network.bu(c));
                    d.charge = this.vI;
                    for (var c = null, e = d.tc; e.next();) { var g = e.value; if (g.toVertex === a) { c = g; break } }
                    if (null === c)
                        for (e = d.wc; e.next();)
                            if (g = e.value, g.fromVertex === a) { c = g; break }
                    null === c && (c = this.network.Fq(a, d, null));
                    c.length = this.wI
                }
            }
    };

    function ou(a, b) {
        v && (D.l(a, lu, nt, "getNodeDistance:vertexA"), D.l(b, lu, nt, "getNodeDistance:vertexB"));
        var c = a.Q,
            d = c.x,
            e = c.y,
            g = c.width,
            c = c.height,
            h = b.Q,
            k = h.x,
            l = h.y,
            m = h.width,
            h = h.height;
        return d + g < k ? e > l + h ? (d = d + g - k, e = e - l - h, pe(d * d + e * e)) : e + c < l ? (d = d + g - k, e = e + c - l, pe(d * d + e * e)) : k - (d + g) : d > k + m ? e > l + h ? (d = d - k - m, e = e - l - h, pe(d * d + e * e)) : e + c < l ? (d = d - k - m, e = e + c - l, pe(d * d + e * e)) : d - (k + m) : e > l + h ? e - (l + h) : e + c < l ? l - (e + c) : .1
    }

    function At(a, b) {
        v && D.p(b, nt, "performIterations:num");
        a.Ug = null;
        for (var c = a.ys + b; a.ys < c && (a.ys++, pu(a)););
        a.Ug = null
    }

    function pu(a) {
        null === a.Ug && (a.Ug = new K(lu), a.Ug.Vc(a.network.vertexes));
        var b = a.Ug.o;
        if (0 >= b.length) return !1;
        var c = b[0];
        c.forceX = 0;
        c.forceY = 0;
        for (var d = c.pa, e = d, g = c.va, h = g, c = 1; c < b.length; c++) {
            var k = b[c];
            k.forceX = 0;
            k.forceY = 0;
            var l = k.pa,
                k = k.va,
                d = Math.min(d, l),
                e = Math.max(e, l),
                g = Math.min(g, k),
                h = Math.max(h, k)
        }(g = e - d > h - g) ? b.sort(function(a, b) { return null === a || null === b || a === b ? 0 : a.pa - b.pa }): b.sort(function(a, b) { return null === a || null === b || a === b ? 0 : a.va - b.va });
        for (var h = a.bj, m = 0, n = 0, p = 0, c = 0; c < b.length; c++) {
            var k =
                b[c],
                l = k.Q,
                q = k.W,
                d = l.x + q.x,
                l = l.y + q.y,
                n = k.charge * a.electricalFieldX(d, l),
                p = k.charge * a.electricalFieldY(d, l),
                n = n + k.mass * a.gravitationalFieldX(d, l),
                p = p + k.mass * a.gravitationalFieldY(d, l);
            k.forceX += n;
            k.forceY += p;
            for (q = c + 1; q < b.length; q++)
                if (e = b[q], e !== k) {
                    var r = e.Q,
                        n = e.W,
                        p = r.x + n.x,
                        r = r.y + n.y;
                    if (d - p > h || p - d > h) { if (g) break } else if (l - r > h || r - l > h) { if (!g) break } else {
                        var s = ou(k, e);
                        1 > s ? (n = a.Fy, null === n && (a.Fy = n = new Ia(0)), m = n.random(), s = n.random(), d > p ? (n = Math.abs(e.Q.right - k.Q.x), n = (1 + n) * m) : d < p ? (n = Math.abs(e.Q.x - k.Q.right),
                            n = -(1 + n) * m) : (n = Math.max(e.width, k.width), n = (1 + n) * m - n / 2), l > r ? (p = Math.abs(e.Q.bottom - k.Q.y), p = (1 + p) * s) : d < p ? (p = Math.abs(e.Q.y - k.Q.bottom), p = -(1 + p) * s) : (p = Math.max(e.height, k.height), p = (1 + p) * s - p / 2)) : (m = -(k.charge * e.charge) / (s * s), n = (p - d) / s * m, p = (r - l) / s * m);
                        k.forceX += n;
                        k.forceY += p;
                        e.forceX -= n;
                        e.forceY -= p
                    }
                }
        }
        for (c = a.network.edges.j; c.next();) g = c.value, k = g.fromVertex, e = g.toVertex, l = k.Q, q = k.W, d = l.x + q.x, l = l.y + q.y, r = e.Q, n = e.W, p = r.x + n.x, r = r.y + n.y, s = ou(k, e), 1 > s ? (n = a.Fy, null === n && (a.Fy = n = new Ia(0)), m = n.random(), s =
            n.random(), n = (d > p ? 1 : -1) * (1 + (e.width > k.width ? e.width : k.width)) * m, p = (l > r ? 1 : -1) * (1 + (e.height > k.height ? e.height : k.height)) * s) : (m = g.stiffness * (s - g.length), n = (p - d) / s * m, p = (r - l) / s * m), k.forceX += n, k.forceY += p, e.forceX -= n, e.forceY -= p;
        c = 0;
        d = a.UJ;
        for (e = 0; e < b.length; e++) k = b[e], a.isFixed(k) ? a.moveFixedVertex(k) : (g = k.forceX, h = k.forceY, g < -d ? g = -d : g > d && (g = d), h < -d ? h = -d : h > d && (h = d), k.pa += g, k.va += h, c = Math.max(c, g * g + h * h));
        return c > a.DF * a.DF
    }
    nt.prototype.moveFixedVertex = function() {};
    nt.prototype.commitLayout = function() {
        this.aC();
        this.commitNodes();
        this.Pu && this.commitLinks()
    };
    nt.prototype.aC = function() {
        if (this.Xq)
            for (var a = this.network.edges.j; a.next();) {
                var b = a.value.link;
                null !== b && (b.Gb = Vc, b.Hb = Vc)
            }
    };
    nt.prototype.commitNodes = function() {
        var a = 0,
            b = 0;
        if (this.bI) {
            var c = D.Sf();
            this.Kh(this.network, c);
            b = this.Zd;
            a = b.x - c.x;
            b = b.y - c.y;
            D.Lb(c)
        }
        for (var c = D.Sf(), d = this.network.vertexes.j; d.next();) {
            var e = d.value;
            if (0 !== a || 0 !== b) c.assign(e.pb), c.x += a, c.y += b, e.pb = c;
            e.commit()
        }
        D.Lb(c)
    };
    nt.prototype.commitLinks = function() { for (var a = this.network.edges.j; a.next();) a.value.commit() };
    nt.prototype.springStiffness = function(a) { a = a.stiffness; return isNaN(a) ? this.Vo : a };
    nt.prototype.springLength = function(a) { a = a.length; return isNaN(a) ? this.Uo : a };
    nt.prototype.electricalCharge = function(a) { a = a.charge; return isNaN(a) ? this.So : a };
    nt.prototype.electricalFieldX = function() { return 0 };
    nt.prototype.electricalFieldY = function() { return 0 };
    nt.prototype.gravitationalMass = function(a) { a = a.mass; return isNaN(a) ? this.To : a };
    nt.prototype.gravitationalFieldX = function() { return 0 };
    nt.prototype.gravitationalFieldY = function() { return 0 };
    nt.prototype.isFixed = function(a) { return a.isFixed };
    D.w(nt, { vL: "currentIteration" }, function() { return this.ys });
    D.defineProperty(nt, { bF: "arrangementSpacing" }, function() { return this.xg }, function(a) {
        D.l(a, Ca, nt, "arrangementSpacing");
        this.xg.O(a) || (this.xg.assign(a), this.L())
    });
    D.defineProperty(nt, { bI: "arrangesToOrigin" }, function() { return this.nr }, function(a) { this.nr !== a && (D.h(a, "boolean", nt, "arrangesToOrigin"), this.nr = a, this.L()) });
    D.defineProperty(nt, { Xq: "setsPortSpots" }, function() { return this.si }, function(a) { this.si !== a && (D.h(a, "boolean", nt, "setsPortSpots"), this.si = a, this.L()) });
    D.defineProperty(nt, { comments: "comments" }, function() { return this.bi }, function(a) { this.bi !== a && (D.h(a, "boolean", nt, "comments"), this.bi = a, this.L()) });
    D.defineProperty(nt, { AB: "maxIterations" }, function() { return this.xp }, function(a) { this.xp !== a && (D.h(a, "number", nt, "maxIterations"), 0 <= a && (this.xp = a, this.L())) });
    D.defineProperty(nt, { DF: "epsilonDistance" }, function() { return this.Zr }, function(a) { this.Zr !== a && (D.h(a, "number", nt, "epsilonDistance"), 0 < a && (this.Zr = a, this.L())) });
    D.defineProperty(nt, { UL: "infinityDistance" }, function() { return this.bj }, function(a) { this.bj !== a && (D.h(a, "number", nt, "infinityDistance"), 1 < a && (this.bj = a, this.L())) });
    D.defineProperty(nt, { UJ: "moveLimit" }, function() { return this.Ts }, function(a) { this.Ts !== a && (D.h(a, "number", nt, "moveLimit"), 1 < a && (this.Ts = a, this.L())) });
    D.defineProperty(nt, { Fy: "randomNumberGenerator" }, function() { return this.mt }, function(a) { this.mt !== a && (null !== a && "function" !== typeof a.random && D.k('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: ' + a), this.mt = a) });
    D.defineProperty(nt, { HL: "defaultSpringStiffness" }, function() { return this.Vo }, function(a) { this.Vo !== a && (D.h(a, "number", nt, "defaultSpringStiffness"), this.Vo = a, this.L()) });
    D.defineProperty(nt, { GL: "defaultSpringLength" }, function() { return this.Uo }, function(a) { this.Uo !== a && (D.h(a, "number", nt, "defaultSpringLength"), this.Uo = a, this.L()) });
    D.defineProperty(nt, { AL: "defaultElectricalCharge" }, function() { return this.So }, function(a) { this.So !== a && (D.h(a, "number", nt, "defaultElectricalCharge"), this.So = a, this.L()) });
    D.defineProperty(nt, { BL: "defaultGravitationalMass" }, function() { return this.To }, function(a) { this.To !== a && (D.h(a, "number", nt, "defaultGravitationalMass"), this.To = a, this.L()) });
    D.defineProperty(nt, { wI: "defaultCommentSpringLength" }, function() { return this.Lr }, function(a) { this.Lr !== a && (D.h(a, "number", nt, "defaultCommentSpringLength"), this.Lr = a, this.L()) });
    D.defineProperty(nt, { vI: "defaultCommentElectricalCharge" }, function() { return this.Kr }, function(a) { this.Kr !== a && (D.h(a, "number", nt, "defaultCommentElectricalCharge"), this.Kr = a, this.L()) });

    function nu() { this.AC = this.zC = this.bz = this.dz = this.cz = 0 }

    function ot() { ua.call(this) }
    D.Ta(ot, ua);
    D.ka("ForceDirectedNetwork", ot);
    ot.prototype.createVertex = function() { return new lu };
    ot.prototype.createEdge = function() { return new qu };

    function lu() {
        va.call(this);
        this.isFixed = !1;
        this.mass = this.charge = NaN;
        this.hl = this.sg = this.forceY = this.forceX = 0;
        this.Xh = this.Hn = null;
        this.UB = 0
    }
    D.Ta(lu, va);
    D.ka("ForceDirectedVertex", lu);

    function qu() {
        wa.call(this);
        this.length = this.stiffness = NaN
    }
    D.Ta(qu, wa);
    D.ka("ForceDirectedEdge", qu);

    function ru() {
        0 < arguments.length && D.zd(ru);
        $g.call(this);
        this.ie = this.an = 25;
        this.ga = 0;
        this.Ro = su;
        this.sp = tu;
        this.ip = uu;
        this.$m = 4;
        this.Fo = vu;
        this.qj = wu;
        this.si = !0;
        this.Ds = 4;
        this.Qb = this.Bw = this.Ab = -1;
        this.Zf = this.Ms = 0;
        this.Vb = this.Xf = this.Yf = this.Jg = this.ve = null;
        this.Vs = 0;
        this.Us = this.fn = null;
        this.Lg = 0;
        this.Ws = null;
        this.KC = new N;
        this.yh = [];
        this.yh.length = 100
    }
    D.Ta(ru, $g);
    D.ka("LayeredDigraphLayout", ru);
    ru.prototype.cloneProtected = function(a) {
        $g.prototype.cloneProtected.call(this, a);
        a.an = this.an;
        a.ie = this.ie;
        a.ga = this.ga;
        a.Ro = this.Ro;
        a.sp = this.sp;
        a.ip = this.ip;
        a.$m = this.$m;
        a.Fo = this.Fo;
        a.qj = this.qj;
        a.si = this.si;
        a.Ds = this.Ds
    };
    ru.prototype.qc = function(a) { a.Qe === ru ? 0 === a.name.indexOf("Aggressive") ? this.aI = a : 0 === a.name.indexOf("Cycle") ? this.uI = a : 0 === a.name.indexOf("Init") ? this.lJ = a : 0 === a.name.indexOf("Layer") ? this.zJ = a : D.k("Unknown enum value: " + a) : $g.prototype.qc.call(this, a) };
    ru.prototype.createNetwork = function() { return new xu };
    ru.prototype.doLayout = function(a) {
        null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
        null === this.network && (this.network = this.makeNetwork(a));
        this.Zd = this.initialOrigin(this.Zd);
        this.Bw = -1;
        this.Zf = this.Ms = 0;
        this.Ws = this.Us = this.fn = null;
        for (a = 0; a < this.yh.length; a++) this.yh[a] = null;
        if (0 < this.network.vertexes.count) {
            this.network.Px();
            for (a = this.network.edges.j; a.next();) a.value.rev = !1;
            switch (this.Ro) {
                default:
                    case yu:
                    a = this.network;
                var b =
                    0,
                    c = a.vertexes.count - 1,
                    d = [];d.length = c + 1;
                for (var e = a.vertexes.j; e.next();) e.value.valid = !0;
                for (; null !== zu(a);) {
                    for (e = Au(a); null !== e;) d[c] = e, c--, e.valid = !1, e = Au(a);
                    for (e = Bu(a); null !== e;) d[b] = e, b++, e.valid = !1, e = Bu(a);
                    for (var e = null, g = 0, h = this.network.vertexes.j; h.next();) { var k = h.value; if (k.valid) { for (var l = 0, m = k.tc; m.next();) m.value.toVertex.valid && l++; for (var m = 0, n = k.wc; n.next();) n.value.fromVertex.valid && m++; if (null === e || g < l - m) e = k, g = l - m } }
                    null !== e && (d[b] = e, b++, e.valid = !1)
                }
                for (b = 0; b < a.vertexes.count; b++) d[b].index =
                    b;
                for (d = a.edges.j; d.next();) b = d.value,
                b.fromVertex.index > b.toVertex.index && (a.Ly(b), b.rev = !0);
                break;
                case su:
                        for (d = this.network.vertexes.j; d.next();) a = d.value, a.lq = -1, a.finish = -1;
                    for (a = this.network.edges.j; a.next();) a.value.forest = !1;this.Vs = 0;
                    for (d.reset(); d.next();) b = d.value,
                    0 === b.wc.count && Cu(this, b);
                    for (d.reset(); d.next();) b = d.value,
                    -1 === b.lq && Cu(this, b);
                    for (a.reset(); a.next();) d = a.value,
                    d.forest || (b = d.fromVertex, c = b.finish, e = d.toVertex, g = e.finish, e.lq < b.lq && c < g && (this.network.Ly(d), d.rev = !0))
            }
            for (a =
                this.network.vertexes.j; a.next();) a.value.layer = -1;
            this.Ab = -1;
            this.assignLayers();
            for (a.reset(); a.next();) this.Ab = Math.max(this.Ab, a.value.layer);
            a = this.network;
            d = [];
            for (c = a.edges.j; c.next();) b = c.value, b.valid = !1, d.push(b);
            for (c = 0; c < d.length; c++)
                if (b = d[c], g = b.fromVertex, e = b.toVertex, !b.valid && (null !== g.Gd && null !== e.Gd || g.layer !== e.layer)) {
                    m = k = l = h = 0;
                    if (null !== b.link) {
                        l = b.link;
                        if (null === l) continue;
                        var p = g.Gd,
                            h = e.Gd;
                        if (null === p || null === h) continue;
                        var q = l.$,
                            k = l.ba,
                            r = l.oc,
                            m = l.Gc;
                        b.rev && (l = q, n = r, q = k, r =
                            m, k = l, m = n);
                        var s = g.W,
                            l = e.W,
                            u = b.rev ? e.Q : g.Q,
                            n = D.P();
                        u.H() ? (lr(q, r, mc, n), n.H() || n.assign(s)) : n.assign(s);
                        p !== q && u.H() && q.isVisible() && (p = g.Q, p.H() && (n.x += u.x - p.x, n.y += u.y - p.y));
                        q = b.rev ? g.Q : e.Q;
                        p = D.P();
                        q.H() ? (lr(k, m, mc, p), p.H() || p.assign(l)) : p.assign(l);
                        h !== k && q.H() && k.isVisible() && (h = e.Q, h.H() && (p.x += q.x - h.x, p.y += q.y - h.y));
                        90 === this.ga || 270 === this.ga ? (h = Math.round((n.x - s.x) / this.ie), k = n.x, l = Math.round((p.x - l.x) / this.ie), m = p.x) : (h = Math.round((n.y - s.y) / this.ie), k = n.y, l = Math.round((p.y - l.y) / this.ie), m =
                            p.y);
                        D.A(n);
                        D.A(p);
                        b.portFromColOffset = h;
                        b.portFromPos = k;
                        b.portToColOffset = l;
                        b.portToPos = m
                    } else b.portFromColOffset = 0, b.portFromPos = 0, b.portToColOffset = 0, b.portToPos = 0;
                    n = g.layer;
                    s = e.layer;
                    a: if (p = b, q = 0, u = p.link, null !== u) {
                            var t = u.oc,
                                y = u.Gc;
                            if (null !== t && null !== y) {
                                var w = u.$,
                                    r = u.ba;
                                if (null !== w && null !== r) {
                                    var A = t.Gb,
                                        B = y.Hb;
                                    this.Xq || (u.Gb.ld() || (A = u.Gb), u.Hb.ld() || (B = u.Hb));
                                    var P = u.ic,
                                        H = Du(this, !0);
                                    if (A.ld() || A === dc) A = H;
                                    var R = Du(this, !1);
                                    if (B.ld() || B === dc) B = R;
                                    if (A.Pj() && A.Mj(R) && B.Pj() && B.Mj(H)) { q = 0; break a }
                                    H =
                                        u.getLinkPoint(w, t, A, !0, P, r, y, D.P());
                                    A = u.getLinkDirection(w, t, H, A, !0, P, r, y);
                                    D.A(H);
                                    A === Eu(this, p, !0) ? q += 1 : this.Xq && null !== w && 1 === w.ports.count && p.rev && (q += 1);
                                    A = u.getLinkPoint(r, y, B, !1, P, w, t, D.P());
                                    u = u.getLinkDirection(r, y, A, B, !1, P, w, t);
                                    D.A(A);
                                    u === Eu(this, p, !1) ? q += 2 : this.Xq && null !== r && 1 === r.ports.count && p.rev && (q += 2)
                                }
                            }
                        }
                    p = 1 === q || 3 === q ? !0 : !1;
                    if (q = 2 === q || 3 === q ? !0 : !1) r = a.createVertex(), r.Gd = null, r.En = 1, r.layer = n, r.near = g, a.em(r), g = a.Fq(g, r, b.link), g.valid = !1, g.rev = b.rev, g.portFromColOffset = h, g.portToColOffset =
                        0, g.portFromPos = k, g.portToPos = 0, g = r;
                    u = 1;
                    p && u--;
                    if (n - s > u && 0 < n) {
                        b.valid = !1;
                        r = a.createVertex();
                        r.Gd = null;
                        r.En = 2;
                        r.layer = n - 1;
                        a.em(r);
                        g = a.Fq(g, r, b.link);
                        g.valid = !0;
                        g.rev = b.rev;
                        g.portFromColOffset = q ? 0 : h;
                        g.portToColOffset = 0;
                        g.portFromPos = q ? 0 : k;
                        g.portToPos = 0;
                        g = r;
                        for (n--; n - s > u && 0 < n;) r = a.createVertex(), r.Gd = null, r.En = 3, r.layer = n - 1, a.em(r), g = a.Fq(g, r, b.link), g.valid = !0, g.rev = b.rev, g.portFromColOffset = 0, g.portToColOffset = 0, g.portFromPos = 0, g.portToPos = 0, g = r, n--;
                        g = a.Fq(r, e, b.link);
                        g.valid = !p;
                        p && (r.near = e);
                        g.rev =
                            b.rev;
                        g.portFromColOffset = 0;
                        g.portToColOffset = l;
                        g.portFromPos = 0;
                        g.portToPos = m
                    } else b.valid = !0
                }
            d = this.ve = [];
            for (b = 0; b <= this.Ab; b++) d[b] = 0;
            for (a = this.network.vertexes.j; a.next();) a.value.index = -1;
            this.initializeIndices();
            this.Bw = -1;
            for (b = this.Zf = this.Ms = 0; b <= this.Ab; b++) d[b] > d[this.Zf] && (this.Bw = d[b] - 1, this.Zf = b), d[b] < d[this.Ms] && (this.Ms = b);
            this.Ws = [];
            for (b = 0; b < d.length; b++) this.Ws[b] = [];
            for (a.reset(); a.next();) d = a.value, this.Ws[d.layer][d.index] = d;
            this.Qb = -1;
            for (a = 0; a <= this.Ab; a++) {
                d = Fu(this, a);
                b =
                    0;
                c = this.ve[a];
                for (e = 0; e < c; e++) g = d[e], b += this.nodeMinColumnSpace(g, !0), g.column = b, b += 1, b += this.nodeMinColumnSpace(g, !1);
                this.Qb = Math.max(this.Qb, b - 1);
                Gu(this, a, d)
            }
            this.reduceCrossings();
            this.straightenAndPack();
            this.updateParts()
        }
        this.network = null;
        this.zf = !0
    };
    ru.prototype.linkMinLength = function() { return 1 };

    function Hu(a) {
        var b = a.fromVertex.Gd;
        a = a.toVertex.Gd;
        return null === b && null === a ? 8 : null === b || null === a ? 4 : 1
    }
    ru.prototype.nodeMinLayerSpace = function(a, b) { return null === a.Gd ? 0 : 90 === this.ga || 270 === this.ga ? b ? a.W.y + 10 : a.Q.height - a.W.y + 10 : b ? a.W.x + 10 : a.Q.width - a.W.x + 10 };
    ru.prototype.nodeMinColumnSpace = function(a, b) {
        if (null === a.Gd) return 0;
        var c = b ? a.IB : a.HB;
        if (null !== c) return c;
        c = this.ga;
        return 90 === c || 270 === c ? b ? a.IB = a.W.x / this.ie + 1 | 0 : a.HB = (a.Q.width - a.W.x) / this.ie + 1 | 0 : b ? a.IB = a.W.y / this.ie + 1 | 0 : a.HB = (a.Q.height - a.W.y) / this.ie + 1 | 0
    };

    function Iu(a) {
        null === a.fn && (a.fn = []);
        for (var b = 0, c = a.network.vertexes.j; c.next();) {
            var d = c.value;
            a.fn[b] = d.layer;
            b++;
            a.fn[b] = d.column;
            b++;
            a.fn[b] = d.index;
            b++
        }
        return a.fn
    }

    function Ju(a, b) {
        for (var c = 0, d = a.network.vertexes.j; d.next();) {
            var e = d.value;
            e.layer = b[c];
            c++;
            e.column = b[c];
            c++;
            e.index = b[c];
            c++
        }
    }

    function Ku(a, b, c) {
        v && (D.p(b, ru, "crossingMatrix:unfixedLayer"), D.p(c, ru, "crossingMatrix:direction"));
        var d = Fu(a, b),
            e = a.ve[b];
        if (null === a.Us || a.Us.length < e * e) a.Us = [];
        for (var g = a.Us, h = 0; h < e; h++) {
            var k = 0,
                l = d[h],
                m = l.near,
                n = 0;
            if (null !== m && m.layer === l.layer)
                if (n = m.index, n > h)
                    for (var p = h + 1; p < n; p++) l = d[p], l.near === m && l.En === m.En || k++;
                else
                    for (p = h - 1; p > n; p--) l = d[p], l.near === m && l.En === m.En || k++;
            var m = 0,
                q, r = q = p = l = 0,
                s, u = 0,
                t = 0;
            s = 0;
            var y;
            if (0 <= c)
                for (n = d[h].Ye, m = 0; m < n.count; m++)
                    if (q = n.o[m], q.valid && q.fromVertex.layer !==
                        b)
                        for (l = q.fromVertex.index, p = q.portToPos, q = q.portFromPos, r = m + 1; r < n.count; r++) s = n.o[r], s.valid && s.fromVertex.layer !== b && (u = s.fromVertex.index, t = s.portToPos, s = s.portFromPos, p < t && (l > u || l === u && q > s) && k++, t < p && (u > l || u === l && s > q) && k++);
            if (0 >= c)
                for (n = d[h].Re, m = 0; m < n.count; m++)
                    if (q = n.o[m], q.valid && q.toVertex.layer !== b)
                        for (l = q.toVertex.index, p = q.portToPos, q = q.portFromPos, r = m + 1; r < n.count; r++) s = n.o[r], s.valid && s.toVertex.layer !== b && (u = s.toVertex.index, t = s.portToPos, s = s.portFromPos, q < s && (l > u || l === u && p > t) && k++,
                            s < q && (u > l || u === l && t > p) && k++);
            g[h * e + h] = k;
            for (n = h + 1; n < e; n++) {
                var w = 0,
                    A = 0;
                if (0 <= c)
                    for (k = d[h].Ye, y = d[n].Ye, m = 0; m < k.count; m++)
                        if (q = k.o[m], q.valid && q.fromVertex.layer !== b)
                            for (l = q.fromVertex.index, q = q.portFromPos, r = 0; r < y.count; r++) s = y.o[r], s.valid && s.fromVertex.layer !== b && (u = s.fromVertex.index, s = s.portFromPos, (l < u || l === u && q < s) && A++, (u < l || u === l && s < q) && w++);
                if (0 >= c)
                    for (k = d[h].Re, y = d[n].Re, m = 0; m < k.count; m++)
                        if (q = k.o[m], q.valid && q.toVertex.layer !== b)
                            for (l = q.toVertex.index, p = q.portToPos, r = 0; r < y.count; r++) s = y.o[r],
                                s.valid && s.toVertex.layer !== b && (u = s.toVertex.index, t = s.portToPos, (l < u || l === u && p < t) && A++, (u < l || u === l && t < p) && w++);
                g[h * e + n] = w;
                g[n * e + h] = A
            }
        }
        Gu(a, b, d);
        return g
    }
    ru.prototype.countCrossings = function() {
        for (var a = 0, b = 0; b <= this.Ab; b++)
            for (var c = Ku(this, b, 1), d = this.ve[b], e = 0; e < d; e++)
                for (var g = e; g < d; g++) a += c[e * d + g];
        return a
    };

    function Lu(a) {
        for (var b = 0, c = 0; c <= a.Ab; c++) {
            for (var d = a, e = c, g = Fu(d, e), h = d.ve[e], k = 0, l = 0; l < h; l++) {
                var m = null,
                    m = g[l].Re,
                    n, p = 0,
                    q = 0;
                if (null !== m)
                    for (var r = 0; r < m.count; r++) n = m.o[r], n.valid && n.toVertex.layer !== e && (p = n.fromVertex.column + n.portFromColOffset, q = n.toVertex.column + n.portToColOffset, k += (Math.abs(p - q) + 1) * Hu(n))
            }
            Gu(d, e, g);
            b += k
        }
        return b
    }
    ru.prototype.normalize = function() {
        var a = Infinity;
        this.Qb = -1;
        for (var b = this.network.vertexes.j; b.next();) {
            var c = b.value,
                a = Math.min(a, c.column - this.nodeMinColumnSpace(c, !0));
            this.Qb = Math.max(this.Qb, c.column + this.nodeMinColumnSpace(c, !1))
        }
        for (b.reset(); b.next();) b.value.column -= a;
        this.Qb -= a
    };

    function Mu(a, b, c) {
        v && (D.p(b, ru, "barycenters:unfixedLayer"), D.p(c, ru, "barycenters:direction"));
        for (var d = Fu(a, b), e = a.ve[b], g = [], h = 0; h < e; h++) {
            var k = d[h],
                l = null;
            0 >= c && (l = k.Ye);
            var m = null;
            0 <= c && (m = k.Re);
            var n = 0,
                p = 0,
                q = k.near;
            null !== q && q.layer === k.layer && (n += q.column - 1, p++);
            if (null !== l)
                for (q = 0; q < l.count; q++) {
                    var k = l.o[q],
                        r = k.fromVertex;
                    k.valid && !k.rev && r.layer !== b && (n += r.column, p++)
                }
            if (null !== m)
                for (l = 0; l < m.count; l++) k = m.o[l], q = k.toVertex, k.valid && !k.rev && q.layer !== b && (n += q.column, p++);
            g[h] = 0 === p ? -1 : n /
                p
        }
        Gu(a, b, d);
        return g
    }

    function Nu(a, b, c) {
        v && (D.p(b, ru, "medians:unfixedLayer"), D.p(c, ru, "medians:direction"));
        for (var d = Fu(a, b), e = a.ve[b], g = [], h = 0; h < e; h++) {
            var k = d[h],
                l = null;
            0 >= c && (l = k.Ye);
            var m = null;
            0 <= c && (m = k.Re);
            var n = 0,
                p = [],
                q = k.near;
            null !== q && q.layer === k.layer && (p[n] = q.column - 1, n++);
            if (null !== l)
                for (q = 0; q < l.count; q++) {
                    var k = l.o[q],
                        r = k.fromVertex;
                    k.valid && !k.rev && r.layer !== b && (p[n] = r.column + k.portFromColOffset, n++)
                }
            if (null !== m)
                for (l = 0; l < m.count; l++) k = m.o[l], q = k.toVertex, k.valid && !k.rev && q.layer !== b && (p[n] = q.column + k.portToColOffset,
                    n++);
            0 === n ? g[h] = -1 : (p.sort(function(a, b) { return a - b }), m = n >> 1, g[h] = 0 !== (n & 1) ? p[m] : p[m - 1] + p[m] >> 1)
        }
        Gu(a, b, d);
        return g
    }

    function Ou(a, b, c, d, e, g) {
        if (b.component === d) {
            b.component = c;
            var h = 0,
                k = 0;
            if (e)
                for (var l = b.tc; l.next();) {
                    var k = l.value,
                        m = k.toVertex,
                        h = b.layer - m.layer,
                        k = a.linkMinLength(k);
                    h === k && Ou(a, m, c, d, e, g)
                }
            if (g)
                for (l = b.wc; l.next();) k = l.value, m = k.fromVertex, h = m.layer - b.layer, k = a.linkMinLength(k), h === k && Ou(a, m, c, d, e, g)
        }
    }

    function Pu(a, b, c, d, e, g) {
        if (b.component === d) {
            b.component = c;
            if (e)
                for (var h = b.tc; h.next();) Pu(a, h.value.toVertex, c, d, e, g);
            if (g)
                for (b = b.wc; b.next();) Pu(a, b.value.fromVertex, c, d, e, g)
        }
    }

    function zu(a) { for (a = a.vertexes.j; a.next();) { var b = a.value; if (b.valid) return b } return null }

    function Au(a) {
        for (a = a.vertexes.j; a.next();) {
            var b = a.value;
            if (b.valid) {
                for (var c = !0, d = b.tc; d.next();)
                    if (d.value.toVertex.valid) { c = !1; break }
                if (c) return b
            }
        }
        return null
    }

    function Bu(a) {
        for (a = a.vertexes.j; a.next();) {
            var b = a.value;
            if (b.valid) {
                for (var c = !0, d = b.wc; d.next();)
                    if (d.value.fromVertex.valid) { c = !1; break }
                if (c) return b
            }
        }
        return null
    }

    function Cu(a, b) {
        b.lq = a.Vs;
        a.Vs++;
        for (var c = b.tc; c.next();) {
            var d = c.value,
                e = d.toVertex; - 1 === e.lq && (d.forest = !0, Cu(a, e))
        }
        b.finish = a.Vs;
        a.Vs++
    }
    ru.prototype.assignLayers = function() {
        switch (this.sp) {
            case Qu:
                Ru(this);
                break;
            case Su:
                for (var a = 0, b = this.network.vertexes.j; b.next();) a = Tu(this, b.value), this.Ab = Math.max(a, this.Ab);
                for (b.reset(); b.next();) a = b.value, a.layer = this.Ab - a.layer;
                break;
            default:
            case tu:
                Ru(this);
                for (b = this.network.vertexes.j; b.next();) b.value.valid = !1;
                for (b.reset(); b.next();) a = b.value, 0 === a.wc.count && Uu(this, a);
                a = Infinity;
                for (b.reset(); b.next();) a = Math.min(a, b.value.layer);
                this.Ab = -1;
                for (b.reset(); b.next();) {
                    var c = b.value;
                    c.layer -=
                        a;
                    this.Ab = Math.max(this.Ab, c.layer)
                }
        }
    };

    function Ru(a) {
        for (var b = a.network.vertexes.j; b.next();) {
            var c = Vu(a, b.value);
            a.Ab = Math.max(c, a.Ab)
        }
    }

    function Vu(a, b) {
        var c = 0;
        if (-1 === b.layer) {
            for (var d = b.tc; d.next();) var e = d.value,
                g = e.toVertex,
                e = a.linkMinLength(e),
                c = Math.max(c, Vu(a, g) + e);
            b.layer = c
        } else c = b.layer;
        return c
    }

    function Tu(a, b) {
        var c = 0;
        if (-1 === b.layer) {
            for (var d = b.wc; d.next();) var e = d.value,
                g = e.fromVertex,
                e = a.linkMinLength(e),
                c = Math.max(c, Tu(a, g) + e);
            b.layer = c
        } else c = b.layer;
        return c
    }

    function Uu(a, b) {
        if (!b.valid) {
            b.valid = !0;
            for (var c = b.tc; c.next();) Uu(a, c.value.toVertex);
            for (c = a.network.vertexes.j; c.next();) c.value.component = -1;
            for (var d = b.Ye.o, e = d.length, g = 0; g < e; g++) {
                var h = d[g],
                    k = h.fromVertex,
                    l = h.toVertex,
                    h = a.linkMinLength(h);
                k.layer - l.layer > h && Ou(a, k, 0, -1, !0, !1)
            }
            for (Ou(a, b, 1, -1, !0, !0); 0 !== b.component;) {
                for (var k = 0, d = Infinity, l = 0, m = null, n = a.network.vertexes.j; n.next();) {
                    var p = n.value;
                    if (1 === p.component) {
                        for (var q = 0, r = !1, s = p.Ye.o, e = s.length, g = 0; g < e; g++) {
                            var h = s[g],
                                u = h.fromVertex,
                                q = q + 1;
                            1 !== u.component && (k += 1, u = u.layer - p.layer, h = a.linkMinLength(h), d = Math.min(d, u - h))
                        }
                        h = p.Re.o;
                        e = h.length;
                        for (g = 0; g < e; g++) s = h[g].toVertex, q -= 1, 1 !== s.component ? k -= 1 : r = !0;
                        (null === m || q < l) && !r && (m = p, l = q)
                    }
                }
                if (0 < k) {
                    for (c.reset(); c.next();) e = c.value, 1 === e.component && (e.layer += d);
                    b.component = 0
                } else m.component = 0
            }
            for (c = a.network.vertexes.j; c.next();) c.value.component = -1;
            for (Ou(a, b, 1, -1, !0, !1); 0 !== b.component;) {
                g = 0;
                e = Infinity;
                d = 0;
                h = null;
                for (k = a.network.vertexes.j; k.next();)
                    if (l = k.value, 1 === l.component) {
                        m =
                            0;
                        n = !1;
                        r = l.Ye.o;
                        p = r.length;
                        for (q = 0; q < p; q++) s = r[q].fromVertex, m += 1, 1 !== s.component ? g += 1 : n = !0;
                        r = l.Re.o;
                        p = r.length;
                        for (q = 0; q < p; q++) s = r[q], u = s.toVertex, m -= 1, 1 !== u.component && (g -= 1, u = l.layer - u.layer, s = a.linkMinLength(s), e = Math.min(e, u - s));
                        (null === h || m > d) && !n && (h = l, d = m)
                    }
                if (0 > g) {
                    for (c.reset(); c.next();) g = c.value, 1 === g.component && (g.layer -= e);
                    b.component = 0
                } else h.component = 0
            }
        }
    }

    function Eu(a, b, c) { return 90 === a.ga ? c && !b.rev || !c && b.rev ? 270 : 90 : 180 === a.ga ? c && !b.rev || !c && b.rev ? 0 : 180 : 270 === a.ga ? c && !b.rev || !c && b.rev ? 90 : 270 : c && !b.rev || !c && b.rev ? 180 : 0 }
    ru.prototype.initializeIndices = function() {
        switch (this.ip) {
            default:
                case Wu:
                for (var a = this.network.vertexes.j; a.next();) {
                var b = a.value,
                    c = b.layer;
                b.index = this.ve[c];
                this.ve[c]++
            }
            break;
            case uu:
                    a = this.network.vertexes.j;
                for (b = this.Ab; 0 <= b; b--)
                    for (a.reset(); a.next();) c = a.value, c.layer === b && -1 === c.index && Xu(this, c);
                break;
            case Yu:
                    for (a = this.network.vertexes.j, b = 0; b <= this.Ab; b++)
                    for (a.reset(); a.next();) c = a.value, c.layer === b && -1 === c.index && Zu(this, c)
        }
    };

    function Xu(a, b) {
        var c = b.layer;
        b.index = a.ve[c];
        a.ve[c]++;
        for (var c = b.Re.Fc(), d = !0; d;)
            for (var d = !1, e = 0; e < c.length - 1; e++) {
                var g = c[e],
                    h = c[e + 1];
                g.portFromColOffset > h.portFromColOffset && (d = !0, c[e] = h, c[e + 1] = g)
            }
        for (e = 0; e < c.length; e++) d = c[e], d.valid && (d = d.toVertex, -1 === d.index && Xu(a, d))
    }

    function Zu(a, b) {
        var c = b.layer;
        b.index = a.ve[c];
        a.ve[c]++;
        for (var c = b.Ye.Fc(), d = !0, e = 0; d;)
            for (d = !1, e = 0; e < c.length - 1; e++) {
                var g = c[e],
                    h = c[e + 1];
                g.portToColOffset > h.portToColOffset && (d = !0, c[e] = h, c[e + 1] = g)
            }
        for (e = 0; e < c.length; e++) d = c[e], d.valid && (d = d.fromVertex, -1 === d.index && Zu(a, d))
    }
    ru.prototype.reduceCrossings = function() {
        for (var a = this.countCrossings(), b = Iu(this), c = 0, d = 0, e = 0, c = 0; c < this.$m; c++) {
            for (d = 0; d <= this.Ab; d++) $u(this, d, 1), av(this, d, 1);
            e = this.countCrossings();
            e < a && (a = e, b = Iu(this));
            for (d = this.Ab; 0 <= d; d--) $u(this, d, -1), av(this, d, -1);
            e = this.countCrossings();
            e < a && (a = e, b = Iu(this))
        }
        Ju(this, b);
        for (c = 0; c < this.$m; c++) {
            for (d = 0; d <= this.Ab; d++) $u(this, d, 0), av(this, d, 0);
            e = this.countCrossings();
            e < a && (a = e, b = Iu(this));
            for (d = this.Ab; 0 <= d; d--) $u(this, d, 0), av(this, d, 0);
            e = this.countCrossings();
            e < a && (a = e, b = Iu(this))
        }
        Ju(this, b);
        var g = !1,
            h = c = 0,
            k = 0,
            d = 0;
        switch (this.Fo) {
            case bv:
                break;
            case cv:
                for (k = a + 1;
                    (d = this.countCrossings()) < k;)
                    for (k = d, c = this.Ab; 0 <= c; c--)
                        for (h = 0; h <= c; h++) {
                            for (g = !0; g;)
                                for (g = !1, d = c; d >= h; d--) g = av(this, d, -1) || g;
                            e = this.countCrossings();
                            e >= a ? Ju(this, b) : (a = e, b = Iu(this));
                            for (g = !0; g;)
                                for (g = !1, d = c; d >= h; d--) g = av(this, d, 1) || g;
                            e = this.countCrossings();
                            e >= a ? Ju(this, b) : (a = e, b = Iu(this));
                            for (g = !0; g;)
                                for (g = !1, d = h; d <= c; d++) g = av(this, d, 1) || g;
                            e >= a ? Ju(this, b) : (a = e, b = Iu(this));
                            for (g = !0; g;)
                                for (g = !1,
                                    d = h; d <= c; d++) g = av(this, d, -1) || g;
                            e >= a ? Ju(this, b) : (a = e, b = Iu(this));
                            for (g = !0; g;)
                                for (g = !1, d = c; d >= h; d--) g = av(this, d, 0) || g;
                            e >= a ? Ju(this, b) : (a = e, b = Iu(this));
                            for (g = !0; g;)
                                for (g = !1, d = h; d <= c; d++) g = av(this, d, 0) || g;
                            e >= a ? Ju(this, b) : (a = e, b = Iu(this))
                        }
                break;
            default:
            case vu:
                for (c = this.Ab, h = 0, k = a + 1;
                    (d = this.countCrossings()) < k;) {
                    k = d;
                    for (g = !0; g;)
                        for (g = !1, d = c; d >= h; d--) g = av(this, d, -1) || g;
                    e = this.countCrossings();
                    e >= a ? Ju(this, b) : (a = e, b = Iu(this));
                    for (g = !0; g;)
                        for (g = !1, d = c; d >= h; d--) g = av(this, d, 1) || g;
                    e = this.countCrossings();
                    e >= a ? Ju(this, b) : (a = e, b = Iu(this));
                    for (g = !0; g;)
                        for (g = !1, d = h; d <= c; d++) g = av(this, d, 1) || g;
                    e >= a ? Ju(this, b) : (a = e, b = Iu(this));
                    for (g = !0; g;)
                        for (g = !1, d = h; d <= c; d++) g = av(this, d, -1) || g;
                    e >= a ? Ju(this, b) : (a = e, b = Iu(this));
                    for (g = !0; g;)
                        for (g = !1, d = c; d >= h; d--) g = av(this, d, 0) || g;
                    e >= a ? Ju(this, b) : (a = e, b = Iu(this));
                    for (g = !0; g;)
                        for (g = !1, d = h; d <= c; d++) g = av(this, d, 0) || g;
                    e >= a ? Ju(this, b) : (a = e, b = Iu(this))
                }
        }
        Ju(this, b)
    };

    function $u(a, b, c) {
        v && (D.p(b, ru, "medianBarycenterCrossingReduction:unfixedLayer"), D.p(c, ru, "medianBarycenterCrossingReduction:direction"));
        var d = 0,
            e = Fu(a, b),
            g = a.ve[b],
            h = Nu(a, b, c);
        c = Mu(a, b, c);
        for (d = 0; d < g; d++) - 1 === c[d] && (c[d] = e[d].column), -1 === h[d] && (h[d] = e[d].column);
        for (var k = !0, l; k;)
            for (k = !1, d = 0; d < g - 1; d++)
                if (h[d + 1] < h[d] || h[d + 1] === h[d] && c[d + 1] < c[d]) k = !0, l = h[d], h[d] = h[d + 1], h[d + 1] = l, l = c[d], c[d] = c[d + 1], c[d + 1] = l, l = e[d], e[d] = e[d + 1], e[d + 1] = l;
        for (d = h = 0; d < g; d++) l = e[d], l.index = d, h += a.nodeMinColumnSpace(l, !0), l.column = h, h += 1, h += a.nodeMinColumnSpace(l, !1);
        Gu(a, b, e)
    }

    function av(a, b, c) {
        var d = Fu(a, b),
            e = a.ve[b];
        c = Ku(a, b, c);
        var g = 0,
            h;
        h = [];
        for (g = 0; g < e; g++) h[g] = -1;
        var k;
        k = [];
        for (g = 0; g < e; g++) k[g] = -1;
        for (var l = !1, m = !0; m;)
            for (m = !1, g = 0; g < e - 1; g++) {
                var n = c[d[g].index * e + d[g + 1].index],
                    p = c[d[g + 1].index * e + d[g].index],
                    q = 0,
                    r = 0,
                    s = d[g].column,
                    u = d[g + 1].column,
                    t = a.nodeMinColumnSpace(d[g], !0),
                    y = a.nodeMinColumnSpace(d[g], !1),
                    w = a.nodeMinColumnSpace(d[g + 1], !0),
                    A = a.nodeMinColumnSpace(d[g + 1], !1),
                    t = s - t + w,
                    y = u - y + A,
                    w = w = 0,
                    B = d[g].wc.j;
                for (B.reset(); B.next();)
                    if (w = B.value, A = w.fromVertex, w.valid &&
                        A.layer === b) {
                        for (w = 0; d[w] !== A;) w++;
                        w < g && (q += 2 * (g - w), r += 2 * (g + 1 - w));
                        w === g + 1 && (q += 1);
                        w > g + 1 && (q += 4 * (w - g), r += 4 * (w - (g + 1)))
                    }
                B = d[g].tc.j;
                for (B.reset(); B.next();)
                    if (w = B.value, A = w.toVertex, w.valid && A.layer === b) {
                        for (w = 0; d[w] !== A;) w++;
                        w === g + 1 && (r += 1)
                    }
                B = d[g + 1].wc.j;
                for (B.reset(); B.next();)
                    if (w = B.value, A = w.fromVertex, w.valid && A.layer === b) {
                        for (w = 0; d[w] !== A;) w++;
                        w < g && (q += 2 * (g + 1 - w), r += 2 * (g - w));
                        w === g && (r += 1);
                        w > g + 1 && (q += 4 * (w - (g + 1)), r += 4 * (w - g))
                    }
                B = d[g + 1].tc.j;
                for (B.reset(); B.next();)
                    if (w = B.value, A = w.toVertex, w.valid &&
                        A.layer === b) {
                        for (w = 0; d[w] !== A;) w++;
                        w === g && (q += 1)
                    }
                var w = A = 0,
                    B = h[d[g].index],
                    P = k[d[g].index],
                    H = h[d[g + 1].index],
                    R = k[d[g + 1].index]; - 1 !== B && (A += Math.abs(B - s), w += Math.abs(B - y)); - 1 !== P && (A += Math.abs(P - s), w += Math.abs(P - y)); - 1 !== H && (A += Math.abs(H - u), w += Math.abs(H - t)); - 1 !== R && (A += Math.abs(R - u), w += Math.abs(R - t));
                if (r < q - .5 || r === q && p < n - .5 || r === q && p === n && w < A - .5) m = l = !0, d[g].column = y, d[g + 1].column = t, n = d[g], d[g] = d[g + 1], d[g + 1] = n
            }
        for (g = 0; g < e; g++) d[g].index = g;
        Gu(a, b, d);
        return l
    }
    ru.prototype.straightenAndPack = function() {
        var a = 0,
            b = !1,
            c = 0 !== (this.qj & dv),
            a = this.qj === wu;
        1E3 < this.network.edges.count && !a && (c = !1);
        if (c) {
            b = [];
            for (a = a = 0; a <= this.Ab; a++) b[a] = 0;
            for (var d = 0, e = this.network.vertexes.j; e.next();) {
                var g = e.value,
                    a = g.layer,
                    d = g.column,
                    g = this.nodeMinColumnSpace(g, !1);
                b[a] = Math.max(b[a], d + g)
            }
            for (e.reset(); e.next();) g = e.value, a = g.layer, d = g.column, g.column = (8 * (this.Qb - b[a]) >> 1) + 8 * d;
            this.Qb *= 8
        }
        if (0 !== (this.qj & ev))
            for (b = !0; b;) {
                b = !1;
                for (a = this.Zf + 1; a <= this.Ab; a++) b = fv(this, a, 1) || b;
                for (a = this.Zf - 1; 0 <= a; a--) b = fv(this, a, -1) || b;
                b = fv(this, this.Zf, 0) || b
            }
        if (0 !== (this.qj & gv)) {
            for (a = this.Zf + 1; a <= this.Ab; a++) hv(this, a, 1);
            for (a = this.Zf - 1; 0 <= a; a--) hv(this, a, -1);
            hv(this, this.Zf, 0)
        }
        c && (iv(this, -1), iv(this, 1));
        if (0 !== (this.qj & ev))
            for (b = !0; b;) {
                b = !1;
                b = fv(this, this.Zf, 0) || b;
                for (a = this.Zf + 1; a <= this.Ab; a++) b = fv(this, a, 0) || b;
                for (a = this.Zf - 1; 0 <= a; a--) b = fv(this, a, 0) || b
            }
    };

    function fv(a, b, c) { v && (D.p(b, ru, "bendStraighten:unfixedLayer"), D.p(c, ru, "bendStraighten:direction")); for (var d = !1; jv(a, b, c);) d = !0; return d }

    function jv(a, b, c) {
        v && (D.p(b, ru, "shiftbendStraighten:unfixedLayer"), D.p(c, ru, "shiftbendStraighten:direction"));
        var d = 0,
            e = Fu(a, b),
            g = a.ve[b],
            h = Mu(a, b, -1);
        if (0 < c)
            for (d = 0; d < g; d++) h[d] = -1;
        var k = Mu(a, b, 1);
        if (0 > c)
            for (d = 0; d < g; d++) k[d] = -1;
        for (var l = !1, m = !0; m;)
            for (m = !1, d = 0; d < g; d++) {
                var n = e[d].column,
                    p = a.nodeMinColumnSpace(e[d], !0),
                    q = a.nodeMinColumnSpace(e[d], !1),
                    r = 0,
                    r = 0 > d - 1 || n - e[d - 1].column - 1 > p + a.nodeMinColumnSpace(e[d - 1], !1) ? n - 1 : n,
                    p = 0,
                    p = d + 1 >= g || e[d + 1].column - n - 1 > q + a.nodeMinColumnSpace(e[d + 1], !0) ? n + 1 : n,
                    s = q =
                    0,
                    u = 0,
                    t = 0,
                    y = 0,
                    w = 0;
                if (0 >= c)
                    for (var A = e[d].wc.j; A.next();) {
                        var w = A.value,
                            B = w.fromVertex;
                        w.valid && B.layer !== b && (t = Hu(w), y = w.portFromColOffset, w = w.portToColOffset, B = B.column, q += (Math.abs(n + w - (B + y)) + 1) * t, s += (Math.abs(r + w - (B + y)) + 1) * t, u += (Math.abs(p + w - (B + y)) + 1) * t)
                    }
                if (0 <= c)
                    for (A = e[d].tc.j; A.next();) w = A.value, B = w.toVertex, w.valid && B.layer !== b && (t = Hu(w), y = w.portFromColOffset, w = w.portToColOffset, B = B.column, q += (Math.abs(n + y - (B + w)) + 1) * t, s += (Math.abs(r + y - (B + w)) + 1) * t, u += (Math.abs(p + y - (B + w)) + 1) * t);
                w = y = t = 0;
                A = h[e[d].index];
                B = k[e[d].index]; - 1 !== A && (t += Math.abs(A - n), y += Math.abs(A - r), w += Math.abs(A - p)); - 1 !== B && (t += Math.abs(B - n), y += Math.abs(B - r), w += Math.abs(B - p));
                if (s < q || s === q && y < t) m = l = !0, e[d].column = r;
                else if (u < q || u === q && w < t) m = l = !0, e[d].column = p
            }
        Gu(a, b, e);
        a.normalize();
        return l
    }

    function hv(a, b, c) {
        v && (D.p(b, ru, "medianStraighten:unfixedLayer"), D.p(c, ru, "medianStraighten:direction"));
        var d = 0,
            e = Fu(a, b),
            g = a.ve[b],
            h = Nu(a, b, c);
        c = [];
        for (d = 0; d < g; d++) c[d] = h[d];
        for (h = !0; h;)
            for (h = !1, d = 0; d < g; d++) {
                var k = e[d].column,
                    l = a.nodeMinColumnSpace(e[d], !0),
                    m = a.nodeMinColumnSpace(e[d], !1),
                    n = 0,
                    p = 0,
                    q = 0,
                    q = p = 0; - 1 === c[d] ? 0 === d && d === g - 1 ? n = k : 0 === d ? (p = e[d + 1].column, n = p - k === m + a.nodeMinColumnSpace(e[d + 1], !0) ? k - 1 : k) : d === g - 1 ? (q = e[d - 1].column, n = k - q === l + a.nodeMinColumnSpace(e[d - 1], !1) ? k + 1 : k) : (q = e[d - 1].column,
                    q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, n = (q + p) / 2 | 0) : 0 === d && d === g - 1 ? n = c[d] : 0 === d ? (p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, n = Math.min(c[d], p)) : d === g - 1 ? (q = e[d - 1].column, q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, n = Math.max(c[d], q)) : (q = e[d - 1].column, q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, q < c[d] && c[d] < p ? n = c[d] : q >= c[d] ? n = q : p <= c[d] && (n = p));
                n !== k && (h = !0, e[d].column = n)
            }
        Gu(a, b, e);
        a.normalize()
    }

    function kv(a, b) {
        v && (D.p(b, ru, "packAux:column"), D.p(1, ru, "packAux:direction"));
        for (var c = !0, d = a.network.vertexes.j; d.next();) {
            var e = d.value,
                g = a.nodeMinColumnSpace(e, !0),
                h = a.nodeMinColumnSpace(e, !1);
            if (e.column - g <= b && e.column + h >= b) { c = !1; break }
        }
        e = !1;
        if (c)
            for (d.reset(); d.next();) c = d.value, c.column > b && (c.column -= 1, e = !0);
        return e
    }

    function lv(a, b) {
        v && (D.p(b, ru, "tightPackAux:column"), D.p(1, ru, "tightPackAux:direction"));
        for (var c = b, c = b + 1, d = 0, e = [], g = [], d = 0; d <= a.Ab; d++) e[d] = !1, g[d] = !1;
        for (var h = a.network.vertexes.j; h.next();) {
            var d = h.value,
                k = d.column - a.nodeMinColumnSpace(d, !0),
                l = d.column + a.nodeMinColumnSpace(d, !1);
            k <= b && l >= b && (e[d.layer] = !0);
            k <= c && l >= c && (g[d.layer] = !0)
        }
        k = !0;
        c = !1;
        for (d = 0; d <= a.Ab; d++) k = k && !(e[d] && g[d]);
        if (k)
            for (h.reset(); h.next();) e = h.value, e.column > b && (e.column -= 1, c = !0);
        return c
    }

    function iv(a, b) {
        v && D.p(b, ru, "componentPack:direction");
        for (var c = 0; c <= a.Qb; c++)
            for (; kv(a, c););
        a.normalize();
        for (c = 0; c < a.Qb; c++)
            for (; lv(a, c););
        a.normalize();
        var c = 0,
            d, e = 0,
            g = 0,
            h = 0;
        if (0 < b)
            for (c = 0; c <= a.Qb; c++)
                for (d = Iu(a), e = Lu(a), g = e + 1; e < g;) g = e, mv(a, c, 1), h = Lu(a), h > e ? Ju(a, d) : h < e && (e = h, d = Iu(a));
        if (0 > b)
            for (c = a.Qb; 0 <= c; c--)
                for (d = Iu(a), e = Lu(a), g = e + 1; e < g;) g = e, mv(a, c, -1), h = Lu(a), h > e ? Ju(a, d) : h < e && (e = h, d = Iu(a));
        a.normalize()
    }

    function mv(a, b, c) {
        a.Lg = 0;
        for (var d = a.network.vertexes.j; d.next();) d.value.component = -1;
        if (0 < c)
            for (d.reset(); d.next();) {
                var e = d.value;
                e.column - a.nodeMinColumnSpace(e, !0) <= b && (e.component = a.Lg)
            }
        if (0 > c)
            for (d.reset(); d.next();) e = d.value, e.column + a.nodeMinColumnSpace(e, !1) >= b && (e.component = a.Lg);
        a.Lg++;
        for (d.reset(); d.next();) b = d.value, -1 === b.component && (Pu(a, b, a.Lg, -1, !0, !0), a.Lg++);
        var g = 0;
        b = [];
        for (g = 0; g < a.Lg * a.Lg; g++) b[g] = !1;
        e = [];
        for (g = 0; g < (a.Ab + 1) * (a.Qb + 1); g++) e[g] = -1;
        for (d.reset(); d.next();)
            for (var g =
                    d.value, h = g.layer, k = Math.max(0, g.column - a.nodeMinColumnSpace(g, !0)), l = Math.min(a.Qb, g.column + a.nodeMinColumnSpace(g, !1)); k <= l; k++) e[h * (a.Qb + 1) + k] = g.component;
        for (g = 0; g <= a.Ab; g++) {
            if (0 < c)
                for (k = 0; k < a.Qb; k++) - 1 !== e[g * (a.Qb + 1) + k] && -1 !== e[g * (a.Qb + 1) + k + 1] && e[g * (a.Qb + 1) + k] !== e[g * (a.Qb + 1) + k + 1] && (b[e[g * (a.Qb + 1) + k] * a.Lg + e[g * (a.Qb + 1) + k + 1]] = !0);
            if (0 > c)
                for (k = a.Qb; 0 < k; k--) - 1 !== e[g * (a.Qb + 1) + k] && -1 !== e[g * (a.Qb + 1) + k - 1] && e[g * (a.Qb + 1) + k] !== e[g * (a.Qb + 1) + k - 1] && (b[e[g * (a.Qb + 1) + k] * a.Lg + e[g * (a.Qb + 1) + k - 1]] = !0)
        }
        e = [];
        for (g =
            0; g < a.Lg; g++) e[g] = !0;
        h = new K("number");
        h.add(0);
        for (l = 0; 0 !== h.count;)
            if (l = h.o[h.count - 1], h.pd(h.count - 1), e[l])
                for (e[l] = !1, g = 0; g < a.Lg; g++) b[l * a.Lg + g] && h.be(0, g);
        if (0 < c)
            for (d.reset(); d.next();) a = d.value, e[a.component] && (a.column -= 1);
        if (0 > c)
            for (d.reset(); d.next();) c = d.value, e[c.component] && (c.column += 1)
    }
    ru.prototype.commitLayout = function() {
        if (this.Xq)
            for (var a = Du(this, !0), b = Du(this, !1), c = this.network.edges.j; c.next();) {
                var d = c.value.link;
                null !== d && (d.Gb = a, d.Hb = b)
            }
        this.commitNodes();
        this.JA();
        this.Pu && this.commitLinks()
    };

    function Du(a, b) { return 270 === a.ga ? b ? $c : gd : 90 === a.ga ? b ? gd : $c : 180 === a.ga ? b ? ed : fd : b ? fd : ed }
    ru.prototype.commitNodes = function() {
        this.Jg = [];
        this.Yf = [];
        this.Xf = [];
        this.Vb = [];
        for (var a = 0; a <= this.Ab; a++) this.Jg[a] = 0, this.Yf[a] = 0, this.Xf[a] = 0, this.Vb[a] = 0;
        for (a = this.network.vertexes.j; a.next();) {
            var b = a.value,
                c = b.layer;
            this.Jg[c] = Math.max(this.Jg[c], this.nodeMinLayerSpace(b, !0));
            this.Yf[c] = Math.max(this.Yf[c], this.nodeMinLayerSpace(b, !1))
        }
        for (var b = 0, d = this.an, c = 0; c <= this.Ab; c++) {
            var e = d;
            0 >= this.Jg[c] + this.Yf[c] && (e = 0);
            0 < c && (b += e / 2);
            90 === this.ga || 0 === this.ga ? (b += this.Yf[c], this.Xf[c] = b, b += this.Jg[c]) :
                (b += this.Jg[c], this.Xf[c] = b, b += this.Yf[c]);
            c < this.Ab && (b += e / 2);
            this.Vb[c] = b
        }
        d = b;
        b = this.Zd;
        for (c = 0; c <= this.Ab; c++) 270 === this.ga ? this.Xf[c] = b.y + this.Xf[c] : 90 === this.ga ? (this.Xf[c] = b.y + d - this.Xf[c], this.Vb[c] = d - this.Vb[c]) : 180 === this.ga ? this.Xf[c] = b.x + this.Xf[c] : (this.Xf[c] = b.x + d - this.Xf[c], this.Vb[c] = d - this.Vb[c]);
        a.reset();
        for (d = e = Infinity; a.next();) {
            var c = a.value,
                g = c.layer,
                h = c.column | 0,
                k = 0,
                l = 0;
            270 === this.ga || 90 === this.ga ? (k = b.x + this.ie * h, l = this.Xf[g]) : (k = this.Xf[g], l = b.y + this.ie * h);
            c.pa = k;
            c.va = l;
            e = Math.min(c.x, e);
            d = Math.min(c.y, d)
        }
        e = b.x - e;
        b = b.y - d;
        this.KC = new N(e, b);
        for (a.reset(); a.next();) c = a.value, c.x += e, c.y += b, c.commit()
    };
    ru.prototype.JA = function() {
        for (var a = 0, b = this.an, c = 0; c <= this.Ab; c++) a += this.Jg[c], a += this.Yf[c];
        for (var a = a + this.Ab * b, b = [], c = this.ie * this.Qb, d = this.HJ; 0 <= d; d--) 270 === this.ga ? 0 === d ? b.push(new C(0, 0, c, Math.abs(this.Vb[0]))) : b.push(new C(0, this.Vb[d - 1], c, Math.abs(this.Vb[d - 1] - this.Vb[d]))) : 90 === this.ga ? 0 === d ? b.push(new C(0, this.Vb[0], c, Math.abs(this.Vb[0] - a))) : b.push(new C(0, this.Vb[d], c, Math.abs(this.Vb[d - 1] - this.Vb[d]))) : 180 === this.ga ? 0 === d ? b.push(new C(0, 0, Math.abs(this.Vb[0]), c)) : b.push(new C(this.Vb[d -
            1], 0, Math.abs(this.Vb[d - 1] - this.Vb[d]), c)) : 0 === d ? b.push(new C(this.Vb[0], 0, Math.abs(this.Vb[0] - a), c)) : b.push(new C(this.Vb[d], 0, Math.abs(this.Vb[d - 1] - this.Vb[d]), c));
        this.commitLayers(b, this.KC)
    };
    ru.prototype.commitLayers = function() {};
    ru.prototype.commitLinks = function() {
        for (var a = this.network.edges.j, b; a.next();) b = a.value.link, null !== b && (b.Dm(), b.dq(), b.Ej());
        for (a.reset(); a.next();) b = a.value.link, null !== b && b.zo();
        for (a.reset(); a.next();) {
            var c = a.value;
            b = c.link;
            if (null !== b) {
                b.Dm();
                var d = b,
                    e = d.$,
                    g = d.ba,
                    h = d.oc,
                    k = d.Gc;
                if (null !== e) {
                    var l = e.findVisibleNode();
                    null !== l && l !== e && (e = l, h = l.port)
                }
                if (null !== g) {
                    var m = g.findVisibleNode();
                    null !== m && m !== g && (g = m, k = m.port)
                }
                var n = b.computeSpot(!0, h),
                    p = b.computeSpot(!1, k),
                    q = c.fromVertex,
                    r = c.toVertex;
                if (c.valid) {
                    if (b.jf === Uj && 4 === b.ta) {
                        if (c.rev) var s = e,
                            e = g,
                            g = s,
                            u = h,
                            h = k,
                            k = u;
                        if (q.column === r.column) {
                            var t = b.getLinkPoint(e, h, n, !0, !1, g, k),
                                y = b.getLinkPoint(g, k, p, !1, !1, e, h);
                            t.H() || t.set(e.aa.jm);
                            y.H() || y.set(g.aa.jm);
                            b.dq();
                            b.Bj(t.x, t.y);
                            b.Bj((2 * t.x + y.x) / 3, (2 * t.y + y.y) / 3);
                            b.Bj((t.x + 2 * y.x) / 3, (t.y + 2 * y.y) / 3);
                            b.Bj(y.x, y.y)
                        } else {
                            var w = !1,
                                A = !1;
                            null !== h && n === dc && (w = !0);
                            null !== k && p === dc && (A = !0);
                            if (w || A) {
                                var B = b.m(0).x,
                                    P = b.m(0).y,
                                    H = b.m(1).x,
                                    R = b.m(1).y,
                                    aa = b.m(2).x,
                                    V = b.m(2).y,
                                    ea = b.m(3).x,
                                    la = b.m(3).y;
                                if (w) {
                                    90 === this.ga ||
                                        270 === this.ga ? (H = B, R = (P + la) / 2) : (H = (B + ea) / 2, R = P);
                                    b.ia(1, H, R);
                                    var Da = b.getLinkPoint(e, h, n, !0, !1, g, k);
                                    Da.H() || Da.set(e.aa.jm);
                                    b.ia(0, Da.x, Da.y)
                                }
                                A && (90 === this.ga || 270 === this.ga ? (aa = ea, V = (P + la) / 2) : (aa = (B + ea) / 2, V = la), b.ia(2, aa, V), Da = b.getLinkPoint(g, k, p, !1, !1, e, h), Da.H() || Da.set(g.aa.jm), b.ia(3, Da.x, Da.y))
                            }
                        }
                    }
                    b.Ej()
                } else if (q.layer === r.layer) b.Ej();
                else {
                    var La = !1,
                        gb = !1,
                        Aa = 0,
                        W = b.tu + 1;
                    if (b.ic) gb = !0, Aa = b.ta, 4 < Aa && b.points.removeRange(2, Aa - 3);
                    else if (b.jf === Uj) La = !0, Aa = b.ta, 4 < Aa && b.points.removeRange(2, Aa - 3),
                        W = 2;
                    else {
                        var Aa = b.ta,
                            xb = n === dc,
                            Pb = p === dc;
                        2 < Aa && xb && Pb ? b.points.removeRange(1, Aa - 2) : 3 < Aa && xb && !Pb ? b.points.removeRange(1, Aa - 3) : 3 < Aa && !xb && Pb ? b.points.removeRange(2, Aa - 2) : 4 < Aa && !xb && !Pb && b.points.removeRange(2, Aa - 3)
                    }
                    var Sa, Qc;
                    if (c.rev) {
                        for (var Ra = 0; null !== r && q !== r;) {
                            Qc = Sa = null;
                            for (var jg = r.wc.j; jg.next();) { var kg = jg.value; if (kg.link === c.link && (Sa = kg.fromVertex, Qc = kg.toVertex, null === Sa.Gd)) break }
                            if (Sa !== q)
                                if (hb = b.m(W - 1).x, ub = b.m(W - 1).y, sa = Sa.pa, na = Sa.va, gb) 180 === this.ga || 0 === this.ga ? 2 === W ? (b.B(W++, hb,
                                    ub), b.B(W++, hb, na)) : (Md = null !== Qc ? Qc.va : ub, Md !== na && (ab = this.Vb[Sa.layer - 1], b.B(W++, ab, ub), b.B(W++, ab, na))) : 2 === W ? (b.B(W++, hb, ub), b.B(W++, sa, ub)) : (Jf = null !== Qc ? Qc.pa : hb, Jf !== sa && (ab = this.Vb[Sa.layer - 1], b.B(W++, hb, ab), b.B(W++, sa, ab)));
                                else if (2 === W)
                                if (Oa = Math.max(10, this.Jg[r.layer]), pb = Math.max(10, this.Yf[r.layer]), La) 180 === this.ga ? sa <= r.Q.x ? (Ra = r.Q.x, b.B(W++, Ra - Oa, na), b.B(W++, Ra, na), b.B(W++, Ra + pb, na)) : (b.B(W++, sa - Oa, na), b.B(W++, sa, na), b.B(W++, sa + pb, na)) : 90 === this.ga ? na >= r.Q.bottom ? (Ra = r.Q.y + r.Q.height,
                                    b.B(W++, sa, Ra + pb), b.B(W++, sa, Ra), b.B(W++, sa, Ra - Oa)) : (b.B(W++, sa, na + pb), b.B(W++, sa, na), b.B(W++, sa, na - Oa)) : 270 === this.ga ? na <= r.Q.y ? (Ra = r.Q.y, b.B(W++, sa, Ra - Oa), b.B(W++, sa, Ra), b.B(W++, sa, Ra + pb)) : (b.B(W++, sa, na - Oa), b.B(W++, sa, na), b.B(W++, sa, na + pb)) : 0 === this.ga && (sa >= r.Q.right ? (Ra = r.Q.x + r.Q.width, b.B(W++, Ra + pb, na), b.B(W++, Ra, na), b.B(W++, Ra - Oa, na)) : (b.B(W++, sa + pb, na), b.B(W++, sa, na), b.B(W++, sa - Oa, na)));
                                else {
                                    b.B(W++, hb, ub);
                                    var vd = 0;
                                    if (180 === this.ga || 0 === this.ga) {
                                        if (180 === this.ga ? sa >= r.Q.right : sa <= r.Q.x) vd =
                                            (0 === this.ga ? -Oa : pb) / 2;
                                        b.B(W++, hb + vd, na)
                                    } else {
                                        if (270 === this.ga ? na >= r.Q.bottom : na <= r.Q.y) vd = (90 === this.ga ? -Oa : pb) / 2;
                                        b.B(W++, sa, ub + vd)
                                    }
                                    b.B(W++, sa, na)
                                }
                            else Oa = Math.max(10, this.Jg[Sa.layer]), pb = Math.max(10, this.Yf[Sa.layer]), 180 === this.ga ? (La && b.B(W++, sa - Oa, na), b.B(W++, sa, na), La && b.B(W++, sa + pb, na)) : 90 === this.ga ? (La && b.B(W++, sa, na + pb), b.B(W++, sa, na), La && b.B(W++, sa, na - Oa)) : 270 === this.ga ? (La && b.B(W++, sa, na - Oa), b.B(W++, sa, na), La && b.B(W++, sa, na + pb)) : (La && b.B(W++, sa + pb, na), b.B(W++, sa, na), La && b.B(W++, sa - Oa,
                                na));
                            r = Sa
                        }
                        if (null === k || n !== dc || gb)
                            if (hb = b.m(W - 1).x, ub = b.m(W - 1).y, sa = b.m(W).x, na = b.m(W).y, gb) {
                                var wd = this.Yf[q.layer],
                                    Rc = 0;
                                180 === this.ga || 0 === this.ga ? (Rc = ub, Rc >= q.Q.y && Rc <= q.Q.bottom && (180 === this.ga ? sa >= q.Q.x : sa <= q.Q.right) && (Ra = q.pa + (180 === this.ga ? -wd : wd), Rc = Rc < q.Q.y + q.Q.height / 2 ? q.Q.y - this.ie / 2 : q.Q.bottom + this.ie / 2, b.B(W++, Ra, ub), b.B(W++, Ra, Rc)), b.B(W++, sa, Rc)) : (Rc = hb, Rc >= q.Q.x && Rc <= q.Q.right && (270 === this.ga ? na >= q.Q.y : na <= q.Q.bottom) && (Ra = q.va + (270 === this.ga ? -wd : wd), Rc = Rc < q.Q.x + q.Q.width / 2 ? q.Q.x -
                                    this.ie / 2 : q.Q.right + this.ie / 2, b.B(W++, hb, Ra), b.B(W++, Rc, Ra)), b.B(W++, Rc, na));
                                b.B(W++, sa, na)
                            } else if (La) Oa = Math.max(10, this.Jg[q.layer]), pb = Math.max(10, this.Yf[q.layer]), 180 === this.ga && sa >= q.Q.x ? (Ra = q.Q.x + q.Q.width, b.ia(W - 2, Ra, ub), b.ia(W - 1, Ra + pb, ub)) : 90 === this.ga && na <= q.Q.bottom ? (Ra = q.Q.y, b.ia(W - 2, hb, Ra), b.ia(W - 1, hb, Ra - Oa)) : 270 === this.ga && na >= q.Q.y ? (Ra = q.Q.y + q.Q.height, b.ia(W - 2, hb, Ra), b.ia(W - 1, hb, Ra + pb)) : 0 === this.ga && sa <= q.Q.right && (Ra = q.Q.x, b.ia(W - 2, Ra, ub), b.ia(W - 1, Ra - Oa, ub));
                        else {
                            Oa = Math.max(10,
                                this.Jg[q.layer]);
                            pb = Math.max(10, this.Yf[q.layer]);
                            vd = 0;
                            if (180 === this.ga || 0 === this.ga) {
                                if (180 === this.ga ? sa <= q.Q.x : sa >= q.Q.right) vd = (0 === this.ga ? pb : -Oa) / 2;
                                b.B(W++, sa + vd, ub)
                            } else {
                                if (270 === this.ga ? na <= q.Q.y : na >= q.Q.bottom) vd = (90 === this.ga ? pb : -Oa) / 2;
                                b.B(W++, hb, na + vd)
                            }
                            b.B(W++, sa, na)
                        }
                    } else {
                        for (; null !== q && q !== r;) {
                            Qc = Sa = null;
                            for (var uh = q.tc.j; uh.next();) { var $e = uh.value; if ($e.link === c.link && (Sa = $e.toVertex, Qc = $e.fromVertex, null !== Qc.Gd && (Qc = null), null === Sa.Gd)) break }
                            var hb = 0,
                                ub = 0,
                                sa = 0,
                                na = 0,
                                ab = 0,
                                Oa = 0,
                                pb = 0;
                            if (Sa !== r)
                                if (hb = b.m(W - 1).x, ub = b.m(W - 1).y, sa = Sa.pa, na = Sa.va, gb)
                                    if (180 === this.ga || 0 === this.ga) {
                                        var Md = null !== Qc ? Qc.va : ub;
                                        Md !== na && (ab = this.Vb[Sa.layer], 2 === W && (ab = 0 === this.ga ? Math.max(ab, hb) : Math.min(ab, hb)), b.B(W++, ab, ub), b.B(W++, ab, na))
                                    } else {
                                        var Jf = null !== Qc ? Qc.pa : hb;
                                        Jf !== sa && (ab = this.Vb[Sa.layer], 2 === W && (ab = 90 === this.ga ? Math.max(ab, ub) : Math.min(ab, ub)), b.B(W++, hb, ab), b.B(W++, sa, ab))
                                    }
                            else Oa = Math.max(10, this.Jg[Sa.layer]), pb = Math.max(10, this.Yf[Sa.layer]), 180 === this.ga ? (b.B(W++, sa + pb, na), La && b.B(W++,
                                sa, na), b.B(W++, sa - Oa, na)) : 90 === this.ga ? (b.B(W++, sa, na - Oa), La && b.B(W++, sa, na), b.B(W++, sa, na + pb)) : 270 === this.ga ? (b.B(W++, sa, na + pb), La && b.B(W++, sa, na), b.B(W++, sa, na - Oa)) : (b.B(W++, sa - Oa, na), La && b.B(W++, sa, na), b.B(W++, sa + pb, na));
                            q = Sa
                        }
                        gb && (hb = b.m(W - 1).x, ub = b.m(W - 1).y, sa = b.m(W).x, na = b.m(W).y, 180 === this.ga || 0 === this.ga ? ub !== na && (ab = 0 === this.ga ? Math.min(Math.max((sa + hb) / 2, this.Vb[r.layer]), sa) : Math.max(Math.min((sa + hb) / 2, this.Vb[r.layer]), sa), b.B(W++, ab, ub), b.B(W++, ab, na)) : hb !== sa && (ab = 90 === this.ga ? Math.min(Math.max((na +
                            ub) / 2, this.Vb[r.layer]), na) : Math.max(Math.min((na + ub) / 2, this.Vb[r.layer]), na), b.B(W++, hb, ab), b.B(W++, sa, ab)))
                    }
                    if (null !== d && La) {
                        if (null !== h) {
                            if (n === dc) {
                                var se = b.m(0),
                                    be = b.m(2);
                                se.O(be) || b.ia(1, (se.x + be.x) / 2, (se.y + be.y) / 2)
                            }
                            Da = b.getLinkPoint(e, h, dc, !0, !1, g, k);
                            Da.H() || Da.set(e.aa.jm);
                            b.ia(0, Da.x, Da.y)
                        }
                        null !== k && (p === dc && (se = b.m(b.ta - 1), be = b.m(b.ta - 3), se.O(be) || b.ia(b.ta - 2, (se.x + be.x) / 2, (se.y + be.y) / 2)), Da = b.getLinkPoint(g, k, dc, !1, !1, e, h), Da.H() || Da.set(g.aa.jm), b.ia(b.ta - 1, Da.x, Da.y))
                    }
                    b.Ej();
                    c.commit()
                }
            }
        }
        for (var jd =
                new K(J), vh = this.network.edges.j; vh.next();) {
            var Kf = vh.value.link;
            null !== Kf && Kf.ic && !jd.contains(Kf) && jd.add(Kf)
        }
        if (0 < jd.count)
            if (90 === this.ga || 270 === this.ga) {
                for (var Ig = 0, Hb = new K(nv), oc, xd, wh = jd.j; wh.next();) {
                    var qb = wh.value;
                    if (null !== qb && qb.ic)
                        for (var Pa = 2; Pa < qb.ta - 3; Pa++)
                            if (oc = qb.m(Pa), xd = qb.m(Pa + 1), ov(oc.y, xd.y) && !ov(oc.x, xd.x)) {
                                var Qb = new nv;
                                Qb.layer = Math.floor(oc.y / 2);
                                var Lf = qb.m(0),
                                    Jg = qb.m(qb.ta - 1);
                                Qb.first = Lf.x * Lf.x + Lf.y;
                                Qb.re = Jg.x * Jg.x + Jg.y;
                                Qb.gf = Math.min(oc.x, xd.x);
                                Qb.Fe = Math.max(oc.x,
                                    xd.x);
                                Qb.index = Pa;
                                Qb.link = qb;
                                if (Pa + 2 < qb.ta) {
                                    var xh = qb.m(Pa - 1),
                                        ib = qb.m(Pa + 2),
                                        zc = 0;
                                    xh.y < oc.y ? zc = ib.y < oc.y ? 3 : oc.x < xd.x ? 2 : 1 : xh.y > oc.y && (zc = ib.y > oc.y ? 0 : xd.x < oc.x ? 2 : 1);
                                    Qb.Li = zc
                                }
                                Hb.add(Qb)
                            }
                }
                if (1 < Hb.count) {
                    Hb.sort(this.YG);
                    for (var $b = 0; $b < Hb.count;) {
                        for (var te = Hb.o[$b].layer, Ac = $b + 1; Ac < Hb.count && Hb.o[Ac].layer === te;) Ac++;
                        if (1 < Ac - $b)
                            for (var Bc = $b; Bc < Ac;) {
                                for (var vb = Hb.o[Bc].Fe, pc = $b + 1; pc < Ac && Hb.o[pc].gf < vb;) vb = Math.max(vb, Hb.o[pc].Fe), pc++;
                                var yb = pc - Bc;
                                if (1 < yb) {
                                    Hb.Zq(this.Oy, Bc, Bc + yb);
                                    for (var Fc = 1, db = Hb.o[Bc].re,
                                            Pa = Bc; Pa < pc; Pa++) {
                                        var Ta = Hb.o[Pa];
                                        Ta.re !== db && (Fc++, db = Ta.re)
                                    }
                                    Hb.Zq(this.XG, Bc, Bc + yb);
                                    for (var Mb = 1, db = Hb.o[Bc].first, Pa = Bc; Pa < pc; Pa++) Ta = Hb.o[Pa], Ta.first !== db && (Mb++, db = Ta.first);
                                    var yd = !0,
                                        lg = Mb;
                                    Fc < Mb ? (yd = !1, lg = Fc, db = Hb.o[Bc].re, Hb.Zq(this.Oy, Bc, Bc + yb)) : db = Hb.o[Bc].first;
                                    for (var af = 0, Pa = Bc; Pa < pc; Pa++) {
                                        Ta = Hb.o[Pa];
                                        (yd ? Ta.first : Ta.re) !== db && (af++, db = yd ? Ta.first : Ta.re);
                                        qb = Ta.link;
                                        oc = qb.m(Ta.index);
                                        xd = qb.m(Ta.index + 1);
                                        var bf = this.tG * (af - (lg - 1) / 2);
                                        if (!qb.Nj || pv(oc.x, oc.y + bf, xd.x, xd.y + bf)) Ig++, qb.Dm(),
                                            qb.ia(Ta.index, oc.x, oc.y + bf), qb.ia(Ta.index + 1, xd.x, xd.y + bf), qb.Ej()
                                    }
                                }
                                Bc = pc
                            }
                        $b = Ac
                    }
                }
            } else {
                for (var wj = 0, Rb = new K(nv), qc, fc, kd = jd.j; kd.next();) {
                    var mb = kd.value;
                    if (null !== mb && mb.ic)
                        for (var Sb = 2; Sb < mb.ta - 3; Sb++)
                            if (qc = mb.m(Sb), fc = mb.m(Sb + 1), ov(qc.x, fc.x) && !ov(qc.y, fc.y)) {
                                var ue = new nv;
                                ue.layer = Math.floor(qc.x / 2);
                                var zb = mb.m(0),
                                    ce = mb.m(mb.ta - 1);
                                ue.first = zb.x + zb.y * zb.y;
                                ue.re = ce.x + ce.y * ce.y;
                                ue.gf = Math.min(qc.y, fc.y);
                                ue.Fe = Math.max(qc.y, fc.y);
                                ue.index = Sb;
                                ue.link = mb;
                                if (Sb + 2 < mb.ta) {
                                    var yh = mb.m(Sb - 1),
                                        zh = mb.m(Sb +
                                            2),
                                        Kg = 0;
                                    yh.x < qc.x ? Kg = zh.x < qc.x ? 3 : qc.y < fc.y ? 2 : 1 : yh.x > qc.x && (Kg = zh.x > qc.x ? 0 : fc.y < qc.y ? 2 : 1);
                                    ue.Li = Kg
                                }
                                Rb.add(ue)
                            }
                }
                if (1 < Rb.count) {
                    Rb.sort(this.YG);
                    for (var ld = 0; ld < Rb.count;) {
                        for (var Nd = Rb.o[ld].layer, gc = ld + 1; gc < Rb.count && Rb.o[gc].layer === Nd;) gc++;
                        if (1 < gc - ld)
                            for (var Ab = ld; Ab < gc;) {
                                for (var zd = Rb.o[Ab].Fe, nb = ld + 1; nb < gc && Rb.o[nb].gf < zd;) zd = Math.max(zd, Rb.o[nb].Fe), nb++;
                                var hc = nb - Ab;
                                if (1 < hc) {
                                    Rb.Zq(this.Oy, Ab, Ab + hc);
                                    for (var ii = 1, ad = Rb.o[Ab].re, Sb = Ab; Sb < nb; Sb++) {
                                        var Ib = Rb.o[Sb];
                                        Ib.re !== ad && (ii++, ad = Ib.re)
                                    }
                                    Rb.Zq(this.XG,
                                        Ab, Ab + hc);
                                    for (var ve = 1, ad = Rb.o[Ab].first, Sb = Ab; Sb < nb; Sb++) Ib = Rb.o[Sb], Ib.first !== ad && (ve++, ad = Ib.first);
                                    var cf = !0,
                                        bd = ve;
                                    ii < ve ? (cf = !1, bd = ii, ad = Rb.o[Ab].re, Rb.Zq(this.Oy, Ab, Ab + hc)) : ad = Rb.o[Ab].first;
                                    for (var Mf = 0, Sb = Ab; Sb < nb; Sb++) {
                                        Ib = Rb.o[Sb];
                                        (cf ? Ib.first : Ib.re) !== ad && (Mf++, ad = cf ? Ib.first : Ib.re);
                                        mb = Ib.link;
                                        qc = mb.m(Ib.index);
                                        fc = mb.m(Ib.index + 1);
                                        var Nf = this.tG * (Mf - (bd - 1) / 2);
                                        if (!mb.Nj || pv(qc.x + Nf, qc.y, fc.x + Nf, fc.y)) wj++, mb.Dm(), mb.ia(Ib.index, qc.x + Nf, qc.y), mb.ia(Ib.index + 1, fc.x + Nf, fc.y), mb.Ej()
                                    }
                                }
                                Ab = nb
                            }
                        ld =
                            gc
                    }
                }
            }
    };
    ru.prototype.YG = function(a, b) { return a instanceof nv && b instanceof nv && a !== b ? a.layer < b.layer ? -1 : a.layer > b.layer ? 1 : a.gf < b.gf ? -1 : a.gf > b.gf ? 1 : a.Fe < b.Fe ? -1 : a.Fe > b.Fe ? 1 : 0 : 0 };
    ru.prototype.XG = function(a, b) { return a instanceof nv && b instanceof nv && a !== b ? a.first < b.first ? -1 : a.first > b.first || a.Li < b.Li ? 1 : a.Li > b.Li || a.gf < b.gf ? -1 : a.gf > b.gf ? 1 : a.Fe < b.Fe ? -1 : a.Fe > b.Fe ? 1 : 0 : 0 };
    ru.prototype.Oy = function(a, b) { return a instanceof nv && b instanceof nv && a !== b ? a.re < b.re ? -1 : a.re > b.re || a.Li < b.Li ? 1 : a.Li > b.Li || a.gf < b.gf ? -1 : a.gf > b.gf ? 1 : a.Fe < b.Fe ? -1 : a.Fe > b.Fe ? 1 : 0 : 0 };

    function ov(a, b) { v && (D.p(a, ru, "isApprox:a"), D.p(b, ru, "isApprox:b")); var c = a - b; return -1 < c && 1 > c }

    function pv(a, b, c, d) { v && (D.p(a, ru, "isUnoccupied2:px"), D.p(b, ru, "isUnoccupied2:py"), D.p(c, ru, "isUnoccupied2:qx"), D.p(d, ru, "isUnoccupied2:qy")); return !0 }

    function Fu(a, b) {
        var c, d = a.ve[b];
        if (d >= a.yh.length) {
            c = [];
            for (var e = 0; e < a.yh.length; e++) c[e] = a.yh[e];
            a.yh = c
        }
        void 0 === a.yh[d] || null === a.yh[d] ? c = [] : (c = a.yh[d], a.yh[d] = null);
        d = a.Ws[b];
        for (e = 0; e < d.length; e++) {
            var g = d[e];
            c[g.index] = g
        }
        return c
    }

    function Gu(a, b, c) { a.yh[a.ve[b]] = c }
    D.defineProperty(ru, { layerSpacing: "layerSpacing" }, function() { return this.an }, function(a) { this.an !== a && (D.h(a, "number", ru, "layerSpacing"), 0 <= a && (this.an = a, this.L())) });
    D.defineProperty(ru, { sL: "columnSpacing" }, function() { return this.ie }, function(a) { this.ie !== a && (D.h(a, "number", ru, "columnSpacing"), 0 < a && (this.ie = a, this.L())) });
    D.defineProperty(ru, { direction: "direction" }, function() { return this.ga }, function(a) { this.ga !== a && (D.h(a, "number", ru, "direction"), 0 === a || 90 === a || 180 === a || 270 === a ? (this.ga = a, this.L()) : D.k("LayeredDigraphLayout.direction must be 0, 90, 180, or 270")) });
    D.defineProperty(ru, { angle: "angle" }, function() { return this.direction }, function(a) { this.direction = a });
    D.defineProperty(ru, { uI: "cycleRemoveOption" }, function() { return this.Ro }, function(a) { this.Ro !== a && (D.Da(a, ru, ru, "cycleRemoveOption"), a === yu || a === su) && (this.Ro = a, this.L()) });
    D.defineProperty(ru, { zJ: "layeringOption" }, function() { return this.sp }, function(a) { this.sp !== a && (D.Da(a, ru, ru, "layeringOption"), a === tu || a === Qu || a === Su) && (this.sp = a, this.L()) });
    D.defineProperty(ru, { lJ: "initializeOption" }, function() { return this.ip }, function(a) { this.ip !== a && (D.Da(a, ru, ru, "initializeOption"), a === uu || a === Yu || a === Wu) && (this.ip = a, this.L()) });
    D.defineProperty(ru, { $L: "iterations" }, function() { return this.$m }, function(a) { this.$m !== a && (D.p(a, xu, "iterations"), 0 <= a && (this.$m = a, this.L())) });
    D.defineProperty(ru, { aI: "aggressiveOption" }, function() { return this.Fo }, function(a) { this.Fo !== a && (D.Da(a, ru, ru, "aggressiveOption"), a === bv || a === vu || a === cv) && (this.Fo = a, this.L()) });
    D.defineProperty(ru, { tM: "packOption" }, function() { return this.qj }, function(a) { this.qj !== a && (D.h(a, "number", ru, "packOption"), 0 <= a && 8 > a && (this.qj = a, this.L())) });
    D.defineProperty(ru, { Xq: "setsPortSpots" }, function() { return this.si }, function(a) { this.si !== a && (D.h(a, "boolean", ru, "setsPortSpots"), this.si = a, this.L()) });
    D.defineProperty(ru, { tG: "linkSpacing" }, function() { return this.Ds }, function(a) { this.Ds !== a && (D.h(a, "number", ru, "linkSpacing"), 0 <= a && (this.Ds = a, this.L())) });
    D.w(ru, { HJ: "maxLayer" }, function() { return this.Ab });
    D.w(ru, { eM: "maxIndex" }, function() { return this.Bw });
    D.w(ru, { dM: "maxColumn" }, function() { return this.Qb });
    D.w(ru, { jM: "minIndexLayer" }, function() { return this.Ms });
    D.w(ru, { fM: "maxIndexLayer" }, function() { return this.Zf });
    var su;
    ru.CycleDepthFirst = su = D.s(ru, "CycleDepthFirst", 0);
    var yu;
    ru.CycleGreedy = yu = D.s(ru, "CycleGreedy", 1);
    var tu;
    ru.LayerOptimalLinkLength = tu = D.s(ru, "LayerOptimalLinkLength", 0);
    var Qu;
    ru.LayerLongestPathSink = Qu = D.s(ru, "LayerLongestPathSink", 1);
    var Su;
    ru.LayerLongestPathSource = Su = D.s(ru, "LayerLongestPathSource", 2);
    var uu;
    ru.InitDepthFirstOut = uu = D.s(ru, "InitDepthFirstOut", 0);
    var Yu;
    ru.InitDepthFirstIn = Yu = D.s(ru, "InitDepthFirstIn", 1);
    var Wu;
    ru.InitNaive = Wu = D.s(ru, "InitNaive", 2);
    var bv;
    ru.AggressiveNone = bv = D.s(ru, "AggressiveNone", 0);
    var vu;
    ru.AggressiveLess = vu = D.s(ru, "AggressiveLess", 1);
    var cv;
    ru.AggressiveMore = cv = D.s(ru, "AggressiveMore", 2);
    ru.PackNone = 0;
    var dv;
    ru.PackExpand = dv = 1;
    var ev;
    ru.PackStraighten = ev = 2;
    var gv;
    ru.PackMedian = gv = 4;
    var wu;
    ru.PackAll = wu = 7;

    function nv() {
        this.index = this.Fe = this.gf = this.re = this.first = this.layer = 0;
        this.link = null;
        this.Li = 0
    }
    D.me(nv, { layer: !0, first: !0, re: !0, gf: !0, Fe: !0, index: !0, link: !0, Li: !0 });

    function xu() { ua.call(this) }
    D.Ta(xu, ua);
    D.ka("LayeredDigraphNetwork", xu);
    xu.prototype.createVertex = function() { return new qv };
    xu.prototype.createEdge = function() { return new rv };

    function qv() {
        va.call(this);
        this.index = this.column = this.layer = -1;
        this.component = NaN;
        this.near = null;
        this.valid = !1;
        this.finish = this.lq = NaN;
        this.En = 0;
        this.HB = this.IB = null
    }
    D.Ta(qv, va);
    D.ka("LayeredDigraphVertex", qv);

    function rv() {
        wa.call(this);
        this.forest = this.rev = this.valid = !1;
        this.portToPos = this.portFromPos = NaN;
        this.portToColOffset = this.portFromColOffset = 0
    }
    D.Ta(rv, wa);
    D.ka("LayeredDigraphEdge", rv);

    function $() {
        0 < arguments.length && D.zd($);
        $g.call(this);
        this.Jd = new L(Object);
        this.gt = sv;
        this.Wf = tv;
        this.Wt = uv;
        this.yw = vv;
        this.IC = null;
        this.bi = !0;
        this.Bd = wv;
        this.xg = (new Ca(10, 10)).freeze();
        this.Aa = new xv;
        this.Ba = new xv;
        this.sA = []
    }
    D.Ta($, $g);
    D.ka("TreeLayout", $);
    $.prototype.cloneProtected = function(a) {
        $g.prototype.cloneProtected.call(this, a);
        a.gt = this.gt;
        a.Wt = this.Wt;
        a.yw = this.yw;
        a.bi = this.bi;
        a.Bd = this.Bd;
        a.xg.assign(this.xg);
        a.Aa.copyInheritedPropertiesFrom(this.Aa);
        a.Ba.copyInheritedPropertiesFrom(this.Ba)
    };
    $.prototype.qc = function(a) { a.Qe === $ ? 0 === a.name.indexOf("Alignment") ? this.alignment = a : 0 === a.name.indexOf("Arrangement") ? this.eg = 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.HK = a : D.k("Unknown enum value: " + a) : $g.prototype.qc.call(this, a) };
    $.prototype.createNetwork = function() { return new yv };
    $.prototype.makeNetwork = function(a) {
        function b(a) {
            if (a instanceof G) return !a.Lf && "Comment" !== a.Kd;
            if (a instanceof J) {
                var b = a.$;
                if (null === b || b.Lf || "Comment" === b.Kd) return !1;
                a = a.ba;
                return null === a || a.Lf || "Comment" === a.Kd ? !1 : !0
            }
            return !1
        }
        var c = this.createNetwork();
        c.Yb = this;
        a instanceof E ? (c.Ok(a.rg, !0, b), c.Ok(a.links, !0, b)) : a instanceof I ? c.Ok(a.uc, !1, b) : c.Ok(a.j, !1, b);
        return c
    };
    $.prototype.doLayout = function(a) {
        null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
        null === this.network && (this.network = this.makeNetwork(a));
        this.eg !== zv && (this.Zd = this.initialOrigin(this.Zd));
        var b = this.g;
        null === b && a instanceof E && (b = a);
        this.Wf = this.path === sv && null !== b ? b.ee ? tv : Av : this.path === sv ? tv : this.path;
        if (0 < this.network.vertexes.count) {
            this.network.Px();
            for (a = this.network.vertexes.j; a.next();) b = a.value, b.initialized = !1, b.level =
                0, b.parent = null, b.children = [];
            if (0 < this.Jd.count) {
                a = new L(xv);
                for (b = this.Jd.j; b.next();) {
                    var c = b.value;
                    c instanceof G ? (c = this.network.Rn(c), null !== c && a.add(c)) : c instanceof xv && a.add(c)
                }
                this.Jd = a
            }
            0 === this.Jd.count && this.findRoots();
            for (a = this.Jd.copy().j; a.next();) b = a.value, b.initialized || (b.initialized = !0, Bv(this, b));
            b = this.network.vertexes;
            for (a = null; a = Cv(b), 0 < a.count;) b = Dv(this, a), null !== b && this.Jd.add(b), b.initialized = !0, Bv(this, b), b = a;
            for (a = this.Jd.j; a.next();) b = a.value, b instanceof xv && Ev(this,
                b);
            for (a = this.Jd.j; a.next();) b = a.value, b instanceof xv && Fv(this, b);
            for (a = this.Jd.j; a.next();) b = a.value, b instanceof xv && Gv(this, b);
            this.FA();
            if (this.vB === Hv) {
                c = [];
                for (a = this.network.vertexes.j; a.next();) {
                    var d = a.value,
                        b = d.parent;
                    null === b && (b = d);
                    var b = 0 === b.angle || 180 === b.angle,
                        e = c[d.level];
                    void 0 === e && (e = 0);
                    c[d.level] = Math.max(e, b ? d.width : d.height)
                }
                for (d = 0; d < c.length; d++) void 0 === c[d] && (c[d] = 0);
                this.IC = c;
                for (a = this.network.vertexes.j; a.next();) d = a.value, b = d.parent, null === b && (b = d), 0 === b.angle || 180 ===
                    b.angle ? (180 === b.angle && (d.xu += c[d.level] - d.width), d.width = c[d.level]) : (270 === b.angle && (d.yu += c[d.level] - d.height), d.height = c[d.level])
            } else if (this.vB === Iv)
                for (a = this.network.vertexes.j; a.next();) {
                    c = a.value;
                    b = 0 === c.angle || 180 === c.angle;
                    e = -1;
                    for (d = 0; d < c.children.length; d++) var g = c.children[d],
                        e = Math.max(e, b ? g.width : g.height);
                    if (0 <= e)
                        for (d = 0; d < c.children.length; d++) g = c.children[d], b ? (180 === c.angle && (g.xu += e - g.width), g.width = e) : (270 === c.angle && (g.yu += e - g.height), g.height = e)
                }
            for (a = this.Jd.j; a.next();) b =
                a.value, b instanceof xv && this.layoutTree(b);
            this.arrangeTrees();
            this.updateParts()
        }
        this.network = null;
        this.Jd = new L(Object);
        this.zf = !0
    };

    function Cv(a) {
        var b = new L(xv);
        for (a = a.j; a.next();) {
            var c = a.value;
            c.initialized || b.add(c)
        }
        return b
    }
    $.prototype.findRoots = function() {
        for (var a = this.network.vertexes, b = a.j; b.next();) {
            var c = b.value;
            switch (this.Wf) {
                case tv:
                    0 === c.wc.count && this.Jd.add(c);
                    break;
                case Av:
                    0 === c.tc.count && this.Jd.add(c);
                    break;
                default:
                    D.k("Unhandled path value " + this.Wf.toString())
            }
        }
        0 === this.Jd.count && (a = Dv(this, a), null !== a && this.Jd.add(a))
    };

    function Dv(a, b) {
        for (var c = 999999, d = null, e = b.j; e.next();) {
            var g = e.value;
            switch (a.Wf) {
                case tv:
                    g.wc.count < c && (c = g.wc.count, d = g);
                    break;
                case Av:
                    g.tc.count < c && (c = g.tc.count, d = g);
                    break;
                default:
                    D.k("Unhandled path value " + a.Wf.toString())
            }
        }
        return d
    }

    function Bv(a, b) {
        if (null !== b) {
            v && D.l(b, xv, $, "walkTree:v");
            switch (a.Wf) {
                case tv:
                    if (0 < b.tc.count) {
                        for (var c = new K(xv), d = b.zI; d.next();) {
                            var e = d.value;
                            Jv(a, b, e) && c.add(e)
                        }
                        0 < c.count && (b.children = c.Fc())
                    }
                    break;
                case Av:
                    if (0 < b.wc.count) {
                        c = new K(xv);
                        for (d = b.wK; d.next();) e = d.value, Jv(a, b, e) && c.add(e);
                        0 < c.count && (b.children = c.Fc())
                    }
                    break;
                default:
                    D.k("Unhandled path value" + a.Wf.toString())
            }
            c = b.children;
            d = c.length;
            for (e = 0; e < d; e++) {
                var g = c[e];
                g.initialized = !0;
                g.level = b.level + 1;
                g.parent = b;
                a.Jd.remove(g)
            }
            for (e =
                0; e < d; e++) g = c[e], Bv(a, g)
        }
    }

    function Jv(a, b, c) {
        v && D.l(b, xv, $, "walkOK:v");
        v && D.l(c, xv, $, "walkOK:c");
        if (c.initialized) {
            var d;
            if (null === b) d = !1;
            else {
                v && D.l(c, xv, $, "isAncestor:a");
                v && D.l(b, xv, $, "isAncestor:b");
                for (d = b.parent; null !== d && d !== c;) d = d.parent;
                d = d === c
            }
            if (d || c.level > b.level) return !1;
            a.removeChild(c.parent, c)
        }
        return !0
    }
    $.prototype.removeChild = function(a, b) {
        if (null !== a && null !== b) {
            v && D.l(a, xv, $, "removeChild:p");
            v && D.l(b, xv, $, "removeChild:c");
            for (var c = a.children, d = 0, e = 0; e < c.length; e++) c[e] === b && d++;
            if (0 < d) {
                for (var d = Array(c.length - d), g = 0, e = 0; e < c.length; e++) c[e] !== b && (d[g++] = c[e]);
                a.children = d
            }
        }
    };

    function Ev(a, b) {
        if (null !== b) {
            v && D.l(b, xv, $, "initializeTree:v");
            a.initializeTreeVertexValues(b);
            b.alignment === Kv && a.sortTreeVertexChildren(b);
            for (var c = 0, d = b.Gn, e = 0, g = b.children, h = g.length, k = 0; k < h; k++) {
                var l = g[k];
                Ev(a, l);
                c += l.descendantCount + 1;
                d = Math.max(d, l.maxChildrenCount);
                e = Math.max(e, l.maxGenerationCount)
            }
            b.descendantCount = c;
            b.maxChildrenCount = d;
            b.maxGenerationCount = 0 < d ? e + 1 : 0
        }
    }

    function Lv(a, b) {
        v && D.l(b, xv, $, "mom:v");
        switch (a.Wt) {
            default:
                case uv:
                return null !== b.parent ? b.parent : a.Aa;
            case Mv:
                    return null === b.parent ? a.Aa : null === b.parent.parent ? a.Ba : b.parent;
            case Nv:
                    return null !== b.parent ? null !== b.parent.parent ? b.parent.parent : a.Ba : a.Aa;
            case Ov:
                    var c = !0;
                if (0 === b.Gn) c = !1;
                else
                    for (var d = b.children, e = d.length, g = 0; g < e; g++)
                        if (0 < d[g].Gn) { c = !1; break } return c && null !== b.parent ? a.Ba : null !== b.parent ? b.parent : a.Aa
        }
    }
    $.prototype.initializeTreeVertexValues = function(a) {
        v && D.l(a, xv, $, "initializeTreeVertexValues:v");
        var b = Lv(this, a);
        a.copyInheritedPropertiesFrom(b);
        if (null !== a.parent && a.parent.alignment === Kv) {
            for (var b = a.angle, c = a.parent.children, d = 0; d < c.length && a !== c[d];) d++;
            0 === d % 2 ? d !== c.length - 1 && (b = 90 === b ? 180 : 180 === b ? 270 : 270 === b ? 180 : 270) : b = 90 === b ? 0 : 180 === b ? 90 : 270 === b ? 0 : 90;
            a.angle = b
        }
        a.initialized = !0
    };

    function Fv(a, b) {
        if (null !== b) {
            v && D.l(b, xv, $, "assignTree:v");
            a.assignTreeVertexValues(b);
            for (var c = b.children, d = c.length, e = 0; e < d; e++) Fv(a, c[e])
        }
    }
    $.prototype.assignTreeVertexValues = function() {};

    function Gv(a, b) {
        if (null !== b) {
            v && D.l(b, xv, $, "sortTree:v");
            b.alignment !== Kv && a.sortTreeVertexChildren(b);
            for (var c = b.children, d = c.length, e = 0; e < d; e++) Gv(a, c[e])
        }
    }
    $.prototype.sortTreeVertexChildren = function(a) {
        v && D.l(a, xv, $, "sortTreeVertexChildren:v");
        switch (a.sorting) {
            case Pv:
                break;
            case Qv:
                a.children.reverse();
                break;
            case Rv:
                a.children.sort(a.comparer);
                break;
            case Sv:
                a.children.sort(a.comparer);
                a.children.reverse();
                break;
            default:
                D.k("Unhandled sorting value " + a.sorting.toString())
        }
    };
    $.prototype.FA = function() {
        if (this.comments)
            for (var a = this.network.vertexes.j; a.next();) this.addComments(a.value)
    };
    $.prototype.addComments = function(a) {
        v && D.l(a, xv, $, "addComments:v");
        var b = a.angle,
            c = a.parent,
            d = 0,
            e = Tv,
            e = !1;
        null !== c && (d = c.angle, e = c.alignment, e = Uv(e));
        var b = 90 === b || 270 === b,
            d = 90 === d || 270 === d,
            c = 0 === a.Gn,
            g = 0,
            h = 0,
            k = 0,
            l = a.commentSpacing;
        if (null !== a.Zc)
            for (var m = a.Zc.GF(); m.next();) {
                var n = m.value;
                "Comment" === n.Kd && n.canLayout() && (null === a.comments && (a.comments = []), a.comments.push(n), n.kf(), n = n.Fa, b && !c || !e && !d && c || e && d && c ? (g = Math.max(g, n.width), h += n.height + Math.abs(k)) : (g += n.width + Math.abs(k), h = Math.max(h,
                    n.height)), k = l)
            }
        null !== a.comments && (b && !c || !e && !d && c || e && d && c ? (g += Math.abs(a.commentMargin), h = Math.max(0, h - a.height)) : (h += Math.abs(a.commentMargin), g = Math.max(0, g - a.width)), e = D.vg(0, 0, a.Q.width + g, a.Q.height + h), a.pb = e, D.Lb(e))
    };

    function Uv(a) { return a === Vv || a === Kv || a === Wv || a === Xv }

    function Yv(a) { return a === Vv || a === Kv }

    function Zv(a) { v && D.l(a, xv, $, "isLeftSideBus:v"); var b = a.parent; if (null !== b) { var c = b.alignment; if (Uv(c)) { if (Yv(c)) { b = b.children; for (c = 0; c < b.length && a !== b[c];) c++; return 0 === c % 2 } if (c === Wv) return !0 } } return !1 }
    $.prototype.layoutComments = function(a) {
        v && D.l(a, xv, $, "layoutComments:v");
        if (null !== a.comments) {
            var b = a.Zc.Fa,
                c = a.parent,
                d = a.angle,
                e = 0,
                g = Tv,
                g = !1;
            null !== c && (e = c.angle, g = c.alignment, g = Uv(g));
            for (var c = 90 === d || 270 === d, d = 90 === e || 270 === e, h = 0 === a.Gn, k = Zv(a), l = 0, m = a.comments, n = m.length, p = D.P(), q = 0; q < n; q++) {
                var r = m[q],
                    s = r.Fa;
                if (c && !h || !g && !d && h || g && d && h) {
                    if (135 < e && !g || d && k)
                        if (0 <= a.commentMargin)
                            for (p.n(a.Q.x - a.commentMargin - s.width, a.Q.y + l), r.move(p), r = r.Yg(); r.next();) {
                                var u = r.value;
                                u.Gb = ed;
                                u.Hb = fd
                            } else
                                for (p.n(a.Q.x +
                                        2 * a.W.x - a.commentMargin, a.Q.y + l), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = fd, u.Hb = ed;
                        else if (0 <= a.commentMargin)
                        for (p.n(a.Q.x + 2 * a.W.x + a.commentMargin, a.Q.y + l), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = fd, u.Hb = ed;
                    else
                        for (p.n(a.Q.x + a.commentMargin - s.width, a.Q.y + l), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = ed, u.Hb = fd;
                    l = 0 <= a.commentSpacing ? l + (s.height + a.commentSpacing) : l + (a.commentSpacing - s.height)
                } else {
                    if (135 < e && !g || !d && k)
                        if (0 <= a.commentMargin)
                            for (p.n(a.Q.x + l, a.Q.y - a.commentMargin - s.height),
                                r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = $c, u.Hb = gd;
                        else
                            for (p.n(a.Q.x + l, a.Q.y + 2 * a.W.y - a.commentMargin), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = gd, u.Hb = $c;
                    else if (0 <= a.commentMargin)
                        for (p.n(a.Q.x + l, a.Q.y + 2 * a.W.y + a.commentMargin), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = gd, u.Hb = $c;
                    else
                        for (p.n(a.Q.x + l, a.Q.y + a.commentMargin - s.height), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = $c, u.Hb = gd;
                    l = 0 <= a.commentSpacing ? l + (s.width + a.commentSpacing) : l + (a.commentSpacing - s.width)
                }
            }
            D.A(p);
            b = l - a.commentSpacing -
                (c ? b.height : b.width);
            if (this.Wf === tv)
                for (e = a.tc; e.next();) a = e.value.link, null === a || a.Nj || (a.rm = 0 < b ? b : NaN);
            else
                for (e = a.wc; e.next();) a = e.value.link, null === a || a.Nj || (a.Hm = 0 < b ? b : NaN)
        }
    };
    $.prototype.layoutTree = function(a) {
        if (null !== a) {
            v && D.l(a, xv, $, "layoutTree:v");
            for (var b = a.children, c = b.length, d = 0; d < c; d++) this.layoutTree(b[d]);
            switch (a.compaction) {
                case $v:
                    aw(this, a);
                    break;
                case bw:
                    if (a.alignment === Kv) aw(this, a);
                    else if (v && D.l(a, xv, $, "layoutTreeBlock:v"), 0 === a.Gn) {
                        var d = a.parent,
                            b = !1,
                            c = 0,
                            e = Tv;
                        null !== d && (c = d.angle, e = d.alignment, b = Uv(e));
                        d = Zv(a);
                        a.sa.n(0, 0);
                        a.tb.n(a.width, a.height);
                        null === a.parent || null === a.comments || (180 !== c && 270 !== c || b) && !d ? a.Wa.n(0, 0) : 180 === c && !b || (90 === c || 270 ===
                            c) && d ? a.Wa.n(a.width - 2 * a.W.x, 0) : a.Wa.n(0, a.height - 2 * a.W.y);
                        a.Ru = null;
                        a.kv = null
                    } else {
                        for (var g = cw(a), b = 90 === g || 270 === g, h = 0, k = a.children, l = k.length, m = 0; m < l; m++) var n = k[m],
                            h = Math.max(h, b ? n.tb.width : n.tb.height);
                        var p = a.alignment,
                            d = p === dw,
                            q = p === ew,
                            r = Uv(p),
                            s = Math.max(0, a.breadthLimit),
                            c = fw(a),
                            u = a.nodeSpacing,
                            t = gw(a),
                            y = a.rowSpacing,
                            w = 0;
                        if (d || q || a.Rq || a.Sq && 1 === a.maxGenerationCount) w = Math.max(0, a.rowIndent);
                        var d = a.width,
                            e = a.height,
                            A = 0,
                            B = 0,
                            P = 0,
                            H = null,
                            R = null,
                            aa = 0,
                            V = 0,
                            ea = 0,
                            la = 0,
                            Da = 0,
                            La = 0,
                            gb = 0,
                            Aa = 0,
                            n = 0;
                        r &&
                            !Yv(p) && 135 < g && k.reverse();
                        if (Yv(p))
                            if (1 < l)
                                for (m = 0; m < l; m++) 0 === m % 2 && m !== l - 1 ? Aa = Math.max(Aa, b ? k[m].tb.width : k[m].tb.height) : 0 !== m % 2 && (n = Math.max(n, b ? k[m].tb.width : k[m].tb.height));
                            else 1 === l && (Aa = b ? k[0].tb.width : k[0].tb.height);
                        if (r) {
                            switch (p) {
                                case Vv:
                                    B = 135 > g ? hw(a, k, Aa, A, B) : iw(a, k, Aa, A, B);
                                    Aa = B.x;
                                    A = B.width;
                                    B = B.height;
                                    break;
                                case Wv:
                                    for (m = 0; m < l; m++) {
                                        var n = k[m],
                                            W = n.tb,
                                            H = 0 === La ? 0 : y;
                                        b ? (n.sa.n(h - W.width, la + H), A = Math.max(A, W.width), B = Math.max(B, la + H + W.height), la += H + W.height) : (n.sa.n(ea + H, h - W.height), A = Math.max(A,
                                            ea + H + W.width), B = Math.max(B, W.height), ea += H + W.width);
                                        La++
                                    }
                                    break;
                                case Xv:
                                    for (m = 0; m < l; m++) n = k[m], W = n.tb, H = 0 === La ? 0 : y, b ? (n.sa.n(u / 2 + a.W.x, la + H), A = Math.max(A, W.width), B = Math.max(B, la + H + W.height), la += H + W.height) : (n.sa.n(ea + H, u / 2 + a.W.y), A = Math.max(A, ea + H + W.width), B = Math.max(B, W.height), ea += H + W.width), La++
                            }
                            H = Ow(this, 2);
                            R = Ow(this, 2);
                            b ? (H[0].n(0, 0), H[1].n(0, B), R[0].n(A, 0)) : (H[0].n(0, 0), H[1].n(A, 0), R[0].n(0, B));
                            R[1].n(A, B)
                        } else
                            for (m = 0; m < l; m++) {
                                n = k[m];
                                W = n.tb;
                                if (b) {
                                    0 < s && 0 < La && ea + u + W.width > s && (ea < h && Pw(a, p, h -
                                        ea, 0, gb, m - 1), Da++, La = 0, gb = m, P = B, ea = 0, la = 135 < g ? -B - y : B + y);
                                    Qw(this, n, 0, la);
                                    var xb = 0;
                                    if (0 === La) { if (H = n.Ru, R = n.kv, aa = W.width, V = W.height, null === H || null === R || g !== cw(n)) H = Ow(this, 2), R = Ow(this, 2), H[0].n(0, 0), H[1].n(0, V), R[0].n(aa, 0), R[1].n(aa, V) } else {
                                        var Pb = D.mb(),
                                            V = Rw(this, a, n, H, R, aa, V, Pb),
                                            xb = V.x,
                                            H = Pb[0],
                                            R = Pb[1],
                                            aa = V.width,
                                            V = V.height;
                                        D.ya(Pb);
                                        ea < W.width && 0 > xb && (Sw(a, -xb, 0, gb, m - 1), Tw(H, -xb, 0), Tw(R, -xb, 0), xb = 0)
                                    }
                                    n.sa.n(xb, la);
                                    A = Math.max(A, aa);
                                    B = Math.max(B, P + (0 === Da ? 0 : y) + W.height);
                                    ea = aa
                                } else {
                                    0 < s && 0 < La && la + u +
                                        W.height > s && (la < h && Pw(a, p, 0, h - la, gb, m - 1), Da++, La = 0, gb = m, P = A, la = 0, ea = 135 < g ? -A - y : A + y);
                                    Qw(this, n, ea, 0);
                                    xb = 0;
                                    if (0 === La) { if (H = n.Ru, R = n.kv, aa = W.width, V = W.height, null === H || null === R || g !== cw(n)) H = Ow(this, 2), R = Ow(this, 2), H[0].n(0, 0), H[1].n(aa, 0), R[0].n(0, V), R[1].n(aa, V) } else Pb = D.mb(), V = Rw(this, a, n, H, R, aa, V, Pb), xb = V.x, H = Pb[0], R = Pb[1], aa = V.width, V = V.height, D.ya(Pb), la < W.height && 0 > xb && (Sw(a, 0, -xb, gb, m - 1), Tw(H, 0, -xb), Tw(R, 0, -xb), xb = 0);
                                    n.sa.n(ea, xb);
                                    B = Math.max(B, V);
                                    A = Math.max(A, P + (0 === Da ? 0 : y) + W.width);
                                    la = V
                                }
                                La++
                            }
                        0 <
                            Da && (b ? (B += Math.max(0, c), ea < A && Pw(a, p, A - ea, 0, gb, l - 1), 0 < w && (q || Sw(a, w, 0, 0, l - 1), A += w)) : (A += Math.max(0, c), la < B && Pw(a, p, 0, B - la, gb, l - 1), 0 < w && (q || Sw(a, 0, w, 0, l - 1), B += w)));
                        w = q = 0;
                        switch (p) {
                            case Uw:
                                b ? q += A / 2 - a.W.x - t / 2 : w += B / 2 - a.W.y - t / 2;
                                break;
                            case Tv:
                                0 < Da ? b ? q += A / 2 - a.W.x - t / 2 : w += B / 2 - a.W.y - t / 2 : b ? (Aa = k[0].sa.x + k[0].Wa.x, m = k[l - 1].sa.x + k[l - 1].Wa.x + 2 * k[l - 1].W.x, q += Aa + (m - Aa) / 2 - a.W.x - t / 2) : (Aa = k[0].sa.y + k[0].Wa.y, m = k[l - 1].sa.y + k[l - 1].Wa.y + 2 * k[l - 1].W.y, w += Aa + (m - Aa) / 2 - a.W.y - t / 2);
                                break;
                            case dw:
                                b ? (q -= t, A += t) : (w -= t, B += t);
                                break;
                            case ew:
                                b ? (q += A - a.width + t, A += t) : (w += B - a.height + t, B += t);
                                break;
                            case Vv:
                                b ? q = 1 < l ? q + (Aa + u / 2 - a.W.x) : q + (k[0].W.x - a.W.x + k[0].Wa.x) : w = 1 < l ? w + (Aa + u / 2 - a.W.y) : w + (k[0].W.y - a.W.y + k[0].Wa.y);
                                break;
                            case Wv:
                                b ? q += A + u / 2 - a.W.x : w += B + u / 2 - a.W.y;
                                break;
                            case Xv:
                                break;
                            default:
                                D.k("Unhandled alignment value " + p.toString())
                        }
                        for (m = 0; m < l; m++) n = k[m], b ? n.sa.n(n.sa.x + n.Wa.x - q, n.sa.y + (135 < g ? (r ? -B : -n.tb.height) + n.Wa.y - c : e + c + n.Wa.y)) : n.sa.n(n.sa.x + (135 < g ? (r ? -A : -n.tb.width) + n.Wa.x - c : d + c + n.Wa.x), n.sa.y + n.Wa.y - w);
                        l = k = 0;
                        r ? b ? (A = Vw(a, A, q),
                            0 > q && (q = 0), 135 < g && (w += B + c), B += e + c, p === Xv && (k += u / 2 + a.W.x), l += e + c) : (135 < g && (q += A + c), A += d + c, B = Ww(a, B, w), 0 > w && (w = 0), p === Xv && (l += u / 2 + a.W.y), k += d + c) : b ? (null === a.comments ? d > A && (p = Xw(p, d - A, 0), k = p.x, l = p.y, A = d, q = 0) : A = Vw(a, A, q), 0 > q && (k -= q, q = 0), 135 < g && (w += B + c), B = Math.max(Math.max(B, e), B + e + c), l += e + c) : (135 < g && (q += A + c), A = Math.max(Math.max(A, d), A + d + c), null === a.comments ? e > B && (p = Xw(p, 0, e - B), k = p.x, l = p.y, B = e, w = 0) : B = Ww(a, B, w), 0 > w && (l -= w, w = 0), k += d + c);
                        if (0 < Da) g = Ow(this, 4), p = Ow(this, 4), b ? (g[2].n(0, e + c), g[3].n(g[2].x, B),
                            p[2].n(A, g[2].y), p[3].n(p[2].x, g[3].y)) : (g[2].n(d + c, 0), g[3].n(A, g[2].y), p[2].n(g[2].x, B), p[3].n(g[3].x, p[2].y));
                        else {
                            g = Ow(this, H.length + 2);
                            p = Ow(this, R.length + 2);
                            for (m = 0; m < H.length; m++) r = H[m], g[m + 2].n(r.x + k, r.y + l);
                            for (m = 0; m < R.length; m++) r = R[m], p[m + 2].n(r.x + k, r.y + l)
                        }
                        b ? (g[0].n(q, 0), g[1].n(g[0].x, e), g[2].y < g[1].y && (g[2].x > g[0].x ? g[2].assign(g[1]) : g[1].assign(g[2])), g[3].y < g[2].y && (g[3].x > g[0].x ? g[3].assign(g[2]) : g[2].assign(g[3])), p[0].n(q + d, 0), p[1].n(p[0].x, e), p[2].y < p[1].y && (p[2].x < p[0].x ? p[2].assign(p[1]) :
                            p[1].assign(p[2])), p[3].y < p[2].y && (p[3].x < p[0].x ? p[3].assign(p[2]) : p[2].assign(p[3])), g[2].y -= c / 2, p[2].y -= c / 2) : (g[0].n(0, w), g[1].n(d, g[0].y), g[2].x < g[1].x && (g[2].y > g[0].y ? g[2].assign(g[1]) : g[1].assign(g[2])), g[3].x < g[2].x && (g[3].y > g[0].y ? g[3].assign(g[2]) : g[2].assign(g[3])), p[0].n(0, w + e), p[1].n(d, p[0].y), p[2].x < p[1].x && (p[2].y < p[0].y ? p[2].assign(p[1]) : p[1].assign(p[2])), p[3].x < p[2].x && (p[3].y < p[0].y ? p[3].assign(p[2]) : p[2].assign(p[3])), g[2].x -= c / 2, p[2].x -= c / 2);
                        Yw(this, H);
                        Yw(this, R);
                        a.Ru = g;
                        a.kv = p;
                        a.Wa.n(q, w);
                        a.tb.n(A, B)
                    }
                    break;
                default:
                    D.k("Unhandled compaction value " + a.compaction.toString())
            }
        }
    };

    function aw(a, b) {
        v && D.l(b, xv, $, "layoutTreeNone:v");
        if (0 === b.Gn) {
            var c = !1,
                d = 0,
                e = Tv;
            null !== b.parent && (d = b.parent.angle, e = b.parent.alignment, c = Uv(e));
            e = Zv(b);
            b.sa.n(0, 0);
            b.tb.n(b.width, b.height);
            null === b.parent || null === b.comments || (180 !== d && 270 !== d || c) && !e ? b.Wa.n(0, 0) : 180 === d && !c || (90 === d || 270 === d) && e ? b.Wa.n(b.width - 2 * b.W.x, 0) : b.Wa.n(0, b.height - 2 * b.W.y)
        } else {
            for (var c = cw(b), d = 90 === c || 270 === c, g = 0, e = b.children, h = e.length, k = 0; k < h; k++) var l = e[k],
                g = Math.max(g, d ? l.tb.width : l.tb.height);
            var m = b.alignment,
                n =
                m === dw,
                p = m === ew,
                q = Uv(m),
                r = Math.max(0, b.breadthLimit),
                s = fw(b),
                u = b.nodeSpacing,
                t = gw(b),
                y = n || p ? 0 : t / 2,
                w = b.rowSpacing,
                A = 0;
            if (n || p || b.Rq || b.Sq && 1 === b.maxGenerationCount) A = Math.max(0, b.rowIndent);
            var n = b.width,
                B = b.height,
                P = 0,
                H = 0,
                R = 0,
                aa = 0,
                V = 0,
                ea = 0,
                la = 0,
                Da = 0,
                La = 0,
                gb = 0;
            q && !Yv(m) && 135 < c && e.reverse();
            if (Yv(m))
                if (1 < h)
                    for (k = 0; k < h; k++) {
                        var l = e[k],
                            Aa = l.tb;
                        0 === k % 2 && k !== h - 1 ? La = Math.max(La, (d ? Aa.width : Aa.height) + Zw(l) - u) : 0 !== k % 2 && (gb = Math.max(gb, (d ? Aa.width : Aa.height) + Zw(l) - u))
                    } else 1 === h && (La = d ? e[0].tb.width : e[0].tb.height);
            if (q) switch (m) {
                case Vv:
                case Kv:
                    H = 135 > c ? hw(b, e, La, P, H) : iw(b, e, La, P, H);
                    La = H.x;
                    P = H.width;
                    H = H.height;
                    break;
                case Wv:
                    for (k = 0; k < h; k++) l = e[k], Aa = l.tb, r = 0 === la ? 0 : w, d ? (l.sa.n(g - Aa.width, V + r), P = Math.max(P, Aa.width), H = Math.max(H, V + r + Aa.height), V += r + Aa.height) : (l.sa.n(aa + r, g - Aa.height), P = Math.max(P, aa + r + Aa.width), H = Math.max(H, Aa.height), aa += r + Aa.width), la++;
                    break;
                case Xv:
                    for (g = 0; g < h; g++) l = e[g], Aa = l.tb, r = 0 === la ? 0 : w, d ? (l.sa.n(u / 2 + b.W.x, V + r), P = Math.max(P, Aa.width), H = Math.max(H, V + r + Aa.height), V += r + Aa.height) : (l.sa.n(aa +
                        r, u / 2 + b.W.y), P = Math.max(P, aa + r + Aa.width), H = Math.max(H, Aa.height), aa += r + Aa.width), la++
            } else
                for (k = 0; k < h; k++) l = e[k], Aa = l.tb, d ? (0 < r && 0 < la && aa + u + Aa.width > r && (aa < g && Pw(b, m, g - aa, 0, Da, k - 1), ea++, la = 0, Da = k, R = H, aa = 0, V = 135 < c ? -H - w : H + w), gb = 0 === la ? y : u, Qw(a, l, 0, V), l.sa.n(aa + gb, V), P = Math.max(P, aa + gb + Aa.width), H = Math.max(H, R + (0 === ea ? 0 : w) + Aa.height), aa += gb + Aa.width) : (0 < r && 0 < la && V + u + Aa.height > r && (V < g && Pw(b, m, 0, g - V, Da, k - 1), ea++, la = 0, Da = k, R = P, V = 0, aa = 135 < c ? -P - w : P + w), gb = 0 === la ? y : u, Qw(a, l, aa, 0), l.sa.n(aa, V + gb), H = Math.max(H,
                    V + gb + Aa.height), P = Math.max(P, R + (0 === ea ? 0 : w) + Aa.width), V += gb + Aa.height), la++;
            0 < ea && (d ? (H += Math.max(0, s), aa < P && Pw(b, m, P - aa, 0, Da, h - 1), 0 < A && (p || Sw(b, A, 0, 0, h - 1), P += A)) : (P += Math.max(0, s), V < H && Pw(b, m, 0, H - V, Da, h - 1), 0 < A && (p || Sw(b, 0, A, 0, h - 1), H += A)));
            A = p = 0;
            switch (m) {
                case Uw:
                    d ? p += P / 2 - b.W.x - t / 2 : A += H / 2 - b.W.y - t / 2;
                    break;
                case Tv:
                    0 < ea ? d ? p += P / 2 - b.W.x - t / 2 : A += H / 2 - b.W.y - t / 2 : d ? (m = e[0].sa.x + e[0].Wa.x, u = e[h - 1].sa.x + e[h - 1].Wa.x + 2 * e[h - 1].W.x, p += m + (u - m) / 2 - b.W.x - t / 2) : (m = e[0].sa.y + e[0].Wa.y, u = e[h - 1].sa.y + e[h - 1].Wa.y + 2 * e[h - 1].W.y,
                        A += m + (u - m) / 2 - b.W.y - t / 2);
                    break;
                case dw:
                    d ? (p -= t, P += t) : (A -= t, H += t);
                    break;
                case ew:
                    d ? (p += P - b.width + t, P += t) : (A += H - b.height + t, H += t);
                    break;
                case Vv:
                case Kv:
                    d ? p = 1 < h ? p + (La + u / 2 - b.W.x) : p + (e[0].W.x - b.W.x + e[0].Wa.x) : A = 1 < h ? A + (La + u / 2 - b.W.y) : A + (e[0].W.y - b.W.y + e[0].Wa.y);
                    break;
                case Wv:
                    d ? p += P + u / 2 - b.W.x : A += H + u / 2 - b.W.y;
                    break;
                case Xv:
                    break;
                default:
                    D.k("Unhandled alignment value " + m.toString())
            }
            for (k = 0; k < h; k++) l = e[k], d ? l.sa.n(l.sa.x + l.Wa.x - p, l.sa.y + (135 < c ? (q ? -H : -l.tb.height) + l.Wa.y - s : B + s + l.Wa.y)) : l.sa.n(l.sa.x + (135 < c ? (q ?
                -P : -l.tb.width) + l.Wa.x - s : n + s + l.Wa.x), l.sa.y + l.Wa.y - A);
            d ? (P = Vw(b, P, p), 0 > p && (p = 0), 135 < c && (A += H + s), H += B + s) : (135 < c && (p += P + s), P += n + s, H = Ww(b, H, A), 0 > A && (A = 0));
            b.Wa.n(p, A);
            b.tb.n(P, H)
        }
    }

    function hw(a, b, c, d, e) {
        v && D.l(a, xv, $, "layoutBusChildrenPosDir:v");
        var g = b.length;
        if (0 === g) return new C(c, 0, d, e);
        if (1 === g) {
            var h = b[0];
            d = h.tb.width;
            e = h.tb.height;
            return new C(c, 0, d, e)
        }
        for (var k = a.nodeSpacing, l = a.rowSpacing, m = 90 === cw(a), n = 0, p = 0, q = 0, r = 0; r < g; r++)
            if (!(0 !== r % 2 || 1 < g && r === g - 1)) {
                var h = b[r],
                    s = h.tb,
                    u = 0 === n ? 0 : l;
                if (m) {
                    var t = Zw(h) - k;
                    h.sa.n(c - (s.width + t), q + u);
                    d = Math.max(d, s.width + t);
                    e = Math.max(e, q + u + s.height);
                    q += u + s.height
                } else t = Zw(h) - k, h.sa.n(p + u, c - (s.height + t)), e = Math.max(e, s.height + t), d = Math.max(d,
                    p + u + s.width), p += u + s.width;
                n++
            }
        var n = 0,
            y = p,
            w = q;
        m ? (p = c + k, q = 0) : (p = 0, q = c + k);
        for (r = 0; r < g; r++) 0 !== r % 2 && (h = b[r], s = h.tb, u = 0 === n ? 0 : l, m ? (t = Zw(h) - k, h.sa.n(p + t, q + u), d = Math.max(d, p + s.width + t), e = Math.max(e, q + u + s.height), q += u + s.height) : (t = Zw(h) - k, h.sa.n(p + u, q + t), d = Math.max(d, p + u + s.width), e = Math.max(e, q + s.height + t), p += u + s.width), n++);
        1 < g && 1 === g % 2 && (h = b[g - 1], s = h.tb, b = $w(h, m ? Math.max(Math.abs(w), Math.abs(q)) : Math.max(Math.abs(y), Math.abs(p))), m ? (h.sa.n(c + k / 2 - h.W.x - h.Wa.x, e + b), m = c + k / 2 - h.W.x - h.Wa.x, d = Math.max(d, m + s.width),
            0 > m && (d -= m), e = Math.max(e, Math.max(w, q) + b + s.height), 0 > h.sa.x && (c = ax(a, h.sa.x, !1, c, k))) : (h.sa.n(d + b, c + k / 2 - h.W.y - h.Wa.y), d = Math.max(d, Math.max(y, p) + b + s.width), m = c + k / 2 - h.W.y - h.Wa.y, e = Math.max(e, m + s.height), 0 > m && (e -= m), 0 > h.sa.y && (c = ax(a, h.sa.y, !0, c, k))));
        return new C(c, 0, d, e)
    }

    function iw(a, b, c, d, e) {
        v && D.l(a, xv, $, "layoutBusChildrenNegDir:v");
        var g = b.length;
        if (0 === g) return new C(c, 0, d, e);
        if (1 === g) {
            var h = b[0];
            d = h.tb.width;
            e = h.tb.height;
            return new C(c, 0, d, e)
        }
        for (var k = a.nodeSpacing, l = a.rowSpacing, m = 270 === cw(a), n = 0, p = 0, q = 0, r = 0; r < g; r++)
            if (!(0 !== r % 2 || 1 < g && r === g - 1)) {
                var h = b[r],
                    s = h.tb,
                    u = 0 === n ? 0 : l;
                if (m) {
                    var t = Zw(h) - k,
                        q = q - (u + s.height);
                    h.sa.n(c - (s.width + t), q);
                    d = Math.max(d, s.width + t);
                    e = Math.max(e, Math.abs(q))
                } else t = Zw(h) - k, p -= u + s.width, h.sa.n(p, c - (s.height + t)), e = Math.max(e, s.height +
                    t), d = Math.max(d, Math.abs(p));
                n++
            }
        var n = 0,
            y = p,
            w = q;
        m ? (p = c + k, q = 0) : (p = 0, q = c + k);
        for (r = 0; r < g; r++) 0 !== r % 2 && (h = b[r], s = h.tb, u = 0 === n ? 0 : l, m ? (t = Zw(h) - k, q -= u + s.height, h.sa.n(p + t, q), d = Math.max(d, p + s.width + t), e = Math.max(e, Math.abs(q))) : (t = Zw(h) - k, p -= u + s.width, h.sa.n(p, q + t), e = Math.max(e, q + s.height + t), d = Math.max(d, Math.abs(p))), n++);
        1 < g && 1 === g % 2 && (h = b[g - 1], s = h.tb, l = $w(h, m ? Math.max(Math.abs(w), Math.abs(q)) : Math.max(Math.abs(y), Math.abs(p))), m ? (h.sa.n(c + k / 2 - h.W.x - h.Wa.x, -e - s.height - l), p = c + k / 2 - h.W.x - h.Wa.x, d = Math.max(d,
            p + s.width), 0 > p && (d -= p), e = Math.max(e, Math.abs(Math.min(w, q)) + l + s.height), 0 > h.sa.x && (c = ax(a, h.sa.x, !1, c, k))) : (h.sa.n(-d - s.width - l, c + k / 2 - h.W.y - h.Wa.y), d = Math.max(d, Math.abs(Math.min(y, p)) + l + s.width), p = c + k / 2 - h.W.y - h.Wa.y, e = Math.max(e, p + s.height), 0 > p && (e -= p), 0 > h.sa.y && (c = ax(a, h.sa.y, !0, c, k))));
        for (r = 0; r < g; r++) h = b[r], m ? h.sa.n(h.sa.x, h.sa.y + e) : h.sa.n(h.sa.x + d, h.sa.y);
        return new C(c, 0, d, e)
    }

    function Zw(a) { v && D.l(a, xv, $, "fixRelativePostions:child"); return null === a.parent ? 0 : a.parent.nodeSpacing }

    function $w(a) { v && D.l(a, xv, $, "fixRelativePostions:lastchild"); return null === a.parent ? 0 : a.parent.rowSpacing }

    function ax(a, b, c, d, e) {
        v && D.l(a, xv, $, "fixRelativePostions:v");
        a = a.children;
        for (var g = a.length, h = 0; h < g; h++) c ? a[h].sa.n(a[h].sa.x, a[h].sa.y - b) : a[h].sa.n(a[h].sa.x - b, a[h].sa.y);
        b = a[g - 1];
        return Math.max(d, c ? b.Wa.y + b.W.y - e / 2 : b.Wa.x + b.W.x - e / 2)
    }

    function Vw(a, b, c) {
        v && D.l(a, xv, $, "calculateSubwidth:v");
        switch (a.alignment) {
            case Tv:
            case Uw:
                var d = b;
                c + a.width > d && (d = c + a.width);
                0 > c && (d -= c);
                return d;
            case dw:
                return a.width > b ? a.width : b;
            case ew:
                return 2 * a.W.x > b ? a.width : b + a.width - 2 * a.W.x;
            case Vv:
            case Kv:
                return d = Math.min(0, c), c = Math.max(b, c + a.width), Math.max(a.width, c - d);
            case Wv:
                return a.width - a.W.x + a.nodeSpacing / 2 + b;
            case Xv:
                return Math.max(a.width, a.W.x + a.nodeSpacing / 2 + b);
            default:
                return b
        }
    }

    function Ww(a, b, c) {
        v && D.l(a, xv, $, "calculateSubheight:v");
        switch (a.alignment) {
            case Tv:
            case Uw:
                var d = b;
                c + a.height > d && (d = c + a.height);
                0 > c && (d -= c);
                return d;
            case dw:
                return a.height > b ? a.height : b;
            case ew:
                return 2 * a.W.y > b ? a.height : b + a.height - 2 * a.W.y;
            case Vv:
            case Kv:
                return d = Math.min(0, c), c = Math.max(b, c + a.height), Math.max(a.height, c - d);
            case Wv:
                return a.height - a.W.y + a.nodeSpacing / 2 + b;
            case Xv:
                return Math.max(a.height, a.W.y + a.nodeSpacing / 2 + b);
            default:
                return b
        }
    }

    function Xw(a, b, c) {
        v && D.l(a, ya, $, "alignOffset:align");
        switch (a) {
            case Uw:
                b /= 2;
                c /= 2;
                break;
            case Tv:
                b /= 2;
                c /= 2;
                break;
            case dw:
                c = b = 0;
                break;
            case ew:
                break;
            default:
                D.k("Unhandled alignment value " + a.toString())
        }
        return new N(b, c)
    }

    function Pw(a, b, c, d, e, g) {
        v && D.l(a, xv, $, "shiftRelPosAlign:v");
        v && D.l(b, ya, $, "shiftRelPosAlign:align");
        b = Xw(b, c, d);
        Sw(a, b.x, b.y, e, g)
    }

    function Sw(a, b, c, d, e) {
        v && D.l(a, xv, $, "shiftRelPos:v");
        if (0 !== b || 0 !== c)
            for (a = a.children; d <= e; d++) {
                var g = a[d].sa;
                g.x += b;
                g.y += c
            }
    }

    function Qw(a, b, c, d) {
        v && (D.l(b, xv, $, "recordMidPoints:v"), D.h(c, "number", $, "recordMidPoints:x"), D.h(d, "number", $, "recordMidPoints:y"));
        var e = b.parent;
        switch (a.Wf) {
            case tv:
                for (a = b.wc; a.next();) b = a.value, b.fromVertex === e && b.nt.n(c, d);
                break;
            case Av:
                for (a = b.tc; a.next();) b = a.value, b.toVertex === e && b.nt.n(c, d);
                break;
            default:
                D.k("Unhandled path value " + a.Wf.toString())
        }
    }

    function Tw(a, b, c) {
        for (var d = 0; d < a.length; d++) {
            var e = a[d];
            e.x += b;
            e.y += c
        }
    }

    function Rw(a, b, c, d, e, g, h, k) {
        v && D.l(b, xv, $, "mergeFringes:parent");
        v && D.l(c, xv, $, "mergeFringes:child");
        var l = cw(b),
            m = 90 === l || 270 === l,
            n = b.nodeSpacing;
        b = d;
        var p = e;
        d = g;
        e = h;
        var q = c.Ru,
            r = c.kv;
        h = c.tb;
        var s = m ? Math.max(e, h.height) : Math.max(d, h.width);
        if (null === q || l !== cw(c)) q = Ow(a, 2), r = Ow(a, 2), m ? (q[0].n(0, 0), q[1].n(0, h.height), r[0].n(h.width, 0), r[1].n(r[0].x, q[1].y)) : (q[0].n(0, 0), q[1].n(h.width, 0), r[0].n(0, h.height), r[1].n(q[1].x, r[0].y));
        if (m) {
            c = d;
            d = 9999999;
            if (!(null === p || 2 > p.length || null === q || 2 > q.length))
                for (m =
                    l = 0; l < p.length && m < q.length;) {
                    e = p[l];
                    var u = q[m];
                    g = u.x;
                    var t = u.y;
                    g += c;
                    var y = e;
                    l + 1 < p.length && (y = p[l + 1]);
                    var w = u,
                        u = w.x,
                        w = w.y;
                    m + 1 < q.length && (w = q[m + 1], u = w.x, w = w.y, u += c);
                    var A = d;
                    e.y === t ? A = g - e.x : e.y > t && e.y < w ? A = g + (e.y - t) / (w - t) * (u - g) - e.x : t > e.y && t < y.y && (A = g - (e.x + (t - e.y) / (y.y - e.y) * (y.x - e.x)));
                    A < d && (d = A);
                    y.y <= e.y ? l++ : w <= t ? m++ : (y.y <= w && l++, w <= y.y && m++)
                }
            c -= d;
            c += n;
            l = q;
            m = c;
            if (null === b || 2 > b.length || null === l || 2 > l.length) d = null;
            else {
                n = Ow(a, b.length + l.length);
                for (d = g = e = 0; g < l.length && l[g].y < b[0].y;) t = l[g++], n[d++].n(t.x +
                    m, t.y);
                for (; e < b.length;) t = b[e++], n[d++].n(t.x, t.y);
                for (e = b[b.length - 1].y; g < l.length && l[g].y <= e;) g++;
                for (; g < l.length && l[g].y > e;) t = l[g++], n[d++].n(t.x + m, t.y);
                l = Ow(a, d);
                for (e = 0; e < d; e++) l[e].assign(n[e]);
                Yw(a, n);
                d = l
            }
            g = r;
            t = c;
            if (null === p || 2 > p.length || null === g || 2 > g.length) e = null;
            else {
                n = Ow(a, p.length + g.length);
                for (m = y = l = 0; l < p.length && p[l].y < g[0].y;) e = p[l++], n[m++].n(e.x, e.y);
                for (; y < g.length;) e = g[y++], n[m++].n(e.x + t, e.y);
                for (g = g[g.length - 1].y; l < p.length && p[l].y <= g;) l++;
                for (; l < p.length && p[l].y > g;) e = p[l++],
                    n[m++].n(e.x, e.y);
                e = Ow(a, m);
                for (l = 0; l < m; l++) e[l].assign(n[l]);
                Yw(a, n)
            }
            g = Math.max(0, c) + h.width;
            h = s
        } else {
            c = e;
            d = 9999999;
            if (!(null === p || 2 > p.length || null === q || 2 > q.length))
                for (m = l = 0; l < p.length && m < q.length;) e = p[l], u = q[m], g = u.x, t = u.y, t += c, y = e, l + 1 < p.length && (y = p[l + 1]), w = u, u = w.x, w = w.y, m + 1 < q.length && (w = q[m + 1], u = w.x, w = w.y, w += c), A = d, e.x === g ? A = t - e.y : e.x > g && e.x < u ? A = t + (e.x - g) / (u - g) * (w - t) - e.y : g > e.x && g < y.x && (A = t - (e.y + (g - e.x) / (y.x - e.x) * (y.y - e.y))), A < d && (d = A), y.x <= e.x ? l++ : u <= g ? m++ : (y.x <= u && l++, u <= y.x && m++);
            c -= d;
            c += n;
            l = q;
            m = c;
            if (null === b || 2 > b.length || null === l || 2 > l.length) d = null;
            else {
                n = Ow(a, b.length + l.length);
                for (d = g = e = 0; g < l.length && l[g].x < b[0].x;) t = l[g++], n[d++].n(t.x, t.y + m);
                for (; e < b.length;) t = b[e++], n[d++].n(t.x, t.y);
                for (e = b[b.length - 1].x; g < l.length && l[g].x <= e;) g++;
                for (; g < l.length && l[g].x > e;) t = l[g++], n[d++].n(t.x, t.y + m);
                l = Ow(a, d);
                for (e = 0; e < d; e++) l[e].assign(n[e]);
                Yw(a, n);
                d = l
            }
            g = r;
            t = c;
            if (null === p || 2 > p.length || null === g || 2 > g.length) e = null;
            else {
                n = Ow(a, p.length + g.length);
                for (m = y = l = 0; l < p.length && p[l].x < g[0].x;) e = p[l++],
                    n[m++].n(e.x, e.y);
                for (; y < g.length;) e = g[y++], n[m++].n(e.x, e.y + t);
                for (g = g[g.length - 1].x; l < p.length && p[l].x <= g;) l++;
                for (; l < p.length && p[l].x > g;) e = p[l++], n[m++].n(e.x, e.y);
                e = Ow(a, m);
                for (l = 0; l < m; l++) e[l].assign(n[l]);
                Yw(a, n)
            }
            g = s;
            h = Math.max(0, c) + h.height
        }
        Yw(a, b);
        Yw(a, q);
        Yw(a, p);
        Yw(a, r);
        k[0] = d;
        k[1] = e;
        return new C(c, 0, g, h)
    }

    function Ow(a, b) { var c = a.sA[b]; if (void 0 !== c && (c = c.pop(), void 0 !== c)) return c; for (var c = [], d = 0; d < b; d++) c[d] = new N; return c }

    function Yw(a, b) {
        var c = b.length,
            d = a.sA[c];
        void 0 === d && (d = [], a.sA[c] = d);
        d.push(b)
    }
    $.prototype.arrangeTrees = function() {
        if (this.Bd === zv)
            for (var a = this.Jd.j; a.next();) {
                var b = a.value;
                if (b instanceof xv) {
                    var c = b.Zc;
                    if (null !== c) {
                        var d = c.position,
                            c = d.x,
                            d = d.y;
                        isFinite(c) || (c = 0);
                        isFinite(d) || (d = 0);
                        bx(this, b, c, d)
                    }
                }
            } else {
                c = [];
                for (a = this.Jd.j; a.next();) b = a.value, b instanceof xv && c.push(b);
                switch (this.sorting) {
                    case Pv:
                        break;
                    case Qv:
                        c.reverse();
                        break;
                    case Rv:
                        c.sort(this.comparer);
                        break;
                    case Sv:
                        c.sort(this.comparer);
                        c.reverse();
                        break;
                    default:
                        D.k("Unhandled sorting value " + this.sorting.toString())
                }
                b =
                    this.Zd;
                a = b.x;
                b = b.y;
                for (d = 0; d < c.length; d++) {
                    var e = c[d];
                    bx(this, e, a + e.Wa.x, b + e.Wa.y);
                    switch (this.Bd) {
                        case wv:
                            b += e.tb.height + this.xg.height;
                            break;
                        case cx:
                            a += e.tb.width + this.xg.width;
                            break;
                        default:
                            D.k("Unhandled arrangement value " + this.Bd.toString())
                    }
                }
            }
    };

    function bx(a, b, c, d) {
        if (null !== b) {
            v && D.l(b, xv, $, "assignAbsolutePositions:v");
            b.x = c;
            b.y = d;
            b = b.children;
            for (var e = b.length, g = 0; g < e; g++) {
                var h = b[g];
                bx(a, h, c + h.sa.x, d + h.sa.y)
            }
        }
    }
    $.prototype.commitLayout = function() {
        this.aC();
        this.commitNodes();
        this.JA();
        this.Pu && this.commitLinks()
    };
    $.prototype.commitNodes = function() { for (var a = this.network.vertexes.j; a.next();) a.value.commit(); for (a.reset(); a.next();) this.layoutComments(a.value) };
    $.prototype.JA = function() {
        if (this.vB === Hv) {
            for (var a = this.IC, b = [], c = null, d = this.network.vertexes.j; d.next();) {
                var e = d.value;
                null === c ? c = e.pb.copy() : c.Zh(e.pb);
                var g = b[e.level],
                    g = void 0 === g ? fw(e) : Math.max(g, fw(e));
                b[e.level] = g
            }
            for (d = 0; d < b.length; d++) void 0 === b[d] && (b[d] = 0);
            90 === this.angle || 270 === this.angle ? (c.ig(this.nodeSpacing / 2, this.layerSpacing), e = new N(-this.nodeSpacing / 2, -this.layerSpacing / 2)) : (c.ig(this.layerSpacing, this.nodeSpacing / 2), e = new N(-this.layerSpacing / 2, -this.nodeSpacing / 2));
            var g = [],
                c = 90 === this.angle || 270 === this.angle ? c.width : c.height,
                h = 0;
            if (180 === this.angle || 270 === this.angle)
                for (d = 0; d < a.length; d++) h += a[d] + b[d];
            for (d = 0; d < a.length; d++) {
                var k = a[d] + b[d];
                270 === this.angle ? (h -= k, g.push(new C(0, h, c, k))) : 90 === this.angle ? (g.push(new C(0, h, c, k)), h += k) : 180 === this.angle ? (h -= k, g.push(new C(h, 0, k, c))) : (g.push(new C(h, 0, k, c)), h += k)
            }
            this.commitLayers(g, e)
        }
    };
    $.prototype.commitLayers = function() {};
    $.prototype.commitLinks = function() { for (var a = this.network.edges.j; a.next();) a.value.commit() };
    $.prototype.aC = function() {
        for (var a = this.Jd.j; a.next();) {
            var b = a.value;
            b instanceof xv && dx(this, b)
        }
    };

    function dx(a, b) {
        if (null !== b) {
            v && D.l(b, xv, $, "setPortSpotsTree:v");
            a.setPortSpots(b);
            for (var c = b.children, d = c.length, e = 0; e < d; e++) dx(a, c[e])
        }
    }
    $.prototype.setPortSpots = function(a) {
        v && D.l(a, xv, $, "setPortSpots:v");
        var b = a.alignment;
        if (Uv(b)) {
            v && D.l(a, xv, $, "setPortSpotsBus:v");
            v && D.l(b, ya, $, "setPortSpots:align");
            var c = this.Wf === tv,
                d = cw(a),
                e;
            switch (d) {
                case 0:
                    e = fd;
                    break;
                case 90:
                    e = gd;
                    break;
                case 180:
                    e = ed;
                    break;
                default:
                    e = $c
            }
            var g = a.children,
                h = g.length;
            switch (b) {
                case Vv:
                case Kv:
                    for (b = 0; b < h; b++) {
                        var k = g[b],
                            k = (c ? k.wc : k.tc).first();
                        if (null !== k && (k = k.link, null !== k)) {
                            var l = 90 === d || 270 === d ? ed : $c;
                            if (1 === h || b === h - 1 && 1 === h % 2) switch (d) {
                                case 0:
                                    l = ed;
                                    break;
                                case 90:
                                    l =
                                        $c;
                                    break;
                                case 180:
                                    l = fd;
                                    break;
                                default:
                                    l = gd
                            } else 0 === b % 2 && (l = 90 === d || 270 === d ? fd : gd);
                            c ? (a.setsPortSpot && (k.Gb = e), a.setsChildPortSpot && (k.Hb = l)) : (a.setsPortSpot && (k.Gb = l), a.setsChildPortSpot && (k.Hb = e))
                        }
                    }
                    break;
                case Wv:
                    l = 90 === d || 270 === d ? fd : gd;
                    for (d = c ? a.tc : a.wc; d.next();) k = d.value.link, null !== k && (c ? (a.setsPortSpot && (k.Gb = e), a.setsChildPortSpot && (k.Hb = l)) : (a.setsPortSpot && (k.Gb = l), a.setsChildPortSpot && (k.Hb = e)));
                    break;
                case Xv:
                    for (l = 90 === d || 270 === d ? ed : $c, d = c ? a.tc : a.wc; d.next();) k = d.value.link, null !== k && (c ?
                        (a.setsPortSpot && (k.Gb = e), a.setsChildPortSpot && (k.Hb = l)) : (a.setsPortSpot && (k.Gb = l), a.setsChildPortSpot && (k.Hb = e)))
            }
        } else if (c = cw(a), this.Wf === tv)
            for (e = a.tc; e.next();) {
                if (d = e.value.link, null !== d) {
                    if (a.setsPortSpot)
                        if (a.portSpot.ld()) switch (c) {
                            case 0:
                                d.Gb = fd;
                                break;
                            case 90:
                                d.Gb = gd;
                                break;
                            case 180:
                                d.Gb = ed;
                                break;
                            default:
                                d.Gb = $c
                        } else d.Gb = a.portSpot;
                    if (a.setsChildPortSpot)
                        if (a.childPortSpot.ld()) switch (c) {
                            case 0:
                                d.Hb = ed;
                                break;
                            case 90:
                                d.Hb = $c;
                                break;
                            case 180:
                                d.Hb = fd;
                                break;
                            default:
                                d.Hb = gd
                        } else d.Hb = a.childPortSpot
                }
            } else
                for (e =
                    a.wc; e.next();)
                    if (d = e.value.link, null !== d) {
                        if (a.setsPortSpot)
                            if (a.portSpot.ld()) switch (c) {
                                case 0:
                                    d.Hb = fd;
                                    break;
                                case 90:
                                    d.Hb = gd;
                                    break;
                                case 180:
                                    d.Hb = ed;
                                    break;
                                default:
                                    d.Hb = $c
                            } else d.Hb = a.portSpot;
                        if (a.setsChildPortSpot)
                            if (a.childPortSpot.ld()) switch (c) {
                                case 0:
                                    d.Gb = ed;
                                    break;
                                case 90:
                                    d.Gb = $c;
                                    break;
                                case 180:
                                    d.Gb = fd;
                                    break;
                                default:
                                    d.Gb = gd
                            } else d.Gb = a.childPortSpot
                    }
    };

    function cw(a) { a = a.angle; return 45 >= a ? 0 : 135 >= a ? 90 : 225 >= a ? 180 : 315 >= a ? 270 : 0 }

    function fw(a) {
        v && D.l(a, xv, $, "computeLayerSpacing:v");
        var b = cw(a),
            b = 90 === b || 270 === b,
            c = a.layerSpacing;
        if (0 < a.layerSpacingParentOverlap) var d = Math.min(1, a.layerSpacingParentOverlap),
            c = c - (b ? a.height * d : a.width * d);
        c < (b ? -a.height : -a.width) && (c = b ? -a.height : -a.width);
        return c
    }

    function gw(a) {
        v && D.l(a, xv, $, "computeNodeIndent:v");
        var b = cw(a),
            b = 90 === b || 270 === b,
            c = a.nodeIndent;
        if (0 < a.nodeIndentPastParent) var d = Math.min(1, a.nodeIndentPastParent),
            c = c + (b ? a.width * d : a.height * d);
        return c = Math.max(0, c)
    }
    D.defineProperty($, { DM: "roots" }, function() { return this.Jd }, function(a) { this.Jd !== a && (D.l(a, L, $, "roots"), this.Jd = a, this.L()) });
    D.defineProperty($, { path: "path" }, function() { return this.gt }, function(a) { this.gt !== a && (D.Da(a, $, $, "path"), this.gt = a, this.L()) });
    D.defineProperty($, { HK: "treeStyle" }, function() { return this.Wt }, function(a) { this.Bd !== a && (D.Da(a, $, $, "treeStyle"), a === uv || a === Nv || a === Ov || a === Mv) && (this.Wt = a, this.L()) });
    D.defineProperty($, { vB: "layerStyle" }, function() { return this.yw }, function(a) { this.Bd !== a && (D.Da(a, $, $, "layerStyle"), a === vv || a === Iv || a === Hv) && (this.yw = a, this.L()) });
    D.defineProperty($, { comments: "comments" }, function() { return this.bi }, function(a) { this.bi !== a && (D.h(a, "boolean", $, "comments"), this.bi = a, this.L()) });
    D.defineProperty($, { eg: "arrangement" }, function() { return this.Bd }, function(a) { this.Bd !== a && (D.Da(a, $, $, "arrangement"), a === wv || a === cx || a === zv) && (this.Bd = a, this.L()) });
    D.defineProperty($, { bF: "arrangementSpacing" }, function() { return this.xg }, function(a) {
        D.l(a, Ca, $, "arrangementSpacing");
        this.xg.O(a) || (this.xg.assign(a), this.L())
    });
    D.defineProperty($, { CM: "rootDefaults" }, function() { return this.Aa }, function(a) { this.Aa !== a && (D.l(a, xv, $, "rootDefaults"), this.Aa = a, this.L()) });
    D.defineProperty($, { $K: "alternateDefaults" }, function() { return this.Ba }, function(a) { this.Ba !== a && (D.l(a, xv, $, "alternateDefaults"), this.Ba = a, this.L()) });
    D.defineProperty($, { sorting: "sorting" }, function() { return this.Aa.sorting }, function(a) { this.Aa.sorting !== a && (D.Da(a, $, $, "sorting"), a === Pv || a === Qv || a === Rv || Sv) && (this.Aa.sorting = a, this.L()) });
    D.defineProperty($, { comparer: "comparer" }, function() { return this.Aa.comparer }, function(a) { this.Aa.comparer !== a && (D.h(a, "function", $, "comparer"), this.Aa.comparer = a, this.L()) });
    D.defineProperty($, { angle: "angle" }, function() { return this.Aa.angle }, function(a) { this.Aa.angle !== a && (D.h(a, "number", $, "angle"), 0 === a || 90 === a || 180 === a || 270 === a ? (this.Aa.angle = a, this.L()) : D.k("TreeLayout.angle must be 0, 90, 180, or 270")) });
    D.defineProperty($, { alignment: "alignment" }, function() { return this.Aa.alignment }, function(a) { this.Aa.alignment !== a && (D.Da(a, $, $, "alignment"), this.Aa.alignment = a, this.L()) });
    D.defineProperty($, { nodeIndent: "nodeIndent" }, function() { return this.Aa.nodeIndent }, function(a) { this.Aa.nodeIndent !== a && (D.h(a, "number", $, "nodeIndent"), 0 <= a && (this.Aa.nodeIndent = a, this.L())) });
    D.defineProperty($, { nodeIndentPastParent: "nodeIndentPastParent" }, function() { return this.Aa.nodeIndentPastParent }, function(a) { this.Aa.nodeIndentPastParent !== a && (D.h(a, "number", $, "nodeIndentPastParent"), 0 <= a && 1 >= a && (this.Aa.nodeIndentPastParent = a, this.L())) });
    D.defineProperty($, { nodeSpacing: "nodeSpacing" }, function() { return this.Aa.nodeSpacing }, function(a) { this.Aa.nodeSpacing !== a && (D.h(a, "number", $, "nodeSpacing"), this.Aa.nodeSpacing = a, this.L()) });
    D.defineProperty($, { layerSpacing: "layerSpacing" }, function() { return this.Aa.layerSpacing }, function(a) { this.Aa.layerSpacing !== a && (D.h(a, "number", $, "layerSpacing"), this.Aa.layerSpacing = a, this.L()) });
    D.defineProperty($, { layerSpacingParentOverlap: "layerSpacingParentOverlap" }, function() { return this.Aa.layerSpacingParentOverlap }, function(a) { this.Aa.layerSpacingParentOverlap !== a && (D.h(a, "number", $, "layerSpacingParentOverlap"), 0 <= a && 1 >= a && (this.Aa.layerSpacingParentOverlap = a, this.L())) });
    D.defineProperty($, { compaction: "compaction" }, function() { return this.Aa.compaction }, function(a) { this.Aa.compaction !== a && (D.Da(a, $, $, "compaction"), a === $v || a === bw) && (this.Aa.compaction = a, this.L()) });
    D.defineProperty($, { breadthLimit: "breadthLimit" }, function() { return this.Aa.breadthLimit }, function(a) { this.Aa.breadthLimit !== a && (D.h(a, "number", $, "breadthLimit"), 0 <= a && (this.Aa.breadthLimit = a, this.L())) });
    D.defineProperty($, { rowSpacing: "rowSpacing" }, function() { return this.Aa.rowSpacing }, function(a) { this.Aa.rowSpacing !== a && (D.h(a, "number", $, "rowSpacing"), this.Aa.rowSpacing = a, this.L()) });
    D.defineProperty($, { rowIndent: "rowIndent" }, function() { return this.Aa.rowIndent }, function(a) { this.Aa.rowIndent !== a && (D.h(a, "number", $, "rowIndent"), 0 <= a && (this.Aa.rowIndent = a, this.L())) });
    D.defineProperty($, { commentSpacing: "commentSpacing" }, function() { return this.Aa.commentSpacing }, function(a) { this.Aa.commentSpacing !== a && (D.h(a, "number", $, "commentSpacing"), this.Aa.commentSpacing = a, this.L()) });
    D.defineProperty($, { commentMargin: "commentMargin" }, function() { return this.Aa.commentMargin }, function(a) { this.Aa.commentMargin !== a && (D.h(a, "number", $, "commentMargin"), this.Aa.commentMargin = a, this.L()) });
    D.defineProperty($, { setsPortSpot: "setsPortSpot" }, function() { return this.Aa.setsPortSpot }, function(a) { this.Aa.setsPortSpot !== a && (D.h(a, "boolean", $, "setsPortSpot"), this.Aa.setsPortSpot = a, this.L()) });
    D.defineProperty($, { portSpot: "portSpot" }, function() { return this.Aa.portSpot }, function(a) {
        D.l(a, S, $, "portSpot");
        this.Aa.portSpot.O(a) || (this.Aa.portSpot = a, this.L())
    });
    D.defineProperty($, { setsChildPortSpot: "setsChildPortSpot" }, function() { return this.Aa.setsChildPortSpot }, function(a) { this.Aa.setsChildPortSpot !== a && (D.h(a, "boolean", $, "setsChildPortSpot"), this.Aa.setsChildPortSpot = a, this.L()) });
    D.defineProperty($, { childPortSpot: "childPortSpot" }, function() { return this.Aa.childPortSpot }, function(a) {
        D.l(a, S, $, "childPortSpot");
        this.Aa.childPortSpot.O(a) || (this.Aa.childPortSpot = a, this.L())
    });
    D.defineProperty($, { kL: "alternateSorting" }, function() { return this.Ba.sorting }, function(a) { this.Ba.sorting !== a && (D.Da(a, $, $, "alternateSorting"), a === Pv || a === Qv || a === Rv || Sv) && (this.Ba.sorting = a, this.L()) });
    D.defineProperty($, { ZK: "alternateComparer" }, function() { return this.Ba.comparer }, function(a) { this.Ba.comparer !== a && (D.h(a, "function", $, "alternateComparer"), this.Ba.comparer = a, this.L()) });
    D.defineProperty($, { TK: "alternateAngle" }, function() { return this.Ba.angle }, function(a) { this.Ba.angle !== a && (D.h(a, "number", $, "alternateAngle"), 0 === a || 90 === a || 180 === a || 270 === a) && (this.Ba.angle = a, this.L()) });
    D.defineProperty($, { SK: "alternateAlignment" }, function() { return this.Ba.alignment }, function(a) { this.Ba.alignment !== a && (D.Da(a, $, $, "alternateAlignment"), this.Ba.alignment = a, this.L()) });
    D.defineProperty($, { cL: "alternateNodeIndent" }, function() { return this.Ba.nodeIndent }, function(a) { this.Ba.nodeIndent !== a && (D.h(a, "number", $, "alternateNodeIndent"), 0 <= a && (this.Ba.nodeIndent = a, this.L())) });
    D.defineProperty($, { dL: "alternateNodeIndentPastParent" }, function() { return this.Ba.nodeIndentPastParent }, function(a) { this.Ba.nodeIndentPastParent !== a && (D.h(a, "number", $, "alternateNodeIndentPastParent"), 0 <= a && 1 >= a && (this.Ba.nodeIndentPastParent = a, this.L())) });
    D.defineProperty($, { eL: "alternateNodeSpacing" }, function() { return this.Ba.nodeSpacing }, function(a) { this.Ba.nodeSpacing !== a && (D.h(a, "number", $, "alternateNodeSpacing"), this.Ba.nodeSpacing = a, this.L()) });
    D.defineProperty($, { aL: "alternateLayerSpacing" }, function() { return this.Ba.layerSpacing }, function(a) { this.Ba.layerSpacing !== a && (D.h(a, "number", $, "alternateLayerSpacing"), this.Ba.layerSpacing = a, this.L()) });
    D.defineProperty($, { bL: "alternateLayerSpacingParentOverlap" }, function() { return this.Ba.layerSpacingParentOverlap }, function(a) { this.Ba.layerSpacingParentOverlap !== a && (D.h(a, "number", $, "alternateLayerSpacingParentOverlap"), 0 <= a && 1 >= a && (this.Ba.layerSpacingParentOverlap = a, this.L())) });
    D.defineProperty($, { YK: "alternateCompaction" }, function() { return this.Ba.compaction }, function(a) { this.Ba.compaction !== a && (D.Da(a, $, $, "alternateCompaction"), a === $v || a === bw) && (this.Ba.compaction = a, this.L()) });
    D.defineProperty($, { UK: "alternateBreadthLimit" }, function() { return this.Ba.breadthLimit }, function(a) { this.Ba.breadthLimit !== a && (D.h(a, "number", $, "alternateBreadthLimit"), 0 <= a && (this.Ba.breadthLimit = a, this.L())) });
    D.defineProperty($, { hL: "alternateRowSpacing" }, function() { return this.Ba.rowSpacing }, function(a) { this.Ba.rowSpacing !== a && (D.h(a, "number", $, "alternateRowSpacing"), this.Ba.rowSpacing = a, this.L()) });
    D.defineProperty($, { gL: "alternateRowIndent" }, function() { return this.Ba.rowIndent }, function(a) { this.Ba.rowIndent !== a && (D.h(a, "number", $, "alternateRowIndent"), 0 <= a && (this.Ba.rowIndent = a, this.L())) });
    D.defineProperty($, { XK: "alternateCommentSpacing" }, function() { return this.Ba.commentSpacing }, function(a) { this.Ba.commentSpacing !== a && (D.h(a, "number", $, "alternateCommentSpacing"), this.Ba.commentSpacing = a, this.L()) });
    D.defineProperty($, { WK: "alternateCommentMargin" }, function() { return this.Ba.commentMargin }, function(a) { this.Ba.commentMargin !== a && (D.h(a, "number", $, "alternateCommentMargin"), this.Ba.commentMargin = a, this.L()) });
    D.defineProperty($, { jL: "alternateSetsPortSpot" }, function() { return this.Ba.setsPortSpot }, function(a) { this.Ba.setsPortSpot !== a && (D.h(a, "boolean", $, "alternateSetsPortSpot"), this.Ba.setsPortSpot = a, this.L()) });
    D.defineProperty($, { fL: "alternatePortSpot" }, function() { return this.Ba.portSpot }, function(a) {
        D.l(a, S, $, "alternatePortSpot");
        this.Ba.portSpot.O(a) || (this.Ba.portSpot = a, this.L())
    });
    D.defineProperty($, { iL: "alternateSetsChildPortSpot" }, function() { return this.Ba.setsChildPortSpot }, function(a) { this.Ba.setsChildPortSpot !== a && (D.h(a, "boolean", $, "alternateSetsChildPortSpot"), this.Ba.setsChildPortSpot = a, this.L()) });
    D.defineProperty($, { VK: "alternateChildPortSpot" }, function() { return this.Ba.childPortSpot }, function(a) {
        D.l(a, S, $, "alternateChildPortSpot");
        this.Ba.childPortSpot.O(a) || (this.Ba.childPortSpot = a, this.L())
    });
    var sv;
    $.PathDefault = sv = D.s($, "PathDefault", -1);
    var tv;
    $.PathDestination = tv = D.s($, "PathDestination", 0);
    var Av;
    $.PathSource = Av = D.s($, "PathSource", 1);
    var Pv;
    $.SortingForwards = Pv = D.s($, "SortingForwards", 10);
    var Qv;
    $.SortingReverse = Qv = D.s($, "SortingReverse", 11);
    var Rv;
    $.SortingAscending = Rv = D.s($, "SortingAscending", 12);
    var Sv;
    $.SortingDescending = Sv = D.s($, "SortingDescending", 13);
    var Uw;
    $.AlignmentCenterSubtrees = Uw = D.s($, "AlignmentCenterSubtrees", 20);
    var Tv;
    $.AlignmentCenterChildren = Tv = D.s($, "AlignmentCenterChildren", 21);
    var dw;
    $.AlignmentStart = dw = D.s($, "AlignmentStart", 22);
    var ew;
    $.AlignmentEnd = ew = D.s($, "AlignmentEnd", 23);
    var Vv;
    $.AlignmentBus = Vv = D.s($, "AlignmentBus", 24);
    var Kv;
    $.AlignmentBusBranching = Kv = D.s($, "AlignmentBusBranching", 25);
    var Wv;
    $.AlignmentTopLeftBus = Wv = D.s($, "AlignmentTopLeftBus", 26);
    var Xv;
    $.AlignmentBottomRightBus = Xv = D.s($, "AlignmentBottomRightBus", 27);
    var $v;
    $.CompactionNone = $v = D.s($, "CompactionNone", 30);
    var bw;
    $.CompactionBlock = bw = D.s($, "CompactionBlock", 31);
    var uv;
    $.StyleLayered = uv = D.s($, "StyleLayered", 40);
    var Ov;
    $.StyleLastParents = Ov = D.s($, "StyleLastParents", 41);
    var Nv;
    $.StyleAlternating = Nv = D.s($, "StyleAlternating", 42);
    var Mv;
    $.StyleRootOnly = Mv = D.s($, "StyleRootOnly", 43);
    var wv;
    $.ArrangementVertical = wv = D.s($, "ArrangementVertical", 50);
    var cx;
    $.ArrangementHorizontal = cx = D.s($, "ArrangementHorizontal", 51);
    var zv;
    $.ArrangementFixedRoots = zv = D.s($, "ArrangementFixedRoots", 52);
    var vv;
    $.LayerIndividual = vv = D.s($, "LayerIndividual", 60);
    var Iv;
    $.LayerSiblings = Iv = D.s($, "LayerSiblings", 61);
    var Hv;
    $.LayerUniform = Hv = D.s($, "LayerUniform", 62);

    function yv() { ua.call(this) }
    D.Ta(yv, ua);
    D.ka("TreeNetwork", yv);
    yv.prototype.createVertex = function() { return new xv };
    yv.prototype.createEdge = function() { return new ex };

    function xv() {
        va.call(this);
        this.initialized = !1;
        this.parent = null;
        this.children = [];
        this.maxGenerationCount = this.maxChildrenCount = this.descendantCount = this.level = 0;
        this.comments = null;
        this.sa = new N(0, 0);
        this.tb = new Ca(0, 0);
        this.Wa = new N(0, 0);
        this.Sq = this.Rq = this.lK = !1;
        this.kv = this.Ru = null;
        this.sorting = Pv;
        this.comparer = ys;
        this.angle = 0;
        this.alignment = Tv;
        this.nodeIndentPastParent = this.nodeIndent = 0;
        this.nodeSpacing = 20;
        this.layerSpacing = 50;
        this.layerSpacingParentOverlap = 0;
        this.compaction = bw;
        this.breadthLimit =
            0;
        this.rowSpacing = 25;
        this.commentSpacing = this.rowIndent = 10;
        this.commentMargin = 20;
        this.setsPortSpot = !0;
        this.portSpot = Vc;
        this.setsChildPortSpot = !0;
        this.childPortSpot = Vc
    }
    D.Ta(xv, va);
    D.ka("TreeVertex", xv);
    xv.prototype.copyInheritedPropertiesFrom = function(a) {
        null !== a && (this.sorting = a.sorting, this.comparer = a.comparer, this.angle = a.angle, this.alignment = a.alignment, this.nodeIndent = a.nodeIndent, this.nodeIndentPastParent = a.nodeIndentPastParent, this.nodeSpacing = a.nodeSpacing, this.layerSpacing = a.layerSpacing, this.layerSpacingParentOverlap = a.layerSpacingParentOverlap, this.compaction = a.compaction, this.breadthLimit = a.breadthLimit, this.rowSpacing = a.rowSpacing, this.rowIndent = a.rowIndent, this.commentSpacing = a.commentSpacing,
            this.commentMargin = a.commentMargin, this.setsPortSpot = a.setsPortSpot, this.portSpot = a.portSpot, this.setsChildPortSpot = a.setsChildPortSpot, this.childPortSpot = a.childPortSpot)
    };
    D.w(xv, { Gn: "childrenCount" }, function() { return this.children.length });
    D.defineProperty(xv, { BM: "relativePosition" }, function() { return this.sa }, function(a) { this.sa.set(a) });
    D.defineProperty(xv, { OM: "subtreeSize" }, function() { return this.tb }, function(a) { this.tb.set(a) });
    D.defineProperty(xv, { NM: "subtreeOffset" }, function() { return this.Wa }, function(a) { this.Wa.set(a) });

    function ex() {
        wa.call(this);
        this.nt = new N(0, 0)
    }
    D.Ta(ex, wa);
    D.ka("TreeEdge", ex);
    ex.prototype.commit = function() {
        var a = this.link;
        if (null !== a && !a.Nj) {
            var b = this.network.Yb,
                c = null,
                d = null;
            switch (b.Wf) {
                case tv:
                    c = this.fromVertex;
                    d = this.toVertex;
                    break;
                case Av:
                    c = this.toVertex;
                    d = this.fromVertex;
                    break;
                default:
                    D.k("Unhandled path value " + b.Wf.toString())
            }
            if (null !== c && null !== d)
                if (b = this.nt, 0 !== b.x || 0 !== b.y || c.lK) {
                    var d = c.pb,
                        e = cw(c),
                        g = fw(c),
                        h = c.rowSpacing;
                    a.zo();
                    var k = a.jf === Uj,
                        l = a.ic,
                        m = 0,
                        n, p;
                    a.Dm();
                    if (l || k) {
                        for (m = 2; 4 < a.ta;) a.KG(2);
                        n = a.m(1);
                        p = a.m(2)
                    } else {
                        for (m = 1; 3 < a.ta;) a.KG(1);
                        n = a.m(0);
                        p =
                            a.m(a.ta - 1)
                    }
                    var q = a.m(a.ta - 1),
                        r = 0;
                    0 === e ? (c.alignment === ew ? (r = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (r = Math.min(r, Math.max(n.y, r - gw(c))))) : c.alignment === dw ? (r = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (r = Math.max(r, Math.min(n.y, r + gw(c))))) : r = c.Rq || c.Sq && 1 === c.maxGenerationCount ? d.top - c.Wa.y + b.y : d.y + d.height / 2 + b.y, k ? (a.B(m, n.x, r), m++, a.B(m, d.right + g, r), m++, a.B(m, d.right + g + (b.x - h) / 3, r), m++, a.B(m, d.right + g + 2 * (b.x - h) / 3, r), m++, a.B(m, d.right + g + (b.x - h), r), m++, a.B(m, p.x, r)) : (l && (a.B(m, d.right + g / 2, n.y),
                        m++), a.B(m, d.right + g / 2, r), m++, a.B(m, d.right + g + b.x - (l ? h / 2 : h), r), m++, l && a.B(m, a.m(m - 1).x, p.y))) : 90 === e ? (c.alignment === ew ? (r = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (r = Math.min(r, Math.max(n.x, r - gw(c))))) : c.alignment === dw ? (r = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (r = Math.max(r, Math.min(n.x, r + gw(c))))) : r = c.Rq || c.Sq && 1 === c.maxGenerationCount ? d.left - c.Wa.x + b.x : d.x + d.width / 2 + b.x, k ? (a.B(m, r, n.y), m++, a.B(m, r, d.bottom + g), m++, a.B(m, r, d.bottom + g + (b.y - h) / 3), m++, a.B(m, r, d.bottom + g + 2 * (b.y - h) / 3), m++, a.B(m, r, d.bottom +
                        g + (b.y - h)), m++, a.B(m, r, p.y)) : (l && (a.B(m, n.x, d.bottom + g / 2), m++), a.B(m, r, d.bottom + g / 2), m++, a.B(m, r, d.bottom + g + b.y - (l ? h / 2 : h)), m++, l && a.B(m, p.x, a.m(m - 1).y))) : 180 === e ? (c.alignment === ew ? (r = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (r = Math.min(r, Math.max(n.y, r - gw(c))))) : c.alignment === dw ? (r = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (r = Math.max(r, Math.min(n.y, r + gw(c))))) : r = c.Rq || c.Sq && 1 === c.maxGenerationCount ? d.top - c.Wa.y + b.y : d.y + d.height / 2 + b.y, k ? (a.B(m, n.x, r), m++, a.B(m, d.left - g, r), m++, a.B(m, d.left - g + (b.x +
                        h) / 3, r), m++, a.B(m, d.left - g + 2 * (b.x + h) / 3, r), m++, a.B(m, d.left - g + (b.x + h), r), m++, a.B(m, p.x, r)) : (l && (a.B(m, d.left - g / 2, n.y), m++), a.B(m, d.left - g / 2, r), m++, a.B(m, d.left - g + b.x + (l ? h / 2 : h), r), m++, l && a.B(m, a.m(m - 1).x, p.y))) : 270 === e ? (c.alignment === ew ? (r = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (r = Math.min(r, Math.max(n.x, r - gw(c))))) : c.alignment === dw ? (r = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (r = Math.max(r, Math.min(n.x, r + gw(c))))) : r = c.Rq || c.Sq && 1 === c.maxGenerationCount ? d.left - c.Wa.x + b.x : d.x + d.width / 2 + b.x, k ? (a.B(m,
                        r, n.y), m++, a.B(m, r, d.top - g), m++, a.B(m, r, d.top - g + (b.y + h) / 3), m++, a.B(m, r, d.top - g + 2 * (b.y + h) / 3), m++, a.B(m, r, d.top - g + (b.y + h)), m++, a.B(m, r, p.y)) : (l && (a.B(m, n.x, d.top - g / 2), m++), a.B(m, r, d.top - g / 2), m++, a.B(m, r, d.top - g + b.y + (l ? h / 2 : h)), m++, l && a.B(m, p.x, a.m(m - 1).y))) : D.k("Invalid angle " + e);
                    a.Ej()
                } else e = c, g = d, v && D.l(e, xv, ex, "adjustRouteForAngleChange:parent"), v && D.l(g, xv, ex, "adjustRouteForAngleChange:child"), a = this.link, c = cw(e), c !== cw(g) && (b = fw(e), d = e.pb, e = g.pb, 0 === c && e.left - d.right < b + 1 || 90 === c && e.top - d.bottom <
                    b + 1 || 180 === c && d.left - e.right < b + 1 || 270 === c && d.top - e.bottom < b + 1 || (a.zo(), e = a.jf === Uj, g = a.ic, h = Uv(this.fromVertex.alignment), a.Dm(), 0 === c ? (c = d.right + b / 2, e ? 4 === a.ta && (b = a.m(3).y, a.ia(1, c - 20, a.m(1).y), a.B(2, c - 20, b), a.B(3, c, b), a.B(4, c + 20, b), a.ia(5, a.m(5).x, b)) : g ? h ? a.ia(3, a.m(2).x, a.m(4).y) : 6 === a.ta && (a.ia(2, c, a.m(2).y), a.ia(3, c, a.m(3).y)) : 4 === a.ta ? a.B(2, c, a.m(2).y) : 3 === a.ta ? a.ia(1, c, a.m(2).y) : 2 === a.ta && a.B(1, c, a.m(1).y)) : 90 === c ? (b = d.bottom + b / 2, e ? 4 === a.ta && (c = a.m(3).x, a.ia(1, a.m(1).x, b - 20), a.B(2, c, b - 20),
                            a.B(3, c, b), a.B(4, c, b + 20), a.ia(5, c, a.m(5).y)) : g ? h ? a.ia(3, a.m(2).x, a.m(4).y) : 6 === a.ta && (a.ia(2, a.m(2).x, b), a.ia(3, a.m(3).x, b)) : 4 === a.ta ? a.B(2, a.m(2).x, b) : 3 === a.ta ? a.ia(1, a.m(2).x, b) : 2 === a.ta && a.B(1, a.m(1).x, b)) : 180 === c ? (c = d.left - b / 2, e ? 4 === a.ta && (b = a.m(3).y, a.ia(1, c + 20, a.m(1).y), a.B(2, c + 20, b), a.B(3, c, b), a.B(4, c - 20, b), a.ia(5, a.m(5).x, b)) : g ? h ? a.ia(3, a.m(2).x, a.m(4).y) : 6 === a.ta && (a.ia(2, c, a.m(2).y), a.ia(3, c, a.m(3).y)) : 4 === a.ta ? a.B(2, c, a.m(2).y) : 3 === a.ta ? a.ia(1, c, a.m(2).y) : 2 === a.ta && a.B(1, c, a.m(1).y)) : 270 ===
                        c && (b = d.top - b / 2, e ? 4 === a.ta && (c = a.m(3).x, a.ia(1, a.m(1).x, b + 20), a.B(2, c, b + 20), a.B(3, c, b), a.B(4, c, b - 20), a.ia(5, c, a.m(5).y)) : g ? h ? a.ia(3, a.m(2).x, a.m(4).y) : 6 === a.ta && (a.ia(2, a.m(2).x, b), a.ia(3, a.m(3).x, b)) : 4 === a.ta ? a.B(2, a.m(2).x, b) : 3 === a.ta ? a.ia(1, a.m(2).x, b) : 2 === a.ta && a.B(1, a.m(1).x, b)), a.Ej()))
        }
    };
    D.defineProperty(ex, { AM: "relativePoint" }, function() { return this.nt }, function(a) { this.nt.set(a) });

    function fx() {
        O.call(this);
        this.af = null
    }
    D.Ta(fx, O);
    fx.prototype.cloneProtected = function(a) {
        O.prototype.cloneProtected.call(this, a);
        a.element = this.af.cloneNode(!0)
    };
    fx.prototype.toString = function() { return "HTMLHost(" + this.af.toString() + ")#" + D.Nd(this) };
    fx.prototype.Wk = function(a, b) {
        var c = this.af;
        if (null !== c) {
            var d = this.fb(mc);
            d.x -= this.aa.width / 2;
            d.y -= this.aa.height / 2;
            d.x -= this.aa.x;
            d.y -= this.aa.y;
            var d = b.pC(d),
                e = b.Hj;
            null === e || e.contains(c) || e.appendChild(c);
            e = this.transform;
            c.style.transform = "matrix(" + e.m11 + "," + e.m12 + "," + e.m21 + "," + e.m22 + "," + e.dx + "," + e.dy + ")";
            c.style.transformOrigin = "0 0";
            e = d.y;
            c.style.left = d.x + "px";
            c.style.top = e + "px"
        }
    };
    fx.prototype.ho = function(a, b, c, d) {
        var e = this.Ea;
        isFinite(e.width) && (a = e.width);
        isFinite(e.height) && (b = e.height);
        var e = this.pf,
            g = this.ah;
        c = Math.max(c, g.width);
        d = Math.max(d, g.height);
        a = Math.min(e.width, a);
        b = Math.min(e.height, b);
        a = Math.max(c, a);
        b = Math.max(d, b);
        c = this.af;
        null !== c && (b = c.getBoundingClientRect(), a = b.width, b = b.height);
        Cb(this.fd, a, b);
        Jo(this, 0, 0, a, b)
    };
    fx.prototype.Cj = function(a, b, c, d) { Oo(this, a, b, c, d) };
    D.w(fx, { Ga: "naturalBounds" }, function() { return this.fd });
    D.defineProperty(fx, { element: "element" }, function() { return this.af }, function(a) {
        var b = this.af;
        b !== a && (a instanceof HTMLElement || D.k("HTMLHost.element must be an instance of Element."), this.af = a, a.className = "HTMLHost", this.i("element", b, a), this.ra())
    });
    ba.version = "1.8.13";
    window && (window.module && "object" === typeof window.module && "object" === typeof window.module.exports ? window.module.exports = ba : window.define && "function" === typeof window.define && window.define.amd ? (window.go = ba, window.define(ba)) : window.go = ba);
    "undefined" !== typeof module && "object" === typeof module.exports && (module.exports = ba);
})(window);