Welcome to mirror list, hosted at ThFree Co, Russian Federation.

viewer.min.js « js « webapp « main « src - github.com/jgraph/drawio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6bedbecfbe84973795818250817d4c3032be8f45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
window.PROXY_URL=window.PROXY_URL||"https://viewer.diagrams.net/proxy";window.SHAPES_PATH=window.SHAPES_PATH||"https://viewer.diagrams.net/shapes";window.STENCIL_PATH=window.STENCIL_PATH||"https://viewer.diagrams.net/stencils";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"https://viewer.diagrams.net/img";window.mxImageBasePath=window.mxImageBasePath||"https://viewer.diagrams.net/mxgraph/images";window.mxBasePath=window.mxBasePath||"https://viewer.diagrams.net/mxgraph/";
window.mxLoadStylesheets=window.mxLoadStylesheets||!1;
//fgnass.github.com/spin.js#v2.0.0
!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(b&&(b.insertBefore(f,b.firstChild||null),e(f,{left:d.left,top:d.top})),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h});
/*! @license DOMPurify 2.3.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.6/LICENSE */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,n){return(t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,o,a){return(r=n()?Reflect.construct:function(e,n,r){var o=[null];o.push.apply(o,n);var a=new(Function.bind.apply(e,o));return r&&t(a,r.prototype),a}).apply(null,arguments)}function o(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var i=Object.hasOwnProperty,l=Object.setPrototypeOf,c=Object.isFrozen,u=Object.getPrototypeOf,s=Object.getOwnPropertyDescriptor,m=Object.freeze,f=Object.seal,p=Object.create,d="undefined"!=typeof Reflect&&Reflect,h=d.apply,g=d.construct;h||(h=function(e,t,n){return e.apply(t,n)}),m||(m=function(e){return e}),f||(f=function(e){return e}),g||(g=function(e,t){return r(e,o(t))});var y,b=_(Array.prototype.forEach),v=_(Array.prototype.pop),T=_(Array.prototype.push),N=_(String.prototype.toLowerCase),E=_(String.prototype.match),A=_(String.prototype.replace),w=_(String.prototype.indexOf),x=_(String.prototype.trim),S=_(RegExp.prototype.test),k=(y=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g(y,t)});function _(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return h(e,t,r)}}function O(e,t){l&&l(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=N(r);o!==r&&(c(t)||(t[n]=o),r=o)}e[r]=!0}return e}function D(e){var t,n=p(null);for(t in e)h(i,e,[t])&&(n[t]=e[t]);return n}function C(e,t){for(;null!==e;){var n=s(e,t);if(n){if(n.get)return _(n.get);if("function"==typeof n.value)return _(n.value)}e=u(e)}return function(e){return console.warn("fallback value for",e),null}}var M=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),R=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),L=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=m(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),F=m(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),H=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=m(["#text"]),z=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),B=m(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),j=m(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),P=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),G=f(/\{\{[\s\S]*|[\s\S]*\}\}/gm),W=f(/<%[\s\S]*|[\s\S]*%>/gm),q=f(/^data-[\-\w.\u00B7-\uFFFF]/),Y=f(/^aria-[\-\w]+$/),K=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=f(/^(?:\w+script|data):/i),$=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),X=f(/^html$/i),Z=function(){return"undefined"==typeof window?null:window},J=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,o="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(o)&&(r=n.currentScript.getAttribute(o));var a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+a+" could not be created."),null}};return function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Z(),r=function(e){return t(e)};if(r.version="2.3.6",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;var a=n.document,i=n.document,l=n.DocumentFragment,c=n.HTMLTemplateElement,u=n.Node,s=n.Element,f=n.NodeFilter,p=n.NamedNodeMap,d=void 0===p?n.NamedNodeMap||n.MozNamedAttrMap:p,h=n.HTMLFormElement,g=n.DOMParser,y=n.trustedTypes,_=s.prototype,Q=C(_,"cloneNode"),ee=C(_,"nextSibling"),te=C(_,"childNodes"),ne=C(_,"parentNode");if("function"==typeof c){var re=i.createElement("template");re.content&&re.content.ownerDocument&&(i=re.content.ownerDocument)}var oe=J(y,a),ae=oe?oe.createHTML(""):"",ie=i,le=ie.implementation,ce=ie.createNodeIterator,ue=ie.createDocumentFragment,se=ie.getElementsByTagName,me=a.importNode,fe={};try{fe=D(i).documentMode?i.documentMode:{}}catch(e){}var pe={};r.isSupported="function"==typeof ne&&le&&void 0!==le.createHTMLDocument&&9!==fe;var de,he,ge=G,ye=W,be=q,ve=Y,Te=V,Ne=$,Ee=K,Ae=null,we=O({},[].concat(o(M),o(R),o(L),o(F),o(U))),xe=null,Se=O({},[].concat(o(z),o(B),o(j),o(P))),ke=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,Oe=null,De=!0,Ce=!0,Me=!1,Re=!1,Le=!1,Ie=!1,Fe=!1,He=!1,Ue=!1,ze=!1,Be=!0,je=!0,Pe=!1,Ge={},We=null,qe=O({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ye=null,Ke=O({},["audio","video","img","source","image","track"]),Ve=null,$e=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",Ze="http://www.w3.org/2000/svg",Je="http://www.w3.org/1999/xhtml",Qe=Je,et=!1,tt=["application/xhtml+xml","text/html"],nt="text/html",rt=null,ot=i.createElement("form"),at=function(e){return e instanceof RegExp||e instanceof Function},it=function(t){rt&&rt===t||(t&&"object"===e(t)||(t={}),t=D(t),Ae="ALLOWED_TAGS"in t?O({},t.ALLOWED_TAGS):we,xe="ALLOWED_ATTR"in t?O({},t.ALLOWED_ATTR):Se,Ve="ADD_URI_SAFE_ATTR"in t?O(D($e),t.ADD_URI_SAFE_ATTR):$e,Ye="ADD_DATA_URI_TAGS"in t?O(D(Ke),t.ADD_DATA_URI_TAGS):Ke,We="FORBID_CONTENTS"in t?O({},t.FORBID_CONTENTS):qe,_e="FORBID_TAGS"in t?O({},t.FORBID_TAGS):{},Oe="FORBID_ATTR"in t?O({},t.FORBID_ATTR):{},Ge="USE_PROFILES"in t&&t.USE_PROFILES,De=!1!==t.ALLOW_ARIA_ATTR,Ce=!1!==t.ALLOW_DATA_ATTR,Me=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Re=t.SAFE_FOR_TEMPLATES||!1,Le=t.WHOLE_DOCUMENT||!1,He=t.RETURN_DOM||!1,Ue=t.RETURN_DOM_FRAGMENT||!1,ze=t.RETURN_TRUSTED_TYPE||!1,Fe=t.FORCE_BODY||!1,Be=!1!==t.SANITIZE_DOM,je=!1!==t.KEEP_CONTENT,Pe=t.IN_PLACE||!1,Ee=t.ALLOWED_URI_REGEXP||Ee,Qe=t.NAMESPACE||Je,t.CUSTOM_ELEMENT_HANDLING&&at(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ke.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&at(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ke.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ke.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),de=de=-1===tt.indexOf(t.PARSER_MEDIA_TYPE)?nt:t.PARSER_MEDIA_TYPE,he="application/xhtml+xml"===de?function(e){return e}:N,Re&&(Ce=!1),Ue&&(He=!0),Ge&&(Ae=O({},o(U)),xe=[],!0===Ge.html&&(O(Ae,M),O(xe,z)),!0===Ge.svg&&(O(Ae,R),O(xe,B),O(xe,P)),!0===Ge.svgFilters&&(O(Ae,L),O(xe,B),O(xe,P)),!0===Ge.mathMl&&(O(Ae,F),O(xe,j),O(xe,P))),t.ADD_TAGS&&(Ae===we&&(Ae=D(Ae)),O(Ae,t.ADD_TAGS)),t.ADD_ATTR&&(xe===Se&&(xe=D(xe)),O(xe,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&O(Ve,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&(We===qe&&(We=D(We)),O(We,t.FORBID_CONTENTS)),je&&(Ae["#text"]=!0),Le&&O(Ae,["html","head","body"]),Ae.table&&(O(Ae,["tbody"]),delete _e.tbody),m&&m(t),rt=t)},lt=O({},["mi","mo","mn","ms","mtext"]),ct=O({},["foreignobject","desc","title","annotation-xml"]),ut=O({},R);O(ut,L),O(ut,I);var st=O({},F);O(st,H);var mt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});var n=N(e.tagName),r=N(t.tagName);if(e.namespaceURI===Ze)return t.namespaceURI===Je?"svg"===n:t.namespaceURI===Xe?"svg"===n&&("annotation-xml"===r||lt[r]):Boolean(ut[n]);if(e.namespaceURI===Xe)return t.namespaceURI===Je?"math"===n:t.namespaceURI===Ze?"math"===n&&ct[r]:Boolean(st[n]);if(e.namespaceURI===Je){if(t.namespaceURI===Ze&&!ct[r])return!1;if(t.namespaceURI===Xe&&!lt[r])return!1;var o=O({},["title","style","font","a","script"]);return!st[n]&&(o[n]||!ut[n])}return!1},ft=function(e){T(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},pt=function(e,t){try{T(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){T(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(He||Ue)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},dt=function(e){var t,n;if(Fe)e="<remove></remove>"+e;else{var r=E(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===de&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var o=oe?oe.createHTML(e):e;if(Qe===Je)try{t=(new g).parseFromString(o,de)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(Qe,"template",null);try{t.documentElement.innerHTML=et?"":o}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),Qe===Je?se.call(t,Le?"html":"body")[0]:Le?t.documentElement:a},ht=function(e){return ce.call(e.ownerDocument||e,e,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT,null,!1)},gt=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},yt=function(t){return"object"===e(u)?t instanceof u:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},bt=function(e,t,n){pe[e]&&b(pe[e],(function(e){e.call(r,t,n,rt)}))},vt=function(e){var t;if(bt("beforeSanitizeElements",e,null),gt(e))return ft(e),!0;if(E(e.nodeName,/[\u0080-\uFFFF]/))return ft(e),!0;var n=he(e.nodeName);if(bt("uponSanitizeElement",e,{tagName:n,allowedTags:Ae}),!yt(e.firstElementChild)&&(!yt(e.content)||!yt(e.content.firstElementChild))&&S(/<[/\w]/g,e.innerHTML)&&S(/<[/\w]/g,e.textContent))return ft(e),!0;if("select"===n&&S(/<template/i,e.innerHTML))return ft(e),!0;if(!Ae[n]||_e[n]){if(!_e[n]&&Nt(n)){if(ke.tagNameCheck instanceof RegExp&&S(ke.tagNameCheck,n))return!1;if(ke.tagNameCheck instanceof Function&&ke.tagNameCheck(n))return!1}if(je&&!We[n]){var o=ne(e)||e.parentNode,a=te(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i)o.insertBefore(Q(a[i],!0),ee(e))}return ft(e),!0}return e instanceof s&&!mt(e)?(ft(e),!0):"noscript"!==n&&"noembed"!==n||!S(/<\/no(script|embed)/i,e.innerHTML)?(Re&&3===e.nodeType&&(t=e.textContent,t=A(t,ge," "),t=A(t,ye," "),e.textContent!==t&&(T(r.removed,{element:e.cloneNode()}),e.textContent=t)),bt("afterSanitizeElements",e,null),!1):(ft(e),!0)},Tt=function(e,t,n){if(Be&&("id"===t||"name"===t)&&(n in i||n in ot))return!1;if(Ce&&!Oe[t]&&S(be,t));else if(De&&S(ve,t));else if(!xe[t]||Oe[t]){if(!(Nt(e)&&(ke.tagNameCheck instanceof RegExp&&S(ke.tagNameCheck,e)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(e))&&(ke.attributeNameCheck instanceof RegExp&&S(ke.attributeNameCheck,t)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(t))||"is"===t&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&S(ke.tagNameCheck,n)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(n))))return!1}else if(Ve[t]);else if(S(Ee,A(n,Ne,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==w(n,"data:")||!Ye[e]){if(Me&&!S(Te,A(n,Ne,"")));else if(n)return!1}else;return!0},Nt=function(e){return e.indexOf("-")>0},Et=function(e){var t,n,o,a;bt("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(a=i.length;a--;){var c=t=i[a],u=c.name,s=c.namespaceURI;if(n="value"===u?t.value:x(t.value),o=he(u),l.attrName=o,l.attrValue=n,l.keepAttr=!0,l.forceKeepAttr=void 0,bt("uponSanitizeAttribute",e,l),n=l.attrValue,!l.forceKeepAttr&&(pt(u,e),l.keepAttr))if(S(/\/>/i,n))pt(u,e);else{Re&&(n=A(n,ge," "),n=A(n,ye," "));var m=he(e.nodeName);if(Tt(m,o,n))try{s?e.setAttributeNS(s,u,n):e.setAttribute(u,n),v(r.removed)}catch(e){}}}bt("afterSanitizeAttributes",e,null)}},At=function e(t){var n,r=ht(t);for(bt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)bt("uponSanitizeShadowNode",n,null),vt(n)||(n.content instanceof l&&e(n.content),Et(n));bt("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(t,o){var i,c,s,m,f;if((et=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!yt(t)){if("function"!=typeof t.toString)throw k("toString is not a function");if("string"!=typeof(t=t.toString()))throw k("dirty is not a string, aborting")}if(!r.isSupported){if("object"===e(n.toStaticHTML)||"function"==typeof n.toStaticHTML){if("string"==typeof t)return n.toStaticHTML(t);if(yt(t))return n.toStaticHTML(t.outerHTML)}return t}if(Ie||it(o),r.removed=[],"string"==typeof t&&(Pe=!1),Pe){if(t.nodeName){var p=he(t.nodeName);if(!Ae[p]||_e[p])throw k("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof u)1===(c=(i=dt("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===c.nodeName||"HTML"===c.nodeName?i=c:i.appendChild(c);else{if(!He&&!Re&&!Le&&-1===t.indexOf("<"))return oe&&ze?oe.createHTML(t):t;if(!(i=dt(t)))return He?null:ze?ae:""}i&&Fe&&ft(i.firstChild);for(var d=ht(Pe?t:i);s=d.nextNode();)3===s.nodeType&&s===m||vt(s)||(s.content instanceof l&&At(s.content),Et(s),m=s);if(m=null,Pe)return t;if(He){if(Ue)for(f=ue.call(i.ownerDocument);i.firstChild;)f.appendChild(i.firstChild);else f=i;return xe.shadowroot&&(f=me.call(a,f,!0)),f}var h=Le?i.outerHTML:i.innerHTML;return Le&&Ae["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&S(X,i.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+h),Re&&(h=A(h,ge," "),h=A(h,ye," ")),oe&&ze?oe.createHTML(h):h},r.setConfig=function(e){it(e),Ie=!0},r.clearConfig=function(){rt=null,Ie=!1},r.isValidAttribute=function(e,t,n){rt||it({});var r=he(e),o=he(t);return Tt(r,o,n)},r.addHook=function(e,t){"function"==typeof t&&(pe[e]=pe[e]||[],T(pe[e],t))},r.removeHook=function(e){if(pe[e])return v(pe[e])},r.removeHooks=function(e){pe[e]&&(pe[e]=[])},r.removeAllHooks=function(){pe={}},r}()}));
/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,i=286,n=30,r=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);var _=new Array(60);e(_);var f=new Array(512);e(f);var u=new Array(256);e(u);var c=new Array(29);e(c);var w,b,g,p=new Array(n);function m(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(p);var k=function(t){return t<256?f[t]:f[256+(t>>>7)]},y=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,y(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},z=function(t,e,a){x(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=function(t,e,a){var i,n,s=new Array(16),o=0;for(i=1;i<=r;i++)s[i]=o=o+a[i-1]<<1;for(n=0;n<=e;n++){var l=t[2*n+1];0!==l&&(t[2*n]=A(s[l]++,l))}},R=function(t){var e;for(e=0;e<i;e++)t.dyn_ltree[2*e]=0;for(e=0;e<n;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},Z=function(t){t.bi_valid>8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=function(t,e,a,i){var n=2*e,r=2*a;return t[n]<t[r]||t[n]===t[r]&&i[e]<=i[a]},U=function(t,e,a){for(var i=t.heap[a],n=a<<1;n<=t.heap_len&&(n<t.heap_len&&S(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!S(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i},D=function(t,e,i){var n,r,l,h,d=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],r=t.pending_buf[t.l_buf+d],d++,0===n?z(t,r,e):(l=u[r],z(t,l+a+1,e),0!==(h=s[l])&&(r-=c[l],x(t,r,h)),n--,l=k(n),z(t,l,i),0!==(h=o[l])&&(n-=p[l],x(t,n,h)))}while(d<t.last_lit);z(t,256,e)},O=function(t,e){var a,i,n,s=e.dyn_tree,o=e.stat_desc.static_tree,l=e.stat_desc.has_stree,h=e.stat_desc.elems,d=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<h;a++)0!==s[2*a]?(t.heap[++t.heap_len]=d=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(n=t.heap[++t.heap_len]=d<2?++d:0)]=1,t.depth[n]=0,t.opt_len--,l&&(t.static_len-=o[2*n+1]);for(e.max_code=d,a=t.heap_len>>1;a>=1;a--)U(t,s,a);n=h;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,s[2*n]=s[2*a]+s[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,s[2*a+1]=s[2*i+1]=n,t.heap[1]=n++,U(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,i,n,s,o,l,h=e.dyn_tree,d=e.max_code,_=e.stat_desc.static_tree,f=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,w=e.stat_desc.max_length,b=0;for(s=0;s<=r;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=h[2*h[2*(i=t.heap[a])+1]+1]+1)>w&&(s=w,b++),h[2*i+1]=s,i>d||(t.bl_count[s]++,o=0,i>=c&&(o=u[i-c]),l=h[2*i],t.opt_len+=l*(s+o),f&&(t.static_len+=l*(_[2*i+1]+o)));if(0!==b){do{for(s=w-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[w]--,b-=2}while(b>0);for(s=w;0!==s;s--)for(i=t.bl_count[s];0!==i;)(n=t.heap[--a])>d||(h[2*n+1]!==s&&(t.opt_len+=(s-h[2*n+1])*h[2*n],h[2*n+1]=s),i--)}}(t,e),E(s,d,t.bl_count)},T=function(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o<l&&n===s||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,r=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4))},I=function(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),i=0;i<=a;i++)if(n=s,s=e[2*(i+1)+1],!(++o<l&&n===s)){if(o<h)do{z(t,n,t.bl_tree)}while(0!=--o);else 0!==n?(n!==r&&(z(t,n,t.bl_tree),o--),z(t,16,t.bl_tree),x(t,o-3,2)):o<=10?(z(t,17,t.bl_tree),x(t,o-3,3)):(z(t,18,t.bl_tree),x(t,o-11,7));o=0,r=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4)}},F=!1,L=function(t,e,a,i){x(t,0+(i?1:0),3),function(t,e,a,i){Z(t),i&&(y(t,a),y(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},N={_tr_init:function(t){F||(!function(){var t,e,a,h,v,k=new Array(16);for(a=0,h=0;h<28;h++)for(c[h]=a,t=0;t<1<<s[h];t++)u[a++]=h;for(u[a-1]=h,v=0,h=0;h<16;h++)for(p[h]=v,t=0;t<1<<o[h];t++)f[v++]=h;for(v>>=7;h<n;h++)for(p[h]=v<<7,t=0;t<1<<o[h]-7;t++)f[256+v++]=h;for(e=0;e<=r;e++)k[e]=0;for(t=0;t<=143;)d[2*t+1]=8,t++,k[8]++;for(;t<=255;)d[2*t+1]=9,t++,k[9]++;for(;t<=279;)d[2*t+1]=7,t++,k[7]++;for(;t<=287;)d[2*t+1]=8,t++,k[8]++;for(E(d,287,k),t=0;t<n;t++)_[2*t+1]=5,_[2*t]=A(t,5);w=new m(d,s,257,i,r),b=new m(_,o,0,n,r),g=new m(new Array(0),l,0,19,7)}(),F=!0),t.l_desc=new v(t.dyn_ltree,w),t.d_desc=new v(t.dyn_dtree,b),t.bl_desc=new v(t.bl_tree,g),t.bi_buf=0,t.bi_valid=0,R(t)},_tr_stored_block:L,_tr_flush_block:function(t,e,i,n){var r,s,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),O(t,t.l_desc),O(t,t.d_desc),o=function(t){var e;for(T(t,t.dyn_ltree,t.l_desc.max_code),T(t,t.dyn_dtree,t.d_desc.max_code),O(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=r&&(r=s)):r=s=i+5,i+4<=r&&-1!==e?L(t,e,i,n):4===t.strategy||s===r?(x(t,2+(n?1:0),3),D(t,d,_)):(x(t,4+(n?1:0),3),function(t,e,a,i){var n;for(x(t,e-257,5),x(t,a-1,5),x(t,i-4,4),n=0;n<i;n++)x(t,t.bl_tree[2*h[n]+1],3);I(t,t.dyn_ltree,e-1),I(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),D(t,t.dyn_ltree,t.dyn_dtree)),R(t),n&&Z(t)},_tr_tally:function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(u[i]+a+1)]++,t.dyn_dtree[2*k(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){x(t,2,3),z(t,256,d),function(t){16===t.bi_valid?(y(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},B=function(t,e,a,i){for(var n=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{r=r+(n=n+e[i++]|0)|0}while(--s);n%=65521,r%=65521}return n|r<<16|0},C=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),M=function(t,e,a,i){var n=C,r=i+a;t^=-1;for(var s=i;s<r;s++)t=t>>>8^n[255&(t^e[s])];return-1^t},H={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},K=N._tr_init,P=N._tr_stored_block,Y=N._tr_flush_block,G=N._tr_tally,X=N._tr_align,W=j.Z_NO_FLUSH,q=j.Z_PARTIAL_FLUSH,J=j.Z_FULL_FLUSH,Q=j.Z_FINISH,V=j.Z_BLOCK,$=j.Z_OK,tt=j.Z_STREAM_END,et=j.Z_STREAM_ERROR,at=j.Z_DATA_ERROR,it=j.Z_BUF_ERROR,nt=j.Z_DEFAULT_COMPRESSION,rt=j.Z_FILTERED,st=j.Z_HUFFMAN_ONLY,ot=j.Z_RLE,lt=j.Z_FIXED,ht=j.Z_DEFAULT_STRATEGY,dt=j.Z_UNKNOWN,_t=j.Z_DEFLATED,ft=258,ut=262,ct=103,wt=113,bt=666,gt=function(t,e){return t.msg=H[e],e},pt=function(t){return(t<<1)-(t>4?9:0)},mt=function(t){for(var e=t.length;--e>=0;)t[e]=0},vt=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},kt=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},yt=function(t,e){Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,kt(t.strm)},xt=function(t,e){t.pending_buf[t.pending++]=e},zt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=function(t,e){var a,i,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ut?t.strstart-(t.w_size-ut):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ft,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(h[(a=e)+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do{}while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<f);if(i=ft-(f-r),r=f-ft,i>s){if(t.match_start=e,s=i,i>=o)break;u=h[r+s-1],c=h[r+s]}}}while((e=_[e&d])>l&&0!=--n);return s<=t.lookahead?s:t.lookahead},Et=function(t){var e,a,i,n,r,s,o,l,h,d,_=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=_+(_-ut)){t.window.set(t.window.subarray(_,_+_),0),t.match_start-=_,t.strstart-=_,t.block_start-=_,e=a=t.hash_size;do{i=t.head[--e],t.head[e]=i>=_?i-_:0}while(--a);e=a=_;do{i=t.prev[--e],t.prev[e]=i>=_?i-_:0}while(--a);n+=_}if(0===t.strm.avail_in)break;if(s=t.strm,o=t.window,l=t.strstart+t.lookahead,h=n,d=void 0,(d=s.avail_in)>h&&(d=h),a=0===d?0:(s.avail_in-=d,o.set(s.input.subarray(s.next_in,s.next_in+d),l),1===s.state.wrap?s.adler=B(s.adler,o,d,l):2===s.state.wrap&&(s.adler=M(s.adler,o,d,l)),s.next_in+=d,s.total_in+=d,d),t.lookahead+=a,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=vt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=vt(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<ut&&0!==t.strm.avail_in)},Rt=function(t,e){for(var a,i;;){if(t.lookahead<ut){if(Et(t),t.lookahead<ut&&e===W)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ut&&(t.match_length=At(t,a)),t.match_length>=3)if(i=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=vt(t,t.ins_h,t.window[t.strstart+1]);else i=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2},Zt=function(t,e){for(var a,i,n;;){if(t.lookahead<ut){if(Et(t),t.lookahead<ut&&e===W)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-ut&&(t.match_length=At(t,a),t.match_length<=5&&(t.strategy===rt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(yt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=G(t,0,t.window[t.strstart-1]))&&yt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}var Ut=[new St(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Et(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,yt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ut&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(yt(t,!1),t.strm.avail_out),1)})),new St(4,4,8,4,Rt),new St(4,5,16,8,Rt),new St(4,6,32,32,Rt),new St(4,4,16,16,Zt),new St(8,16,32,32,Zt),new St(8,16,128,128,Zt),new St(8,32,128,256,Zt),new St(32,128,258,1024,Zt),new St(32,258,258,4096,Zt)];function Dt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_t,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return gt(t,et);t.total_in=t.total_out=0,t.data_type=dt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:wt,t.adler=2===e.wrap?0:1,e.last_flush=W,K(e),$},Tt=function(t){var e,a=Ot(t);return a===$&&((e=t.state).window_size=2*e.w_size,mt(e.head),e.max_lazy_match=Ut[e.level].max_lazy,e.good_match=Ut[e.level].good_length,e.nice_match=Ut[e.level].nice_length,e.max_chain_length=Ut[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},It=function(t,e,a,i,n,r){if(!t)return et;var s=1;if(e===nt&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>9||a!==_t||i<8||i>15||e<0||e>9||r<0||r>lt)return gt(t,et);8===i&&(i=9);var o=new Dt;return t.state=o,o.strm=t,o.wrap=s,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=e,o.strategy=r,o.method=a,Tt(t)},Ft={deflateInit:function(t,e){return It(t,e,_t,15,8,ht)},deflateInit2:It,deflateReset:Tt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?et:(t.state.gzhead=e,$):et},deflate:function(t,e){var a,i;if(!t||!t.state||e>V||e<0)return t?gt(t,et):et;var n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===bt&&e!==Q)return gt(t,0===t.avail_out?it:et);n.strm=t;var r=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,xt(n,31),xt(n,139),xt(n,8),n.gzhead?(xt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),xt(n,255&n.gzhead.time),xt(n,n.gzhead.time>>8&255),xt(n,n.gzhead.time>>16&255),xt(n,n.gzhead.time>>24&255),xt(n,9===n.level?2:n.strategy>=st||n.level<2?4:0),xt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(xt(n,255&n.gzhead.extra.length),xt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=M(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,9===n.level?2:n.strategy>=st||n.level<2?4:0),xt(n,3),n.status=wt);else{var s=_t+(n.w_bits-8<<4)<<8;s|=(n.strategy>=st||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=wt,zt(n,s),0!==n.strstart&&(zt(n,t.adler>>>16),zt(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),kt(t),a=n.pending,n.pending!==n.pending_buf_size));)xt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),kt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,xt(n,i)}while(0!==i);n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),kt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,xt(n,i)}while(0!==i);n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.status=ct)}else n.status=ct;if(n.status===ct&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&kt(t),n.pending+2<=n.pending_buf_size&&(xt(n,255&t.adler),xt(n,t.adler>>8&255),t.adler=0,n.status=wt)):n.status=wt),0!==n.pending){if(kt(t),0===t.avail_out)return n.last_flush=-1,$}else if(0===t.avail_in&&pt(e)<=pt(r)&&e!==Q)return gt(t,it);if(n.status===bt&&0!==t.avail_in)return gt(t,it);if(0!==t.avail_in||0!==n.lookahead||e!==W&&n.status!==bt){var o=n.strategy===st?function(t,e){for(var a;;){if(0===t.lookahead&&(Et(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2}(n,e):n.strategy===ot?function(t,e){for(var a,i,n,r,s=t.window;;){if(t.lookahead<=ft){if(Et(t),t.lookahead<=ft&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=s[n=t.strstart-1])===s[++n]&&i===s[++n]&&i===s[++n]){r=t.strstart+ft;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<r);t.match_length=ft-(r-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2}(n,e):Ut[n.level].func(n,e);if(3!==o&&4!==o||(n.status=bt),1===o||3===o)return 0===t.avail_out&&(n.last_flush=-1),$;if(2===o&&(e===q?X(n):e!==V&&(P(n,0,0,!1),e===J&&(mt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),kt(t),0===t.avail_out))return n.last_flush=-1,$}return e!==Q?$:n.wrap<=0?tt:(2===n.wrap?(xt(n,255&t.adler),xt(n,t.adler>>8&255),xt(n,t.adler>>16&255),xt(n,t.adler>>24&255),xt(n,255&t.total_in),xt(n,t.total_in>>8&255),xt(n,t.total_in>>16&255),xt(n,t.total_in>>24&255)):(zt(n,t.adler>>>16),zt(n,65535&t.adler)),kt(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?$:tt)},deflateEnd:function(t){if(!t||!t.state)return et;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ct&&e!==wt&&e!==bt?gt(t,et):(t.state=null,e===wt?gt(t,at):$)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return et;var i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return et;if(1===n&&(t.adler=B(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(mt(i.head),i.strstart=0,i.block_start=0,i.insert=0);var r=new Uint8Array(i.w_size);r.set(e.subarray(a-i.w_size,a),0),e=r,a=i.w_size}var s=t.avail_in,o=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Et(i);i.lookahead>=3;){var h=i.strstart,d=i.lookahead-2;do{i.ins_h=vt(i,i.ins_h,i.window[h+3-1]),i.prev[h&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=h,h++}while(--d);i.strstart=h,i.lookahead=2,Et(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=o,t.input=l,t.avail_in=s,i.wrap=n,$},deflateInfo:"pako deflate (from Nodeca project)"};function Lt(t){return(Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Nt=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Bt=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!==Lt(a))throw new TypeError(a+"must be non-object");for(var i in a)Nt(a,i)&&(t[i]=a[i])}}return t},Ct=function(t){for(var e=0,a=0,i=t.length;a<i;a++)e+=t[a].length;for(var n=new Uint8Array(e),r=0,s=0,o=t.length;r<o;r++){var l=t[r];n.set(l,s),s+=l.length}return n},Mt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Mt=!1}for(var Ht=new Uint8Array(256),jt=0;jt<256;jt++)Ht[jt]=jt>=252?6:jt>=248?5:jt>=240?4:jt>=224?3:jt>=192?2:1;Ht[254]=Ht[254]=1;var Kt=function(t){var e,a,i,n,r,s=t.length,o=0;for(n=0;n<s;n++)55296==(64512&(a=t.charCodeAt(n)))&&n+1<s&&56320==(64512&(i=t.charCodeAt(n+1)))&&(a=65536+(a-55296<<10)+(i-56320),n++),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),r=0,n=0;r<o;n++)55296==(64512&(a=t.charCodeAt(n)))&&n+1<s&&56320==(64512&(i=t.charCodeAt(n+1)))&&(a=65536+(a-55296<<10)+(i-56320),n++),a<128?e[r++]=a:a<2048?(e[r++]=192|a>>>6,e[r++]=128|63&a):a<65536?(e[r++]=224|a>>>12,e[r++]=128|a>>>6&63,e[r++]=128|63&a):(e[r++]=240|a>>>18,e[r++]=128|a>>>12&63,e[r++]=128|a>>>6&63,e[r++]=128|63&a);return e},Pt=function(t,e){var a,i,n=e||t.length,r=new Array(2*n);for(i=0,a=0;a<n;){var s=t[a++];if(s<128)r[i++]=s;else{var o=Ht[s];if(o>4)r[i++]=65533,a+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&a<n;)s=s<<6|63&t[a++],o--;o>1?r[i++]=65533:s<65536?r[i++]=s:(s-=65536,r[i++]=55296|s>>10&1023,r[i++]=56320|1023&s)}}}return function(t,e){if(e<65534&&t.subarray&&Mt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var a="",i=0;i<e;i++)a+=String.fromCharCode(t[i]);return a}(r,i)},Yt=function(t,e){(e=e||t.length)>t.length&&(e=t.length);for(var a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Ht[t[a]]>e?a:e};var Gt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Xt=Object.prototype.toString,Wt=j.Z_NO_FLUSH,qt=j.Z_SYNC_FLUSH,Jt=j.Z_FULL_FLUSH,Qt=j.Z_FINISH,Vt=j.Z_OK,$t=j.Z_STREAM_END,te=j.Z_DEFAULT_COMPRESSION,ee=j.Z_DEFAULT_STRATEGY,ae=j.Z_DEFLATED;function ie(t){this.options=Bt({level:te,method:ae,chunkSize:16384,windowBits:15,memLevel:8,strategy:ee},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Gt,this.strm.avail_out=0;var a=Ft.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Vt)throw new Error(H[a]);if(e.header&&Ft.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(i="string"==typeof e.dictionary?Kt(e.dictionary):"[object ArrayBuffer]"===Xt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=Ft.deflateSetDictionary(this.strm,i))!==Vt)throw new Error(H[a]);this._dict_set=!0}}function ne(t,e){var a=new ie(e);if(a.push(t,!0),a.err)throw a.msg||H[a.err];return a.result}ie.prototype.push=function(t,e){var a,i,n=this.strm,r=this.options.chunkSize;if(this.ended)return!1;for(i=e===~~e?e:!0===e?Qt:Wt,"string"==typeof t?n.input=Kt(t):"[object ArrayBuffer]"===Xt.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(i===qt||i===Jt)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if((a=Ft.deflate(n,i))===$t)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=Ft.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Vt;if(0!==n.avail_out){if(i>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},ie.prototype.onData=function(t){this.chunks.push(t)},ie.prototype.onEnd=function(t){t===Vt&&(this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var re={Deflate:ie,deflate:ne,deflateRaw:function(t,e){return(e=e||{}).raw=!0,ne(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,ne(t,e)},constants:j},se=function(t,e){var a,i,n,r,s,o,l,h,d,_,f,u,c,w,b,g,p,m,v,k,y,x,z,A,E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,r=n-(e-t.avail_out),s=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,u=E.bits,c=E.lencode,w=E.distcode,b=(1<<E.lenbits)-1,g=(1<<E.distbits)-1;t:do{u<15&&(f+=z[a++]<<u,u+=8,f+=z[a++]<<u,u+=8),p=c[f&b];e:for(;;){if(f>>>=m=p>>>24,u-=m,0===(m=p>>>16&255))A[n++]=65535&p;else{if(!(16&m)){if(0==(64&m)){p=c[(65535&p)+(f&(1<<m)-1)];continue e}if(32&m){E.mode=12;break t}t.msg="invalid literal/length code",E.mode=30;break t}v=65535&p,(m&=15)&&(u<m&&(f+=z[a++]<<u,u+=8),v+=f&(1<<m)-1,f>>>=m,u-=m),u<15&&(f+=z[a++]<<u,u+=8,f+=z[a++]<<u,u+=8),p=w[f&g];a:for(;;){if(f>>>=m=p>>>24,u-=m,!(16&(m=p>>>16&255))){if(0==(64&m)){p=w[(65535&p)+(f&(1<<m)-1)];continue a}t.msg="invalid distance code",E.mode=30;break t}if(k=65535&p,u<(m&=15)&&(f+=z[a++]<<u,(u+=8)<m&&(f+=z[a++]<<u,u+=8)),(k+=f&(1<<m)-1)>o){t.msg="invalid distance too far back",E.mode=30;break t}if(f>>>=m,u-=m,k>(m=n-r)){if((m=k-m)>h&&E.sane){t.msg="invalid distance too far back",E.mode=30;break t}if(y=0,x=_,0===d){if(y+=l-m,m<v){v-=m;do{A[n++]=_[y++]}while(--m);y=n-k,x=A}}else if(d<m){if(y+=l+d-m,(m-=d)<v){v-=m;do{A[n++]=_[y++]}while(--m);if(y=0,d<v){v-=m=d;do{A[n++]=_[y++]}while(--m);y=n-k,x=A}}}else if(y+=d-m,m<v){v-=m;do{A[n++]=_[y++]}while(--m);y=n-k,x=A}for(;v>2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],v-=3;v&&(A[n++]=x[y++],v>1&&(A[n++]=x[y++]))}else{y=n-k;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],v-=3}while(v>2);v&&(A[n++]=A[y++],v>1&&(A[n++]=A[y++]))}break}}break}}while(a<i&&n<s);a-=v=u>>3,f&=(1<<(u-=v<<3))-1,t.next_in=a,t.next_out=n,t.avail_in=a<i?i-a+5:5-(a-i),t.avail_out=n<s?s-n+257:257-(n-s),E.hold=f,E.bits=u},oe=15,le=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),he=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),de=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),_e=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),fe=function(t,e,a,i,n,r,s,o){var l,h,d,_,f,u,c,w,b,g=o.bits,p=0,m=0,v=0,k=0,y=0,x=0,z=0,A=0,E=0,R=0,Z=null,S=0,U=new Uint16Array(16),D=new Uint16Array(16),O=null,T=0;for(p=0;p<=oe;p++)U[p]=0;for(m=0;m<i;m++)U[e[a+m]]++;for(y=g,k=oe;k>=1&&0===U[k];k--);if(y>k&&(y=k),0===k)return n[r++]=20971520,n[r++]=20971520,o.bits=1,0;for(v=1;v<k&&0===U[v];v++);for(y<v&&(y=v),A=1,p=1;p<=oe;p++)if(A<<=1,(A-=U[p])<0)return-1;if(A>0&&(0===t||1!==k))return-1;for(D[1]=0,p=1;p<oe;p++)D[p+1]=D[p]+U[p];for(m=0;m<i;m++)0!==e[a+m]&&(s[D[e[a+m]]++]=m);if(0===t?(Z=O=s,u=19):1===t?(Z=le,S-=257,O=he,T-=257,u=256):(Z=de,O=_e,u=-1),R=0,m=0,p=v,f=r,x=y,z=0,d=-1,_=(E=1<<y)-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){c=p-z,s[m]<u?(w=0,b=s[m]):s[m]>u?(w=O[T+s[m]],b=Z[S+s[m]]):(w=96,b=0),l=1<<p-z,v=h=1<<x;do{n[f+(R>>z)+(h-=l)]=c<<24|w<<16|b|0}while(0!==h);for(l=1<<p-1;R&l;)l>>=1;if(0!==l?(R&=l-1,R+=l):R=0,m++,0==--U[p]){if(p===k)break;p=e[a+s[m]]}if(p>y&&(R&_)!==d){for(0===z&&(z=y),f+=v,A=1<<(x=p-z);x+z<k&&!((A-=U[x+z])<=0);)x++,A<<=1;if(E+=1<<x,1===t&&E>852||2===t&&E>592)return 1;n[d=R&_]=y<<24|x<<16|f-r|0}}return 0!==R&&(n[f+R]=p-z<<24|64<<16|0),o.bits=y,0},ue=j.Z_FINISH,ce=j.Z_BLOCK,we=j.Z_TREES,be=j.Z_OK,ge=j.Z_STREAM_END,pe=j.Z_NEED_DICT,me=j.Z_STREAM_ERROR,ve=j.Z_DATA_ERROR,ke=j.Z_MEM_ERROR,ye=j.Z_BUF_ERROR,xe=j.Z_DEFLATED,ze=12,Ae=30,Ee=function(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)};function Re(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Ze,Se,Ue=function(t){if(!t||!t.state)return me;var e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,be},De=function(t){if(!t||!t.state)return me;var e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ue(t)},Oe=function(t,e){var a;if(!t||!t.state)return me;var i=t.state;return e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?me:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,De(t))},Te=function(t,e){if(!t)return me;var a=new Re;t.state=a,a.window=null;var i=Oe(t,e);return i!==be&&(t.state=null),i},Ie=!0,Fe=function(t){if(Ie){Ze=new Int32Array(512),Se=new Int32Array(32);for(var e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(fe(1,t.lens,0,288,Ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;fe(2,t.lens,0,32,Se,0,t.work,{bits:5}),Ie=!1}t.lencode=Ze,t.lenbits=9,t.distcode=Se,t.distbits=5},Le=function(t,e,a,i){var n,r=t.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),i>=r.wsize?(r.window.set(e.subarray(a-r.wsize,a),0),r.wnext=0,r.whave=r.wsize):((n=r.wsize-r.wnext)>i&&(n=i),r.window.set(e.subarray(a-i,a-i+n),r.wnext),(i-=n)?(r.window.set(e.subarray(a-i,a),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=n))),0},Ne={inflateReset:De,inflateReset2:Oe,inflateResetKeep:Ue,inflateInit:function(t){return Te(t,15)},inflateInit2:Te,inflate:function(t,e){var a,i,n,r,s,o,l,h,d,_,f,u,c,w,b,g,p,m,v,k,y,x,z,A,E=0,R=new Uint8Array(4),Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return me;(a=t.state).mode===ze&&(a.mode=13),s=t.next_out,n=t.output,l=t.avail_out,r=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=be;t:for(;;)switch(a.mode){case 1:if(0===a.wrap){a.mode=13;break}for(;d<16;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}if(2&a.wrap&&35615===h){a.check=0,R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0),h=0,d=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=Ae;break}if((15&h)!==xe){t.msg="unknown compression method",a.mode=Ae;break}if(d-=4,y=8+(15&(h>>>=4)),0===a.wbits)a.wbits=y;else if(y>a.wbits){t.msg="invalid window size",a.mode=Ae;break}a.dmax=1<<a.wbits,t.adler=a.check=1,a.mode=512&h?10:ze,h=0,d=0;break;case 2:for(;d<16;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==xe){t.msg="unknown compression method",a.mode=Ae;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=Ae;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&(R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0,a.mode=3;case 3:for(;d<32;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&(R[0]=255&h,R[1]=h>>>8&255,R[2]=h>>>16&255,R[3]=h>>>24&255,a.check=M(a.check,R,4,0)),h=0,d=0,a.mode=4;case 4:for(;d<16;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&(R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0,a.mode=5;case 5:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&(R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&((u=a.length)>o&&(u=o),u&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(r,r+u),y)),512&a.flags&&(a.check=M(a.check,i,u,r)),o-=u,r+=u,a.length-=u),a.length))break t;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===o)break t;u=0;do{y=i[r+u++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&(a.check=M(a.check,i,u,r)),o-=u,r+=u,y)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=8;case 8:if(4096&a.flags){if(0===o)break t;u=0;do{y=i[r+u++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&(a.check=M(a.check,i,u,r)),o-=u,r+=u,y)break t}else a.head&&(a.head.comment=null);a.mode=9;case 9:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}if(h!==(65535&a.check)){t.msg="header crc mismatch",a.mode=Ae;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=ze;break;case 10:for(;d<32;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}t.adler=a.check=Ee(h),h=0,d=0,a.mode=11;case 11:if(0===a.havedict)return t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,pe;t.adler=a.check=1,a.mode=ze;case ze:if(e===ce||e===we)break t;case 13:if(a.last){h>>>=7&d,d-=7&d,a.mode=27;break}for(;d<3;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}switch(a.last=1&h,d-=1,3&(h>>>=1)){case 0:a.mode=14;break;case 1:if(Fe(a),a.mode=20,e===we){h>>>=2,d-=2;break t}break;case 2:a.mode=17;break;case 3:t.msg="invalid block type",a.mode=Ae}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",a.mode=Ae;break}if(a.length=65535&h,h=0,d=0,a.mode=15,e===we)break t;case 15:a.mode=16;case 16:if(u=a.length){if(u>o&&(u=o),u>l&&(u=l),0===u)break t;n.set(i.subarray(r,r+u),s),o-=u,r+=u,l-=u,s+=u,a.length-=u;break}a.mode=ze;break;case 17:for(;d<14;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=Ae;break}a.have=0,a.mode=18;case 18:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,z={bits:a.lenbits},x=fe(0,a.lens,0,19,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid code lengths set",a.mode=Ae;break}a.have=0,a.mode=19;case 19:for(;a.have<a.nlen+a.ndist;){for(;g=(E=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,p=65535&E,!((b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}if(p<16)h>>>=b,d-=b,a.lens[a.have++]=p;else{if(16===p){for(A=b+2;d<A;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}if(h>>>=b,d-=b,0===a.have){t.msg="invalid bit length repeat",a.mode=Ae;break}y=a.lens[a.have-1],u=3+(3&h),h>>>=2,d-=2}else if(17===p){for(A=b+3;d<A;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}d-=b,y=0,u=3+(7&(h>>>=b)),h>>>=3,d-=3}else{for(A=b+7;d<A;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}d-=b,y=0,u=11+(127&(h>>>=b)),h>>>=7,d-=7}if(a.have+u>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=Ae;break}for(;u--;)a.lens[a.have++]=y}}if(a.mode===Ae)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=Ae;break}if(a.lenbits=9,z={bits:a.lenbits},x=fe(1,a.lens,0,a.nlen,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid literal/lengths set",a.mode=Ae;break}if(a.distbits=6,a.distcode=a.distdyn,z={bits:a.distbits},x=fe(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,z),a.distbits=z.bits,x){t.msg="invalid distances set",a.mode=Ae;break}if(a.mode=20,e===we)break t;case 20:a.mode=21;case 21:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,se(t,f),s=t.next_out,n=t.output,l=t.avail_out,r=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,a.mode===ze&&(a.back=-1);break}for(a.back=0;g=(E=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,p=65535&E,!((b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}if(g&&0==(240&g)){for(m=b,v=g,k=p;g=(E=a.lencode[k+((h&(1<<m+v)-1)>>m)])>>>16&255,p=65535&E,!(m+(b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}h>>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,a.length=p,0===g){a.mode=26;break}if(32&g){a.back=-1,a.mode=ze;break}if(64&g){t.msg="invalid literal/length code",a.mode=Ae;break}a.extra=15&g,a.mode=22;case 22:if(a.extra){for(A=a.extra;d<A;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;g=(E=a.distcode[h&(1<<a.distbits)-1])>>>16&255,p=65535&E,!((b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}if(0==(240&g)){for(m=b,v=g,k=p;g=(E=a.distcode[k+((h&(1<<m+v)-1)>>m)])>>>16&255,p=65535&E,!(m+(b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}h>>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,64&g){t.msg="invalid distance code",a.mode=Ae;break}a.offset=p,a.extra=15&g,a.mode=24;case 24:if(a.extra){for(A=a.extra;d<A;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=Ae;break}a.mode=25;case 25:if(0===l)break t;if(u=f-l,a.offset>u){if((u=a.offset-u)>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=Ae;break}u>a.wnext?(u-=a.wnext,c=a.wsize-u):c=a.wnext-u,u>a.length&&(u=a.length),w=a.window}else w=n,c=s-a.offset,u=a.length;u>l&&(u=l),l-=u,a.length-=u;do{n[s++]=w[c++]}while(--u);0===a.length&&(a.mode=21);break;case 26:if(0===l)break t;n[s++]=a.length,l--,a.mode=21;break;case 27:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[r++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,f&&(t.adler=a.check=a.flags?M(a.check,n,f,s-f):B(a.check,n,f,s-f)),f=l,(a.flags?h:Ee(h))!==a.check){t.msg="incorrect data check",a.mode=Ae;break}h=0,d=0}a.mode=28;case 28:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=i[r++]<<d,d+=8}if(h!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=Ae;break}h=0,d=0}a.mode=29;case 29:x=ge;break t;case Ae:x=ve;break t;case 31:return ke;case 32:default:return me}return t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<Ae&&(a.mode<27||e!==ue))&&Le(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,a.wrap&&f&&(t.adler=a.check=a.flags?M(a.check,n,f,t.next_out-f):B(a.check,n,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(a.mode===ze?128:0)+(20===a.mode||15===a.mode?256:0),(0===_&&0===f||e===ue)&&x===be&&(x=ye),x},inflateEnd:function(t){if(!t||!t.state)return me;var e=t.state;return e.window&&(e.window=null),t.state=null,be},inflateGetHeader:function(t,e){if(!t||!t.state)return me;var a=t.state;return 0==(2&a.wrap)?me:(a.head=e,e.done=!1,be)},inflateSetDictionary:function(t,e){var a,i=e.length;return t&&t.state?0!==(a=t.state).wrap&&11!==a.mode?me:11===a.mode&&B(1,e,i,0)!==a.check?ve:Le(t,e,i,i)?(a.mode=31,ke):(a.havedict=1,be):me},inflateInfo:"pako inflate (from Nodeca project)"};var Be=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Ce=Object.prototype.toString,Me=j.Z_NO_FLUSH,He=j.Z_FINISH,je=j.Z_OK,Ke=j.Z_STREAM_END,Pe=j.Z_NEED_DICT,Ye=j.Z_STREAM_ERROR,Ge=j.Z_DATA_ERROR,Xe=j.Z_MEM_ERROR;function We(t){this.options=Bt({chunkSize:65536,windowBits:15,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Gt,this.strm.avail_out=0;var a=Ne.inflateInit2(this.strm,e.windowBits);if(a!==je)throw new Error(H[a]);if(this.header=new Be,Ne.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Kt(e.dictionary):"[object ArrayBuffer]"===Ce.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ne.inflateSetDictionary(this.strm,e.dictionary))!==je))throw new Error(H[a])}function qe(t,e){var a=new We(e);if(a.push(t),a.err)throw a.msg||H[a.err];return a.result}We.prototype.push=function(t,e){var a,i,n,r=this.strm,s=this.options.chunkSize,o=this.options.dictionary;if(this.ended)return!1;for(i=e===~~e?e:!0===e?He:Me,"[object ArrayBuffer]"===Ce.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(s),r.next_out=0,r.avail_out=s),(a=Ne.inflate(r,i))===Pe&&o&&((a=Ne.inflateSetDictionary(r,o))===je?a=Ne.inflate(r,i):a===Ge&&(a=Pe));r.avail_in>0&&a===Ke&&r.state.wrap>0&&0!==t[r.next_in];)Ne.inflateReset(r),a=Ne.inflate(r,i);switch(a){case Ye:case Ge:case Pe:case Xe:return this.onEnd(a),this.ended=!0,!1}if(n=r.avail_out,r.next_out&&(0===r.avail_out||a===Ke))if("string"===this.options.to){var l=Yt(r.output,r.next_out),h=r.next_out-l,d=Pt(r.output,l);r.next_out=h,r.avail_out=s-h,h&&r.output.set(r.output.subarray(l,l+h),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(a!==je||0!==n){if(a===Ke)return a=Ne.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},We.prototype.onData=function(t){this.chunks.push(t)},We.prototype.onEnd=function(t){t===je&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Je={Inflate:We,inflate:qe,inflateRaw:function(t,e){return(e=e||{}).raw=!0,qe(t,e)},ungzip:qe,constants:j},Qe=re.Deflate,Ve=re.deflate,$e=re.deflateRaw,ta=re.gzip,ea=Je.Inflate,aa=Je.inflate,ia=Je.inflateRaw,na=Je.ungzip,ra=j,sa={Deflate:Qe,deflate:Ve,deflateRaw:$e,gzip:ta,Inflate:ea,inflate:aa,inflateRaw:ia,ungzip:na,constants:ra};t.Deflate=Qe,t.Inflate=ea,t.constants=ra,t.default=sa,t.deflate=Ve,t.deflateRaw=$e,t.gzip=ta,t.inflate=aa,t.inflateRaw=ia,t.ungzip=na,Object.defineProperty(t,"__esModule",{value:!0})}));
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(d,h,l){if(l.get||l.set)throw new TypeError("ES3 does not support getters and setters.");d!=Array.prototype&&d!=Object.prototype&&(d[h]=l.value)};$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(d,h,l,p){if(h){l=$jscomp.global;d=d.split(".");for(p=0;p<d.length-1;p++){var v=d[p];v in l||(l[v]={});l=l[v]}d=d[d.length-1];p=l[d];h=h(p);h!=p&&null!=h&&$jscomp.defineProperty(l,d,{configurable:!0,writable:!0,value:h})}};$jscomp.polyfill("Math.imul",function(d){return d?d:function(d,l){d=Number(d);l=Number(l);var h=d&65535,v=l&65535;return h*v+((d>>>16&65535)*v+h*(l>>>16&65535)<<16>>>0)|0}},"es6-impl","es3");
$jscomp.polyfill("Object.setPrototypeOf",function(d){return d?d:"object"!=typeof"".__proto__?null:function(d,l){d.__proto__=l;if(d.__proto__!==l)throw new TypeError(d+" is not extensible");return d}},"es6","es5");$jscomp.polyfill("Reflect.apply",function(d){if(d)return d;var h=Function.prototype.apply;return function(d,p,v){return h.call(d,p,v)}},"es6","es3");
$jscomp.polyfill("Reflect.construct",function(d){return d?d:function(d,l,p){void 0===p&&(p=d);p=Object.create(p.prototype||Object.prototype);return Reflect.apply(d,p,l)||p}},"es6","es5");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(d){return $jscomp.SYMBOL_PREFIX+(d||"")+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.iterator;d||(d=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[d]&&$jscomp.defineProperty(Array.prototype,d,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(d){var h=0;return $jscomp.iteratorPrototype(function(){return h<d.length?{done:!1,value:d[h++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(d){$jscomp.initSymbolIterator();d={next:d};d[$jscomp.global.Symbol.iterator]=function(){return this};return d};$jscomp.polyfill("Array.from",function(d){return d?d:function(d,l,p){$jscomp.initSymbolIterator();l=null!=l?l:function(d){return d};var h=[],z=d[Symbol.iterator];if("function"==typeof z)for(d=z.call(d);!(z=d.next()).done;)h.push(l.call(p,z.value));else for(var z=d.length,B=0;B<z;B++)h.push(l.call(p,d[B]));return h}},"es6-impl","es3");
$jscomp.polyfill("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991},"es6-impl","es3");$jscomp.owns=function(d,h){return Object.prototype.hasOwnProperty.call(d,h)};$jscomp.polyfill("Object.assign",function(d){return d?d:function(d,l){for(var h=1;h<arguments.length;h++){var v=arguments[h];if(v)for(var z in v)$jscomp.owns(v,z)&&(d[z]=v[z])}return d}},"es6-impl","es3");
$jscomp.polyfill("Array.prototype.fill",function(d){return d?d:function(d,l,p){var h=this.length||0;0>l&&(l=Math.max(0,h+l));if(null==p||p>h)p=h;p=Number(p);0>p&&(p=Math.max(0,h+p));for(l=Number(l||0);l<p;l++)this[l]=d;return this}},"es6-impl","es3");Array.from||(Array.from=function(d){return[].slice.call(d)});Math.imul=Math.imul||function(d,h){var l=d&65535,p=h&65535;return l*p+((d>>>16&65535)*p+l*(h>>>16&65535)<<16>>>0)|0};
function _instanceof(d,h){return null!=h&&"undefined"!==typeof Symbol&&h[Symbol.hasInstance]?!!h[Symbol.hasInstance](d):d instanceof h}function _inherits(d,h){if("function"!==typeof h&&null!==h)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(h&&h.prototype,{constructor:{value:d,writable:!0,configurable:!0}});h&&_setPrototypeOf(d,h)}
function _setPrototypeOf(d,h){_setPrototypeOf=Object.setPrototypeOf||function(d,h){d.__proto__=h;return d};return _setPrototypeOf(d,h)}function _createSuper(d){var h=_isNativeReflectConstruct();return function(){var l=_getPrototypeOf(d);if(h)var p=_getPrototypeOf(this).constructor,l=Reflect.construct(l,arguments,p);else l=l.apply(this,arguments);return _possibleConstructorReturn(this,l)}}
function _possibleConstructorReturn(d,h){return!h||"object"!==_typeof(h)&&"function"!==typeof h?_assertThisInitialized(d):h}function _assertThisInitialized(d){if(void 0===d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}
function _isNativeReflectConstruct(){if("undefined"===typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(d){return!1}}function _getPrototypeOf(d){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(d){return d.__proto__||Object.getPrototypeOf(d)};return _getPrototypeOf(d)}
function _createForOfIteratorHelper(d,h){var l;if("undefined"===typeof Symbol||null==d[Symbol.iterator]){if(Array.isArray(d)||(l=_unsupportedIterableToArray(d))||h&&d&&"number"===typeof d.length){l&&(d=l);var p=0,v=function(){};return{s:v,n:function(){return p>=d.length?{done:!0}:{done:!1,value:d[p++]}},e:function(d){throw d;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z=!0,
B=!1,C;return{s:function(){l=d[Symbol.iterator]()},n:function(){var d=l.next();z=d.done;return d},e:function(d){B=!0;C=d},f:function(){try{z||null==l["return"]||l["return"]()}finally{if(B)throw C;}}}}function _classCallCheck(d,h){if(!_instanceof(d,h))throw new TypeError("Cannot call a class as a function");}function _defineProperties(d,h){for(var l=0;l<h.length;l++){var p=h[l];p.enumerable=p.enumerable||!1;p.configurable=!0;"value"in p&&(p.writable=!0);Object.defineProperty(d,p.key,p)}}
function _createClass(d,h,l){h&&_defineProperties(d.prototype,h);l&&_defineProperties(d,l);return d}function _typeof(d){"@babel/helpers - typeof";_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(d){return typeof d}:function(d){return d&&"function"===typeof Symbol&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};return _typeof(d)}
function _toConsumableArray(d){return _arrayWithoutHoles(d)||_iterableToArray(d)||_unsupportedIterableToArray(d)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(d){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(d))return Array.from(d)}
function _arrayWithoutHoles(d){if(Array.isArray(d))return _arrayLikeToArray(d)}function _slicedToArray(d,h){return _arrayWithHoles(d)||_iterableToArrayLimit(d,h)||_unsupportedIterableToArray(d,h)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}
function _unsupportedIterableToArray(d,h){if(d){if("string"===typeof d)return _arrayLikeToArray(d,h);var l=Object.prototype.toString.call(d).slice(8,-1);"Object"===l&&d.constructor&&(l=d.constructor.name);if("Map"===l||"Set"===l)return Array.from(d);if("Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return _arrayLikeToArray(d,h)}}function _arrayLikeToArray(d,h){if(null==h||h>d.length)h=d.length;for(var l=0,p=Array(h);l<h;l++)p[l]=d[l];return p}
function _iterableToArrayLimit(d,h){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(d)){var l=[],p=!0,v=!1,z=void 0;try{for(var B=d[Symbol.iterator](),C;!(p=(C=B.next()).done)&&(l.push(C.value),!h||l.length!==h);p=!0);}catch(H){v=!0,z=H}finally{try{if(!p&&null!=B["return"])B["return"]()}finally{if(v)throw z;}}return l}}function _arrayWithHoles(d){if(Array.isArray(d))return d}
var rough=function(){function d(b,a,e){if(b&&b.length){a=_slicedToArray(a,2);var c=a[0],f=a[1];e*=Math.PI/180;var k=Math.cos(e),d=Math.sin(e);b.forEach(function(a){var e=_slicedToArray(a,2),b=e[0],e=e[1];a[0]=(b-c)*k-(e-f)*d+c;a[1]=(b-c)*d+(e-f)*k+f})}}function h(b){var a=b[0];b=b[1];return Math.sqrt(Math.pow(a[0]-b[0],2)+Math.pow(a[1]-b[1],2))}function l(b,a,e,c){var f=a[1]-b[1];a=b[0]-a[0];b=f*b[0]+a*b[1];var k=c[1]-e[1];c=e[0]-c[0];e=k*e[0]+c*e[1];var d=f*c-k*a;return d?[(c*b-a*e)/d,(f*e-k*b)/
d]:null}function p(b,a,e){var c=b.length;if(3>c)return!1;var f=[Number.MAX_SAFE_INTEGER,e];a=[a,e];for(var k=e=0;k<c;k++){var d=b[k],g=b[(k+1)%c];if(B(d,g,a,f)){if(0===z(d,a,g))return v(d,a,g);e++}}return 1==e%2}function v(b,a,e){return a[0]<=Math.max(b[0],e[0])&&a[0]>=Math.min(b[0],e[0])&&a[1]<=Math.max(b[1],e[1])&&a[1]>=Math.min(b[1],e[1])}function z(b,a,e){b=(a[1]-b[1])*(e[0]-a[0])-(a[0]-b[0])*(e[1]-a[1]);return 0===b?0:0<b?1:2}function B(b,a,e,c){var f=z(b,a,e),k=z(b,a,c),d=z(e,c,b),g=z(e,c,a);
return f!==k&&d!==g||!(0!==f||!v(b,e,a))||!(0!==k||!v(b,c,a))||!(0!==d||!v(e,b,c))||!(0!==g||!v(e,a,c))}function C(b,a){var e=[0,0],c=Math.round(a.hachureAngle+90);c&&d(b,e,c);var f=function(a,e){var c=_toConsumableArray(a);c[0].join(",")!==c[c.length-1].join(",")&&c.push([c[0][0],c[0][1]]);var f=[];if(c&&2<c.length){var b=function(){var a=e.hachureGap;0>a&&(a=4*e.strokeWidth);for(var a=Math.max(a,.1),b=[],k=0;k<c.length-1;k++){var g=c[k],d=c[k+1];if(g[1]!==d[1]){var n=Math.min(g[1],d[1]);b.push({ymin:n,
ymax:Math.max(g[1],d[1]),x:n===g[1]?g[0]:d[0],islope:(d[0]-g[0])/(d[1]-g[1])})}}if(b.sort(function(a,c){return a.ymin<c.ymin?-1:a.ymin>c.ymin?1:a.x<c.x?-1:a.x>c.x?1:a.ymax===c.ymax?0:(a.ymax-c.ymax)/Math.abs(a.ymax-c.ymax)}),!b.length)return{v:f};for(var m=[],r=b[0].ymin;m.length||b.length;){if(b.length){k=-1;for(g=0;g<b.length&&!(b[g].ymin>r);g++)k=g;b.splice(0,k+1).forEach(function(a){m.push({s:r,edge:a})})}if(m=m.filter(function(a){return!(a.edge.ymax<=r)}),m.sort(function(a,c){return a.edge.x===
c.edge.x?0:(a.edge.x-c.edge.x)/Math.abs(a.edge.x-c.edge.x)}),1<m.length)for(k=0;k<m.length;k+=2){g=k+1;if(g>=m.length)break;f.push([[Math.round(m[k].edge.x),r],[Math.round(m[g].edge.x),r]])}r+=a;m.forEach(function(c){c.edge.x+=a*c.edge.islope})}}();if("object"===_typeof(b))return b.v}return f}(b,a);return c&&(d(b,e,-c),function(a,c,e){var f=[];a.forEach(function(a){return f.push.apply(f,_toConsumableArray(a))});d(f,c,e)}(f,e,-c)),f}function H(b){var a=[],e;a:{e=b;for(var c=[];""!==e;){if(!e.match(/^([ \t\r\n,]+)/))if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))c[c.length]=
{type:0,text:RegExp.$1};else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)){e=[];break a}c[c.length]={type:1,text:"".concat(parseFloat(RegExp.$1))}}e=e.substr(RegExp.$1.length)}e=(c[c.length]={type:2,text:""},c)}for(var c="BOD",f=0,k=e[f];2!==k.type;){var d=0,g=[];if("BOD"===c){if("M"!==k.text&&"m"!==k.text)return H("M0,0"+b);f++;d=K[k.text];c=k.text}else 1===k.type?d=K[c]:(f++,d=K[k.text],c=k.text);if(!(f+d<e.length))throw Error("Path data ended short");for(k=f;k<f+d;k++){var n=
e[k];if(1!==n.type)throw Error("Param not a number: "+c+","+n.text);g[g.length]=+n.text}if("number"!=typeof K[c])throw Error("Bad segment: "+c);a.push({key:c,data:g});f+=d;k=e[f];"M"===c&&(c="L");"m"===c&&(c="l")}return a}function W(b){var a,e,c,f,k,d,g=0,n=0,m=0,x=0,w=[];b=_createForOfIteratorHelper(b);var t;try{for(b.s();!(t=b.n()).done;){var h=t.value,q=h.data;switch(h.key){case "M":w.push({key:"M",data:_toConsumableArray(q)});a=q;e=_slicedToArray(a,2);g=e[0];n=e[1];a;c=q;f=_slicedToArray(c,2);
m=f[0];x=f[1];c;break;case "m":g+=q[0];n+=q[1];w.push({key:"M",data:[g,n]});m=g;x=n;break;case "L":w.push({key:"L",data:_toConsumableArray(q)});k=q;d=_slicedToArray(k,2);g=d[0];n=d[1];k;break;case "l":g+=q[0];n+=q[1];w.push({key:"L",data:[g,n]});break;case "C":w.push({key:"C",data:_toConsumableArray(q)});g=q[4];n=q[5];break;case "c":var l=q.map(function(a,c){return c%2?a+n:a+g});w.push({key:"C",data:l});g=l[4];n=l[5];break;case "Q":w.push({key:"Q",data:_toConsumableArray(q)});g=q[2];n=q[3];break;
case "q":var p=q.map(function(a,c){return c%2?a+n:a+g});w.push({key:"Q",data:p});g=p[2];n=p[3];break;case "A":w.push({key:"A",data:_toConsumableArray(q)});g=q[5];n=q[6];break;case "a":g+=q[5];n+=q[6];w.push({key:"A",data:[q[0],q[1],q[2],q[3],q[4],g,n]});break;case "H":w.push({key:"H",data:_toConsumableArray(q)});g=q[0];break;case "h":g+=q[0];w.push({key:"H",data:[g]});break;case "V":w.push({key:"V",data:_toConsumableArray(q)});n=q[0];break;case "v":n+=q[0];w.push({key:"V",data:[n]});break;case "S":w.push({key:"S",
data:_toConsumableArray(q)});g=q[2];n=q[3];break;case "s":var u=q.map(function(a,c){return c%2?a+n:a+g});w.push({key:"S",data:u});g=u[2];n=u[3];break;case "T":w.push({key:"T",data:_toConsumableArray(q)});g=q[0];n=q[1];break;case "t":g+=q[0];n+=q[1];w.push({key:"T",data:[g,n]});break;case "Z":case "z":w.push({key:"Z",data:[]}),g=m,n=x}}}catch(y){b.e(y)}finally{b.f()}return w}function X(b){var a,e,c,f,k,d,g=[],n="",m=0,x=0,w=0,t=0,h=0,q=0;b=_createForOfIteratorHelper(b);var l;try{for(b.s();!(l=b.n()).done;){var p=
l.value,u=p.key,y=p.data;switch(u){case "M":g.push({key:"M",data:_toConsumableArray(y)});a=y;e=_slicedToArray(a,2);m=e[0];x=e[1];a;c=y;f=_slicedToArray(c,2);w=f[0];t=f[1];c;break;case "C":g.push({key:"C",data:_toConsumableArray(y)});m=y[4];x=y[5];h=y[2];q=y[3];break;case "L":g.push({key:"L",data:_toConsumableArray(y)});k=y;d=_slicedToArray(k,2);m=d[0];x=d[1];k;break;case "H":m=y[0];g.push({key:"L",data:[m,x]});break;case "V":x=y[0];g.push({key:"L",data:[m,x]});break;case "S":var F=0,v=0;"C"===n||
"S"===n?(F=m+(m-h),v=x+(x-q)):(F=m,v=x);g.push({key:"C",data:[F,v].concat(_toConsumableArray(y))});h=y[0];q=y[1];m=y[2];x=y[3];break;case "T":var z=_slicedToArray(y,2),A=z[0],B=z[1],v=F=0;"Q"===n||"T"===n?(F=m+(m-h),v=x+(x-q)):(F=m,v=x);g.push({key:"C",data:[m+2*(F-m)/3,x+2*(v-x)/3,A+2*(F-A)/3,B+2*(v-B)/3,A,B]});h=F;q=v;m=A;x=B;break;case "Q":var C=_slicedToArray(y,4),D=C[0],G=C[1],E=C[2],H=C[3];g.push({key:"C",data:[m+2*(D-m)/3,x+2*(G-x)/3,E+2*(D-E)/3,H+2*(G-H)/3,E,H]});h=D;q=G;m=E;x=H;break;case "A":var I=
Math.abs(y[0]),J=Math.abs(y[1]),K=y[2],N=y[3],O=y[4],L=y[5],M=y[6];if(0===I||0===J)g.push({key:"C",data:[m,x,L,M,L,M]}),m=L,x=M;else if(m!==L||x!==M)Y(m,x,L,M,I,J,K,N,O).forEach(function(a){g.push({key:"C",data:a})}),m=L,x=M;break;case "Z":g.push({key:"Z",data:[]}),m=w,x=t}n=u}}catch(ka){b.e(ka)}finally{b.f()}return g}function I(b,a,e){return[b*Math.cos(e)-a*Math.sin(e),b*Math.sin(e)+a*Math.cos(e)]}function Y(b,a,e,c,f,k,d,g,n,m){var r=(w=d,Math.PI*w/180),w;w=[];var t,h,q;if(m)q=_slicedToArray(m,
4),t=q[0],g=q[1],h=q[2],q=q[3];else{t=I(b,a,-r);a=_slicedToArray(t,2);b=a[0];a=a[1];t;t=I(e,c,-r);c=_slicedToArray(t,2);e=c[0];c=c[1];t;t=(b-e)/2;h=(a-c)/2;q=t*t/(f*f)+h*h/(k*k);1<q&&(q=Math.sqrt(q),f*=q,k*=q);q=f*f;var l=k*k;g=(g===n?-1:1)*Math.sqrt(Math.abs((q*l-q*h*h-l*t*t)/(q*h*h+l*t*t)));h=g*f*h/k+(b+e)/2;q=g*-k*t/f+(a+c)/2;t=Math.asin(parseFloat(((a-q)/k).toFixed(9)));g=Math.asin(parseFloat(((c-q)/k).toFixed(9)));b<h&&(t=Math.PI-t);e<h&&(g=Math.PI-g);0>t&&(t=2*Math.PI+t);0>g&&(g=2*Math.PI+g);
n&&t>g&&(t-=2*Math.PI);!n&&g>t&&(g-=2*Math.PI)}Math.abs(g-t)>120*Math.PI/180&&(g=n&&g>t?t+120*Math.PI/180*1:t+120*Math.PI/180*-1,w=Y(e=h+f*Math.cos(g),c=q+k*Math.sin(g),e,c,f,k,d,0,n,[g,g,h,q]));d=Math.tan((g-t)/4);f=4/3*f*d;d*=4/3*k;k=[b,a];b=[b+f*Math.sin(t),a-d*Math.cos(t)];a=[e+f*Math.sin(g),c-d*Math.cos(g)];e=[e,c];if(b[0]=2*k[0]-b[0],b[1]=2*k[1]-b[1],m)return[b,a,e].concat(w);w=[b,a,e].concat(w);m=[];for(e=0;e<w.length;e+=3)c=I(w[e][0],w[e][1],r),b=I(w[e+1][0],w[e+1][1],r),a=I(w[e+2][0],w[e+
2][1],r),m.push([c[0],c[1],b[0],b[1],a[0],a[1]]);return m}function N(b,a,e){var c=(b||[]).length;if(2<c){for(var f=[],k=0;k<c-1;k++)f.push.apply(f,_toConsumableArray(D(b[k][0],b[k][1],b[k+1][0],b[k+1][1],e)));return a&&f.push.apply(f,_toConsumableArray(D(b[c-1][0],b[c-1][1],b[0][0],b[0][1],e))),{type:"path",ops:f}}return 2===c?{type:"path",ops:D(b[0][0],b[0][1],b[1][0],b[1][1],e)}:{type:"path",ops:[]}}function la(b,a){var e=Z(b,1*(1+.2*a.roughness),a);if(!a.disableMultiStroke){var c=1.5*(1+.22*a.roughness),
f=Object.assign({},a);f.randomizer=void 0;a.seed&&(f.seed=a.seed+1);c=Z(b,c,f);e=e.concat(c)}return{type:"path",ops:e}}function aa(b,a,e){var c=2*Math.PI/Math.max(e.curveStepCount,e.curveStepCount/Math.sqrt(200)*Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(b/2,2)+Math.pow(a/2,2))/2)));b=Math.abs(b/2);a=Math.abs(a/2);var f=1-e.curveFitting;return b+=u(b*f,e),a+=u(a*f,e),{increment:c,rx:b,ry:a}}function T(b,a,e,c){var f=ba(c.increment,b,a,c.rx,c.ry,1,c.increment*O(.1,O(.4,1,e),e),e),k=_slicedToArray(f,2),
f=k[1],k=P(k[0],null,e);e.disableMultiStroke||(b=ba(c.increment,b,a,c.rx,c.ry,1.5,0,e),b=_slicedToArray(b,1)[0],e=P(b,null,e),k=k.concat(e));return{estimatedPoints:f,opset:{type:"path",ops:k}}}function ca(b,a,e,c,f,k,d,g,n){e=Math.abs(e/2);c=Math.abs(c/2);e+=u(.01*e,n);for(c+=u(.01*c,n);0>f;)f+=2*Math.PI,k+=2*Math.PI;k-f>2*Math.PI&&(f=0,k=2*Math.PI);var m=Math.min(2*Math.PI/n.curveStepCount/2,(k-f)/2),r=da(m,b,a,e,c,f,k,1,n);n.disableMultiStroke||(m=da(m,b,a,e,c,f,k,1.5,n),r.push.apply(r,_toConsumableArray(m)));
return d&&(g?r.push.apply(r,_toConsumableArray(D(b,a,b+e*Math.cos(f),a+c*Math.sin(f),n)).concat(_toConsumableArray(D(b,a,b+e*Math.cos(k),a+c*Math.sin(k),n)))):r.push({op:"lineTo",data:[b,a]},{op:"lineTo",data:[b+e*Math.cos(f),a+c*Math.sin(f)]})),{type:"path",ops:r}}function J(b,a){var e=[];if(b.length){var c=a.maxRandomnessOffset||0,f=b.length;if(2<f){e.push({op:"move",data:[b[0][0]+u(c,a),b[0][1]+u(c,a)]});for(var k=1;k<f;k++)e.push({op:"lineTo",data:[b[k][0]+u(c,a),b[k][1]+u(c,a)]})}}return{type:"fillPath",
ops:e}}function G(b,a){var e=ma,c=a.fillStyle||"hachure";if(!A[c])switch(c){case "zigzag":A[c]||(A[c]=new na(e));break;case "cross-hatch":A[c]||(A[c]=new oa(e));break;case "dots":A[c]||(A[c]=new pa(e));break;case "dashed":A[c]||(A[c]=new qa(e));break;case "zigzag-line":A[c]||(A[c]=new ra(e));break;default:c="hachure",A[c]||(A[c]=new U(e))}return A[c].fillPolygon(b,a)}function ea(b){return b.randomizer||(b.randomizer=new sa(b.seed||0)),b.randomizer.next()}function O(b,a,e){return e.roughness*(3<arguments.length&&
void 0!==arguments[3]?arguments[3]:1)*(ea(e)*(a-b)+b)}function u(b,a){return O(-b,b,a,2<arguments.length&&void 0!==arguments[2]?arguments[2]:1)}function D(b,a,e,c,f){var k=5<arguments.length&&void 0!==arguments[5]&&arguments[5]?f.disableMultiStrokeFill:f.disableMultiStroke,d=fa(b,a,e,c,f,!0,!1);if(k)return d;k=fa(b,a,e,c,f,!0,!0);return d.concat(k)}function fa(b,a,e,c,f,k,d){var g=Math.pow(b-e,2)+Math.pow(a-c,2),n=Math.sqrt(g),m=1,m=200>n?1:500<n?.4:-.0016668*n+1.233334,r=f.maxRandomnessOffset||0;
r*r*100>g&&(r=n/10);var h=r/2,g=.2+.2*ea(f),n=f.bowing*f.maxRandomnessOffset*(c-a)/200,t=f.bowing*f.maxRandomnessOffset*(b-e)/200,n=u(n,f,m),t=u(t,f,m),l=[],q=function(){return u(h,f,m)},p=function(){return u(r,f,m)},v=f.preserveVertices;return k&&(d?l.push({op:"move",data:[b+(v?0:q()),a+(v?0:q())]}):l.push({op:"move",data:[b+(v?0:u(r,f,m)),a+(v?0:u(r,f,m))]})),d?l.push({op:"bcurveTo",data:[n+b+(e-b)*g+q(),t+a+(c-a)*g+q(),n+b+2*(e-b)*g+q(),t+a+2*(c-a)*g+q(),e+(v?0:q()),c+(v?0:q())]}):l.push({op:"bcurveTo",
data:[n+b+(e-b)*g+p(),t+a+(c-a)*g+p(),n+b+2*(e-b)*g+p(),t+a+2*(c-a)*g+p(),e+(v?0:p()),c+(v?0:p())]}),l}function Z(b,a,e){var c=[];c.push([b[0][0]+u(a,e),b[0][1]+u(a,e)]);c.push([b[0][0]+u(a,e),b[0][1]+u(a,e)]);for(var f=1;f<b.length;f++)c.push([b[f][0]+u(a,e),b[f][1]+u(a,e)]),f===b.length-1&&c.push([b[f][0]+u(a,e),b[f][1]+u(a,e)]);return P(c,null,e)}function P(b,a,e){var c=b.length,f=[];if(3<c){var k=[],d=1-e.curveTightness;f.push({op:"move",data:[b[1][0],b[1][1]]});for(var g=1;g+2<c;g++){var n=b[g];
k[0]=[n[0],n[1]];k[1]=[n[0]+(d*b[g+1][0]-d*b[g-1][0])/6,n[1]+(d*b[g+1][1]-d*b[g-1][1])/6];k[2]=[b[g+1][0]+(d*b[g][0]-d*b[g+2][0])/6,b[g+1][1]+(d*b[g][1]-d*b[g+2][1])/6];k[3]=[b[g+1][0],b[g+1][1]];f.push({op:"bcurveTo",data:[k[1][0],k[1][1],k[2][0],k[2][1],k[3][0],k[3][1]]})}a&&2===a.length&&(b=e.maxRandomnessOffset,f.push({op:"lineTo",data:[a[0]+u(b,e),a[1]+u(b,e)]}))}else 3===c?(f.push({op:"move",data:[b[1][0],b[1][1]]}),f.push({op:"bcurveTo",data:[b[1][0],b[1][1],b[2][0],b[2][1],b[2][0],b[2][1]]})):
2===c&&f.push.apply(f,_toConsumableArray(D(b[0][0],b[0][1],b[1][0],b[1][1],e)));return f}function ba(b,a,e,c,f,k,d,g){var n=[],m=[],r=u(.5,g)-Math.PI/2;m.push([u(k,g)+a+.9*c*Math.cos(r-b),u(k,g)+e+.9*f*Math.sin(r-b)]);for(var h=r;h<2*Math.PI+r-.01;h+=b){var t=[u(k,g)+a+c*Math.cos(h),u(k,g)+e+f*Math.sin(h)];n.push(t);m.push(t)}return m.push([u(k,g)+a+c*Math.cos(r+2*Math.PI+.5*d),u(k,g)+e+f*Math.sin(r+2*Math.PI+.5*d)]),m.push([u(k,g)+a+.98*c*Math.cos(r+d),u(k,g)+e+.98*f*Math.sin(r+d)]),m.push([u(k,
g)+a+.9*c*Math.cos(r+.5*d),u(k,g)+e+.9*f*Math.sin(r+.5*d)]),[m,n]}function da(b,a,e,c,f,k,d,g,n){var m=k+u(.1,n);k=[];for(k.push([u(g,n)+a+.9*c*Math.cos(m-b),u(g,n)+e+.9*f*Math.sin(m-b)]);m<=d;m+=b)k.push([u(g,n)+a+c*Math.cos(m),u(g,n)+e+f*Math.sin(m)]);return k.push([a+c*Math.cos(d),e+f*Math.sin(d)]),k.push([a+c*Math.cos(d),e+f*Math.sin(d)]),P(k,null,n)}function ta(b,a,e,c,f,d,r,g){for(var k=[],m=[g.maxRandomnessOffset||1,(g.maxRandomnessOffset||1)+.3],h,w=g.disableMultiStroke?1:2,t=g.preserveVertices,
l=0;l<w;l++)0===l?k.push({op:"move",data:[r[0],r[1]]}):k.push({op:"move",data:[r[0]+(t?0:u(m[0],g)),r[1]+(t?0:u(m[0],g))]}),h=t?[f,d]:[f+u(m[l],g),d+u(m[l],g)],k.push({op:"bcurveTo",data:[b+u(m[l],g),a+u(m[l],g),e+u(m[l],g),c+u(m[l],g),h[0],h[1]]});return k}function Q(b,a){return Math.pow(b[0]-a[0],2)+Math.pow(b[1]-a[1],2)}function E(b,a,e){return[b[0]+(a[0]-b[0])*e,b[1]+(a[1]-b[1])*e]}function V(b,a,e,c){c=c||[];var f=b[a+0],d=b[a+1],r=b[a+2],g=b[a+3],n=3*d[0]-2*f[0]-g[0],n=n*n,d=3*d[1]-2*f[1]-g[1],
d=d*d,m=3*r[0]-2*g[0]-f[0],m=m*m,f=3*r[1]-2*g[1]-f[1];(f*=f,n<m&&(n=m),d<f&&(d=f),n+d)<e?(e=b[a+0],c.length?1<(h=c[c.length-1],l=e,Math.sqrt(Q(h,l)))&&c.push(e):c.push(e),c.push(b[a+3])):(h=b[a+0],n=b[a+1],l=b[a+2],b=b[a+3],a=E(h,n,.5),f=E(n,l,.5),l=E(l,b,.5),n=E(a,f,.5),f=E(f,l,.5),r=E(n,f,.5),V([h,a,n,r],0,e,c),V([r,f,l,b],0,e,c));var h,l;return c}function R(b,a,e,c,f){f=f||[];for(var d=b[a],r=b[e-1],g=0,n=1,m=a+1;m<e-1;++m){var h;h=b[m];var l=d,t=r,p=Q(l,t);0===p?h=Q(h,l):(p=((h[0]-l[0])*(t[0]-
l[0])+(h[1]-l[1])*(t[1]-l[1]))/p,h=(p=Math.max(0,Math.min(1,p)),Q(h,E(l,t,p))));h>g&&(g=h,n=m)}return Math.sqrt(g)>c?(R(b,a,n+1,c,f),R(b,n,e,c,f)):(f.length||f.push(d),f.push(r)),f}function ga(b){for(var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:.15,e=2<arguments.length?arguments[2]:void 0,c=[],f=(b.length-1)/3,d=0;d<f;d++)V(b,3*d,a,c);return e&&0<e?R(c,0,c.length,e):c}var U=function(){function b(a){_classCallCheck(this,b);this.helper=a}_createClass(b,[{key:"fillPolygon",value:function(a,
e){return this._fillPolygon(a,e)}},{key:"_fillPolygon",value:function(a,e){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!1,f=C(a,e);c&&(c=this.connectingLines(a,f),f=f.concat(c));return{type:"fillSketch",ops:this.renderLines(f,e)}}},{key:"renderLines",value:function(a,e){var c=[],f=_createForOfIteratorHelper(a),b;try{for(f.s();!(b=f.n()).done;){var d=b.value;c.push.apply(c,_toConsumableArray(this.helper.doubleLineOps(d[0][0],d[0][1],d[1][0],d[1][1],e)))}}catch(g){f.e(g)}finally{f.f()}return c}},
{key:"connectingLines",value:function(a,e){var c=[];if(1<e.length)for(var f=1;f<e.length;f++){var b=e[f-1];3>h(b)||(b=[e[f][0],b[1]],3<h(b)&&(b=this.splitOnIntersections(a,b),c.push.apply(c,_toConsumableArray(b))))}return c}},{key:"midPointInPolygon",value:function(a,e){return p(a,(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2)}},{key:"splitOnIntersections",value:function(a,e){for(var c=Math.max(5,.1*h(e)),b=[],d=0;d<a.length;d++){var r=a[d],g=a[(d+1)%a.length];if(B.apply(void 0,[r,g].concat(_toConsumableArray(e)))&&
(r=l(r,g,e[0],e[1]))){var g=h([r,e[0]]),n=h([r,e[1]]);g>c&&n>c&&b.push({point:r,distance:g})}}if(1<b.length){c=b.sort(function(a,c){return a.distance-c.distance}).map(function(a){return a.point});if(p.apply(void 0,[a].concat(_toConsumableArray(e[0])))||c.shift(),p.apply(void 0,[a].concat(_toConsumableArray(e[1])))||c.pop(),1>=c.length)return this.midPointInPolygon(a,e)?[e]:[];c=[e[0]].concat(_toConsumableArray(c),[e[1]]);b=[];for(d=0;d<c.length-1;d+=2)r=[c[d],c[d+1]],this.midPointInPolygon(a,r)&&
b.push(r);return b}return this.midPointInPolygon(a,e)?[e]:[]}}]);return b}(),na=function(b){function a(){_classCallCheck(this,a);return e.apply(this,arguments)}_inherits(a,b);var e=_createSuper(a);_createClass(a,[{key:"fillPolygon",value:function(a,e){return this._fillPolygon(a,e,!0)}}]);return a}(U),oa=function(b){function a(){_classCallCheck(this,a);return e.apply(this,arguments)}_inherits(a,b);var e=_createSuper(a);_createClass(a,[{key:"fillPolygon",value:function(a,e){var c=this._fillPolygon(a,
e),b=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),b=this._fillPolygon(a,b);return c.ops=c.ops.concat(b.ops),c}}]);return a}(U),pa=function(){function b(a){_classCallCheck(this,b);this.helper=a}_createClass(b,[{key:"fillPolygon",value:function(a,e){var c=C(a,e=Object.assign({},e,{curveStepCount:4,hachureAngle:0,roughness:1}));return this.dotsOnLines(c,e)}},{key:"dotsOnLines",value:function(a,e){var c=[],b=e.hachureGap;0>b&&(b=4*e.strokeWidth);var b=Math.max(b,.1),d=e.fillWeight;0>d&&(d=e.strokeWidth/
2);var r=b/4,g=_createForOfIteratorHelper(a),n;try{for(g.s();!(n=g.n()).done;)for(var m=n.value,l=h(m),w=Math.ceil(l/b)-1,t=l-w*b,p=(m[0][0]+m[1][0])/2-b/4,q=Math.min(m[0][1],m[1][1]),u=0;u<w;u++){var v=q+t+u*b,z=this.helper.randOffsetWithRange(p-r,p+r,e),y=this.helper.randOffsetWithRange(v-r,v+r,e),F=this.helper.ellipse(z,y,d,d,e);c.push.apply(c,_toConsumableArray(F.ops))}}catch(ha){g.e(ha)}finally{g.f()}return{type:"fillSketch",ops:c}}}]);return b}(),qa=function(){function b(a){_classCallCheck(this,
b);this.helper=a}_createClass(b,[{key:"fillPolygon",value:function(a,e){var c=C(a,e);return{type:"fillSketch",ops:this.dashedLine(c,e)}}},{key:"dashedLine",value:function(a,e){var c=this,b=0>e.dashOffset?0>e.hachureGap?4*e.strokeWidth:e.hachureGap:e.dashOffset,d=0>e.dashGap?0>e.hachureGap?4*e.strokeWidth:e.hachureGap:e.dashGap,r=[];return a.forEach(function(a){var f=h(a),g=Math.floor(f/(b+d)),f=(f+d-g*(b+d))/2,k=a[0],l=a[1];k[0]>l[0]&&(k=a[1],l=a[0]);a=Math.atan((l[1]-k[1])/(l[0]-k[0]));for(l=0;l<
g;l++){var t=l*(b+d),p=t+b,t=[k[0]+t*Math.cos(a)+f*Math.cos(a),k[1]+t*Math.sin(a)+f*Math.sin(a)],p=[k[0]+p*Math.cos(a)+f*Math.cos(a),k[1]+p*Math.sin(a)+f*Math.sin(a)];r.push.apply(r,_toConsumableArray(c.helper.doubleLineOps(t[0],t[1],p[0],p[1],e)))}}),r}}]);return b}(),ra=function(){function b(a){_classCallCheck(this,b);this.helper=a}_createClass(b,[{key:"fillPolygon",value:function(a,e){var c=0>e.hachureGap?4*e.strokeWidth:e.hachureGap,b=0>e.zigzagOffset?c:e.zigzagOffset,c=C(a,e=Object.assign({},
e,{hachureGap:c+b}));return{type:"fillSketch",ops:this.zigzagLines(c,b,e)}}},{key:"zigzagLines",value:function(a,e,c){var b=this,d=[];return a.forEach(function(a){var f=h(a),f=Math.round(f/(2*e)),k=a[0],m=a[1];k[0]>m[0]&&(k=a[1],m=a[0]);a=Math.atan((m[1]-k[1])/(m[0]-k[0]));for(m=0;m<f;m++){var l=2*m*e,r=2*(m+1)*e,t=Math.sqrt(2*Math.pow(e,2)),l=[k[0]+l*Math.cos(a),k[1]+l*Math.sin(a)],r=[k[0]+r*Math.cos(a),k[1]+r*Math.sin(a)],t=[l[0]+t*Math.cos(a+Math.PI/4),l[1]+t*Math.sin(a+Math.PI/4)];d.push.apply(d,
_toConsumableArray(b.helper.doubleLineOps(l[0],l[1],t[0],t[1],c)).concat(_toConsumableArray(b.helper.doubleLineOps(t[0],t[1],r[0],r[1],c))))}}),d}}]);return b}(),A={},sa=function(){function b(a){_classCallCheck(this,b);this.seed=a}_createClass(b,[{key:"next",value:function(){return this.seed?(Math.pow(2,31)-1&(this.seed=Math.imul(48271,this.seed)))/Math.pow(2,31):Math.random()}}]);return b}(),K={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0},ma={randOffset:function(b,
a){return u(b,a)},randOffsetWithRange:function(b,a,e){return O(b,a,e)},ellipse:function(b,a,e,c,d){e=aa(e,c,d);return T(b,a,d,e).opset},doubleLineOps:function(b,a,e,c,d){return D(b,a,e,c,d,!0)}},S=function(){function b(a){_classCallCheck(this,b);this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,
combineNestedSvgPaths:!1,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1};this.config=a||{};this.config.options&&(this.defaultOptions=this._o(this.config.options))}_createClass(b,[{key:"_o",value:function(a){return a?Object.assign({},this.defaultOptions,a):this.defaultOptions}},{key:"_d",value:function(a,e,c){return{shape:a,sets:e||[],options:c||this.defaultOptions}}},{key:"line",value:function(a,e,c,b,d){d=this._o(d);return this._d("line",[{type:"path",ops:D(a,e,c,b,d)}],d)}},
{key:"rectangle",value:function(a,e,c,b,d){d=this._o(d);var f=[],g;g=N([[a,e],[a+c,e],[a+c,e+b],[a,e+b]],!0,d);d.fill&&(a=[[a,e],[a+c,e],[a+c,e+b],[a,e+b]],"solid"===d.fillStyle?f.push(J(a,d)):f.push(G(a,d)));return"none"!==d.stroke&&f.push(g),this._d("rectangle",f,d)}},{key:"ellipse",value:function(a,e,c,b,d){d=this._o(d);var f=[];b=aa(c,b,d);c=T(a,e,d,b);d.fill&&("solid"===d.fillStyle?(a=T(a,e,d,b).opset,a.type="fillPath",f.push(a)):f.push(G(c.estimatedPoints,d)));return"none"!==d.stroke&&f.push(c.opset),
this._d("ellipse",f,d)}},{key:"circle",value:function(a,e,c,b){a=this.ellipse(a,e,c,c,b);return a.shape="circle",a}},{key:"linearPath",value:function(a,e){var c=this._o(e);return this._d("linearPath",[N(a,!1,c)],c)}},{key:"arc",value:function(a,e,c,b,d,h){var f=6<arguments.length&&void 0!==arguments[6]?arguments[6]:!1,k=this._o(7<arguments.length?arguments[7]:void 0),m=[],l=ca(a,e,c,b,d,h,f,!0,k);f&&k.fill&&("solid"===k.fillStyle?(f=ca(a,e,c,b,d,h,!0,!1,k),f.type="fillPath",m.push(f)):m.push(function(a,
c,e,b,d,f,g){e=Math.abs(e/2);b=Math.abs(b/2);e+=u(.01*e,g);for(b+=u(.01*b,g);0>d;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);for(var k=(f-d)/g.curveStepCount,m=[];d<=f;d+=k)m.push([a+e*Math.cos(d),c+b*Math.sin(d)]);return m.push([a+e*Math.cos(f),c+b*Math.sin(f)]),m.push([a,c]),G(m,g)}(a,e,c,b,d,h,k)));return"none"!==k.stroke&&m.push(l),this._d("arc",m,k)}},{key:"curve",value:function(a,e){var c=this._o(e),b=[],d=la(a,c);if(c.fill&&"none"!==c.fill&&3<=a.length){var h=ga(function(a){var c=
1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,e=a.length;if(3>e)throw Error("A curve must have at least three points.");var b=[];if(3===e)b.push(_toConsumableArray(a[0]),_toConsumableArray(a[1]),_toConsumableArray(a[2]),_toConsumableArray(a[2]));else{e=[];e.push(a[0],a[0]);for(var d=1;d<a.length;d++)e.push(a[d]),d===a.length-1&&e.push(a[d]);d=[];c=1-c;b.push(_toConsumableArray(e[0]));for(var f=1;f+2<e.length;f++){var g=e[f];d[0]=[g[0],g[1]];d[1]=[g[0]+(c*e[f+1][0]-c*e[f-1][0])/6,g[1]+(c*
e[f+1][1]-c*e[f-1][1])/6];d[2]=[e[f+1][0]+(c*e[f][0]-c*e[f+2][0])/6,e[f+1][1]+(c*e[f][1]-c*e[f+2][1])/6];d[3]=[e[f+1][0],e[f+1][1]];b.push(d[1],d[2],d[3])}}return b}(a),10,(1+c.roughness)/2);"solid"===c.fillStyle?b.push(J(h,c)):b.push(G(h,c))}return"none"!==c.stroke&&b.push(d),this._d("curve",b,c)}},{key:"polygon",value:function(a,e){var c=this._o(e),b=[],d=N(a,!0,c);return c.fill&&("solid"===c.fillStyle?b.push(J(a,c)):b.push(G(a,c))),"none"!==c.stroke&&b.push(d),this._d("polygon",b,c)}},{key:"path",
value:function(a,e){var c=this._o(e),b=[];if(!a)return this._d("path",b,c);a=(a||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");var d=c.fill&&"transparent"!==c.fill&&"none"!==c.fill,h="none"!==c.stroke,g=!!(c.simplification&&1>c.simplification),l=function(a,c,e){var b=X(W(H(a))),d=[],f=[];a=[0,0];var g=[],k=function(){var a;4<=g.length&&(a=f).push.apply(a,_toConsumableArray(ga(g,c)));g=[]},h=function(){k();f.length&&(d.push(f),f=[])},b=_createForOfIteratorHelper(b),l;try{for(b.s();!(l=
b.n()).done;){var m=l.value,n=m.data;switch(m.key){case "M":h();a=[n[0],n[1]];f.push(a);break;case "L":k();f.push([n[0],n[1]]);break;case "C":if(!g.length){var r=f.length?f[f.length-1]:a;g.push([r[0],r[1]])}g.push([n[0],n[1]]);g.push([n[2],n[3]]);g.push([n[4],n[5]]);break;case "Z":k(),f.push([a[0],a[1]])}}}catch(ja){b.e(ja)}finally{b.f()}if(h(),!e)return d;l=[];for(m=0;m<d.length;m++)n=d[m],n=R(n,0,n.length,e),n.length&&l.push(n);return l}(a,1,g?4-4*c.simplification:(1+c.roughness)/2);if(d)if(c.combineNestedSvgPaths){var m=
[];l.forEach(function(a){return m.push.apply(m,_toConsumableArray(a))});"solid"===c.fillStyle?b.push(J(m,c)):b.push(G(m,c))}else l.forEach(function(a){"solid"===c.fillStyle?b.push(J(a,c)):b.push(G(a,c))});return h&&(g?l.forEach(function(a){b.push(N(a,!1,c))}):b.push(function(a,c){var e=X(W(H(a))),b=[],d=[0,0],f=[0,0],e=_createForOfIteratorHelper(e),g;try{for(e.s();!(g=e.n()).done;){var k=g.value,h=k.data;switch(k.key){case "M":if("break"===function(){var a=1*(c.maxRandomnessOffset||0),e=c.preserveVertices;
b.push({op:"move",data:h.map(function(b){return b+(e?0:u(a,c))})});f=[h[0],h[1]];d=[h[0],h[1]];return"break"}())break;case "L":b.push.apply(b,_toConsumableArray(D(f[0],f[1],h[0],h[1],c)));f=[h[0],h[1]];break;case "C":var l=_slicedToArray(h,6),m=l[4],n=l[5];b.push.apply(b,_toConsumableArray(ta(l[0],l[1],l[2],l[3],m,n,f,c)));f=[m,n];break;case "Z":b.push.apply(b,_toConsumableArray(D(f[0],f[1],d[0],d[1],c))),f=[d[0],d[1]]}}}catch(ia){e.e(ia)}finally{e.f()}return{type:"path",ops:b}}(a,c))),this._d("path",
b,c)}},{key:"opsToPath",value:function(a,e){var c="",b=_createForOfIteratorHelper(a.ops),d;try{for(b.s();!(d=b.n()).done;){var h=d.value,g="number"==typeof e&&0<=e?h.data.map(function(a){return+a.toFixed(e)}):h.data;switch(h.op){case "move":c+="M".concat(g[0]," ").concat(g[1]," ");break;case "bcurveTo":c+="C".concat(g[0]," ").concat(g[1],", ").concat(g[2]," ").concat(g[3],", ").concat(g[4]," ").concat(g[5]," ");break;case "lineTo":c+="L".concat(g[0]," ").concat(g[1]," ")}}}catch(n){b.e(n)}finally{b.f()}return c.trim()}},
{key:"toPaths",value:function(a){var e=a.options||this.defaultOptions,c=[];a=_createForOfIteratorHelper(a.sets||[]);var b;try{for(a.s();!(b=a.n()).done;){var d=b.value,h=null;switch(d.type){case "path":h={d:this.opsToPath(d),stroke:e.stroke,strokeWidth:e.strokeWidth,fill:"none"};break;case "fillPath":h={d:this.opsToPath(d),stroke:"none",strokeWidth:0,fill:e.fill||"none"};break;case "fillSketch":h=this.fillSketch(d,e)}h&&c.push(h)}}catch(g){a.e(g)}finally{a.f()}return c}},{key:"fillSketch",value:function(a,
e){var c=e.fillWeight;return 0>c&&(c=e.strokeWidth/2),{d:this.opsToPath(a),stroke:e.fill||"none",strokeWidth:c,fill:"none"}}}],[{key:"newSeed",value:function(){return Math.floor(Math.random()*Math.pow(2,31))}}]);return b}(),ua=function(){function b(a,e){_classCallCheck(this,b);this.canvas=a;this.ctx=this.canvas.getContext("2d");this.gen=new S(e)}_createClass(b,[{key:"draw",value:function(a){var e=a.sets||[],c=a.options||this.getDefaultOptions(),b=this.ctx,e=_createForOfIteratorHelper(e),d;try{for(e.s();!(d=
e.n()).done;){var h=d.value;switch(h.type){case "path":b.save();b.strokeStyle="none"===c.stroke?"transparent":c.stroke;b.lineWidth=c.strokeWidth;c.strokeLineDash&&b.setLineDash(c.strokeLineDash);c.strokeLineDashOffset&&(b.lineDashOffset=c.strokeLineDashOffset);this._drawToContext(b,h);b.restore();break;case "fillPath":b.save();b.fillStyle=c.fill||"";this._drawToContext(b,h,"curve"===a.shape||"polygon"===a.shape?"evenodd":"nonzero");b.restore();break;case "fillSketch":this.fillSketch(b,h,c)}}}catch(g){e.e(g)}finally{e.f()}}},
{key:"fillSketch",value:function(a,e,c){var b=c.fillWeight;0>b&&(b=c.strokeWidth/2);a.save();c.fillLineDash&&a.setLineDash(c.fillLineDash);c.fillLineDashOffset&&(a.lineDashOffset=c.fillLineDashOffset);a.strokeStyle=c.fill||"";a.lineWidth=b;this._drawToContext(a,e);a.restore()}},{key:"_drawToContext",value:function(a,e){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"nonzero";a.beginPath();var b=_createForOfIteratorHelper(e.ops),d;try{for(b.s();!(d=b.n()).done;){var h=d.value,g=h.data;
switch(h.op){case "move":a.moveTo(g[0],g[1]);break;case "bcurveTo":a.bezierCurveTo(g[0],g[1],g[2],g[3],g[4],g[5]);break;case "lineTo":a.lineTo(g[0],g[1])}}}catch(n){b.e(n)}finally{b.f()}"fillPath"===e.type?a.fill(c):a.stroke()}},{key:"getDefaultOptions",value:function(){return this.gen.defaultOptions}},{key:"line",value:function(a,b,c,d,k){a=this.gen.line(a,b,c,d,k);return this.draw(a),a}},{key:"rectangle",value:function(a,b,c,d,k){a=this.gen.rectangle(a,b,c,d,k);return this.draw(a),a}},{key:"ellipse",
value:function(a,b,c,d,k){a=this.gen.ellipse(a,b,c,d,k);return this.draw(a),a}},{key:"circle",value:function(a,b,c,d){a=this.gen.circle(a,b,c,d);return this.draw(a),a}},{key:"linearPath",value:function(a,b){var c=this.gen.linearPath(a,b);return this.draw(c),c}},{key:"polygon",value:function(a,b){var c=this.gen.polygon(a,b);return this.draw(c),c}},{key:"arc",value:function(a,b,c,d,k,h){var e=this.gen.arc(a,b,c,d,k,h,6<arguments.length&&void 0!==arguments[6]?arguments[6]:!1,7<arguments.length?arguments[7]:
void 0);return this.draw(e),e}},{key:"curve",value:function(a,b){var c=this.gen.curve(a,b);return this.draw(c),c}},{key:"path",value:function(a,b){var c=this.gen.path(a,b);return this.draw(c),c}},{key:"generator",get:function(){return this.gen}}]);return b}(),va=function(){function b(a,e){_classCallCheck(this,b);this.svg=a;this.gen=new S(e)}_createClass(b,[{key:"draw",value:function(a){var b=a.sets||[],c=a.options||this.getDefaultOptions(),d=this.svg.ownerDocument||window.document,k=d.createElementNS("http://www.w3.org/2000/svg",
"g"),h=a.options.fixedDecimalPlaceDigits,b=_createForOfIteratorHelper(b),g;try{for(b.s();!(g=b.n()).done;){var l=g.value,m=null;switch(l.type){case "path":m=d.createElementNS("http://www.w3.org/2000/svg","path");m.setAttribute("d",this.opsToPath(l,h));m.setAttribute("stroke",c.stroke);m.setAttribute("stroke-width",c.strokeWidth+"");m.setAttribute("fill","none");c.strokeLineDash&&m.setAttribute("stroke-dasharray",c.strokeLineDash.join(" ").trim());c.strokeLineDashOffset&&m.setAttribute("stroke-dashoffset",
"".concat(c.strokeLineDashOffset));break;case "fillPath":m=d.createElementNS("http://www.w3.org/2000/svg","path");m.setAttribute("d",this.opsToPath(l,h));m.setAttribute("stroke","none");m.setAttribute("stroke-width","0");m.setAttribute("fill",c.fill||"");"curve"!==a.shape&&"polygon"!==a.shape||m.setAttribute("fill-rule","evenodd");break;case "fillSketch":m=this.fillSketch(d,l,c)}m&&k.appendChild(m)}}catch(x){b.e(x)}finally{b.f()}return k}},{key:"fillSketch",value:function(a,b,c){var e=c.fillWeight;
0>e&&(e=c.strokeWidth/2);a=a.createElementNS("http://www.w3.org/2000/svg","path");return a.setAttribute("d",this.opsToPath(b,c.fixedDecimalPlaceDigits)),a.setAttribute("stroke",c.fill||""),a.setAttribute("stroke-width",e+""),a.setAttribute("fill","none"),c.fillLineDash&&a.setAttribute("stroke-dasharray",c.fillLineDash.join(" ").trim()),c.fillLineDashOffset&&a.setAttribute("stroke-dashoffset","".concat(c.fillLineDashOffset)),a}},{key:"getDefaultOptions",value:function(){return this.gen.defaultOptions}},
{key:"opsToPath",value:function(a,b){return this.gen.opsToPath(a,b)}},{key:"line",value:function(a,b,c,d,h){a=this.gen.line(a,b,c,d,h);return this.draw(a)}},{key:"rectangle",value:function(a,b,c,d,h){a=this.gen.rectangle(a,b,c,d,h);return this.draw(a)}},{key:"ellipse",value:function(a,b,c,d,h){a=this.gen.ellipse(a,b,c,d,h);return this.draw(a)}},{key:"circle",value:function(a,b,c,d){a=this.gen.circle(a,b,c,d);return this.draw(a)}},{key:"linearPath",value:function(a,b){var c=this.gen.linearPath(a,b);
return this.draw(c)}},{key:"polygon",value:function(a,b){var c=this.gen.polygon(a,b);return this.draw(c)}},{key:"arc",value:function(a,b,c,d,h,l){var e=this.gen.arc(a,b,c,d,h,l,6<arguments.length&&void 0!==arguments[6]?arguments[6]:!1,7<arguments.length?arguments[7]:void 0);return this.draw(e)}},{key:"curve",value:function(a,b){var c=this.gen.curve(a,b);return this.draw(c)}},{key:"path",value:function(a,b){var c=this.gen.path(a,b);return this.draw(c)}},{key:"generator",get:function(){return this.gen}}]);
return b}();return{canvas:function(b,a){return new ua(b,a)},svg:function(b,a){return new va(b,a)},generator:function(b){return new S(b)},newSeed:function(){return S.newSeed()}}}();
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a,b){var c="",d=0;for(null!=b&&b||(a=Base64._utf8_encode(a));d<a.length;){var e=a.charCodeAt(d++);b=a.charCodeAt(d++);var f=a.charCodeAt(d++);var g=e>>2;e=(e&3)<<4|b>>4;var k=(b&15)<<2|f>>6;var l=f&63;isNaN(b)?k=l=64:isNaN(f)&&(l=64);c=c+this._keyStr.charAt(g)+this._keyStr.charAt(e)+this._keyStr.charAt(k)+this._keyStr.charAt(l)}return c},decode:function(a,b){b=null!=b?b:!1;var c="",d=0;for(a=a.replace(/[^A-Za-z0-9\+\/=]/g,
"");d<a.length;){var e=this._keyStr.indexOf(a.charAt(d++));var f=this._keyStr.indexOf(a.charAt(d++));var g=this._keyStr.indexOf(a.charAt(d++));var k=this._keyStr.indexOf(a.charAt(d++));e=e<<2|f>>4;f=(f&15)<<4|g>>2;var l=(g&3)<<6|k;c+=String.fromCharCode(e);64!=g&&(c+=String.fromCharCode(f));64!=k&&(c+=String.fromCharCode(l))}b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):
(127<d&&2048>d?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0;for(c1=c2=0;c<a.length;){var d=a.charCodeAt(c);128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3)}return b}};window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.mxLoadSettings=window.mxLoadSettings||"1"!=urlParams.configure;window.isSvgBrowser=!0;window.DRAWIO_BASE_URL=window.DRAWIO_BASE_URL||(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)?window.location.protocol+"//"+window.location.hostname:"https://app.diagrams.net");window.DRAWIO_LIGHTBOX_URL=window.DRAWIO_LIGHTBOX_URL||"https://viewer.diagrams.net";
window.EXPORT_URL=window.EXPORT_URL||"https://convert.diagrams.net/node/export";window.PLANT_URL=window.PLANT_URL||"https://plant-aws.diagrams.net";window.DRAW_MATH_URL=window.DRAW_MATH_URL||window.DRAWIO_BASE_URL+"/math/es5";window.VSD_CONVERT_URL=window.VSD_CONVERT_URL||"https://convert.diagrams.net/VsdConverter/api/converter";window.EMF_CONVERT_URL=window.EMF_CONVERT_URL||"https://convert.diagrams.net/emf2png/convertEMF";
window.REALTIME_URL=window.REALTIME_URL||("test.draw.io"==window.location.hostname&&"local"!=urlParams.cache?"https://app.diagrams.net/cache":"cache");window.DRAWIO_GITLAB_URL=window.DRAWIO_GITLAB_URL||"https://gitlab.com";window.DRAWIO_GITLAB_ID=window.DRAWIO_GITLAB_ID||"2b14debc5feeb18ba65358d863ec870e4cc9294b28c3c941cb3014eb4af9a9b4";window.DRAWIO_GITHUB_URL=window.DRAWIO_GITHUB_URL||"https://github.com";window.DRAWIO_GITHUB_API_URL=window.DRAWIO_GITHUB_API_URL||"https://api.github.com";
window.DRAWIO_GITHUB_ID=window.DRAWIO_GITHUB_ID||"Iv1.98d62f0431e40543";window.DRAWIO_DROPBOX_ID=window.DRAWIO_DROPBOX_ID||"jg02tc0onwmhlgm";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"import";window.PROXY_URL=window.PROXY_URL||"proxy";window.DRAWIO_VIEWER_URL=window.DRAWIO_VIEWER_URL||null;window.NOTIFICATIONS_URL=window.NOTIFICATIONS_URL||"https://www.draw.io/notifications";
window.RT_WEBSOCKET_URL=window.RT_WEBSOCKET_URL||"wss://"+("test.draw.io"==window.location.hostname?"app.diagrams.net":window.location.hostname)+"/rt";window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img";window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":window.DRAWIO_BASE_URL+"/iconSearch");
window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.NEW_DIAGRAM_CATS_PATH=window.NEW_DIAGRAM_CATS_PATH||"newDiagramCats";window.PLUGINS_BASE_PATH=window.PLUGINS_BASE_PATH||"";window.ALLOW_CUSTOM_PLUGINS=window.ALLOW_CUSTOM_PLUGINS||!1;window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.DRAWIO_CONFIG=window.DRAWIO_CONFIG||null;window.mxLoadResources=window.mxLoadResources||!1;
window.mxLanguage=window.mxLanguage||function(){var a=urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null);if(!a&&window.mxIsElectron&&(a=urlParams.appLang,null!=a)){var c=a.indexOf("-");0<=c&&(a=a.substring(0,c));a=a.toLowerCase()}}catch(d){isLocalStorage=!1}return a}();
window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Bahasa Melayu",bs:"Bosanski",bg:"Bulgarian",ca:"Català",cs:"Čeština",da:"Dansk",de:"Deutsch",et:"Eesti",en:"English",es:"Español",eu:"Euskara",fil:"Filipino",fr:"Français",gl:"Galego",it:"Italiano",hu:"Magyar",lt:"Lietuvių",lv:"Latviešu",nl:"Nederlands",no:"Norsk",pl:"Polski","pt-br":"Português (Brasil)",pt:"Português (Portugal)",ro:"Română",fi:"Suomi",sv:"Svenska",vi:"Tiếng Việt",tr:"Türkçe",el:"Ελληνικά",ru:"Русский",
sr:"Српски",uk:"Українська",he:"עברית",ar:"العربية",fa:"فارسی",th:"ไทย",ko:"한국어",ja:"日本語",zh:"简体中文","zh-tw":"繁體中文"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph",window.mxImageBasePath="mxgraph/images");
if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang);if(null==window.mxLanguage&&("test.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"viewer.diagrams.net"==window.location.hostname||"embed.diagrams.net"==window.location.hostname||"app.diagrams.net"==window.location.hostname||"jgraph.github.io"==window.location.hostname)&&(lang=navigator.language,null!=lang)){var dash=lang.indexOf("-");0<dash&&(lang=
lang.substring(0,dash));0<=window.mxLanguages.indexOf(lang)&&(window.mxLanguage=lang)}}"1"==urlParams.extAuth&&/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent)&&(urlParams.gapi="0",urlParams.noDevice="1","1"!=urlParams.lightbox&&(urlParams.lightbox="1",urlParams.layers="1",urlParams.viewerOnlyMsg="1"));window.location.hostname==DRAWIO_LIGHTBOX_URL.substring(DRAWIO_LIGHTBOX_URL.indexOf("//")+2)&&(urlParams.lightbox="1");"1"==urlParams.lightbox&&(urlParams.chrome="0");
"1"==urlParams.embedInline&&(urlParams.embed="1",urlParams.ui="sketch",urlParams.plugins="0",urlParams.proto="json",urlParams.prefetchFonts="1");function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)}
window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;"1"==urlParams.extAuth&&(a="sketch");if(null==a&&isLocalStorage&&"undefined"!==typeof JSON&&"1"!=urlParams.lightbox)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}try{null==a&&768>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)&&(null==urlParams.pages&&(urlParams.pages="1"),a="sketch")}catch(c){}"sketch"==a?(urlParams.sketch="1",a="min"):
"1"!=urlParams.dark||""!=a&&"kennedy"!=a||(a="dark");return a}();
(function(){if("undefined"!==typeof JSON&&isLocalStorage)try{var a=localStorage.getItem("1"==urlParams.sketch?".sketch-config":".drawio-config"),b=!0;null!=a&&(b=JSON.parse(a).showStartScreen);0==b&&(urlParams.splash="0")}catch(d){}a=urlParams["export"];null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),EXPORT_URL=a);a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+
a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;if("test.draw.io"!=a){var c="diagrams.net";b=a.length-c.length;c=a.lastIndexOf(c,b);-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io"))}})();
if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0";
"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");
"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,ADD_ATTR:["target","content"]};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";
window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;
window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"20.3.3",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),
IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),
IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:"undefined"!==typeof InstallTrigger,IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&
0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==
document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_LINUX:/\bLinux\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),
defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_SVG},link:function(a,b,c,d){c=c||document;var e=c.createElement("link");e.setAttribute("rel",a);e.setAttribute("href",b);e.setAttribute("charset","UTF-8");e.setAttribute("type","text/css");d&&e.setAttribute("id",d);c.getElementsByTagName("head")[0].appendChild(e)},loadResources:function(a,b){function c(){0==--d&&a()}for(var d=mxClient.defaultBundles.length,e=0;e<mxClient.defaultBundles.length;e++)mxResources.add(mxClient.defaultBundles[e],
b,c)},include:function(a){document.write('<script src="'+a+'">\x3c/script>')}};"undefined"==typeof mxLoadResources&&(mxLoadResources=!0);"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1);"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt");"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0);
"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".";"undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath="images";
mxClient.language="undefined"!=typeof mxLanguage&&null!=mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language;mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxDefaultLanguage:"en";mxLoadStylesheets&&mxClient.link("stylesheet","mxgraph/css/common.css");"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages);
var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var a=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,b=document.createElement("table");b.setAttribute("width","100%");b.setAttribute("height","100%");var c=document.createElement("tbody"),d=document.createElement("tr"),e=document.createElement("td");e.style.verticalAlign="top";mxLog.textarea=document.createElement("textarea");mxLog.textarea.setAttribute("wrap","off");
mxLog.textarea.setAttribute("readOnly","true");mxLog.textarea.style.height="100%";mxLog.textarea.style.resize="none";mxLog.textarea.value=mxLog.buffer;mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%";e.appendChild(mxLog.textarea);d.appendChild(e);c.appendChild(d);d=document.createElement("tr");mxLog.td=document.createElement("td");mxLog.td.style.verticalAlign="top";mxLog.td.setAttribute("height","30px");d.appendChild(mxLog.td);c.appendChild(d);b.appendChild(c);
mxLog.addButton("Info",function(g){mxLog.info()});mxLog.addButton("DOM",function(g){g=mxUtils.getInnerHtml(document.body);mxLog.debug(g)});mxLog.addButton("Trace",function(g){mxLog.TRACE=!mxLog.TRACE;mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")});mxLog.addButton("Copy",function(g){try{mxUtils.copy(mxLog.textarea.value)}catch(k){mxUtils.alert(k)}});mxLog.addButton("Show",function(g){try{mxUtils.popup(mxLog.textarea.value)}catch(k){mxUtils.alert(k)}});mxLog.addButton("Clear",
function(g){mxLog.textarea.value=""});d=c=0;"number"===typeof window.innerWidth?(c=window.innerHeight,d=window.innerWidth):(c=document.documentElement.clientHeight||document.body.clientHeight,d=document.body.clientWidth);mxLog.window=new mxWindow(a,b,Math.max(0,d-320),Math.max(0,c-210),300,160);mxLog.window.setMaximizable(!0);mxLog.window.setScrollable(!1);mxLog.window.setResizable(!0);mxLog.window.setClosable(!0);mxLog.window.destroyOnClose=!1;if((mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&
!mxClient.IS_SF&&"BackCompat"!=document.compatMode||11==document.documentMode){var f=mxLog.window.getElement();a=function(g,k){mxLog.textarea.style.height=Math.max(0,f.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,a);mxLog.window.addListener(mxEvent.MAXIMIZE,a);mxLog.window.addListener(mxEvent.NORMALIZE,a);mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(a,b){var c=document.createElement("button");mxUtils.write(c,
a);mxEvent.addListener(c,"click",b);mxLog.td.appendChild(c)},isVisible:function(){return null!=mxLog.window?mxLog.window.isVisible():!1},show:function(){mxLog.setVisible(!0)},setVisible:function(a){null==mxLog.window&&mxLog.init();null!=mxLog.window&&mxLog.window.setVisible(a)},enter:function(a){if(mxLog.TRACE)return mxLog.writeln("Entering "+a),(new Date).getTime()},leave:function(a,b){mxLog.TRACE&&(b=0!=b?" ("+((new Date).getTime()-b)+" ms)":"",mxLog.writeln("Leaving "+a+b))},debug:function(){mxLog.DEBUG&&
mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var a="",b=0;b<arguments.length;b++)a+=arguments[b],b<arguments.length-1&&(a+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=a,null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=a},writeln:function(){for(var a=
"",b=0;b<arguments.length;b++)a+=arguments[b],b<arguments.length-1&&(a+=" ");mxLog.write(a+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(a){if(null!=a){if(null==a[mxObjectIdentity.FIELD_NAME])if("object"===typeof a){var b=mxUtils.getFunctionName(a.constructor);a[mxObjectIdentity.FIELD_NAME]=b+"#"+mxObjectIdentity.counter++}else"function"===typeof a&&(a[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++);return a[mxObjectIdentity.FIELD_NAME]}return null},
clear:function(a){"object"!==typeof a&&"function"!==typeof a||delete a[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null;mxDictionary.prototype.clear=function(){this.map={}};mxDictionary.prototype.get=function(a){a=mxObjectIdentity.get(a);return this.map[a]};mxDictionary.prototype.put=function(a,b){a=mxObjectIdentity.get(a);var c=this.map[a];this.map[a]=b;return c};
mxDictionary.prototype.remove=function(a){a=mxObjectIdentity.get(a);var b=this.map[a];delete this.map[a];return b};mxDictionary.prototype.getKeys=function(){var a=[],b;for(b in this.map)a.push(b);return a};mxDictionary.prototype.getValues=function(){var a=[],b;for(b in this.map)a.push(this.map[b]);return a};mxDictionary.prototype.visit=function(a){for(var b in this.map)a(b,this.map[b])};
var mxResources={resources:{},extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(a){return null!=mxClient.languages?0<=mxUtils.indexOf(mxClient.languages,a):!0},getDefaultBundle:function(a,b){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(b)?a+mxResources.extension:null},getSpecialBundle:function(a,b){if(null==mxClient.languages||!this.isLanguageSupported(b)){var c=b.indexOf("-");0<c&&(b=b.substring(0,c))}return mxResources.loadSpecialBundle&&
mxResources.isLanguageSupported(b)&&b!=mxClient.defaultLanguage?a+"_"+b+mxResources.extension:null},add:function(a,b,c){b=null!=b?b:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE;if(b!=mxConstants.NONE){var d=mxResources.getDefaultBundle(a,b),e=mxResources.getSpecialBundle(a,b),f=function(){if(null!=e)if(c)mxUtils.get(e,function(l){mxResources.parse(l.getText());c()},function(){c()});else try{var k=mxUtils.load(e);k.isReady()&&mxResources.parse(k.getText())}catch(l){}else null!=
c&&c()};if(null!=d)if(c)mxUtils.get(d,function(k){mxResources.parse(k.getText());f()},function(){f()});else try{var g=mxUtils.load(d);g.isReady()&&mxResources.parse(g.getText());f()}catch(k){}else f()}},parse:function(a){if(null!=a){a=a.split("\n");for(var b=0;b<a.length;b++)if("#"!=a[b].charAt(0)){var c=a[b].indexOf("=");if(0<c){var d=a[b].substring(0,c),e=a[b].length;13==a[b].charCodeAt(e-1)&&e--;c=a[b].substring(c+1,e);this.resourcesEncoded?(c=c.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[d]=
unescape(c)):mxResources.resources[d]=c}}}},get:function(a,b,c){a=mxResources.resources[a];null==a&&(a=c);null!=a&&null!=b&&(a=mxResources.replacePlaceholders(a,b));return a},replacePlaceholders:function(a,b){for(var c=[],d=null,e=0;e<a.length;e++){var f=a.charAt(e);"{"==f?d="":null!=d&&"}"==f?(d=parseInt(d)-1,0<=d&&d<b.length&&c.push(b[d]),d=null):null!=d?d+=f:c.push(f)}return c.join("")},loadResources:function(a){mxResources.add(mxClient.basePath+"/resources/editor",null,function(){mxResources.add(mxClient.basePath+
"/resources/graph",null,a)})}};function mxPoint(a,b){this.x=null!=a?a:0;this.y=null!=b?b:0}mxPoint.prototype.x=null;mxPoint.prototype.y=null;mxPoint.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y};mxPoint.prototype.clone=function(){return mxUtils.clone(this)};function mxRectangle(a,b,c,d){mxPoint.call(this,a,b);this.width=null!=c?c:0;this.height=null!=d?d:0}mxRectangle.prototype=new mxPoint;mxRectangle.prototype.constructor=mxRectangle;mxRectangle.prototype.width=null;
mxRectangle.prototype.height=null;mxRectangle.prototype.setRect=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d};mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2};mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2};
mxRectangle.prototype.add=function(a){if(null!=a){var b=Math.min(this.x,a.x),c=Math.min(this.y,a.y),d=Math.max(this.x+this.width,a.x+a.width);a=Math.max(this.y+this.height,a.y+a.height);this.x=b;this.y=c;this.width=d-b;this.height=a-c}};mxRectangle.prototype.intersect=function(a){if(null!=a){var b=this.x+this.width,c=a.x+a.width,d=this.y+this.height,e=a.y+a.height;this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.width=Math.min(b,c)-this.x;this.height=Math.min(d,e)-this.y}};
mxRectangle.prototype.grow=function(a){this.x-=a;this.y-=a;this.width+=2*a;this.height+=2*a;return this};mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)};mxRectangle.prototype.rotate90=function(){var a=(this.width-this.height)/2;this.x+=a;this.y-=a;a=this.width;this.width=this.height;this.height=a};mxRectangle.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y&&a.width==this.width&&a.height==this.height};
mxRectangle.fromPoint=function(a){return new mxRectangle(a.x,a.y,0,0)};mxRectangle.fromRectangle=function(a){return new mxRectangle(a.x,a.y,a.width,a.height)};
var mxEffects={animateChanges:function(a,b,c){var d=0,e=function(){for(var g=!1,k=0;k<b.length;k++){var l=b[k];if(l instanceof mxGeometryChange||l instanceof mxTerminalChange||l instanceof mxValueChange||l instanceof mxChildChange||l instanceof mxStyleChange){var m=a.getView().getState(l.cell||l.child,!1);if(null!=m)if(g=!0,l.constructor!=mxGeometryChange||a.model.isEdge(l.cell))mxUtils.setOpacity(m.shape.node,100*d/10);else{var n=a.getView().scale,p=(l.geometry.x-l.previous.x)*n,r=(l.geometry.y-
l.previous.y)*n,q=(l.geometry.width-l.previous.width)*n;n*=l.geometry.height-l.previous.height;0==d?(m.x-=p,m.y-=r,m.width-=q,m.height-=n):(m.x+=p/10,m.y+=r/10,m.width+=q/10,m.height+=n/10);a.cellRenderer.redraw(m);mxEffects.cascadeOpacity(a,l.cell,100*d/10)}}}10>d&&g?(d++,window.setTimeout(e,f)):null!=c&&c()},f=30;e()},cascadeOpacity:function(a,b,c){for(var d=a.model.getChildCount(b),e=0;e<d;e++){var f=a.model.getChildAt(b,e),g=a.getView().getState(f);null!=g&&(mxUtils.setOpacity(g.shape.node,c),
mxEffects.cascadeOpacity(a,f,c))}b=a.model.getEdges(b);if(null!=b)for(e=0;e<b.length;e++)d=a.getView().getState(b[e]),null!=d&&mxUtils.setOpacity(d.shape.node,c)},fadeOut:function(a,b,c,d,e,f){d=d||40;e=e||30;var g=b||100;mxUtils.setOpacity(a,g);if(f||null==f){var k=function(){g=Math.max(g-d,0);mxUtils.setOpacity(a,g);0<g?window.setTimeout(k,e):(a.style.visibility="hidden",c&&a.parentNode&&a.parentNode.removeChild(a))};window.setTimeout(k,e)}else a.style.visibility="hidden",c&&a.parentNode&&a.parentNode.removeChild(a)}},
mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(a){null!=a.style&&(a.style.cursor="");a=a.childNodes;if(null!=a)for(var b=a.length,c=0;c<b;c+=1)mxUtils.removeCursors(a[c])},getCurrentStyle:function(){return mxClient.IS_IE&&(null==document.documentMode||9>document.documentMode)?function(a){return null!=a?a.currentStyle:null}:function(a){return null!=a?window.getComputedStyle(a,
""):null}}(),parseCssNumber:function(a){"thin"==a?a="2":"medium"==a?a="4":"thick"==a&&(a="6");a=parseFloat(a);isNaN(a)&&(a=0);return a},setPrefixedStyle:function(){var a=null;mxClient.IS_OT?a="O":mxClient.IS_SF||mxClient.IS_GC?a="Webkit":mxClient.IS_MT?a="Moz":mxClient.IS_IE&&9<=document.documentMode&&10>document.documentMode&&(a="ms");return function(b,c,d){b[c]=d;null!=a&&0<c.length&&(c=a+c.substring(0,1).toUpperCase()+c.substring(1),b[c]=d)}}(),hasScrollbars:function(a){a=mxUtils.getCurrentStyle(a);
return null!=a&&("scroll"==a.overflow||"auto"==a.overflow)},bind:function(a,b){return function(){return b.apply(a,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(c){mxLog.warn(c.message+" while evaluating "+a)}else try{b=eval(a)}catch(c){mxLog.warn(c.message+" while evaluating "+a)}return b},findNode:function(a,b,c){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=a.getAttribute(b);
if(null!=d&&d==c)return a}for(a=a.firstChild;null!=a;){d=mxUtils.findNode(a,b,c);if(null!=d)return d;a=a.nextSibling}return null},getFunctionName:function(a){var b=null;null!=a&&(null!=a.name?b=a.name:(b=mxUtils.trim(a.toString()),/^function\s/.test(b)&&(b=mxUtils.ltrim(b.substring(9)),a=b.indexOf("("),0<a&&(b=b.substring(0,a)))));return b},indexOf:function(a,b){if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(a[c]==b)return c;return-1},forEach:function(a,b){if(null!=a&&null!=b)for(var c=0;c<a.length;c++)b(a[c]);
return a},remove:function(a,b){var c=null;if("object"==typeof b)for(var d=mxUtils.indexOf(b,a);0<=d;)b.splice(d,1),c=a,d=mxUtils.indexOf(b,a);for(var e in b)b[e]==a&&(delete b[e],c=a);return c},isNode:function(a,b,c,d){return null==a||a.constructor!==Element||null!=b&&a.nodeName.toLowerCase()!=b.toLowerCase()?!1:null==c||a.getAttribute(c)==d},isAncestorNode:function(a,b){for(;null!=b;){if(b==a)return!0;b=b.parentNode}return!1},getChildNodes:function(a,b){b=b||mxConstants.NODETYPE_ELEMENT;var c=[];
for(a=a.firstChild;null!=a;)a.nodeType==b&&c.push(a),a=a.nextSibling;return c},importNode:function(a,b,c){return mxClient.IS_IE&&(null==document.documentMode||10>document.documentMode)?mxUtils.importNodeImplementation(a,b,c):a.importNode(b,c)},importNodeImplementation:function(a,b,c){switch(b.nodeType){case 1:var d=a.createElement(b.nodeName);if(b.attributes&&0<b.attributes.length)for(var e=0;e<b.attributes.length;e++)d.setAttribute(b.attributes[e].nodeName,b.getAttribute(b.attributes[e].nodeName));
if(c&&b.childNodes&&0<b.childNodes.length)for(e=0;e<b.childNodes.length;e++)d.appendChild(mxUtils.importNodeImplementation(a,b.childNodes[e],c));return d;case 3:case 4:case 8:return a.createTextNode(null!=b.nodeValue?b.nodeValue:b.value)}},createXmlDocument:function(){var a=null;document.implementation&&document.implementation.createDocument&&(a=document.implementation.createDocument("","",null));return a},parseXml:function(a){return(new DOMParser).parseFromString(a,"text/xml")},clearSelection:function(){return document.selection?
function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges()}:function(){}}(),removeWhitespace:function(a,b){for(a=b?a.previousSibling:a.nextSibling;null!=a&&a.nodeType==mxConstants.NODETYPE_TEXT;){var c=b?a.previousSibling:a.nextSibling,d=mxUtils.getTextContent(a);0==mxUtils.trim(d).length&&a.parentNode.removeChild(a);a=c}},htmlEntities:function(a,b){a=
String(a||"");a=a.replace(/&/g,"&amp;");a=a.replace(/"/g,"&quot;");a=a.replace(/'/g,"&#39;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");if(null==b||b)a=a.replace(/\n/g,"&#xa;");return a},decodeHtml:function(a){var b=document.createElement("textarea");b.innerHTML=a;return b.value},getXml:function(a,b){var c="";mxClient.IS_IE||mxClient.IS_IE11?c=mxUtils.getPrettyXml(a,"","",""):null!=window.XMLSerializer?c=(new XMLSerializer).serializeToString(a):null!=a.xml&&(c=a.xml.replace(/\r\n\t[\t]*/g,
"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n"));return c.replace(/\n/g,b||"&#xa;")},getPrettyXml:function(a,b,c,d,e){var f=[];if(null!=a)if(b=null!=b?b:"  ",c=null!=c?c:"",d=null!=d?d:"\n",null!=a.namespaceURI&&a.namespaceURI!=e&&(e=a.namespaceURI,null==a.getAttribute("xmlns")&&a.setAttribute("xmlns",a.namespaceURI)),a.nodeType==mxConstants.NODETYPE_DOCUMENT)f.push(mxUtils.getPrettyXml(a.documentElement,b,c,d,e));else if(a.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){var g=a.firstChild;if(null!=
g)for(;null!=g;)f.push(mxUtils.getPrettyXml(g,b,c,d,e)),g=g.nextSibling}else if(a.nodeType==mxConstants.NODETYPE_COMMENT)a=mxUtils.getTextContent(a),0<a.length&&f.push(c+"\x3c!--"+a+"--\x3e"+d);else if(a.nodeType==mxConstants.NODETYPE_TEXT)a=mxUtils.trim(mxUtils.getTextContent(a)),0<a.length&&f.push(c+mxUtils.htmlEntities(a,!1)+d);else if(a.nodeType==mxConstants.NODETYPE_CDATA)a=mxUtils.getTextContent(a),0<a.length&&f.push(c+"<![CDATA["+a+"]]"+d);else{f.push(c+"<"+a.nodeName);g=a.attributes;if(null!=
g)for(var k=0;k<g.length;k++){var l=mxUtils.htmlEntities(g[k].value);f.push(" "+g[k].nodeName+'="'+l+'"')}g=a.firstChild;if(null!=g){for(f.push(">"+d);null!=g;)f.push(mxUtils.getPrettyXml(g,b,c+b,d,e)),g=g.nextSibling;f.push(c+"</"+a.nodeName+">"+d)}else f.push(" />"+d)}return f.join("")},extractTextWithWhitespace:function(a){function b(e){if(1!=e.length||"BR"!=e[0].nodeName&&"\n"!=e[0].innerHTML)for(var f=0;f<e.length;f++){var g=e[f];"BR"==g.nodeName||"\n"==g.innerHTML||(1==e.length||0==f)&&"DIV"==
g.nodeName&&"<br>"==g.innerHTML.toLowerCase()?d.push("\n"):(3===g.nodeType||4===g.nodeType?0<g.nodeValue.length&&d.push(g.nodeValue):8!==g.nodeType&&0<g.childNodes.length&&b(g.childNodes),f<e.length-1&&0<=mxUtils.indexOf(c,e[f+1].nodeName)&&d.push("\n"))}}var c="BLOCKQUOTE DIV H1 H2 H3 H4 H5 H6 OL P PRE TABLE UL".split(" "),d=[];b(a);return d.join("")},replaceTrailingNewlines:function(a,b){for(var c="";0<a.length&&"\n"==a.charAt(a.length-1);)a=a.substring(0,a.length-1),c+=b;return a+c},getTextContent:function(a){return mxClient.IS_IE&&
void 0!==a.innerText?a.innerText:null!=a?a[void 0===a.textContent?"text":"textContent"]:""},setTextContent:function(a,b){void 0!==a.innerText?a.innerText=b:a[void 0===a.textContent?"text":"textContent"]=b},getInnerHtml:function(){return mxClient.IS_IE?function(a){return null!=a?a.innerHTML:""}:function(a){return null!=a?(new XMLSerializer).serializeToString(a):""}}(),getOuterHtml:function(){return mxClient.IS_IE?function(a){if(null!=a){if(null!=a.outerHTML)return a.outerHTML;var b=[];b.push("<"+a.nodeName);
var c=a.attributes;if(null!=c)for(var d=0;d<c.length;d++){var e=c[d].value;null!=e&&0<e.length&&(b.push(" "),b.push(c[d].nodeName),b.push('="'),b.push(e),b.push('"'))}0==a.innerHTML.length?b.push("/>"):(b.push(">"),b.push(a.innerHTML),b.push("</"+a.nodeName+">"));return b.join("")}return""}:function(a){return null!=a?(new XMLSerializer).serializeToString(a):""}}(),write:function(a,b){b=a.ownerDocument.createTextNode(b);null!=a&&a.appendChild(b);return b},writeln:function(a,b){b=a.ownerDocument.createTextNode(b);
null!=a&&(a.appendChild(b),a.appendChild(document.createElement("br")));return b},br:function(a,b){b=b||1;for(var c=null,d=0;d<b;d++)null!=a&&(c=a.ownerDocument.createElement("br"),a.appendChild(c));return c},button:function(a,b,c){c=null!=c?c:document;c=c.createElement("button");mxUtils.write(c,a);mxEvent.addListener(c,"click",function(d){b(d)});return c},para:function(a,b){var c=document.createElement("p");mxUtils.write(c,b);null!=a&&a.appendChild(c);return c},addTransparentBackgroundFilter:function(a){a.style.filter+=
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(a,b,c,d,e){return mxUtils.link(a,b,function(){c.execute(d)},e)},linkInvoke:function(a,b,c,d,e,f){return mxUtils.link(a,b,function(){c[d](e)},f)},link:function(a,b,c,d){var e=document.createElement("span");e.style.color="blue";e.style.textDecoration="underline";e.style.cursor="pointer";null!=d&&(e.style.paddingLeft=d+"px");mxEvent.addListener(e,"click",c);
mxUtils.write(e,b);null!=a&&a.appendChild(e);return e},getDocumentSize:function(){var a=document.body,b=document.documentElement;try{return new mxRectangle(0,0,a.clientWidth||b.clientWidth,Math.max(a.clientHeight||0,b.clientHeight))}catch(c){return new mxRectangle}},fit:function(a){var b=mxUtils.getDocumentSize(),c=parseInt(a.offsetLeft),d=parseInt(a.offsetWidth),e=mxUtils.getDocumentScrollOrigin(a.ownerDocument),f=e.x;e=e.y;var g=f+b.width;c+d>g&&(a.style.left=Math.max(f,g-d)+"px");c=parseInt(a.offsetTop);
d=parseInt(a.offsetHeight);b=e+b.height;c+d>b&&(a.style.top=Math.max(e,b-d)+"px")},load:function(a){a=new mxXmlRequest(a,null,"GET",!1);a.send();return a},get:function(a,b,c,d,e,f,g){a=new mxXmlRequest(a,null,"GET");var k=a.setRequestHeaders;g&&(a.setRequestHeaders=function(l,m){k.apply(this,arguments);for(var n in g)l.setRequestHeader(n,g[n])});null!=d&&a.setBinary(d);a.send(b,c,e,f);return a},getAll:function(a,b,c){for(var d=a.length,e=[],f=0,g=function(){0==f&&null!=c&&c();f++},k=0;k<a.length;k++)(function(l,
m){mxUtils.get(l,function(n){var p=n.getStatus();200>p||299<p?g():(e[m]=n,d--,0==d&&b(e))},g)})(a[k],k);0==d&&b(e)},post:function(a,b,c,d){return(new mxXmlRequest(a,b)).send(c,d)},submit:function(a,b,c,d){return(new mxXmlRequest(a,b)).simulate(c,d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;
null==a&&(a=c||0);return Number(a)},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===Element)d=a.cloneNode(null!=c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},
equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||
a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c]){var d=
mxUtils.getFunctionName(a[c].constructor);b+=c+" => ["+d+"]\n"}else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return E;c=Math.abs(c);d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180);E=Math.sin(e*Math.PI/180);e=p*m+E*n;m=-1*E*m+p*n;n=e*e;var r=m*m,q=c*c,t=d*d,u=n/q+r/t;1<u?(c*=Math.sqrt(u),d*=Math.sqrt(u),f=0):(u=1,f===g&&
(u=-1),f=u*Math.sqrt((q*t-q*r-t*n)/(q*r+t*n)));n=f*c*m/d;r=-1*f*d*e/c;k=p*n-E*r+k/2;l=E*n+p*r+l/2;q=Math.atan2((m-r)/d,(e-n)/c)-Math.atan2(0,1);f=0<=q?q:2*Math.PI+q;q=Math.atan2((-m-r)/d,(-e-n)/c)-Math.atan2((m-r)/d,(e-n)/c);e=0<=q?q:2*Math.PI+q;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=E;d*=E;var x=Math.cos(f),A=Math.sin(f);r=-m*(n*A+d*x);q=-m*(c*A-p*x);for(var E=[],C=0;C<g;++C){f+=e;x=
Math.cos(f);A=Math.sin(f);t=n*x-d*A+k;u=c*x+p*A+l;var D=-m*(n*A+d*x);x=-m*(c*A-p*x);A=6*C;E[A]=Number(r+a);E[A+1]=Number(q+b);E[A+2]=Number(t-D+a);E[A+3]=Number(u-x+b);E[A+4]=Number(t+a);E[A+5]=Number(u+b);r=t+D;q=u+x}return E},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);d=Math.cos(b);var e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=
new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,
mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;
break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=
mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},reversePortConstraints:function(a){var b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<
1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=a.absolutePoints[g];e=mxUtils.ptSegDistSq(e.x,e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,
!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||
e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=
null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y;f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=d?d.p:null},intersectsPoints:function(a,b){for(var c=0;c<b.length-1;c++)if(mxUtils.rectangleIntersectsSegment(a,b[c],b[c+1]))return!0;return!1},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<
e&&(a=e);if(a>k)return!1;e=b.y;g=c.y;var l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b){var c=a.width,d=a.height,e=b.width,f=b.height;if(0>=e||0>=f||0>=c||0>=d)return!1;var g=a.x;a=a.y;var k=b.x;b=b.y;e+=k;f+=b;c+=g;d+=a;return(e<k||e>g)&&(f<b||f>a)&&(c<g||c>k)&&(d<a||d>b)},intersectsHotspot:function(a,b,c,d,e,
f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),
g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||e||(b=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=b.x,d+=b.y);a=a.getBoundingClientRect();null!=a&&(c+=a.left,d+=a.top);return new mxPoint(c,
d)},getDocumentScrollOrigin:function(a){a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint,
k=!1;null!=a&&a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},ltrim:function(a,b){return null!=a?a.replace(new RegExp("^["+(b||"\\s")+"]+","g"),""):null},
rtrim:function(a,b){return null!=a?a.replace(new RegExp("["+(b||"\\s")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,k){var l=(k-f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return 0<=
g&&1>=g&&0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e-c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,
arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?"":"alpha(opacity="+b+")":a.style.opacity=b/100},createImage:function(a){var b=document.createElement("img");b.setAttribute("src",a);b.setAttribute("border","0");return b},sortCells:function(a,b){b=null!=b?
b:!0;var c=new mxDictionary;a.sort(function(d,e){var f=c.get(d);null==f&&(f=mxCellPath.create(d).split(mxCellPath.PATH_SEPARATOR),c.put(d,f));d=c.get(e);null==d&&(d=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,d));e=mxCellPath.compare(f,d);return 0==e?0:0<e==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},
indexOfStylename:function(a,b){if(null!=a&&null!=b){a=a.split(";");for(var c=0,d=0;d<a.length;d++){if(a[d]==b)return c;c+=a[d].length+1}}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length-1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a){a=a.split(";");for(var d=0;d<a.length;d++)a[d]!=b&&c.push(a[d])}return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<
a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},hex2rgb:function(a){if(null!=a&&7==a.length&&"#"==a.charAt(0)){var b=parseInt(a.substring(1,3),16),c=parseInt(a.substring(3,5),16);a=parseInt(a.substring(5,7),16);a="rgb("+b+", "+c+", "+a+")"}return a},hex2rgba:function(a){if(null!=
a&&7<=a.length&&"#"==a.charAt(0)){var b=parseInt(a.substring(1,3),16),c=parseInt(a.substring(3,5),16),d=parseInt(a.substring(5,7),16),e=1;7<a.length&&(e=parseInt(a.substring(7,9),16)/255);a="rgba("+b+", "+c+", "+d+", "+e+")"}return a},rgba2hex:function(a){return(rgb=a&&a.match?a.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i):a)&&4===rgb.length?"#"+("0"+parseInt(rgb[1],10).toString(16)).slice(-2)+("0"+parseInt(rgb[2],10).toString(16)).slice(-2)+("0"+parseInt(rgb[3],10).toString(16)).slice(-2):
a},setCssText:function(a,b){if(null!=a&&null!=b){b=b.split(";");for(var c=0;c<b.length;c++){var d=b[c].split(":");1<d.length&&(d[0]=mxUtils.trim(d[0].replace(/-([a-z])/gi,function(e,f){return f.toUpperCase()})),a[d[0]]=mxUtils.trim(d[1]))}}},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length+1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+
1)}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length-1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=
d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&
(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;null!=e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==
mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";null!=d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);
a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);document.body.removeChild(f);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=
f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=
c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=c.width-2*d;c=c.height-2*d;d=b.getGraphBounds().clone();b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){g=Math.floor(c)/c;var k=Math.floor(d)/d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*
c/b*.99999},show:function(a,b,c,d,e,f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";g=document.getElementsByTagName("base");
for(c=0;c<g.length;c++)d+=g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;"><div style="position:absolute;overflow:hidden;width:'+(e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+a.container.innerHTML;b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));
d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");c.position="absolute";c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;
for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+k+","+l+")"))}mxUtils.removeCursors(b.body);return b},printScreen:function(a){var b=window.open();a.getGraphBounds();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,
500):a()},popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";b=document.createElement("pre");b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),
c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),b=c.document.createElement("pre"),b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",
d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),
c=document.createElement("button"),mxClient.IS_IE?c.style.cssText="float:right":c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(k){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=
g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(n){return"function"==typeof b?b(n):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(n){var p=d.cloneNode(!0),r=parseInt(p.style.width),q=parseInt(p.style.height);p.style.width=Math.round(r*n.view.scale)+"px";p.style.height=Math.round(q*n.view.scale)+"px";return p}));return a},format:function(a){return parseFloat(parseFloat(a).toFixed(2))}},
mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,
NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",
CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,
GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,
DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",
STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_FILL_STYLE:"fillStyle",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",
STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",
STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",
STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",
STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",
STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",
STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FIXED_WIDTH:"fixedWidth",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",
STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",STYLE_CLIP_PATH:"clipPath",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",
SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",
ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_RADIAL:"radial",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,
ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};
function mxEventObject(a){this.name=a;this.properties=[];for(var b=1;b<arguments.length;b+=2)null!=arguments[b+1]&&(this.properties[arguments[b]]=arguments[b+1])}mxEventObject.prototype.name=null;mxEventObject.prototype.properties=null;mxEventObject.prototype.consumed=!1;mxEventObject.prototype.getName=function(){return this.name};mxEventObject.prototype.getProperties=function(){return this.properties};mxEventObject.prototype.getProperty=function(a){return this.properties[a]};
mxEventObject.prototype.isConsumed=function(){return this.consumed};mxEventObject.prototype.consume=function(){this.consumed=!0};function mxMouseEvent(a,b){this.evt=a;this.sourceState=this.state=b}mxMouseEvent.prototype.consumed=!1;mxMouseEvent.prototype.evt=null;mxMouseEvent.prototype.graphX=null;mxMouseEvent.prototype.graphY=null;mxMouseEvent.prototype.state=null;mxMouseEvent.prototype.sourceState=null;mxMouseEvent.prototype.getEvent=function(){return this.evt};
mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)};mxMouseEvent.prototype.isSource=function(a){return null!=a?mxUtils.isAncestorNode(a.node,this.getSource()):!1};mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())};mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())};mxMouseEvent.prototype.getGraphX=function(){return this.graphX};mxMouseEvent.prototype.getGraphY=function(){return this.graphY};
mxMouseEvent.prototype.getState=function(){return this.state};mxMouseEvent.prototype.getCell=function(){var a=this.getState();return null!=a?a.cell:null};mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())};mxMouseEvent.prototype.isConsumed=function(){return this.consumed};
mxMouseEvent.prototype.consume=function(a){(null!=a?a:null!=this.evt.touches||mxEvent.isMouseEvent(this.evt))&&this.evt.preventDefault&&this.evt.preventDefault();mxClient.IS_IE&&(this.evt.returnValue=!0);this.consumed=!0};function mxEventSource(a){this.setEventSource(a)}mxEventSource.prototype.eventListeners=null;mxEventSource.prototype.eventsEnabled=!0;mxEventSource.prototype.eventSource=null;mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled};
mxEventSource.prototype.setEventsEnabled=function(a){this.eventsEnabled=a};mxEventSource.prototype.getEventSource=function(){return this.eventSource};mxEventSource.prototype.setEventSource=function(a){this.eventSource=a};mxEventSource.prototype.addListener=function(a,b){null==this.eventListeners&&(this.eventListeners=[]);this.eventListeners.push(a);this.eventListeners.push(b)};
mxEventSource.prototype.removeListener=function(a){if(null!=this.eventListeners)for(var b=0;b<this.eventListeners.length;)this.eventListeners[b+1]==a?this.eventListeners.splice(b,2):b+=2};
mxEventSource.prototype.fireEvent=function(a,b){if(null!=this.eventListeners&&this.isEventsEnabled()){null==a&&(a=new mxEventObject);null==b&&(b=this.getEventSource());null==b&&(b=this);for(var c=0;c<this.eventListeners.length;c+=2){var d=this.eventListeners[c];null!=d&&d!=a.getName()||this.eventListeners[c+1].apply(this,[b,a])}}};
var mxEvent={addListener:function(){if(window.addEventListener){var a=!1;try{document.addEventListener("test",function(){},Object.defineProperty&&Object.defineProperty({},"passive",{get:function(){a=!0}}))}catch(b){}return function(b,c,d){b.addEventListener(c,d,a?{passive:!1}:!1);null==b.mxListenerList&&(b.mxListenerList=[]);b.mxListenerList.push({name:c,f:d})}}return function(b,c,d){b.attachEvent("on"+c,d);null==b.mxListenerList&&(b.mxListenerList=[]);b.mxListenerList.push({name:c,f:d})}}(),removeListener:function(){var a=
function(b,c,d){if(null!=b.mxListenerList){c=b.mxListenerList.length;for(var e=0;e<c;e++)if(b.mxListenerList[e].f==d){b.mxListenerList.splice(e,1);break}0==b.mxListenerList.length&&(b.mxListenerList=null)}};return window.removeEventListener?function(b,c,d){b.removeEventListener(c,d,!1);a(b,c,d)}:function(b,c,d){b.detachEvent("on"+c,d);a(b,c,d)}}(),removeAllListeners:function(a){var b=a.mxListenerList;if(null!=b)for(;0<b.length;){var c=b[0];mxEvent.removeListener(a,c.name,c.f)}},addGestureListeners:function(a,
b,c,d){null!=b&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",b);null!=c&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointermove":"mousemove",c);null!=d&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointerup":"mouseup",d);!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=b&&mxEvent.addListener(a,"touchstart",b),null!=c&&mxEvent.addListener(a,"touchmove",c),null!=d&&mxEvent.addListener(a,"touchend",d))},removeGestureListeners:function(a,b,c,d){null!=b&&mxEvent.removeListener(a,mxClient.IS_POINTER?
"pointerdown":"mousedown",b);null!=c&&mxEvent.removeListener(a,mxClient.IS_POINTER?"pointermove":"mousemove",c);null!=d&&mxEvent.removeListener(a,mxClient.IS_POINTER?"pointerup":"mouseup",d);!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=b&&mxEvent.removeListener(a,"touchstart",b),null!=c&&mxEvent.removeListener(a,"touchmove",c),null!=d&&mxEvent.removeListener(a,"touchend",d))},redirectMouseEvents:function(a,b,c,d,e,f,g){var k=function(l){return"function"==typeof c?c(l):c};mxEvent.addGestureListeners(a,
function(l){null!=d?d(l):mxEvent.isConsumed(l)||b.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(l,k(l)))},function(l){null!=e?e(l):mxEvent.isConsumed(l)||b.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(l,k(l)))},function(l){null!=f?f(l):mxEvent.isConsumed(l)||b.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(l,k(l)))});mxEvent.addListener(a,"dblclick",function(l){if(null!=g)g(l);else if(!mxEvent.isConsumed(l)){var m=k(l);b.dblClick(l,null!=m?m.cell:null)}})},release:function(a){try{if(null!=
a){mxEvent.removeAllListeners(a);var b=a.childNodes;if(null!=b){var c=b.length;for(a=0;a<c;a+=1)mxEvent.release(b[a])}}}catch(d){}},addMouseWheelListener:function(a,b){if(null!=a){b=null!=b?b:window;if(mxClient.IS_SF&&!mxClient.IS_TOUCH){var c=1;mxEvent.addListener(b,"gesturestart",function(g){mxEvent.consume(g);c=1});mxEvent.addListener(b,"gesturechange",function(g){mxEvent.consume(g);var k=c-g.scale;.2<Math.abs(k)&&(a(g,0>k,!0),c=g.scale)});mxEvent.addListener(b,"gestureend",function(g){mxEvent.consume(g)})}else{var d=
[],e=0,f=0;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(g){mxEvent.isMouseEvent(g)||null==g.pointerId||d.push(g)}),mxUtils.bind(this,function(g){if(!mxEvent.isMouseEvent(g)&&2==d.length){for(var k=0;k<d.length;k++)if(g.pointerId==d[k].pointerId){d[k]=g;break}g=Math.abs(d[0].clientX-d[1].clientX);k=Math.abs(d[0].clientY-d[1].clientY);var l=Math.abs(g-e),m=Math.abs(k-f);if(l>mxEvent.PINCH_THRESHOLD||m>mxEvent.PINCH_THRESHOLD)a(d[0],l>m?g>e:k>f,!0,d[0].clientX+(d[1].clientX-d[0].clientX)/
2,d[0].clientY+(d[1].clientY-d[0].clientY)/2),e=g,f=k}}),mxUtils.bind(this,function(g){d=[];f=e=0}))}mxEvent.addListener(b,"wheel",function(g){null==g&&(g=window.event);g.ctrlKey&&g.preventDefault();(.5<Math.abs(g.deltaX)||.5<Math.abs(g.deltaY))&&a(g,0==g.deltaY?0<-g.deltaX:0<-g.deltaY)})}},disableContextMenu:function(a){mxEvent.addListener(a,"contextmenu",function(b){b.preventDefault&&b.preventDefault();return!1})},getSource:function(a){return null!=a.srcElement?a.srcElement:a.target},isConsumed:function(a){return null!=
a.isConsumed&&a.isConsumed},isTouchEvent:function(a){return null!=a.pointerType?"touch"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_TOUCH:null!=a.mozInputSource?5==a.mozInputSource:0==a.type.indexOf("touch")},isPenEvent:function(a){return null!=a.pointerType?"pen"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_PEN:null!=a.mozInputSource?2==a.mozInputSource:0==a.type.indexOf("pen")},isMultiTouchEvent:function(a){return null!=a.type&&0==a.type.indexOf("touch")&&null!=a.touches&&1<a.touches.length},
isMouseEvent:function(a){return!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.mozInputSource?1==a.mozInputSource:0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in
a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||mxClient.IS_MAC&&mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)&&!mxEvent.isMetaDown(a)&&!mxEvent.isAltDown(a)},isShiftDown:function(a){return null!=a?a.shiftKey:!1},isAltDown:function(a){return null!=a?a.altKey:!1},isControlDown:function(a){return null!=a?a.ctrlKey:!1},isMetaDown:function(a){return null!=a?a.metaKey:!1},getMainEvent:function(a){"touchstart"!=a.type&&"touchmove"!=a.type||null==a.touches||
null==a.touches[0]?"touchend"==a.type&&null!=a.changedTouches&&null!=a.changedTouches[0]&&(a=a.changedTouches[0]):a=a.touches[0];return a},getClientX:function(a){return mxEvent.getMainEvent(a).clientX},getClientY:function(a){return mxEvent.getMainEvent(a).clientY},consume:function(a,b,c){c=null!=c?c:!0;if(null!=b?b:1)a.preventDefault?(c&&a.stopPropagation(),a.preventDefault()):c&&(a.cancelBubble=!0);a.isConsumed=!0;a.preventDefault||(a.returnValue=!1)},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,
VIRTUAL_HANDLE:-1E5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",
TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",
LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",
UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",
START:"start",RESET:"reset",PINCH_THRESHOLD:10};function mxXmlRequest(a,b,c,d,e,f){this.url=a;this.params=b;this.method=c||"POST";this.async=null!=d?d:!0;this.username=e;this.password=f}mxXmlRequest.prototype.url=null;mxXmlRequest.prototype.params=null;mxXmlRequest.prototype.method=null;mxXmlRequest.prototype.async=null;mxXmlRequest.prototype.binary=!1;mxXmlRequest.prototype.withCredentials=!1;mxXmlRequest.prototype.username=null;mxXmlRequest.prototype.password=null;
mxXmlRequest.prototype.request=null;mxXmlRequest.prototype.decodeSimulateValues=!1;mxXmlRequest.prototype.isBinary=function(){return this.binary};mxXmlRequest.prototype.setBinary=function(a){this.binary=a};mxXmlRequest.prototype.getText=function(){return this.request.responseText};mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState};mxXmlRequest.prototype.getDocumentElement=function(){var a=this.getXml();return null!=a?a.documentElement:null};
mxXmlRequest.prototype.getXml=function(){var a=this.request.responseXML;if(9<=document.documentMode||null==a||null==a.documentElement)a=mxUtils.parseXml(this.request.responseText);return a};mxXmlRequest.prototype.getStatus=function(){return null!=this.request?this.request.status:null};
mxXmlRequest.prototype.create=function(){if(window.XMLHttpRequest)return function(){var a=new XMLHttpRequest;this.isBinary()&&a.overrideMimeType&&a.overrideMimeType("text/plain; charset=x-user-defined");return a};if("undefined"!=typeof ActiveXObject)return function(){return new ActiveXObject("Microsoft.XMLHTTP")}}();
mxXmlRequest.prototype.send=function(a,b,c,d){this.request=this.create();null!=this.request&&(null!=a&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(a(this),this.request.onreadystatechange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),(null==document.documentMode||9<document.documentMode)&&window.XMLHttpRequest&&
null!=c&&null!=d&&(this.request.timeout=c,this.request.ontimeout=d),this.request.send(this.params))};mxXmlRequest.prototype.setRequestHeaders=function(a,b){null!=b&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded")};
mxXmlRequest.prototype.simulate=function(a,b){a=a||document;var c=null;a==document&&(c=window.onbeforeunload,window.onbeforeunload=null);var d=a.createElement("form");d.setAttribute("method",this.method);d.setAttribute("action",this.url);null!=b&&d.setAttribute("target",b);d.style.display="none";d.style.visibility="hidden";b=0<this.params.indexOf("&")?this.params.split("&"):this.params.split();for(var e=0;e<b.length;e++){var f=b[e].indexOf("=");if(0<f){var g=b[e].substring(0,f);f=b[e].substring(f+
1);this.decodeSimulateValues&&(f=decodeURIComponent(f));var k=a.createElement("textarea");k.setAttribute("wrap","off");k.setAttribute("name",g);mxUtils.write(k,f);d.appendChild(k)}}a.body.appendChild(d);d.submit();null!=d.parentNode&&d.parentNode.removeChild(d);null!=c&&(window.onbeforeunload=c)};
var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(a){mxClipboard.cells=a},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(a,b){b=mxClipboard.copy(a,b);mxClipboard.insertCount=0;mxClipboard.removeCells(a,b,!1);return b},removeCells:function(a,b,c){a.removeCells(b,c)},copy:function(a,b){b=b||a.getSelectionCells();b=a.getExportableCells(a.model.getTopmostCells(b));mxClipboard.insertCount=1;mxClipboard.setCells(a.cloneCells(b));
return b},paste:function(a){var b=null;if(!mxClipboard.isEmpty()){b=a.getImportableCells(mxClipboard.getCells());var c=mxClipboard.insertCount*mxClipboard.STEPSIZE,d=a.getDefaultParent();b=a.importCells(b,c,c,d);mxClipboard.insertCount++;a.setSelectionCells(b)}return b}};
function mxWindow(a,b,c,d,e,f,g,k,l,m){null!=b&&(g=null!=g?g:!0,this.content=b,this.init(c,d,e,f,m),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(g),this.setTitle(a),(null==k||k)&&this.installMoveHandler(),null!=l&&null!=l.parentNode?l.parentNode.replaceChild(this.div,l):document.body.appendChild(this.div))}mxWindow.prototype=new mxEventSource;mxWindow.prototype.constructor=mxWindow;mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif";
mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif";mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif";mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif";mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif";mxWindow.prototype.visible=!1;mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40);mxWindow.prototype.destroyOnClose=!0;
mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2;mxWindow.prototype.title=null;mxWindow.prototype.content=null;
mxWindow.prototype.init=function(a,b,c,d,e){e=null!=e?e:"mxWindow";this.div=document.createElement("div");this.div.className=e;this.div.style.left=a+"px";this.div.style.top=b+"px";this.table=document.createElement("table");this.table.className=e;mxClient.IS_POINTER&&(this.div.style.touchAction="none");null!=c&&(this.div.style.width=c+"px",this.table.style.width=c+"px");null!=d&&(this.div.style.height=d+"px",this.table.style.height=d+"px");a=document.createElement("tbody");b=document.createElement("tr");
this.title=document.createElement("td");this.title.className=e+"Title";this.buttons=document.createElement("div");this.buttons.style.position="absolute";this.buttons.style.display="inline-block";this.buttons.style.right="4px";this.buttons.style.top="5px";this.title.appendChild(this.buttons);b.appendChild(this.title);a.appendChild(b);b=document.createElement("tr");this.td=document.createElement("td");this.td.className=e+"Pane";7==document.documentMode&&(this.td.style.height="100%");this.contentWrapper=
document.createElement("div");this.contentWrapper.className=e+"Pane";this.contentWrapper.style.width="100%";this.contentWrapper.appendChild(this.content);"DIV"!=this.content.nodeName.toUpperCase()&&(this.contentWrapper.style.height="100%");this.td.appendChild(this.contentWrapper);b.appendChild(this.td);a.appendChild(b);this.table.appendChild(a);this.div.appendChild(this.table);e=mxUtils.bind(this,function(f){this.activate()});mxEvent.addGestureListeners(this.title,e);mxEvent.addGestureListeners(this.table,
e);this.hide()};mxWindow.prototype.setTitle=function(a){for(var b=this.title.firstChild;null!=b;){var c=b.nextSibling;b.nodeType==mxConstants.NODETYPE_TEXT&&b.parentNode.removeChild(b);b=c}mxUtils.write(this.title,a||"");this.title.appendChild(this.buttons)};mxWindow.prototype.setScrollable=function(a){if(null==navigator.userAgent||0>navigator.userAgent.indexOf("Presto/2.5"))this.contentWrapper.style.overflow=a?"auto":"hidden"};
mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var a=mxUtils.getCurrentStyle(this.getElement());a=null!=a?a.zIndex:3;if(mxWindow.activeWindow){var b=mxWindow.activeWindow.getElement();null!=b&&null!=b.style&&(b.style.zIndex=a)}b=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(a)+1;mxWindow.activeWindow=this;this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",b))}};mxWindow.prototype.getElement=function(){return this.div};
mxWindow.prototype.fit=function(){mxUtils.fit(this.div)};mxWindow.prototype.isResizable=function(){return null!=this.resize?"none"!=this.resize.style.display:!1};
mxWindow.prototype.setResizable=function(a){if(a)if(null==this.resize){this.resize=document.createElement("img");this.resize.style.position="absolute";this.resize.style.bottom="2px";this.resize.style.right="2px";this.resize.setAttribute("src",this.resizeImage);this.resize.style.cursor="nw-resize";var b=null,c=null,d=null,e=null;a=mxUtils.bind(this,function(k){this.activate();b=mxEvent.getClientX(k);c=mxEvent.getClientY(k);d=this.div.offsetWidth;e=this.div.offsetHeight;mxEvent.addGestureListeners(document,
null,f,g);this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",k));mxEvent.consume(k)});var f=mxUtils.bind(this,function(k){if(null!=b&&null!=c){var l=mxEvent.getClientX(k)-b,m=mxEvent.getClientY(k)-c;this.setSize(d+l,e+m);this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",k));mxEvent.consume(k)}}),g=mxUtils.bind(this,function(k){null!=b&&null!=c&&(c=b=null,mxEvent.removeGestureListeners(document,null,f,g),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",k)),mxEvent.consume(k))});
mxEvent.addGestureListeners(this.resize,a,f,g);this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(this.resize.style.display="none")};
mxWindow.prototype.setSize=function(a,b){a=Math.max(this.minimumSize.width,a);b=Math.max(this.minimumSize.height,b);this.div.style.width=a+"px";this.div.style.height=b+"px";this.table.style.width=a+"px";this.table.style.height=b+"px";this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"};mxWindow.prototype.setMinimizable=function(a){this.minimizeImg.style.display=a?"":"none"};
mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)};
mxWindow.prototype.toggleMinimized=function(a){this.activate();if(this.minimized)this.minimized=!1,this.minimizeImg.setAttribute("src",this.minimizeImage),this.minimizeImg.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=this.maxDisplay,this.div.style.height=this.height,this.table.style.height=this.height,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",a));else{this.minimized=!0;this.minimizeImg.setAttribute("src",
this.normalizeImage);this.minimizeImg.setAttribute("title","Normalize");this.contentWrapper.style.display="none";this.maxDisplay=this.maximize.style.display;this.maximize.style.display="none";this.height=this.table.style.height;var b=this.getMinimumSize();0<b.height&&(this.div.style.height=b.height+"px",this.table.style.height=b.height+"px");0<b.width&&(this.div.style.width=b.width+"px",this.table.style.width=b.width+"px");null!=this.resize&&(this.resize.style.visibility="hidden");this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,
"event",a))}};
mxWindow.prototype.installMinimizeHandler=function(){this.minimizeImg=document.createElement("img");this.minimizeImg.setAttribute("src",this.minimizeImage);this.minimizeImg.setAttribute("title","Minimize");this.minimizeImg.style.cursor="pointer";this.minimizeImg.style.marginLeft="2px";this.minimizeImg.style.display="none";this.buttons.appendChild(this.minimizeImg);this.minimized=!1;this.height=this.maxDisplay=null;var a=mxUtils.bind(this,function(b){this.toggleMinimized(b);mxEvent.consume(b)});mxEvent.addGestureListeners(this.minimizeImg,
a)};mxWindow.prototype.setMaximizable=function(a){this.maximize.style.display=a?"":"none"};
mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img");this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title","Maximize");this.maximize.style.cursor="default";this.maximize.style.marginLeft="2px";this.maximize.style.cursor="pointer";this.maximize.style.display="none";this.buttons.appendChild(this.maximize);var a=!1,b=null,c=null,d=null,e=null,f=null,g=mxUtils.bind(this,function(k){this.activate();if("none"!=this.maximize.style.display){if(a){a=
!1;this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title","Maximize");this.contentWrapper.style.display="";this.minimizeImg.style.display=f;this.div.style.left=b+"px";this.div.style.top=c+"px";this.div.style.height=d;this.div.style.width=e;l=mxUtils.getCurrentStyle(this.contentWrapper);if("auto"==l.overflow||null!=this.resize)this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px";this.table.style.height=d;this.table.style.width=
e;null!=this.resize&&(this.resize.style.visibility="");this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",k))}else{a=!0;this.maximize.setAttribute("src",this.normalizeImage);this.maximize.setAttribute("title","Normalize");this.contentWrapper.style.display="";f=this.minimizeImg.style.display;this.minimizeImg.style.display="none";b=parseInt(this.div.style.left);c=parseInt(this.div.style.top);d=this.table.style.height;e=this.table.style.width;this.div.style.left="0px";this.div.style.top="0px";
l=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);this.div.style.width=document.body.clientWidth-2+"px";this.div.style.height=l-2+"px";this.table.style.width=document.body.clientWidth-2+"px";this.table.style.height=l-2+"px";null!=this.resize&&(this.resize.style.visibility="hidden");var l=mxUtils.getCurrentStyle(this.contentWrapper);if("auto"==l.overflow||null!=this.resize)this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+
"px";this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",k))}mxEvent.consume(k)}});mxEvent.addGestureListeners(this.maximize,g);mxEvent.addListener(this.title,"dblclick",g)};
mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move";mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(a){var b=mxEvent.getClientX(a),c=mxEvent.getClientY(a),d=this.getX(),e=this.getY(),f=mxUtils.bind(this,function(k){var l=mxEvent.getClientX(k)-b,m=mxEvent.getClientY(k)-c;this.setLocation(d+l,e+m);this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",k));mxEvent.consume(k)}),g=mxUtils.bind(this,function(k){mxEvent.removeGestureListeners(document,null,f,
g);this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",k));mxEvent.consume(k)});mxEvent.addGestureListeners(document,null,f,g);this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",a));mxEvent.consume(a)}));mxClient.IS_POINTER&&(this.title.style.touchAction="none")};mxWindow.prototype.setLocation=function(a,b){this.div.style.left=a+"px";this.div.style.top=b+"px"};mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)};mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)};
mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img");this.closeImg.setAttribute("src",this.closeImage);this.closeImg.setAttribute("title","Close");this.closeImg.style.marginLeft="2px";this.closeImg.style.cursor="pointer";this.closeImg.style.display="none";this.buttons.appendChild(this.closeImg);mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(a){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",a));this.destroyOnClose?this.destroy():
this.setVisible(!1);mxEvent.consume(a)}))};mxWindow.prototype.setImage=function(a){this.image=document.createElement("img");this.image.setAttribute("src",a);this.image.setAttribute("align","left");this.image.style.marginRight="4px";this.image.style.marginLeft="0px";this.image.style.marginTop="-2px";this.title.insertBefore(this.image,this.title.firstChild)};mxWindow.prototype.setClosable=function(a){this.closeImg.style.display=a?"":"none"};
mxWindow.prototype.isVisible=function(){return null!=this.div?"none"!=this.div.style.display:!1};mxWindow.prototype.setVisible=function(a){null!=this.div&&(this.isVisible()!=a?a?this.show():this.hide():this.fireEvent(new mxEventObject(a?mxEvent.SHOW:mxEvent.HIDE)))};
mxWindow.prototype.show=function(){this.div.style.display="";this.activate();"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.fireEvent(new mxEventObject(mxEvent.SHOW))};mxWindow.prototype.hide=function(){this.div.style.display="none";this.fireEvent(new mxEventObject(mxEvent.HIDE))};
mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY));null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null);this.contentWrapper=this.content=this.title=null};function mxForm(a){this.table=document.createElement("table");this.table.className=a;this.body=document.createElement("tbody");this.table.appendChild(this.body)}mxForm.prototype.table=null;mxForm.prototype.body=!1;mxForm.prototype.getTable=function(){return this.table};
mxForm.prototype.addButtons=function(a,b){var c=document.createElement("tr"),d=document.createElement("td");c.appendChild(d);d=document.createElement("td");var e=document.createElement("button");mxUtils.write(e,mxResources.get("ok")||"OK");d.appendChild(e);mxEvent.addListener(e,"click",function(){a()});e=document.createElement("button");mxUtils.write(e,mxResources.get("cancel")||"Cancel");d.appendChild(e);mxEvent.addListener(e,"click",function(){b()});c.appendChild(d);this.body.appendChild(c)};
mxForm.prototype.addText=function(a,b,c){var d=document.createElement("input");d.setAttribute("type",c||"text");d.value=b;return this.addField(a,d)};mxForm.prototype.addCheckbox=function(a,b){var c=document.createElement("input");c.setAttribute("type","checkbox");this.addField(a,c);b&&(c.checked=!0);return c};mxForm.prototype.addTextarea=function(a,b,c){var d=document.createElement("textarea");mxClient.IS_NS&&c--;d.setAttribute("rows",c||2);d.value=b;return this.addField(a,d)};
mxForm.prototype.addCombo=function(a,b,c){var d=document.createElement("select");null!=c&&d.setAttribute("size",c);b&&d.setAttribute("multiple","true");return this.addField(a,d)};mxForm.prototype.addOption=function(a,b,c,d){var e=document.createElement("option");mxUtils.writeln(e,b);e.setAttribute("value",c);d&&e.setAttribute("selected",d);a.appendChild(e)};
mxForm.prototype.addField=function(a,b){var c=document.createElement("tr"),d=document.createElement("td");mxUtils.write(d,a);c.appendChild(d);d=document.createElement("td");d.appendChild(b);c.appendChild(d);this.body.appendChild(c);return b};function mxImage(a,b,c,d,e){this.src=a;this.width=null!=b?b:this.width;this.height=null!=c?c:this.height;this.x=null!=d?d:this.x;this.y=null!=e?e:this.y}mxImage.prototype.src=null;mxImage.prototype.width=0;mxImage.prototype.height=0;mxImage.prototype.x=0;
mxImage.prototype.y=0;function mxDivResizer(a,b){"div"==a.nodeName.toLowerCase()&&(null==b&&(b=window),this.div=a,a=mxUtils.getCurrentStyle(a),null!=a&&(this.resizeWidth="auto"==a.width,this.resizeHeight="auto"==a.height),mxEvent.addListener(b,"resize",mxUtils.bind(this,function(c){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize())}mxDivResizer.prototype.resizeWidth=!0;mxDivResizer.prototype.resizeHeight=!0;mxDivResizer.prototype.handlingResize=!1;
mxDivResizer.prototype.resize=function(){var a=this.getDocumentWidth(),b=this.getDocumentHeight(),c=parseInt(this.div.style.left),d=parseInt(this.div.style.right),e=parseInt(this.div.style.top),f=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(c)&&!isNaN(d)&&0<=c&&0<=d&&0<a-d-c&&(this.div.style.width=a-d-c+"px");this.resizeHeight&&!isNaN(e)&&!isNaN(f)&&0<=e&&0<=f&&0<b-e-f&&(this.div.style.height=b-e-f+"px")};mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth};
mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight};function mxDragSource(a,b){this.element=a;this.dropHandler=b;mxEvent.addGestureListeners(a,mxUtils.bind(this,function(c){this.mouseDown(c)}));mxEvent.addListener(a,"dragstart",function(c){mxEvent.consume(c)});this.eventConsumer=function(c,d){c=d.getProperty("eventName");d=d.getProperty("event");c!=mxEvent.MOUSE_DOWN&&d.consume()}}mxDragSource.prototype.element=null;mxDragSource.prototype.dropHandler=null;
mxDragSource.prototype.dragOffset=null;mxDragSource.prototype.dragElement=null;mxDragSource.prototype.previewElement=null;mxDragSource.prototype.previewOffset=null;mxDragSource.prototype.enabled=!0;mxDragSource.prototype.currentGraph=null;mxDragSource.prototype.currentDropTarget=null;mxDragSource.prototype.currentPoint=null;mxDragSource.prototype.currentGuide=null;mxDragSource.prototype.currentHighlight=null;mxDragSource.prototype.autoscroll=!0;mxDragSource.prototype.guidesEnabled=!0;
mxDragSource.prototype.gridEnabled=!0;mxDragSource.prototype.highlightDropTargets=!0;mxDragSource.prototype.dragElementZIndex=100;mxDragSource.prototype.dragElementOpacity=70;mxDragSource.prototype.checkEventSource=!0;mxDragSource.prototype.isEnabled=function(){return this.enabled};mxDragSource.prototype.setEnabled=function(a){this.enabled=a};mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled};mxDragSource.prototype.setGuidesEnabled=function(a){this.guidesEnabled=a};
mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled};mxDragSource.prototype.setGridEnabled=function(a){this.gridEnabled=a};mxDragSource.prototype.getGraphForEvent=function(a){return null};mxDragSource.prototype.getDropTarget=function(a,b,c,d){return a.getCellAt(b,c)};mxDragSource.prototype.createDragElement=function(a){return this.element.cloneNode(!0)};mxDragSource.prototype.createPreviewElement=function(a){return null};
mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler};mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null);this.removeDragElement();this.removeListeners();this.stopDrag()};
mxDragSource.prototype.mouseDown=function(a){this.enabled&&!mxEvent.isConsumed(a)&&null==this.mouseMoveHandler&&(this.startDrag(a),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(a)&&(this.eventSource=mxEvent.getSource(a),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)))};
mxDragSource.prototype.startDrag=function(a){this.dragElement=this.createDragElement(a);this.dragElement.style.position="absolute";this.dragElement.style.zIndex=this.dragElementZIndex;mxUtils.setOpacity(this.dragElement,this.dragElementOpacity);this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")};mxDragSource.prototype.stopDrag=function(){this.removeDragElement()};
mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)};mxDragSource.prototype.getElementForEvent=function(a){return mxEvent.isTouchEvent(a)||mxEvent.isPenEvent(a)?document.elementFromPoint(mxEvent.getClientX(a),mxEvent.getClientY(a)):mxEvent.getSource(a)};
mxDragSource.prototype.graphContainsEvent=function(a,b){var c=mxEvent.getClientX(b),d=mxEvent.getClientY(b),e=mxUtils.getOffset(a.container),f=mxUtils.getScrollOrigin();b=this.getElementForEvent(b);if(this.checkEventSource)for(;null!=b&&b!=a.container;)b=b.parentNode;return null!=b&&c>=e.x-f.x&&d>=e.y-f.y&&c<=e.x-f.x+a.container.offsetWidth&&d<=e.y-f.y+a.container.offsetHeight};
mxDragSource.prototype.mouseMove=function(a){var b=this.getGraphForEvent(a);null==b||this.graphContainsEvent(b,a)||(b=null);b!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,a),this.currentGraph=b,null!=this.currentGraph&&this.dragEnter(this.currentGraph,a));null!=this.currentGraph&&this.dragOver(this.currentGraph,a);if(null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility=
"hidden");else{b=mxEvent.getClientX(a);var c=mxEvent.getClientY(a);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement);this.dragElement.style.visibility="visible";null!=this.dragOffset&&(b+=this.dragOffset.x,c+=this.dragOffset.y);var d=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=b+d.x+"px";this.dragElement.style.top=c+d.y+"px"}mxEvent.consume(a)};
mxDragSource.prototype.mouseUp=function(a){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var b=this.currentGraph.view.scale,c=this.currentGraph.view.translate;this.drop(this.currentGraph,a,this.currentDropTarget,this.currentPoint.x/b-c.x,this.currentPoint.y/b-c.y)}this.dragExit(this.currentGraph);this.currentGraph=null}this.stopDrag();this.removeListeners();mxEvent.consume(a)};
mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null);mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler);this.mouseUpHandler=this.mouseMoveHandler=null};
mxDragSource.prototype.dragEnter=function(a,b){a.isMouseDown=!0;a.isMouseTrigger=mxEvent.isMouseEvent(b);this.previewElement=this.createPreviewElement(a);null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none");this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(a,a.graphHandler.getGuideStates()));this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(a,mxConstants.DROP_TARGET_COLOR));a.addListener(mxEvent.FIRE_MOUSE_EVENT,
this.eventConsumer)};mxDragSource.prototype.dragExit=function(a,b){this.currentPoint=this.currentDropTarget=null;a.isMouseDown=!1;a.removeListener(this.eventConsumer);null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null);null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null);null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)};
mxDragSource.prototype.dragOver=function(a,b){var c=mxUtils.getOffset(a.container),d=mxUtils.getScrollOrigin(a.container),e=mxEvent.getClientX(b)-c.x+d.x-a.panDx;c=mxEvent.getClientY(b)-c.y+d.y-a.panDy;a.autoScroll&&(null==this.autoscroll||this.autoscroll)&&a.scrollPointToVisible(e,c,a.autoExtend);null!=this.currentHighlight&&a.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(a,e,c,b),d=a.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(d));if(null!=this.previewElement){null==
this.previewElement.parentNode&&(a.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");d=this.isGridEnabled()&&a.isGridEnabledEvent(b);var f=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(b))a=parseInt(this.previewElement.style.width),f=parseInt(this.previewElement.style.height),a=new mxRectangle(0,0,a,f),c=new mxPoint(e,c),c=this.currentGuide.move(a,c,d,!0),f=!1,e=c.x,c=c.y;else if(d){d=a.view.scale;b=
a.view.translate;var g=a.gridSize/2;e=(a.snap(e/d-b.x-g)+b.x)*d;c=(a.snap(c/d-b.y-g)+b.y)*d}null!=this.currentGuide&&f&&this.currentGuide.hide();null!=this.previewOffset&&(e+=this.previewOffset.x,c+=this.previewOffset.y);this.previewElement.style.left=Math.round(e)+"px";this.previewElement.style.top=Math.round(c)+"px";this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(e,c)};
mxDragSource.prototype.drop=function(a,b,c,d,e){this.dropHandler.apply(this,arguments);"hidden"!=a.container.style.visibility&&a.container.focus()};function mxToolbar(a){this.container=a}mxToolbar.prototype=new mxEventSource;mxToolbar.prototype.constructor=mxToolbar;mxToolbar.prototype.container=null;mxToolbar.prototype.enabled=!0;mxToolbar.prototype.noReset=!1;mxToolbar.prototype.updateDefaultMode=!0;
mxToolbar.prototype.addItem=function(a,b,c,d,e,f){var g=document.createElement(null!=b?"img":"button"),k=e||(null!=f?"mxToolbarMode":"mxToolbarItem");g.className=k;g.setAttribute("src",b);null!=a&&(null!=b?g.setAttribute("title",a):mxUtils.write(g,a));this.container.appendChild(g);null!=c&&(mxEvent.addListener(g,"click",c),mxClient.IS_TOUCH&&mxEvent.addListener(g,"touchend",c));a=mxUtils.bind(this,function(l){null!=d?g.setAttribute("src",b):g.style.backgroundColor=""});mxEvent.addGestureListeners(g,
mxUtils.bind(this,function(l){null!=d?g.setAttribute("src",d):g.style.backgroundColor="gray";if(null!=f){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var m=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu();m!=g&&(this.currentImg=g,this.menu.factoryMethod=f,m=new mxPoint(g.offsetLeft,g.offsetTop+g.offsetHeight),this.menu.popup(m.x,m.y,null,l),this.menu.isMenuShowing()&&(g.className=k+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this);
g.className=k;this.currentImg=null}))}}),null,a);mxEvent.addListener(g,"mouseout",a);return g};mxToolbar.prototype.addCombo=function(a){var b=document.createElement("div");b.style.display="inline";b.className="mxToolbarComboContainer";var c=document.createElement("select");c.className=a||"mxToolbarCombo";b.appendChild(c);this.container.appendChild(b);return c};
mxToolbar.prototype.addActionCombo=function(a,b){var c=document.createElement("select");c.className=b||"mxToolbarCombo";this.addOption(c,a,null);mxEvent.addListener(c,"change",function(d){var e=c.options[c.selectedIndex];c.selectedIndex=0;null!=e.funct&&e.funct(d)});this.container.appendChild(c);return c};mxToolbar.prototype.addOption=function(a,b,c){var d=document.createElement("option");mxUtils.writeln(d,b);"function"==typeof c?d.funct=c:d.setAttribute("value",c);a.appendChild(d);return d};
mxToolbar.prototype.addSwitchMode=function(a,b,c,d,e){var f=document.createElement("img");f.initialClassName=e||"mxToolbarMode";f.className=f.initialClassName;f.setAttribute("src",b);f.altIcon=d;null!=a&&f.setAttribute("title",a);mxEvent.addListener(f,"click",mxUtils.bind(this,function(g){g=this.selectedMode.altIcon;null!=g?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",g)):this.selectedMode.className=this.selectedMode.initialClassName;this.updateDefaultMode&&
(this.defaultMode=f);this.selectedMode=f;g=f.altIcon;null!=g?(f.altIcon=f.getAttribute("src"),f.setAttribute("src",g)):f.className=f.initialClassName+"Selected";this.fireEvent(new mxEventObject(mxEvent.SELECT));c()}));this.container.appendChild(f);null==this.defaultMode&&(this.defaultMode=f,this.selectMode(f),c());return f};
mxToolbar.prototype.addMode=function(a,b,c,d,e,f){f=null!=f?f:!0;var g=document.createElement(null!=b?"img":"button");g.initialClassName=e||"mxToolbarMode";g.className=g.initialClassName;g.setAttribute("src",b);g.altIcon=d;null!=a&&g.setAttribute("title",a);this.enabled&&f&&(mxEvent.addListener(g,"click",mxUtils.bind(this,function(k){this.selectMode(g,c);this.noReset=!1})),mxEvent.addListener(g,"dblclick",mxUtils.bind(this,function(k){this.selectMode(g,c);this.noReset=!0})),null==this.defaultMode&&
(this.defaultMode=g,this.defaultFunction=c,this.selectMode(g,c)));this.container.appendChild(g);return g};
mxToolbar.prototype.selectMode=function(a,b){if(this.selectedMode!=a){if(null!=this.selectedMode){var c=this.selectedMode.altIcon;null!=c?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",c)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=a;c=this.selectedMode.altIcon;null!=c?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",c)):this.selectedMode.className=this.selectedMode.initialClassName+
"Selected";this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",b))}};mxToolbar.prototype.resetMode=function(a){!a&&this.noReset||this.selectedMode==this.defaultMode||this.selectMode(this.defaultMode,this.defaultFunction)};mxToolbar.prototype.addSeparator=function(a){return this.addItem(null,a,null)};mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)};
mxToolbar.prototype.addLine=function(){var a=document.createElement("hr");a.style.marginRight="6px";a.setAttribute("size","1");this.container.appendChild(a)};mxToolbar.prototype.destroy=function(){mxEvent.release(this.container);this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null;null!=this.menu&&this.menu.destroy()};function mxUndoableEdit(a,b){this.source=a;this.changes=[];this.significant=null!=b?b:!0}mxUndoableEdit.prototype.source=null;
mxUndoableEdit.prototype.changes=null;mxUndoableEdit.prototype.significant=null;mxUndoableEdit.prototype.undone=!1;mxUndoableEdit.prototype.redone=!1;mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length};mxUndoableEdit.prototype.isSignificant=function(){return this.significant};mxUndoableEdit.prototype.add=function(a){this.changes.push(a)};mxUndoableEdit.prototype.notify=function(){};mxUndoableEdit.prototype.die=function(){};
mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length-1;0<=a;a--){var b=this.changes[a];null!=b.execute?b.execute():null!=b.undo&&b.undo();this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",b))}this.undone=!0;this.redone=!1;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};
mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length,b=0;b<a;b++){var c=this.changes[b];null!=c.execute?c.execute():null!=c.redo&&c.redo();this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",c))}this.undone=!1;this.redone=!0;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};function mxUndoManager(a){this.size=null!=a?a:100;this.clear()}mxUndoManager.prototype=new mxEventSource;
mxUndoManager.prototype.constructor=mxUndoManager;mxUndoManager.prototype.size=null;mxUndoManager.prototype.history=null;mxUndoManager.prototype.indexOfNextAdd=0;mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length};mxUndoManager.prototype.clear=function(){this.history=[];this.indexOfNextAdd=0;this.fireEvent(new mxEventObject(mxEvent.CLEAR))};mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd};
mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var a=this.history[--this.indexOfNextAdd];a.undo();if(a.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a));break}}};mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length};
mxUndoManager.prototype.redo=function(){for(var a=this.history.length;this.indexOfNextAdd<a;){var b=this.history[this.indexOfNextAdd++];b.redo();if(b.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",b));break}}};mxUndoManager.prototype.undoableEditHappened=function(a){this.trim();0<this.size&&this.size==this.history.length&&this.history.shift();this.history.push(a);this.indexOfNextAdd=this.history.length;this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",a))};
mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var a=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),b=0;b<a.length;b++)a[b].die()};var mxUrlConverter=function(){};mxUrlConverter.prototype.enabled=!0;mxUrlConverter.prototype.baseUrl=null;mxUrlConverter.prototype.baseDomain=null;
mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host;this.baseUrl=this.baseDomain+location.pathname;var a=this.baseUrl.lastIndexOf("/");0<a&&(this.baseUrl=this.baseUrl.substring(0,a+1))};mxUrlConverter.prototype.isEnabled=function(){return this.enabled};mxUrlConverter.prototype.setEnabled=function(a){this.enabled=a};mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl};mxUrlConverter.prototype.setBaseUrl=function(a){this.baseUrl=a};
mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain};mxUrlConverter.prototype.setBaseDomain=function(a){this.baseDomain=a};mxUrlConverter.prototype.isRelativeUrl=function(a){return null!=a&&"//"!=a.substring(0,2)&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&"data:image"!=a.substring(0,10)&&"file://"!=a.substring(0,7)};
mxUrlConverter.prototype.convert=function(a){this.isEnabled()&&this.isRelativeUrl(a)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),a="/"==a.charAt(0)?this.getBaseDomain()+a:this.getBaseUrl()+a);return a};
function mxPanningManager(a){this.thread=null;this.active=!1;this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0;this.scrollbars=!1;this.scrollTop=this.scrollLeft=0;this.mouseListener={mouseDown:function(c,d){},mouseMove:function(c,d){},mouseUp:mxUtils.bind(this,function(c,d){this.active&&this.stop()})};a.addMouseListener(this.mouseListener);this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.stop()});mxEvent.addListener(document,"mouseup",this.mouseUpListener);var b=mxUtils.bind(this,
function(){this.scrollbars=mxUtils.hasScrollbars(a.container);this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop;return window.setInterval(mxUtils.bind(this,function(){this.tdx-=this.dx;this.tdy-=this.dy;this.scrollbars?(a.panGraph(-a.container.scrollLeft-Math.ceil(this.dx),-a.container.scrollTop-Math.ceil(this.dy)),a.panDx=this.scrollLeft-a.container.scrollLeft,a.panDy=this.scrollTop-a.container.scrollTop,a.fireEvent(new mxEventObject(mxEvent.PAN))):a.panGraph(this.getDx(),
this.getDy())}),this.delay)});this.isActive=function(){return active};this.getDx=function(){return Math.round(this.tdx)};this.getDy=function(){return Math.round(this.tdy)};this.start=function(){this.t0x=a.view.translate.x;this.t0y=a.view.translate.y;this.active=!0};this.panTo=function(c,d,e,f){this.active||this.start();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop;var g=a.container;this.dx=c+(null!=e?e:0)-g.scrollLeft-g.clientWidth;this.dx=0>this.dx&&Math.abs(this.dx)<
this.border?this.border+this.dx:this.handleMouseOut?Math.max(this.dx,0):0;0==this.dx&&(this.dx=c-g.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0);this.dy=d+(null!=f?f:0)-g.scrollTop-g.clientHeight;this.dy=0>this.dy&&Math.abs(this.dy)<this.border?this.border+this.dy:this.handleMouseOut?Math.max(this.dy,0):0;0==this.dy&&(this.dy=d-g.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy):
0);0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=b())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)};this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)a.panDx=0,a.panDy=0,a.fireEvent(new mxEventObject(mxEvent.PAN));else{var c=a.panDx,d=a.panDy;if(0!=c||0!=d)a.panGraph(0,0),a.view.setTranslate(this.t0x+c/a.view.scale,
this.t0y+d/a.view.scale)}};this.destroy=function(){a.removeMouseListener(this.mouseListener);mxEvent.removeListener(document,"mouseup",this.mouseUpListener)}}mxPanningManager.prototype.damper=1/6;mxPanningManager.prototype.delay=10;mxPanningManager.prototype.handleMouseOut=!0;mxPanningManager.prototype.border=0;function mxPopupMenu(a){this.factoryMethod=a;null!=a&&this.init()}mxPopupMenu.prototype=new mxEventSource;mxPopupMenu.prototype.constructor=mxPopupMenu;
mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif";mxPopupMenu.prototype.zIndex=10006;mxPopupMenu.prototype.factoryMethod=null;mxPopupMenu.prototype.useLeftButtonForPopup=!1;mxPopupMenu.prototype.enabled=!0;mxPopupMenu.prototype.itemCount=0;mxPopupMenu.prototype.autoExpand=!1;mxPopupMenu.prototype.smartSeparators=!1;mxPopupMenu.prototype.labels=!0;
mxPopupMenu.prototype.init=function(){this.table=document.createElement("table");this.table.className="mxPopupMenu";this.tbody=document.createElement("tbody");this.table.appendChild(this.tbody);this.div=document.createElement("div");this.div.className="mxPopupMenu";this.div.style.display="inline";this.div.style.zIndex=this.zIndex;this.div.appendChild(this.table);mxEvent.disableContextMenu(this.div)};mxPopupMenu.prototype.isEnabled=function(){return this.enabled};
mxPopupMenu.prototype.setEnabled=function(a){this.enabled=a};mxPopupMenu.prototype.isPopupTrigger=function(a){return a.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(a.getEvent())};
mxPopupMenu.prototype.addItem=function(a,b,c,d,e,f,g,k){d=d||this;this.itemCount++;d.willAddSeparator&&(d.containsItems&&this.addSeparator(d,!0),d.willAddSeparator=!1);d.containsItems=!0;var l=document.createElement("tr");l.className="mxPopupMenuItem";var m=document.createElement("td");m.className="mxPopupMenuIcon";null!=b?(e=document.createElement("img"),e.src=b,m.appendChild(e)):null!=e&&(b=document.createElement("div"),b.className=e,m.appendChild(b));l.appendChild(m);this.labels&&(m=document.createElement("td"),
m.className="mxPopupMenuItem"+(null==f||f?"":" mxDisabled"),mxUtils.write(m,a),m.align="left",l.appendChild(m),a=document.createElement("td"),a.className="mxPopupMenuItem"+(null==f||f?"":" mxDisabled"),a.style.paddingRight="6px",a.style.textAlign="right",l.appendChild(a),null==d.div&&this.createSubmenu(d));d.tbody.appendChild(l);if(0!=g&&0!=f){var n=null;mxEvent.addGestureListeners(l,mxUtils.bind(this,function(p){this.eventReceiver=l;d.activeRow!=l&&d.activeRow!=d&&(null!=d.activeRow&&null!=d.activeRow.div.parentNode&&
this.hideSubmenu(d),null!=l.div&&(this.showSubmenu(d,l),d.activeRow=l));null!=document.selection&&8==document.documentMode&&(n=document.selection.createRange());mxEvent.consume(p)}),mxUtils.bind(this,function(p){d.activeRow!=l&&d.activeRow!=d&&(null!=d.activeRow&&null!=d.activeRow.div.parentNode&&this.hideSubmenu(d),this.autoExpand&&null!=l.div&&(this.showSubmenu(d,l),d.activeRow=l));k||(l.className="mxPopupMenuItemHover")}),mxUtils.bind(this,function(p){if(this.eventReceiver==l){d.activeRow!=l&&
this.hideMenu();if(null!=n){try{n.select()}catch(r){}n=null}null!=c&&c(p)}this.eventReceiver=null;mxEvent.consume(p)}));k||mxEvent.addListener(l,"mouseout",mxUtils.bind(this,function(p){l.className="mxPopupMenuItem"}))}return l};mxPopupMenu.prototype.addCheckmark=function(a,b){a=a.firstChild.nextSibling;a.style.backgroundImage="url('"+b+"')";a.style.backgroundRepeat="no-repeat";a.style.backgroundPosition="2px 50%"};
mxPopupMenu.prototype.createSubmenu=function(a){a.table=document.createElement("table");a.table.className="mxPopupMenu";a.tbody=document.createElement("tbody");a.table.appendChild(a.tbody);a.div=document.createElement("div");a.div.className="mxPopupMenu";a.div.style.position="absolute";a.div.style.display="inline";a.div.style.zIndex=this.zIndex;a.div.appendChild(a.table);var b=document.createElement("img");b.setAttribute("src",this.submenuImage);td=a.firstChild.nextSibling.nextSibling;td.appendChild(b)};
mxPopupMenu.prototype.showSubmenu=function(a,b){if(null!=b.div){b.div.style.left=a.div.offsetLeft+b.offsetLeft+b.offsetWidth-1+"px";b.div.style.top=a.div.offsetTop+b.offsetTop+"px";document.body.appendChild(b.div);var c=parseInt(b.div.offsetLeft),d=parseInt(b.div.offsetWidth),e=mxUtils.getDocumentScrollOrigin(document),f=document.documentElement;c+d>e.x+(document.body.clientWidth||f.clientWidth)&&(b.div.style.left=Math.max(0,a.div.offsetLeft-d+(mxClient.IS_IE?6:-6))+"px");b.div.style.overflowY="auto";
b.div.style.overflowX="hidden";b.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-10+"px";mxUtils.fit(b.div)}};
mxPopupMenu.prototype.addSeparator=function(a,b){a=a||this;if(this.smartSeparators&&!b)a.willAddSeparator=!0;else if(null!=a.tbody){a.willAddSeparator=!1;b=document.createElement("tr");var c=document.createElement("td");c.className="mxPopupMenuIcon";c.style.padding="0 0 0 0px";b.appendChild(c);c=document.createElement("td");c.style.padding="0 0 0 0px";c.setAttribute("colSpan","2");var d=document.createElement("hr");d.setAttribute("size","1");c.appendChild(d);b.appendChild(c);a.tbody.appendChild(b)}};
mxPopupMenu.prototype.popup=function(a,b,c,d){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){this.div.style.left=a+"px";for(this.div.style.top=b+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0;this.factoryMethod(this,c,d);0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}};
mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body};mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none");document.body.appendChild(this.div);mxUtils.fit(this.div)};mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))};
mxPopupMenu.prototype.hideSubmenu=function(a){null!=a.activeRow&&(this.hideSubmenu(a.activeRow),null!=a.activeRow.div.parentNode&&a.activeRow.div.parentNode.removeChild(a.activeRow.div),a.activeRow=null)};mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)};
function mxAutoSaveManager(a){this.changeHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.graphModelChanged(c.getProperty("edit").changes)});this.setGraph(a)}mxAutoSaveManager.prototype=new mxEventSource;mxAutoSaveManager.prototype.constructor=mxAutoSaveManager;mxAutoSaveManager.prototype.graph=null;mxAutoSaveManager.prototype.autoSaveDelay=10;mxAutoSaveManager.prototype.autoSaveThrottle=2;mxAutoSaveManager.prototype.autoSaveThreshold=5;mxAutoSaveManager.prototype.ignoredChanges=0;
mxAutoSaveManager.prototype.lastSnapshot=0;mxAutoSaveManager.prototype.enabled=!0;mxAutoSaveManager.prototype.changeHandler=null;mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled};mxAutoSaveManager.prototype.setEnabled=function(a){this.enabled=a};mxAutoSaveManager.prototype.setGraph=function(a){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler);this.graph=a;null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)};
mxAutoSaveManager.prototype.save=function(){};mxAutoSaveManager.prototype.graphModelChanged=function(a){a=((new Date).getTime()-this.lastSnapshot)/1E3;a>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&a>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++};mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime();this.ignoredChanges=0};mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)};
function mxAnimation(a){this.delay=null!=a?a:20}mxAnimation.prototype=new mxEventSource;mxAnimation.prototype.constructor=mxAnimation;mxAnimation.prototype.delay=null;mxAnimation.prototype.thread=null;mxAnimation.prototype.isRunning=function(){return null!=this.thread};mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))};mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))};
mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))};function mxMorphing(a,b,c,d){mxAnimation.call(this,d);this.graph=a;this.steps=null!=b?b:6;this.ease=null!=c?c:1.5}mxMorphing.prototype=new mxAnimation;mxMorphing.prototype.constructor=mxMorphing;mxMorphing.prototype.graph=null;mxMorphing.prototype.steps=null;mxMorphing.prototype.step=0;mxMorphing.prototype.ease=null;
mxMorphing.prototype.cells=null;mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var a=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var b=0;b<this.cells.length;b++)this.animateCell(this.cells[b],a,!1);else this.animateCell(this.graph.getModel().getRoot(),a,!0);this.show(a);(a.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()};mxMorphing.prototype.show=function(a){a.show()};
mxMorphing.prototype.animateCell=function(a,b,c){var d=this.graph.getView().getState(a),e=null;if(null!=d&&(e=this.getDelta(d),this.graph.getModel().isVertex(a)&&(0!=e.x||0!=e.y))){var f=this.graph.view.getTranslate(),g=this.graph.view.getScale();e.x+=f.x*g;e.y+=f.y*g;b.moveState(d,-e.x/this.ease,-e.y/this.ease)}if(c&&!this.stopRecursion(d,e))for(d=this.graph.getModel().getChildCount(a),e=0;e<d;e++)this.animateCell(this.graph.getModel().getChildAt(a,e),b,c)};
mxMorphing.prototype.stopRecursion=function(a,b){return null!=b&&(0!=b.x||0!=b.y)};mxMorphing.prototype.getDelta=function(a){var b=this.getOriginForCell(a.cell),c=this.graph.getView().getTranslate(),d=this.graph.getView().getScale();return new mxPoint((b.x-(a.x/d-c.x))*d,(b.y-(a.y/d-c.y))*d)};
mxMorphing.prototype.getOriginForCell=function(a){var b=null;if(null!=a){var c=this.graph.getModel().getParent(a);a=this.graph.getCellGeometry(a);b=this.getOriginForCell(c);null!=a&&(a.relative?(c=this.graph.getCellGeometry(c),null!=c&&(b.x+=a.x*c.width,b.y+=a.y*c.height)):(b.x+=a.x,b.y+=a.y))}null==b&&(b=this.graph.view.getTranslate(),b=new mxPoint(-b.x,-b.y));return b};function mxImageBundle(a){this.images=[];this.alt=null!=a?a:!1}mxImageBundle.prototype.images=null;
mxImageBundle.prototype.alt=null;mxImageBundle.prototype.putImage=function(a,b,c){this.images[a]={value:b,fallback:c}};mxImageBundle.prototype.getImage=function(a){var b=null;null!=a&&(a=this.images[a],null!=a&&(b=this.alt?a.fallback:a.value));return b};function mxImageExport(){}mxImageExport.prototype.includeOverlays=!1;
mxImageExport.prototype.drawState=function(a,b){null!=a&&(this.visitStatesRecursive(a,b,mxUtils.bind(this,function(){this.drawCellState.apply(this,arguments)})),this.includeOverlays&&this.visitStatesRecursive(a,b,mxUtils.bind(this,function(){this.drawOverlays.apply(this,arguments)})))};
mxImageExport.prototype.visitStatesRecursive=function(a,b,c){if(null!=a){c(a,b);for(var d=a.view.graph,e=d.model.getChildCount(a.cell),f=0;f<e;f++){var g=d.view.getState(d.model.getChildAt(a.cell,f));this.visitStatesRecursive(g,b,c)}}};mxImageExport.prototype.getLinkForCellState=function(a,b){return null};mxImageExport.prototype.getLinkTargetForCellState=function(a,b){return null};
mxImageExport.prototype.drawCellState=function(a,b){var c=this.getLinkForCellState(a,b);null!=c&&b.setLink(c,this.getLinkTargetForCellState(a,b));this.drawShape(a,b);this.drawText(a,b);null!=c&&b.setLink(null)};mxImageExport.prototype.drawShape=function(a,b){a.shape instanceof mxShape&&this.doDrawShape(a.shape,b)};mxImageExport.prototype.drawText=function(a,b){this.doDrawShape(a.text,b)};
mxImageExport.prototype.doDrawShape=function(a,b){null!=a&&a.checkBounds()&&(b.save(),a.beforePaint(b),a.paint(b),a.afterPaint(b),b.restore())};mxImageExport.prototype.drawOverlays=function(a,b){null!=a.overlays&&a.overlays.visit(function(c,d){d instanceof mxShape&&d.paint(b)})};function mxAbstractCanvas2D(){this.converter=this.createUrlConverter();this.reset()}mxAbstractCanvas2D.prototype.state=null;mxAbstractCanvas2D.prototype.states=null;mxAbstractCanvas2D.prototype.path=null;
mxAbstractCanvas2D.prototype.rotateHtml=!0;mxAbstractCanvas2D.prototype.lastX=0;mxAbstractCanvas2D.prototype.lastY=0;mxAbstractCanvas2D.prototype.moveOp="M";mxAbstractCanvas2D.prototype.lineOp="L";mxAbstractCanvas2D.prototype.quadOp="Q";mxAbstractCanvas2D.prototype.curveOp="C";mxAbstractCanvas2D.prototype.closeOp="Z";mxAbstractCanvas2D.prototype.pointerEvents=!1;mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter};
mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState();this.states=[]};
mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillAlpha:1,strokeAlpha:1,fillColor:null,gradientFillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",fixDash:!1,lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,shadowColor:mxConstants.SHADOWCOLOR,
shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}};mxAbstractCanvas2D.prototype.format=function(a){return Math.round(parseFloat(a))};
mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var a=this.state,b=2;b<arguments.length;b+=2)this.lastX=arguments[b-1],this.lastY=arguments[b],this.path.push(this.format((this.lastX+a.dx)*a.scale)),this.path.push(this.format((this.lastY+a.dy)*a.scale))};mxAbstractCanvas2D.prototype.rotatePoint=function(a,b,c,d,e){c*=Math.PI/180;return mxUtils.getRotatedPoint(new mxPoint(a,b),Math.cos(c),Math.sin(c),new mxPoint(d,e))};
mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state)};mxAbstractCanvas2D.prototype.restore=function(){0<this.states.length&&(this.state=this.states.pop())};mxAbstractCanvas2D.prototype.setLink=function(a,b){};mxAbstractCanvas2D.prototype.scale=function(a){this.state.scale*=a;this.state.strokeWidth*=a};mxAbstractCanvas2D.prototype.translate=function(a,b){this.state.dx+=a;this.state.dy+=b};
mxAbstractCanvas2D.prototype.rotate=function(a,b,c,d,e){};mxAbstractCanvas2D.prototype.setAlpha=function(a){this.state.alpha=a};mxAbstractCanvas2D.prototype.setFillAlpha=function(a){this.state.fillAlpha=a};mxAbstractCanvas2D.prototype.setStrokeAlpha=function(a){this.state.strokeAlpha=a};mxAbstractCanvas2D.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fillColor=a;this.state.gradientColor=null};
mxAbstractCanvas2D.prototype.setFillStyle=function(a){a==mxConstants.NONE&&(a=null);this.state.fillStyle=a};mxAbstractCanvas2D.prototype.setGradient=function(a,b,c,d,e,f,g,k,l){c=this.state;c.fillColor=a;c.gradientFillAlpha=null!=k?k:1;c.gradientColor=b;c.gradientAlpha=null!=l?l:1;c.gradientDirection=g};mxAbstractCanvas2D.prototype.setStrokeColor=function(a){a==mxConstants.NONE&&(a=null);this.state.strokeColor=a};mxAbstractCanvas2D.prototype.setStrokeWidth=function(a){this.state.strokeWidth=a};
mxAbstractCanvas2D.prototype.setDashed=function(a,b){this.state.dashed=a;this.state.fixDash=b};mxAbstractCanvas2D.prototype.setDashPattern=function(a){this.state.dashPattern=a};mxAbstractCanvas2D.prototype.setLineCap=function(a){this.state.lineCap=a};mxAbstractCanvas2D.prototype.setLineJoin=function(a){this.state.lineJoin=a};mxAbstractCanvas2D.prototype.setMiterLimit=function(a){this.state.miterLimit=a};
mxAbstractCanvas2D.prototype.setFontColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontColor=a};mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxAbstractCanvas2D.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a};mxAbstractCanvas2D.prototype.setFontSize=function(a){this.state.fontSize=parseFloat(a)};
mxAbstractCanvas2D.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAbstractCanvas2D.prototype.setFontStyle=function(a){null==a&&(a=0);this.state.fontStyle=a};mxAbstractCanvas2D.prototype.setShadow=function(a){this.state.shadow=a};mxAbstractCanvas2D.prototype.setShadowColor=function(a){a==mxConstants.NONE&&(a=null);this.state.shadowColor=a};mxAbstractCanvas2D.prototype.setShadowAlpha=function(a){this.state.shadowAlpha=a};
mxAbstractCanvas2D.prototype.setShadowOffset=function(a,b){this.state.shadowDx=a;this.state.shadowDy=b};mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0;this.path=[]};mxAbstractCanvas2D.prototype.moveTo=function(a,b){this.addOp(this.moveOp,a,b)};mxAbstractCanvas2D.prototype.lineTo=function(a,b){this.addOp(this.lineOp,a,b)};mxAbstractCanvas2D.prototype.quadTo=function(a,b,c,d){this.addOp(this.quadOp,a,b,c,d)};
mxAbstractCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){this.addOp(this.curveOp,a,b,c,d,e,f)};mxAbstractCanvas2D.prototype.arcTo=function(a,b,c,d,e,f,g){a=mxUtils.arcToCurves(this.lastX,this.lastY,a,b,c,d,e,f,g);if(null!=a)for(b=0;b<a.length;b+=6)this.curveTo(a[b],a[b+1],a[b+2],a[b+3],a[b+4],a[b+5])};mxAbstractCanvas2D.prototype.close=function(a,b,c,d,e,f){this.addOp(this.closeOp)};mxAbstractCanvas2D.prototype.end=function(){};
function mxXmlCanvas2D(a){mxAbstractCanvas2D.call(this);this.root=a;this.writeDefaults()}mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D);mxXmlCanvas2D.prototype.textEnabled=!0;mxXmlCanvas2D.prototype.compressed=!0;
mxXmlCanvas2D.prototype.writeDefaults=function(){var a=this.createElement("fontfamily");a.setAttribute("family",mxConstants.DEFAULT_FONTFAMILY);this.root.appendChild(a);a=this.createElement("fontsize");a.setAttribute("size",mxConstants.DEFAULT_FONTSIZE);this.root.appendChild(a);a=this.createElement("shadowcolor");a.setAttribute("color",mxConstants.SHADOWCOLOR);this.root.appendChild(a);a=this.createElement("shadowalpha");a.setAttribute("alpha",mxConstants.SHADOW_OPACITY);this.root.appendChild(a);a=
this.createElement("shadowoffset");a.setAttribute("dx",mxConstants.SHADOW_OFFSET_X);a.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y);this.root.appendChild(a)};mxXmlCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};mxXmlCanvas2D.prototype.createElement=function(a){return this.root.ownerDocument.createElement(a)};mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments);this.root.appendChild(this.createElement("save"))};
mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments);this.root.appendChild(this.createElement("restore"))};mxXmlCanvas2D.prototype.scale=function(a){var b=this.createElement("scale");b.setAttribute("scale",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.translate=function(a,b){var c=this.createElement("translate");c.setAttribute("dx",this.format(a));c.setAttribute("dy",this.format(b));this.root.appendChild(c)};
mxXmlCanvas2D.prototype.rotate=function(a,b,c,d,e){var f=this.createElement("rotate");if(0!=a||b||c)f.setAttribute("theta",this.format(a)),f.setAttribute("flipH",b?"1":"0"),f.setAttribute("flipV",c?"1":"0"),f.setAttribute("cx",this.format(d)),f.setAttribute("cy",this.format(e)),this.root.appendChild(f)};
mxXmlCanvas2D.prototype.setAlpha=function(a){if(this.compressed){if(this.state.alpha==a)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var b=this.createElement("alpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)};mxXmlCanvas2D.prototype.setFillAlpha=function(a){if(this.compressed){if(this.state.fillAlpha==a)return;mxAbstractCanvas2D.prototype.setFillAlpha.apply(this,arguments)}var b=this.createElement("fillalpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setStrokeAlpha=function(a){if(this.compressed){if(this.state.strokeAlpha==a)return;mxAbstractCanvas2D.prototype.setStrokeAlpha.apply(this,arguments)}var b=this.createElement("strokealpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fillColor==a)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var b=this.createElement("fillcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setGradient=function(a,b,c,d,e,f,g,k,l){if(null!=a&&null!=b){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var m=this.createElement("gradient");m.setAttribute("c1",a);m.setAttribute("c2",b);m.setAttribute("x",this.format(c));m.setAttribute("y",this.format(d));m.setAttribute("w",this.format(e));m.setAttribute("h",this.format(f));null!=g&&m.setAttribute("direction",g);null!=k&&m.setAttribute("alpha1",k);null!=l&&m.setAttribute("alpha2",l);this.root.appendChild(m)}};
mxXmlCanvas2D.prototype.setStrokeColor=function(a){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.strokeColor==a)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var b=this.createElement("strokecolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setStrokeWidth=function(a){if(this.compressed){if(this.state.strokeWidth==a)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var b=this.createElement("strokewidth");b.setAttribute("width",this.format(a));this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setDashed=function(a,b){if(this.compressed){if(this.state.dashed==a)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var c=this.createElement("dashed");c.setAttribute("dashed",a?"1":"0");null!=b&&c.setAttribute("fixDash",b?"1":"0");this.root.appendChild(c)};
mxXmlCanvas2D.prototype.setDashPattern=function(a){if(this.compressed){if(this.state.dashPattern==a)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var b=this.createElement("dashpattern");b.setAttribute("pattern",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.setLineCap=function(a){if(this.compressed){if(this.state.lineCap==a)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var b=this.createElement("linecap");b.setAttribute("cap",a);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setLineJoin=function(a){if(this.compressed){if(this.state.lineJoin==a)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var b=this.createElement("linejoin");b.setAttribute("join",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.setMiterLimit=function(a){if(this.compressed){if(this.state.miterLimit==a)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var b=this.createElement("miterlimit");b.setAttribute("limit",a);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setFontColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontColor==a)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var b=this.createElement("fontcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setFontBackgroundColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontBackgroundColor==a)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var b=this.createElement("fontbackgroundcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setFontBorderColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontBorderColor==a)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var b=this.createElement("fontbordercolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setFontSize=function(a){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==a)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var b=this.createElement("fontsize");b.setAttribute("size",a);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setFontFamily=function(a){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==a)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var b=this.createElement("fontfamily");b.setAttribute("family",a);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setFontStyle=function(a){if(this.textEnabled){null==a&&(a=0);if(this.compressed){if(this.state.fontStyle==a)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var b=this.createElement("fontstyle");b.setAttribute("style",a);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setShadow=function(a){if(this.compressed){if(this.state.shadow==a)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var b=this.createElement("shadow");b.setAttribute("enabled",a?"1":"0");this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setShadowColor=function(a){if(this.compressed){a==mxConstants.NONE&&(a=null);if(this.state.shadowColor==a)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var b=this.createElement("shadowcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setShadowAlpha=function(a){if(this.compressed){if(this.state.shadowAlpha==a)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var b=this.createElement("shadowalpha");b.setAttribute("alpha",a);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setShadowOffset=function(a,b){if(this.compressed){if(this.state.shadowDx==a&&this.state.shadowDy==b)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var c=this.createElement("shadowoffset");c.setAttribute("dx",a);c.setAttribute("dy",b);this.root.appendChild(c)};
mxXmlCanvas2D.prototype.rect=function(a,b,c,d){var e=this.createElement("rect");e.setAttribute("x",this.format(a));e.setAttribute("y",this.format(b));e.setAttribute("w",this.format(c));e.setAttribute("h",this.format(d));this.root.appendChild(e)};
mxXmlCanvas2D.prototype.roundrect=function(a,b,c,d,e,f){var g=this.createElement("roundrect");g.setAttribute("x",this.format(a));g.setAttribute("y",this.format(b));g.setAttribute("w",this.format(c));g.setAttribute("h",this.format(d));g.setAttribute("dx",this.format(e));g.setAttribute("dy",this.format(f));this.root.appendChild(g)};
mxXmlCanvas2D.prototype.ellipse=function(a,b,c,d){var e=this.createElement("ellipse");e.setAttribute("x",this.format(a));e.setAttribute("y",this.format(b));e.setAttribute("w",this.format(c));e.setAttribute("h",this.format(d));this.root.appendChild(e)};
mxXmlCanvas2D.prototype.image=function(a,b,c,d,e,f,g,k){e=this.converter.convert(e);var l=this.createElement("image");l.setAttribute("x",this.format(a));l.setAttribute("y",this.format(b));l.setAttribute("w",this.format(c));l.setAttribute("h",this.format(d));l.setAttribute("src",e);l.setAttribute("aspect",f?"1":"0");l.setAttribute("flipH",g?"1":"0");l.setAttribute("flipV",k?"1":"0");this.root.appendChild(l)};
mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin"));this.lastY=this.lastX=0};mxXmlCanvas2D.prototype.moveTo=function(a,b){var c=this.createElement("move");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b};
mxXmlCanvas2D.prototype.lineTo=function(a,b){var c=this.createElement("line");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b};mxXmlCanvas2D.prototype.quadTo=function(a,b,c,d){var e=this.createElement("quad");e.setAttribute("x1",this.format(a));e.setAttribute("y1",this.format(b));e.setAttribute("x2",this.format(c));e.setAttribute("y2",this.format(d));this.root.appendChild(e);this.lastX=c;this.lastY=d};
mxXmlCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){var g=this.createElement("curve");g.setAttribute("x1",this.format(a));g.setAttribute("y1",this.format(b));g.setAttribute("x2",this.format(c));g.setAttribute("y2",this.format(d));g.setAttribute("x3",this.format(e));g.setAttribute("y3",this.format(f));this.root.appendChild(g);this.lastX=e;this.lastY=f};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))};
mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,r){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var q=this.createElement("text");q.setAttribute("x",this.format(a));q.setAttribute("y",this.format(b));q.setAttribute("w",this.format(c));q.setAttribute("h",this.format(d));q.setAttribute("str",e);null!=f&&q.setAttribute("align",f);null!=g&&q.setAttribute("valign",g);q.setAttribute("wrap",k?"1":"0");null==l&&(l="");q.setAttribute("format",l);null!=m&&q.setAttribute("overflow",
m);null!=n&&q.setAttribute("clip",n?"1":"0");null!=p&&q.setAttribute("rotation",p);null!=r&&q.setAttribute("dir",r);this.root.appendChild(q)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))};
function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.gradients=[];this.fillPatterns=[];this.defs=null;this.styleEnabled=null!=b?b:!1;b=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):b.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}
mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);
(function(){mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"===typeof DOMParser&&"function"===typeof XMLSerializer;if(mxSvgCanvas2D.prototype.useDomParser)try{var a=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=a}catch(b){mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&0<document.getElementsByTagName("base").length})();
mxSvgCanvas2D.prototype.node=null;mxSvgCanvas2D.prototype.matchHtmlAlignment=!0;mxSvgCanvas2D.prototype.textEnabled=!0;mxSvgCanvas2D.prototype.foEnabled=!0;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.imageOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.minStrokeWidth=1;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.lineHeightCorrection=1;
mxSvgCanvas2D.prototype.pointerEventsValue="all";mxSvgCanvas2D.prototype.fontMetricsPadding=10;mxSvgCanvas2D.prototype.foreignObjectPadding=2;mxSvgCanvas2D.prototype.cacheOffsetSize=!0;mxSvgCanvas2D.prototype.setCssText=function(a,b){mxClient.IS_IE||mxClient.IS_IE11?a.setAttribute("style",b):mxUtils.setCssText(a.style,b)};mxSvgCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};
mxSvgCanvas2D.prototype.getBaseUrl=function(){var a=window.location.href,b=a.lastIndexOf("#");0<b&&(a=a.substring(0,b));return a};mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments);this.gradients=[];this.fillPatterns=[]};
mxSvgCanvas2D.prototype.createStyle=function(a){a=this.createElement("style");a.setAttribute("type","text/css");mxUtils.write(a,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}");return a};
mxSvgCanvas2D.prototype.createElement=function(a,b){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(b||mxConstants.NS_SVG,a);a=this.root.ownerDocument.createElement(a);null!=b&&a.setAttribute("xmlns",b);return a};mxSvgCanvas2D.prototype.getAlternateText=function(a,b,c,d,e,f,g,k,l,m,n,p,r){return null!=f?this.foAltText:null};
mxSvgCanvas2D.prototype.createAlternateContent=function(a,b,c,d,e,f,g,k,l,m,n,p,r){a=this.getAlternateText(a,b,c,d,e,f,g,k,l,m,n,p,r);d=this.state;return null!=a&&0<d.fontSize?(k=k==mxConstants.ALIGN_TOP?1:k==mxConstants.ALIGN_BOTTOM?0:.3,e=g==mxConstants.ALIGN_RIGHT?"end":g==mxConstants.ALIGN_LEFT?"start":"middle",g=this.createElement("text"),g.setAttribute("x",Math.round(b+d.dx)),g.setAttribute("y",Math.round(c+d.dy+k*d.fontSize)),g.setAttribute("fill",d.fontColor||"black"),g.setAttribute("font-family",
d.fontFamily),g.setAttribute("font-size",Math.round(d.fontSize)+"px"),"start"!=e&&g.setAttribute("text-anchor",e),(d.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&g.setAttribute("font-weight","bold"),(d.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&g.setAttribute("font-style","italic"),b=[],(d.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(d.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),
0<b.length&&g.setAttribute("text-decoration",b.join(" ")),mxUtils.write(g,a),g):null};
mxSvgCanvas2D.prototype.createGradientId=function(a,b,c,d,e){a=mxUtils.rgba2hex(a);"#"==a.charAt(0)&&(a=a.substring(1));b=mxUtils.rgba2hex(b);"#"==b.charAt(0)&&(b=b.substring(1));a=a.toLowerCase()+"-"+c;b=b.toLowerCase()+"-"+d;c=null;null==e||e==mxConstants.DIRECTION_SOUTH?c="s":e==mxConstants.DIRECTION_EAST?c="e":e==mxConstants.DIRECTION_RADIAL?c="r":(d=a,a=b,b=d,e==mxConstants.DIRECTION_NORTH?c="s":e==mxConstants.DIRECTION_WEST&&(c="e"));return"mx-gradient-"+a+"-"+b+"-"+c};
mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){var f=this.createGradientId(a,b,c,d,e),g=this.gradients[f];if(null==g){var k=this.root.ownerSVGElement,l=0,m=f+"-"+l;if(null!=k)for(g=k.ownerDocument.getElementById(m);null!=g&&g.ownerSVGElement!=k;)m=f+"-"+l++,g=k.ownerDocument.getElementById(m);else m="id"+ ++this.refCount;null==g&&(g=this.createSvgGradient(a,b,c,d,e),g.setAttribute("id",m),null!=this.defs?this.defs.appendChild(g):k.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};
mxSvgCanvas2D.prototype.createSvgGradient=function(a,b,c,d,e){var f=this.createElement(e==mxConstants.DIRECTION_RADIAL?"radialGradient":"linearGradient");f.setAttribute("x1","0%");f.setAttribute("y1","0%");f.setAttribute("x2","0%");f.setAttribute("y2","0%");null==e||e==mxConstants.DIRECTION_SOUTH?f.setAttribute("y2","100%"):e==mxConstants.DIRECTION_EAST?f.setAttribute("x2","100%"):e==mxConstants.DIRECTION_NORTH?f.setAttribute("y1","100%"):e==mxConstants.DIRECTION_WEST&&f.setAttribute("x1","100%");
e=this.createElement("stop");e.setAttribute("offset","0%");e.style.stopColor=a;e.style.stopOpacity=c;f.appendChild(e);e=this.createElement("stop");e.setAttribute("offset","100%");e.style.stopColor=b;e.style.stopOpacity=d;f.appendChild(e);return f};mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c){c=mxUtils.rgba2hex(c);"#"==c.charAt(0)&&(c=c.substring(1));return("mx-pattern-"+a+"-"+b+"-"+c).toLowerCase()};
mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){var e=this.createFillPatternId(a,b,c),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=this.createCrossHatchPattern(b,
c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return"ERROR"}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}return f.getAttribute("id")};
mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b);e.setAttribute("stroke-width",
a);d.appendChild(e);return d};
mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b);e.setAttribute("stroke-width",
a);d.appendChild(e);return d};
mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b);e.setAttribute("stroke-width",
a);e.setAttribute("fill","none");d.appendChild(e);return d};
mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a=.5*a*c;c=this.format(1.5*(10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b);e.setAttribute("stroke-width",
a);e.setAttribute("fill","none");d.appendChild(e);return d};
mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format((10+a)*c);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b);c.appendChild(d);return c};
mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.node,d=this.state;if(null!=c){if("path"==c.nodeName)if(null!=this.path&&0<this.path.length)c.setAttribute("d",this.path.join(" "));else return;a&&null!=d.fillColor?this.updateFill():this.styleEnabled||("ellipse"==c.nodeName&&mxClient.IS_FF?c.setAttribute("fill","transparent"):c.setAttribute("fill","none"),a=!1);b&&null!=d.strokeColor?this.updateStroke():this.styleEnabled||c.setAttribute("stroke","none");null!=d.transform&&0<d.transform.length&&
c.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");d.shadow&&this.root.appendChild(this.createShadow(c));0<this.strokeTolerance&&(!a||null==d.fillColor)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=
c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};
mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");d="url("+d+"#"+c+
")"}else d="url(#"+c+")"}else d=String(a.fillColor).toLowerCase();b||null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?this.node.setAttribute("fill",d):(a=this.getFillPattern(a.fillStyle,this.getCurrentStrokeWidth(),d,a.scale),this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")"))};
mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};
mxSvgCanvas2D.prototype.updateStroke=function(){var a=this.state;this.node.setAttribute("stroke",String(a.strokeColor).toLowerCase());(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);var b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale))};
mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};
mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Number(c[d])*a}return b.join(" ")};
mxSvgCanvas2D.prototype.createTolerance=function(a){a=a.cloneNode(!0);var b=parseFloat(a.getAttribute("stroke-width")||1)+this.strokeTolerance;a.setAttribute("pointer-events","stroke");a.setAttribute("visibility","hidden");a.removeAttribute("stroke-dasharray");a.setAttribute("stroke-width",b);a.setAttribute("fill","none");a.setAttribute("stroke",mxClient.IS_OT?"none":"white");return a};
mxSvgCanvas2D.prototype.createShadow=function(a){a=a.cloneNode(!0);var b=this.state;"none"==a.getAttribute("fill")||mxClient.IS_FF&&"transparent"==a.getAttribute("fill")||a.setAttribute("fill",b.shadowColor);"none"!=a.getAttribute("stroke")&&a.setAttribute("stroke",b.shadowColor);a.setAttribute("transform","translate("+this.format(b.shadowDx*b.scale)+","+this.format(b.shadowDy*b.scale)+")"+(b.transform||""));a.setAttribute("opacity",b.shadowAlpha);return a};
mxSvgCanvas2D.prototype.setLink=function(a,b){if(null==a)this.root=this.originalRoot;else{this.originalRoot=this.root;var c=this.createElement("a");null==c.setAttributeNS||this.root.ownerDocument!=document&&null==document.documentMode?c.setAttribute("xlink:href",a):c.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",a);null!=b&&c.setAttribute("target",b);this.root.appendChild(c);this.root=c}};
mxSvgCanvas2D.prototype.rotate=function(a,b,c,d,e){if(0!=a||b||c){var f=this.state;d+=f.dx;e+=f.dy;d*=f.scale;e*=f.scale;f.transform=f.transform||"";if(b&&c)a+=180;else if(b!=c){var g=b?d:0,k=b?-1:1,l=c?e:0,m=c?-1:1;f.transform+="translate("+this.format(g)+","+this.format(l)+")scale("+this.format(k)+","+this.format(m)+")translate("+this.format(-g)+","+this.format(-l)+")"}if(b?!c:c)a*=-1;0!=a&&(f.transform+="rotate("+this.format(a)+","+this.format(d)+","+this.format(e)+")");f.rotation+=a;f.rotationCx=
d;f.rotationCy=e}};mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments);this.node=this.createElement("path")};mxSvgCanvas2D.prototype.rect=function(a,b,c,d){var e=this.state,f=this.createElement("rect");f.setAttribute("x",this.format((a+e.dx)*e.scale));f.setAttribute("y",this.format((b+e.dy)*e.scale));f.setAttribute("width",this.format(c*e.scale));f.setAttribute("height",this.format(d*e.scale));this.node=f};
mxSvgCanvas2D.prototype.roundrect=function(a,b,c,d,e,f){this.rect(a,b,c,d);0<e&&this.node.setAttribute("rx",this.format(e*this.state.scale));0<f&&this.node.setAttribute("ry",this.format(f*this.state.scale))};mxSvgCanvas2D.prototype.ellipse=function(a,b,c,d){var e=this.state,f=this.createElement("ellipse");f.setAttribute("cx",this.format((a+c/2+e.dx)*e.scale));f.setAttribute("cy",this.format((b+d/2+e.dy)*e.scale));f.setAttribute("rx",c/2*e.scale);f.setAttribute("ry",d/2*e.scale);this.node=f};
mxSvgCanvas2D.prototype.image=function(a,b,c,d,e,f,g,k,l){e=this.converter.convert(e);f=null!=f?f:!0;g=null!=g?g:!1;k=null!=k?k:!1;var m=this.state;a+=m.dx;b+=m.dy;var n=this.createElement("image");n.setAttribute("x",this.format(a*m.scale)+this.imageOffset);n.setAttribute("y",this.format(b*m.scale)+this.imageOffset);n.setAttribute("width",this.format(c*m.scale));n.setAttribute("height",this.format(d*m.scale));null==n.setAttributeNS?n.setAttribute("xlink:href",e):n.setAttributeNS(mxConstants.NS_XLINK,
"xlink:href",e);f||n.setAttribute("preserveAspectRatio","none");(1>m.alpha||1>m.fillAlpha)&&n.setAttribute("opacity",m.alpha*m.fillAlpha);e=this.state.transform||"";if(g||k){var p=f=1,r=0,q=0;g&&(f=-1,r=-c-2*a);k&&(p=-1,q=-d-2*b);e+="scale("+f+","+p+")translate("+r*m.scale+","+q*m.scale+")"}0<e.length&&n.setAttribute("transform",e);this.pointerEvents||n.setAttribute("pointer-events","none");null!=l&&this.processClipPath(n,l,new mxRectangle(a,b,c,d));this.root.appendChild(n)};
mxSvgCanvas2D.prototype.processClipPath=function(a,b,c){try{var d=this.createElement("clipPath");d.setAttribute("id",this.createClipPathId(b));d.setAttribute("clipPathUnits","objectBoundingBox");var e=this.appendClipPath(d,b,c);if(null!=e){var f=this.state;a.setAttribute("x",c.x*f.scale-c.width*f.scale*e.x/e.width+this.imageOffset);a.setAttribute("y",c.y*f.scale-c.height*f.scale*e.y/e.height+this.imageOffset);a.setAttribute("width",c.width*f.scale/e.width);a.setAttribute("height",c.height*f.scale/
e.height)}this.setClip(a,d)}catch(g){}};
mxSvgCanvas2D.prototype.convertHtml=function(a){if(this.useDomParser){var b=(new DOMParser).parseFromString(a,"text/html");null!=b&&(a=(new XMLSerializer).serializeToString(b.body),"<body"==a.substring(0,5)&&(a=a.substring(a.indexOf(">",5)+1)),"</body>"==a.substring(a.length-7,a.length)&&(a=a.substring(0,a.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){b=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null);var c=b.createElement("body");
b.documentElement.appendChild(c);var d=document.createElement("div");d.innerHTML=a;for(a=d.firstChild;null!=a;)d=a.nextSibling,c.appendChild(b.adoptNode(a)),a=d;return c.innerHTML}b=document.createElement("textarea");b.innerHTML=a.replace(/&amp;/g,"&amp;amp;").replace(/&#60;/g,"&amp;lt;").replace(/&#62;/g,"&amp;gt;").replace(/&lt;/g,"&amp;lt;").replace(/&gt;/g,"&amp;gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;");a=b.value.replace(/&/g,"&amp;").replace(/&amp;lt;/g,"&lt;").replace(/&amp;gt;/g,"&gt;").replace(/&amp;amp;/g,
"&amp;").replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />").replace(/(<img[^>]+)>/gm,"$1 />")}return a};
mxSvgCanvas2D.prototype.createDiv=function(a){mxUtils.isNode(a)||(a="<div><div>"+this.convertHtml(a)+"</div></div>");if(mxClient.IS_IE||mxClient.IS_IE11||!document.createElementNS)return mxUtils.isNode(a)&&(a="<div><div>"+mxUtils.getXml(a)+"</div></div>"),mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml">'+a+"</div>").documentElement;var b=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(a)){var c=document.createElement("div"),d=c.cloneNode(!1);this.root.ownerDocument!=
document?c.appendChild(a.cloneNode(!0)):c.appendChild(a);d.appendChild(c);b.appendChild(d)}else b.innerHTML=a;return b};mxSvgCanvas2D.prototype.updateText=function(a,b,c,d,e,f,g,k,l,m,n){null!=n&&null!=n.firstChild&&null!=n.firstChild.firstChild&&this.updateTextNodes(a,b,c,d,e,f,g,k,l,m,n.firstChild)};
mxSvgCanvas2D.prototype.addForeignObject=function(a,b,c,d,e,f,g,k,l,m,n,p,r,q,t){r=this.createElement("g");var u=this.createElement("foreignObject");this.setCssText(u,"overflow: visible; text-align: left;");u.setAttribute("pointer-events","none");q.ownerDocument!=document&&(q=mxUtils.importNodeImplementation(u.ownerDocument,q,!0));u.appendChild(q);r.appendChild(u);this.updateTextNodes(a,b,c,d,f,g,k,m,n,p,r);this.root.ownerDocument!=document&&(a=this.createAlternateContent(u,a,b,c,d,e,f,g,k,l,m,n,
p),null!=a&&(u.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),b=this.createElement("switch"),b.appendChild(u),b.appendChild(a),r.appendChild(b)));t.appendChild(r)};
mxSvgCanvas2D.prototype.updateTextNodes=function(a,b,c,d,e,f,g,k,l,m,n){var p=this.state.scale;mxSvgCanvas2D.createCss(c+this.foreignObjectPadding,d,e,f,g,k,l,null!=this.state.fontBackgroundColor?this.state.fontBackgroundColor:null,null!=this.state.fontBorderColor?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(f==mxConstants.ALIGN_TOP?"flex-start":f==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(e==mxConstants.ALIGN_LEFT?"flex-start":e==mxConstants.ALIGN_RIGHT?
"flex-end":"center")+"; ",this.getTextCss(),p,mxUtils.bind(this,function(r,q,t,u,x){a+=this.state.dx;b+=this.state.dy;var A=n.firstChild,E=A.firstChild,C=E.firstChild,D=(this.rotateHtml?this.state.rotation:0)+(null!=m?m:0),B=(0!=this.foOffset?"translate("+this.foOffset+" "+this.foOffset+")":"")+(1!=p?"scale("+p+")":"");this.setCssText(C.firstChild,x);this.setCssText(C,u);C.setAttribute("data-drawio-colors","color: "+this.state.fontColor+"; "+(null==this.state.fontBackgroundColor?"":"background-color: "+
this.state.fontBackgroundColor+"; ")+(null==this.state.fontBorderColor?"":"border-color: "+this.state.fontBorderColor+"; "));A.setAttribute("width",Math.ceil(1/Math.min(1,p)*100)+"%");A.setAttribute("height",Math.ceil(1/Math.min(1,p)*100)+"%");q=Math.round(b+q);0>q?A.setAttribute("y",q):(A.removeAttribute("y"),t+="padding-top: "+q+"px; ");this.setCssText(E,t+"margin-left: "+Math.round(a+r)+"px;");B+=0!=D?"rotate("+D+" "+a+" "+b+")":"";""!=B?n.setAttribute("transform",B):n.removeAttribute("transform");
1!=this.state.alpha?n.setAttribute("opacity",this.state.alpha):n.removeAttribute("opacity")}))};
mxSvgCanvas2D.createCss=function(a,b,c,d,e,f,g,k,l,m,n,p,r){p="box-sizing: border-box; font-size: 0; text-align: "+(c==mxConstants.ALIGN_LEFT?"left":c==mxConstants.ALIGN_RIGHT?"right":"center")+"; ";var q=mxUtils.getAlignmentAsPoint(c,d);c="overflow: hidden; ";var t="width: 1px; ",u="height: 1px; ",x=q.x*a;q=q.y*b;g?(t="width: "+Math.round(a)+"px; ",p+="max-height: "+Math.round(b)+"px; ",q=0):"fill"==f?(t="width: "+Math.round(a)+"px; ",u="height: "+Math.round(b)+"px; ",n+="width: 100%; height: 100%; ",
p+="width: "+Math.round(a-2)+"px; "+u):"width"==f?(t="width: "+Math.round(a-2)+"px; ",n+="width: 100%; ",p+=t,q=0,0<b&&(p+="max-height: "+Math.round(b)+"px; ")):"block"==f?(t="width: "+Math.round(a-2)+"px; ",n+="width: 100%; ",c="",q=0,p+=t,"middle"==d&&(p+="max-height: "+Math.round(b)+"px; ")):(c="",q=0);b="";null!=k&&(b+="background-color: "+k+"; ");null!=l&&(b+="border: 1px solid "+l+"; ");""==c||g?n+=b:p+=b;e&&0<a?(n+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",t="width: "+Math.round(a)+
"px; ",""!=c&&"fill"!=f&&(q=0)):(n+="white-space: nowrap; ",""==c&&"block"!=f&&(x=0));r(x,q,m+t+u,p+c,n,c)};
mxSvgCanvas2D.prototype.getTextCss=function(){var a=this.state,b="display: inline-block; font-size: "+a.fontSize+"px; font-family: "+a.fontFamily+"; color: "+a.fontColor+"; line-height: "+(mxConstants.ABSOLUTE_LINE_HEIGHT?a.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection)+"; pointer-events: "+(this.pointerEvents?this.pointerEventsValue:"none")+"; ";(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(b+="font-weight: bold; ");(a.fontStyle&mxConstants.FONT_ITALIC)==
mxConstants.FONT_ITALIC&&(b+="font-style: italic; ");var c=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&c.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&c.push("line-through");0<c.length&&(b+="text-decoration: "+c.join(" ")+"; ");return b};
mxSvgCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,r){if(this.textEnabled&&null!=e)if(p=null!=p?p:0,this.foEnabled&&"html"==l){var q=this.createDiv(e);null!=q&&(null!=r&&q.setAttribute("dir",r),this.addForeignObject(a,b,c,d,e,f,g,k,l,m,n,p,r,q,this.root))}else this.plainText(a+this.state.dx,b+this.state.dy,c,d,e,f,g,k,m,n,p,r)};
mxSvgCanvas2D.prototype.createClip=function(a,b,c,d){a=Math.round(a);b=Math.round(b);c=Math.round(c);d=Math.round(d);for(var e="mx-clip-"+a+"-"+b+"-"+c+"-"+d,f=0,g=e+"-"+f;null!=document.getElementById(g);)g=e+"-"+ ++f;e=this.createElement("clipPath");e.setAttribute("id",g);g=this.createElement("rect");g.setAttribute("x",a);g.setAttribute("y",b);g.setAttribute("width",c);g.setAttribute("height",d);e.appendChild(g);return e};
mxSvgCanvas2D.prototype.createClipPathId=function(a){a="mx-clippath-"+a.replace(/[^a-zA-Z0-9]+/g,"-");for(var b="-"==a.charAt(a.length-1)?"":"-",c=0,d=a+b+c;null!=document.getElementById(d);)d=a+b+ ++c;return d};
mxSvgCanvas2D.prototype.appendClipPath=function(a,b,c){var d=b.match(/\(([^)]+)\)/),e=null;"polygon"==b.substring(0,7)?e=this.appendPolygonClip(d[1],a,c):"circle"==b.substring(0,6)?e=this.appendCircleClip(d[1],a,c):"ellipse"==b.substring(0,7)?e=this.appendEllipseClip(d[1],a,c):"inset"==b.substring(0,5)&&(e=this.appendInsetClip(d[1],a,c));return e};
mxSvgCanvas2D.prototype.appendPolygonClip=function(a,b,c){c=this.createElement("polygon");a=a.split(/[ ,]+/);for(var d=null,e=null,f=null,g=null,k=[],l=0;l<a.length;l++){var m=this.parseClipValue(a,l);if(0==l%2){if(null==d||d>m)d=m;if(null==f||f<m)f=m}else{if(null==e||e>m)e=m;if(null==g||g<m)g=m}k.push(m)}c.setAttribute("points",k.join(","));b.appendChild(c);return new mxRectangle(d,e,f-d,g-e)};
mxSvgCanvas2D.prototype.appendCircleClip=function(a,b,c){c=this.createElement("circle");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,2);d=this.parseClipValue(d,3);c.setAttribute("r",a);c.setAttribute("cx",e);c.setAttribute("cy",d);b.appendChild(c);return new mxRectangle(e-a,d-a,2*a,2*a)};
mxSvgCanvas2D.prototype.appendEllipseClip=function(a,b,c){c=this.createElement("ellipse");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,1),f=this.parseClipValue(d,3);d=this.parseClipValue(d,4);c.setAttribute("rx",a);c.setAttribute("ry",e);c.setAttribute("cx",f);c.setAttribute("cy",d);b.appendChild(c);return new mxRectangle(f-a,d-e,2*a,2*e)};
mxSvgCanvas2D.prototype.appendInsetClip=function(a,b,c){c=this.createElement("rect");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,1),f=this.parseClipValue(d,2),g=this.parseClipValue(d,3);e=1-e-g;f=1-a-f;c.setAttribute("x",g);c.setAttribute("y",a);c.setAttribute("width",e);c.setAttribute("height",f);4<d.length&&"round"==d[4]&&(d=this.parseClipValue(d,5),c.setAttribute("rx",d),c.setAttribute("ry",d));b.appendChild(c);return new mxRectangle(g,a,e,f)};
mxSvgCanvas2D.prototype.parseClipValue=function(a,b){b=a[Math.min(b,a.length-1)];a=1;"center"==b?a=.5:"top"==b||"left"==b?a=0:(b=parseFloat(b),isNaN(b)||(a=Math.max(0,Math.min(1,b/100))));return a};
mxSvgCanvas2D.prototype.setClip=function(a,b){null!=this.defs?this.defs.appendChild(b):this.root.appendChild(b);if(mxClient.IS_CHROMEAPP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)a.setAttribute("clip-path","url(#"+b.getAttribute("id")+")");else{var c=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");a.setAttribute("clip-path","url("+c+"#"+b.getAttribute("id")+")")}};
mxSvgCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,k,l,m,n,p){n=null!=n?n:0;k=this.state;var r=k.fontSize,q=this.createElement("g"),t=k.transform||"";this.updateFont(q);this.pointerEvents||null!=this.originalRoot||q.setAttribute("pointer-events","none");0!=n&&(t+="rotate("+n+","+this.format(a*k.scale)+","+this.format(b*k.scale)+")");null!=p&&q.setAttribute("direction",p);m&&0<c&&0<d&&(p=a,n=b,f==mxConstants.ALIGN_CENTER?p-=c/2:f==mxConstants.ALIGN_RIGHT&&(p-=c),"fill"!=l&&(g==mxConstants.ALIGN_MIDDLE?
n-=d/2:g==mxConstants.ALIGN_BOTTOM&&(n-=d)),this.setClip(q,this.createClip(p*k.scale-2,n*k.scale-2,c*k.scale+4,d*k.scale+4)));n=f==mxConstants.ALIGN_RIGHT?"end":f==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=n&&q.setAttribute("text-anchor",n);this.styleEnabled&&r==mxConstants.DEFAULT_FONTSIZE||q.setAttribute("font-size",r*k.scale+"px");0<t.length&&q.setAttribute("transform",t);1>k.alpha&&q.setAttribute("opacity",k.alpha);t=e.split("\n");p=Math.round(r*mxConstants.LINE_HEIGHT);var u=r+(t.length-
1)*p;n=b+r-1;g==mxConstants.ALIGN_MIDDLE?"fill"==l?n-=d/2:(m=(this.matchHtmlAlignment&&m&&0<d?Math.min(u,d):u)/2,n-=m):g==mxConstants.ALIGN_BOTTOM&&("fill"==l?n-=d:(m=this.matchHtmlAlignment&&m&&0<d?Math.min(u,d):u,n-=m+1));for(m=0;m<t.length;m++)0<t[m].length&&0<mxUtils.trim(t[m]).length&&(r=this.createElement("text"),r.setAttribute("x",this.format(a*k.scale)+this.textOffset),r.setAttribute("y",this.format(n*k.scale)+this.textOffset),mxUtils.write(r,t[m]),q.appendChild(r)),n+=p;this.root.appendChild(q);
this.addTextBackground(q,e,a,b,c,"fill"==l?d:u,f,g,l)};
mxSvgCanvas2D.prototype.updateFont=function(a){var b=this.state;a.setAttribute("fill",b.fontColor);this.styleEnabled&&b.fontFamily==mxConstants.DEFAULT_FONTFAMILY||a.setAttribute("font-family",b.fontFamily);(b.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&a.setAttribute("font-weight","bold");(b.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&a.setAttribute("font-style","italic");var c=[];(b.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&c.push("underline");
(b.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&c.push("line-through");0<c.length&&a.setAttribute("text-decoration",c.join(" "))};
mxSvgCanvas2D.prototype.addTextBackground=function(a,b,c,d,e,f,g,k,l){var m=this.state;if(null!=m.fontBackgroundColor||null!=m.fontBorderColor){var n=null;if("fill"==l||"width"==l)g==mxConstants.ALIGN_CENTER?c-=e/2:g==mxConstants.ALIGN_RIGHT&&(c-=e),k==mxConstants.ALIGN_MIDDLE?d-=f/2:k==mxConstants.ALIGN_BOTTOM&&(d-=f),n=new mxRectangle((c+1)*m.scale,d*m.scale,(e-2)*m.scale,(f+2)*m.scale);else if(null!=a.getBBox&&this.root.ownerDocument==document)try{n=a.getBBox();var p=mxClient.IS_IE&&mxClient.IS_SVG;
n=new mxRectangle(n.x,n.y+(p?0:1),n.width,n.height+(p?1:0))}catch(r){}if(null==n||0==n.width||0==n.height)n=document.createElement("div"),n.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?m.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,n.style.fontSize=m.fontSize+"px",n.style.fontFamily=m.fontFamily,n.style.whiteSpace="nowrap",n.style.position="absolute",n.style.visibility="hidden",n.style.display="inline-block",n.style.zoom="1",(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&
(n.style.fontWeight="bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(n.style.fontStyle="italic"),b=mxUtils.htmlEntities(b,!1),n.innerHTML=b.replace(/\n/g,"<br/>"),document.body.appendChild(n),e=n.offsetWidth,f=n.offsetHeight,n.parentNode.removeChild(n),g==mxConstants.ALIGN_CENTER?c-=e/2:g==mxConstants.ALIGN_RIGHT&&(c-=e),k==mxConstants.ALIGN_MIDDLE?d-=f/2:k==mxConstants.ALIGN_BOTTOM&&(d-=f),n=new mxRectangle((c+1)*m.scale,(d+2)*m.scale,e*m.scale,(f+1)*m.scale);null!=n&&(b=
this.createElement("rect"),b.setAttribute("fill",m.fontBackgroundColor||"none"),b.setAttribute("stroke",m.fontBorderColor||"none"),b.setAttribute("x",Math.floor(n.x-1)),b.setAttribute("y",Math.floor(n.y-1)),b.setAttribute("width",Math.ceil(n.width+2)),b.setAttribute("height",Math.ceil(n.height)),m=null!=m.fontBorderColor?Math.max(1,this.format(m.scale)):0,b.setAttribute("stroke-width",m),this.root.ownerDocument==document&&1==mxUtils.mod(m,2)&&b.setAttribute("transform","translate(0.5, 0.5)"),a.insertBefore(b,
a.firstChild))}};mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)};mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)};mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};function mxGuide(a,b){this.graph=a;this.setStates(b)}mxGuide.prototype.graph=null;mxGuide.prototype.states=null;mxGuide.prototype.horizontal=!0;mxGuide.prototype.vertical=!0;mxGuide.prototype.guideX=null;mxGuide.prototype.guideY=null;mxGuide.prototype.rounded=!1;
mxGuide.prototype.tolerance=2;mxGuide.prototype.setStates=function(a){this.states=a};mxGuide.prototype.isEnabledForEvent=function(a){return!0};mxGuide.prototype.getGuideTolerance=function(a){return a&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance};mxGuide.prototype.createGuideShape=function(a){a=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);a.isDashed=!0;return a};mxGuide.prototype.isStateIgnored=function(a){return!1};
mxGuide.prototype.move=function(a,b,c,d){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=b){d=function(B,v,y){var F=!1;y&&Math.abs(B-D)<t?(b.y=B-a.getCenterY(),t=Math.abs(B-D),F=!0):y||(Math.abs(B-E)<t?(b.y=B-a.y,t=Math.abs(B-E),F=!0):Math.abs(B-C)<t&&(b.y=B-a.y-a.height,t=Math.abs(B-C),F=!0));F&&(p=v,r=B,null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane())));
n=n||F};var e=function(B,v,y){var F=!1;y&&Math.abs(B-A)<q?(b.x=B-a.getCenterX(),q=Math.abs(B-A),F=!0):y||(Math.abs(B-u)<q?(b.x=B-a.x,q=Math.abs(B-u),F=!0):Math.abs(B-x)<q&&(b.x=B-a.x-a.width,q=Math.abs(B-x),F=!0));F&&(l=v,m=B,null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane())));k=k||F},f=this.graph.getView().scale;f*=this.getGuideTolerance(c);var g=a.clone();g.x+=
b.x;g.y+=b.y;var k=!1,l=null,m=null,n=!1,p=null,r=null,q=f,t=f,u=g.x,x=g.x+g.width,A=g.getCenterX(),E=g.y,C=g.y+g.height,D=g.getCenterY();for(f=0;f<this.states.length;f++)g=this.states[f],null==g||this.isStateIgnored(g)||(this.horizontal&&(e.call(this,g.getCenterX(),g,!0),e.call(this,g.x,g,!1),e.call(this,g.x+g.width,g,!1),null==g.cell&&e.call(this,g.getCenterX(),g,!1)),this.vertical&&(d.call(this,g.getCenterY(),g,!0),d.call(this,g.y,g,!1),d.call(this,g.y+g.height,g,!1),null==g.cell&&d.call(this,
g.getCenterY(),g,!1)));this.graph.snapDelta(b,a,!c,k,n);b=this.getDelta(a,l,b.x,p,b.y);c=this.graph.container;k||null==this.guideX?null!=this.guideX&&(e=d=null,null!=l&&null!=a&&(d=Math.min(a.y+b.y-this.graph.panDy,l.y),e=Math.max(a.y+a.height+b.y-this.graph.panDy,l.y+l.height)),this.guideX.points=null!=d&&null!=e?[new mxPoint(m,d),new mxPoint(m,e)]:[new mxPoint(m,-this.graph.panDy),new mxPoint(m,c.scrollHeight-3-this.graph.panDy)],this.guideX.stroke=this.getGuideColor(l,!0),this.guideX.node.style.visibility=
"visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden";n||null==this.guideY?null!=this.guideY&&(e=d=null,null!=p&&null!=a&&(d=Math.min(a.x+b.x-this.graph.panDx,p.x),e=Math.max(a.x+a.width+b.x-this.graph.panDx,p.x+p.width)),this.guideY.points=null!=d&&null!=e?[new mxPoint(d,r),new mxPoint(e,r)]:[new mxPoint(-this.graph.panDx,r),new mxPoint(c.scrollWidth-3-this.graph.panDx,r)],this.guideY.stroke=this.getGuideColor(p,!1),this.guideY.node.style.visibility="visible",this.guideY.redraw()):
this.guideY.node.style.visibility="hidden"}return b};mxGuide.prototype.getDelta=function(a,b,c,d,e){var f=this.graph.view.scale;if(this.rounded||null!=b&&null==b.cell)c=Math.round((a.x+c)/f)*f-a.x;if(this.rounded||null!=d&&null==d.cell)e=Math.round((a.y+e)/f)*f-a.y;return new mxPoint(c,e)};mxGuide.prototype.getGuideColor=function(a,b){return mxConstants.GUIDE_COLOR};mxGuide.prototype.hide=function(){this.setVisible(!1)};
mxGuide.prototype.setVisible=function(a){null!=this.guideX&&(this.guideX.node.style.visibility=a?"visible":"hidden");null!=this.guideY&&(this.guideY.node.style.visibility=a?"visible":"hidden")};mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null);null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)};function mxShape(a){this.stencil=a;this.initStyles()}mxShape.prototype.dialect=null;mxShape.prototype.scale=1;mxShape.prototype.antiAlias=!0;
mxShape.prototype.minSvgStrokeWidth=1;mxShape.prototype.bounds=null;mxShape.prototype.points=null;mxShape.prototype.node=null;mxShape.prototype.state=null;mxShape.prototype.style=null;mxShape.prototype.boundingBox=null;mxShape.prototype.stencil=null;mxShape.prototype.svgStrokeTolerance=8;mxShape.prototype.pointerEvents=!0;mxShape.prototype.svgPointerEvents="all";mxShape.prototype.shapePointerEvents=!1;mxShape.prototype.stencilPointerEvents=!1;mxShape.prototype.outline=!1;
mxShape.prototype.visible=!0;mxShape.prototype.useSvgBoundingBox=!1;mxShape.prototype.init=function(a){null==this.node&&(this.node=this.create(a),null!=a&&a.appendChild(this.node))};mxShape.prototype.initStyles=function(a){this.strokewidth=1;this.rotation=0;this.strokeOpacity=this.fillOpacity=this.opacity=100;this.flipV=this.flipH=!1};mxShape.prototype.isHtmlAllowed=function(){return!1};
mxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round((this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth)*this.scale)),2)?.5:0};mxShape.prototype.create=function(a){return null!=a&&null!=a.ownerSVGElement?this.createSvg(a):this.createHtml(a)};mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")};
mxShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxShape.prototype.reconfigure=function(){this.redraw()};mxShape.prototype.redraw=function(){this.updateBoundsFromPoints();this.visible&&this.checkBounds()?(this.node.style.visibility="visible",this.clear(),"DIV"==this.node.nodeName?this.redrawHtmlShape():this.redrawShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)};
mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerText=""};
mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),1,1);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),1,1))}};
mxShape.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),c=a;b!=mxConstants.DIRECTION_SOUTH&&b!=mxConstants.DIRECTION_NORTH&&null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(c=c.clone(),b=c.width,c.width=c.height,c.height=b);c=this.getLabelMargins(c);if(null!=c){var d="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,!1),e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,
!1);null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(b=c.x,c.x=c.height,c.height=c.width,c.width=c.y,c.y=b,b=d,d=e,e=b);return mxUtils.getDirectedBounds(a,c,this.style,d,e)}return a};mxShape.prototype.getLabelMargins=function(a){return null};
mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height};
mxShape.prototype.redrawShape=function(){var a=this.createCanvas();null!=a&&(a.pointerEvents=this.pointerEvents,this.beforePaint(a),this.paint(a),this.afterPaint(a),this.node!=a.root&&this.node.insertAdjacentHTML("beforeend",a.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(a))};
mxShape.prototype.createCanvas=function(){var a=null;null!=this.node.ownerSVGElement&&(a=this.createSvgCanvas());null!=a&&this.outline&&(a.setStrokeWidth(this.strokewidth),a.setStrokeColor(this.stroke),null!=this.isDashed&&a.setDashed(this.isDashed),a.setStrokeWidth=function(){},a.setStrokeColor=function(){},a.setFillColor=function(){},a.setGradient=function(){},a.setDashed=function(){},a.text=function(){});return a};
mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a};
mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node);this.updateHtmlFilters(this.node);this.updateHtmlColors(this.node)};
mxShape.prototype.updateHtmlFilters=function(a){var b="";100>this.opacity&&(b+="alpha(opacity="+this.opacity+")");this.isShadow&&(b+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')");if(null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var c=this.fill,d=this.gradient,e="0",f={east:0,south:1,
west:2,north:3},g=null!=this.direction?f[this.direction]:0;null!=this.gradientDirection&&(g=mxUtils.mod(g+f[this.gradientDirection]-1,4));1==g?(e="1",f=c,c=d,d=f):2==g?(f=c,c=d,d=f):3==g&&(e="1");b+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+c+"', endColorStr='"+d+"', gradientType='"+e+"')"}a.style.filter=b};
mxShape.prototype.updateHtmlColors=function(a){var b=this.stroke;null!=b&&b!=mxConstants.NONE?(a.style.borderColor=b,this.isDashed?a.style.borderStyle="dashed":0<this.strokewidth&&(a.style.borderStyle="solid"),a.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):a.style.borderWidth="0px";b=this.outline?null:this.fill;null!=b&&b!=mxConstants.NONE?(a.style.backgroundColor=b,a.style.backgroundImage="none"):this.pointerEvents?a.style.backgroundColor="transparent":8==document.documentMode?
mxUtils.addTransparentBackgroundFilter(a):this.setTransparentBackgroundImage(a)};
mxShape.prototype.updateHtmlBounds=function(a){var b=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);a.style.borderWidth=Math.max(1,b)+"px";a.style.overflow="hidden";a.style.left=Math.round(this.bounds.x-b/2)+"px";a.style.top=Math.round(this.bounds.y-b/2)+"px";"CSS1Compat"==document.compatMode&&(b=-b);a.style.width=Math.round(Math.max(0,this.bounds.width+b))+"px";a.style.height=Math.round(Math.max(0,this.bounds.height+b))+"px"};
mxShape.prototype.destroyCanvas=function(a){if(a instanceof mxSvgCanvas2D){for(var b in a.gradients){var c=a.gradients[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)+1)}for(b in a.fillPatterns)c=a.fillPatterns[b],null!=c&&(c.mxRefCount=(c.mxRefCount||0)+1);this.releaseSvgGradients(this.oldGradients);this.releaseSvgFillPatterns(this.oldFillPatterns);this.oldGradients=a.gradients;this.oldFillPatterns=a.fillPatterns}};mxShape.prototype.beforePaint=function(a){};mxShape.prototype.afterPaint=function(a){};
mxShape.prototype.paint=function(a){var b=!1;if(null!=a&&this.outline){var c=a.stroke;a.stroke=function(){b=!0;c.apply(this,arguments)};var d=a.fillAndStroke;a.fillAndStroke=function(){b=!0;d.apply(this,arguments)}}var e=this.scale,f=this.bounds.x/e,g=this.bounds.y/e,k=this.bounds.width/e,l=this.bounds.height/e;if(this.isPaintBoundsInverted()){var m=(k-l)/2;f+=m;g-=m;m=k;k=l;l=m}this.updateTransform(a,f,g,k,l);this.configureCanvas(a,f,g,k,l);m=null;if(null==this.stencil&&null==this.points&&this.shapePointerEvents||
null!=this.stencil&&this.stencilPointerEvents){var n=this.createBoundingBox();this.dialect==mxConstants.DIALECT_SVG?(m=this.createTransparentSvgRectangle(n.x,n.y,n.width,n.height),this.node.appendChild(m)):(e=a.createRect("rect",n.x/e,n.y/e,n.width/e,n.height/e),e.appendChild(a.createTransparentFill()),e.stroked="false",a.root.appendChild(e))}null!=this.stencil?this.stencil.drawShape(a,this,f,g,k,l):(a.setStrokeWidth(this.strokewidth),e=this.getWaypoints(),null!=e?1<e.length&&this.paintEdgeShape(a,
e):this.paintVertexShape(a,f,g,k,l));null!=m&&null!=a.state&&null!=a.state.transform&&m.setAttribute("transform",a.state.transform);null!=a&&this.outline&&!b&&(a.rect(f,g,k,l),a.stroke())};mxShape.prototype.getWaypoints=function(){var a=this.points,b=null;if(null!=a&&(b=[],0<a.length)){var c=this.scale,d=Math.max(c,1),e=a[0];b.push(new mxPoint(e.x/c,e.y/c));for(var f=1;f<a.length;f++){var g=a[f];(Math.abs(e.x-g.x)>=d||Math.abs(e.y-g.y)>=d)&&b.push(new mxPoint(g.x/c,g.y/c));e=g}}return b};
mxShape.prototype.configureCanvas=function(a,b,c,d,e){var f=null;null!=this.style&&(f=this.style.dashPattern);a.setAlpha(this.opacity/100);a.setFillAlpha(this.fillOpacity/100);a.setStrokeAlpha(this.strokeOpacity/100);null!=this.isShadow&&a.setShadow(this.isShadow);null!=this.isDashed&&a.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);null!=f&&a.setDashPattern(f);null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?
(b=this.getGradientBounds(a,b,c,d,e),a.setGradient(this.fill,this.gradient,b.x,b.y,b.width,b.height,this.gradientDirection)):(a.setFillColor(this.fill),a.setFillStyle(this.fillStyle));a.setStrokeColor(this.stroke);this.configurePointerEvents(a)};mxShape.prototype.configurePointerEvents=function(a){null==this.style||null!=this.fill&&this.fill!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(a.pointerEvents=!1)};
mxShape.prototype.getGradientBounds=function(a,b,c,d,e){return new mxRectangle(b,c,d,e)};mxShape.prototype.updateTransform=function(a,b,c,d,e){a.scale(this.scale);a.rotate(this.getShapeRotation(),this.flipH,this.flipV,b+d/2,c+e/2)};mxShape.prototype.paintVertexShape=function(a,b,c,d,e){this.paintBackground(a,b,c,d,e);this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(a.setShadow(!1),this.paintForeground(a,b,c,d,e))};
mxShape.prototype.paintBackground=function(a,b,c,d,e){};mxShape.prototype.paintForeground=function(a,b,c,d,e){};mxShape.prototype.paintEdgeShape=function(a,b){};
mxShape.prototype.getArcSize=function(a,b){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))a=Math.min(a/2,Math.min(b/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;a=Math.min(a*c,b*c)}return a};
mxShape.prototype.paintGlassEffect=function(a,b,c,d,e,f){var g=Math.ceil(this.strokewidth/2);a.setGradient("#ffffff","#ffffff",b,c,d,.6*e,"south",.9,.1);a.begin();f+=2*g;this.isRounded?(a.moveTo(b-g+f,c-g),a.quadTo(b-g,c-g,b-g,c-g+f),a.lineTo(b-g,c+.4*e),a.quadTo(b+.5*d,c+.7*e,b+d+g,c+.4*e),a.lineTo(b+d+g,c-g+f),a.quadTo(b+d+g,c-g,b+d+g-f,c-g)):(a.moveTo(b-g,c-g),a.lineTo(b-g,c+.4*e),a.quadTo(b+.5*d,c+.7*e,b+d+g,c+.4*e),a.lineTo(b+d+g,c-g));a.close();a.fill()};
mxShape.prototype.addPoints=function(a,b,c,d,e,f,g){if(null!=b&&0<b.length){g=null!=g?g:!0;var k=b[b.length-1];if(e&&c){b=b.slice();var l=b[0];l=new mxPoint(k.x+(l.x-k.x)/2,k.y+(l.y-k.y)/2);b.splice(0,0,l)}var m=b[0];l=1;for(g?a.moveTo(m.x,m.y):a.lineTo(m.x,m.y);l<(e?b.length:b.length-1);){g=b[mxUtils.mod(l,b.length)];var n=m.x-g.x;m=m.y-g.y;if(c&&(0!=n||0!=m)&&(null==f||0>mxUtils.indexOf(f,l-1))){var p=Math.sqrt(n*n+m*m);a.lineTo(g.x+n*Math.min(d,p/2)/p,g.y+m*Math.min(d,p/2)/p);for(m=b[mxUtils.mod(l+
1,b.length)];l<b.length-2&&0==Math.round(m.x-g.x)&&0==Math.round(m.y-g.y);)m=b[mxUtils.mod(l+2,b.length)],l++;n=m.x-g.x;m=m.y-g.y;p=Math.max(1,Math.sqrt(n*n+m*m));n=g.x+n*Math.min(d,p/2)/p;m=g.y+m*Math.min(d,p/2)/p;a.quadTo(g.x,g.y,n,m);g=new mxPoint(n,m)}else a.lineTo(g.x,g.y);m=g;l++}e?a.close():a.lineTo(k.x,k.y)}};
mxShape.prototype.resetStyles=function(){this.initStyles();this.spacing=0;delete this.fill;delete this.gradient;delete this.gradientDirection;delete this.stroke;delete this.startSize;delete this.endSize;delete this.startArrow;delete this.endArrow;delete this.direction;delete this.isShadow;delete this.isDashed;delete this.isRounded;delete this.glass};
mxShape.prototype.apply=function(a){this.state=a;this.style=a.style;if(null!=this.style){this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill);this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient);this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity);this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY,
this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,this.fillStyle);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,
mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,
mxConstants.STYLE_FLIPH,0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=
1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};
mxShape.prototype.getCursor=function(){return this.cursor};mxShape.prototype.isRoundable=function(){return!1};
mxShape.prototype.updateBoundingBox=function(){if(this.useSvgBoundingBox&&null!=this.node&&null!=this.node.ownerSVGElement)try{var a=this.node.getBBox();if(0<a.width&&0<a.height){this.boundingBox=new mxRectangle(a.x,a.y,a.width,a.height);this.boundingBox.grow(this.strokewidth*this.scale/2);return}}catch(c){}if(null!=this.bounds){a=this.createBoundingBox();if(null!=a){this.augmentBoundingBox(a);var b=this.getShapeRotation();0!=b&&(a=mxUtils.getBoundingBox(a,b))}this.boundingBox=a}};
mxShape.prototype.createBoundingBox=function(){var a=this.bounds.clone();(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&a.rotate90();return a};mxShape.prototype.augmentBoundingBox=function(a){this.isShadow&&(a.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),a.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale));a.grow(this.strokewidth*this.scale/2)};
mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)};mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0};mxShape.prototype.getTextRotation=function(){var a=this.getRotation();1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(a+=mxText.prototype.verticalTextRotation);return a};
mxShape.prototype.getShapeRotation=function(){var a=this.getRotation();null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?a+=270:this.direction==mxConstants.DIRECTION_WEST?a+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(a+=90));return a};
mxShape.prototype.createTransparentSvgRectangle=function(a,b,c,d){var e=document.createElementNS(mxConstants.NS_SVG,"rect");e.setAttribute("x",a);e.setAttribute("y",b);e.setAttribute("width",c);e.setAttribute("height",d);e.setAttribute("fill","none");e.setAttribute("stroke","none");e.setAttribute("pointer-events","all");return e};mxShape.prototype.setTransparentBackgroundImage=function(a){a.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"};
mxShape.prototype.intersectsRectangle=function(a){return null!=a&&null!=this.node&&"hidden"!=this.node.style.visibility&&"none"!=this.node.style.display&&mxUtils.intersects(this.bounds,a)};mxShape.prototype.releaseSvgGradients=function(a){if(null!=a)for(var b in a){var c=a[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)-1,0==c.mxRefCount&&null!=c.parentNode&&c.parentNode.removeChild(c))}};
mxShape.prototype.releaseSvgFillPatterns=function(a){if(null!=a)for(var b in a){var c=a[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)-1,0==c.mxRefCount&&null!=c.parentNode&&c.parentNode.removeChild(c))}};
mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null);this.releaseSvgGradients(this.oldGradients);this.releaseSvgFillPatterns(this.oldFillPatterns);this.oldFillPatterns=this.oldGradients=null};function mxStencil(a){this.desc=a;this.parseDescription();this.parseConstraints()}mxUtils.extend(mxStencil,mxShape);mxStencil.defaultLocalized=!1;mxStencil.allowEval=!1;
mxStencil.prototype.desc=null;mxStencil.prototype.constraints=null;mxStencil.prototype.aspect=null;mxStencil.prototype.w0=null;mxStencil.prototype.h0=null;mxStencil.prototype.bgNode=null;mxStencil.prototype.fgNode=null;mxStencil.prototype.strokewidth=null;
mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0];this.bgNode=this.desc.getElementsByTagName("background")[0];this.w0=Number(this.desc.getAttribute("w")||100);this.h0=Number(this.desc.getAttribute("h")||100);var a=this.desc.getAttribute("aspect");this.aspect=null!=a?a:"variable";a=this.desc.getAttribute("strokewidth");this.strokewidth=null!=a?a:"1"};
mxStencil.prototype.parseConstraints=function(){var a=this.desc.getElementsByTagName("connections")[0];if(null!=a&&(a=mxUtils.getChildNodes(a),null!=a&&0<a.length)){this.constraints=[];for(var b=0;b<a.length;b++)this.constraints.push(this.parseConstraint(a[b]))}};mxStencil.prototype.parseConstraint=function(a){var b=Number(a.getAttribute("x")),c=Number(a.getAttribute("y")),d="1"==a.getAttribute("perimeter");a=a.getAttribute("name");return new mxConnectionConstraint(new mxPoint(b,c),d,a)};
mxStencil.prototype.evaluateTextAttribute=function(a,b,c){b=this.evaluateAttribute(a,b,c);a=a.getAttribute("localized");if(mxStencil.defaultLocalized&&null==a||"1"==a)b=mxResources.get(b);return b};mxStencil.prototype.evaluateAttribute=function(a,b,c){b=a.getAttribute(b);null==b&&(a=mxUtils.getTextContent(a),null!=a&&mxStencil.allowEval&&(a=mxUtils.eval(a),"function"==typeof a&&(b=a(c))));return b};
mxStencil.prototype.drawShape=function(a,b,c,d,e,f){var g=a.states.slice(),k=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null);k=this.computeAspect(b.style,c,d,e,f,k);var l=Math.min(k.width,k.height);l="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*l;a.setStrokeWidth(l);null!=b.style&&"1"==mxUtils.getValue(b.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(a.setStrokeColor(mxConstants.NONE),a.rect(c,d,e,f),a.stroke(),a.setStrokeColor(b.stroke));
this.drawChildren(a,b,c,d,e,f,this.bgNode,k,!1,!0);this.drawChildren(a,b,c,d,e,f,this.fgNode,k,!0,!b.outline||null==b.style||0==mxUtils.getValue(b.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0));a.states.length!=g.length&&(a.states=g)};mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,k,l,m){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,k,l,m),c=c.nextSibling};
mxStencil.prototype.computeAspect=function(a,b,c,d,e,f){a=b;b=d/this.w0;var g=e/this.h0;if(f=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH){g=d/this.h0;b=e/this.w0;var k=(d-e)/2;a+=k;c-=k}"fixed"==this.aspect&&(b=g=Math.min(b,g),f?(a+=(e-this.w0*b)/2,c+=(d-this.h0*g)/2):(a+=(d-this.w0*b)/2,c+=(e-this.h0*g)/2));return new mxRectangle(a,c,b,g)};mxStencil.prototype.parseColor=function(a,b,c,d){"stroke"==d?d=b.stroke:"fill"==d&&(d=b.fill);return d};
mxStencil.prototype.drawNode=function(a,b,c,d,e,f){var g=c.nodeName,k=d.x,l=d.y,m=d.width,n=d.height,p=Math.min(m,n);if("save"==g)a.save();else if("restore"==g)a.restore();else if(f){if("path"==g){a.begin();p=!0;if("1"==c.getAttribute("rounded")){p=!1;for(var r=Number(c.getAttribute("arcSize")),q=0,t=[],u=c.firstChild;null!=u;){if(u.nodeType==mxConstants.NODETYPE_ELEMENT){var x=u.nodeName;if("move"==x||"line"==x)"move"!=x&&0!=t.length||t.push([]),t[t.length-1].push(new mxPoint(k+Number(u.getAttribute("x"))*
m,l+Number(u.getAttribute("y"))*n)),q++;else{p=!0;break}}u=u.nextSibling}if(!p&&0<q)for(m=0;m<t.length;m++)n=!1,l=t[m][0],k=t[m][t[m].length-1],l.x==k.x&&l.y==k.y&&(t[m].pop(),n=!0),this.addPoints(a,t[m],!0,r,n);else p=!0}if(p)for(u=c.firstChild;null!=u;)u.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,u,d,e,f),u=u.nextSibling}else if("close"==g)a.close();else if("move"==g)a.moveTo(k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n);else if("line"==g)a.lineTo(k+Number(c.getAttribute("x"))*
m,l+Number(c.getAttribute("y"))*n);else if("quad"==g)a.quadTo(k+Number(c.getAttribute("x1"))*m,l+Number(c.getAttribute("y1"))*n,k+Number(c.getAttribute("x2"))*m,l+Number(c.getAttribute("y2"))*n);else if("curve"==g)a.curveTo(k+Number(c.getAttribute("x1"))*m,l+Number(c.getAttribute("y1"))*n,k+Number(c.getAttribute("x2"))*m,l+Number(c.getAttribute("y2"))*n,k+Number(c.getAttribute("x3"))*m,l+Number(c.getAttribute("y3"))*n);else if("arc"==g)a.arcTo(Number(c.getAttribute("rx"))*m,Number(c.getAttribute("ry"))*
n,Number(c.getAttribute("x-axis-rotation")),Number(c.getAttribute("large-arc-flag")),Number(c.getAttribute("sweep-flag")),k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n);else if("rect"==g)a.rect(k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n,Number(c.getAttribute("w"))*m,Number(c.getAttribute("h"))*n);else if("roundrect"==g)b=Number(c.getAttribute("arcsize")),0==b&&(b=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),d=Number(c.getAttribute("w"))*m,f=Number(c.getAttribute("h"))*
n,b=Number(b)/100,b=Math.min(d*b,f*b),a.roundrect(k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n,d,f,b,b);else if("ellipse"==g)a.ellipse(k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n,Number(c.getAttribute("w"))*m,Number(c.getAttribute("h"))*n);else if("image"==g)b.outline||(b=this.evaluateAttribute(c,"src",b),a.image(k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n,Number(c.getAttribute("w"))*m,Number(c.getAttribute("h"))*n,b,!1,"1"==c.getAttribute("flipH"),
"1"==c.getAttribute("flipV")));else if("text"==g)b.outline||(d=this.evaluateTextAttribute(c,"str",b),f="1"==c.getAttribute("vertical")?-90:0,"0"==c.getAttribute("align-shape")&&(p=b.rotation,r=1==mxUtils.getValue(b.style,mxConstants.STYLE_FLIPH,0),b=1==mxUtils.getValue(b.style,mxConstants.STYLE_FLIPV,0),f=r&&b?f-p:r||b?f+p:f-p),f-=c.getAttribute("rotation"),a.text(k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n,0,0,d,c.getAttribute("align")||"left",c.getAttribute("valign")||"top",
!1,"",null,!1,f));else if("include-shape"==g)p=mxStencilRegistry.getStencil(c.getAttribute("name")),null!=p&&(k+=Number(c.getAttribute("x"))*m,l+=Number(c.getAttribute("y"))*n,d=Number(c.getAttribute("w"))*m,f=Number(c.getAttribute("h"))*n,p.drawShape(a,b,k,l,d,f));else if("fillstroke"==g)a.fillAndStroke();else if("fill"==g)a.fill();else if("stroke"==g)a.stroke();else if("strokewidth"==g)m="1"==c.getAttribute("fixed")?1:p,a.setStrokeWidth(Number(c.getAttribute("width"))*m);else if("dashed"==g)a.setDashed("1"==
c.getAttribute("dashed"));else if("dashpattern"==g){if(c=c.getAttribute("pattern"),null!=c){c=c.split(" ");n=[];for(m=0;m<c.length;m++)0<c[m].length&&n.push(Number(c[m])*p);c=n.join(" ");a.setDashPattern(c)}}else"strokecolor"==g?a.setStrokeColor(this.parseColor(a,b,c,c.getAttribute("color"))):"linecap"==g?a.setLineCap(c.getAttribute("cap")):"linejoin"==g?a.setLineJoin(c.getAttribute("join")):"miterlimit"==g?a.setMiterLimit(Number(c.getAttribute("limit"))):"fillcolor"==g?a.setFillColor(this.parseColor(a,
b,c,c.getAttribute("color"))):"alpha"==g?a.setAlpha(c.getAttribute("alpha")):"fillalpha"==g?a.setAlpha(c.getAttribute("alpha")):"strokealpha"==g?a.setAlpha(c.getAttribute("alpha")):"fontcolor"==g?a.setFontColor(this.parseColor(a,b,c,c.getAttribute("color"))):"fontstyle"==g?a.setFontStyle(c.getAttribute("style")):"fontfamily"==g?a.setFontFamily(c.getAttribute("family")):"fontsize"==g&&a.setFontSize(Number(c.getAttribute("size"))*p);!e||"fillstroke"!=g&&"fill"!=g&&"stroke"!=g||a.setShadow(!1)}};
var mxStencilRegistry={stencils:{},addStencil:function(a,b){mxStencilRegistry.stencils[a]=b},getStencil:function(a){return mxStencilRegistry.stencils[a]}},mxMarker={markers:[],addMarker:function(a,b){mxMarker.markers[a]=b},createMarker:function(a,b,c,d,e,f,g,k,l,m){var n=mxMarker.markers[c];return null!=n?n(a,b,c,d,e,f,g,k,l,m):null}};
(function(){function a(d){d=null!=d?d:2;return function(e,f,g,k,l,m,n,p,r,q){f=l*r*1.118;p=m*r*1.118;l*=n+r;m*=n+r;var t=k.clone();t.x-=f;t.y-=p;n=g!=mxConstants.ARROW_CLASSIC&&g!=mxConstants.ARROW_CLASSIC_THIN?1:.75;k.x+=-l*n-f;k.y+=-m*n-p;return function(){e.begin();e.moveTo(t.x,t.y);e.lineTo(t.x-l-m/d,t.y-m+l/d);g!=mxConstants.ARROW_CLASSIC&&g!=mxConstants.ARROW_CLASSIC_THIN||e.lineTo(t.x-3*l/4,t.y-3*m/4);e.lineTo(t.x+m/d-l,t.y-m-l/d);e.close();q?e.fillAndStroke():e.stroke()}}}function b(d){d=
null!=d?d:2;return function(e,f,g,k,l,m,n,p,r,q){f=l*r*1.118;g=m*r*1.118;l*=n+r;m*=n+r;var t=k.clone();t.x-=f;t.y-=g;k.x+=2*-f;k.y+=2*-g;return function(){e.begin();e.moveTo(t.x-l-m/d,t.y-m+l/d);e.lineTo(t.x,t.y);e.lineTo(t.x+m/d-l,t.y-m-l/d);e.stroke()}}}function c(d,e,f,g,k,l,m,n,p,r){n=f==mxConstants.ARROW_DIAMOND?.7071:.9862;e=k*p*n;n*=l*p;k*=m+p;l*=m+p;var q=g.clone();q.x-=e;q.y-=n;g.x+=-k-e;g.y+=-l-n;var t=f==mxConstants.ARROW_DIAMOND?2:3.4;return function(){d.begin();d.moveTo(q.x,q.y);d.lineTo(q.x-
k/2-l/t,q.y+k/t-l/2);d.lineTo(q.x-k,q.y-l);d.lineTo(q.x-k/2+l/t,q.y-l/2-k/t);d.close();r?d.fillAndStroke():d.stroke()}}mxMarker.addMarker("classic",a(2));mxMarker.addMarker("classicThin",a(3));mxMarker.addMarker("block",a(2));mxMarker.addMarker("blockThin",a(3));mxMarker.addMarker("open",b(2));mxMarker.addMarker("openThin",b(3));mxMarker.addMarker("oval",function(d,e,f,g,k,l,m,n,p,r){var q=m/2,t=g.clone();g.x-=k*q;g.y-=l*q;return function(){d.ellipse(t.x-q,t.y-q,m,m);r?d.fillAndStroke():d.stroke()}});
mxMarker.addMarker("baseDash",function(d,e,f,g,k,l,m,n,p,r){var q=k*(m+p+1),t=l*(m+p+1);return function(){d.begin();d.moveTo(g.x-t/2,g.y+q/2);d.lineTo(g.x+t/2,g.y-q/2);d.stroke()}});mxMarker.addMarker("doubleBlock",function(d,e,f,g,k,l,m,n,p,r){e=k*p*1.118;n=l*p*1.118;k*=m+p;l*=m+p;var q=g.clone();q.x-=e;q.y-=n;f=f!=mxConstants.ARROW_CLASSIC&&f!=mxConstants.ARROW_CLASSIC_THIN?1:.75;g.x+=-k*f*2-e;g.y+=-l*f*2-n;return function(){d.begin();d.moveTo(q.x,q.y);d.lineTo(q.x-k-l/2,q.y-l+k/2);d.lineTo(q.x+
l/2-k,q.y-l-k/2);d.close();d.moveTo(q.x-k,q.y-l);d.lineTo(q.x-2*k-.5*l,q.y+.5*k-2*l);d.lineTo(q.x-2*k+.5*l,q.y-.5*k-2*l);d.close();r?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("diamond",c);mxMarker.addMarker("diamondThin",c)})();function mxActor(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxActor,mxShape);mxActor.prototype.paintVertexShape=function(a,b,c,d,e){a.translate(b,c);a.begin();this.redrawPath(a,b,c,d,e);a.fillAndStroke()};
mxActor.prototype.redrawPath=function(a,b,c,d,e){b=d/3;a.moveTo(0,e);a.curveTo(0,3*e/5,0,2*e/5,d/2,2*e/5);a.curveTo(d/2-b,2*e/5,d/2-b,0,d/2,0);a.curveTo(d/2+b,0,d/2+b,2*e/5,d/2,2*e/5);a.curveTo(d,2*e/5,d,3*e/5,d,e);a.close()};function mxCloud(a,b,c,d){mxActor.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxCloud,mxActor);
mxCloud.prototype.redrawPath=function(a,b,c,d,e){a.moveTo(.25*d,.25*e);a.curveTo(.05*d,.25*e,0,.5*e,.16*d,.55*e);a.curveTo(0,.66*e,.18*d,.9*e,.31*d,.8*e);a.curveTo(.4*d,e,.7*d,e,.8*d,.8*e);a.curveTo(d,.8*e,d,.6*e,.875*d,.5*e);a.curveTo(d,.3*e,.8*d,.1*e,.625*d,.2*e);a.curveTo(.5*d,.05*e,.3*d,.05*e,.25*d,.25*e);a.close()};function mxRectangleShape(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxRectangleShape,mxShape);
mxRectangleShape.prototype.isHtmlAllowed=function(){var a=!0;null!=this.style&&(a="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));return!this.isRounded&&!this.glass&&0==this.rotation&&(a||null!=this.fill&&this.fill!=mxConstants.NONE)};
mxRectangleShape.prototype.paintBackground=function(a,b,c,d,e){if(this.isRounded){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))var f=Math.min(d/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.min(d*f,e*f);a.roundrect(b,c,d,e,f,f)}else a.rect(b,c,d,e);a.fillAndStroke()};
mxRectangleShape.prototype.isRoundable=function(){return!0};mxRectangleShape.prototype.paintForeground=function(a,b,c,d,e){this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(a,b,c,d,e,this.getArcSize(d+this.strokewidth,e+this.strokewidth))};function mxEllipse(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxEllipse,mxShape);
mxEllipse.prototype.paintVertexShape=function(a,b,c,d,e){a.ellipse(b,c,d,e);a.fillAndStroke()};function mxDoubleEllipse(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxDoubleEllipse,mxShape);mxDoubleEllipse.prototype.paintBackground=function(a,b,c,d,e){a.ellipse(b,c,d,e);a.fillAndStroke()};
mxDoubleEllipse.prototype.paintForeground=function(a,b,c,d,e){if(!this.outline){var f=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(d/5,e/5)));b+=f;c+=f;d-=2*f;e-=2*f;0<d&&0<e&&a.ellipse(b,c,d,e);a.stroke()}};
mxDoubleEllipse.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(a.width/5/this.scale,a.height/5/this.scale)))*this.scale;return new mxRectangle(a.x+b,a.y+b,a.width-2*b,a.height-2*b)};function mxRhombus(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxRhombus,mxShape);mxRhombus.prototype.isRoundable=function(){return!0};
mxRhombus.prototype.paintVertexShape=function(a,b,c,d,e){var f=d/2,g=e/2,k=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;a.begin();this.addPoints(a,[new mxPoint(b+f,c),new mxPoint(b+d,c+g),new mxPoint(b+f,c+e),new mxPoint(b,c+g)],this.isRounded,k,!0);a.fillAndStroke()};function mxPolyline(a,b,c){mxShape.call(this);this.points=a;this.stroke=b;this.strokewidth=null!=c?c:1}mxUtils.extend(mxPolyline,mxShape);mxPolyline.prototype.getRotation=function(){return 0};
mxPolyline.prototype.getShapeRotation=function(){return 0};mxPolyline.prototype.isPaintBoundsInverted=function(){return!1};mxPolyline.prototype.paintEdgeShape=function(a,b){var c=a.pointerEventsValue;a.pointerEventsValue="stroke";null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(a,b,this.isRounded):this.paintCurvedLine(a,b);a.pointerEventsValue=c};
mxPolyline.prototype.paintLine=function(a,b,c){var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;a.begin();this.addPoints(a,b,c,d,!1);a.stroke()};mxPolyline.prototype.paintCurvedLine=function(a,b){a.begin();var c=b[0],d=b.length;a.moveTo(c.x,c.y);for(c=1;c<d-2;c++){var e=b[c],f=b[c+1];a.quadTo(e.x,e.y,(e.x+f.x)/2,(e.y+f.y)/2)}e=b[d-2];f=b[d-1];a.quadTo(e.x,e.y,f.x,f.y);a.stroke()};
function mxArrow(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.spacing=null!=f?f:mxConstants.ARROW_SPACING;this.endSize=null!=g?g:mxConstants.ARROW_SIZE}mxUtils.extend(mxArrow,mxShape);mxArrow.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);a.grow((Math.max(this.arrowWidth,this.endSize)/2+this.strokewidth)*this.scale)};
mxArrow.prototype.paintEdgeShape=function(a,b){var c=mxConstants.ARROW_SPACING,d=mxConstants.ARROW_WIDTH,e=b[0];b=b[b.length-1];var f=b.x-e.x,g=b.y-e.y,k=Math.sqrt(f*f+g*g),l=k-2*c-mxConstants.ARROW_SIZE;f/=k;g/=k;k=d*g/3;d=-d*f/3;var m=e.x-k/2+c*f;e=e.y-d/2+c*g;var n=m+k,p=e+d,r=n+l*f;l=p+l*g;var q=r+k,t=l+d,u=q-3*k,x=t-3*d;a.begin();a.moveTo(m,e);a.lineTo(n,p);a.lineTo(r,l);a.lineTo(q,t);a.lineTo(b.x-c*f,b.y-c*g);a.lineTo(u,x);a.lineTo(u+k,x+d);a.close();a.fillAndStroke()};
function mxArrowConnector(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.arrowSpacing=null!=f?f:mxConstants.ARROW_SPACING;this.startSize=mxConstants.ARROW_SIZE/5;this.endSize=mxConstants.ARROW_SIZE/5}mxUtils.extend(mxArrowConnector,mxShape);mxArrowConnector.prototype.useSvgBoundingBox=!0;mxArrowConnector.prototype.isRoundable=function(){return!0};
mxArrowConnector.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.arrowSpacing=mxConstants.ARROW_SPACING};mxArrowConnector.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.startSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5),this.endSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5))};
mxArrowConnector.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=this.getEdgeWidth();this.isMarkerStart()&&(b=Math.max(b,this.getStartArrowWidth()));this.isMarkerEnd()&&(b=Math.max(b,this.getEndArrowWidth()));a.grow((b/2+this.strokewidth)*this.scale)};
mxArrowConnector.prototype.paintEdgeShape=function(a,b){var c=this.strokewidth;this.outline&&(c=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));var d=this.getStartArrowWidth()+c,e=this.getEndArrowWidth()+c,f=this.outline?this.getEdgeWidth()+c:this.getEdgeWidth(),g=this.isOpenEnded(),k=this.isMarkerStart(),l=this.isMarkerEnd(),m=g?0:this.arrowSpacing+c/2,n=this.startSize+c;c=this.endSize+c;var p=this.isArrowRounded(),r=b[b.length-1],q=b[1].x-b[0].x,t=b[1].y-
b[0].y,u=Math.sqrt(q*q+t*t);if(0!=u){var x=q/u,A=x,E=t/u,C=E;u=f*E;var D=-f*x,B=[];p?a.setLineJoin("round"):2<b.length&&a.setMiterLimit(1.42);a.begin();q=x;t=E;if(k&&!g)this.paintMarker(a,b[0].x,b[0].y,x,E,n,d,f,m,!0);else{var v=b[0].x+u/2+m*x,y=b[0].y+D/2+m*E,F=b[0].x-u/2+m*x,H=b[0].y-D/2+m*E;g?(a.moveTo(v,y),B.push(function(){a.lineTo(F,H)})):(a.moveTo(F,H),a.lineTo(v,y))}var G=y=v=0;for(u=0;u<b.length-2;u++)if(D=mxUtils.relativeCcw(b[u].x,b[u].y,b[u+1].x,b[u+1].y,b[u+2].x,b[u+2].y),v=b[u+2].x-
b[u+1].x,y=b[u+2].y-b[u+1].y,G=Math.sqrt(v*v+y*y),0!=G){A=v/G;C=y/G;G=Math.max(Math.sqrt((x*A+E*C+1)/2),.04);v=x+A;y=E+C;var z=Math.sqrt(v*v+y*y);if(0!=z){v/=z;y/=z;z=Math.max(G,Math.min(this.strokewidth/200+.04,.35));G=0!=D&&p?Math.max(.1,z):Math.max(G,.06);var J=b[u+1].x+y*f/2/G,I=b[u+1].y-v*f/2/G;y=b[u+1].x-y*f/2/G;v=b[u+1].y+v*f/2/G;0!=D&&p?-1==D?(D=y+C*f,G=v-A*f,a.lineTo(y+E*f,v-x*f),a.quadTo(J,I,D,G),function(K,L){B.push(function(){a.lineTo(K,L)})}(y,v)):(a.lineTo(J,I),function(K,L){var O=J-
E*f,P=I+x*f,Q=J-C*f,R=I+A*f;B.push(function(){a.quadTo(K,L,O,P)});B.push(function(){a.lineTo(Q,R)})}(y,v)):(a.lineTo(J,I),function(K,L){B.push(function(){a.lineTo(K,L)})}(y,v));x=A;E=C}}u=f*C;D=-f*A;if(l&&!g)this.paintMarker(a,r.x,r.y,-x,-E,c,e,f,m,!1);else{a.lineTo(r.x-m*A+u/2,r.y-m*C+D/2);var M=r.x-m*A-u/2,N=r.y-m*C-D/2;g?(a.moveTo(M,N),B.splice(0,0,function(){a.moveTo(M,N)})):a.lineTo(M,N)}for(u=B.length-1;0<=u;u--)B[u]();g?(a.end(),a.stroke()):(a.close(),a.fillAndStroke());a.setShadow(!1);a.setMiterLimit(4);
p&&a.setLineJoin("flat");2<b.length&&(a.setMiterLimit(4),k&&!g&&(a.begin(),this.paintMarker(a,b[0].x,b[0].y,q,t,n,d,f,m,!0),a.stroke(),a.end()),l&&!g&&(a.begin(),this.paintMarker(a,r.x,r.y,-x,-E,c,e,f,m,!0),a.stroke(),a.end()))}};mxArrowConnector.prototype.paintMarker=function(a,b,c,d,e,f,g,k,l,m){g=k/g;var n=k*e/2;k=-k*d/2;var p=(l+f)*d;f=(l+f)*e;m?a.moveTo(b-n+p,c-k+f):a.lineTo(b-n+p,c-k+f);a.lineTo(b-n/g+p,c-k/g+f);a.lineTo(b+l*d,c+l*e);a.lineTo(b+n/g+p,c+k/g+f);a.lineTo(b+n+p,c+k+f)};
mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded};mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3};mxArrowConnector.prototype.isOpenEnded=function(){return!1};
mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE};mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE};
function mxText(a,b,c,d,e,f,g,k,l,m,n,p,r,q,t,u,x,A,E,C,D){mxShape.call(this);this.value=a;this.bounds=b;this.color=null!=e?e:"black";this.align=null!=c?c:mxConstants.ALIGN_CENTER;this.valign=null!=d?d:mxConstants.ALIGN_MIDDLE;this.family=null!=f?f:mxConstants.DEFAULT_FONTFAMILY;this.size=null!=g?g:mxConstants.DEFAULT_FONTSIZE;this.fontStyle=null!=k?k:mxConstants.DEFAULT_FONTSTYLE;this.spacing=parseInt(l||2);this.spacingTop=this.spacing+parseInt(m||0);this.spacingRight=this.spacing+parseInt(n||0);
this.spacingBottom=this.spacing+parseInt(p||0);this.spacingLeft=this.spacing+parseInt(r||0);this.horizontal=null!=q?q:!0;this.background=t;this.border=u;this.wrap=null!=x?x:!1;this.clipped=null!=A?A:!1;this.overflow=null!=E?E:"visible";this.labelPadding=null!=C?C:0;this.textDirection=D;this.rotation=0;this.updateMargin()}mxUtils.extend(mxText,mxShape);mxText.prototype.baseSpacingTop=0;mxText.prototype.baseSpacingBottom=0;mxText.prototype.baseSpacingLeft=0;mxText.prototype.baseSpacingRight=0;
mxText.prototype.replaceLinefeeds=!0;mxText.prototype.verticalTextRotation=-90;mxText.prototype.ignoreClippedStringSize=!0;mxText.prototype.ignoreStringSize=!1;mxText.prototype.textWidthPadding=8!=document.documentMode||mxClient.IS_EM?3:4;mxText.prototype.lastValue=null;mxText.prototype.cacheEnabled=!0;mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode||mxClient.IS_EM};mxText.prototype.getSvgScreenOffset=function(){return 0};
mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)};mxText.prototype.configurePointerEvents=function(a){};
mxText.prototype.paint=function(a,b){var c=this.scale,d=this.bounds.x/c,e=this.bounds.y/c,f=this.bounds.width/c;c=this.bounds.height/c;this.updateTransform(a,d,e,f,c);this.configureCanvas(a,d,e,f,c);if(b)a.updateText(d,e,f,c,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var g=(b=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML)?"html":"",k=this.value;b||"html"!=g||(k=mxUtils.htmlEntities(k,!1));"html"!=g||mxUtils.isNode(this.value)||
(k=mxUtils.replaceTrailingNewlines(k,"<div><br></div>"));k=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==g?k.replace(/\n/g,"<br/>"):k;var l=this.textDirection;l!=mxConstants.TEXT_DIRECTION_AUTO||b||(l=this.getAutoDirection());l!=mxConstants.TEXT_DIRECTION_LTR&&l!=mxConstants.TEXT_DIRECTION_RTL&&(l=null);a.text(d,e,f,c,k,this.align,this.valign,this.wrap,g,this.overflow,this.clipped,this.getTextRotation(),l)}};
mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML))if("DIV"==this.node.nodeName)mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),mxClient.IS_IE&&(null==document.documentMode||8>=document.documentMode)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else{var a=
this.createCanvas();null!=a&&null!=a.updateText?(a.pointerEvents=this.pointerEvents,this.paint(a,!0),this.destroyCanvas(a),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null};
mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.color="black";this.align=mxConstants.ALIGN_CENTER;this.valign=mxConstants.ALIGN_MIDDLE;this.family=mxConstants.DEFAULT_FONTFAMILY;this.size=mxConstants.DEFAULT_FONTSIZE;this.fontStyle=mxConstants.DEFAULT_FONTSTYLE;this.spacingLeft=this.spacingBottom=this.spacingRight=this.spacingTop=this.spacing=2;this.horizontal=!0;delete this.background;delete this.border;this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION;
delete this.margin};
mxText.prototype.apply=function(a){var b=this.spacing;mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,
this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-b))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-b))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,
this.spacingBottom-b))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-b))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,
mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin());this.flipH=this.flipV=null};mxText.prototype.getAutoDirection=function(){var a=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=a&&0<a.length&&"z"<a[0]?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR};
mxText.prototype.getContentNode=function(){var a=this.node;null!=a&&(a=null==a.ownerSVGElement?this.node.firstChild.firstChild:a.firstChild.firstChild.firstChild.firstChild.firstChild);return a};
mxText.prototype.updateBoundingBox=function(){var a=this.node;this.boundingBox=this.bounds.clone();var b=this.getTextRotation(),c=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,d=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!(this.ignoreStringSize||null==a||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize&&c==mxConstants.ALIGN_CENTER&&d==mxConstants.ALIGN_MIDDLE)){d=
c=null;if(null!=a.ownerSVGElement)if(null!=a.firstChild&&null!=a.firstChild.firstChild&&"foreignObject"==a.firstChild.firstChild.nodeName)a=a.firstChild.firstChild.firstChild.firstChild,d=a.offsetHeight*this.scale,c="width"==this.overflow?this.boundingBox.width:a.offsetWidth*this.scale;else try{var e=a.getBBox();"string"==typeof this.value&&0==mxUtils.trim(this.value)?this.boundingBox=null:this.boundingBox=0==e.width&&0==e.height?null:new mxRectangle(e.x,e.y,e.width,e.height);return}catch(f){}else{c=
null!=this.state?this.state.view.textDiv:null;if(null==this.offsetWidth||null==this.offsetHeight)null!=c&&(this.updateFont(c),this.updateSize(c,!1),this.updateInnerHtml(c),a=c),e=a,8!=document.documentMode||mxClient.IS_EM?null!=e.firstChild&&"DIV"==e.firstChild.nodeName&&(e=e.firstChild):(d=Math.round(this.bounds.width/this.scale),this.wrap&&0<d?(a.style.wordWrap=mxConstants.WORD_WRAP,a.style.whiteSpace="normal","break-word"!=a.style.wordWrap&&(a=e.getElementsByTagName("div"),0<a.length&&(e=a[a.length-
1]),c=e.offsetWidth+2,a=this.node.getElementsByTagName("div"),this.clipped&&(c=Math.min(d,c)),1<a.length&&(a[a.length-2].style.width=c+"px"))):a.style.whiteSpace="nowrap"),this.offsetWidth=e.offsetWidth+this.textWidthPadding,this.offsetHeight=e.offsetHeight;c=this.offsetWidth*this.scale;d=this.offsetHeight*this.scale}null!=c&&null!=d&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,c,d))}null!=this.boundingBox&&(0!=b?(b=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,
this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),b,new mxPoint(0,0)),this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=b.x,this.boundingBox.y+=b.y,this.boundingBox.width=b.width,this.boundingBox.height=b.height):(this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=
this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null))};mxText.prototype.getShapeRotation=function(){return 0};mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0};mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)};
mxText.prototype.configureCanvas=function(a,b,c,d,e){mxShape.prototype.configureCanvas.apply(this,arguments);a.setFontColor(this.color);a.setFontBackgroundColor(this.background);a.setFontBorderColor(this.border);a.setFontFamily(this.family);a.setFontSize(this.size);a.setFontStyle(this.fontStyle)};
mxText.prototype.getHtmlValue=function(){var a=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=mxUtils.htmlEntities(a,!1));a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");return this.replaceLinefeeds?a.replace(/\n/g,"<br/>"):a};
mxText.prototype.getTextCss=function(){var a="display: inline-block; font-size: "+this.size+"px; font-family: "+this.family+"; color: "+this.color+"; line-height: "+(mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight: bold; ");(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="font-style: italic; ");
var b=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline");(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through");0<b.length&&(a+="text-decoration: "+b.join(" ")+"; ");return a};
mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var a=this.node.style;a.whiteSpace="normal";a.overflow="";a.width="";a.height="";this.updateValue();this.updateFont(this.node);this.updateSize(this.node,null==this.state||null==this.state.view.textDiv);this.offsetHeight=this.offsetWidth=null;mxClient.IS_IE&&(null==document.documentMode||8>=document.documentMode)?this.updateHtmlFilter():this.updateHtmlTransform()}};
mxText.prototype.redrawHtmlShapeWithCss3=function(){var a=Math.max(0,Math.round(this.bounds.width/this.scale)),b=Math.max(0,Math.round(this.bounds.height/this.scale)),c="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",d=this.getTextCss();mxSvgCanvas2D.createCss(a+2,b,this.align,this.valign,this.wrap,this.overflow,this.clipped,null!=this.background?mxUtils.htmlEntities(this.background):null,null!=this.border?mxUtils.htmlEntities(this.border):
null,c,d,this.scale,mxUtils.bind(this,function(e,f,g,k,l,m){e=this.getTextRotation();e=(1!=this.scale?"scale("+this.scale+") ":"")+(0!=e?"rotate("+e+"deg) ":"")+(0!=this.margin.x||0!=this.margin.y?"translate("+100*this.margin.x+"%,"+100*this.margin.y+"%)":"");""!=e&&(e="transform-origin: 0 0; transform: "+e+"; ");"block"==this.overflow&&this.valign==mxConstants.ALIGN_MIDDLE&&(e+="max-height: "+(b+1)+"px;");""==m?(g+=k,k="display:inline-block; min-width: 100%; "+e):(k+=e,mxClient.IS_SF&&(k+="-webkit-clip-path: content-box;"));
"block"==this.overflow&&(k+="width: 100%; ");100>this.opacity&&(l+="opacity: "+this.opacity/100+"; ");this.node.setAttribute("style",g);g=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();null==this.node.firstChild&&(this.node.innerHTML="<div><div>"+g+"</div></div>",mxClient.IS_IE11&&this.fixFlexboxForIe11(this.node));this.node.firstChild.firstChild.setAttribute("style",l);this.node.firstChild.setAttribute("style",k)}))};
mxText.prototype.fixFlexboxForIe11=function(a){for(var b=a.querySelectorAll('div[style*="display: flex; justify-content: flex-end;"]'),c=0;c<b.length;c++)b[c].style.justifyContent="flex-start",b[c].style.flexDirection="row-reverse";if(!this.wrap)for(b=a.querySelectorAll('div[style*="display: flex; justify-content: center;"]'),a=-window.innerWidth,c=0;c<b.length;c++)b[c].style.marginLeft=a+"px",b[c].style.marginRight=a+"px"};
mxText.prototype.updateHtmlTransform=function(){var a=this.getTextRotation(),b=this.node.style,c=this.margin.x,d=this.margin.y;0!=a?(mxUtils.setPrefixedStyle(b,"transformOrigin",100*-c+"% "+100*-d+"%"),mxUtils.setPrefixedStyle(b,"transform","translate("+100*c+"%,"+100*d+"%) scale("+this.scale+") rotate("+a+"deg)")):(mxUtils.setPrefixedStyle(b,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(b,"transform","scale("+this.scale+") translate("+100*c+"%,"+100*d+"%)"));b.left=Math.round(this.bounds.x-
Math.ceil(c*("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px";b.top=Math.round(this.bounds.y-d*("fill"!=this.overflow?3:1))+"px";b.opacity=100>this.opacity?this.opacity/100:""};
mxText.prototype.updateInnerHtml=function(a){if(mxUtils.isNode(this.value))a.innerHTML=this.value.outerHTML;else{var b=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(b=mxUtils.htmlEntities(b,!1));b=mxUtils.replaceTrailingNewlines(b,"<div>&nbsp;</div>");b=this.replaceLinefeeds?b.replace(/\n/g,"<br/>"):b;a.innerHTML='<div style="display:inline-block;_display:inline;">'+b+"</div>"}};
mxText.prototype.updateHtmlFilter=function(){var a=this.node.style,b=this.margin.x,c=this.margin.y,d=this.scale;mxUtils.setOpacity(this.node,this.opacity);var e=0,f=null!=this.state?this.state.view.textDiv:null,g=this.node;if(null!=f){f.style.overflow="";f.style.height="";f.style.width="";this.updateFont(f);this.updateSize(f,!1);this.updateInnerHtml(f);var k=Math.round(this.bounds.width/this.scale);if(this.wrap&&0<k){f.style.whiteSpace="normal";f.style.wordWrap=mxConstants.WORD_WRAP;var l=k;this.clipped&&
(l=Math.min(l,this.bounds.width));f.style.width=l+"px"}else f.style.whiteSpace="nowrap";g=f;null!=g.firstChild&&"DIV"==g.firstChild.nodeName&&(g=g.firstChild,this.wrap&&"break-word"==f.style.wordWrap&&(g.style.width="100%"));!this.clipped&&this.wrap&&0<k&&(l=g.offsetWidth+this.textWidthPadding,f.style.width=l+"px");e=g.offsetHeight+2}else null!=g.firstChild&&"DIV"==g.firstChild.nodeName&&(g=g.firstChild,e=g.offsetHeight);l=g.offsetWidth+this.textWidthPadding;this.clipped&&(e=Math.min(e,this.bounds.height));
k=this.bounds.width/d;f=this.bounds.height/d;"fill"==this.overflow?(e=f,l=k):"width"==this.overflow&&(e=g.scrollHeight,l=k);this.offsetWidth=l;this.offsetHeight=e;"fill"!=this.overflow&&"width"!=this.overflow&&(this.clipped&&(l=Math.min(k,l)),k=l,this.wrap&&(a.width=Math.round(k)+"px"));f=e*d;k*=d;var m=this.getTextRotation()*(Math.PI/180);l=parseFloat(parseFloat(Math.cos(m)).toFixed(8));e=parseFloat(parseFloat(Math.sin(-m)).toFixed(8));m%=2*Math.PI;0>m&&(m+=2*Math.PI);m%=Math.PI;m>Math.PI/2&&(m=
Math.PI-m);g=Math.cos(m);var n=Math.sin(-m);b=k*-(b+.5);c=f*-(c+.5);0!=m&&(m="progid:DXImageTransform.Microsoft.Matrix(M11="+l+", M12="+e+", M21="+-e+", M22="+l+", sizingMethod='auto expand')",a.filter=null!=a.filter&&0<a.filter.length?a.filter+(" "+m):m);a.zoom=d;a.left=Math.round(this.bounds.x+((k-k*g+f*n)/2-l*b-e*c)-k/2)+"px";a.top=Math.round(this.bounds.y+((f-f*g+k*n)/2+e*b-l*c)-f/2)+"px"};
mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerText="",this.node.appendChild(this.value);else{var a=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=mxUtils.htmlEntities(a,!1));a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");a=this.replaceLinefeeds?a.replace(/\n/g,"<br/>"):a;var b=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,c=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if("fill"==this.overflow||
"width"==this.overflow)null!=b&&(this.node.style.backgroundColor=b),null!=c&&(this.node.style.border="1px solid "+c);else{var d="";null!=b&&(d+="background-color:"+mxUtils.htmlEntities(b)+";");null!=c&&(d+="border:1px solid "+mxUtils.htmlEntities(c)+";");a='<div style="zoom:1;'+d+"display:inline-block;_display:inline;text-decoration:inherit;padding-bottom:1px;padding-right:1px;line-height:"+(mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)+'">'+a+"</div>"}this.node.innerHTML=
a;a=this.node.getElementsByTagName("div");0<a.length&&(b=this.textDirection,b==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(b=this.getAutoDirection()),b==mxConstants.TEXT_DIRECTION_LTR||b==mxConstants.TEXT_DIRECTION_RTL?a[a.length-1].setAttribute("dir",b):a[a.length-1].removeAttribute("dir"))}};
mxText.prototype.updateFont=function(a){a=a.style;a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;a.fontSize=this.size+"px";a.fontFamily=this.family;a.verticalAlign="top";a.color=this.color;a.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"";a.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"";var b=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&
b.push("underline");(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through");a.textDecoration=b.join(" ");a.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"};
mxText.prototype.updateSize=function(a,b){var c=Math.max(0,Math.round(this.bounds.width/this.scale)),d=Math.max(0,Math.round(this.bounds.height/this.scale)),e=a.style;this.clipped?(e.overflow="hidden",e.maxHeight=d+"px",e.maxWidth=c+"px"):"fill"==this.overflow?(e.width=c+1+"px",e.height=d+1+"px",e.overflow="hidden"):"width"==this.overflow?(e.width=c+1+"px",e.maxHeight=d+1+"px",e.overflow="hidden"):"block"==this.overflow&&(e.width=c+1+"px");if(this.wrap&&0<c){if(e.wordWrap=mxConstants.WORD_WRAP,e.whiteSpace=
"normal",e.width=c+"px",b&&"fill"!=this.overflow&&"width"!=this.overflow){b=a;null!=b.firstChild&&"DIV"==b.firstChild.nodeName&&(b=b.firstChild,"break-word"==a.style.wordWrap&&(b.style.width="100%"));d=b.offsetWidth;if(0==d){var f=a.parentNode;a.style.visibility="hidden";document.body.appendChild(a);d=b.offsetWidth;a.style.visibility="";f.appendChild(a)}d+=3;this.clipped&&(d=Math.min(d,c));e.width=d+"px"}}else e.whiteSpace="nowrap"};
mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)};
mxText.prototype.getSpacing=function(a){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-(a?0:this.baseSpacingRight):this.spacingLeft+(a?0:this.baseSpacingLeft),this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-(a?0:this.baseSpacingBottom):this.spacingTop+(a?0:this.baseSpacingTop))};
function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor);mxTriangle.prototype.isRoundable=function(){return!0};mxTriangle.prototype.redrawPath=function(a,b,c,d,e){b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,.5*e),new mxPoint(0,e)],this.isRounded,b,!0)};function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor);
mxHexagon.prototype.redrawPath=function(a,b,c,d,e){b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(.25*d,0),new mxPoint(.75*d,0),new mxPoint(d,.5*e),new mxPoint(.75*d,e),new mxPoint(.25*d,e),new mxPoint(0,.5*e)],this.isRounded,b,!0)};function mxLine(a,b,c,d){mxShape.call(this);this.bounds=a;this.stroke=b;this.strokewidth=null!=c?c:1;this.vertical=null!=d?d:this.vertical}mxUtils.extend(mxLine,mxShape);mxLine.prototype.vertical=!1;
mxLine.prototype.paintVertexShape=function(a,b,c,d,e){a.begin();if(this.vertical){var f=b+d/2;a.moveTo(f,c);a.lineTo(f,c+e)}else f=c+e/2,a.moveTo(b,f),a.lineTo(b+d,f);a.stroke()};function mxImageShape(a,b,c,d,e){mxShape.call(this);this.bounds=a;this.image=b;this.fill=c;this.stroke=d;this.strokewidth=null!=e?e:1;this.shadow=!1}mxUtils.extend(mxImageShape,mxRectangleShape);mxImageShape.prototype.preserveImageAspect=!0;mxImageShape.prototype.getSvgScreenOffset=function(){return 0};
mxImageShape.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);this.gradient=this.stroke=this.fill=null;null!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.imageBackground=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),this.imageBorder=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||
1==mxUtils.getValue(this.style,"imageFlipV",0),this.clipPath=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null))};mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect};mxImageShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxImageShape.prototype.isRoundable=function(){return!1};mxImageShape.prototype.getImageDataUri=function(){return this.image};mxImageShape.prototype.configurePointerEvents=function(a){};
mxImageShape.prototype.paintVertexShape=function(a,b,c,d,e){null!=this.image?(null!=this.imageBackground&&(a.setFillColor(this.imageBackground),a.setStrokeColor(this.imageBorder),a.rect(b,c,d,e),a.fillAndStroke()),a.image(b,c,d,e,this.getImageDataUri(),this.preserveImageAspect,!1,!1,this.clipPath),null!=this.imageBorder&&(a.setShadow(!1),a.setStrokeColor(this.imageBorder),a.rect(b,c,d,e),a.stroke())):mxRectangleShape.prototype.paintBackground.apply(this,arguments)};
mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px";this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px";this.node.innerText="";if(null!=this.image){var a=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),b=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=
a;this.node.style.borderColor=b;a=document.createElement("img");a.setAttribute("border","0");a.style.position="absolute";a.src=this.image;b=100>this.opacity?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=b;this.flipH&&this.flipV?b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?b+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)");a.style.filter!=b&&(a.style.filter=b);"image"==
a.nodeName?a.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(a.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(a.style,"transform","");a.style.width=this.node.style.width;a.style.height=this.node.style.height;this.node.style.backgroundImage="";this.node.appendChild(a)}else this.setTransparentBackgroundImage(this.node)};function mxLabel(a,b,c,d){mxRectangleShape.call(this,a,b,c,d)}mxUtils.extend(mxLabel,mxRectangleShape);
mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE;mxLabel.prototype.spacing=2;mxLabel.prototype.indicatorSize=10;mxLabel.prototype.indicatorSpacing=2;mxLabel.prototype.init=function(a){mxShape.prototype.init.apply(this,arguments);null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))};
mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw());mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape};
mxLabel.prototype.paintForeground=function(a,b,c,d,e){this.paintImage(a,b,c,d,e);this.paintIndicator(a,b,c,d,e);mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxLabel.prototype.paintImage=function(a,b,c,d,e){null!=this.image&&(b=this.getImageBounds(b,c,d,e),c=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null),a.image(b.x,b.y,b.width,b.height,this.image,!1,!1,!1,c))};
mxLabel.prototype.getImageBounds=function(a,b,c,d){var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),k=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;a=e==mxConstants.ALIGN_CENTER?
a+(c-g)/2:e==mxConstants.ALIGN_RIGHT?a+(c-g-l):a+l;b=f==mxConstants.ALIGN_TOP?b+l:f==mxConstants.ALIGN_BOTTOM?b+(d-k-l):b+(d-k)/2;return new mxRectangle(a,b,g,k)};mxLabel.prototype.paintIndicator=function(a,b,c,d,e){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(b,c,d,e),this.indicator.paint(a)):null!=this.indicatorImage&&(b=this.getIndicatorBounds(b,c,d,e),a.image(b.x,b.y,b.width,b.height,this.indicatorImage,!1,!1,!1))};
mxLabel.prototype.getIndicatorBounds=function(a,b,c,d){var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),k=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;a=e==mxConstants.ALIGN_RIGHT?a+(c-g-l):e==mxConstants.ALIGN_CENTER?a+(c-g)/
2:a+l;b=f==mxConstants.ALIGN_BOTTOM?b+(d-k-l):f==mxConstants.ALIGN_TOP?b+l:b+(d-k)/2;return new mxRectangle(a,b,g,k)};
mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var a=document.createElement("img");a.style.position="relative";a.setAttribute("border","0");var b=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);b.x-=this.bounds.x;b.y-=this.bounds.y;a.style.left=Math.round(b.x)+"px";a.style.top=Math.round(b.y)+"px";a.style.width=
Math.round(b.width)+"px";a.style.height=Math.round(b.height)+"px";a.src=this.image;this.node.appendChild(a)}};function mxCylinder(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxCylinder,mxShape);mxCylinder.prototype.maxHeight=40;
mxCylinder.prototype.paintVertexShape=function(a,b,c,d,e){a.translate(b,c);a.begin();this.redrawPath(a,b,c,d,e,!1);a.fillAndStroke();this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(a.setShadow(!1),a.begin(),this.redrawPath(a,b,c,d,e,!0),a.stroke())};mxCylinder.prototype.getCylinderSize=function(a,b,c,d){return Math.min(this.maxHeight,Math.round(d/5))};
mxCylinder.prototype.redrawPath=function(a,b,c,d,e,f){b=this.getCylinderSize(b,c,d,e);if(f&&null!=this.fill||!f&&null==this.fill)a.moveTo(0,b),a.curveTo(0,2*b,d,2*b,d,b),f||(a.stroke(),a.begin());f||(a.moveTo(0,b),a.curveTo(0,-b/3,d,-b/3,d,b),a.lineTo(d,e-b),a.curveTo(d,e+b/3,0,e+b/3,0,e-b),a.close())};function mxConnector(a,b,c){mxPolyline.call(this,a,b,c)}mxUtils.extend(mxConnector,mxPolyline);
mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED];mxShape.prototype.updateBoundingBox.apply(this,arguments)};mxConnector.prototype.paintEdgeShape=function(a,b){var c=this.createMarker(a,b,!0),d=this.createMarker(a,b,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);a.setFillColor(this.stroke);a.setShadow(!1);a.setDashed(!1);null!=c&&c();null!=d&&d()};
mxConnector.prototype.createMarker=function(a,b,c){var d=null,e=b.length,f=mxUtils.getValue(this.style,c?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),g=c?b[1]:b[e-2];b=c?b[0]:b[e-1];if(null!=f&&null!=g&&null!=b){d=b.x-g.x;e=b.y-g.y;var k=Math.sqrt(d*d+e*e);g=d/k;d=e/k;e=mxUtils.getNumber(this.style,c?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);d=mxMarker.createMarker(a,this,f,b,g,d,e,c,this.strokewidth,0!=this.style[c?mxConstants.STYLE_STARTFILL:
mxConstants.STYLE_ENDFILL])}return d};
mxConnector.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1);mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b=Math.max(b,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+
1);a.grow(b*this.scale)};function mxSwimlane(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxSwimlane,mxShape);mxSwimlane.prototype.imageSize=16;mxSwimlane.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.laneFill=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE))};mxSwimlane.prototype.isRoundable=function(){return!0};
mxSwimlane.prototype.getTitleSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE))};
mxSwimlane.prototype.getLabelBounds=function(a){var b=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),c=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);a=new mxRectangle(a.x,a.y,a.width,a.height);var d=this.isHorizontal(),e=this.getTitleSize(),f=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH;d=d==!f;b=!d&&b!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);c=d&&c!=(this.direction==mxConstants.DIRECTION_SOUTH||
this.direction==mxConstants.DIRECTION_WEST);if(f){e=Math.min(a.width,e*this.scale);if(b||c)a.x+=a.width-e;a.width=e}else{e=Math.min(a.height,e*this.scale);if(b||c)a.y+=a.height-e;a.height=e}return a};mxSwimlane.prototype.getGradientBounds=function(a,b,c,d,e){a=this.getTitleSize();return this.isHorizontal()?new mxRectangle(b,c,d,Math.min(a,e)):new mxRectangle(b,c,Math.min(a,d),e)};
mxSwimlane.prototype.getSwimlaneArcSize=function(a,b,c){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))return Math.min(a/2,Math.min(b/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return c*a*3};mxSwimlane.prototype.isHorizontal=function(){return 1==mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)};
mxSwimlane.prototype.paintVertexShape=function(a,b,c,d,e){if(!this.outline){var f=this.getTitleSize(),g=0;f=this.isHorizontal()?Math.min(f,e):Math.min(f,d);a.translate(b,c);this.isRounded?(g=this.getSwimlaneArcSize(d,e,f),g=Math.min((this.isHorizontal()?e:d)-f,Math.min(f,g)),this.paintRoundedSwimlane(a,b,c,d,e,f,g)):this.paintSwimlane(a,b,c,d,e,f);var k=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);this.paintSeparator(a,b,c,d,e,f,k);null!=this.image&&(e=this.getImageBounds(b,
c,d,e),k=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null),a.image(e.x-b,e.y-c,e.width,e.height,this.image,!1,!1,!1,k));this.glass&&(a.setShadow(!1),this.paintGlassEffect(a,0,0,d,f,g))}};
mxSwimlane.prototype.configurePointerEvents=function(a){var b=!0,c=!0,d=!0;null!=this.style&&(b="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),c=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),d=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));(b||c||d)&&mxShape.prototype.configurePointerEvents.apply(this,arguments)};
mxSwimlane.prototype.paintSwimlane=function(a,b,c,d,e,f){var g=this.laneFill,k=!0,l=!0,m=!0,n=!0;null!=this.style&&(k="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),l=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),m=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),n=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));this.isHorizontal()?(a.begin(),a.moveTo(0,f),a.lineTo(0,0),a.lineTo(d,0),a.lineTo(d,f),m?a.fillAndStroke():
a.fill(),f<e&&(g!=mxConstants.NONE&&k||(a.pointerEvents=!1),g!=mxConstants.NONE&&a.setFillColor(g),a.begin(),a.moveTo(0,f),a.lineTo(0,e),a.lineTo(d,e),a.lineTo(d,f),n?g==mxConstants.NONE?a.stroke():n&&a.fillAndStroke():g!=mxConstants.NONE&&a.fill())):(a.begin(),a.moveTo(f,0),a.lineTo(0,0),a.lineTo(0,e),a.lineTo(f,e),m?a.fillAndStroke():a.fill(),f<d&&(g!=mxConstants.NONE&&k||(a.pointerEvents=!1),g!=mxConstants.NONE&&a.setFillColor(g),a.begin(),a.moveTo(f,0),a.lineTo(d,0),a.lineTo(d,e),a.lineTo(f,e),
n?g==mxConstants.NONE?a.stroke():n&&a.fillAndStroke():g!=mxConstants.NONE&&a.fill()));l&&this.paintDivider(a,b,c,d,e,f,g==mxConstants.NONE)};
mxSwimlane.prototype.paintRoundedSwimlane=function(a,b,c,d,e,f,g){var k=this.laneFill,l=!0,m=!0,n=!0,p=!0;null!=this.style&&(l="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),m=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),n=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),p=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));this.isHorizontal()?(a.begin(),a.moveTo(d,f),a.lineTo(d,g),a.quadTo(d,0,d-Math.min(d/2,g),0),a.lineTo(Math.min(d/
2,g),0),a.quadTo(0,0,0,g),a.lineTo(0,f),n?a.fillAndStroke():a.fill(),f<e&&(k!=mxConstants.NONE&&l||(a.pointerEvents=!1),k!=mxConstants.NONE&&a.setFillColor(k),a.begin(),a.moveTo(0,f),a.lineTo(0,e-g),a.quadTo(0,e,Math.min(d/2,g),e),a.lineTo(d-Math.min(d/2,g),e),a.quadTo(d,e,d,e-g),a.lineTo(d,f),p?k==mxConstants.NONE?a.stroke():p&&a.fillAndStroke():k!=mxConstants.NONE&&a.fill())):(a.begin(),a.moveTo(f,0),a.lineTo(g,0),a.quadTo(0,0,0,Math.min(e/2,g)),a.lineTo(0,e-Math.min(e/2,g)),a.quadTo(0,e,g,e),a.lineTo(f,
e),n?a.fillAndStroke():a.fill(),f<d&&(k!=mxConstants.NONE&&l||(a.pointerEvents=!1),k!=mxConstants.NONE&&a.setFillColor(k),a.begin(),a.moveTo(f,e),a.lineTo(d-g,e),a.quadTo(d,e,d,e-Math.min(e/2,g)),a.lineTo(d,Math.min(e/2,g)),a.quadTo(d,0,d-g,0),a.lineTo(f,0),p?k==mxConstants.NONE?a.stroke():p&&a.fillAndStroke():k!=mxConstants.NONE&&a.fill()));m&&this.paintDivider(a,b,c,d,e,f,k==mxConstants.NONE)};
mxSwimlane.prototype.paintDivider=function(a,b,c,d,e,f,g){0!=f&&(g||a.setShadow(!1),a.begin(),this.isHorizontal()?(a.moveTo(0,f),a.lineTo(d,f)):(a.moveTo(f,0),a.lineTo(f,e)),a.stroke())};mxSwimlane.prototype.paintSeparator=function(a,b,c,d,e,f,g){g!=mxConstants.NONE&&(a.setStrokeColor(g),a.setDashed(!0),a.begin(),this.isHorizontal()?(a.moveTo(d,f),a.lineTo(d,e)):(a.moveTo(f,0),a.lineTo(d,0)),a.stroke(),a.setDashed(!1))};
mxSwimlane.prototype.getImageBounds=function(a,b,c,d){return this.isHorizontal()?new mxRectangle(a+c-this.imageSize,b,this.imageSize,this.imageSize):new mxRectangle(a,b,this.imageSize,this.imageSize)};function mxGraphLayout(a){this.graph=a}mxGraphLayout.prototype.graph=null;mxGraphLayout.prototype.useBoundingBox=!0;mxGraphLayout.prototype.parent=null;mxGraphLayout.prototype.moveCell=function(a,b,c){};mxGraphLayout.prototype.resizeCell=function(a,b){};mxGraphLayout.prototype.execute=function(a){};
mxGraphLayout.prototype.getGraph=function(){return this.graph};mxGraphLayout.prototype.getConstraint=function(a,b,c,d){return this.graph.getCurrentCellStyle(b)[a]};
mxGraphLayout.traverse=function(a,b,c,d,e){if(null!=c&&null!=a&&(b=null!=b?b:!0,e=e||new mxDictionary,!e.get(a)&&(e.put(a,!0),d=c(a,d),null==d||d))&&(d=this.graph.model.getEdgeCount(a),0<d))for(var f=0;f<d;f++){var g=this.graph.model.getEdgeAt(a,f),k=this.graph.model.getTerminal(g,!0)==a;if(!b||k)k=this.graph.view.getVisibleTerminal(g,!k),this.traverse(k,b,c,g,e)}};
mxGraphLayout.prototype.isAncestor=function(a,b,c){if(!c)return this.graph.model.getParent(b)==a;if(b==a)return!1;for(;null!=b&&b!=a;)b=this.graph.model.getParent(b);return b==a};mxGraphLayout.prototype.isVertexMovable=function(a){return this.graph.isCellMovable(a)};mxGraphLayout.prototype.isVertexIgnored=function(a){return!this.graph.getModel().isVertex(a)||!this.graph.getModel().isVisible(a)};
mxGraphLayout.prototype.isEdgeIgnored=function(a){var b=this.graph.getModel();return!b.isEdge(a)||!this.graph.getModel().isVisible(a)||null==b.getTerminal(a,!0)||null==b.getTerminal(a,!1)};mxGraphLayout.prototype.setEdgeStyleEnabled=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,b?"0":"1",[a])};mxGraphLayout.prototype.setOrthogonalEdge=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,b?"1":"0",[a])};
mxGraphLayout.prototype.getParentOffset=function(a){var b=new mxPoint;if(null!=a&&a!=this.parent){var c=this.graph.getModel();if(c.isAncestor(this.parent,a))for(var d=c.getGeometry(a);a!=this.parent;)b.x+=d.x,b.y+=d.y,a=c.getParent(a),d=c.getGeometry(a)}return b};
mxGraphLayout.prototype.setEdgePoints=function(a,b){if(null!=a){var c=this.graph.model,d=c.getGeometry(a);null==d?(d=new mxGeometry,d.setRelative(!0)):d=d.clone();if(null!=this.parent&&null!=b){var e=c.getParent(a);e=this.getParentOffset(e);for(var f=0;f<b.length;f++)b[f].x-=e.x,b[f].y-=e.y}d.points=b;c.setGeometry(a,d)}};
mxGraphLayout.prototype.setVertexLocation=function(a,b,c){var d=this.graph.getModel(),e=d.getGeometry(a),f=null;if(null!=e){f=new mxRectangle(b,c,e.width,e.height);if(this.useBoundingBox){var g=this.graph.getView().getState(a);if(null!=g&&null!=g.text&&null!=g.text.boundingBox){var k=this.graph.getView().scale,l=g.text.boundingBox;g.text.boundingBox.x<g.x&&(b+=(g.x-l.x)/k,f.width=l.width);g.text.boundingBox.y<g.y&&(c+=(g.y-l.y)/k,f.height=l.height)}}null!=this.parent&&(g=d.getParent(a),null!=g&&g!=
this.parent&&(g=this.getParentOffset(g),b-=g.x,c-=g.y));if(e.x!=b||e.y!=c)e=e.clone(),e.x=b,e.y=c,d.setGeometry(a,e)}return f};
mxGraphLayout.prototype.getVertexBounds=function(a){var b=this.graph.getModel().getGeometry(a);if(this.useBoundingBox){var c=this.graph.getView().getState(a);if(null!=c&&null!=c.text&&null!=c.text.boundingBox){var d=this.graph.getView().scale,e=c.text.boundingBox,f=Math.max(c.x-e.x,0)/d,g=Math.max(c.y-e.y,0)/d;b=new mxRectangle(b.x-f,b.y-g,b.width+f+Math.max(e.x+e.width-(c.x+c.width),0)/d,b.height+g+Math.max(e.y+e.height-(c.y+c.height),0)/d)}}null!=this.parent&&(a=this.graph.getModel().getParent(a),
b=b.clone(),null!=a&&a!=this.parent&&(a=this.getParentOffset(a),b.x+=a.x,b.y+=a.y));return new mxRectangle(b.x,b.y,b.width,b.height)};mxGraphLayout.prototype.arrangeGroups=function(a,b,c,d,e,f){return this.graph.updateGroupBounds(a,b,!0,c,d,e,f)};function WeightedCellSorter(a,b){this.cell=a;this.weightedValue=b}WeightedCellSorter.prototype.weightedValue=0;WeightedCellSorter.prototype.nudge=!1;WeightedCellSorter.prototype.visited=!1;WeightedCellSorter.prototype.rankIndex=null;
WeightedCellSorter.prototype.cell=null;WeightedCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.weightedValue>a.weightedValue?-1:b.weightedValue<a.weightedValue?1:b.nudge?-1:1:0};function mxStackLayout(a,b,c,d,e,f){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.spacing=null!=c?c:0;this.x0=null!=d?d:0;this.y0=null!=e?e:0;this.border=null!=f?f:0}mxStackLayout.prototype=new mxGraphLayout;mxStackLayout.prototype.constructor=mxStackLayout;
mxStackLayout.prototype.horizontal=null;mxStackLayout.prototype.spacing=null;mxStackLayout.prototype.x0=null;mxStackLayout.prototype.y0=null;mxStackLayout.prototype.border=0;mxStackLayout.prototype.marginTop=0;mxStackLayout.prototype.marginLeft=0;mxStackLayout.prototype.marginRight=0;mxStackLayout.prototype.marginBottom=0;mxStackLayout.prototype.keepFirstLocation=!1;mxStackLayout.prototype.fill=!1;mxStackLayout.prototype.resizeParent=!1;mxStackLayout.prototype.resizeParentMax=!1;
mxStackLayout.prototype.resizeLast=!1;mxStackLayout.prototype.wrap=null;mxStackLayout.prototype.borderCollapse=!0;mxStackLayout.prototype.allowGaps=!1;mxStackLayout.prototype.gridSize=0;mxStackLayout.prototype.isHorizontal=function(){return this.horizontal};
mxStackLayout.prototype.moveCell=function(a,b,c){var d=this.graph.getModel(),e=d.getParent(a),f=this.isHorizontal();if(null!=a&&null!=e){var g=0,k=d.getChildCount(e);c=f?b:c;b=this.graph.getView().getState(e);null!=b&&(c-=f?b.x:b.y);c/=this.graph.view.scale;for(b=0;b<k;b++){var l=d.getChildAt(e,b);if(l!=a&&(l=d.getGeometry(l),null!=l)){l=f?l.x+l.width/2:l.y+l.height/2;if(g<=c&&l>c)break;g=l}}f=e.getIndex(a);f=Math.max(0,b-(b>f?1:0));d.add(e,a,f)}};
mxStackLayout.prototype.getParentSize=function(a){var b=this.graph.getModel(),c=b.getGeometry(a);null!=this.graph.container&&(null==c&&b.isLayer(a)||a==this.graph.getView().currentRoot)&&(c=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));return c};
mxStackLayout.prototype.getLayoutCells=function(a){for(var b=this.graph.getModel(),c=b.getChildCount(a),d=[],e=0;e<c;e++){var f=b.getChildAt(a,e);!this.isVertexIgnored(f)&&this.isVertexMovable(f)&&d.push(f)}this.allowGaps&&d.sort(mxUtils.bind(this,function(g,k){g=this.graph.getCellGeometry(g);k=this.graph.getCellGeometry(k);return this.horizontal?g.x==k.x?0:g.x>k.x>0?1:-1:g.y==k.y?0:g.y>k.y>0?1:-1}));return d};
mxStackLayout.prototype.snap=function(a){if(null!=this.gridSize&&0<this.gridSize&&(a=Math.max(a,this.gridSize),1<a/this.gridSize)){var b=a%this.gridSize;a+=b>this.gridSize/2?this.gridSize-b:-b}return a};
mxStackLayout.prototype.execute=function(a){if(null!=a){var b=this.getParentSize(a),c=this.isHorizontal(),d=this.graph.getModel(),e=null;null!=b&&(e=c?b.height-this.marginTop-this.marginBottom:b.width-this.marginLeft-this.marginRight);e-=2*this.border;var f=this.x0+this.border+this.marginLeft,g=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(a)){var k=this.graph.getCellStyle(a),l=mxUtils.getNumber(k,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);k=1==mxUtils.getValue(k,mxConstants.STYLE_HORIZONTAL,
!0);null!=b&&(l=k?Math.min(l,b.height):Math.min(l,b.width));c==k&&(e-=l);k?g+=l:f+=l}d.beginUpdate();try{l=0;k=null;for(var m=0,n=null,p=this.getLayoutCells(a),r=0;r<p.length;r++){var q=p[r],t=d.getGeometry(q);if(null!=t){t=t.clone();null!=this.wrap&&null!=k&&(c&&k.x+k.width+t.width+2*this.spacing>this.wrap||!c&&k.y+k.height+t.height+2*this.spacing>this.wrap)&&(k=null,c?g+=l+this.spacing:f+=l+this.spacing,l=0);l=Math.max(l,c?t.height:t.width);var u=0;if(!this.borderCollapse){var x=this.graph.getCellStyle(q);
u=mxUtils.getNumber(x,mxConstants.STYLE_STROKEWIDTH,1)}if(null!=k){var A=m+this.spacing+Math.floor(u/2);c?t.x=this.snap((this.allowGaps?Math.max(A,t.x):A)-this.marginLeft)+this.marginLeft:t.y=this.snap((this.allowGaps?Math.max(A,t.y):A)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(c?t.x=this.allowGaps&&t.x>f?Math.max(this.snap(t.x-this.marginLeft)+this.marginLeft,f):f:t.y=this.allowGaps&&t.y>g?Math.max(this.snap(t.y-this.marginTop)+this.marginTop,g):g);c?t.y=g:t.x=f;this.fill&&null!=
e&&(c?t.height=e:t.width=e);c?t.width=this.snap(t.width):t.height=this.snap(t.height);this.setChildGeometry(q,t);n=q;k=t;m=c?k.x+k.width+Math.floor(u/2):k.y+k.height+Math.floor(u/2)}}this.resizeParent&&null!=b&&null!=k&&!this.graph.isCellCollapsed(a)?this.updateParentGeometry(a,b,k):this.resizeLast&&null!=b&&null!=k&&null!=n&&(c?k.width=b.width-k.x-this.spacing-this.marginRight-this.marginLeft:k.height=b.height-k.y-this.spacing-this.marginBottom,this.setChildGeometry(n,k))}finally{d.endUpdate()}}};
mxStackLayout.prototype.setChildGeometry=function(a,b){var c=this.graph.getCellGeometry(a);null!=c&&b.x==c.x&&b.y==c.y&&b.width==c.width&&b.height==c.height||this.graph.getModel().setGeometry(a,b)};
mxStackLayout.prototype.updateParentGeometry=function(a,b,c){var d=this.isHorizontal(),e=this.graph.getModel(),f=b.clone();d?(c=c.x+c.width+this.marginRight+this.border,f.width=this.resizeParentMax?Math.max(f.width,c):c):(c=c.y+c.height+this.marginBottom+this.border,f.height=this.resizeParentMax?Math.max(f.height,c):c);b.x==f.x&&b.y==f.y&&b.width==f.width&&b.height==f.height||e.setGeometry(a,f)};
function mxPartitionLayout(a,b,c,d){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.spacing=c||0;this.border=d||0}mxPartitionLayout.prototype=new mxGraphLayout;mxPartitionLayout.prototype.constructor=mxPartitionLayout;mxPartitionLayout.prototype.horizontal=null;mxPartitionLayout.prototype.spacing=null;mxPartitionLayout.prototype.border=null;mxPartitionLayout.prototype.resizeVertices=!0;mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal};
mxPartitionLayout.prototype.moveCell=function(a,b,c){c=this.graph.getModel();var d=c.getParent(a);if(null!=a&&null!=d){var e,f=0,g=c.getChildCount(d);for(e=0;e<g;e++){var k=c.getChildAt(d,e);k=this.getVertexBounds(k);if(null!=k){k=k.x+k.width/2;if(f<b&&k>b)break;f=k}}b=d.getIndex(a);b=Math.max(0,e-(e>b?1:0));c.add(d,a,b)}};
mxPartitionLayout.prototype.execute=function(a){var b=this.isHorizontal(),c=this.graph.getModel(),d=c.getGeometry(a);null!=this.graph.container&&(null==d&&c.isLayer(a)||a==this.graph.getView().currentRoot)&&(d=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));if(null!=d){for(var e=[],f=c.getChildCount(a),g=0;g<f;g++){var k=c.getChildAt(a,g);!this.isVertexIgnored(k)&&this.isVertexMovable(k)&&e.push(k)}f=e.length;if(0<f){var l=this.border,m=this.border,n=b?
d.height:d.width;n-=2*this.border;a=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;n-=b?a.height:a.width;l+=a.width;m+=a.height;a=this.border+(f-1)*this.spacing;d=b?(d.width-l-a)/f:(d.height-m-a)/f;if(0<d){c.beginUpdate();try{for(g=0;g<f;g++){k=e[g];var p=c.getGeometry(k);null!=p&&(p=p.clone(),p.x=l,p.y=m,b?(this.resizeVertices&&(p.width=d,p.height=n),l+=d+this.spacing):(this.resizeVertices&&(p.height=d,p.width=n),m+=d+this.spacing),c.setGeometry(k,p))}}finally{c.endUpdate()}}}}};
function mxCompactTreeLayout(a,b,c){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.invert=null!=c?c:!1}mxCompactTreeLayout.prototype=new mxGraphLayout;mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout;mxCompactTreeLayout.prototype.horizontal=null;mxCompactTreeLayout.prototype.invert=null;mxCompactTreeLayout.prototype.resizeParent=!0;mxCompactTreeLayout.prototype.maintainParentLocation=!1;mxCompactTreeLayout.prototype.groupPadding=10;
mxCompactTreeLayout.prototype.groupPaddingTop=0;mxCompactTreeLayout.prototype.groupPaddingRight=0;mxCompactTreeLayout.prototype.groupPaddingBottom=0;mxCompactTreeLayout.prototype.groupPaddingLeft=0;mxCompactTreeLayout.prototype.parentsChanged=null;mxCompactTreeLayout.prototype.moveTree=!1;mxCompactTreeLayout.prototype.visited=null;mxCompactTreeLayout.prototype.levelDistance=10;mxCompactTreeLayout.prototype.nodeDistance=20;mxCompactTreeLayout.prototype.resetEdges=!0;
mxCompactTreeLayout.prototype.prefHozEdgeSep=5;mxCompactTreeLayout.prototype.prefVertEdgeOff=4;mxCompactTreeLayout.prototype.minEdgeJetty=8;mxCompactTreeLayout.prototype.channelBuffer=4;mxCompactTreeLayout.prototype.edgeRouting=!0;mxCompactTreeLayout.prototype.sortEdges=!1;mxCompactTreeLayout.prototype.alignRanks=!1;mxCompactTreeLayout.prototype.maxRankHeight=null;mxCompactTreeLayout.prototype.root=null;mxCompactTreeLayout.prototype.node=null;
mxCompactTreeLayout.prototype.isVertexIgnored=function(a){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(a).length};mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal};
mxCompactTreeLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.getModel();if(null==b)if(0<this.graph.getEdges(a,c.getParent(a),this.invert,!this.invert,!1).length)this.root=a;else{if(b=this.graph.findTreeRoots(a,!0,this.invert),0<b.length)for(var d=0;d<b.length;d++)if(!this.isVertexIgnored(b[d])&&0<this.graph.getEdges(b[d],null,this.invert,!this.invert,!1).length){this.root=b[d];break}}else this.root=b;if(null!=this.root){this.parentsChanged=this.resizeParent?{}:null;this.parentY=
this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var e=this.graph.getCellGeometry(a);null!=e&&(this.parentX=e.x,this.parentY=e.y)}c.beginUpdate();try{if(this.visited={},this.node=this.dfs(this.root,a),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node){this.layout(this.node);var f=this.graph.gridSize;b=f;if(!this.moveTree){var g=this.getVertexBounds(this.root);null!=g&&(f=g.x,b=g.y)}g=null;
g=this.isHorizontal()?this.horizontalLayout(this.node,f,b):this.verticalLayout(this.node,null,f,b);if(null!=g){var k=d=0;0>g.x&&(d=Math.abs(f-g.x));0>g.y&&(k=Math.abs(b-g.y));0==d&&0==k||this.moveNode(this.node,d,k);this.resizeParent&&this.adjustParents();this.edgeRouting&&this.localEdgeProcessing(this.node)}null!=this.parentX&&null!=this.parentY&&(e=this.graph.getCellGeometry(a),null!=e&&(e=e.clone(),e.x=this.parentX,e.y=this.parentY,c.setGeometry(a,e)))}}finally{c.endUpdate()}}};
mxCompactTreeLayout.prototype.moveNode=function(a,b,c){a.x+=b;a.y+=c;this.apply(a);for(a=a.child;null!=a;)this.moveNode(a,b,c),a=a.next};
mxCompactTreeLayout.prototype.sortOutgoingEdges=function(a,b){var c=new mxDictionary;b.sort(function(d,e){var f=d.getTerminal(d.getTerminal(!1)==a);d=c.get(f);null==d&&(d=mxCellPath.create(f).split(mxCellPath.PATH_SEPARATOR),c.put(f,d));e=e.getTerminal(e.getTerminal(!1)==a);f=c.get(e);null==f&&(f=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,f));return mxCellPath.compare(d,f)})};
mxCompactTreeLayout.prototype.findRankHeights=function(a,b){if(null==this.maxRankHeight[b]||this.maxRankHeight[b]<a.height)this.maxRankHeight[b]=a.height;for(a=a.child;null!=a;)this.findRankHeights(a,b+1),a=a.next};mxCompactTreeLayout.prototype.setCellHeights=function(a,b){null!=this.maxRankHeight[b]&&this.maxRankHeight[b]>a.height&&(a.height=this.maxRankHeight[b]);for(a=a.child;null!=a;)this.setCellHeights(a,b+1),a=a.next};
mxCompactTreeLayout.prototype.dfs=function(a,b){var c=mxCellPath.create(a),d=null;if(null!=a&&null==this.visited[c]&&!this.isVertexIgnored(a)){this.visited[c]=a;d=this.createNode(a);c=this.graph.getModel();var e=null,f=this.graph.getEdges(a,b,this.invert,!this.invert,!1,!0),g=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(a,f);for(a=0;a<f.length;a++){var k=f[a];if(!this.isEdgeIgnored(k)){this.resetEdges&&this.setEdgePoints(k,null);this.edgeRouting&&(this.setEdgeStyleEnabled(k,!1),this.setEdgePoints(k,
null));var l=g.getState(k);k=null!=l?l.getVisibleTerminal(this.invert):g.getVisibleTerminal(k,this.invert);l=this.dfs(k,b);null!=l&&null!=c.getGeometry(k)&&(null==e?d.child=l:e.next=l,e=l)}}}return d};mxCompactTreeLayout.prototype.layout=function(a){if(null!=a){for(var b=a.child;null!=b;)this.layout(b),b=b.next;null!=a.child?this.attachParent(a,this.join(a)):this.layoutLeaf(a)}};
mxCompactTreeLayout.prototype.horizontalLayout=function(a,b,c,d){a.x+=b+a.offsetX;a.y+=c+a.offsetY;d=this.apply(a,d);b=a.child;if(null!=b){d=this.horizontalLayout(b,a.x,a.y,d);c=a.y+b.offsetY;for(var e=b.next;null!=e;)d=this.horizontalLayout(e,a.x+b.offsetX,c,d),c+=e.offsetY,e=e.next}return d};
mxCompactTreeLayout.prototype.verticalLayout=function(a,b,c,d,e){a.x+=c+a.offsetY;a.y+=d+a.offsetX;e=this.apply(a,e);b=a.child;if(null!=b)for(e=this.verticalLayout(b,a,a.x,a.y,e),c=a.x+b.offsetY,d=b.next;null!=d;)e=this.verticalLayout(d,a,c,a.y+b.offsetX,e),c+=d.offsetY,d=d.next;return e};
mxCompactTreeLayout.prototype.attachParent=function(a,b){var c=this.nodeDistance+this.levelDistance,d=(b-a.width)/2-this.nodeDistance;b=d+a.width+2*this.nodeDistance-b;a.child.offsetX=c+a.height;a.child.offsetY=b;a.contour.upperHead=this.createLine(a.height,0,this.createLine(c,b,a.contour.upperHead));a.contour.lowerHead=this.createLine(a.height,0,this.createLine(c,d,a.contour.lowerHead))};
mxCompactTreeLayout.prototype.layoutLeaf=function(a){var b=2*this.nodeDistance;a.contour.upperTail=this.createLine(a.height+b,0);a.contour.upperHead=a.contour.upperTail;a.contour.lowerTail=this.createLine(0,-a.width-b);a.contour.lowerHead=this.createLine(a.height+b,0,a.contour.lowerTail)};
mxCompactTreeLayout.prototype.join=function(a){var b=2*this.nodeDistance,c=a.child;a.contour=c.contour;var d=c.width+b,e=d;for(c=c.next;null!=c;){var f=this.merge(a.contour,c.contour);c.offsetY=f+d;c.offsetX=0;d=c.width+b;e+=f+d;c=c.next}return e};
mxCompactTreeLayout.prototype.merge=function(a,b){for(var c=0,d=0,e=0,f=a.lowerHead,g=b.upperHead;null!=g&&null!=f;){var k=this.offset(c,d,g.dx,g.dy,f.dx,f.dy);d+=k;e+=k;c+g.dx<=f.dx?(c+=g.dx,d+=g.dy,g=g.next):(c-=f.dx,d-=f.dy,f=f.next)}null!=g?(c=this.bridge(a.upperTail,0,0,g,c,d),a.upperTail=null!=c.next?b.upperTail:c,a.lowerTail=b.lowerTail):(c=this.bridge(b.lowerTail,c,d,f,0,0),null==c.next&&(a.lowerTail=c));a.lowerHead=b.lowerHead;return e};
mxCompactTreeLayout.prototype.offset=function(a,b,c,d,e,f){if(e<=a||0>=a+c)return 0;a=0<e*d-c*f?0>a?a*d/c-b:0<a?a*f/e-b:-b:e<a+c?f-(b+(e-a)*d/c):e>a+c?(c+a)*f/e-(b+d):f-(b+d);return 0<a?a:0};mxCompactTreeLayout.prototype.bridge=function(a,b,c,d,e,f){b=e+d.dx-b;0==d.dx?e=d.dy:(e=b*d.dy,e/=d.dx);b=this.createLine(b,e,d.next);a.next=this.createLine(0,f+d.dy-e-c,b);return b};
mxCompactTreeLayout.prototype.createNode=function(a){var b={};b.cell=a;b.x=0;b.y=0;b.width=0;b.height=0;a=this.getVertexBounds(a);null!=a&&(this.isHorizontal()?(b.width=a.height,b.height=a.width):(b.width=a.width,b.height=a.height));b.offsetX=0;b.offsetY=0;b.contour={};return b};
mxCompactTreeLayout.prototype.apply=function(a,b){var c=this.graph.getModel(),d=a.cell,e=c.getGeometry(d);null!=d&&null!=e&&(this.isVertexMovable(d)&&(e=this.setVertexLocation(d,a.x,a.y),this.resizeParent&&(a=c.getParent(d),c=mxCellPath.create(a),null==this.parentsChanged[c]&&(this.parentsChanged[c]=a))),b=null==b?new mxRectangle(e.x,e.y,e.width,e.height):new mxRectangle(Math.min(b.x,e.x),Math.min(b.y,e.y),Math.max(b.x+b.width,e.x+e.width),Math.max(b.y+b.height,e.y+e.height)));return b};
mxCompactTreeLayout.prototype.createLine=function(a,b,c){var d={};d.dx=a;d.dy=b;d.next=c;return d};mxCompactTreeLayout.prototype.adjustParents=function(){var a=[],b;for(b in this.parentsChanged)a.push(this.parentsChanged[b]);this.arrangeGroups(mxUtils.sortCells(a,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)};
mxCompactTreeLayout.prototype.localEdgeProcessing=function(a){this.processNodeOutgoing(a);for(a=a.child;null!=a;)this.localEdgeProcessing(a),a=a.next};
mxCompactTreeLayout.prototype.processNodeOutgoing=function(a){for(var b=a.child,c=a.cell,d=0,e=[];null!=b;){d++;var f=b.x;this.horizontal&&(f=b.y);e.push(new WeightedCellSorter(b,f));b=b.next}e.sort(WeightedCellSorter.prototype.compare);f=a.width;var g=(d+1)*this.prefHozEdgeSep;f>g+2*this.prefHozEdgeSep&&(f-=2*this.prefHozEdgeSep);a=f/d;b=a/2;f>g+2*this.prefHozEdgeSep&&(b+=this.prefHozEdgeSep);f=this.minEdgeJetty-this.prefVertEdgeOff;g=this.getVertexBounds(c);for(var k=0;k<e.length;k++){var l=e[k].cell.cell,
m=this.getVertexBounds(l);l=this.graph.getEdgesBetween(c,l,!1);for(var n=[],p,r,q=0;q<l.length;q++)this.horizontal?(p=g.x+g.width,r=g.y+b,n.push(new mxPoint(p,r)),p=g.x+g.width+f,n.push(new mxPoint(p,r)),r=m.y+m.height/2):(p=g.x+b,r=g.y+g.height,n.push(new mxPoint(p,r)),r=g.y+g.height+f,n.push(new mxPoint(p,r)),p=m.x+m.width/2),n.push(new mxPoint(p,r)),this.setEdgePoints(l[q],n);k<d/2?f+=this.prefVertEdgeOff:k>d/2&&(f-=this.prefVertEdgeOff);b+=a}};
function mxRadialTreeLayout(a){mxCompactTreeLayout.call(this,a,!1)}mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout);mxRadialTreeLayout.prototype.angleOffset=.5;mxRadialTreeLayout.prototype.rootx=0;mxRadialTreeLayout.prototype.rooty=0;mxRadialTreeLayout.prototype.levelDistance=120;mxRadialTreeLayout.prototype.nodeDistance=10;mxRadialTreeLayout.prototype.autoRadius=!1;mxRadialTreeLayout.prototype.sortEdges=!1;mxRadialTreeLayout.prototype.rowMinX=[];mxRadialTreeLayout.prototype.rowMaxX=[];
mxRadialTreeLayout.prototype.rowMinCenX=[];mxRadialTreeLayout.prototype.rowMaxCenX=[];mxRadialTreeLayout.prototype.rowRadi=[];mxRadialTreeLayout.prototype.row=[];mxRadialTreeLayout.prototype.isVertexIgnored=function(a){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(a).length};
mxRadialTreeLayout.prototype.execute=function(a,b){this.parent=a;this.edgeRouting=this.useBoundingBox=!1;mxCompactTreeLayout.prototype.execute.apply(this,arguments);var c=null,d=this.getVertexBounds(this.root);this.centerX=d.x+d.width/2;this.centerY=d.y+d.height/2;for(var e in this.visited){var f=this.getVertexBounds(this.visited[e]);c=null!=c?c:f.clone();c.add(f)}this.calcRowDims([this.node],0);var g=0,k=0;for(c=0;c<this.row.length;c++)e=(this.rowMaxX[c]-this.centerX-this.nodeDistance)/this.rowRadi[c],
g=Math.max(g,(this.centerX-this.rowMinX[c]-this.nodeDistance)/this.rowRadi[c]),k=Math.max(k,e);for(c=0;c<this.row.length;c++){var l=this.centerX-this.nodeDistance-g*this.rowRadi[c],m=this.centerX+this.nodeDistance+k*this.rowRadi[c]-l;for(e=0;e<this.row[c].length;e++)f=this.row[c],d=f[e],f=this.getVertexBounds(d.cell),d.theta=(f.x+f.width/2-l)/m*Math.PI*2}for(c=this.row.length-2;0<=c;c--)for(f=this.row[c],e=0;e<f.length;e++){d=f[e];g=d.child;for(l=k=0;null!=g;)l+=g.theta,k++,g=g.next;0<k&&(g=l/k,g>
d.theta&&e<f.length-1?d.theta=Math.min(g,f[e+1].theta-Math.PI/10):g<d.theta&&0<e&&(d.theta=Math.max(g,f[e-1].theta+Math.PI/10)))}for(c=0;c<this.row.length;c++)for(e=0;e<this.row[c].length;e++)f=this.row[c],d=f[e],f=this.getVertexBounds(d.cell),this.setVertexLocation(d.cell,this.centerX-f.width/2+this.rowRadi[c]*Math.cos(d.theta),this.centerY-f.height/2+this.rowRadi[c]*Math.sin(d.theta))};
mxRadialTreeLayout.prototype.calcRowDims=function(a,b){if(null!=a&&0!=a.length){this.rowMinX[b]=this.centerX;this.rowMaxX[b]=this.centerX;this.rowMinCenX[b]=this.centerX;this.rowMaxCenX[b]=this.centerX;this.row[b]=[];for(var c=!1,d=0;d<a.length;d++)for(var e=null!=a[d]?a[d].child:null;null!=e;){var f=this.getVertexBounds(e.cell);this.rowMinX[b]=Math.min(f.x,this.rowMinX[b]);this.rowMaxX[b]=Math.max(f.x+f.width,this.rowMaxX[b]);this.rowMinCenX[b]=Math.min(f.x+f.width/2,this.rowMinCenX[b]);this.rowMaxCenX[b]=
Math.max(f.x+f.width/2,this.rowMaxCenX[b]);this.rowRadi[b]=f.y-this.getVertexBounds(this.root).y;null!=e.child&&(c=!0);this.row[b].push(e);e=e.next}c&&this.calcRowDims(this.row[b],b+1)}};function mxFastOrganicLayout(a){mxGraphLayout.call(this,a)}mxFastOrganicLayout.prototype=new mxGraphLayout;mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout;mxFastOrganicLayout.prototype.useInputOrigin=!0;mxFastOrganicLayout.prototype.resetEdges=!0;mxFastOrganicLayout.prototype.disableEdgeStyle=!0;
mxFastOrganicLayout.prototype.forceConstant=50;mxFastOrganicLayout.prototype.forceConstantSquared=0;mxFastOrganicLayout.prototype.minDistanceLimit=2;mxFastOrganicLayout.prototype.maxDistanceLimit=500;mxFastOrganicLayout.prototype.minDistanceLimitSquared=4;mxFastOrganicLayout.prototype.initialTemp=200;mxFastOrganicLayout.prototype.temperature=0;mxFastOrganicLayout.prototype.maxIterations=0;mxFastOrganicLayout.prototype.iteration=0;mxFastOrganicLayout.prototype.allowedToRun=!0;
mxFastOrganicLayout.prototype.isVertexIgnored=function(a){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(a).length};
mxFastOrganicLayout.prototype.execute=function(a){var b=this.graph.getModel();this.vertexArray=[];for(var c=this.graph.getChildVertices(a),d=0;d<c.length;d++)this.isVertexIgnored(c[d])||this.vertexArray.push(c[d]);var e=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null,f=this.vertexArray.length;this.indices=[];this.dispX=[];this.dispY=[];this.cellLocation=[];this.isMoveable=[];this.neighbours=[];this.radius=[];this.radiusSquared=[];.001>this.forceConstant&&(this.forceConstant=
.001);this.forceConstantSquared=this.forceConstant*this.forceConstant;for(d=0;d<this.vertexArray.length;d++){var g=this.vertexArray[d];this.cellLocation[d]=[];var k=mxObjectIdentity.get(g);this.indices[k]=d;var l=this.getVertexBounds(g),m=l.width,n=l.height,p=l.x,r=l.y;this.cellLocation[d][0]=p+m/2;this.cellLocation[d][1]=r+n/2;this.radius[d]=Math.min(m,n);this.radiusSquared[d]=this.radius[d]*this.radius[d]}b.beginUpdate();try{for(d=0;d<f;d++){this.dispX[d]=0;this.dispY[d]=0;this.isMoveable[d]=this.isVertexMovable(this.vertexArray[d]);
var q=this.graph.getConnections(this.vertexArray[d],a);c=this.graph.getOpposites(q,this.vertexArray[d]);this.neighbours[d]=[];for(m=0;m<c.length;m++){this.resetEdges&&this.graph.resetEdge(q[m]);this.disableEdgeStyle&&this.setEdgeStyleEnabled(q[m],!1);k=mxObjectIdentity.get(c[m]);var t=this.indices[k];this.neighbours[d][m]=null!=t?t:d}}this.temperature=this.initialTemp;0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(f));for(this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;
this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}a=c=null;for(d=0;d<this.vertexArray.length;d++)g=this.vertexArray[d],this.isVertexMovable(g)&&(l=this.getVertexBounds(g),null!=l&&(this.cellLocation[d][0]-=l.width/2,this.cellLocation[d][1]-=l.height/2,p=this.graph.snap(Math.round(this.cellLocation[d][0])),r=this.graph.snap(Math.round(this.cellLocation[d][1])),this.setVertexLocation(g,p,r),c=null==c?p:Math.min(c,p),a=null==a?r:Math.min(a,r)));d=-(c||0)+1;g=-(a||
0)+1;null!=e&&(d+=e.x,g+=e.y);this.graph.moveCells(this.vertexArray,d,g)}finally{b.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var a=0;a<this.vertexArray.length;a++)if(this.isMoveable[a]){var b=Math.sqrt(this.dispX[a]*this.dispX[a]+this.dispY[a]*this.dispY[a]);.001>b&&(b=.001);var c=this.dispX[a]/b*Math.min(b,this.temperature);b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}};
mxFastOrganicLayout.prototype.calcAttraction=function(){for(var a=0;a<this.vertexArray.length;a++)for(var b=0;b<this.neighbours[a].length;b++){var c=this.neighbours[a][b];if(a!=c&&this.isMoveable[a]&&this.isMoveable[c]){var d=this.cellLocation[a][0]-this.cellLocation[c][0],e=this.cellLocation[a][1]-this.cellLocation[c][1],f=d*d+e*e-this.radiusSquared[a]-this.radiusSquared[c];f<this.minDistanceLimitSquared&&(f=this.minDistanceLimitSquared);var g=Math.sqrt(f);f/=this.forceConstant;d=d/g*f;e=e/g*f;this.dispX[a]-=
d;this.dispY[a]-=e;this.dispX[c]+=d;this.dispY[c]+=e}}};
mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var a=this.vertexArray.length,b=0;b<a;b++)for(var c=b;c<a;c++){if(!this.allowedToRun)return;if(c!=b&&this.isMoveable[b]&&this.isMoveable[c]){var d=this.cellLocation[b][0]-this.cellLocation[c][0],e=this.cellLocation[b][1]-this.cellLocation[c][1];0==d&&(d=.01+Math.random());0==e&&(e=.01+Math.random());var f=Math.sqrt(d*d+e*e),g=f-this.radius[b]-this.radius[c];g>this.maxDistanceLimit||(g<this.minDistanceLimit&&(g=this.minDistanceLimit),g=this.forceConstantSquared/
g,d=d/f*g,e=e/f*g,this.dispX[b]+=d,this.dispY[b]+=e,this.dispX[c]-=d,this.dispY[c]-=e)}}};mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)};function mxCircleLayout(a,b){mxGraphLayout.call(this,a);this.radius=null!=b?b:100}mxCircleLayout.prototype=new mxGraphLayout;mxCircleLayout.prototype.constructor=mxCircleLayout;mxCircleLayout.prototype.radius=null;mxCircleLayout.prototype.moveCircle=!1;
mxCircleLayout.prototype.x0=0;mxCircleLayout.prototype.y0=0;mxCircleLayout.prototype.resetEdges=!0;mxCircleLayout.prototype.disableEdgeStyle=!0;
mxCircleLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0,d=null,e=null,f=[],g=b.getChildCount(a),k=0;k<g;k++){var l=b.getChildAt(a,k);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{f.push(l);var m=this.getVertexBounds(l);d=null==d?m.y:Math.min(d,m.y);e=null==e?m.x:Math.min(e,m.x);c=Math.max(c,Math.max(m.width,m.height))}}var n=this.getRadius(f.length,
c);this.moveCircle&&(e=this.x0,d=this.y0);this.circle(f,n,e,d)}finally{b.endUpdate()}};mxCircleLayout.prototype.getRadius=function(a,b){return Math.max(a*b/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(a,b,c,d){for(var e=a.length,f=2*Math.PI/e,g=0;g<e;g++)this.isVertexMovable(a[g])&&this.setVertexLocation(a[g],Math.round(c+b+b*Math.cos(g*f-Math.PI/2)),Math.round(d+b+b*Math.sin(g*f-Math.PI/2)))};function mxParallelEdgeLayout(a){mxGraphLayout.call(this,a)}
mxParallelEdgeLayout.prototype=new mxGraphLayout;mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout;mxParallelEdgeLayout.prototype.spacing=20;mxParallelEdgeLayout.prototype.checkOverlap=!1;mxParallelEdgeLayout.prototype.execute=function(a,b){a=this.findParallels(a,b);this.graph.model.beginUpdate();try{for(var c in a){var d=a[c];1<d.length&&this.layout(d)}}finally{this.graph.model.endUpdate()}};
mxParallelEdgeLayout.prototype.findParallels=function(a,b){var c=[],d=mxUtils.bind(this,function(g){if(!this.isEdgeIgnored(g)){var k=this.getEdgeId(g);null!=k&&(null==c[k]&&(c[k]=[]),c[k].push(g))}});if(null!=b)for(var e=0;e<b.length;e++)d(b[e]);else{b=this.graph.getModel();var f=b.getChildCount(a);for(e=0;e<f;e++)d(b.getChildAt(a,e))}return c};
mxParallelEdgeLayout.prototype.getEdgeId=function(a){var b=this.graph.getView(),c=b.getVisibleTerminal(a,!0);b=b.getVisibleTerminal(a,!1);var d="";if(null!=c&&null!=b){c=mxObjectIdentity.get(c);b=mxObjectIdentity.get(b);if(this.checkOverlap&&(a=this.graph.view.getState(a),null!=a&&null!=a.absolutePoints)){d=[];for(var e=0;e<a.absolutePoints.length;e++){var f=a.absolutePoints[e];null!=f&&d.push(f.x,f.y)}d=d.join(",")}return(c>b?b+"-"+c:c+"-"+b)+d}return null};
mxParallelEdgeLayout.prototype.layout=function(a){var b=a[0],c=this.graph.getView(),d=this.graph.getModel(),e=d.getGeometry(c.getVisibleTerminal(b,!0));d=d.getGeometry(c.getVisibleTerminal(b,!1));if(e==d){b=e.x+e.width+this.spacing;c=e.y+e.height/2;for(var f=0;f<a.length;f++)this.route(a[f],b,c),b+=this.spacing}else if(null!=e&&null!=d){b=e.x+e.width/2;c=e.y+e.height/2;f=d.x+d.width/2-b;var g=d.y+d.height/2-c;d=Math.sqrt(f*f+g*g);if(0<d)for(e=g*this.spacing/d,d=f*this.spacing/d,b=b+f/2+e*(a.length-
1)/2,c=c+g/2-d*(a.length-1)/2,f=0;f<a.length;f++)this.route(a[f],b,c),b-=e,c+=d}};mxParallelEdgeLayout.prototype.route=function(a,b,c){this.graph.isCellMovable(a)&&this.setEdgePoints(a,[new mxPoint(b,c)])};function mxCompositeLayout(a,b,c){mxGraphLayout.call(this,a);this.layouts=b;this.master=c}mxCompositeLayout.prototype=new mxGraphLayout;mxCompositeLayout.prototype.constructor=mxCompositeLayout;mxCompositeLayout.prototype.layouts=null;mxCompositeLayout.prototype.master=null;
mxCompositeLayout.prototype.moveCell=function(a,b,c){null!=this.master?this.master.moveCell.apply(this.master,arguments):this.layouts[0].moveCell.apply(this.layouts[0],arguments)};mxCompositeLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0;c<this.layouts.length;c++)this.layouts[c].execute.apply(this.layouts[c],arguments)}finally{b.endUpdate()}};function mxEdgeLabelLayout(a,b){mxGraphLayout.call(this,a)}mxEdgeLabelLayout.prototype=new mxGraphLayout;
mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout;mxEdgeLabelLayout.prototype.execute=function(a){for(var b=this.graph.view,c=this.graph.getModel(),d=[],e=[],f=c.getChildCount(a),g=0;g<f;g++){var k=c.getChildAt(a,g),l=b.getState(k);null!=l&&(this.isVertexIgnored(k)?this.isEdgeIgnored(k)||d.push(l):e.push(l))}this.placeLabels(e,d)};
mxEdgeLabelLayout.prototype.placeLabels=function(a,b){var c=this.graph.getModel();c.beginUpdate();try{for(var d=0;d<b.length;d++){var e=b[d];if(null!=e&&null!=e.text&&null!=e.text.boundingBox)for(var f=0;f<a.length;f++){var g=a[f];null!=g&&this.avoid(e,g)}}}finally{c.endUpdate()}};
mxEdgeLabelLayout.prototype.avoid=function(a,b){var c=this.graph.getModel(),d=a.text.boundingBox;if(mxUtils.intersects(d,b)){var e=-d.y-d.height+b.y,f=-d.y+b.y+b.height;e=Math.abs(e)<Math.abs(f)?e:f;f=-d.x-d.width+b.x;b=-d.x+b.x+b.width;b=Math.abs(f)<Math.abs(b)?f:b;Math.abs(b)<Math.abs(e)?e=0:b=0;d=c.getGeometry(a.cell);null!=d&&(d=d.clone(),null!=d.offset?(d.offset.x+=b,d.offset.y+=e):d.offset=new mxPoint(b,e),c.setGeometry(a.cell,d))}};
function mxGraphAbstractHierarchyCell(){this.x=[];this.y=[];this.temp=[]}mxGraphAbstractHierarchyCell.prototype.maxRank=-1;mxGraphAbstractHierarchyCell.prototype.minRank=-1;mxGraphAbstractHierarchyCell.prototype.x=null;mxGraphAbstractHierarchyCell.prototype.y=null;mxGraphAbstractHierarchyCell.prototype.width=0;mxGraphAbstractHierarchyCell.prototype.height=0;mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null;mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null;
mxGraphAbstractHierarchyCell.prototype.temp=null;mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(a){return null};mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(a){return null};mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1};mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1};mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(a){return null};
mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(a,b){return null};mxGraphAbstractHierarchyCell.prototype.setX=function(a,b){this.isVertex()?this.x[0]=b:this.isEdge()&&(this.x[a-this.minRank-1]=b)};mxGraphAbstractHierarchyCell.prototype.getX=function(a){return this.isVertex()?this.x[0]:this.isEdge()?this.x[a-this.minRank-1]:0};mxGraphAbstractHierarchyCell.prototype.setY=function(a,b){this.isVertex()?this.y[0]=b:this.isEdge()&&(this.y[a-this.minRank-1]=b)};
function mxGraphHierarchyNode(a){mxGraphAbstractHierarchyCell.apply(this,arguments);this.cell=a;this.id=mxObjectIdentity.get(a);this.connectsAsTarget=[];this.connectsAsSource=[]}mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode;mxGraphHierarchyNode.prototype.cell=null;mxGraphHierarchyNode.prototype.id=null;mxGraphHierarchyNode.prototype.connectsAsTarget=null;mxGraphHierarchyNode.prototype.connectsAsSource=null;
mxGraphHierarchyNode.prototype.hashCode=!1;mxGraphHierarchyNode.prototype.getRankValue=function(a){return this.maxRank};mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(a){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];this.nextLayerConnectedCells[0]=[];for(var b=0;b<this.connectsAsTarget.length;b++){var c=this.connectsAsTarget[b];-1==c.maxRank||c.maxRank==a+1?this.nextLayerConnectedCells[0].push(c.source):this.nextLayerConnectedCells[0].push(c)}}return this.nextLayerConnectedCells[0]};
mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(a){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];this.previousLayerConnectedCells[0]=[];for(var b=0;b<this.connectsAsSource.length;b++){var c=this.connectsAsSource[b];-1==c.minRank||c.minRank==a-1?this.previousLayerConnectedCells[0].push(c.target):this.previousLayerConnectedCells[0].push(c)}}return this.previousLayerConnectedCells[0]};mxGraphHierarchyNode.prototype.isVertex=function(){return!0};
mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(a){return this.temp[0]};mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(a,b){this.temp[0]=b};mxGraphHierarchyNode.prototype.isAncestor=function(a){if(null!=a&&null!=this.hashCode&&null!=a.hashCode&&this.hashCode.length<a.hashCode.length){if(this.hashCode==a.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var b=0;b<this.hashCode.length;b++)if(this.hashCode[b]!=a.hashCode[b])return!1;return!0}return!1};
mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell};function mxGraphHierarchyEdge(a){mxGraphAbstractHierarchyCell.apply(this,arguments);this.edges=a;this.ids=[];for(var b=0;b<a.length;b++)this.ids.push(mxObjectIdentity.get(a[b]))}mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge;mxGraphHierarchyEdge.prototype.edges=null;mxGraphHierarchyEdge.prototype.ids=null;mxGraphHierarchyEdge.prototype.source=null;
mxGraphHierarchyEdge.prototype.target=null;mxGraphHierarchyEdge.prototype.isReversed=!1;mxGraphHierarchyEdge.prototype.invert=function(a){a=this.source;this.source=this.target;this.target=a;this.isReversed=!this.isReversed};
mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(a){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var b=0;b<this.temp.length;b++)this.nextLayerConnectedCells[b]=[],b==this.temp.length-1?this.nextLayerConnectedCells[b].push(this.source):this.nextLayerConnectedCells[b].push(this)}return this.nextLayerConnectedCells[a-this.minRank-1]};
mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(a){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var b=0;b<this.temp.length;b++)this.previousLayerConnectedCells[b]=[],0==b?this.previousLayerConnectedCells[b].push(this.target):this.previousLayerConnectedCells[b].push(this)}return this.previousLayerConnectedCells[a-this.minRank-1]};mxGraphHierarchyEdge.prototype.isEdge=function(){return!0};
mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(a){return this.temp[a-this.minRank-1]};mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(a,b){this.temp[a-this.minRank-1]=b};mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null};
function mxGraphHierarchyModel(a,b,c,d,e){a.getGraph();this.tightenToSource=e;this.roots=c;this.parent=d;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;c=[];null==b&&(b=this.graph.getChildVertices(d));this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(a,b,c);for(d=0;d<b.length;d++){e=c[d].connectsAsSource;for(var f=0;f<e.length;f++){var g=e[f],k=g.edges;if(null!=k&&0<k.length){k=k[0];var l=a.getVisibleTerminal(k,!1);l=this.vertexMapper.get(l);c[d]==
l&&(l=a.getVisibleTerminal(k,!0),l=this.vertexMapper.get(l));null!=l&&c[d]!=l&&(g.target=l,0==l.connectsAsTarget.length&&(l.connectsAsTarget=[]),0>mxUtils.indexOf(l.connectsAsTarget,g)&&l.connectsAsTarget.push(g))}}c[d].temp[0]=1}}mxGraphHierarchyModel.prototype.maxRank=null;mxGraphHierarchyModel.prototype.vertexMapper=null;mxGraphHierarchyModel.prototype.edgeMapper=null;mxGraphHierarchyModel.prototype.ranks=null;mxGraphHierarchyModel.prototype.roots=null;mxGraphHierarchyModel.prototype.parent=null;
mxGraphHierarchyModel.prototype.dfsCount=0;mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1E8;mxGraphHierarchyModel.prototype.tightenToSource=!1;
mxGraphHierarchyModel.prototype.createInternalCells=function(a,b,c){for(var d=a.getGraph(),e=0;e<b.length;e++){c[e]=new mxGraphHierarchyNode(b[e]);this.vertexMapper.put(b[e],c[e]);var f=a.getEdges(b[e]);c[e].connectsAsSource=[];for(var g=0;g<f.length;g++){var k=a.getVisibleTerminal(f[g],!1);if(k!=b[e]&&a.graph.model.isVertex(k)&&!a.isVertexIgnored(k)){var l=a.getEdgesBetween(b[e],k,!1);k=a.getEdgesBetween(b[e],k,!0);if(null!=l&&0<l.length&&null==this.edgeMapper.get(l[0])&&2*k.length>=l.length){k=
new mxGraphHierarchyEdge(l);for(var m=0;m<l.length;m++){var n=l[m];this.edgeMapper.put(n,k);d.resetEdge(n);a.disableEdgeStyle&&(a.setEdgeStyleEnabled(n,!1),a.setOrthogonalEdge(n,!0))}k.source=c[e];0>mxUtils.indexOf(c[e].connectsAsSource,k)&&c[e].connectsAsSource.push(k)}}}c[e].temp[0]=0}};
mxGraphHierarchyModel.prototype.initialRank=function(){var a=[];if(null!=this.roots)for(var b=0;b<this.roots.length;b++){var c=this.vertexMapper.get(this.roots[b]);null!=c&&a.push(c)}var d=this.vertexMapper.getValues();for(b=0;b<d.length;b++)d[b].temp[0]=-1;for(var e=a.slice();0<a.length;){c=a[0];var f=c.connectsAsTarget,g=c.connectsAsSource,k=!0,l=this.SOURCESCANSTARTRANK;for(b=0;b<f.length;b++){var m=f[b];if(5270620==m.temp[0])m=m.source,l=Math.min(l,m.temp[0]-1);else{k=!1;break}}if(k){c.temp[0]=
l;this.maxRank=Math.min(this.maxRank,l);if(null!=g)for(b=0;b<g.length;b++)m=g[b],m.temp[0]=5270620,m=m.target,-1==m.temp[0]&&(a.push(m),m.temp[0]=-2);a.shift()}else if(b=a.shift(),a.push(c),b==c&&1==a.length)break}for(b=0;b<d.length;b++)d[b].temp[0]-=this.maxRank;for(b=0;b<e.length;b++)for(c=e[b],a=0,f=c.connectsAsSource,d=0;d<f.length;d++)m=f[d],m=m.target,c.temp[0]=Math.max(a,m.temp[0]+1),a=c.temp[0];this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank};
mxGraphHierarchyModel.prototype.fixRanks=function(){var a=[];this.ranks=[];for(var b=0;b<this.maxRank+1;b++)a[b]=[],this.ranks[b]=a[b];var c=null;if(null!=this.roots){var d=this.roots;c=[];for(b=0;b<d.length;b++){var e=this.vertexMapper.get(d[b]);c[b]=e}}this.visit(function(f,g,k,l,m){0==m&&0>g.maxRank&&0>g.minRank&&(a[g.temp[0]].push(g),g.maxRank=g.temp[0],g.minRank=g.temp[0],g.temp[0]=a[g.maxRank].length-1);if(null!=f&&null!=k&&1<f.maxRank-g.maxRank)for(k.maxRank=f.maxRank,k.minRank=g.maxRank,k.temp=
[],k.x=[],k.y=[],f=k.minRank+1;f<k.maxRank;f++)a[f].push(k),k.setGeneralPurposeVariable(f,a[f].length-1)},c,!1,null)};mxGraphHierarchyModel.prototype.visit=function(a,b,c,d){if(null!=b){for(var e=0;e<b.length;e++){var f=b[e];null!=f&&(null==d&&(d={}),c?(f.hashCode=[],f.hashCode[0]=this.dfsCount,f.hashCode[1]=e,this.extendedDfs(null,f,null,a,d,f.hashCode,e,0)):this.dfs(null,f,null,a,d,0))}this.dfsCount++}};
mxGraphHierarchyModel.prototype.dfs=function(a,b,c,d,e,f){if(null!=b){var g=b.id;if(null==e[g])for(e[g]=b,d(a,b,c,f,0),a=b.connectsAsSource.slice(),c=0;c<a.length;c++)g=a[c],this.dfs(b,g.target,g,d,e,f+1);else d(a,b,c,f,1)}};
mxGraphHierarchyModel.prototype.extendedDfs=function(a,b,c,d,e,f,g,k){if(null!=b)if(null==a||null!=b.hashCode&&b.hashCode[0]==a.hashCode[0]||(f=a.hashCode.length+1,b.hashCode=a.hashCode.slice(),b.hashCode[f-1]=g),g=b.id,null==e[g])for(e[g]=b,d(a,b,c,k,0),a=b.connectsAsSource.slice(),c=0;c<a.length;c++)g=a[c],this.extendedDfs(b,g.target,g,d,e,b.hashCode,c,k+1);else d(a,b,c,k,1)};
function mxSwimlaneModel(a,b,c,d,e){a.getGraph();this.tightenToSource=e;this.roots=c;this.parent=d;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;c=[];null==b&&(b=this.graph.getChildVertices(d));this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(a,b,c);for(d=0;d<b.length;d++){e=c[d].connectsAsSource;for(var f=0;f<e.length;f++){var g=e[f],k=g.edges;if(null!=k&&0<k.length){k=k[0];var l=a.getVisibleTerminal(k,!1);l=this.vertexMapper.get(l);c[d]==l&&(l=
a.getVisibleTerminal(k,!0),l=this.vertexMapper.get(l));null!=l&&c[d]!=l&&(g.target=l,0==l.connectsAsTarget.length&&(l.connectsAsTarget=[]),0>mxUtils.indexOf(l.connectsAsTarget,g)&&l.connectsAsTarget.push(g))}}c[d].temp[0]=1}}mxSwimlaneModel.prototype.maxRank=null;mxSwimlaneModel.prototype.vertexMapper=null;mxSwimlaneModel.prototype.edgeMapper=null;mxSwimlaneModel.prototype.ranks=null;mxSwimlaneModel.prototype.roots=null;mxSwimlaneModel.prototype.parent=null;mxSwimlaneModel.prototype.dfsCount=0;
mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1E8;mxSwimlaneModel.prototype.tightenToSource=!1;mxSwimlaneModel.prototype.ranksPerGroup=null;
mxSwimlaneModel.prototype.createInternalCells=function(a,b,c){for(var d=a.getGraph(),e=a.swimlanes,f=0;f<b.length;f++){c[f]=new mxGraphHierarchyNode(b[f]);this.vertexMapper.put(b[f],c[f]);c[f].swimlaneIndex=-1;for(var g=0;g<e.length;g++)if(d.model.getParent(b[f])==e[g]){c[f].swimlaneIndex=g;break}g=a.getEdges(b[f]);c[f].connectsAsSource=[];for(var k=0;k<g.length;k++){var l=a.getVisibleTerminal(g[k],!1);if(l!=b[f]&&a.graph.model.isVertex(l)&&!a.isVertexIgnored(l)){var m=a.getEdgesBetween(b[f],l,!1);
l=a.getEdgesBetween(b[f],l,!0);if(null!=m&&0<m.length&&null==this.edgeMapper.get(m[0])&&2*l.length>=m.length){l=new mxGraphHierarchyEdge(m);for(var n=0;n<m.length;n++){var p=m[n];this.edgeMapper.put(p,l);d.resetEdge(p);a.disableEdgeStyle&&(a.setEdgeStyleEnabled(p,!1),a.setOrthogonalEdge(p,!0))}l.source=c[f];0>mxUtils.indexOf(c[f].connectsAsSource,l)&&c[f].connectsAsSource.push(l)}}}c[f].temp[0]=0}};
mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var a=[],b={};if(null!=this.roots)for(var c=0;c<this.roots.length;c++){var d=this.vertexMapper.get(this.roots[c]);this.maxChainDfs(null,d,null,b,0);null!=d&&a.push(d)}d=[];b=[];for(c=this.ranksPerGroup.length-1;0<=c;c--)d[c]=c==this.ranksPerGroup.length-1?0:b[c+1]+1,b[c]=d[c]+this.ranksPerGroup[c];this.maxRank=b[0];d=this.vertexMapper.getValues();for(c=0;c<d.length;c++)d[c].temp[0]=-1;for(a.slice();0<a.length;){d=a[0];var e=d.connectsAsTarget,
f=d.connectsAsSource,g=!0,k=b[0];for(c=0;c<e.length;c++){var l=e[c];if(5270620==l.temp[0])l=l.source,k=Math.min(k,l.temp[0]-1);else{g=!1;break}}if(g){k>b[d.swimlaneIndex]&&(k=b[d.swimlaneIndex]);d.temp[0]=k;if(null!=f)for(c=0;c<f.length;c++)l=f[c],l.temp[0]=5270620,l=l.target,-1==l.temp[0]&&(a.push(l),l.temp[0]=-2);a.shift()}else if(c=a.shift(),a.push(d),c==d&&1==a.length)break}};
mxSwimlaneModel.prototype.maxChainDfs=function(a,b,c,d,e){if(null!=b&&(a=mxCellPath.create(b.cell),null==d[a])){d[a]=b;a=b.swimlaneIndex;if(null==this.ranksPerGroup[a]||this.ranksPerGroup[a]<e)this.ranksPerGroup[a]=e;a=b.connectsAsSource.slice();for(c=0;c<a.length;c++){var f=a[c],g=f.target;b.swimlaneIndex<g.swimlaneIndex?this.maxChainDfs(b,g,f,mxUtils.clone(d,null,!0),0):b.swimlaneIndex==g.swimlaneIndex&&this.maxChainDfs(b,g,f,mxUtils.clone(d,null,!0),e+1)}}};
mxSwimlaneModel.prototype.fixRanks=function(){var a=[];this.ranks=[];for(var b=0;b<this.maxRank+1;b++)a[b]=[],this.ranks[b]=a[b];var c=null;if(null!=this.roots){var d=this.roots;c=[];for(b=0;b<d.length;b++){var e=this.vertexMapper.get(d[b]);c[b]=e}}this.visit(function(f,g,k,l,m){0==m&&0>g.maxRank&&0>g.minRank&&(a[g.temp[0]].push(g),g.maxRank=g.temp[0],g.minRank=g.temp[0],g.temp[0]=a[g.maxRank].length-1);if(null!=f&&null!=k&&1<f.maxRank-g.maxRank)for(k.maxRank=f.maxRank,k.minRank=g.maxRank,k.temp=
[],k.x=[],k.y=[],f=k.minRank+1;f<k.maxRank;f++)a[f].push(k),k.setGeneralPurposeVariable(f,a[f].length-1)},c,!1,null)};mxSwimlaneModel.prototype.visit=function(a,b,c,d){if(null!=b){for(var e=0;e<b.length;e++){var f=b[e];null!=f&&(null==d&&(d={}),c?(f.hashCode=[],f.hashCode[0]=this.dfsCount,f.hashCode[1]=e,this.extendedDfs(null,f,null,a,d,f.hashCode,e,0)):this.dfs(null,f,null,a,d,0))}this.dfsCount++}};
mxSwimlaneModel.prototype.dfs=function(a,b,c,d,e,f){if(null!=b){var g=b.id;if(null==e[g])for(e[g]=b,d(a,b,c,f,0),a=b.connectsAsSource.slice(),c=0;c<a.length;c++)g=a[c],this.dfs(b,g.target,g,d,e,f+1);else d(a,b,c,f,1)}};
mxSwimlaneModel.prototype.extendedDfs=function(a,b,c,d,e,f,g,k){if(null!=b)if(null==a||null!=b.hashCode&&b.hashCode[0]==a.hashCode[0]||(f=a.hashCode.length+1,b.hashCode=a.hashCode.slice(),b.hashCode[f-1]=g),g=b.id,null==e[g]){e[g]=b;d(a,b,c,k,0);a=b.connectsAsSource.slice();c=b.connectsAsTarget.slice();for(g=0;g<a.length;g++){f=a[g];var l=f.target;b.swimlaneIndex<=l.swimlaneIndex&&this.extendedDfs(b,l,f,d,e,b.hashCode,g,k+1)}for(g=0;g<c.length;g++)f=c[g],l=f.source,b.swimlaneIndex<l.swimlaneIndex&&
this.extendedDfs(b,l,f,d,e,b.hashCode,g,k+1)}else d(a,b,c,k,1)};function mxHierarchicalLayoutStage(){}mxHierarchicalLayoutStage.prototype.execute=function(a){};function mxMedianHybridCrossingReduction(a){this.layout=a}mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage;mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction;mxMedianHybridCrossingReduction.prototype.layout=null;mxMedianHybridCrossingReduction.prototype.maxIterations=24;
mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null;mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0;mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0;mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2;
mxMedianHybridCrossingReduction.prototype.execute=function(a){a=this.layout.getModel();this.nestedBestRanks=[];for(var b=0;b<a.ranks.length;b++)this.nestedBestRanks[b]=a.ranks[b].slice();var c=0,d=this.calculateCrossings(a);for(b=0;b<this.maxIterations&&c<this.maxNoImprovementIterations;b++){this.weightedMedian(b,a);this.transpose(b,a);var e=this.calculateCrossings(a);if(e<d)for(d=e,e=c=0;e<this.nestedBestRanks.length;e++)for(var f=a.ranks[e],g=0;g<f.length;g++){var k=f[g];this.nestedBestRanks[e][k.getGeneralPurposeVariable(e)]=
k}else for(c++,e=0;e<this.nestedBestRanks.length;e++)for(f=a.ranks[e],g=0;g<f.length;g++)k=f[g],k.setGeneralPurposeVariable(e,g);if(0==d)break}c=[];d=[];for(b=0;b<a.maxRank+1;b++)d[b]=[],c[b]=d[b];for(b=0;b<this.nestedBestRanks.length;b++)for(e=0;e<this.nestedBestRanks[b].length;e++)d[b].push(this.nestedBestRanks[b][e]);a.ranks=c};mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(a){for(var b=a.ranks.length,c=0,d=1;d<b;d++)c+=this.calculateRankCrossing(d,a);return c};
mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(a,b){var c=0,d=b.ranks[a],e=b.ranks[a-1],f=[];for(b=0;b<d.length;b++){var g=d[b],k=g.getGeneralPurposeVariable(a);g=g.getPreviousLayerConnectedCells(a);for(var l=[],m=0;m<g.length;m++){var n=g[m].getGeneralPurposeVariable(a-1);l.push(n)}l.sort(function(p,r){return p-r});f[k]=l}a=[];for(b=0;b<f.length;b++)a=a.concat(f[b]);for(d=1;d<e.length;)d<<=1;f=2*d-1;--d;e=[];for(b=0;b<f;++b)e[b]=0;for(b=0;b<a.length;b++)for(f=a[b]+d,++e[f];0<
f;)f%2&&(c+=e[f+1]),f=f-1>>1,++e[f];return c};
mxMedianHybridCrossingReduction.prototype.transpose=function(a,b){for(var c=!0,d=0;c&&10>d++;){var e=1==a%2&&1==d%2;c=!1;for(var f=0;f<b.ranks.length;f++){for(var g=b.ranks[f],k=[],l=0;l<g.length;l++){var m=g[l],n=m.getGeneralPurposeVariable(f);0>n&&(n=l);k[n]=m}var p=null,r=null,q=null,t=null,u=null;for(l=0;l<g.length-1;l++){if(0==l){var x=k[l];m=x.getNextLayerConnectedCells(f);n=x.getPreviousLayerConnectedCells(f);for(var A=[],E=[],C=0;C<m.length;C++)A[C]=m[C].getGeneralPurposeVariable(f+1);for(C=
0;C<n.length;C++)E[C]=n[C].getGeneralPurposeVariable(f-1)}else m=p,n=r,A=q,E=t,x=u;u=k[l+1];p=u.getNextLayerConnectedCells(f);r=u.getPreviousLayerConnectedCells(f);q=[];t=[];for(C=0;C<p.length;C++)q[C]=p[C].getGeneralPurposeVariable(f+1);for(C=0;C<r.length;C++)t[C]=r[C].getGeneralPurposeVariable(f-1);var D=0,B=0;for(C=0;C<A.length;C++)for(var v=0;v<q.length;v++)A[C]>q[v]&&D++,A[C]<q[v]&&B++;for(C=0;C<E.length;C++)for(v=0;v<t.length;v++)E[C]>t[v]&&D++,E[C]<t[v]&&B++;if(B<D||B==D&&e)p=x.getGeneralPurposeVariable(f),
x.setGeneralPurposeVariable(f,u.getGeneralPurposeVariable(f)),u.setGeneralPurposeVariable(f,p),p=m,r=n,q=A,t=E,u=x,e||(c=!0)}}}};mxMedianHybridCrossingReduction.prototype.weightedMedian=function(a,b){if(a=0==a%2)for(var c=b.maxRank-1;0<=c;c--)this.medianRank(c,a);else for(c=1;c<b.maxRank;c++)this.medianRank(c,a)};
mxMedianHybridCrossingReduction.prototype.medianRank=function(a,b){for(var c=this.nestedBestRanks[a].length,d=[],e=[],f=0;f<c;f++){var g=this.nestedBestRanks[a][f],k=new MedianCellSorter;k.cell=g;var l=b?g.getNextLayerConnectedCells(a):g.getPreviousLayerConnectedCells(a),m=b?a+1:a-1;null!=l&&0!=l.length?(k.medianValue=this.medianValue(l,m),d.push(k)):e[g.getGeneralPurposeVariable(a)]=!0}d.sort(MedianCellSorter.prototype.compare);for(f=0;f<c;f++)null==e[f]&&(g=d.shift().cell,g.setGeneralPurposeVariable(a,
f))};mxMedianHybridCrossingReduction.prototype.medianValue=function(a,b){for(var c=[],d=0,e=0;e<a.length;e++){var f=a[e];c[d++]=f.getGeneralPurposeVariable(b)}c.sort(function(g,k){return g-k});if(1==d%2)return c[Math.floor(d/2)];if(2==d)return(c[0]+c[1])/2;a=d/2;b=c[a-1]-c[0];d=c[d-1]-c[a];return(c[a-1]*d+c[a]*b)/(b+d)};function MedianCellSorter(){}MedianCellSorter.prototype.medianValue=0;MedianCellSorter.prototype.cell=!1;
MedianCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.medianValue>a.medianValue?-1:b.medianValue<a.medianValue?1:0:0};function mxMinimumCycleRemover(a){this.layout=a}mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage;mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover;mxMinimumCycleRemover.prototype.layout=null;
mxMinimumCycleRemover.prototype.execute=function(a){a=this.layout.getModel();for(var b={},c=a.vertexMapper.getValues(),d={},e=0;e<c.length;e++)d[c[e].id]=c[e];c=null;if(null!=a.roots){var f=a.roots;c=[];for(e=0;e<f.length;e++)c[e]=a.vertexMapper.get(f[e])}a.visit(function(g,k,l,m,n){k.isAncestor(g)&&(l.invert(),mxUtils.remove(l,g.connectsAsSource),g.connectsAsTarget.push(l),mxUtils.remove(l,k.connectsAsTarget),k.connectsAsSource.push(l));b[k.id]=k;delete d[k.id]},c,!0,null);e=mxUtils.clone(b,null,
!0);a.visit(function(g,k,l,m,n){k.isAncestor(g)&&(l.invert(),mxUtils.remove(l,g.connectsAsSource),k.connectsAsSource.push(l),g.connectsAsTarget.push(l),mxUtils.remove(l,k.connectsAsTarget));b[k.id]=k;delete d[k.id]},d,!0,e)};function mxCoordinateAssignment(a,b,c,d,e,f){this.layout=a;this.intraCellSpacing=b;this.interRankCellSpacing=c;this.orientation=d;this.initialX=e;this.parallelEdgeSpacing=f}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage;
mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment;mxCoordinateAssignment.prototype.layout=null;mxCoordinateAssignment.prototype.intraCellSpacing=30;mxCoordinateAssignment.prototype.interRankCellSpacing=100;mxCoordinateAssignment.prototype.parallelEdgeSpacing=10;mxCoordinateAssignment.prototype.maxIterations=8;mxCoordinateAssignment.prototype.prefHozEdgeSep=5;mxCoordinateAssignment.prototype.prefVertEdgeOff=2;mxCoordinateAssignment.prototype.minEdgeJetty=12;
mxCoordinateAssignment.prototype.channelBuffer=4;mxCoordinateAssignment.prototype.jettyPositions=null;mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH;mxCoordinateAssignment.prototype.initialX=null;mxCoordinateAssignment.prototype.limitX=null;mxCoordinateAssignment.prototype.currentXDelta=null;mxCoordinateAssignment.prototype.widestRank=null;mxCoordinateAssignment.prototype.rankTopY=null;mxCoordinateAssignment.prototype.rankBottomY=null;
mxCoordinateAssignment.prototype.widestRankValue=null;mxCoordinateAssignment.prototype.rankWidths=null;mxCoordinateAssignment.prototype.rankY=null;mxCoordinateAssignment.prototype.fineTuning=!0;mxCoordinateAssignment.prototype.nextLayerConnectedCache=null;mxCoordinateAssignment.prototype.previousLayerConnectedCache=null;mxCoordinateAssignment.prototype.groupPadding=10;
mxCoordinateAssignment.prototype.printStatus=function(){var a=this.layout.getModel();mxLog.show();mxLog.writeln("======Coord assignment debug=======");for(var b=0;b<a.ranks.length;b++){mxLog.write("Rank ",b," : ");for(var c=a.ranks[b],d=0;d<c.length;d++)mxLog.write(c[d].getGeneralPurposeVariable(b),"  ");mxLog.writeln()}mxLog.writeln("====================================")};
mxCoordinateAssignment.prototype.execute=function(a){this.jettyPositions={};a=this.layout.getModel();this.currentXDelta=0;this.initialCoords(this.layout.getGraph(),a);this.fineTuning&&this.minNode(a);var b=1E8;if(this.fineTuning)for(var c=0;c<this.maxIterations;c++){0!=c&&(this.medianPos(c,a),this.minNode(a));if(this.currentXDelta<b){for(var d=0;d<a.ranks.length;d++)for(var e=a.ranks[d],f=0;f<e.length;f++){var g=e[f];g.setX(d,g.getGeneralPurposeVariable(d))}b=this.currentXDelta}else for(d=0;d<a.ranks.length;d++)for(e=
a.ranks[d],f=0;f<e.length;f++)g=e[f],g.setGeneralPurposeVariable(d,g.getX(d));this.minPath(this.layout.getGraph(),a);this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),a)};
mxCoordinateAssignment.prototype.minNode=function(a){for(var b=[],c=new mxDictionary,d=[],e=0;e<=a.maxRank;e++){d[e]=a.ranks[e];for(var f=0;f<d[e].length;f++){var g=d[e][f],k=new WeightedCellSorter(g,e);k.rankIndex=f;k.visited=!0;b.push(k);c.put(g,k)}}a=10*b.length;for(f=0;0<b.length&&f<=a;){g=b.shift();e=g.cell;var l=g.weightedValue,m=parseInt(g.rankIndex);k=e.getNextLayerConnectedCells(l);var n=e.getPreviousLayerConnectedCells(l),p=k.length,r=n.length,q=this.medianXValue(k,l+1),t=this.medianXValue(n,
l-1),u=p+r,x=e.getGeneralPurposeVariable(l),A=x;0<u&&(A=(q*p+t*r)/u);p=!1;A<x-1?0==m?(e.setGeneralPurposeVariable(l,A),p=!0):(m=d[l][m-1],x=m.getGeneralPurposeVariable(l),x=x+m.width/2+this.intraCellSpacing+e.width/2,x<A?(e.setGeneralPurposeVariable(l,A),p=!0):x<e.getGeneralPurposeVariable(l)-1&&(e.setGeneralPurposeVariable(l,x),p=!0)):A>x+1&&(m==d[l].length-1?(e.setGeneralPurposeVariable(l,A),p=!0):(m=d[l][m+1],x=m.getGeneralPurposeVariable(l),x=x-m.width/2-this.intraCellSpacing-e.width/2,x>A?(e.setGeneralPurposeVariable(l,
A),p=!0):x>e.getGeneralPurposeVariable(l)+1&&(e.setGeneralPurposeVariable(l,x),p=!0)));if(p){for(e=0;e<k.length;e++)l=k[e],l=c.get(l),null!=l&&0==l.visited&&(l.visited=!0,b.push(l));for(e=0;e<n.length;e++)l=n[e],l=c.get(l),null!=l&&0==l.visited&&(l.visited=!0,b.push(l))}g.visited=!1;f++}};mxCoordinateAssignment.prototype.medianPos=function(a,b){if(0==a%2)for(a=b.maxRank;0<a;a--)this.rankMedianPosition(a-1,b,a);else for(a=0;a<b.maxRank-1;a++)this.rankMedianPosition(a+1,b,a)};
mxCoordinateAssignment.prototype.rankMedianPosition=function(a,b,c){b=b.ranks[a];for(var d=[],e={},f=0;f<b.length;f++){var g=b[f];d[f]=new WeightedCellSorter;d[f].cell=g;d[f].rankIndex=f;e[g.id]=d[f];var k=c<a?g.getPreviousLayerConnectedCells(a):g.getNextLayerConnectedCells(a);d[f].weightedValue=this.calculatedWeightedValue(g,k)}d.sort(WeightedCellSorter.prototype.compare);for(f=0;f<d.length;f++){g=d[f].cell;var l=0;k=c<a?g.getPreviousLayerConnectedCells(a).slice():g.getNextLayerConnectedCells(a).slice();
null!=k&&(l=k.length,l=0<l?this.medianXValue(k,c):g.getGeneralPurposeVariable(a));var m=0;k=-1E8;for(var n=d[f].rankIndex-1;0<=n;){var p=e[b[n].id];if(null!=p){var r=p.cell;p.visited?(k=r.getGeneralPurposeVariable(a)+r.width/2+this.intraCellSpacing+m+g.width/2,n=-1):(m+=r.width+this.intraCellSpacing,n--)}}m=0;r=1E8;for(n=d[f].rankIndex+1;n<d.length;)if(p=e[b[n].id],null!=p){var q=p.cell;p.visited?(r=q.getGeneralPurposeVariable(a)-q.width/2-this.intraCellSpacing-m-g.width/2,n=d.length):(m+=q.width+
this.intraCellSpacing,n++)}l>=k&&l<=r?g.setGeneralPurposeVariable(a,l):l<k?(g.setGeneralPurposeVariable(a,k),this.currentXDelta+=k-l):l>r&&(g.setGeneralPurposeVariable(a,r),this.currentXDelta+=l-r);d[f].visited=!0}};mxCoordinateAssignment.prototype.calculatedWeightedValue=function(a,b){for(var c=0,d=0;d<b.length;d++){var e=b[d];a.isVertex()&&e.isVertex()?c++:c=a.isEdge()&&e.isEdge()?c+8:c+2}return c};
mxCoordinateAssignment.prototype.medianXValue=function(a,b){if(0==a.length)return 0;for(var c=[],d=0;d<a.length;d++)c[d]=a[d].getGeneralPurposeVariable(b);c.sort(function(e,f){return e-f});if(1==a.length%2)return c[Math.floor(a.length/2)];a=a.length/2;return(c[a-1]+c[a])/2};
mxCoordinateAssignment.prototype.initialCoords=function(a,b){this.calculateWidestRank(a,b);for(var c=this.widestRank;0<=c;c--)c<b.maxRank&&this.rankCoordinates(c,a,b);for(c=this.widestRank+1;c<=b.maxRank;c++)0<c&&this.rankCoordinates(c,a,b)};
mxCoordinateAssignment.prototype.rankCoordinates=function(a,b,c){b=c.ranks[a];c=this.initialX+(this.widestRankValue-this.rankWidths[a])/2;for(var d=!1,e=0;e<b.length;e++){var f=b[e];if(f.isVertex()){var g=this.layout.getVertexBounds(f.cell);null!=g?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(f.width=g.width,f.height=g.height):(f.width=g.height,f.height=g.width):d=!0}else f.isEdge()&&(g=1,null!=f.edges?g=f.edges.length:mxLog.warn("edge.edges is null"),
f.width=(g-1)*this.parallelEdgeSpacing);c+=f.width/2;f.setX(a,c);f.setGeneralPurposeVariable(a,c);c+=f.width/2;c+=this.intraCellSpacing}1==d&&mxLog.warn("At least one cell has no bounds")};
mxCoordinateAssignment.prototype.calculateWidestRank=function(a,b){a=-this.interRankCellSpacing;var c=0;this.rankWidths=[];this.rankY=[];for(var d=b.maxRank;0<=d;d--){for(var e=0,f=b.ranks[d],g=this.initialX,k=!1,l=0;l<f.length;l++){var m=f[l];if(m.isVertex()){var n=this.layout.getVertexBounds(m.cell);null!=n?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(m.width=n.width,m.height=n.height):(m.width=n.height,m.height=n.width):k=!0;e=Math.max(e,m.height)}else m.isEdge()&&
(n=1,null!=m.edges?n=m.edges.length:mxLog.warn("edge.edges is null"),m.width=(n-1)*this.parallelEdgeSpacing);g+=m.width/2;m.setX(d,g);m.setGeneralPurposeVariable(d,g);g+=m.width/2;g+=this.intraCellSpacing;g>this.widestRankValue&&(this.widestRankValue=g,this.widestRank=d);this.rankWidths[d]=g}1==k&&mxLog.warn("At least one cell has no bounds");this.rankY[d]=a;g=e/2+c/2+this.interRankCellSpacing;c=e;a=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?a+g:a-
g;for(l=0;l<f.length;l++)f[l].setY(d,a)}};
mxCoordinateAssignment.prototype.minPath=function(a,b){a=b.edgeMapper.getValues();for(var c=0;c<a.length;c++){var d=a[c];if(!(1>d.maxRank-d.minRank-1)){for(var e=d.getGeneralPurposeVariable(d.minRank+1),f=!0,g=0,k=d.minRank+2;k<d.maxRank;k++){var l=d.getGeneralPurposeVariable(k);e!=l?(f=!1,e=l):g++}if(!f){f=e=0;l=[];var m=[],n=d.getGeneralPurposeVariable(d.minRank+1);for(k=d.minRank+1;k<d.maxRank-1;k++){var p=d.getX(k+1);n==p?(l[k-d.minRank-1]=n,e++):this.repositionValid(b,d,k+1,n)?(l[k-d.minRank-
1]=n,e++):n=l[k-d.minRank-1]=p}n=d.getX(k);for(k=d.maxRank-1;k>d.minRank+1;k--)p=d.getX(k-1),n==p?(m[k-d.minRank-2]=n,f++):this.repositionValid(b,d,k-1,n)?(m[k-d.minRank-2]=n,f++):(m[k-d.minRank-2]=d.getX(k-1),n=p);if(f>g||e>g)if(f>=e)for(k=d.maxRank-2;k>d.minRank;k--)d.setX(k,m[k-d.minRank-1]);else if(e>f)for(k=d.minRank+2;k<d.maxRank;k++)d.setX(k,l[k-d.minRank-2])}}}};
mxCoordinateAssignment.prototype.repositionValid=function(a,b,c,d){a=a.ranks[c];for(var e=-1,f=0;f<a.length;f++)if(b==a[f]){e=f;break}if(0>e)return!1;f=b.getGeneralPurposeVariable(c);if(d<f){if(0==e)return!0;a=a[e-1];c=a.getGeneralPurposeVariable(c);c=c+a.width/2+this.intraCellSpacing+b.width/2;if(!(c<=d))return!1}else if(d>f){if(e==a.length-1)return!0;a=a[e+1];c=a.getGeneralPurposeVariable(c);c=c-a.width/2-this.intraCellSpacing-b.width/2;if(!(c>=d))return!1}return!0};
mxCoordinateAssignment.prototype.setCellLocations=function(a,b){this.rankTopY=[];this.rankBottomY=[];for(a=0;a<b.ranks.length;a++)this.rankTopY[a]=Number.MAX_VALUE,this.rankBottomY[a]=-Number.MAX_VALUE;var c=b.vertexMapper.getValues();for(a=0;a<c.length;a++)this.setVertexLocation(c[a]);this.layout.edgeStyle!=mxHierarchicalEdgeStyle.ORTHOGONAL&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.POLYLINE&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.CURVE||this.localEdgeProcessing(b);b=b.edgeMapper.getValues();
for(a=0;a<b.length;a++)this.setEdgePosition(b[a])};
mxCoordinateAssignment.prototype.localEdgeProcessing=function(a){for(var b=0;b<a.ranks.length;b++)for(var c=a.ranks[b],d=0;d<c.length;d++){var e=c[d];if(e.isVertex())for(var f=e.getPreviousLayerConnectedCells(b),g=b-1,k=0;2>k;k++){if(-1<g&&g<a.ranks.length&&null!=f&&0<f.length){for(var l=[],m=0;m<f.length;m++){var n=new WeightedCellSorter(f[m],f[m].getX(g));l.push(n)}l.sort(WeightedCellSorter.prototype.compare);n=e.x[0]-e.width/2;var p=n+e.width,r=f=0;g=[];for(m=0;m<l.length;m++){var q=l[m].cell;
if(q.isVertex())for(var t=0==k?e.connectsAsSource:e.connectsAsTarget,u=0;u<t.length;u++){if(t[u].source==q||t[u].target==q)f+=t[u].edges.length,r++,g.push(t[u])}else f+=q.edges.length,r++,g.push(q)}e.width>(f+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);l=(p-n)/f;n+=l/2;p=this.minEdgeJetty-this.prefVertEdgeOff;for(m=0;m<g.length;m++)for(r=g[m].edges.length,q=this.jettyPositions[g[m].ids[0]],null==q&&(q=[],this.jettyPositions[g[m].ids[0]]=q),m<f/2?p+=
this.prefVertEdgeOff:m>f/2&&(p-=this.prefVertEdgeOff),t=0;t<r;t++)q[4*t+2*k]=n,n+=l,q[4*t+2*k+1]=p}f=e.getNextLayerConnectedCells(b);g=b+1}}};
mxCoordinateAssignment.prototype.setEdgePosition=function(a){var b=0;if(101207!=a.temp[0]){var c=a.maxRank,d=a.minRank;c==d&&(c=a.source.maxRank,d=a.target.minRank);for(var e=0,f=this.jettyPositions[a.ids[0]],g=a.isReversed?a.target.cell:a.source.cell,k=this.layout.graph,l=this.orientation==mxConstants.DIRECTION_EAST||this.orientation==mxConstants.DIRECTION_SOUTH,m=0;m<a.edges.length;m++){var n=a.edges[m],p=this.layout.getVisibleTerminal(n,!0),r=[],q=a.isReversed;p!=g&&(q=!q);if(null!=f){var t=q?
2:0,u=q?l?this.rankBottomY[d]:this.rankTopY[d]:l?this.rankTopY[c]:this.rankBottomY[c],x=f[4*e+1+t];q!=l&&(x=-x);u+=x;t=f[4*e+t];var A=k.model.getTerminal(n,!0);this.layout.isPort(A)&&k.model.getParent(A)==p&&(t=k.view.getState(A),t=null!=t?t.x:p.geometry.x+a.source.width*A.geometry.x);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(r.push(new mxPoint(t,u)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&r.push(new mxPoint(t,u+x))):(r.push(new mxPoint(u,
t)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&r.push(new mxPoint(u+x,t)))}t=a.x.length-1;u=x=-1;p=a.maxRank-1;for(q&&(t=0,x=a.x.length,u=1,p=a.minRank+1);a.maxRank!=a.minRank&&t!=x;t+=u){A=a.x[t]+b;var E=(this.rankTopY[p]+this.rankBottomY[p+1])/2,C=(this.rankTopY[p-1]+this.rankBottomY[p])/2;if(q){var D=E;E=C;C=D}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(r.push(new mxPoint(A,E)),r.push(new mxPoint(A,C))):(r.push(new mxPoint(E,A)),r.push(new mxPoint(C,
A)));this.limitX=Math.max(this.limitX,A);p+=u}null!=f&&(t=q?2:0,u=q?l?this.rankTopY[c]:this.rankBottomY[c]:l?this.rankBottomY[d]:this.rankTopY[d],x=f[4*e+3-t],q!=l&&(x=-x),u-=x,t=f[4*e+2-t],q=k.model.getTerminal(n,!1),p=this.layout.getVisibleTerminal(n,!1),this.layout.isPort(q)&&k.model.getParent(q)==p&&(t=k.view.getState(q),t=null!=t?t.x:p.geometry.x+a.target.width*q.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&
r.push(new mxPoint(t,u-x)),r.push(new mxPoint(t,u))):(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&r.push(new mxPoint(u-x,t)),r.push(new mxPoint(u,t))));a.isReversed&&this.processReversedEdge(a,n);this.layout.setEdgePoints(n,r);b=0==b?this.parallelEdgeSpacing:0<b?-b:-b+this.parallelEdgeSpacing;e++}a.temp[0]=101207}};
mxCoordinateAssignment.prototype.setVertexLocation=function(a){var b=a.cell,c=a.x[0]-a.width/2,d=a.y[0]-a.height/2;this.rankTopY[a.minRank]=Math.min(this.rankTopY[a.minRank],d);this.rankBottomY[a.minRank]=Math.max(this.rankBottomY[a.minRank],d+a.height);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(b,c,d):this.layout.setVertexLocation(b,d,c);this.limitX=Math.max(this.limitX,c+a.width)};
mxCoordinateAssignment.prototype.processReversedEdge=function(a,b){};function mxSwimlaneOrdering(a){this.layout=a}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage;mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering;mxSwimlaneOrdering.prototype.layout=null;
mxSwimlaneOrdering.prototype.execute=function(a){a=this.layout.getModel();var b=mxUtils.clone(a.vertexMapper,null,!0),c=null;if(null!=a.roots){var d=a.roots;c=[];for(var e=0;e<d.length;e++)c[e]=a.vertexMapper.get(d[e])}a.visit(function(f,g,k,l,m){l=null!=f&&f.swimlaneIndex==g.swimlaneIndex&&g.isAncestor(f);m=null!=f&&null!=k&&f.swimlaneIndex<g.swimlaneIndex&&k.source==g;l?(k.invert(),mxUtils.remove(k,f.connectsAsSource),g.connectsAsSource.push(k),f.connectsAsTarget.push(k),mxUtils.remove(k,g.connectsAsTarget)):
m&&(k.invert(),mxUtils.remove(k,f.connectsAsTarget),g.connectsAsTarget.push(k),f.connectsAsSource.push(k),mxUtils.remove(k,g.connectsAsSource));f=mxCellPath.create(g.cell);delete b[f]},c,!0,null)};function mxHierarchicalLayout(a,b,c){mxGraphLayout.call(this,a);this.orientation=null!=b?b:mxConstants.DIRECTION_NORTH;this.deterministic=null!=c?c:!0}var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};mxHierarchicalLayout.prototype=new mxGraphLayout;
mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout;mxHierarchicalLayout.prototype.roots=null;mxHierarchicalLayout.prototype.resizeParent=!1;mxHierarchicalLayout.prototype.maintainParentLocation=!1;mxHierarchicalLayout.prototype.moveParent=!1;mxHierarchicalLayout.prototype.parentBorder=0;mxHierarchicalLayout.prototype.intraCellSpacing=30;mxHierarchicalLayout.prototype.interRankCellSpacing=100;mxHierarchicalLayout.prototype.interHierarchySpacing=60;
mxHierarchicalLayout.prototype.parallelEdgeSpacing=10;mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxHierarchicalLayout.prototype.fineTuning=!0;mxHierarchicalLayout.prototype.tightenToSource=!0;mxHierarchicalLayout.prototype.disableEdgeStyle=!0;mxHierarchicalLayout.prototype.traverseAncestors=!0;mxHierarchicalLayout.prototype.model=null;mxHierarchicalLayout.prototype.edgesCache=null;mxHierarchicalLayout.prototype.edgeSourceTermCache=null;
mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxHierarchicalLayout.prototype.getModel=function(){return this.model};
mxHierarchicalLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;null==b||b instanceof Array||(b=[b]);if(null!=b||null!=a){this.parentY=this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var d=this.graph.getCellGeometry(a);null!=d&&(this.parentX=d.x,this.parentY=d.y)}if(null!=b){for(var e=[],f=0;f<b.length;f++)(null!=a?c.isAncestor(a,
b[f]):1)&&c.isVertex(b[f])&&e.push(b[f]);this.roots=e}c.beginUpdate();try{this.run(a),this.resizeParent&&!this.graph.isCellCollapsed(a)&&this.graph.updateGroupBounds([a],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY&&(d=this.graph.getCellGeometry(a),null!=d&&(d=d.clone(),d.x=this.parentX,d.y=this.parentY,c.setGeometry(a,d)))}finally{c.endUpdate()}}};
mxHierarchicalLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){a=this.graph.model;var d=null,e=-1E5,f;for(f in b){var g=b[f];if(a.isVertex(g)&&this.graph.isCellVisible(g)){for(var k=this.getEdges(g),l=0,m=0,n=0;n<k.length;n++)this.getVisibleTerminal(k[n],!0)==g?l++:m++;0==m&&0<l&&c.push(g);k=l-m;k>e&&(e=k,d=g)}}0==c.length&&null!=d&&c.push(d)}return c};
mxHierarchicalLayout.prototype.getEdges=function(a){var b=this.edgesCache.get(a);if(null!=b)return b;var c=this.graph.model;b=[];for(var d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;f<e;f++){var g=c.getChildAt(a,f);if(this.isPort(g))b=b.concat(c.getEdges(g,!0,!0));else if(d||!this.graph.isCellVisible(g))b=b.concat(c.getEdges(g,!0,!0))}b=b.concat(c.getEdges(a,!0,!0));c=[];for(f=0;f<b.length;f++)d=this.getVisibleTerminal(b[f],!0),e=this.getVisibleTerminal(b[f],!1),(d==e||d!=e&&(e==a&&(null==
this.parent||this.isAncestor(this.parent,d,this.traverseAncestors))||d==a&&(null==this.parent||this.isAncestor(this.parent,e,this.traverseAncestors))))&&c.push(b[f]);this.edgesCache.put(a,c);return c};
mxHierarchicalLayout.prototype.getVisibleTerminal=function(a,b){var c=this.edgesTargetTermCache;b&&(c=this.edgeSourceTermCache);var d=c.get(a);if(null!=d)return d;d=this.graph.view.getState(a);var e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b);null==e&&(e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b));null!=e&&(this.isPort(e)&&(e=this.graph.model.getParent(e)),c.put(a,e));return e};
mxHierarchicalLayout.prototype.run=function(a){var b=[],c=[];if(null==this.roots&&null!=a){var d={};this.filterDescendants(a,d);this.roots=[];var e=!0,f;for(f in d)if(null!=d[f]){e=!1;break}for(;!e;){var g=this.findRoots(a,d);for(e=0;e<g.length;e++){var k={};b.push(k);this.traverse(g[e],!0,null,c,k,b,d)}for(e=0;e<g.length;e++)this.roots.push(g[e]);e=!0;for(f in d)if(null!=d[f]){e=!1;break}}}else for(e=0;e<this.roots.length;e++)k={},b.push(k),this.traverse(this.roots[e],!0,null,c,k,b,null);for(e=c=
0;e<b.length;e++){k=b[e];d=[];for(f in k)d.push(k[f]);this.model=new mxGraphHierarchyModel(this,d,this.roots,a,this.tightenToSource);this.cycleStage(a);this.layeringStage();this.crossingStage(a);c=this.placementStage(c,a)}};
mxHierarchicalLayout.prototype.filterDescendants=function(a,b){var c=this.graph.model;c.isVertex(a)&&a!=this.parent&&this.graph.isCellVisible(a)&&(b[mxObjectIdentity.get(a)]=a);if(this.traverseAncestors||a==this.parent&&this.graph.isCellVisible(a))for(var d=c.getChildCount(a),e=0;e<d;e++){var f=c.getChildAt(a,e);this.isPort(f)||this.filterDescendants(f,b)}};mxHierarchicalLayout.prototype.isPort=function(a){return null!=a&&null!=a.geometry?a.geometry.relative:!1};
mxHierarchicalLayout.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.getVisibleTerminal(d[f],!0),k=this.getVisibleTerminal(d[f],!1);(g==a&&k==b||!c&&g==b&&k==a)&&e.push(d[f])}return e};
mxHierarchicalLayout.prototype.traverse=function(a,b,c,d,e,f,g){if(null!=a&&null!=d){var k=mxObjectIdentity.get(a);if(null==d[k]&&(null==g||null!=g[k])){null==e[k]&&(e[k]=a);null==d[k]&&(d[k]=a);null!==g&&delete g[k];var l=this.getEdges(a);k=[];for(c=0;c<l.length;c++)k[c]=this.getVisibleTerminal(l[c],!0)==a;for(c=0;c<l.length;c++)if(!b||k[c]){a=this.getVisibleTerminal(l[c],!k[c]);for(var m=1,n=0;n<l.length;n++)if(n!=c){var p=k[n];this.getVisibleTerminal(l[n],!p)==a&&(p?m++:m--)}0<=m&&(e=this.traverse(a,
b,l[c],d,e,f,g))}}else if(null==e[k])for(c=0;c<f.length;c++)if(b=f[c],null!=b[k]){for(l in b)e[l]=b[l];f.splice(c,1);break}}return e};mxHierarchicalLayout.prototype.cycleStage=function(a){(new mxMinimumCycleRemover(this)).execute(a)};mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxHierarchicalLayout.prototype.crossingStage=function(a){(new mxMedianHybridCrossingReduction(this)).execute(a)};
mxHierarchicalLayout.prototype.placementStage=function(a,b){a=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,a,this.parallelEdgeSpacing);a.fineTuning=this.fineTuning;a.execute(b);return a.limitX+this.interHierarchySpacing};function mxSwimlaneLayout(a,b,c){mxGraphLayout.call(this,a);this.orientation=null!=b?b:mxConstants.DIRECTION_NORTH;this.deterministic=null!=c?c:!0}mxSwimlaneLayout.prototype=new mxGraphLayout;
mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout;mxSwimlaneLayout.prototype.roots=null;mxSwimlaneLayout.prototype.swimlanes=null;mxSwimlaneLayout.prototype.dummyVertexWidth=50;mxSwimlaneLayout.prototype.resizeParent=!1;mxSwimlaneLayout.prototype.maintainParentLocation=!1;mxSwimlaneLayout.prototype.moveParent=!1;mxSwimlaneLayout.prototype.parentBorder=30;mxSwimlaneLayout.prototype.intraCellSpacing=30;mxSwimlaneLayout.prototype.interRankCellSpacing=100;
mxSwimlaneLayout.prototype.interHierarchySpacing=60;mxSwimlaneLayout.prototype.parallelEdgeSpacing=10;mxSwimlaneLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxSwimlaneLayout.prototype.fineTuning=!0;mxSwimlaneLayout.prototype.tightenToSource=!0;mxSwimlaneLayout.prototype.disableEdgeStyle=!0;mxSwimlaneLayout.prototype.traverseAncestors=!0;mxSwimlaneLayout.prototype.model=null;mxSwimlaneLayout.prototype.edgesCache=null;mxHierarchicalLayout.prototype.edgeSourceTermCache=null;
mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxSwimlaneLayout.prototype.getModel=function(){return this.model};
mxSwimlaneLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;if(!(null==b||1>b.length)){null==a&&(a=c.getParent(b[0]));this.parentY=this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var d=this.graph.getCellGeometry(a);null!=d&&(this.parentX=d.x,this.parentY=d.y)}this.swimlanes=b;for(var e=[],f=0;f<b.length;f++){var g=this.graph.getChildCells(b[f]);
if(null==g||0==g.length)g=this.graph.insertVertex(b[f],null,null,0,0,this.dummyVertexWidth,0),e.push(g)}c.beginUpdate();try{this.run(a),this.resizeParent&&!this.graph.isCellCollapsed(a)&&this.graph.updateGroupBounds([a],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY&&(d=this.graph.getCellGeometry(a),null!=d&&(d=d.clone(),d.x=this.parentX,d.y=this.parentY,c.setGeometry(a,d))),this.graph.removeCells(e)}finally{c.endUpdate()}}};
mxSwimlaneLayout.prototype.updateGroupBounds=function(){var a=[],b=this.model;for(f in b.edgeMapper)for(var c=b.edgeMapper[f],d=0;d<c.edges.length;d++)a.push(c.edges[d]);a=this.graph.getBoundingBoxFromGeometry(a,!0);b=[];for(d=0;d<this.swimlanes.length;d++){var e=this.swimlanes[d],f=this.graph.getCellGeometry(e);if(null!=f){var g=this.graph.getChildCells(e);c=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;e=this.graph.getBoundingBoxFromGeometry(g);b[d]=e;c=e.y+f.y-c.height-this.parentBorder;
f=e.y+f.y+e.height;null==a?a=new mxRectangle(0,c,0,f-c):(a.y=Math.min(a.y,c),a.height=Math.max(a.y+a.height,f)-a.y)}}for(d=0;d<this.swimlanes.length;d++)if(e=this.swimlanes[d],f=this.graph.getCellGeometry(e),null!=f){g=this.graph.getChildCells(e);c=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;var k=f.clone(),l=c.width+(0==d?this.parentBorder:this.interRankCellSpacing/2),m=b[d].x-l,n=a.y-this.parentBorder;k.x+=m;k.y=n;k.width=b[d].width+l+this.interRankCellSpacing/2;k.height=
a.height+c.height+2*this.parentBorder;this.graph.model.setGeometry(e,k);this.graph.moveCells(g,-m,f.y-n)}};
mxSwimlaneLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){var d=this.graph.model,e=null,f=-1E5,g;for(g in b){var k=b[g];if(null!=k&&d.isVertex(k)&&this.graph.isCellVisible(k)&&d.isAncestor(a,k)){for(var l=this.getEdges(k),m=0,n=0,p=0;p<l.length;p++){var r=this.getVisibleTerminal(l[p],!0);r==k?(r=this.getVisibleTerminal(l[p],!1),d.isAncestor(a,r)&&m++):d.isAncestor(a,r)&&n++}0==n&&0<m&&c.push(k);l=m-n;l>f&&(f=l,e=k)}}0==c.length&&null!=e&&c.push(e)}return c};
mxSwimlaneLayout.prototype.getEdges=function(a){var b=this.edgesCache.get(a);if(null!=b)return b;var c=this.graph.model;b=[];for(var d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;f<e;f++){var g=c.getChildAt(a,f);if(this.isPort(g))b=b.concat(c.getEdges(g,!0,!0));else if(d||!this.graph.isCellVisible(g))b=b.concat(c.getEdges(g,!0,!0))}b=b.concat(c.getEdges(a,!0,!0));c=[];for(f=0;f<b.length;f++)d=this.getVisibleTerminal(b[f],!0),e=this.getVisibleTerminal(b[f],!1),(d==e||d!=e&&(e==a&&(null==
this.parent||this.graph.isValidAncestor(d,this.parent,this.traverseAncestors))||d==a&&(null==this.parent||this.graph.isValidAncestor(e,this.parent,this.traverseAncestors))))&&c.push(b[f]);this.edgesCache.put(a,c);return c};
mxSwimlaneLayout.prototype.getVisibleTerminal=function(a,b){var c=this.edgesTargetTermCache;b&&(c=this.edgeSourceTermCache);var d=c.get(a);if(null!=d)return d;d=this.graph.view.getState(a);var e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b);null==e&&(e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b));null!=e&&(this.isPort(e)&&(e=this.graph.model.getParent(e)),c.put(a,e));return e};
mxSwimlaneLayout.prototype.run=function(a){var b=[],c={};if(null!=this.swimlanes&&0<this.swimlanes.length&&null!=a){for(var d={},e=0;e<this.swimlanes.length;e++)this.filterDescendants(this.swimlanes[e],d);this.roots=[];e=!0;for(var f in d)if(null!=d[f]){e=!1;break}for(var g=0;!e&&g<this.swimlanes.length;){var k=this.findRoots(this.swimlanes[g],d);if(0==k.length)g++;else{for(e=0;e<k.length;e++){var l={};b.push(l);this.traverse(k[e],!0,null,c,l,b,d,g)}for(e=0;e<k.length;e++)this.roots.push(k[e]);e=
!0;for(f in d)if(null!=d[f]){e=!1;break}}}}else for(e=0;e<this.roots.length;e++)l={},b.push(l),this.traverse(this.roots[e],!0,null,c,l,b,null);b=[];for(f in c)b.push(c[f]);this.model=new mxSwimlaneModel(this,b,this.roots,a,this.tightenToSource);this.cycleStage(a);this.layeringStage();this.crossingStage(a);this.placementStage(0,a)};
mxSwimlaneLayout.prototype.filterDescendants=function(a,b){var c=this.graph.model;c.isVertex(a)&&a!=this.parent&&c.getParent(a)!=this.parent&&this.graph.isCellVisible(a)&&(b[mxObjectIdentity.get(a)]=a);if(this.traverseAncestors||a==this.parent&&this.graph.isCellVisible(a))for(var d=c.getChildCount(a),e=0;e<d;e++){var f=c.getChildAt(a,e);this.isPort(f)||this.filterDescendants(f,b)}};mxSwimlaneLayout.prototype.isPort=function(a){return a.geometry.relative?!0:!1};
mxSwimlaneLayout.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.getVisibleTerminal(d[f],!0),k=this.getVisibleTerminal(d[f],!1);(g==a&&k==b||!c&&g==b&&k==a)&&e.push(d[f])}return e};
mxSwimlaneLayout.prototype.traverse=function(a,b,c,d,e,f,g,k){if(null!=a&&null!=d){var l=mxObjectIdentity.get(a);if(null==d[l]&&(null==g||null!=g[l])){null==e[l]&&(e[l]=a);null==d[l]&&(d[l]=a);null!==g&&delete g[l];var m=this.getEdges(a);l=this.graph.model;for(c=0;c<m.length;c++){var n=this.getVisibleTerminal(m[c],!0),p=n==a;p&&(n=this.getVisibleTerminal(m[c],!1));for(var r=0;r<this.swimlanes.length&&!l.isAncestor(this.swimlanes[r],n);)r++;r>=this.swimlanes.length||!(r>k||(!b||p)&&r==k)||(e=this.traverse(n,
b,m[c],d,e,f,g,r))}}else if(null==e[l])for(c=0;c<f.length;c++)if(a=f[c],null!=a[l]){for(m in a)e[m]=a[m];f.splice(c,1);break}}return e};mxSwimlaneLayout.prototype.cycleStage=function(a){(new mxSwimlaneOrdering(this)).execute(a)};mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxSwimlaneLayout.prototype.crossingStage=function(a){(new mxMedianHybridCrossingReduction(this)).execute(a)};
mxSwimlaneLayout.prototype.placementStage=function(a,b){a=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,a,this.parallelEdgeSpacing);a.fineTuning=this.fineTuning;a.execute(b);return a.limitX+this.interHierarchySpacing};function mxGraphModel(a){this.currentEdit=this.createUndoableEdit();null!=a?this.setRoot(a):this.clear()}mxGraphModel.prototype=new mxEventSource;mxGraphModel.prototype.constructor=mxGraphModel;mxGraphModel.prototype.root=null;
mxGraphModel.prototype.cells=null;mxGraphModel.prototype.maintainEdgeParent=!0;mxGraphModel.prototype.ignoreRelativeEdgeParent=!0;mxGraphModel.prototype.createIds=!0;mxGraphModel.prototype.prefix="";mxGraphModel.prototype.postfix="";mxGraphModel.prototype.nextId=0;mxGraphModel.prototype.currentEdit=null;mxGraphModel.prototype.updateLevel=0;mxGraphModel.prototype.endingUpdate=!1;mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())};mxGraphModel.prototype.isCreateIds=function(){return this.createIds};
mxGraphModel.prototype.setCreateIds=function(a){this.createIds=a};mxGraphModel.prototype.createRoot=function(){var a=new mxCell;a.insert(new mxCell);return a};mxGraphModel.prototype.getCell=function(a){return null!=this.cells?this.cells[a]:null};mxGraphModel.prototype.filterCells=function(a,b){var c=null;if(null!=a){c=[];for(var d=0;d<a.length;d++)b(a[d])&&c.push(a[d])}return c};mxGraphModel.prototype.getDescendants=function(a){return this.filterDescendants(null,a)};
mxGraphModel.prototype.filterDescendants=function(a,b){var c=[];b=b||this.getRoot();(null==a||a(b))&&c.push(b);for(var d=this.getChildCount(b),e=0;e<d;e++){var f=this.getChildAt(b,e);c=c.concat(this.filterDescendants(a,f))}return c};mxGraphModel.prototype.getRoot=function(a){var b=a||this.root;if(null!=a)for(;null!=a;)b=a,a=this.getParent(a);return b};mxGraphModel.prototype.setRoot=function(a){this.execute(new mxRootChange(this,a));return a};
mxGraphModel.prototype.rootChanged=function(a){var b=this.root;this.root=a;this.nextId=0;this.cells=null;this.cellAdded(a);return b};mxGraphModel.prototype.isRoot=function(a){return null!=a&&this.root==a};mxGraphModel.prototype.isLayer=function(a){return this.isRoot(this.getParent(a))};mxGraphModel.prototype.isAncestor=function(a,b){for(;null!=b&&b!=a;)b=this.getParent(b);return b==a};mxGraphModel.prototype.contains=function(a){return this.isAncestor(this.root,a)};
mxGraphModel.prototype.getParent=function(a){return null!=a?a.getParent():null};mxGraphModel.prototype.add=function(a,b,c){if(b!=a&&null!=a&&null!=b){null==c&&(c=this.getChildCount(a));var d=a!=this.getParent(b);this.execute(new mxChildChange(this,a,b,c));this.maintainEdgeParent&&d&&this.updateEdgeParents(b)}return b};
mxGraphModel.prototype.cellAdded=function(a){if(null!=a){null==a.getId()&&this.createIds&&a.setId(this.createId(a));if(null!=a.getId()){var b=this.getCell(a.getId());if(b!=a){for(;null!=b;)a.setId(this.createId(a)),b=this.getCell(a.getId());null==this.cells&&(this.cells={});this.cells[a.getId()]=a}}mxUtils.isNumeric(a.getId())&&(this.nextId=Math.max(this.nextId,a.getId()));b=this.getChildCount(a);for(var c=0;c<b;c++)this.cellAdded(this.getChildAt(a,c))}};
mxGraphModel.prototype.createId=function(a){a=this.nextId;this.nextId++;return this.prefix+a+this.postfix};mxGraphModel.prototype.updateEdgeParents=function(a,b){b=b||this.getRoot(a);for(var c=this.getChildCount(a),d=0;d<c;d++){var e=this.getChildAt(a,d);this.updateEdgeParents(e,b)}e=this.getEdgeCount(a);c=[];for(d=0;d<e;d++)c.push(this.getEdgeAt(a,d));for(d=0;d<c.length;d++)a=c[d],this.isAncestor(b,a)&&this.updateEdgeParent(a,b)};
mxGraphModel.prototype.updateEdgeParent=function(a,b){for(var c=this.getTerminal(a,!0),d=this.getTerminal(a,!1);null!=c&&!this.isEdge(c)&&null!=c.geometry&&c.geometry.relative;)c=this.getParent(c);for(;null!=d&&this.ignoreRelativeEdgeParent&&!this.isEdge(d)&&null!=d.geometry&&d.geometry.relative;)d=this.getParent(d);if(this.isAncestor(b,c)&&this.isAncestor(b,d)&&(b=c==d?this.getParent(c):this.getNearestCommonAncestor(c,d),null!=b&&(this.getParent(b)!=this.root||this.isAncestor(b,a))&&this.getParent(a)!=
b)){c=this.getGeometry(a);if(null!=c){var e=this.getOrigin(this.getParent(a)),f=this.getOrigin(b);d=f.x-e.x;e=f.y-e.y;c=c.clone();c.translate(-d,-e);this.setGeometry(a,c)}this.add(b,a,this.getChildCount(b))}};mxGraphModel.prototype.getOrigin=function(a){if(null!=a){var b=this.getOrigin(this.getParent(a));this.isEdge(a)||(a=this.getGeometry(a),null!=a&&(b.x+=a.x,b.y+=a.y))}else b=new mxPoint;return b};
mxGraphModel.prototype.getNearestCommonAncestor=function(a,b){if(null!=a&&null!=b){var c=mxCellPath.create(b);if(null!=c&&0<c.length){var d=mxCellPath.create(a);for(c.length<d.length&&(a=b,b=d,d=c,c=b);null!=a;){b=this.getParent(a);if(0==c.indexOf(d+mxCellPath.PATH_SEPARATOR)&&null!=b)return a;d=mxCellPath.getParentPath(d);a=b}}}return null};mxGraphModel.prototype.remove=function(a){a==this.root?this.setRoot(null):null!=this.getParent(a)&&this.execute(new mxChildChange(this,null,a));return a};
mxGraphModel.prototype.cellRemoved=function(a){if(null!=a&&null!=this.cells){for(var b=this.getChildCount(a)-1;0<=b;b--)this.cellRemoved(this.getChildAt(a,b));null!=this.cells&&null!=a.getId()&&delete this.cells[a.getId()]}};mxGraphModel.prototype.parentForCellChanged=function(a,b,c){var d=this.getParent(a);null!=b?b==d&&d.getIndex(a)==c||b.insert(a,c):null!=d&&(c=d.getIndex(a),d.remove(c));b=this.contains(b);c=this.contains(d);b&&!c?this.cellAdded(a):c&&!b&&this.cellRemoved(a);return d};
mxGraphModel.prototype.getChildCount=function(a){return null!=a?a.getChildCount():0};mxGraphModel.prototype.getChildAt=function(a,b){return null!=a?a.getChildAt(b):null};mxGraphModel.prototype.getChildren=function(a){return null!=a?a.children:null};mxGraphModel.prototype.getChildVertices=function(a){return this.getChildCells(a,!0,!1)};mxGraphModel.prototype.getChildEdges=function(a){return this.getChildCells(a,!1,!0)};
mxGraphModel.prototype.getChildCells=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;for(var d=this.getChildCount(a),e=[],f=0;f<d;f++){var g=this.getChildAt(a,f);(!c&&!b||c&&this.isEdge(g)||b&&this.isVertex(g))&&e.push(g)}return e};mxGraphModel.prototype.getTerminal=function(a,b){return null!=a?a.getTerminal(b):null};
mxGraphModel.prototype.setTerminal=function(a,b,c){var d=b!=this.getTerminal(a,c);this.execute(new mxTerminalChange(this,a,b,c));this.maintainEdgeParent&&d&&this.updateEdgeParent(a,this.getRoot());return b};mxGraphModel.prototype.setTerminals=function(a,b,c){this.beginUpdate();try{this.setTerminal(a,b,!0),this.setTerminal(a,c,!1)}finally{this.endUpdate()}};
mxGraphModel.prototype.terminalForCellChanged=function(a,b,c){var d=this.getTerminal(a,c);null!=b?b.insertEdge(a,c):null!=d&&d.removeEdge(a,c);return d};mxGraphModel.prototype.getEdgeCount=function(a){return null!=a?a.getEdgeCount():0};mxGraphModel.prototype.getEdgeAt=function(a,b){return null!=a?a.getEdgeAt(b):null};mxGraphModel.prototype.getDirectedEdgeCount=function(a,b,c){for(var d=0,e=this.getEdgeCount(a),f=0;f<e;f++){var g=this.getEdgeAt(a,f);g!=c&&this.getTerminal(g,b)==a&&d++}return d};
mxGraphModel.prototype.getConnections=function(a){return this.getEdges(a,!0,!0,!1)};mxGraphModel.prototype.getIncomingEdges=function(a){return this.getEdges(a,!0,!1,!1)};mxGraphModel.prototype.getOutgoingEdges=function(a){return this.getEdges(a,!1,!0,!1)};
mxGraphModel.prototype.getEdges=function(a,b,c,d){b=null!=b?b:!0;c=null!=c?c:!0;d=null!=d?d:!0;for(var e=this.getEdgeCount(a),f=[],g=0;g<e;g++){var k=this.getEdgeAt(a,g),l=this.getTerminal(k,!0),m=this.getTerminal(k,!1);(d&&l==m||l!=m&&(b&&m==a||c&&l==a))&&f.push(k)}return f};
mxGraphModel.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;var d=this.getEdgeCount(a),e=this.getEdgeCount(b),f=a,g=d;e<d&&(g=e,f=b);d=[];for(e=0;e<g;e++){var k=this.getEdgeAt(f,e),l=this.getTerminal(k,!0),m=this.getTerminal(k,!1),n=m==a&&l==b;(l==a&&m==b||!c&&n)&&d.push(k)}return d};
mxGraphModel.prototype.getOpposites=function(a,b,c,d){c=null!=c?c:!0;d=null!=d?d:!0;var e=[];if(null!=a)for(var f=0;f<a.length;f++){var g=this.getTerminal(a[f],!0),k=this.getTerminal(a[f],!1);g==b&&null!=k&&k!=b&&d?e.push(k):k==b&&null!=g&&g!=b&&c&&e.push(g)}return e};
mxGraphModel.prototype.getTopmostCells=function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.put(a[d],!0);for(d=0;d<a.length;d++){for(var e=a[d],f=!0,g=this.getParent(e);null!=g;){if(b.get(g)){f=!1;break}g=this.getParent(g)}f&&c.push(e)}return c};mxGraphModel.prototype.isVertex=function(a){return null!=a?a.isVertex():!1};mxGraphModel.prototype.isEdge=function(a){return null!=a?a.isEdge():!1};mxGraphModel.prototype.isConnectable=function(a){return null!=a?a.isConnectable():!1};
mxGraphModel.prototype.getValue=function(a){return null!=a?a.getValue():null};mxGraphModel.prototype.setValue=function(a,b){this.execute(new mxValueChange(this,a,b));return b};mxGraphModel.prototype.valueForCellChanged=function(a,b){return a.valueChanged(b)};mxGraphModel.prototype.getGeometry=function(a){return null!=a?a.getGeometry():null};mxGraphModel.prototype.setGeometry=function(a,b){b!=this.getGeometry(a)&&this.execute(new mxGeometryChange(this,a,b));return b};
mxGraphModel.prototype.geometryForCellChanged=function(a,b){var c=this.getGeometry(a);a.setGeometry(b);return c};mxGraphModel.prototype.getStyle=function(a){return null!=a?a.getStyle():null};mxGraphModel.prototype.setStyle=function(a,b){b!=this.getStyle(a)&&this.execute(new mxStyleChange(this,a,b));return b};mxGraphModel.prototype.styleForCellChanged=function(a,b){var c=this.getStyle(a);a.setStyle(b);return c};mxGraphModel.prototype.isCollapsed=function(a){return null!=a?a.isCollapsed():!1};
mxGraphModel.prototype.setCollapsed=function(a,b){b!=this.isCollapsed(a)&&this.execute(new mxCollapseChange(this,a,b));return b};mxGraphModel.prototype.collapsedStateForCellChanged=function(a,b){var c=this.isCollapsed(a);a.setCollapsed(b);return c};mxGraphModel.prototype.isVisible=function(a){return null!=a?a.isVisible():!1};mxGraphModel.prototype.setVisible=function(a,b){b!=this.isVisible(a)&&this.execute(new mxVisibleChange(this,a,b));return b};
mxGraphModel.prototype.visibleStateForCellChanged=function(a,b){var c=this.isVisible(a);a.setVisible(b);return c};mxGraphModel.prototype.execute=function(a){a.execute();this.beginUpdate();this.currentEdit.add(a);this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",a));this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",a));this.endUpdate()};mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++;this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE));1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))};
mxGraphModel.prototype.endUpdate=function(){this.updateLevel--;0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT));if(!this.endingUpdate){this.endingUpdate=0==this.updateLevel;this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var a=this.currentEdit;this.currentEdit=this.createUndoableEdit();a.notify();this.fireEvent(new mxEventObject(mxEvent.UNDO,
"edit",a))}}finally{this.endingUpdate=!1}}};mxGraphModel.prototype.createUndoableEdit=function(a){var b=new mxUndoableEdit(this,null!=a?a:!0);b.notify=function(){b.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",b,"changes",b.changes));b.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",b,"changes",b.changes))};return b};
mxGraphModel.prototype.mergeChildren=function(a,b,c){c=null!=c?c:!0;this.beginUpdate();try{var d={};this.mergeChildrenImpl(a,b,c,d);for(var e in d){var f=d[e],g=this.getTerminal(f,!0);null!=g&&(g=d[mxCellPath.create(g)],this.setTerminal(f,g,!0));g=this.getTerminal(f,!1);null!=g&&(g=d[mxCellPath.create(g)],this.setTerminal(f,g,!1))}}finally{this.endUpdate()}};
mxGraphModel.prototype.mergeChildrenImpl=function(a,b,c,d){this.beginUpdate();try{for(var e=a.getChildCount(),f=0;f<e;f++){var g=a.getChildAt(f);if("function"==typeof g.getId){var k=g.getId(),l=null==k||this.isEdge(g)&&c?null:this.getCell(k);if(null==l){var m=g.clone();m.setId(k);m.setTerminal(g.getTerminal(!0),!0);m.setTerminal(g.getTerminal(!1),!1);l=b.insert(m);this.cellAdded(l)}d[mxCellPath.create(g)]=l;this.mergeChildrenImpl(g,l,c,d)}}}finally{this.endUpdate()}};
mxGraphModel.prototype.getParents=function(a){var b=[];if(null!=a)for(var c=new mxDictionary,d=0;d<a.length;d++){var e=this.getParent(a[d]);null==e||c.get(e)||(c.put(e,!0),b.push(e))}return b};mxGraphModel.prototype.cloneCell=function(a,b,c){return null!=a?this.cloneCells([a],b,null,c)[0]:null};
mxGraphModel.prototype.cloneCells=function(a,b,c,d){b=null!=b?b:!0;c=null!=c?c:{};d=null!=d?d:!1;for(var e=[],f=0;f<a.length;f++)null!=a[f]?e.push(this.cloneCellImpl(a[f],c,b,d)):e.push(null);for(f=0;f<e.length;f++)null!=e[f]&&this.restoreClone(e[f],a[f],c);return e};
mxGraphModel.prototype.cloneCellImpl=function(a,b,c,d){var e=mxObjectIdentity.get(a),f=b[e];if(null==f&&(f=this.cellCloned(a),b[e]=f,d&&(f.id=a.id),c))for(c=this.getChildCount(a),e=0;e<c;e++){var g=this.cloneCellImpl(this.getChildAt(a,e),b,!0,d);f.insert(g)}return f};mxGraphModel.prototype.cellCloned=function(a){return a.clone()};
mxGraphModel.prototype.restoreClone=function(a,b,c){var d=this.getTerminal(b,!0);null!=d&&(d=c[mxObjectIdentity.get(d)],null!=d&&d.insertEdge(a,!0));d=this.getTerminal(b,!1);null!=d&&(d=c[mxObjectIdentity.get(d)],null!=d&&d.insertEdge(a,!1));d=this.getChildCount(a);for(var e=0;e<d;e++)this.restoreClone(this.getChildAt(a,e),this.getChildAt(b,e),c)};function mxRootChange(a,b){this.model=a;this.previous=this.root=b}mxRootChange.prototype.execute=function(){this.root=this.previous;this.previous=this.model.rootChanged(this.previous)};
function mxChildChange(a,b,c,d){this.model=a;this.previous=this.parent=b;this.child=c;this.previousIndex=this.index=d}
mxChildChange.prototype.execute=function(){if(null!=this.child){var a=this.model.getParent(this.child),b=null!=a?a.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1);a=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex);null!=this.previous&&this.connect(this.child,!0);this.parent=this.previous;this.previous=a;this.index=this.previousIndex;this.previousIndex=b}};
mxChildChange.prototype.connect=function(a,b){b=null!=b?b:!0;var c=a.getTerminal(!0),d=a.getTerminal(!1);null!=c&&(b?this.model.terminalForCellChanged(a,c,!0):this.model.terminalForCellChanged(a,null,!0));null!=d&&(b?this.model.terminalForCellChanged(a,d,!1):this.model.terminalForCellChanged(a,null,!1));a.setTerminal(c,!0);a.setTerminal(d,!1);c=this.model.getChildCount(a);for(d=0;d<c;d++)this.connect(this.model.getChildAt(a,d),b)};
function mxTerminalChange(a,b,c,d){this.model=a;this.cell=b;this.previous=this.terminal=c;this.source=d}mxTerminalChange.prototype.execute=function(){null!=this.cell&&(this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source))};function mxValueChange(a,b,c){this.model=a;this.cell=b;this.previous=this.value=c}
mxValueChange.prototype.execute=function(){null!=this.cell&&(this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous))};function mxStyleChange(a,b,c){this.model=a;this.cell=b;this.previous=this.style=c}mxStyleChange.prototype.execute=function(){null!=this.cell&&(this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous))};function mxGeometryChange(a,b,c){this.model=a;this.cell=b;this.previous=this.geometry=c}
mxGeometryChange.prototype.execute=function(){null!=this.cell&&(this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous))};function mxCollapseChange(a,b,c){this.model=a;this.cell=b;this.previous=this.collapsed=c}mxCollapseChange.prototype.execute=function(){null!=this.cell&&(this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous))};
function mxVisibleChange(a,b,c){this.model=a;this.cell=b;this.previous=this.visible=c}mxVisibleChange.prototype.execute=function(){null!=this.cell&&(this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous))};function mxCellAttributeChange(a,b,c){this.cell=a;this.attribute=b;this.previous=this.value=c}
mxCellAttributeChange.prototype.execute=function(){if(null!=this.cell){var a=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous);this.previous=a}};function mxCell(a,b,c){this.value=a;this.setGeometry(b);this.setStyle(c);if(null!=this.onInit)this.onInit()}mxCell.prototype.id=null;mxCell.prototype.value=null;mxCell.prototype.geometry=null;mxCell.prototype.style=null;mxCell.prototype.vertex=!1;
mxCell.prototype.edge=!1;mxCell.prototype.connectable=!0;mxCell.prototype.visible=!0;mxCell.prototype.collapsed=!1;mxCell.prototype.parent=null;mxCell.prototype.source=null;mxCell.prototype.target=null;mxCell.prototype.children=null;mxCell.prototype.edges=null;mxCell.prototype.mxTransient="id value parent source target children edges".split(" ");mxCell.prototype.getId=function(){return this.id};mxCell.prototype.setId=function(a){this.id=a};mxCell.prototype.getValue=function(){return this.value};
mxCell.prototype.setValue=function(a){this.value=a};mxCell.prototype.valueChanged=function(a){var b=this.getValue();this.setValue(a);return b};mxCell.prototype.getGeometry=function(){return this.geometry};mxCell.prototype.setGeometry=function(a){this.geometry=a};mxCell.prototype.getStyle=function(){return this.style};mxCell.prototype.setStyle=function(a){this.style=a};mxCell.prototype.isVertex=function(){return 0!=this.vertex};mxCell.prototype.setVertex=function(a){this.vertex=a};
mxCell.prototype.isEdge=function(){return 0!=this.edge};mxCell.prototype.setEdge=function(a){this.edge=a};mxCell.prototype.isConnectable=function(){return 0!=this.connectable};mxCell.prototype.setConnectable=function(a){this.connectable=a};mxCell.prototype.isVisible=function(){return 0!=this.visible};mxCell.prototype.setVisible=function(a){this.visible=a};mxCell.prototype.isCollapsed=function(){return 0!=this.collapsed};mxCell.prototype.setCollapsed=function(a){this.collapsed=a};
mxCell.prototype.getParent=function(){return this.parent};mxCell.prototype.setParent=function(a){this.parent=a};mxCell.prototype.getTerminal=function(a){return a?this.source:this.target};mxCell.prototype.setTerminal=function(a,b){b?this.source=a:this.target=a;return a};mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length};mxCell.prototype.getIndex=function(a){return mxUtils.indexOf(this.children,a)};
mxCell.prototype.getChildAt=function(a){return null==this.children?null:this.children[a]};mxCell.prototype.insert=function(a,b){null!=a&&(null==b&&(b=this.getChildCount(),a.getParent()==this&&b--),a.removeFromParent(),a.setParent(this),null==this.children?(this.children=[],this.children.push(a)):this.children.splice(b,0,a));return a};mxCell.prototype.remove=function(a){var b=null;null!=this.children&&0<=a&&(b=this.getChildAt(a),null!=b&&(this.children.splice(a,1),b.setParent(null)));return b};
mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var a=this.parent.getIndex(this);this.parent.remove(a)}};mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length};mxCell.prototype.getEdgeIndex=function(a){return mxUtils.indexOf(this.edges,a)};mxCell.prototype.getEdgeAt=function(a){return null==this.edges?null:this.edges[a]};
mxCell.prototype.insertEdge=function(a,b){null!=a&&(a.removeFromTerminal(b),a.setTerminal(this,b),null==this.edges||a.getTerminal(!b)!=this||0>mxUtils.indexOf(this.edges,a))&&(null==this.edges&&(this.edges=[]),this.edges.push(a));return a};mxCell.prototype.removeEdge=function(a,b){if(null!=a){if(a.getTerminal(!b)!=this&&null!=this.edges){var c=this.getEdgeIndex(a);0<=c&&this.edges.splice(c,1)}a.setTerminal(null,b)}return a};
mxCell.prototype.removeFromTerminal=function(a){var b=this.getTerminal(a);null!=b&&b.removeEdge(this,a)};mxCell.prototype.hasAttribute=function(a){var b=this.getValue();return null!=b&&b.nodeType==mxConstants.NODETYPE_ELEMENT&&b.hasAttribute?b.hasAttribute(a):null!=b.getAttribute(a)};mxCell.prototype.getAttribute=function(a,b){var c=this.getValue();a=null!=c&&c.nodeType==mxConstants.NODETYPE_ELEMENT?c.getAttribute(a):null;return null!=a?a:b};
mxCell.prototype.setAttribute=function(a,b){var c=this.getValue();null!=c&&c.nodeType==mxConstants.NODETYPE_ELEMENT&&c.setAttribute(a,b)};mxCell.prototype.clone=function(){var a=mxUtils.clone(this,this.mxTransient);a.setValue(this.cloneValue());return a};mxCell.prototype.cloneValue=function(a){a=null!=a?a:this.getValue();null!=a&&("function"==typeof a.clone?a=a.clone():isNaN(a.nodeType)||(a=a.cloneNode(!0)));return a};function mxGeometry(a,b,c,d){mxRectangle.call(this,a,b,c,d)}
mxGeometry.prototype=new mxRectangle;mxGeometry.prototype.constructor=mxGeometry;mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0;mxGeometry.prototype.alternateBounds=null;mxGeometry.prototype.sourcePoint=null;mxGeometry.prototype.targetPoint=null;mxGeometry.prototype.points=null;mxGeometry.prototype.offset=null;mxGeometry.prototype.relative=!1;
mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var a=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x;this.y=this.alternateBounds.y;this.width=this.alternateBounds.width;this.height=this.alternateBounds.height;this.alternateBounds=a}};mxGeometry.prototype.getTerminalPoint=function(a){return a?this.sourcePoint:this.targetPoint};mxGeometry.prototype.setTerminalPoint=function(a,b){b?this.sourcePoint=a:this.targetPoint=a;return a};
mxGeometry.prototype.rotate=function(a,b){var c=mxUtils.toRadians(a);a=Math.cos(c);c=Math.sin(c);if(!this.relative){var d=new mxPoint(this.getCenterX(),this.getCenterY());d=mxUtils.getRotatedPoint(d,a,c,b);this.x=Math.round(d.x-this.width/2);this.y=Math.round(d.y-this.height/2)}null!=this.sourcePoint&&(d=mxUtils.getRotatedPoint(this.sourcePoint,a,c,b),this.sourcePoint.x=Math.round(d.x),this.sourcePoint.y=Math.round(d.y));null!=this.targetPoint&&(d=mxUtils.getRotatedPoint(this.targetPoint,a,c,b),this.targetPoint.x=
Math.round(d.x),this.targetPoint.y=Math.round(d.y));if(null!=this.points)for(var e=0;e<this.points.length;e++)null!=this.points[e]&&(d=mxUtils.getRotatedPoint(this.points[e],a,c,b),this.points[e].x=Math.round(d.x),this.points[e].y=Math.round(d.y))};
mxGeometry.prototype.translate=function(a,b){a=parseFloat(a);b=parseFloat(b);this.relative||(this.x=parseFloat(this.x)+a,this.y=parseFloat(this.y)+b);null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)+a,this.sourcePoint.y=parseFloat(this.sourcePoint.y)+b);null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)+a,this.targetPoint.y=parseFloat(this.targetPoint.y)+b);if(this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var c=0;c<this.points.length;c++)null!=
this.points[c]&&(this.points[c].x=parseFloat(this.points[c].x)+a,this.points[c].y=parseFloat(this.points[c].y)+b)};
mxGeometry.prototype.scale=function(a,b,c){a=parseFloat(a);b=parseFloat(b);null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)*a,this.sourcePoint.y=parseFloat(this.sourcePoint.y)*b);null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)*a,this.targetPoint.y=parseFloat(this.targetPoint.y)*b);if(null!=this.points)for(var d=0;d<this.points.length;d++)null!=this.points[d]&&(this.points[d].x=parseFloat(this.points[d].x)*a,this.points[d].y=parseFloat(this.points[d].y)*
b);this.relative||(this.x=parseFloat(this.x)*a,this.y=parseFloat(this.y)*b,c&&(b=a=Math.min(a,b)),this.width=parseFloat(this.width)*a,this.height=parseFloat(this.height)*b)};
mxGeometry.prototype.equals=function(a){return mxRectangle.prototype.equals.apply(this,arguments)&&this.relative==a.relative&&(null==this.sourcePoint&&null==a.sourcePoint||null!=this.sourcePoint&&this.sourcePoint.equals(a.sourcePoint))&&(null==this.targetPoint&&null==a.targetPoint||null!=this.targetPoint&&this.targetPoint.equals(a.targetPoint))&&(null==this.points&&null==a.points||null!=this.points&&mxUtils.equalPoints(this.points,a.points))&&(null==this.alternateBounds&&null==a.alternateBounds||
null!=this.alternateBounds&&this.alternateBounds.equals(a.alternateBounds))&&(null==this.offset&&null==a.offset||null!=this.offset&&this.offset.equals(a.offset))};
var mxCellPath={PATH_SEPARATOR:".",create:function(a){var b="";if(null!=a)for(var c=a.getParent();null!=c;)b=c.getIndex(a)+mxCellPath.PATH_SEPARATOR+b,a=c,c=a.getParent();a=b.length;1<a&&(b=b.substring(0,a-1));return b},getParentPath:function(a){if(null!=a){var b=a.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=b)return a.substring(0,b);if(0<a.length)return""}return null},resolve:function(a,b){if(null!=b){b=b.split(mxCellPath.PATH_SEPARATOR);for(var c=0;c<b.length;c++)a=a.getChildAt(parseInt(b[c]))}return a},
compare:function(a,b){for(var c=Math.min(a.length,b.length),d=0,e=0;e<c;e++)if(a[e]!=b[e]){0==a[e].length||0==b[e].length?d=a[e]==b[e]?0:a[e]>b[e]?1:-1:(c=parseInt(a[e]),e=parseInt(b[e]),d=c==e?0:c>e?1:-1);break}0==d&&(c=a.length,e=b.length,c!=e&&(d=c>e?1:-1));return d}},mxPerimeter={RectanglePerimeter:function(a,b,c,d){b=a.getCenterX();var e=a.getCenterY(),f=Math.atan2(c.y-e,c.x-b),g=new mxPoint(0,0),k=Math.PI,l=Math.PI/2-f,m=Math.atan2(a.height,a.width);f<-k+m||f>k-m?(g.x=a.x,g.y=e-a.width*Math.tan(f)/
2):f<-m?(g.y=a.y,g.x=b-a.height*Math.tan(l)/2):f<m?(g.x=a.x+a.width,g.y=e+a.width*Math.tan(f)/2):(g.y=a.y+a.height,g.x=b+a.height*Math.tan(l)/2);d&&(c.x>=a.x&&c.x<=a.x+a.width?g.x=c.x:c.y>=a.y&&c.y<=a.y+a.height&&(g.y=c.y),c.x<a.x?g.x=a.x:c.x>a.x+a.width&&(g.x=a.x+a.width),c.y<a.y?g.y=a.y:c.y>a.y+a.height&&(g.y=a.y+a.height));return g},EllipsePerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width/2,k=a.height/2,l=e+g,m=f+k;b=c.x;c=c.y;var n=parseInt(b-l),p=parseInt(c-m);if(0==n&&0!=p)return new mxPoint(l,
m+k*p/Math.abs(p));if(0==n&&0==p)return new mxPoint(b,c);if(d){if(c>=f&&c<=f+a.height)return a=c-m,a=Math.sqrt(g*g*(1-a*a/(k*k)))||0,b<=e&&(a=-a),new mxPoint(l+a,c);if(b>=e&&b<=e+a.width)return a=b-l,a=Math.sqrt(k*k*(1-a*a/(g*g)))||0,c<=f&&(a=-a),new mxPoint(b,m+a)}e=p/n;m-=e*l;f=g*g*e*e+k*k;a=-2*l*f;k=Math.sqrt(a*a-4*f*(g*g*e*e*l*l+k*k*l*l-g*g*k*k));g=(-a+k)/(2*f);l=(-a-k)/(2*f);k=e*g+m;m=e*l+m;Math.sqrt(Math.pow(g-b,2)+Math.pow(k-c,2))<Math.sqrt(Math.pow(l-b,2)+Math.pow(m-c,2))?(b=g,c=k):(b=l,c=
m);return new mxPoint(b,c)},RhombusPerimeter:function(a,b,c,d){b=a.x;var e=a.y,f=a.width;a=a.height;var g=b+f/2,k=e+a/2,l=c.x;c=c.y;if(g==l)return k>c?new mxPoint(g,e):new mxPoint(g,e+a);if(k==c)return g>l?new mxPoint(b,k):new mxPoint(b+f,k);var m=g,n=k;d&&(l>=b&&l<=b+f?m=l:c>=e&&c<=e+a&&(n=c));return l<g?c<k?mxUtils.intersection(l,c,m,n,g,e,b,k):mxUtils.intersection(l,c,m,n,g,e+a,b,k):c<k?mxUtils.intersection(l,c,m,n,g,e,b+f,k):mxUtils.intersection(l,c,m,n,g,e+a,b+f,k)},TrianglePerimeter:function(a,
b,c,d){b=null!=b?b.style[mxConstants.STYLE_DIRECTION]:null;var e=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH,f=a.x,g=a.y,k=a.width,l=a.height;a=f+k/2;var m=g+l/2,n=new mxPoint(f,g),p=new mxPoint(f+k,m),r=new mxPoint(f,g+l);b==mxConstants.DIRECTION_NORTH?(n=r,p=new mxPoint(a,g),r=new mxPoint(f+k,g+l)):b==mxConstants.DIRECTION_SOUTH?(p=new mxPoint(a,g+l),r=new mxPoint(f+k,g)):b==mxConstants.DIRECTION_WEST&&(n=new mxPoint(f+k,g),p=new mxPoint(f,m),r=new mxPoint(f+k,g+l));var q=c.x-
a,t=c.y-m;q=e?Math.atan2(q,t):Math.atan2(t,q);t=e?Math.atan2(k,l):Math.atan2(l,k);(b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?q>-t&&q<t:q<-Math.PI+t||q>Math.PI-t)?c=d&&(e&&c.x>=n.x&&c.x<=r.x||!e&&c.y>=n.y&&c.y<=r.y)?e?new mxPoint(c.x,n.y):new mxPoint(n.x,c.y):b==mxConstants.DIRECTION_NORTH?new mxPoint(f+k/2+l*Math.tan(q)/2,g+l):b==mxConstants.DIRECTION_SOUTH?new mxPoint(f+k/2-l*Math.tan(q)/2,g):b==mxConstants.DIRECTION_WEST?new mxPoint(f+k,g+l/2+k*Math.tan(q)/2):new mxPoint(f,g+
l/2-k*Math.tan(q)/2):(d&&(d=new mxPoint(a,m),c.y>=g&&c.y<=g+l?(d.x=e?a:b==mxConstants.DIRECTION_WEST?f+k:f,d.y=c.y):c.x>=f&&c.x<=f+k&&(d.x=c.x,d.y=e?b==mxConstants.DIRECTION_NORTH?g+l:g:m),a=d.x,m=d.y),c=e&&c.x<=f+k/2||!e&&c.y<=g+l/2?mxUtils.intersection(c.x,c.y,a,m,n.x,n.y,p.x,p.y):mxUtils.intersection(c.x,c.y,a,m,p.x,p.y,r.x,r.y));null==c&&(c=new mxPoint(a,m));return c},HexagonPerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width,k=a.height,l=a.getCenterX();a=a.getCenterY();var m=c.x,n=c.y,p=-Math.atan2(n-
a,m-l),r=Math.PI,q=Math.PI/2;new mxPoint(l,a);b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var t=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH;b=new mxPoint;var u=new mxPoint;if(m<e&&n<f||m<e&&n>f+k||m>e+g&&n<f||m>e+g&&n>f+k)d=!1;if(d){if(t){if(m==l){if(n<=f)return new mxPoint(l,f);if(n>=f+k)return new mxPoint(l,f+k)}else if(m<e){if(n==f+k/4)return new mxPoint(e,f+k/4);if(n==f+3*k/4)return new mxPoint(e,f+3*
k/4)}else if(m>e+g){if(n==f+k/4)return new mxPoint(e+g,f+k/4);if(n==f+3*k/4)return new mxPoint(e+g,f+3*k/4)}else if(m==e){if(n<a)return new mxPoint(e,f+k/4);if(n>a)return new mxPoint(e,f+3*k/4)}else if(m==e+g){if(n<a)return new mxPoint(e+g,f+k/4);if(n>a)return new mxPoint(e+g,f+3*k/4)}if(n==f)return new mxPoint(l,f);if(n==f+k)return new mxPoint(l,f+k);m<l?n>f+k/4&&n<f+3*k/4?(b=new mxPoint(e,f),u=new mxPoint(e,f+k)):n<f+k/4?(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f-
Math.floor(.25*k))):n>f+3*k/4&&(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f+Math.floor(1.25*k))):m>l&&(n>f+k/4&&n<f+3*k/4?(b=new mxPoint(e+g,f),u=new mxPoint(e+g,f+k)):n<f+k/4?(b=new mxPoint(e,f-Math.floor(.25*k)),u=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k))):n>f+3*k/4&&(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k)),u=new mxPoint(e,f+Math.floor(1.25*k))))}else{if(n==a){if(m<=e)return new mxPoint(e,f+k/2);if(m>=e+g)return new mxPoint(e+g,f+k/2)}else if(n<
f){if(m==e+g/4)return new mxPoint(e+g/4,f);if(m==e+3*g/4)return new mxPoint(e+3*g/4,f)}else if(n>f+k){if(m==e+g/4)return new mxPoint(e+g/4,f+k);if(m==e+3*g/4)return new mxPoint(e+3*g/4,f+k)}else if(n==f){if(m<l)return new mxPoint(e+g/4,f);if(m>l)return new mxPoint(e+3*g/4,f)}else if(n==f+k){if(m<l)return new mxPoint(e+g/4,f+k);if(n>a)return new mxPoint(e+3*g/4,f+k)}if(m==e)return new mxPoint(e,a);if(m==e+g)return new mxPoint(e+g,a);n<a?m>e+g/4&&m<e+3*g/4?(b=new mxPoint(e,f),u=new mxPoint(e+g,f)):
m<e+g/4?(b=new mxPoint(e-Math.floor(.25*g),f+k),u=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k))):m>e+3*g/4&&(b=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f+k)):n>a&&(m>e+g/4&&m<e+3*g/4?(b=new mxPoint(e,f+k),u=new mxPoint(e+g,f+k)):m<e+g/4?(b=new mxPoint(e-Math.floor(.25*g),f),u=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k))):m>e+3*g/4&&(b=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f)))}d=l;p=a;m>=e&&m<=
e+g?(d=m,p=n<a?f+k:f):n>=f&&n<=f+k&&(p=n,d=m<l?e+g:e);c=mxUtils.intersection(d,p,c.x,c.y,b.x,b.y,u.x,u.y)}else{if(t){m=Math.atan2(k/4,g/2);if(p==m)return new mxPoint(e+g,f+Math.floor(.25*k));if(p==q)return new mxPoint(e+Math.floor(.5*g),f);if(p==r-m)return new mxPoint(e,f+Math.floor(.25*k));if(p==-m)return new mxPoint(e+g,f+Math.floor(.75*k));if(p==-q)return new mxPoint(e+Math.floor(.5*g),f+k);if(p==-r+m)return new mxPoint(e,f+Math.floor(.75*k));p<m&&p>-m?(b=new mxPoint(e+g,f),u=new mxPoint(e+g,f+
k)):p>m&&p<q?(b=new mxPoint(e,f-Math.floor(.25*k)),u=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k))):p>q&&p<r-m?(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f-Math.floor(.25*k))):p>r-m&&p<=r||p<-r+m&&p>=-r?(b=new mxPoint(e,f),u=new mxPoint(e,f+k)):p<-m&&p>-q?(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k)),u=new mxPoint(e,f+Math.floor(1.25*k))):p<-q&&p>-r+m&&(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f+Math.floor(1.25*k)))}else{m=
Math.atan2(k/2,g/4);if(p==m)return new mxPoint(e+Math.floor(.75*g),f);if(p==r-m)return new mxPoint(e+Math.floor(.25*g),f);if(p==r||p==-r)return new mxPoint(e,f+Math.floor(.5*k));if(0==p)return new mxPoint(e+g,f+Math.floor(.5*k));if(p==-m)return new mxPoint(e+Math.floor(.75*g),f+k);if(p==-r+m)return new mxPoint(e+Math.floor(.25*g),f+k);0<p&&p<m?(b=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f+k)):p>m&&p<r-m?(b=new mxPoint(e,f),u=new mxPoint(e+g,f)):p>r-m&&
p<r?(b=new mxPoint(e-Math.floor(.25*g),f+k),u=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k))):0>p&&p>-m?(b=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f)):p<-m&&p>-r+m?(b=new mxPoint(e,f+k),u=new mxPoint(e+g,f+k)):p<-r+m&&p>-r&&(b=new mxPoint(e-Math.floor(.25*g),f),u=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k)))}c=mxUtils.intersection(l,a,c.x,c.y,b.x,b.y,u.x,u.y)}return null==c?new mxPoint(l,a):c}};
function mxPrintPreview(a,b,c,d,e,f,g,k,l){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.border=null!=d?d:0;this.pageFormat=mxRectangle.fromRectangle(null!=c?c:a.pageFormat);this.title=null!=k?k:"Printer-friendly version";this.x0=null!=e?e:0;this.y0=null!=f?f:0;this.borderColor=g;this.pageSelector=null!=l?l:!0}mxPrintPreview.prototype.graph=null;mxPrintPreview.prototype.pageFormat=null;mxPrintPreview.prototype.scale=null;mxPrintPreview.prototype.border=0;
mxPrintPreview.prototype.marginTop=0;mxPrintPreview.prototype.marginBottom=0;mxPrintPreview.prototype.x0=0;mxPrintPreview.prototype.y0=0;mxPrintPreview.prototype.autoOrigin=!0;mxPrintPreview.prototype.printOverlays=!1;mxPrintPreview.prototype.printControls=!1;mxPrintPreview.prototype.printBackgroundImage=!1;mxPrintPreview.prototype.backgroundColor="#ffffff";mxPrintPreview.prototype.borderColor=null;mxPrintPreview.prototype.title=null;mxPrintPreview.prototype.pageSelector=null;
mxPrintPreview.prototype.wnd=null;mxPrintPreview.prototype.targetWindow=null;mxPrintPreview.prototype.pageCount=0;mxPrintPreview.prototype.clipping=!0;mxPrintPreview.prototype.getWindow=function(){return this.wnd};mxPrintPreview.prototype.getDoctype=function(){var a="";8==document.documentMode?a='<meta http-equiv="X-UA-Compatible" content="IE=8">':8<document.documentMode&&(a='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--\x3e');return a};
mxPrintPreview.prototype.appendGraph=function(a,b,c,d,e,f){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.x0=c;this.y0=d;this.open(null,null,e,f)};
mxPrintPreview.prototype.open=function(a,b,c,d){var e=this.graph.cellRenderer.initializeOverlay,f=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(G,z){z.init(G.view.getDrawPane())});this.printControls&&(this.graph.cellRenderer.initControl=function(G,z,J,I){z.dialect=G.view.graph.dialect;z.init(G.view.getDrawPane())});this.wnd=null!=b?b:this.wnd;var g=!1;null==this.wnd&&(g=!0,this.wnd=window.open());var k=this.wnd.document;if(g){var l=this.getDoctype();null!=l&&0<l.length&&
k.writeln(l);"CSS1Compat"===document.compatMode&&k.writeln("<!DOCTYPE html>");k.writeln("<html>");k.writeln("<head>");this.writeHead(k,a);k.writeln("</head>");k.writeln('<body class="mxPage">')}var m=this.graph.getGraphBounds().clone(),n=this.graph.getView().getScale(),p=n/this.scale,r=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=r.x*this.scale,this.y0-=r.y*this.scale,m.width+=m.x,m.height+=m.y,m.x=0,this.border=m.y=0);var q=this.pageFormat.width-2*this.border,t=this.pageFormat.height-
2*this.border;this.pageFormat.height+=this.marginTop+this.marginBottom;m.width/=p;m.height/=p;var u=Math.max(1,Math.ceil((m.width+this.x0)/q)),x=Math.max(1,Math.ceil((m.height+this.y0)/t));this.pageCount=u*x;var A=mxUtils.bind(this,function(){if(this.pageSelector&&(1<x||1<u)){var G=this.createPageSelector(x,u);k.body.appendChild(G);if(mxClient.IS_IE&&null==k.documentMode||5==k.documentMode||8==k.documentMode||7==k.documentMode){G.style.position="absolute";var z=function(){G.style.top=(k.body.scrollTop||
k.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(J){z()});mxEvent.addListener(this.wnd,"resize",function(J){z()})}}}),E=mxUtils.bind(this,function(G,z){null!=this.borderColor&&(G.style.borderColor=this.borderColor,G.style.borderStyle="solid",G.style.borderWidth="1px");G.style.background=this.backgroundColor;if(c||z)G.style.pageBreakAfter="always";if(g&&(mxClient.IS_IE||11<=document.documentMode||mxClient.IS_EDGE))k.writeln(G.outerHTML),G.parentNode.removeChild(G);
else if(mxClient.IS_IE||11<=document.documentMode||mxClient.IS_EDGE){var J=k.createElement("div");J.innerHTML=G.outerHTML;J=J.getElementsByTagName("div")[0];k.body.appendChild(J);G.parentNode.removeChild(G)}else G.parentNode.removeChild(G),k.body.appendChild(G);(c||z)&&this.addPageBreak(k)}),C=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(null!=C)for(var D=0;D<C.length;D++)E(C[D],!0);var B=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(D=0;D<x;D++){var v=
D*t/this.scale-this.y0/this.scale+(m.y-r.y*n)/n;for(a=0;a<u;a++){if(null==this.wnd)return null;var y=a*q/this.scale-this.x0/this.scale+(m.x-r.x*n)/n,F=D*u+a+1,H=new mxRectangle(y,v,q,t);f=this.renderPage(this.pageFormat.width,this.pageFormat.height,0,0,mxUtils.bind(this,function(G){this.addGraphFragment(-y,-v,this.scale,F,G,H);this.printBackgroundImage&&this.insertBackgroundImage(G,-y,-v)}),F);f.setAttribute("id","mxPage-"+F);E(f,null!=B||D<x-1||a<u-1)}}if(null!=B)for(D=0;D<B.length;D++)E(B[D],D<
B.length-1);g&&!d&&(this.closeDocument(),A());this.wnd.focus()}catch(G){null!=f&&null!=f.parentNode&&f.parentNode.removeChild(f)}finally{this.graph.cellRenderer.initializeOverlay=e}return this.wnd};mxPrintPreview.prototype.addPageBreak=function(a){var b=a.createElement("hr");b.className="mxPageBreak";a.body.appendChild(b)};
mxPrintPreview.prototype.closeDocument=function(){try{if(null!=this.wnd&&null!=this.wnd.document){var a=this.wnd.document;this.writePostfix(a);a.writeln("</body>");a.writeln("</html>");a.close();mxEvent.release(a.body)}}catch(b){}};
mxPrintPreview.prototype.writeHead=function(a,b){null!=this.title&&a.writeln("<title>"+this.title+"</title>");mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a);a.writeln('<style type="text/css">');a.writeln("@media print {");a.writeln("  * { -webkit-print-color-adjust: exact; }");a.writeln("  table.mxPageSelector { display: none; }");a.writeln("  hr.mxPageBreak { display: none; }");a.writeln("}");a.writeln("@media screen {");a.writeln("  table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }");
a.writeln("  table.mxPageSelector td { border: solid 1px gray; padding:4px; }");a.writeln("  body.mxPage { background: gray; }");a.writeln("}");null!=b&&a.writeln(b);a.writeln("</style>")};mxPrintPreview.prototype.writePostfix=function(a){};
mxPrintPreview.prototype.createPageSelector=function(a,b){var c=this.wnd.document,d=c.createElement("table");d.className="mxPageSelector";d.setAttribute("border","0");for(var e=c.createElement("tbody"),f=0;f<a;f++){for(var g=c.createElement("tr"),k=0;k<b;k++){var l=f*b+k+1,m=c.createElement("td"),n=c.createElement("a");n.setAttribute("href","#mxPage-"+l);!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC||n.setAttribute("onclick","var page = document.getElementById('mxPage-"+l+"');page.scrollIntoView(true);event.preventDefault();");
mxUtils.write(n,l,c);m.appendChild(n);g.appendChild(m)}e.appendChild(g)}d.appendChild(e);return d};
mxPrintPreview.prototype.renderPage=function(a,b,c,d,e,f){f=this.wnd.document;var g=document.createElement("div"),k=null;try{if(0!=c||0!=d){g.style.position="relative";g.style.width=a+"px";g.style.height=b+"px";g.style.pageBreakInside="avoid";var l=document.createElement("div");l.style.position="relative";l.style.top=this.border+"px";l.style.left=this.border+"px";l.style.width=a-2*this.border+"px";l.style.height=b-2*this.border+"px";l.style.overflow="hidden";var m=document.createElement("div");m.style.position=
"relative";m.style.marginLeft=c+"px";m.style.marginTop=d+"px";8==f.documentMode&&(l.style.position="absolute",m.style.position="absolute");10==f.documentMode&&(m.style.width="100%",m.style.height="100%");l.appendChild(m);g.appendChild(l);document.body.appendChild(g);k=m}else g.style.width=a+"px",g.style.height=b+"px",g.style.overflow="hidden",g.style.pageBreakInside="avoid",8==f.documentMode&&(g.style.position="relative"),l=document.createElement("div"),l.style.width=a-2*this.border+"px",l.style.height=
b-2*this.border+"px",l.style.overflow="hidden",!mxClient.IS_IE||null!=f.documentMode&&5!=f.documentMode&&8!=f.documentMode&&7!=f.documentMode?(l.style.top=this.border+"px",l.style.left=this.border+"px"):(l.style.marginTop=this.border+"px",l.style.marginLeft=this.border+"px"),g.appendChild(l),document.body.appendChild(g),k=l}catch(n){throw g.parentNode.removeChild(g),n;}e(k);return g};
mxPrintPreview.prototype.getRoot=function(){var a=this.graph.view.currentRoot;null==a&&(a=this.graph.getModel().getRoot());return a};mxPrintPreview.prototype.useCssTransforms=function(){return!mxClient.NO_FO&&!mxClient.IS_SF};mxPrintPreview.prototype.isCellVisible=function(a){return!0};
mxPrintPreview.prototype.addGraphFragment=function(a,b,c,d,e,f){var g=this.graph.getView();d=this.graph.container;this.graph.container=e;var k=g.getCanvas(),l=g.getBackgroundPane(),m=g.getDrawPane(),n=g.getOverlayPane(),p=c;if(this.graph.dialect==mxConstants.DIALECT_SVG){if(g.createSvg(),this.useCssTransforms()){var r=g.getDrawPane().parentNode;r.getAttribute("transform");r.setAttribute("transformOrigin","0 0");r.setAttribute("transform","scale("+c+","+c+")translate("+a+","+b+")");c=1;b=a=0}}else g.createHtml();
r=g.isEventsEnabled();g.setEventsEnabled(!1);var q=this.graph.isEnabled();this.graph.setEnabled(!1);var t=g.getTranslate();g.translate=new mxPoint(a,b);var u=this.graph.cellRenderer.redraw,x=g.states;a=g.scale;if(this.clipping){var A=new mxRectangle((f.x+t.x)*a,(f.y+t.y)*a,f.width*a/p,f.height*a/p),E=this;this.graph.cellRenderer.redraw=function(D,B,v){if(null!=D){var y=x.get(D.cell);if(null!=y&&(y=g.getBoundingBox(y,!1),null!=y&&0<y.width&&0<y.height&&!mxUtils.intersects(A,y))||!E.isCellVisible(D.cell))return}u.apply(this,
arguments)}}a=null;try{var C=[this.getRoot()];a=new mxTemporaryCellStates(g,c,C,null,mxUtils.bind(this,function(D){return this.getLinkForCellState(D)}))}finally{if(mxClient.IS_IE)g.overlayPane.innerText="",g.canvas.style.overflow="hidden",g.canvas.style.position="relative",g.canvas.style.top=this.marginTop+"px",g.canvas.style.width=f.width+"px",g.canvas.style.height=f.height+"px";else for(c=e.firstChild;null!=c;)C=c.nextSibling,b=c.nodeName.toLowerCase(),"svg"==b?(c.style.overflow="hidden",c.style.position=
"relative",c.style.top=this.marginTop+"px",c.setAttribute("width",f.width),c.setAttribute("height",f.height),c.style.width="",c.style.height=""):"default"!=c.style.cursor&&"div"!=b&&c.parentNode.removeChild(c),c=C;this.printBackgroundImage&&(e=e.getElementsByTagName("svg"),0<e.length&&(e[0].style.position="absolute"));g.overlayPane.parentNode.removeChild(g.overlayPane);this.graph.setEnabled(q);this.graph.container=d;this.graph.cellRenderer.redraw=u;g.canvas=k;g.backgroundPane=l;g.drawPane=m;g.overlayPane=
n;g.translate=t;a.destroy();g.setEventsEnabled(r)}};mxPrintPreview.prototype.getLinkForCellState=function(a){return this.graph.getLinkForCell(a.cell)};
mxPrintPreview.prototype.insertBackgroundImage=function(a,b,c){var d=this.graph.backgroundImage;if(null!=d){var e=document.createElement("img");e.style.position="absolute";e.style.marginLeft=Math.round((b+d.x)*this.scale)+"px";e.style.marginTop=Math.round((c+d.y)*this.scale)+"px";e.setAttribute("width",Math.round(d.width*this.scale));e.setAttribute("height",Math.round(d.height*this.scale));e.src=d.src;a.insertBefore(e,a.firstChild)}};mxPrintPreview.prototype.getCoverPages=function(){return null};
mxPrintPreview.prototype.getAppendices=function(){return null};mxPrintPreview.prototype.print=function(a){a=this.open(a);null!=a&&a.print()};mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)};function mxStylesheet(){this.styles={};this.putDefaultVertexStyle(this.createDefaultVertexStyle());this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}
mxStylesheet.prototype.createDefaultVertexStyle=function(){var a={};a[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE;a[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter;a[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;a[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;a[mxConstants.STYLE_FILLCOLOR]="#C3D9FF";a[mxConstants.STYLE_STROKECOLOR]="#6482B9";a[mxConstants.STYLE_FONTCOLOR]="#774400";return a};
mxStylesheet.prototype.createDefaultEdgeStyle=function(){var a={};a[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR;a[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC;a[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;a[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;a[mxConstants.STYLE_STROKECOLOR]="#6482B9";a[mxConstants.STYLE_FONTCOLOR]="#446299";return a};mxStylesheet.prototype.putDefaultVertexStyle=function(a){this.putCellStyle("defaultVertex",a)};
mxStylesheet.prototype.putDefaultEdgeStyle=function(a){this.putCellStyle("defaultEdge",a)};mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex};mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge};mxStylesheet.prototype.putCellStyle=function(a,b){this.styles[a]=b};
mxStylesheet.prototype.getCellStyle=function(a,b,c){c=null!=c?c:!0;if(null!=a&&0<a.length){var d=a.split(";");b=null!=b&&";"!=a.charAt(0)?mxUtils.clone(b):{};for(a=0;a<d.length;a++){var e=d[a],f=e.indexOf("=");if(0<=f){var g=e.substring(0,f);e=e.substring(f+1);e==mxConstants.NONE&&c?delete b[g]:mxUtils.isNumeric(e)?b[g]=parseFloat(e):b[g]=e}else if(e=this.styles[e],null!=e)for(g in e)b[g]=e[g]}}return b};
function mxCellState(a,b,c){this.view=a;this.cell=b;this.style=null!=c?c:{};this.origin=new mxPoint;this.absoluteOffset=new mxPoint}mxCellState.prototype=new mxRectangle;mxCellState.prototype.constructor=mxCellState;mxCellState.prototype.view=null;mxCellState.prototype.cell=null;mxCellState.prototype.style=null;mxCellState.prototype.invalidStyle=!1;mxCellState.prototype.invalid=!0;mxCellState.prototype.origin=null;mxCellState.prototype.absolutePoints=null;mxCellState.prototype.absoluteOffset=null;
mxCellState.prototype.visibleSourceState=null;mxCellState.prototype.visibleTargetState=null;mxCellState.prototype.terminalDistance=0;mxCellState.prototype.length=0;mxCellState.prototype.segments=null;mxCellState.prototype.shape=null;mxCellState.prototype.text=null;mxCellState.prototype.unscaledWidth=null;mxCellState.prototype.unscaledHeight=null;
mxCellState.prototype.getPerimeterBounds=function(a,b){a=a||0;b=null!=b?b:new mxRectangle(this.x,this.y,this.width,this.height);if(null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var c=this.shape.stencil.computeAspect(this.style,b.x,b.y,b.width,b.height);b.x=c.x;b.y=c.y;b.width=this.shape.stencil.w0*c.width;b.height=this.shape.stencil.h0*c.height}0!=a&&b.grow(a);return b};
mxCellState.prototype.setAbsoluteTerminalPoint=function(a,b){b?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(a):this.absolutePoints[0]=a):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(a)):1==this.absolutePoints.length?this.absolutePoints.push(a):this.absolutePoints[this.absolutePoints.length-1]=a};
mxCellState.prototype.setCursor=function(a){null!=this.shape&&this.shape.setCursor(a);null!=this.text&&this.text.setCursor(a)};mxCellState.prototype.isFloatingTerminalPoint=function(a){var b=this.getVisibleTerminalState(a);if(null==b)return!1;a=this.view.graph.getConnectionConstraint(this,b,a);return null==a||null==a.point};mxCellState.prototype.getVisibleTerminal=function(a){a=this.getVisibleTerminalState(a);return null!=a?a.cell:null};
mxCellState.prototype.getVisibleTerminalState=function(a){return a?this.visibleSourceState:this.visibleTargetState};mxCellState.prototype.setVisibleTerminalState=function(a,b){b?this.visibleSourceState=a:this.visibleTargetState=a};mxCellState.prototype.getCellBounds=function(){return this.cellBounds};mxCellState.prototype.getPaintBounds=function(){return this.paintBounds};
mxCellState.prototype.updateCachedBounds=function(){var a=this.view.translate,b=this.view.scale;this.cellBounds=new mxRectangle(this.x/b-a.x,this.y/b-a.y,this.width/b,this.height/b);this.paintBounds=mxRectangle.fromRectangle(this.cellBounds);null!=this.shape&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()};
mxCellState.prototype.setState=function(a){this.view=a.view;this.cell=a.cell;this.style=a.style;this.absolutePoints=a.absolutePoints;this.origin=a.origin;this.absoluteOffset=a.absoluteOffset;this.boundingBox=a.boundingBox;this.terminalDistance=a.terminalDistance;this.segments=a.segments;this.length=a.length;this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;this.unscaledWidth=a.unscaledWidth;this.unscaledHeight=a.unscaledHeight};
mxCellState.prototype.clone=function(){var a=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){a.absolutePoints=[];for(var b=0;b<this.absolutePoints.length;b++)a.absolutePoints[b]=this.absolutePoints[b].clone()}null!=this.origin&&(a.origin=this.origin.clone());null!=this.absoluteOffset&&(a.absoluteOffset=this.absoluteOffset.clone());null!=this.boundingBox&&(a.boundingBox=this.boundingBox.clone());a.terminalDistance=this.terminalDistance;a.segments=this.segments;a.length=
this.length;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;a.unscaledWidth=this.unscaledWidth;a.unscaledHeight=this.unscaledHeight;return a};mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)};function mxGraphSelectionModel(a){this.graph=a;this.cells=[]}mxGraphSelectionModel.prototype=new mxEventSource;mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel;mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"";
mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"";mxGraphSelectionModel.prototype.graph=null;mxGraphSelectionModel.prototype.singleSelection=!1;mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection};mxGraphSelectionModel.prototype.setSingleSelection=function(a){this.singleSelection=a};mxGraphSelectionModel.prototype.isSelected=function(a){return null!=a?0<=mxUtils.indexOf(this.cells,a):!1};
mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length};mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)};mxGraphSelectionModel.prototype.setCell=function(a){null!=a&&this.setCells([a])};mxGraphSelectionModel.prototype.setCells=function(a){if(null!=a){this.singleSelection&&(a=[this.getFirstSelectableCell(a)]);for(var b=[],c=0;c<a.length;c++)this.graph.isCellSelectable(a[c])&&b.push(a[c]);this.changeSelection(b,this.cells)}};
mxGraphSelectionModel.prototype.getFirstSelectableCell=function(a){if(null!=a)for(var b=0;b<a.length;b++)if(this.graph.isCellSelectable(a[b]))return a[b];return null};mxGraphSelectionModel.prototype.addCell=function(a){null!=a&&this.addCells([a])};
mxGraphSelectionModel.prototype.addCells=function(a){if(null!=a){var b=null;this.singleSelection&&(b=this.cells,a=[this.getFirstSelectableCell(a)]);for(var c=[],d=0;d<a.length;d++)!this.isSelected(a[d])&&this.graph.isCellSelectable(a[d])&&c.push(a[d]);this.changeSelection(c,b)}};mxGraphSelectionModel.prototype.removeCell=function(a){null!=a&&this.removeCells([a])};
mxGraphSelectionModel.prototype.removeCells=function(a){if(null!=a){for(var b=[],c=0;c<a.length;c++)this.isSelected(a[c])&&b.push(a[c]);this.changeSelection(null,b)}};mxGraphSelectionModel.prototype.changeSelection=function(a,b){if(null!=a&&0<a.length&&null!=a[0]||null!=b&&0<b.length&&null!=b[0])a=new mxSelectionChange(this,a,b),a.execute(),b=new mxUndoableEdit(this,!1),b.add(a),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",b))};
mxGraphSelectionModel.prototype.cellAdded=function(a){null==a||this.isSelected(a)||this.cells.push(a)};mxGraphSelectionModel.prototype.cellRemoved=function(a){null!=a&&(a=mxUtils.indexOf(this.cells,a),0<=a&&this.cells.splice(a,1))};function mxSelectionChange(a,b,c){this.selectionModel=a;this.added=null!=b?b.slice():null;this.removed=null!=c?c.slice():null}
mxSelectionChange.prototype.execute=function(){var a=mxLog.enter("mxSelectionChange.execute");window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource;if(null!=this.removed)for(var b=0;b<this.removed.length;b++)this.selectionModel.cellRemoved(this.removed[b]);if(null!=this.added)for(b=0;b<this.added.length;b++)this.selectionModel.cellAdded(this.added[b]);b=this.added;this.added=this.removed;this.removed=b;window.status=mxResources.get(this.selectionModel.doneResource)||
this.selectionModel.doneResource;mxLog.leave("mxSelectionChange.execute",a);this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))};
function mxCellEditor(a){this.graph=a;this.zoomHandler=mxUtils.bind(this,function(){this.graph.isEditing()&&this.resize()});this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler);this.changeHandler=mxUtils.bind(this,function(b){null!=this.editingCell&&(b=this.graph.getView().getState(this.editingCell),null==b?this.stopEditing(!0):this.updateTextAreaStyle(b))});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}
mxCellEditor.prototype.graph=null;mxCellEditor.prototype.textarea=null;mxCellEditor.prototype.editingCell=null;mxCellEditor.prototype.trigger=null;mxCellEditor.prototype.modified=!1;mxCellEditor.prototype.autoSize=!0;mxCellEditor.prototype.selectText=!0;mxCellEditor.prototype.emptyLabelText=mxClient.IS_FF?"<br>":"";mxCellEditor.prototype.escapeCancelsEditing=!0;mxCellEditor.prototype.textNode="";mxCellEditor.prototype.zIndex=1;mxCellEditor.prototype.minResize=new mxRectangle(0,20);
mxCellEditor.prototype.wordWrapPadding=0;mxCellEditor.prototype.blurEnabled=!1;mxCellEditor.prototype.initialValue=null;mxCellEditor.prototype.align=null;mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div");this.textarea.className="mxCellEditor mxPlainTextEditor";this.textarea.contentEditable=!0;mxClient.IS_GC&&(this.textarea.style.minHeight="1em");this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative";this.installListeners(this.textarea)};
mxCellEditor.prototype.applyValue=function(a,b){this.graph.labelChanged(a.cell,b,this.trigger)};mxCellEditor.prototype.setAlign=function(a){null!=this.textarea&&(this.textarea.style.textAlign=a);this.align=a;this.resize()};mxCellEditor.prototype.getInitialValue=function(a,b){a=mxUtils.htmlEntities(this.graph.getEditingValue(a.cell,b),!1);8!=document.documentMode&&9!=document.documentMode&&10!=document.documentMode&&(a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>"));return a.replace(/\n/g,"<br>")};
mxCellEditor.prototype.getCurrentValue=function(a){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)};mxCellEditor.prototype.isCancelEditingKeyEvent=function(a){return this.escapeCancelsEditing||mxEvent.isShiftDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)};
mxCellEditor.prototype.installListeners=function(a){mxEvent.addListener(a,"dragstart",mxUtils.bind(this,function(d){this.graph.stopEditing(!1);mxEvent.consume(d)}));mxEvent.addListener(a,"blur",mxUtils.bind(this,function(d){this.blurEnabled&&this.focusLost(d)}));mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(d){mxEvent.isConsumed(d)||(this.isStopEditingEvent(d)?(this.graph.stopEditing(!1),mxEvent.consume(d)):27==d.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(d)),mxEvent.consume(d)))}));
var b=mxUtils.bind(this,function(d){null!=this.editingCell&&this.clearOnChange&&a.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=d.keyCode&&46!=d.keyCode)&&(this.clearOnChange=!1,a.innerText="")});mxEvent.addListener(a,"keypress",b);mxEvent.addListener(a,"paste",b);b=mxUtils.bind(this,function(d){null!=this.editingCell&&(0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length):
this.clearOnChange=!1)});mxEvent.addListener(a,mxClient.IS_IE11||mxClient.IS_IE?"keyup":"input",b);mxEvent.addListener(a,"cut",b);mxEvent.addListener(a,"paste",b);b=mxClient.IS_IE11||mxClient.IS_IE?"keydown":"input";var c=mxUtils.bind(this,function(d){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(d)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null;this.resize()}),0))});mxEvent.addListener(a,
b,c);mxEvent.addListener(window,"resize",c);9<=document.documentMode?(mxEvent.addListener(a,"DOMNodeRemoved",c),mxEvent.addListener(a,"DOMNodeInserted",c)):(mxEvent.addListener(a,"cut",c),mxEvent.addListener(a,"paste",c))};mxCellEditor.prototype.isStopEditingEvent=function(a){return 113==a.keyCode||this.graph.isEnterStopsCellEditing()&&13==a.keyCode&&!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)};mxCellEditor.prototype.isEventSource=function(a){return mxEvent.getSource(a)==this.textarea};
mxCellEditor.prototype.resize=function(){var a=this.graph.getView().getState(this.editingCell);if(null==a)this.stopEditing(!0);else if(null!=this.textarea){var b=this.graph.getModel().isEdge(a.cell),c=this.graph.getView().scale,d=null;if(this.autoSize&&"fill"!=a.style[mxConstants.STYLE_OVERFLOW]){var e=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);d=null!=a.text&&null==this.align?a.text.margin:null;null==d&&(d=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,
mxConstants.ALIGN_CENTER),mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));if(b){if(this.bounds=new mxRectangle(a.absoluteOffset.x,a.absoluteOffset.y,0,0),null!=e){var f=(parseFloat(e)+2)*c;this.bounds.width=f;this.bounds.x+=d.x*f}}else{b=mxRectangle.fromRectangle(a);var g=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),k=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);b=null!=a.shape&&
g==mxConstants.ALIGN_CENTER&&k==mxConstants.ALIGN_MIDDLE?a.shape.getLabelBounds(b):b;null!=e&&(b.width=parseFloat(e)*c);if(!a.view.graph.cellRenderer.legacySpacing||"width"!=a.style[mxConstants.STYLE_OVERFLOW]&&"block"!=a.style[mxConstants.STYLE_OVERFLOW]){g=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_SPACING,2))*c;var l=(parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_SPACING_TOP,0))+mxText.prototype.baseSpacingTop)*c+g,m=(parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_SPACING_RIGHT,
0))+mxText.prototype.baseSpacingRight)*c+g,n=(parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_SPACING_BOTTOM,0))+mxText.prototype.baseSpacingBottom)*c+g,p=(parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_SPACING_LEFT,0))+mxText.prototype.baseSpacingLeft)*c+g;g=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);k=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);b=new mxRectangle(b.x+p,b.y+l,b.width-(g==mxConstants.ALIGN_CENTER&&
null==e?p+m:0),b.height-(k==mxConstants.ALIGN_MIDDLE?l+n:0));this.graph.isHtmlLabel(a.cell)&&(b.x-=mxSvgCanvas2D.prototype.foreignObjectPadding/2,b.y-=mxSvgCanvas2D.prototype.foreignObjectPadding/2,b.width+=mxSvgCanvas2D.prototype.foreignObjectPadding)}this.bounds=new mxRectangle(b.x+a.absoluteOffset.x,b.y+a.absoluteOffset.y,b.width,b.height)}if(this.graph.isWrapping(a.cell)&&(2<=this.bounds.width||2<=this.bounds.height))if(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace=
"normal",this.textarea.innerHTML!=this.getEmptyLabelText())if(f=Math.round(this.bounds.width/c)+this.wordWrapPadding,"relative"!=this.textarea.style.position)this.textarea.style.width=f+"px",this.textarea.scrollWidth>f&&(this.textarea.style.width=this.textarea.scrollWidth+"px");else if("block"==a.style[mxConstants.STYLE_OVERFLOW]||"width"==a.style[mxConstants.STYLE_OVERFLOW]){if(-.5==d.y||"width"==a.style[mxConstants.STYLE_OVERFLOW])this.textarea.style.maxHeight=this.bounds.height+"px";this.textarea.style.width=
f+"px"}else this.textarea.style.maxWidth=f+"px";else this.textarea.style.maxWidth=f+"px";else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";8==document.documentMode&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");8==document.documentMode?(a=this.textarea.scrollWidth,e=this.textarea.scrollHeight,this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-d.x*(this.bounds.width-(a+1)*c)+a*(c-1)*0+2*(d.x+.5))/c))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-
d.y*(this.bounds.height-(e+.5)*c)+e*(c-1)*0+1*Math.abs(d.y+.5))/c))+"px",this.textarea.style.width=Math.round(a*c)+"px",this.textarea.style.height=Math.round(e*c)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-d.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-d.y*(this.bounds.height-4)+(-1==d.y?3:0))+1)+"px")}else this.bounds=this.getEditorBounds(a),this.textarea.style.width=Math.round(this.bounds.width/c)+"px",this.textarea.style.height=
Math.round(this.bounds.height/c)+"px",8==document.documentMode?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"),this.graph.isWrapping(a.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace=
"normal","fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/c)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=""));mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+c+","+c+")"+(null==d?"":" translate("+100*d.x+"%,"+100*d.y+"%)"))}};mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())};
mxCellEditor.prototype.getBackgroundColor=function(a){return null};mxCellEditor.prototype.getBorderColor=function(a){return null};mxCellEditor.prototype.isLegacyEditor=function(){var a=!1;if(mxClient.IS_SVG){var b=this.graph.view.getDrawPane().ownerSVGElement;null!=b&&(b=mxUtils.getCurrentStyle(b),null!=b&&(a="absolute"==b.position))}return!a};
mxCellEditor.prototype.updateTextAreaStyle=function(a){this.graph.getView();var b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),d=mxUtils.getValue(a.style,mxConstants.STYLE_FONTCOLOR,"black"),e=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),f=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,g=(mxUtils.getValue(a.style,
mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,k=[];(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&k.push("underline");(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&k.push("line-through");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(b*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.backgroundColor=
this.getBackgroundColor(a);this.textarea.style.textDecoration=k.join(" ");this.textarea.style.fontWeight=f?"bold":"normal";this.textarea.style.fontStyle=g?"italic":"";this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.zIndex=this.zIndex;this.textarea.style.fontFamily=c;this.textarea.style.textAlign=e;this.textarea.style.outline="none";this.textarea.style.color=d;b=this.getBorderColor(a);this.textarea.style.border=null!=b?"1px solid "+b:"none";b=this.textDirection=mxUtils.getValue(a.style,
mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);b==mxConstants.TEXT_DIRECTION_AUTO&&(null==a||null==a.text||a.text.dialect==mxConstants.DIALECT_STRICTHTML||mxUtils.isNode(a.text.value)||(b=a.text.getAutoDirection()));b==mxConstants.TEXT_DIRECTION_LTR||b==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",b):this.textarea.removeAttribute("dir")};
mxCellEditor.prototype.startEditing=function(a,b){this.stopEditing(!0);this.align=null;null==this.textarea&&this.init();null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var c=this.graph.getView().getState(a);if(null!=c){this.updateTextAreaStyle(c);this.textarea.innerHTML=this.getInitialValue(c,b)||"";this.initialValue=this.textarea.innerHTML;0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=
!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText();this.graph.container.appendChild(this.textarea);this.editingCell=a;this.trigger=b;this.textNode=null;null!=c.text&&this.isHideLabel(c)&&(this.textNode=c.text.node,this.textNode.style.visibility="hidden");this.autoSize&&(this.graph.model.isEdge(c.cell)||"fill"!=c.style[mxConstants.STYLE_OVERFLOW])&&window.setTimeout(mxUtils.bind(this,function(){this.resize()}),0);this.resize();try{this.textarea.focus(),this.isSelectText()&&0<
this.textarea.innerHTML.length&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch(d){}}};mxCellEditor.prototype.isSelectText=function(){return this.selectText};mxCellEditor.prototype.clearSelection=function(){var a=null;window.getSelection?a=window.getSelection():document.selection&&(a=document.selection);null!=a&&(a.empty?a.empty():a.removeAllRanges&&a.removeAllRanges())};
mxCellEditor.prototype.stopEditing=function(a){if(null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);a=a?null:this.graph.view.getState(this.editingCell);var b=this.initialValue;this.bounds=this.trigger=this.editingCell=this.initialValue=null;this.textarea.blur();this.clearSelection();null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea);this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerText=
"",this.clearOnChange=!1);if(null!=a&&(this.textarea.innerHTML!=b||null!=this.align)){this.prepareTextarea();b=this.getCurrentValue(a);this.graph.getModel().beginUpdate();try{null!=b&&this.applyValue(a,b),null!=this.align&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[a.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea);this.align=this.textarea=null}};
mxCellEditor.prototype.prepareTextarea=function(){null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)};mxCellEditor.prototype.isHideLabel=function(a){return!0};mxCellEditor.prototype.getMinimumSize=function(a){var b=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*b+20,"left"==this.textarea.style.textAlign?120:40)};
mxCellEditor.prototype.getEditorBounds=function(a){var b=this.graph.getModel().isEdge(a.cell),c=this.graph.getView().scale,d=this.getMinimumSize(a),e=d.width;d=d.height;if(!b&&a.view.graph.cellRenderer.legacySpacing&&"fill"==a.style[mxConstants.STYLE_OVERFLOW])c=a.shape.getLabelBounds(mxRectangle.fromRectangle(a));else{var f=parseFloat(mxUtils.getValue(style,mxConstants.STYLE_SPACING,2))*c,g=(parseFloat(mxUtils.getValue(style,mxConstants.STYLE_SPACING_TOP,0))+mxText.prototype.baseSpacingTop)*c+f,
k=(parseFloat(mxUtils.getValue(style,mxConstants.STYLE_SPACING_RIGHT,0))+mxText.prototype.baseSpacingRight)*c+f,l=(parseFloat(mxUtils.getValue(style,mxConstants.STYLE_SPACING_BOTTOM,0))+mxText.prototype.baseSpacingBottom)*c+f;f=(parseFloat(mxUtils.getValue(style,mxConstants.STYLE_SPACING_LEFT,0))+mxText.prototype.baseSpacingLeft)*c+f;c=new mxRectangle(a.x,a.y,Math.max(e,a.width-f-k),Math.max(d,a.height-g-l));k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);l=mxUtils.getValue(a.style,
mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);this.graph.isHtmlLabel(a.cell)&&(c.width+=mxSvgCanvas2D.prototype.foreignObjectPadding);c=null!=a.shape&&k==mxConstants.ALIGN_CENTER&&l==mxConstants.ALIGN_MIDDLE?a.shape.getLabelBounds(c):c;b?(c.x=a.absoluteOffset.x,c.y=a.absoluteOffset.y,null!=a.text&&null!=a.text.boundingBox&&(0<a.text.boundingBox.x&&(c.x=a.text.boundingBox.x),0<a.text.boundingBox.y&&(c.y=a.text.boundingBox.y))):null!=a.text&&null!=a.text.boundingBox&&(c.x=Math.min(c.x,
a.text.boundingBox.x),c.y=Math.min(c.y,a.text.boundingBox.y));c.x+=f;c.y+=g;null!=a.text&&null!=a.text.boundingBox&&(b?(c.width=Math.max(e,a.text.boundingBox.width),c.height=Math.max(d,a.text.boundingBox.height)):(c.width=Math.max(c.width,a.text.boundingBox.width),c.height=Math.max(c.height,a.text.boundingBox.height)));this.graph.getModel().isVertex(a.cell)&&(b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),b==mxConstants.ALIGN_LEFT?c.x-=a.width:b==mxConstants.ALIGN_RIGHT&&
(c.x+=a.width),b=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),b==mxConstants.ALIGN_TOP?c.y-=a.height:b==mxConstants.ALIGN_BOTTOM&&(c.y+=a.height))}return new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))};mxCellEditor.prototype.getEmptyLabelText=function(a){return this.emptyLabelText};mxCellEditor.prototype.getEditingCell=function(){return this.editingCell};
mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)};function mxCellRenderer(){}mxCellRenderer.defaultShapes={};
mxCellRenderer.prototype.defaultEdgeShape=mxConnector;mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape;mxCellRenderer.prototype.defaultTextShape=mxText;mxCellRenderer.prototype.legacyControlPosition=!0;mxCellRenderer.prototype.legacySpacing=!0;mxCellRenderer.prototype.antiAlias=!0;mxCellRenderer.prototype.minSvgStrokeWidth=1;mxCellRenderer.prototype.forceControlClickHandler=!1;mxCellRenderer.registerShape=function(a,b){mxCellRenderer.defaultShapes[a]=b};
mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape);mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus);mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder);mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor);mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle);
mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon);mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud);mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane);
mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape);mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel);mxCellRenderer.prototype.initializeShape=function(a){a.shape.dialect=a.view.graph.dialect;this.configureShape(a);a.shape.init(a.view.getDrawPane())};
mxCellRenderer.prototype.createShape=function(a){var b=null;null!=a.style&&(b=a.style[mxConstants.STYLE_SHAPE],b=null==mxCellRenderer.defaultShapes[b]?mxStencilRegistry.getStencil(b):null,b=null!=b?new mxShape(b):new (this.getShapeConstructor(a)));return b};mxCellRenderer.prototype.createIndicatorShape=function(a){a.shape.indicatorShape=this.getShape(a.view.graph.getIndicatorShape(a))};mxCellRenderer.prototype.getShape=function(a){return null!=a?mxCellRenderer.defaultShapes[a]:null};
mxCellRenderer.prototype.getShapeConstructor=function(a){var b=this.getShape(a.style[mxConstants.STYLE_SHAPE]);null==b&&(b=a.view.graph.getModel().isEdge(a.cell)?this.defaultEdgeShape:this.defaultVertexShape);return b};
mxCellRenderer.prototype.configureShape=function(a){a.shape.apply(a);a.shape.image=a.view.graph.getImage(a);a.shape.indicatorColor=a.view.graph.getIndicatorColor(a);a.shape.indicatorStrokeColor=a.style[mxConstants.STYLE_INDICATOR_STROKECOLOR];a.shape.indicatorGradientColor=a.view.graph.getIndicatorGradientColor(a);a.shape.indicatorDirection=a.style[mxConstants.STYLE_INDICATOR_DIRECTION];a.shape.indicatorImage=a.view.graph.getIndicatorImage(a);this.postConfigureShape(a)};
mxCellRenderer.prototype.postConfigureShape=function(a){null!=a.shape&&(this.resolveColor(a,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(a,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(a,"gradient",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(a,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(a,"fill",mxConstants.STYLE_FILLCOLOR))};
mxCellRenderer.prototype.checkPlaceholderStyles=function(a){if(null!=a.style)for(var b=["inherit","swimlane","indicated"],c=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],d=0;d<c.length;d++)if(0<=mxUtils.indexOf(b,a.style[c[d]]))return!0;return!1};
mxCellRenderer.prototype.resolveColor=function(a,b,c){var d=c==mxConstants.STYLE_FONTCOLOR?a.text:a.shape;if(null!=d){var e=a.view.graph,f=d[b],g=null;"inherit"==f?g=e.model.getParent(a.cell):"swimlane"==f?(d[b]=c==mxConstants.STYLE_STROKECOLOR||c==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",g=null!=e.model.getTerminal(a.cell,!1)?e.model.getTerminal(a.cell,!1):a.cell,g=e.getSwimlane(g),c=e.swimlaneIndicatorColorAttribute):"indicated"==f&&null!=a.shape?d[b]=a.shape.indicatorColor:c!=mxConstants.STYLE_FILLCOLOR&&
f==mxConstants.STYLE_FILLCOLOR&&null!=a.shape?d[b]=a.style[mxConstants.STYLE_FILLCOLOR]:c!=mxConstants.STYLE_STROKECOLOR&&f==mxConstants.STYLE_STROKECOLOR&&null!=a.shape&&(d[b]=a.style[mxConstants.STYLE_STROKECOLOR]);null!=g&&(a=e.getView().getState(g),d[b]=null,null!=a&&(e=c==mxConstants.STYLE_FONTCOLOR?a.text:a.shape,d[b]=null!=e&&"indicatorColor"!=b?e[b]:a.style[c]))}};mxCellRenderer.prototype.getLabelValue=function(a){return a.view.graph.getLabel(a.cell)};
mxCellRenderer.prototype.createLabel=function(a,b){var c=a.view.graph;c.getModel().isEdge(a.cell);if(0<a.style[mxConstants.STYLE_FONTSIZE]||null==a.style[mxConstants.STYLE_FONTSIZE]){var d=c.isHtmlLabel(a.cell)||null!=b&&mxUtils.isNode(b);a.text=new this.defaultTextShape(b,new mxRectangle,a.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,c.getVerticalAlign(a),a.style[mxConstants.STYLE_FONTCOLOR],a.style[mxConstants.STYLE_FONTFAMILY],a.style[mxConstants.STYLE_FONTSIZE],a.style[mxConstants.STYLE_FONTSTYLE],
a.style[mxConstants.STYLE_SPACING],a.style[mxConstants.STYLE_SPACING_TOP],a.style[mxConstants.STYLE_SPACING_RIGHT],a.style[mxConstants.STYLE_SPACING_BOTTOM],a.style[mxConstants.STYLE_SPACING_LEFT],a.style[mxConstants.STYLE_HORIZONTAL],a.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],a.style[mxConstants.STYLE_LABEL_BORDERCOLOR],c.isWrapping(a.cell)&&c.isHtmlLabel(a.cell),c.isLabelClipped(a.cell),a.style[mxConstants.STYLE_OVERFLOW],a.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_DIRECTION,
mxConstants.DEFAULT_TEXT_DIRECTION));a.text.opacity=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_OPACITY,100);a.text.dialect=d?mxConstants.DIALECT_STRICTHTML:a.view.graph.dialect;a.text.style=a.style;a.text.state=a;this.initializeLabel(a,a.text);this.configureShape(a);var e=!1,f=function(g){var k=a;if(mxClient.IS_TOUCH||e)k=mxEvent.getClientX(g),g=mxEvent.getClientY(g),g=mxUtils.convertPoint(c.container,k,g),k=c.view.getState(c.getCellAt(g.x,g.y));return k};mxEvent.addGestureListeners(a.text.node,
mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,a)),e=c.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(g).nodeName)}),mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&c.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,f(g)))}),mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(g,f(g))),e=!1)}));c.nativeDblClickEnabled&&mxEvent.addListener(a.text.node,"dblclick",
mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.dblClick(g,a.cell),mxEvent.consume(g))}))}};mxCellRenderer.prototype.initializeLabel=function(a,b){mxClient.IS_SVG&&mxClient.NO_FO&&b.dialect!=mxConstants.DIALECT_SVG?b.init(a.view.graph.container):b.init(a.view.getDrawPane())};
mxCellRenderer.prototype.createCellOverlays=function(a){var b=a.view.graph.getCellOverlays(a.cell),c=null;if(null!=b){c=new mxDictionary;for(var d=0;d<b.length;d++){var e=null!=a.overlays?a.overlays.remove(b[d]):null;null==e?(e=new mxImageShape(new mxRectangle,b[d].image.src),e.dialect=a.view.graph.dialect,e.preserveImageAspect=!1,e.overlay=b[d],this.initializeOverlay(a,e),this.installCellOverlayListeners(a,b[d],e),null!=b[d].cursor&&(e.node.style.cursor=b[d].cursor),c.put(b[d],e)):c.put(b[d],e)}}null!=
a.overlays&&a.overlays.visit(function(f,g){g.destroy()});a.overlays=c};mxCellRenderer.prototype.initializeOverlay=function(a,b){b.init(a.view.getOverlayPane())};
mxCellRenderer.prototype.installCellOverlayListeners=function(a,b,c){var d=a.view.graph;mxEvent.addListener(c.node,"click",function(e){d.isEditing()&&d.stopEditing(!d.isInvokesStopCellEditing());b.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",a.cell))});mxEvent.addGestureListeners(c.node,function(e){mxEvent.consume(e)},function(e){d.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,a))});mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchend",function(e){b.fireEvent(new mxEventObject(mxEvent.CLICK,
"event",e,"cell",a.cell))})};mxCellRenderer.prototype.createControl=function(a){var b=a.view.graph,c=b.getFoldingImage(a);if(b.foldingEnabled&&null!=c){if(null==a.control){var d=new mxRectangle(0,0,c.width,c.height);a.control=new mxImageShape(d,c.src);a.control.preserveImageAspect=!1;a.control.dialect=b.dialect;this.initControl(a,a.control,!0,this.createControlClickHandler(a))}}else null!=a.control&&(a.control.destroy(),a.control=null)};
mxCellRenderer.prototype.createControlClickHandler=function(a){var b=a.view.graph;return mxUtils.bind(this,function(c){if(this.forceControlClickHandler||b.isEnabled()){var d=!b.isCellCollapsed(a.cell);b.foldCells(d,!1,[a.cell],null,c);mxEvent.consume(c)}})};
mxCellRenderer.prototype.initControl=function(a,b,c,d){var e=a.view.graph;e.isHtmlLabel(a.cell)&&mxClient.NO_FO&&e.dialect==mxConstants.DIALECT_SVG?(b.dialect=mxConstants.DIALECT_PREFERHTML,b.init(e.container),b.node.style.zIndex=1):b.init(a.view.getOverlayPane());b=b.innerNode||b.node;null==d||mxClient.IS_IOS||(e.isEnabled()&&(b.style.cursor="pointer"),mxEvent.addListener(b,"click",d));if(c){var f=null;mxEvent.addGestureListeners(b,function(g){f=new mxPoint(mxEvent.getClientX(g),mxEvent.getClientY(g));
e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,a));mxEvent.consume(g)},function(g){e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,a))},function(g){e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(g,a));mxEvent.consume(g)});null!=d&&mxClient.IS_IOS&&b.addEventListener("touchend",function(g){if(null!=f){var k=e.tolerance;Math.abs(f.x-mxEvent.getClientX(g))<k&&Math.abs(f.y-mxEvent.getClientY(g))<k&&(d.call(d,g),mxEvent.consume(g))}},!0)}return b};
mxCellRenderer.prototype.isShapeEvent=function(a,b){return!0};mxCellRenderer.prototype.isLabelEvent=function(a,b){return!0};
mxCellRenderer.prototype.installListeners=function(a){var b=a.view.graph,c=function(d){var e=a;if(b.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(d).nodeName||mxClient.IS_TOUCH)e=mxEvent.getClientX(d),d=mxEvent.getClientY(d),d=mxUtils.convertPoint(b.container,e,d),e=b.view.getState(b.getCellAt(d.x,d.y));return e};mxEvent.addGestureListeners(a.shape.node,mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(d,a))}),mxUtils.bind(this,
function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(d,c(d)))}),mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(d,c(d)))}));b.nativeDblClickEnabled&&mxEvent.addListener(a.shape.node,"dblclick",mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&(b.dblClick(d,a.cell),mxEvent.consume(d))}))};
mxCellRenderer.prototype.redrawLabel=function(a,b){var c=a.view.graph,d=this.getLabelValue(a),e=c.isWrapping(a.cell),f=c.isLabelClipped(a.cell),g=a.view.graph.isHtmlLabel(a.cell)||null!=d&&mxUtils.isNode(d)?mxConstants.DIALECT_STRICTHTML:a.view.graph.dialect,k=a.style[mxConstants.STYLE_OVERFLOW]||"visible";null==a.text||a.text.wrap==e&&a.text.clipped==f&&a.text.overflow==k&&a.text.dialect==g||(a.text.destroy(),a.text=null);null==a.text&&null!=d&&(mxUtils.isNode(d)||0<d.length)?this.createLabel(a,
d):null==a.text||null!=d&&0!=d.length||(a.text.destroy(),a.text=null);if(null!=a.text){b&&(null!=a.text.lastValue&&this.isTextShapeInvalid(a,a.text)&&(a.text.lastValue=null),a.text.resetStyles(),a.text.apply(a),this.configureShape(a),a.text.valign=c.getVerticalAlign(a));c=this.getLabelBounds(a);var l=this.getTextScale(a);this.resolveColor(a,"color",mxConstants.STYLE_FONTCOLOR);if(b||a.text.value!=d||a.text.isWrapping!=e||a.text.overflow!=k||a.text.isClipping!=f||a.text.scale!=l||a.text.dialect!=g||
null==a.text.bounds||!a.text.bounds.equals(c))a.text.dialect=g,a.text.value=d,a.text.bounds=c,a.text.scale=l,a.text.wrap=e,a.text.clipped=f,a.text.overflow=k,b=a.text.node.style.visibility,this.redrawLabelShape(a.text),a.text.node.style.visibility=b}};
mxCellRenderer.prototype.isTextShapeInvalid=function(a,b){function c(d,e,f){return"spacingTop"==e||"spacingRight"==e||"spacingBottom"==e||"spacingLeft"==e?parseFloat(b[d])-parseFloat(b.spacing)!=(a.style[e]||f):b[d]!=(a.style[e]||f)}return c("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||c("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||c("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||c("color",mxConstants.STYLE_FONTCOLOR,"black")||
c("align",mxConstants.STYLE_ALIGN,"")||c("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||c("spacing",mxConstants.STYLE_SPACING,2)||c("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||c("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||c("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||c("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||c("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||c("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||c("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||c("opacity",
mxConstants.STYLE_TEXT_OPACITY,100)||c("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)};mxCellRenderer.prototype.redrawLabelShape=function(a){a.redraw()};mxCellRenderer.prototype.getTextScale=function(a){return a.view.scale};
mxCellRenderer.prototype.getLabelBounds=function(a){var b=a.view.graph,c=a.view.scale,d=b.getModel().isEdge(a.cell),e=new mxRectangle(a.absoluteOffset.x,a.absoluteOffset.y);if(d){var f=a.text.getSpacing();e.x+=f.x*c;e.y+=f.y*c;b=b.getCellGeometry(a.cell);null!=b&&(e.width=Math.max(0,b.width*c),e.height=Math.max(0,b.height*c))}else a.text.isPaintBoundsInverted()&&(b=e.x,e.x=e.y,e.y=b),e.x+=a.x,e.y+=a.y,e.width=Math.max(1,a.width),e.height=Math.max(1,a.height);a.text.isPaintBoundsInverted()&&(b=(a.width-
a.height)/2,e.x+=b,e.y-=b,b=e.width,e.width=e.height,e.height=b);null!=a.shape&&(b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),f=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),b==mxConstants.ALIGN_CENTER&&f==mxConstants.ALIGN_MIDDLE&&(e=a.shape.getLabelBounds(e)));b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);null!=b&&(e.width=parseFloat(b)*c);d||this.rotateLabelBounds(a,e);return e};
mxCellRenderer.prototype.rotateLabelBounds=function(a,b){b.y-=a.text.margin.y*b.height;b.x-=a.text.margin.x*b.width;if(!this.legacySpacing||"fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&"width"!=a.style[mxConstants.STYLE_OVERFLOW]&&("block"!=a.style[mxConstants.STYLE_OVERFLOW]||"1"==a.style[mxConstants.STYLE_BLOCK_SPACING])){var c=a.view.scale,d=a.text.getSpacing("1"==a.style[mxConstants.STYLE_BLOCK_SPACING]);b.x+=d.x*c;b.y+=d.y*c;d=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);
var e=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),f=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);b.width=Math.max(0,b.width-(d==mxConstants.ALIGN_CENTER&&null==f?a.text.spacingLeft*c+a.text.spacingRight*c:0));b.height=Math.max(0,b.height-(e==mxConstants.ALIGN_MIDDLE?a.text.spacingTop*c+a.text.spacingBottom*c:0))}d=a.text.getTextRotation();0!=d&&null!=a&&a.view.graph.model.isVertex(a.cell)&&(c=a.getCenterX(),a=a.getCenterY(),b.x!=c||
b.y!=a)&&(d*=Math.PI/180,a=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(d),Math.sin(d),new mxPoint(c,a)),b.x=a.x,b.y=a.y)};
mxCellRenderer.prototype.redrawCellOverlays=function(a,b){this.createCellOverlays(a);if(null!=a.overlays){var c=mxUtils.mod(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),90),d=mxUtils.toRadians(c),e=Math.cos(d),f=Math.sin(d);a.overlays.visit(function(g,k){g=k.overlay.getBounds(a);if(!a.view.graph.getModel().isEdge(a.cell)&&null!=a.shape&&0!=c){var l=g.getCenterX(),m=g.getCenterY();m=mxUtils.getRotatedPoint(new mxPoint(l,m),e,f,new mxPoint(a.getCenterX(),a.getCenterY()));l=m.x;m=m.y;g.x=Math.round(l-
g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.redraw()})}};
mxCellRenderer.prototype.redrawControl=function(a,b){var c=a.view.graph.getFoldingImage(a);if(null!=a.control&&null!=c){c=this.getControlBounds(a,c.width,c.height);var d=this.legacyControlPosition?mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0):a.shape.getTextRotation(),e=a.view.scale;if(b||a.control.scale!=e||!a.control.bounds.equals(c)||a.control.rotation!=d)a.control.rotation=d,a.control.bounds=c,a.control.scale=e,a.control.redraw()}};
mxCellRenderer.prototype.getControlBounds=function(a,b,c){if(null!=a.control){var d=a.view.scale,e=a.getCenterX(),f=a.getCenterY();if(!a.view.graph.getModel().isEdge(a.cell)&&(e=a.x+b*d,f=a.y+c*d,null!=a.shape)){var g=a.shape.getShapeRotation();if(this.legacyControlPosition)g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0);else if(a.shape.isPaintBoundsInverted()){var k=(a.width-a.height)/2;e+=k;f-=k}0!=g&&(k=mxUtils.toRadians(g),g=Math.cos(k),k=Math.sin(k),f=mxUtils.getRotatedPoint(new mxPoint(e,
f),g,k,new mxPoint(a.getCenterX(),a.getCenterY())),e=f.x,f=f.y)}return a.view.graph.getModel().isEdge(a.cell),new mxRectangle(Math.round(e-b/2*d),Math.round(f-c/2*d),Math.round(b*d),Math.round(c*d))}return null};
mxCellRenderer.prototype.insertStateAfter=function(a,b,c){for(var d=this.getShapesForState(a),e=0;e<d.length;e++)if(null!=d[e]&&null!=d[e].node){var f=d[e].node.parentNode!=a.view.getDrawPane()&&d[e].node.parentNode!=a.view.getOverlayPane(),g=f?c:b;if(null!=g&&g.nextSibling!=d[e].node)null==g.nextSibling?g.parentNode.appendChild(d[e].node):g.parentNode.insertBefore(d[e].node,g.nextSibling);else if(null==g)if(d[e].node.parentNode==a.view.graph.container){for(g=a.view.canvas;null!=g&&g.parentNode!=
a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSibling!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,g.nextSibling):d[e].node.parentNode.appendChild(d[e].node)}else null!=d[e].node.parentNode&&null!=d[e].node.parentNode.firstChild&&d[e].node.parentNode.firstChild!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,d[e].node.parentNode.firstChild);f?c=d[e].node:b=d[e].node}return[b,c]};
mxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);null==a.shape||null!=c&&!c||(this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b))};
mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE]&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a),
this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&a.shape.indicatorShape!=this.getShape(a.view.graph.getIndicatorShape(a))&&(null!=a.shape.indicator&&(a.shape.indicator.destroy(),a.shape.indicator=null),this.createIndicatorShape(a),
null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,null==c||c?this.doRedrawShape(a):a.shape.updateBoundingBox(),e=!0);return e};
mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};
mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(b,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};
var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&
p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));
null!=b&&null!=c&&(a=k?b.x:b.x+b.width,b=f.getRoutingCenterY(b),l=n?c.x:c.x+c.width,c=f.getRoutingCenterY(c),f=new mxPoint(a+(k?-d:d),b),g=new mxPoint(l+(n?-d:d),c),k==n?(d=k?Math.min(a,l)-d:Math.max(a,l)+d,e.push(new mxPoint(d,b)),e.push(new mxPoint(d,c))):(f.x<g.x==k?(d=b+(c-b)/2,e.push(f),e.push(new mxPoint(f.x,d)),e.push(new mxPoint(g.x,d))):e.push(f),e.push(g)))},Loop:function(a,b,c,d,e){c=a.absolutePoints;var f=c[c.length-1];if(null!=c[0]&&null!=f){if(null!=d&&0<d.length)for(b=0;b<d.length;b++)c=
d[b],c=a.view.transformControlPoint(a,c),e.push(new mxPoint(c.x,c.y))}else if(null!=b){f=a.view;var g=f.graph;c=null!=d&&0<d.length?d[0]:null;null!=c&&(c=f.transformControlPoint(a,c),mxUtils.contains(b,c.x,c.y)&&(c=null));var k=d=0,l=0,m=0;g=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,g.gridSize)*f.scale;a=mxUtils.getValue(a.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);a==mxConstants.DIRECTION_NORTH||a==mxConstants.DIRECTION_SOUTH?(d=f.getRoutingCenterX(b),k=g):(l=f.getRoutingCenterY(b),
m=g);null==c||c.x<b.x||c.x>b.x+b.width?null!=c?(d=c.x,m=Math.max(Math.abs(l-c.y),m)):a==mxConstants.DIRECTION_NORTH?l=b.y-2*k:a==mxConstants.DIRECTION_SOUTH?l=b.y+b.height+2*k:d=a==mxConstants.DIRECTION_EAST?b.x-2*m:b.x+b.width+2*m:null!=c&&(d=f.getRoutingCenterX(b),k=Math.max(Math.abs(d-c.x),m),l=c.y,m=0);e.push(new mxPoint(d-k,l-m));e.push(new mxPoint(d+k,l+m))}},ElbowConnector:function(a,b,c,d,e){var f=null!=d&&0<d.length?d[0]:null,g=!1,k=!1;if(null!=b&&null!=c)if(null!=f){var l=Math.min(b.x,c.x),
m=Math.max(b.x+b.width,c.x+c.width);k=Math.min(b.y,c.y);var n=Math.max(b.y+b.height,c.y+c.height);f=a.view.transformControlPoint(a,f);g=f.y<k||f.y>n;k=f.x<l||f.x>m}else l=Math.max(b.x,c.x),m=Math.min(b.x+b.width,c.x+c.width),(g=l==m)||(k=Math.max(b.y,c.y),n=Math.min(b.y+b.height,c.y+c.height),k=k==n);k||!g&&a.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(a,b,c,d,e):mxEdgeStyle.TopToBottom(a,b,c,d,e)},SideToSide:function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length?
d[0]:null;var g=a.absolutePoints,k=g[0];g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null!=k&&(b=new mxCellState,b.x=k.x,b.y=k.y);null!=g&&(c=new mxCellState,c.x=g.x,c.y=g.y);null!=b&&null!=c&&(a=Math.max(b.x,c.x),k=Math.min(b.x+b.width,c.x+c.width),a=null!=d?d.x:Math.round(k+(a-k)/2),k=f.getRoutingCenterY(b),f=f.getRoutingCenterY(c),null!=d&&(d.y>=b.y&&d.y<=b.y+b.height&&(k=d.y),d.y>=c.y&&d.y<=c.y+c.height&&(f=d.y)),mxUtils.contains(c,a,k)||mxUtils.contains(b,a,k)||e.push(new mxPoint(a,
k)),mxUtils.contains(c,a,f)||mxUtils.contains(b,a,f)||e.push(new mxPoint(a,f)),1==e.length&&(null!=d?mxUtils.contains(c,a,d.y)||mxUtils.contains(b,a,d.y)||e.push(new mxPoint(a,d.y)):(f=Math.max(b.y,c.y),e.push(new mxPoint(a,f+(Math.min(b.y+b.height,c.y+c.height)-f)/2)))))},TopToBottom:function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,k=g[0];g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null!=k&&(b=new mxCellState,b.x=k.x,b.y=k.y);null!=g&&(c=new mxCellState,
c.x=g.x,c.y=g.y);null!=b&&null!=c&&(k=Math.max(b.y,c.y),g=Math.min(b.y+b.height,c.y+c.height),a=f.getRoutingCenterX(b),null!=d&&d.x>=b.x&&d.x<=b.x+b.width&&(a=d.x),k=null!=d?d.y:Math.round(g+(k-g)/2),mxUtils.contains(c,a,k)||mxUtils.contains(b,a,k)||e.push(new mxPoint(a,k)),a=null!=d&&d.x>=c.x&&d.x<=c.x+c.width?d.x:f.getRoutingCenterX(c),mxUtils.contains(c,a,k)||mxUtils.contains(b,a,k)||e.push(new mxPoint(a,k)),1==e.length&&(null!=d&&1==e.length?mxUtils.contains(c,d.x,k)||mxUtils.contains(b,d.x,k)||
e.push(new mxPoint(d.x,k)):(f=Math.max(b.x,c.x),e.push(new mxPoint(f+(Math.min(b.x+b.width,c.x+c.width)-f)/2,k)))))},SegmentConnector:function(a,b,c,d,e){var f=mxEdgeStyle.scalePointArray(a.absolutePoints,a.view.scale);b=mxEdgeStyle.scaleCellState(b,a.view.scale);var g=mxEdgeStyle.scaleCellState(c,a.view.scale);c=[];var k=0<e.length?e[0]:null,l=!0,m=f[0];null==m&&null!=b?m=new mxPoint(a.view.getRoutingCenterX(b),a.view.getRoutingCenterY(b)):null!=m&&(m=m.clone());var n=f.length-1;if(null!=d&&0<d.length){for(var p=
[],r=0;r<d.length;r++){var q=a.view.transformControlPoint(a,d[r],!0);null!=q&&p.push(q)}if(0==p.length)return;null!=m&&null!=p[0]&&(1>Math.abs(p[0].x-m.x)&&(p[0].x=m.x),1>Math.abs(p[0].y-m.y)&&(p[0].y=m.y));q=f[n];null!=q&&null!=p[p.length-1]&&(1>Math.abs(p[p.length-1].x-q.x)&&(p[p.length-1].x=q.x),1>Math.abs(p[p.length-1].y-q.y)&&(p[p.length-1].y=q.y));d=p[0];var t=b,u=f[0],x=d;null!=u&&(t=null);for(r=0;2>r;r++){var A=null!=u&&u.x==x.x,E=null!=u&&u.y==x.y,C=null!=t&&x.y>=t.y&&x.y<=t.y+t.height,D=
null!=t&&x.x>=t.x&&x.x<=t.x+t.width;t=E||null==u&&C;x=A||null==u&&D;if(0!=r||!(t&&x||A&&E)){if(null!=u&&!E&&!A&&(C||D)){l=C?!1:!0;break}if(x||t){l=t;1==r&&(l=0==p.length%2?t:x);break}}t=g;u=f[n];null!=u&&(t=null);x=p[p.length-1];A&&E&&(p=p.slice(1))}l&&(null!=f[0]&&f[0].y!=d.y||null==f[0]&&null!=b&&(d.y<b.y||d.y>b.y+b.height))?c.push(new mxPoint(m.x,d.y)):!l&&(null!=f[0]&&f[0].x!=d.x||null==f[0]&&null!=b&&(d.x<b.x||d.x>b.x+b.width))&&c.push(new mxPoint(d.x,m.y));l?m.y=d.y:m.x=d.x;for(r=0;r<p.length;r++)l=
!l,d=p[r],l?m.y=d.y:m.x=d.x,c.push(m.clone())}else d=m,l=!0;m=f[n];null==m&&null!=g&&(m=new mxPoint(a.view.getRoutingCenterX(g),a.view.getRoutingCenterY(g)));null!=m&&null!=d&&(l&&(null!=f[n]&&f[n].y!=d.y||null==f[n]&&null!=g&&(d.y<g.y||d.y>g.y+g.height))?c.push(new mxPoint(m.x,d.y)):!l&&(null!=f[n]&&f[n].x!=d.x||null==f[n]&&null!=g&&(d.x<g.x||d.x>g.x+g.width))&&c.push(new mxPoint(d.x,m.y)));if(null==f[0]&&null!=b)for(;0<c.length&&null!=c[0]&&mxUtils.contains(b,c[0].x,c[0].y);)c.splice(0,1);if(null==
f[n]&&null!=g)for(;0<c.length&&null!=c[c.length-1]&&mxUtils.contains(g,c[c.length-1].x,c[c.length-1].y);)c.splice(c.length-1,1);for(r=0;r<c.length;r++)if(f=c[r],f.x=Math.round(f.x*a.view.scale*10)/10,f.y=Math.round(f.y*a.view.scale*10)/10,null==k||1<=Math.abs(k.x-f.x)||Math.abs(k.y-f.y)>=Math.max(1,a.view.scale))e.push(f),k=f;null!=q&&null!=e[e.length-1]&&1>=Math.abs(q.x-e[e.length-1].x)&&1>=Math.abs(q.y-e[e.length-1].y)&&(e.splice(e.length-1,1),null!=e[e.length-1]&&(1>Math.abs(e[e.length-1].x-q.x)&&
(e[e.length-1].x=q.x),1>Math.abs(e[e.length-1].y-q.y)&&(e[e.length-1].y=q.y)))},orthBuffer:10,orthPointsFallback:!0,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,
2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,
BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,getJettySize:function(a,b){var c=mxUtils.getValue(a.style,b?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(a.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));"auto"==c&&(mxUtils.getValue(a.style,b?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE?(a=mxUtils.getNumber(a.style,b?mxConstants.STYLE_STARTSIZE:
mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),c=Math.max(2,Math.ceil((a+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer):c=2*mxEdgeStyle.orthBuffer);return c},scalePointArray:function(a,b){var c=[];if(null!=a)for(var d=0;d<a.length;d++)if(null!=a[d]){var e=new mxPoint(Math.round(a[d].x/b*10)/10,Math.round(a[d].y/b*10)/10);c[d]=e}else c[d]=null;else c=null;return c},scaleCellState:function(a,b){if(null!=a){var c=a.clone();c.setRect(Math.round(a.x/b*10)/10,Math.round(a.y/
b*10)/10,Math.round(a.width/b*10)/10,Math.round(a.height/b*10)/10)}else c=null;return c},OrthConnector:function(a,b,c,d,e){var f=a.view.graph,g=null==l?!1:f.getModel().isEdge(l.cell),k=null==m?!1:f.getModel().isEdge(m.cell);f=mxEdgeStyle.scalePointArray(a.absolutePoints,a.view.scale);var l=mxEdgeStyle.scaleCellState(b,a.view.scale),m=mxEdgeStyle.scaleCellState(c,a.view.scale),n=f[0],p=f[f.length-1],r=null!=l?l.x:n.x,q=null!=l?l.y:n.y,t=null!=l?l.width:0,u=null!=l?l.height:0,x=null!=m?m.x:p.x,A=null!=
m?m.y:p.y,E=null!=m?m.width:0,C=null!=m?m.height:0;f=mxEdgeStyle.getJettySize(a,!0);var D=mxEdgeStyle.getJettySize(a,!1);null!=l&&m==l&&(f=D=Math.max(f,D));var B=D+f,v=!1;if(null!=n&&null!=p){v=p.x-n.x;var y=p.y-n.y;v=v*v+y*y<B*B}if(v||mxEdgeStyle.orthPointsFallback&&null!=d&&0<d.length||g||k)mxEdgeStyle.SegmentConnector(a,b,c,d,e);else{c=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL];null!=l&&(c[0]=mxUtils.getPortConstraints(l,a,!0,mxConstants.DIRECTION_MASK_ALL),b=mxUtils.getValue(l.style,
mxConstants.STYLE_ROTATION,0),0!=b&&(b=mxUtils.getBoundingBox(new mxRectangle(r,q,t,u),b),r=b.x,q=b.y,t=b.width,u=b.height));null!=m&&(c[1]=mxUtils.getPortConstraints(m,a,!1,mxConstants.DIRECTION_MASK_ALL),b=mxUtils.getValue(m.style,mxConstants.STYLE_ROTATION,0),0!=b&&(b=mxUtils.getBoundingBox(new mxRectangle(x,A,E,C),b),x=b.x,A=b.y,E=b.width,C=b.height));b=[0,0];r=[[r,q,t,u],[x,A,E,C]];D=[f,D];for(v=0;2>v;v++)mxEdgeStyle.limits[v][1]=r[v][0]-D[v],mxEdgeStyle.limits[v][2]=r[v][1]-D[v],mxEdgeStyle.limits[v][4]=
r[v][0]+r[v][2]+D[v],mxEdgeStyle.limits[v][8]=r[v][1]+r[v][3]+D[v];D=r[0][1]+r[0][3]/2;q=r[1][1]+r[1][3]/2;v=r[0][0]+r[0][2]/2-(r[1][0]+r[1][2]/2);y=D-q;D=0;0>v?D=0>y?2:1:0>=y&&(D=3,0==v&&(D=2));q=null;null!=l&&(q=n);l=[[.5,.5],[.5,.5]];for(v=0;2>v;v++)null!=q&&(l[v][0]=(q.x-r[v][0])/r[v][2],1>=Math.abs(q.x-r[v][0])?b[v]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(q.x-r[v][0]-r[v][2])&&(b[v]=mxConstants.DIRECTION_MASK_EAST),l[v][1]=(q.y-r[v][1])/r[v][3],1>=Math.abs(q.y-r[v][1])?b[v]=mxConstants.DIRECTION_MASK_NORTH:
1>=Math.abs(q.y-r[v][1]-r[v][3])&&(b[v]=mxConstants.DIRECTION_MASK_SOUTH)),q=null,null!=m&&(q=p);v=r[0][1]-(r[1][1]+r[1][3]);p=r[0][0]-(r[1][0]+r[1][2]);q=r[1][1]-(r[0][1]+r[0][3]);t=r[1][0]-(r[0][0]+r[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(p-B,0);mxEdgeStyle.vertexSeperations[2]=Math.max(v-B,0);mxEdgeStyle.vertexSeperations[4]=Math.max(q-B,0);mxEdgeStyle.vertexSeperations[3]=Math.max(t-B,0);B=[];m=[];n=[];m[0]=p>=t?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;n[0]=v>=
q?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;m[1]=mxUtils.reversePortConstraints(m[0]);n[1]=mxUtils.reversePortConstraints(n[0]);p=p>=t?p:t;q=v>=q?v:q;t=[[0,0],[0,0]];u=!1;for(v=0;2>v;v++)0==b[v]&&(0==(m[v]&c[v])&&(m[v]=mxUtils.reversePortConstraints(m[v])),0==(n[v]&c[v])&&(n[v]=mxUtils.reversePortConstraints(n[v])),t[v][0]=n[v],t[v][1]=m[v]);0<q&&0<p&&(0<(m[0]&c[0])&&0<(n[1]&c[1])?(t[0][0]=m[0],t[0][1]=n[0],t[1][0]=n[1],t[1][1]=m[1],u=!0):0<(n[0]&c[0])&&0<(m[1]&c[1])&&(t[0][0]=
n[0],t[0][1]=m[0],t[1][0]=m[1],t[1][1]=n[1],u=!0));0<q&&!u&&(t[0][0]=n[0],t[0][1]=m[0],t[1][0]=n[1],t[1][1]=m[1],u=!0);0<p&&!u&&(t[0][0]=m[0],t[0][1]=n[0],t[1][0]=m[1],t[1][1]=n[1]);for(v=0;2>v;v++)0==b[v]&&(0==(t[v][0]&c[v])&&(t[v][0]=t[v][1]),B[v]=t[v][0]&c[v],B[v]|=(t[v][1]&c[v])<<8,B[v]|=(t[1-v][v]&c[v])<<16,B[v]|=(t[1-v][1-v]&c[v])<<24,0==(B[v]&15)&&(B[v]<<=8),0==(B[v]&3840)&&(B[v]=B[v]&15|B[v]>>8),0==(B[v]&983040)&&(B[v]=B[v]&65535|(B[v]&251658240)>>8),b[v]=B[v]&15,c[v]==mxConstants.DIRECTION_MASK_WEST||
c[v]==mxConstants.DIRECTION_MASK_NORTH||c[v]==mxConstants.DIRECTION_MASK_EAST||c[v]==mxConstants.DIRECTION_MASK_SOUTH)&&(b[v]=c[v]);c=b[0]==mxConstants.DIRECTION_MASK_EAST?3:b[0];B=b[1]==mxConstants.DIRECTION_MASK_EAST?3:b[1];c-=D;B-=D;1>c&&(c+=4);1>B&&(B+=4);c=mxEdgeStyle.routePatterns[c-1][B-1];mxEdgeStyle.wayPoints1[0][0]=r[0][0];mxEdgeStyle.wayPoints1[0][1]=r[0][1];switch(b[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=f;mxEdgeStyle.wayPoints1[0][1]+=l[0][1]*r[0][3];break;
case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=l[0][0]*r[0][2];mxEdgeStyle.wayPoints1[0][1]+=r[0][3]+f;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=r[0][2]+f;mxEdgeStyle.wayPoints1[0][1]+=l[0][1]*r[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=l[0][0]*r[0][2],mxEdgeStyle.wayPoints1[0][1]-=f}f=0;m=B=0<(b[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1;for(v=0;v<c.length;v++)n=c[v]&15,u=n==mxConstants.DIRECTION_MASK_EAST?
3:n,u+=D,4<u&&(u-=4),p=mxEdgeStyle.dirVectors[u-1],n=0<u%2?0:1,n!=B&&(f++,mxEdgeStyle.wayPoints1[f][0]=mxEdgeStyle.wayPoints1[f-1][0],mxEdgeStyle.wayPoints1[f][1]=mxEdgeStyle.wayPoints1[f-1][1]),x=0<(c[v]&mxEdgeStyle.TARGET_MASK),A=0<(c[v]&mxEdgeStyle.SOURCE_MASK),q=(c[v]&mxEdgeStyle.SIDE_MASK)>>5,q<<=D,15<q&&(q>>=4),t=0<(c[v]&mxEdgeStyle.CENTER_MASK),(A||x)&&9>q?(u=A?0:1,q=t&&0==n?r[u][0]+l[u][0]*r[u][2]:t?r[u][1]+l[u][1]*r[u][3]:mxEdgeStyle.limits[u][q],0==n?(q=(q-mxEdgeStyle.wayPoints1[f][0])*
p[0],0<q&&(mxEdgeStyle.wayPoints1[f][0]+=p[0]*q)):(q=(q-mxEdgeStyle.wayPoints1[f][1])*p[1],0<q&&(mxEdgeStyle.wayPoints1[f][1]+=p[1]*q))):t&&(mxEdgeStyle.wayPoints1[f][0]+=p[0]*Math.abs(mxEdgeStyle.vertexSeperations[u]/2),mxEdgeStyle.wayPoints1[f][1]+=p[1]*Math.abs(mxEdgeStyle.vertexSeperations[u]/2)),0<f&&mxEdgeStyle.wayPoints1[f][n]==mxEdgeStyle.wayPoints1[f-1][n]?f--:B=n;for(v=0;v<=f&&(v!=f||((0<(b[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==m?0:1)==(f+1)%2);v++)e.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[v][0]*
a.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[v][1]*a.view.scale*10)/10));for(a=1;a<e.length;)null==e[a-1]||null==e[a]||e[a-1].x!=e[a].x||e[a-1].y!=e[a].y?a++:e.splice(a,1)}},getRoutePattern:function(a,b,c,d){var e=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];a=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];e-=b;a-=b;1>e&&(e+=4);1>a&&(a+=4);b=routePatterns[e-1][a-1];0!=c&&0!=d||null==inlineRoutePatterns[e-1][a-1]||(b=inlineRoutePatterns[e-1][a-1]);return b}},mxStyleRegistry={values:[],putValue:function(a,
b){mxStyleRegistry.values[a]=b},getValue:function(a){return mxStyleRegistry.values[a]},getName:function(a){for(var b in mxStyleRegistry.values)if(mxStyleRegistry.values[b]==a)return b;return null}};mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide);
mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector);mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter);
mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_HEXAGON,mxPerimeter.HexagonPerimeter);function mxGraphView(a){this.graph=a;this.translate=new mxPoint;this.graphBounds=new mxRectangle;this.states=new mxDictionary}mxGraphView.prototype=new mxEventSource;mxGraphView.prototype.constructor=mxGraphView;mxGraphView.prototype.EMPTY_POINT=new mxPoint;mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"";
mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"";mxGraphView.prototype.allowEval=!1;mxGraphView.prototype.captureDocumentGesture=!0;mxGraphView.prototype.rendering=!0;mxGraphView.prototype.graph=null;mxGraphView.prototype.currentRoot=null;mxGraphView.prototype.graphBounds=null;mxGraphView.prototype.scale=1;mxGraphView.prototype.translate=null;mxGraphView.prototype.states=null;mxGraphView.prototype.updateStyle=!1;mxGraphView.prototype.lastNode=null;
mxGraphView.prototype.lastHtmlNode=null;mxGraphView.prototype.lastForegroundNode=null;mxGraphView.prototype.lastForegroundHtmlNode=null;mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds};mxGraphView.prototype.setGraphBounds=function(a){this.graphBounds=a};
mxGraphView.prototype.getBounds=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.getState(a[d]);null!=e&&(null==b?b=mxRectangle.fromRectangle(e):b.add(e))}return b};mxGraphView.prototype.setCurrentRoot=function(a){if(this.currentRoot!=a){var b=new mxCurrentRootChange(this,a);b.execute();var c=new mxUndoableEdit(this,!0);c.add(b);this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",c));this.graph.sizeDidChange()}return a};
mxGraphView.prototype.scaleAndTranslate=function(a,b,c){var d=this.scale,e=new mxPoint(this.translate.x,this.translate.y);if(this.scale!=a||this.translate.x!=b||this.translate.y!=c)this.scale=a,this.translate.x=b,this.translate.y=c,this.isEventsEnabled()&&this.viewStateChanged();this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",a,"previousScale",d,"translate",this.translate,"previousTranslate",e))};mxGraphView.prototype.getScale=function(){return this.scale};
mxGraphView.prototype.setScale=function(a){var b=this.scale;this.scale!=a&&(this.scale=a,this.isEventsEnabled()&&this.viewStateChanged());this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",a,"previousScale",b))};mxGraphView.prototype.getTranslate=function(){return this.translate};
mxGraphView.prototype.setTranslate=function(a,b){var c=new mxPoint(this.translate.x,this.translate.y);if(this.translate.x!=a||this.translate.y!=b)this.translate.x=a,this.translate.y=b,this.isEventsEnabled()&&this.viewStateChanged();this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",c))};mxGraphView.prototype.viewStateChanged=function(){this.revalidate();this.graph.sizeDidChange()};
mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear();this.revalidate()};mxGraphView.prototype.revalidate=function(){this.invalidate();this.validate()};mxGraphView.prototype.clear=function(a,b,c){var d=this.graph.getModel();a=a||d.getRoot();b=null!=b?b:!1;c=null!=c?c:!0;this.removeState(a);if(c&&(b||a!=this.currentRoot)){c=d.getChildCount(a);for(var e=0;e<c;e++)this.clear(d.getChildAt(a,e),b)}else this.invalidate(a)};
mxGraphView.prototype.invalidate=function(a,b,c){var d=this.graph.getModel();a=a||d.getRoot();b=null!=b?b:!0;c=null!=c?c:!0;var e=this.getState(a);null!=e&&(e.invalid=!0);if(!a.invalidating){a.invalidating=!0;if(b){var f=d.getChildCount(a);for(e=0;e<f;e++){var g=d.getChildAt(a,e);this.invalidate(g,b,c)}}if(c)for(f=d.getEdgeCount(a),e=0;e<f;e++)this.invalidate(d.getEdgeAt(a,e),b,c);delete a.invalidating}};
mxGraphView.prototype.validate=function(a){var b=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;this.resetValidationState();var c=null;null==this.canvas||null!=this.textDiv||8!=document.documentMode||mxClient.IS_EM||(this.placeholder=document.createElement("div"),this.placeholder.style.position="absolute",this.placeholder.style.width=this.canvas.clientWidth+"px",this.placeholder.style.height=this.canvas.clientHeight+
"px",this.canvas.parentNode.appendChild(this.placeholder),c=this.drawPane.style.display,this.canvas.style.display="none",this.textDiv=document.createElement("div"),this.textDiv.style.position="absolute",this.textDiv.style.whiteSpace="nowrap",this.textDiv.style.visibility="hidden",this.textDiv.style.display="inline-block",this.textDiv.style.zoom="1",document.body.appendChild(this.textDiv));a=this.getBoundingBox(this.validateCellState(this.validateCell(a||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()))));
this.setGraphBounds(null!=a?a:this.getEmptyBounds());this.validateBackground();null!=c&&(this.canvas.style.display=c,this.textDiv.parentNode.removeChild(this.textDiv),null!=this.placeholder&&this.placeholder.parentNode.removeChild(this.placeholder),this.textDiv=null);this.resetValidationState();window.status=mxResources.get(this.doneResource)||this.doneResource;mxLog.leave("mxGraphView.validate",b)};
mxGraphView.prototype.getEmptyBounds=function(){return new mxRectangle(this.translate.x*this.scale,this.translate.y*this.scale)};
mxGraphView.prototype.getBoundingBox=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&(null!=a.shape&&null!=a.shape.boundingBox&&(c=a.shape.boundingBox.clone()),null!=a.text&&null!=a.text.boundingBox&&(null!=c?c.add(a.text.boundingBox):c=a.text.boundingBox.clone()),b)){b=this.graph.getModel();for(var d=b.getChildCount(a.cell),e=0;e<d;e++){var f=this.getBoundingBox(this.getState(b.getChildAt(a.cell,e)));null!=f&&(null==c?c=f:c.add(f))}}return c};
mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"white","black")};mxGraphView.prototype.validateBackground=function(){this.validateBackgroundImage();this.validateBackgroundPage()};
mxGraphView.prototype.validateBackgroundImage=function(){var a=this.graph.getBackgroundImage();if(null!=a){if(null==this.backgroundImage||this.backgroundImage.image!=a.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var b=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(b,a.src);this.backgroundImage.dialect=this.graph.dialect;this.backgroundImage.init(this.backgroundPane);this.backgroundImage.redraw();8!=document.documentMode||mxClient.IS_EM||mxEvent.addGestureListeners(this.backgroundImage.node,
mxUtils.bind(this,function(c){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))}))}this.redrawBackgroundImage(this.backgroundImage,a)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null)};
mxGraphView.prototype.validateBackgroundPage=function(){if(this.graph.pageVisible){var a=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(a),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),this.graph.nativeDblClickEnabled&&mxEvent.addListener(this.backgroundPageShape.node,
"dblclick",mxUtils.bind(this,function(b){this.graph.dblClick(b)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(b){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(b))}),mxUtils.bind(this,function(b){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide();this.graph.isMouseDown&&!mxEvent.isConsumed(b)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(b))}),mxUtils.bind(this,function(b){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,
new mxMouseEvent(b))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=a,this.backgroundPageShape.redraw())}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.graph.pageFormat,b=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,a.width*b,a.height*b)};
mxGraphView.prototype.redrawBackgroundImage=function(a,b){a.scale=this.scale;a.bounds.x=this.scale*(this.translate.x+b.x);a.bounds.y=this.scale*(this.translate.y+b.y);a.bounds.width=this.scale*b.width;a.bounds.height=this.scale*b.height;a.redraw()};
mxGraphView.prototype.validateCell=function(a,b){if(null!=a)if(b=(null!=b?b:!0)&&this.graph.isCellVisible(a),null==this.getState(a,b)||b)for(var c=this.graph.getModel(),d=c.getChildCount(a),e=0;e<d;e++)this.validateCell(c.getChildAt(a,e),b&&(!this.isCellCollapsed(a)||a==this.currentRoot));else this.removeState(a);return a};
mxGraphView.prototype.validateCellState=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&(c=this.getState(a),null!=c)){var d=this.graph.getModel();if(c.invalid){c.invalid=!1;if(null==c.style||c.invalidStyle)c.style=this.graph.getCellStyle(c.cell),c.invalidStyle=!1;a!=this.currentRoot&&this.validateCellState(d.getParent(a),!1);c.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(a,!0),!1),!0);c.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(a,!1),!1),
!1);this.updateCellState(c);a==this.currentRoot||c.invalid||(this.graph.cellRenderer.redraw(c,!1,this.isRendering()),c.updateCachedBounds())}if(b&&!c.invalid){null!=c.shape&&this.stateValidated(c);b=d.getChildCount(a);for(var e=0;e<b;e++)this.validateCellState(d.getChildAt(a,e))}}return c};
mxGraphView.prototype.updateCellState=function(a){a.absoluteOffset.x=0;a.absoluteOffset.y=0;a.origin.x=0;a.origin.y=0;a.length=0;if(a.cell!=this.currentRoot){var b=this.graph.getModel(),c=this.getState(b.getParent(a.cell));null!=c&&c.cell!=this.currentRoot&&(a.origin.x+=c.origin.x,a.origin.y+=c.origin.y);var d=this.graph.getChildOffsetForCell(a.cell);null!=d&&(a.origin.x+=d.x,a.origin.y+=d.y);var e=this.graph.getCellGeometry(a.cell);null!=e&&(b.isEdge(a.cell)||(d=null!=e.offset?e.offset:this.EMPTY_POINT,
e.relative&&null!=c?b.isEdge(c.cell)?(d=this.getPoint(c,e),null!=d&&(a.origin.x+=d.x/this.scale-c.origin.x-this.translate.x,a.origin.y+=d.y/this.scale-c.origin.y-this.translate.y)):(a.origin.x+=e.x*c.unscaledWidth+d.x,a.origin.y+=e.y*c.unscaledHeight+d.y):(a.absoluteOffset.x=this.scale*d.x,a.absoluteOffset.y=this.scale*d.y,a.origin.x+=e.x,a.origin.y+=e.y)),a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*e.width,a.unscaledWidth=e.width,a.height=
this.scale*e.height,a.unscaledHeight=e.height,b.isVertex(a.cell)&&this.updateVertexState(a,e),b.isEdge(a.cell)&&this.updateEdgeState(a,e))}a.updateCachedBounds()};mxGraphView.prototype.isCellCollapsed=function(a){return this.graph.isCellCollapsed(a)};
mxGraphView.prototype.updateVertexState=function(a,b){var c=this.graph.getModel(),d=this.getState(c.getParent(a.cell));if(b.relative&&null!=d&&!c.isEdge(d.cell)&&(c=mxUtils.toRadians(d.style[mxConstants.STYLE_ROTATION]||"0"),0!=c)){b=Math.cos(c);c=Math.sin(c);var e=new mxPoint(a.getCenterX(),a.getCenterY());d=new mxPoint(d.getCenterX(),d.getCenterY());d=mxUtils.getRotatedPoint(e,b,c,d);a.x=d.x-a.width/2;a.y=d.y-a.height/2}this.updateVertexLabelOffset(a)};
mxGraphView.prototype.updateEdgeState=function(a,b){var c=a.getVisibleTerminalState(!0),d=a.getVisibleTerminalState(!1);null!=this.graph.model.getTerminal(a.cell,!0)&&null==c||null==c&&null==b.getTerminalPoint(!0)||null!=this.graph.model.getTerminal(a.cell,!1)&&null==d||null==d&&null==b.getTerminalPoint(!1)?this.clear(a.cell,!0):(this.updateFixedTerminalPoints(a,c,d),this.updatePoints(a,b.points,c,d),this.updateFloatingTerminalPoints(a,c,d),b=a.absolutePoints,a.cell!=this.currentRoot&&(null==b||2>
b.length||null==b[0]||null==b[b.length-1])?this.clear(a.cell,!0):(this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)))};
mxGraphView.prototype.updateVertexLabelOffset=function(a){var b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);if(b==mxConstants.ALIGN_LEFT)b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null),b=null!=b?b*this.scale:a.width,a.absoluteOffset.x-=b;else if(b==mxConstants.ALIGN_RIGHT)a.absoluteOffset.x+=a.width;else if(b==mxConstants.ALIGN_CENTER&&(b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null),null!=b)){var c=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,
mxConstants.ALIGN_CENTER),d=0;c==mxConstants.ALIGN_CENTER?d=.5:c==mxConstants.ALIGN_RIGHT&&(d=1);0!=d&&(a.absoluteOffset.x-=(b*this.scale-a.width)*d)}b=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);b==mxConstants.ALIGN_TOP?a.absoluteOffset.y-=a.height:b==mxConstants.ALIGN_BOTTOM&&(a.absoluteOffset.y+=a.height)};mxGraphView.prototype.resetValidationState=function(){this.lastForegroundHtmlNode=this.lastForegroundNode=this.lastHtmlNode=this.lastNode=null};
mxGraphView.prototype.stateValidated=function(a){var b=this.graph.getModel().isEdge(a.cell)&&this.graph.keepEdgesInForeground||this.graph.getModel().isVertex(a.cell)&&this.graph.keepEdgesInBackground;a=this.graph.cellRenderer.insertStateAfter(a,b?this.lastForegroundNode||this.lastNode:this.lastNode,b?this.lastForegroundHtmlNode||this.lastHtmlNode:this.lastHtmlNode);b?(this.lastForegroundHtmlNode=a[1],this.lastForegroundNode=a[0]):(this.lastHtmlNode=a[1],this.lastNode=a[0])};
mxGraphView.prototype.updateFixedTerminalPoints=function(a,b,c){this.updateFixedTerminalPoint(a,b,!0,this.graph.getConnectionConstraint(a,b,!0));this.updateFixedTerminalPoint(a,c,!1,this.graph.getConnectionConstraint(a,c,!1))};mxGraphView.prototype.updateFixedTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(a,b,c,d),c)};
mxGraphView.prototype.getFixedTerminalPoint=function(a,b,c,d){var e=null;null!=d&&(e=this.graph.getConnectionPoint(b,d,!1));if(null==e&&null==b){b=this.scale;d=this.translate;var f=a.origin;e=this.graph.getCellGeometry(a.cell).getTerminalPoint(c);null!=e&&(e=new mxPoint(b*(d.x+e.x+f.x),b*(d.y+e.y+f.y)))}return e};
mxGraphView.prototype.updateBoundsFromStencil=function(a){var b=null;if(null!=a&&null!=a.shape&&null!=a.shape.stencil&&"fixed"==a.shape.stencil.aspect){b=mxRectangle.fromRectangle(a);var c=a.shape.stencil.computeAspect(a.style,a.x,a.y,a.width,a.height);a.setRect(c.x,c.y,a.shape.stencil.w0*c.width,a.shape.stencil.h0*c.height)}return b};
mxGraphView.prototype.updatePoints=function(a,b,c,d){if(null!=a){var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),k=this.updateBoundsFromStencil(d);f(a,c,d,b,e);null!=g&&c.setRect(g.x,g.y,g.width,g.height);null!=k&&d.setRect(k.x,k.y,k.width,k.height)}else if(null!=b)for(f=0;f<b.length;f++)null!=b[f]&&(c=mxUtils.clone(b[f]),e.push(this.transformControlPoint(a,c)));b=
a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.transformControlPoint=function(a,b,c){return null!=a&&null!=b?(a=a.origin,c=c?1:this.scale,new mxPoint(c*(b.x+this.translate.x+a.x),c*(b.y+this.translate.y+a.y))):null};
mxGraphView.prototype.isLoopStyleEnabled=function(a,b,c,d){var e=this.graph.getConnectionConstraint(a,c,!0),f=this.graph.getConnectionConstraint(a,d,!1);return!(null==b||2>b.length)||mxUtils.getValue(a.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)&&(null!=e&&null!=e.point||null!=f&&null!=f.point)?!1:null!=c&&c==d};
mxGraphView.prototype.getEdgeStyle=function(a,b,c,d){a=this.isLoopStyleEnabled(a,b,c,d)?mxUtils.getValue(a.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(a.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:a.style[mxConstants.STYLE_EDGE];"string"==typeof a&&(b=mxStyleRegistry.getValue(a),null==b&&this.isAllowEval()&&(b=mxUtils.eval(a)),a=b);return"function"==typeof a?a:null};
mxGraphView.prototype.updateFloatingTerminalPoints=function(a,b,c){var d=a.absolutePoints,e=d[0];null==d[d.length-1]&&null!=c&&this.updateFloatingTerminalPoint(a,c,b,!1);null==e&&null!=b&&this.updateFloatingTerminalPoint(a,b,c,!0)};mxGraphView.prototype.updateFloatingTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(a,b,c,d),d)};
mxGraphView.prototype.getFloatingTerminalPoint=function(a,b,c,d){b=this.getTerminalPort(a,b,d);var e=this.getNextPoint(a,c,d),f=this.graph.isOrthogonal(a);c=mxUtils.toRadians(Number(b.style[mxConstants.STYLE_ROTATION]||"0"));var g=new mxPoint(b.getCenterX(),b.getCenterY());if(0!=c){var k=Math.cos(-c),l=Math.sin(-c);e=mxUtils.getRotatedPoint(e,k,l,g)}k=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);k+=parseFloat(a.style[d?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||
0);a=this.getPerimeterPoint(b,e,0==c&&f,k);0!=c&&(k=Math.cos(c),l=Math.sin(c),a=mxUtils.getRotatedPoint(a,k,l,g));return a};mxGraphView.prototype.getTerminalPort=function(a,b,c){a=mxUtils.getValue(a.style,c?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT);null!=a&&(a=this.getState(this.graph.getModel().getCell(a)),null!=a&&(b=a));return b};
mxGraphView.prototype.getPerimeterPoint=function(a,b,c,d){var e=null;if(null!=a){var f=this.getPerimeterFunction(a);if(null!=f&&null!=b&&(d=this.getPerimeterBounds(a,d),0<d.width||0<d.height)){e=new mxPoint(b.x,b.y);var g=b=!1;this.graph.model.isVertex(a.cell)&&(b=1==mxUtils.getValue(a.style,mxConstants.STYLE_FLIPH,0),g=1==mxUtils.getValue(a.style,mxConstants.STYLE_FLIPV,0),null!=a.shape&&null!=a.shape.stencil&&(b=1==mxUtils.getValue(a.style,"stencilFlipH",0)||b,g=1==mxUtils.getValue(a.style,"stencilFlipV",
0)||g),b&&(e.x=2*d.getCenterX()-e.x),g&&(e.y=2*d.getCenterY()-e.y));e=f(d,a,e,c);null!=e&&(b&&(e.x=2*d.getCenterX()-e.x),g&&(e.y=2*d.getCenterY()-e.y))}null==e&&(e=this.getPoint(a))}return e};mxGraphView.prototype.getRoutingCenterX=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_X])||0:0;return a.getCenterX()+b*a.width};
mxGraphView.prototype.getRoutingCenterY=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0:0;return a.getCenterY()+b*a.height};mxGraphView.prototype.getPerimeterBounds=function(a,b){b=null!=b?b:0;null!=a&&(b+=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0));return a.getPerimeterBounds(b*this.scale)};
mxGraphView.prototype.getPerimeterFunction=function(a){a=a.style[mxConstants.STYLE_PERIMETER];if("string"==typeof a){var b=mxStyleRegistry.getValue(a);null==b&&this.isAllowEval()&&(b=mxUtils.eval(a));a=b}return"function"==typeof a?a:null};mxGraphView.prototype.getNextPoint=function(a,b,c){a=a.absolutePoints;var d=null;null!=a&&2<=a.length&&(d=a.length,d=a[c?Math.min(1,d-1):Math.max(0,d-2)]);null==d&&null!=b&&(d=new mxPoint(b.getCenterX(),b.getCenterY()));return d};
mxGraphView.prototype.getVisibleTerminal=function(a,b){var c=this.graph.getModel();for(b=a=c.getTerminal(a,b);null!=a&&a!=this.currentRoot;){if(!this.graph.isCellVisible(b)||this.isCellCollapsed(a))b=a;a=c.getParent(a)}null==b||c.contains(b)&&c.getParent(b)!=c.getRoot()&&b!=this.currentRoot||(b=null);return b};
mxGraphView.prototype.updateEdgeBounds=function(a){var b=a.absolutePoints,c=b[0],d=b[b.length-1];if(c.x!=d.x||c.y!=d.y){var e=d.x-c.x,f=d.y-c.y;a.terminalDistance=Math.sqrt(e*e+f*f)}else a.terminalDistance=0;d=0;var g=[];f=c;if(null!=f){c=f.x;for(var k=f.y,l=c,m=k,n=1;n<b.length;n++){var p=b[n];null!=p&&(e=f.x-p.x,f=f.y-p.y,e=Math.sqrt(e*e+f*f),g.push(e),d+=e,f=p,c=Math.min(f.x,c),k=Math.min(f.y,k),l=Math.max(f.x,l),m=Math.max(f.y,m))}a.length=d;a.segments=g;a.x=c;a.y=k;a.width=Math.max(1,l-c);a.height=
Math.max(1,m-k)}};
mxGraphView.prototype.getPoint=function(a,b){var c=a.getCenterX(),d=a.getCenterY();if(null==a.segments||null!=b&&!b.relative)null!=b&&(b=b.offset,null!=b&&(c+=b.x,d+=b.y));else{for(var e=a.absolutePoints.length,f=Math.round(((null!=b?b.x/2:0)+.5)*a.length),g=a.segments[0],k=0,l=1;f>=Math.round(k+g)&&l<e-1;)k+=g,g=a.segments[l++];e=0==g?0:(f-k)/g;f=a.absolutePoints[l-1];a=a.absolutePoints[l];null!=f&&null!=a&&(l=c=d=0,null!=b&&(d=b.y,b=b.offset,null!=b&&(c=b.x,l=b.y)),b=a.x-f.x,a=a.y-f.y,c=f.x+b*e+
((0==g?0:a/g)*d+c)*this.scale,d=f.y+a*e-((0==g?0:b/g)*d-l)*this.scale)}return new mxPoint(c,d)};
mxGraphView.prototype.getRelativePoint=function(a,b,c){var d=this.graph.getModel().getGeometry(a.cell);if(null!=d){var e=a.absolutePoints.length;if(d.relative&&1<e){d=a.length;for(var f=a.segments,g=a.absolutePoints[0],k=a.absolutePoints[1],l=mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c),m=0,n=0,p=0,r=2;r<e;r++)g=k,k=a.absolutePoints[r],g=mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c),p+=f[r-2],g<=l&&(l=g,n=r-1,m=p);e=f[n];g=a.absolutePoints[n];k=a.absolutePoints[n+1];l=k.x;f=k.y;a=g.x-l;n=g.y-f;f=(a-(b-l))*
a+(n-(c-f))*n;a=Math.sqrt(0>=f?0:f*f/(a*a+n*n));a>e&&(a=e);e=Math.sqrt(mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c));-1==mxUtils.relativeCcw(g.x,g.y,k.x,k.y,b,c)&&(e=-e);return new mxPoint((d/2-m-a)/d*-2,e/this.scale)}}return new mxPoint};
mxGraphView.prototype.updateEdgeLabelOffset=function(a){var b=a.absolutePoints;a.absoluteOffset.x=a.getCenterX();a.absoluteOffset.y=a.getCenterY();if(null!=b&&0<b.length&&null!=a.segments){var c=this.graph.getCellGeometry(a.cell);if(c.relative){var d=this.getPoint(a,c);null!=d&&(a.absoluteOffset=d)}else{d=b[0];var e=b[b.length-1];if(null!=d&&null!=e){b=e.x-d.x;var f=e.y-d.y,g=e=0;c=c.offset;null!=c&&(e=c.x,g=c.y);c=d.y+f/2+g*this.scale;a.absoluteOffset.x=d.x+b/2+e*this.scale;a.absoluteOffset.y=c}}}};
mxGraphView.prototype.getState=function(a,b){b=b||!1;var c=null;null!=a&&(c=this.states.get(a),b&&(null==c||this.updateStyle)&&this.graph.isCellVisible(a)&&(null==c?(c=this.createState(a),this.states.put(a,c)):c.style=this.graph.getCellStyle(a)));return c};mxGraphView.prototype.isRendering=function(){return this.rendering};mxGraphView.prototype.setRendering=function(a){this.rendering=a};mxGraphView.prototype.isAllowEval=function(){return this.allowEval};
mxGraphView.prototype.setAllowEval=function(a){this.allowEval=a};mxGraphView.prototype.getStates=function(){return this.states};mxGraphView.prototype.setStates=function(a){this.states=a};mxGraphView.prototype.getCellStates=function(a){if(null==a)return this.states;for(var b=[],c=0;c<a.length;c++){var d=this.getState(a[c]);null!=d&&b.push(d)}return b};
mxGraphView.prototype.removeState=function(a){var b=null;null!=a&&(b=this.states.remove(a),null!=b&&(this.graph.cellRenderer.destroy(b),b.invalid=!0,b.destroy()));return b};mxGraphView.prototype.createState=function(a){return new mxCellState(this,a,this.graph.getCellStyle(a))};mxGraphView.prototype.getCanvas=function(){return this.canvas};mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane};mxGraphView.prototype.getDrawPane=function(){return this.drawPane};
mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane};mxGraphView.prototype.getDecoratorPane=function(){return this.decoratorPane};mxGraphView.prototype.isContainerEvent=function(a){a=mxEvent.getSource(a);return a==this.graph.container||a.parentNode==this.backgroundPane||null!=a.parentNode&&a.parentNode.parentNode==this.backgroundPane||a==this.canvas.parentNode||a==this.canvas||a==this.backgroundPane||a==this.drawPane||a==this.overlayPane||a==this.decoratorPane};
mxGraphView.prototype.isScrollEvent=function(a){var b=mxUtils.getOffset(this.graph.container);a=new mxPoint(a.clientX-b.x,a.clientY-b.y);b=this.graph.container.offsetWidth;var c=this.graph.container.clientWidth;if(b>c&&a.x>c+2&&a.x<=b)return!0;b=this.graph.container.offsetHeight;c=this.graph.container.clientHeight;return b>c&&a.y>c+2&&a.y<=b?!0:!1};mxGraphView.prototype.init=function(){this.installListeners();this.graph.dialect==mxConstants.DIALECT_SVG?this.createSvg():this.createHtml()};
mxGraphView.prototype.installListeners=function(){var a=this.graph,b=a.container;null!=b&&(mxClient.IS_TOUCH&&(mxEvent.addListener(b,"gesturestart",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)})),mxEvent.addListener(b,"gesturechange",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)})),mxEvent.addListener(b,"gestureend",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)}))),mxEvent.addGestureListeners(b,mxUtils.bind(this,function(c){!this.isContainerEvent(c)||
(mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_GC||mxClient.IS_OP||mxClient.IS_SF)&&this.isScrollEvent(c)||a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))})),mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.dblClick(c)})),
a.addMouseListener({mouseDown:function(c,d){a.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(c){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();if(this.captureDocumentGesture&&a.isMouseDown&&null!=a.container&&!this.isContainerEvent(c)&&"none"!=a.container.style.display&&"hidden"!=a.container.style.visibility&&!mxEvent.isConsumed(c)){var d=a.fireMouseEvent,e=mxEvent.MOUSE_MOVE,f=null;if(mxClient.IS_TOUCH){f=
mxEvent.getClientX(c);var g=mxEvent.getClientY(c);f=mxUtils.convertPoint(b,f,g);f=a.view.getState(a.getCellAt(f.x,f.y))}d.call(a,e,new mxMouseEvent(c,f))}}),this.endHandler=mxUtils.bind(this,function(c){this.captureDocumentGesture&&a.isMouseDown&&null!=a.container&&!this.isContainerEvent(c)&&"none"!=a.container.style.display&&"hidden"!=a.container.style.visibility&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler))};
mxGraphView.prototype.createHtml=function(){var a=this.graph.container;null!=a&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),
a.appendChild(this.canvas),this.updateContainerStyle(a))};mxGraphView.prototype.updateHtmlCanvasSize=function(a,b){if(null!=this.graph.container){var c=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<a?a+"px":"100%";this.canvas.style.height=c<b?b+"px":"100%"}};
mxGraphView.prototype.createHtmlPane=function(a,b){var c=document.createElement("DIV");null!=a&&null!=b?(c.style.position="absolute",c.style.left="0px",c.style.top="0px",c.style.width=a,c.style.height=b):c.style.position="relative";return c};
mxGraphView.prototype.createSvg=function(){var a=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g");this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.backgroundPane);this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.drawPane);this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.overlayPane);this.decoratorPane=document.createElementNS(mxConstants.NS_SVG,
"g");this.canvas.appendChild(this.decoratorPane);var b=document.createElementNS(mxConstants.NS_SVG,"svg");b.style.left="0px";b.style.top="0px";b.style.width="100%";b.style.height="100%";b.style.display="block";b.appendChild(this.canvas);if(mxClient.IS_IE||mxClient.IS_IE11)b.style.overflow="hidden";null!=a&&(a.appendChild(b),this.updateContainerStyle(a))};
mxGraphView.prototype.updateContainerStyle=function(a){var b=mxUtils.getCurrentStyle(a);null!=b&&"static"==b.position&&(a.style.position="relative");mxClient.IS_POINTER&&(a.style.touchAction="none")};
mxGraphView.prototype.destroy=function(){var a=null!=this.canvas?this.canvas.ownerSVGElement:null;null==a&&(a=this.canvas);null!=a&&null!=a.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),a.parentNode.removeChild(a),this.decoratorPane=this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)};
function mxCurrentRootChange(a,b){this.view=a;this.previous=this.root=b;this.isUp=null==b;if(!this.isUp){a=this.view.currentRoot;for(var c=this.view.graph.getModel();null!=a;){if(a==b){this.isUp=!0;break}a=c.getParent(a)}}}
mxCurrentRootChange.prototype.execute=function(){var a=this.view.currentRoot;this.view.currentRoot=this.previous;this.previous=a;a=this.view.graph.getTranslateForRoot(this.view.currentRoot);null!=a&&(this.view.translate=new mxPoint(-a.x,-a.y));this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh();this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous));this.isUp=!this.isUp};
function mxGraph(a,b,c,d,e){this.mouseListeners=null;this.renderHint=c;this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:c==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:c==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML;this.model=null!=b?b:new mxGraphModel;this.multiplicities=[];this.imageBundles=[];this.cellRenderer=this.createCellRenderer();this.setSelectionModel(this.createSelectionModel());this.setStylesheet(null!=d?d:this.createStylesheet());
this.view=this.createGraphView();this.view.rendering=null!=e?e:this.view.rendering;this.graphModelChangeListener=mxUtils.bind(this,function(f,g){this.graphModelChanged(g.getProperty("edit").changes)});this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener);this.createHandlers();null!=a&&this.init(a);this.view.rendering&&this.view.revalidate()}mxLoadResources?mxResources.add(mxClient.basePath+"/resources/graph"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/graph");
mxGraph.prototype=new mxEventSource;mxGraph.prototype.constructor=mxGraph;mxGraph.prototype.mouseListeners=null;mxGraph.prototype.isMouseDown=!1;mxGraph.prototype.model=null;mxGraph.prototype.view=null;mxGraph.prototype.stylesheet=null;mxGraph.prototype.selectionModel=null;mxGraph.prototype.cellEditor=null;mxGraph.prototype.cellRenderer=null;mxGraph.prototype.multiplicities=null;mxGraph.prototype.renderHint=null;mxGraph.prototype.dialect=null;mxGraph.prototype.gridSize=10;
mxGraph.prototype.gridEnabled=!0;mxGraph.prototype.portsEnabled=!0;mxGraph.prototype.nativeDblClickEnabled=!0;mxGraph.prototype.doubleTapEnabled=!0;mxGraph.prototype.doubleTapTimeout=500;mxGraph.prototype.doubleTapTolerance=25;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchTime=0;mxGraph.prototype.tapAndHoldEnabled=!0;mxGraph.prototype.tapAndHoldDelay=500;mxGraph.prototype.tapAndHoldInProgress=!1;mxGraph.prototype.tapAndHoldValid=!1;
mxGraph.prototype.initialTouchX=0;mxGraph.prototype.initialTouchY=0;mxGraph.prototype.tolerance=4;mxGraph.prototype.defaultOverlap=.5;mxGraph.prototype.defaultParent=null;mxGraph.prototype.alternateEdgeStyle=null;mxGraph.prototype.backgroundImage=null;mxGraph.prototype.pageVisible=!1;mxGraph.prototype.pageBreaksVisible=!1;mxGraph.prototype.pageBreakColor="gray";mxGraph.prototype.pageBreakDashed=!0;mxGraph.prototype.minPageBreakDist=20;mxGraph.prototype.preferPageSize=!1;
mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT;mxGraph.prototype.pageScale=1.5;mxGraph.prototype.enabled=!0;mxGraph.prototype.escapeEnabled=!0;mxGraph.prototype.invokesStopCellEditing=!0;mxGraph.prototype.enterStopsCellEditing=!1;mxGraph.prototype.useScrollbarsForPanning=!0;mxGraph.prototype.exportEnabled=!0;mxGraph.prototype.importEnabled=!0;mxGraph.prototype.cellsLocked=!1;mxGraph.prototype.cellsCloneable=!0;mxGraph.prototype.foldingEnabled=!0;mxGraph.prototype.cellsEditable=!0;
mxGraph.prototype.cellsDeletable=!0;mxGraph.prototype.cellsMovable=!0;mxGraph.prototype.edgeLabelsMovable=!0;mxGraph.prototype.vertexLabelsMovable=!1;mxGraph.prototype.dropEnabled=!1;mxGraph.prototype.splitEnabled=!0;mxGraph.prototype.cellsResizable=!0;mxGraph.prototype.cellsBendable=!0;mxGraph.prototype.cellsSelectable=!0;mxGraph.prototype.cellsDisconnectable=!0;mxGraph.prototype.autoSizeCells=!1;mxGraph.prototype.autoSizeCellsOnAdd=!1;mxGraph.prototype.autoScroll=!0;
mxGraph.prototype.ignoreScrollbars=!1;mxGraph.prototype.translateToScrollPosition=!1;mxGraph.prototype.timerAutoScroll=!1;mxGraph.prototype.allowAutoPanning=!1;mxGraph.prototype.autoExtend=!0;mxGraph.prototype.maximumGraphBounds=null;mxGraph.prototype.minimumGraphSize=null;mxGraph.prototype.minimumContainerSize=null;mxGraph.prototype.maximumContainerSize=null;mxGraph.prototype.resizeContainer=!1;mxGraph.prototype.border=0;mxGraph.prototype.keepEdgesInForeground=!1;
mxGraph.prototype.keepEdgesInBackground=!1;mxGraph.prototype.allowNegativeCoordinates=!0;mxGraph.prototype.constrainChildren=!0;mxGraph.prototype.constrainRelativeChildren=!1;mxGraph.prototype.extendParents=!0;mxGraph.prototype.extendParentsOnAdd=!0;mxGraph.prototype.extendParentsOnMove=!1;mxGraph.prototype.recursiveResize=!1;mxGraph.prototype.collapseToPreferredSize=!0;mxGraph.prototype.zoomFactor=1.2;mxGraph.prototype.keepSelectionVisibleOnZoom=!1;mxGraph.prototype.centerZoom=!0;
mxGraph.prototype.resetViewOnRootChange=!0;mxGraph.prototype.resetEdgesOnResize=!1;mxGraph.prototype.resetEdgesOnMove=!1;mxGraph.prototype.resetEdgesOnConnect=!0;mxGraph.prototype.allowLoops=!1;mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop;mxGraph.prototype.multigraph=!0;mxGraph.prototype.connectableEdges=!1;mxGraph.prototype.allowDanglingEdges=!0;mxGraph.prototype.cloneInvalidEdges=!1;mxGraph.prototype.disconnectOnMove=!0;mxGraph.prototype.labelsVisible=!0;mxGraph.prototype.htmlLabels=!1;
mxGraph.prototype.swimlaneSelectionEnabled=!0;mxGraph.prototype.swimlaneNesting=!0;mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR;mxGraph.prototype.imageBundles=null;mxGraph.prototype.minFitScale=.1;mxGraph.prototype.maxFitScale=8;mxGraph.prototype.panDx=0;mxGraph.prototype.panDy=0;mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9);mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9);
mxGraph.prototype.warningImage=new mxImage(mxClient.imageBasePath+"/warning"+(mxClient.IS_MAC?".png":".gif"),16,16);mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"";mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"";mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"";
mxGraph.prototype.init=function(a){this.container=a;this.cellEditor=this.createCellEditor();this.view.init();this.sizeDidChange();mxEvent.addListener(a,"mouseleave",mxUtils.bind(this,function(b){null!=this.tooltipHandler&&null!=this.tooltipHandler.div&&this.tooltipHandler.div!=b.relatedTarget&&this.tooltipHandler.hide()}));mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(a,"selectstart",mxUtils.bind(this,function(b){return this.isEditing()||
!this.isMouseDown&&!mxEvent.isShiftDown(b)})))};mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler();this.tooltipHandler.setEnabled(!1);this.selectionCellsHandler=this.createSelectionCellsHandler();this.connectionHandler=this.createConnectionHandler();this.connectionHandler.setEnabled(!1);this.graphHandler=this.createGraphHandler();this.panningHandler=this.createPanningHandler();this.panningHandler.panningEnabled=!1;this.popupMenuHandler=this.createPopupMenuHandler()};
mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)};mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)};mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)};mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)};mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)};mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)};
mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view};
mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(a){this.stylesheet=a};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(a){this.selectionModel=a};
mxGraph.prototype.getSelectionCellsForChanges=function(a,b){for(var c=new mxDictionary,d=[],e=mxUtils.bind(this,function(l){if(!c.get(l)&&this.model.contains(l))if(this.model.isEdge(l)||this.model.isVertex(l))c.put(l,!0),d.push(l);else for(var m=this.model.getChildCount(l),n=0;n<m;n++)e(this.model.getChildAt(l,n))}),f=0;f<a.length;f++){var g=a[f];if(g.constructor!=mxRootChange&&(null==b||!b(g))){var k=null;g instanceof mxChildChange?k=g.child:null!=g.cell&&g.cell instanceof mxCell&&(k=g.cell);null!=
k&&e(k)}}return d};mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.updateSelection();this.view.validate();this.sizeDidChange()};
mxGraph.prototype.updateSelection=function(){for(var a=this.getSelectionCells(),b=[],c=0;c<a.length;c++)if(this.model.contains(a[c])&&this.isCellVisible(a[c]))for(var d=this.model.getParent(a[c]);null!=d&&d!=this.view.currentRoot;){if(this.isCellCollapsed(d)||!this.isCellVisible(d)){b.push(a[c]);break}d=this.model.getParent(d)}else b.push(a[c]);this.removeSelectionCells(b)};
mxGraph.prototype.processChange=function(a){if(a instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(a.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(a instanceof mxChildChange){var b=this.model.getParent(a.child);this.view.invalidate(a.child,!0,!0);if(!this.model.contains(b)||this.isCellCollapsed(b))this.view.invalidate(a.child,!0,!0),this.removeStateForCell(a.child),
this.view.currentRoot==a.child&&this.home();b!=a.previous&&(null!=b&&this.view.invalidate(b,!1,!1),null!=a.previous&&this.view.invalidate(a.previous,!1,!1))}else a instanceof mxTerminalChange||a instanceof mxGeometryChange?(a instanceof mxTerminalChange||null==a.previous&&null!=a.geometry||null!=a.previous&&!a.previous.equals(a.geometry))&&this.view.invalidate(a.cell):a instanceof mxValueChange?this.view.invalidate(a.cell,!1,!1):a instanceof mxStyleChange?(this.view.invalidate(a.cell,!0,!0),a=this.view.getState(a.cell),
null!=a&&(a.invalidStyle=!0)):null!=a.cell&&a.cell instanceof mxCell&&this.removeStateForCell(a.cell)};mxGraph.prototype.removeStateForCell=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.removeStateForCell(this.model.getChildAt(a,c));this.view.invalidate(a,!1,!0);this.view.removeState(a)};
mxGraph.prototype.addCellOverlay=function(a,b){null==a.overlays&&(a.overlays=[]);a.overlays.push(b);var c=this.view.getState(a);null!=c&&this.cellRenderer.redraw(c);this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",a,"overlay",b));return b};mxGraph.prototype.getCellOverlays=function(a){return a.overlays};
mxGraph.prototype.removeCellOverlay=function(a,b){if(null==b)this.removeCellOverlays(a);else{var c=mxUtils.indexOf(a.overlays,b);0<=c?(a.overlays.splice(c,1),0==a.overlays.length&&(a.overlays=null),c=this.view.getState(a),null!=c&&this.cellRenderer.redraw(c),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",a,"overlay",b))):b=null}return b};
mxGraph.prototype.removeCellOverlays=function(a){var b=a.overlays;if(null!=b){a.overlays=null;var c=this.view.getState(a);null!=c&&this.cellRenderer.redraw(c);for(c=0;c<b.length;c++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",a,"overlay",b[c]))}return b};mxGraph.prototype.clearCellOverlays=function(a){a=null!=a?a:this.model.getRoot();this.removeCellOverlays(a);for(var b=this.model.getChildCount(a),c=0;c<b;c++){var d=this.model.getChildAt(a,c);this.clearCellOverlays(d)}};
mxGraph.prototype.setCellWarning=function(a,b,c,d){if(null!=b&&0<b.length)return c=null!=c?c:this.warningImage,b=new mxCellOverlay(c,"<font color=red>"+b+"</font>"),d&&b.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,f){this.isEnabled()&&this.setSelectionCell(a)})),this.addCellOverlay(a,b);this.removeCellOverlays(a);return null};mxGraph.prototype.startEditing=function(a){this.startEditingAtCell(null,a)};
mxGraph.prototype.startEditingAtCell=function(a,b){null!=b&&mxEvent.isMultiTouchEvent(b)||(null==a&&(a=this.getSelectionCell(),null==a||this.isCellEditable(a)||(a=null)),null!=a&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",a,"event",b)),this.cellEditor.startEditing(a,b),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",a,"event",b))))};mxGraph.prototype.getEditingValue=function(a,b){return this.convertValueToString(a)};
mxGraph.prototype.stopEditing=function(a){this.cellEditor.stopEditing(a);this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",a))};mxGraph.prototype.labelChanged=function(a,b,c){this.model.beginUpdate();try{var d=a.value;this.cellLabelChanged(a,b,this.isAutoSizeCell(a));this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",a,"value",b,"old",d,"event",c))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellLabelChanged=function(a,b,c){this.model.beginUpdate();try{this.model.setValue(a,b),c&&this.cellSizeUpdated(a,!1)}finally{this.model.endUpdate()}};mxGraph.prototype.escape=function(a){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",a))};
mxGraph.prototype.click=function(a){var b=a.getEvent(),c=a.getCell(),d=new mxEventObject(mxEvent.CLICK,"event",b,"cell",c);a.isConsumed()&&d.consume();this.fireEvent(d);if(this.isEnabled()&&!mxEvent.isConsumed(b)&&!d.isConsumed()){if(null!=c){if(this.isTransparentClickEvent(b)){var e=!1;a=this.getCellAt(a.graphX,a.graphY,null,null,null,mxUtils.bind(this,function(g){var k=this.isCellSelected(g.cell);e=e||k;return!e||k||g.cell!=c&&this.model.isAncestor(g.cell,c)}));null!=a&&(c=a)}}else if(this.isSwimlaneSelectionEnabled()&&
(c=this.getSwimlaneAt(a.getGraphX(),a.getGraphY()),!(null==c||this.isToggleEvent(b)&&mxEvent.isAltDown(b)))){d=c;for(a=[];null!=d;){d=this.model.getParent(d);var f=this.view.getState(d);this.isSwimlane(d)&&null!=f&&a.push(d)}if(0<a.length)for(a=a.reverse(),a.splice(0,0,c),a.push(c),d=0;d<a.length-1;d++)this.isCellSelected(a[d])&&(c=a[this.isToggleEvent(b)?d:d+1])}null!=c?this.selectCellForEvent(c,b):this.isToggleEvent(b)||this.clearSelection()}};
mxGraph.prototype.isSiblingSelected=function(a){for(var b=this.model,c=b.getParent(a),d=b.getChildCount(c),e=0;e<d;e++){var f=b.getChildAt(c,e);if(a!=f&&this.isCellSelected(f))return!0}return!1};mxGraph.prototype.dblClick=function(a,b){var c=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",a,"cell",b);this.fireEvent(c);!this.isEnabled()||mxEvent.isConsumed(a)||c.isConsumed()||null==b||!this.isCellEditable(b)||this.isEditing(b)||(this.startEditingAtCell(b,a),mxEvent.consume(a))};
mxGraph.prototype.tapAndHold=function(a){var b=a.getEvent(),c=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",b,"cell",a.getCell());this.fireEvent(c);c.isConsumed()&&(this.panningHandler.panningTrigger=!1);this.isEnabled()&&!mxEvent.isConsumed(b)&&!c.isConsumed()&&this.connectionHandler.isEnabled()&&(b=this.view.getState(this.connectionHandler.marker.getCell(a)),null!=b&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=b,
this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(a.getGraphX(),a.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(a),this.connectionHandler.previous=b,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous))))};
mxGraph.prototype.scrollPointToVisible=function(a,b,c,d){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(a+this.panDx,b+this.panDy));else{var e=this.container;d=null!=d?d:20;if(a>=e.scrollLeft&&b>=e.scrollTop&&a<=e.scrollLeft+e.clientWidth&&b<=e.scrollTop+e.clientHeight){var f=e.scrollLeft+e.clientWidth-
a;if(f<d){if(a=e.scrollLeft,e.scrollLeft+=d-f,c&&a==e.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){a=this.view.getDrawPane().ownerSVGElement;var g=this.container.scrollWidth+d-f}else g=Math.max(e.clientWidth,e.scrollWidth)+d-f,a=this.view.getCanvas();a.style.width=g+"px";e.scrollLeft+=d-f}}else f=a-e.scrollLeft,f<d&&(e.scrollLeft-=d-f);f=e.scrollTop+e.clientHeight-b;f<d?(a=e.scrollTop,e.scrollTop+=d-f,a==e.scrollTop&&c&&(this.dialect==mxConstants.DIALECT_SVG?(a=this.view.getDrawPane().ownerSVGElement,
b=this.container.scrollHeight+d-f,a.style.height=b+"px"):(b=Math.max(e.clientHeight,e.scrollHeight)+d-f,a=this.view.getCanvas(),a.style.height=b+"px"),e.scrollTop+=d-f)):(f=b-e.scrollTop,f<d&&(e.scrollTop-=d-f))}}};mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)};
mxGraph.prototype.getBorderSizes=function(){var a=mxUtils.getCurrentStyle(this.container);return new mxRectangle(mxUtils.parseCssNumber(a.paddingLeft)+("none"!=a.borderLeftStyle?mxUtils.parseCssNumber(a.borderLeftWidth):0),mxUtils.parseCssNumber(a.paddingTop)+("none"!=a.borderTopStyle?mxUtils.parseCssNumber(a.borderTopWidth):0),mxUtils.parseCssNumber(a.paddingRight)+("none"!=a.borderRightStyle?mxUtils.parseCssNumber(a.borderRightWidth):0),mxUtils.parseCssNumber(a.paddingBottom)+("none"!=a.borderBottomStyle?
mxUtils.parseCssNumber(a.borderBottomWidth):0))};mxGraph.prototype.getPreferredPageSize=function(a,b,c){a=this.view.translate;var d=this.pageFormat,e=this.pageScale;d=new mxRectangle(0,0,Math.ceil(d.width*e),Math.ceil(d.height*e));return new mxRectangle(0,0,(this.pageBreaksVisible?Math.ceil(b/d.width):1)*d.width+2+a.x,(this.pageBreaksVisible?Math.ceil(c/d.height):1)*d.height+2+a.y)};
mxGraph.prototype.fit=function(a,b,c,d,e,f,g){if(null!=this.container){a=null!=a?a:this.getBorder();b=null!=b?b:!1;c=null!=c?c:0;d=null!=d?d:!0;e=null!=e?e:!1;f=null!=f?f:!1;var k=this.getBorderSizes(),l=this.container.offsetWidth-k.x-k.width-1,m=null!=g?g:this.container.offsetHeight-k.y-k.height-1;g=this.view.getGraphBounds();if(0<g.width&&0<g.height){b&&null!=g.x&&null!=g.y&&(g=g.clone(),g.width+=g.x,g.height+=g.y,g.x=0,g.y=0);k=this.view.scale;var n=g.width/k,p=g.height/k;null!=this.backgroundImage&&
null!=this.backgroundImage.width&&null!=this.backgroundImage.height&&(n=Math.max(n,this.backgroundImage.width-g.x/k),p=Math.max(p,this.backgroundImage.height-g.y/k));var r=(b?a:2*a)+c+1;l-=r;m-=r;e=e?m/p:f?l/n:Math.min(l/n,m/p);null!=this.minFitScale&&(e=Math.max(e,this.minFitScale));null!=this.maxFitScale&&(e=Math.min(e,this.maxFitScale));if(d)b?this.view.scale!=e&&this.view.setScale(e):mxUtils.hasScrollbars(this.container)?(this.view.setScale(e),a=this.getGraphBounds(),null!=a.x&&(this.container.scrollLeft=
a.x),null!=a.y&&(this.container.scrollTop=a.y)):this.view.scaleAndTranslate(e,null!=g.x?Math.floor(this.view.translate.x-g.x/k+a/e+c/2):a,null!=g.y?Math.floor(this.view.translate.y-g.y/k+a/e+c/2):a);else return e}}return this.view.scale};
mxGraph.prototype.sizeDidChange=function(){var a=this.getGraphBounds();if(null!=this.container){var b=this.getBorder(),c=Math.max(0,a.x)+a.width+2*b;b=Math.max(0,a.y)+a.height+2*b;null!=this.minimumContainerSize&&(c=Math.max(c,this.minimumContainerSize.width),b=Math.max(b,this.minimumContainerSize.height));this.resizeContainer&&this.doResizeContainer(c,b);if(this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var d=this.getPreferredPageSize(a,Math.max(1,c),Math.max(1,b));null!=d&&(c=d.width*this.view.scale,
b=d.height*this.view.scale)}null!=this.minimumGraphSize&&(c=Math.max(c,this.minimumGraphSize.width*this.view.scale),b=Math.max(b,this.minimumGraphSize.height*this.view.scale));c=Math.ceil(c);b=Math.ceil(b);this.dialect==mxConstants.DIALECT_SVG?(d=this.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.minWidth=Math.max(1,c)+"px",d.style.minHeight=Math.max(1,b)+"px",d.style.width="100%",d.style.height="100%")):(this.view.canvas.style.minWidth=Math.max(1,c)+"px",this.view.canvas.style.minHeight=Math.max(1,
b)+"px");this.updatePageBreaks(this.pageBreaksVisible,c,b)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",a))};mxGraph.prototype.doResizeContainer=function(a,b){null!=this.maximumContainerSize&&(a=Math.min(this.maximumContainerSize.width,a),b=Math.min(this.maximumContainerSize.height,b));this.container.style.width=Math.ceil(a)+"px";this.container.style.height=Math.ceil(b)+"px"};
mxGraph.prototype.updatePageBreaks=function(a,b,c){b=this.view.scale;c=this.view.translate;var d=this.pageFormat,e=b*this.pageScale,f=new mxRectangle(0,0,d.width*e,d.height*e);d=mxRectangle.fromRectangle(this.getGraphBounds());d.width=Math.max(1,d.width);d.height=Math.max(1,d.height);f.x=Math.floor((d.x-c.x*b)/f.width)*f.width+c.x*b;f.y=Math.floor((d.y-c.y*b)/f.height)*f.height+c.y*b;d.width=Math.ceil((d.width+(d.x-f.x))/f.width)*f.width;d.height=Math.ceil((d.height+(d.y-f.y))/f.height)*f.height;
var g=(a=a&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.ceil(d.height/f.height)+1:0,k=a?Math.ceil(d.width/f.width)+1:0,l=(k-1)*f.width,m=(g-1)*f.height;null==this.horizontalPageBreaks&&0<g&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<k&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(n){if(null!=n){for(var p=n==this.horizontalPageBreaks?g:k,r=0;r<=p;r++){var q=n==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x),Math.round(f.y+r*f.height)),new mxPoint(Math.round(f.x+
l),Math.round(f.y+r*f.height))]:[new mxPoint(Math.round(f.x+r*f.width),Math.round(f.y)),new mxPoint(Math.round(f.x+r*f.width),Math.round(f.y+m))];null!=n[r]?(n[r].points=q,n[r].redraw()):(q=new mxPolyline(q,this.pageBreakColor),q.dialect=this.dialect,q.pointerEvents=!1,q.isDashed=this.pageBreakDashed,q.init(this.view.backgroundPane),q.redraw(),n[r]=q)}for(r=p;r<n.length;r++)n[r].destroy();n.splice(p,n.length-p)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
mxGraph.prototype.getCurrentCellStyle=function(a,b){b=b?null:this.view.getState(a);return null!=b?b.style:this.getCellStyle(a)};mxGraph.prototype.getCellStyle=function(a,b){b=null!=b?b:!0;var c=this.model.getStyle(a),d=this.model.isEdge(a)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();null!=c?d=this.stylesheet.getCellStyle(c,d,b):null!=d&&(d=mxUtils.clone(d));null==d?d={}:b&&(d=this.postProcessCellStyle(a,d));return d};
mxGraph.prototype.postProcessCellStyle=function(a,b){if(null!=b){var c=b[mxConstants.STYLE_IMAGE];a=this.getImageFromBundles(c);null!=a?b[mxConstants.STYLE_IMAGE]=a:a=c;null!=a&&"data:image/"==a.substring(0,11)&&("data:image/svg+xml,<"==a.substring(0,20)?a=a.substring(0,19)+encodeURIComponent(a.substring(19)):"data:image/svg+xml,%3C"!=a.substring(0,22)&&(c=a.indexOf(","),0<c&&";base64,"!=a.substring(c-7,c+1)&&(a=a.substring(0,c)+";base64,"+a.substring(c+1))),b[mxConstants.STYLE_IMAGE]=a)}return b};
mxGraph.prototype.setCellStyle=function(a,b){b=b||this.getSelectionCells();if(null!=b){this.model.beginUpdate();try{for(var c=0;c<b.length;c++)this.model.setStyle(b[c],a)}finally{this.model.endUpdate()}}};mxGraph.prototype.toggleCellStyle=function(a,b,c){c=c||this.getSelectionCell();return this.toggleCellStyles(a,b,[c])};
mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getEditableCells(this.getSelectionCells());var d=null;null!=c&&0<c.length&&(d=this.getCurrentCellStyle(c[0]),d=mxUtils.getValue(d,a,b)?0:1,this.setCellStyles(a,d,c));return d};mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getEditableCells(this.getSelectionCells());mxUtils.setCellStyles(this.model,c,a,b)};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)};
mxGraph.prototype.setCellStyleFlags=function(a,b,c,d){d=d||this.getEditableCells(this.getSelectionCells());null!=d&&0<d.length&&(null==c&&(c=this.getCurrentCellStyle(d[0]),c=(parseInt(c[a]||0)&b)!=b),mxUtils.setCellStyleFlags(this.model,d,a,b,c))};mxGraph.prototype.getOriginForCell=function(a){a=this.model.getParent(a);for(var b=new mxPoint;null!=a;){var c=this.getCellGeometry(a);null==c||c.relative||(b.x+=c.x,b.y+=c.y);a=this.model.getParent(a)}return b};
mxGraph.prototype.alignCells=function(a,b,c){null==b&&(b=this.getMovableCells(this.getSelectionCells()));if(null!=b&&1<b.length){if(null==c)for(var d=0;d<b.length;d++){var e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]);if(!this.model.isEdge(b[d])&&null!=f&&!f.relative)if(null==c)if(a==mxConstants.ALIGN_CENTER){c=e.x+f.x+f.width/2;break}else if(a==mxConstants.ALIGN_RIGHT)c=e.x+f.x+f.width;else if(a==mxConstants.ALIGN_TOP)c=e.y+f.y;else if(a==mxConstants.ALIGN_MIDDLE){c=e.y+f.y+f.height/
2;break}else c=a==mxConstants.ALIGN_BOTTOM?e.y+f.y+f.height:e.x+f.x;else c=a==mxConstants.ALIGN_RIGHT?Math.max(c,e.x+f.x+f.width):a==mxConstants.ALIGN_TOP?Math.min(c,e.y+f.y):a==mxConstants.ALIGN_BOTTOM?Math.max(c,e.y+f.y+f.height):Math.min(c,e.x+f.x)}if(null!=c){b=mxUtils.sortCells(b);this.model.beginUpdate();try{for(d=0;d<b.length;d++)e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]),this.model.isEdge(b[d])||null==f||f.relative||(f=f.clone(),a==mxConstants.ALIGN_CENTER?f.x=c-e.x-f.width/
2:a==mxConstants.ALIGN_RIGHT?f.x=c-e.x-f.width:a==mxConstants.ALIGN_TOP?f.y=c-e.y:a==mxConstants.ALIGN_MIDDLE?f.y=c-e.y-f.height/2:a==mxConstants.ALIGN_BOTTOM?f.y=c-e.y-f.height:f.x=c-e.x,this.resizeCell(b[d],f));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",a,"cells",b))}finally{this.model.endUpdate()}}}return b};
mxGraph.prototype.flipEdge=function(a){if(null!=a&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var b=this.model.getStyle(a);null==b||0==b.length?this.model.setStyle(a,this.alternateEdgeStyle):this.model.setStyle(a,null);this.resetEdge(a);this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",a))}finally{this.model.endUpdate()}}return a};mxGraph.prototype.addImageBundle=function(a){this.imageBundles.push(a)};
mxGraph.prototype.removeImageBundle=function(a){for(var b=[],c=0;c<this.imageBundles.length;c++)this.imageBundles[c]!=a&&b.push(this.imageBundles[c]);this.imageBundles=b};mxGraph.prototype.getImageFromBundles=function(a){if(null!=a)for(var b=0;b<this.imageBundles.length;b++){var c=this.imageBundles[b].getImage(a);if(null!=c)return c}return null};
mxGraph.prototype.orderCells=function(a,b,c){null==b&&(b=mxUtils.sortCells(this.getEditableCells(this.getSelectionCells()),!0));this.model.beginUpdate();try{this.cellsOrdered(b,a,c),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",a,"cells",b,"increment",c))}finally{this.model.endUpdate()}return b};
mxGraph.prototype.cellsOrdered=function(a,b,c){if(null!=a){this.model.beginUpdate();try{for(var d=0;d<a.length;d++){var e=this.model.getParent(a[d]);b?c?this.model.add(e,a[d],Math.max(0,e.getIndex(a[d])-1)):this.model.add(e,a[d],d):c?this.model.add(e,a[d],Math.min(this.model.getChildCount(e)-1,e.getIndex(a[d])+1)):this.model.add(e,a[d],this.model.getChildCount(e)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",b,"cells",a,"increment",c))}finally{this.model.endUpdate()}}};
mxGraph.prototype.groupCells=function(a,b,c){null==c&&(c=mxUtils.sortCells(this.getSelectionCells(),!0));c=this.getCellsForGroup(c);null==a&&(a=this.createGroupCell(c));var d=this.getBoundsForGroup(a,c,b);if(1<c.length&&null!=d){var e=this.model.getParent(a);null==e&&(e=this.model.getParent(c[0]));this.model.beginUpdate();try{null==this.getCellGeometry(a)&&this.model.setGeometry(a,new mxGeometry);var f=this.model.getChildCount(e);this.cellsAdded([a],e,f,null,null,!1,!1,!1);f=this.model.getChildCount(a);
this.cellsAdded(c,a,f,null,null,!1,!1,!1);this.cellsMoved(c,-d.x,-d.y,!1,!1,!1);this.cellsResized([a],[d],!1);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",a,"border",b,"cells",c))}finally{this.model.endUpdate()}}return a};mxGraph.prototype.getCellsForGroup=function(a){var b=[];if(null!=a&&0<a.length){var c=this.model.getParent(a[0]);b.push(a[0]);for(var d=1;d<a.length;d++)this.model.getParent(a[d])==c&&b.push(a[d])}return b};
mxGraph.prototype.getBoundsForGroup=function(a,b,c){b=this.getBoundingBoxFromGeometry(b,!0);null!=b&&(this.isSwimlane(a)&&(a=this.getStartSize(a),b.x-=a.width,b.y-=a.height,b.width+=a.width,b.height+=a.height),null!=c&&(b.x-=c,b.y-=c,b.width+=2*c,b.height+=2*c));return b};mxGraph.prototype.createGroupCell=function(a){a=new mxCell("");a.setVertex(!0);a.setConnectable(!1);return a};
mxGraph.prototype.ungroupCells=function(a){var b=[];null==a&&(a=this.getCellsForUngroup());if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var c=0;c<a.length;c++){var d=this.model.getChildren(a[c]);if(null!=d&&0<d.length){d=d.slice();var e=this.model.getParent(a[c]),f=this.model.getChildCount(e);this.cellsAdded(d,e,f,null,null,!0);b=b.concat(d);for(var g=0;g<d.length;g++)if(this.model.isVertex(d[g])){var k=this.view.getState(d[g]),l=this.getCellGeometry(d[g]);null!=k&&null!=l&&l.relative&&
(l=l.clone(),l.x=k.origin.x,l.y=k.origin.y,l.relative=!1,this.model.setGeometry(d[g],l))}}}this.removeCellsAfterUngroup(a);this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",a))}finally{this.model.endUpdate()}}return b};mxGraph.prototype.getCellsForUngroup=function(){for(var a=this.getEditableCells(this.getSelectionCells()),b=[],c=0;c<a.length;c++)this.model.isVertex(a[c])&&0<this.model.getChildCount(a[c])&&b.push(a[c]);return b};mxGraph.prototype.removeCellsAfterUngroup=function(a){this.cellsRemoved(this.addAllEdges(a))};
mxGraph.prototype.removeCellsFromParent=function(a){null==a&&(a=this.getSelectionCells());this.model.beginUpdate();try{var b=this.getDefaultParent(),c=this.model.getChildCount(b);this.cellsAdded(a,b,c,null,null,!0);this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",a))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.updateGroupBounds=function(a,b,c,d,e,f,g){null==a&&(a=this.getSelectionCells());b=null!=b?b:0;c=null!=c?c:!1;d=null!=d?d:0;e=null!=e?e:0;f=null!=f?f:0;g=null!=g?g:0;this.model.beginUpdate();try{for(var k=a.length-1;0<=k;k--){var l=this.getCellGeometry(a[k]);if(null!=l){var m=this.getChildCells(a[k]);if(null!=m&&0<m.length){var n=this.getBoundingBoxFromGeometry(m,!0);if(null!=n&&0<n.width&&0<n.height){var p=this.isSwimlane(a[k])?this.getActualStartSize(a[k],!0):new mxRectangle;l=
l.clone();c&&(l.x=Math.round(l.x+n.x-b-p.x-g),l.y=Math.round(l.y+n.y-b-p.y-d));l.width=Math.round(n.width+2*b+p.x+g+e+p.width);l.height=Math.round(n.height+2*b+p.y+d+f+p.height);this.model.setGeometry(a[k],l);this.moveCells(m,b+p.x-n.x+g,b+p.y-n.y+d)}}}}}finally{this.model.endUpdate()}return a};
mxGraph.prototype.getBoundingBox=function(a){var b=null;if(null!=a&&0<a.length)for(var c=0;c<a.length;c++)if(this.model.isVertex(a[c])||this.model.isEdge(a[c])){var d=this.view.getBoundingBox(this.view.getState(a[c]),!0);null!=d&&(null==b?b=mxRectangle.fromRectangle(d):b.add(d))}return b};mxGraph.prototype.cloneCell=function(a,b,c,d){return this.cloneCells([a],b,c,d)[0]};
mxGraph.prototype.cloneCells=function(a,b,c,d){b=null!=b?b:!0;var e=null;if(null!=a){var f=new mxDictionary;e=[];for(var g=0;g<a.length;g++)f.put(a[g],!0),e.push(a[g]);if(0<e.length){var k=this.view.scale,l=this.view.translate;e=this.model.cloneCells(a,!0,c);for(g=0;g<a.length;g++)if(!b&&this.model.isEdge(e[g])&&null!=this.getEdgeValidationError(e[g],this.model.getTerminal(e[g],!0),this.model.getTerminal(e[g],!1)))e[g]=null;else{var m=this.model.getGeometry(e[g]);if(null!=m){var n=this.view.getState(a[g]),
p=this.view.getState(this.model.getParent(a[g]));if(null!=n&&null!=p)if(c=d?0:p.origin.x,p=d?0:p.origin.y,this.model.isEdge(e[g])){if(n=n.absolutePoints,null!=n){for(var r=this.model.getTerminal(a[g],!0);null!=r&&!f.get(r);)r=this.model.getParent(r);null==r&&null!=n[0]&&m.setTerminalPoint(new mxPoint(n[0].x/k-l.x,n[0].y/k-l.y),!0);for(r=this.model.getTerminal(a[g],!1);null!=r&&!f.get(r);)r=this.model.getParent(r);var q=n.length-1;null==r&&null!=n[q]&&m.setTerminalPoint(new mxPoint(n[q].x/k-l.x,n[q].y/
k-l.y),!1);m=m.points;if(null!=m)for(n=0;n<m.length;n++)m[n].x+=c,m[n].y+=p}}else m.translate(c,p)}}}else e=[]}return e};mxGraph.prototype.insertVertex=function(a,b,c,d,e,f,g,k,l){b=this.createVertex(a,b,c,d,e,f,g,k,l);return this.addCell(b,a)};mxGraph.prototype.createVertex=function(a,b,c,d,e,f,g,k,l){a=new mxGeometry(d,e,f,g);a.relative=null!=l?l:!1;c=new mxCell(c,a,k);c.setId(b);c.setVertex(!0);c.setConnectable(!0);return c};
mxGraph.prototype.insertEdge=function(a,b,c,d,e,f){b=this.createEdge(a,b,c,d,e,f);return this.addEdge(b,a,d,e)};mxGraph.prototype.createEdge=function(a,b,c,d,e,f){a=new mxCell(c,new mxGeometry,f);a.setId(b);a.setEdge(!0);a.geometry.relative=!0;return a};mxGraph.prototype.addEdge=function(a,b,c,d,e){return this.addCell(a,b,e,c,d)};mxGraph.prototype.addCell=function(a,b,c,d,e){return this.addCells([a],b,c,d,e)[0]};
mxGraph.prototype.addCells=function(a,b,c,d,e,f){null==b&&(b=this.getDefaultParent());null==c&&(c=this.model.getChildCount(b));this.model.beginUpdate();try{this.cellsAdded(a,b,c,d,e,null!=f?f:!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",a,"parent",b,"index",c,"source",d,"target",e))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellsAdded=function(a,b,c,d,e,f,g,k){if(null!=a&&null!=b&&null!=c){this.model.beginUpdate();try{var l=f?this.view.getState(b):null,m=null!=l?l.origin:null,n=new mxPoint(0,0);for(l=0;l<a.length;l++)if(null==a[l])c--;else{var p=this.model.getParent(a[l]);if(null!=m&&a[l]!=b&&b!=p){var r=this.view.getState(p),q=null!=r?r.origin:n,t=this.model.getGeometry(a[l]);if(null!=t){var u=q.x-m.x,x=q.y-m.y;t=t.clone();t.translate(u,x);t.relative||!this.model.isVertex(a[l])||this.isAllowNegativeCoordinates()||
(t.x=Math.max(0,t.x),t.y=Math.max(0,t.y));this.model.setGeometry(a[l],t)}}b==p&&c+l>this.model.getChildCount(b)&&c--;this.model.add(b,a[l],c+l);this.autoSizeCellsOnAdd&&this.autoSizeCell(a[l],!0);(null==k||k)&&this.isExtendParentsOnAdd(a[l])&&this.isExtendParent(a[l])&&this.extendParent(a[l]);(null==g||g)&&this.constrainChild(a[l]);null!=d&&this.cellConnected(a[l],d,!0);null!=e&&this.cellConnected(a[l],e,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",a,"parent",b,"index",c,"source",
d,"target",e,"absolute",f))}finally{this.model.endUpdate()}}};mxGraph.prototype.autoSizeCell=function(a,b){if(null!=b?b:1){b=this.model.getChildCount(a);for(var c=0;c<b;c++)this.autoSizeCell(this.model.getChildAt(a,c))}this.getModel().isVertex(a)&&this.isAutoSizeCell(a)&&this.updateCellSize(a)};
mxGraph.prototype.removeCells=function(a,b){b=null!=b?b:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));if(b)a=this.getDeletableCells(this.addAllEdges(a));else{a=a.slice();for(var c=this.getDeletableCells(this.getAllEdges(a)),d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);for(e=0;e<c.length;e++)null!=this.view.getState(c[e])||d.get(c[e])||(d.put(c[e],!0),a.push(c[e]))}this.model.beginUpdate();try{this.cellsRemoved(a),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",
a,"includeEdges",b))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellsRemoved=function(a){if(null!=a&&0<a.length){var b=this.view.scale,c=this.view.translate;this.model.beginUpdate();try{for(var d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);for(e=0;e<a.length;e++){for(var f=this.getAllEdges([a[e]]),g=mxUtils.bind(this,function(l,m){var n=this.model.getGeometry(l);if(null!=n){for(var p=this.model.getTerminal(l,m),r=!1,q=p;null!=q;){if(a[e]==q){r=!0;break}q=this.model.getParent(q)}r&&(n=n.clone(),r=this.view.getState(l),null!=r&&null!=r.absolutePoints?
(p=r.absolutePoints,q=m?0:p.length-1,n.setTerminalPoint(new mxPoint(p[q].x/b-c.x-r.origin.x,p[q].y/b-c.y-r.origin.y),m)):(p=this.view.getState(p),null!=p&&n.setTerminalPoint(new mxPoint(p.getCenterX()/b-c.x,p.getCenterY()/b-c.y),m)),this.model.setGeometry(l,n),this.model.setTerminal(l,null,m))}}),k=0;k<f.length;k++)d.get(f[k])||(d.put(f[k],!0),g(f[k],!0),g(f[k],!1));this.model.remove(a[e])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",a))}finally{this.model.endUpdate()}}};
mxGraph.prototype.splitEdge=function(a,b,c,d,e,f,g,k){d=d||0;e=e||0;k=null!=k?k:this.model.getParent(a);f=this.model.getTerminal(a,!0);this.model.beginUpdate();try{if(null==c){c=this.cloneCell(a);var l=this.view.getState(a),m=this.getCellGeometry(c);if(null!=m&&null!=m.points&&null!=l){var n=this.view.translate,p=this.view.scale,r=mxUtils.findNearestSegment(l,(d+n.x)*p,(e+n.y)*p);m.points=m.points.slice(0,r);m=this.getCellGeometry(a);null!=m&&null!=m.points&&(m=m.clone(),m.points=m.points.slice(r),
this.model.setGeometry(a,m))}}this.cellsMoved(b,d,e,!1,!1);this.cellsAdded(b,k,this.model.getChildCount(k),null,null,!0);this.cellsAdded([c],k,this.model.getChildCount(k),f,b[0],!1);this.cellConnected(a,b[0],!0);this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",a,"cells",b,"newEdge",c,"dx",d,"dy",e))}finally{this.model.endUpdate()}return c};
mxGraph.prototype.toggleCells=function(a,b,c){null==b&&(b=this.getSelectionCells());c&&(b=this.addAllEdges(b));this.model.beginUpdate();try{this.cellsToggled(b,a),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",a,"cells",b,"includeEdges",c))}finally{this.model.endUpdate()}return b};mxGraph.prototype.cellsToggled=function(a,b){if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],b)}finally{this.model.endUpdate()}}};
mxGraph.prototype.foldCells=function(a,b,c,d,e){b=null!=b?b:!1;null==c&&(c=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing(!1);this.model.beginUpdate();try{this.cellsFolded(c,a,b,d),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",a,"recurse",b,"cells",c))}finally{this.model.endUpdate()}return c};
mxGraph.prototype.cellsFolded=function(a,b,c,d){if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var e=0;e<a.length;e++)if((!d||this.isCellFoldable(a[e],b))&&b!=this.isCellCollapsed(a[e])){this.model.setCollapsed(a[e],b);this.swapBounds(a[e],b);this.isExtendParent(a[e])&&this.extendParent(a[e]);if(c){var f=this.model.getChildren(a[e]);this.cellsFolded(f,b,c)}this.constrainChild(a[e])}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",a,"collapse",b,"recurse",c))}finally{this.model.endUpdate()}}};
mxGraph.prototype.swapBounds=function(a,b){if(null!=a){var c=this.model.getGeometry(a);null!=c&&(c=c.clone(),this.updateAlternateBounds(a,c,b),c.swap(),this.model.setGeometry(a,c))}};
mxGraph.prototype.updateAlternateBounds=function(a,b,c){if(null!=a&&null!=b){c=this.getCurrentCellStyle(a);if(null==b.alternateBounds){var d=b;this.collapseToPreferredSize&&(a=this.getPreferredSizeForCell(a),null!=a&&(d=a,a=mxUtils.getValue(c,mxConstants.STYLE_STARTSIZE),0<a&&(d.height=Math.max(d.height,a))));b.alternateBounds=new mxRectangle(0,0,d.width,d.height)}if(null!=b.alternateBounds){b.alternateBounds.x=b.x;b.alternateBounds.y=b.y;var e=mxUtils.toRadians(c[mxConstants.STYLE_ROTATION]||0);
0!=e&&(c=b.alternateBounds.getCenterX()-b.getCenterX(),d=b.alternateBounds.getCenterY()-b.getCenterY(),a=Math.cos(e),e=Math.sin(e),b.alternateBounds.x+=a*c-e*d-c,b.alternateBounds.y+=e*c+a*d-d)}}};mxGraph.prototype.addAllEdges=function(a){var b=a.slice();return mxUtils.removeDuplicates(b.concat(this.getAllEdges(a)))};
mxGraph.prototype.getAllEdges=function(a){var b=[];if(null!=a)for(var c=0;c<a.length;c++){for(var d=this.model.getEdgeCount(a[c]),e=0;e<d;e++)b.push(this.model.getEdgeAt(a[c],e));d=this.model.getChildren(a[c]);b=b.concat(this.getAllEdges(d))}return b};mxGraph.prototype.updateCellSize=function(a,b){b=null!=b?b:!1;this.model.beginUpdate();try{this.cellSizeUpdated(a,b),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",a,"ignoreChildren",b))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellSizeUpdated=function(a,b){if(null!=a){this.model.beginUpdate();try{var c=this.getCellStyle(a),d=this.model.getGeometry(a);if(null!=d){var e=null,f=mxUtils.getValue(c,mxConstants.STYLE_FIXED_WIDTH,!1);f&&(e=d.width-2*parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING,2))-parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING_LEFT,0))-parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING_RIGHT,0)));var g=this.getPreferredSizeForCell(a,e);if(null!=g){var k=this.isCellCollapsed(a);
d=d.clone();if(this.isSwimlane(a)){var l=this.model.getStyle(a);null==l&&(l="");mxUtils.getValue(c,mxConstants.STYLE_HORIZONTAL,!0)?(l=mxUtils.setStyle(l,mxConstants.STYLE_STARTSIZE,g.height+8),k&&(d.height=g.height+8),f||(d.width=g.width)):(l=mxUtils.setStyle(l,mxConstants.STYLE_STARTSIZE,g.width+8),k&&!f&&(d.width=g.width+8),d.height=g.height);this.model.setStyle(a,l)}else{var m=this.view.createState(a),n=m.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,p=this.getVerticalAlign(m);"fixed"==
m.style[mxConstants.STYLE_ASPECT]&&(g.height=Math.round(d.height*g.width*100/d.width)/100);p==mxConstants.ALIGN_BOTTOM?d.y+=d.height-g.height:p==mxConstants.ALIGN_MIDDLE&&(d.y+=Math.round((d.height-g.height)/2));d.height=g.height;f||(n==mxConstants.ALIGN_RIGHT?d.x+=d.width-g.width:n==mxConstants.ALIGN_CENTER&&(d.x+=Math.round((d.width-g.width)/2)),d.width=g.width)}if(!b&&!k){var r=this.view.getBounds(this.model.getChildren(a));if(null!=r){var q=this.view.translate,t=this.view.scale,u=(r.x+r.width)/
t-d.x-q.x;d.height=Math.max(d.height,(r.y+r.height)/t-d.y-q.y);f||(d.width=Math.max(d.width,u))}}this.cellsResized([a],[d],!1)}}}finally{this.model.endUpdate()}}};
mxGraph.prototype.getPreferredSizeForCell=function(a,b){var c=null;if(null!=a){var d=this.view.createState(a),e=d.style;if(!this.model.isEdge(a)){var f=e[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE;a=c=0;null==this.getImage(d)&&null==e[mxConstants.STYLE_IMAGE]||e[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(e[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(c+=parseFloat(mxUtils.getValue(e,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),e[mxConstants.STYLE_ALIGN]!=
mxConstants.ALIGN_CENTER&&(a+=parseFloat(mxUtils.getValue(e,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));c+=2*parseFloat(mxUtils.getValue(e,mxConstants.STYLE_SPACING,2));c+=parseFloat(mxUtils.getValue(e,mxConstants.STYLE_SPACING_LEFT,2));c+=parseFloat(mxUtils.getValue(e,mxConstants.STYLE_SPACING_RIGHT,2));a+=2*parseFloat(mxUtils.getValue(e,mxConstants.STYLE_SPACING,2));a+=parseFloat(mxUtils.getValue(e,mxConstants.STYLE_SPACING_TOP,2));a+=parseFloat(mxUtils.getValue(e,mxConstants.STYLE_SPACING_BOTTOM,
2));var g=this.getFoldingImage(d);null!=g&&(c+=g.width+8);g=this.cellRenderer.getLabelValue(d);null!=g&&0<g.length?(this.isHtmlLabel(d.cell)?null!=b&&(b+=mxSvgCanvas2D.prototype.foreignObjectPadding):g=mxUtils.htmlEntities(g,!1),g=g.replace(/\n/g,"<br>"),d=mxUtils.getSizeForString(g,f,e[mxConstants.STYLE_FONTFAMILY],b,e[mxConstants.STYLE_FONTSTYLE]),b=d.width+c,d=d.height+a,mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,!0)||(e=d,d=b,b=e),this.gridEnabled&&(b=this.snap(b+this.gridSize/2),d=this.snap(d+
this.gridSize/2)),c=new mxRectangle(0,0,b,d)):(e=4*this.gridSize,c=new mxRectangle(0,0,e,e))}}return c};mxGraph.prototype.resizeCell=function(a,b,c){return this.resizeCells([a],[b],c)[0]};mxGraph.prototype.resizeCells=function(a,b,c){c=null!=c?c:this.isRecursiveResize();this.model.beginUpdate();try{var d=this.cellsResized(a,b,c);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",a,"bounds",b,"previous",d))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellsResized=function(a,b,c){c=null!=c?c:!1;var d=[];if(null!=a&&null!=b&&a.length==b.length){this.model.beginUpdate();try{for(var e=0;e<a.length;e++)d.push(this.cellResized(a[e],b[e],!1,c)),this.isExtendParent(a[e])&&this.extendParent(a[e]),this.constrainChild(a[e]);this.resetEdgesOnResize&&this.resetEdges(a);this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",a,"bounds",b,"previous",d))}finally{this.model.endUpdate()}}return d};
mxGraph.prototype.cellResized=function(a,b,c,d){var e=this.model.getGeometry(a);if(null!=e&&(e.x!=b.x||e.y!=b.y||e.width!=b.width||e.height!=b.height)){var f=e.clone();!c&&f.relative?(c=f.offset,null!=c&&(c.x+=b.x-f.x,c.y+=b.y-f.y)):(f.x=b.x,f.y=b.y);f.width=b.width;f.height=b.height;f.relative||!this.model.isVertex(a)||this.isAllowNegativeCoordinates()||(f.x=Math.max(0,f.x),f.y=Math.max(0,f.y));this.model.beginUpdate();try{d&&this.resizeChildCells(a,f),this.model.setGeometry(a,f),this.constrainChildCells(a)}finally{this.model.endUpdate()}}return e};
mxGraph.prototype.resizeChildCells=function(a,b){var c=this.model.getGeometry(a),d=0!=c.width?b.width/c.width:1;b=0!=c.height?b.height/c.height:1;c=this.model.getChildCount(a);for(var e=0;e<c;e++)this.scaleCell(this.model.getChildAt(a,e),d,b,!0)};mxGraph.prototype.constrainChildCells=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.constrainChild(this.model.getChildAt(a,c))};
mxGraph.prototype.scaleCell=function(a,b,c,d){var e=this.model.getGeometry(a);if(null!=e){var f=this.getCurrentCellStyle(a);e=e.clone();var g=e.x,k=e.y,l=e.width,m=e.height;e.scale(b,c,"fixed"==f[mxConstants.STYLE_ASPECT]);"1"==f[mxConstants.STYLE_RESIZE_WIDTH]?e.width=l*b:"0"==f[mxConstants.STYLE_RESIZE_WIDTH]&&(e.width=l);"1"==f[mxConstants.STYLE_RESIZE_HEIGHT]?e.height=m*c:"0"==f[mxConstants.STYLE_RESIZE_HEIGHT]&&(e.height=m);this.isCellMovable(a)||(e.x=g,e.y=k);this.isCellResizable(a)||(e.width=
l,e.height=m);this.model.isVertex(a)?this.cellResized(a,e,!0,d):this.model.setGeometry(a,e)}};mxGraph.prototype.extendParent=function(a){if(null!=a){var b=this.model.getParent(a),c=this.getCellGeometry(b);null==b||null==c||this.isCellCollapsed(b)||(a=this.getCellGeometry(a),null!=a&&!a.relative&&(c.width<a.x+a.width||c.height<a.y+a.height)&&(c=c.clone(),c.width=Math.max(c.width,a.x+a.width),c.height=Math.max(c.height,a.y+a.height),this.cellsResized([b],[c],!1)))}};
mxGraph.prototype.importCells=function(a,b,c,d,e,f){return this.moveCells(a,b,c,!0,d,e,f)};
mxGraph.prototype.moveCells=function(a,b,c,d,e,f,g){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:!1;if(null!=a&&(0!=b||0!=c||d||null!=e)){var k=a=this.model.getTopmostCells(a);this.model.beginUpdate();try{for(var l=new mxDictionary,m=0;m<a.length;m++)l.put(a[m],!0);var n=mxUtils.bind(this,function(x){for(;null!=x;){if(l.get(x))return!0;x=this.model.getParent(x)}return!1}),p=[];for(m=0;m<a.length;m++){var r=this.getCellGeometry(a[m]),q=this.model.getParent(a[m]);null!=r&&r.relative&&this.model.isEdge(q)&&
(n(this.model.getTerminal(q,!0))||n(this.model.getTerminal(q,!1)))||p.push(a[m])}a=p;d&&(a=this.cloneCells(a,this.isCloneInvalidEdges(),g),null==e&&(e=this.getDefaultParent()));var t=this.isAllowNegativeCoordinates();null!=e&&this.setAllowNegativeCoordinates(!0);this.cellsMoved(a,b,c,!d&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==e,this.isExtendParentsOnMove()&&null==e);this.setAllowNegativeCoordinates(t);if(null!=e){var u=this.model.getChildCount(e);this.cellsAdded(a,e,u,null,null,
!0);if(d)for(m=0;m<a.length;m++)r=this.getCellGeometry(a[m]),q=this.model.getParent(k[m]),null!=r&&r.relative&&this.model.isEdge(q)&&this.model.contains(q)&&this.model.add(q,a[m])}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",a,"dx",b,"dy",c,"clone",d,"target",e,"event",f))}finally{this.model.endUpdate()}}return a};
mxGraph.prototype.cellsMoved=function(a,b,c,d,e,f){if(null!=a&&(0!=b||0!=c)){f=null!=f?f:!1;this.model.beginUpdate();try{d&&this.disconnectGraph(a);for(var g=0;g<a.length;g++)this.translateCell(a[g],b,c),f&&this.isExtendParent(a[g])?this.extendParent(a[g]):e&&this.constrainChild(a[g]);this.resetEdgesOnMove&&this.resetEdges(a);this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",a,"dx",b,"dy",c,"disconnect",d))}finally{this.model.endUpdate()}}};
mxGraph.prototype.translateCell=function(a,b,c){var d=this.model.getGeometry(a);if(null!=d){b=parseFloat(b);c=parseFloat(c);d=d.clone();d.translate(b,c);d.relative||!this.model.isVertex(a)||this.isAllowNegativeCoordinates()||(d.x=Math.max(0,parseFloat(d.x)),d.y=Math.max(0,parseFloat(d.y)));if(d.relative&&!this.model.isEdge(a)){var e=this.model.getParent(a),f=0;this.model.isVertex(e)&&(e=this.getCurrentCellStyle(e),f=mxUtils.getValue(e,mxConstants.STYLE_ROTATION,0));0!=f&&(f=mxUtils.toRadians(-f),
e=Math.cos(f),f=Math.sin(f),c=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,new mxPoint(0,0)),b=c.x,c=c.y);null==d.offset?d.offset=new mxPoint(Math.round(b),Math.round(c)):(d.offset.x=Math.round(parseFloat(d.offset.x+b)),d.offset.y=Math.round(parseFloat(d.offset.y+c)))}this.model.setGeometry(a,d)}};
mxGraph.prototype.getCellContainmentArea=function(a){if(null!=a&&!this.model.isEdge(a)){var b=this.model.getParent(a);if(null!=b&&b!=this.getDefaultParent()){var c=this.model.getGeometry(b);if(null!=c){var d=a=0,e=c.width;c=c.height;if(this.isSwimlane(b)){var f=this.getStartSize(b),g=this.getCurrentCellStyle(b);b=mxUtils.getValue(g,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);var k=1==mxUtils.getValue(g,mxConstants.STYLE_FLIPH,0);g=1==mxUtils.getValue(g,mxConstants.STYLE_FLIPV,0);if(b==
mxConstants.DIRECTION_SOUTH||b==mxConstants.DIRECTION_NORTH){var l=f.width;f.width=f.height;f.height=l}if(b==mxConstants.DIRECTION_EAST&&!g||b==mxConstants.DIRECTION_NORTH&&!k||b==mxConstants.DIRECTION_WEST&&g||b==mxConstants.DIRECTION_SOUTH&&k)a=f.width,d=f.height;e-=f.width;c-=f.height}return new mxRectangle(a,d,e,c)}}}return null};mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds};
mxGraph.prototype.constrainChild=function(a,b){if(null!=a&&(b=this.getCellGeometry(a),null!=b&&(this.isConstrainRelativeChildren()||!b.relative))){var c=this.model.getParent(a);this.getCellGeometry(c);var d=this.getMaximumGraphBounds();null!=d&&(c=this.getBoundingBoxFromGeometry([c],!1),null!=c&&(d=mxRectangle.fromRectangle(d),d.x-=c.x,d.y-=c.y));if(this.isConstrainChild(a)&&(c=this.getCellContainmentArea(a),null!=c)){var e=this.getOverlap(a);0<e&&(c=mxRectangle.fromRectangle(c),c.x-=c.width*e,c.y-=
c.height*e,c.width+=2*c.width*e,c.height+=2*c.height*e);null==d?d=c:(d=mxRectangle.fromRectangle(d),d.intersect(c))}if(null!=d){c=[a];if(!this.isCellCollapsed(a)){e=this.model.getDescendants(a);for(var f=0;f<e.length;f++)this.isCellVisible(e[f])&&c.push(e[f])}c=this.getBoundingBoxFromGeometry(c,!1);if(null!=c){b=b.clone();e=0;b.width>d.width&&(e=b.width-d.width,b.width-=e);c.x+c.width>d.x+d.width&&(e-=c.x+c.width-d.x-d.width-e);f=0;b.height>d.height&&(f=b.height-d.height,b.height-=f);c.y+c.height>
d.y+d.height&&(f-=c.y+c.height-d.y-d.height-f);c.x<d.x&&(e-=c.x-d.x);c.y<d.y&&(f-=c.y-d.y);if(0!=e||0!=f)b.relative?(null==b.offset&&(b.offset=new mxPoint),b.offset.x+=e,b.offset.y+=f):(b.x+=e,b.y+=f);this.model.setGeometry(a,b)}}}};
mxGraph.prototype.resetEdges=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);this.model.beginUpdate();try{for(c=0;c<a.length;c++){var d=this.model.getEdges(a[c]);if(null!=d)for(var e=0;e<d.length;e++){var f=this.view.getState(d[e]),g=null!=f?f.getVisibleTerminal(!0):this.view.getVisibleTerminal(d[e],!0),k=null!=f?f.getVisibleTerminal(!1):this.view.getVisibleTerminal(d[e],!1);b.get(g)&&b.get(k)||this.resetEdge(d[e])}this.resetEdges(this.model.getChildren(a[c]))}}finally{this.model.endUpdate()}}};
mxGraph.prototype.resetEdge=function(a){var b=this.model.getGeometry(a);null!=b&&null!=b.points&&0<b.points.length&&(b=b.clone(),b.points=[],this.model.setGeometry(a,b));return a};
mxGraph.prototype.getOutlineConstraint=function(a,b,c){if(null!=b.shape){c=this.view.getPerimeterBounds(b);var d=b.style[mxConstants.STYLE_DIRECTION];if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH){c.x+=c.width/2-c.height/2;c.y+=c.height/2-c.width/2;var e=c.width;c.width=c.height;c.height=e}var f=mxUtils.toRadians(b.shape.getShapeRotation());if(0!=f){e=Math.cos(-f);f=Math.sin(-f);var g=new mxPoint(c.getCenterX(),c.getCenterY());a=mxUtils.getRotatedPoint(a,e,f,g)}g=f=1;var k=0,l=
0;if(this.getModel().isVertex(b.cell)){var m=b.style[mxConstants.STYLE_FLIPH],n=b.style[mxConstants.STYLE_FLIPV];null!=b.shape&&null!=b.shape.stencil&&(m=1==mxUtils.getValue(b.style,"stencilFlipH",0)||m,n=1==mxUtils.getValue(b.style,"stencilFlipV",0)||n);if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH)e=m,m=n,n=e;m&&(f=-1,k=-c.width);n&&(g=-1,l=-c.height)}a=new mxPoint((a.x-c.x)*f-k+c.x,(a.y-c.y)*g-l+c.y);return new mxConnectionConstraint(new mxPoint(0==c.width?0:Math.round(1E3*
(a.x-c.x)/c.width)/1E3,0==c.height?0:Math.round(1E3*(a.y-c.y)/c.height)/1E3),!1)}return null};mxGraph.prototype.getAllConnectionConstraints=function(a,b){return null!=a&&null!=a.shape&&null!=a.shape.stencil?a.shape.stencil.constraints:null};
mxGraph.prototype.getConnectionConstraint=function(a,b,c){b=null;var d=a.style[c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=d){var e=a.style[c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=e&&(b=new mxPoint(parseFloat(d),parseFloat(e)))}d=!1;var f=e=0;null!=b&&(d=mxUtils.getValue(a.style,c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),e=parseFloat(a.style[c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),f=parseFloat(a.style[c?mxConstants.STYLE_EXIT_DY:
mxConstants.STYLE_ENTRY_DY]),e=isFinite(e)?e:0,f=isFinite(f)?f:0);return new mxConnectionConstraint(b,d,null,e,f)};
mxGraph.prototype.setConnectionConstraint=function(a,b,c,d){if(null!=d){this.model.beginUpdate();try{null==d||null==d.point?(this.setCellStyles(c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:
mxConstants.STYLE_ENTRY_PERIMETER,null,[a])):null!=d.point&&(this.setCellStyles(c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,d.point.x,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,d.point.y,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,d.dx,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,d.dy,[a]),d.perimeter?this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,
null,[a]):this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[a]))}finally{this.model.endUpdate()}}};
mxGraph.prototype.getConnectionPoint=function(a,b,c){c=null!=c?c:!0;var d=null;if(null!=a&&null!=b.point){var e=this.view.getPerimeterBounds(a),f=new mxPoint(e.getCenterX(),e.getCenterY()),g=a.style[mxConstants.STYLE_DIRECTION],k=0;null!=g&&1==mxUtils.getValue(a.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(g==mxConstants.DIRECTION_NORTH?k+=270:g==mxConstants.DIRECTION_WEST?k+=180:g==mxConstants.DIRECTION_SOUTH&&(k+=90),g!=mxConstants.DIRECTION_NORTH&&g!=mxConstants.DIRECTION_SOUTH||e.rotate90());
d=this.view.scale;d=new mxPoint(e.x+b.point.x*e.width+b.dx*d,e.y+b.point.y*e.height+b.dy*d);var l=a.style[mxConstants.STYLE_ROTATION]||0;if(b.perimeter)0!=k&&(g=e=0,90==k?g=1:180==k?e=-1:270==k&&(g=-1),d=mxUtils.getRotatedPoint(d,e,g,f)),d=this.view.getPerimeterPoint(a,d,!1);else if(l+=k,this.getModel().isVertex(a.cell)){k=1==a.style[mxConstants.STYLE_FLIPH];b=1==a.style[mxConstants.STYLE_FLIPV];null!=a.shape&&null!=a.shape.stencil&&(k=1==mxUtils.getValue(a.style,"stencilFlipH",0)||k,b=1==mxUtils.getValue(a.style,
"stencilFlipV",0)||b);if(g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_SOUTH)a=k,k=b,b=a;k&&(d.x=2*e.getCenterX()-d.x);b&&(d.y=2*e.getCenterY()-d.y)}0!=l&&null!=d&&(a=mxUtils.toRadians(l),e=Math.cos(a),g=Math.sin(a),d=mxUtils.getRotatedPoint(d,e,g,f))}c&&null!=d&&(d.x=Math.round(d.x),d.y=Math.round(d.y));return d};
mxGraph.prototype.connectCell=function(a,b,c,d){this.model.beginUpdate();try{var e=this.model.getTerminal(a,c);this.cellConnected(a,b,c,d);this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",a,"terminal",b,"source",c,"previous",e))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellConnected=function(a,b,c,d){if(null!=a){this.model.beginUpdate();try{var e=this.model.getTerminal(a,c);this.setConnectionConstraint(a,b,c,d);this.isPortsEnabled()&&(d=null,this.isPort(b)&&(d=b.getId(),b=this.getTerminalForPort(b,c)),this.setCellStyles(c?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,d,[a]));this.model.setTerminal(a,b,c);this.resetEdgesOnConnect&&this.resetEdge(a);this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",a,"terminal",b,"source",
c,"previous",e))}finally{this.model.endUpdate()}}};
mxGraph.prototype.disconnectGraph=function(a){if(null!=a){this.model.beginUpdate();try{for(var b=this.view.scale,c=this.view.translate,d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);for(e=0;e<a.length;e++)if(this.model.isEdge(a[e])){var f=this.model.getGeometry(a[e]);if(null!=f){var g=this.view.getState(a[e]),k=this.view.getState(this.model.getParent(a[e]));if(null!=g&&null!=k){f=f.clone();var l=-k.origin.x,m=-k.origin.y,n=g.absolutePoints,p=this.model.getTerminal(a[e],!0);if(null!=p&&this.isCellDisconnectable(a[e],
p,!0)){for(;null!=p&&!d.get(p);)p=this.model.getParent(p);null==p&&(f.setTerminalPoint(new mxPoint(n[0].x/b-c.x+l,n[0].y/b-c.y+m),!0),this.model.setTerminal(a[e],null,!0))}var r=this.model.getTerminal(a[e],!1);if(null!=r&&this.isCellDisconnectable(a[e],r,!1)){for(;null!=r&&!d.get(r);)r=this.model.getParent(r);if(null==r){var q=n.length-1;f.setTerminalPoint(new mxPoint(n[q].x/b-c.x+l,n[q].y/b-c.y+m),!1);this.model.setTerminal(a[e],null,!1)}}this.model.setGeometry(a[e],f)}}}}finally{this.model.endUpdate()}}};
mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot};mxGraph.prototype.getTranslateForRoot=function(a){return null};mxGraph.prototype.isPort=function(a){return!1};mxGraph.prototype.getTerminalForPort=function(a,b){return this.model.getParent(a)};mxGraph.prototype.getChildOffsetForCell=function(a){return null};mxGraph.prototype.enterGroup=function(a){a=a||this.getSelectionCell();null!=a&&this.isValidRoot(a)&&(this.view.setCurrentRoot(a),this.clearSelection())};
mxGraph.prototype.exitGroup=function(){var a=this.model.getRoot(),b=this.getCurrentRoot();if(null!=b){for(var c=this.model.getParent(b);c!=a&&!this.isValidRoot(c)&&this.model.getParent(c)!=a;)c=this.model.getParent(c);c==a||this.model.getParent(c)==a?this.view.setCurrentRoot(null):this.view.setCurrentRoot(c);null!=this.view.getState(b)&&this.setSelectionCell(b)}};mxGraph.prototype.home=function(){var a=this.getCurrentRoot();null!=a&&(this.view.setCurrentRoot(null),null!=this.view.getState(a)&&this.setSelectionCell(a))};
mxGraph.prototype.isValidRoot=function(a){return null!=a};mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()};mxGraph.prototype.getCellBounds=function(a,b,c){var d=[a];b&&(d=d.concat(this.model.getEdges(a)));d=this.view.getBounds(d);if(c){c=this.model.getChildCount(a);for(var e=0;e<c;e++){var f=this.getCellBounds(this.model.getChildAt(a,e),b,!0);null!=d?d.add(f):d=f}}return d};
mxGraph.prototype.getBoundingBoxFromGeometry=function(a,b){b=null!=b?b:!1;var c=null;if(null!=a)for(var d=0;d<a.length;d++)if(b||this.model.isVertex(a[d])){var e=this.getCellGeometry(a[d]);if(null!=e){var f=null;if(this.model.isEdge(a[d])){f=function(l){null!=l&&(null==g?g=new mxRectangle(l.x,l.y,0,0):g.add(new mxRectangle(l.x,l.y,0,0)))};null==this.model.getTerminal(a[d],!0)&&f(e.getTerminalPoint(!0));null==this.model.getTerminal(a[d],!1)&&f(e.getTerminalPoint(!1));e=e.points;if(null!=e&&0<e.length)for(var g=
new mxRectangle(e[0].x,e[0].y,0,0),k=1;k<e.length;k++)f(e[k]);f=g}else k=this.model.getParent(a[d]),e.relative?this.model.isVertex(k)&&k!=this.view.currentRoot&&(g=this.getBoundingBoxFromGeometry([k],!1),null!=g&&(f=new mxRectangle(e.x*g.width,e.y*g.height,e.width,e.height),0<=mxUtils.indexOf(a,k)&&(f.x+=g.x,f.y+=g.y))):(f=mxRectangle.fromRectangle(e),this.model.isVertex(k)&&0<=mxUtils.indexOf(a,k)&&(g=this.getBoundingBoxFromGeometry([k],!1),null!=g&&(f.x+=g.x,f.y+=g.y))),null!=f&&null!=e.offset&&
(f.x+=e.offset.x,f.y+=e.offset.y),e=this.getCurrentCellStyle(a[d]),null!=f&&(e=mxUtils.getValue(e,mxConstants.STYLE_ROTATION,0),0!=e&&(f=mxUtils.getBoundingBox(f,e)));null!=f&&(null==c?c=mxRectangle.fromRectangle(f):c.add(f))}}return c};mxGraph.prototype.refresh=function(a){this.view.clear(a,null==a);this.view.validate();this.sizeDidChange();this.fireEvent(new mxEventObject(mxEvent.REFRESH))};mxGraph.prototype.snap=function(a){this.gridEnabled&&(a=Math.round(a/this.gridSize)*this.gridSize);return a};
mxGraph.prototype.snapDelta=function(a,b,c,d,e){var f=this.view.translate,g=this.view.scale;!c&&this.gridEnabled?(c=this.gridSize*g*.5,d||(d=b.x-(this.snap(b.x/g-f.x)+f.x)*g,a.x=Math.abs(a.x-d)<c?0:this.snap(a.x/g)*g-d),e||(b=b.y-(this.snap(b.y/g-f.y)+f.y)*g,a.y=Math.abs(a.y-b)<c?0:this.snap(a.y/g)*g-b)):(c=.5*g,d||(d=b.x-(Math.round(b.x/g-f.x)+f.x)*g,a.x=Math.abs(a.x-d)<c?0:Math.round(a.x/g)*g-d),e||(b=b.y-(Math.round(b.y/g-f.y)+f.y)*g,a.y=Math.abs(a.y-b)<c?0:Math.round(a.y/g)*g-b));return a};
mxGraph.prototype.panGraph=function(a,b){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-a,this.container.scrollTop=-b;else{var c=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==a&&0==b){if(mxClient.IS_IE?c.setAttribute("transform","translate("+a+","+b+")"):c.removeAttribute("transform"),null!=this.shiftPreview1){for(var d=this.shiftPreview1.firstChild;null!=d;){var e=d.nextSibling;this.container.appendChild(d);d=e}null!=this.shiftPreview1.parentNode&&
this.shiftPreview1.parentNode.removeChild(this.shiftPreview1);this.shiftPreview1=null;this.container.appendChild(c.parentNode);for(d=this.shiftPreview2.firstChild;null!=d;)e=d.nextSibling,this.container.appendChild(d),d=e;null!=this.shiftPreview2.parentNode&&this.shiftPreview2.parentNode.removeChild(this.shiftPreview2);this.shiftPreview2=null}}else{c.setAttribute("transform","translate("+a+","+b+")");if(null==this.shiftPreview1){this.shiftPreview1=document.createElement("div");this.shiftPreview1.style.position=
"absolute";this.shiftPreview1.style.overflow="visible";this.shiftPreview2=document.createElement("div");this.shiftPreview2.style.position="absolute";this.shiftPreview2.style.overflow="visible";var f=this.shiftPreview1;for(d=this.container.firstChild;null!=d;)e=d.nextSibling,d!=c.parentNode?f.appendChild(d):f=this.shiftPreview2,d=e;null!=this.shiftPreview1.firstChild&&this.container.insertBefore(this.shiftPreview1,c.parentNode);null!=this.shiftPreview2.firstChild&&this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=
a+"px";this.shiftPreview1.style.top=b+"px";this.shiftPreview2.style.left=a+"px";this.shiftPreview2.style.top=b+"px"}else c.style.left=a+"px",c.style.top=b+"px";this.panDx=a;this.panDy=b;this.fireEvent(new mxEventObject(mxEvent.PAN))}};mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)};mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)};
mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))};mxGraph.prototype.zoomTo=function(a,b){this.zoom(a/this.view.scale,b)};
mxGraph.prototype.center=function(a,b,c,d){a=null!=a?a:!0;b=null!=b?b:!0;c=null!=c?c:.5;d=null!=d?d:.5;var e=mxUtils.hasScrollbars(this.container),f=2*this.getBorder(),g=this.container.clientWidth-f;f=this.container.clientHeight-f;var k=this.getGraphBounds(),l=this.view.translate,m=this.view.scale,n=a?g-k.width:0,p=b?f-k.height:0;e?(k.x-=l.x,k.y-=l.y,a=this.container.scrollWidth,b=this.container.scrollHeight,a>g&&(n=0),b>f&&(p=0),this.view.setTranslate(Math.floor(n/2-k.x),Math.floor(p/2-k.y)),this.container.scrollLeft=
(a-g)/2,this.container.scrollTop=(b-f)/2):this.view.setTranslate(a?Math.floor(l.x-k.x/m+n*c/m):l.x,b?Math.floor(l.y-k.y/m+p*d/m):l.y)};
mxGraph.prototype.zoom=function(a,b,c){b=null!=b?b:this.centerZoom;var d=Math.round(this.view.scale*a*100)/100;null!=c&&(d=Math.round(d*c)/c);c=this.view.getState(this.getSelectionCell());a=d/this.view.scale;if(this.keepSelectionVisibleOnZoom&&null!=c)a=new mxRectangle(c.x*a,c.y*a,c.width*a,c.height*a),this.view.scale=d,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(d));else if(c=mxUtils.hasScrollbars(this.container),b&&!c){c=this.container.offsetWidth;var e=this.container.offsetHeight;
1<a?(a=(a-1)/(2*d),c*=-a,e*=-a):(a=(1/a-1)/(2*this.view.scale),c*=a,e*=a);this.view.scaleAndTranslate(d,this.view.translate.x+c,this.view.translate.y+e)}else{var f=this.view.translate.x,g=this.view.translate.y,k=this.container.scrollLeft,l=this.container.scrollTop;this.view.setScale(d);c&&(e=c=0,b&&(c=this.container.offsetWidth*(a-1)/2,e=this.container.offsetHeight*(a-1)/2),this.container.scrollLeft=(this.view.translate.x-f)*this.view.scale+Math.round(k*a+c),this.container.scrollTop=(this.view.translate.y-
g)*this.view.scale+Math.round(l*a+e))}};
mxGraph.prototype.zoomToRect=function(a){var b=this.container.clientWidth/a.width/(this.container.clientHeight/a.height);a.x=Math.max(0,a.x);a.y=Math.max(0,a.y);var c=Math.min(this.container.scrollWidth,a.x+a.width),d=Math.min(this.container.scrollHeight,a.y+a.height);a.width=c-a.x;a.height=d-a.y;1>b?(b=a.height/b,c=(b-a.height)/2,a.height=b,a.y-=Math.min(a.y,c),d=Math.min(this.container.scrollHeight,a.y+a.height),a.height=d-a.y):(b*=a.width,c=(b-a.width)/2,a.width=b,a.x-=Math.min(a.x,c),c=Math.min(this.container.scrollWidth,
a.x+a.width),a.width=c-a.x);b=this.container.clientWidth/a.width;c=this.view.scale*b;mxUtils.hasScrollbars(this.container)?(this.view.setScale(c),this.container.scrollLeft=Math.round(a.x*b),this.container.scrollTop=Math.round(a.y*b)):this.view.scaleAndTranslate(c,this.view.translate.x-a.x/this.view.scale,this.view.translate.y-a.y/this.view.scale)};
mxGraph.prototype.scrollCellToVisible=function(a,b){var c=-this.view.translate.x,d=-this.view.translate.y;a=this.view.getState(a);null!=a&&(c=new mxRectangle(c+a.x,d+a.y,a.width,a.height),b&&null!=this.container&&(b=this.container.clientWidth,d=this.container.clientHeight,c.x=c.getCenterX()-b/2,c.width=b,c.y=c.getCenterY()-d/2,c.height=d),b=new mxPoint(this.view.translate.x,this.view.translate.y),this.scrollRectToVisible(c)&&(c=new mxPoint(this.view.translate.x,this.view.translate.y),this.view.translate.x=
b.x,this.view.translate.y=b.y,this.view.setTranslate(c.x,c.y)))};
mxGraph.prototype.scrollRectToVisible=function(a){var b=!1;if(null!=a){var c=this.container.offsetWidth,d=this.container.offsetHeight,e=Math.min(c,a.width),f=Math.min(d,a.height);if(mxUtils.hasScrollbars(this.container)){c=this.container;a.x+=this.view.translate.x;a.y+=this.view.translate.y;var g=c.scrollLeft-a.x;d=Math.max(g-c.scrollLeft,0);0<g?c.scrollLeft-=g+2:(g=a.x+e-c.scrollLeft-c.clientWidth,0<g&&(c.scrollLeft+=g+2));e=c.scrollTop-a.y;g=Math.max(0,e-c.scrollTop);0<e?c.scrollTop-=e+2:(e=a.y+
f-c.scrollTop-c.clientHeight,0<e&&(c.scrollTop+=e+2));this.useScrollbarsForPanning||0==d&&0==g||this.view.setTranslate(d,g)}else{g=-this.view.translate.x;var k=-this.view.translate.y,l=this.view.scale;a.x+e>g+c&&(this.view.translate.x-=(a.x+e-c-g)/l,b=!0);a.y+f>k+d&&(this.view.translate.y-=(a.y+f-d-k)/l,b=!0);a.x<g&&(this.view.translate.x+=(g-a.x)/l,b=!0);a.y<k&&(this.view.translate.y+=(k-a.y)/l,b=!0);b&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return b};
mxGraph.prototype.getCellGeometry=function(a){return this.model.getGeometry(a)};mxGraph.prototype.isCellVisible=function(a){return this.model.isVisible(a)};mxGraph.prototype.isCellCollapsed=function(a){return this.model.isCollapsed(a)};mxGraph.prototype.isCellConnectable=function(a){return this.model.isConnectable(a)};
mxGraph.prototype.isOrthogonal=function(a){var b=a.style[mxConstants.STYLE_ORTHOGONAL];if(null!=b)return b;a=this.view.getEdgeStyle(a);return a==mxEdgeStyle.SegmentConnector||a==mxEdgeStyle.ElbowConnector||a==mxEdgeStyle.SideToSide||a==mxEdgeStyle.TopToBottom||a==mxEdgeStyle.EntityRelation||a==mxEdgeStyle.OrthConnector};mxGraph.prototype.isLoop=function(a){var b=a.getVisibleTerminalState(!0);a=a.getVisibleTerminalState(!1);return null!=b&&b==a};mxGraph.prototype.isCloneEvent=function(a){return mxEvent.isControlDown(a)};
mxGraph.prototype.isTransparentClickEvent=function(a){return!1};mxGraph.prototype.isToggleEvent=function(a){return mxClient.IS_MAC?mxEvent.isMetaDown(a):mxEvent.isControlDown(a)};mxGraph.prototype.isGridEnabledEvent=function(a){return null!=a&&!mxEvent.isAltDown(a)};mxGraph.prototype.isConstrainedEvent=function(a){return mxEvent.isShiftDown(a)};mxGraph.prototype.isIgnoreTerminalEvent=function(a){return!1};mxGraph.prototype.validationAlert=function(a){mxUtils.alert(a)};
mxGraph.prototype.isEdgeValid=function(a,b,c){return null==this.getEdgeValidationError(a,b,c)};
mxGraph.prototype.getEdgeValidationError=function(a,b,c){if(null!=a&&!this.isAllowDanglingEdges()&&(null==b||null==c))return"";if(null!=a&&null==this.model.getTerminal(a,!0)&&null==this.model.getTerminal(a,!1))return null;if(!this.allowLoops&&b==c&&null!=b||!this.isValidConnection(b,c))return"";if(null!=b&&null!=c){var d="";if(!this.multigraph){var e=this.model.getEdgesBetween(b,c,!0);if(1<e.length||1==e.length&&e[0]!=a)d+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+
"\n"}e=this.model.getDirectedEdgeCount(b,!0,a);var f=this.model.getDirectedEdgeCount(c,!1,a);if(null!=this.multiplicities)for(var g=0;g<this.multiplicities.length;g++){var k=this.multiplicities[g].check(this,a,b,c,e,f);null!=k&&(d+=k)}k=this.validateEdge(a,b,c);null!=k&&(d+=k);return 0<d.length?d:null}return this.allowDanglingEdges?null:""};mxGraph.prototype.validateEdge=function(a,b,c){return null};
mxGraph.prototype.validateGraph=function(a,b){a=null!=a?a:this.model.getRoot();b=null!=b?b:{};for(var c=!0,d=this.model.getChildCount(a),e=0;e<d;e++){var f=this.model.getChildAt(a,e),g=b;this.isValidRoot(f)&&(g={});g=this.validateGraph(f,g);null!=g?this.setCellWarning(f,g.replace(/\n/g,"<br>")):this.setCellWarning(f,null);c=c&&null==g}d="";this.isCellCollapsed(a)&&!c&&(d+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n");d=this.model.isEdge(a)?d+
(this.getEdgeValidationError(a,this.model.getTerminal(a,!0),this.model.getTerminal(a,!1))||""):d+(this.getCellValidationError(a)||"");b=this.validateCell(a,b);null!=b&&(d+=b);null==this.model.getParent(a)&&this.view.validate();return 0<d.length||!c?d:null};
mxGraph.prototype.getCellValidationError=function(a){var b=this.model.getDirectedEdgeCount(a,!0),c=this.model.getDirectedEdgeCount(a,!1);a=this.model.getValue(a);var d="";if(null!=this.multiplicities)for(var e=0;e<this.multiplicities.length;e++){var f=this.multiplicities[e];f.source&&mxUtils.isNode(a,f.type,f.attr,f.value)&&(b>f.max||b<f.min)?d+=f.countError+"\n":!f.source&&mxUtils.isNode(a,f.type,f.attr,f.value)&&(c>f.max||c<f.min)&&(d+=f.countError+"\n")}return 0<d.length?d:null};
mxGraph.prototype.validateCell=function(a,b){return null};mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage};mxGraph.prototype.setBackgroundImage=function(a){this.backgroundImage=a};mxGraph.prototype.getFoldingImage=function(a){if(null!=a&&this.foldingEnabled&&!this.getModel().isEdge(a.cell)){var b=this.isCellCollapsed(a.cell);if(this.isCellFoldable(a.cell,!b))return b?this.collapsedImage:this.expandedImage}return null};
mxGraph.prototype.convertValueToString=function(a){a=this.model.getValue(a);if(null!=a){if(mxUtils.isNode(a))return a.nodeName;if("function"==typeof a.toString)return a.toString()}return""};mxGraph.prototype.getLabel=function(a){var b="";if(this.labelsVisible&&null!=a){var c=this.getCurrentCellStyle(a);mxUtils.getValue(c,mxConstants.STYLE_NOLABEL,!1)||(b=this.convertValueToString(a))}return b};mxGraph.prototype.isHtmlLabel=function(a){return this.isHtmlLabels()};mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels};
mxGraph.prototype.setHtmlLabels=function(a){this.htmlLabels=a};mxGraph.prototype.isWrapping=function(a){return"wrap"==this.getCurrentCellStyle(a)[mxConstants.STYLE_WHITE_SPACE]};mxGraph.prototype.isLabelClipped=function(a){return"hidden"==this.getCurrentCellStyle(a)[mxConstants.STYLE_OVERFLOW]};
mxGraph.prototype.getTooltip=function(a,b,c,d){var e=null;null!=a&&(null==a.control||b!=a.control.node&&b.parentNode!=a.control.node||(e=this.collapseExpandResource,e=mxUtils.htmlEntities(mxResources.get(e)||e).replace(/\\n/g,"<br>")),null==e&&null!=a.overlays&&a.overlays.visit(function(f,g){null!=e||b!=g.node&&b.parentNode!=g.node||(e=g.overlay.toString())}),null==e&&(c=this.selectionCellsHandler.getHandler(a.cell),null!=c&&"function"==typeof c.getTooltipForNode&&(e=c.getTooltipForNode(b))),null==
e&&(e=this.getTooltipForCell(a.cell)));return e};mxGraph.prototype.getTooltipForCell=function(a){return null!=a&&null!=a.getTooltip?a.getTooltip():this.convertValueToString(a)};mxGraph.prototype.getLinkForCell=function(a){return null};mxGraph.prototype.getLinkTargetForCell=function(a){return null};mxGraph.prototype.getCursorForMouseEvent=function(a){return this.getCursorForCell(a.getCell())};mxGraph.prototype.getCursorForCell=function(a){return null};
mxGraph.prototype.getStartSize=function(a,b){var c=new mxRectangle;a=this.getCurrentCellStyle(a,b);b=parseInt(mxUtils.getValue(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)?c.height=b:c.width=b;return c};
mxGraph.prototype.getSwimlaneDirection=function(a){var b=mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),c=1==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,0),d=1==mxUtils.getValue(a,mxConstants.STYLE_FLIPV,0);a=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)?0:3;b==mxConstants.DIRECTION_NORTH?a--:b==mxConstants.DIRECTION_WEST?a+=2:b==mxConstants.DIRECTION_SOUTH&&(a+=1);b=mxUtils.mod(a,2);c&&1==b&&(a+=2);d&&0==b&&(a+=2);return[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,
mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(a,4)]};mxGraph.prototype.getActualStartSize=function(a,b){var c=new mxRectangle;this.isSwimlane(a,b)&&(b=this.getCurrentCellStyle(a,b),a=parseInt(mxUtils.getValue(b,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),b=this.getSwimlaneDirection(b),b==mxConstants.DIRECTION_NORTH?c.y=a:b==mxConstants.DIRECTION_WEST?c.x=a:b==mxConstants.DIRECTION_SOUTH?c.height=a:c.width=a);return c};
mxGraph.prototype.getImage=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_IMAGE]:null};mxGraph.prototype.isTransparentState=function(a){var b=!1;if(null!=a){b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE);var c=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);b=b==mxConstants.NONE&&c==mxConstants.NONE&&null==this.getImage(a)}return b};
mxGraph.prototype.getVerticalAlign=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null};mxGraph.prototype.getIndicatorColor=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_COLOR]:null};mxGraph.prototype.getIndicatorGradientColor=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null};
mxGraph.prototype.getIndicatorShape=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_SHAPE]:null};mxGraph.prototype.getIndicatorImage=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_IMAGE]:null};mxGraph.prototype.getBorder=function(){return this.border};mxGraph.prototype.setBorder=function(a){this.border=a};
mxGraph.prototype.isSwimlane=function(a,b){return null==a||this.model.getParent(a)==this.model.getRoot()||this.model.isEdge(a)?!1:this.getCurrentCellStyle(a,b)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE};mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer};mxGraph.prototype.setResizeContainer=function(a){this.resizeContainer=a};mxGraph.prototype.isEnabled=function(){return this.enabled};
mxGraph.prototype.setEnabled=function(a){this.enabled=a;this.fireEvent(new mxEventObject("enabledChanged","enabled",a))};mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled};mxGraph.prototype.setEscapeEnabled=function(a){this.escapeEnabled=a};mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing};mxGraph.prototype.setInvokesStopCellEditing=function(a){this.invokesStopCellEditing=a};mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing};
mxGraph.prototype.setEnterStopsCellEditing=function(a){this.enterStopsCellEditing=a};mxGraph.prototype.isCellLocked=function(a){var b=this.model.getGeometry(a);return this.isCellsLocked()||null!=b&&this.model.isVertex(a)&&b.relative};mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked};mxGraph.prototype.setCellsLocked=function(a){this.cellsLocked=a};mxGraph.prototype.getCloneableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellCloneable(b)}))};
mxGraph.prototype.isCellCloneable=function(a){a=this.getCurrentCellStyle(a);return this.isCellsCloneable()&&0!=a[mxConstants.STYLE_CLONEABLE]};mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable};mxGraph.prototype.setCellsCloneable=function(a){this.cellsCloneable=a};mxGraph.prototype.getExportableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.canExportCell(b)}))};mxGraph.prototype.canExportCell=function(a){return this.exportEnabled};
mxGraph.prototype.getImportableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.canImportCell(b)}))};mxGraph.prototype.canImportCell=function(a){return this.importEnabled};mxGraph.prototype.isCellSelectable=function(a){return this.isCellsSelectable()};mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable};mxGraph.prototype.setCellsSelectable=function(a){this.cellsSelectable=a};
mxGraph.prototype.getDeletableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellDeletable(b)}))};mxGraph.prototype.isCellDeletable=function(a){a=this.getCurrentCellStyle(a);return this.isCellsDeletable()&&0!=a[mxConstants.STYLE_DELETABLE]};mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable};mxGraph.prototype.setCellsDeletable=function(a){this.cellsDeletable=a};
mxGraph.prototype.isLabelMovable=function(a){return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&this.vertexLabelsMovable)};mxGraph.prototype.getRotatableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellRotatable(b)}))};mxGraph.prototype.isCellRotatable=function(a){return 0!=this.getCurrentCellStyle(a)[mxConstants.STYLE_ROTATABLE]};
mxGraph.prototype.getMovableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellMovable(b)}))};mxGraph.prototype.isCellMovable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsMovable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_MOVABLE]};mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable};mxGraph.prototype.setCellsMovable=function(a){this.cellsMovable=a};mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled};
mxGraph.prototype.setGridEnabled=function(a){this.gridEnabled=a};mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled};mxGraph.prototype.setPortsEnabled=function(a){this.portsEnabled=a};mxGraph.prototype.getGridSize=function(){return this.gridSize};mxGraph.prototype.setGridSize=function(a){this.gridSize=a};mxGraph.prototype.getTolerance=function(){return this.tolerance};mxGraph.prototype.setTolerance=function(a){this.tolerance=a};mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable};
mxGraph.prototype.setVertexLabelsMovable=function(a){this.vertexLabelsMovable=a};mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable};mxGraph.prototype.setEdgeLabelsMovable=function(a){this.edgeLabelsMovable=a};mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting};mxGraph.prototype.setSwimlaneNesting=function(a){this.swimlaneNesting=a};mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled};
mxGraph.prototype.setSwimlaneSelectionEnabled=function(a){this.swimlaneSelectionEnabled=a};mxGraph.prototype.isMultigraph=function(){return this.multigraph};mxGraph.prototype.setMultigraph=function(a){this.multigraph=a};mxGraph.prototype.isAllowLoops=function(){return this.allowLoops};mxGraph.prototype.setAllowDanglingEdges=function(a){this.allowDanglingEdges=a};mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges};
mxGraph.prototype.setConnectableEdges=function(a){this.connectableEdges=a};mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges};mxGraph.prototype.setCloneInvalidEdges=function(a){this.cloneInvalidEdges=a};mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges};mxGraph.prototype.setAllowLoops=function(a){this.allowLoops=a};mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove};
mxGraph.prototype.setDisconnectOnMove=function(a){this.disconnectOnMove=a};mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled};mxGraph.prototype.setDropEnabled=function(a){this.dropEnabled=a};mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled};mxGraph.prototype.setSplitEnabled=function(a){this.splitEnabled=a};mxGraph.prototype.getResizableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellResizable(b)}))};
mxGraph.prototype.isCellResizable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsResizable()&&!this.isCellLocked(a)&&"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")};mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable};mxGraph.prototype.setCellsResizable=function(a){this.cellsResizable=a};mxGraph.prototype.isTerminalPointMovable=function(a,b){return!0};
mxGraph.prototype.isCellBendable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsBendable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_BENDABLE]};mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable};mxGraph.prototype.setCellsBendable=function(a){this.cellsBendable=a};mxGraph.prototype.getEditableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellEditable(b)}))};
mxGraph.prototype.isCellEditable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsEditable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_EDITABLE]};mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable};mxGraph.prototype.setCellsEditable=function(a){this.cellsEditable=a};mxGraph.prototype.isCellDisconnectable=function(a,b,c){return this.isCellsDisconnectable()&&!this.isCellLocked(a)};mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable};
mxGraph.prototype.setCellsDisconnectable=function(a){this.cellsDisconnectable=a};mxGraph.prototype.isValidSource=function(a){return null==a&&this.allowDanglingEdges||null!=a&&(!this.model.isEdge(a)||this.connectableEdges)&&this.isCellConnectable(a)};mxGraph.prototype.isValidTarget=function(a){return this.isValidSource(a)};mxGraph.prototype.isValidConnection=function(a,b){return this.isValidSource(a)&&this.isValidTarget(b)};mxGraph.prototype.setConnectable=function(a){this.connectionHandler.setEnabled(a)};
mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()};mxGraph.prototype.setTooltips=function(a){this.tooltipHandler.setEnabled(a)};mxGraph.prototype.setPanning=function(a){this.panningHandler.panningEnabled=a};mxGraph.prototype.isEditing=function(a){if(null!=this.cellEditor){var b=this.cellEditor.getEditingCell();return null==a?null!=b:a==b}return!1};mxGraph.prototype.isAutoSizeCell=function(a){a=this.getCurrentCellStyle(a);return this.isAutoSizeCells()||1==a[mxConstants.STYLE_AUTOSIZE]};
mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells};mxGraph.prototype.setAutoSizeCells=function(a){this.autoSizeCells=a};mxGraph.prototype.isExtendParent=function(a){return!this.getModel().isEdge(a)&&this.isExtendParents()};mxGraph.prototype.isExtendParents=function(){return this.extendParents};mxGraph.prototype.setExtendParents=function(a){this.extendParents=a};mxGraph.prototype.isExtendParentsOnAdd=function(a){return this.extendParentsOnAdd};
mxGraph.prototype.setExtendParentsOnAdd=function(a){this.extendParentsOnAdd=a};mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove};mxGraph.prototype.setExtendParentsOnMove=function(a){this.extendParentsOnMove=a};mxGraph.prototype.isRecursiveResize=function(a){return this.recursiveResize};mxGraph.prototype.setRecursiveResize=function(a){this.recursiveResize=a};mxGraph.prototype.isConstrainChild=function(a){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(a))};
mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren};mxGraph.prototype.setConstrainChildren=function(a){this.constrainChildren=a};mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren};mxGraph.prototype.setConstrainRelativeChildren=function(a){this.constrainRelativeChildren=a};mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates};
mxGraph.prototype.setAllowNegativeCoordinates=function(a){this.allowNegativeCoordinates=a};mxGraph.prototype.getOverlap=function(a){return this.isAllowOverlapParent(a)?this.defaultOverlap:0};mxGraph.prototype.isAllowOverlapParent=function(a){return!1};mxGraph.prototype.getFoldableCells=function(a,b){return this.model.filterCells(a,mxUtils.bind(this,function(c){return this.isCellFoldable(c,b)}))};
mxGraph.prototype.isCellFoldable=function(a,b){b=this.getCurrentCellStyle(a);return 0<this.model.getChildCount(a)&&0!=b[mxConstants.STYLE_FOLDABLE]};mxGraph.prototype.isValidDropTarget=function(a,b,c){return null!=a&&(this.isSplitEnabled()&&this.isSplitTarget(a,b,c)||!this.model.isEdge(a)&&(this.isSwimlane(a)||0<this.model.getChildCount(a)&&!this.isCellCollapsed(a)))};
mxGraph.prototype.isSplitTarget=function(a,b,c){return this.model.isEdge(a)&&null!=b&&1==b.length&&this.isCellConnectable(b[0])&&null==this.getEdgeValidationError(a,this.model.getTerminal(a,!0),b[0])?(c=this.model.getTerminal(a,!0),a=this.model.getTerminal(a,!1),!this.model.isAncestor(b[0],c)&&!this.model.isAncestor(b[0],a)):!1};
mxGraph.prototype.getDropTarget=function(a,b,c,d){if(!this.isSwimlaneNesting())for(var e=0;e<a.length;e++)if(this.isSwimlane(a[e]))return null;e=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b));e.x-=this.panDx;e.y-=this.panDy;e=this.getSwimlaneAt(e.x,e.y);if(null==c)c=e;else if(null!=e){for(var f=this.model.getParent(e);null!=f&&this.isSwimlane(f)&&f!=c;)f=this.model.getParent(f);f==c&&(c=e)}for(;null!=c&&!this.isValidDropTarget(c,a,b)&&!this.model.isLayer(c);)c=this.model.getParent(c);
if(null==d||!d)for(var g=c;null!=g&&0>mxUtils.indexOf(a,g);)g=this.model.getParent(g);return this.model.isLayer(c)||null!=g?null:c};mxGraph.prototype.getDefaultParent=function(){var a=this.getCurrentRoot();null==a&&(a=this.defaultParent,null==a&&(a=this.model.getRoot(),a=this.model.getChildAt(a,0)));return a};mxGraph.prototype.setDefaultParent=function(a){this.defaultParent=a};mxGraph.prototype.getSwimlane=function(a){for(;null!=a&&!this.isSwimlane(a);)a=this.model.getParent(a);return a};
mxGraph.prototype.getSwimlaneAt=function(a,b,c){null==c&&(c=this.getCurrentRoot(),null==c&&(c=this.model.getRoot()));if(null!=c)for(var d=this.model.getChildCount(c),e=0;e<d;e++){var f=this.model.getChildAt(c,e);if(null!=f){var g=this.getSwimlaneAt(a,b,f);if(null!=g)return g;if(this.isCellVisible(f)&&this.isSwimlane(f)&&(g=this.view.getState(f),this.intersects(g,a,b)))return f}}return null};
mxGraph.prototype.getCellAt=function(a,b,c,d,e,f){d=null!=d?d:!0;e=null!=e?e:!0;null==c&&(c=this.getCurrentRoot(),null==c&&(c=this.getModel().getRoot()));if(null!=c)for(var g=this.model.getChildCount(c)-1;0<=g;g--){var k=this.model.getChildAt(c,g),l=this.getCellAt(a,b,k,d,e,f);if(null!=l)return l;if(this.isCellVisible(k)&&(e&&this.model.isEdge(k)||d&&this.model.isVertex(k))&&(l=this.view.getState(k),null!=l&&(null==f||!f(l,a,b))&&this.intersects(l,a,b)))return k}return null};
mxGraph.prototype.intersects=function(a,b,c){if(null!=a){var d=a.absolutePoints;if(null!=d){a=this.tolerance*this.tolerance;for(var e=d[0],f=1;f<d.length;f++){var g=d[f];if(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,b,c)<=a)return!0;e=g}}else if(e=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0),0!=e&&(d=Math.cos(-e),e=Math.sin(-e),f=new mxPoint(a.getCenterX(),a.getCenterY()),e=mxUtils.getRotatedPoint(new mxPoint(b,c),d,e,f),b=e.x,c=e.y),mxUtils.contains(a,b,c))return!0}return!1};
mxGraph.prototype.hitsSwimlaneContent=function(a,b,c){var d=this.getView().getState(a);a=this.getStartSize(a);if(null!=d){var e=this.getView().getScale();b-=d.x;c-=d.y;if(0<a.width&&0<b&&b>a.width*e||0<a.height&&0<c&&c>a.height*e)return!0}return!1};mxGraph.prototype.getChildVertices=function(a){return this.getChildCells(a,!0,!1)};mxGraph.prototype.getChildEdges=function(a){return this.getChildCells(a,!1,!0)};
mxGraph.prototype.getChildCells=function(a,b,c){a=null!=a?a:this.getDefaultParent();a=this.model.getChildCells(a,null!=b?b:!1,null!=c?c:!1);b=[];for(c=0;c<a.length;c++)this.isCellVisible(a[c])&&b.push(a[c]);return b};mxGraph.prototype.getConnections=function(a,b){return this.getEdges(a,b,!0,!0,!1)};mxGraph.prototype.getIncomingEdges=function(a,b){return this.getEdges(a,b,!0,!1,!1)};mxGraph.prototype.getOutgoingEdges=function(a,b){return this.getEdges(a,b,!1,!0,!1)};
mxGraph.prototype.getEdges=function(a,b,c,d,e,f){c=null!=c?c:!0;d=null!=d?d:!0;e=null!=e?e:!0;f=null!=f?f:!1;for(var g=[],k=this.isCellCollapsed(a),l=this.model.getChildCount(a),m=0;m<l;m++){var n=this.model.getChildAt(a,m);if(k||!this.isCellVisible(n))g=g.concat(this.model.getEdges(n,c,d))}g=g.concat(this.model.getEdges(a,c,d));k=[];for(m=0;m<g.length;m++)n=this.view.getState(g[m]),l=null!=n?n.getVisibleTerminal(!0):this.view.getVisibleTerminal(g[m],!0),n=null!=n?n.getVisibleTerminal(!1):this.view.getVisibleTerminal(g[m],
!1),(e&&l==n||l!=n&&(c&&n==a&&(null==b||this.isValidAncestor(l,b,f))||d&&l==a&&(null==b||this.isValidAncestor(n,b,f))))&&k.push(g[m]);return k};mxGraph.prototype.isValidAncestor=function(a,b,c){return c?this.model.isAncestor(b,a):this.model.getParent(a)==b};
mxGraph.prototype.getOpposites=function(a,b,c,d){c=null!=c?c:!0;d=null!=d?d:!0;var e=[],f=new mxDictionary;if(null!=a)for(var g=0;g<a.length;g++){var k=this.view.getState(a[g]),l=null!=k?k.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[g],!0);k=null!=k?k.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[g],!1);l==b&&null!=k&&k!=b&&d?f.get(k)||(f.put(k,!0),e.push(k)):k==b&&null!=l&&l!=b&&c&&!f.get(l)&&(f.put(l,!0),e.push(l))}return e};
mxGraph.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.view.getState(d[f]),k=null!=g?g.getVisibleTerminal(!0):this.view.getVisibleTerminal(d[f],!0);g=null!=g?g.getVisibleTerminal(!1):this.view.getVisibleTerminal(d[f],!1);(k==a&&g==b||!c&&k==b&&g==a)&&e.push(d[f])}return e};
mxGraph.prototype.getPointForEvent=function(a,b){a=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));var c=this.view.scale,d=this.view.translate;b=0!=b?this.gridSize/2:0;a.x=this.snap(a.x/c-d.x-b);a.y=this.snap(a.y/c-d.y-b);return a};
mxGraph.prototype.getCells=function(a,b,c,d,e,f,g,k,l){f=null!=f?f:[];if(0<c||0<d||null!=g){var m=this.getModel(),n=a+c,p=b+d;null==e&&(e=this.getCurrentRoot(),null==e&&(e=m.getRoot()));if(null!=e)for(var r=m.getChildCount(e),q=0;q<r;q++){var t=m.getChildAt(e,q),u=this.view.getState(t);if(null!=u&&this.isCellVisible(t)&&(null==k||!k(u))){var x=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=x&&(u=mxUtils.getBoundingBox(u,x));(x=null!=g&&m.isVertex(t)&&mxUtils.intersects(g,u)||null!=g&&
m.isEdge(t)&&mxUtils.intersects(g,u)||null==g&&(m.isEdge(t)||m.isVertex(t))&&u.x>=a&&u.y+u.height<=p&&u.y>=b&&u.x+u.width<=n)&&f.push(t);x&&!l||this.getCells(a,b,c,d,t,f,g,k,l)}}}return f};mxGraph.prototype.getCellsBeyond=function(a,b,c,d,e){var f=[];if(d||e)if(null==c&&(c=this.getDefaultParent()),null!=c)for(var g=this.model.getChildCount(c),k=0;k<g;k++){var l=this.model.getChildAt(c,k),m=this.view.getState(l);this.isCellVisible(l)&&null!=m&&(!d||m.x>=a)&&(!e||m.y>=b)&&f.push(l)}return f};
mxGraph.prototype.findTreeRoots=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;var d=[];if(null!=a){for(var e=this.getModel(),f=e.getChildCount(a),g=null,k=0,l=0;l<f;l++){var m=e.getChildAt(a,l);if(this.model.isVertex(m)&&this.isCellVisible(m)){for(var n=this.getConnections(m,b?a:null),p=0,r=0,q=0;q<n.length;q++)this.view.getVisibleTerminal(n[q],!0)==m?p++:r++;(c&&0==p&&0<r||!c&&0==r&&0<p)&&d.push(m);n=c?r-p:p-r;n>k&&(k=n,g=m)}}0==d.length&&null!=g&&d.push(g)}return d};
mxGraph.prototype.traverse=function(a,b,c,d,e,f){if(null!=c&&null!=a&&(b=null!=b?b:!0,f=null!=f?f:!1,e=e||new mxDictionary,null==d||!e.get(d))&&(e.put(d,!0),d=c(a,d),null==d||d)&&(d=this.model.getEdgeCount(a),0<d))for(var g=0;g<d;g++){var k=this.model.getEdgeAt(a,g),l=this.model.getTerminal(k,!0)==a;b&&!f!=l||(l=this.model.getTerminal(k,!l),this.traverse(l,b,c,k,e,f))}};mxGraph.prototype.isCellSelected=function(a){return this.getSelectionModel().isSelected(a)};mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()};
mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()};mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length};mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]};mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()};mxGraph.prototype.setSelectionCell=function(a){this.getSelectionModel().setCell(a)};mxGraph.prototype.setSelectionCells=function(a){this.getSelectionModel().setCells(a)};
mxGraph.prototype.addSelectionCell=function(a){this.getSelectionModel().addCell(a)};mxGraph.prototype.addSelectionCells=function(a){this.getSelectionModel().addCells(a)};mxGraph.prototype.removeSelectionCell=function(a){this.getSelectionModel().removeCell(a)};mxGraph.prototype.removeSelectionCells=function(a){this.getSelectionModel().removeCells(a)};mxGraph.prototype.selectRegion=function(a,b){a=this.getCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(a,b);return a};
mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)};mxGraph.prototype.selectPreviousCell=function(){this.selectCell()};mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)};mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)};
mxGraph.prototype.selectCell=function(a,b,c){var d=this.selectionModel,e=0<d.cells.length?d.cells[0]:null;1<d.cells.length&&d.clear();d=null!=e?this.model.getParent(e):this.getDefaultParent();var f=this.model.getChildCount(d);null==e&&0<f?(a=this.model.getChildAt(d,0),this.setSelectionCell(a)):null!=e&&!b||null==this.view.getState(d)||null==this.model.getGeometry(d)?null!=e&&c?0<this.model.getChildCount(e)&&(a=this.model.getChildAt(e,0),this.setSelectionCell(a)):0<f&&(b=d.getIndex(e),a?(b++,a=this.model.getChildAt(d,
b%f)):(b--,a=this.model.getChildAt(d,0>b?f-1:b)),this.setSelectionCell(a)):this.getCurrentRoot()!=d&&this.setSelectionCell(d)};mxGraph.prototype.selectAll=function(a,b){a=a||this.getDefaultParent();b=b?this.model.filterDescendants(mxUtils.bind(this,function(c){return c!=a&&null!=this.view.getState(c)}),a):this.model.getChildren(a);null!=b&&this.setSelectionCells(b)};mxGraph.prototype.selectVertices=function(a,b){this.selectCells(!0,!1,a,b)};
mxGraph.prototype.selectEdges=function(a){this.selectCells(!1,!0,a)};mxGraph.prototype.selectCells=function(a,b,c,d){c=c||this.getDefaultParent();var e=mxUtils.bind(this,function(f){return null!=this.view.getState(f)&&((d||0==this.model.getChildCount(f))&&this.model.isVertex(f)&&a&&!this.model.isEdge(this.model.getParent(f))||this.model.isEdge(f)&&b)});c=this.model.filterDescendants(e,c);null!=c&&this.setSelectionCells(c)};
mxGraph.prototype.selectCellForEvent=function(a,b){var c=this.isCellSelected(a);this.isToggleEvent(b)?c?this.removeSelectionCell(a):this.addSelectionCell(a):c&&1==this.getSelectionCount()||this.setSelectionCell(a)};mxGraph.prototype.selectCellsForEvent=function(a,b){this.isToggleEvent(b)?this.addSelectionCells(a):this.setSelectionCells(a)};
mxGraph.prototype.createHandler=function(a){var b=null;if(null!=a)if(this.model.isEdge(a.cell)){b=a.getVisibleTerminalState(!0);var c=a.getVisibleTerminalState(!1),d=this.getCellGeometry(a.cell);b=this.view.getEdgeStyle(a,null!=d?d.points:null,b,c);b=this.createEdgeHandler(a,b)}else b=this.createVertexHandler(a);return b};mxGraph.prototype.createVertexHandler=function(a){return new mxVertexHandler(a)};
mxGraph.prototype.createEdgeHandler=function(a,b){return b==mxEdgeStyle.Loop||b==mxEdgeStyle.ElbowConnector||b==mxEdgeStyle.SideToSide||b==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(a):b==mxEdgeStyle.SegmentConnector||b==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(a):new mxEdgeHandler(a)};mxGraph.prototype.createEdgeSegmentHandler=function(a){return new mxEdgeSegmentHandler(a)};mxGraph.prototype.createElbowEdgeHandler=function(a){return new mxElbowEdgeHandler(a)};
mxGraph.prototype.addMouseListener=function(a){null==this.mouseListeners&&(this.mouseListeners=[]);this.mouseListeners.push(a)};mxGraph.prototype.removeMouseListener=function(a){if(null!=this.mouseListeners)for(var b=0;b<this.mouseListeners.length;b++)if(this.mouseListeners[b]==a){this.mouseListeners.splice(b,1);break}};
mxGraph.prototype.updateMouseEvent=function(a,b){if(null==a.graphX||null==a.graphY){var c=mxUtils.convertPoint(this.container,a.getX(),a.getY());a.graphX=c.x-this.panDx;a.graphY=c.y-this.panDy;null==a.getCell()&&this.isMouseDown&&b==mxEvent.MOUSE_MOVE&&(a.state=this.view.getState(this.getCellAt(c.x,c.y,null,null,null,function(d){return null==d.shape||d.shape.paintBackground!=mxRectangleShape.prototype.paintBackground||"1"==mxUtils.getValue(d.style,mxConstants.STYLE_POINTER_EVENTS,"1")||null!=d.shape.fill&&
d.shape.fill!=mxConstants.NONE})))}return a};mxGraph.prototype.getStateForTouchEvent=function(a){var b=mxEvent.getClientX(a);a=mxEvent.getClientY(a);b=mxUtils.convertPoint(this.container,b,a);return this.view.getState(this.getCellAt(b.x,b.y))};
mxGraph.prototype.isEventIgnored=function(a,b,c){var d=mxEvent.isMouseEvent(b.getEvent()),e=!1;b.getEvent()==this.lastEvent?e=!0:this.lastEvent=b.getEvent();if(null!=this.eventSource&&a!=mxEvent.MOUSE_MOVE)mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect),this.eventSource=this.mouseUpRedirect=this.mouseMoveRedirect=null;else if(!mxClient.IS_GC&&null!=this.eventSource&&b.getSource()!=this.eventSource)e=!0;else if(mxClient.IS_TOUCH&&a==mxEvent.MOUSE_DOWN&&
!d&&!mxEvent.isPenEvent(b.getEvent())){this.eventSource=b.getSource();var f=null;!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC||(f=b.getEvent().pointerId);this.mouseMoveRedirect=mxUtils.bind(this,function(g){null!=f&&g.pointerId!=f||this.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,this.getStateForTouchEvent(g)))});this.mouseUpRedirect=mxUtils.bind(this,function(g){this.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(g,this.getStateForTouchEvent(g)));f=null});mxEvent.addGestureListeners(this.eventSource,
null,this.mouseMoveRedirect,this.mouseUpRedirect)}this.isSyntheticEventIgnored(a,b,c)&&(e=!0);if(!mxEvent.isPopupTrigger(this.lastEvent)&&a!=mxEvent.MOUSE_MOVE&&2==this.lastEvent.detail)return!0;a==mxEvent.MOUSE_UP&&this.isMouseDown?this.isMouseDown=!1:a!=mxEvent.MOUSE_DOWN||this.isMouseDown?!e&&((!mxClient.IS_FF||a!=mxEvent.MOUSE_MOVE)&&this.isMouseDown&&this.isMouseTrigger!=d||a==mxEvent.MOUSE_DOWN&&this.isMouseDown||a==mxEvent.MOUSE_UP&&!this.isMouseDown)&&(e=!0):(this.isMouseDown=!0,this.isMouseTrigger=
d);e||a!=mxEvent.MOUSE_DOWN||(this.lastMouseX=b.getX(),this.lastMouseY=b.getY());return e};mxGraph.prototype.isSyntheticEventIgnored=function(a,b,c){c=!1;b=mxEvent.isMouseEvent(b.getEvent());this.ignoreMouseEvents&&b&&a!=mxEvent.MOUSE_MOVE?(this.ignoreMouseEvents=a!=mxEvent.MOUSE_UP,c=!0):mxClient.IS_FF&&!b&&a==mxEvent.MOUSE_UP&&(this.ignoreMouseEvents=!0);return c};
mxGraph.prototype.isEventSourceIgnored=function(a,b){var c=b.getSource(),d=null!=c.nodeName?c.nodeName.toLowerCase():"";b=!mxEvent.isMouseEvent(b.getEvent())||mxEvent.isLeftMouseButton(b.getEvent());return a==mxEvent.MOUSE_DOWN&&b&&("select"==d||"option"==d||"input"==d&&"checkbox"!=c.type&&"radio"!=c.type&&"button"!=c.type&&"submit"!=c.type&&"file"!=c.type)};mxGraph.prototype.getEventState=function(a){return a};
mxGraph.prototype.isPointerEventIgnored=function(a,b){var c=!1;if(mxClient.IS_ANDROID||!mxClient.IS_LINUX||!mxClient.IS_GC){var d=b.getEvent().pointerId;a==mxEvent.MOUSE_DOWN?null!=this.currentPointerId&&this.currentPointerId!=d?c=!0:null==this.currentPointerId&&(this.currentPointerId=b.getEvent().pointerId):a==mxEvent.MOUSE_MOVE?null!=this.currentPointerId&&this.currentPointerId!=d&&(c=!0):a==mxEvent.MOUSE_UP&&(this.currentPointerId=null)}return c};
mxGraph.prototype.fireMouseEvent=function(a,b,c){if(this.isEventSourceIgnored(a,b))null!=this.tooltipHandler&&this.tooltipHandler.hide();else if(this.isPointerEventIgnored(a,b))this.tapAndHoldValid=!1;else{null==c&&(c=this);b=this.updateMouseEvent(b,a);if(!this.nativeDblClickEnabled&&!mxEvent.isPopupTrigger(b.getEvent())||this.doubleTapEnabled&&mxClient.IS_TOUCH&&(mxEvent.isTouchEvent(b.getEvent())||mxEvent.isPenEvent(b.getEvent()))){var d=(new Date).getTime();if(a==mxEvent.MOUSE_DOWN)if(null!=this.lastTouchEvent&&
this.lastTouchEvent!=b.getEvent()&&d-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-b.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-b.getY())<this.doubleTapTolerance&&2>this.doubleClickCounter){if(this.doubleClickCounter++,d=!1,a==mxEvent.MOUSE_UP?b.getCell()==this.lastTouchCell&&null!=this.lastTouchCell&&(this.lastTouchTime=0,d=this.lastTouchCell,this.lastTouchCell=null,this.dblClick(b.getEvent(),d),d=!0):(this.fireDoubleClick=!0,this.lastTouchTime=0),d){mxEvent.consume(b.getEvent());
return}}else{if(null==this.lastTouchEvent||this.lastTouchEvent!=b.getEvent())this.lastTouchCell=b.getCell(),this.lastTouchX=b.getX(),this.lastTouchY=b.getY(),this.lastTouchTime=d,this.lastTouchEvent=b.getEvent(),this.doubleClickCounter=0}else if((this.isMouseDown||a==mxEvent.MOUSE_UP)&&this.fireDoubleClick){this.fireDoubleClick=!1;d=this.lastTouchCell;this.lastTouchCell=null;this.isMouseDown=!1;(null!=d||(mxEvent.isTouchEvent(b.getEvent())||mxEvent.isPenEvent(b.getEvent()))&&(mxClient.IS_GC||mxClient.IS_SF))&&
Math.abs(this.lastTouchX-b.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-b.getY())<this.doubleTapTolerance?this.dblClick(b.getEvent(),d):mxEvent.consume(b.getEvent());return}}if(!this.isEventIgnored(a,b,c)){b.state=this.getEventState(b.getState());this.fireEvent(new mxEventObject(mxEvent.FIRE_MOUSE_EVENT,"eventName",a,"event",b));if(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE11||mxClient.IS_IE&&mxClient.IS_SVG||b.getEvent().target!=this.container){if(a==mxEvent.MOUSE_MOVE&&
this.isMouseDown&&this.autoScroll&&!mxEvent.isMultiTouchEvent(b.getEvent))this.scrollPointToVisible(b.getGraphX(),b.getGraphY(),this.autoExtend);else if(a==mxEvent.MOUSE_UP&&this.ignoreScrollbars&&this.translateToScrollPosition&&(0!=this.container.scrollLeft||0!=this.container.scrollTop)){d=this.view.scale;var e=this.view.translate;this.view.setTranslate(e.x-this.container.scrollLeft/d,e.y-this.container.scrollTop/d);this.container.scrollLeft=0;this.container.scrollTop=0}if(null!=this.mouseListeners)for(d=
[c,b],b.getEvent().preventDefault||(b.getEvent().returnValue=!0),e=0;e<this.mouseListeners.length;e++){var f=this.mouseListeners[e];a==mxEvent.MOUSE_DOWN?f.mouseDown.apply(f,d):a==mxEvent.MOUSE_MOVE?f.mouseMove.apply(f,d):a==mxEvent.MOUSE_UP&&f.mouseUp.apply(f,d)}a==mxEvent.MOUSE_UP&&this.click(b)}(mxEvent.isTouchEvent(b.getEvent())||mxEvent.isPenEvent(b.getEvent()))&&a==mxEvent.MOUSE_DOWN&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress?(this.tapAndHoldInProgress=!0,this.initialTouchX=b.getGraphX(),
this.initialTouchY=b.getGraphY(),this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(b);this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0):a==mxEvent.MOUSE_UP?this.tapAndHoldValid=this.tapAndHoldInProgress=!1:this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-b.getGraphX())<this.tolerance&&Math.abs(this.initialTouchY-
b.getGraphY())<this.tolerance);a==mxEvent.MOUSE_DOWN&&this.isEditing()&&!this.cellEditor.isEventSource(b.getEvent())&&this.stopEditing(!this.isInvokesStopCellEditing());this.consumeMouseEvent(a,b,c)}}};mxGraph.prototype.consumeMouseEvent=function(a,b,c){a==mxEvent.MOUSE_DOWN&&mxEvent.isTouchEvent(b.getEvent())&&b.consume(!1)};mxGraph.prototype.fireGestureEvent=function(a,b){this.lastTouchTime=0;this.fireEvent(new mxEventObject(mxEvent.GESTURE,"event",a,"cell",b))};
mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.popupMenuHandler&&this.popupMenuHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),
null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)};function mxCellOverlay(a,b,c,d,e,f){this.image=a;this.tooltip=b;this.align=null!=c?c:this.align;this.verticalAlign=null!=d?d:this.verticalAlign;this.offset=null!=e?e:new mxPoint;this.cursor=null!=f?f:"help"}mxCellOverlay.prototype=new mxEventSource;mxCellOverlay.prototype.constructor=mxCellOverlay;mxCellOverlay.prototype.image=null;
mxCellOverlay.prototype.tooltip=null;mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT;mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM;mxCellOverlay.prototype.offset=null;mxCellOverlay.prototype.cursor=null;mxCellOverlay.prototype.defaultOverlap=.5;
mxCellOverlay.prototype.getBounds=function(a){var b=a.view.graph.getModel().isEdge(a.cell),c=a.view.scale,d=this.image.width,e=this.image.height;if(b)if(b=a.absolutePoints,1==b.length%2)b=b[Math.floor(b.length/2)];else{var f=b.length/2;a=b[f-1];b=b[f];b=new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2)}else b=new mxPoint,b.x=this.align==mxConstants.ALIGN_LEFT?a.x:this.align==mxConstants.ALIGN_CENTER?a.x+a.width/2:a.x+a.width,b.y=this.verticalAlign==mxConstants.ALIGN_TOP?a.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?
a.y+a.height/2:a.y+a.height;return new mxRectangle(Math.round(b.x-(d*this.defaultOverlap-this.offset.x)*c),Math.round(b.y-(e*this.defaultOverlap-this.offset.y)*c),d*c,e*c)};mxCellOverlay.prototype.toString=function(){return this.tooltip};function mxOutline(a,b){this.source=a;null!=b&&this.init(b)}mxOutline.prototype.source=null;mxOutline.prototype.container=null;mxOutline.prototype.enabled=!0;mxOutline.prototype.suspended=!1;mxOutline.prototype.border=14;
mxOutline.prototype.opacity=mxClient.IS_IE11?.9:.7;
mxOutline.prototype.init=function(a){this.container=a;this.updateHandler=mxUtils.bind(this,function(b,c){this.update(!0)});this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler);this.source.addListener(mxEvent.REFRESH,this.updateHandler);a=this.source.getView();a.addListener(mxEvent.UP,this.updateHandler);a.addListener(mxEvent.DOWN,this.updateHandler);a.addListener(mxEvent.SCALE,this.updateHandler);a.addListener(mxEvent.TRANSLATE,this.updateHandler);a.addListener(mxEvent.SCALE_AND_TRANSLATE,
this.updateHandler);this.scrollHandler=mxUtils.bind(this,function(b,c){this.update(!1)});mxEvent.addListener(this.source.container,"scroll",this.scrollHandler);this.source.addListener(mxEvent.PAN,this.scrollHandler);this.update(!0)};mxOutline.prototype.isEnabled=function(){return this.enabled};mxOutline.prototype.setEnabled=function(a){this.enabled=a};mxOutline.prototype.isSuspended=function(){return this.suspended};mxOutline.prototype.setSuspended=function(a){this.suspended=a;this.update(!0)};
mxOutline.prototype.isScrolling=function(){return this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)};
mxOutline.prototype.createSvg=function(){var a=document.createElementNS(mxConstants.NS_SVG,"svg");a.style.position="absolute";a.style.left="0px";a.style.top="0px";a.style.width="100%";a.style.height="100%";a.style.display="block";a.style.padding=this.border+"px";a.style.boxSizing="border-box";a.style.overflow="visible";a.style.cursor="default";a.setAttribute("shape-rendering","optimizeSpeed");a.setAttribute("image-rendering","optimizeSpeed");return a};
mxOutline.prototype.addGestureListeners=function(a){var b=null,c=0,d=0,e=1,f=mxUtils.bind(this,function(l){if(this.isEnabled()){b=new mxPoint(mxEvent.getClientX(l),mxEvent.getClientY(l));var m=a.clientWidth-2*this.border,n=a.clientHeight-2*this.border,p=this.getViewBox();e=Math.max(p.width/m,p.height/n);if(mxEvent.getSource(l)!=this.viewport)if(this.isScrolling()){m-=p.width/e;n-=p.height/e;var r=this.svg.getBoundingClientRect();this.source.container.scrollLeft=p.x-m*e/2+(b.x-this.border-r.left)*
e;this.source.container.scrollTop=p.y-n*e/2+(b.y-this.border-r.top)*e}else p=this.source.view.translate,n=this.viewport.getBoundingClientRect(),m=(mxEvent.getClientX(l)-n.left)*e/this.source.view.scale,n=(mxEvent.getClientY(l)-n.top)*e/this.source.view.scale,this.source.getView().setTranslate(p.x-m,p.y-n),this.source.panGraph(0,0);mxEvent.addGestureListeners(document,null,g,k);c=this.source.container.scrollLeft;d=this.source.container.scrollTop;mxEvent.consume(l)}}),g=mxUtils.bind(this,function(l){this.isEnabled()&&
null!=b&&(this.isScrolling()?(this.source.container.scrollLeft=c+(mxEvent.getClientX(l)-b.x)*e,this.source.container.scrollTop=d+(mxEvent.getClientY(l)-b.y)*e):this.source.panGraph((b.x-mxEvent.getClientX(l))*e,(b.y-mxEvent.getClientY(l))*e),mxEvent.consume(l))}),k=mxUtils.bind(this,function(l){if(this.isEnabled()&&null!=b){if(!this.isScrolling()){var m=(mxEvent.getClientX(l)-b.x)*e/this.source.view.scale,n=(mxEvent.getClientY(l)-b.y)*e/this.source.view.scale,p=this.source.view.translate;this.source.getView().setTranslate(p.x-
m,p.y-n);this.source.panGraph(0,0)}mxEvent.removeGestureListeners(document,null,g,k);mxEvent.consume(l);b=null}});mxEvent.addGestureListeners(a,f,g,k)};mxOutline.prototype.getViewBox=function(){return this.source.getGraphBounds()};
mxOutline.prototype.updateSvg=function(){null==this.svg&&(this.svg=this.createSvg(),this.addGestureListeners(this.svg),this.container.appendChild(this.svg));var a=this.getViewBox();this.svg.setAttribute("viewBox",Math.round(a.x)+" "+Math.round(a.y)+" "+Math.round(a.width)+" "+Math.round(a.height));a=this.source.background;this.svg.style.backgroundColor=a==mxConstants.NONE?"":a;this.updateDrawPane()};
mxOutline.prototype.updateDrawPane=function(){null!=this.drawPane&&this.drawPane.parentNode.removeChild(this.drawPane);this.drawPane=this.source.view.getDrawPane().cloneNode(!0);this.drawPane.style.opacity=this.opacity;this.processSvg(this.drawPane);null!=this.viewport?this.svg.insertBefore(this.drawPane,this.viewport):this.svg.appendChild(this.drawPane)};
mxOutline.prototype.processSvg=function(a){var b=mxClient.IS_IE11?Math.max(1,this.source.view.scale):this.source.view.scale;Array.prototype.slice.call(a.getElementsByTagName("*")).forEach(mxUtils.bind(this,function(c){if("text"!=c.nodeName&&"foreignObject"!=c.nodeName&&"hidden"!=c.getAttribute("visibility")&&c instanceof SVGElement){var d=parseInt(c.getAttribute("stroke-width")||1);isNaN(d)||c.setAttribute("stroke-width",Math.max(mxClient.IS_IE11?4:1,d/(5*b)));c.setAttribute("vector-effect","non-scaling-stroke");
c.style.cursor=""}else c.parentNode.removeChild(c)}))};
mxOutline.prototype.updateViewport=function(){if(null!=this.svg){null==this.viewport&&(this.viewport=this.createViewport(),this.svg.appendChild(this.viewport));var a=this.source.container;a=new mxRectangle(a.scrollLeft,a.scrollTop,a.clientWidth,a.clientHeight);this.isScrolling()||(a.x=-this.source.panDx,a.y=-this.source.panDy);this.viewport.setAttribute("x",a.x);this.viewport.setAttribute("y",a.y);this.viewport.setAttribute("width",a.width);this.viewport.setAttribute("height",a.height)}};
mxOutline.prototype.createViewport=function(){var a=this.svg.ownerDocument.createElementNS(mxConstants.NS_SVG,"rect");a.setAttribute("stroke-width",mxClient.IS_IE11?"12":"3");a.setAttribute("stroke",HoverIcons.prototype.arrowFill);a.setAttribute("fill",HoverIcons.prototype.arrowFill);a.setAttribute("vector-effect","non-scaling-stroke");a.setAttribute("fill-opacity",.2);a.style.cursor="move";return a};
mxOutline.prototype.update=function(a){null!=this.source&&null!=this.source.container&&(null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),this.fullUpdate=this.fullUpdate||a,this.thread=window.setTimeout(mxUtils.bind(this,function(){this.isSuspended()||(this.fullUpdate&&this.updateSvg(),this.updateViewport());this.thread=this.fullUpdate=null}),this.isScrolling()?10:0))};
mxOutline.prototype.destroy=function(){null!=this.svg&&(this.svg.parentNode.removeChild(this.svg),this.svg=null);null!=this.source&&(this.source.removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),this.source.getModel().removeListener(this.updateHandler),this.source.removeListener(mxEvent.PAN,this.scrollHandler),mxEvent.removeListener(this.source.container,"scroll",this.scrollHandler),this.source=null)};
function mxMultiplicity(a,b,c,d,e,f,g,k,l,m){this.source=a;this.type=b;this.attr=c;this.value=d;this.min=null!=e?e:0;this.max=null!=f?f:"n";this.validNeighbors=g;this.countError=mxResources.get(k)||k;this.typeError=mxResources.get(l)||l;this.validNeighborsAllowed=null!=m?m:!0}mxMultiplicity.prototype.type=null;mxMultiplicity.prototype.attr=null;mxMultiplicity.prototype.value=null;mxMultiplicity.prototype.source=null;mxMultiplicity.prototype.min=null;mxMultiplicity.prototype.max=null;
mxMultiplicity.prototype.validNeighbors=null;mxMultiplicity.prototype.validNeighborsAllowed=!0;mxMultiplicity.prototype.countError=null;mxMultiplicity.prototype.typeError=null;
mxMultiplicity.prototype.check=function(a,b,c,d,e,f){var g="";if(this.source&&this.checkTerminal(a,c,b)||!this.source&&this.checkTerminal(a,d,b))null!=this.countError&&(this.source&&(0==this.max||e>=this.max)||!this.source&&(0==this.max||f>=this.max))&&(g+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(a,b,c,d)||(g+=this.typeError+"\n"));return 0<g.length?g:null};
mxMultiplicity.prototype.checkNeighbors=function(a,b,c,d){b=a.model.getValue(c);d=a.model.getValue(d);c=!this.validNeighborsAllowed;for(var e=this.validNeighbors,f=0;f<e.length;f++)if(this.source&&this.checkType(a,d,e[f])){c=this.validNeighborsAllowed;break}else if(!this.source&&this.checkType(a,b,e[f])){c=this.validNeighborsAllowed;break}return c};mxMultiplicity.prototype.checkTerminal=function(a,b,c){b=a.model.getValue(b);return this.checkType(a,b,this.type,this.attr,this.value)};
mxMultiplicity.prototype.checkType=function(a,b,c,d,e){return null!=b?isNaN(b.nodeType)?b==c:mxUtils.isNode(b,c,d,e):!1};
function mxLayoutManager(a){this.undoHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.beforeUndo(c.getProperty("edit"))});this.moveHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.cellsMoved(c.getProperty("cells"),c.getProperty("event"))});this.resizeHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.cellsResized(c.getProperty("cells"),c.getProperty("bounds"),c.getProperty("previous"))});this.setGraph(a)}mxLayoutManager.prototype=new mxEventSource;
mxLayoutManager.prototype.constructor=mxLayoutManager;mxLayoutManager.prototype.graph=null;mxLayoutManager.prototype.bubbling=!0;mxLayoutManager.prototype.enabled=!0;mxLayoutManager.prototype.undoHandler=null;mxLayoutManager.prototype.moveHandler=null;mxLayoutManager.prototype.resizeHandler=null;mxLayoutManager.prototype.isEnabled=function(){return this.enabled};mxLayoutManager.prototype.setEnabled=function(a){this.enabled=a};mxLayoutManager.prototype.isBubbling=function(){return this.bubbling};
mxLayoutManager.prototype.setBubbling=function(a){this.bubbling=a};mxLayoutManager.prototype.getGraph=function(){return this.graph};
mxLayoutManager.prototype.setGraph=function(a){if(null!=this.graph){var b=this.graph.getModel();b.removeListener(this.undoHandler);this.graph.removeListener(this.moveHandler);this.graph.removeListener(this.resizeHandler)}this.graph=a;null!=this.graph&&(b=this.graph.getModel(),b.addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler),this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler))};
mxLayoutManager.prototype.hasLayout=function(a){return null!=this.getLayout(a,mxEvent.LAYOUT_CELLS)};mxLayoutManager.prototype.getLayout=function(a,b){return null};mxLayoutManager.prototype.beforeUndo=function(a){this.executeLayoutForCells(this.getCellsForChanges(a.changes))};
mxLayoutManager.prototype.cellsMoved=function(a,b){if(null!=a&&null!=b){b=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(b),mxEvent.getClientY(b));for(var c=this.getGraph().getModel(),d=0;d<a.length;d++){var e=this.getLayout(c.getParent(a[d]),mxEvent.MOVE_CELLS);null!=e&&e.moveCell(a[d],b.x,b.y)}}};
mxLayoutManager.prototype.cellsResized=function(a,b,c){if(null!=a&&null!=b)for(var d=this.getGraph().getModel(),e=0;e<a.length;e++){var f=this.getLayout(d.getParent(a[e]),mxEvent.RESIZE_CELLS);null!=f&&f.resizeCell(a[e],b[e],c[e])}};mxLayoutManager.prototype.getCellsForChanges=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d instanceof mxRootChange)return[];b=b.concat(this.getCellsForChange(d))}return b};
mxLayoutManager.prototype.getCellsForChange=function(a){return a instanceof mxChildChange?this.addCellsWithLayout(a.child,this.addCellsWithLayout(a.previous)):a instanceof mxValueChange||a instanceof mxTerminalChange||a instanceof mxGeometryChange||a instanceof mxVisibleChange||a instanceof mxStyleChange?this.addCellsWithLayout(a.cell):[]};mxLayoutManager.prototype.addCellsWithLayout=function(a,b){return this.addDescendantsWithLayout(a,this.addAncestorsWithLayout(a,b))};
mxLayoutManager.prototype.addAncestorsWithLayout=function(a,b){b=null!=b?b:[];if(null!=a&&(this.hasLayout(a)&&b.push(a),this.isBubbling())){var c=this.getGraph().getModel();this.addAncestorsWithLayout(c.getParent(a),b)}return b};mxLayoutManager.prototype.addDescendantsWithLayout=function(a,b){b=null!=b?b:[];if(null!=a&&this.hasLayout(a))for(var c=this.getGraph().getModel(),d=0;d<c.getChildCount(a);d++){var e=c.getChildAt(a,d);this.hasLayout(e)&&(b.push(e),this.addDescendantsWithLayout(e,b))}return b};
mxLayoutManager.prototype.executeLayoutForCells=function(a){var b=this.getGraph().getModel();b.beginUpdate();try{var c=mxUtils.sortCells(a,!1);this.layoutCells(c,!0);this.layoutCells(c.reverse(),!1)}finally{b.endUpdate()}};
mxLayoutManager.prototype.layoutCells=function(a,b){if(0<a.length){var c=this.getGraph().getModel();c.beginUpdate();try{for(var d=null,e=0;e<a.length;e++)a[e]!=c.getRoot()&&a[e]!=d&&(this.executeLayout(a[e],b),d=a[e]);this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",a))}finally{c.endUpdate()}}};mxLayoutManager.prototype.executeLayout=function(a,b){b=this.getLayout(a,b?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE);null!=b&&b.execute(a)};mxLayoutManager.prototype.destroy=function(){this.setGraph(null)};
function mxSwimlaneManager(a,b,c,d){this.horizontal=null!=b?b:!0;this.addEnabled=null!=c?c:!0;this.resizeEnabled=null!=d?d:!0;this.addHandler=mxUtils.bind(this,function(e,f){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(f.getProperty("cells"))});this.resizeHandler=mxUtils.bind(this,function(e,f){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(f.getProperty("cells"))});this.setGraph(a)}mxSwimlaneManager.prototype=new mxEventSource;mxSwimlaneManager.prototype.constructor=mxSwimlaneManager;
mxSwimlaneManager.prototype.graph=null;mxSwimlaneManager.prototype.enabled=!0;mxSwimlaneManager.prototype.horizontal=!0;mxSwimlaneManager.prototype.addEnabled=!0;mxSwimlaneManager.prototype.resizeEnabled=!0;mxSwimlaneManager.prototype.addHandler=null;mxSwimlaneManager.prototype.resizeHandler=null;mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled};mxSwimlaneManager.prototype.setEnabled=function(a){this.enabled=a};mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal};
mxSwimlaneManager.prototype.setHorizontal=function(a){this.horizontal=a};mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled};mxSwimlaneManager.prototype.setAddEnabled=function(a){this.addEnabled=a};mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled};mxSwimlaneManager.prototype.setResizeEnabled=function(a){this.resizeEnabled=a};mxSwimlaneManager.prototype.getGraph=function(){return this.graph};
mxSwimlaneManager.prototype.setGraph=function(a){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler));this.graph=a;null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))};mxSwimlaneManager.prototype.isSwimlaneIgnored=function(a){return!this.getGraph().isSwimlane(a)};
mxSwimlaneManager.prototype.isCellHorizontal=function(a){return this.graph.isSwimlane(a)?(a=this.graph.getCellStyle(a),1==mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,1)):!this.isHorizontal()};mxSwimlaneManager.prototype.cellsAdded=function(a){if(null!=a){var b=this.getGraph().getModel();b.beginUpdate();try{for(var c=0;c<a.length;c++)this.isSwimlaneIgnored(a[c])||this.swimlaneAdded(a[c])}finally{b.endUpdate()}}};
mxSwimlaneManager.prototype.swimlaneAdded=function(a){for(var b=this.getGraph().getModel(),c=b.getParent(a),d=b.getChildCount(c),e=null,f=0;f<d;f++){var g=b.getChildAt(c,f);if(g!=a&&!this.isSwimlaneIgnored(g)&&(e=b.getGeometry(g),null!=e))break}null!=e&&(b=null!=c?this.isCellHorizontal(c):this.horizontal,this.resizeSwimlane(a,e.width,e.height,b))};
mxSwimlaneManager.prototype.cellsResized=function(a){if(null!=a){var b=this.getGraph().getModel();b.beginUpdate();try{for(var c=0;c<a.length;c++)if(!this.isSwimlaneIgnored(a[c])){var d=b.getGeometry(a[c]);if(null!=d){for(var e=new mxRectangle(0,0,d.width,d.height),f=a[c],g=f;null!=g;){f=g;g=b.getParent(g);var k=this.graph.isSwimlane(g)?this.graph.getStartSize(g):new mxRectangle;e.width+=k.width;e.height+=k.height}var l=null!=g?this.isCellHorizontal(g):this.horizontal;this.resizeSwimlane(f,e.width,
e.height,l)}}}finally{b.endUpdate()}}};
mxSwimlaneManager.prototype.resizeSwimlane=function(a,b,c,d){var e=this.getGraph().getModel();e.beginUpdate();try{var f=this.isCellHorizontal(a);if(!this.isSwimlaneIgnored(a)){var g=e.getGeometry(a);null!=g&&(d&&g.height!=c||!d&&g.width!=b)&&(g=g.clone(),d?g.height=c:g.width=b,e.setGeometry(a,g))}var k=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;b-=k.width;c-=k.height;var l=e.getChildCount(a);for(d=0;d<l;d++){var m=e.getChildAt(a,d);this.resizeSwimlane(m,b,c,f)}}finally{e.endUpdate()}};
mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)};
function mxTemporaryCellStates(a,b,c,d,e,f){b=null!=b?b:1;this.view=a;this.oldValidateCellState=a.validateCellState;this.oldBounds=a.getGraphBounds();this.oldStates=a.getStates();this.oldScale=a.getScale();this.oldDoRedrawShape=a.graph.cellRenderer.doRedrawShape;var g=this;null!=e&&(a.graph.cellRenderer.doRedrawShape=function(m){var n=m.shape.paint;m.shape.paint=function(p){var r=e(m);null!=r&&p.setLink(r,null!=f?f(m):null);n.apply(this,arguments);null!=r&&p.setLink(null)};g.oldDoRedrawShape.apply(a.graph.cellRenderer,
arguments);m.shape.paint=n});a.validateCellState=function(m,n){return null==m||null==d||d(m)?g.oldValidateCellState.apply(a,arguments):null};a.setStates(new mxDictionary);a.setScale(b);if(null!=c){a.resetValidationState();b=null;for(var k=0;k<c.length;k++){var l=a.getBoundingBox(a.validateCellState(a.validateCell(c[k])));null==b?b=l:b.add(l)}a.setGraphBounds(b||new mxRectangle)}}mxTemporaryCellStates.prototype.view=null;mxTemporaryCellStates.prototype.oldStates=null;
mxTemporaryCellStates.prototype.oldBounds=null;mxTemporaryCellStates.prototype.oldScale=null;mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale);this.view.setStates(this.oldStates);this.view.setGraphBounds(this.oldBounds);this.view.validateCellState=this.oldValidateCellState;this.view.graph.cellRenderer.doRedrawShape=this.oldDoRedrawShape};function mxCellStatePreview(a){this.deltas=new mxDictionary;this.graph=a}mxCellStatePreview.prototype.graph=null;
mxCellStatePreview.prototype.deltas=null;mxCellStatePreview.prototype.count=0;mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count};mxCellStatePreview.prototype.moveState=function(a,b,c,d,e){d=null!=d?d:!0;e=null!=e?e:!0;var f=this.deltas.get(a.cell);null==f?(f={point:new mxPoint(b,c),state:a},this.deltas.put(a.cell,f),this.count++):d?(f.point.x+=b,f.point.y+=c):(f.point.x=b,f.point.y=c);e&&this.addEdges(a);return f.point};
mxCellStatePreview.prototype.show=function(a){this.deltas.visit(mxUtils.bind(this,function(b,c){this.translateState(c.state,c.point.x,c.point.y)}));this.deltas.visit(mxUtils.bind(this,function(b,c){this.revalidateState(c.state,c.point.x,c.point.y,a)}))};
mxCellStatePreview.prototype.translateState=function(a,b,c){if(null!=a){var d=this.graph.getModel();if(d.isVertex(a.cell)){a.view.updateCellState(a);var e=d.getGeometry(a.cell);0==b&&0==c||null==e||e.relative&&null==this.deltas.get(a.cell)||(a.x+=b,a.y+=c)}e=d.getChildCount(a.cell);for(var f=0;f<e;f++)this.translateState(a.view.getState(d.getChildAt(a.cell,f)),b,c)}};
mxCellStatePreview.prototype.revalidateState=function(a,b,c,d){if(null!=a){var e=this.graph.getModel();e.isEdge(a.cell)&&a.view.updateCellState(a);var f=this.graph.getCellGeometry(a.cell),g=a.view.getState(e.getParent(a.cell));0==b&&0==c||null==f||!f.relative||!e.isVertex(a.cell)||null!=g&&!e.isVertex(g.cell)&&null==this.deltas.get(a.cell)||(a.x+=b,a.y+=c);this.graph.cellRenderer.redraw(a);null!=d&&d(a);f=e.getChildCount(a.cell);for(g=0;g<f;g++)this.revalidateState(this.graph.view.getState(e.getChildAt(a.cell,
g)),b,c,d)}};mxCellStatePreview.prototype.addEdges=function(a){for(var b=this.graph.getModel(),c=b.getEdgeCount(a.cell),d=0;d<c;d++){var e=a.view.getState(b.getEdgeAt(a.cell,d));null!=e&&this.moveState(e,0,0)}};function mxConnectionConstraint(a,b,c,d,e){this.point=a;this.perimeter=null!=b?b:!0;this.name=c;this.dx=d?d:0;this.dy=e?e:0}mxConnectionConstraint.prototype.point=null;mxConnectionConstraint.prototype.perimeter=null;mxConnectionConstraint.prototype.name=null;
mxConnectionConstraint.prototype.dx=null;mxConnectionConstraint.prototype.dy=null;
function mxGraphHandler(a){this.graph=a;this.graph.addMouseListener(this);this.panHandler=mxUtils.bind(this,function(){this.suspended||(this.updatePreview(),this.updateHint())});this.graph.addListener(mxEvent.PAN,this.panHandler);this.escapeHandler=mxUtils.bind(this,function(b,c){this.reset()});this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler);this.refreshHandler=mxUtils.bind(this,function(b,c){this.refreshThread&&window.clearTimeout(this.refreshThread);this.refreshThread=window.setTimeout(mxUtils.bind(this,
function(){this.refreshThread=null;if(null!=this.first&&!this.suspended){var d=this.currentDx,e=this.currentDy;this.currentDy=this.currentDx=0;this.updatePreview();this.bounds=this.graph.getView().getBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);null!=this.pBounds||this.livePreviewUsed?(this.currentDx=d,this.currentDy=e,this.updatePreview(),this.updateHint(),this.livePreviewUsed&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1,!0),
this.updatePreview())):this.reset()}}),0)});this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.addListener(mxEvent.REFRESH,this.refreshHandler);this.keyHandler=mxUtils.bind(this,function(b){null==this.graph.container||"hidden"==this.graph.container.style.visibility||null==this.first||this.suspended||(b=this.graph.isCloneEvent(b)&&this.graph.isCellsCloneable()&&this.isCloneEnabled(),b!=this.cloning&&(this.cloning=b,this.checkPreview(),this.updatePreview()))});mxEvent.addListener(document,
"keydown",this.keyHandler);mxEvent.addListener(document,"keyup",this.keyHandler)}mxGraphHandler.prototype.graph=null;mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50;mxGraphHandler.prototype.enabled=!0;mxGraphHandler.prototype.highlightEnabled=!0;mxGraphHandler.prototype.cloneEnabled=!0;mxGraphHandler.prototype.moveEnabled=!0;mxGraphHandler.prototype.guidesEnabled=!1;mxGraphHandler.prototype.handlesVisible=!0;mxGraphHandler.prototype.guide=null;mxGraphHandler.prototype.currentDx=null;
mxGraphHandler.prototype.currentDy=null;mxGraphHandler.prototype.updateCursor=!0;mxGraphHandler.prototype.selectEnabled=!0;mxGraphHandler.prototype.removeCellsFromParent=!0;mxGraphHandler.prototype.removeEmptyParents=!1;mxGraphHandler.prototype.connectOnDrop=!1;mxGraphHandler.prototype.scrollOnMove=!0;mxGraphHandler.prototype.minimumSize=6;mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1;
mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.allowLivePreview=mxClient.IS_SVG;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};mxGraphHandler.prototype.setCloneEnabled=function(a){this.cloneEnabled=a};mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled};
mxGraphHandler.prototype.setMoveEnabled=function(a){this.moveEnabled=a};mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled};mxGraphHandler.prototype.setSelectEnabled=function(a){this.selectEnabled=a};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};mxGraphHandler.prototype.setRemoveCellsFromParent=function(a){this.removeCellsFromParent=a};
mxGraphHandler.prototype.isPropagateSelectionCell=function(a,b,c){var d=this.graph.model.getParent(a);return b?(b=this.graph.model.isEdge(a)?null:this.graph.getCellGeometry(a),!this.graph.isSiblingSelected(a)&&(null!=b&&b.relative||!this.graph.isSwimlane(d))):(!this.graph.isToggleEvent(c.getEvent())||!this.graph.isSiblingSelected(a)&&!this.graph.isCellSelected(a)&&!this.graph.isSwimlane(d)||this.graph.isCellSelected(d))&&(this.graph.isToggleEvent(c.getEvent())||!this.graph.isCellSelected(d))};
mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=a.getState();if(!(this.graph.isToggleEvent(a.getEvent())&&mxEvent.isAltDown(a.getEvent())||null==b||this.graph.isCellSelected(b.cell)))for(var c=this.graph.model,d=this.graph.view.getState(c.getParent(b.cell));null!=d&&!this.graph.isCellSelected(d.cell)&&(c.isVertex(d.cell)||c.isEdge(d.cell))&&this.isPropagateSelectionCell(b.cell,!0,a);)b=d,d=this.graph.view.getState(this.graph.getModel().getParent(b.cell));return null!=b?b.cell:null};
mxGraphHandler.prototype.isDelayedSelection=function(a,b){if(!this.graph.isToggleEvent(b.getEvent())||!mxEvent.isAltDown(b.getEvent()))for(;null!=a;){if(this.graph.selectionCellsHandler.isHandled(a))return this.graph.cellEditor.getEditingCell()!=a;a=this.graph.model.getParent(a)}return this.graph.isToggleEvent(b.getEvent())&&!mxEvent.isAltDown(b.getEvent())};
mxGraphHandler.prototype.selectDelayed=function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);this.selectCellForEvent(b,a)}};
mxGraphHandler.prototype.selectCellForEvent=function(a,b){var c=this.graph.view.getState(a);if(null!=c){if(!(b.isSource(c.control)||this.graph.isToggleEvent(b.getEvent())&&mxEvent.isAltDown(b.getEvent()))){c=this.graph.getModel();for(var d=c.getParent(a);null!=this.graph.view.getState(d)&&(c.isVertex(d)||c.isEdge(d)&&!this.graph.isToggleEvent(b.getEvent()))&&this.isPropagateSelectionCell(a,!1,b);)a=d,d=c.getParent(a)}this.graph.selectCellForEvent(a,b.getEvent())}return a};
mxGraphHandler.prototype.consumeMouseEvent=function(a,b){b.consume()};
mxGraphHandler.prototype.mouseDown=function(a,b){if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null!=b.getState()&&!mxEvent.isMultiTouchEvent(b.getEvent())&&(a=this.getInitialCellForEvent(b),this.delayedSelection=this.isDelayedSelection(a,b),this.cell=null,this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(a,b.getEvent()),this.isMoveEnabled())){var c=this.graph.model,d=c.getGeometry(a);this.graph.isCellMovable(a)&&(!c.isEdge(a)||1<this.graph.getSelectionCount()||
null!=d.points&&0<d.points.length||null==c.getTerminal(a,!0)||null==c.getTerminal(a,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(b.getEvent())&&this.graph.isCellsCloneable())?this.start(a,b.getX(),b.getY()):this.delayedSelection&&(this.cell=a);this.cellWasClicked=!0;this.consumeMouseEvent(mxEvent.MOUSE_DOWN,b)}};
mxGraphHandler.prototype.getGuideStates=function(){var a=this.graph.getDefaultParent(),b=this.graph.getModel(),c=mxUtils.bind(this,function(d){return null!=this.graph.view.getState(d)&&b.isVertex(d)&&null!=b.getGeometry(d)&&!b.getGeometry(d).relative});return this.graph.view.getCellStates(b.filterDescendants(c,a))};mxGraphHandler.prototype.getCells=function(a){return!this.delayedSelection&&this.graph.isCellMovable(a)?[a]:this.graph.getMovableCells(this.graph.getSelectionCells())};
mxGraphHandler.prototype.getPreviewBounds=function(a){a=this.getBoundingBox(a);null!=a&&(a.width=Math.max(0,a.width-1),a.height=Math.max(0,a.height-1),a.width<this.minimumSize?(a.x-=(this.minimumSize-a.width)/2,a.width=this.minimumSize):(a.x=Math.round(a.x),a.width=Math.ceil(a.width)),a.height<this.minimumSize?(a.y-=(this.minimumSize-a.height)/2,a.height=this.minimumSize):(a.y=Math.round(a.y),a.height=Math.ceil(a.height)));return a};
mxGraphHandler.prototype.getBoundingBox=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.graph.view.getState(a[d]);if(null!=e){var f=e;c.isVertex(a[d])&&null!=e.shape&&null!=e.shape.boundingBox&&(f=e.shape.boundingBox);null==b?b=mxRectangle.fromRectangle(f):b.add(f)}}return b};
mxGraphHandler.prototype.createPreviewShape=function(a){a=new mxRectangleShape(a,null,this.previewColor);a.isDashed=!0;this.htmlPreview?(a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane()),a.pointerEvents=!1,mxClient.IS_IOS&&(a.getSvgScreenOffset=function(){return 0}));return a};
mxGraphHandler.prototype.start=function(a,b,c,d){this.cell=a;this.first=mxUtils.convertPoint(this.graph.container,b,c);this.cells=null!=d?d:this.getCells(this.cell);this.bounds=this.graph.getView().getBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);this.allCells=new mxDictionary;this.cloning=!1;for(b=this.cellCount=0;b<this.cells.length;b++)this.cellCount+=this.addStates(this.cells[b],this.allCells);if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());
var e=this.graph.model.getParent(a),f=2>this.graph.model.getChildCount(e),g=new mxDictionary;a=this.graph.getOpposites(this.graph.getEdges(this.cell),this.cell);for(b=0;b<a.length;b++)c=this.graph.view.getState(a[b]),null==c||g.get(c)||g.put(c,!0);this.guide.isStateIgnored=mxUtils.bind(this,function(k){var l=this.graph.model.getParent(k.cell);return null!=k.cell&&(!this.cloning&&this.isCellMoving(k.cell)||k.cell!=(this.target||e)&&!f&&!g.get(k)&&(null==this.target||2<=this.graph.model.getChildCount(this.target))&&
l!=(this.target||e))})}};mxGraphHandler.prototype.addStates=function(a,b){var c=this.graph.view.getState(a),d=0;if(null!=c&&null==b.get(a)){b.put(a,c);d++;c=this.graph.model.getChildCount(a);for(var e=0;e<c;e++)d+=this.addStates(this.graph.model.getChildAt(a,e),b)}return d};mxGraphHandler.prototype.isCellMoving=function(a){return null!=this.allCells.get(a)};
mxGraphHandler.prototype.useGuidesForEvent=function(a){return null!=this.guide?this.guide.isEnabledForEvent(a.getEvent())&&!this.isConstrainedEvent(a):!0};mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());return new mxPoint(a.x-this.first.x-this.graph.panDx,a.y-this.first.y-this.graph.panDy)};
mxGraphHandler.prototype.updateHint=function(a){};mxGraphHandler.prototype.removeHint=function(){};mxGraphHandler.prototype.roundLength=function(a){return Math.round(100*a)/100};mxGraphHandler.prototype.isValidDropTarget=function(a,b){return this.graph.model.getParent(this.cell)!=a};
mxGraphHandler.prototype.checkPreview=function(){this.livePreviewActive&&this.cloning?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?this.cloning&&this.livePreviewActive||(this.livePreviewUsed=this.livePreviewActive=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds))};
mxGraphHandler.prototype.mouseMove=function(a,b){a=this.graph;if(b.isConsumed()||!a.isMouseDown||null==this.cell||null==this.first||null==this.bounds||this.suspended)!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||b.isConsumed()||null==b.getState()&&null==b.sourceState||a.isMouseDown||(c=a.getCursorForMouseEvent(b),null==c&&a.isEnabled()&&a.isCellMovable(b.getCell())&&(c=a.getModel().isEdge(b.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=c&&
null!=b.sourceState&&b.sourceState.setCursor(c));else if(mxEvent.isMultiTouchEvent(b.getEvent()))this.reset();else{var c=this.getDelta(b),d=a.tolerance;if(null!=this.shape||this.livePreviewActive||Math.abs(c.x)>d||Math.abs(c.y)>d){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));d=a.isCloneEvent(b.getEvent())&&a.isCellsCloneable()&&this.isCloneEnabled();var e=a.isGridEnabledEvent(b.getEvent()),f=b.getCell();f=null!=f&&0>mxUtils.indexOf(this.cells,
f)?f:a.getCellAt(b.getGraphX(),b.getGraphY(),null,null,null,mxUtils.bind(this,function(n,p,r){return 0<=mxUtils.indexOf(this.cells,n.cell)}));var g=!0,k=null;this.cloning=d;a.isDropEnabled()&&this.highlightEnabled&&(k=a.getDropTarget(this.cells,b.getEvent(),f,d));var l=a.getView().getState(k),m=!1;null!=l&&(d||this.isValidDropTarget(k,b))?(this.target!=k&&(this.target=k,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),m=!0):(this.target=null,this.connectOnDrop&&null!=f&&1==this.cells.length&&
a.getModel().isVertex(f)&&a.isCellConnectable(f)&&(l=a.getView().getState(f),null!=l&&(a=null==a.getEdgeValidationError(null,this.cell,f)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(a),m=!0)));null!=l&&m?this.highlight.highlight(l):this.highlight.hide();null!=this.guide&&this.useGuidesForEvent(b)?(c=this.guide.move(this.bounds,c,e,d),g=!1):c=this.graph.snapDelta(c,this.bounds,!e,!1,!1);null!=this.guide&&g&&this.guide.hide();this.isConstrainedEvent(b)&&(Math.abs(c.x)>
Math.abs(c.y)?c.y=0:c.x=0);this.checkPreview();if(this.currentDx!=c.x||this.currentDy!=c.y)this.currentDx=c.x,this.currentDy=c.y,this.updatePreview()}this.updateHint(b);this.consumeMouseEvent(mxEvent.MOUSE_MOVE,b);mxEvent.consume(b.getEvent())}};mxGraphHandler.prototype.isConstrainedEvent=function(a){return(null==this.target||this.graph.isCloneEvent(a.getEvent()))&&this.graph.isConstrainedEvent(a.getEvent())};
mxGraphHandler.prototype.updatePreview=function(a){this.livePreviewUsed&&!a?null!=this.cells&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()};
mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&null!=this.pBounds&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())};
mxGraphHandler.prototype.updateLivePreview=function(a,b){if(!this.suspended){var c=[];null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,function(n,p){n=this.graph.view.getState(p.cell);n!=p&&(p.destroy(),null!=n?this.allCells.put(p.cell,n):this.allCells.remove(p.cell),p=n);null!=p&&(n=p.clone(),c.push([p,n]),null!=p.shape&&(null==p.shape.originalPointerEvents&&(p.shape.originalPointerEvents=p.shape.pointerEvents),p.shape.pointerEvents=!1,null!=p.text&&(null==p.text.originalPointerEvents&&
(p.text.originalPointerEvents=p.text.pointerEvents),p.text.pointerEvents=!1)),this.graph.model.isVertex(p.cell))&&((p.x+=a,p.y+=b,this.cloning)?null!=p.text&&(p.text.updateBoundingBox(),null!=p.text.boundingBox&&(p.text.boundingBox.x+=a,p.text.boundingBox.y+=b),null!=p.text.unrotatedBoundingBox&&(p.text.unrotatedBoundingBox.x+=a,p.text.unrotatedBoundingBox.y+=b)):(p.view.graph.cellRenderer.redraw(p,!0),p.view.invalidate(p.cell),p.invalid=!1,null!=p.control&&null!=p.control.node&&(p.control.node.style.visibility=
"hidden")))}));if(0==c.length)this.reset();else{for(var d=this.graph.view.scale,e=0;e<c.length;e++){var f=c[e][0];if(this.graph.model.isEdge(f.cell)){var g=this.graph.getCellGeometry(f.cell),k=[];if(null!=g&&null!=g.points)for(var l=0;l<g.points.length;l++)null!=g.points[l]&&k.push(new mxPoint(g.points[l].x+a/d,g.points[l].y+b/d));g=f.visibleSourceState;l=f.visibleTargetState;var m=c[e][1].absolutePoints;null!=g&&this.isCellMoving(g.cell)?f.view.updateFixedTerminalPoint(f,g,!0,this.graph.getConnectionConstraint(f,
g,!0)):(g=m[0],f.setAbsoluteTerminalPoint(new mxPoint(g.x+a,g.y+b),!0),g=null);null!=l&&this.isCellMoving(l.cell)?f.view.updateFixedTerminalPoint(f,l,!1,this.graph.getConnectionConstraint(f,l,!1)):(l=m[m.length-1],f.setAbsoluteTerminalPoint(new mxPoint(l.x+a,l.y+b),!1),l=null);f.view.updatePoints(f,k,g,l);f.view.updateFloatingTerminalPoints(f,g,l);f.view.updateEdgeLabelOffset(f);f.invalid=!1;this.cloning||f.view.graph.cellRenderer.redraw(f,!0)}}this.graph.view.validate();this.redrawHandles(c);this.resetPreviewStates(c)}}};
mxGraphHandler.prototype.redrawHandles=function(a){for(var b=0;b<a.length;b++){var c=this.graph.selectionCellsHandler.getHandler(a[b][0].cell);null!=c&&c.redraw(!0)}};mxGraphHandler.prototype.resetPreviewStates=function(a){for(var b=0;b<a.length;b++)a[b][0].setState(a[b][1])};
mxGraphHandler.prototype.suspend=function(){this.suspended||(this.livePreviewUsed&&this.updateLivePreview(0,0),null!=this.shape&&(this.shape.node.style.visibility="hidden"),null!=this.guide&&this.guide.setVisible(!1),this.suspended=!0)};mxGraphHandler.prototype.resume=function(){this.suspended&&(this.suspended=null,this.livePreviewUsed&&(this.livePreviewActive=!0),null!=this.shape&&(this.shape.node.style.visibility="visible"),null!=this.guide&&this.guide.setVisible(!0))};
mxGraphHandler.prototype.resetLivePreview=function(){null!=this.allCells&&(this.allCells.visit(mxUtils.bind(this,function(a,b){null!=b.shape&&null!=b.shape.originalPointerEvents&&(b.shape.pointerEvents=b.shape.originalPointerEvents,b.shape.originalPointerEvents=null,b.shape.bounds=null,null!=b.text&&(b.text.pointerEvents=b.text.originalPointerEvents,b.text.originalPointerEvents=null));null!=b.control&&null!=b.control.node&&"hidden"==b.control.node.style.visibility&&(b.control.node.style.visibility=
"");this.cloning||null!=b.text&&b.text.updateBoundingBox();b.view.invalidate(b.cell)})),this.graph.view.validate())};mxGraphHandler.prototype.setHandlesVisibleForCells=function(a,b,c){if(c||this.handlesVisible!=b)for(this.handlesVisible=b,c=0;c<a.length;c++){var d=this.graph.selectionCellsHandler.getHandler(a[c]);null!=d&&(d.setHandlesVisible(b),b&&d.redraw())}};mxGraphHandler.prototype.setHighlightColor=function(a){null!=this.highlight&&this.highlight.setHighlightColor(a)};
mxGraphHandler.prototype.mouseUp=function(a,b){if(!b.isConsumed())if(this.livePreviewUsed&&this.resetLivePreview(),null==this.cell||null==this.first||null==this.shape&&!this.livePreviewUsed||null==this.currentDx||null==this.currentDy)this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(b);else{a=this.graph;var c=b.getCell();if(this.connectOnDrop&&null==this.target&&null!=c&&a.getModel().isVertex(c)&&a.isCellConnectable(c)&&a.isEdgeValid(null,this.cell,c))a.connectionHandler.connect(this.cell,
c,b.getEvent());else{c=a.isCloneEvent(b.getEvent())&&a.isCellsCloneable()&&this.isCloneEnabled();var d=a.getView().scale,e=this.roundLength(this.currentDx/d);d=this.roundLength(this.currentDy/d);var f=this.target;a.isSplitEnabled()&&a.isSplitTarget(f,this.cells,b.getEvent())?a.splitEdge(f,this.cells,null,e,d,b.getGraphX(),b.getGraphY()):this.moveCells(this.cells,e,d,c,this.target,b.getEvent())}}this.cellWasClicked&&this.consumeMouseEvent(mxEvent.MOUSE_UP,b);this.reset()};
mxGraphHandler.prototype.reset=function(){this.livePreviewUsed&&(this.resetLivePreview(),this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!0));this.destroyShapes();this.removeHint();this.delayedSelection=!1;this.livePreviewUsed=this.livePreviewActive=null;this.cellWasClicked=!1;this.cellCount=this.currentDy=this.currentDx=this.suspended=null;this.cloning=!1;this.cell=this.cells=this.first=this.target=this.guides=this.pBounds=this.allCells=null};
mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,b,c){if(this.graph.getModel().isVertex(a)&&(a=this.graph.getView().getState(a),null!=a)){c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(c),mxEvent.getClientY(c));var d=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){b=Math.cos(-d);d=Math.sin(-d);var e=new mxPoint(a.getCenterX(),a.getCenterY());c=mxUtils.getRotatedPoint(c,b,d,e)}return!mxUtils.contains(a,c.x,c.y)}return!1};
mxGraphHandler.prototype.moveCells=function(a,b,c,d,e,f){d&&(a=this.graph.getCloneableCells(a));var g=this.graph.getModel().getParent(this.cell);null==e&&null!=f&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(g,a,f)&&(e=this.graph.getDefaultParent());d=d&&!this.graph.isCellLocked(e||this.graph.getDefaultParent());this.graph.getModel().beginUpdate();try{g=[];if(!d&&null!=e&&this.removeEmptyParents){for(var k=new mxDictionary,l=0;l<a.length;l++)k.put(a[l],!0);for(l=0;l<a.length;l++){var m=
this.graph.model.getParent(a[l]);null==m||k.get(m)||(k.put(m,!0),g.push(m))}}a=this.graph.moveCells(a,b,c,d,e,f);b=[];for(l=0;l<g.length;l++)this.shouldRemoveParent(g[l])&&b.push(g[l]);this.graph.removeCells(b,!1)}finally{this.graph.getModel().endUpdate()}d&&this.graph.setSelectionCells(a);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0])};
mxGraphHandler.prototype.shouldRemoveParent=function(a){a=this.graph.view.getState(a);return null!=a&&(this.graph.model.isEdge(a.cell)||this.graph.model.isVertex(a.cell))&&this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)&&this.graph.isTransparentState(a)};
mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.guide&&(this.guide.destroy(),this.guide=null);null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)};
mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.panHandler);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.refreshHandler&&(this.graph.getModel().removeListener(this.refreshHandler),this.graph.removeListener(this.refreshHandler),this.refreshHandler=null);mxEvent.removeListener(document,"keydown",this.keyHandler);mxEvent.removeListener(document,"keyup",this.keyHandler);this.destroyShapes();
this.removeHint()};
function mxPanningHandler(a){null!=a&&(this.graph=a,this.graph.addMouseListener(this),this.forcePanningHandler=mxUtils.bind(this,function(b,c){b=c.getProperty("eventName");c=c.getProperty("event");b==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(c)&&(this.start(c),this.active=!0,this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",c)),c.consume())}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler),this.gestureHandler=mxUtils.bind(this,function(b,c){this.isPinchEnabled()&&(b=
c.getProperty("event"),mxEvent.isConsumed(b)||"gesturestart"!=b.type?"gestureend"==b.type&&null!=this.initialScale&&(this.initialScale=null):(this.initialScale=this.graph.view.scale,this.active||null==this.mouseDownEvent||(this.start(this.mouseDownEvent),this.mouseDownEvent=null)),null!=this.initialScale&&this.zoomGraph(b))}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.reset()}),mxEvent.addGestureListeners(document,
null,null,this.mouseUpListener),mxEvent.addListener(document,"mouseleave",this.mouseUpListener))}mxPanningHandler.prototype=new mxEventSource;mxPanningHandler.prototype.constructor=mxPanningHandler;mxPanningHandler.prototype.graph=null;mxPanningHandler.prototype.useLeftButtonForPanning=!1;mxPanningHandler.prototype.usePopupTrigger=!0;mxPanningHandler.prototype.ignoreCell=!1;mxPanningHandler.prototype.previewEnabled=!0;mxPanningHandler.prototype.useGrid=!1;
mxPanningHandler.prototype.panningEnabled=!0;mxPanningHandler.prototype.pinchEnabled=!0;mxPanningHandler.prototype.maxScale=8;mxPanningHandler.prototype.minScale=.01;mxPanningHandler.prototype.dx=null;mxPanningHandler.prototype.dy=null;mxPanningHandler.prototype.startX=0;mxPanningHandler.prototype.startY=0;mxPanningHandler.prototype.isActive=function(){return this.active||null!=this.initialScale};mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled};
mxPanningHandler.prototype.setPanningEnabled=function(a){this.panningEnabled=a};mxPanningHandler.prototype.isPinchEnabled=function(){return this.pinchEnabled};mxPanningHandler.prototype.setPinchEnabled=function(a){this.pinchEnabled=a};mxPanningHandler.prototype.isPanningTrigger=function(a){var b=a.getEvent();return this.useLeftButtonForPanning&&null==a.getState()&&mxEvent.isLeftMouseButton(b)||mxEvent.isControlDown(b)&&mxEvent.isShiftDown(b)||this.usePopupTrigger&&mxEvent.isPopupTrigger(b)};
mxPanningHandler.prototype.isForcePanningEvent=function(a){return this.ignoreCell||mxEvent.isMultiTouchEvent(a.getEvent())};mxPanningHandler.prototype.mouseDown=function(a,b){this.mouseDownEvent=b;!b.isConsumed()&&this.isPanningEnabled()&&!this.active&&this.isPanningTrigger(b)&&(this.start(b),this.consumePanningTrigger(b))};
mxPanningHandler.prototype.start=function(a){this.dx0=-this.graph.container.scrollLeft;this.dy0=-this.graph.container.scrollTop;this.startX=a.getX();this.startY=a.getY();this.dy=this.dx=null;this.panningTrigger=!0};mxPanningHandler.prototype.consumePanningTrigger=function(a){a.consume()};
mxPanningHandler.prototype.mouseMove=function(a,b){this.dx=b.getX()-this.startX;this.dy=b.getY()-this.startY;this.active?(this.previewEnabled&&(this.useGrid&&(this.dx=this.graph.snap(this.dx),this.dy=this.graph.snap(this.dy)),this.graph.panGraph(this.dx+this.dx0,this.dy+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",b))):this.panningTrigger&&(a=this.active,this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!a&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,
"event",b)));(this.active||this.panningTrigger)&&b.consume()};mxPanningHandler.prototype.mouseUp=function(a,b){if(this.active){if(null!=this.dx&&null!=this.dy){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){a=this.graph.getView().scale;var c=this.graph.getView().translate;this.graph.panGraph(0,0);this.panGraph(c.x+this.dx/a,c.y+this.dy/a)}b.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",b))}this.reset()};
mxPanningHandler.prototype.zoomGraph=function(a){var b=Math.round(this.initialScale*a.scale*100)/100;null!=this.minScale&&(b=Math.max(this.minScale,b));null!=this.maxScale&&(b=Math.min(this.maxScale,b));this.graph.view.scale!=b&&(this.graph.zoomTo(b),mxEvent.consume(a))};mxPanningHandler.prototype.reset=function(){this.panningTrigger=this.graph.isMouseDown=!1;this.mouseDownEvent=null;this.active=!1;this.dy=this.dx=null};
mxPanningHandler.prototype.panGraph=function(a,b){this.graph.getView().setTranslate(a,b)};mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.forcePanningHandler);this.graph.removeListener(this.gestureHandler);mxEvent.removeGestureListeners(document,null,null,this.mouseUpListener);mxEvent.removeListener(document,"mouseleave",this.mouseUpListener)};
function mxPopupMenuHandler(a,b){null!=a&&(this.graph=a,this.factoryMethod=b,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(c,d){this.inTolerance=!1}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}mxPopupMenuHandler.prototype=new mxPopupMenu;mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler;mxPopupMenuHandler.prototype.graph=null;mxPopupMenuHandler.prototype.selectOnPopup=!0;
mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0;mxPopupMenuHandler.prototype.triggerX=null;mxPopupMenuHandler.prototype.triggerY=null;mxPopupMenuHandler.prototype.screenX=null;mxPopupMenuHandler.prototype.screenY=null;mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this);mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(a){this.graph.tooltipHandler.hide()}))};mxPopupMenuHandler.prototype.isSelectOnPopup=function(a){return this.selectOnPopup};
mxPopupMenuHandler.prototype.mouseDown=function(a,b){this.isEnabled()&&!mxEvent.isMultiTouchEvent(b.getEvent())&&(this.hideMenu(),this.triggerX=b.getGraphX(),this.triggerY=b.getGraphY(),this.screenX=mxEvent.getMainEvent(b.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(b.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(b),this.inTolerance=!0)};
mxPopupMenuHandler.prototype.mouseMove=function(a,b){this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(Math.abs(mxEvent.getMainEvent(b.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(b.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)};
mxPopupMenuHandler.prototype.mouseUp=function(a,b,c){a=null==c;c=null!=c?c:mxUtils.bind(this,function(e){var f=mxUtils.getScrollOrigin();this.popup(b.getX()+f.x+1,b.getY()+f.y+1,e,b.getEvent())});if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var d=this.getCellForPopupEvent(b);this.graph.isEnabled()&&this.isSelectOnPopup(b)&&null!=d&&!this.graph.isCellSelected(d)?this.graph.setSelectionCell(d):this.clearSelectionOnBackground&&null==d&&this.graph.clearSelection();
this.graph.tooltipHandler.hide();c(d);a&&b.consume()}this.inTolerance=this.popupTrigger=!1};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){return a.getCell()};mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.gestureHandler);mxPopupMenu.prototype.destroy.apply(this)};
function mxCellMarker(a,b,c,d){mxEventSource.call(this);null!=a&&(this.graph=a,this.validColor=null!=b?b:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=c?c:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=d?d:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(a))}mxUtils.extend(mxCellMarker,mxEventSource);mxCellMarker.prototype.graph=null;mxCellMarker.prototype.enabled=!0;mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT;mxCellMarker.prototype.hotspotEnabled=!1;
mxCellMarker.prototype.validColor=null;mxCellMarker.prototype.invalidColor=null;mxCellMarker.prototype.currentColor=null;mxCellMarker.prototype.validState=null;mxCellMarker.prototype.markedState=null;mxCellMarker.prototype.setEnabled=function(a){this.enabled=a};mxCellMarker.prototype.isEnabled=function(){return this.enabled};mxCellMarker.prototype.setHotspot=function(a){this.hotspot=a};mxCellMarker.prototype.getHotspot=function(){return this.hotspot};
mxCellMarker.prototype.setHotspotEnabled=function(a){this.hotspotEnabled=a};mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled};mxCellMarker.prototype.hasValidState=function(){return null!=this.validState};mxCellMarker.prototype.getValidState=function(){return this.validState};mxCellMarker.prototype.getMarkedState=function(){return this.markedState};mxCellMarker.prototype.reset=function(){this.validState=null;null!=this.markedState&&(this.markedState=null,this.unmark())};
mxCellMarker.prototype.process=function(a){var b=null;this.isEnabled()&&(b=this.getState(a),this.setCurrentState(b,a));return b};mxCellMarker.prototype.setCurrentState=function(a,b,c){var d=null!=a?this.isValidState(a):!1;c=null!=c?c:this.getMarkerColor(b.getEvent(),a,d);this.validState=d?a:null;if(a!=this.markedState||c!=this.currentColor)this.currentColor=c,null!=a&&null!=this.currentColor?(this.markedState=a,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark())};
mxCellMarker.prototype.markCell=function(a,b){a=this.graph.getView().getState(a);null!=a&&(this.currentColor=null!=b?b:this.validColor,this.markedState=a,this.mark())};mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor);this.highlight.highlight(this.markedState);this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))};mxCellMarker.prototype.unmark=function(){this.mark()};mxCellMarker.prototype.isValidState=function(a){return!0};
mxCellMarker.prototype.getMarkerColor=function(a,b,c){return c?this.validColor:this.invalidColor};mxCellMarker.prototype.getState=function(a){var b=this.graph.getView(),c=this.getCell(a);b=this.getStateToMark(b.getState(c));return null!=b&&this.intersects(b,a)?b:null};mxCellMarker.prototype.getCell=function(a){return a.getCell()};mxCellMarker.prototype.getStateToMark=function(a){return a};
mxCellMarker.prototype.intersects=function(a,b){return this.hotspotEnabled?mxUtils.intersectsHotspot(a,b.getGraphX(),b.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE):!0};mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getModel().removeListener(this.resetHandler);this.highlight.destroy()};
function mxSelectionCellsHandler(a){mxEventSource.call(this);this.graph=a;this.handlers=new mxDictionary;this.graph.addMouseListener(this);this.refreshHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.refresh()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler);
this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler);this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}mxUtils.extend(mxSelectionCellsHandler,mxEventSource);mxSelectionCellsHandler.prototype.graph=null;mxSelectionCellsHandler.prototype.enabled=!0;mxSelectionCellsHandler.prototype.refreshHandler=null;mxSelectionCellsHandler.prototype.maxHandlers=100;
mxSelectionCellsHandler.prototype.handlers=null;mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled};mxSelectionCellsHandler.prototype.setEnabled=function(a){this.enabled=a};mxSelectionCellsHandler.prototype.getHandler=function(a){return this.handlers.get(a)};mxSelectionCellsHandler.prototype.isHandled=function(a){return null!=this.getHandler(a)};mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(a,b){b.reset.apply(b)})};
mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()};
mxSelectionCellsHandler.prototype.refresh=function(){var a=this.handlers;this.handlers=new mxDictionary;for(var b=mxUtils.sortCells(this.getHandledSelectionCells(),!1),c=0;c<b.length;c++){var d=this.graph.view.getState(b[c]);if(null!=d){var e=a.remove(b[c]);null!=e&&(e.state!=d?(e.destroy(),e=null):this.isHandlerActive(e)||(null!=e.refresh&&e.refresh(),e.redraw()));null!=e&&this.handlers.put(b[c],e)}}a.visit(mxUtils.bind(this,function(f,g){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",g.state));
g.destroy()}));for(c=0;c<b.length;c++)d=this.graph.view.getState(b[c]),null!=d&&(e=this.handlers.get(b[c]),null==e?(e=this.graph.createHandler(d),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",d)),this.handlers.put(b[c],e)):e.updateParentHighlight())};mxSelectionCellsHandler.prototype.isHandlerActive=function(a){return null!=a.index};
mxSelectionCellsHandler.prototype.updateHandler=function(a){var b=this.handlers.remove(a.cell);if(null!=b){var c=b.index,d=b.startX,e=b.startY;b.destroy();b=this.graph.createHandler(a);null!=b&&(this.handlers.put(a.cell,b),null!=c&&null!=d&&null!=e&&b.start(d,e,c))}};mxSelectionCellsHandler.prototype.mouseDown=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseDown.apply(e,c)})}};
mxSelectionCellsHandler.prototype.mouseMove=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseMove.apply(e,c)})}};mxSelectionCellsHandler.prototype.mouseUp=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseUp.apply(e,c)})}};
mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)};
function mxConnectionHandler(a,b){mxEventSource.call(this);null!=a&&(this.graph=a,this.factoryMethod=b,this.init(),this.escapeHandler=mxUtils.bind(this,function(c,d){this.reset()}),this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxUtils.extend(mxConnectionHandler,mxEventSource);mxConnectionHandler.prototype.graph=null;mxConnectionHandler.prototype.factoryMethod=!0;mxConnectionHandler.prototype.moveIconFront=!1;mxConnectionHandler.prototype.moveIconBack=!1;
mxConnectionHandler.prototype.connectImage=null;mxConnectionHandler.prototype.targetConnectImage=!1;mxConnectionHandler.prototype.enabled=!0;mxConnectionHandler.prototype.select=!0;mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null;mxConnectionHandler.prototype.constraintHandler=null;mxConnectionHandler.prototype.error=null;mxConnectionHandler.prototype.waypointsEnabled=!1;mxConnectionHandler.prototype.ignoreMouseDown=!1;mxConnectionHandler.prototype.first=null;
mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET);mxConnectionHandler.prototype.edgeState=null;mxConnectionHandler.prototype.changeHandler=null;mxConnectionHandler.prototype.drillHandler=null;mxConnectionHandler.prototype.mouseDownCounter=0;mxConnectionHandler.prototype.movePreviewAway=!1;mxConnectionHandler.prototype.outlineConnect=!1;mxConnectionHandler.prototype.livePreview=!1;mxConnectionHandler.prototype.cursor=null;
mxConnectionHandler.prototype.insertBeforeSource=!1;mxConnectionHandler.prototype.isEnabled=function(){return this.enabled};mxConnectionHandler.prototype.setEnabled=function(a){this.enabled=a};mxConnectionHandler.prototype.isInsertBefore=function(a,b,c,d,e){return this.insertBeforeSource&&b!=c};mxConnectionHandler.prototype.isCreateTarget=function(a){return this.createTarget};mxConnectionHandler.prototype.setCreateTarget=function(a){this.createTarget=a};
mxConnectionHandler.prototype.createShape=function(){var a=this.livePreview&&null!=this.edgeState?this.graph.cellRenderer.createShape(this.edgeState):new mxPolyline([],mxConstants.INVALID_COLOR);a.dialect=mxConstants.DIALECT_SVG;a.scale=this.graph.view.scale;a.svgStrokeTolerance=0;a.pointerEvents=!1;a.isDashed=!0;a.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(a.node,this.graph,null);return a};
mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this);this.marker=this.createMarker();this.constraintHandler=new mxConstraintHandler(this.graph);this.changeHandler=mxUtils.bind(this,function(a){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell));null!=this.iconState?(this.redrawIcons(this.icons,this.iconState),this.constraintHandler.reset()):null!=this.previous&&null==this.graph.view.getState(this.previous.cell)&&this.reset()});this.graph.getModel().addListener(mxEvent.CHANGE,
this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler);this.drillHandler=mxUtils.bind(this,function(a){this.reset()});this.graph.addListener(mxEvent.START_EDITING,this.drillHandler);this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler);this.graph.getView().addListener(mxEvent.UP,this.drillHandler)};
mxConnectionHandler.prototype.isConnectableCell=function(a){return!0};
mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);a.hotspotEnabled=!0;a.getCell=mxUtils.bind(this,function(b){var c=mxCellMarker.prototype.getCell.apply(a,arguments);this.error=null;null==c&&null!=this.currentPoint&&(c=this.graph.getCellAt(this.currentPoint.x,this.currentPoint.y));if(null!=c&&!this.graph.isCellConnectable(c)){var d=this.graph.getModel().getParent(c);this.graph.getModel().isVertex(d)&&this.graph.isCellConnectable(d)&&(c=d)}if(this.graph.isSwimlane(c)&&
null!=this.currentPoint&&this.graph.hitsSwimlaneContent(c,this.currentPoint.x,this.currentPoint.y)||!this.isConnectableCell(c))c=null;null!=c?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,c),null!=this.error&&0==this.error.length&&(c=null,this.isCreateTarget(b.getEvent())&&(this.error=null))):this.isValidSource(c,b)||(c=null):!this.isConnecting()||this.isCreateTarget(b.getEvent())||this.graph.allowDanglingEdges||(this.error="");return c});a.isValidState=
mxUtils.bind(this,function(b){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)});a.getMarkerColor=mxUtils.bind(this,function(b,c,d){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null});a.intersects=mxUtils.bind(this,function(b,c){return null!=this.connectImage||this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};
mxConnectionHandler.prototype.start=function(a,b,c,d){this.previous=a;this.first=new mxPoint(b,c);this.edgeState=null!=d?d:this.createEdgeState(null);this.marker.currentColor=this.marker.validColor;this.marker.markedState=a;this.marker.mark();this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))};mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape};mxConnectionHandler.prototype.isValidSource=function(a,b){return this.graph.isValidSource(a)};
mxConnectionHandler.prototype.isValidTarget=function(a){return!0};mxConnectionHandler.prototype.validateConnection=function(a,b){return this.isValidTarget(b)?this.graph.getEdgeValidationError(null,a,b):""};mxConnectionHandler.prototype.getConnectImage=function(a){return this.connectImage};mxConnectionHandler.prototype.isMoveIconToFrontForState=function(a){return null!=a.text&&a.text.node.parentNode==this.graph.container?!0:this.moveIconFront};
mxConnectionHandler.prototype.createIcons=function(a){var b=this.getConnectImage(a);if(null!=b&&null!=a){this.iconState=a;var c=[],d=new mxRectangle(0,0,b.width,b.height),e=new mxImageShape(d,b.src,null,null,0);e.preserveImageAspect=!1;this.isMoveIconToFrontForState(a)?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=e.node.previousSibling&&e.node.parentNode.insertBefore(e.node,
e.node.parentNode.firstChild));e.node.style.cursor=mxConstants.CURSOR_CONNECT;var f=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:a});b=mxUtils.bind(this,function(g){mxEvent.isConsumed(g)||(this.icon=e,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,f())))});mxEvent.redirectMouseEvents(e.node,this.graph,f,b);c.push(e);this.redrawIcons(c,this.iconState);return c}return null};
mxConnectionHandler.prototype.redrawIcons=function(a,b){null!=a&&null!=a[0]&&null!=b&&(b=this.getIconPosition(a[0],b),a[0].bounds.x=b.x,a[0].bounds.y=b.y,a[0].redraw())};
mxConnectionHandler.prototype.getIconPosition=function(a,b){var c=this.graph.getView().scale,d=b.getCenterX(),e=b.getCenterY();if(this.graph.isSwimlane(b.cell)){var f=this.graph.getStartSize(b.cell);d=0!=f.width?b.x+f.width*c/2:d;e=0!=f.height?b.y+f.height*c/2:e;f=mxUtils.toRadians(mxUtils.getValue(b.style,mxConstants.STYLE_ROTATION)||0);0!=f&&(c=Math.cos(f),f=Math.sin(f),b=new mxPoint(b.getCenterX(),b.getCenterY()),e=mxUtils.getRotatedPoint(new mxPoint(d,e),c,f,b),d=e.x,e=e.y)}return new mxPoint(d-
a.bounds.width/2,e-a.bounds.height/2)};mxConnectionHandler.prototype.destroyIcons=function(){if(null!=this.icons){for(var a=0;a<this.icons.length;a++)this.icons[a].destroy();this.iconState=this.selectedIcon=this.icon=this.icons=null}};mxConnectionHandler.prototype.isStartEvent=function(a){return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon)};
mxConnectionHandler.prototype.mouseDown=function(a,b){this.mouseDownCounter++;this.isEnabled()&&this.graph.isEnabled()&&!b.isConsumed()&&!this.isConnecting()&&this.isStartEvent(b)&&(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(b.getGraphX(),
b.getGraphY()),this.edgeState=this.createEdgeState(b),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState)),null==this.previous&&null!=this.edgeState&&(a=this.graph.getPointForEvent(b.getEvent()),this.edgeState.cell.geometry.setTerminalPoint(a,!0)),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),b.consume());this.selectedIcon=this.icon;this.icon=null};
mxConnectionHandler.prototype.isImmediateConnectSource=function(a){return!this.graph.isCellMovable(a.cell)};mxConnectionHandler.prototype.createEdgeState=function(a){return null};
mxConnectionHandler.prototype.isOutlineConnectEvent=function(a){if(mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent()))return!1;var b=mxUtils.getOffset(this.graph.container),c=a.getEvent(),d=mxEvent.getClientX(c);c=mxEvent.getClientY(c);var e=document.documentElement,f=this.currentPoint.x-this.graph.container.scrollLeft+b.x-((window.pageXOffset||e.scrollLeft)-(e.clientLeft||0));b=this.currentPoint.y-this.graph.container.scrollTop+b.y-((window.pageYOffset||e.scrollTop)-(e.clientTop||
0));return this.outlineConnect&&(mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())||a.isSource(this.marker.highlight.shape)||!mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent())&&null!=a.getState()||this.marker.highlight.isHighlightAt(d,c)||(f!=d||b!=c)&&null==a.getState()&&this.marker.highlight.isHighlightAt(f,b))};
mxConnectionHandler.prototype.updateCurrentState=function(a,b){this.constraintHandler.update(a,null==this.first,!1,null==this.first||a.isSource(this.marker.highlight.shape)?null:b);if(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint)null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",
this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent"),null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,this.constraintHandler.currentFocus.cell),null==this.error&&(this.currentState=this.constraintHandler.currentFocus),(null!=this.error||null!=this.currentState&&!this.isCellEnabled(this.currentState.cell))&&this.constraintHandler.reset());else{this.graph.isIgnoreTerminalEvent(a.getEvent())?(this.marker.reset(),this.currentState=
null):(this.marker.process(a),this.currentState=this.marker.getValidState());null==this.currentState||this.isCellEnabled(this.currentState.cell)||(this.constraintHandler.reset(),this.marker.reset(),this.currentState=null);var c=this.isOutlineConnectEvent(a);null!=this.currentState&&c&&(a.isSource(this.marker.highlight.shape)&&(b=new mxPoint(a.getGraphX(),a.getGraphY())),c=this.graph.getOutlineConstraint(b,this.currentState,a),this.constraintHandler.setFocus(a,this.currentState,!1),this.constraintHandler.currentConstraint=
c,this.constraintHandler.currentPoint=b);this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&(b=this.graph.view.scale,null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=mxConstants.OUTLINE_HIGHLIGHT_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/b/b,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.graph.isCellConnectable(a.getCell())&&
this.marker.getValidState()!=a.getState()?(this.marker.highlight.shape.stroke="transparent",this.currentState=null):this.marker.highlight.shape.stroke=mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/b/b,this.marker.highlight.repaint()))}};mxConnectionHandler.prototype.isCellEnabled=function(a){return!0};
mxConnectionHandler.prototype.convertWaypoint=function(a){var b=this.graph.getView().getScale(),c=this.graph.getView().getTranslate();a.x=a.x/b-c.x;a.y=a.y/b-c.y};
mxConnectionHandler.prototype.snapToPreview=function(a,b){if(!mxEvent.isAltDown(a.getEvent())&&null!=this.previous){var c=this.graph.gridSize*this.graph.view.scale/2,d=null!=this.sourceConstraint?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());Math.abs(d.x-a.getGraphX())<c&&(b.x=d.x);Math.abs(d.y-a.getGraphY())<c&&(b.y=d.y)}};
mxConnectionHandler.prototype.mouseMove=function(a,b){if(b.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{this.isEnabled()||null==this.currentState||(this.destroyIcons(),this.currentState=null);a=this.graph.getView();var c=a.scale,d=a.translate;a=new mxPoint(b.getGraphX(),b.getGraphY());this.error=null;this.graph.isGridEnabledEvent(b.getEvent())&&(a=new mxPoint((this.graph.snap(a.x/c-d.x)+d.x)*c,(this.graph.snap(a.y/c-d.y)+d.y)*c));
this.snapToPreview(b,a);this.currentPoint=a;(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&(null!=this.shape||null==this.first||Math.abs(b.getGraphX()-this.first.x)>this.graph.tolerance||Math.abs(b.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(b,a);if(null!=this.first){var e=null;c=a;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(e=this.constraintHandler.currentConstraint,
c=this.constraintHandler.currentPoint.clone()):null!=this.previous&&mxEvent.isShiftDown(b.getEvent())&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&(Math.abs(this.previous.getCenterX()-a.x)<Math.abs(this.previous.getCenterY()-a.y)?a.x=this.previous.getCenterX():a.y=this.previous.getCenterY());d=this.first;if(null!=this.selectedIcon){var f=this.selectedIcon.bounds.width,g=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(f=this.getIconPosition(this.selectedIcon,
this.currentState),this.selectedIcon.bounds.x=f.x,this.selectedIcon.bounds.y=f.y):(f=new mxRectangle(b.getGraphX()+this.connectIconOffset.x,b.getGraphY()+this.connectIconOffset.y,f,g),this.selectedIcon.bounds=f);this.selectedIcon.redraw()}null!=this.edgeState?(this.updateEdgeState(c,e),c=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],d=this.edgeState.absolutePoints[0]):(null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(f=this.getTargetPerimeterPoint(this.currentState,
b),null!=f&&(c=f)),null==this.sourceConstraint&&null!=this.previous&&(f=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:c,b),null!=f&&(d=f)));if(null==this.currentState&&this.movePreviewAway){f=d;null!=this.edgeState&&2<=this.edgeState.absolutePoints.length&&(e=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2],null!=e&&(f=e));e=c.x-f.x;f=c.y-f.y;g=Math.sqrt(e*e+f*f);if(0==g)return;this.originalPoint=c.clone();c.x-=4*e/
g;c.y-=4*f/g}else this.originalPoint=null;null==this.shape&&(e=Math.abs(b.getGraphX()-this.first.x),f=Math.abs(b.getGraphY()-this.first.y),e>this.graph.tolerance||f>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(b,a));null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(a=[d],null!=this.waypoints&&(a=a.concat(this.waypoints)),a.push(c),this.shape.points=a),this.drawPreview());
null!=this.cursor&&(this.graph.container.style.cursor=this.cursor);mxEvent.consume(b.getEvent());b.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),b.consume())),this.previous=this.currentState):this.previous!=
this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||b.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){a=!1;c=b.getSource();for(d=0;d<this.icons.length&&!a;d++)a=c==this.icons[d].node||c.parentNode==this.icons[d].node;a||this.updateIcons(this.currentState,this.icons,b)}}};
mxConnectionHandler.prototype.updateEdgeState=function(a,b){null!=this.sourceConstraint&&null!=this.sourceConstraint.point&&(this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y);null!=b&&null!=b.point?(this.edgeState.style[mxConstants.STYLE_ENTRY_X]=b.point.x,this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=b.point.y):(delete this.edgeState.style[mxConstants.STYLE_ENTRY_X],delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]);
this.edgeState.absolutePoints=[null,null!=this.currentState?null:a];this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint);null!=this.currentState&&(null==b&&(b=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,b));a=null;if(null!=this.waypoints)for(a=[],b=0;b<this.waypoints.length;b++){var c=this.waypoints[b].clone();
this.convertWaypoint(c);a[b]=c}this.graph.view.updatePoints(this.edgeState,a,this.previous,this.currentState);this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)};
mxConnectionHandler.prototype.getTargetPerimeterPoint=function(a,b){b=null;var c=a.view,d=c.getPerimeterFunction(a);if(null!=d){var e=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());a=d(c.getPerimeterBounds(a),this.edgeState,e,!1);null!=a&&(b=a)}else b=new mxPoint(a.getCenterX(),a.getCenterY());return b};
mxConnectionHandler.prototype.getSourcePerimeterPoint=function(a,b,c){c=null;var d=a.view,e=d.getPerimeterFunction(a),f=new mxPoint(a.getCenterX(),a.getCenterY());if(null!=e){var g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),k=Math.PI/180*-g;0!=g&&(b=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(k),Math.sin(k),f));a=e(d.getPerimeterBounds(a),a,b,!1);null!=a&&(0!=g&&(a=mxUtils.getRotatedPoint(new mxPoint(a.x,a.y),Math.cos(-k),Math.sin(-k),f)),c=a)}else c=f;return c};
mxConnectionHandler.prototype.updateIcons=function(a,b,c){};mxConnectionHandler.prototype.isStopEvent=function(a){return null!=a.getState()};
mxConnectionHandler.prototype.addWaypointForEvent=function(a){var b=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY()),c=Math.abs(b.x-this.first.x);b=Math.abs(b.y-this.first.y);if(null!=this.waypoints||1<this.mouseDownCounter&&(c>this.graph.tolerance||b>this.graph.tolerance))null==this.waypoints&&(this.waypoints=[]),c=this.graph.view.scale,b=new mxPoint(this.graph.snap(a.getGraphX()/c)*c,this.graph.snap(a.getGraphY()/c)*c),this.waypoints.push(b)};
mxConnectionHandler.prototype.checkConstraints=function(a,b){return null==a||null==b||null==a.point||null==b.point||!a.point.equals(b.point)||a.dx!=b.dx||a.dy!=b.dy||a.perimeter!=b.perimeter};
mxConnectionHandler.prototype.mouseUp=function(a,b){if(!b.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(b)){this.addWaypointForEvent(b);b.consume();return}a=this.sourceConstraint;var c=this.constraintHandler.currentConstraint,d=null!=this.previous?this.previous.cell:null,e=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(e=this.constraintHandler.currentFocus.cell);null==e&&null!=this.currentState&&(e=this.currentState.cell);
null!=this.error||null!=d&&null!=e&&d==e&&!this.checkConstraints(a,c)?(null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,b.getEvent()),null!=this.error&&0<this.error.length&&this.graph.validationAlert(this.error)):this.connect(d,e,b.getEvent(),b.getCell());this.destroyIcons();b.consume()}null!=this.first&&this.reset()};
mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.cursor&&null!=this.graph.container&&(this.graph.container.style.cursor="");this.destroyIcons();this.marker.reset();this.constraintHandler.reset();this.sourceConstraint=this.error=this.previous=this.edgeState=this.currentPoint=this.originalPoint=null;this.mouseDownCounter=0;this.first=null;this.fireEvent(new mxEventObject(mxEvent.RESET))};
mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(null==this.error);null!=this.edgeState&&(this.edgeState.shape=this.shape,this.graph.cellRenderer.postConfigureShape(this.edgeState),this.edgeState.shape=null);this.shape.redraw()};mxConnectionHandler.prototype.updatePreview=function(a){this.shape.strokewidth=this.getEdgeWidth(a);this.shape.stroke=this.getEdgeColor(a)};mxConnectionHandler.prototype.getEdgeColor=function(a){return a?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR};
mxConnectionHandler.prototype.getEdgeWidth=function(a){return a?3:1};
mxConnectionHandler.prototype.connect=function(a,b,c,d){if(null!=b||this.isCreateTarget(c)||this.graph.allowDanglingEdges){var e=this.graph.getModel(),f=!1,g=null;e.beginUpdate();try{if(null!=a&&null==b&&!this.graph.isIgnoreTerminalEvent(c)&&this.isCreateTarget(c)&&(b=this.createTargetVertex(c,a),null!=b)){d=this.graph.getDropTarget([b],c,d);f=!0;if(null!=d&&this.graph.getModel().isEdge(d))d=this.graph.getDefaultParent();else{var k=this.graph.getView().getState(d);if(null!=k){var l=e.getGeometry(b);
l.x-=k.origin.x;l.y-=k.origin.y}}this.graph.addCell(b,d)}var m=this.graph.getDefaultParent();null!=a&&null!=b&&e.getParent(a)==e.getParent(b)&&e.getParent(e.getParent(a))!=e.getRoot()&&(m=e.getParent(a),null!=a.geometry&&a.geometry.relative&&null!=b.geometry&&b.geometry.relative&&(m=e.getParent(m)));var n=k=null;null!=this.edgeState&&(k=this.edgeState.cell.value,n=this.edgeState.cell.style);g=this.insertEdge(m,null,k,a,b,n);if(null!=g){this.graph.setConnectionConstraint(g,a,!0,this.sourceConstraint);
this.graph.setConnectionConstraint(g,b,!1,this.constraintHandler.currentConstraint);null!=this.edgeState&&e.setGeometry(g,this.edgeState.cell.geometry);m=e.getParent(a);if(this.isInsertBefore(g,a,b,c,d)){for(l=a;null!=l.parent&&null!=l.geometry&&l.geometry.relative&&l.parent!=g.parent;)l=this.graph.model.getParent(l);null!=l&&null!=l.parent&&l.parent==g.parent&&e.add(m,g,l.parent.getIndex(l))}var p=e.getGeometry(g);null==p&&(p=new mxGeometry,p.relative=!0,e.setGeometry(g,p));if(null!=this.waypoints&&
0<this.waypoints.length){var r=this.graph.view.scale,q=this.graph.view.translate;p.points=[];for(a=0;a<this.waypoints.length;a++){var t=this.waypoints[a];p.points.push(new mxPoint(t.x/r-q.x,t.y/r-q.y))}}if(null==b){var u=this.graph.view.translate;r=this.graph.view.scale;t=null!=this.originalPoint?new mxPoint(this.originalPoint.x/r-u.x,this.originalPoint.y/r-u.y):new mxPoint(this.currentPoint.x/r-u.x,this.currentPoint.y/r-u.y);t.x-=this.graph.panDx/this.graph.view.scale;t.y-=this.graph.panDy/this.graph.view.scale;
p.setTerminalPoint(t,!1)}this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",g,"terminal",b,"event",c,"target",d,"terminalInserted",f))}}catch(x){mxLog.show(),mxLog.debug(x.message)}finally{e.endUpdate()}this.select&&this.selectCells(g,f?b:null)}};mxConnectionHandler.prototype.selectCells=function(a,b){this.graph.setSelectionCell(a)};
mxConnectionHandler.prototype.insertEdge=function(a,b,c,d,e,f){if(null==this.factoryMethod)return this.graph.insertEdge(a,b,c,d,e,f);b=this.createEdge(c,d,e,f);return this.graph.addEdge(b,a,d,e)};
mxConnectionHandler.prototype.createTargetVertex=function(a,b){for(a=this.graph.getCellGeometry(b);null!=a&&a.relative;)b=this.graph.getModel().getParent(b),a=this.graph.getCellGeometry(b);var c=this.graph.cloneCell(b);a=this.graph.getModel().getGeometry(c);if(null!=a){var d=this.graph.view.translate,e=this.graph.view.scale,f=new mxPoint(this.currentPoint.x/e-d.x,this.currentPoint.y/e-d.y);a.x=Math.round(f.x-a.width/2-this.graph.panDx/e);a.y=Math.round(f.y-a.height/2-this.graph.panDy/e);f=this.getAlignmentTolerance();
if(0<f){var g=this.graph.view.getState(b);null!=g&&(b=g.x/e-d.x,d=g.y/e-d.y,Math.abs(b-a.x)<=f&&(a.x=Math.round(b)),Math.abs(d-a.y)<=f&&(a.y=Math.round(d)))}}return c};mxConnectionHandler.prototype.getAlignmentTolerance=function(a){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance};
mxConnectionHandler.prototype.createEdge=function(a,b,c,d){var e=null;null!=this.factoryMethod&&(e=this.factoryMethod(b,c,d));null==e&&(e=new mxCell(a||""),e.setEdge(!0),e.setStyle(d),a=new mxGeometry,a.relative=!0,e.setGeometry(a));return e};
mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.marker&&(this.marker.destroy(),this.marker=null);null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null);null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),
this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)};
function mxConstraintHandler(a){this.graph=a;this.resetHandler=mxUtils.bind(this,function(b,c){null!=this.currentFocus&&null==this.graph.view.getState(this.currentFocus.cell)?this.reset():this.redraw()});this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE,this.resetHandler);this.graph.addListener(mxEvent.ROOT,
this.resetHandler)}mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5);mxConstraintHandler.prototype.graph=null;mxConstraintHandler.prototype.enabled=!0;mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR;mxConstraintHandler.prototype.isEnabled=function(){return this.enabled};mxConstraintHandler.prototype.setEnabled=function(a){this.enabled=a};
mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var a=0;a<this.focusIcons.length;a++)this.focusIcons[a].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null);this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null};mxConstraintHandler.prototype.getTolerance=function(a){return this.graph.getTolerance()};
mxConstraintHandler.prototype.getImageForConstraint=function(a,b,c){return this.pointImage};mxConstraintHandler.prototype.isEventIgnored=function(a,b){return!1};mxConstraintHandler.prototype.isStateIgnored=function(a,b){return!1};mxConstraintHandler.prototype.destroyIcons=function(){if(null!=this.focusIcons){for(var a=0;a<this.focusIcons.length;a++)this.focusIcons[a].destroy();this.focusPoints=this.focusIcons=null}};
mxConstraintHandler.prototype.destroyFocusHighlight=function(){null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)};mxConstraintHandler.prototype.isKeepFocusEvent=function(a){return mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())};
mxConstraintHandler.prototype.getCellForEvent=function(a,b){var c=a.getCell();null!=c||null==b||a.getGraphX()==b.x&&a.getGraphY()==b.y||(c=this.graph.getCellAt(b.x,b.y));null==c||this.graph.isCellConnectable(c)||(a=this.graph.getModel().getParent(c),this.graph.getModel().isVertex(a)&&this.graph.isCellConnectable(a)&&(c=a));return this.graph.isCellLocked(c)?null:c};
mxConstraintHandler.prototype.update=function(a,b,c,d){if(this.isEnabled()&&!this.isEventIgnored(a)){null==this.mouseleaveHandler&&null!=this.graph.container&&(this.mouseleaveHandler=mxUtils.bind(this,function(){this.reset()}),mxEvent.addListener(this.graph.container,"mouseleave",this.resetHandler));var e=this.getTolerance(a),f=null!=d?d.x:a.getGraphX(),g=null!=d?d.y:a.getGraphY();f=new mxRectangle(f-e,g-e,2*e,2*e);e=new mxRectangle(a.getGraphX()-e,a.getGraphY()-e,2*e,2*e);var k=this.graph.view.getState(this.getCellForEvent(a,
d));this.isKeepFocusEvent(a)||null!=this.currentFocusArea&&null!=this.currentFocus&&null==k&&this.graph.getModel().isVertex(this.currentFocus.cell)&&mxUtils.intersects(this.currentFocusArea,e)||k==this.currentFocus||(this.currentFocus=this.currentFocusArea=null,this.setFocus(a,k,b));a=this.currentPoint=this.currentConstraint=null;if(null!=this.focusIcons&&null!=this.constraints&&(null==k||this.currentFocus==k)){g=e.getCenterX();for(var l=e.getCenterY(),m=0;m<this.focusIcons.length;m++){var n=g-this.focusIcons[m].bounds.getCenterX(),
p=l-this.focusIcons[m].bounds.getCenterY();n=n*n+p*p;if((this.intersects(this.focusIcons[m],e,b,c)||null!=d&&this.intersects(this.focusIcons[m],f,b,c))&&(null==a||n<a)){this.currentConstraint=this.constraints[m];this.currentPoint=this.focusPoints[m];a=n;n=this.focusIcons[m].bounds.clone();n.grow(mxConstants.HIGHLIGHT_SIZE+1);--n.width;--n.height;if(null==this.focusHighlight){p=this.createHighlightShape();p.dialect=mxConstants.DIALECT_SVG;p.pointerEvents=!1;p.init(this.graph.getView().getOverlayPane());
this.focusHighlight=p;var r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:k});mxEvent.redirectMouseEvents(p.node,this.graph,r)}this.focusHighlight.bounds=n;this.focusHighlight.redraw()}}}null==this.currentConstraint&&this.destroyFocusHighlight()}else this.currentPoint=this.currentFocus=this.currentConstraint=null};
mxConstraintHandler.prototype.redraw=function(){if(null!=this.currentFocus&&null!=this.constraints&&null!=this.focusIcons){var a=this.graph.view.getState(this.currentFocus.cell);this.currentFocus=a;this.currentFocusArea=new mxRectangle(a.x,a.y,a.width,a.height);for(var b=0;b<this.constraints.length;b++){var c=this.graph.getConnectionPoint(a,this.constraints[b]),d=this.getImageForConstraint(a,this.constraints[b],c);d=new mxRectangle(Math.round(c.x-d.width/2),Math.round(c.y-d.height/2),d.width,d.height);
this.focusIcons[b].bounds=d;this.focusIcons[b].redraw();this.currentFocusArea.add(this.focusIcons[b].bounds);this.focusPoints[b]=c}}};
mxConstraintHandler.prototype.setFocus=function(a,b,c){this.constraints=null!=b&&!this.isStateIgnored(b,c)&&this.graph.isCellConnectable(b.cell)?this.isEnabled()?this.graph.getAllConnectionConstraints(b,c)||[]:[]:null;if(null!=this.constraints){this.currentFocus=b;this.currentFocusArea=new mxRectangle(b.x,b.y,b.width,b.height);if(null!=this.focusIcons){for(c=0;c<this.focusIcons.length;c++)this.focusIcons[c].destroy();this.focusPoints=this.focusIcons=null}this.focusPoints=[];this.focusIcons=[];for(c=
0;c<this.constraints.length;c++){var d=this.graph.getConnectionPoint(b,this.constraints[c]),e=this.getImageForConstraint(b,this.constraints[c],d),f=e.src;e=new mxRectangle(Math.round(d.x-e.width/2),Math.round(d.y-e.height/2),e.width,e.height);f=new mxImageShape(e,f);f.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;f.preserveImageAspect=!1;f.init(this.graph.getView().getDecoratorPane());null!=f.node.previousSibling&&f.node.parentNode.insertBefore(f.node,
f.node.parentNode.firstChild);e=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:b});f.redraw();mxEvent.redirectMouseEvents(f.node,this.graph,e);this.currentFocusArea.add(f.bounds);this.focusIcons.push(f);this.focusPoints.push(d)}this.currentFocusArea.grow(this.getTolerance(a))}else this.destroyIcons(),this.destroyFocusHighlight()};
mxConstraintHandler.prototype.createHighlightShape=function(){var a=new mxRectangleShape(null,this.highlightColor,this.highlightColor,mxConstants.HIGHLIGHT_STROKEWIDTH);a.opacity=mxConstants.HIGHLIGHT_OPACITY;return a};mxConstraintHandler.prototype.intersects=function(a,b,c,d){return mxUtils.intersects(a.bounds,b)};
mxConstraintHandler.prototype.destroy=function(){this.reset();null!=this.resetHandler&&(this.graph.model.removeListener(this.resetHandler),this.graph.view.removeListener(this.resetHandler),this.graph.removeListener(this.resetHandler),this.resetHandler=null);null!=this.mouseleaveHandler&&null!=this.graph.container&&(mxEvent.removeListener(this.graph.container,"mouseleave",this.mouseleaveHandler),this.mouseleaveHandler=null)};
function mxRubberband(a){null!=a&&(this.graph=a,this.graph.addMouseListener(this),this.forceRubberbandHandler=mxUtils.bind(this,function(b,c){b=c.getProperty("eventName");c=c.getProperty("event");if(b==mxEvent.MOUSE_DOWN&&this.isForceRubberbandEvent(c)){b=mxUtils.getOffset(this.graph.container);var d=mxUtils.getScrollOrigin(this.graph.container);d.x-=b.x;d.y-=b.y;this.start(c.getX()+d.x,c.getY()+d.y);c.consume(!1)}}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forceRubberbandHandler),this.panHandler=
mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),this.gestureHandler=mxUtils.bind(this,function(b,c){null!=this.first&&this.reset()}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxRubberband.prototype.defaultOpacity=20;mxRubberband.prototype.enabled=!0;mxRubberband.prototype.div=null;mxRubberband.prototype.sharedDiv=null;
mxRubberband.prototype.currentX=0;mxRubberband.prototype.currentY=0;mxRubberband.prototype.fadeOut=!1;mxRubberband.prototype.isEnabled=function(){return this.enabled};mxRubberband.prototype.setEnabled=function(a){this.enabled=a};mxRubberband.prototype.isForceRubberbandEvent=function(a){return mxEvent.isAltDown(a.getEvent())};
mxRubberband.prototype.mouseDown=function(a,b){if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null==b.getState()&&!mxEvent.isMultiTouchEvent(b.getEvent())){a=mxUtils.getOffset(this.graph.container);var c=mxUtils.getScrollOrigin(this.graph.container);c.x-=a.x;c.y-=a.y;this.start(b.getX()+c.x,b.getY()+c.y);b.consume(!1)}};
mxRubberband.prototype.start=function(a,b){function c(e){e=new mxMouseEvent(e);var f=mxUtils.convertPoint(d,e.getX(),e.getY());e.graphX=f.x;e.graphY=f.y;return e}this.first=new mxPoint(a,b);var d=this.graph.container;this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,c(e))});this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,c(e))});mxClient.IS_FF&&mxEvent.addGestureListeners(document,null,this.dragHandler,this.dropHandler)};
mxRubberband.prototype.mouseMove=function(a,b){if(!b.isConsumed()&&null!=this.first){var c=mxUtils.getScrollOrigin(this.graph.container);a=mxUtils.getOffset(this.graph.container);c.x-=a.x;c.y-=a.y;a=b.getX()+c.x;c=b.getY()+c.y;var d=this.first.x-a,e=this.first.y-c,f=this.graph.tolerance;if(null!=this.div||Math.abs(d)>f||Math.abs(e)>f)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,c),b.consume()}};
mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity));this.graph.container.appendChild(this.sharedDiv);var a=this.sharedDiv;mxClient.IS_SVG&&(!mxClient.IS_IE||10<=document.documentMode)&&this.fadeOut&&(this.sharedDiv=null);return a};mxRubberband.prototype.isActive=function(a,b){return null!=this.div&&"none"!=this.div.style.display};
mxRubberband.prototype.mouseUp=function(a,b){a=this.isActive();this.reset();a&&(this.execute(b.getEvent()),b.consume())};mxRubberband.prototype.execute=function(a){var b=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(b,a)};
mxRubberband.prototype.reset=function(){if(null!=this.div)if(mxClient.IS_SVG&&(!mxClient.IS_IE||10<=document.documentMode)&&this.fadeOut){var a=this.div;mxUtils.setPrefixedStyle(a.style,"transition","all 0.2s linear");a.style.pointerEvents="none";a.style.opacity=0;window.setTimeout(function(){a.parentNode.removeChild(a)},200)}else this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler);this.dropHandler=this.dragHandler=null;this.currentY=
this.currentX=0;this.div=this.first=null};mxRubberband.prototype.update=function(a,b){this.currentX=a;this.currentY=b;this.repaint()};
mxRubberband.prototype.repaint=function(){if(null!=this.div){var a=this.currentX-this.graph.panDx,b=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,a);this.y=Math.min(this.first.y,b);this.width=Math.max(this.first.x,a)-this.x;this.height=Math.max(this.first.y,b)-this.y;this.div.style.left=this.x+0+"px";this.div.style.top=this.y+0+"px";this.div.style.width=Math.max(1,this.width)+"px";this.div.style.height=Math.max(1,this.height)+"px"}};
mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))};function mxHandle(a,b,c,d){this.graph=a.view.graph;this.state=a;this.cursor=null!=b?b:this.cursor;this.image=null!=c?c:this.image;this.shape=null!=d?d:null;this.init()}mxHandle.prototype.cursor="default";mxHandle.prototype.image=null;
mxHandle.prototype.ignoreGrid=!1;mxHandle.prototype.getPosition=function(a){};mxHandle.prototype.setPosition=function(a,b,c){};mxHandle.prototype.execute=function(a){};mxHandle.prototype.copyStyle=function(a){this.graph.setCellStyles(a,this.state.style[a],[this.state.cell])};
mxHandle.prototype.processEvent=function(a){var b=this.graph.view.scale,c=this.graph.view.translate;c=new mxPoint(a.getGraphX()/b-c.x,a.getGraphY()/b-c.y);null!=this.shape&&null!=this.shape.bounds&&(c.x-=this.shape.bounds.width/b/4,c.y-=this.shape.bounds.height/b/4);b=-mxUtils.toRadians(this.getRotation());var d=-mxUtils.toRadians(this.getTotalRotation())-b;c=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(c,b),this.ignoreGrid||!this.graph.isGridEnabledEvent(a.getEvent())),d));this.setPosition(this.state.getPaintBounds(),
c,a);this.redraw()};mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state);null!=this.state.shape&&this.state.shape.apply(this.state);this.graph.cellRenderer.redraw(this.state,!0)};mxHandle.prototype.getRotation=function(){return null!=this.state.shape?this.state.shape.getRotation():0};mxHandle.prototype.getTotalRotation=function(){return null!=this.state.shape?this.state.shape.getShapeRotation():0};
mxHandle.prototype.init=function(){var a=this.isHtmlRequired();null!=this.image?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):null==this.shape&&(this.shape=this.createShape(a));this.initShape(a)};mxHandle.prototype.createShape=function(a){a=new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE);return new mxRectangleShape(a,mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};
mxHandle.prototype.initShape=function(a){a&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,null!=this.cursor&&this.shape.init(this.graph.getView().getOverlayPane()));mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state);this.shape.node.style.cursor=this.cursor};
mxHandle.prototype.redraw=function(){if(null!=this.shape&&null!=this.state.shape){var a=this.getPosition(this.state.getPaintBounds());if(null!=a){var b=mxUtils.toRadians(this.getTotalRotation());a=this.rotatePoint(this.flipPoint(a),b);b=this.graph.view.scale;var c=this.graph.view.translate;this.shape.bounds.x=Math.floor((a.x+c.x)*b-this.shape.bounds.width/2);this.shape.bounds.y=Math.floor((a.y+c.y)*b-this.shape.bounds.height/2);this.shape.redraw()}}};
mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container};mxHandle.prototype.rotatePoint=function(a,b){var c=this.state.getCellBounds();c=new mxPoint(c.getCenterX(),c.getCenterY());return mxUtils.getRotatedPoint(a,Math.cos(b),Math.sin(b),c)};
mxHandle.prototype.flipPoint=function(a){if(null!=this.state.shape){var b=this.state.getCellBounds();this.state.shape.flipH&&(a.x=2*b.x+b.width-a.x);this.state.shape.flipV&&(a.y=2*b.y+b.height-a.y)}return a};mxHandle.prototype.snapPoint=function(a,b){b||(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));return a};mxHandle.prototype.setVisible=function(a){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=a?"":"none")};
mxHandle.prototype.reset=function(){this.setVisible(!0);this.state.style=this.graph.getCellStyle(this.state.cell);this.positionChanged()};mxHandle.prototype.destroy=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null)};
function mxVertexHandler(a){null!=a&&(this.state=a,this.init(),this.escapeHandler=mxUtils.bind(this,function(b,c){this.livePreview&&null!=this.index&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate());this.reset()}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxVertexHandler.prototype.graph=null;mxVertexHandler.prototype.state=null;mxVertexHandler.prototype.singleSizer=!1;
mxVertexHandler.prototype.index=null;mxVertexHandler.prototype.allowHandleBoundsCheck=!0;mxVertexHandler.prototype.handleImage=null;mxVertexHandler.prototype.handlesVisible=!0;mxVertexHandler.prototype.tolerance=0;mxVertexHandler.prototype.rotationEnabled=!1;mxVertexHandler.prototype.parentHighlightEnabled=!1;mxVertexHandler.prototype.rotationRaster=!0;mxVertexHandler.prototype.rotationCursor="crosshair";mxVertexHandler.prototype.livePreview=!1;mxVertexHandler.prototype.movePreviewToFront=!1;
mxVertexHandler.prototype.manageSizers=!1;mxVertexHandler.prototype.constrainGroupByChildren=!1;mxVertexHandler.prototype.rotationHandleVSpacing=-16;mxVertexHandler.prototype.horizontalOffset=0;mxVertexHandler.prototype.verticalOffset=0;
mxVertexHandler.prototype.init=function(){this.graph=this.state.view.graph;this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.selectionBorder=this.createSelectionShape(this.bounds);this.selectionBorder.dialect=mxConstants.DIALECT_SVG;this.selectionBorder.pointerEvents=!1;this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0");
this.selectionBorder.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state);this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellLocked(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX);if(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var a=this.graph.isCellResizable(this.state.cell)&&!this.graph.isCellLocked(this.state.cell);this.sizers=
[];if(a||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var b=0;a&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",b++)),this.sizers.push(this.createSizer("n-resize",b++)),this.sizers.push(this.createSizer("ne-resize",b++)),this.sizers.push(this.createSizer("w-resize",b++)),this.sizers.push(this.createSizer("e-resize",b++)),this.sizers.push(this.createSizer("sw-resize",b++)),this.sizers.push(this.createSizer("s-resize",b++))),this.sizers.push(this.createSizer("se-resize",
b++)));a=this.graph.model.getGeometry(this.state.cell);null==a||a.relative||this.graph.isSwimlane(this.state.cell)||!this.graph.isLabelMovable(this.state.cell)||(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!a&&2>this.state.width&&2>this.state.height&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,
mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.isRotationHandleVisible()&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape));this.graph.isCellLocked(this.state.cell)||(this.customHandles=this.createCustomHandles());this.redraw();this.constrainGroupByChildren&&this.updateMinBounds()};
mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&!this.graph.isCellLocked(this.state.cell)&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.isConstrainedEvent=function(a){return mxEvent.isShiftDown(a.getEvent())||"fixed"==this.state.style[mxConstants.STYLE_ASPECT]};
mxVertexHandler.prototype.isCenteredEvent=function(a,b){return!1};mxVertexHandler.prototype.createCustomHandles=function(){return null};
mxVertexHandler.prototype.updateMinBounds=function(){var a=this.graph.getChildCells(this.state.cell);if(0<a.length&&(this.minBounds=this.graph.view.getBounds(a),null!=this.minBounds)){a=this.state.view.scale;var b=this.state.view.translate;this.minBounds.x-=this.state.x;this.minBounds.y-=this.state.y;this.minBounds.x/=a;this.minBounds.y/=a;this.minBounds.width/=a;this.minBounds.height/=a;this.x0=this.state.x/a-b.x;this.y0=this.state.y/a-b.y}};
mxVertexHandler.prototype.getSelectionBounds=function(a){return new mxRectangle(Math.round(a.x),Math.round(a.y),Math.round(a.width),Math.round(a.height))};mxVertexHandler.prototype.createParentHighlightShape=function(a){return this.createSelectionShape(a)};mxVertexHandler.prototype.createSelectionShape=function(a){a=new mxRectangleShape(mxRectangle.fromRectangle(a),null,this.getSelectionColor());a.strokewidth=this.getSelectionStrokeWidth();a.isDashed=this.isSelectionDashed();return a};
mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isCellEditable(this.state.cell)?mxConstants.VERTEX_SELECTION_COLOR:mxConstants.LOCKED_HANDLE_FILLCOLOR};mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH};mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED};
mxVertexHandler.prototype.createSizer=function(a,b,c,d){c=c||mxConstants.HANDLE_SIZE;c=new mxRectangle(0,0,c,c);d=this.createSizerShape(c,b,d);d.isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(--d.bounds.height,--d.bounds.width,d.dialect=mxConstants.DIALECT_STRICTHTML,d.init(this.graph.container)):(d.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,d.init(this.graph.getView().getOverlayPane()));
mxEvent.redirectMouseEvents(d.node,this.graph,this.state);this.graph.isEnabled()&&d.setCursor(a);this.isSizerVisible(b)||(d.visible=!1);return d};mxVertexHandler.prototype.isSizerVisible=function(a){return!0};
mxVertexHandler.prototype.createSizerShape=function(a,b,c){return null!=this.handleImage?(a=new mxRectangle(a.x,a.y,this.handleImage.width,this.handleImage.height),a=new mxImageShape(a,this.handleImage.src),a.preserveImageAspect=!1,a):b==mxEvent.ROTATION_HANDLE?new mxEllipse(a,c||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(a,c||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};
mxVertexHandler.prototype.moveSizerTo=function(a,b,c){null!=a&&(a.bounds.x=Math.floor(b-a.bounds.width/2),a.bounds.y=Math.floor(c-a.bounds.height/2),null!=a.node&&"none"!=a.node.style.display&&a.redraw())};
mxVertexHandler.prototype.getHandleForEvent=function(a){var b=mxEvent.isMouseEvent(a.getEvent())?1:this.tolerance,c=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<b)?new mxRectangle(a.getGraphX()-b,a.getGraphY()-b,2*b,2*b):null;b=mxUtils.bind(this,function(e){var f=null!=e&&e.constructor!=mxImageShape&&this.allowHandleBoundsCheck?e.strokewidth+e.svgStrokeTolerance:null;f=null!=f?new mxRectangle(a.getGraphX()-Math.floor(f/2),a.getGraphY()-Math.floor(f/2),f,f):c;return null!=e&&(a.isSource(e)||e.intersectsRectangle(f))});
if(b(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(b(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var d=0;d<this.sizers.length;d++)if(b(this.sizers[d]))return d;if(null!=this.customHandles&&this.isCustomHandleEvent(a))for(d=this.customHandles.length-1;0<=d;d--)if(b(this.customHandles[d].shape))return mxEvent.CUSTOM_HANDLE-d;return null};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!0};
mxVertexHandler.prototype.mouseDown=function(a,b){!b.isConsumed()&&this.graph.isEnabled()&&(a=this.getHandleForEvent(b),null!=a&&(this.start(b.getGraphX(),b.getGraphY(),a),b.consume()))};mxVertexHandler.prototype.isLivePreviewBorder=function(){return null!=this.state.shape&&null==this.state.shape.fill&&null==this.state.shape.stroke};
mxVertexHandler.prototype.start=function(a,b,c){if(null!=this.selectionBorder)if(this.livePreviewActive=this.livePreview&&0==this.graph.model.getChildCount(this.state.cell),this.inTolerance=!0,this.childOffsetY=this.childOffsetX=0,this.index=c,this.startX=a,this.startY=b,this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview())this.ghostPreview=this.createGhostPreview();else{a=this.state.view.graph.model;b=a.getParent(this.state.cell);this.state.view.currentRoot!=b&&(a.isVertex(b)||a.isEdge(b))&&
(this.parentState=this.state.view.graph.view.getState(b));this.selectionBorder.node.style.display=c==mxEvent.ROTATION_HANDLE?"inline":"none";if(!this.livePreviewActive||this.isLivePreviewBorder())this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):
(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container));c==mxEvent.ROTATION_HANDLE&&(b=this.getRotationHandlePosition(),a=b.x-this.state.getCenterX(),b=b.y-this.state.getCenterY(),this.startAngle=0!=a?180*Math.atan(b/a)/Math.PI+90:0,this.startDist=Math.sqrt(a*a+b*b));if(this.livePreviewActive)for(this.hideSizers(),c==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":c==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":null!=this.sizers&&
null!=this.sizers[c]?this.sizers[c].node.style.display="":c<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-c].setVisible(!0),c=this.graph.getEdges(this.state.cell),this.edgeHandlers=[],a=0;a<c.length;a++)b=this.graph.selectionCellsHandler.getHandler(c[a]),null!=b&&this.edgeHandlers.push(b)}};
mxVertexHandler.prototype.createGhostPreview=function(){var a=this.graph.cellRenderer.createShape(this.state);a.init(this.graph.view.getOverlayPane());a.scale=this.state.view.scale;a.bounds=this.bounds;a.outline=!0;return a};mxVertexHandler.prototype.setHandlesVisible=function(a){this.handlesVisible=a;if(null!=this.sizers)for(var b=0;b<this.sizers.length;b++)this.sizers[b].node.style.display=a?"":"none";if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)this.customHandles[b].setVisible(a)};
mxVertexHandler.prototype.hideSizers=function(){this.setHandlesVisible(!1)};mxVertexHandler.prototype.checkTolerance=function(a){this.inTolerance&&null!=this.startX&&null!=this.startY&&(mxEvent.isMouseEvent(a.getEvent())||Math.abs(a.getGraphX()-this.startX)>this.graph.tolerance||Math.abs(a.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)};mxVertexHandler.prototype.updateHint=function(a){};mxVertexHandler.prototype.removeHint=function(){};
mxVertexHandler.prototype.roundAngle=function(a){return Math.round(10*a)/10};mxVertexHandler.prototype.roundLength=function(a){return Math.round(100*a)/100};
mxVertexHandler.prototype.mouseMove=function(a,b){b.isConsumed()||null==this.index?this.graph.isMouseDown||null==this.getHandleForEvent(b)||b.consume(!1):(this.checkTolerance(b),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(b),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0,null!=this.ghostPreview?(this.ghostPreview.apply(this.state),this.ghostPreview.strokewidth=this.getSelectionStrokeWidth()/
this.ghostPreview.scale/this.ghostPreview.scale,this.ghostPreview.isDashed=this.isSelectionDashed(),this.ghostPreview.stroke=this.getSelectionColor(),this.ghostPreview.redraw(),null!=this.selectionBounds&&(this.selectionBorder.node.style.display="none")):(this.movePreviewToFront&&this.moveToFront(),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged())):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(b):(this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(b):this.resizeVertex(b),
this.updateHint(b))),b.consume())};mxVertexHandler.prototype.isGhostPreview=function(){return 0<this.state.view.graph.model.getChildCount(this.state.cell)};
mxVertexHandler.prototype.moveLabel=function(a){var b=new mxPoint(a.getGraphX(),a.getGraphY()),c=this.graph.view.translate,d=this.graph.view.scale;this.graph.isGridEnabledEvent(a.getEvent())&&(b.x=(this.graph.snap(b.x/d-c.x)+c.x)*d,b.y=(this.graph.snap(b.y/d-c.y)+c.y)*d);this.moveSizerTo(this.sizers[null!=this.rotationShape?this.sizers.length-2:this.sizers.length-1],b.x,b.y)};
mxVertexHandler.prototype.rotateVertex=function(a){var b=new mxPoint(a.getGraphX(),a.getGraphY()),c=this.state.x+this.state.width/2-b.x,d=this.state.y+this.state.height/2-b.y;this.currentAlpha=0!=c?180*Math.atan(d/c)/Math.PI+90:0>d?180:0;0<c&&(this.currentAlpha-=180);this.currentAlpha-=this.startAngle;this.rotationRaster&&this.graph.isGridEnabledEvent(a.getEvent())?(c=b.x-this.state.getCenterX(),d=b.y-this.state.getCenterY(),a=Math.sqrt(c*c+d*d),raster=2>a-this.startDist?15:25>a-this.startDist?5:
1,this.currentAlpha=Math.round(this.currentAlpha/raster)*raster):this.currentAlpha=this.roundAngle(this.currentAlpha);this.selectionBorder.rotation=this.currentAlpha;this.selectionBorder.redraw();this.livePreviewActive&&this.redrawHandles()};
mxVertexHandler.prototype.resizeVertex=function(a){var b=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),c=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),d=new mxPoint(a.getGraphX(),a.getGraphY()),e=this.graph.view.translate,f=this.graph.view.scale,g=Math.cos(-c),k=Math.sin(-c),l=d.x-this.startX,m=d.y-this.startY;d=k*l+g*m;l=g*l-k*m;m=d;g=this.graph.getCellGeometry(this.state.cell);this.unscaledBounds=this.union(g,l/f,m/f,this.index,this.graph.isGridEnabledEvent(a.getEvent()),
1,new mxPoint(0,0),this.isConstrainedEvent(a),this.isCenteredEvent(this.state,a));g.relative||(k=this.graph.getMaximumGraphBounds(),null!=k&&null!=this.parentState&&(k=mxRectangle.fromRectangle(k),k.x-=(this.parentState.x-e.x*f)/f,k.y-=(this.parentState.y-e.y*f)/f),this.graph.isConstrainChild(this.state.cell)&&(d=this.graph.getCellContainmentArea(this.state.cell),null!=d&&(l=this.graph.getOverlap(this.state.cell),0<l&&(d=mxRectangle.fromRectangle(d),d.x-=d.width*l,d.y-=d.height*l,d.width+=2*d.width*
l,d.height+=2*d.height*l),null==k?k=d:(k=mxRectangle.fromRectangle(k),k.intersect(d)))),null!=k&&(this.unscaledBounds.x<k.x&&(this.unscaledBounds.width-=k.x-this.unscaledBounds.x,this.unscaledBounds.x=k.x),this.unscaledBounds.y<k.y&&(this.unscaledBounds.height-=k.y-this.unscaledBounds.y,this.unscaledBounds.y=k.y),this.unscaledBounds.x+this.unscaledBounds.width>k.x+k.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-k.x-k.width),this.unscaledBounds.y+this.unscaledBounds.height>
k.y+k.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-k.y-k.height)));d=this.bounds;this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:e.x*f)+this.unscaledBounds.x*f,(null!=this.parentState?this.parentState.y:e.y*f)+this.unscaledBounds.y*f,this.unscaledBounds.width*f,this.unscaledBounds.height*f);g.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y);g=Math.cos(c);
k=Math.sin(c);c=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY());l=c.x-b.x;m=c.y-b.y;b=g*l-k*m-l;c=k*l+g*m-m;l=this.bounds.x-this.state.x;m=this.bounds.y-this.state.y;e=g*l-k*m;g=k*l+g*m;this.bounds.x+=b;this.bounds.y+=c;this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+b/f);this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+c/f);this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width);this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height);
this.graph.isCellCollapsed(this.state.cell)||0==b&&0==c?this.childOffsetY=this.childOffsetX=0:(this.childOffsetX=this.state.x-this.bounds.x+e,this.childOffsetY=this.state.y-this.bounds.y+g);d.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(a),null!=this.preview?this.drawPreview():this.updateParentHighlight())};
mxVertexHandler.prototype.updateLivePreview=function(a){var b=this.graph.view.scale,c=this.graph.view.translate;a=this.state.clone();this.state.x=this.bounds.x;this.state.y=this.bounds.y;this.state.origin=new mxPoint(this.state.x/b-c.x,this.state.y/b-c.y);this.state.width=this.bounds.width;this.state.height=this.bounds.height;b=this.state.absoluteOffset;new mxPoint(b.x,b.y);this.state.absoluteOffset.x=0;this.state.absoluteOffset.y=0;b=this.graph.getCellGeometry(this.state.cell);null!=b&&(c=b.offset||
this.EMPTY_POINT,null==c||b.relative||(this.state.absoluteOffset.x=this.state.view.scale*c.x,this.state.absoluteOffset.y=this.state.view.scale*c.y),this.state.view.updateVertexLabelOffset(this.state));this.state.view.graph.cellRenderer.redraw(this.state,!0);this.state.view.invalidate(this.state.cell);this.state.invalid=!1;this.state.view.validate();this.redrawHandles();this.movePreviewToFront&&this.moveToFront();null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility=
"hidden");this.state.setState(a)};
mxVertexHandler.prototype.moveToFront=function(){if(null!=this.state.text&&null!=this.state.text.node&&null!=this.state.text.node.nextSibling||null!=this.state.shape&&null!=this.state.shape.node&&null!=this.state.shape.node.nextSibling&&(null==this.state.text||this.state.shape.node.nextSibling!=this.state.text.node))null!=this.state.shape&&null!=this.state.shape.node&&this.state.shape.node.parentNode.appendChild(this.state.shape.node),null!=this.state.text&&null!=this.state.text.node&&this.state.text.node.parentNode.appendChild(this.state.text.node)};
mxVertexHandler.prototype.mouseUp=function(a,b){if(null!=this.index&&null!=this.state){var c=new mxPoint(b.getGraphX(),b.getGraphY());a=this.index;this.index=null;null==this.ghostPreview&&(this.state.view.invalidate(this.state.cell,!1,!1),this.state.view.validate());this.graph.getModel().beginUpdate();try{if(a<=mxEvent.CUSTOM_HANDLE){if(null!=this.customHandles){var d=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-a].active=!1;this.customHandles[mxEvent.CUSTOM_HANDLE-
a].execute(b);null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-a]&&(this.state.style=d,this.customHandles[mxEvent.CUSTOM_HANDLE-a].positionChanged())}}else if(a==mxEvent.ROTATION_HANDLE)if(null!=this.currentAlpha){var e=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);0!=e&&this.rotateCell(this.state.cell,e)}else this.rotateClick();else{var f=this.graph.isGridEnabledEvent(b.getEvent()),g=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),
k=Math.cos(-g),l=Math.sin(-g),m=c.x-this.startX,n=c.y-this.startY;d=l*m+k*n;m=k*m-l*n;n=d;var p=this.graph.view.scale,r=this.isRecursiveResize(this.state,b);this.resizeCell(this.state.cell,this.roundLength(m/p),this.roundLength(n/p),a,f,this.isConstrainedEvent(b),r)}}finally{this.graph.getModel().endUpdate()}b.consume();this.reset();this.redrawHandles()}};mxVertexHandler.prototype.isRecursiveResize=function(a,b){return this.graph.isRecursiveResize(this.state)};
mxVertexHandler.prototype.rotateClick=function(){};
mxVertexHandler.prototype.rotateCell=function(a,b,c){if(0!=b){var d=this.graph.getModel();if(d.isVertex(a)||d.isEdge(a)){if(!d.isEdge(a)){var e=(this.graph.getCurrentCellStyle(a)[mxConstants.STYLE_ROTATION]||0)+b;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,e,[a])}e=this.graph.getCellGeometry(a);if(null!=e){var f=this.graph.getCellGeometry(c);null==f||d.isEdge(c)||(e=e.clone(),e.rotate(b,new mxPoint(f.width/2,f.height/2)),d.setGeometry(a,e));if(d.isVertex(a)&&!e.relative||d.isEdge(a))for(c=
d.getChildCount(a),e=0;e<c;e++)this.rotateCell(d.getChildAt(a,e),b,a)}}}};
mxVertexHandler.prototype.reset=function(){null!=this.sizers&&null!=this.index&&null!=this.sizers[this.index]&&"none"==this.sizers[this.index].node.style.display&&(this.sizers[this.index].node.style.display="");this.index=this.inTolerance=this.currentAlpha=null;null!=this.preview&&(this.preview.destroy(),this.preview=null);null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null);if(this.livePreviewActive&&null!=this.sizers){for(var a=0;a<this.sizers.length;a++)null!=this.sizers[a]&&
(this.sizers[a].node.style.display="");null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="")}if(null!=this.customHandles)for(a=0;a<this.customHandles.length;a++)this.customHandles[a].active?(this.customHandles[a].active=!1,this.customHandles[a].reset()):this.customHandles[a].setVisible(!0);null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,
this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview());this.removeHint();this.redrawHandles();this.edgeHandlers=null;this.handlesVisible=!0;this.livePreviewActive=this.unscaledBounds=null};
mxVertexHandler.prototype.resizeCell=function(a,b,c,d,e,f,g){b=this.graph.model.getGeometry(a);null!=b&&(d==mxEvent.LABEL_HANDLE?(d=-mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),g=Math.cos(d),c=Math.sin(d),d=this.graph.view.scale,g=mxUtils.getRotatedPoint(new mxPoint(Math.round((this.labelShape.bounds.getCenterX()-this.startX)/d),Math.round((this.labelShape.bounds.getCenterY()-this.startY)/d)),g,c),b=b.clone(),null==b.offset?b.offset=g:(b.offset.x+=g.x,b.offset.y+=g.y),this.graph.model.setGeometry(a,
b)):null!=this.unscaledBounds&&(d=this.graph.view.scale,0==this.childOffsetX&&0==this.childOffsetY||this.moveChildren(a,Math.round(this.childOffsetX/d),Math.round(this.childOffsetY/d)),this.graph.resizeCell(a,this.unscaledBounds,g)))};mxVertexHandler.prototype.moveChildren=function(a,b,c){for(var d=this.graph.getModel(),e=d.getChildCount(a),f=0;f<e;f++){var g=d.getChildAt(a,f),k=this.graph.getCellGeometry(g);null!=k&&(k=k.clone(),k.translate(b,c),d.setGeometry(g,k))}};
mxVertexHandler.prototype.union=function(a,b,c,d,e,f,g,k,l){e=null!=e?e&&this.graph.gridEnabled:this.graph.gridEnabled;if(this.singleSizer)return d=a.x+a.width+b,g=a.y+a.height+c,e&&(d=this.graph.snap(d/f)*f,g=this.graph.snap(g/f)*f),f=new mxRectangle(a.x,a.y,0,0),f.add(new mxRectangle(d,g,0,0)),f;var m=a.width,n=a.height,p=a.x-g.x*f,r=p+m;a=a.y-g.y*f;var q=a+n,t=p+m/2,u=a+n/2;4<d?(q+=c,q=e?this.graph.snap(q/f)*f:Math.round(q/f)*f):3>d&&(a+=c,a=e?this.graph.snap(a/f)*f:Math.round(a/f)*f);if(0==d||
3==d||5==d)p+=b,p=e?this.graph.snap(p/f)*f:Math.round(p/f)*f;else if(2==d||4==d||7==d)r+=b,r=e?this.graph.snap(r/f)*f:Math.round(r/f)*f;e=r-p;c=q-a;k&&(k=this.graph.getCellGeometry(this.state.cell),null!=k&&(k=k.width/k.height,1==d||2==d||7==d||6==d?e=c*k:c=e/k,0==d&&(p=r-e,a=q-c)));l&&(e+=e-m,c+=c-n,p+=t-(p+e/2),a+=u-(a+c/2));0>e&&(p+=e,e=Math.abs(e));0>c&&(a+=c,c=Math.abs(c));d=new mxRectangle(p+g.x*f,a+g.y*f,e,c);null!=this.minBounds&&(d.width=Math.max(d.width,this.minBounds.x*f+this.minBounds.width*
f+Math.max(0,this.x0*f-d.x)),d.height=Math.max(d.height,this.minBounds.y*f+this.minBounds.height*f+Math.max(0,this.y0*f-d.y)));return d};mxVertexHandler.prototype.redraw=function(a){this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.drawPreview();a||this.redrawHandles()};
mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),b=this.tolerance;null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]&&(this.bounds.width<2*this.sizers[0].bounds.width+2*b||this.bounds.height<2*this.sizers[0].bounds.height+2*b)&&(b/=2,a.x=this.sizers[0].bounds.width+b,a.y=this.sizers[0].bounds.height+b);return a};mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds};
mxVertexHandler.prototype.redrawHandles=function(){var a=this.getSizerBounds(),b=this.tolerance;this.verticalOffset=this.horizontalOffset=0;if(null!=this.customHandles)for(var c=0;c<this.customHandles.length;c++){var d=this.customHandles[c].shape.node.style.display;this.customHandles[c].redraw();this.customHandles[c].shape.node.style.display=d;this.customHandles[c].shape.node.style.visibility=this.handlesVisible&&this.isCustomHandleVisible(this.customHandles[c])?"":"hidden"}if(null!=this.sizers&&
0<this.sizers.length&&null!=this.sizers[0]){if(null==this.index&&this.manageSizers&&8<=this.sizers.length){c=this.getHandlePadding();this.horizontalOffset=c.x;this.verticalOffset=c.y;if(0!=this.horizontalOffset||0!=this.verticalOffset)a=new mxRectangle(a.x,a.y,a.width,a.height),a.x-=this.horizontalOffset/2,a.width+=this.horizontalOffset,a.y-=this.verticalOffset/2,a.height+=this.verticalOffset;8<=this.sizers.length&&(a.width<2*this.sizers[0].bounds.width+2*b||a.height<2*this.sizers[0].bounds.height+
2*b?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):this.handlesVisible&&(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))}b=a.x+a.width;c=a.y+a.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],b,c);else{d=a.x+a.width/2;var e=a.y+a.height/2;if(8<=this.sizers.length){var f=
"nw-resize n-resize ne-resize e-resize se-resize s-resize sw-resize w-resize".split(" "),g=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),k=Math.cos(g),l=Math.sin(g);g=Math.round(4*g/Math.PI);var m=new mxPoint(a.getCenterX(),a.getCenterY()),n=mxUtils.getRotatedPoint(new mxPoint(a.x,a.y),k,l,m);this.moveSizerTo(this.sizers[0],n.x,n.y);this.sizers[0].setCursor(f[mxUtils.mod(0+g,f.length)]);n.x=d;n.y=a.y;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[1],n.x,n.y);
this.sizers[1].setCursor(f[mxUtils.mod(1+g,f.length)]);n.x=b;n.y=a.y;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[2],n.x,n.y);this.sizers[2].setCursor(f[mxUtils.mod(2+g,f.length)]);n.x=a.x;n.y=e;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[3],n.x,n.y);this.sizers[3].setCursor(f[mxUtils.mod(7+g,f.length)]);n.x=b;n.y=e;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[4],n.x,n.y);this.sizers[4].setCursor(f[mxUtils.mod(3+g,f.length)]);n.x=a.x;n.y=c;
n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[5],n.x,n.y);this.sizers[5].setCursor(f[mxUtils.mod(6+g,f.length)]);n.x=d;n.y=c;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[6],n.x,n.y);this.sizers[6].setCursor(f[mxUtils.mod(5+g,f.length)]);n.x=b;n.y=c;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[7],n.x,n.y);this.sizers[7].setCursor(f[mxUtils.mod(4+g,f.length)]);n.x=d+this.state.absoluteOffset.x;n.y=e+this.state.absoluteOffset.y;n=mxUtils.getRotatedPoint(n,
k,l,m);this.moveSizerTo(this.sizers[8],n.x,n.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],d+this.state.absoluteOffset.x,e+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}null!=this.rotationShape&&(g=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),k=Math.cos(g),l=Math.sin(g),m=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),n=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),
k,l,m),null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,n.x,n.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()||!this.handlesVisible?"hidden":""));null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"));if(null!=this.edgeHandlers)for(c=0;c<this.edgeHandlers.length;c++)this.edgeHandlers[c].redraw()};
mxVertexHandler.prototype.isCustomHandleVisible=function(a){return!this.graph.isEditing()&&1==this.state.view.graph.getSelectionCount()};mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)};mxVertexHandler.prototype.isParentHighlightVisible=function(){return!this.graph.isCellSelected(this.graph.model.getParent(this.state.cell))};
mxVertexHandler.prototype.destroyParentHighlight=function(){null!=this.parentHighlight.state&&(delete this.parentHighlight.state.parentHighlight,delete this.parentHighlight.state);this.parentHighlight.destroy();this.parentHighlight=null};
mxVertexHandler.prototype.updateParentHighlight=function(){if(!this.isDestroyed()){var a=this.isParentHighlightVisible(),b=this.graph.model.getParent(this.state.cell),c=this.graph.view.getState(b);null!=this.parentHighlight?this.graph.model.isVertex(b)&&a?(a=this.parentHighlight.bounds,null==c||a.x==c.x&&a.y==c.y&&a.width==c.width&&a.height==c.height||(this.parentHighlight.bounds=mxRectangle.fromRectangle(c),this.parentHighlight.redraw())):this.destroyParentHighlight():this.parentHighlightEnabled&&
a&&this.graph.model.isVertex(b)&&null!=c&&null==c.parentHighlight&&(this.parentHighlight=this.createParentHighlightShape(c),this.parentHighlight.dialect=mxConstants.DIALECT_SVG,this.parentHighlight.pointerEvents=!1,this.parentHighlight.rotation=Number(c.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()),this.parentHighlight.redraw(),c.parentHighlight=this.parentHighlight,this.parentHighlight.state=c)}};
mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw());this.selectionBorder.bounds=this.getSelectionBorderBounds();this.selectionBorder.redraw();this.updateParentHighlight()};
mxVertexHandler.prototype.getSelectionBorderBounds=function(){return this.bounds};mxVertexHandler.prototype.isDestroyed=function(){return null==this.selectionBorder};
mxVertexHandler.prototype.destroy=function(){null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.preview&&(this.preview.destroy(),this.preview=null);null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null);null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null);null!=this.parentHighlight&&this.destroyParentHighlight();this.labelShape=null;this.removeHint();if(null!=this.sizers){for(var a=
0;a<this.sizers.length;a++)this.sizers[a].destroy();this.sizers=null}if(null!=this.customHandles){for(a=0;a<this.customHandles.length;a++)this.customHandles[a].destroy();this.customHandles=null}};function mxEdgeHandler(a){null!=a&&null!=a.shape&&(this.state=a,this.init(),this.escapeHandler=mxUtils.bind(this,function(b,c){b=null!=this.index;this.reset();b&&this.graph.cellRenderer.redraw(this.state,!1,a.view.isRendering())}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}
mxEdgeHandler.prototype.graph=null;mxEdgeHandler.prototype.state=null;mxEdgeHandler.prototype.marker=null;mxEdgeHandler.prototype.constraintHandler=null;mxEdgeHandler.prototype.error=null;mxEdgeHandler.prototype.shape=null;mxEdgeHandler.prototype.bends=null;mxEdgeHandler.prototype.labelShape=null;mxEdgeHandler.prototype.cloneEnabled=!0;mxEdgeHandler.prototype.addEnabled=!1;mxEdgeHandler.prototype.removeEnabled=!1;mxEdgeHandler.prototype.dblClickRemoveEnabled=!1;
mxEdgeHandler.prototype.mergeRemoveEnabled=!1;mxEdgeHandler.prototype.straightRemoveEnabled=!1;mxEdgeHandler.prototype.virtualBendsEnabled=!1;mxEdgeHandler.prototype.virtualBendOpacity=20;mxEdgeHandler.prototype.parentHighlightEnabled=!1;mxEdgeHandler.prototype.preferHtml=!1;mxEdgeHandler.prototype.allowHandleBoundsCheck=!0;mxEdgeHandler.prototype.snapToTerminals=!1;mxEdgeHandler.prototype.handleImage=null;mxEdgeHandler.prototype.tolerance=0;mxEdgeHandler.prototype.outlineConnect=!1;
mxEdgeHandler.prototype.manageLabelHandle=!1;
mxEdgeHandler.prototype.init=function(){this.graph=this.state.view.graph;this.marker=this.createMarker();this.constraintHandler=new mxConstraintHandler(this.graph);this.points=[];this.abspoints=this.getSelectionPoints(this.state);this.shape=this.createSelectionShape(this.abspoints);this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;this.shape.init(this.graph.getView().getOverlayPane());this.shape.svgStrokeTolerance=0;this.shape.pointerEvents=
!1;mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state);this.graph.isCellMovable(this.state.cell)&&this.shape.setCursor(mxConstants.CURSOR_MOVABLE_EDGE);this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container;if(!this.preferHtml){var a=this.state.getVisibleTerminalState(!0);null!=a&&(this.preferHtml=null!=a.text&&a.text.node.parentNode==this.graph.container);this.preferHtml||(a=this.state.getVisibleTerminalState(!1),null!=a&&(this.preferHtml=null!=
a.text&&a.text.node.parentNode==this.graph.container))}this.graph.isCellEditable(this.state.cell)&&(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||0>=mxGraphHandler.prototype.maxCells)&&(this.bends=this.createBends(),this.isVirtualBendsEnabled()&&(this.virtualBends=this.createVirtualBends()));this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y);this.labelShape=this.createLabelHandleShape();this.initBend(this.labelShape);this.graph.isCellEditable(this.state.cell)&&
(this.labelShape.setCursor(mxConstants.CURSOR_LABEL_HANDLE),this.customHandles=this.createCustomHandles());this.updateParentHighlight();this.redraw()};mxEdgeHandler.prototype.isParentHighlightVisible=mxVertexHandler.prototype.isParentHighlightVisible;mxEdgeHandler.prototype.destroyParentHighlight=mxVertexHandler.prototype.destroyParentHighlight;mxEdgeHandler.prototype.updateParentHighlight=mxVertexHandler.prototype.updateParentHighlight;mxEdgeHandler.prototype.createCustomHandles=function(){return null};
mxEdgeHandler.prototype.isVirtualBendsEnabled=function(a){return this.virtualBendsEnabled&&(null==this.state.style[mxConstants.STYLE_EDGE]||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.NONE||1==this.state.style[mxConstants.STYLE_NOEDGESTYLE])&&"arrow"!=mxUtils.getValue(this.state.style,mxConstants.STYLE_SHAPE,null)};mxEdgeHandler.prototype.isCellEnabled=function(a){return!0};mxEdgeHandler.prototype.isAddPointEvent=function(a){return mxEvent.isShiftDown(a)};
mxEdgeHandler.prototype.isRemovePointEvent=function(a){return mxEvent.isShiftDown(a)};mxEdgeHandler.prototype.getSelectionPoints=function(a){return a.absolutePoints};mxEdgeHandler.prototype.createParentHighlightShape=function(a){a=new mxRectangleShape(mxRectangle.fromRectangle(a),null,this.getSelectionColor());a.strokewidth=this.getSelectionStrokeWidth();a.isDashed=this.isSelectionDashed();return a};
mxEdgeHandler.prototype.createSelectionShape=function(a){a=new this.state.shape.constructor;a.outline=!0;a.apply(this.state);a.isDashed=this.isSelectionDashed();a.stroke=this.getSelectionColor();a.isShadow=!1;return a};mxEdgeHandler.prototype.getSelectionColor=function(){return this.graph.isCellEditable(this.state.cell)?mxConstants.EDGE_SELECTION_COLOR:mxConstants.LOCKED_HANDLE_FILLCOLOR};mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH};
mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED};mxEdgeHandler.prototype.isConnectableCell=function(a){return!0};mxEdgeHandler.prototype.getCellAt=function(a,b){return this.outlineConnect?null:this.graph.getCellAt(a,b)};
mxEdgeHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph),b=this;a.getCell=function(c){var d=mxCellMarker.prototype.getCell.apply(this,arguments);d!=b.state.cell&&null!=d||null==b.currentPoint||(d=b.graph.getCellAt(b.currentPoint.x,b.currentPoint.y));if(null!=d&&!this.graph.isCellConnectable(d)){var e=this.graph.getModel().getParent(d);this.graph.getModel().isVertex(e)&&this.graph.isCellConnectable(e)&&(d=e)}e=b.graph.getModel();if(this.graph.isSwimlane(d)&&null!=b.currentPoint&&
this.graph.hitsSwimlaneContent(d,b.currentPoint.x,b.currentPoint.y)||!b.isConnectableCell(d)||d==b.state.cell||null!=d&&!b.graph.connectableEdges&&e.isEdge(d)||e.isAncestor(b.state.cell,d))d=null;this.graph.isCellConnectable(d)||(d=null);return d};a.isValidState=function(c){var d=b.graph.getModel();d=b.graph.view.getTerminalPort(c,b.graph.view.getState(d.getTerminal(b.state.cell,!b.isSource)),!b.isSource);d=null!=d?d.cell:null;b.error=b.validateConnection(b.isSource?c.cell:d,b.isSource?d:c.cell);
return null==b.error};return a};mxEdgeHandler.prototype.validateConnection=function(a,b){return this.graph.getEdgeValidationError(this.state.cell,a,b)};
mxEdgeHandler.prototype.createBends=function(){for(var a=this.state.cell,b=[],c=0;c<this.abspoints.length;c++)if(this.isHandleVisible(c)){var d=c==this.abspoints.length-1,e=0==c||d;(e||this.graph.isCellBendable(a))&&mxUtils.bind(this,function(f){var g=this.createHandleShape(f,null,f==this.abspoints.length-1);this.initBend(g,mxUtils.bind(this,mxUtils.bind(this,function(){this.dblClickRemoveEnabled&&this.removePoint(this.state,f)})));this.isHandleEnabled(c)&&g.setCursor(e?mxConstants.CURSOR_TERMINAL_HANDLE:
mxConstants.CURSOR_BEND_HANDLE);b.push(g);e||(this.points.push(new mxPoint(0,0)),g.node.style.visibility="hidden")})(c)}return b};mxEdgeHandler.prototype.createVirtualBends=function(){var a=[];if(this.graph.isCellBendable(this.state.cell))for(var b=1;b<this.abspoints.length;b++)mxUtils.bind(this,function(c){this.initBend(c);c.setCursor(mxConstants.CURSOR_VIRTUAL_BEND_HANDLE);a.push(c)})(this.createHandleShape());return a};mxEdgeHandler.prototype.isHandleEnabled=function(a){return!0};
mxEdgeHandler.prototype.isHandleVisible=function(a){var b=this.state.getVisibleTerminalState(!0),c=this.state.getVisibleTerminalState(!1),d=this.graph.getCellGeometry(this.state.cell);return(null!=d?this.graph.view.getEdgeStyle(this.state,d.points,b,c):null)!=mxEdgeStyle.EntityRelation||0==a||a==this.abspoints.length-1};
mxEdgeHandler.prototype.createHandleShape=function(a){if(null!=this.handleImage)return a=new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src),a.preserveImageAspect=!1,a;a=mxConstants.HANDLE_SIZE;this.preferHtml&&--a;return new mxRectangleShape(new mxRectangle(0,0,a,a),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};
mxEdgeHandler.prototype.createLabelHandleShape=function(){if(null!=this.labelHandleImage){var a=new mxImageShape(new mxRectangle(0,0,this.labelHandleImage.width,this.labelHandleImage.height),this.labelHandleImage.src);a.preserveImageAspect=!1;return a}a=mxConstants.LABEL_HANDLE_SIZE;return new mxRectangleShape(new mxRectangle(0,0,a,a),mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};
mxEdgeHandler.prototype.initBend=function(a,b){this.preferHtml?(a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane()));mxEvent.redirectMouseEvents(a.node,this.graph,this.state,null,null,null,b);mxClient.IS_TOUCH&&a.node.setAttribute("pointer-events","none")};
mxEdgeHandler.prototype.getHandleForEvent=function(a){var b=null;if(null!=this.state){var c=function(g){if(null!=g&&(a.isSource(g)||g.intersectsRectangle(e))){var k=a.getGraphX()-g.bounds.getCenterX();g=a.getGraphY()-g.bounds.getCenterY();k=k*k+g*g;if(null==f||k<=f)return f=k,!0}return!1},d=mxEvent.isMouseEvent(a.getEvent())?1:this.tolerance,e=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<d)?new mxRectangle(a.getGraphX()-d,a.getGraphY()-d,2*d,2*d):null,f=null;if(null!=this.customHandles&&this.isCustomHandleEvent(a))for(d=
this.customHandles.length-1;0<=d;d--)if(c(this.customHandles[d].shape))return mxEvent.CUSTOM_HANDLE-d;if(a.isSource(this.state.text)||c(this.labelShape))b=mxEvent.LABEL_HANDLE;if(null!=this.bends)for(d=0;d<this.bends.length;d++)c(this.bends[d])&&(b=d);if(null!=this.virtualBends&&this.isAddVirtualBendEvent(a))for(d=0;d<this.virtualBends.length;d++)c(this.virtualBends[d])&&(b=mxEvent.VIRTUAL_HANDLE-d)}return b};mxEdgeHandler.prototype.isAddVirtualBendEvent=function(a){return!0};
mxEdgeHandler.prototype.isCustomHandleEvent=function(a){return!0};
mxEdgeHandler.prototype.mouseDown=function(a,b){if(this.graph.isCellEditable(this.state.cell)){a=this.getHandleForEvent(b);if(null!=this.bends&&null!=this.bends[a]){var c=this.bends[a].bounds;this.snapPoint=new mxPoint(c.getCenterX(),c.getCenterY())}if(this.addEnabled&&null==a&&this.isAddPointEvent(b.getEvent()))this.addPoint(this.state,b.getEvent()),b.consume();else if(null!=a&&!b.isConsumed()&&this.graph.isEnabled()){if(this.removeEnabled&&this.isRemovePointEvent(b.getEvent()))this.removePoint(this.state,
a);else if(a!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(b.getCell()))a<=mxEvent.VIRTUAL_HANDLE&&mxUtils.setOpacity(this.virtualBends[mxEvent.VIRTUAL_HANDLE-a].node,100),this.start(b.getX(),b.getY(),a);b.consume()}}};
mxEdgeHandler.prototype.start=function(a,b,c){this.startX=a;this.startY=b;this.isSource=null==this.bends?!1:0==c;this.isTarget=null==this.bends?!1:c==this.bends.length-1;this.isLabel=c==mxEvent.LABEL_HANDLE;if(this.isSource||this.isTarget){if(a=this.state.cell,b=this.graph.model.getTerminal(a,this.isSource),null==b&&this.graph.isTerminalPointMovable(a,this.isSource)||null!=b&&this.graph.isCellDisconnectable(a,b,this.isSource))this.index=c}else this.index=c;if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>
mxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(c=0;c<this.customHandles.length;c++)c!=mxEvent.CUSTOM_HANDLE-this.index&&this.customHandles[c].setVisible(!1)};mxEdgeHandler.prototype.clonePreviewState=function(a,b){return this.state.clone()};mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return 2};mxEdgeHandler.prototype.updateHint=function(a,b){};mxEdgeHandler.prototype.removeHint=function(){};mxEdgeHandler.prototype.roundLength=function(a){return Math.round(a)};
mxEdgeHandler.prototype.isSnapToTerminalsEvent=function(a){return this.snapToTerminals&&!mxEvent.isAltDown(a.getEvent())};
mxEdgeHandler.prototype.getPointForEvent=function(a){var b=this.graph.getView(),c=b.scale,d=new mxPoint(this.roundLength(a.getGraphX()/c)*c,this.roundLength(a.getGraphY()/c)*c),e=this.getSnapToTerminalTolerance(),f=!1,g=!1;if(0<e&&this.isSnapToTerminalsEvent(a)){var k=function(n){null!=n&&l.call(this,new mxPoint(b.getRoutingCenterX(n),b.getRoutingCenterY(n)))},l=function(n){if(null!=n){var p=n.x;Math.abs(d.x-p)<e&&(d.x=p,f=!0);n=n.y;Math.abs(d.y-n)<e&&(d.y=n,g=!0)}};k.call(this,this.state.getVisibleTerminalState(!0));
k.call(this,this.state.getVisibleTerminalState(!1));k=this.state.absolutePoints;if(null!=k)for(var m=0;m<k.length;m++)(0<m||!this.state.isFloatingTerminalPoint(!0))&&(m<k.length-1||!this.state.isFloatingTerminalPoint(!1))&&l.call(this,this.state.absolutePoints[m])}this.graph.isGridEnabledEvent(a.getEvent())&&(a=b.translate,f||(d.x=(this.graph.snap(d.x/c-a.x)+a.x)*c),g||(d.y=(this.graph.snap(d.y/c-a.y)+a.y)*c));return d};
mxEdgeHandler.prototype.getPreviewTerminalState=function(a){this.constraintHandler.update(a,this.isSource,!0,a.isSource(this.marker.highlight.shape)?null:this.currentPoint);if(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint)return null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",
this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent"),a=this.graph.getModel(),a=this.graph.view.getTerminalPort(this.state,this.graph.view.getState(a.getTerminal(this.state.cell,!this.isSource)),!this.isSource),a=null!=a?a.cell:null,this.error=this.validateConnection(this.isSource?this.constraintHandler.currentFocus.cell:a,this.isSource?a:this.constraintHandler.currentFocus.cell),a=null,null==this.error&&(a=this.constraintHandler.currentFocus),
(null!=this.error||null!=a&&!this.isCellEnabled(a.cell))&&this.constraintHandler.reset(),a;if(this.graph.isIgnoreTerminalEvent(a.getEvent()))return this.marker.reset(),null;this.marker.process(a);a=this.marker.getValidState();null==a||this.isCellEnabled(a.cell)||(this.constraintHandler.reset(),this.marker.reset());return this.marker.getValidState()};
mxEdgeHandler.prototype.getPreviewPoints=function(a,b){var c=this.graph.getCellGeometry(this.state.cell);c=null!=c.points?c.points.slice():null;var d=new mxPoint(a.x,a.y),e=null;if(this.isSource||this.isTarget)this.graph.resetEdgesOnConnect&&(c=null);else if(this.convertPoint(d,!1),null==c)c=[d];else{this.index<=mxEvent.VIRTUAL_HANDLE&&c.splice(mxEvent.VIRTUAL_HANDLE-this.index,0,d);if(!this.isSource&&!this.isTarget){for(var f=0;f<this.bends.length;f++)if(f!=this.index){var g=this.bends[f];null!=
g&&mxUtils.contains(g.bounds,a.x,a.y)&&(this.index<=mxEvent.VIRTUAL_HANDLE?c.splice(mxEvent.VIRTUAL_HANDLE-this.index,1):c.splice(this.index-1,1),e=c)}if(null==e&&this.straightRemoveEnabled&&(null==b||!mxEvent.isAltDown(b.getEvent()))){b=this.graph.tolerance*this.graph.tolerance;f=this.state.absolutePoints.slice();f[this.index]=a;var k=this.state.getVisibleTerminalState(!0);null!=k&&(g=this.graph.getConnectionConstraint(this.state,k,!0),null==g||null==this.graph.getConnectionPoint(k,g))&&(f[0]=new mxPoint(k.view.getRoutingCenterX(k),
k.view.getRoutingCenterY(k)));k=this.state.getVisibleTerminalState(!1);null!=k&&(g=this.graph.getConnectionConstraint(this.state,k,!1),null==g||null==this.graph.getConnectionPoint(k,g))&&(f[f.length-1]=new mxPoint(k.view.getRoutingCenterX(k),k.view.getRoutingCenterY(k)));g=this.index;0<g&&g<f.length-1&&mxUtils.ptSegDistSq(f[g-1].x,f[g-1].y,f[g+1].x,f[g+1].y,a.x,a.y)<b&&(c.splice(g-1,1),e=c)}}null==e&&this.index>mxEvent.VIRTUAL_HANDLE&&(c[this.index-1]=d)}return null!=e?e:c};
mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){if(mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent()))return!1;var b=mxUtils.getOffset(this.graph.container),c=a.getEvent(),d=mxEvent.getClientX(c);c=mxEvent.getClientY(c);var e=document.documentElement,f=this.currentPoint.x-this.graph.container.scrollLeft+b.x-((window.pageXOffset||e.scrollLeft)-(e.clientLeft||0));b=this.currentPoint.y-this.graph.container.scrollTop+b.y-((window.pageYOffset||e.scrollTop)-(e.clientTop||0));return this.outlineConnect&&
(mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())||a.isSource(this.marker.highlight.shape)||!mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent())&&null!=a.getState()||this.marker.highlight.isHighlightAt(d,c)||(f!=d||b!=c)&&null==a.getState()&&this.marker.highlight.isHighlightAt(f,b))};
mxEdgeHandler.prototype.updatePreviewState=function(a,b,c,d,e){var f=this.isSource?c:this.state.getVisibleTerminalState(!0),g=this.isTarget?c:this.state.getVisibleTerminalState(!1),k=this.graph.getConnectionConstraint(a,f,!0),l=this.graph.getConnectionConstraint(a,g,!1),m=this.constraintHandler.currentConstraint;null==m&&e&&(null!=c?(d.isSource(this.marker.highlight.shape)&&(b=new mxPoint(d.getGraphX(),d.getGraphY())),m=this.graph.getOutlineConstraint(b,c,d),this.constraintHandler.setFocus(d,c,this.isSource),
this.constraintHandler.currentConstraint=m,this.constraintHandler.currentPoint=b):m=new mxConnectionConstraint);if(this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var n=this.graph.view.scale;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=e?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/n/n,this.marker.highlight.repaint()):
this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.graph.isCellConnectable(d.getCell())&&this.marker.getValidState()!=d.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/n/n,this.marker.highlight.repaint())}this.isSource?k=m:this.isTarget&&(l=m);if(this.isSource||this.isTarget)null!=m&&null!=m.point?(a.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=m.point.x,a.style[this.isSource?
mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=m.point.y):(delete a.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete a.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]);a.setVisibleTerminalState(f,!0);a.setVisibleTerminalState(g,!1);this.isSource&&null==f||a.view.updateFixedTerminalPoint(a,f,!0,k);this.isTarget&&null==g||a.view.updateFixedTerminalPoint(a,g,!1,l);(this.isSource||this.isTarget)&&null==c&&(a.setAbsoluteTerminalPoint(b,this.isSource),
null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:""));a.view.updatePoints(a,this.points,f,g);a.view.updateFloatingTerminalPoints(a,f,g)};
mxEdgeHandler.prototype.mouseMove=function(a,b){if(null!=this.index&&null!=this.marker){this.currentPoint=this.getPointForEvent(b);this.error=null;null!=this.snapPoint&&mxEvent.isShiftDown(b.getEvent())&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&null==this.constraintHandler.currentFocus&&this.constraintHandler.currentFocus!=this.state&&(Math.abs(this.snapPoint.x-this.currentPoint.x)<Math.abs(this.snapPoint.y-this.currentPoint.y)?this.currentPoint.x=this.snapPoint.x:this.currentPoint.y=this.snapPoint.y);
if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE)null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(b),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged(),null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="none"));else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,b);a=this.isSource||this.isTarget?this.getPreviewTerminalState(b):
null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint)this.currentPoint=this.constraintHandler.currentPoint.clone();else if(this.outlineConnect){var c=this.isSource||this.isTarget?this.isOutlineConnectEvent(b):!1;c?a=this.marker.highlight.state:null!=a&&a!=b.getState()&&this.graph.isCellConnectable(b.getCell())&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),
a=null)}null==a||this.isCellEnabled(a.cell)||(a=null,this.marker.reset());var d=this.clonePreviewState(this.currentPoint,null!=a?a.cell:null);this.updatePreviewState(d,this.currentPoint,a,b,c);this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor);this.abspoints=d.absolutePoints;this.active=!0;this.updateHint(b,this.currentPoint)}this.drawPreview();mxEvent.consume(b.getEvent());b.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(b)&&b.consume(!1)};
mxEdgeHandler.prototype.mouseUp=function(a,b){if(null!=this.index&&null!=this.marker){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="");a=this.state.cell;var c=this.index;this.index=null;if(b.getX()!=this.startX||b.getY()!=this.startY){var d=!this.graph.isIgnoreTerminalEvent(b.getEvent())&&this.graph.isCloneEvent(b.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(c<=mxEvent.CUSTOM_HANDLE&&
c>mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){var e=this.graph.getModel();e.beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-c].execute(b),null!=this.shape&&null!=this.shape.node&&(this.shape.apply(this.state),this.shape.redraw())}finally{e.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget)if(c=null,null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(c=this.constraintHandler.currentFocus.cell),
null==c&&this.marker.hasValidState()&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&&"white"!=this.marker.highlight.shape.stroke&&(c=this.marker.validState.cell),null!=c){e=this.graph.getModel();var f=e.getParent(a);e.beginUpdate();try{if(d){var g=e.getGeometry(a);d=this.graph.cloneCell(a);e.add(f,d,e.getChildCount(f));null!=g&&(g=g.clone(),e.setGeometry(d,g));var k=e.getTerminal(a,!this.isSource);this.graph.connectCell(d,k,!this.isSource);
a=d}a=this.connect(a,c,this.isSource,d,b)}finally{e.endUpdate()}}else this.graph.isAllowDanglingEdges()&&(g=this.abspoints[this.isSource?0:this.abspoints.length-1],g.x=this.roundLength(g.x/this.graph.view.scale-this.graph.view.translate.x),g.y=this.roundLength(g.y/this.graph.view.scale-this.graph.view.translate.y),k=this.graph.getView().getState(this.graph.getModel().getParent(a)),null!=k&&(g.x-=k.origin.x,g.y-=k.origin.y),g.x-=this.graph.panDx/this.graph.view.scale,g.y-=this.graph.panDy/this.graph.view.scale,
a=this.changeTerminalPoint(a,g,this.isSource,d));else this.active?a=this.changePoints(a,this.points,d):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}else this.graph.isToggleEvent(b.getEvent())&&this.graph.selectCellForEvent(this.state.cell,b.getEvent());null!=this.marker&&(this.reset(),a!=this.state.cell&&this.graph.setSelectionCell(a));b.consume()}};
mxEdgeHandler.prototype.reset=function(){this.active&&this.refresh();this.snapPoint=this.points=this.label=this.index=this.error=null;this.active=this.isTarget=this.isSource=this.isLabel=!1;if(this.livePreview&&null!=this.sizers)for(var a=0;a<this.sizers.length;a++)null!=this.sizers[a]&&(this.sizers[a].node.style.display="");null!=this.marker&&this.marker.reset();null!=this.constraintHandler&&this.constraintHandler.reset();if(null!=this.customHandles)for(a=0;a<this.customHandles.length;a++)this.customHandles[a].reset();
this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR);this.removeHint();this.redraw()};mxEdgeHandler.prototype.setPreviewColor=function(a){null!=this.shape&&(this.shape.stroke=a)};
mxEdgeHandler.prototype.convertPoint=function(a,b){var c=this.graph.getView().getScale(),d=this.graph.getView().getTranslate();b&&(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));a.x=Math.round(a.x/c-d.x);a.y=Math.round(a.y/c-d.y);b=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell));null!=b&&(a.x-=b.origin.x,a.y-=b.origin.y);return a};
mxEdgeHandler.prototype.moveLabel=function(a,b,c){var d=this.graph.getModel(),e=d.getGeometry(a.cell);if(null!=e){var f=this.graph.getView().scale;e=e.clone();if(e.relative){var g=this.graph.getView().getRelativePoint(a,b,c);e.x=Math.round(1E4*g.x)/1E4;e.y=Math.round(g.y);e.offset=new mxPoint(0,0);g=this.graph.view.getPoint(a,e);e.offset=new mxPoint(Math.round((b-g.x)/f),Math.round((c-g.y)/f))}else{var k=a.absolutePoints;g=k[0];k=k[k.length-1];null!=g&&null!=k&&(e.offset=new mxPoint(Math.round((b-
(g.x+(k.x-g.x)/2))/f),Math.round((c-(g.y+(k.y-g.y)/2))/f)),e.x=0,e.y=0)}d.setGeometry(a.cell,e)}};mxEdgeHandler.prototype.connect=function(a,b,c,d,e){d=this.graph.getModel();d.getParent(a);d.beginUpdate();try{var f=this.constraintHandler.currentConstraint;null==f&&(f=new mxConnectionConstraint);this.graph.connectCell(a,b,c,f)}finally{d.endUpdate()}return a};
mxEdgeHandler.prototype.changeTerminalPoint=function(a,b,c,d){var e=this.graph.getModel();e.beginUpdate();try{if(d){var f=e.getParent(a),g=e.getTerminal(a,!c);a=this.graph.cloneCell(a);e.add(f,a,e.getChildCount(f));e.setTerminal(a,g,!c)}var k=e.getGeometry(a);null!=k&&(k=k.clone(),k.setTerminalPoint(b,c),e.setGeometry(a,k),this.graph.connectCell(a,null,c,new mxConnectionConstraint))}finally{e.endUpdate()}return a};
mxEdgeHandler.prototype.changePoints=function(a,b,c){var d=this.graph.getModel();d.beginUpdate();try{if(c){var e=d.getParent(a),f=d.getTerminal(a,!0),g=d.getTerminal(a,!1);a=this.graph.cloneCell(a);d.add(e,a,d.getChildCount(e));d.setTerminal(a,f,!0);d.setTerminal(a,g,!1)}var k=d.getGeometry(a);null!=k&&(k=k.clone(),k.points=b,d.setGeometry(a,k))}finally{d.endUpdate()}return a};
mxEdgeHandler.prototype.addPoint=function(a,b){var c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),d=this.graph.isGridEnabledEvent(b);this.convertPoint(c,d);this.addPointAt(a,c.x,c.y);mxEvent.consume(b)};
mxEdgeHandler.prototype.addPointAt=function(a,b,c){var d=this.graph.getCellGeometry(a.cell);b=new mxPoint(b,c);if(null!=d){d=d.clone();var e=this.graph.view.translate;c=this.graph.view.scale;e=new mxPoint(e.x*c,e.y*c);var f=this.graph.model.getParent(this.state.cell);this.graph.model.isVertex(f)&&(e=this.graph.view.getState(f),e=new mxPoint(e.x,e.y));c=mxUtils.findNearestSegment(a,b.x*c+e.x,b.y*c+e.y);null==d.points?d.points=[b]:d.points.splice(c,0,b);this.graph.getModel().setGeometry(a.cell,d);this.refresh();
this.redraw()}};mxEdgeHandler.prototype.removePoint=function(a,b){if(0<b&&b<this.abspoints.length-1){var c=this.graph.getCellGeometry(this.state.cell);null!=c&&null!=c.points&&(c=c.clone(),c.points.splice(b-1,1),this.graph.getModel().setGeometry(a.cell,c),this.refresh(),this.redraw())}};
mxEdgeHandler.prototype.getHandleFillColor=function(a){a=0==a;var b=this.state.cell,c=this.graph.getModel().getTerminal(b,a),d=mxConstants.HANDLE_FILLCOLOR;null!=c&&!this.graph.isCellDisconnectable(b,c,a)||null==c&&!this.graph.isTerminalPointMovable(b,a)?d=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=c&&this.graph.isCellDisconnectable(b,c,a)&&(d=mxConstants.CONNECT_HANDLE_FILLCOLOR);return d};
mxEdgeHandler.prototype.redraw=function(a){if(null!=this.state){this.abspoints=this.state.absolutePoints.slice();var b=this.graph.getModel().getGeometry(this.state.cell);if(null!=b&&(b=b.points,null!=this.bends&&0<this.bends.length&&null!=b)){null==this.points&&(this.points=[]);for(var c=1;c<this.bends.length-1;c++)null!=this.bends[c]&&null!=this.abspoints[c]&&(this.points[c-1]=b[c-1])}this.drawPreview();a||this.redrawHandles()}};
mxEdgeHandler.prototype.redrawHandles=function(){var a=this.state.cell,b=this.labelShape.bounds;this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y);this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-b.width/2),Math.round(this.label.y-b.height/2),b.width,b.height);b=this.graph.getLabel(a);this.labelShape.visible=null!=b&&0<b.length&&this.graph.isCellEditable(this.state.cell)&&this.graph.isLabelMovable(a);if(null!=this.bends&&0<this.bends.length){var c=this.abspoints.length-
1;a=this.abspoints[0];var d=a.x,e=a.y;b=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.floor(d-b.width/2),Math.floor(e-b.height/2),b.width,b.height);this.bends[0].fill=this.getHandleFillColor(0);this.bends[0].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);c=this.abspoints[c];d=c.x;e=c.y;var f=this.bends.length-1;b=this.bends[f].bounds;this.bends[f].bounds=new mxRectangle(Math.floor(d-b.width/2),Math.floor(e-b.height/2),b.width,b.height);this.bends[f].fill=
this.getHandleFillColor(f);this.bends[f].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[f].bounds);this.redrawInnerBends(a,c)}if(null!=this.abspoints&&null!=this.virtualBends&&0<this.virtualBends.length)for(c=this.abspoints[0],a=0;a<this.virtualBends.length;a++)null!=this.virtualBends[a]&&null!=this.abspoints[a+1]&&(d=this.abspoints[a+1],b=this.virtualBends[a],b.bounds=new mxRectangle(Math.floor(c.x+(d.x-c.x)/2-b.bounds.width/2),Math.floor(c.y+(d.y-c.y)/2-b.bounds.height/2),b.bounds.width,
b.bounds.height),b.redraw(),mxUtils.setOpacity(b.node,this.virtualBendOpacity),c=d,this.manageLabelHandle&&this.checkLabelHandle(b.bounds));null!=this.labelShape&&this.labelShape.redraw();if(null!=this.customHandles)for(a=0;a<this.customHandles.length;a++)b=this.customHandles[a].shape.node.style.display,this.customHandles[a].redraw(),this.customHandles[a].shape.node.style.display=b,this.customHandles[a].shape.node.style.visibility=this.isCustomHandleVisible(this.customHandles[a])?"":"hidden"};
mxEdgeHandler.prototype.isCustomHandleVisible=function(a){return!this.graph.isEditing()&&1==this.state.view.graph.getSelectionCount()};
mxEdgeHandler.prototype.setHandlesVisible=function(a){if(null!=this.bends)for(var b=0;b<this.bends.length;b++)this.bends[b].node.style.display=a?"":"none";if(null!=this.virtualBends)for(b=0;b<this.virtualBends.length;b++)this.virtualBends[b].node.style.display=a?"":"none";null!=this.labelShape&&(this.labelShape.node.style.display=a?"":"none");if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)this.customHandles[b].setVisible(a)};
mxEdgeHandler.prototype.redrawInnerBends=function(a,b){for(a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){b=this.abspoints[a].x;var c=this.abspoints[a].y,d=this.bends[a].bounds;this.bends[a].node.style.visibility="visible";this.bends[a].bounds=new mxRectangle(Math.round(b-d.width/2),Math.round(c-d.height/2),d.width,d.height);this.manageLabelHandle?this.checkLabelHandle(this.bends[a].bounds):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(this.bends[a].bounds,
this.labelShape.bounds)&&(w=mxConstants.HANDLE_SIZE+3,h=mxConstants.HANDLE_SIZE+3,this.bends[a].bounds=new mxRectangle(Math.round(b-w/2),Math.round(c-h/2),w,h));this.bends[a].redraw()}else this.bends[a].destroy(),this.bends[a]=null};mxEdgeHandler.prototype.checkLabelHandle=function(a){if(null!=this.labelShape){var b=this.labelShape.bounds;mxUtils.intersects(a,b)&&(a.getCenterY()<b.getCenterY()?b.y=a.y+a.height:b.y=a.y-b.height)}};
mxEdgeHandler.prototype.drawPreview=function(){try{if(this.isLabel){var a=this.labelShape.bounds,b=new mxRectangle(Math.round(this.label.x-a.width/2),Math.round(this.label.y-a.height/2),a.width,a.height);this.labelShape.bounds.equals(b)||(this.labelShape.bounds=b,this.labelShape.redraw())}null==this.shape||mxUtils.equalPoints(this.shape.points,this.abspoints)||(this.shape.apply(this.state),this.shape.points=this.abspoints.slice(),this.shape.scale=this.state.view.scale,this.shape.isDashed=this.isSelectionDashed(),
this.shape.stroke=this.getSelectionColor(),this.shape.strokewidth=this.getSelectionStrokeWidth()/this.shape.scale/this.shape.scale,this.shape.isShadow=!1,this.shape.redraw());this.updateParentHighlight()}catch(c){}};
mxEdgeHandler.prototype.refresh=function(){null!=this.state&&(this.abspoints=this.getSelectionPoints(this.state),this.points=[],null!=this.bends&&(this.destroyBends(this.bends),this.bends=this.createBends()),null!=this.virtualBends&&(this.destroyBends(this.virtualBends),this.virtualBends=this.createVirtualBends()),null!=this.customHandles&&(this.destroyBends(this.customHandles),this.customHandles=this.createCustomHandles()),null!=this.labelShape&&null!=this.labelShape.node&&null!=this.labelShape.node.parentNode&&
this.labelShape.node.parentNode.appendChild(this.labelShape.node))};mxEdgeHandler.prototype.isDestroyed=function(){return null==this.shape};mxEdgeHandler.prototype.destroyBends=function(a){if(null!=a)for(var b=0;b<a.length;b++)null!=a[b]&&a[b].destroy()};
mxEdgeHandler.prototype.destroy=function(){null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.marker&&(this.marker.destroy(),this.marker=null);null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null);null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null);null!=this.parentHighlight&&this.destroyParentHighlight();this.destroyBends(this.virtualBends);
this.virtualBends=null;this.destroyBends(this.customHandles);this.customHandles=null;this.destroyBends(this.bends);this.bends=null;this.removeHint()};function mxElbowEdgeHandler(a){mxEdgeHandler.call(this,a)}mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler);mxElbowEdgeHandler.prototype.flipEnabled=!0;mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"";
mxElbowEdgeHandler.prototype.createBends=function(){var a=[],b=this.createHandleShape(0);this.initBend(b);b.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(b);a.push(this.createVirtualBend(mxUtils.bind(this,function(c){!mxEvent.isConsumed(c)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,c),mxEvent.consume(c))})));this.points.push(new mxPoint(0,0));b=this.createHandleShape(2,null,!0);this.initBend(b);b.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(b);return a};
mxElbowEdgeHandler.prototype.createVirtualBend=function(a){var b=this.createHandleShape();this.initBend(b,a);b.setCursor(this.getCursorForBend());this.graph.isCellBendable(this.state.cell)||(b.node.style.display="none");return b};
mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"};
mxElbowEdgeHandler.prototype.getTooltipForNode=function(a){var b=null;null==this.bends||null==this.bends[1]||a!=this.bends[1].node&&a.parentNode!=this.bends[1].node||(b=this.doubleClickOrientationResource,b=mxResources.get(b)||b);return b};
mxElbowEdgeHandler.prototype.convertPoint=function(a,b){var c=this.graph.getView().getScale(),d=this.graph.getView().getTranslate(),e=this.state.origin;b&&(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));a.x=Math.round(a.x/c-d.x-e.x);a.y=Math.round(a.y/c-d.y-e.y);return a};
mxElbowEdgeHandler.prototype.redrawInnerBends=function(a,b){var c=this.graph.getModel().getGeometry(this.state.cell),d=this.state.absolutePoints,e=null;1<d.length?(a=d[1],b=d[d.length-2]):null!=c.points&&0<c.points.length&&(e=d[0]);e=null==e?new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2):new mxPoint(this.graph.getView().scale*(e.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(e.y+this.graph.getView().translate.y+this.state.origin.y));b=this.bends[1].bounds;a=b.width;
b=b.height;a=new mxRectangle(Math.round(e.x-a/2),Math.round(e.y-b/2),a,b);this.manageLabelHandle?this.checkLabelHandle(a):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(a,this.labelShape.bounds)&&(a=mxConstants.HANDLE_SIZE+3,b=mxConstants.HANDLE_SIZE+3,a=new mxRectangle(Math.floor(e.x-a/2),Math.floor(e.y-b/2),a,b));this.bends[1].bounds=a;this.bends[1].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)};
function mxEdgeSegmentHandler(a){mxEdgeHandler.call(this,a)}mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler);
mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var a=this.state.absolutePoints;if(null!=a){var b=Math.max(1,this.graph.view.scale);if(2==a.length||3==a.length&&(Math.abs(a[0].x-a[1].x)<b&&Math.abs(a[1].x-a[2].x)<b||Math.abs(a[0].y-a[1].y)<b&&Math.abs(a[1].y-a[2].y)<b)){b=a[0].x+(a[a.length-1].x-a[0].x)/2;var c=a[0].y+(a[a.length-1].y-a[0].y)/2;a=[a[0],new mxPoint(b,c),new mxPoint(b,c),a[a.length-1]]}}return a};
mxEdgeSegmentHandler.prototype.getPreviewPoints=function(a){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);var b=this.getCurrentPoints(),c=this.convertPoint(b[0].clone(),!1);a=this.convertPoint(a.clone(),!1);for(var d=[],e=1;e<b.length;e++){var f=this.convertPoint(b[e].clone(),!1);e==this.index&&(0==Math.round(c.x-f.x)&&(c.x=a.x,f.x=a.x),0==Math.round(c.y-f.y)&&(c.y=a.y,f.y=a.y));e<b.length-1&&d.push(f);c=f}if(1==d.length){b=this.state.getVisibleTerminalState(!0);
c=this.state.getVisibleTerminalState(!1);f=this.state.view.getScale();var g=this.state.view.getTranslate();e=d[0].x*f+g.x;f=d[0].y*f+g.y;if(null!=b&&mxUtils.contains(b,e,f)||null!=c&&mxUtils.contains(c,e,f))d=[a,a]}return d};
mxEdgeSegmentHandler.prototype.updatePreviewState=function(a,b,c,d){mxEdgeHandler.prototype.updatePreviewState.apply(this,arguments);if(!this.isSource&&!this.isTarget){b=this.convertPoint(b.clone(),!1);for(var e=a.absolutePoints,f=e[0],g=e[1],k=[],l=2;l<e.length;l++){var m=e[l];0==Math.round(f.x-g.x)&&0==Math.round(g.x-m.x)||0==Math.round(f.y-g.y)&&0==Math.round(g.y-m.y)||k.push(this.convertPoint(g.clone(),!1));f=g;g=m}f=this.state.getVisibleTerminalState(!0);g=this.state.getVisibleTerminalState(!1);
l=this.state.absolutePoints;if(0==k.length&&(0==Math.round(e[0].x-e[e.length-1].x)||0==Math.round(e[0].y-e[e.length-1].y)))k=[b,b];else if(5==e.length&&2==k.length&&null!=f&&null!=g&&null!=l&&0==Math.round(l[0].x-l[l.length-1].x)){k=this.graph.getView();l=k.getScale();m=k.getTranslate();e=k.getRoutingCenterY(f)/l-m.y;var n=this.graph.getConnectionConstraint(a,f,!0);null!=n&&(n=this.graph.getConnectionPoint(f,n),null!=n&&(this.convertPoint(n,!1),e=n.y));k=k.getRoutingCenterY(g)/l-m.y;if(l=this.graph.getConnectionConstraint(a,
g,!1))n=this.graph.getConnectionPoint(g,l),null!=n&&(this.convertPoint(n,!1),k=n.y);k=[new mxPoint(b.x,e),new mxPoint(b.x,k)]}this.points=k;a.view.updateFixedTerminalPoints(a,f,g);a.view.updatePoints(a,this.points,f,g);a.view.updateFloatingTerminalPoints(a,f,g)}};
mxEdgeSegmentHandler.prototype.connect=function(a,b,c,d,e){var f=this.graph.getModel(),g=f.getGeometry(a),k=null;if(null!=g&&null!=g.points&&0<g.points.length){var l=this.abspoints,m=l[0],n=l[1];k=[];for(var p=2;p<l.length;p++){var r=l[p];0==Math.round(m.x-n.x)&&0==Math.round(n.x-r.x)||0==Math.round(m.y-n.y)&&0==Math.round(n.y-r.y)||k.push(this.convertPoint(n.clone(),!1));m=n;n=r}}f.beginUpdate();try{null!=k&&(g=f.getGeometry(a),null!=g&&(g=g.clone(),g.points=k,f.setGeometry(a,g))),a=mxEdgeHandler.prototype.connect.apply(this,
arguments)}finally{f.endUpdate()}return a};mxEdgeSegmentHandler.prototype.getTooltipForNode=function(a){return null};mxEdgeSegmentHandler.prototype.start=function(a,b,c){mxEdgeHandler.prototype.start.apply(this,arguments);null==this.bends||null==this.bends[c]||this.isSource||this.isTarget||mxUtils.setOpacity(this.bends[c].node,100)};
mxEdgeSegmentHandler.prototype.createBends=function(){var a=[],b=this.createHandleShape(0);this.initBend(b);b.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(b);var c=this.getCurrentPoints();if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var d=0;d<c.length-1;d++){b=this.createVirtualBend();a.push(b);var e=0==Math.round(c[d].x-c[d+1].x);0==Math.round(c[d].y-c[d+1].y)&&d<c.length-2&&(e=0==Math.round(c[d].x-c[d+2].x));b.setCursor(e?"col-resize":"row-resize");
this.points.push(new mxPoint(0,0))}}b=this.createHandleShape(c.length,null,!0);this.initBend(b);b.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(b);return a};mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh();mxEdgeHandler.prototype.redraw.apply(this,arguments)};
mxEdgeSegmentHandler.prototype.redrawInnerBends=function(a,b){if(this.graph.isCellBendable(this.state.cell)){var c=this.getCurrentPoints();if(null!=c&&1<c.length){var d=!1;if(4==c.length&&0==Math.round(c[1].x-c[2].x)&&0==Math.round(c[1].y-c[2].y))if(d=!0,0==Math.round(c[0].y-c[c.length-1].y)){var e=c[0].x+(c[c.length-1].x-c[0].x)/2;c[1]=new mxPoint(e,c[1].y);c[2]=new mxPoint(e,c[2].y)}else e=c[0].y+(c[c.length-1].y-c[0].y)/2,c[1]=new mxPoint(c[1].x,e),c[2]=new mxPoint(c[2].x,e);for(e=0;e<c.length-
1;e++)null!=this.bends[e+1]&&(a=c[e],b=c[e+1],a=new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2),b=this.bends[e+1].bounds,this.bends[e+1].bounds=new mxRectangle(Math.floor(a.x-b.width/2),Math.floor(a.y-b.height/2),b.width,b.height),this.bends[e+1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[e+1].bounds));d&&(mxUtils.setOpacity(this.bends[1].node,this.virtualBendOpacity),mxUtils.setOpacity(this.bends[3].node,this.virtualBendOpacity))}}};
function mxKeyHandler(a,b){null!=a&&(this.graph=a,this.target=b||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],this.keydownHandler=mxUtils.bind(this,function(c){this.keyDown(c)}),mxEvent.addListener(this.target,"keydown",this.keydownHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxKeyHandler.prototype.graph=null;mxKeyHandler.prototype.target=null;
mxKeyHandler.prototype.normalKeys=null;mxKeyHandler.prototype.shiftKeys=null;mxKeyHandler.prototype.controlKeys=null;mxKeyHandler.prototype.controlShiftKeys=null;mxKeyHandler.prototype.enabled=!0;mxKeyHandler.prototype.isEnabled=function(){return this.enabled};mxKeyHandler.prototype.setEnabled=function(a){this.enabled=a};mxKeyHandler.prototype.bindKey=function(a,b){this.normalKeys[a]=b};mxKeyHandler.prototype.bindShiftKey=function(a,b){this.shiftKeys[a]=b};
mxKeyHandler.prototype.bindControlKey=function(a,b){this.controlKeys[a]=b};mxKeyHandler.prototype.bindControlShiftKey=function(a,b){this.controlShiftKeys[a]=b};mxKeyHandler.prototype.isControlDown=function(a){return mxEvent.isControlDown(a)};mxKeyHandler.prototype.getFunction=function(a){return null==a||mxEvent.isAltDown(a)?null:this.isControlDown(a)?mxEvent.isShiftDown(a)?this.controlShiftKeys[a.keyCode]:this.controlKeys[a.keyCode]:mxEvent.isShiftDown(a)?this.shiftKeys[a.keyCode]:this.normalKeys[a.keyCode]};
mxKeyHandler.prototype.isGraphEvent=function(a){var b=mxEvent.getSource(a);return b==this.target||b.parentNode==this.target||null!=this.graph.cellEditor&&this.graph.cellEditor.isEventSource(a)?!0:mxUtils.isAncestorNode(this.graph.container,b)};mxKeyHandler.prototype.keyDown=function(a){if(this.isEnabledForEvent(a))if(27==a.keyCode)this.escape(a);else if(!this.isEventIgnored(a)){var b=this.getFunction(a);null!=b&&(b(a),mxEvent.consume(a))}};
mxKeyHandler.prototype.isEnabledForEvent=function(a){return this.graph.isEnabled()&&!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()};mxKeyHandler.prototype.isEventIgnored=function(a){return this.graph.isEditing()};mxKeyHandler.prototype.escape=function(a){this.graph.isEscapeEnabled()&&this.graph.escape(a)};
mxKeyHandler.prototype.destroy=function(){null!=this.target&&null!=this.keydownHandler&&(mxEvent.removeListener(this.target,"keydown",this.keydownHandler),this.keydownHandler=null);this.target=null};function mxTooltipHandler(a,b){null!=a&&(this.graph=a,this.delay=b||500,this.graph.addMouseListener(this))}mxTooltipHandler.prototype.zIndex=10005;mxTooltipHandler.prototype.graph=null;mxTooltipHandler.prototype.delay=null;mxTooltipHandler.prototype.ignoreTouchEvents=!0;
mxTooltipHandler.prototype.hideOnHover=!1;mxTooltipHandler.prototype.destroyed=!1;mxTooltipHandler.prototype.enabled=!0;mxTooltipHandler.prototype.isEnabled=function(){return this.enabled};mxTooltipHandler.prototype.setEnabled=function(a){this.enabled=a};mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover};mxTooltipHandler.prototype.setHideOnHover=function(a){this.hideOnHover=a};
mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",document.body.appendChild(this.div),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(a){"A"!=mxEvent.getSource(a).nodeName&&this.hideTooltip()})))};mxTooltipHandler.prototype.getStateForEvent=function(a){return a.getState()};mxTooltipHandler.prototype.mouseDown=function(a,b){this.reset(b,!1);this.hideTooltip()};
mxTooltipHandler.prototype.mouseMove=function(a,b){if(b.getX()!=this.lastX||b.getY()!=this.lastY)this.reset(b,!0),a=this.getStateForEvent(b),(this.isHideOnHover()||a!=this.state||b.getSource()!=this.node&&(!this.stateSource||null!=a&&this.stateSource==(b.isSource(a.shape)||!b.isSource(a.text))))&&this.hideTooltip();this.lastX=b.getX();this.lastY=b.getY()};mxTooltipHandler.prototype.mouseUp=function(a,b){this.reset(b,!0);this.hideTooltip()};
mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)};
mxTooltipHandler.prototype.reset=function(a,b,c){if(!this.ignoreTouchEvents||mxEvent.isMouseEvent(a.getEvent()))if(this.resetTimer(),c=null!=c?c:this.getStateForEvent(a),b&&this.isEnabled()&&null!=c&&(null==this.div||"hidden"==this.div.style.visibility)){var d=a.getSource(),e=a.getX(),f=a.getY(),g=a.isSource(c.shape)||a.isSource(c.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.popupMenuHandler.isMenuShowing()&&!this.graph.isMouseDown){var k=
this.graph.getTooltip(c,d,e,f);this.show(k,e,f);this.state=c;this.node=d;this.stateSource=g}}),this.delay)}};mxTooltipHandler.prototype.hide=function(){this.resetTimer();this.hideTooltip()};mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden",this.div.innerText="")};
mxTooltipHandler.prototype.show=function(a,b,c){if(!this.destroyed&&null!=a&&0<a.length){null==this.div&&this.init();var d=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex;this.div.style.left=b+d.x+"px";this.div.style.top=c+mxConstants.TOOLTIP_VERTICAL_OFFSET+d.y+"px";mxUtils.isNode(a)?(this.div.innerText="",this.div.appendChild(a)):this.div.innerHTML=a.replace(/\n/g,"<br>");this.div.style.visibility="";mxUtils.fit(this.div)}};
mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)};function mxCellTracker(a,b,c){mxCellMarker.call(this,a,b);this.graph.addMouseListener(this);null!=c&&(this.getCell=c);mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}mxUtils.extend(mxCellTracker,mxCellMarker);
mxCellTracker.prototype.mouseDown=function(a,b){};mxCellTracker.prototype.mouseMove=function(a,b){this.isEnabled()&&this.process(b)};mxCellTracker.prototype.mouseUp=function(a,b){};mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))};
function mxCellHighlight(a,b,c,d){null!=a&&(this.graph=a,this.highlightColor=null!=b?b:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=c?c:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=d?d:!1,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,function(){if(null!=this.state){var e=this.graph.view.getState(this.state.cell);null==e?this.hide():(this.state=e,this.repaint())}}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,
this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}mxCellHighlight.prototype.keepOnTop=!1;mxCellHighlight.prototype.graph=null;mxCellHighlight.prototype.state=null;
mxCellHighlight.prototype.spacing=2;mxCellHighlight.prototype.resetHandler=null;mxCellHighlight.prototype.setHighlightColor=function(a){this.highlightColor=a;null!=this.shape&&(this.shape.stroke=a)};mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape();this.repaint();this.keepOnTop||this.shape.node.parentNode.firstChild==this.shape.node||this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)};
mxCellHighlight.prototype.createShape=function(){var a=this.graph.cellRenderer.createShape(this.state);a.svgStrokeTolerance=this.graph.tolerance;a.points=this.state.absolutePoints;a.apply(this.state);a.stroke=this.highlightColor;a.opacity=this.opacity;a.isDashed=this.dashed;a.isShadow=!1;a.dialect=mxConstants.DIALECT_SVG;a.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(a.node,this.graph,this.state);this.graph.dialect!=mxConstants.DIALECT_SVG?a.pointerEvents=!1:a.svgPointerEvents=
"stroke";return a};mxCellHighlight.prototype.getStrokeWidth=function(a){return this.strokeWidth};
mxCellHighlight.prototype.repaint=function(){null!=this.state&&null!=this.shape&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||
"0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),this.shape.redraw())};mxCellHighlight.prototype.hide=function(){this.highlight(null)};mxCellHighlight.prototype.highlight=function(a){this.state!=a&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=a,null!=this.state&&this.drawHighlight())};
mxCellHighlight.prototype.isHighlightAt=function(a,b){var c=!1;if(null!=this.shape&&null!=document.elementFromPoint)for(a=document.elementFromPoint(a,b);null!=a;){if(a==this.shape.node){c=!0;break}a=a.parentNode}return c};mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getView().removeListener(this.repaintHandler);this.graph.getModel().removeListener(this.repaintHandler);null!=this.shape&&(this.shape.destroy(),this.shape=null)};
var mxCodecRegistry={codecs:[],aliases:[],register:function(a){if(null!=a){var b=a.getName();mxCodecRegistry.codecs[b]=a;var c=mxUtils.getFunctionName(a.template.constructor);c!=b&&mxCodecRegistry.addAlias(c,b)}return a},addAlias:function(a,b){mxCodecRegistry.aliases[a]=b},getCodec:function(a){var b=null;if(null!=a){b=mxUtils.getFunctionName(a);var c=mxCodecRegistry.aliases[b];null!=c&&(b=c);b=mxCodecRegistry.codecs[b];if(null==b)try{b=new mxObjectCodec(new a),mxCodecRegistry.register(b)}catch(d){}}return b}};
function mxCodec(a){this.document=a||mxUtils.createXmlDocument();this.objects=[]}mxCodec.allowlist=null;mxCodec.prototype.document=null;mxCodec.prototype.objects=null;mxCodec.prototype.elements=null;mxCodec.prototype.encodeDefaults=!1;mxCodec.prototype.putObject=function(a,b){return this.objects[a]=b};mxCodec.prototype.getObject=function(a){var b=null;null!=a&&(b=this.objects[a],null==b&&(b=this.lookup(a),null==b&&(a=this.getElementById(a),null!=a&&(b=this.decode(a)))));return b};
mxCodec.prototype.lookup=function(a){return null};mxCodec.prototype.getElementById=function(a){this.updateElements();return this.elements[a]};mxCodec.prototype.updateElements=function(){null==this.elements&&(this.elements={},null!=this.document.documentElement&&this.addElement(this.document.documentElement))};
mxCodec.prototype.addElement=function(a){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var b=a.getAttribute("id");if(null!=b)if(null==this.elements[b])this.elements[b]=a;else if(this.elements[b]!=a)throw Error(b+": Duplicate ID");}for(a=a.firstChild;null!=a;)this.addElement(a),a=a.nextSibling};mxCodec.prototype.getId=function(a){var b=null;null!=a&&(b=this.reference(a),null==b&&a instanceof mxCell&&(b=a.getId(),null==b&&(b=mxCellPath.create(a),0==b.length&&(b="root"))));return b};
mxCodec.prototype.reference=function(a){return null};mxCodec.prototype.encode=function(a){var b=null;if(null!=a&&null!=a.constructor){var c=mxCodecRegistry.getCodec(a.constructor);null!=c?b=c.encode(this,a):mxUtils.isNode(a)?b=mxUtils.importNode(this.document,a,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(a.constructor))}return b};
mxCodec.prototype.decode=function(a,b){this.updateElements();var c=null;null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT&&(c=this.getConstructor(a.nodeName),c=mxCodecRegistry.getCodec(c),null!=c?c=c.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as")));return c};mxCodec.prototype.getConstructor=function(a){var b=null;try{null==mxCodec.allowlist||0<=mxUtils.indexOf(mxCodec.allowlist,a)?b=window[a]:null!=window.console&&console.error("mxCodec.getConstructor: "+a+" not allowed in mxCodec.allowlist")}catch(c){}return b};
mxCodec.prototype.encodeCell=function(a,b,c){b.appendChild(this.encode(a));if(null==c||c){c=a.getChildCount();for(var d=0;d<c;d++)this.encodeCell(a.getChildAt(d),b)}};mxCodec.prototype.isCellCodec=function(a){return null!=a&&"function"==typeof a.isCellCodec?a.isCellCodec():!1};
mxCodec.prototype.decodeCell=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){c=mxCodecRegistry.getCodec(a.nodeName);if(!this.isCellCodec(c))for(var d=a.firstChild;null!=d&&!this.isCellCodec(c);)c=mxCodecRegistry.getCodec(d.nodeName),d=d.nextSibling;this.isCellCodec(c)||(c=mxCodecRegistry.getCodec(mxCell));c=c.decode(this,a);b&&this.insertIntoGraph(c)}return c};
mxCodec.prototype.insertIntoGraph=function(a){var b=a.parent,c=a.getTerminal(!0),d=a.getTerminal(!1);a.setTerminal(null,!1);a.setTerminal(null,!0);a.parent=null;if(null!=b){if(b==a)throw Error(b.id+": Self Reference");b.insert(a)}null!=c&&c.insertEdge(a,!0);null!=d&&d.insertEdge(a,!1)};mxCodec.prototype.setAttribute=function(a,b,c){null!=b&&null!=c&&a.setAttribute(b,c)};
function mxObjectCodec(a,b,c,d){this.template=a;this.exclude=null!=b?b:[];this.idrefs=null!=c?c:[];this.mapping=null!=d?d:[];this.reverse={};for(var e in this.mapping)this.reverse[this.mapping[e]]=e}mxObjectCodec.allowEval=!1;mxObjectCodec.prototype.template=null;mxObjectCodec.prototype.exclude=null;mxObjectCodec.prototype.idrefs=null;mxObjectCodec.prototype.mapping=null;mxObjectCodec.prototype.reverse=null;mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)};
mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor};mxObjectCodec.prototype.getFieldName=function(a){if(null!=a){var b=this.reverse[a];null!=b&&(a=b)}return a};mxObjectCodec.prototype.getAttributeName=function(a){if(null!=a){var b=this.mapping[a];null!=b&&(a=b)}return a};mxObjectCodec.prototype.isExcluded=function(a,b,c,d){return b==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,b)};
mxObjectCodec.prototype.isReference=function(a,b,c,d){return 0<=mxUtils.indexOf(this.idrefs,b)};mxObjectCodec.prototype.encode=function(a,b){var c=a.document.createElement(this.getName());b=this.beforeEncode(a,b,c);this.encodeObject(a,b,c);return this.afterEncode(a,b,c)};mxObjectCodec.prototype.encodeObject=function(a,b,c){a.setAttribute(c,"id",a.getId(b));for(var d in b){var e=d,f=b[e];null==f||this.isExcluded(b,e,f,!0)||(mxUtils.isInteger(e)&&(e=null),this.encodeValue(a,b,e,f,c))}};
mxObjectCodec.prototype.encodeValue=function(a,b,c,d,e){if(null!=d){if(this.isReference(b,c,d,!0)){var f=a.getId(d);if(null==f){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+c+"="+d);return}d=f}f=this.template[c];if(null==c||a.encodeDefaults||f!=d)c=this.getAttributeName(c),this.writeAttribute(a,b,c,d,e)}};mxObjectCodec.prototype.writeAttribute=function(a,b,c,d,e){"object"!=typeof d?this.writePrimitiveAttribute(a,b,c,d,e):this.writeComplexAttribute(a,b,c,d,e)};
mxObjectCodec.prototype.writePrimitiveAttribute=function(a,b,c,d,e){d=this.convertAttributeToXml(a,b,c,d,e);null==c?(b=a.document.createElement("add"),"function"==typeof d?b.appendChild(a.document.createTextNode(d)):a.setAttribute(b,"value",d),e.appendChild(b)):"function"!=typeof d&&a.setAttribute(e,c,d)};
mxObjectCodec.prototype.writeComplexAttribute=function(a,b,c,d,e){a=a.encode(d);null!=a?(null!=c&&a.setAttribute("as",c),e.appendChild(a)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+c+": "+d)};mxObjectCodec.prototype.convertAttributeToXml=function(a,b,c,d){this.isBooleanAttribute(a,b,c,d)&&(d=1==d?"1":"0");return d};mxObjectCodec.prototype.isBooleanAttribute=function(a,b,c,d){return"undefined"==typeof d.length&&(1==d||0==d)};
mxObjectCodec.prototype.convertAttributeFromXml=function(a,b,c){var d=b.value;this.isNumericAttribute(a,b,c)&&(d=parseFloat(d),isNaN(d)||!isFinite(d))&&(d=0);return d};mxObjectCodec.prototype.isNumericAttribute=function(a,b,c){return c.constructor==mxGeometry&&("x"==b.name||"y"==b.name||"width"==b.name||"height"==b.name)||c.constructor==mxPoint&&("x"==b.name||"y"==b.name)||mxUtils.isNumeric(b.value)};mxObjectCodec.prototype.beforeEncode=function(a,b,c){return b};
mxObjectCodec.prototype.afterEncode=function(a,b,c){return c};mxObjectCodec.prototype.decode=function(a,b,c){var d=b.getAttribute("id"),e=a.objects[d];null==e&&(e=c||this.cloneTemplate(),null!=d&&a.putObject(d,e));b=this.beforeDecode(a,b,e);this.decodeNode(a,b,e);return this.afterDecode(a,b,e)};mxObjectCodec.prototype.decodeNode=function(a,b,c){null!=b&&(this.decodeAttributes(a,b,c),this.decodeChildren(a,b,c))};
mxObjectCodec.prototype.decodeAttributes=function(a,b,c){b=b.attributes;if(null!=b)for(var d=0;d<b.length;d++)this.decodeAttribute(a,b[d],c)};mxObjectCodec.prototype.isIgnoredAttribute=function(a,b,c){return"as"==b.nodeName||"id"==b.nodeName};
mxObjectCodec.prototype.decodeAttribute=function(a,b,c){if(!this.isIgnoredAttribute(a,b,c)){var d=b.nodeName;b=this.convertAttributeFromXml(a,b,c);var e=this.getFieldName(d);if(this.isReference(c,e,b,!1)){a=a.getObject(b);if(null==a){mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+d+"="+b);return}b=a}this.isExcluded(c,d,b,!1)||(c[d]=b)}};
mxObjectCodec.prototype.decodeChildren=function(a,b,c){for(b=b.firstChild;null!=b;){var d=b.nextSibling;b.nodeType!=mxConstants.NODETYPE_ELEMENT||this.processInclude(a,b,c)||this.decodeChild(a,b,c);b=d}};
mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b);"add"==b.nodeName?(a=b.getAttribute("value"),null==a&&mxObjectCodec.allowEval&&(a=mxUtils.eval(mxUtils.getTextContent(b)))):a=a.decode(b,e);try{this.addObjectValue(c,d,a,e)}catch(f){throw Error(f.message+" for "+b.nodeName);}}};
mxObjectCodec.prototype.getFieldTemplate=function(a,b,c){a=a[b];a instanceof Array&&0<a.length&&(a=null);return a};mxObjectCodec.prototype.addObjectValue=function(a,b,c,d){null!=c&&c!=d&&(null!=b&&0<b.length?a[b]=c:a.push(c))};mxObjectCodec.prototype.processInclude=function(a,b,c){if("include"==b.nodeName){b=b.getAttribute("name");if(null!=b)try{var d=mxUtils.load(b).getDocumentElement();null!=d&&a.decode(d,c)}catch(e){}return!0}return!1};mxObjectCodec.prototype.beforeDecode=function(a,b,c){return b};
mxObjectCodec.prototype.afterDecode=function(a,b,c){return c};
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);a.isCellCodec=function(){return!0};a.isNumericAttribute=function(b,c,d){return"value"!==c.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};a.isExcluded=function(b,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&"value"==c&&mxUtils.isNode(d)};a.afterEncode=function(b,c,d){if(null!=c.value&&mxUtils.isNode(c.value)){var e=
d;d=mxUtils.importNode(b.document,c.value,!0);d.appendChild(e);b=e.getAttribute("id");d.setAttribute("id",b);e.removeAttribute("id")}return d};a.beforeDecode=function(b,c,d){var e=c.cloneNode(!0),f=this.getName();c.nodeName!=f?(e=c.getElementsByTagName(f)[0],null!=e&&e.parentNode==c?(mxUtils.removeWhitespace(e,!0),mxUtils.removeWhitespace(e,!1),e.parentNode.removeChild(e)):e=null,d.value=c.cloneNode(!0),c=d.value.getAttribute("id"),null!=c&&(d.setId(c),d.value.removeAttribute("id"))):d.setId(c.getAttribute("id"));
if(null!=e)for(c=0;c<this.idrefs.length;c++){f=this.idrefs[c];var g=e.getAttribute(f);if(null!=g){e.removeAttribute(f);var k=b.objects[g]||b.lookup(g);null==k&&(g=b.getElementById(g),null!=g&&(k=(mxCodecRegistry.codecs[g.nodeName]||this).decode(b,g)));d[f]=k}}return e};return a}());
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxGraphModel);a.encodeObject=function(b,c,d){var e=b.document.createElement("root");b.encodeCell(c.getRoot(),e);d.appendChild(e)};a.decodeChild=function(b,c,d){"root"==c.nodeName?this.decodeRoot(b,c,d):mxObjectCodec.prototype.decodeChild.apply(this,arguments)};a.decodeRoot=function(b,c,d){var e=null;for(c=c.firstChild;null!=c;){var f=b.decodeCell(c);null!=f&&null==f.getParent()&&(e=f);c=c.nextSibling}null!=e&&d.setRoot(e)};return a}());
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxRootChange,["model","previous","root"]);a.afterEncode=function(b,c,d){b.encodeCell(c.root,d);return d};a.beforeDecode=function(b,c,d){if(null!=c.firstChild&&c.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){c=c.cloneNode(!0);var e=c.firstChild;d.root=b.decodeCell(e,!1);d=e.nextSibling;e.parentNode.removeChild(e);for(e=d;null!=e;)d=e.nextSibling,b.decodeCell(e),e.parentNode.removeChild(e),e=d}return c};a.afterDecode=function(b,c,
d){d.previous=d.root;return d};return a}());
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);a.isReference=function(b,c,d,e){return"child"!=c||e&&!b.model.contains(b.previous)?0<=mxUtils.indexOf(this.idrefs,c):!0};a.isExcluded=function(b,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&null!=d&&("previous"==c||"parent"==c)&&!b.model.contains(d)};a.afterEncode=function(b,c,d){this.isReference(c,"child",c.child,!0)?d.setAttribute("child",
b.getId(c.child)):b.encodeCell(c.child,d);return d};a.beforeDecode=function(b,c,d){if(null!=c.firstChild&&c.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){c=c.cloneNode(!0);var e=c.firstChild;d.child=b.decodeCell(e,!1);d=e.nextSibling;e.parentNode.removeChild(e);for(e=d;null!=e;){d=e.nextSibling;if(e.nodeType==mxConstants.NODETYPE_ELEMENT){var f=e.getAttribute("id");null==b.lookup(f)&&b.decodeCell(e)}e.parentNode.removeChild(e);e=d}}else e=c.getAttribute("child"),d.child=b.getObject(e);return c};
a.afterDecode=function(b,c,d){null!=d.child&&(null!=d.child.parent&&null!=d.previous&&d.child.parent!=d.previous&&(d.previous=d.child.parent),d.child.parent=d.previous,d.previous=d.parent,d.previousIndex=d.index);return d};return a}());mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);a.afterDecode=function(b,c,d){d.previous=d.terminal;return d};return a}());
var mxGenericChangeCodec=function(a,b){a=new mxObjectCodec(a,["model","previous"],["cell"]);a.afterDecode=function(c,d,e){mxUtils.isNode(e.cell)&&(e.cell=c.decodeCell(e.cell,!1));e.previous=e[b];return e};return a};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value"));mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style"));mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry"));
mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed"));mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible"));mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value"));mxCodecRegistry.register(function(){return new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))}());
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxGraphView);a.encode=function(b,c){return this.encodeCell(b,c,c.graph.getModel().getRoot())};a.encodeCell=function(b,c,d){var e=c.graph.getModel(),f=c.getState(d),g=e.getParent(d);if(null==g||null!=f){var k=e.getChildCount(d),l=c.graph.getCellGeometry(d),m=null;g==e.getRoot()?m="layer":null==g?m="graph":e.isEdge(d)?m="edge":0<k&&null!=l?m="group":e.isVertex(d)&&(m="vertex");if(null!=m){var n=b.document.createElement(m);null!=c.graph.getLabel(d)&&
(n.setAttribute("label",c.graph.getLabel(d)),c.graph.isHtmlLabel(d)&&n.setAttribute("html",!0));if(null==g){var p=c.getGraphBounds();null!=p&&(n.setAttribute("x",Math.round(p.x)),n.setAttribute("y",Math.round(p.y)),n.setAttribute("width",Math.round(p.width)),n.setAttribute("height",Math.round(p.height)));n.setAttribute("scale",c.scale)}else if(null!=f&&null!=l){for(p in f.style)g=f.style[p],"function"==typeof g&&"object"==typeof g&&(g=mxStyleRegistry.getName(g)),null!=g&&"function"!=typeof g&&"object"!=
typeof g&&n.setAttribute(p,g);g=f.absolutePoints;if(null!=g&&0<g.length){l=Math.round(g[0].x)+","+Math.round(g[0].y);for(p=1;p<g.length;p++)l+=" "+Math.round(g[p].x)+","+Math.round(g[p].y);n.setAttribute("points",l)}else n.setAttribute("x",Math.round(f.x)),n.setAttribute("y",Math.round(f.y)),n.setAttribute("width",Math.round(f.width)),n.setAttribute("height",Math.round(f.height));p=f.absoluteOffset;null!=p&&(0!=p.x&&n.setAttribute("dx",Math.round(p.x)),0!=p.y&&n.setAttribute("dy",Math.round(p.y)))}for(p=
0;p<k;p++)f=this.encodeCell(b,c,e.getChildAt(d,p)),null!=f&&n.appendChild(f)}}return n};return a}());
var mxStylesheetCodec=mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxStylesheet);a.encode=function(b,c){var d=b.document.createElement(this.getName()),e;for(e in c.styles){var f=c.styles[e],g=b.document.createElement("add");if(null!=e){g.setAttribute("as",e);for(var k in f){var l=this.getStringValue(k,f[k]);if(null!=l){var m=b.document.createElement("add");m.setAttribute("value",l);m.setAttribute("as",k);g.appendChild(m)}}0<g.childNodes.length&&d.appendChild(g)}}return d};a.getStringValue=
function(b,c){b=typeof c;"function"==b?c=mxStyleRegistry.getName(c):"object"==b&&(c=null);return c};a.decode=function(b,c,d){d=d||new this.template.constructor;var e=c.getAttribute("id");null!=e&&(b.objects[e]=d);for(c=c.firstChild;null!=c;){if(!this.processInclude(b,c,d)&&"add"==c.nodeName&&(e=c.getAttribute("as"),null!=e)){var f=c.getAttribute("extend"),g=null!=f?mxUtils.clone(d.styles[f]):null;null==g&&(null!=f&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+f+" not found to extend"),g={});
for(f=c.firstChild;null!=f;){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){var k=f.getAttribute("as");if("add"==f.nodeName){var l=mxUtils.getTextContent(f);null!=l&&0<l.length&&mxStylesheetCodec.allowEval?l=mxUtils.eval(l):(l=f.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l)));null!=l&&(g[k]=l)}else"remove"==f.nodeName&&delete g[k]}f=f.nextSibling}d.putCellStyle(e,g)}c=c.nextSibling}return d};return a}());mxStylesheetCodec.allowEval=!1;/*
 GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
 @author  Jan Odvarko, http://odvarko.cz
 @created 2008-06-15
 @updated 2012-01-19
 @link    http://jscolor.com
*/
var mxJSColor={bindClass:"color",binding:!0,preloading:!0,install:function(){},init:function(){mxJSColor.preloading&&mxJSColor.preload()},getDir:function(){return IMAGE_PATH+"/"},detectDir:function(){for(var a=location.href,b=document.getElementsByTagName("base"),c=0;c<b.length;c+=1)b[c].href&&(a=b[c].href);b=document.getElementsByTagName("script");for(c=0;c<b.length;c+=1)if(b[c].src&&/(^|\/)jscolor\.js([?#].*)?$/i.test(b[c].src))return a=(new mxJSColor.URI(b[c].src)).toAbsolute(a),a.path=a.path.replace(/[^\/]+$/,
""),a.query=null,a.fragment=null,a.toString();return!1},preload:function(){for(var a in mxJSColor.imgRequire)mxJSColor.imgRequire.hasOwnProperty(a)&&mxJSColor.loadImage(a)},images:{pad:[181,101],sld:[16,101],cross:[15,15],arrow:[7,11]},imgRequire:{},imgLoaded:{},requireImage:function(a){mxJSColor.imgRequire[a]=!0},loadImage:function(a){mxJSColor.imgLoaded[a]||(mxJSColor.imgLoaded[a]=new Image,mxJSColor.imgLoaded[a].src=mxJSColor.getDir()+a)},fetchElement:function(a){return"string"===typeof a?document.getElementById(a):
a},addEvent:function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)},fireEvent:function(a,b){if(a)if(document.createEvent){var c=document.createEvent("HTMLEvents");c.initEvent(b,!0,!0);a.dispatchEvent(c)}else if(document.createEventObject)c=document.createEventObject(),a.fireEvent("on"+b,c);else if(a["on"+b])a["on"+b]()},getElementPos:function(a){var b=a,c=0,d=0;if(b.offsetParent){do c+=b.offsetLeft,d+=b.offsetTop;while(b=b.offsetParent)}for(;(a=a.parentNode)&&
"BODY"!==a.nodeName.toUpperCase();)c-=a.scrollLeft,d-=a.scrollTop;return[c,d]},getElementSize:function(a){return[a.offsetWidth,a.offsetHeight]},getRelMousePos:function(a){var b=0,c=0;a||(a=window.event);"number"===typeof a.offsetX?(b=a.offsetX,c=a.offsetY):"number"===typeof a.layerX&&(b=a.layerX,c=a.layerY);return{x:b,y:c}},getViewPos:function(){return"number"===typeof window.pageYOffset?[window.pageXOffset,window.pageYOffset]:document.body&&(document.body.scrollLeft||document.body.scrollTop)?[document.body.scrollLeft,
document.body.scrollTop]:document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)?[document.documentElement.scrollLeft,document.documentElement.scrollTop]:[0,0]},getViewSize:function(){return"number"===typeof window.innerWidth?[window.innerWidth,window.innerHeight]:document.body&&(document.body.clientWidth||document.body.clientHeight)?[document.body.clientWidth,document.body.clientHeight]:document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?
[document.documentElement.clientWidth,document.documentElement.clientHeight]:[0,0]},URI:function(a){function b(c){for(var d="";c;)if("../"===c.substr(0,3)||"./"===c.substr(0,2))c=c.replace(/^\.+/,"").substr(1);else if("/./"===c.substr(0,3)||"/."===c)c="/"+c.substr(3);else if("/../"===c.substr(0,4)||"/.."===c)c="/"+c.substr(4),d=d.replace(/\/?[^\/]*$/,"");else if("."===c||".."===c)c="";else{var e=c.match(/^\/?[^\/]*/)[0];c=c.substr(e.length);d+=e}return d}this.authority=this.scheme=null;this.path=
"";this.fragment=this.query=null;this.parse=function(c){c=c.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);this.scheme=c[3]?c[2]:null;this.authority=c[5]?c[6]:null;this.path=c[7];this.query=c[9]?c[10]:null;this.fragment=c[12]?c[13]:null;return this};this.toString=function(){var c="";null!==this.scheme&&(c=c+this.scheme+":");null!==this.authority&&(c=c+"//"+this.authority);null!==this.path&&(c+=this.path);null!==this.query&&(c=c+"?"+this.query);null!==
this.fragment&&(c=c+"#"+this.fragment);return c};this.toAbsolute=function(c){c=new mxJSColor.URI(c);var d=new mxJSColor.URI;if(null===c.scheme)return!1;null!==this.scheme&&this.scheme.toLowerCase()===c.scheme.toLowerCase()&&(this.scheme=null);null!==this.scheme?(d.scheme=this.scheme,d.authority=this.authority,d.path=b(this.path),d.query=this.query):(null!==this.authority?(d.authority=this.authority,d.path=b(this.path),d.query=this.query):(""===this.path?(d.path=c.path,d.query=null!==this.query?this.query:
c.query):("/"===this.path.substr(0,1)?d.path=b(this.path):(d.path=null!==c.authority&&""===c.path?"/"+this.path:c.path.replace(/[^\/]+$/,"")+this.path,d.path=b(d.path)),d.query=this.query),d.authority=c.authority),d.scheme=c.scheme);d.fragment=this.fragment;return d};a&&this.parse(a)},color:function(a,b){function c(y,F,H){if(null===y)return[H,H,H];var G=Math.floor(y),z=H*(1-F);y=H*(1-F*(G%2?y-G:1-(y-G)));switch(G){case 6:case 0:return[H,y,z];case 1:return[y,H,z];case 2:return[z,H,y];case 3:return[z,
y,H];case 4:return[y,z,H];case 5:return[H,z,y]}}function d(y,F){if(!mxJSColor.picker){mxJSColor.picker={box:document.createElement("div"),boxB:document.createElement("div"),pad:document.createElement("div"),padB:document.createElement("div"),padM:document.createElement("div"),sld:document.createElement("div"),sldB:document.createElement("div"),sldM:document.createElement("div"),btn:document.createElement("div"),btnS:document.createElement("span"),btnT:document.createTextNode(q.pickerCloseText)};for(var H=
0;H<mxJSColor.images.sld[1];H+=4){var G=document.createElement("div");G.style.height="4px";G.style.fontSize="1px";G.style.lineHeight="0";mxJSColor.picker.sld.appendChild(G)}mxJSColor.picker.sldB.appendChild(mxJSColor.picker.sld);mxJSColor.picker.box.appendChild(mxJSColor.picker.sldB);mxJSColor.picker.box.appendChild(mxJSColor.picker.sldM);mxJSColor.picker.padB.appendChild(mxJSColor.picker.pad);mxJSColor.picker.box.appendChild(mxJSColor.picker.padB);mxJSColor.picker.box.appendChild(mxJSColor.picker.padM);
mxJSColor.picker.btnS.appendChild(mxJSColor.picker.btnT);mxJSColor.picker.btn.appendChild(mxJSColor.picker.btnS);mxJSColor.picker.box.appendChild(mxJSColor.picker.btn);mxJSColor.picker.boxB.appendChild(mxJSColor.picker.box)}var z=mxJSColor.picker;z.box.onmouseup=z.box.onmouseout=function(){mxClient.IS_TOUCH||a.focus()};z.box.onmousedown=function(){};z.box.onmousemove=function(I){if(A||E)A&&m(I),E&&n(I),document.selection?document.selection.empty():window.getSelection&&window.getSelection().removeAllRanges(),
p()};z.padM.onmouseup=z.padM.onmouseout=function(){A&&(A=!1,mxJSColor.fireEvent(u,"change"))};z.padM.onmousedown=function(I){switch(t){case 0:0===q.hsv[2]&&q.fromHSV(null,null,1);break;case 1:0===q.hsv[1]&&q.fromHSV(null,1,null)}A=!0;m(I);p()};z.sldM.onmouseup=z.sldM.onmouseout=function(){E&&(E=!1,mxJSColor.fireEvent(u,"change"))};z.sldM.onmousedown=function(I){E=!0;n(I);p()};H=e(q);z.box.style.width=H[0]+"px";z.box.style.height=H[1]+"px";z.boxB.style.position="absolute";z.boxB.style.clear="both";
z.boxB.style.left=y+"px";z.boxB.style.top=F+"px";z.boxB.style.zIndex=q.pickerZIndex;z.boxB.style.border=q.pickerBorder+"px solid";z.boxB.style.borderColor=q.pickerBorderColor;z.boxB.style.background=q.pickerFaceColor;z.pad.style.width=mxJSColor.images.pad[0]+"px";z.pad.style.height=mxJSColor.images.pad[1]+"px";z.padB.style.position="absolute";z.padB.style.left=q.pickerFace+"px";z.padB.style.top=q.pickerFace+"px";z.padB.style.border=q.pickerInset+"px solid";z.padB.style.borderColor=q.pickerInsetColor;
z.padM.style.position="absolute";z.padM.style.left="0";z.padM.style.top="0";z.padM.style.width=q.pickerFace+2*q.pickerInset+mxJSColor.images.pad[0]+mxJSColor.images.arrow[0]+"px";z.padM.style.height=z.box.style.height;z.padM.style.cursor="crosshair";z.sld.style.overflow="hidden";z.sld.style.width=mxJSColor.images.sld[0]+"px";z.sld.style.height=mxJSColor.images.sld[1]+"px";z.sldB.style.display=q.slider?"block":"none";z.sldB.style.position="absolute";z.sldB.style.right=q.pickerFace+"px";z.sldB.style.top=
q.pickerFace+"px";z.sldB.style.border=q.pickerInset+"px solid";z.sldB.style.borderColor=q.pickerInsetColor;z.sldM.style.display=q.slider?"block":"none";z.sldM.style.position="absolute";z.sldM.style.right="0";z.sldM.style.top="0";z.sldM.style.width=mxJSColor.images.sld[0]+mxJSColor.images.arrow[0]+q.pickerFace+2*q.pickerInset+"px";z.sldM.style.height=z.box.style.height;try{z.sldM.style.cursor="pointer"}catch(I){z.sldM.style.cursor="hand"}z.btn.style.display=q.pickerClosable?"block":"none";z.btn.style.position=
"absolute";z.btn.style.left=q.pickerFace+"px";z.btn.style.bottom=q.pickerFace+"px";z.btn.style.padding="0 15px";z.btn.style.height="18px";z.btn.style.border=q.pickerInset+"px solid";(function(){var I=q.pickerInsetColor.split(/\s+/);z.btn.style.borderColor=2>I.length?I[0]:I[1]+" "+I[0]+" "+I[0]+" "+I[1]})();z.btn.style.color=q.pickerButtonColor;z.btn.style.font="12px sans-serif";z.btn.style.textAlign="center";try{z.btn.style.cursor="pointer"}catch(I){z.btn.style.cursor="hand"}z.btn.onmousedown=function(){q.hidePicker()};
z.btnS.style.lineHeight=z.btn.style.height;switch(t){case 0:var J="hs.png";break;case 1:J="hv.png"}z.padM.style.backgroundImage="url(data:image/gif;base64,R0lGODlhDwAPAKEBAAAAAP///////////yH5BAEKAAIALAAAAAAPAA8AAAIklB8Qx53b4otSUWcvyiz4/4AeQJbmKY4p1HHapBlwPL/uVRsFADs=)";z.padM.style.backgroundRepeat="no-repeat";z.sldM.style.backgroundImage="url(data:image/gif;base64,R0lGODlhBwALAKECAAAAAP///6g8eKg8eCH5BAEKAAIALAAAAAAHAAsAAAITTIQYcLnsgGxvijrxqdQq6DRJAQA7)";z.sldM.style.backgroundRepeat="no-repeat";
z.pad.style.backgroundImage="url('"+mxJSColor.getDir()+J+"')";z.pad.style.backgroundRepeat="no-repeat";z.pad.style.backgroundPosition="0 0";f();g();mxJSColor.picker.owner=q;document.getElementsByTagName("body")[0].appendChild(z.boxB)}function e(y){return[2*y.pickerInset+2*y.pickerFace+mxJSColor.images.pad[0]+(y.slider?2*y.pickerInset+2*mxJSColor.images.arrow[0]+mxJSColor.images.sld[0]:0),y.pickerClosable?4*y.pickerInset+3*y.pickerFace+mxJSColor.images.pad[1]+y.pickerButtonHeight:2*y.pickerInset+2*
y.pickerFace+mxJSColor.images.pad[1]]}function f(){switch(t){case 0:var y=1;break;case 1:y=2}mxJSColor.picker.padM.style.backgroundPosition=q.pickerFace+q.pickerInset+Math.round(q.hsv[0]/6*(mxJSColor.images.pad[0]-1))-Math.floor(mxJSColor.images.cross[0]/2)+"px "+(q.pickerFace+q.pickerInset+Math.round((1-q.hsv[y])*(mxJSColor.images.pad[1]-1))-Math.floor(mxJSColor.images.cross[1]/2))+"px";y=mxJSColor.picker.sld.childNodes;switch(t){case 0:for(var F=c(q.hsv[0],q.hsv[1],1),H=0;H<y.length;H+=1)y[H].style.backgroundColor=
"rgb("+F[0]*(1-H/y.length)*100+"%,"+F[1]*(1-H/y.length)*100+"%,"+F[2]*(1-H/y.length)*100+"%)";break;case 1:var G=[q.hsv[2],0,0];H=Math.floor(q.hsv[0]);var z=H%2?q.hsv[0]-H:1-(q.hsv[0]-H);switch(H){case 6:case 0:F=[0,1,2];break;case 1:F=[1,0,2];break;case 2:F=[2,0,1];break;case 3:F=[2,1,0];break;case 4:F=[1,2,0];break;case 5:F=[0,2,1]}for(H=0;H<y.length;H+=1){var J=1-1/(y.length-1)*H;G[1]=G[0]*(1-J*z);G[2]=G[0]*(1-J);y[H].style.backgroundColor="rgb("+100*G[F[0]]+"%,"+100*G[F[1]]+"%,"+100*G[F[2]]+"%)"}}}
function g(){switch(t){case 0:var y=2;break;case 1:y=1}mxJSColor.picker.sldM.style.backgroundPosition="0 "+(q.pickerFace+q.pickerInset+Math.round((1-q.hsv[y])*(mxJSColor.images.sld[1]-1))-Math.floor(mxJSColor.images.arrow[1]/2))+"px"}function k(){return mxJSColor.picker&&mxJSColor.picker.owner===q}function l(){u!==a&&q.importColor()}function m(y){var F=mxJSColor.getRelMousePos(y);y=F.x-q.pickerFace-q.pickerInset;F=F.y-q.pickerFace-q.pickerInset;switch(t){case 0:q.fromHSV(6/(mxJSColor.images.pad[0]-
1)*y,1-F/(mxJSColor.images.pad[1]-1),null,v);break;case 1:q.fromHSV(6/(mxJSColor.images.pad[0]-1)*y,null,1-F/(mxJSColor.images.pad[1]-1),v)}}function n(y){y=mxJSColor.getRelMousePos(y).y-q.pickerFace-q.pickerInset;switch(t){case 0:q.fromHSV(null,null,1-y/(mxJSColor.images.sld[1]-1),B);break;case 1:q.fromHSV(null,1-y/(mxJSColor.images.sld[1]-1),null,B)}}function p(){if(q.onImmediateChange&&"string"!==typeof q.onImmediateChange)q.onImmediateChange(q)}this.adjust=this.required=!0;this.hash=!1;this.slider=
this.caps=!0;this.styleElement=this.valueElement=a;this.onImmediateChange=null;this.hsv=[0,0,1];this.rgb=[1,1,1];this.pickerOnfocus=!0;this.pickerMode="HSV";this.pickerPosition="bottom";this.pickerSmartPosition=!0;this.pickerButtonHeight=20;this.pickerClosable=!1;this.pickerCloseText="Close";this.pickerButtonColor="ButtonText";this.pickerFace=0;this.pickerFaceColor="ThreeDFace";this.pickerBorder=1;this.pickerBorderColor="ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight";this.pickerInset=
1;this.pickerInsetColor="ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow";this.pickerZIndex=1E4;for(var r in b)b.hasOwnProperty(r)&&(this[r]=b[r]);this.hidePicker=function(){k()&&(delete mxJSColor.picker.owner,document.getElementsByTagName("body")[0].removeChild(mxJSColor.picker.boxB))};this.showPicker=function(){k()||(mxJSColor.getElementPos(a),mxJSColor.getElementSize(a),mxJSColor.getViewPos(),mxJSColor.getViewSize(),e(this),this.pickerPosition.toLowerCase(),d(0,0))};this.importColor=
function(){u?this.adjust?!this.required&&/^\s*$/.test(u.value)?(u.value="",x.style.backgroundImage=x.jscStyle.backgroundImage,x.style.backgroundColor=x.jscStyle.backgroundColor,x.style.color=x.jscStyle.color,this.exportColor(C|D)):this.fromString(u.value)||this.exportColor():this.fromString(u.value,C)||(x.style.backgroundImage=x.jscStyle.backgroundImage,x.style.backgroundColor=x.jscStyle.backgroundColor,x.style.color=x.jscStyle.color,this.exportColor(C|D)):this.exportColor()};this.exportColor=function(y){if(!(y&
C)&&u){var F=this.toString();this.caps&&(F=F.toUpperCase());this.hash&&(F="#"+F);u.value=F}y&D||!x||(x.style.backgroundImage="none",x.style.backgroundColor="#"+this.toString(),x.style.color=.5>.213*this.rgb[0]+.715*this.rgb[1]+.072*this.rgb[2]?"#FFF":"#000");y&B||!k()||f();y&v||!k()||g()};this.fromHSV=function(y,F,H,G){0>y&&(y=0);6<y&&(y=6);0>F&&(F=0);1<F&&(F=1);0>H&&(H=0);1<H&&(H=1);this.rgb=c(null===y?this.hsv[0]:this.hsv[0]=y,null===F?this.hsv[1]:this.hsv[1]=F,null===H?this.hsv[2]:this.hsv[2]=
H);this.exportColor(G)};this.fromRGB=function(y,F,H,G){0>y&&(y=0);1<y&&(y=1);0>F&&(F=0);1<F&&(F=1);0>H&&(H=0);1<H&&(H=1);y=null===y?this.rgb[0]:this.rgb[0]=y;F=null===F?this.rgb[1]:this.rgb[1]=F;var z=null===H?this.rgb[2]:this.rgb[2]=H,J=Math.min(Math.min(y,F),z);H=Math.max(Math.max(y,F),z);var I=H-J;0===I?y=[null,0,H]:(y=y===J?3+(z-F)/I:F===J?5+(y-z)/I:1+(F-y)/I,y=[6===y?0:y,I/H,H]);null!==y[0]&&(this.hsv[0]=y[0]);0!==y[2]&&(this.hsv[1]=y[1]);this.hsv[2]=y[2];this.exportColor(G)};this.fromString=
function(y,F){return(y=y.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i))?(6===y[1].length?this.fromRGB(parseInt(y[1].substr(0,2),16)/255,parseInt(y[1].substr(2,2),16)/255,parseInt(y[1].substr(4,2),16)/255,F):this.fromRGB(parseInt(y[1].charAt(0)+y[1].charAt(0),16)/255,parseInt(y[1].charAt(1)+y[1].charAt(1),16)/255,parseInt(y[1].charAt(2)+y[1].charAt(2),16)/255,F),!0):!1};this.toString=function(){return(256|Math.round(255*this.rgb[0])).toString(16).substr(1)+(256|Math.round(255*this.rgb[1])).toString(16).substr(1)+
(256|Math.round(255*this.rgb[2])).toString(16).substr(1)};var q=this,t="hvs"===this.pickerMode.toLowerCase()?1:0,u=mxJSColor.fetchElement(this.valueElement),x=mxJSColor.fetchElement(this.styleElement),A=!1,E=!1,C=1,D=2,B=4,v=8;u&&(b=function(){q.fromString(u.value,C);p()},mxJSColor.addEvent(u,"keyup",b),mxJSColor.addEvent(u,"input",b),mxJSColor.addEvent(u,"blur",l),u.setAttribute("autocomplete","off"));x&&(x.jscStyle={backgroundImage:x.style.backgroundImage,backgroundColor:x.style.backgroundColor,
color:x.style.color});switch(t){case 0:mxJSColor.requireImage("hs.png");break;case 1:mxJSColor.requireImage("hv.png")}this.importColor()}};mxJSColor.install();
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(b){return b.raw=b};$jscomp.createTemplateTagFirstArgWithRaw=function(b,d){b.raw=d;return b};$jscomp.arrayIteratorImpl=function(b){var d=0;return function(){return d<b.length?{done:!1,value:b[d++]}:{done:!0}}};$jscomp.arrayIterator=function(b){return{next:$jscomp.arrayIteratorImpl(b)}};$jscomp.makeIterator=function(b){var d="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];return d?d.call(b):$jscomp.arrayIterator(b)};
Editor=function(b,d,g,l,D){mxEventSource.call(this);this.chromeless=null!=b?b:this.chromeless;this.initStencilRegistry();this.graph=l||this.createGraph(d,g);this.editable=null!=D?D:!b;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(p){this.status=p;this.fireEvent(new mxEventObject("statusChanged"))};this.getStatus=
function(){return this.status};this.graphChangeListener=function(p,E){p=null!=E?E.getProperty("edit"):null;null!=p&&p.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};Editor.pageCounter=0;
(function(){try{for(var b=window;null!=b.opener&&"undefined"!==typeof b.opener.Editor&&!isNaN(b.opener.Editor.pageCounter)&&b.opener!=b;)b=b.opener;null!=b&&(b.Editor.pageCounter++,Editor.pageCounter=b.Editor.pageCounter)}catch(d){}})();Editor.defaultHtmlFont='-apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, ui-sans-serif, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"';Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS;
Editor.rowMoveImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAEBAMAAACw6DhOAAAAGFBMVEUzMzP///9tbW1QUFCKiopBQUF8fHxfX1/IXlmXAAAAFElEQVQImWNgNVdzYBAUFBRggLMAEzYBy29kEPgAAAAASUVORK5CYII=";Editor.lightCheckmarkImage="data:image/gif;base64,R0lGODlhFQAVAMQfAGxsbHx8fIqKioaGhvb29nJycvr6+sDAwJqamltbW5OTk+np6YGBgeTk5Ly8vJiYmP39/fLy8qWlpa6ursjIyOLi4vj4+N/f3+3t7fT09LCwsHZ2dubm5r6+vmZmZv///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEY4NTZERTQ5QUFBMTFFMUE5MTVDOTM5MUZGMTE3M0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEY4NTZERTU5QUFBMTFFMUE5MTVDOTM5MUZGMTE3M0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4Rjg1NkRFMjlBQUExMUUxQTkxNUM5MzkxRkYxMTczRCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4Rjg1NkRFMzlBQUExMUUxQTkxNUM5MzkxRkYxMTczRCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAB8ALAAAAAAVABUAAAVI4CeOZGmeaKqubKtylktSgCOLRyLd3+QJEJnh4VHcMoOfYQXQLBcBD4PA6ngGlIInEHEhPOANRkaIFhq8SuHCE1Hb8Lh8LgsBADs=";
Editor.darkCheckmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg==";Editor.darkHelpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=";
Editor.lightHelpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAwaDI0djI0SDB6Ii8+PHBhdGggZD0iTTExIDE4aDJ2LTJoLTJ2MnptMS0xNkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMCAxOGMtNC40MSAwLTgtMy41OS04LThzMy41OS04IDgtOCA4IDMuNTkgOCA4LTMuNTkgOC04IDh6bTAtMTRjLTIuMjEgMC00IDEuNzktNCA0aDJjMC0xLjEuOS0yIDItMnMyIC45IDIgMmMwIDItMyAxLjc1LTMgNWgyYzAtMi4yNSAzLTIuNSAzLTUgMC0yLjIxLTEuNzktNC00LTR6Ii8+PC9zdmc+";
Editor.menuImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTMgMThoMTh2LTJIM3Yyem0wLTVoMTh2LTJIM3Yyem0wLTd2MmgxOFY2SDN6Ii8+PC9zdmc+";Editor.moveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI4cHgiIGhlaWdodD0iMjhweCI+PGc+PC9nPjxnPjxnPjxnPjxwYXRoIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIuNCwyLjQpc2NhbGUoMC44KXJvdGF0ZSg0NSwxMiwxMikiIHN0cm9rZT0iIzI5YjZmMiIgZmlsbD0iIzI5YjZmMiIgZD0iTTE1LDNsMi4zLDIuM2wtMi44OSwyLjg3bDEuNDIsMS40MkwxOC43LDYuN0wyMSw5VjNIMTV6IE0zLDlsMi4zLTIuM2wyLjg3LDIuODlsMS40Mi0xLjQyTDYuNyw1LjNMOSwzSDNWOXogTTksMjEgbC0yLjMtMi4zbDIuODktMi44N2wtMS40Mi0xLjQyTDUuMywxNy4zTDMsMTV2Nkg5eiBNMjEsMTVsLTIuMywyLjNsLTIuODctMi44OWwtMS40MiwxLjQybDIuODksMi44N0wxNSwyMWg2VjE1eiIvPjwvZz48L2c+PC9nPjwvc3ZnPgo=";
Editor.zoomInImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHptMi41LTRoLTJ2Mkg5di0ySDdWOWgyVjdoMXYyaDJ2MXoiLz48L3N2Zz4=";
Editor.zoomOutImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg==";
Editor.fullscreenImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyA1djRoMlY1aDRWM0g1Yy0xLjEgMC0yIC45LTIgMnptMiAxMEgzdjRjMCAxLjEuOSAyIDIgMmg0di0ySDV2LTR6bTE0IDRoLTR2Mmg0YzEuMSAwIDItLjkgMi0ydi00aC0ydjR6bTAtMTZoLTR2Mmg0djRoMlY1YzAtMS4xLS45LTItMi0yeiIvPjwvc3ZnPg==";Editor.fullscreenExitImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTUgMTZoM3YzaDJ2LTVINXYyem0zLThINXYyaDVWNUg4djN6bTYgMTFoMnYtM2gzdi0yaC01djV6bTItMTFWNWgtMnY1aDVWOGgtM3oiLz48L3N2Zz4=";
Editor.zoomFitImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTUgMTVIM3Y0YzAgMS4xLjkgMiAyIDJoNHYtMkg1di00ek01IDVoNFYzSDVjLTEuMSAwLTIgLjktMiAydjRoMlY1em03IDNjLTIuMjEgMC00IDEuNzktNCA0czEuNzkgNCA0IDQgNC0xLjc5IDQtNC0xLjc5LTQtNC00em0wIDZjLTEuMSAwLTItLjktMi0ycy45LTIgMi0yIDIgLjkgMiAyLS45IDItMiAyem03LTExaC00djJoNHY0aDJWNWMwLTEuMS0uOS0yLTItMnptMCAxNmgtNHYyaDRjMS4xIDAgMi0uOSAyLTJ2LTRoLTJ2NHoiLz48L3N2Zz4=";
Editor.layersImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTExLjk5IDE4LjU0bC03LjM3LTUuNzNMMyAxNC4wN2w5IDcgOS03LTEuNjMtMS4yN3pNMTIgMTZsNy4zNi01LjczTDIxIDlsLTktNy05IDcgMS42MyAxLjI3TDEyIDE2em0wLTExLjQ3TDE3Ljc0IDkgMTIgMTMuNDcgNi4yNiA5IDEyIDQuNTN6Ii8+PC9zdmc+";Editor.previousImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE1LjQxIDcuNDFMMTQgNmwtNiA2IDYgNiAxLjQxLTEuNDFMMTAuODMgMTJsNC41OC00LjU5eiIvPjwvc3ZnPg==";
Editor.nextImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEwIDZMOC41OSA3LjQxIDEzLjE3IDEybC00LjU4IDQuNTlMMTAgMThsNi02LTYtNnoiLz48L3N2Zz4=";Editor.editImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE0LjA2IDkuMDJsLjkyLjkyTDUuOTIgMTlINXYtLjkybDkuMDYtOS4wNk0xNy42NiAzYy0uMjUgMC0uNTEuMS0uNy4yOWwtMS44MyAxLjgzIDMuNzUgMy43NSAxLjgzLTEuODNjLjM5LS4zOS4zOS0xLjAyIDAtMS40MWwtMi4zNC0yLjM0Yy0uMi0uMi0uNDUtLjI5LS43MS0uMjl6bS0zLjYgMy4xOUwzIDE3LjI1VjIxaDMuNzVMMTcuODEgOS45NGwtMy43NS0zLjc1eiIvPjwvc3ZnPg==";
Editor.duplicateImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE2IDFINGMtMS4xIDAtMiAuOS0yIDJ2MTRoMlYzaDEyVjF6bTMgNEg4Yy0xLjEgMC0yIC45LTIgMnYxNGMwIDEuMS45IDIgMiAyaDExYzEuMSAwIDItLjkgMi0yVjdjMC0xLjEtLjktMi0yLTJ6bTAgMTZIOFY3aDExdjE0eiIvPjwvc3ZnPg==";Editor.addImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDEzaC02djZoLTJ2LTZINXYtMmg2VjVoMnY2aDZ2MnoiLz48L3N2Zz4=";
Editor.crossImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDYuNDFMMTcuNTkgNSAxMiAxMC41OSA2LjQxIDUgNSA2LjQxIDEwLjU5IDEyIDUgMTcuNTkgNi40MSAxOSAxMiAxMy40MSAxNy41OSAxOSAxOSAxNy41OSAxMy40MSAxMiAxOSA2LjQxeiIvPjwvc3ZnPg==";Editor.verticalDotsImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEyIDhjMS4xIDAgMi0uOSAyLTJzLS45LTItMi0yLTIgLjktMiAyIC45IDIgMiAyem0wIDJjLTEuMSAwLTIgLjktMiAycy45IDIgMiAyIDItLjkgMi0yLS45LTItMi0yem0wIDZjLTEuMSAwLTIgLjktMiAycy45IDIgMiAyIDItLjkgMi0yLS45LTItMi0yeiIvPjwvc3ZnPg==";
Editor.trashImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE2IDl2MTBIOFY5aDhtLTEuNS02aC01bC0xIDFINXYyaDE0VjRoLTMuNWwtMS0xek0xOCA3SDZ2MTJjMCAxLjEuOSAyIDIgMmg4YzEuMSAwIDItLjkgMi0yVjd6Ii8+PC9zdmc+";Editor.hiddenImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEyIDZjMy43OSAwIDcuMTcgMi4xMyA4LjgyIDUuNS0uNTkgMS4yMi0xLjQyIDIuMjctMi40MSAzLjEybDEuNDEgMS40MWMxLjM5LTEuMjMgMi40OS0yLjc3IDMuMTgtNC41M0MyMS4yNyA3LjExIDE3IDQgMTIgNGMtMS4yNyAwLTIuNDkuMi0zLjY0LjU3bDEuNjUgMS42NUMxMC42NiA2LjA5IDExLjMyIDYgMTIgNnptLTEuMDcgMS4xNEwxMyA5LjIxYy41Ny4yNSAxLjAzLjcxIDEuMjggMS4yOGwyLjA3IDIuMDdjLjA4LS4zNC4xNC0uNy4xNC0xLjA3QzE2LjUgOS4wMSAxNC40OCA3IDEyIDdjLS4zNyAwLS43Mi4wNS0xLjA3LjE0ek0yLjAxIDMuODdsMi42OCAyLjY4QzMuMDYgNy44MyAxLjc3IDkuNTMgMSAxMS41IDIuNzMgMTUuODkgNyAxOSAxMiAxOWMxLjUyIDAgMi45OC0uMjkgNC4zMi0uODJsMy40MiAzLjQyIDEuNDEtMS40MUwzLjQyIDIuNDUgMi4wMSAzLjg3em03LjUgNy41bDIuNjEgMi42MWMtLjA0LjAxLS4wOC4wMi0uMTIuMDItMS4zOCAwLTIuNS0xLjEyLTIuNS0yLjUgMC0uMDUuMDEtLjA4LjAxLS4xM3ptLTMuNC0zLjRsMS43NSAxLjc1Yy0uMjMuNTUtLjM2IDEuMTUtLjM2IDEuNzggMCAyLjQ4IDIuMDIgNC41IDQuNSA0LjUuNjMgMCAxLjIzLS4xMyAxLjc3LS4zNmwuOTguOThjLS44OC4yNC0xLjguMzgtMi43NS4zOC0zLjc5IDAtNy4xNy0yLjEzLTguODItNS41LjctMS40MyAxLjcyLTIuNjEgMi45My0zLjUzeiIvPjwvc3ZnPg==";
Editor.visibleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEyIDZjMy43OSAwIDcuMTcgMi4xMyA4LjgyIDUuNUMxOS4xNyAxNC44NyAxNS43OSAxNyAxMiAxN3MtNy4xNy0yLjEzLTguODItNS41QzQuODMgOC4xMyA4LjIxIDYgMTIgNm0wLTJDNyA0IDIuNzMgNy4xMSAxIDExLjUgMi43MyAxNS44OSA3IDE5IDEyIDE5czkuMjctMy4xMSAxMS03LjVDMjEuMjcgNy4xMSAxNyA0IDEyIDR6bTAgNWMxLjM4IDAgMi41IDEuMTIgMi41IDIuNVMxMy4zOCAxNCAxMiAxNHMtMi41LTEuMTItMi41LTIuNVMxMC42MiA5IDEyIDltMC0yYy0yLjQ4IDAtNC41IDIuMDItNC41IDQuNVM5LjUyIDE2IDEyIDE2czQuNS0yLjAyIDQuNS00LjVTMTQuNDggNyAxMiA3eiIvPjwvc3ZnPg==";
Editor.lockedImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PGcgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBvcGFjaXR5PSIuODciLz48L2c+PHBhdGggZD0iTTE4IDhoLTFWNmMwLTIuNzYtMi4yNC01LTUtNVM3IDMuMjQgNyA2djJINmMtMS4xIDAtMiAuOS0yIDJ2MTBjMCAxLjEuOSAyIDIgMmgxMmMxLjEgMCAyLS45IDItMlYxMGMwLTEuMS0uOS0yLTItMnpNOSA2YzAtMS42NiAxLjM0LTMgMy0zczMgMS4zNCAzIDN2Mkg5VjZ6bTkgMTRINlYxMGgxMnYxMHptLTYtM2MxLjEgMCAyLS45IDItMnMtLjktMi0yLTItMiAuOS0yIDIgLjkgMiAyIDJ6Ii8+PC9zdmc+";
Editor.unlockedImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE4IDhoLTFWNmMwLTIuNzYtMi4yNC01LTUtNVM3IDMuMjQgNyA2aDJjMC0xLjY2IDEuMzQtMyAzLTNzMyAxLjM0IDMgM3YySDZjLTEuMSAwLTIgLjktMiAydjEwYzAgMS4xLjkgMiAyIDJoMTJjMS4xIDAgMi0uOSAyLTJWMTBjMC0xLjEtLjktMi0yLTJ6bTAgMTJINlYxMGgxMnYxMHptLTYtM2MxLjEgMCAyLS45IDItMnMtLjktMi0yLTItMiAuOS0yIDIgLjkgMiAyIDJ6Ii8+PC9zdmc+";
Editor.printImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDhoLTFWM0g2djVINWMtMS42NiAwLTMgMS4zNC0zIDN2Nmg0djRoMTJ2LTRoNHYtNmMwLTEuNjYtMS4zNC0zLTMtM3pNOCA1aDh2M0g4VjV6bTggMTJ2Mkg4di00aDh2MnptMi0ydi0ySDZ2Mkg0di00YzAtLjU1LjQ1LTEgMS0xaDE0Yy41NSAwIDEgLjQ1IDEgMXY0aC0yeiIvPjxjaXJjbGUgY3g9IjE4IiBjeT0iMTEuNSIgcj0iMSIvPjwvc3ZnPg==";
Editor.refreshImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE3LjY1IDYuMzVDMTYuMiA0LjkgMTQuMjEgNCAxMiA0Yy00LjQyIDAtNy45OSAzLjU4LTcuOTkgOHMzLjU3IDggNy45OSA4YzMuNzMgMCA2Ljg0LTIuNTUgNy43My02aC0yLjA4Yy0uODIgMi4zMy0zLjA0IDQtNS42NSA0LTMuMzEgMC02LTIuNjktNi02czIuNjktNiA2LTZjMS42NiAwIDMuMTQuNjkgNC4yMiAxLjc4TDEzIDExaDdWNGwtMi4zNSAyLjM1eiIvPjwvc3ZnPg==";
Editor.backImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIiBvcGFjaXR5PSIuODciLz48cGF0aCBkPSJNMTcuNTEgMy44N0wxNS43MyAyLjEgNS44NCAxMmw5LjkgOS45IDEuNzctMS43N0w5LjM4IDEybDguMTMtOC4xM3oiLz48L3N2Zz4=";Editor.closeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIiBvcGFjaXR5PSIuODciLz48cGF0aCBkPSJNMTIgMkM2LjQ3IDIgMiA2LjQ3IDIgMTJzNC40NyAxMCAxMCAxMCAxMC00LjQ3IDEwLTEwUzE3LjUzIDIgMTIgMnptMCAxOGMtNC40MSAwLTgtMy41OS04LThzMy41OS04IDgtOCA4IDMuNTkgOCA4LTMuNTkgOC04IDh6bTMuNTktMTNMMTIgMTAuNTkgOC40MSA3IDcgOC40MSAxMC41OSAxMiA3IDE1LjU5IDguNDEgMTcgMTIgMTMuNDEgMTUuNTkgMTcgMTcgMTUuNTkgMTMuNDEgMTIgMTcgOC40MXoiLz48L3N2Zz4=";
Editor.closeBlackImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjZweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjZweCI+PGVsbGlwc2UgY3g9IjEyIiBjeT0iMTIiIHJ4PSI5IiByeT0iOSIgc3Ryb2tlPSJub25lIiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE0LjU5IDhMMTIgMTAuNTkgOS40MSA4IDggOS40MSAxMC41OSAxMiA4IDE0LjU5IDkuNDEgMTYgMTIgMTMuNDEgMTQuNTkgMTYgMTYgMTQuNTkgMTMuNDEgMTIgMTYgOS40MSAxNC41OSA4ek0xMiAyQzYuNDcgMiAyIDYuNDcgMiAxMnM0LjQ3IDEwIDEwIDEwIDEwLTQuNDcgMTAtMTBTMTcuNTMgMiAxMiAyem0wIDE4Yy00LjQxIDAtOC0zLjU5LTgtOHMzLjU5LTggOC04IDggMy41OSA4IDgtMy41OSA4LTggOHoiLz48L3N2Zz4=";
Editor.plusImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==";Editor.shapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0cHgiIGZpbGw9IiMwMDAwMDAiPjxnPjxwYXRoIGQ9Ik0wLDBoMjR2MjRIMFYweiIgZmlsbD0ibm9uZSIvPjwvZz48Zz48Zz48cGF0aCBkPSJNMywxMWg4VjNIM1YxMXogTTUsNWg0djRINVY1eiIvPjxwYXRoIGQ9Ik0xMywzdjhoOFYzSDEzeiBNMTksOWgtNFY1aDRWOXoiLz48cGF0aCBkPSJNMywyMWg4di04SDNWMjF6IE01LDE1aDR2NEg1VjE1eiIvPjxwb2x5Z29uIHBvaW50cz0iMTgsMTMgMTYsMTMgMTYsMTYgMTMsMTYgMTMsMTggMTYsMTggMTYsMjEgMTgsMjEgMTgsMTggMjEsMTggMjEsMTYgMTgsMTYiLz48L2c+PC9nPjwvc3ZnPg==";
Editor.formatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==";
Editor.freehandImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHJlY3QgZmlsbD0ibm9uZSIgaGVpZ2h0PSIyNCIgd2lkdGg9IjI0Ii8+PHBhdGggZD0iTTQuNSw4YzEuMDQsMCwyLjM0LTEuNSw0LjI1LTEuNWMxLjUyLDAsMi43NSwxLjIzLDIuNzUsMi43NWMwLDIuMDQtMS45OSwzLjE1LTMuOTEsNC4yMkM1LjQyLDE0LjY3LDQsMTUuNTcsNCwxNyBjMCwxLjEsMC45LDIsMiwydjJjLTIuMjEsMC00LTEuNzktNC00YzAtMi43MSwyLjU2LTQuMTQsNC42Mi01LjI4YzEuNDItMC43OSwyLjg4LTEuNiwyLjg4LTIuNDdjMC0wLjQxLTAuMzQtMC43NS0wLjc1LTAuNzUgQzcuNSw4LjUsNi4yNSwxMCw0LjUsMTBDMy4xMiwxMCwyLDguODgsMiw3LjVDMiw1LjQ1LDQuMTcsMi44Myw1LDJsMS40MSwxLjQxQzUuNDEsNC40Miw0LDYuNDMsNCw3LjVDNCw3Ljc4LDQuMjIsOCw0LjUsOHogTTgsMjEgbDMuNzUsMGw4LjA2LTguMDZsLTMuNzUtMy43NUw4LDE3LjI1TDgsMjF6IE0xMCwxOC4wOGw2LjA2LTYuMDZsMC45MiwwLjkyTDEwLjkyLDE5TDEwLDE5TDEwLDE4LjA4eiBNMjAuMzcsNi4yOSBjLTAuMzktMC4zOS0xLjAyLTAuMzktMS40MSwwbC0xLjgzLDEuODNsMy43NSwzLjc1bDEuODMtMS44M2MwLjM5LTAuMzksMC4zOS0xLjAyLDAtMS40MUwyMC4zNyw2LjI5eiIvPjwvc3ZnPg==";
Editor.undoImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+";Editor.redoImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTguNCAxMC42QzE2LjU1IDguOTkgMTQuMTUgOCAxMS41IDhjLTQuNjUgMC04LjU4IDMuMDMtOS45NiA3LjIyTDMuOSAxNmMxLjA1LTMuMTkgNC4wNS01LjUgNy42LTUuNSAxLjk1IDAgMy43My43MiA1LjEyIDEuODhMMTMgMTZoOVY3bC0zLjYgMy42eiIvPjwvc3ZnPg==";
Editor.outlineImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjxwYXRoIGQ9Ik0yMC41IDNsLS4xNi4wM0wxNSA1LjEgOSAzIDMuMzYgNC45Yy0uMjEuMDctLjM2LjI1LS4zNi40OFYyMC41YzAgLjI4LjIyLjUuNS41bC4xNi0uMDNMOSAxOC45bDYgMi4xIDUuNjQtMS45Yy4yMS0uMDcuMzYtLjI1LjM2LS40OFYzLjVjMC0uMjgtLjIyLS41LS41LS41ek0xNSAxOWwtNi0yLjExVjVsNiAyLjExVjE5eiIvPjwvc3ZnPg==";
Editor.saveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDEydjdINXYtN0gzdjdjMCAxLjEuOSAyIDIgMmgxNGMxLjEgMCAyLS45IDItMnYtN2gtMnptLTYgLjY3bDIuNTktMi41OEwxNyAxMS41bC01IDUtNS01IDEuNDEtMS40MUwxMSAxMi42N1YzaDJ2OS42N3oiLz48L3N2Zz4=";Editor.helpImage=Editor.lightHelpImage;Editor.checkmarkImage=Editor.lightCheckmarkImage;
Editor.roughFillStyles=[{val:"auto",dispName:"Auto"},{val:"hachure",dispName:"Hachure"},{val:"solid",dispName:"Solid"},{val:"zigzag",dispName:"ZigZag"},{val:"cross-hatch",dispName:"Cross Hatch"},{val:"dashed",dispName:"Dashed"},{val:"zigzag-line",dispName:"ZigZag Line"}];
Editor.fillStyles=[{val:"auto",dispName:"Auto"},{val:"hatch",dispName:"Hatch"},{val:"solid",dispName:"Solid"},{val:"dots",dispName:"Dots"},{val:"cross-hatch",dispName:"Cross Hatch"},{val:"dashed",dispName:"Dashed"},{val:"zigzag-line",dispName:"ZigZag Line"}];Editor.themes=null;Editor.ctrlKey=mxClient.IS_MAC?"Cmd":"Ctrl";Editor.hintOffset=20;Editor.shapePickerHoverDelay=300;Editor.fitWindowBorders=null;Editor.popupsAllowed=null!=window.urlParams?"1"!=urlParams.noDevice:!0;Editor.simpleLabels=!1;
Editor.enableNativeCipboard=window==window.top&&!mxClient.IS_FF&&null!=navigator.clipboard;Editor.sketchMode=!1;Editor.darkMode=!1;Editor.currentTheme=uiTheme;Editor.darkColor="#2a2a2a";Editor.lightColor="#f0f0f0";Editor.isDarkMode=function(b){return Editor.darkMode};Editor.isPngDataUrl=function(b){return null!=b&&"data:image/png;"==b.substring(0,15)};
Editor.isPngData=function(b){return 8<b.length&&137==b.charCodeAt(0)&&80==b.charCodeAt(1)&&78==b.charCodeAt(2)&&71==b.charCodeAt(3)&&13==b.charCodeAt(4)&&10==b.charCodeAt(5)&&26==b.charCodeAt(6)&&10==b.charCodeAt(7)};
Editor.extractGraphModelFromPng=function(b){var d=null;try{var g=b.substring(b.indexOf(",")+1),l=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0);EditorUi.parsePng(l,mxUtils.bind(this,function(D,p,E){D=l.substring(D+8,D+8+E);"zTXt"==p?(E=D.indexOf(String.fromCharCode(0)),"mxGraphModel"==D.substring(0,E)&&(D=pako.inflateRaw(Graph.stringToArrayBuffer(D.substring(E+2)),{to:"string"}).replace(/\+/g," "),null!=D&&0<D.length&&(d=D))):"tEXt"==p&&(D=D.split(String.fromCharCode(0)),1<D.length&&("mxGraphModel"==
D[0]||"mxfile"==D[0])&&(d=D[1]));if(null!=d||"IDAT"==p)return!0}))}catch(D){}null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));return d};mxUtils.extend(Editor,mxEventSource);Editor.prototype.originalNoForeignObject=mxClient.NO_FO;Editor.prototype.transparentImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhMAAwAIAAAP///wAAACH5BAEAAAAALAAAAAAwADAAAAIxhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8egpAAA7":IMAGE_PATH+"/transparent.gif";
Editor.prototype.extendCanvas=!0;Editor.prototype.chromeless=!1;Editor.prototype.cancelFirst=!0;Editor.prototype.enabled=!0;Editor.prototype.filename=null;Editor.prototype.modified=!1;Editor.prototype.autosave=!0;Editor.prototype.initialTopSpacing=0;Editor.prototype.appName=document.title;Editor.prototype.editBlankUrl=window.location.protocol+"//"+window.location.host+"/";Editor.prototype.defaultGraphOverflow="hidden";Editor.prototype.init=function(){};Editor.prototype.isChromelessView=function(){return this.chromeless};
Editor.prototype.setAutosave=function(b){this.autosave=b;this.fireEvent(new mxEventObject("autosaveChanged"))};Editor.prototype.getEditBlankUrl=function(b){return this.editBlankUrl+b};
Editor.prototype.editAsNew=function(b,d){d=null!=d?"?title="+encodeURIComponent(d):"";null!=urlParams.ui&&(d+=(0<d.length?"&":"?")+"ui="+urlParams.ui);if("undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)){var g=null,l=mxUtils.bind(this,function(D){"ready"==D.data&&D.source==g&&(mxEvent.removeListener(window,"message",l),g.postMessage(b,"*"))});mxEvent.addListener(window,"message",l);g=this.graph.openLink(this.getEditBlankUrl(d+(0<d.length?"&":"?")+"client=1"),
null,!0)}else this.graph.openLink(this.getEditBlankUrl(d)+"#R"+encodeURIComponent(b))};Editor.prototype.createGraph=function(b,d){b=new Graph(null,d,null,null,b);b.transparentBackground=!1;var g=b.isCssTransformsSupported,l=this;b.isCssTransformsSupported=function(){return g.apply(this,arguments)&&(!l.chromeless||!mxClient.IS_SF)};this.chromeless||(b.isBlankLink=function(D){return!this.isExternalProtocol(D)});return b};
Editor.prototype.resetGraph=function(){this.graph.gridEnabled=this.graph.defaultGridEnabled&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.graphHandler.guidesEnabled=!0;this.graph.setTooltips(!0);this.graph.setConnectable(!0);this.graph.foldingEnabled=!0;this.graph.scrollbars=this.graph.defaultScrollbars;this.graph.pageVisible=this.graph.defaultPageVisible;this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;this.graph.background=
null;this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.pageFormat=mxGraph.prototype.pageFormat;this.graph.currentScale=1;this.graph.currentTranslate.x=0;this.graph.currentTranslate.y=0;this.updateGraphComponents();this.graph.view.setScale(1)};
Editor.prototype.readGraphState=function(b){var d=b.getAttribute("grid");if(null==d||""==d)d=this.graph.defaultGridEnabled?"1":"0";this.graph.gridEnabled="0"!=d&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.gridSize=parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize;this.graph.graphHandler.guidesEnabled="0"!=b.getAttribute("guides");this.graph.setTooltips("0"!=b.getAttribute("tooltips"));this.graph.setConnectable("0"!=b.getAttribute("connect"));this.graph.connectionArrowsEnabled=
"0"!=b.getAttribute("arrows");this.graph.foldingEnabled="0"!=b.getAttribute("fold");this.isChromelessView()&&this.graph.foldingEnabled&&(this.graph.foldingEnabled="1"==urlParams.nav,this.graph.cellRenderer.forceControlClickHandler=this.graph.foldingEnabled);d=parseFloat(b.getAttribute("pageScale"));!isNaN(d)&&0<d?this.graph.pageScale=d:this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.isLightboxView()||this.graph.isViewer()?this.graph.pageVisible=!1:(d=b.getAttribute("page"),this.graph.pageVisible=
null!=d?"0"!=d:this.graph.defaultPageVisible);this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;d=parseFloat(b.getAttribute("pageWidth"));var g=parseFloat(b.getAttribute("pageHeight"));isNaN(d)||isNaN(g)||(this.graph.pageFormat=new mxRectangle(0,0,d,g));b=b.getAttribute("background");this.graph.background=null!=b&&0<b.length?b:null};
Editor.prototype.setGraphXml=function(b){if(null!=b){var d=new mxCodec(b.ownerDocument);if("mxGraphModel"==b.nodeName){this.graph.model.beginUpdate();try{this.graph.model.clear(),this.graph.view.scale=1,this.readGraphState(b),this.updateGraphComponents(),d.decode(b,this.graph.getModel())}finally{this.graph.model.endUpdate()}this.fireEvent(new mxEventObject("resetGraphView"))}else if("root"==b.nodeName){this.resetGraph();var g=d.document.createElement("mxGraphModel");g.appendChild(b);d.decode(g,this.graph.getModel());
this.updateGraphComponents();this.fireEvent(new mxEventObject("resetGraphView"))}else throw{message:mxResources.get("cannotOpenFile"),node:b,toString:function(){return this.message}};}else this.resetGraph(),this.graph.model.clear(),this.fireEvent(new mxEventObject("resetGraphView"))};
Editor.prototype.getGraphXml=function(b){b=(null!=b?b:1)?(new mxCodec(mxUtils.createXmlDocument())).encode(this.graph.getModel()):this.graph.encodeCells(mxUtils.sortCells(this.graph.model.getTopmostCells(this.graph.getSelectionCells())));if(0!=this.graph.view.translate.x||0!=this.graph.view.translate.y)b.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),b.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100);b.setAttribute("grid",this.graph.isGridEnabled()?"1":"0");b.setAttribute("gridSize",
this.graph.gridSize);b.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");b.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");b.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0");b.setAttribute("arrows",this.graph.connectionArrowsEnabled?"1":"0");b.setAttribute("fold",this.graph.foldingEnabled?"1":"0");b.setAttribute("page",this.graph.pageVisible?"1":"0");b.setAttribute("pageScale",this.graph.pageScale);b.setAttribute("pageWidth",this.graph.pageFormat.width);
b.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&b.setAttribute("background",this.graph.background);return b};Editor.prototype.updateGraphComponents=function(){var b=this.graph;null!=b.container&&(b.view.validateBackground(),b.container.style.overflow=b.scrollbars?"auto":this.defaultGraphOverflow,this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(b){this.modified=b};
Editor.prototype.setFilename=function(b){this.filename=b};
Editor.prototype.createUndoManager=function(){var b=this.graph,d=new mxUndoManager;this.undoListener=function(l,D){d.undoableEditHappened(D.getProperty("edit"))};var g=mxUtils.bind(this,function(l,D){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,g);b.getView().addListener(mxEvent.UNDO,g);g=function(l,D){l=b.getSelectionCellsForChanges(D.getProperty("edit").changes,function(E){return!(E instanceof mxChildChange)});if(0<l.length){b.getModel();D=[];for(var p=0;p<l.length;p++)null!=
b.view.getState(l[p])&&D.push(l[p]);b.setSelectionCells(D)}};d.addListener(mxEvent.UNDO,g);d.addListener(mxEvent.REDO,g);return d};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(b){this.consumer=this.producer=null;this.done=b;this.args=null};OpenFile.prototype.setConsumer=function(b){this.consumer=b;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};
OpenFile.prototype.error=function(b){this.cancel(!0);mxUtils.alert(b)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(b){null!=this.done&&this.done(null!=b?b:!0)};
function Dialog(b,d,g,l,D,p,E,N,R,G,M){var Q=R?57:0,e=g,f=l,k=R?0:64,z=Editor.inlineFullscreen||null==b.embedViewport?mxUtils.getDocumentSize():mxUtils.clone(b.embedViewport);null==b.embedViewport&&null!=window.innerHeight&&(z.height=window.innerHeight);var t=z.height,B=Math.max(1,Math.round((z.width-g-k)/2)),I=Math.max(1,Math.round((t-l-b.footerHeight)/3));d.style.maxHeight="100%";g=null!=document.body?Math.min(g,document.body.scrollWidth-k):g;l=Math.min(l,t-k);0<b.dialogs.length&&(this.zIndex+=
2*b.dialogs.length);null==this.bg&&(this.bg=b.createDiv("background"),this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=t+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity));z=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=z.x+"px";this.bg.style.top=z.y+"px";B+=z.x;I+=z.y;Editor.inlineFullscreen||null==b.embedViewport||(this.bg.style.height=mxUtils.getDocumentSize().height+"px",
I+=b.embedViewport.y,B+=b.embedViewport.x);D&&document.body.appendChild(this.bg);var O=b.createDiv(R?"geTransDialog":"geDialog");D=this.getPosition(B,I,g,l);B=D.x;I=D.y;O.style.width=g+"px";O.style.height=l+"px";O.style.left=B+"px";O.style.top=I+"px";O.style.zIndex=this.zIndex;O.appendChild(d);document.body.appendChild(O);!N&&d.clientHeight>O.clientHeight-k&&(d.style.overflowY="auto");d.style.overflowX="hidden";if(p&&(p=document.createElement("img"),p.setAttribute("src",Dialog.prototype.closeImage),
p.setAttribute("title",mxResources.get("close")),p.className="geDialogClose",p.style.top=I+14+"px",p.style.left=B+g+38-Q+"px",p.style.zIndex=this.zIndex,mxEvent.addListener(p,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),document.body.appendChild(p),this.dialogImg=p,!M)){var J=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(y){J=!0}),null,mxUtils.bind(this,function(y){J&&(b.hideDialog(!0),J=!1)}))}this.resizeListener=mxUtils.bind(this,function(){if(null!=G){var y=G();
null!=y&&(e=g=y.w,f=l=y.h)}y=mxUtils.getDocumentSize();t=y.height;this.bg.style.height=t+"px";Editor.inlineFullscreen||null==b.embedViewport||(this.bg.style.height=mxUtils.getDocumentSize().height+"px");B=Math.max(1,Math.round((y.width-g-k)/2));I=Math.max(1,Math.round((t-l-b.footerHeight)/3));g=null!=document.body?Math.min(e,document.body.scrollWidth-k):e;l=Math.min(f,t-k);y=this.getPosition(B,I,g,l);B=y.x;I=y.y;O.style.left=B+"px";O.style.top=I+"px";O.style.width=g+"px";O.style.height=l+"px";!N&&
d.clientHeight>O.clientHeight-k&&(d.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=I+14+"px",this.dialogImg.style.left=B+g+38-Q+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=E;this.container=O;b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white";Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-2;
Dialog.prototype.noColorImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC":IMAGE_PATH+
"/nocolor.png";Dialog.prototype.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==":IMAGE_PATH+"/close.png";
Dialog.prototype.clearImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==":IMAGE_PATH+
"/clear.gif";Dialog.prototype.bgOpacity=80;Dialog.prototype.getPosition=function(b,d){return new mxPoint(b,d)};Dialog.prototype.close=function(b,d){if(null!=this.onDialogClose){if(0==this.onDialogClose(b,d))return!1;this.onDialogClose=null}null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);mxEvent.removeListener(window,"resize",this.resizeListener);this.container.parentNode.removeChild(this.container)};
var ErrorDialog=function(b,d,g,l,D,p,E,N,R,G,M){R=null!=R?R:!0;var Q=document.createElement("div");Q.style.textAlign="center";if(null!=d){var e=document.createElement("div");e.style.padding="0px";e.style.margin="0px";e.style.fontSize="18px";e.style.paddingBottom="16px";e.style.marginBottom="10px";e.style.borderBottom="1px solid #c0c0c0";e.style.color="gray";e.style.whiteSpace="nowrap";e.style.textOverflow="ellipsis";e.style.overflow="hidden";mxUtils.write(e,d);e.setAttribute("title",d);Q.appendChild(e)}d=
document.createElement("div");d.style.lineHeight="1.2em";d.style.padding="6px";d.innerHTML=g;Q.appendChild(d);g=document.createElement("div");g.style.marginTop="12px";g.style.textAlign="center";null!=p&&(d=mxUtils.button(mxResources.get("tryAgain"),function(){b.hideDialog();p()}),d.className="geBtn",g.appendChild(d),g.style.textAlign="center");null!=G&&(G=mxUtils.button(G,function(){null!=M&&M()}),G.className="geBtn",g.appendChild(G));var f=mxUtils.button(l,function(){R&&b.hideDialog();null!=D&&D()});
f.className="geBtn";g.appendChild(f);null!=E&&(l=mxUtils.button(E,function(){R&&b.hideDialog();null!=N&&N()}),l.className="geBtn gePrimaryBtn",g.appendChild(l));this.init=function(){f.focus()};Q.appendChild(g);this.container=Q},PrintDialog=function(b,d){this.create(b,d)};
PrintDialog.prototype.create=function(b){function d(f){var k=E.checked||G.checked,z=parseInt(Q.value)/100;isNaN(z)&&(z=1,Q.value="100%");z*=.75;var t=g.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,B=1/g.pageScale;if(k){var I=E.checked?1:parseInt(M.value);isNaN(I)||(B=mxUtils.getScaleForPageCount(I,g,t))}g.getGraphBounds();var O=I=0;t=mxRectangle.fromRectangle(t);t.width=Math.ceil(t.width*z);t.height=Math.ceil(t.height*z);B*=z;!k&&g.pageVisible?(z=g.getPageLayout(),I-=z.x*t.width,O-=z.y*t.height):
k=!0;k=PrintDialog.createPrintPreview(g,B,t,0,I,O,k);k.open();f&&PrintDialog.printPreview(k)}var g=b.editor.graph,l=document.createElement("table");l.style.width="100%";l.style.height="100%";var D=document.createElement("tbody");var p=document.createElement("tr");var E=document.createElement("input");E.setAttribute("type","checkbox");var N=document.createElement("td");N.setAttribute("colspan","2");N.style.fontSize="10pt";N.appendChild(E);var R=document.createElement("span");mxUtils.write(R," "+mxResources.get("fitPage"));
N.appendChild(R);mxEvent.addListener(R,"click",function(f){E.checked=!E.checked;G.checked=!E.checked;mxEvent.consume(f)});mxEvent.addListener(E,"change",function(){G.checked=!E.checked});p.appendChild(N);D.appendChild(p);p=p.cloneNode(!1);var G=document.createElement("input");G.setAttribute("type","checkbox");N=document.createElement("td");N.style.fontSize="10pt";N.appendChild(G);R=document.createElement("span");mxUtils.write(R," "+mxResources.get("posterPrint")+":");N.appendChild(R);mxEvent.addListener(R,
"click",function(f){G.checked=!G.checked;E.checked=!G.checked;mxEvent.consume(f)});p.appendChild(N);var M=document.createElement("input");M.setAttribute("value","1");M.setAttribute("type","number");M.setAttribute("min","1");M.setAttribute("size","4");M.setAttribute("disabled","disabled");M.style.width="50px";N=document.createElement("td");N.style.fontSize="10pt";N.appendChild(M);mxUtils.write(N," "+mxResources.get("pages")+" (max)");p.appendChild(N);D.appendChild(p);mxEvent.addListener(G,"change",
function(){G.checked?M.removeAttribute("disabled"):M.setAttribute("disabled","disabled");E.checked=!G.checked});p=p.cloneNode(!1);N=document.createElement("td");mxUtils.write(N,mxResources.get("pageScale")+":");p.appendChild(N);N=document.createElement("td");var Q=document.createElement("input");Q.setAttribute("value","100 %");Q.setAttribute("size","5");Q.style.width="50px";N.appendChild(Q);p.appendChild(N);D.appendChild(p);p=document.createElement("tr");N=document.createElement("td");N.colSpan=2;
N.style.paddingTop="20px";N.setAttribute("align","right");R=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});R.className="geBtn";b.editor.cancelFirst&&N.appendChild(R);if(PrintDialog.previewEnabled){var e=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();d(!1)});e.className="geBtn";N.appendChild(e)}e=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();d(!0)});e.className="geBtn gePrimaryBtn";N.appendChild(e);b.editor.cancelFirst||
N.appendChild(R);p.appendChild(N);D.appendChild(p);l.appendChild(D);this.container=l};PrintDialog.printPreview=function(b){try{if(null!=b.wnd){var d=function(){b.wnd.focus();b.wnd.print();b.wnd.close()};mxClient.IS_GC?window.setTimeout(d,500):d()}}catch(g){}};
PrintDialog.createPrintPreview=function(b,d,g,l,D,p,E){d=new mxPrintPreview(b,d,g,l,D,p);d.title=mxResources.get("preview");d.printBackgroundImage=!0;d.autoOrigin=E;b=b.background;if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";d.backgroundColor=b;var N=d.writeHead;d.writeHead=function(R){N.apply(this,arguments);R.writeln('<style type="text/css">');R.writeln("@media screen {");R.writeln("  body > div { padding:30px;box-sizing:content-box; }");R.writeln("}");R.writeln("</style>")};return d};
PrintDialog.previewEnabled=!0;
var PageSetupDialog=function(b){function d(){null==M||M==mxConstants.NONE?(G.style.backgroundColor="",G.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(G.style.backgroundColor=M,G.style.backgroundImage="")}function g(){var t=k;null!=t&&Graph.isPageLink(t.src)&&(t=b.createImageForPageLink(t.src,null));null!=t&&null!=t.src?(f.setAttribute("src",t.src),f.style.display=""):(f.removeAttribute("src"),f.style.display="none")}var l=b.editor.graph,D=document.createElement("table");D.style.width=
"100%";D.style.height="100%";var p=document.createElement("tbody");var E=document.createElement("tr");var N=document.createElement("td");N.style.verticalAlign="top";N.style.fontSize="10pt";mxUtils.write(N,mxResources.get("paperSize")+":");E.appendChild(N);N=document.createElement("td");N.style.verticalAlign="top";N.style.fontSize="10pt";var R=PageSetupDialog.addPageFormatPanel(N,"pagesetupdialog",l.pageFormat);E.appendChild(N);p.appendChild(E);E=document.createElement("tr");N=document.createElement("td");
mxUtils.write(N,mxResources.get("background")+":");E.appendChild(N);N=document.createElement("td");N.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var G=document.createElement("button");G.style.width="22px";G.style.height="22px";G.style.cursor="pointer";G.style.marginRight="20px";G.style.backgroundPosition="center center";G.style.backgroundRepeat="no-repeat";mxClient.IS_FF&&(G.style.position="relative",G.style.top="-6px");var M=l.background;d();mxEvent.addListener(G,
"click",function(t){b.pickColor(M||"none",function(B){M=B;d()});mxEvent.consume(t)});N.appendChild(G);mxUtils.write(N,mxResources.get("gridSize")+":");var Q=document.createElement("input");Q.setAttribute("type","number");Q.setAttribute("min","0");Q.style.width="40px";Q.style.marginLeft="6px";Q.value=l.getGridSize();N.appendChild(Q);mxEvent.addListener(Q,"change",function(){var t=parseInt(Q.value);Q.value=Math.max(1,isNaN(t)?l.getGridSize():t)});E.appendChild(N);p.appendChild(E);E=document.createElement("tr");
N=document.createElement("td");mxUtils.write(N,mxResources.get("image")+":");E.appendChild(N);N=document.createElement("td");var e=document.createElement("button");e.className="geBtn";e.style.margin="0px";mxUtils.write(e,mxResources.get("change")+"...");var f=document.createElement("img");f.setAttribute("valign","middle");f.style.verticalAlign="middle";f.style.border="1px solid lightGray";f.style.borderRadius="4px";f.style.marginRight="14px";f.style.maxWidth="100px";f.style.cursor="pointer";f.style.height=
"60px";f.style.padding="4px";var k=l.backgroundImage,z=function(t){b.showBackgroundImageDialog(function(B,I){I||(k=B,g())},k);mxEvent.consume(t)};mxEvent.addListener(e,"click",z);mxEvent.addListener(f,"click",z);g();N.appendChild(f);N.appendChild(e);E.appendChild(N);p.appendChild(E);E=document.createElement("tr");N=document.createElement("td");N.colSpan=2;N.style.paddingTop="16px";N.setAttribute("align","right");e=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});e.className="geBtn";
b.editor.cancelFirst&&N.appendChild(e);z=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var t=parseInt(Q.value);isNaN(t)||l.gridSize===t||l.setGridSize(t);t=new ChangePageSetup(b,M,k,R.get());t.ignoreColor=l.background==M;t.ignoreImage=(null!=l.backgroundImage?l.backgroundImage.src:null)===(null!=k?k.src:null);l.pageFormat.width==t.previousFormat.width&&l.pageFormat.height==t.previousFormat.height&&t.ignoreColor&&t.ignoreImage||l.model.execute(t)});z.className="geBtn gePrimaryBtn";
N.appendChild(z);b.editor.cancelFirst||N.appendChild(e);E.appendChild(N);p.appendChild(E);D.appendChild(p);this.container=D};
PageSetupDialog.addPageFormatPanel=function(b,d,g,l){function D(y,ia,da){if(da||Q!=document.activeElement&&e!=document.activeElement){y=!1;for(ia=0;ia<k.length;ia++)da=k[ia],I?"custom"==da.key&&(N.value=da.key,I=!1):null!=da.format&&("a4"==da.key?826==g.width?(g=mxRectangle.fromRectangle(g),g.width=827):826==g.height&&(g=mxRectangle.fromRectangle(g),g.height=827):"a5"==da.key&&(584==g.width?(g=mxRectangle.fromRectangle(g),g.width=583):584==g.height&&(g=mxRectangle.fromRectangle(g),g.height=583)),
g.width==da.format.width&&g.height==da.format.height?(N.value=da.key,p.setAttribute("checked","checked"),p.defaultChecked=!0,p.checked=!0,E.removeAttribute("checked"),E.defaultChecked=!1,E.checked=!1,y=!0):g.width==da.format.height&&g.height==da.format.width&&(N.value=da.key,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,E.setAttribute("checked","checked"),E.defaultChecked=!0,y=E.checked=!0));y?(R.style.display="",M.style.display="none"):(Q.value=g.width/100,e.value=g.height/100,p.setAttribute("checked",
"checked"),N.value="custom",R.style.display="none",M.style.display="")}}d="format-"+d;var p=document.createElement("input");p.setAttribute("name",d);p.setAttribute("type","radio");p.setAttribute("value","portrait");var E=document.createElement("input");E.setAttribute("name",d);E.setAttribute("type","radio");E.setAttribute("value","landscape");var N=document.createElement("select");N.style.marginBottom="8px";N.style.borderRadius="4px";N.style.border="1px solid rgb(160, 160, 160)";N.style.width="206px";
var R=document.createElement("div");R.style.marginLeft="4px";R.style.width="210px";R.style.height="24px";p.style.marginRight="6px";R.appendChild(p);d=document.createElement("span");d.style.maxWidth="100px";mxUtils.write(d,mxResources.get("portrait"));R.appendChild(d);E.style.marginLeft="10px";E.style.marginRight="6px";R.appendChild(E);var G=document.createElement("span");G.style.width="100px";mxUtils.write(G,mxResources.get("landscape"));R.appendChild(G);var M=document.createElement("div");M.style.marginLeft=
"4px";M.style.width="210px";M.style.height="24px";var Q=document.createElement("input");Q.setAttribute("size","7");Q.style.textAlign="right";M.appendChild(Q);mxUtils.write(M," in x ");var e=document.createElement("input");e.setAttribute("size","7");e.style.textAlign="right";M.appendChild(e);mxUtils.write(M," in");R.style.display="none";M.style.display="none";for(var f={},k=PageSetupDialog.getFormats(),z=0;z<k.length;z++){var t=k[z];f[t.key]=t;var B=document.createElement("option");B.setAttribute("value",
t.key);mxUtils.write(B,t.title);N.appendChild(B)}var I=!1;D();b.appendChild(N);mxUtils.br(b);b.appendChild(R);b.appendChild(M);var O=g,J=function(y,ia){y=f[N.value];null!=y.format?(Q.value=y.format.width/100,e.value=y.format.height/100,M.style.display="none",R.style.display=""):(R.style.display="none",M.style.display="");y=parseFloat(Q.value);if(isNaN(y)||0>=y)Q.value=g.width/100;y=parseFloat(e.value);if(isNaN(y)||0>=y)e.value=g.height/100;y=new mxRectangle(0,0,Math.floor(100*parseFloat(Q.value)),
Math.floor(100*parseFloat(e.value)));"custom"!=N.value&&E.checked&&(y=new mxRectangle(0,0,y.height,y.width));ia&&I||y.width==O.width&&y.height==O.height||(O=y,null!=l&&l(O))};mxEvent.addListener(d,"click",function(y){p.checked=!0;J(y);mxEvent.consume(y)});mxEvent.addListener(G,"click",function(y){E.checked=!0;J(y);mxEvent.consume(y)});mxEvent.addListener(Q,"blur",J);mxEvent.addListener(Q,"click",J);mxEvent.addListener(e,"blur",J);mxEvent.addListener(e,"click",J);mxEvent.addListener(E,"change",J);
mxEvent.addListener(p,"change",J);mxEvent.addListener(N,"change",function(y){I="custom"==N.value;J(y,!0)});J();return{set:function(y){g=y;D(null,null,!0)},get:function(){return O},widthInput:Q,heightInput:e}};
PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:'US-Tabloid (11" x 17")',format:new mxRectangle(0,0,1100,1700)},{key:"executive",title:'US-Executive (7" x 10")',format:new mxRectangle(0,0,700,1E3)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",
format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},
{key:"b4",title:"B4 (250 mm x 353 mm)",format:new mxRectangle(0,0,980,1390)},{key:"b5",title:"B5 (176 mm x 250 mm)",format:new mxRectangle(0,0,690,980)},{key:"16-9",title:"16:9 (1600 x 900)",format:new mxRectangle(0,0,900,1600)},{key:"16-10",title:"16:10 (1920 x 1200)",format:new mxRectangle(0,0,1200,1920)},{key:"4-3",title:"4:3 (1600 x 1200)",format:new mxRectangle(0,0,1200,1600)},{key:"custom",title:mxResources.get("custom"),format:null}]};
var FilenameDialog=function(b,d,g,l,D,p,E,N,R,G,M,Q,e){R=null!=R?R:!0;var f=document.createElement("table"),k=document.createElement("tbody");f.style.position="absolute";f.style.top="30px";f.style.left="20px";var z=document.createElement("tr");var t=document.createElement("td");t.style.textOverflow="ellipsis";t.style.textAlign="right";t.style.maxWidth=(e?e+15:100)+"px";t.style.fontSize="10pt";t.style.width=(e?e:84)+"px";mxUtils.write(t,(D||mxResources.get("filename"))+":");z.appendChild(t);var B=
document.createElement("input");B.setAttribute("value",d||"");B.style.marginLeft="4px";B.style.width=null!=Q?Q+"px":"180px";var I=mxUtils.button(g,function(){if(null==p||p(B.value))R&&b.hideDialog(),l(B.value)});I.className="geBtn gePrimaryBtn";this.init=function(){if(null!=D||null==E)if(B.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?B.select():document.execCommand("selectAll",!1,null),Graph.fileSupport){var O=f.parentNode;if(null!=O){var J=null;mxEvent.addListener(O,"dragleave",
function(y){null!=J&&(J.style.backgroundColor="",J=null);y.stopPropagation();y.preventDefault()});mxEvent.addListener(O,"dragover",mxUtils.bind(this,function(y){null==J&&(!mxClient.IS_IE||10<document.documentMode)&&(J=B,J.style.backgroundColor="#ebf2f9");y.stopPropagation();y.preventDefault()}));mxEvent.addListener(O,"drop",mxUtils.bind(this,function(y){null!=J&&(J.style.backgroundColor="",J=null);0<=mxUtils.indexOf(y.dataTransfer.types,"text/uri-list")&&(B.value=decodeURIComponent(y.dataTransfer.getData("text/uri-list")),
I.click());y.stopPropagation();y.preventDefault()}))}}};t=document.createElement("td");t.style.whiteSpace="nowrap";t.appendChild(B);z.appendChild(t);if(null!=D||null==E)k.appendChild(z),null!=M&&(t.appendChild(FilenameDialog.createTypeHint(b,B,M)),null!=b.editor.diagramFileTypes&&(z=document.createElement("tr"),t=document.createElement("td"),t.style.textOverflow="ellipsis",t.style.textAlign="right",t.style.maxWidth="100px",t.style.fontSize="10pt",t.style.width="84px",mxUtils.write(t,mxResources.get("type")+
":"),z.appendChild(t),t=document.createElement("td"),t.style.whiteSpace="nowrap",z.appendChild(t),d=FilenameDialog.createFileTypes(b,B,b.editor.diagramFileTypes),d.style.marginLeft="4px",d.style.width="198px",t.appendChild(d),B.style.width=null!=Q?Q-40+"px":"190px",z.appendChild(t),k.appendChild(z)));null!=E&&(z=document.createElement("tr"),t=document.createElement("td"),t.colSpan=2,t.appendChild(E),z.appendChild(t),k.appendChild(z));z=document.createElement("tr");t=document.createElement("td");t.colSpan=
2;t.style.paddingTop=null!=M?"12px":"20px";t.style.whiteSpace="nowrap";t.setAttribute("align","right");M=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=G&&G()});M.className="geBtn";b.editor.cancelFirst&&t.appendChild(M);null!=N&&(Q=mxUtils.button(mxResources.get("help"),function(){b.editor.graph.openLink(N)}),Q.className="geBtn",t.appendChild(Q));mxEvent.addListener(B,"keypress",function(O){13==O.keyCode&&I.click()});t.appendChild(I);b.editor.cancelFirst||t.appendChild(M);
z.appendChild(t);k.appendChild(z);f.appendChild(k);this.container=f};FilenameDialog.filenameHelpLink=null;
FilenameDialog.createTypeHint=function(b,d,g){var l=document.createElement("img");l.style.backgroundPosition="center bottom";l.style.backgroundRepeat="no-repeat";l.style.margin="2px 0 0 4px";l.style.verticalAlign="top";l.style.cursor="pointer";l.style.height="16px";l.style.width="16px";mxUtils.setOpacity(l,70);var D=function(){l.setAttribute("src",Editor.helpImage);l.setAttribute("title",mxResources.get("help"));for(var p=0;p<g.length;p++)if(0<g[p].ext.length&&d.value.toLowerCase().substring(d.value.length-
g[p].ext.length-1)=="."+g[p].ext){l.setAttribute("title",mxResources.get(g[p].title));break}};mxEvent.addListener(d,"keyup",D);mxEvent.addListener(d,"change",D);mxEvent.addListener(l,"click",function(p){var E=l.getAttribute("title");l.getAttribute("src")==Editor.helpImage?b.editor.graph.openLink(FilenameDialog.filenameHelpLink):""!=E&&b.showError(null,E,mxResources.get("help"),function(){b.editor.graph.openLink(FilenameDialog.filenameHelpLink)},null,mxResources.get("ok"),null,null,null,340,90);mxEvent.consume(p)});
D();return l};
FilenameDialog.createFileTypes=function(b,d,g){var l=document.createElement("select");for(b=0;b<g.length;b++){var D=document.createElement("option");D.setAttribute("value",b);mxUtils.write(D,mxResources.get(g[b].description)+" (."+g[b].extension+")");l.appendChild(D)}mxEvent.addListener(l,"change",function(p){p=g[l.value].extension;var E=d.value.lastIndexOf(".drawio.");E=0<E?E:d.value.lastIndexOf(".");"drawio"!=p&&(p="drawio."+p);d.value=0<E?d.value.substring(0,E+1)+p:d.value+"."+p;"createEvent"in
document?(p=document.createEvent("HTMLEvents"),p.initEvent("change",!1,!0),d.dispatchEvent(p)):d.fireEvent("onchange")});b=function(p){p=d.value.toLowerCase();for(var E=0,N=0;N<g.length;N++){var R=g[N].extension,G=null;"drawio"!=R&&(G=R,R=".drawio."+R);if(p.substring(p.length-R.length-1)=="."+R||null!=G&&p.substring(p.length-G.length-1)=="."+G){E=N;break}}l.value=E};mxEvent.addListener(d,"change",b);mxEvent.addListener(d,"keyup",b);b();return l};
var WrapperWindow=function(b,d,g,l,D,p,E){var N=b.createSidebarContainer();E(N);this.window=new mxWindow(d,N,g,l,D,p,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);mxClient.IS_SF&&(this.window.div.onselectstart=mxUtils.bind(this,function(R){null==R&&(R=window.event);return null!=R&&b.isSelectionAllowed(R)}))};
(function(){mxGraphView.prototype.validateBackgroundPage=function(){var E=this.graph;if(null!=E.container&&!E.transparentBackground){if(E.pageVisible){var N=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var R=E.container.firstChild;null!=R&&R.nodeType!=mxConstants.NODETYPE_ELEMENT;)R=R.nextSibling;null!=R&&(this.backgroundPageShape=this.createBackgroundPageShape(N),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,
this.backgroundPageShape.init(E.container),R.style.position="absolute",E.container.insertBefore(this.backgroundPageShape.node,R),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(G){E.dblClick(G)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(G){E.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(G))}),mxUtils.bind(this,function(G){null!=
E.tooltipHandler&&E.tooltipHandler.isHideOnHover()&&E.tooltipHandler.hide();E.isMouseDown&&!mxEvent.isConsumed(G)&&E.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(G))}),mxUtils.bind(this,function(G){E.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(G))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=N,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};
mxGraphView.prototype.validateBackgroundStyles=function(){var E=this.graph,N=null==E.background||E.background==mxConstants.NONE?E.defaultPageBackgroundColor:E.background,R=null!=N&&this.gridColor!=N.toLowerCase()?this.gridColor:"#ffffff",G="none",M="";if(E.isGridEnabled()||E.gridVisible){M=10;mxClient.IS_SVG?(G=unescape(encodeURIComponent(this.createSvgGrid(R))),G=window.btoa?btoa(G):Base64.encode(G,!0),G="url(data:image/svg+xml;base64,"+G+")",M=E.gridSize*this.scale*this.gridSteps):G="url("+this.gridImage+
")";var Q=R=0;null!=E.view.backgroundPageShape&&(Q=this.getBackgroundPageBounds(),R=1+Q.x,Q=1+Q.y);M=-Math.round(M-mxUtils.mod(this.translate.x*this.scale-R,M))+"px "+-Math.round(M-mxUtils.mod(this.translate.y*this.scale-Q,M))+"px"}R=E.view.canvas;null!=R.ownerSVGElement&&(R=R.ownerSVGElement);null!=E.view.backgroundPageShape?(E.view.backgroundPageShape.node.style.backgroundPosition=M,E.view.backgroundPageShape.node.style.backgroundImage=G,E.view.backgroundPageShape.node.style.backgroundColor=N,E.view.backgroundPageShape.node.style.borderColor=
E.defaultPageBorderColor,E.container.className="geDiagramContainer geDiagramBackdrop",R.style.backgroundImage="none",R.style.backgroundColor="",Editor.isDarkMode()||"sketch"!=Editor.currentTheme?E.container.style.backgroundColor="":E.container.style.backgroundColor=E.sketchBackgroundColor):(E.container.className="geDiagramContainer",R.style.backgroundPosition=M,R.style.backgroundImage=G,null!=E.background&&E.background!=mxConstants.NONE||Editor.isDarkMode()||"sketch"!=Editor.currentTheme?R.style.backgroundColor=
N:R.style.backgroundColor=E.sketchBackgroundColor)};mxGraphView.prototype.createSvgGrid=function(E){for(var N=this.graph.gridSize*this.scale;N<this.minGridSize;)N*=2;for(var R=this.gridSteps*N,G=[],M=1;M<this.gridSteps;M++){var Q=M*N;G.push("M 0 "+Q+" L "+R+" "+Q+" M "+Q+" 0 L "+Q+" "+R)}return'<svg width="'+R+'" height="'+R+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+R+'" height="'+R+'" patternUnits="userSpaceOnUse"><path d="'+G.join(" ")+'" fill="none" stroke="'+E+'" opacity="0.2" stroke-width="1"/><path d="M '+
R+" 0 L 0 0 0 "+R+'" fill="none" stroke="'+E+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(E,N){b.apply(this,arguments);if(null!=this.shiftPreview1){var R=this.view.canvas;null!=R.ownerSVGElement&&(R=R.ownerSVGElement);var G=this.gridSize*this.view.scale*this.view.gridSteps;G=-Math.round(G-mxUtils.mod(this.view.translate.x*this.view.scale+E,G))+"px "+-Math.round(G-mxUtils.mod(this.view.translate.y*
this.view.scale+N,G))+"px";R.style.backgroundPosition=G}};mxGraph.prototype.updatePageBreaks=function(E,N,R){var G=this.view.scale,M=this.view.translate,Q=this.pageFormat,e=G*this.pageScale,f=this.view.getBackgroundPageBounds();N=f.width;R=f.height;var k=new mxRectangle(G*M.x,G*M.y,Q.width*e,Q.height*e),z=(E=E&&Math.min(k.width,k.height)>this.minPageBreakDist)?Math.ceil(R/k.height)-1:0,t=E?Math.ceil(N/k.width)-1:0,B=f.x+N,I=f.y+R;null==this.horizontalPageBreaks&&0<z&&(this.horizontalPageBreaks=[]);
null==this.verticalPageBreaks&&0<t&&(this.verticalPageBreaks=[]);E=mxUtils.bind(this,function(O){if(null!=O){for(var J=O==this.horizontalPageBreaks?z:t,y=0;y<=J;y++){var ia=O==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x),Math.round(f.y+(y+1)*k.height)),new mxPoint(Math.round(B),Math.round(f.y+(y+1)*k.height))]:[new mxPoint(Math.round(f.x+(y+1)*k.width),Math.round(f.y)),new mxPoint(Math.round(f.x+(y+1)*k.width),Math.round(I))];null!=O[y]?(O[y].points=ia,O[y].redraw()):(ia=new mxPolyline(ia,
this.pageBreakColor),ia.dialect=this.dialect,ia.isDashed=this.pageBreakDashed,ia.pointerEvents=!1,ia.init(this.view.backgroundPane),ia.redraw(),O[y]=ia)}for(y=J;y<O.length;y++)O[y].destroy();O.splice(J,O.length-J)}});E(this.horizontalPageBreaks);E(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(E,N,R){for(var G=0;G<N.length;G++){if(this.graph.isTableCell(N[G])||this.graph.isTableRow(N[G]))return!1;if(this.graph.getModel().isVertex(N[G])){var M=
this.graph.getCellGeometry(N[G]);if(null!=M&&M.relative)return!1}}return d.apply(this,arguments)};var g=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var E=g.apply(this,arguments);E.intersects=mxUtils.bind(this,function(N,R){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(E,arguments)});return E};mxGraphView.prototype.createBackgroundPageShape=function(E){return new mxRectangleShape(E,"#ffffff",this.graph.defaultPageBorderColor)};
mxGraphView.prototype.getBackgroundPageBounds=function(){var E=this.getGraphBounds(),N=0<E.width?E.x/this.scale-this.translate.x:0,R=0<E.height?E.y/this.scale-this.translate.y:0,G=this.graph.pageFormat,M=this.graph.pageScale,Q=G.width*M;G=G.height*M;M=Math.floor(Math.min(0,N)/Q);var e=Math.floor(Math.min(0,R)/G);return new mxRectangle(this.scale*(this.translate.x+M*Q),this.scale*(this.translate.y+e*G),this.scale*(Math.ceil(Math.max(1,N+E.width/this.scale)/Q)-M)*Q,this.scale*(Math.ceil(Math.max(1,
R+E.height/this.scale)/G)-e)*G)};var l=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(E,N){l.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=E+"px",this.view.backgroundPageShape.node.style.marginTop=N+"px")};var D=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(E,N,R,G,M,Q){var e=D.apply(this,
arguments);null==Q||Q||mxEvent.addListener(e,"mousedown",function(f){mxEvent.consume(f)});return e};var p=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(E,N,R){var G=this.graph.model.getParent(E);if(N){var M=this.graph.model.isEdge(E)?null:this.graph.getCellGeometry(E);M=!this.graph.model.isEdge(G)&&!this.graph.isSiblingSelected(E)&&(null!=M&&M.relative||!this.graph.isContainer(G)||this.graph.isPart(E))}else if(M=p.apply(this,arguments),
this.graph.isTableCell(E)||this.graph.isTableRow(E))M=G,this.graph.isTable(M)||(M=this.graph.model.getParent(M)),M=!this.graph.selectionCellsHandler.isHandled(M)||this.graph.isCellSelected(M)&&this.graph.isToggleEvent(R.getEvent())||this.graph.isCellSelected(E)&&!this.graph.isToggleEvent(R.getEvent())||this.graph.isTableCell(E)&&this.graph.isCellSelected(G);return M};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(E){E=E.getCell();for(var N=this.graph.getModel(),R=N.getParent(E),G=this.graph.view.getState(R),
M=this.graph.isCellSelected(E);null!=G&&(N.isVertex(R)||N.isEdge(R));){var Q=this.graph.isCellSelected(R);M=M||Q;if(Q||!M&&(this.graph.isTableCell(E)||this.graph.isTableRow(E)))E=R;R=N.getParent(R)}return E}})();EditorUi=function(b,d,g){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var l=this.editor.graph;l.lightbox=g;var D=l.getGraphBounds;l.getGraphBounds=function(){var T=D.apply(this,arguments),Y=this.backgroundImage;if(null!=Y&&null!=Y.width&&null!=Y.height){var W=this.view.translate,ka=this.view.scale;T=mxRectangle.fromRectangle(T);T.add(new mxRectangle((W.x+Y.x)*ka,(W.y+Y.y)*ka,Y.width*ka,Y.height*ka))}return T};l.useCssTransforms&&(this.lazyZoomDelay=
0);mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage;mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src);this.selectionStateListener=mxUtils.bind(this,function(T,Y){this.clearSelectionState()});l.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);
l.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);l.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);l.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);l.getView().addListener("unitChanged",this.selectionStateListener);this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,l.isEnabled=function(){return!1},l.panningHandler.isForcePanningEvent=function(T){return!mxEvent.isPopupTrigger(T.getEvent())});this.actions=new Actions(this);this.menus=
this.createMenus();if(!l.standalone){var p="rounded shadow glass dashed dashPattern labelBackgroundColor labelBorderColor comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification sketchStyle pointerEvents strokeColor strokeWidth".split(" "),E="shape edgeStyle curved rounded elbow jumpStyle jumpSize comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification sketchStyle".split(" "),
N="curved sourcePerimeterSpacing targetPerimeterSpacing startArrow startFill startSize endArrow endFill endSize".split(" "),R=!1,G=!1;this.setDefaultStyle=function(T){try{l.getModel().isEdge(T)?G=!1:R=!1;var Y=l.getCellStyle(T,!1),W=[],ka=[],q;for(q in Y)W.push(Y[q]),ka.push(q);l.getModel().isEdge(T)?l.currentEdgeStyle={}:l.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",ka,"values",W,"cells",[T]));l.getModel().isEdge(T)?G=!0:R=!0}catch(F){this.handleError(F)}};this.clearDefaultStyle=
function(){l.currentEdgeStyle=mxUtils.clone(l.defaultEdgeStyle);l.currentVertexStyle=mxUtils.clone(l.defaultVertexStyle);R=G=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var M=["fontFamily","fontSource","fontSize","fontColor"];for(d=0;d<M.length;d++)0>mxUtils.indexOf(p,M[d])&&p.push(M[d]);var Q="edgeStyle startArrow startFill startSize endArrow endFill endSize".split(" "),e=[["startArrow","startFill","endArrow","endFill"],["startSize","endSize"],["sourcePerimeterSpacing",
"targetPerimeterSpacing"],["fillColor","gradientColor","gradientDirection"],["opacity"],["html"]];for(d=0;d<e.length;d++)for(g=0;g<e[d].length;g++)p.push(e[d][g]);for(d=0;d<E.length;d++)0>mxUtils.indexOf(p,E[d])&&p.push(E[d]);var f=function(T,Y,W,ka,q,F,S){ka=null!=ka?ka:l.currentVertexStyle;q=null!=q?q:l.currentEdgeStyle;F=null!=F?F:!0;W=null!=W?W:l.getModel();if(S){S=[];for(var ba=0;ba<T.length;ba++)S=S.concat(W.getDescendants(T[ba]));T=S}W.beginUpdate();try{for(ba=0;ba<T.length;ba++){var U=T[ba];
if(Y)var ca=["fontSize","fontFamily","fontColor"];else{var ea=W.getStyle(U),na=null!=ea?ea.split(";"):[];ca=p.slice();for(var ra=0;ra<na.length;ra++){var ya=na[ra],va=ya.indexOf("=");if(0<=va){var Da=ya.substring(0,va),pa=mxUtils.indexOf(ca,Da);0<=pa&&ca.splice(pa,1);for(S=0;S<e.length;S++){var Aa=e[S];if(0<=mxUtils.indexOf(Aa,Da))for(var xa=0;xa<Aa.length;xa++){var Ma=mxUtils.indexOf(ca,Aa[xa]);0<=Ma&&ca.splice(Ma,1)}}}}}var Oa=W.isEdge(U);S=Oa?q:ka;var Na=W.getStyle(U);for(ra=0;ra<ca.length;ra++){Da=
ca[ra];var La=S[Da];null!=La&&"edgeStyle"!=Da&&("shape"!=Da||Oa)&&(!Oa||F||0>mxUtils.indexOf(N,Da))&&(Na=mxUtils.setStyle(Na,Da,La))}Editor.simpleLabels&&(Na=mxUtils.setStyle(mxUtils.setStyle(Na,"html",null),"whiteSpace",null));W.setStyle(U,Na)}}finally{W.endUpdate()}return T};l.addListener("cellsInserted",function(T,Y){f(Y.getProperty("cells"),null,null,null,null,!0,!0)});l.addListener("textInserted",function(T,Y){f(Y.getProperty("cells"),!0)});this.insertHandler=f;this.createDivs();this.createUi();
this.refresh();var k=mxUtils.bind(this,function(T){null==T&&(T=window.event);return l.isEditing()||null!=T&&this.isSelectionAllowed(T)});this.container==document.body&&(this.menubarContainer.onselectstart=k,this.menubarContainer.onmousedown=k,this.toolbarContainer.onselectstart=k,this.toolbarContainer.onmousedown=k,this.diagramContainer.onselectstart=k,this.diagramContainer.onmousedown=k,this.sidebarContainer.onselectstart=k,this.sidebarContainer.onmousedown=k,this.formatContainer.onselectstart=k,
this.formatContainer.onmousedown=k,this.footerContainer.onselectstart=k,this.footerContainer.onmousedown=k,null!=this.tabContainer&&(this.tabContainer.onselectstart=k));!this.editor.chromeless||this.editor.editable?(d=function(T){if(null!=T){var Y=mxEvent.getSource(T);if("A"==Y.nodeName)for(;null!=Y;){if("geHint"==Y.className)return!0;Y=Y.parentNode}}return k(T)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",
d):this.diagramContainer.oncontextmenu=d):l.panningHandler.usePopupTrigger=!1;l.init(this.diagramContainer);mxClient.IS_SVG&&null!=l.view.getDrawPane()&&(d=l.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons();if(null!=l.graphHandler){var z=l.graphHandler.start;l.graphHandler.start=function(){null!=qa.hoverIcons&&qa.hoverIcons.reset();z.apply(this,arguments)}}mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(T){var Y=
mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(T)-Y.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(T)-Y.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var t=!1,B=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(T,Y){return t||B.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(T){32!=T.which||l.isEditing()?mxEvent.isConsumed(T)||
27!=T.keyCode||this.hideDialog(null,!0):(t=!0,this.hoverIcons.reset(),l.container.style.cursor="move",l.isEditing()||mxEvent.getSource(T)!=l.container||mxEvent.consume(T))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(T){l.container.style.cursor="";t=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var I=l.panningHandler.isForcePanningEvent;l.panningHandler.isForcePanningEvent=function(T){return I.apply(this,arguments)||t||mxEvent.isMouseEvent(T.getEvent())&&
(this.usePopupTrigger||!mxEvent.isPopupTrigger(T.getEvent()))&&(!mxEvent.isControlDown(T.getEvent())&&mxEvent.isRightMouseButton(T.getEvent())||mxEvent.isMiddleMouseButton(T.getEvent()))};var O=l.cellEditor.isStopEditingEvent;l.cellEditor.isStopEditingEvent=function(T){return O.apply(this,arguments)||13==T.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(T)||mxClient.IS_MAC&&mxEvent.isMetaDown(T)||mxClient.IS_SF&&mxEvent.isShiftDown(T))};var J=l.isZoomWheelEvent;l.isZoomWheelEvent=function(){return t||
J.apply(this,arguments)};var y=!1,ia=null,da=null,ja=null,aa=mxUtils.bind(this,function(){if(null!=this.toolbar&&y!=l.cellEditor.isContentEditing()){for(var T=this.toolbar.container.firstChild,Y=[];null!=T;){var W=T.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,T)&&(T.parentNode.removeChild(T),Y.push(T));T=W}T=this.toolbar.fontMenu;W=this.toolbar.sizeMenu;if(null==ja)this.toolbar.createTextToolbar();else{for(var ka=0;ka<ja.length;ka++)this.toolbar.container.appendChild(ja[ka]);this.toolbar.fontMenu=
ia;this.toolbar.sizeMenu=da}y=l.cellEditor.isContentEditing();ia=T;da=W;ja=Y}}),qa=this,sa=l.cellEditor.startEditing;l.cellEditor.startEditing=function(){sa.apply(this,arguments);aa();if(l.cellEditor.isContentEditing()){var T=!1,Y=function(){T||(T=!0,window.setTimeout(function(){var W=l.getSelectedEditingElement();null!=W&&(W=mxUtils.getCurrentStyle(W),null!=W&&null!=qa.toolbar&&(qa.toolbar.setFontName(Graph.stripQuotes(W.fontFamily)),qa.toolbar.setFontSize(parseInt(W.fontSize))));T=!1},0))};mxEvent.addListener(l.cellEditor.textarea,
"input",Y);mxEvent.addListener(l.cellEditor.textarea,"touchend",Y);mxEvent.addListener(l.cellEditor.textarea,"mouseup",Y);mxEvent.addListener(l.cellEditor.textarea,"keyup",Y);Y()}};var L=l.cellEditor.stopEditing;l.cellEditor.stopEditing=function(T,Y){try{L.apply(this,arguments),aa()}catch(W){qa.handleError(W)}};l.container.setAttribute("tabindex","0");l.container.style.cursor="default";if(window.self===window.top&&null!=l.container.parentNode)try{l.container.focus()}catch(T){}var V=l.fireMouseEvent;
l.fireMouseEvent=function(T,Y,W){T==mxEvent.MOUSE_DOWN&&this.container.focus();V.apply(this,arguments)};l.popupMenuHandler.autoExpand=!0;null!=this.menus&&(l.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(T,Y,W){this.menus.createPopupMenu(T,Y,W)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(T){l.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};l.connectionHandler.addListener(mxEvent.CONNECT,function(T,
Y){var W=[Y.getProperty("cell")];Y.getProperty("terminalInserted")&&(W.push(Y.getProperty("terminal")),window.setTimeout(function(){null!=qa.hoverIcons&&qa.hoverIcons.update(l.view.getState(W[W.length-1]))},0));f(W)});this.addListener("styleChanged",mxUtils.bind(this,function(T,Y){var W=Y.getProperty("cells"),ka=T=!1;if(0<W.length)for(var q=0;q<W.length&&(T=l.getModel().isVertex(W[q])||T,!(ka=l.getModel().isEdge(W[q])||ka)||!T);q++);else ka=T=!0;T=T&&!R;ka=ka&&!G;W=Y.getProperty("keys");Y=Y.getProperty("values");
for(q=0;q<W.length;q++){var F=0<=mxUtils.indexOf(M,W[q]);if("strokeColor"!=W[q]||null!=Y[q]&&"none"!=Y[q])if(0<=mxUtils.indexOf(E,W[q]))ka||0<=mxUtils.indexOf(Q,W[q])?null==Y[q]?delete l.currentEdgeStyle[W[q]]:l.currentEdgeStyle[W[q]]=Y[q]:T&&0<=mxUtils.indexOf(p,W[q])&&(null==Y[q]?delete l.currentVertexStyle[W[q]]:l.currentVertexStyle[W[q]]=Y[q]);else if(0<=mxUtils.indexOf(p,W[q])){if(T||F)null==Y[q]?delete l.currentVertexStyle[W[q]]:l.currentVertexStyle[W[q]]=Y[q];if(ka||F||0<=mxUtils.indexOf(Q,
W[q]))null==Y[q]?delete l.currentEdgeStyle[W[q]]:l.currentEdgeStyle[W[q]]=Y[q]}}null!=this.toolbar&&(this.toolbar.setFontName(l.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(l.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==l.currentEdgeStyle.edgeStyle&&"1"==l.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==
l.currentEdgeStyle.edgeStyle||"none"==l.currentEdgeStyle.edgeStyle||null==l.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"==l.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==l.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==l.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==l.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==l.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):
"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==l.currentEdgeStyle.shape?"geSprite geSprite-linkedge":"flexArrow"==l.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==l.currentEdgeStyle.shape?"geSprite geSprite-simplearrow":"geSprite geSprite-connection"))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var T=l.currentVertexStyle.fontFamily||"Helvetica",Y=String(l.currentVertexStyle.fontSize||
"12"),W=l.getView().getState(l.getSelectionCell());null!=W&&(T=W.style[mxConstants.STYLE_FONTFAMILY]||T,Y=W.style[mxConstants.STYLE_FONTSIZE]||Y,10<T.length&&(T=T.substring(0,8)+"..."));this.toolbar.setFontName(T);this.toolbar.setFontSize(Y)}),l.getSelectionModel().addListener(mxEvent.CHANGE,b),l.getModel().addListener(mxEvent.CHANGE,b));l.addListener(mxEvent.CELLS_ADDED,function(T,Y){T=Y.getProperty("cells");Y=Y.getProperty("parent");null!=Y&&l.getModel().isLayer(Y)&&!l.isCellVisible(Y)&&null!=T&&
0<T.length&&l.getModel().setVisible(Y,!0)});this.gestureHandler=mxUtils.bind(this,function(T){null!=this.currentMenu&&mxEvent.getSource(T)!=this.currentMenu.div&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,this.gestureHandler);this.resizeHandler=mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});
mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&"undefined"!==typeof Menus&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,"scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){l.view.validateBackground()}));this.addListener("backgroundColorChanged",
mxUtils.bind(this,function(){l.view.validateBackground()}));l.addListener("gridSizeChanged",mxUtils.bind(this,function(){l.isGridEnabled()&&l.view.validateBackground()}));this.editor.resetGraph()}this.init();l.standalone||this.open()};EditorUi.compactUi=!0;
EditorUi.parsePng=function(b,d,g){function l(N,R){var G=p;p+=R;return N.substring(G,p)}function D(N){N=l(N,4);return N.charCodeAt(3)+(N.charCodeAt(2)<<8)+(N.charCodeAt(1)<<16)+(N.charCodeAt(0)<<24)}var p=0;if(l(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(l(b,4),"IHDR"!=l(b,4))null!=g&&g();else{l(b,17);do{g=D(b);var E=l(b,4);if(null!=d&&d(p-8,E,g))break;value=l(b,g);l(b,4);if("IEND"==E)break}while(g)}};mxUtils.extend(EditorUi,mxEventSource);
EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=38;EditorUi.prototype.footerHeight=28;EditorUi.prototype.sidebarFooterHeight=34;EditorUi.prototype.hsplitPosition=640>=screen.width?118:"large"!=urlParams["sidebar-entries"]?212:240;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2;
EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1;
EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();mxEvent.addListener(b.container,"scroll",mxUtils.bind(this,function(){b.tooltipHandler.hide();null!=b.connectionHandler&&null!=b.connectionHandler.constraintHandler&&b.connectionHandler.constraintHandler.reset()}));b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){b.tooltipHandler.hide();var l=b.getRubberband();null!=l&&l.cancel()}));mxEvent.addListener(b.container,
"keydown",mxUtils.bind(this,function(l){this.onKeyDown(l)}));mxEvent.addListener(b.container,"keypress",mxUtils.bind(this,function(l){this.onKeyPress(l)}));this.addUndoListener();this.addBeforeUnloadListener();b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));b.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));var d=b.setDefaultParent,g=this;this.editor.graph.setDefaultParent=function(){d.apply(this,
arguments);g.updateActionStates()};b.editLink=g.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()}};EditorUi.prototype.clearSelectionState=function(){this.selectionState=null};EditorUi.prototype.getSelectionState=function(){null==this.selectionState&&(this.selectionState=this.createSelectionState());return this.selectionState};
EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,d=b.getSelectionCells(),g=this.initSelectionState(),l=!0,D=0;D<d.length;D++){var p=b.getCurrentCellStyle(d[D]);"0"!=mxUtils.getValue(p,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(g,d[D],d,l),l=!1)}this.updateSelectionStateForTableCells(g);return g};
EditorUi.prototype.initSelectionState=function(){return{vertices:[],edges:[],cells:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,rounded:!0,autoSize:!1,image:!0,shadow:!0,lineJumps:!0,resizable:!0,table:!1,cell:!1,row:!1,movable:!0,rotatable:!0,stroke:!0,swimlane:!1,unlocked:this.editor.graph.isEnabled(),connections:!1}};
EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){for(var d=mxUtils.sortCells(b.cells),g=this.editor.graph.model,l=g.getParent(d[0]),D=g.getParent(l),p=l.getIndex(d[0]),E=D.getIndex(l),N=null,R=1,G=1,M=0,Q=E<D.getChildCount()-1?g.getChildAt(g.getChildAt(D,E+1),p):null;M<d.length-1;){var e=d[++M];null==Q||Q!=e||null!=N&&R!=N||(N=R,R=0,G++,l=g.getParent(Q),Q=E+G<D.getChildCount()?g.getChildAt(g.getChildAt(D,E+G),p):null);var f=this.editor.graph.view.getState(e);
if(e==g.getChildAt(l,p+R)&&null!=f&&1==mxUtils.getValue(f.style,"colspan",1)&&1==mxUtils.getValue(f.style,"rowspan",1))R++;else break}M==G*R-1&&(b.mergeCell=d[0],b.colspan=R,b.rowspan=G)}};
EditorUi.prototype.updateSelectionStateForCell=function(b,d,g,l){g=this.editor.graph;b.cells.push(d);if(g.getModel().isVertex(d)){b.connections=0<g.model.getEdgeCount(d);b.unlocked=b.unlocked&&!g.isCellLocked(d);b.resizable=b.resizable&&g.isCellResizable(d);b.rotatable=b.rotatable&&g.isCellRotatable(d);b.movable=b.movable&&g.isCellMovable(d)&&!g.isTableRow(d)&&!g.isTableCell(d);b.swimlane=b.swimlane||g.isSwimlane(d);b.table=b.table||g.isTable(d);b.cell=b.cell||g.isTableCell(d);b.row=b.row||g.isTableRow(d);
b.vertices.push(d);var D=g.getCellGeometry(d);if(null!=D&&(0<D.width?null==b.width?b.width=D.width:b.width!=D.width&&(b.width=""):b.containsLabel=!0,0<D.height?null==b.height?b.height=D.height:b.height!=D.height&&(b.height=""):b.containsLabel=!0,!D.relative||null!=D.offset)){var p=D.relative?D.offset.x:D.x;D=D.relative?D.offset.y:D.y;null==b.x?b.x=p:b.x!=p&&(b.x="");null==b.y?b.y=D:b.y!=D&&(b.y="")}}else g.getModel().isEdge(d)&&(b.edges.push(d),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=
!1);d=g.view.getState(d);null!=d&&(b.autoSize=b.autoSize||g.isAutoSizeState(d),b.glass=b.glass&&g.isGlassState(d),b.rounded=b.rounded&&g.isRoundedState(d),b.lineJumps=b.lineJumps&&g.isLineJumpState(d),b.image=b.image&&g.isImageState(d),b.shadow=b.shadow&&g.isShadowState(d),b.fill=b.fill&&g.isFillState(d),b.stroke=b.stroke&&g.isStrokeState(d),p=mxUtils.getValue(d.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||"image"==p,g.mergeStyle(d.style,b.style,l))};
EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,d=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(R,G){"mouseDown"==G.getProperty("eventName")&&d.hideShapePicker()}));var g=mxUtils.bind(this,function(){d.hideShapePicker(!0)});b.addListener("wheel",g);b.addListener(mxEvent.ESCAPE,g);b.view.addListener(mxEvent.SCALE,g);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,g);b.getSelectionModel().addListener(mxEvent.CHANGE,g);var l=b.popupMenuHandler.isMenuShowing;
b.popupMenuHandler.isMenuShowing=function(){return l.apply(this,arguments)||null!=d.shapePicker};var D=b.dblClick;b.dblClick=function(R,G){if(this.isEnabled())if(null!=G||null==d.sidebar||mxEvent.isShiftDown(R)||b.isCellLocked(b.getDefaultParent()))D.apply(this,arguments);else{var M=mxUtils.convertPoint(this.container,mxEvent.getClientX(R),mxEvent.getClientY(R));mxEvent.consume(R);window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(M.x,M.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",
g);var p=this.hoverIcons.drag;this.hoverIcons.drag=function(){d.hideShapePicker();p.apply(this,arguments)};var E=this.hoverIcons.execute;this.hoverIcons.execute=function(R,G,M){var Q=M.getEvent();this.graph.isCloneEvent(Q)||mxEvent.isShiftDown(Q)?E.apply(this,arguments):this.graph.connectVertex(R.cell,G,this.graph.defaultEdgeLength,Q,null,null,mxUtils.bind(this,function(e,f,k){var z=b.getCompositeParent(R.cell);e=b.getCellGeometry(z);for(M.consume();null!=z&&b.model.isVertex(z)&&null!=e&&e.relative;)cell=
z,z=b.model.getParent(cell),e=b.getCellGeometry(z);window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(M.getGraphX(),M.getGraphY(),z,mxUtils.bind(this,function(t){k(t);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(t))}),G)}),30)}),mxUtils.bind(this,function(e){this.graph.selectCellsForConnectVertex(e,Q,this)}))};var N=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(R,G){null!=N&&window.clearTimeout(N);N=window.setTimeout(mxUtils.bind(this,function(){var M=
G.getProperty("arrow"),Q=G.getProperty("direction"),e=G.getProperty("event");M=M.getBoundingClientRect();var f=mxUtils.getOffset(b.container),k=b.container.scrollLeft+M.x-f.x;f=b.container.scrollTop+M.y-f.y;var z=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),t=d.showShapePicker(k,f,z,mxUtils.bind(this,function(B){null!=B&&b.connectVertex(z,Q,b.defaultEdgeLength,e,!0,!0,function(I,O,J){J(B);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(B))},
function(I){b.selectCellsForConnectVertex(I)},e,this.hoverIcons)}),Q,!0);this.centerShapePicker(t,M,k,f,Q);mxUtils.setOpacity(t,30);mxEvent.addListener(t,"mouseenter",function(){mxUtils.setOpacity(t,100)});mxEvent.addListener(t,"mouseleave",function(){d.hideShapePicker()})}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(R,G){null!=N&&window.clearTimeout(N)}))}};
EditorUi.prototype.centerShapePicker=function(b,d,g,l,D){if(D==mxConstants.DIRECTION_EAST||D==mxConstants.DIRECTION_WEST)b.style.width="40px";var p=b.getBoundingClientRect();D==mxConstants.DIRECTION_NORTH?(g-=p.width/2-10,l-=p.height+6):D==mxConstants.DIRECTION_SOUTH?(g-=p.width/2-10,l+=d.height+6):D==mxConstants.DIRECTION_WEST?(g-=p.width+6,l-=p.height/2-10):D==mxConstants.DIRECTION_EAST&&(g+=d.width+6,l-=p.height/2-10);b.style.left=g+"px";b.style.top=l+"px"};
EditorUi.prototype.showShapePicker=function(b,d,g,l,D,p){b=this.createShapePicker(b,d,g,l,D,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(g,p),p);null!=b&&(null==this.hoverIcons||p||this.hoverIcons.reset(),p=this.editor.graph,p.popupMenuHandler.hideMenu(),p.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=l,this.shapePicker=b);return b};
EditorUi.prototype.createShapePicker=function(b,d,g,l,D,p,E,N){var R=null;if(null!=E&&0<E.length){var G=this,M=this.editor.graph;R=document.createElement("div");D=M.view.getState(g);var Q=null==g||null!=D&&M.isTransparentState(D)?null:M.copyStyle(g);g=6>E.length?35*E.length:140;R.className="geToolbarContainer geSidebarContainer";R.style.cssText="position:absolute;left:"+b+"px;top:"+d+"px;width:"+g+"px;border-radius:10px;padding:4px;text-align:center;box-shadow:0px 0px 3px 1px #d1d1d1;padding: 6px 0 8px 0;z-index: "+
mxPopupMenu.prototype.zIndex+1+";";N||mxUtils.setPrefixedStyle(R.style,"transform","translate(-22px,-22px)");null!=M.background&&M.background!=mxConstants.NONE&&(R.style.backgroundColor=M.background);M.container.appendChild(R);g=mxUtils.bind(this,function(e){var f=document.createElement("a");f.className="geItem";f.style.cssText="position:relative;display:inline-block;position:relative;width:30px;height:30px;cursor:pointer;overflow:hidden;padding:3px 0 0 3px;";R.appendChild(f);null!=Q&&"1"!=urlParams.sketch?
this.sidebar.graph.pasteStyle(Q,[e]):G.insertHandler([e],""!=e.value&&"1"!=urlParams.sketch,this.sidebar.graph.model);this.sidebar.createThumb([e],25,25,f,null,!0,!1,e.geometry.width,e.geometry.height);mxEvent.addListener(f,"click",function(){var k=M.cloneCell(e);if(null!=l)l(k);else{k.geometry.x=M.snap(Math.round(b/M.view.scale)-M.view.translate.x-e.geometry.width/2);k.geometry.y=M.snap(Math.round(d/M.view.scale)-M.view.translate.y-e.geometry.height/2);M.model.beginUpdate();try{M.addCell(k)}finally{M.model.endUpdate()}M.setSelectionCell(k);
M.scrollCellToVisible(k);M.startEditingAtCell(k);null!=G.hoverIcons&&G.hoverIcons.update(M.view.getState(k))}null!=p&&p()})});for(D=0;D<(N?Math.min(E.length,4):E.length);D++)g(E[D]);E=R.offsetTop+R.clientHeight-(M.container.scrollTop+M.container.offsetHeight);0<E&&(R.style.top=Math.max(M.container.scrollTop+22,d-E)+"px");E=R.offsetLeft+R.clientWidth-(M.container.scrollLeft+M.container.offsetWidth);0<E&&(R.style.left=Math.max(M.container.scrollLeft+22,b-E)+"px")}return R};
EditorUi.prototype.getCellsForShapePicker=function(b,d){d=mxUtils.bind(this,function(g,l,D,p){return this.editor.graph.createVertex(null,null,p||"",0,0,l||120,D||60,g,!1)});return[null!=b?this.editor.graph.cloneCell(b):d("text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;",40,20,"Text"),d("whiteSpace=wrap;html=1;"),d("ellipse;whiteSpace=wrap;html=1;"),d("rhombus;whiteSpace=wrap;html=1;",80,80),d("rounded=1;whiteSpace=wrap;html=1;"),d("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),
d("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),d("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),d("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),d("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),d("triangle;whiteSpace=wrap;html=1;",60,80),d("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),d("shape=tape;whiteSpace=wrap;html=1;",120,100),d("ellipse;shape=cloud;whiteSpace=wrap;html=1;",
120,80),d("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),d("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",40,40)]};EditorUi.prototype.hideShapePicker=function(b){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,b||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};
EditorUi.prototype.onKeyDown=function(b){var d=this.editor.graph;if(9==b.which&&d.isEnabled()&&!mxEvent.isControlDown(b)){if(d.isEditing())if(mxEvent.isAltDown(b))d.stopEditing(!1);else try{var g=d.cellEditor.isContentEditing()&&d.cellEditor.isTextSelected();if(window.getSelection&&d.cellEditor.isContentEditing()&&!g&&!mxClient.IS_IE&&!mxClient.IS_IE11){var l=window.getSelection(),D=0<l.rangeCount?l.getRangeAt(0).commonAncestorContainer:null;g=null!=D&&("LI"==D.nodeName||null!=D.parentNode&&"LI"==
D.parentNode.nodeName)}g?document.execCommand(mxEvent.isShiftDown(b)?"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?d.stopEditing(!1):d.cellEditor.insertTab(d.cellEditor.isContentEditing()?null:4)}catch(p){}else mxEvent.isAltDown(b)?d.selectParentCell():d.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};
EditorUi.prototype.onKeyPress=function(b){var d=this.editor.graph;!this.isImmediateEditingEvent(b)||d.isEditing()||d.isSelectionEmpty()||0===b.which||27===b.which||mxEvent.isAltDown(b)||mxEvent.isControlDown(b)||mxEvent.isMetaDown(b)||(d.escape(),d.startEditing(),mxClient.IS_FF&&(d=d.cellEditor,null!=d.textarea&&(d.textarea.innerHTML=String.fromCharCode(b.which),b=document.createRange(),b.selectNodeContents(d.textarea),b.collapse(!1),d=window.getSelection(),d.removeAllRanges(),d.addRange(b))))};
EditorUi.prototype.isImmediateEditingEvent=function(b){return!0};
EditorUi.prototype.updateCssForMarker=function(b,d,g,l,D){b.style.verticalAlign="top";b.style.height="21px";b.style.width="21px";b.innerText="";"flexArrow"==g?b.className=null!=l&&l!=mxConstants.NONE?"geSprite geSprite-"+d+"blocktrans":"geSprite geSprite-noarrow":(g=this.getImageForMarker(l,D),null!=g?(l=document.createElement("img"),l.className="geAdaptiveAsset",l.style.position="absolute",l.style.marginTop="0.5px",l.setAttribute("src",g),b.className="","end"==d&&mxUtils.setPrefixedStyle(l.style,
"transform","scaleX(-1)"),b.appendChild(l)):(b.className="geSprite geSprite-noarrow",b.innerHTML=mxUtils.htmlEntities(mxResources.get("none")),b.style.backgroundImage="none",b.style.verticalAlign="top",b.style.marginTop="4px",b.style.fontSize="10px",b.style.filter="none",b.style.color=this.defaultStrokeColor,b.nextSibling.style.marginTop="0px"))};
EditorUi.prototype.getImageForMarker=function(b,d){var g=null;b==mxConstants.ARROW_CLASSIC?g="1"!=d?Format.classicMarkerImage.src:Format.classicFilledMarkerImage.src:b==mxConstants.ARROW_CLASSIC_THIN?g="1"!=d?Format.classicThinMarkerImage.src:Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_OPEN?g=Format.openFilledMarkerImage.src:b==mxConstants.ARROW_OPEN_THIN?g=Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_BLOCK?g="1"!=d?Format.blockMarkerImage.src:Format.blockFilledMarkerImage.src:
b==mxConstants.ARROW_BLOCK_THIN?g="1"!=d?Format.blockThinMarkerImage.src:Format.blockThinFilledMarkerImage.src:b==mxConstants.ARROW_OVAL?g="1"!=d?Format.ovalMarkerImage.src:Format.ovalFilledMarkerImage.src:b==mxConstants.ARROW_DIAMOND?g="1"!=d?Format.diamondMarkerImage.src:Format.diamondFilledMarkerImage.src:b==mxConstants.ARROW_DIAMOND_THIN?g="1"!=d?Format.diamondThinMarkerImage.src:Format.diamondThinFilledMarkerImage.src:"doubleBlock"==b?g="1"!=d?Format.doubleBlockMarkerImage.src:Format.doubleBlockFilledMarkerImage.src:
"box"==b?g=Format.boxMarkerImage.src:"halfCircle"==b?g=Format.halfCircleMarkerImage.src:"openAsync"==b?g=Format.openAsyncFilledMarkerImage.src:"async"==b?g="1"!=d?Format.asyncMarkerImage.src:Format.asyncFilledMarkerImage.src:"dash"==b?g=Format.dashMarkerImage.src:"baseDash"==b?g=Format.baseDashMarkerImage.src:"cross"==b?g=Format.crossMarkerImage.src:"circle"==b?g=Format.circleMarkerImage.src:"circlePlus"==b?g=Format.circlePlusMarkerImage.src:"ERone"==b?g=Format.EROneMarkerImage.src:"ERmandOne"==b?
g=Format.ERmandOneMarkerImage.src:"ERmany"==b?g=Format.ERmanyMarkerImage.src:"ERoneToMany"==b?g=Format.ERoneToManyMarkerImage.src:"ERzeroToOne"==b?g=Format.ERzeroToOneMarkerImage.src:"ERzeroToMany"==b&&(g=Format.ERzeroToManyMarkerImage.src);return g};EditorUi.prototype.createMenus=function(){return null};
EditorUi.prototype.updatePasteActionStates=function(){var b=this.editor.graph,d=this.actions.get("paste"),g=this.actions.get("pasteHere");d.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(!mxClient.IS_FF&&null!=navigator.clipboard||!mxClipboard.isEmpty())&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()));g.setEnabled(d.isEnabled())};
EditorUi.prototype.initClipboard=function(){var b=this,d=mxClipboard.cut;mxClipboard.cut=function(p){p.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(p){var E=null;if(p.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{E=E||p.getSelectionCells();E=p.getExportableCells(p.model.getTopmostCells(E));for(var N={},R=p.createCellLookup(E),G=p.cloneCells(E,null,N),M=new mxGraphModel,Q=M.getChildAt(M.getRoot(),
0),e=0;e<G.length;e++){M.add(Q,G[e]);var f=p.view.getState(E[e]);if(null!=f){var k=p.getCellGeometry(G[e]);null!=k&&k.relative&&!M.isEdge(E[e])&&null==R[mxObjectIdentity.get(M.getParent(E[e]))]&&(k.offset=null,k.relative=!1,k.x=f.x/f.view.scale-f.view.translate.x,k.y=f.y/f.view.scale-f.view.translate.y)}}p.updateCustomLinks(p.createCellMapping(N,R),G);mxClipboard.insertCount=1;mxClipboard.setCells(G)}b.updatePasteActionStates();return E};var g=mxClipboard.paste;mxClipboard.paste=function(p){var E=
null;p.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):E=g.apply(this,arguments);b.updatePasteActionStates();return E};var l=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){l.apply(this,arguments);b.updatePasteActionStates()};var D=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(p,E){D.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};
EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=400;EditorUi.prototype.buttonZoomDelay=600;
EditorUi.prototype.initCanvas=function(){var b=this.editor.graph;b.timerAutoScroll=!0;b.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((b.container.offsetWidth-34)/b.view.scale)),Math.max(0,Math.round((b.container.offsetHeight-34)/b.view.scale)))};b.view.getBackgroundPageBounds=function(){var W=this.graph.getPageLayout(),ka=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+W.x*ka.width),this.scale*(this.translate.y+W.y*ka.height),this.scale*W.width*ka.width,
this.scale*W.height*ka.height)};b.getPreferredPageSize=function(W,ka,q){W=this.getPageLayout();ka=this.getPageSize();return new mxRectangle(0,0,W.width*ka.width,W.height*ka.height)};var d=null,g=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(W,ka,q,F){if(null!=b.container&&!b.isViewer()){q=null!=q?q:0;F=null!=F?F:0;var S=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),ba=mxUtils.hasScrollbars(b.container),U=b.view.translate,ca=b.view.scale,
ea=mxRectangle.fromRectangle(S);ea.x=ea.x/ca-U.x;ea.y=ea.y/ca-U.y;ea.width/=ca;ea.height/=ca;U=b.container.scrollTop;var na=b.container.scrollLeft,ra=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)ra+=3;var ya=b.container.offsetWidth-ra;ra=b.container.offsetHeight-ra;W=W?Math.max(.3,Math.min(ka||1,ya/ea.width)):ca;ka=(ya-W*ea.width)/2/W;var va=0==this.lightboxVerticalDivider?0:(ra-W*ea.height)/this.lightboxVerticalDivider/W;ba&&(ka=Math.max(ka,0),va=Math.max(va,
0));if(ba||S.width<ya||S.height<ra)b.view.scaleAndTranslate(W,Math.floor(ka-ea.x),Math.floor(va-ea.y)),b.container.scrollTop=U*W/ca,b.container.scrollLeft=na*W/ca;else if(0!=q||0!=F)S=b.view.translate,b.view.setTranslate(Math.floor(S.x+q/ca),Math.floor(S.y+F/ca))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var l=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",l);this.destroyFunctions.push(function(){mxEvent.removeListener(window,
"resize",l)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(W){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(W){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var D=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position=
"fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=b.isViewer()?"0":"50%";mxClient.IS_IE||mxClient.IS_IE11?(this.chromelessToolbar.style.backgroundColor="#ffffff",this.chromelessToolbar.style.border="3px solid black"):this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,
"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var p=mxUtils.bind(this,function(){var W=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=W?parseInt(W["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",p);p();var E=0;p=mxUtils.bind(this,function(W,ka,q){E++;
var F=document.createElement("span");F.style.paddingLeft="8px";F.style.paddingRight="8px";F.style.cursor="pointer";mxEvent.addListener(F,"click",W);null!=q&&F.setAttribute("title",q);W=document.createElement("img");W.setAttribute("border","0");W.setAttribute("src",ka);W.style.width="36px";W.style.filter="invert(100%)";F.appendChild(W);this.chromelessToolbar.appendChild(F);return F});if(null!=D.backBtn){var N=Graph.sanitizeLink(D.backBtn.url);null!=N&&p(mxUtils.bind(this,function(W){window.location.href=
N;mxEvent.consume(W)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var R=p(mxUtils.bind(this,function(W){this.actions.get("previousPage").funct();mxEvent.consume(W)}),Editor.previousImage,mxResources.get("previousPage")),G=document.createElement("div");G.style.fontFamily=Editor.defaultHtmlFont;G.style.display="inline-block";G.style.verticalAlign="top";G.style.fontWeight="bold";G.style.marginTop="8px";G.style.fontSize="14px";G.style.color=mxClient.IS_IE||mxClient.IS_IE11?
"#000000":"#ffffff";this.chromelessToolbar.appendChild(G);var M=p(mxUtils.bind(this,function(W){this.actions.get("nextPage").funct();mxEvent.consume(W)}),Editor.nextImage,mxResources.get("nextPage")),Q=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(G.innerText="",mxUtils.write(G,mxUtils.indexOf(this.pages,this.currentPage)+1+" / "+this.pages.length))});R.style.paddingLeft="0px";R.style.paddingRight="4px";M.style.paddingLeft="4px";M.style.paddingRight=
"0px";var e=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(M.style.display="",R.style.display="",G.style.display="inline-block"):(M.style.display="none",R.style.display="none",G.style.display="none");Q()});this.editor.addListener("resetGraphView",e);this.editor.addListener("pageSelected",Q)}p(mxUtils.bind(this,function(W){this.actions.get("zoomOut").funct();mxEvent.consume(W)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");p(mxUtils.bind(this,
function(W){this.actions.get("zoomIn").funct();mxEvent.consume(W)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(W){b.isLightboxView()?(1==b.view.scale?this.lightboxFit():b.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(W)}),Editor.zoomFitImage,mxResources.get("fit"));var f=null,k=null,z=mxUtils.bind(this,function(W){null!=f&&(window.clearTimeout(f),f=null);null!=k&&(window.clearTimeout(k),k=null);f=window.setTimeout(mxUtils.bind(this,
function(){mxUtils.setOpacity(this.chromelessToolbar,0);f=null;k=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";k=null}),600)}),W||200)}),t=mxUtils.bind(this,function(W){null!=f&&(window.clearTimeout(f),f=null);null!=k&&(window.clearTimeout(k),k=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,W||30)});if("1"==urlParams.layers){this.layersDialog=null;var B=p(mxUtils.bind(this,function(W){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),
this.layersDialog=null;else{this.layersDialog=b.createLayersDialog(null,!0);mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var ka=B.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily=Editor.defaultHtmlFont;this.layersDialog.style.width="160px";this.layersDialog.style.padding=
"4px 2px 4px 2px";this.layersDialog.style.left=ka.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";mxClient.IS_IE||mxClient.IS_IE11?(this.layersDialog.style.backgroundColor="#ffffff",this.layersDialog.style.border="2px solid black",this.layersDialog.style.color="#000000"):(this.layersDialog.style.backgroundColor="#000000",this.layersDialog.style.color="#ffffff",mxUtils.setOpacity(this.layersDialog,80));ka=mxUtils.getCurrentStyle(this.editor.graph.container);
this.layersDialog.style.zIndex=ka.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(W)}),Editor.layersImage,mxResources.get("layers")),I=b.getModel();I.addListener(mxEvent.CHANGE,function(){B.style.display=1<I.getChildCount(I.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(p);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||p(mxUtils.bind(this,function(W){null!=
this.editor.editButtonFunc?this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(W)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(e=0;e<this.lightboxToolbarActions.length;e++){var O=this.lightboxToolbarActions[e];O.elem=p(O.fn,O.icon,O.tooltip)}if(null!=D.refreshBtn){var J=null==D.refreshBtn.url?null:Graph.sanitizeLink(D.refreshBtn.url);
p(mxUtils.bind(this,function(W){null!=J?window.location.href=J:window.location.reload();mxEvent.consume(W)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=D.fullscreenBtn&&window.self!==window.top&&p(mxUtils.bind(this,function(W){D.fullscreenBtn.url?b.openLink(D.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(W)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",null,"Open in New Window"));(D.closeBtn&&window.self===window.top||b.lightbox&&("1"==
urlParams.close||this.container!=document.body))&&p(mxUtils.bind(this,function(W){"1"==urlParams.close||D.closeBtn?window.close():(this.destroy(),mxEvent.consume(W))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,
function(W){mxEvent.isTouchEvent(W)||(mxEvent.isShiftDown(W)||t(30),z())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(W){mxEvent.consume(W)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(W){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(W)?z():t(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(W){mxEvent.isShiftDown(W)?z():t(100);
mxEvent.consume(W)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(W){mxEvent.isTouchEvent(W)||t(30)}));var y=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(W,ka){this.startX=ka.getGraphX();this.startY=ka.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(W,ka){},mouseUp:function(W,ka){mxEvent.isTouchEvent(ka.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<
y&&Math.abs(this.scrollTop-b.container.scrollTop)<y&&Math.abs(this.startX-ka.getGraphX())<y&&Math.abs(this.startY-ka.getGraphY())<y&&(0<parseFloat(g.chromelessToolbar.style.opacity||0)?z():t(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ia=b.view.validate;b.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var W=this.graph.getPagePadding(),ka=this.graph.getPageSize();this.translate.x=W.x-(this.x0||
0)*ka.width;this.translate.y=W.y-(this.y0||0)*ka.height}ia.apply(this,arguments)};if(!b.isViewer()){var da=b.sizeDidChange;b.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var W=this.getPageLayout(),ka=this.getPagePadding(),q=this.getPageSize(),F=Math.ceil(2*ka.x+W.width*q.width),S=Math.ceil(2*ka.y+W.height*q.height),ba=b.minimumGraphSize;if(null==ba||ba.width!=F||ba.height!=S)b.minimumGraphSize=new mxRectangle(0,0,F,S);F=ka.x-W.x*q.width;ka=ka.y-W.y*q.height;
this.autoTranslate||this.view.translate.x==F&&this.view.translate.y==ka?da.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=W.x,this.view.y0=W.y,W=b.view.translate.x,q=b.view.translate.y,b.view.setTranslate(F,ka),b.container.scrollLeft+=Math.round((F-W)*b.view.scale),b.container.scrollTop+=Math.round((ka-q)*b.view.scale),this.autoTranslate=!1)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ja=b.view.getBackgroundPane(),aa=b.view.getDrawPane();b.cumulativeZoomFactor=
1;var qa=null,sa=null,L=null,V=null,T=null,Y=function(W){null!=qa&&window.clearTimeout(qa);0<=W&&window.setTimeout(function(){if(!b.isMouseDown||V)qa=window.setTimeout(mxUtils.bind(this,function(){b.isFastZoomEnabled()&&(null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform-origin",null),mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform",null)),aa.style.transformOrigin="",ja.style.transformOrigin=
"",mxClient.IS_SF?(aa.style.transform="scale(1)",ja.style.transform="scale(1)",window.setTimeout(function(){aa.style.transform="";ja.style.transform=""},0)):(aa.style.transform="",ja.style.transform=""),b.view.getDecoratorPane().style.opacity="",b.view.getOverlayPane().style.opacity="");var ka=new mxPoint(b.container.scrollLeft,b.container.scrollTop),q=mxUtils.getOffset(b.container),F=b.view.scale,S=0,ba=0;null!=sa&&(S=b.container.offsetWidth/2-sa.x+q.x,ba=b.container.offsetHeight/2-sa.y+q.y);b.zoom(b.cumulativeZoomFactor,
null,b.isFastZoomEnabled()?20:null);b.view.scale!=F&&(null!=L&&(S+=ka.x-L.x,ba+=ka.y-L.y),null!=d&&g.chromelessResize(!1,null,S*(b.cumulativeZoomFactor-1),ba*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||0==S&&0==ba||(b.container.scrollLeft-=S*(b.cumulativeZoomFactor-1),b.container.scrollTop-=ba*(b.cumulativeZoomFactor-1)));null!=T&&aa.setAttribute("filter",T);b.cumulativeZoomFactor=1;T=V=sa=L=qa=null}),null!=W?W:b.isFastZoomEnabled()?g.wheelZoomDelay:g.lazyZoomDelay)},0)};b.lazyZoom=
function(W,ka,q,F){F=null!=F?F:this.zoomFactor;(ka=ka||!b.scrollbars)&&(sa=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/2));W?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=F,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=
(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=F,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;b.isFastZoomEnabled()&&(null==T&&""!=aa.getAttribute("filter")&&(T=aa.getAttribute("filter"),aa.removeAttribute("filter")),L=new mxPoint(b.container.scrollLeft,b.container.scrollTop),W=ka||null==sa?b.container.scrollLeft+
b.container.clientWidth/2:sa.x+b.container.scrollLeft-b.container.offsetLeft,F=ka||null==sa?b.container.scrollTop+b.container.clientHeight/2:sa.y+b.container.scrollTop-b.container.offsetTop,aa.style.transformOrigin=W+"px "+F+"px",aa.style.transform="scale("+this.cumulativeZoomFactor+")",ja.style.transformOrigin=W+"px "+F+"px",ja.style.transform="scale("+this.cumulativeZoomFactor+")",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&(W=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(W.style,
"transform-origin",(ka||null==sa?b.container.clientWidth/2+b.container.scrollLeft-W.offsetLeft+"px":sa.x+b.container.scrollLeft-W.offsetLeft-b.container.offsetLeft+"px")+" "+(ka||null==sa?b.container.clientHeight/2+b.container.scrollTop-W.offsetTop+"px":sa.y+b.container.scrollTop-W.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(W.style,"transform","scale("+this.cumulativeZoomFactor+")")),b.view.getDecoratorPane().style.opacity="0",b.view.getOverlayPane().style.opacity="0",null!=g.hoverIcons&&
g.hoverIcons.reset());Y(b.isFastZoomEnabled()?q:0)};mxEvent.addGestureListeners(b.container,function(W){null!=qa&&window.clearTimeout(qa)},null,function(W){1!=b.cumulativeZoomFactor&&Y(0)});mxEvent.addListener(b.container,"scroll",function(W){null==qa||b.isMouseDown||1==b.cumulativeZoomFactor||Y(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(W,ka,q,F,S){b.fireEvent(new mxEventObject("wheel"));if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!q&&b.isScrollWheelEvent(W))q=
b.view.getTranslate(),F=40/b.view.scale,mxEvent.isShiftDown(W)?b.view.setTranslate(q.x+(ka?-F:F),q.y):b.view.setTranslate(q.x,q.y+(ka?F:-F));else if(q||b.isZoomWheelEvent(W))for(var ba=mxEvent.getSource(W);null!=ba;){if(ba==b.container)return b.tooltipHandler.hideTooltip(),sa=null!=F&&null!=S?new mxPoint(F,S):new mxPoint(mxEvent.getClientX(W),mxEvent.getClientY(W)),V=q,q=b.zoomFactor,F=null,W.ctrlKey&&null!=W.deltaY&&40>Math.abs(W.deltaY)&&Math.round(W.deltaY)!=W.deltaY?q=1+Math.abs(W.deltaY)/20*
(q-1):null!=W.movementY&&"pointermove"==W.type&&(q=1+Math.max(1,Math.abs(W.movementY))/20*(q-1),F=-1),b.lazyZoom(ka,null,F,q),mxEvent.consume(W),!1;ba=ba.parentNode}}),b.container);b.panningHandler.zoomGraph=function(W){b.cumulativeZoomFactor=W.scale;b.lazyZoom(0<W.scale,!0);mxEvent.consume(W)}};EditorUi.prototype.addChromelessToolbarItems=function(b){b(mxUtils.bind(this,function(d){this.actions.get("print").funct();mxEvent.consume(d)}),Editor.printImage,mxResources.get("print"))};
EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};EditorUi.prototype.createTemporaryGraph=function(b){return Graph.createOffscreenGraph(b)};EditorUi.prototype.addChromelessClickHandler=function(){var b=urlParams.highlight;null!=b&&0<b.length&&(b="#"+b);this.editor.graph.addClickHandler(b)};
EditorUi.prototype.toggleFormatPanel=function(b){b=null!=b?b:0==this.formatWidth;null!=this.format&&(this.formatWidth=b?240:0,this.formatContainer.style.display=b?"":"none",this.refresh(),this.format.refresh(),this.fireEvent(new mxEventObject("formatWidthChanged")))};EditorUi.prototype.isFormatPanelVisible=function(){return 0<this.formatWidth};
EditorUi.prototype.lightboxFit=function(b){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var d=urlParams.border,g=60;null!=d&&(g=parseInt(d));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(g,null,null,null,null,null,b);this.editor.graph.maxFitScale=null}};EditorUi.prototype.isDiagramEmpty=function(){var b=this.editor.graph.getModel();return 1==b.getChildCount(b.root)&&0==b.getChildCount(b.getChildAt(b.root,0))};
EditorUi.prototype.isSelectionAllowed=function(b){return"SELECT"==mxEvent.getSource(b).nodeName||"INPUT"==mxEvent.getSource(b).nodeName&&mxUtils.isAncestorNode(this.formatContainer,mxEvent.getSource(b))};EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){if(!this.editor.isChromelessView())return this.onBeforeUnload()})};EditorUi.prototype.onBeforeUnload=function(){if(this.editor.modified)return mxResources.get("allChangesLost")};
EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(b,d){try{var g=mxUtils.parseXml(b);this.editor.setGraphXml(g.documentElement);this.editor.setModified(!1);this.editor.undoManager.clear();null!=d&&(this.editor.setFilename(d),this.updateDocumentTitle())}catch(l){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+l.message)}}))}catch(b){}this.editor.graph.view.validate();this.editor.graph.sizeDidChange();
this.editor.fireEvent(new mxEventObject("resetGraphView"))};EditorUi.prototype.showPopupMenu=function(b,d,g,l){this.editor.graph.popupMenuHandler.hideMenu();var D=new mxPopupMenu(b);D.div.className+=" geMenubarMenu";D.smartSeparators=!0;D.showDisabled=!0;D.autoExpand=!0;D.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(D,arguments);D.destroy()});D.popup(d,g,null,l);this.setCurrentMenu(D)};
EditorUi.prototype.setCurrentMenu=function(b,d){this.currentMenuElt=d;this.currentMenu=b};EditorUi.prototype.resetCurrentMenu=function(){this.currentMenu=this.currentMenuElt=null};EditorUi.prototype.hideCurrentMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.resetCurrentMenu())};EditorUi.prototype.updateDocumentTitle=function(){var b=this.editor.getOrCreateFilename();null!=this.editor.appName&&(b+=" - "+this.editor.appName);document.title=b};
EditorUi.prototype.createHoverIcons=function(){return new HoverIcons(this.editor.graph)};EditorUi.prototype.redo=function(){try{this.editor.graph.isEditing()?document.execCommand("redo",!1,null):this.editor.undoManager.redo()}catch(b){}};EditorUi.prototype.undo=function(){try{var b=this.editor.graph;if(b.isEditing()){var d=b.cellEditor.textarea.innerHTML;document.execCommand("undo",!1,null);d==b.cellEditor.textarea.innerHTML&&(b.stopEditing(!0),this.editor.undoManager.undo())}else this.editor.undoManager.undo()}catch(g){}};
EditorUi.prototype.canRedo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canRedo()};EditorUi.prototype.canUndo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canUndo()};EditorUi.prototype.getEditBlankXml=function(){return mxUtils.getXml(this.editor.getGraphXml())};EditorUi.prototype.getUrl=function(b){b=null!=b?b:window.location.pathname;var d=0<b.indexOf("?")?1:0,g;for(g in urlParams)b=0==d?b+"?":b+"&",b+=g+"="+urlParams[g],d++;return b};
EditorUi.prototype.setScrollbars=function(b){var d=this.editor.graph,g=d.container.style.overflow;d.scrollbars=b;this.editor.updateGraphComponents();g!=d.container.style.overflow&&(d.container.scrollTop=0,d.container.scrollLeft=0,d.view.scaleAndTranslate(1,0,0),this.resetScrollbars());this.fireEvent(new mxEventObject("scrollbarsChanged"))};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars};
EditorUi.prototype.resetScrollbars=function(){var b=this.editor.graph;if(!this.editor.extendCanvas)b.container.scrollTop=0,b.container.scrollLeft=0,mxUtils.hasScrollbars(b.container)||b.view.setTranslate(0,0);else if(!this.editor.isChromelessView())if(mxUtils.hasScrollbars(b.container))if(b.pageVisible){var d=b.getPagePadding();b.container.scrollTop=Math.floor(d.y-this.editor.initialTopSpacing)-1;b.container.scrollLeft=Math.floor(Math.min(d.x,(b.container.scrollWidth-b.container.clientWidth)/2))-
1;d=b.getGraphBounds();0<d.width&&0<d.height&&(d.x>b.container.scrollLeft+.9*b.container.clientWidth&&(b.container.scrollLeft=Math.min(d.x+d.width-b.container.clientWidth,d.x-10)),d.y>b.container.scrollTop+.9*b.container.clientHeight&&(b.container.scrollTop=Math.min(d.y+d.height-b.container.clientHeight,d.y-10)))}else{d=b.getGraphBounds();var g=Math.max(d.width,b.scrollTileSize.width*b.view.scale);b.container.scrollTop=Math.floor(Math.max(0,d.y-Math.max(20,(b.container.clientHeight-Math.max(d.height,
b.scrollTileSize.height*b.view.scale))/4)));b.container.scrollLeft=Math.floor(Math.max(0,d.x-Math.max(0,(b.container.clientWidth-g)/2)))}else{d=mxRectangle.fromRectangle(b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds());g=b.view.translate;var l=b.view.scale;d.x=d.x/l-g.x;d.y=d.y/l-g.y;d.width/=l;d.height/=l;b.view.setTranslate(Math.floor(Math.max(0,(b.container.clientWidth-d.width)/2)-d.x+2),Math.floor((b.pageVisible?0:Math.max(0,(b.container.clientHeight-d.height)/4))-d.y+1))}};
EditorUi.prototype.setPageVisible=function(b){var d=this.editor.graph,g=mxUtils.hasScrollbars(d.container),l=0,D=0;g&&(l=d.view.translate.x*d.view.scale-d.container.scrollLeft,D=d.view.translate.y*d.view.scale-d.container.scrollTop);d.pageVisible=b;d.pageBreaksVisible=b;d.preferPageSize=b;d.view.validateBackground();if(g){var p=d.getSelectionCells();d.clearSelection();d.setSelectionCells(p)}d.sizeDidChange();g&&(d.container.scrollLeft=d.view.translate.x*d.view.scale-l,d.container.scrollTop=d.view.translate.y*
d.view.scale-D);d.defaultPageVisible=b;this.fireEvent(new mxEventObject("pageViewChanged"))};
EditorUi.prototype.installResizeHandler=function(b,d,g){d&&(b.window.setSize=function(D,p){if(!this.minimized){var E=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;D=Math.min(D,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.getX());p=Math.min(p,E-this.getY())}mxWindow.prototype.setSize.apply(this,arguments)});b.window.setLocation=function(D,p){var E=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,
N=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,R=parseInt(this.div.style.width),G=parseInt(this.div.style.height);D=Math.max(0,Math.min(D,E-R));p=Math.max(0,Math.min(p,N-G));this.getX()==D&&this.getY()==p||mxWindow.prototype.setLocation.apply(this,arguments);d&&!this.minimized&&this.setSize(R,G)};var l=mxUtils.bind(this,function(){var D=b.window.getX(),p=b.window.getY();b.window.setLocation(D,p)});mxEvent.addListener(window,"resize",l);b.destroy=function(){mxEvent.removeListener(window,
"resize",l);b.window.destroy();null!=g&&g()}};function ChangeGridColor(b,d){this.ui=b;this.color=d}ChangeGridColor.prototype.execute=function(){var b=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=b};(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);mxCodecRegistry.register(b)})();
function ChangePageSetup(b,d,g,l,D){this.ui=b;this.previousColor=this.color=d;this.previousImage=this.image=g;this.previousFormat=this.format=l;this.previousPageScale=this.pageScale=D;this.ignoreImage=this.ignoreColor=!1}
ChangePageSetup.prototype.execute=function(){var b=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var d=b.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=d}if(!this.ignoreImage){this.image=this.previousImage;d=b.backgroundImage;var g=this.previousImage;null!=g&&null!=g.src&&"data:page/id,"==g.src.substring(0,13)&&(g=this.ui.createImageForPageLink(g.src,this.ui.currentPage));this.ui.setBackgroundImage(g);this.previousImage=d}null!=this.previousFormat&&
(this.format=this.previousFormat,d=b.pageFormat,this.previousFormat.width!=d.width||this.previousFormat.height!=d.height)&&(this.ui.setPageFormat(this.previousFormat),this.previousFormat=d);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled);null!=this.previousPageScale&&(b=this.ui.editor.graph.pageScale,this.previousPageScale!=b&&(this.ui.setPageScale(this.previousPageScale),
this.previousPageScale=b))};(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat","previousPageScale"]);b.afterDecode=function(d,g,l){l.previousColor=l.color;l.previousImage=l.image;l.previousFormat=l.format;l.previousPageScale=l.pageScale;null!=l.foldingEnabled&&(l.foldingEnabled=!l.foldingEnabled);return l};mxCodecRegistry.register(b)})();
EditorUi.prototype.setBackgroundColor=function(b){this.editor.graph.background=b;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("backgroundColorChanged"))};EditorUi.prototype.setFoldingEnabled=function(b){this.editor.graph.foldingEnabled=b;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))};
EditorUi.prototype.setPageFormat=function(b,d){d=null!=d?d:"1"==urlParams.sketch;this.editor.graph.pageFormat=b;d||(this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct());this.fireEvent(new mxEventObject("pageFormatChanged"))};
EditorUi.prototype.setPageScale=function(b){this.editor.graph.pageScale=b;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))};EditorUi.prototype.setGridColor=function(b){this.editor.graph.view.gridColor=b;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))};
EditorUi.prototype.addUndoListener=function(){var b=this.actions.get("undo"),d=this.actions.get("redo"),g=this.editor.undoManager,l=mxUtils.bind(this,function(){b.setEnabled(this.canUndo());d.setEnabled(this.canRedo())});g.addListener(mxEvent.ADD,l);g.addListener(mxEvent.UNDO,l);g.addListener(mxEvent.REDO,l);g.addListener(mxEvent.CLEAR,l);var D=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){D.apply(this,arguments);l()};var p=this.editor.graph.cellEditor.stopEditing;
this.editor.graph.cellEditor.stopEditing=function(E,N){p.apply(this,arguments);l()};l()};
EditorUi.prototype.updateActionStates=function(){for(var b=this.editor.graph,d=this.getSelectionState(),g=b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()),l="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded strokeColor sharp snapToGrid".split(" "),D=0;D<l.length;D++)this.actions.get(l[D]).setEnabled(0<d.cells.length);
this.actions.get("grid").setEnabled(!this.editor.chromeless||this.editor.editable);this.actions.get("pasteSize").setEnabled(null!=this.copiedSize&&0<d.vertices.length);this.actions.get("pasteData").setEnabled(null!=this.copiedValue&&0<d.cells.length);this.actions.get("setAsDefaultStyle").setEnabled(1==b.getSelectionCount());this.actions.get("lockUnlock").setEnabled(!b.isSelectionEmpty());this.actions.get("bringForward").setEnabled(1==d.cells.length);this.actions.get("sendBackward").setEnabled(1==
d.cells.length);this.actions.get("rotation").setEnabled(1==d.vertices.length);this.actions.get("wordWrap").setEnabled(1==d.vertices.length);this.actions.get("autosize").setEnabled(0<d.vertices.length);this.actions.get("copySize").setEnabled(1==d.vertices.length);this.actions.get("clearWaypoints").setEnabled(d.connections);this.actions.get("curved").setEnabled(0<d.edges.length);this.actions.get("turn").setEnabled(0<d.cells.length);this.actions.get("group").setEnabled(!d.row&&!d.cell&&(1<d.cells.length||
1==d.vertices.length&&0==b.model.getChildCount(d.cells[0])&&!b.isContainer(d.vertices[0])));this.actions.get("ungroup").setEnabled(!d.row&&!d.cell&&!d.table&&0<d.vertices.length&&(b.isContainer(d.vertices[0])||0<b.getModel().getChildCount(d.vertices[0])));this.actions.get("removeFromGroup").setEnabled(1==d.cells.length&&b.getModel().isVertex(b.getModel().getParent(d.cells[0])));this.actions.get("collapsible").setEnabled(1==d.vertices.length&&(0<b.model.getChildCount(d.vertices[0])||b.isContainer(d.vertices[0])));
this.actions.get("exitGroup").setEnabled(null!=b.view.currentRoot);this.actions.get("home").setEnabled(null!=b.view.currentRoot);this.actions.get("enterGroup").setEnabled(1==d.cells.length&&b.isValidRoot(d.cells[0]));this.actions.get("editLink").setEnabled(1==d.cells.length);this.actions.get("openLink").setEnabled(1==d.cells.length&&null!=b.getLinkForCell(d.cells[0]));this.actions.get("guides").setEnabled(b.isEnabled());this.actions.get("selectVertices").setEnabled(g);this.actions.get("selectEdges").setEnabled(g);
this.actions.get("selectAll").setEnabled(g);this.actions.get("selectNone").setEnabled(g);l=1==d.vertices.length&&b.isCellFoldable(d.vertices[0]);this.actions.get("expand").setEnabled(l);this.actions.get("collapse").setEnabled(l);this.menus.get("navigation").setEnabled(0<d.cells.length||null!=b.view.currentRoot);this.menus.get("layout").setEnabled(g);this.menus.get("insert").setEnabled(g);this.menus.get("direction").setEnabled(d.unlocked&&1==d.vertices.length);this.menus.get("distribute").setEnabled(d.unlocked&&
1<d.vertices.length);this.menus.get("align").setEnabled(d.unlocked&&0<d.cells.length);this.updatePasteActionStates()};EditorUi.prototype.zeroOffset=new mxPoint(0,0);EditorUi.prototype.getDiagramContainerOffset=function(){return this.zeroOffset};
EditorUi.prototype.refresh=function(b){b=null!=b?b:!0;var d=this.container.clientWidth,g=this.container.clientHeight;this.container==document.body&&(d=document.body.clientWidth||document.documentElement.clientWidth,g=document.documentElement.clientHeight);var l=0;mxClient.IS_IOS&&!window.navigator.standalone&&"undefined"!==typeof Menus&&window.innerHeight!=document.documentElement.clientHeight&&(l=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var D=Math.max(0,Math.min(this.hsplitPosition,
d-this.splitSize-20));d=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",d+=this.menubarHeight);null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",d+=this.toolbarHeight);0<d&&(d+=1);var p=0;if(null!=this.sidebarFooterContainer){var E=this.footerHeight+l;p=Math.max(0,Math.min(g-d-E,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=D+"px";this.sidebarFooterContainer.style.height=
p+"px";this.sidebarFooterContainer.style.bottom=E+"px"}g=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=d+"px";this.sidebarContainer.style.width=D+"px";this.formatContainer.style.top=d+"px";this.formatContainer.style.width=g+"px";this.formatContainer.style.display=null!=this.format?"":"none";E=this.getDiagramContainerOffset();var N=null!=this.hsplit.parentNode?D+this.splitSize:0;this.footerContainer.style.height=this.footerHeight+"px";this.hsplit.style.top=this.sidebarContainer.style.top;
this.hsplit.style.bottom=this.footerHeight+l+"px";this.hsplit.style.left=D+"px";this.footerContainer.style.display=0==this.footerHeight?"none":"";null!=this.tabContainer&&(this.tabContainer.style.left=N+"px");0<this.footerHeight&&(this.footerContainer.style.bottom=l+"px");D=0;null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+l+"px",this.tabContainer.style.right=g+"px",D=this.tabContainer.clientHeight);this.sidebarContainer.style.bottom=this.footerHeight+p+l+"px";this.formatContainer.style.bottom=
this.footerHeight+l+"px";"1"!=urlParams.embedInline&&(this.diagramContainer.style.left=N+E.x+"px",this.diagramContainer.style.top=d+E.y+"px",this.diagramContainer.style.right=g+"px",this.diagramContainer.style.bottom=this.footerHeight+l+D+"px");b&&this.editor.graph.sizeDidChange()};EditorUi.prototype.createTabContainer=function(){return null};
EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer");this.toolbarContainer=this.createDiv("geToolbarContainer");this.sidebarContainer=this.createDiv("geSidebarContainer");this.formatContainer=this.createDiv("geSidebarContainer geFormatContainer");this.diagramContainer=this.createDiv("geDiagramContainer");this.footerContainer=this.createDiv("geFooterContainer");this.hsplit=this.createDiv("geHsplit");this.hsplit.setAttribute("title",mxResources.get("collapseExpand"));
this.menubarContainer.style.top="0px";this.menubarContainer.style.left="0px";this.menubarContainer.style.right="0px";this.toolbarContainer.style.left="0px";this.toolbarContainer.style.right="0px";this.sidebarContainer.style.left="0px";this.formatContainer.style.right="0px";this.formatContainer.style.zIndex="1";this.diagramContainer.style.right=(null!=this.format?this.formatWidth:0)+"px";this.footerContainer.style.left="0px";this.footerContainer.style.right="0px";this.footerContainer.style.bottom=
"0px";this.footerContainer.style.zIndex=mxPopupMenu.prototype.zIndex-3;this.hsplit.style.width=this.splitSize+"px";if(this.sidebarFooterContainer=this.createSidebarFooterContainer())this.sidebarFooterContainer.style.left="0px";this.editor.chromeless?this.diagramContainer.style.border="none":this.tabContainer=this.createTabContainer()};
EditorUi.prototype.createSidebarContainer=function(){var b=document.createElement("div");b.className="geSidebarContainer";b.style.position="absolute";b.style.width="100%";b.style.height="100%";b.style.border="1px solid whiteSmoke";b.style.overflowX="hidden";b.style.overflowY="auto";return b};EditorUi.prototype.createSidebarFooterContainer=function(){return null};
EditorUi.prototype.createUi=function(){this.menubar=this.editor.chromeless?null:this.menus.createMenubar(this.createDiv("geMenubar"));null!=this.menubar&&this.menubarContainer.appendChild(this.menubar.container);null!=this.menubar&&(this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.container.appendChild(this.menubarContainer));
this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContainer);null!=this.sidebar&&this.container.appendChild(this.sidebarContainer);this.format=this.editor.chromeless||!this.formatEnabled?null:this.createFormat(this.formatContainer);null!=this.format&&this.container.appendChild(this.formatContainer);var b=this.editor.chromeless?null:this.createFooter();null!=b&&(this.footerContainer.appendChild(b),this.container.appendChild(this.footerContainer));null!=this.sidebar&&this.sidebarFooterContainer&&
this.container.appendChild(this.sidebarFooterContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar"));null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit,
!0,0,mxUtils.bind(this,function(d){this.hsplitPosition=d;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var b=document.createElement("a");b.className="geItem geStatus";return b};EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=b;0==this.statusContainer.getElementsByTagName("div").length&&(this.statusContainer.innerText="",b=this.createStatusDiv(b),this.statusContainer.appendChild(b))};
EditorUi.prototype.createStatusDiv=function(b){var d=document.createElement("div");d.setAttribute("title",b);d.innerHTML=b;return d};EditorUi.prototype.createToolbar=function(b){return new Toolbar(this,b)};EditorUi.prototype.createSidebar=function(b){return new Sidebar(this,b)};EditorUi.prototype.createFormat=function(b){return new Format(this,b)};EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")};
EditorUi.prototype.createDiv=function(b){var d=document.createElement("div");d.className=b;return d};
EditorUi.prototype.addSplitHandler=function(b,d,g,l){function D(Q){if(null!=E){var e=new mxPoint(mxEvent.getClientX(Q),mxEvent.getClientY(Q));l(Math.max(0,N+(d?e.x-E.x:E.y-e.y)-g));mxEvent.consume(Q);N!=M()&&(R=!0,G=null)}}function p(Q){D(Q);E=N=null}var E=null,N=null,R=!0,G=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var M=mxUtils.bind(this,function(){var Q=parseInt(d?b.style.left:b.style.bottom);d||(Q=Q+g-this.footerHeight);return Q});mxEvent.addGestureListeners(b,function(Q){E=new mxPoint(mxEvent.getClientX(Q),
mxEvent.getClientY(Q));N=M();R=!1;mxEvent.consume(Q)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(Q){if(!R&&this.hsplitClickEnabled){var e=null!=G?G-g:0;G=M();l(e);mxEvent.consume(Q)}}));mxEvent.addGestureListeners(document,null,D,p);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,D,p)})};
EditorUi.prototype.prompt=function(b,d,g){b=new FilenameDialog(this,d,mxResources.get("apply"),function(l){g(parseFloat(l))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};
EditorUi.prototype.handleError=function(b,d,g,l,D){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=d){D=mxUtils.htmlEntities(mxResources.get("unknownError"));var p=mxResources.get("ok");d=null!=d?d:mxResources.get("error");null!=b&&null!=b.message&&(D=mxUtils.htmlEntities(b.message));this.showError(d,D,p,g,null,null,null,null,null,null,null,null,l?g:null)}else null!=g&&g()};
EditorUi.prototype.showError=function(b,d,g,l,D,p,E,N,R,G,M,Q,e){b=new ErrorDialog(this,b,d,g||mxResources.get("ok"),l,D,p,E,Q,N,R);d=Math.ceil(null!=d?d.length/50:1);this.showDialog(b.container,G||340,M||100+20*d,!0,!1,e);b.init()};EditorUi.prototype.showDialog=function(b,d,g,l,D,p,E,N,R,G){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,d,g,l,D,p,E,N,R,G);this.dialogs.push(this.dialog)};
EditorUi.prototype.hideDialog=function(b,d,g){null!=this.dialogs&&0<this.dialogs.length&&(null==g||g==this.dialog.container.firstChild)&&(g=this.dialogs.pop(),0==g.close(b,d)?this.dialogs.push(g):(this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog")),null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&window.setTimeout(mxUtils.bind(this,function(){this.editor.graph.isEditing()&&null!=this.editor.graph.cellEditor.textarea?
this.editor.graph.cellEditor.textarea.focus():(mxUtils.clearSelection(),this.editor.graph.container.focus())}),0)))};EditorUi.prototype.ctrlEnter=function(){var b=this.editor.graph;if(b.isEnabled())try{for(var d=b.getSelectionCells(),g=new mxDictionary,l=[],D=0;D<d.length;D++){var p=b.isTableCell(d[D])?b.model.getParent(d[D]):d[D];null==p||g.get(p)||(g.put(p,!0),l.push(p))}b.setSelectionCells(b.duplicateCells(l,!1))}catch(E){this.handleError(E)}};
EditorUi.prototype.pickColor=function(b,d){var g=this.editor.graph,l=g.cellEditor.saveSelection(),D=230+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12));b=new ColorDialog(this,mxUtils.rgba2hex(b)||"none",function(p){g.cellEditor.restoreSelection(l);d(p)},function(){g.cellEditor.restoreSelection(l)});this.showDialog(b.container,230,D,!0,!1);b.init()};
EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})};
EditorUi.prototype.extractGraphModelFromHtml=function(b){var d=null;try{var g=b.indexOf("&lt;mxGraphModel ");if(0<=g){var l=b.lastIndexOf("&lt;/mxGraphModel&gt;");l>g&&(d=b.substring(g,l+21).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}}catch(D){}return d};
EditorUi.prototype.readGraphModelFromClipboard=function(b){this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(d){null!=d?b(d):this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(g){if(null!=g){var l=decodeURIComponent(g);this.isCompatibleString(l)&&(g=l)}b(g)}),"text")}),"html")};
EditorUi.prototype.readGraphModelFromClipboardWithType=function(b,d){navigator.clipboard.read().then(mxUtils.bind(this,function(g){if(null!=g&&0<g.length&&"html"==d&&0<=mxUtils.indexOf(g[0].types,"text/html"))g[0].getType("text/html").then(mxUtils.bind(this,function(l){l.text().then(mxUtils.bind(this,function(D){try{var p=this.parseHtmlData(D),E="text/plain"!=p.getAttribute("data-type")?p.innerHTML:mxUtils.trim(null==p.innerText?mxUtils.getTextContent(p):p.innerText);try{var N=E.lastIndexOf("%3E");
0<=N&&N<E.length-3&&(E=E.substring(0,N+3))}catch(M){}try{var R=p.getElementsByTagName("span"),G=null!=R&&0<R.length?mxUtils.trim(decodeURIComponent(R[0].textContent)):decodeURIComponent(E);this.isCompatibleString(G)&&(E=G)}catch(M){}}catch(M){}b(this.isCompatibleString(E)?E:null)}))["catch"](function(D){b(null)})}))["catch"](function(l){b(null)});else if(null!=g&&0<g.length&&"text"==d&&0<=mxUtils.indexOf(g[0].types,"text/plain"))g[0].getType("text/plain").then(function(l){l.text().then(function(D){b(D)})["catch"](function(){b(null)})})["catch"](function(){b(null)});
else b(null)}))["catch"](function(g){b(null)})};
EditorUi.prototype.parseHtmlData=function(b){var d=null;if(null!=b&&0<b.length){var g="<meta "==b.substring(0,6);d=document.createElement("div");d.innerHTML=(g?'<meta charset="utf-8">':"")+this.editor.graph.sanitizeHtml(b);asHtml=!0;b=d.getElementsByTagName("style");if(null!=b)for(;0<b.length;)b[0].parentNode.removeChild(b[0]);null!=d.firstChild&&d.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=d.firstChild.nextSibling&&d.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==
d.firstChild.nodeName&&"A"==d.firstChild.nextSibling.nodeName&&null==d.firstChild.nextSibling.nextSibling&&(b=null==d.firstChild.nextSibling.innerText?mxUtils.getTextContent(d.firstChild.nextSibling):d.firstChild.nextSibling.innerText,b==d.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(d,b),asHtml=!1));g=g&&null!=d.firstChild?d.firstChild.nextSibling:d.firstChild;null!=g&&null==g.nextSibling&&g.nodeType==mxConstants.NODETYPE_ELEMENT&&"IMG"==g.nodeName?(b=g.getAttribute("src"),
null!=b&&(Editor.isPngDataUrl(b)&&(g=Editor.extractGraphModelFromPng(b),null!=g&&0<g.length&&(b=g)),mxUtils.setTextContent(d,b),asHtml=!1)):(g=d.getElementsByTagName("img"),1==g.length&&(g=g[0],b=g.getAttribute("src"),null!=b&&g.parentNode==d&&1==d.children.length&&(Editor.isPngDataUrl(b)&&(g=Editor.extractGraphModelFromPng(b),null!=g&&0<g.length&&(b=g)),mxUtils.setTextContent(d,b),asHtml=!1)));asHtml&&Graph.removePasteFormatting(d)}asHtml||d.setAttribute("data-type","text/plain");return d};
EditorUi.prototype.extractGraphModelFromEvent=function(b){var d=null,g=null;null!=b&&(b=null!=b.dataTransfer?b.dataTransfer:b.clipboardData,null!=b&&(10==document.documentMode||11==document.documentMode?g=b.getData("Text"):(g=0<=mxUtils.indexOf(b.types,"text/html")?b.getData("text/html"):null,0<=mxUtils.indexOf(b.types,"text/plain")&&(null==g||0==g.length)&&(g=b.getData("text/plain"))),null!=g&&(g=Graph.zapGremlins(mxUtils.trim(g)),b=this.extractGraphModelFromHtml(g),null!=b&&(g=b))));null!=g&&this.isCompatibleString(g)&&
(d=g);return d};EditorUi.prototype.isCompatibleString=function(b){return!1};EditorUi.prototype.saveFile=function(b){b||null==this.editor.filename?(b=new FilenameDialog(this,this.editor.getOrCreateFilename(),mxResources.get("save"),mxUtils.bind(this,function(d){this.save(d)}),null,mxUtils.bind(this,function(d){if(null!=d&&0<d.length)return!0;mxUtils.confirm(mxResources.get("invalidName"));return!1})),this.showDialog(b.container,300,100,!0,!0),b.init()):this.save(this.editor.getOrCreateFilename())};
EditorUi.prototype.save=function(b){if(null!=b){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var d=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(b)&&!mxUtils.confirm(mxResources.get("replaceIt",[b])))return;localStorage.setItem(b,d);this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}else if(d.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&xml="+encodeURIComponent(d))).simulate(document,
"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(d);return}this.editor.setModified(!1);this.editor.setFilename(b);this.updateDocumentTitle()}catch(g){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}}};
EditorUi.prototype.executeLayouts=function(b,d){this.executeLayout(mxUtils.bind(this,function(){var g=new mxCompositeLayout(this.editor.graph,b),l=this.editor.graph.getSelectionCells();g.execute(this.editor.graph.getDefaultParent(),0==l.length?null:l)}),!0,d)};
EditorUi.prototype.executeLayout=function(b,d,g){var l=this.editor.graph;l.getModel().beginUpdate();try{b()}catch(D){throw D;}finally{this.allowAnimation&&d&&l.isEnabled()?(b=new mxMorphing(l),b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){l.getModel().endUpdate();null!=g&&g()})),b.startAnimation()):(l.getModel().endUpdate(),null!=g&&g())}};
EditorUi.prototype.showImageDialog=function(b,d,g,l){l=this.editor.graph.cellEditor;var D=l.saveSelection(),p=mxUtils.prompt(b,d);l.restoreSelection(D);if(null!=p&&0<p.length){var E=new Image;E.onload=function(){g(p,E.width,E.height)};E.onerror=function(){g(null);mxUtils.alert(mxResources.get("fileNotFound"))};E.src=p}else g(null)};EditorUi.prototype.showLinkDialog=function(b,d,g){b=new LinkDialog(this,b,d,g);this.showDialog(b.container,420,90,!0,!0);b.init()};
EditorUi.prototype.showDataDialog=function(b){null!=b&&(b=new EditDataDialog(this,b),this.showDialog(b.container,480,420,!0,!1,null,!1),b.init())};
EditorUi.prototype.showBackgroundImageDialog=function(b,d){b=null!=b?b:mxUtils.bind(this,function(l){l=new ChangePageSetup(this,null,l);l.ignoreColor=!0;this.editor.graph.model.execute(l)});var g=mxUtils.prompt(mxResources.get("backgroundImage"),null!=d?d.src:"");null!=g&&0<g.length?(d=new Image,d.onload=function(){b(new mxImage(g,d.width,d.height),!1)},d.onerror=function(){b(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},d.src=g):b(null)};
EditorUi.prototype.setBackgroundImage=function(b){this.editor.graph.setBackgroundImage(b);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(b,d,g){mxUtils.confirm(b)?null!=d&&d():null!=g&&g()};EditorUi.prototype.createOutline=function(b){var d=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){d.update(!1)});return d};
EditorUi.prototype.altShiftActions={67:"clearWaypoints",65:"connectionArrows",76:"editLink",80:"connectionPoints",84:"editTooltip",86:"pasteSize",88:"copySize",66:"copyData",69:"pasteData"};
EditorUi.prototype.createKeyHandler=function(b){function d(Q,e,f){if(!l.isSelectionEmpty()&&l.isEnabled()){e=null!=e?e:1;var k=l.getCompositeParents(l.getSelectionCells()),z=0<k.length?k[0]:null;if(null!=z)if(f){l.getModel().beginUpdate();try{for(z=0;z<k.length;z++)if(l.getModel().isVertex(k[z])&&l.isCellResizable(k[z])){var t=l.getCellGeometry(k[z]);null!=t&&(t=t.clone(),37==Q?t.width=Math.max(0,t.width-e):38==Q?t.height=Math.max(0,t.height-e):39==Q?t.width+=e:40==Q&&(t.height+=e),l.getModel().setGeometry(k[z],
t))}}finally{l.getModel().endUpdate()}}else{t=l.model.getParent(z);var B=l.getView().scale;f=null;1==l.getSelectionCount()&&l.model.isVertex(z)&&null!=l.layoutManager&&!l.isCellLocked(z)&&(f=l.layoutManager.getLayout(t));if(null!=f&&f.constructor==mxStackLayout)e=t.getIndex(z),37==Q||38==Q?l.model.add(t,z,Math.max(0,e-1)):(39==Q||40==Q)&&l.model.add(t,z,Math.min(l.model.getChildCount(t),e+1));else{var I=l.graphHandler;null!=I&&(null==I.first&&I.start(z,0,0,k),null!=I.first&&(z=k=0,37==Q?k=-e:38==
Q?z=-e:39==Q?k=e:40==Q&&(z=e),I.currentDx+=k*B,I.currentDy+=z*B,I.checkPreview(),I.updatePreview()),null!=E&&window.clearTimeout(E),E=window.setTimeout(function(){if(null!=I.first){var O=I.roundLength(I.currentDx/B),J=I.roundLength(I.currentDy/B);I.moveCells(I.cells,O,J);I.reset()}},400))}}}}var g=this,l=this.editor.graph,D=new mxKeyHandler(l),p=D.isEventIgnored;D.isEventIgnored=function(Q){return!(mxEvent.isShiftDown(Q)&&9==Q.keyCode)&&(!this.isControlDown(Q)||mxEvent.isShiftDown(Q)||90!=Q.keyCode&&
89!=Q.keyCode&&188!=Q.keyCode&&190!=Q.keyCode&&85!=Q.keyCode)&&(66!=Q.keyCode&&73!=Q.keyCode||!this.isControlDown(Q)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&p.apply(this,arguments)};D.isEnabledForEvent=function(Q){return!mxEvent.isConsumed(Q)&&this.isGraphEvent(Q)&&this.isEnabled()&&(null==g.dialogs||0==g.dialogs.length)};D.isControlDown=function(Q){return mxEvent.isControlDown(Q)||mxClient.IS_MAC&&Q.metaKey};var E=null,N={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,
39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},R=D.getFunction;mxKeyHandler.prototype.getFunction=function(Q){if(l.isEnabled()){if(mxEvent.isShiftDown(Q)&&mxEvent.isAltDown(Q)){var e=g.actions.get(g.altShiftActions[Q.keyCode]);if(null!=e)return e.funct}if(null!=N[Q.keyCode]&&!l.isSelectionEmpty())if(!this.isControlDown(Q)&&mxEvent.isShiftDown(Q)&&mxEvent.isAltDown(Q)){if(l.model.isVertex(l.getSelectionCell()))return function(){var f=l.connectVertex(l.getSelectionCell(),N[Q.keyCode],
l.defaultEdgeLength,Q,!0);null!=f&&0<f.length&&(1==f.length&&l.model.isEdge(f[0])?l.setSelectionCell(l.model.getTerminal(f[0],!1)):l.setSelectionCell(f[f.length-1]),l.scrollCellToVisible(l.getSelectionCell()),null!=g.hoverIcons&&g.hoverIcons.update(l.view.getState(l.getSelectionCell())))}}else return this.isControlDown(Q)?function(){d(Q.keyCode,mxEvent.isShiftDown(Q)?l.gridSize:null,!0)}:function(){d(Q.keyCode,mxEvent.isShiftDown(Q)?l.gridSize:null)}}return R.apply(this,arguments)};D.bindAction=mxUtils.bind(this,
function(Q,e,f,k){var z=this.actions.get(f);null!=z&&(f=function(){z.isEnabled()&&z.funct.apply(this,arguments)},e?k?D.bindControlShiftKey(Q,f):D.bindControlKey(Q,f):k?D.bindShiftKey(Q,f):D.bindKey(Q,f))});var G=this,M=D.escape;D.escape=function(Q){M.apply(this,arguments)};D.enter=function(){};D.bindControlShiftKey(36,function(){l.exitGroup()});D.bindControlShiftKey(35,function(){l.enterGroup()});D.bindShiftKey(36,function(){l.home()});D.bindKey(35,function(){l.refresh()});D.bindAction(107,!0,"zoomIn");
D.bindAction(109,!0,"zoomOut");D.bindAction(80,!0,"print");D.bindAction(79,!0,"outline",!0);if(!this.editor.chromeless||this.editor.editable)D.bindControlKey(36,function(){l.isEnabled()&&l.foldCells(!0)}),D.bindControlKey(35,function(){l.isEnabled()&&l.foldCells(!1)}),D.bindControlKey(13,function(){G.ctrlEnter()}),D.bindAction(8,!1,"delete"),D.bindAction(8,!0,"deleteAll"),D.bindAction(8,!1,"deleteLabels",!0),D.bindAction(46,!1,"delete"),D.bindAction(46,!0,"deleteAll"),D.bindAction(46,!1,"deleteLabels",
!0),D.bindAction(36,!1,"resetView"),D.bindAction(72,!0,"fitWindow",!0),D.bindAction(74,!0,"fitPage"),D.bindAction(74,!0,"fitTwoPages",!0),D.bindAction(48,!0,"customZoom"),D.bindAction(82,!0,"turn"),D.bindAction(82,!0,"clearDefaultStyle",!0),D.bindAction(83,!0,"save"),D.bindAction(83,!0,"saveAs",!0),D.bindAction(65,!0,"selectAll"),D.bindAction(65,!0,"selectNone",!0),D.bindAction(73,!0,"selectVertices",!0),D.bindAction(69,!0,"selectEdges",!0),D.bindAction(69,!0,"editStyle"),D.bindAction(66,!0,"bold"),
D.bindAction(66,!0,"toBack",!0),D.bindAction(70,!0,"toFront",!0),D.bindAction(68,!0,"duplicate"),D.bindAction(68,!0,"setAsDefaultStyle",!0),D.bindAction(90,!0,"undo"),D.bindAction(89,!0,"autosize",!0),D.bindAction(88,!0,"cut"),D.bindAction(67,!0,"copy"),D.bindAction(86,!0,"paste"),D.bindAction(71,!0,"group"),D.bindAction(77,!0,"editData"),D.bindAction(71,!0,"grid",!0),D.bindAction(73,!0,"italic"),D.bindAction(76,!0,"lockUnlock"),D.bindAction(76,!0,"layers",!0),D.bindAction(80,!0,"format",!0),D.bindAction(85,
!0,"underline"),D.bindAction(85,!0,"ungroup",!0),D.bindAction(190,!0,"superscript"),D.bindAction(188,!0,"subscript"),D.bindAction(13,!1,"keyPressEnter"),D.bindKey(113,function(){l.isEnabled()&&l.startEditingAtCell()});mxClient.IS_WIN?D.bindAction(89,!0,"redo"):D.bindAction(90,!0,"redo",!0);return D};
EditorUi.prototype.destroy=function(){var b=this.editor.graph;null!=b&&null!=this.selectionStateListener&&(b.getSelectionModel().removeListener(mxEvent.CHANGE,this.selectionStateListener),b.getModel().removeListener(mxEvent.CHANGE,this.selectionStateListener),b.removeListener(mxEvent.EDITING_STARTED,this.selectionStateListener),b.removeListener(mxEvent.EDITING_STOPPED,this.selectionStateListener),b.getView().removeListener("unitChanged",this.selectionStateListener),this.selectionStateListener=null);
null!=this.editor&&(this.editor.destroy(),this.editor=null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null);null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar=null);null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null);null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null);null!=this.keyupHandler&&(mxEvent.removeListener(document,"keyup",
this.keyupHandler),this.keyupHandler=null);null!=this.resizeHandler&&(mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null);null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null);null!=this.scrollHandler&&(mxEvent.removeListener(window,"scroll",this.scrollHandler),
this.scrollHandler=null);if(null!=this.destroyFunctions){for(b=0;b<this.destroyFunctions.length;b++)this.destroyFunctions[b]();this.destroyFunctions=null}var d=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.footerContainer,this.chromelessToolbar,this.hsplit,this.sidebarFooterContainer,this.layersDialog];for(b=0;b<d.length;b++)null!=d[b]&&null!=d[b].parentNode&&d[b].parentNode.removeChild(d[b])};(function(){var b=[["nbsp","160"],["shy","173"]],d=mxUtils.parseXml;mxUtils.parseXml=function(g){for(var l=0;l<b.length;l++)g=g.replace(new RegExp("&"+b[l][0]+";","g"),"&#"+b[l][1]+";");return d(g)}})();
Date.prototype.toISOString||function(){function b(d){d=String(d);1===d.length&&(d="0"+d);return d}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1E3).toFixed(3)).slice(2,5)+"Z"}}();Date.now||(Date.now=function(){return(new Date).getTime()});
Uint8Array.from||(Uint8Array.from=function(){var b=Object.prototype.toString,d=function(l){return"function"===typeof l||"[object Function]"===b.call(l)},g=Math.pow(2,53)-1;return function(l){var D=Object(l);if(null==l)throw new TypeError("Array.from requires an array-like object - not null or undefined");var p=1<arguments.length?arguments[1]:void 0,E;if("undefined"!==typeof p){if(!d(p))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(E=
arguments[2])}var N=Number(D.length);N=isNaN(N)?0:0!==N&&isFinite(N)?(0<N?1:-1)*Math.floor(Math.abs(N)):N;N=Math.min(Math.max(N,0),g);for(var R=d(this)?Object(new this(N)):Array(N),G=0,M;G<N;)M=D[G],R[G]=p?"undefined"===typeof E?p(M,G):p.call(E,M,G):M,G+=1;R.length=N;return R}}());mxConstants.POINTS=1;mxConstants.MILLIMETERS=2;mxConstants.INCHES=3;mxConstants.METERS=4;mxConstants.PIXELS_PER_MM=3.937;mxConstants.PIXELS_PER_INCH=100;mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";
mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;
(function(){try{if(null!=navigator&&null!=navigator.language){var b=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===b||"en-ca"===b||"es-mx"===b?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(d){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;
mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.defaultGridColor="#d0d0d0";mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultGridColor;mxGraphView.prototype.unit=mxConstants.POINTS;
mxGraphView.prototype.setUnit=function(b){this.unit!=b&&(this.unit=b,this.fireEvent(new mxEventObject("unitChanged","unit",b)))};mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(b,d,g){return null};
mxImageShape.prototype.getImageDataUri=function(){var b=this.image;if("data:image/svg+xml;base64,"==b.substring(0,26)&&null!=this.style&&"1"==mxUtils.getValue(this.style,"clipSvg","0")){if(null==this.clippedSvg||this.clippedImage!=b)this.clippedSvg=Graph.clipSvgDataUri(b,!0),this.clippedImage=b;b=this.clippedSvg}return b};
Graph=function(b,d,g,l,D,p){mxGraph.call(this,b,d,g,l);this.themes=D||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=p?p:!1;b=this.baseUrl;d=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=b.indexOf("/",d+2),0<d&&(this.domainUrl=b.substring(0,d)),d=b.lastIndexOf("/"),0<d&&(this.domainPathUrl=b.substring(0,d+1)));this.isHtmlLabel=function(L){L=this.getCurrentCellStyle(L);
return null!=L?"1"==L.html||"wrap"==L[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.edgeMode){var E=null,N=null,R=null,G=null,M=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(L,V){if("mouseDown"==V.getProperty("eventName")&&this.isEnabled()){L=V.getProperty("event");var T=L.getState();V=this.view.scale;if(!mxEvent.isAltDown(L.getEvent())&&null!=T)if(this.model.isEdge(T.cell))if(E=new mxPoint(L.getGraphX(),L.getGraphY()),M=this.isCellSelected(T.cell),R=T,N=L,null!=T.text&&null!=
T.text.boundingBox&&mxUtils.contains(T.text.boundingBox,L.getGraphX(),L.getGraphY()))G=mxEvent.LABEL_HANDLE;else{var Y=this.selectionCellsHandler.getHandler(T.cell);null!=Y&&null!=Y.bends&&0<Y.bends.length&&(G=Y.getHandleForEvent(L))}else if(!this.panningHandler.isActive()&&!mxEvent.isControlDown(L.getEvent())&&(Y=this.selectionCellsHandler.getHandler(T.cell),null==Y||null==Y.getHandleForEvent(L))){var W=new mxRectangle(L.getGraphX()-1,L.getGraphY()-1),ka=mxEvent.isTouchEvent(L.getEvent())?mxShape.prototype.svgStrokeTolerance-
1:(mxShape.prototype.svgStrokeTolerance+2)/2;Y=ka+2;W.grow(ka);if(this.isTableCell(T.cell)&&!this.isCellSelected(T.cell)&&!(mxUtils.contains(T,L.getGraphX()-Y,L.getGraphY()-Y)&&mxUtils.contains(T,L.getGraphX()-Y,L.getGraphY()+Y)&&mxUtils.contains(T,L.getGraphX()+Y,L.getGraphY()+Y)&&mxUtils.contains(T,L.getGraphX()+Y,L.getGraphY()-Y))){var q=this.model.getParent(T.cell);Y=this.model.getParent(q);if(!this.isCellSelected(Y)){ka*=V;var F=2*ka;if(this.model.getChildAt(Y,0)!=q&&mxUtils.intersects(W,new mxRectangle(T.x,
T.y-ka,T.width,F))||this.model.getChildAt(q,0)!=T.cell&&mxUtils.intersects(W,new mxRectangle(T.x-ka,T.y,F,T.height))||mxUtils.intersects(W,new mxRectangle(T.x,T.y+T.height-ka,T.width,F))||mxUtils.intersects(W,new mxRectangle(T.x+T.width-ka,T.y,F,T.height)))q=this.selectionCellsHandler.isHandled(Y),this.selectCellForEvent(Y,L.getEvent()),Y=this.selectionCellsHandler.getHandler(Y),null!=Y&&(ka=Y.getHandleForEvent(L),null!=ka&&(Y.start(L.getGraphX(),L.getGraphY(),ka),Y.blockDelayedSelection=!q,L.consume()))}}for(;!L.isConsumed()&&
null!=T&&(this.isTableCell(T.cell)||this.isTableRow(T.cell)||this.isTable(T.cell));)this.isSwimlane(T.cell)&&(Y=this.getActualStartSize(T.cell),(0<Y.x||0<Y.width)&&mxUtils.intersects(W,new mxRectangle(T.x+(Y.x-Y.width-1)*V+(0==Y.x?T.width:0),T.y,1,T.height))||(0<Y.y||0<Y.height)&&mxUtils.intersects(W,new mxRectangle(T.x,T.y+(Y.y-Y.height-1)*V+(0==Y.y?T.height:0),T.width,1)))&&(this.selectCellForEvent(T.cell,L.getEvent()),Y=this.selectionCellsHandler.getHandler(T.cell),null!=Y&&(ka=mxEvent.CUSTOM_HANDLE-
Y.customHandles.length+1,Y.start(L.getGraphX(),L.getGraphY(),ka),L.consume())),T=this.view.getState(this.model.getParent(T.cell))}}}));this.addMouseListener({mouseDown:function(L,V){},mouseMove:mxUtils.bind(this,function(L,V){L=this.selectionCellsHandler.handlers.map;for(var T in L)if(null!=L[T].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(V.getEvent())){var Y=this.tolerance;if(null!=E&&null!=R&&null!=N){if(T=R,Math.abs(E.x-V.getGraphX())>Y||Math.abs(E.y-V.getGraphY())>
Y){var W=this.selectionCellsHandler.getHandler(T.cell);null==W&&this.model.isEdge(T.cell)&&(W=this.createHandler(T));if(null!=W&&null!=W.bends&&0<W.bends.length){L=W.getHandleForEvent(N);var ka=this.view.getEdgeStyle(T);Y=ka==mxEdgeStyle.EntityRelation;M||G!=mxEvent.LABEL_HANDLE||(L=G);if(Y&&0!=L&&L!=W.bends.length-1&&L!=mxEvent.LABEL_HANDLE)!Y||null==T.visibleSourceState&&null==T.visibleTargetState||(this.graphHandler.reset(),V.consume());else if(L==mxEvent.LABEL_HANDLE||0==L||null!=T.visibleSourceState||
L==W.bends.length-1||null!=T.visibleTargetState)Y||L==mxEvent.LABEL_HANDLE||(Y=T.absolutePoints,null!=Y&&(null==ka&&null==L||ka==mxEdgeStyle.OrthConnector)&&(L=G,null==L&&(L=new mxRectangle(E.x,E.y),L.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(L,Y[0].x,Y[0].y)?L=0:mxUtils.contains(L,Y[Y.length-1].x,Y[Y.length-1].y)?L=W.bends.length-1:null!=ka&&(2==Y.length||3==Y.length&&(0==Math.round(Y[0].x-Y[1].x)&&0==Math.round(Y[1].x-Y[2].x)||0==Math.round(Y[0].y-Y[1].y)&&0==Math.round(Y[1].y-
Y[2].y)))?L=2:(L=mxUtils.findNearestSegment(T,E.x,E.y),L=null==ka?mxEvent.VIRTUAL_HANDLE-L:L+1))),null==L&&(L=mxEvent.VIRTUAL_HANDLE)),W.start(V.getGraphX(),V.getGraphX(),L),V.consume(),this.graphHandler.reset()}null!=W&&(this.selectionCellsHandler.isHandlerActive(W)?this.isCellSelected(T.cell)||(this.selectionCellsHandler.handlers.put(T.cell,W),this.selectCellForEvent(T.cell,V.getEvent())):this.isCellSelected(T.cell)||W.destroy());M=!1;E=N=R=G=null}}else if(T=V.getState(),null!=T&&this.isCellEditable(T.cell)){W=
null;if(this.model.isEdge(T.cell)){if(L=new mxRectangle(V.getGraphX(),V.getGraphY()),L.grow(mxEdgeHandler.prototype.handleImage.width/2),Y=T.absolutePoints,null!=Y)if(null!=T.text&&null!=T.text.boundingBox&&mxUtils.contains(T.text.boundingBox,V.getGraphX(),V.getGraphY()))W="move";else if(mxUtils.contains(L,Y[0].x,Y[0].y)||mxUtils.contains(L,Y[Y.length-1].x,Y[Y.length-1].y))W="pointer";else if(null!=T.visibleSourceState||null!=T.visibleTargetState)L=this.view.getEdgeStyle(T),W="crosshair",L!=mxEdgeStyle.EntityRelation&&
this.isOrthogonal(T)&&(V=mxUtils.findNearestSegment(T,V.getGraphX(),V.getGraphY()),V<Y.length-1&&0<=V&&(W=0==Math.round(Y[V].x-Y[V+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(V.getEvent())){Y=mxShape.prototype.svgStrokeTolerance/2;L=new mxRectangle(V.getGraphX(),V.getGraphY());L.grow(Y);if(this.isTableCell(T.cell)&&(V=this.model.getParent(T.cell),Y=this.model.getParent(V),!this.isCellSelected(Y)))if(mxUtils.intersects(L,new mxRectangle(T.x,T.y-2,T.width,4))&&this.model.getChildAt(Y,
0)!=V||mxUtils.intersects(L,new mxRectangle(T.x,T.y+T.height-2,T.width,4)))W="row-resize";else if(mxUtils.intersects(L,new mxRectangle(T.x-2,T.y,4,T.height))&&this.model.getChildAt(V,0)!=T.cell||mxUtils.intersects(L,new mxRectangle(T.x+T.width-2,T.y,4,T.height)))W="col-resize";for(V=T;null==W&&null!=V&&(this.isTableCell(V.cell)||this.isTableRow(V.cell)||this.isTable(V.cell));)this.isSwimlane(V.cell)&&(Y=this.getActualStartSize(V.cell),ka=this.view.scale,(0<Y.x||0<Y.width)&&mxUtils.intersects(L,new mxRectangle(V.x+
(Y.x-Y.width-1)*ka+(0==Y.x?V.width*ka:0),V.y,1,V.height))?W="col-resize":(0<Y.y||0<Y.height)&&mxUtils.intersects(L,new mxRectangle(V.x,V.y+(Y.y-Y.height-1)*ka+(0==Y.y?V.height:0),V.width,1))&&(W="row-resize")),V=this.view.getState(this.model.getParent(V.cell))}null!=W&&T.setCursor(W)}}}),mouseUp:mxUtils.bind(this,function(L,V){G=E=N=R=null})})}this.cellRenderer.minSvgStrokeWidth=.1;this.cellRenderer.getLabelValue=function(L){var V=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);L.view.graph.isHtmlLabel(L.cell)&&
(V=1!=L.style.html?mxUtils.htmlEntities(V,!1):L.view.graph.sanitizeHtml(V));return V};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;
this.connectionHandler.isValidSource=function(L,V){return!1};this.alternateEdgeStyle="vertical";null==l&&this.loadStylesheet();var Q=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var L=Q.apply(this,arguments);if(this.graph.pageVisible){var V=[],T=this.graph.pageFormat,Y=this.graph.pageScale,W=T.width*Y;T=T.height*Y;Y=this.graph.view.translate;for(var ka=this.graph.view.scale,q=this.graph.getPageLayout(),F=0;F<q.width;F++)V.push(new mxRectangle(((q.x+F)*W+Y.x)*ka,(q.y*
T+Y.y)*ka,W*ka,T*ka));for(F=1;F<q.height;F++)V.push(new mxRectangle((q.x*W+Y.x)*ka,((q.y+F)*T+Y.y)*ka,W*ka,T*ka));L=V.concat(L)}return L};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(L,V){return null==L.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(L){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,
arguments)};var e=this.graphHandler.getCells;this.graphHandler.getCells=function(L){for(var V=e.apply(this,arguments),T=new mxDictionary,Y=[],W=0;W<V.length;W++){var ka=this.graph.isTableCell(L)&&this.graph.isTableCell(V[W])&&this.graph.isCellSelected(V[W])?this.graph.model.getParent(V[W]):this.graph.isTableRow(L)&&this.graph.isTableRow(V[W])&&this.graph.isCellSelected(V[W])?V[W]:this.graph.getCompositeParent(V[W]);null==ka||T.get(ka)||(T.put(ka,!0),Y.push(ka))}return Y};var f=this.graphHandler.start;
this.graphHandler.start=function(L,V,T,Y){var W=!1;this.graph.isTableCell(L)&&(this.graph.isCellSelected(L)?W=!0:L=this.graph.model.getParent(L));W||this.graph.isTableRow(L)&&this.graph.isCellSelected(L)||(L=this.graph.getCompositeParent(L));f.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(L,V){V=this.graph.getCompositeParent(V);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var k=new mxRubberband(this);this.getRubberband=function(){return k};
var z=(new Date).getTime(),t=0,B=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var L=this.currentState;B.apply(this,arguments);L!=this.currentState?(z=(new Date).getTime(),t=0):t=(new Date).getTime()-z};var I=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(L){return mxEvent.isShiftDown(L.getEvent())&&mxEvent.isAltDown(L.getEvent())?!1:null!=this.currentState&&L.getState()==this.currentState&&2E3<t||(null==this.currentState||
"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&I.apply(this,arguments)};var O=this.isToggleEvent;this.isToggleEvent=function(L){return O.apply(this,arguments)||!mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(L)};var J=k.isForceRubberbandEvent;k.isForceRubberbandEvent=function(L){return J.apply(this,arguments)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(L.getEvent())||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==L.getState()&&mxEvent.isTouchEvent(L.getEvent())};
var y=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(y=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=y)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(L){return mxEvent.isMouseEvent(L.getEvent())};var ia=this.click;this.click=function(L){var V=null==L.state&&null!=
L.sourceState&&this.isCellLocked(L.sourceState.cell);if(this.isEnabled()&&!V||L.isConsumed())return ia.apply(this,arguments);var T=V?L.sourceState.cell:L.getCell();null!=T&&(T=this.getClickableLinkForCell(T),null!=T&&(this.isCustomLink(T)?this.customLinkClicked(T):this.openLink(T)));this.isEnabled()&&V&&this.clearSelection()};this.tooltipHandler.getStateForEvent=function(L){return L.sourceState};var da=this.tooltipHandler.show;this.tooltipHandler.show=function(){da.apply(this,arguments);if(null!=
this.div)for(var L=this.div.getElementsByTagName("a"),V=0;V<L.length;V++)null!=L[V].getAttribute("href")&&null==L[V].getAttribute("target")&&L[V].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(L){return L.sourceState};this.getCursorForMouseEvent=function(L){var V=null==L.state&&null!=L.sourceState&&this.isCellLocked(L.sourceState.cell);return this.getCursorForCell(V?L.sourceState.cell:L.getCell())};var ja=this.getCursorForCell;this.getCursorForCell=function(L){if(!this.isEnabled()||
this.isCellLocked(L)){if(null!=this.getClickableLinkForCell(L))return"pointer";if(this.isCellLocked(L))return"default"}return ja.apply(this,arguments)};this.selectRegion=function(L,V){var T=mxEvent.isAltDown(V)?L:null;L=this.getCells(L.x,L.y,L.width,L.height,null,null,T,function(Y){return"1"==mxUtils.getValue(Y.style,"locked","0")},!0);if(this.isToggleEvent(V))for(T=0;T<L.length;T++)this.selectCellForEvent(L[T],V);else this.selectCellsForEvent(L,V);return L};var aa=this.graphHandler.shouldRemoveCellsFromParent;
this.graphHandler.shouldRemoveCellsFromParent=function(L,V,T){return this.graph.isCellSelected(L)?!1:aa.apply(this,arguments)};this.isCellLocked=function(L){for(;null!=L;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(L),"locked","0"))return!0;L=this.model.getParent(L)}return!1};var qa=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(L,V){"mouseDown"==V.getProperty("eventName")&&(L=V.getProperty("event").getState(),qa=null==L||this.isSelectionEmpty()||this.isCellSelected(L.cell)?
null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(L,V){if(!mxEvent.isMultiTouchEvent(V)){L=V.getProperty("event");var T=V.getProperty("cell");null==T?(L=mxUtils.convertPoint(this.container,mxEvent.getClientX(L),mxEvent.getClientY(L)),k.start(L.x,L.y)):null!=qa?this.addSelectionCells(qa):1<this.getSelectionCount()&&this.isCellSelected(T)&&this.removeSelectionCell(T);qa=null;V.consume()}}));this.connectionHandler.selectCells=function(L,V){this.graph.setSelectionCell(V||
L)};this.connectionHandler.constraintHandler.isStateIgnored=function(L,V){var T=L.view.graph;return V&&(T.isCellSelected(L.cell)||T.isTableRow(L.cell)&&T.selectionCellsHandler.isHandled(T.model.getParent(L.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var L=this.connectionHandler.constraintHandler;null!=L.currentFocus&&L.isStateIgnored(L.currentFocus,!0)&&(L.currentFocus=null,L.constraints=null,L.destroyIcons());L.destroyFocusHighlight()}));Graph.touchStyle&&
this.initTouch();var sa=this.updateMouseEvent;this.updateMouseEvent=function(L){L=sa.apply(this,arguments);null!=L.state&&this.isCellLocked(L.getCell())&&(L.state=null);return L}}this.currentTranslate=new mxPoint(0,0)};Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;
Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport);Graph.translateDiagram="1"==urlParams["translate-diagram"];Graph.diagramLanguage=null!=urlParams["diagram-language"]?urlParams["diagram-language"]:mxClient.language;Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;Graph.zoomWheel=!1;Graph.minTableColumnWidth=20;Graph.minTableRowHeight=20;Graph.foreignObjectWarningText="Text is not SVG - cannot display";
Graph.foreignObjectWarningLink="https://www.diagrams.net/doc/faq/svg-export-text-problems";Graph.xmlDeclaration='<?xml version="1.0" encoding="UTF-8"?>';Graph.svgDoctype='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';Graph.svgFileComment="\x3c!-- Do not edit this file with editors other than diagrams.net --\x3e";Graph.pasteStyles="rounded shadow dashed dashPattern fontFamily fontSource fontSize fontColor fontStyle align verticalAlign strokeColor strokeWidth fillColor gradientColor swimlaneFillColor textOpacity gradientDirection glass labelBackgroundColor labelBorderColor opacity spacing spacingTop spacingLeft spacingBottom spacingRight endFill endArrow endSize targetPerimeterSpacing startFill startArrow startSize sourcePerimeterSpacing arcSize comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle".split(" ");
Graph.layoutNames="mxHierarchicalLayout mxCircleLayout mxCompactTreeLayout mxEdgeLabelLayout mxFastOrganicLayout mxParallelEdgeLayout mxPartitionLayout mxRadialTreeLayout mxStackLayout".split(" ");
Graph.createOffscreenGraph=function(b){var d=new Graph(document.createElement("div"));d.stylesheet.styles=mxUtils.clone(b.styles);d.resetViewOnRootChange=!1;d.setConnectable(!1);d.gridEnabled=!1;d.autoScroll=!1;d.setTooltips(!1);d.setEnabled(!1);d.container.style.visibility="hidden";d.container.style.position="absolute";d.container.style.overflow="hidden";d.container.style.height="1px";d.container.style.width="1px";return d};
Graph.createSvgImage=function(b,d,g,l,D){g=unescape(encodeURIComponent(Graph.svgDoctype+'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+b+'px" height="'+d+'px" '+(null!=l&&null!=D?'viewBox="0 0 '+l+" "+D+'" ':"")+'version="1.1">'+g+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(g):Base64.encode(g,!0)),b,d)};
Graph.createSvgNode=function(b,d,g,l,D){var p=mxUtils.createXmlDocument(),E=null!=p.createElementNS?p.createElementNS(mxConstants.NS_SVG,"svg"):p.createElement("svg");null!=D&&(null!=E.style?E.style.backgroundColor=D:E.setAttribute("style","background-color:"+D));null==p.createElementNS?(E.setAttribute("xmlns",mxConstants.NS_SVG),E.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):E.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);E.setAttribute("version","1.1");
E.setAttribute("width",g+"px");E.setAttribute("height",l+"px");E.setAttribute("viewBox",b+" "+d+" "+g+" "+l);p.appendChild(E);return E};Graph.htmlToPng=function(b,d,g,l){var D=document.createElement("canvas");D.width=d;D.height=g;var p=document.createElement("img");p.onload=mxUtils.bind(this,function(){D.getContext("2d").drawImage(p,0,0);l(D.toDataURL())});p.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml"><style>em{color:red;}</style><em>I</em> lick <span>cheese</span></div></foreignObject></svg>')};
Graph.zapGremlins=function(b){for(var d=0,g=[],l=0;l<b.length;l++){var D=b.charCodeAt(l);(32<=D||9==D||10==D||13==D)&&65535!=D&&65534!=D||(g.push(b.substring(d,l)),d=l+1)}0<d&&d<b.length&&g.push(b.substring(d));return 0==g.length?b:g.join("")};Graph.stringToBytes=function(b){for(var d=Array(b.length),g=0;g<b.length;g++)d[g]=b.charCodeAt(g);return d};Graph.bytesToString=function(b){for(var d=Array(b.length),g=0;g<b.length;g++)d[g]=String.fromCharCode(b[g]);return d.join("")};
Graph.base64EncodeUnicode=function(b){return btoa(encodeURIComponent(b).replace(/%([0-9A-F]{2})/g,function(d,g){return String.fromCharCode(parseInt(g,16))}))};Graph.base64DecodeUnicode=function(b){return decodeURIComponent(Array.prototype.map.call(atob(b),function(d){return"%"+("00"+d.charCodeAt(0).toString(16)).slice(-2)}).join(""))};Graph.compressNode=function(b,d){b=mxUtils.getXml(b);return Graph.compress(d?b:Graph.zapGremlins(b))};
Graph.arrayBufferToString=function(b){var d="";b=new Uint8Array(b);for(var g=b.byteLength,l=0;l<g;l++)d+=String.fromCharCode(b[l]);return d};Graph.stringToArrayBuffer=function(b){return Uint8Array.from(b,function(d){return d.charCodeAt(0)})};
Graph.arrayBufferIndexOfString=function(b,d,g){var l=d.charCodeAt(0),D=1,p=-1;for(g=g||0;g<b.byteLength;g++)if(b[g]==l){p=g;break}for(g=p+1;-1<p&&g<b.byteLength&&g<p+d.length-1;g++){if(b[g]!=d.charCodeAt(D))return Graph.arrayBufferIndexOfString(b,d,p+1);D++}return D==d.length-1?p:-1};Graph.compress=function(b,d){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=d?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};
Graph.decompress=function(b,d,g){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=Graph.stringToArrayBuffer(atob(b));d=decodeURIComponent(d?pako.inflate(b,{to:"string"}):pako.inflateRaw(b,{to:"string"}));return g?d:Graph.zapGremlins(d)};
Graph.fadeNodes=function(b,d,g,l,D){D=null!=D?D:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,d);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+D+"ms ease-in-out");Graph.setOpacityForNodes(b,g);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=l&&l()},D)},0)};Graph.removeKeys=function(b,d){for(var g in b)d(g)&&delete b[g]};
Graph.setTransitionForNodes=function(b,d){for(var g=0;g<b.length;g++)mxUtils.setPrefixedStyle(b[g].style,"transition",d)};Graph.setOpacityForNodes=function(b,d){for(var g=0;g<b.length;g++)b[g].style.opacity=d};Graph.removePasteFormatting=function(b){for(;null!=b;)null!=b.firstChild&&Graph.removePasteFormatting(b.firstChild),b.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=b.style&&(b.style.whiteSpace="","#000000"==b.style.color&&(b.style.color="")),b=b.nextSibling};
Graph.sanitizeHtml=function(b,d){return Graph.domPurify(b,!1)};Graph.sanitizeLink=function(b){if(null==b)return null;var d=document.createElement("a");d.setAttribute("href",b);Graph.sanitizeNode(d);return d.getAttribute("href")};Graph.sanitizeNode=function(b){return Graph.domPurify(b,!0)};
DOMPurify.addHook("afterSanitizeAttributes",function(b){"use"==b.nodeName&&(null!=b.getAttribute("xlink:href")&&!b.getAttribute("xlink:href").startsWith("#")||null!=b.getAttribute("href")&&!b.getAttribute("href").startsWith("#"))&&b.remove()});DOMPurify.addHook("uponSanitizeAttribute",function(b,d){"svg"==b.nodeName&&"content"==d.attrName&&(d.forceKeepAttr=!0);return b});Graph.domPurify=function(b,d){window.DOM_PURIFY_CONFIG.IN_PLACE=d;return DOMPurify.sanitize(b,window.DOM_PURIFY_CONFIG)};
Graph.clipSvgDataUri=function(b,d){if(!mxClient.IS_IE&&!mxClient.IS_IE11&&null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var g=document.createElement("div");g.style.position="absolute";g.style.visibility="hidden";var l=decodeURIComponent(escape(atob(b.substring(26)))),D=l.indexOf("<svg");if(0<=D){g.innerHTML=Graph.sanitizeHtml(l.substring(D));var p=g.getElementsByTagName("svg");if(0<p.length){if(d||null!=p[0].getAttribute("preserveAspectRatio")){document.body.appendChild(g);try{l=d=
1;var E=p[0].getAttribute("width"),N=p[0].getAttribute("height");E=null!=E&&"%"!=E.charAt(E.length-1)?parseFloat(E):NaN;N=null!=N&&"%"!=N.charAt(N.length-1)?parseFloat(N):NaN;var R=p[0].getAttribute("viewBox");if(null!=R&&!isNaN(E)&&!isNaN(N)){var G=R.split(" ");4<=R.length&&(d=parseFloat(G[2])/E,l=parseFloat(G[3])/N)}var M=p[0].getBBox();0<M.width&&0<M.height&&(g.getElementsByTagName("svg")[0].setAttribute("viewBox",M.x+" "+M.y+" "+M.width+" "+M.height),g.getElementsByTagName("svg")[0].setAttribute("width",
M.width/d),g.getElementsByTagName("svg")[0].setAttribute("height",M.height/l))}catch(Q){}finally{document.body.removeChild(g)}}b=Editor.createSvgDataUri(mxUtils.getXml(p[0]))}}}catch(Q){}return b};Graph.stripQuotes=function(b){null!=b&&("'"==b.charAt(0)&&(b=b.substring(1)),"'"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1)),'"'==b.charAt(0)&&(b=b.substring(1)),'"'==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1)));return b};
Graph.createRemoveIcon=function(b,d){var g=document.createElement("img");g.setAttribute("src",Dialog.prototype.clearImage);g.setAttribute("title",b);g.setAttribute("width","13");g.setAttribute("height","10");g.style.marginLeft="4px";g.style.marginBottom="-1px";g.style.cursor="pointer";mxEvent.addListener(g,"click",d);return g};Graph.isPageLink=function(b){return null!=b&&"data:page/id,"==b.substring(0,13)};Graph.isLink=function(b){return null!=b&&Graph.linkPattern.test(b)};
Graph.linkPattern=RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.linkRelation="nofollow noopener noreferrer";
Graph.prototype.defaultScrollbars=!0;Graph.prototype.defaultPageVisible=!0;Graph.prototype.defaultGridEnabled="0"!=urlParams.grid;Graph.prototype.lightbox=!1;Graph.prototype.defaultPageBackgroundColor="#ffffff";Graph.prototype.sketchBackgroundColor="#f0f0f0";Graph.prototype.defaultPageBorderColor="#ffffff";Graph.prototype.shapeForegroundColor="#000000";Graph.prototype.shapeBackgroundColor="#ffffff";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);Graph.prototype.transparentBackground=!0;
Graph.prototype.selectParentAfterDelete=!1;Graph.prototype.defaultEdgeLength=80;Graph.prototype.edgeMode=!1;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}^ ^\"^ '^=^;]+)%","g");Graph.prototype.absoluteUrlPattern=RegExp("^(?:[a-z]+:)?//","i");Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=null!=urlParams.base?decodeURIComponent(urlParams.base):(window!=window.top?document.referrer:document.location.toString()).split("#")[0];
Graph.prototype.editAfterInsert=!1;Graph.prototype.builtInProperties=["label","tooltip","placeholders","placeholder"];Graph.prototype.standalone=!1;Graph.prototype.enableFlowAnimation=!1;Graph.prototype.roundableShapes="label rectangle internalStorage corner parallelogram swimlane triangle trapezoid ext step tee process link rhombus offPageConnector loopLimit hexagon manualInput card curlyBracket singleArrow callout doubleArrow flexArrow umlLifeline".split(" ");
Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(g,l){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var D=g.view.graph.tolerance,p=!0,E=null,N=mxUtils.bind(this,function(M){p=!0;E=new mxPoint(mxEvent.getClientX(M),mxEvent.getClientY(M))}),R=mxUtils.bind(this,function(M){p=p&&null!=E&&Math.abs(E.x-mxEvent.getClientX(M))<D&&Math.abs(E.y-mxEvent.getClientY(M))<D}),G=mxUtils.bind(this,function(M){if(p)for(var Q=mxEvent.getSource(M);null!=
Q&&Q!=l.node;){if("a"==Q.nodeName.toLowerCase()){g.view.graph.labelLinkClicked(g,Q,M);break}Q=Q.parentNode}});mxEvent.addGestureListeners(l.node,N,R,G);mxEvent.addListener(l.node,"click",function(M){mxEvent.consume(M)})};if(null!=this.tooltipHandler){var d=this.tooltipHandler.init;this.tooltipHandler.init=function(){d.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(g){var l=mxEvent.getSource(g);"A"==l.nodeName&&(l=l.getAttribute("href"),null!=
l&&this.graph.isCustomLink(l)&&(mxEvent.isTouchEvent(g)||!mxEvent.isPopupTrigger(g))&&this.graph.customLinkClicked(l)&&mxEvent.consume(g))}))}}this.addListener(mxEvent.SIZE,mxUtils.bind(this,function(g,l){null!=this.container&&this.flowAnimationStyle&&(g=this.flowAnimationStyle.getAttribute("id"),this.flowAnimationStyle.innerHTML=this.getFlowAnimationStyleCss(g))}));this.initLayoutManager()};
(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.isFillState=function(E){return!this.isSpecialColor(E.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(E.style,"lineShape",null)&&(this.model.isVertex(E.cell)||"arrow"==mxUtils.getValue(E.style,mxConstants.STYLE_SHAPE,null)||"filledEdge"==mxUtils.getValue(E.style,mxConstants.STYLE_SHAPE,null)||"flexArrow"==mxUtils.getValue(E.style,mxConstants.STYLE_SHAPE,
null)||"mxgraph.arrows2.wedgeArrow"==mxUtils.getValue(E.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isStrokeState=function(E){return!this.isSpecialColor(E.style[mxConstants.STYLE_STROKECOLOR])};Graph.prototype.isSpecialColor=function(E){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],E)};Graph.prototype.isGlassState=function(E){E=mxUtils.getValue(E.style,mxConstants.STYLE_SHAPE,null);return"label"==E||"rectangle"==E||
"internalStorage"==E||"ext"==E||"umlLifeline"==E||"swimlane"==E||"process"==E};Graph.prototype.isRoundedState=function(E){return null!=E.shape?E.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(E.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(E){var N=mxUtils.getValue(E.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(E.style,mxConstants.STYLE_CURVED,!1)&&("connector"==N||"filledEdge"==N)};Graph.prototype.isAutoSizeState=function(E){return"1"==
mxUtils.getValue(E.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isImageState=function(E){E=mxUtils.getValue(E.style,mxConstants.STYLE_SHAPE,null);return"label"==E||"image"==E};Graph.prototype.isShadowState=function(E){return"image"!=mxUtils.getValue(E.style,mxConstants.STYLE_SHAPE,null)};Graph.prototype.getVerticesAndEdges=function(E,N){E=null!=E?E:!0;N=null!=N?N:!0;var R=this.model;return R.filterDescendants(function(G){return E&&R.isVertex(G)||N&&R.isEdge(G)},R.getRoot())};Graph.prototype.getCommonStyle=
function(E){for(var N={},R=0;R<E.length;R++){var G=this.view.getState(E[R]);this.mergeStyle(G.style,N,0==R)}return N};Graph.prototype.mergeStyle=function(E,N,R){if(null!=E){var G={},M;for(M in E){var Q=E[M];null!=Q&&(G[M]=!0,null==N[M]&&R?N[M]=Q:N[M]!=Q&&delete N[M])}for(M in N)G[M]||delete N[M]}};Graph.prototype.getStartEditingCell=function(E,N){N=this.getCellStyle(E);N=parseInt(mxUtils.getValue(N,mxConstants.STYLE_STARTSIZE,0));this.isTable(E)&&(!this.isSwimlane(E)||0==N)&&""==this.getLabel(E)&&
0<this.model.getChildCount(E)&&(E=this.model.getChildAt(E,0),N=this.getCellStyle(E),N=parseInt(mxUtils.getValue(N,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(E)&&(!this.isSwimlane(E)||0==N)&&""==this.getLabel(E)&&0<this.model.getChildCount(E))for(N=0;N<this.model.getChildCount(E);N++){var R=this.model.getChildAt(E,N);if(this.isCellEditable(R)){E=R;break}}return E};Graph.prototype.copyStyle=function(E){return this.getCellStyle(E,!1)};Graph.prototype.pasteStyle=function(E,N,R){R=null!=R?R:Graph.pasteStyles;
Graph.removeKeys(E,function(G){return 0>mxUtils.indexOf(R,G)});this.updateCellStyles(E,N)};Graph.prototype.updateCellStyles=function(E,N){this.model.beginUpdate();try{for(var R=0;R<N.length;R++)if(this.model.isVertex(N[R])||this.model.isEdge(N[R])){var G=this.getCellStyle(N[R],!1),M;for(M in E){var Q=E[M];G[M]!=Q&&this.setCellStyles(M,Q,[N[R]])}}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&
(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(E,N,R,G,M,Q){this.useCssTransforms&&(E=E/this.currentScale-this.currentTranslate.x,N=N/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(E,N,R,G,M,Q){G=null!=G?G:!0;M=null!=M?M:!0;
null==R&&(R=this.getCurrentRoot(),null==R&&(R=this.getModel().getRoot()));if(null!=R)for(var e=this.model.getChildCount(R)-1;0<=e;e--){var f=this.model.getChildAt(R,e),k=this.getScaledCellAt(E,N,f,G,M,Q);if(null!=k)return k;if(this.isCellVisible(f)&&(M&&this.model.isEdge(f)||G&&this.model.isVertex(f))&&(k=this.view.getState(f),null!=k&&(null==Q||!Q(k,E,N))&&this.intersects(k,E,N)))return f}return null};Graph.prototype.isRecursiveVertexResize=function(E){return!this.isSwimlane(E.cell)&&0<this.model.getChildCount(E.cell)&&
!this.isCellCollapsed(E.cell)&&"1"==mxUtils.getValue(E.style,"recursiveResize","1")&&null==mxUtils.getValue(E.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(E){for(var N=this.getCellGeometry(E);null!=N&&N.relative;)E=this.getModel().getParent(E),N=this.getCellGeometry(E);return E};Graph.prototype.isPart=function(E){return"1"==mxUtils.getValue(this.getCurrentCellStyle(E),"part","0")||this.isTableCell(E)||this.isTableRow(E)};Graph.prototype.getCompositeParents=function(E){for(var N=
new mxDictionary,R=[],G=0;G<E.length;G++){var M=this.getCompositeParent(E[G]);this.isTableCell(M)&&(M=this.graph.model.getParent(M));this.isTableRow(M)&&(M=this.graph.model.getParent(M));null==M||N.get(M)||(N.put(M,!0),R.push(M))}return R};Graph.prototype.getCompositeParent=function(E){for(;this.isPart(E);){var N=this.model.getParent(E);if(!this.model.isVertex(N))break;E=N}return E};Graph.prototype.filterSelectionCells=function(E){var N=this.getSelectionCells();if(null!=E){for(var R=[],G=0;G<N.length;G++)E(N[G])||
R.push(N[G]);N=R}return N};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(E){if(this.useCssTransforms){var N=this.currentScale,R=this.currentTranslate;E=new mxRectangle((E.x+2*R.x)*N-R.x,(E.y+2*R.y)*N-R.y,E.width*N,E.height*N)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(E){E=this.strokeWidth;this.graph.useCssTransforms&&(E/=this.graph.currentScale);return E};mxGraphView.prototype.getGraphBounds=function(){var E=this.graphBounds;
if(this.graph.useCssTransforms){var N=this.graph.currentTranslate,R=this.graph.currentScale;E=new mxRectangle((E.x+N.x)*R,(E.y+N.y)*R,E.width*R,E.height*R)}return E};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var d=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(E){this.graph.useCssTransforms&&(this.graph.currentScale=this.scale,this.graph.currentTranslate.x=this.translate.x,this.graph.currentTranslate.y=
this.translate.y,this.scale=1,this.translate.x=0,this.translate.y=0);d.apply(this,arguments);this.graph.useCssTransforms&&(this.graph.updateCssTransform(),this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,this.translate.y=this.graph.currentTranslate.y)};var g=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(E){E=g.apply(this,arguments);for(var N=[],R=0;R<E.length;R++)this.isTableRow(E[R])||this.isTableCell(E[R])||N.push(E[R]);return N};var l=
mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(E){E=l.apply(this,arguments);for(var N=[],R=0;R<E.length;R++)this.isTable(E[R])||this.isTableRow(E[R])||this.isTableCell(E[R])||N.push(E[R]);return N};Graph.prototype.updateCssTransform=function(){var E=this.view.getDrawPane();if(null!=E)if(E=E.parentNode,this.useCssTransforms){var N=E.getAttribute("transform");E.setAttribute("transformOrigin","0 0");var R=Math.round(100*this.currentScale)/100;E.setAttribute("transform",
"scale("+R+","+R+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");N!=E.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",E.getAttribute("transform"))}else E.removeAttribute("transformOrigin"),E.removeAttribute("transform")};var D=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var E=this.graph.useCssTransforms,N=this.scale,R=this.translate;
E&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);D.apply(this,arguments);E&&(this.scale=N,this.translate=R)};var p=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(E,N,R){var G=this.useCssTransforms,M=this.view.scale,Q=this.view.translate;G&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);p.apply(this,arguments);G&&(this.view.scale=M,this.view.translate=Q,this.useCssTransforms=!0)}})();
Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};Graph.prototype.labelLinkClicked=function(b,d,g){var l=d.getAttribute("href");l!=Graph.sanitizeLink(l)&&Graph.sanitizeNode(d);if(null!=l&&!this.isCustomLink(l)&&(mxEvent.isLeftMouseButton(g)&&!mxEvent.isPopupTrigger(g)||mxEvent.isTouchEvent(g))){if(!this.isEnabled()||this.isCellLocked(b.cell))b=this.isBlankLink(l)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(l),b);mxEvent.consume(g)}};
Graph.prototype.openLink=function(b,d,g){var l=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==d&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==b.charAt(this.baseUrl.length)&&"_top"==d&&window==window.top){var D=b.split("#")[1];window.location.hash=="#"+D&&(window.location.hash="");window.location.hash=D}else l=window.open(b,null!=d?d:"_blank"),null==l||g||(l.opener=null)}catch(p){}return l};
Graph.prototype.getLinkTitle=function(b){return b.substring(b.lastIndexOf("/")+1)};Graph.prototype.isCustomLink=function(b){return"data:"==b.substring(0,5)};Graph.prototype.customLinkClicked=function(b){return!1};Graph.prototype.isExternalProtocol=function(b){return"mailto:"===b.substring(0,7)};Graph.prototype.isBlankLink=function(b){return!this.isExternalProtocol(b)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(b)&&b.substring(0,this.domainUrl.length)!==this.domainUrl)};
Graph.prototype.isRelativeUrl=function(b){return null!=b&&!this.absoluteUrlPattern.test(b)&&"data:"!==b.substring(0,5)&&!this.isExternalProtocol(b)};Graph.prototype.getAbsoluteUrl=function(b){null!=b&&this.isRelativeUrl(b)&&(b="#"==b.charAt(0)?this.baseUrl+b:"/"==b.charAt(0)?this.domainUrl+b:this.domainPathUrl+b);return b};
Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.hasLayout=function(b){return null!=this.graph.getCellStyle(b).childLayout};this.layoutManager.getLayout=function(b,d){var g=this.graph.model.getParent(b);if(!this.graph.isCellCollapsed(b)&&(d!=mxEvent.BEGIN_UPDATE||this.hasLayout(g,d))){b=this.graph.getCellStyle(b);if("stackLayout"==b.childLayout)return d=new mxStackLayout(this.graph,!0),d.resizeParentMax="1"==mxUtils.getValue(b,"resizeParentMax",
"1"),d.horizontal="1"==mxUtils.getValue(b,"horizontalStack","1"),d.resizeParent="1"==mxUtils.getValue(b,"resizeParent","1"),d.resizeLast="1"==mxUtils.getValue(b,"resizeLast","0"),d.spacing=b.stackSpacing||d.spacing,d.border=b.stackBorder||d.border,d.marginLeft=b.marginLeft||0,d.marginRight=b.marginRight||0,d.marginTop=b.marginTop||0,d.marginBottom=b.marginBottom||0,d.allowGaps=b.allowGaps||0,d.fill=!0,d.allowGaps&&(d.gridSize=parseFloat(mxUtils.getValue(b,"stackUnitSize",20))),d;if("treeLayout"==
b.childLayout)return d=new mxCompactTreeLayout(this.graph),d.horizontal="1"==mxUtils.getValue(b,"horizontalTree","1"),d.resizeParent="1"==mxUtils.getValue(b,"resizeParent","1"),d.groupPadding=mxUtils.getValue(b,"parentPadding",20),d.levelDistance=mxUtils.getValue(b,"treeLevelDistance",30),d.maintainParentLocation=!0,d.edgeRouting=!1,d.resetEdges=!1,d;if("flowLayout"==b.childLayout)return d=new mxHierarchicalLayout(this.graph,mxUtils.getValue(b,"flowOrientation",mxConstants.DIRECTION_EAST)),d.resizeParent=
"1"==mxUtils.getValue(b,"resizeParent","1"),d.parentBorder=mxUtils.getValue(b,"parentPadding",20),d.maintainParentLocation=!0,d.intraCellSpacing=mxUtils.getValue(b,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),d.interRankCellSpacing=mxUtils.getValue(b,"interRankCellSpacing",mxHierarchicalLayout.prototype.interRankCellSpacing),d.interHierarchySpacing=mxUtils.getValue(b,"interHierarchySpacing",mxHierarchicalLayout.prototype.interHierarchySpacing),d.parallelEdgeSpacing=mxUtils.getValue(b,
"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),d;if("circleLayout"==b.childLayout)return new mxCircleLayout(this.graph);if("organicLayout"==b.childLayout)return new mxFastOrganicLayout(this.graph);if("tableLayout"==b.childLayout)return new TableLayout(this.graph);if(null!=b.childLayout&&"["==b.childLayout.charAt(0))try{return new mxCompositeLayout(this.graph,this.graph.createLayouts(JSON.parse(b.childLayout)))}catch(l){null!=window.console&&console.error(l)}}return null}};
Graph.prototype.createLayouts=function(b){for(var d=[],g=0;g<b.length;g++)if(0<=mxUtils.indexOf(Graph.layoutNames,b[g].layout)){var l=new window[b[g].layout](this);if(null!=b[g].config)for(var D in b[g].config)l[D]=b[g].config[D];d.push(l)}else throw Error(mxResources.get("invalidCallFnNotFound",[b[g].layout]));return d};
Graph.prototype.getDataForCells=function(b){for(var d=[],g=0;g<b.length;g++){var l=null!=b[g].value?b[g].value.attributes:null,D={};D.id=b[g].id;if(null!=l)for(var p=0;p<l.length;p++)D[l[p].nodeName]=l[p].nodeValue;else D.label=this.convertValueToString(b[g]);d.push(D)}return d};
Graph.prototype.getNodesForCells=function(b){for(var d=[],g=0;g<b.length;g++){var l=this.view.getState(b[g]);if(null!=l){for(var D=this.cellRenderer.getShapesForState(l),p=0;p<D.length;p++)null!=D[p]&&null!=D[p].node&&d.push(D[p].node);null!=l.control&&null!=l.control.node&&d.push(l.control.node)}}return d};
Graph.prototype.createWipeAnimations=function(b,d){for(var g=[],l=0;l<b.length;l++){var D=this.view.getState(b[l]);null!=D&&null!=D.shape&&(this.model.isEdge(D.cell)&&null!=D.absolutePoints&&1<D.absolutePoints.length?g.push(this.createEdgeWipeAnimation(D,d)):this.model.isVertex(D.cell)&&null!=D.shape.bounds&&g.push(this.createVertexWipeAnimation(D,d)))}return g};
Graph.prototype.createEdgeWipeAnimation=function(b,d){var g=b.absolutePoints.slice(),l=b.segments,D=b.length,p=g.length;return{execute:mxUtils.bind(this,function(E,N){if(null!=b.shape){var R=[g[0]];N=E/N;d||(N=1-N);for(var G=D*N,M=1;M<p;M++)if(G<=l[M-1]){R.push(new mxPoint(g[M-1].x+(g[M].x-g[M-1].x)*G/l[M-1],g[M-1].y+(g[M].y-g[M-1].y)*G/l[M-1]));break}else G-=l[M-1],R.push(g[M]);b.shape.points=R;b.shape.redraw();0==E&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=
b.text.node&&(b.text.node.style.opacity=N)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};
Graph.prototype.createVertexWipeAnimation=function(b,d){var g=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(l,D){null!=b.shape&&(D=l/D,d||(D=1-D),b.shape.bounds=new mxRectangle(g.x,g.y,g.width*D,g.height),b.shape.redraw(),0==l&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=D))}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&
(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};Graph.prototype.executeAnimations=function(b,d,g,l){g=null!=g?g:30;l=null!=l?l:30;var D=null,p=0,E=mxUtils.bind(this,function(){if(p==g||this.stoppingCustomActions){window.clearInterval(D);for(var N=0;N<b.length;N++)b[N].stop();null!=d&&d()}else for(N=0;N<b.length;N++)b[N].execute(p,g);p++});D=window.setInterval(E,l);E()};
Graph.prototype.getPageSize=function(){return this.pageVisible?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize};
Graph.prototype.getPageLayout=function(){var b=this.getPageSize(),d=this.getGraphBounds();if(0==d.width||0==d.height)return new mxRectangle(0,0,1,1);var g=Math.floor(Math.ceil(d.x/this.view.scale-this.view.translate.x)/b.width),l=Math.floor(Math.ceil(d.y/this.view.scale-this.view.translate.y)/b.height);return new mxRectangle(g,l,Math.ceil((Math.floor((d.x+d.width)/this.view.scale)-this.view.translate.x)/b.width)-g,Math.ceil((Math.floor((d.y+d.height)/this.view.scale)-this.view.translate.y)/b.height)-
l)};Graph.prototype.sanitizeHtml=function(b,d){return Graph.sanitizeHtml(b,d)};Graph.prototype.updatePlaceholders=function(){var b=!1,d;for(d in this.model.cells){var g=this.model.cells[d];this.isReplacePlaceholders(g)&&(this.view.invalidate(g,!1,!1),b=!0)}b&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(b){return null!=b.value&&"object"==typeof b.value&&"1"==b.value.getAttribute("placeholders")};
Graph.prototype.isZoomWheelEvent=function(b){return Graph.zoomWheel&&!mxEvent.isShiftDown(b)&&!mxEvent.isMetaDown(b)&&!mxEvent.isAltDown(b)&&(!mxEvent.isControlDown(b)||mxClient.IS_MAC)||!Graph.zoomWheel&&(mxEvent.isAltDown(b)||mxEvent.isControlDown(b))};Graph.prototype.isScrollWheelEvent=function(b){return!this.isZoomWheelEvent(b)};Graph.prototype.isTransparentClickEvent=function(b){return mxEvent.isAltDown(b)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(b)};
Graph.prototype.isIgnoreTerminalEvent=function(b){return mxEvent.isAltDown(b)&&!mxEvent.isShiftDown(b)&&!mxEvent.isControlDown(b)&&!mxEvent.isMetaDown(b)};Graph.prototype.isEdgeIgnored=function(b){var d=!1;null!=b&&(b=this.getCurrentCellStyle(b),d="1"==mxUtils.getValue(b,"ignoreEdge","0"));return d};Graph.prototype.isSplitTarget=function(b,d,g){return!this.model.isEdge(d[0])&&!mxEvent.isAltDown(g)&&!mxEvent.isShiftDown(g)&&mxGraph.prototype.isSplitTarget.apply(this,arguments)};
Graph.prototype.getLabel=function(b){var d=mxGraph.prototype.getLabel.apply(this,arguments);null!=d&&this.isReplacePlaceholders(b)&&null==b.getAttribute("placeholder")&&(d=this.replacePlaceholders(b,d));return d};Graph.prototype.isLabelMovable=function(b){var d=this.getCurrentCellStyle(b);return!this.isCellLocked(b)&&(this.model.isEdge(b)&&this.edgeLabelsMovable||this.model.isVertex(b)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(d,"labelMovable","0")))};
Graph.prototype.setGridSize=function(b){this.gridSize=b;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.setDefaultParent=function(b){this.defaultParent=b;this.fireEvent(new mxEventObject("defaultParentChanged"))};Graph.prototype.getClickableLinkForCell=function(b){do{var d=this.getLinkForCell(b);if(null!=d)return d;b=this.model.getParent(b)}while(null!=b);return null};
Graph.prototype.getGlobalVariable=function(b){var d=null;"date"==b?d=(new Date).toLocaleDateString():"time"==b?d=(new Date).toLocaleTimeString():"timestamp"==b?d=(new Date).toLocaleString():"date{"==b.substring(0,5)&&(b=b.substring(5,b.length-1),d=this.formatDate(new Date,b));return d};
Graph.prototype.formatDate=function(b,d,g){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",
shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var l=this.dateFormatCache,D=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,p=/[^-+\dA-Z]/g,E=function(B,I){B=String(B);for(I=I||2;B.length<I;)B="0"+B;return B};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||
/\d/.test(b)||(d=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");d=String(l.masks[d]||d||l.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),g=!0);var N=g?"getUTC":"get",R=b[N+"Date"](),G=b[N+"Day"](),M=b[N+"Month"](),Q=b[N+"FullYear"](),e=b[N+"Hours"](),f=b[N+"Minutes"](),k=b[N+"Seconds"]();N=b[N+"Milliseconds"]();var z=g?0:b.getTimezoneOffset(),t={d:R,dd:E(R),ddd:l.i18n.dayNames[G],dddd:l.i18n.dayNames[G+7],m:M+1,mm:E(M+1),mmm:l.i18n.monthNames[M],mmmm:l.i18n.monthNames[M+
12],yy:String(Q).slice(2),yyyy:Q,h:e%12||12,hh:E(e%12||12),H:e,HH:E(e),M:f,MM:E(f),s:k,ss:E(k),l:E(N,3),L:E(99<N?Math.round(N/10):N),t:12>e?"a":"p",tt:12>e?"am":"pm",T:12>e?"A":"P",TT:12>e?"AM":"PM",Z:g?"UTC":(String(b).match(D)||[""]).pop().replace(p,""),o:(0<z?"-":"+")+E(100*Math.floor(Math.abs(z)/60)+Math.abs(z)%60,4),S:["th","st","nd","rd"][3<R%10?0:(10!=R%100-R%10)*R%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(B){return B in t?t[B]:B.slice(1,
B.length-1)})};Graph.prototype.getLayerForCells=function(b){var d=null;if(0<b.length){for(d=b[0];!this.model.isLayer(d);)d=this.model.getParent(d);for(var g=1;g<b.length;g++)if(!this.model.isAncestor(d,b[g])){d=null;break}}return d};
Graph.prototype.createLayersDialog=function(b,d){var g=document.createElement("div");g.style.position="absolute";for(var l=this.getModel(),D=l.getChildCount(l.root),p=0;p<D;p++)mxUtils.bind(this,function(E){function N(){l.isVisible(E)?(M.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(G,75)):(M.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(G,25))}var R=this.convertValueToString(E)||mxResources.get("background")||"Background",G=document.createElement("div");G.style.overflow=
"hidden";G.style.textOverflow="ellipsis";G.style.padding="2px";G.style.whiteSpace="nowrap";G.style.cursor="pointer";G.setAttribute("title",mxResources.get(l.isVisible(E)?"hideIt":"show",[R]));var M=document.createElement("img");M.setAttribute("draggable","false");M.setAttribute("align","absmiddle");M.setAttribute("border","0");M.style.position="relative";M.style.width="16px";M.style.padding="0px 6px 0 4px";d&&(M.style.filter="invert(100%)",M.style.top="-2px");G.appendChild(M);mxUtils.write(G,R);g.appendChild(G);
mxEvent.addListener(G,"click",function(){l.setVisible(E,!l.isVisible(E));N();null!=b&&b(E)});N()})(l.getChildAt(l.root,p));return g};
Graph.prototype.replacePlaceholders=function(b,d,g,l){l=[];if(null!=d){for(var D=0;match=this.placeholderPattern.exec(d);){var p=match[0];if(2<p.length&&"%label%"!=p&&"%tooltip%"!=p){var E=null;if(match.index>D&&"%"==d.charAt(match.index-1))E=p.substring(1);else{var N=p.substring(1,p.length-1);if("id"==N)E=b.id;else if(0>N.indexOf("{"))for(var R=b;null==E&&null!=R;)null!=R.value&&"object"==typeof R.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(E=R.getAttribute(N+"_"+Graph.diagramLanguage)),
null==E&&(E=R.hasAttribute(N)?null!=R.getAttribute(N)?R.getAttribute(N):"":null)),R=this.model.getParent(R);null==E&&(E=this.getGlobalVariable(N));null==E&&null!=g&&(E=g[N])}l.push(d.substring(D,match.index)+(null!=E?E:p));D=match.index+p.length}}l.push(d.substring(D))}return l.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var d=[],g=0;g<b.length;g++){var l=this.model.getCell(b[g].id);null!=l&&d.push(l)}this.setSelectionCells(d)}else this.clearSelection()};
Graph.prototype.selectCellForEvent=function(b,d){mxEvent.isShiftDown(d)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),b)||mxGraph.prototype.selectCellForEvent.apply(this,arguments)};
Graph.prototype.selectTableRange=function(b,d){var g=!1;if(this.isTableCell(b)&&this.isTableCell(d)){var l=this.model.getParent(b),D=this.model.getParent(l),p=this.model.getParent(d);if(D==this.model.getParent(p)){b=l.getIndex(b);l=D.getIndex(l);var E=p.getIndex(d),N=D.getIndex(p);p=Math.max(l,N);d=Math.min(b,E);b=Math.max(b,E);E=[];for(l=Math.min(l,N);l<=p;l++){N=this.model.getChildAt(D,l);for(var R=d;R<=b;R++)E.push(this.model.getChildAt(N,R))}0<E.length&&(1<E.length||1<this.getSelectionCount()||
!this.isCellSelected(E[0]))&&(this.setSelectionCells(E),g=!0)}}return g};
Graph.prototype.snapCellsToGrid=function(b,d){this.getModel().beginUpdate();try{for(var g=0;g<b.length;g++){var l=b[g],D=this.getCellGeometry(l);if(null!=D){D=D.clone();if(this.getModel().isVertex(l))D.x=Math.round(D.x/d)*d,D.y=Math.round(D.y/d)*d,D.width=Math.round(D.width/d)*d,D.height=Math.round(D.height/d)*d;else if(this.getModel().isEdge(l)&&null!=D.points)for(var p=0;p<D.points.length;p++)D.points[p].x=Math.round(D.points[p].x/d)*d,D.points[p].y=Math.round(D.points[p].y/d)*d;this.getModel().setGeometry(l,
D)}}}finally{this.getModel().endUpdate()}};Graph.prototype.selectCellsForConnectVertex=function(b,d,g){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=g&&(mxEvent.isTouchEvent(d)?g.update(g.getState(this.view.getState(b[1]))):g.reset())):this.setSelectionCells(b)};
Graph.prototype.isCloneConnectSource=function(b){var d=null;null!=this.layoutManager&&(d=this.layoutManager.getLayout(this.model.getParent(b)));return this.isTableRow(b)||this.isTableCell(b)||null!=d&&d.constructor==mxStackLayout};
Graph.prototype.connectVertex=function(b,d,g,l,D,p,E,N){p=p?p:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var R=this.isCloneConnectSource(b),G=R?b:this.getCompositeParent(b),M=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(G.geometry.x,G.geometry.y);d==mxConstants.DIRECTION_NORTH?(M.x+=G.geometry.width/2,M.y-=g):d==
mxConstants.DIRECTION_SOUTH?(M.x+=G.geometry.width/2,M.y+=G.geometry.height+g):(M.x=d==mxConstants.DIRECTION_WEST?M.x-g:M.x+(G.geometry.width+g),M.y+=G.geometry.height/2);var Q=this.view.getState(this.model.getParent(b));g=this.view.scale;var e=this.view.translate;G=e.x*g;e=e.y*g;null!=Q&&this.model.isVertex(Q.cell)&&(G=Q.x,e=Q.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(M.x+=b.parent.geometry.x,M.y+=b.parent.geometry.y);p=p?null:(new mxRectangle(G+M.x*g,e+M.y*g)).grow(40*g);p=null!=p?
this.getCells(0,0,0,0,null,null,p,null,!0):null;Q=this.view.getState(b);var f=null,k=null;if(null!=p){p=p.reverse();for(var z=0;z<p.length;z++)if(!this.isCellLocked(p[z])&&!this.model.isEdge(p[z])&&p[z]!=b)if(!this.model.isAncestor(b,p[z])&&this.isContainer(p[z])&&(null==f||p[z]==this.model.getParent(b)))f=p[z];else if(null==k&&this.isCellConnectable(p[z])&&!this.model.isAncestor(p[z],b)&&!this.isSwimlane(p[z])){var t=this.view.getState(p[z]);null==Q||null==t||mxUtils.intersects(Q,t)||(k=p[z])}}var B=
!mxEvent.isShiftDown(l)||mxEvent.isControlDown(l)||D;B&&("1"!=urlParams.sketch||D)&&(d==mxConstants.DIRECTION_NORTH?M.y-=b.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?M.y+=b.geometry.height/2:M.x=d==mxConstants.DIRECTION_WEST?M.x-b.geometry.width/2:M.x+b.geometry.width/2);var I=[],O=k;k=f;D=mxUtils.bind(this,function(J){if(null==E||null!=J||null==k&&R){this.model.beginUpdate();try{if(null==O&&B){var y=this.getAbsoluteParent(null!=J?J:b);y=R?b:this.getCompositeParent(y);O=null!=J?J:this.duplicateCells([y],
!1)[0];null!=J&&this.addCells([O],this.model.getParent(b),null,null,null,!0);var ia=this.getCellGeometry(O);null!=ia&&(null!=J&&"1"==urlParams.sketch&&(d==mxConstants.DIRECTION_NORTH?M.y-=ia.height/2:d==mxConstants.DIRECTION_SOUTH?M.y+=ia.height/2:M.x=d==mxConstants.DIRECTION_WEST?M.x-ia.width/2:M.x+ia.width/2),ia.x=M.x-ia.width/2,ia.y=M.y-ia.height/2);null!=f?(this.addCells([O],f,null,null,null,!0),k=null):B&&!R&&this.addCells([O],this.getDefaultParent(),null,null,null,!0)}var da=mxEvent.isControlDown(l)&&
mxEvent.isShiftDown(l)&&B||null==k&&R?null:this.insertEdge(this.model.getParent(b),null,"",b,O,this.createCurrentEdgeStyle());if(null!=da&&this.connectionHandler.insertBeforeSource){var ja=null;for(J=b;null!=J.parent&&null!=J.geometry&&J.geometry.relative&&J.parent!=da.parent;)J=this.model.getParent(J);null!=J&&null!=J.parent&&J.parent==da.parent&&(ja=J.parent.getIndex(J),this.model.add(J.parent,da,ja))}null==k&&null!=O&&null!=b.parent&&R&&d==mxConstants.DIRECTION_WEST&&(ja=b.parent.getIndex(b),this.model.add(b.parent,
O,ja));null!=da&&I.push(da);null==k&&null!=O&&I.push(O);null==O&&null!=da&&da.geometry.setTerminalPoint(M,!1);null!=da&&this.fireEvent(new mxEventObject("cellsInserted","cells",[da]))}finally{this.model.endUpdate()}}if(null!=N)N(I);else return I});if(null==E||null!=O||!B||null==k&&R)return D(O);E(G+M.x*g,e+M.y*g,D)};
Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var d=document.createElement("div"),g=[],l,D=0;D<b.length;D++)if(l=b[D],this.model.isVertex(l)||this.model.isEdge(l))this.isHtmlLabel(l)?(d.innerHTML=Graph.sanitizeHtml(this.getLabel(l)),l=mxUtils.extractTextWithWhitespace([d])):l=this.getLabel(l),l=mxUtils.trim(l.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<l.length&&g.push(l);return g.join(" ")};
Graph.prototype.convertValueToString=function(b){var d=this.model.getValue(b);if(null!=d&&"object"==typeof d){var g=null;if(this.isReplacePlaceholders(b)&&null!=b.getAttribute("placeholder")){d=b.getAttribute("placeholder");for(var l=b;null==g&&null!=l;)null!=l.value&&"object"==typeof l.value&&(g=l.hasAttribute(d)?null!=l.getAttribute(d)?l.getAttribute(d):"":null),l=this.model.getParent(l)}else g=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(g=d.getAttribute("label_"+Graph.diagramLanguage)),
null==g&&(g=d.getAttribute("label")||"");return g||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};Graph.prototype.getLinksForState=function(b){return null!=b&&null!=b.text&&null!=b.text.node?b.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(b){return null!=b.value&&"object"==typeof b.value?(b=b.value.getAttribute("link"),null!=b&&"javascript:"===b.toLowerCase().substring(0,11)&&(b=b.substring(11)),b):null};
Graph.prototype.getLinkTargetForCell=function(b){return null!=b.value&&"object"==typeof b.value?b.value.getAttribute("linkTarget"):null};Graph.prototype.postProcessCellStyle=function(b,d){return this.updateHorizontalStyle(b,this.replaceDefaultColors(b,mxGraph.prototype.postProcessCellStyle.apply(this,arguments)))};
Graph.prototype.updateHorizontalStyle=function(b,d){if(null!=b&&null!=d&&null!=this.layoutManager){var g=this.model.getParent(b);this.model.isVertex(g)&&this.isCellCollapsed(b)&&(b=this.layoutManager.getLayout(g),null!=b&&b.constructor==mxStackLayout&&(d[mxConstants.STYLE_HORIZONTAL]=!b.horizontal))}return d};
Graph.prototype.replaceDefaultColors=function(b,d){if(null!=d){b=mxUtils.hex2rgb(this.shapeBackgroundColor);var g=mxUtils.hex2rgb(this.shapeForegroundColor);this.replaceDefaultColor(d,mxConstants.STYLE_FONTCOLOR,g,b);this.replaceDefaultColor(d,mxConstants.STYLE_FILLCOLOR,b,g);this.replaceDefaultColor(d,mxConstants.STYLE_GRADIENTCOLOR,g,b);this.replaceDefaultColor(d,mxConstants.STYLE_STROKECOLOR,g,b);this.replaceDefaultColor(d,mxConstants.STYLE_IMAGE_BORDER,g,b);this.replaceDefaultColor(d,mxConstants.STYLE_IMAGE_BACKGROUND,
b,g);this.replaceDefaultColor(d,mxConstants.STYLE_LABEL_BORDERCOLOR,g,b);this.replaceDefaultColor(d,mxConstants.STYLE_SWIMLANE_FILLCOLOR,b,g);this.replaceDefaultColor(d,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,b,g)}return d};Graph.prototype.replaceDefaultColor=function(b,d,g,l){null!=b&&"default"==b[d]&&null!=g&&(b[d]=this.getDefaultColor(b,d,g,l))};Graph.prototype.getDefaultColor=function(b,d,g,l){d="default"+d.charAt(0).toUpperCase()+d.substring(1);"invert"==b[d]&&(g=l);return g};
Graph.prototype.updateAlternateBounds=function(b,d,g){if(null!=b&&null!=d&&null!=this.layoutManager&&null!=d.alternateBounds){var l=this.layoutManager.getLayout(this.model.getParent(b));null!=l&&l.constructor==mxStackLayout&&(l.horizontal?d.alternateBounds.height=0:d.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(b,d){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(d.style,"moveCells","0")};
Graph.prototype.foldCells=function(b,d,g,l,D){d=null!=d?d:!1;null==g&&(g=this.getFoldableCells(this.getSelectionCells(),b));if(null!=g){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var p=0;p<g.length;p++){var E=this.view.getState(g[p]),N=this.getCellGeometry(g[p]);if(null!=E&&null!=N){var R=Math.round(N.width-E.width/this.view.scale),G=Math.round(N.height-E.height/this.view.scale);if(0!=G||0!=R){var M=this.model.getParent(g[p]),Q=this.layoutManager.getLayout(M);
null==Q?null!=D&&this.isMoveCellsEvent(D,E)&&this.moveSiblings(E,M,R,G):null!=D&&mxEvent.isAltDown(D)||Q.constructor!=mxStackLayout||Q.resizeLast||this.resizeParentStacks(M,Q,R,G)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(g)}};
Graph.prototype.moveSiblings=function(b,d,g,l){this.model.beginUpdate();try{var D=this.getCellsBeyond(b.x,b.y,d,!0,!0);for(d=0;d<D.length;d++)if(D[d]!=b.cell){var p=this.view.getState(D[d]),E=this.getCellGeometry(D[d]);null!=p&&null!=E&&(E=E.clone(),E.translate(Math.round(g*Math.max(0,Math.min(1,(p.x-b.x)/b.width))),Math.round(l*Math.max(0,Math.min(1,(p.y-b.y)/b.height)))),this.model.setGeometry(D[d],E))}}finally{this.model.endUpdate()}};
Graph.prototype.resizeParentStacks=function(b,d,g,l){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var D=d.horizontal;null!=b&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==D&&!d.resizeLast;){var p=this.getCellGeometry(b),E=this.view.getState(b);null!=E&&null!=p&&(p=p.clone(),d.horizontal?p.width+=g+Math.min(0,E.width/this.view.scale-p.width):p.height+=l+Math.min(0,E.height/this.view.scale-p.height),this.model.setGeometry(b,
p));b=this.model.getParent(b);d=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var d=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=d.container:"1"==d.container};Graph.prototype.isCellConnectable=function(b){var d=this.getCurrentCellStyle(b);return null!=d.connectable?"0"!=d.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)};
Graph.prototype.isLabelMovable=function(b){var d=this.getCurrentCellStyle(b);return null!=d.movableLabel?"0"!=d.movableLabel:mxGraph.prototype.isLabelMovable.apply(this,arguments)};Graph.prototype.selectAll=function(b){b=b||this.getDefaultParent();this.isCellLocked(b)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(b,d,g){g=g||this.getDefaultParent();this.isCellLocked(g)||mxGraph.prototype.selectCells.apply(this,arguments)};
Graph.prototype.getSwimlaneAt=function(b,d,g){var l=mxGraph.prototype.getSwimlaneAt.apply(this,arguments);this.isCellLocked(l)&&(l=null);return l};Graph.prototype.isCellFoldable=function(b){var d=this.getCurrentCellStyle(b);return this.foldingEnabled&&"0"!=mxUtils.getValue(d,mxConstants.STYLE_RESIZABLE,"1")&&("1"==d.treeFolding||!this.isCellLocked(b)&&(this.isContainer(b)&&"0"!=d.collapsible||!this.isContainer(b)&&"1"==d.collapsible))};
Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()};Graph.prototype.zoom=function(b,d){b=Math.max(.01,Math.min(this.view.scale*b,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){.15>this.view.scale?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)};
Graph.prototype.zoomOut=function(){.15>=this.view.scale?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(1/this.zoomFactor*this.view.scale*20)/20/this.view.scale)};
Graph.prototype.fitWindow=function(b,d){d=null!=d?d:10;var g=this.container.clientWidth-d,l=this.container.clientHeight-d,D=Math.floor(20*Math.min(g/b.width,l/b.height))/20;this.zoomTo(D);if(mxUtils.hasScrollbars(this.container)){var p=this.view.translate;this.container.scrollTop=(b.y+p.y)*D-Math.max((l-b.height*D)/2+d/2,0);this.container.scrollLeft=(b.x+p.x)*D-Math.max((g-b.width*D)/2+d/2,0)}};
Graph.prototype.getTooltipForCell=function(b){var d="";if(mxUtils.isNode(b.value)){var g=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&(g=b.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==g&&(g=b.value.getAttribute("tooltip"));if(null!=g)null!=g&&this.isReplacePlaceholders(b)&&(g=this.replacePlaceholders(b,g)),d=Graph.sanitizeHtml(g);else{g=this.builtInProperties;b=b.value.attributes;var l=[];this.isEnabled()&&(g.push("linkTarget"),g.push("link"));for(var D=0;D<b.length;D++)(Graph.translateDiagram&&
"label"==b[D].nodeName||0>mxUtils.indexOf(g,b[D].nodeName))&&0<b[D].nodeValue.length&&l.push({name:b[D].nodeName,value:b[D].nodeValue});l.sort(function(p,E){return p.name<E.name?-1:p.name>E.name?1:0});for(D=0;D<l.length;D++)"link"==l[D].name&&this.isCustomLink(l[D].value)||(d+=("link"!=l[D].name?"<b>"+mxUtils.htmlEntities(l[D].name)+":</b> ":"")+mxUtils.htmlEntities(l[D].value)+"\n");0<d.length&&(d=d.substring(0,d.length-1),mxClient.IS_SVG&&(d='<div style="max-width:360px;text-overflow:ellipsis;overflow:hidden;">'+
d+"</div>"))}}return d};Graph.prototype.getFlowAnimationStyle=function(){var b=document.getElementsByTagName("head")[0];if(null!=b&&null==this.flowAnimationStyle){this.flowAnimationStyle=document.createElement("style");this.flowAnimationStyle.setAttribute("id","geEditorFlowAnimation-"+Editor.guid());this.flowAnimationStyle.type="text/css";var d=this.flowAnimationStyle.getAttribute("id");this.flowAnimationStyle.innerHTML=this.getFlowAnimationStyleCss(d);b.appendChild(this.flowAnimationStyle)}return this.flowAnimationStyle};
Graph.prototype.getFlowAnimationStyleCss=function(b){return"."+b+" {\nanimation: "+b+" 0.5s linear;\nanimation-iteration-count: infinite;\n}\n@keyframes "+b+" {\nto {\nstroke-dashoffset: "+-16*this.view.scale+";\n}\n}"};Graph.prototype.stringToBytes=function(b){return Graph.stringToBytes(b)};Graph.prototype.bytesToString=function(b){return Graph.bytesToString(b)};Graph.prototype.compressNode=function(b){return Graph.compressNode(b)};Graph.prototype.compress=function(b,d){return Graph.compress(b,d)};
Graph.prototype.decompress=function(b,d){return Graph.decompress(b,d)};Graph.prototype.zapGremlins=function(b){return Graph.zapGremlins(b)};HoverIcons=function(b){mxEventSource.call(this);this.graph=b;this.init()};mxUtils.extend(HoverIcons,mxEventSource);HoverIcons.prototype.arrowSpacing=2;HoverIcons.prototype.updateDelay=500;HoverIcons.prototype.activationDelay=140;HoverIcons.prototype.currentState=null;HoverIcons.prototype.activeArrow=null;HoverIcons.prototype.inactiveOpacity=15;
HoverIcons.prototype.cssCursor="copy";HoverIcons.prototype.checkCollisions=!0;HoverIcons.prototype.arrowFill="#29b6f2";HoverIcons.prototype.triangleUp=mxClient.IS_SVG?Graph.createSvgImage(18,28,'<path d="m 6 26 L 12 26 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-up.png",26,14);
HoverIcons.prototype.triangleRight=mxClient.IS_SVG?Graph.createSvgImage(26,18,'<path d="m 1 6 L 14 6 L 14 1 L 26 9 L 14 18 L 14 12 L 1 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-right.png",14,26);HoverIcons.prototype.triangleDown=mxClient.IS_SVG?Graph.createSvgImage(18,26,'<path d="m 6 1 L 6 14 L 1 14 L 9 26 L 18 14 L 12 14 L 12 1 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-down.png",26,14);
HoverIcons.prototype.triangleLeft=mxClient.IS_SVG?Graph.createSvgImage(28,18,'<path d="m 1 9 L 12 1 L 12 6 L 26 6 L 26 12 L 12 12 L 12 18 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-left.png",14,26);HoverIcons.prototype.roundDrop=mxClient.IS_SVG?Graph.createSvgImage(26,26,'<circle cx="13" cy="13" r="12" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/round-drop.png",26,26);
HoverIcons.prototype.refreshTarget=new mxImage(mxClient.IS_SVG?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjM2cHgiIGhlaWdodD0iMzZweCI+PGVsbGlwc2UgZmlsbD0iIzI5YjZmMiIgY3g9IjEyIiBjeT0iMTIiIHJ4PSIxMiIgcnk9IjEyIi8+PHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjgpIHRyYW5zbGF0ZSgyLjQsIDIuNCkiIHN0cm9rZT0iI2ZmZiIgZmlsbD0iI2ZmZiIgZD0iTTEyIDZ2M2w0LTQtNC00djNjLTQuNDIgMC04IDMuNTgtOCA4IDAgMS41Ny40NiAzLjAzIDEuMjQgNC4yNkw2LjcgMTQuOGMtLjQ1LS44My0uNy0xLjc5LS43LTIuOCAwLTMuMzEgMi42OS02IDYtNnptNi43NiAxLjc0TDE3LjMgOS4yYy40NC44NC43IDEuNzkuNyAyLjggMCAzLjMxLTIuNjkgNi02IDZ2LTNsLTQgNCA0IDR2LTNjNC40MiAwIDgtMy41OCA4LTggMC0xLjU3LS40Ni0zLjAzLTEuMjQtNC4yNnoiLz48cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PC9zdmc+Cg==":
IMAGE_PATH+"/refresh.png",38,38);HoverIcons.prototype.tolerance=mxClient.IS_TOUCH?6:0;
HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangleUp,mxResources.get("plusTooltip"),mxConstants.DIRECTION_NORTH);this.arrowRight=this.createArrow(this.triangleRight,mxResources.get("plusTooltip"),mxConstants.DIRECTION_EAST);this.arrowDown=this.createArrow(this.triangleDown,mxResources.get("plusTooltip"),mxConstants.DIRECTION_SOUTH);this.arrowLeft=this.createArrow(this.triangleLeft,mxResources.get("plusTooltip"),mxConstants.DIRECTION_WEST);this.elts=[this.arrowUp,this.arrowRight,
this.arrowDown,this.arrowLeft];this.resetHandler=mxUtils.bind(this,function(){this.reset()});this.repaintHandler=mxUtils.bind(this,function(){this.repaint()});this.graph.selectionModel.addListener(mxEvent.CHANGE,this.resetHandler);this.graph.model.addListener(mxEvent.CHANGE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler);
this.graph.view.addListener(mxEvent.DOWN,this.repaintHandler);this.graph.view.addListener(mxEvent.UP,this.repaintHandler);this.graph.addListener(mxEvent.ROOT,this.repaintHandler);this.graph.addListener(mxEvent.ESCAPE,this.resetHandler);mxEvent.addListener(this.graph.container,"scroll",this.resetHandler);this.graph.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.mouseDownPoint=null}));mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(g){null!=g.relatedTarget&&
mxEvent.getSource(g)==this.graph.container&&this.setDisplay("none")}));this.graph.addListener(mxEvent.START_EDITING,mxUtils.bind(this,function(g){this.reset()}));var b=this.graph.click;this.graph.click=mxUtils.bind(this,function(g){b.apply(this.graph,arguments);null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||!mxEvent.isTouchEvent(g.getEvent())||this.graph.model.isVertex(g.getCell())||this.reset()});var d=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(g,
l){d=!1;g=l.getEvent();this.isResetEvent(g)?this.reset():this.isActive()||(l=this.getState(l.getState()),null==l&&mxEvent.isTouchEvent(g)||this.update(l));this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(g,l){g=l.getEvent();this.isResetEvent(g)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(g)||this.update(this.getState(l.getState()),l.getGraphX(),l.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(d=!0)}),mouseUp:mxUtils.bind(this,
function(g,l){g=l.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(g),mxEvent.getClientY(g));this.isResetEvent(g)?this.reset():this.isActive()&&!d&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),l):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(l.getGraphX(),l.getGraphY())))):mxEvent.isTouchEvent(g)||null!=
this.bbox&&mxUtils.contains(this.bbox,l.getGraphX(),l.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(g)||this.reset();d=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(b,d){return mxEvent.isAltDown(b)||null==this.activeArrow&&mxEvent.isShiftDown(b)||mxEvent.isPopupTrigger(b)&&!this.graph.isCloneEvent(b)};
HoverIcons.prototype.createArrow=function(b,d,g){var l=null;l=mxUtils.createImage(b.src);l.style.width=b.width+"px";l.style.height=b.height+"px";l.style.padding=this.tolerance+"px";null!=d&&l.setAttribute("title",d);l.style.position="absolute";l.style.cursor=this.cssCursor;mxEvent.addGestureListeners(l,mxUtils.bind(this,function(D){null==this.currentState||this.isResetEvent(D)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(D),mxEvent.getClientY(D)),this.drag(D,
this.mouseDownPoint.x,this.mouseDownPoint.y),this.activeArrow=l,this.setDisplay("none"),mxEvent.consume(D))}));mxEvent.redirectMouseEvents(l,this.graph,this.currentState);mxEvent.addListener(l,"mouseenter",mxUtils.bind(this,function(D){mxEvent.isMouseEvent(D)&&(null!=this.activeArrow&&this.activeArrow!=l&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(l,100),this.activeArrow=l,this.fireEvent(new mxEventObject("focus",
"arrow",l,"direction",g,"event",D)))}));mxEvent.addListener(l,"mouseleave",mxUtils.bind(this,function(D){mxEvent.isMouseEvent(D)&&this.fireEvent(new mxEventObject("blur","arrow",l,"direction",g,"event",D));this.graph.isMouseDown||this.resetActiveArrow()}));return l};HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)};
HoverIcons.prototype.getDirection=function(){var b=mxConstants.DIRECTION_EAST;this.activeArrow==this.arrowUp?b=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?b=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(b=mxConstants.DIRECTION_WEST);return b};HoverIcons.prototype.visitNodes=function(b){for(var d=0;d<this.elts.length;d++)null!=this.elts[d]&&b(this.elts[d])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(b){null!=b.parentNode&&b.parentNode.removeChild(b)})};
HoverIcons.prototype.setDisplay=function(b){this.visitNodes(function(d){d.style.display=b})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState};
HoverIcons.prototype.drag=function(b,d,g){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,d,g),this.graph.isMouseTrigger=mxEvent.isMouseEvent(b),this.graph.isMouseDown=!0,d=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=d&&d.setHandlesVisible(!1),d=this.graph.connectionHandler.edgeState,null!=b&&mxEvent.isShiftDown(b)&&mxEvent.isControlDown(b)&&null!=d&&"orthogonalEdgeStyle"===
mxUtils.getValue(d.style,mxConstants.STYLE_EDGE,null)&&(b=this.getDirection(),d.cell.style=mxUtils.setStyle(d.cell.style,"sourcePortConstraint",b),d.style.sourcePortConstraint=b))};HoverIcons.prototype.getStateAt=function(b,d,g){return this.graph.view.getState(this.graph.getCellAt(d,g))};
HoverIcons.prototype.click=function(b,d,g){var l=g.getEvent(),D=g.getGraphX(),p=g.getGraphY();D=this.getStateAt(b,D,p);null==D||!this.graph.model.isEdge(D.cell)||this.graph.isCloneEvent(l)||D.getVisibleTerminalState(!0)!=b&&D.getVisibleTerminalState(!1)!=b?null!=b&&this.execute(b,d,g):(this.graph.setSelectionCell(D.cell),this.reset());g.consume()};
HoverIcons.prototype.execute=function(b,d,g){g=g.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(b.cell,d,this.graph.defaultEdgeLength,g,this.graph.isCloneEvent(g),this.graph.isCloneEvent(g)),g,this)};HoverIcons.prototype.reset=function(b){null!=b&&!b||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null;this.fireEvent(new mxEventObject("reset"))};
HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var b=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(b=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));b.grow(this.graph.tolerance);b.grow(this.arrowSpacing);
var d=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);this.graph.isTableRow(this.currentState.cell)&&(d=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell)));var g=null;null!=d&&(b.x-=d.horizontalOffset/2,b.y-=d.verticalOffset/2,b.width+=d.horizontalOffset,b.height+=d.verticalOffset,null!=d.rotationShape&&null!=d.rotationShape.node&&"hidden"!=d.rotationShape.node.style.visibility&&"none"!=d.rotationShape.node.style.display&&null!=d.rotationShape.boundingBox&&
(g=d.rotationShape.boundingBox));d=mxUtils.bind(this,function(N,R,G){if(null!=g){var M=new mxRectangle(R,G,N.clientWidth,N.clientHeight);mxUtils.intersects(M,g)&&(N==this.arrowUp?G-=M.y+M.height-g.y:N==this.arrowRight?R+=g.x+g.width-M.x:N==this.arrowDown?G+=g.y+g.height-M.y:N==this.arrowLeft&&(R-=M.x+M.width-g.x))}N.style.left=R+"px";N.style.top=G+"px";mxUtils.setOpacity(N,this.inactiveOpacity)});d(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-
this.triangleUp.height-this.tolerance));d(this.arrowRight,Math.round(b.x+b.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance));d(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(b.y+b.height-this.tolerance));d(this.arrowLeft,Math.round(b.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top));if(this.checkCollisions){d=this.graph.getCellAt(b.x+b.width+this.triangleRight.width/2,this.currentState.getCenterY());
var l=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),D=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=d&&d==l&&l==D&&D==b&&(b=D=l=d=null);var p=this.graph.getCellGeometry(this.currentState.cell),E=mxUtils.bind(this,function(N,R){var G=this.graph.model.isVertex(N)&&this.graph.getCellGeometry(N);null==N||this.graph.model.isAncestor(N,
this.currentState.cell)||this.graph.isSwimlane(N)||!(null==G||null==p||G.height<3*p.height&&G.width<3*p.width)?R.style.visibility="visible":R.style.visibility="hidden"});E(d,this.arrowRight);E(l,this.arrowLeft);E(D,this.arrowUp);E(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),
this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};
HoverIcons.prototype.computeBoundingBox=function(){var b=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(d){null!=d.parentNode&&(d=new mxRectangle(d.offsetLeft,d.offsetTop,d.offsetWidth,d.offsetHeight),null==b?b=d:b.add(d))});return b};
HoverIcons.prototype.getState=function(b){if(null!=b)if(b=b.cell,this.graph.getModel().contains(b)){if(this.graph.getModel().isVertex(b)&&!this.graph.isCellConnectable(b)){var d=this.graph.getModel().getParent(b);this.graph.getModel().isVertex(d)&&this.graph.isCellConnectable(d)&&(b=d)}if(this.graph.isCellLocked(b)||this.graph.model.isEdge(b))b=null;b=this.graph.view.getState(b);null!=b&&null==b.style&&(b=null)}else b=null;return b};
HoverIcons.prototype.update=function(b,d,g){if(!this.graph.connectionArrowsEnabled||null!=this.graph.freehand&&this.graph.freehand.isDrawing()||null!=b&&"0"==mxUtils.getValue(b.style,"allowArrows","1"))this.reset();else{null!=b&&null!=b.cell.geometry&&b.cell.geometry.relative&&this.graph.model.isEdge(b.cell.parent)&&(b=null);var l=null;this.prev!=b||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=b,l=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=b&&(this.updateThread=
window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=b,this.update(b,d,g))}),this.updateDelay+10))):null!=this.startTime&&(l=(new Date).getTime()-this.startTime);this.setDisplay("");null!=this.currentState&&this.currentState!=b&&l<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,d,g)?this.reset(!1):(null!=this.currentState||l>this.activationDelay)&&this.currentState!=b&&(l>this.updateDelay&&null!=
b||null==this.bbox||null==d||null==g||!mxUtils.contains(this.bbox,d,g))&&(null!=b&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(b),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=b&&this.graph.connectionHandler.constraintHandler.reset()):this.reset())}};
HoverIcons.prototype.setCurrentState=function(b){"eastwest"!=b.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=b};Graph.prototype.createParent=function(b,d,g,l,D){b=this.cloneCell(b);for(var p=0;p<g;p++){var E=this.cloneCell(d),N=this.getCellGeometry(E);null!=N&&(N.x+=p*l,N.y+=p*D);b.insert(E)}return b};
Graph.prototype.createTable=function(b,d,g,l,D,p,E,N,R){g=null!=g?g:60;l=null!=l?l:40;p=null!=p?p:30;N=null!=N?N:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;";R=null!=R?R:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";return this.createParent(this.createVertex(null,
null,null!=D?D:"",0,0,d*g,b*l+(null!=D?p:0),null!=E?E:"shape=table;startSize="+(null!=D?p:"0")+";container=1;collapsible=0;childLayout=tableLayout;"),this.createParent(this.createVertex(null,null,"",0,0,d*g,l,N),this.createVertex(null,null,"",0,0,g,l,R),d,g,0),b,0,l)};
Graph.prototype.setTableValues=function(b,d,g){for(var l=this.model.getChildCells(b,!0),D=0;D<l.length;D++)if(null!=g&&(l[D].value=g[D]),null!=d)for(var p=this.model.getChildCells(l[D],!0),E=0;E<p.length;E++)null!=d[D][E]&&(p[E].value=d[D][E]);return b};
Graph.prototype.createCrossFunctionalSwimlane=function(b,d,g,l,D,p,E,N,R){g=null!=g?g:120;l=null!=l?l:120;E=null!=E?E:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;collapsible=0;recursiveResize=0;expand=0;";N=null!=N?N:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";
R=null!=R?R:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";D=this.createVertex(null,null,null!=D?D:"",0,0,d*g,b*l,null!=p?p:"shape=table;childLayout=tableLayout;"+(null==D?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");p=mxUtils.getValue(this.getCellStyle(D),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);D.geometry.width+=p;D.geometry.height+=p;E=this.createVertex(null,
null,"",0,p,d*g+p,l,E);D.insert(this.createParent(E,this.createVertex(null,null,"",p,0,g,l,N),d,g,0));return 1<b?(E.geometry.y=l+p,this.createParent(D,this.createParent(E,this.createVertex(null,null,"",p,0,g,l,R),d,g,0),b-1,0,l)):D};
Graph.prototype.visitTableCells=function(b,d){var g=null,l=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var D=0;D<l.length;D++){for(var p=this.getActualStartSize(l[D],!0),E=this.model.getChildCells(l[D],!0),N=this.getCellStyle(l[D],!0),R=null,G=[],M=0;M<E.length;M++){var Q=this.getCellGeometry(E[M]),e={cell:E[M],rospan:1,colspan:1,row:D,col:M,geo:Q};Q=null!=Q.alternateBounds?Q.alternateBounds:Q;e.point=new mxPoint(Q.width+(null!=R?R.point.x:b.x+p.x),Q.height+(null!=g&&null!=
g[0]?g[0].point.y:b.y+p.y));e.actual=e;null!=g&&null!=g[M]&&1<g[M].rowspan?(e.rowspan=g[M].rowspan-1,e.colspan=g[M].colspan,e.actual=g[M].actual):null!=R&&1<R.colspan?(e.rowspan=R.rowspan,e.colspan=R.colspan-1,e.actual=R.actual):(R=this.getCurrentCellStyle(E[M],!0),null!=R&&(e.rowspan=parseInt(R.rowspan||1),e.colspan=parseInt(R.colspan||1)));R=1==mxUtils.getValue(N,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(N,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE;d(e,E.length,
l.length,b.x+(R?p.x:0),b.y+(R?p.y:0));G.push(e);R=e}g=G}};Graph.prototype.getTableLines=function(b,d,g){var l=[],D=[];(d||g)&&this.visitTableCells(b,mxUtils.bind(this,function(p,E,N,R,G){d&&p.row<N-1&&(null==l[p.row]&&(l[p.row]=[new mxPoint(R,p.point.y)]),1<p.rowspan&&l[p.row].push(null),l[p.row].push(p.point));g&&p.col<E-1&&(null==D[p.col]&&(D[p.col]=[new mxPoint(p.point.x,G)]),1<p.colspan&&D[p.col].push(null),D[p.col].push(p.point))}));return l.concat(D)};
Graph.prototype.isTableCell=function(b){return this.model.isVertex(b)&&this.isTableRow(this.model.getParent(b))};Graph.prototype.isTableRow=function(b){return this.model.isVertex(b)&&this.isTable(this.model.getParent(b))};Graph.prototype.isTable=function(b){b=this.getCellStyle(b);return null!=b&&"tableLayout"==b.childLayout};Graph.prototype.isStack=function(b){b=this.getCellStyle(b);return null!=b&&"stackLayout"==b.childLayout};
Graph.prototype.isStackChild=function(b){return this.model.isVertex(b)&&this.isStack(this.model.getParent(b))};
Graph.prototype.setTableRowHeight=function(b,d,g){g=null!=g?g:!0;var l=this.getModel();l.beginUpdate();try{var D=this.getCellGeometry(b);if(null!=D){D=D.clone();D.height+=d;l.setGeometry(b,D);var p=l.getParent(b),E=l.getChildCells(p,!0);if(!g){var N=mxUtils.indexOf(E,b);if(N<E.length-1){var R=E[N+1],G=this.getCellGeometry(R);null!=G&&(G=G.clone(),G.y+=d,G.height-=d,l.setGeometry(R,G))}}var M=this.getCellGeometry(p);null!=M&&(g||(g=b==E[E.length-1]),g&&(M=M.clone(),M.height+=d,l.setGeometry(p,M)))}}finally{l.endUpdate()}};
Graph.prototype.setTableColumnWidth=function(b,d,g){g=null!=g?g:!1;var l=this.getModel(),D=l.getParent(b),p=l.getParent(D),E=l.getChildCells(D,!0);b=mxUtils.indexOf(E,b);var N=b==E.length-1;l.beginUpdate();try{for(var R=l.getChildCells(p,!0),G=0;G<R.length;G++){D=R[G];E=l.getChildCells(D,!0);var M=E[b],Q=this.getCellGeometry(M);null!=Q&&(Q=Q.clone(),Q.width+=d,null!=Q.alternateBounds&&(Q.alternateBounds.width+=d),l.setGeometry(M,Q));b<E.length-1&&(M=E[b+1],Q=this.getCellGeometry(M),null!=Q&&(Q=Q.clone(),
Q.x+=d,g||(Q.width-=d,null!=Q.alternateBounds&&(Q.alternateBounds.width-=d)),l.setGeometry(M,Q)))}if(N||g){var e=this.getCellGeometry(p);null!=e&&(e=e.clone(),e.width+=d,l.setGeometry(p,e))}null!=this.layoutManager&&this.layoutManager.executeLayout(p)}finally{l.endUpdate()}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};
TableLayout.prototype.isVertexIgnored=function(b){return!this.graph.getModel().isVertex(b)||!this.graph.isCellVisible(b)};TableLayout.prototype.getSize=function(b,d){for(var g=0,l=0;l<b.length;l++)if(!this.isVertexIgnored(b[l])){var D=this.graph.getCellGeometry(b[l]);null!=D&&(g+=d?D.width:D.height)}return g};
TableLayout.prototype.getRowLayout=function(b,d){var g=this.graph.model.getChildCells(b,!0),l=this.graph.getActualStartSize(b,!0);b=this.getSize(g,!0);d=d-l.x-l.width;var D=[];l=l.x;for(var p=0;p<g.length;p++){var E=this.graph.getCellGeometry(g[p]);null!=E&&(l+=(null!=E.alternateBounds?E.alternateBounds.width:E.width)*d/b,D.push(Math.round(l)))}return D};
TableLayout.prototype.layoutRow=function(b,d,g,l){var D=this.graph.getModel(),p=D.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var E=b.x,N=0;null!=d&&(d=d.slice(),d.splice(0,0,b.x));for(var R=0;R<p.length;R++){var G=this.graph.getCellGeometry(p[R]);null!=G&&(G=G.clone(),G.y=b.y,G.height=g-b.y-b.height,null!=d?(G.x=d[R],G.width=d[R+1]-G.x,R==p.length-1&&R<d.length-2&&(G.width=l-G.x-b.x-b.width)):(G.x=E,E+=G.width,R==p.length-1?G.width=l-b.x-b.width-N:N+=G.width),G.alternateBounds=new mxRectangle(0,
0,G.width,G.height),D.setGeometry(p[R],G))}return N};
TableLayout.prototype.execute=function(b){if(null!=b){var d=this.graph.getActualStartSize(b,!0),g=this.graph.getCellGeometry(b),l=this.graph.getCellStyle(b),D="1"==mxUtils.getValue(l,"resizeLastRow","0"),p="1"==mxUtils.getValue(l,"resizeLast","0");l="1"==mxUtils.getValue(l,"fixedRows","0");var E=this.graph.getModel(),N=0;E.beginUpdate();try{for(var R=g.height-d.y-d.height,G=g.width-d.x-d.width,M=E.getChildCells(b,!0),Q=0;Q<M.length;Q++)E.setVisible(M[Q],!0);var e=this.getSize(M,!1);if(0<R&&0<G&&0<
M.length&&0<e){if(D){var f=this.graph.getCellGeometry(M[M.length-1]);null!=f&&(f=f.clone(),f.height=R-e+f.height,E.setGeometry(M[M.length-1],f))}var k=p?null:this.getRowLayout(M[0],G),z=[],t=d.y;for(Q=0;Q<M.length;Q++)f=this.graph.getCellGeometry(M[Q]),null!=f&&(f=f.clone(),f.x=d.x,f.width=G,f.y=Math.round(t),t=D||l?t+f.height:t+f.height/e*R,f.height=Math.round(t)-f.y,E.setGeometry(M[Q],f)),N=Math.max(N,this.layoutRow(M[Q],k,f.height,G,z));l&&R<e&&(g=g.clone(),g.height=t+d.height,E.setGeometry(b,
g));p&&G<N+Graph.minTableColumnWidth&&(g=g.clone(),g.width=N+d.width+d.x+Graph.minTableColumnWidth,E.setGeometry(b,g));this.graph.visitTableCells(b,mxUtils.bind(this,function(B){E.setVisible(B.cell,B.actual.cell==B.cell);if(B.actual.cell!=B.cell){if(B.actual.row==B.row){var I=null!=B.geo.alternateBounds?B.geo.alternateBounds:B.geo;B.actual.geo.width+=I.width}B.actual.col==B.col&&(I=null!=B.geo.alternateBounds?B.geo.alternateBounds:B.geo,B.actual.geo.height+=I.height)}}))}else for(Q=0;Q<M.length;Q++)E.setVisible(M[Q],
!1)}finally{E.endUpdate()}}};
(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var d=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(M,Q){Q=null!=Q?Q:!0;var e=this.getState(M);null!=e&&Q&&this.graph.model.isEdge(e.cell)&&null!=e.style&&1!=e.style[mxConstants.STYLE_CURVED]&&!e.invalid&&this.updateLineJumps(e)&&this.graph.cellRenderer.redraw(e,!1,this.isRendering());e=d.apply(this,
arguments);null!=e&&Q&&this.graph.model.isEdge(e.cell)&&null!=e.style&&1!=e.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(e);return e};var g=mxShape.prototype.paint;mxShape.prototype.paint=function(){g.apply(this,arguments);if(null!=this.state&&null!=this.node&&this.state.view.graph.enableFlowAnimation&&this.state.view.graph.model.isEdge(this.state.cell)&&"1"==mxUtils.getValue(this.state.style,"flowAnimation","0")){var M=this.node.getElementsByTagName("path");if(1<M.length){"1"!=mxUtils.getValue(this.state.style,
mxConstants.STYLE_DASHED,"0")&&M[1].setAttribute("stroke-dasharray",8*this.state.view.scale);var Q=this.state.view.graph.getFlowAnimationStyle();null!=Q&&M[1].setAttribute("class",Q.getAttribute("id"))}}};var l=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(M,Q){return l.apply(this,arguments)||null!=M.routedPoints&&null!=Q.routedPoints&&!mxUtils.equalPoints(Q.routedPoints,M.routedPoints)};var D=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=
function(M){D.apply(this,arguments);this.graph.model.isEdge(M.cell)&&1!=M.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(M)};mxGraphView.prototype.updateLineJumps=function(M){var Q=M.absolutePoints;if(Graph.lineJumpsEnabled){var e=null!=M.routedPoints,f=null;if(null!=Q&&null!=this.validEdges&&"none"!==mxUtils.getValue(M.style,"jumpStyle","none")){var k=function(qa,sa,L){var V=new mxPoint(sa,L);V.type=qa;f.push(V);V=null!=M.routedPoints?M.routedPoints[f.length-1]:null;return null==V||V.type!=
qa||V.x!=sa||V.y!=L},z=.5*this.scale;e=!1;f=[];for(var t=0;t<Q.length-1;t++){for(var B=Q[t+1],I=Q[t],O=[],J=Q[t+2];t<Q.length-2&&mxUtils.ptSegDistSq(I.x,I.y,J.x,J.y,B.x,B.y)<1*this.scale*this.scale;)B=J,t++,J=Q[t+2];e=k(0,I.x,I.y)||e;for(var y=0;y<this.validEdges.length;y++){var ia=this.validEdges[y],da=ia.absolutePoints;if(null!=da&&mxUtils.intersects(M,ia)&&"1"!=ia.style.noJump)for(ia=0;ia<da.length-1;ia++){var ja=da[ia+1],aa=da[ia];for(J=da[ia+2];ia<da.length-2&&mxUtils.ptSegDistSq(aa.x,aa.y,J.x,
J.y,ja.x,ja.y)<1*this.scale*this.scale;)ja=J,ia++,J=da[ia+2];J=mxUtils.intersection(I.x,I.y,B.x,B.y,aa.x,aa.y,ja.x,ja.y);if(null!=J&&(Math.abs(J.x-I.x)>z||Math.abs(J.y-I.y)>z)&&(Math.abs(J.x-B.x)>z||Math.abs(J.y-B.y)>z)&&(Math.abs(J.x-aa.x)>z||Math.abs(J.y-aa.y)>z)&&(Math.abs(J.x-ja.x)>z||Math.abs(J.y-ja.y)>z)){ja=J.x-I.x;aa=J.y-I.y;J={distSq:ja*ja+aa*aa,x:J.x,y:J.y};for(ja=0;ja<O.length;ja++)if(O[ja].distSq>J.distSq){O.splice(ja,0,J);J=null;break}null==J||0!=O.length&&O[O.length-1].x===J.x&&O[O.length-
1].y===J.y||O.push(J)}}}for(ia=0;ia<O.length;ia++)e=k(1,O[ia].x,O[ia].y)||e}J=Q[Q.length-1];e=k(0,J.x,J.y)||e}M.routedPoints=f;return e}return!1};var p=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(M,Q,e){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)p.apply(this,arguments);else{var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,
mxConstants.LINE_ARCSIZE)/2,k=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,z=mxUtils.getValue(this.style,"jumpStyle","none"),t=!0,B=null,I=null,O=[],J=null;M.begin();for(var y=0;y<this.state.routedPoints.length;y++){var ia=this.state.routedPoints[y],da=new mxPoint(ia.x/this.scale,ia.y/this.scale);0==y?da=Q[0]:y==this.state.routedPoints.length-1&&(da=Q[Q.length-1]);var ja=!1;if(null!=B&&1==ia.type){var aa=this.state.routedPoints[y+1];ia=aa.x/this.scale-
da.x;aa=aa.y/this.scale-da.y;ia=ia*ia+aa*aa;null==J&&(J=new mxPoint(da.x-B.x,da.y-B.y),I=Math.sqrt(J.x*J.x+J.y*J.y),0<I?(J.x=J.x*k/I,J.y=J.y*k/I):J=null);ia>k*k&&0<I&&(ia=B.x-da.x,aa=B.y-da.y,ia=ia*ia+aa*aa,ia>k*k&&(ja=new mxPoint(da.x-J.x,da.y-J.y),ia=new mxPoint(da.x+J.x,da.y+J.y),O.push(ja),this.addPoints(M,O,e,f,!1,null,t),O=0>Math.round(J.x)||0==Math.round(J.x)&&0>=Math.round(J.y)?1:-1,t=!1,"sharp"==z?(M.lineTo(ja.x-J.y*O,ja.y+J.x*O),M.lineTo(ia.x-J.y*O,ia.y+J.x*O),M.lineTo(ia.x,ia.y)):"line"==
z?(M.moveTo(ja.x+J.y*O,ja.y-J.x*O),M.lineTo(ja.x-J.y*O,ja.y+J.x*O),M.moveTo(ia.x-J.y*O,ia.y+J.x*O),M.lineTo(ia.x+J.y*O,ia.y-J.x*O),M.moveTo(ia.x,ia.y)):"arc"==z?(O*=1.3,M.curveTo(ja.x-J.y*O,ja.y+J.x*O,ia.x-J.y*O,ia.y+J.x*O,ia.x,ia.y)):(M.moveTo(ia.x,ia.y),t=!0),O=[ia],ja=!0))}else J=null;ja||(O.push(da),B=da)}this.addPoints(M,O,e,f,!1,null,t);M.stroke()}};var E=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(M,Q,e,f){return null!=Q&&"centerPerimeter"==
Q.style[mxConstants.STYLE_PERIMETER]?new mxPoint(Q.getCenterX(),Q.getCenterY()):E.apply(this,arguments)};var N=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(M,Q,e,f){if(null==Q||null==M||"1"!=Q.style.snapToPoint&&"1"!=M.style.snapToPoint)N.apply(this,arguments);else{Q=this.getTerminalPort(M,Q,f);var k=this.getNextPoint(M,e,f),z=this.graph.isOrthogonal(M),t=mxUtils.toRadians(Number(Q.style[mxConstants.STYLE_ROTATION]||"0")),B=new mxPoint(Q.getCenterX(),
Q.getCenterY());if(0!=t){var I=Math.cos(-t),O=Math.sin(-t);k=mxUtils.getRotatedPoint(k,I,O,B)}I=parseFloat(M.style[mxConstants.STYLE_PERIMETER_SPACING]||0);I+=parseFloat(M.style[f?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);k=this.getPerimeterPoint(Q,k,0==t&&z,I);0!=t&&(I=Math.cos(t),O=Math.sin(t),k=mxUtils.getRotatedPoint(k,I,O,B));M.setAbsoluteTerminalPoint(this.snapToAnchorPoint(M,Q,e,f,k),f)}};mxGraphView.prototype.snapToAnchorPoint=function(M,Q,
e,f,k){if(null!=Q&&null!=M){M=this.graph.getAllConnectionConstraints(Q);f=e=null;if(null!=M)for(var z=0;z<M.length;z++){var t=this.graph.getConnectionPoint(Q,M[z]);if(null!=t){var B=(t.x-k.x)*(t.x-k.x)+(t.y-k.y)*(t.y-k.y);if(null==f||B<f)e=t,f=B}}null!=e&&(k=e)}return k};var R=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(M,Q,e){var f=R.apply(this,arguments);"1"==M.getAttribute("placeholders")&&null!=e.state&&(f=e.state.view.graph.replacePlaceholders(e.state.cell,
f));return f};var G=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(M){if(null!=M.style&&"undefined"!==typeof pako){var Q=mxUtils.getValue(M.style,mxConstants.STYLE_SHAPE,null);if(null!=Q&&"string"===typeof Q&&"stencil("==Q.substring(0,8))try{var e=Q.substring(8,Q.length-1),f=mxUtils.parseXml(Graph.decompress(e));return new mxShape(new mxStencil(f.documentElement))}catch(k){null!=window.console&&console.log("Error in shape: "+k)}}return G.apply(this,arguments)}})();
mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};
mxStencilRegistry.getStencil=function(b){var d=mxStencilRegistry.stencils[b];if(null==d&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var g=mxStencilRegistry.getBasenameForStencil(b);if(null!=g){d=mxStencilRegistry.libraries[g];if(null!=d){if(null==mxStencilRegistry.packages[g]){for(var l=0;l<d.length;l++){var D=d[l];if(!mxStencilRegistry.filesLoaded[D])if(mxStencilRegistry.filesLoaded[D]=!0,".xml"==D.toLowerCase().substring(D.length-4,D.length))mxStencilRegistry.loadStencilSet(D,
null);else if(".js"==D.toLowerCase().substring(D.length-3,D.length))try{if(mxStencilRegistry.allowEval){var p=mxUtils.load(D);null!=p&&200<=p.getStatus()&&299>=p.getStatus()&&eval.call(window,p.getText())}}catch(E){null!=window.console&&console.log("error in getStencil:",b,g,d,D,E)}}mxStencilRegistry.packages[g]=1}}else g=g.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+g+".xml",null);d=mxStencilRegistry.stencils[b]}}return d};
mxStencilRegistry.getBasenameForStencil=function(b){var d=null;if(null!=b&&"string"===typeof b&&(b=b.split("."),0<b.length&&"mxgraph"==b[0])){d=b[1];for(var g=2;g<b.length-1;g++)d+="/"+b[g]}return d};
mxStencilRegistry.loadStencilSet=function(b,d,g,l){var D=mxStencilRegistry.packages[b];if(null!=g&&g||null==D){var p=!1;if(null==D)try{if(l){mxStencilRegistry.loadStencil(b,mxUtils.bind(this,function(E){null!=E&&null!=E.documentElement&&(mxStencilRegistry.packages[b]=E,p=!0,mxStencilRegistry.parseStencilSet(E.documentElement,d,p))}));return}D=mxStencilRegistry.loadStencil(b);mxStencilRegistry.packages[b]=D;p=!0}catch(E){null!=window.console&&console.log("error in loadStencilSet:",b,E)}null!=D&&null!=
D.documentElement&&mxStencilRegistry.parseStencilSet(D.documentElement,d,p)}};mxStencilRegistry.loadStencil=function(b,d){if(null!=d)mxUtils.get(b,mxUtils.bind(this,function(g){d(200<=g.getStatus()&&299>=g.getStatus()?g.getXml():null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var d=0;d<b.length;d++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[d]).documentElement)};
mxStencilRegistry.parseStencilSet=function(b,d,g){if("stencils"==b.nodeName)for(var l=b.firstChild;null!=l;)"shapes"==l.nodeName&&mxStencilRegistry.parseStencilSet(l,d,g),l=l.nextSibling;else{g=null!=g?g:!0;l=b.firstChild;var D="";b=b.getAttribute("name");for(null!=b&&(D=b+".");null!=l;){if(l.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=l.getAttribute("name"),null!=b)){D=D.toLowerCase();var p=b.replace(/ /g,"_");g&&mxStencilRegistry.addStencil(D+p.toLowerCase(),new mxStencil(l));if(null!=d){var E=l.getAttribute("w"),
N=l.getAttribute("h");E=null==E?80:parseInt(E,10);N=null==N?80:parseInt(N,10);d(D,p,b,E,N)}}l=l.nextSibling}}};
"undefined"!==typeof mxVertexHandler&&function(){function b(){var x=document.createElement("div");x.className="geHint";x.style.whiteSpace="nowrap";x.style.position="absolute";return x}function d(x,H){switch(H){case mxConstants.POINTS:return x;case mxConstants.MILLIMETERS:return(x/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(x/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(x/mxConstants.PIXELS_PER_INCH).toFixed(2)}}mxConstants.HANDLE_FILLCOLOR="#29b6f2";
mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR="#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_OPACITY=30;mxConstants.HIGHLIGHT_SIZE=5;mxEdgeHandler.prototype.snapToTerminals=
!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(x){return!mxEvent.isAltDown(x)};var g=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(x){return g.apply(this,arguments)||this.graph.isTableRow(x)||this.graph.isTableCell(x)};var l=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=function(x){return l.apply(this,arguments)||
this.graph.isEdgeIgnored(x)};var D=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(x){return this.graph.isCloneEvent(x)!=D.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var x=new mxEllipse(null,this.highlightColor,this.highlightColor,0);x.opacity=mxConstants.HIGHLIGHT_OPACITY;return x};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=
function(x){x=this.graph.createCurrentEdgeStyle();x=this.graph.createEdge(null,null,null,null,null,x);x=new mxCellState(this.graph.view,x,this.graph.getCellStyle(x));for(var H in this.graph.currentEdgeStyle)x.style[H]=this.graph.currentEdgeStyle[H];x.style=this.graph.postProcessCellStyle(x.cell,x.style);return x};var p=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var x=p.apply(this,arguments);x.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];
return x};mxConnectionHandler.prototype.updatePreview=function(x){};var E=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var x=E.apply(this,arguments),H=x.getCell;x.getCell=mxUtils.bind(this,function(P){var X=H.apply(this,arguments);this.error=null;return X});return x};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=
function(){for(var x="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",H="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize".split(" "),P=0;P<H.length;P++)null!=this.currentEdgeStyle[H[P]]&&(x+=H[P]+"="+this.currentEdgeStyle[H[P]]+";");null!=this.currentEdgeStyle.orthogonalLoop?x+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&
(x+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?x+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(x+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(x+="elbow="+this.currentEdgeStyle.elbow+";");return x=null!=this.currentEdgeStyle.html?x+("html="+this.currentEdgeStyle.html+";"):x+"html=1;"};
Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var x=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=x&&(new mxCodec(x.ownerDocument)).decode(x,this.getStylesheet())};Graph.prototype.createCellLookup=function(x,H){H=null!=H?H:{};for(var P=0;P<x.length;P++){var X=x[P];H[mxObjectIdentity.get(X)]=X.getId();for(var Z=this.model.getChildCount(X),
fa=0;fa<Z;fa++)this.createCellLookup([this.model.getChildAt(X,fa)],H)}return H};Graph.prototype.createCellMapping=function(x,H,P){P=null!=P?P:{};for(var X in x){var Z=H[X];null==P[Z]&&(P[Z]=x[X].getId()||"")}return P};Graph.prototype.importGraphModel=function(x,H,P,X){H=null!=H?H:0;P=null!=P?P:0;var Z=new mxCodec(x.ownerDocument),fa=new mxGraphModel;Z.decode(x,fa);x=[];Z={};var la={},za=fa.getChildren(this.cloneCell(fa.root,this.isCloneInvalidEdges(),Z));if(null!=za){var ua=this.createCellLookup([fa.root]);
za=za.slice();this.model.beginUpdate();try{if(1!=za.length||this.isCellLocked(this.getDefaultParent()))for(fa=0;fa<za.length;fa++)oa=this.model.getChildren(this.moveCells([za[fa]],H,P,!1,this.model.getRoot())[0]),null!=oa&&(x=x.concat(oa));else{var oa=fa.getChildren(za[0]);null!=oa&&(x=this.moveCells(oa,H,P,!1,this.getDefaultParent()),la[fa.getChildAt(fa.root,0).getId()]=this.getDefaultParent().getId())}if(null!=x&&(this.createCellMapping(Z,ua,la),this.updateCustomLinks(la,x),X)){this.isGridEnabled()&&
(H=this.snap(H),P=this.snap(P));var ta=this.getBoundingBoxFromGeometry(x,!0);null!=ta&&this.moveCells(x,H-ta.x,P-ta.y)}}finally{this.model.endUpdate()}}return x};Graph.prototype.encodeCells=function(x){for(var H={},P=this.cloneCells(x,null,H),X=new mxDictionary,Z=0;Z<x.length;Z++)X.put(x[Z],!0);var fa=new mxCodec,la=new mxGraphModel,za=la.getChildAt(la.getRoot(),0);for(Z=0;Z<P.length;Z++){la.add(za,P[Z]);var ua=this.view.getState(x[Z]);if(null!=ua){var oa=this.getCellGeometry(P[Z]);null!=oa&&oa.relative&&
!this.model.isEdge(x[Z])&&null==X.get(this.model.getParent(x[Z]))&&(oa.offset=null,oa.relative=!1,oa.x=ua.x/ua.view.scale-ua.view.translate.x,oa.y=ua.y/ua.view.scale-ua.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(H,this.createCellLookup(x)),P);return fa.encode(la)};Graph.prototype.isSwimlane=function(x,H){var P=null;null==x||this.model.isEdge(x)||this.model.getParent(x)==this.model.getRoot()||(P=this.getCurrentCellStyle(x,H)[mxConstants.STYLE_SHAPE]);return P==mxConstants.SHAPE_SWIMLANE||
"table"==P||"tableRow"==P};var N=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(x){var H=this.model.getParent(x);if(null!=H){var P=this.getCurrentCellStyle(H);if(null!=P.expand)return"0"!=P.expand}return N.apply(this,arguments)&&(null==H||!this.isTable(H))};var R=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(x,H,P,X,Z,fa,la,za){null==za&&(za=this.model.getParent(x),this.isTable(za)||this.isTableRow(za))&&(za=this.getCellAt(fa,la,null,!0,!1));P=null;this.model.beginUpdate();
try{P=R.apply(this,[x,H,P,X,Z,fa,la,za]);this.model.setValue(P,"");var ua=this.getChildCells(P,!0);for(H=0;H<ua.length;H++){var oa=this.getCellGeometry(ua[H]);null!=oa&&oa.relative&&0<oa.x&&this.model.remove(ua[H])}var ta=this.getChildCells(x,!0);for(H=0;H<ta.length;H++)oa=this.getCellGeometry(ta[H]),null!=oa&&oa.relative&&0>=oa.x&&this.model.remove(ta[H]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,null,[P]);this.setCellStyles(mxConstants.STYLE_ENDARROW,mxConstants.NONE,[P]);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,
null,[x]);this.setCellStyles(mxConstants.STYLE_STARTARROW,mxConstants.NONE,[x]);var Ea=this.model.getTerminal(P,!1);if(null!=Ea){var Fa=this.getCurrentCellStyle(Ea);null!=Fa&&"1"==Fa.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[x]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[x]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[P]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[P]))}}finally{this.model.endUpdate()}return P};var G=Graph.prototype.selectCell;Graph.prototype.selectCell=
function(x,H,P){if(H||P)G.apply(this,arguments);else{var X=this.getSelectionCell(),Z=null,fa=[],la=mxUtils.bind(this,function(za){if(null!=this.view.getState(za)&&(this.model.isVertex(za)||this.model.isEdge(za)))if(fa.push(za),za==X)Z=fa.length-1;else if(x&&null==X&&0<fa.length||null!=Z&&x&&fa.length>Z||!x&&0<Z)return;for(var ua=0;ua<this.model.getChildCount(za);ua++)la(this.model.getChildAt(za,ua))});la(this.model.root);0<fa.length&&(Z=null!=Z?mxUtils.mod(Z+(x?1:-1),fa.length):0,this.setSelectionCell(fa[Z]))}};
Graph.prototype.swapShapes=function(x,H,P,X,Z,fa,la){H=!1;if(!X&&null!=Z&&1==x.length&&(X=this.view.getState(Z),P=this.view.getState(x[0]),null!=X&&null!=P&&(null!=fa&&mxEvent.isShiftDown(fa)||"umlLifeline"==X.style.shape&&"umlLifeline"==P.style.shape)&&(X=this.getCellGeometry(Z),fa=this.getCellGeometry(x[0]),null!=X&&null!=fa))){H=X.clone();X=fa.clone();X.x=H.x;X.y=H.y;H.x=fa.x;H.y=fa.y;this.model.beginUpdate();try{this.model.setGeometry(Z,H),this.model.setGeometry(x[0],X)}finally{this.model.endUpdate()}H=
!0}return H};var M=Graph.prototype.moveCells;Graph.prototype.moveCells=function(x,H,P,X,Z,fa,la){if(this.swapShapes(x,H,P,X,Z,fa,la))return x;la=null!=la?la:{};if(this.isTable(Z)){for(var za=[],ua=0;ua<x.length;ua++)this.isTable(x[ua])?za=za.concat(this.model.getChildCells(x[ua],!0).reverse()):za.push(x[ua]);x=za}this.model.beginUpdate();try{za=[];for(ua=0;ua<x.length;ua++)if(null!=Z&&this.isTableRow(x[ua])){var oa=this.model.getParent(x[ua]),ta=this.getCellGeometry(x[ua]);this.isTable(oa)&&za.push(oa);
if(null!=oa&&null!=ta&&this.isTable(oa)&&this.isTable(Z)&&(X||oa!=Z)){if(!X){var Ea=this.getCellGeometry(oa);null!=Ea&&(Ea=Ea.clone(),Ea.height-=ta.height,this.model.setGeometry(oa,Ea))}Ea=this.getCellGeometry(Z);null!=Ea&&(Ea=Ea.clone(),Ea.height+=ta.height,this.model.setGeometry(Z,Ea));var Fa=this.model.getChildCells(Z,!0);if(0<Fa.length){x[ua]=X?this.cloneCell(x[ua]):x[ua];var Pa=this.model.getChildCells(x[ua],!0),Ra=this.model.getChildCells(Fa[0],!0),Ca=Ra.length-Pa.length;if(0<Ca)for(var Ja=
0;Ja<Ca;Ja++){var Qa=this.cloneCell(Pa[Pa.length-1]);null!=Qa&&(Qa.value="",this.model.add(x[ua],Qa))}else if(0>Ca)for(Ja=0;Ja>Ca;Ja--)this.model.remove(Pa[Pa.length+Ja-1]);Pa=this.model.getChildCells(x[ua],!0);for(Ja=0;Ja<Ra.length;Ja++){var $a=this.getCellGeometry(Ra[Ja]),eb=this.getCellGeometry(Pa[Ja]);null!=$a&&null!=eb&&(eb=eb.clone(),eb.width=$a.width,this.model.setGeometry(Pa[Ja],eb))}}}}var cb=M.apply(this,arguments);for(ua=0;ua<za.length;ua++)!X&&this.model.contains(za[ua])&&0==this.model.getChildCount(za[ua])&&
this.model.remove(za[ua]);X&&this.updateCustomLinks(this.createCellMapping(la,this.createCellLookup(x)),cb)}finally{this.model.endUpdate()}return cb};var Q=Graph.prototype.removeCells;Graph.prototype.removeCells=function(x,H){var P=[];this.model.beginUpdate();try{for(var X=0;X<x.length;X++)if(this.isTableCell(x[X])){var Z=this.model.getParent(x[X]),fa=this.model.getParent(Z);1==this.model.getChildCount(Z)&&1==this.model.getChildCount(fa)?0>mxUtils.indexOf(x,fa)&&0>mxUtils.indexOf(P,fa)&&P.push(fa):
this.labelChanged(x[X],"")}else{if(this.isTableRow(x[X])&&(fa=this.model.getParent(x[X]),0>mxUtils.indexOf(x,fa)&&0>mxUtils.indexOf(P,fa))){for(var la=this.model.getChildCells(fa,!0),za=0,ua=0;ua<la.length;ua++)0<=mxUtils.indexOf(x,la[ua])&&za++;za==la.length&&P.push(fa)}P.push(x[X])}P=Q.apply(this,[P,H])}finally{this.model.endUpdate()}return P};Graph.prototype.updateCustomLinks=function(x,H,P){P=null!=P?P:new Graph;for(var X=0;X<H.length;X++)null!=H[X]&&P.updateCustomLinksForCell(x,H[X],P)};Graph.prototype.updateCustomLinksForCell=
function(x,H){this.doUpdateCustomLinksForCell(x,H);for(var P=this.model.getChildCount(H),X=0;X<P;X++)this.updateCustomLinksForCell(x,this.model.getChildAt(H,X))};Graph.prototype.doUpdateCustomLinksForCell=function(x,H){};Graph.prototype.getAllConnectionConstraints=function(x,H){if(null!=x){H=mxUtils.getValue(x.style,"points",null);if(null!=H){x=[];try{var P=JSON.parse(H);for(H=0;H<P.length;H++){var X=P[H];x.push(new mxConnectionConstraint(new mxPoint(X[0],X[1]),2<X.length?"0"!=X[2]:!0,null,3<X.length?
X[3]:0,4<X.length?X[4]:0))}}catch(fa){}return x}if(null!=x.shape&&null!=x.shape.bounds){X=x.shape.direction;H=x.shape.bounds;var Z=x.shape.scale;P=H.width/Z;H=H.height/Z;if(X==mxConstants.DIRECTION_NORTH||X==mxConstants.DIRECTION_SOUTH)X=P,P=H,H=X;H=x.shape.getConstraints(x.style,P,H);if(null!=H)return H;if(null!=x.shape.stencil&&null!=x.shape.stencil.constraints)return x.shape.stencil.constraints;if(null!=x.shape.constraints)return x.shape.constraints}}return null};Graph.prototype.flipEdge=function(x){if(null!=
x){var H=this.getCurrentCellStyle(x);H=mxUtils.getValue(H,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,H,[x])}};Graph.prototype.isValidRoot=function(x){for(var H=this.model.getChildCount(x),P=0,X=0;X<H;X++){var Z=this.model.getChildAt(x,X);this.model.isVertex(Z)&&(Z=this.getCellGeometry(Z),null==Z||Z.relative||P++)}return 0<P||this.isContainer(x)};Graph.prototype.isValidDropTarget=
function(x,H,P){for(var X=this.getCurrentCellStyle(x),Z=!0,fa=!0,la=0;la<H.length&&fa;la++)Z=Z&&this.isTable(H[la]),fa=fa&&this.isTableRow(H[la]);return(1==H.length&&null!=P&&mxEvent.isShiftDown(P)&&!mxEvent.isControlDown(P)&&!mxEvent.isAltDown(P)||("1"!=mxUtils.getValue(X,"part","0")||this.isContainer(x))&&"0"!=mxUtils.getValue(X,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(x))&&!this.isTableRow(x)&&(!this.isTable(x)||fa||Z))&&!this.isCellLocked(x)};
Graph.prototype.createGroupCell=function(){var x=mxGraph.prototype.createGroupCell.apply(this,arguments);x.setStyle("group");return x};Graph.prototype.isExtendParentsOnAdd=function(x){var H=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(H&&null!=x&&null!=this.layoutManager){var P=this.model.getParent(x);null!=P&&(P=this.layoutManager.getLayout(P),null!=P&&P.constructor==mxStackLayout&&(H=!1))}return H};Graph.prototype.getPreferredSizeForCell=function(x){var H=mxGraph.prototype.getPreferredSizeForCell.apply(this,
arguments);null!=H&&(H.width+=10,H.height+=4,this.gridEnabled&&(H.width=this.snap(H.width),H.height=this.snap(H.height)));return H};Graph.prototype.turnShapes=function(x,H){var P=this.getModel(),X=[];P.beginUpdate();try{for(var Z=0;Z<x.length;Z++){var fa=x[Z];if(P.isEdge(fa)){var la=P.getTerminal(fa,!0),za=P.getTerminal(fa,!1);P.setTerminal(fa,za,!0);P.setTerminal(fa,la,!1);var ua=P.getGeometry(fa);if(null!=ua){ua=ua.clone();null!=ua.points&&ua.points.reverse();var oa=ua.getTerminalPoint(!0),ta=ua.getTerminalPoint(!1);
ua.setTerminalPoint(oa,!1);ua.setTerminalPoint(ta,!0);P.setGeometry(fa,ua);var Ea=this.view.getState(fa),Fa=this.view.getState(la),Pa=this.view.getState(za);if(null!=Ea){var Ra=null!=Fa?this.getConnectionConstraint(Ea,Fa,!0):null,Ca=null!=Pa?this.getConnectionConstraint(Ea,Pa,!1):null;this.setConnectionConstraint(fa,la,!0,Ca);this.setConnectionConstraint(fa,za,!1,Ra);var Ja=mxUtils.getValue(Ea.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,
mxUtils.getValue(Ea.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[fa]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,Ja,[fa])}X.push(fa)}}else if(P.isVertex(fa)&&(ua=this.getCellGeometry(fa),null!=ua)){if(!(this.isTable(fa)||this.isTableRow(fa)||this.isTableCell(fa)||this.isSwimlane(fa))){ua=ua.clone();ua.x+=ua.width/2-ua.height/2;ua.y+=ua.height/2-ua.width/2;var Qa=ua.width;ua.width=ua.height;ua.height=Qa;P.setGeometry(fa,ua)}var $a=this.view.getState(fa);if(null!=$a){var eb=
[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],cb=mxUtils.getValue($a.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,eb[mxUtils.mod(mxUtils.indexOf(eb,cb)+(H?-1:1),eb.length)],[fa])}X.push(fa)}}}finally{P.endUpdate()}return X};Graph.prototype.stencilHasPlaceholders=function(x){if(null!=x&&null!=x.fgNode)for(x=x.fgNode.firstChild;null!=x;){if("text"==x.nodeName&&"1"==x.getAttribute("placeholders"))return!0;
x=x.nextSibling}return!1};var e=Graph.prototype.processChange;Graph.prototype.processChange=function(x){if(x instanceof mxGeometryChange&&(this.isTableCell(x.cell)||this.isTableRow(x.cell))&&(null==x.previous&&null!=x.geometry||null!=x.previous&&!x.previous.equals(x.geometry))){var H=x.cell;this.isTableCell(H)&&(H=this.model.getParent(H));this.isTableRow(H)&&(H=this.model.getParent(H));var P=this.view.getState(H);null!=P&&null!=P.shape&&(this.view.invalidate(H),P.shape.bounds=null)}e.apply(this,arguments);
x instanceof mxValueChange&&null!=x.cell&&null!=x.cell.value&&"object"==typeof x.cell.value&&this.invalidateDescendantsWithPlaceholders(x.cell)};Graph.prototype.invalidateDescendantsWithPlaceholders=function(x){x=this.model.getDescendants(x);if(0<x.length)for(var H=0;H<x.length;H++){var P=this.view.getState(x[H]);null!=P&&null!=P.shape&&null!=P.shape.stencil&&this.stencilHasPlaceholders(P.shape.stencil)?this.removeStateForCell(x[H]):this.isReplacePlaceholders(x[H])&&this.view.invalidate(x[H],!1,!1)}};
Graph.prototype.replaceElement=function(x,H){H=x.ownerDocument.createElement(null!=H?H:"span");for(var P=Array.prototype.slice.call(x.attributes);attr=P.pop();)H.setAttribute(attr.nodeName,attr.nodeValue);H.innerHTML=x.innerHTML;x.parentNode.replaceChild(H,x)};Graph.prototype.processElements=function(x,H){if(null!=x){x=x.getElementsByTagName("*");for(var P=0;P<x.length;P++)H(x[P])}};Graph.prototype.updateLabelElements=function(x,H,P){x=null!=x?x:this.getSelectionCells();for(var X=document.createElement("div"),
Z=0;Z<x.length;Z++)if(this.isHtmlLabel(x[Z])){var fa=this.convertValueToString(x[Z]);if(null!=fa&&0<fa.length){X.innerHTML=fa;for(var la=X.getElementsByTagName(null!=P?P:"*"),za=0;za<la.length;za++)H(la[za]);X.innerHTML!=fa&&this.cellLabelChanged(x[Z],X.innerHTML)}}};Graph.prototype.cellLabelChanged=function(x,H,P){H=Graph.zapGremlins(H);this.model.beginUpdate();try{if(null!=x.value&&"object"==typeof x.value){if(this.isReplacePlaceholders(x)&&null!=x.getAttribute("placeholder"))for(var X=x.getAttribute("placeholder"),
Z=x;null!=Z;){if(Z==this.model.getRoot()||null!=Z.value&&"object"==typeof Z.value&&Z.hasAttribute(X)){this.setAttributeForCell(Z,X,H);break}Z=this.model.getParent(Z)}var fa=x.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&fa.hasAttribute("label_"+Graph.diagramLanguage)?fa.setAttribute("label_"+Graph.diagramLanguage,H):fa.setAttribute("label",H);H=fa}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(x){if(null!=
x){for(var H=new mxDictionary,P=0;P<x.length;P++)H.put(x[P],!0);var X=[];for(P=0;P<x.length;P++){var Z=this.model.getParent(x[P]);null==Z||H.get(Z)||(H.put(Z,!0),X.push(Z))}for(P=0;P<X.length;P++)if(Z=this.view.getState(X[P]),null!=Z&&(this.model.isEdge(Z.cell)||this.model.isVertex(Z.cell))&&this.isCellDeletable(Z.cell)&&this.isTransparentState(Z)){for(var fa=!0,la=0;la<this.model.getChildCount(Z.cell)&&fa;la++)H.get(this.model.getChildAt(Z.cell,la))||(fa=!1);fa&&x.push(Z.cell)}}mxGraph.prototype.cellsRemoved.apply(this,
arguments)};Graph.prototype.removeCellsAfterUngroup=function(x){for(var H=[],P=0;P<x.length;P++)this.isCellDeletable(x[P])&&this.isTransparentState(this.view.getState(x[P]))&&H.push(x[P]);x=H;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(x,H){this.setAttributeForCell(x,"link",H)};Graph.prototype.setTooltipForCell=function(x,H){var P="tooltip";Graph.translateDiagram&&null!=Graph.diagramLanguage&&mxUtils.isNode(x.value)&&x.value.hasAttribute("tooltip_"+
Graph.diagramLanguage)&&(P="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(x,P,H)};Graph.prototype.getAttributeForCell=function(x,H,P){x=null!=x.value&&"object"===typeof x.value?x.value.getAttribute(H):null;return null!=x?x:P};Graph.prototype.setAttributeForCell=function(x,H,P){if(null!=x.value&&"object"==typeof x.value)var X=x.value.cloneNode(!0);else X=mxUtils.createXmlDocument().createElement("UserObject"),X.setAttribute("label",x.value||"");null!=P?X.setAttribute(H,P):X.removeAttribute(H);
this.model.setValue(x,X)};var f=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(x,H,P,X){this.getModel();if(mxEvent.isAltDown(H))return null;for(var Z=0;Z<x.length;Z++){var fa=this.model.getParent(x[Z]);if(this.model.isEdge(fa)&&0>mxUtils.indexOf(x,fa))return null}fa=f.apply(this,arguments);var la=!0;for(Z=0;Z<x.length&&la;Z++)la=la&&this.isTableRow(x[Z]);la&&(this.isTableCell(fa)&&(fa=this.model.getParent(fa)),this.isTableRow(fa)&&(fa=this.model.getParent(fa)),this.isTable(fa)||
(fa=null));return fa};Graph.prototype.click=function(x){mxGraph.prototype.click.call(this,x);this.firstClickState=x.getState();this.firstClickSource=x.getSource()};Graph.prototype.dblClick=function(x,H){this.isEnabled()&&(H=this.insertTextForEvent(x,H),mxGraph.prototype.dblClick.call(this,x,H))};Graph.prototype.insertTextForEvent=function(x,H){var P=mxUtils.convertPoint(this.container,mxEvent.getClientX(x),mxEvent.getClientY(x));if(null!=x&&!this.model.isVertex(H)){var X=this.model.isEdge(H)?this.view.getState(H):
null,Z=mxEvent.getSource(x);this.firstClickState!=X||this.firstClickSource!=Z||null!=X&&null!=X.text&&null!=X.text.node&&null!=X.text.boundingBox&&(mxUtils.contains(X.text.boundingBox,P.x,P.y)||mxUtils.isAncestorNode(X.text.node,mxEvent.getSource(x)))||(null!=X||this.isCellLocked(this.getDefaultParent()))&&(null==X||this.isCellLocked(X.cell))||!(null!=X||mxClient.IS_SVG&&Z==this.view.getCanvas().ownerSVGElement)||(null==X&&(X=this.view.getState(this.getCellAt(P.x,P.y))),H=this.addText(P.x,P.y,X))}return H};
Graph.prototype.getInsertPoint=function(){var x=this.getGridSize(),H=this.container.scrollLeft/this.view.scale-this.view.translate.x,P=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var X=this.getPageLayout(),Z=this.getPageSize();H=Math.max(H,X.x*Z.width);P=Math.max(P,X.y*Z.height)}return new mxPoint(this.snap(H+x),this.snap(P+x))};Graph.prototype.getFreeInsertPoint=function(){var x=this.view,H=this.getGraphBounds(),P=this.getInsertPoint(),X=this.snap(Math.round(Math.max(P.x,
H.x/x.scale-x.translate.x+(0==H.width?2*this.gridSize:0))));x=this.snap(Math.round(Math.max(P.y,(H.y+H.height)/x.scale-x.translate.y+2*this.gridSize)));return new mxPoint(X,x)};Graph.prototype.getCenterInsertPoint=function(x){x=null!=x?x:new mxRectangle;return mxUtils.hasScrollbars(this.container)?new mxPoint(this.snap(Math.round((this.container.scrollLeft+this.container.clientWidth/2)/this.view.scale-this.view.translate.x-x.width/2)),this.snap(Math.round((this.container.scrollTop+this.container.clientHeight/
2)/this.view.scale-this.view.translate.y-x.height/2))):new mxPoint(this.snap(Math.round(this.container.clientWidth/2/this.view.scale-this.view.translate.x-x.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-x.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(x,H,P){var X=new mxCell;X.value="Text";X.geometry=new mxGeometry(0,0,0,0);X.vertex=!0;if(null!=P&&this.model.isEdge(P.cell)){X.style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];";
X.geometry.relative=!0;X.connectable=!1;var Z=this.view.getRelativePoint(P,x,H);X.geometry.x=Math.round(1E4*Z.x)/1E4;X.geometry.y=Math.round(Z.y);X.geometry.offset=new mxPoint(0,0);Z=this.view.getPoint(P,X.geometry);var fa=this.view.scale;X.geometry.offset=new mxPoint(Math.round((x-Z.x)/fa),Math.round((H-Z.y)/fa))}else Z=this.view.translate,X.style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];",X.geometry.width=40,X.geometry.height=20,X.geometry.x=Math.round(x/this.view.scale)-
Z.x-(null!=P?P.origin.x:0),X.geometry.y=Math.round(H/this.view.scale)-Z.y-(null!=P?P.origin.y:0),X.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([X],null!=P?P.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[X])),this.autoSizeCell(X)}finally{this.getModel().endUpdate()}return X};Graph.prototype.addClickHandler=function(x,H,P){var X=mxUtils.bind(this,function(){var ua=this.container.getElementsByTagName("a");if(null!=ua)for(var oa=0;oa<ua.length;oa++){var ta=
this.getAbsoluteUrl(ua[oa].getAttribute("href"));null!=ta&&(ua[oa].setAttribute("rel",this.linkRelation),ua[oa].setAttribute("href",ta),null!=H&&mxEvent.addGestureListeners(ua[oa],null,null,H))}});this.model.addListener(mxEvent.CHANGE,X);X();var Z=this.container.style.cursor,fa=this.getTolerance(),la=this,za={currentState:null,currentLink:null,currentTarget:null,highlight:null!=x&&""!=x&&x!=mxConstants.NONE?new mxCellHighlight(la,x,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(ua){var oa=
ua.sourceState;if(null==oa||null==la.getLinkForCell(oa.cell))ua=la.getCellAt(ua.getGraphX(),ua.getGraphY(),null,null,null,function(ta,Ea,Fa){return null==la.getLinkForCell(ta.cell)}),oa=null==oa||la.model.isAncestor(ua,oa.cell)?la.view.getState(ua):null;oa!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=oa,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(ua,oa){this.startX=oa.getGraphX();this.startY=oa.getGraphY();this.scrollLeft=la.container.scrollLeft;
this.scrollTop=la.container.scrollTop;null==this.currentLink&&"auto"==la.container.style.overflow&&(la.container.style.cursor="move");this.updateCurrentState(oa)},mouseMove:function(ua,oa){if(la.isMouseDown)null!=this.currentLink&&(ua=Math.abs(this.startX-oa.getGraphX()),oa=Math.abs(this.startY-oa.getGraphY()),(ua>fa||oa>fa)&&this.clear());else{for(ua=oa.getSource();null!=ua&&"a"!=ua.nodeName.toLowerCase();)ua=ua.parentNode;null!=ua?this.clear():(null!=la.tooltipHandler&&null!=this.currentLink&&null!=
this.currentState&&la.tooltipHandler.reset(oa,!0,this.currentState),(null==this.currentState||oa.getState()!=this.currentState&&null!=oa.sourceState||!la.intersects(this.currentState,oa.getGraphX(),oa.getGraphY()))&&this.updateCurrentState(oa))}},mouseUp:function(ua,oa){var ta=oa.getSource();for(ua=oa.getEvent();null!=ta&&"a"!=ta.nodeName.toLowerCase();)ta=ta.parentNode;null==ta&&Math.abs(this.scrollLeft-la.container.scrollLeft)<fa&&Math.abs(this.scrollTop-la.container.scrollTop)<fa&&(null==oa.sourceState||
!oa.isSource(oa.sourceState.control))&&((mxEvent.isLeftMouseButton(ua)||mxEvent.isMiddleMouseButton(ua))&&!mxEvent.isPopupTrigger(ua)||mxEvent.isTouchEvent(ua))&&(null!=this.currentLink?(ta=la.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&ta||null==H||H(ua,this.currentLink),mxEvent.isConsumed(ua)||(ua=null!=this.currentTarget?this.currentTarget:mxEvent.isMiddleMouseButton(ua)?"_blank":ta?la.linkTarget:"_top",la.openLink(this.currentLink,ua),oa.consume())):null!=P&&!oa.isConsumed()&&
Math.abs(this.scrollLeft-la.container.scrollLeft)<fa&&Math.abs(this.scrollTop-la.container.scrollTop)<fa&&Math.abs(this.startX-oa.getGraphX())<fa&&Math.abs(this.startY-oa.getGraphY())<fa&&P(oa.getEvent()));this.clear()},activate:function(ua){this.currentLink=la.getAbsoluteUrl(la.getLinkForCell(ua.cell));null!=this.currentLink&&(this.currentTarget=la.getLinkTargetForCell(ua.cell),la.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(ua))},clear:function(){null!=la.container&&
(la.container.style.cursor=Z);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=la.tooltipHandler&&la.tooltipHandler.hide()}};la.click=function(ua){};la.addMouseListener(za);mxEvent.addListener(document,"mouseleave",function(ua){za.clear()})};Graph.prototype.duplicateCells=function(x,H){x=null!=x?x:this.getSelectionCells();H=null!=H?H:!0;for(var P=0;P<x.length;P++)this.isTableCell(x[P])&&(x[P]=this.model.getParent(x[P]));x=this.model.getTopmostCells(x);
var X=this.getModel(),Z=this.gridSize,fa=[];X.beginUpdate();try{var la={},za=this.createCellLookup(x),ua=this.cloneCells(x,!1,la,!0);for(P=0;P<x.length;P++){var oa=X.getParent(x[P]);if(null!=oa){var ta=this.moveCells([ua[P]],Z,Z,!1)[0];fa.push(ta);if(H)X.add(oa,ua[P]);else{var Ea=oa.getIndex(x[P]);X.add(oa,ua[P],Ea+1)}if(this.isTable(oa)){var Fa=this.getCellGeometry(ua[P]),Pa=this.getCellGeometry(oa);null!=Fa&&null!=Pa&&(Pa=Pa.clone(),Pa.height+=Fa.height,X.setGeometry(oa,Pa))}}else fa.push(ua[P])}this.updateCustomLinks(this.createCellMapping(la,
za),ua,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",ua))}finally{X.endUpdate()}return fa};Graph.prototype.insertImage=function(x,H,P){if(null!=x&&null!=this.cellEditor.textarea){for(var X=this.cellEditor.textarea.getElementsByTagName("img"),Z=[],fa=0;fa<X.length;fa++)Z.push(X[fa]);document.execCommand("insertimage",!1,x);x=this.cellEditor.textarea.getElementsByTagName("img");if(x.length==Z.length+1)for(fa=x.length-1;0<=fa;fa--)if(0==fa||x[fa]!=Z[fa-1]){x[fa].setAttribute("width",
H);x[fa].setAttribute("height",P);break}}};Graph.prototype.insertLink=function(x){if(null!=this.cellEditor.textarea)if(0==x.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var H=this.cellEditor.textarea.getElementsByTagName("a"),P=[],X=0;X<H.length;X++)P.push(H[X]);document.execCommand("createlink",!1,mxUtils.trim(x));H=this.cellEditor.textarea.getElementsByTagName("a");if(H.length==P.length+1)for(X=H.length-1;0<=X;X--)if(H[X]!=P[X-1]){for(H=H[X].getElementsByTagName("a");0<H.length;){for(P=
H[0].parentNode;null!=H[0].firstChild;)P.insertBefore(H[0].firstChild,H[0]);P.removeChild(H[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(x))};Graph.prototype.isCellResizable=function(x){var H=mxGraph.prototype.isCellResizable.apply(this,arguments),P=this.getCurrentCellStyle(x);return!this.isTableCell(x)&&!this.isTableRow(x)&&(H||"0"!=mxUtils.getValue(P,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==P[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.distributeCells=function(x,H){null==
H&&(H=this.getSelectionCells());if(null!=H&&1<H.length){for(var P=[],X=null,Z=null,fa=0;fa<H.length;fa++)if(this.getModel().isVertex(H[fa])){var la=this.view.getState(H[fa]);if(null!=la){var za=x?la.getCenterX():la.getCenterY();X=null!=X?Math.max(X,za):za;Z=null!=Z?Math.min(Z,za):za;P.push(la)}}if(2<P.length){P.sort(function(Ea,Fa){return x?Ea.x-Fa.x:Ea.y-Fa.y});la=this.view.translate;za=this.view.scale;Z=Z/za-(x?la.x:la.y);X=X/za-(x?la.x:la.y);this.getModel().beginUpdate();try{var ua=(X-Z)/(P.length-
1);X=Z;for(fa=1;fa<P.length-1;fa++){var oa=this.view.getState(this.model.getParent(P[fa].cell)),ta=this.getCellGeometry(P[fa].cell);X+=ua;null!=ta&&null!=oa&&(ta=ta.clone(),x?ta.x=Math.round(X-ta.width/2)-oa.origin.x:ta.y=Math.round(X-ta.height/2)-oa.origin.y,this.getModel().setGeometry(P[fa].cell,ta))}}finally{this.getModel().endUpdate()}}}return H};Graph.prototype.isCloneEvent=function(x){return mxClient.IS_MAC&&mxEvent.isMetaDown(x)||mxEvent.isControlDown(x)};Graph.prototype.createSvgImageExport=
function(){var x=new mxImageExport;x.getLinkForCellState=mxUtils.bind(this,function(H,P){return this.getLinkForCell(H.cell)});return x};Graph.prototype.parseBackgroundImage=function(x){var H=null;null!=x&&0<x.length&&(x=JSON.parse(x),H=new mxImage(x.src,x.width,x.height));return H};Graph.prototype.getBackgroundImageObject=function(x){return x};Graph.prototype.getSvg=function(x,H,P,X,Z,fa,la,za,ua,oa,ta,Ea,Fa,Pa){var Ra=null;if(null!=Pa)for(Ra=new mxDictionary,ta=0;ta<Pa.length;ta++)Ra.put(Pa[ta],
!0);if(Pa=this.useCssTransforms)this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange();try{H=null!=H?H:1;P=null!=P?P:0;Z=null!=Z?Z:!0;fa=null!=fa?fa:!0;la=null!=la?la:!0;oa=null!=oa?oa:!1;var Ca="page"==Fa?this.view.getBackgroundPageBounds():fa&&null==Ra||X||"diagram"==Fa?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),Ja=this.view.scale;"diagram"==Fa&&null!=this.backgroundImage&&(Ca=mxRectangle.fromRectangle(Ca),Ca.add(new mxRectangle((this.view.translate.x+this.backgroundImage.x)*
Ja,(this.view.translate.y+this.backgroundImage.y)*Ja,this.backgroundImage.width*Ja,this.backgroundImage.height*Ja)));if(null==Ca)throw Error(mxResources.get("drawingEmpty"));X=H/Ja;Fa=Z?-.5:0;var Qa=Graph.createSvgNode(Fa,Fa,Math.max(1,Math.ceil(Ca.width*X)+2*P)+(oa&&0==P?5:0),Math.max(1,Math.ceil(Ca.height*X)+2*P)+(oa&&0==P?5:0),x),$a=Qa.ownerDocument,eb=null!=$a.createElementNS?$a.createElementNS(mxConstants.NS_SVG,"g"):$a.createElement("g");Qa.appendChild(eb);var cb=this.createSvgCanvas(eb);cb.foOffset=
Z?-.5:0;cb.textOffset=Z?-.5:0;cb.imageOffset=Z?-.5:0;cb.translate(Math.floor(P/H-Ca.x/Ja),Math.floor(P/H-Ca.y/Ja));var db=document.createElement("div"),rb=cb.getAlternateText;cb.getAlternateText=function(Za,fb,hb,qb,kb,ib,ub,ob,nb,wb,lb,gb,tb){if(null!=ib&&0<this.state.fontSize)try{mxUtils.isNode(ib)?ib=ib.innerText:(db.innerHTML=ib,ib=mxUtils.extractTextWithWhitespace(db.childNodes));for(var Cb=Math.ceil(2*qb/this.state.fontSize),xb=[],zb=0,pb=0;(0==Cb||zb<Cb)&&pb<ib.length;){var yb=ib.charCodeAt(pb);
if(10==yb||13==yb){if(0<zb)break}else xb.push(ib.charAt(pb)),255>yb&&zb++;pb++}xb.length<ib.length&&1<ib.length-xb.length&&(ib=mxUtils.trim(xb.join(""))+"...");return ib}catch(Ab){return rb.apply(this,arguments)}else return rb.apply(this,arguments)};var mb=this.backgroundImage;if(null!=mb){x=Ja/H;var vb=this.view.translate;Fa=new mxRectangle((mb.x+vb.x)*x,(mb.y+vb.y)*x,mb.width*x,mb.height*x);mxUtils.intersects(Ca,Fa)&&cb.image(mb.x+vb.x,mb.y+vb.y,mb.width,mb.height,mb.src,!0)}cb.scale(X);cb.textEnabled=
la;za=null!=za?za:this.createSvgImageExport();var Bb=za.drawCellState,Ya=za.getLinkForCellState;za.getLinkForCellState=function(Za,fb){var hb=Ya.apply(this,arguments);return null==hb||Za.view.graph.isCustomLink(hb)?null:hb};za.getLinkTargetForCellState=function(Za,fb){return Za.view.graph.getLinkTargetForCell(Za.cell)};za.drawCellState=function(Za,fb){for(var hb=Za.view.graph,qb=null!=Ra?Ra.get(Za.cell):hb.isCellSelected(Za.cell),kb=hb.model.getParent(Za.cell);!(fa&&null==Ra||qb)&&null!=kb;)qb=null!=
Ra?Ra.get(kb):hb.isCellSelected(kb),kb=hb.model.getParent(kb);if(fa&&null==Ra||qb)hb.view.redrawEnumerationState(Za),Bb.apply(this,arguments),this.doDrawShape(Za.secondLabel,fb)};za.drawState(this.getView().getState(this.model.root),cb);this.updateSvgLinks(Qa,ua,!0);this.addForeignObjectWarning(cb,Qa);return Qa}finally{Pa&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(x,H){if("0"!=urlParams["svg-warning"]&&0<H.getElementsByTagName("foreignObject").length){var P=
x.createElement("switch"),X=x.createElement("g");X.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var Z=x.createElement("a");Z.setAttribute("transform","translate(0,-5)");null==Z.setAttributeNS||H.ownerDocument!=document&&null==document.documentMode?(Z.setAttribute("xlink:href",Graph.foreignObjectWarningLink),Z.setAttribute("target","_blank")):(Z.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),Z.setAttributeNS(mxConstants.NS_XLINK,
"target","_blank"));x=x.createElement("text");x.setAttribute("text-anchor","middle");x.setAttribute("font-size","10px");x.setAttribute("x","50%");x.setAttribute("y","100%");mxUtils.write(x,Graph.foreignObjectWarningText);P.appendChild(X);Z.appendChild(x);P.appendChild(Z);H.appendChild(P)}};Graph.prototype.updateSvgLinks=function(x,H,P){x=x.getElementsByTagName("a");for(var X=0;X<x.length;X++)if(null==x[X].getAttribute("target")){var Z=x[X].getAttribute("href");null==Z&&(Z=x[X].getAttribute("xlink:href"));
null!=Z&&(null!=H&&/^https?:\/\//.test(Z)?x[X].setAttribute("target",H):P&&this.isCustomLink(Z)&&x[X].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(x){x=new mxSvgCanvas2D(x);x.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;x.pointerEvents=!0;return x};Graph.prototype.getSelectedElement=function(){var x=null;if(window.getSelection){var H=window.getSelection();H.getRangeAt&&H.rangeCount&&(x=H.getRangeAt(0).commonAncestorContainer)}else document.selection&&
(x=document.selection.createRange().parentElement());return x};Graph.prototype.getSelectedEditingElement=function(){for(var x=this.getSelectedElement();null!=x&&x.nodeType!=mxConstants.NODETYPE_ELEMENT;)x=x.parentNode;null!=x&&x==this.cellEditor.textarea&&1==this.cellEditor.textarea.children.length&&this.cellEditor.textarea.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&(x=this.cellEditor.textarea.firstChild);return x};Graph.prototype.getParentByName=function(x,H,P){for(;null!=x&&x.nodeName!=
H;){if(x==P)return null;x=x.parentNode}return x};Graph.prototype.getParentByNames=function(x,H,P){for(;null!=x&&!(0<=mxUtils.indexOf(H,x.nodeName));){if(x==P)return null;x=x.parentNode}return x};Graph.prototype.selectNode=function(x){var H=null;if(window.getSelection){if(H=window.getSelection(),H.getRangeAt&&H.rangeCount){var P=document.createRange();P.selectNode(x);H.removeAllRanges();H.addRange(P)}}else(H=document.selection)&&"Control"!=H.type&&(x=H.createRange(),x.collapse(!0),P=H.createRange(),
P.setEndPoint("StartToStart",x),P.select())};Graph.prototype.flipEdgePoints=function(x,H,P){var X=this.getCellGeometry(x);if(null!=X){X=X.clone();if(null!=X.points)for(var Z=0;Z<X.points.length;Z++)H?X.points[Z].x=P+(P-X.points[Z].x):X.points[Z].y=P+(P-X.points[Z].y);Z=function(fa){null!=fa&&(H?fa.x=P+(P-fa.x):fa.y=P+(P-fa.y))};Z(X.getTerminalPoint(!0));Z(X.getTerminalPoint(!1));this.model.setGeometry(x,X)}};Graph.prototype.flipChildren=function(x,H,P){this.model.beginUpdate();try{for(var X=this.model.getChildCount(x),
Z=0;Z<X;Z++){var fa=this.model.getChildAt(x,Z);if(this.model.isEdge(fa))this.flipEdgePoints(fa,H,P);else{var la=this.getCellGeometry(fa);null!=la&&(la=la.clone(),H?la.x=P+(P-la.x-la.width):la.y=P+(P-la.y-la.height),this.model.setGeometry(fa,la))}}}finally{this.model.endUpdate()}};Graph.prototype.flipCells=function(x,H){this.model.beginUpdate();try{x=this.model.getTopmostCells(x);for(var P=[],X=0;X<x.length;X++)if(this.model.isEdge(x[X])){var Z=this.view.getState(x[X]);null!=Z&&this.flipEdgePoints(x[X],
H,(H?Z.getCenterX():Z.getCenterY())/this.view.scale-(H?Z.origin.x:Z.origin.y)-(H?this.view.translate.x:this.view.translate.y))}else{var fa=this.getCellGeometry(x[X]);null!=fa&&this.flipChildren(x[X],H,H?fa.getCenterX()-fa.x:fa.getCenterY()-fa.y);P.push(x[X])}this.toggleCellStyles(H?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,P)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(x,H){var P=null;if(null!=x&&0<x.length){this.model.beginUpdate();try{for(var X=0;X<x.length;X++){var Z=
this.model.getParent(x[X]);if(this.isTable(Z)){var fa=this.getCellGeometry(x[X]),la=this.getCellGeometry(Z);null!=fa&&null!=la&&(la=la.clone(),la.height-=fa.height,this.model.setGeometry(Z,la))}}var za=this.selectParentAfterDelete?this.model.getParents(x):null;this.removeCells(x,H)}finally{this.model.endUpdate()}if(null!=za)for(P=[],X=0;X<za.length;X++)this.model.contains(za[X])&&(this.model.isVertex(za[X])||this.model.isEdge(za[X]))&&P.push(za[X])}return P};Graph.prototype.insertTableColumn=function(x,
H){var P=this.getModel();P.beginUpdate();try{var X=x,Z=0;if(this.isTableCell(x)){var fa=P.getParent(x);X=P.getParent(fa);Z=mxUtils.indexOf(P.getChildCells(fa,!0),x)}else this.isTableRow(x)?X=P.getParent(x):x=P.getChildCells(X,!0)[0],H||(Z=P.getChildCells(x,!0).length-1);var la=P.getChildCells(X,!0),za=Graph.minTableColumnWidth;for(x=0;x<la.length;x++){var ua=P.getChildCells(la[x],!0)[Z],oa=P.cloneCell(ua,!1),ta=this.getCellGeometry(oa);oa.value=null;oa.style=mxUtils.setStyle(mxUtils.setStyle(oa.style,
"rowspan",null),"colspan",null);if(null!=ta){null!=ta.alternateBounds&&(ta.width=ta.alternateBounds.width,ta.height=ta.alternateBounds.height,ta.alternateBounds=null);za=ta.width;var Ea=this.getCellGeometry(la[x]);null!=Ea&&(ta.height=Ea.height)}P.add(la[x],oa,Z+(H?0:1))}var Fa=this.getCellGeometry(X);null!=Fa&&(Fa=Fa.clone(),Fa.width+=za,P.setGeometry(X,Fa))}finally{P.endUpdate()}};Graph.prototype.deleteLane=function(x){var H=this.getModel();H.beginUpdate();try{var P=null;P="stackLayout"==this.getCurrentCellStyle(x).childLayout?
x:H.getParent(x);var X=H.getChildCells(P,!0);0==X.length?H.remove(P):(P==x&&(x=X[X.length-1]),H.remove(x))}finally{H.endUpdate()}};Graph.prototype.insertLane=function(x,H){var P=this.getModel();P.beginUpdate();try{var X=null;if("stackLayout"==this.getCurrentCellStyle(x).childLayout){X=x;var Z=P.getChildCells(X,!0);x=Z[H?0:Z.length-1]}else X=P.getParent(x);var fa=X.getIndex(x);x=P.cloneCell(x,!1);x.value=null;P.add(X,x,fa+(H?0:1))}finally{P.endUpdate()}};Graph.prototype.insertTableRow=function(x,H){var P=
this.getModel();P.beginUpdate();try{var X=x,Z=x;if(this.isTableCell(x))Z=P.getParent(x),X=P.getParent(Z);else if(this.isTableRow(x))X=P.getParent(x);else{var fa=P.getChildCells(X,!0);Z=fa[H?0:fa.length-1]}var la=P.getChildCells(Z,!0),za=X.getIndex(Z);Z=P.cloneCell(Z,!1);Z.value=null;var ua=this.getCellGeometry(Z);if(null!=ua){for(fa=0;fa<la.length;fa++){x=P.cloneCell(la[fa],!1);x.value=null;x.style=mxUtils.setStyle(mxUtils.setStyle(x.style,"rowspan",null),"colspan",null);var oa=this.getCellGeometry(x);
null!=oa&&(null!=oa.alternateBounds&&(oa.width=oa.alternateBounds.width,oa.height=oa.alternateBounds.height,oa.alternateBounds=null),oa.height=ua.height);Z.insert(x)}P.add(X,Z,za+(H?0:1));var ta=this.getCellGeometry(X);null!=ta&&(ta=ta.clone(),ta.height+=ua.height,P.setGeometry(X,ta))}}finally{P.endUpdate()}};Graph.prototype.deleteTableColumn=function(x){var H=this.getModel();H.beginUpdate();try{var P=x,X=x;this.isTableCell(x)&&(X=H.getParent(x));this.isTableRow(X)&&(P=H.getParent(X));var Z=H.getChildCells(P,
!0);if(0==Z.length)H.remove(P);else{this.isTableRow(X)||(X=Z[0]);var fa=H.getChildCells(X,!0);if(1>=fa.length)H.remove(P);else{var la=fa.length-1;this.isTableCell(x)&&(la=mxUtils.indexOf(fa,x));for(X=x=0;X<Z.length;X++){var za=H.getChildCells(Z[X],!0)[la];H.remove(za);var ua=this.getCellGeometry(za);null!=ua&&(x=Math.max(x,ua.width))}var oa=this.getCellGeometry(P);null!=oa&&(oa=oa.clone(),oa.width-=x,H.setGeometry(P,oa))}}}finally{H.endUpdate()}};Graph.prototype.deleteTableRow=function(x){var H=this.getModel();
H.beginUpdate();try{var P=x,X=x;this.isTableCell(x)&&(x=X=H.getParent(x));this.isTableRow(x)&&(P=H.getParent(X));var Z=H.getChildCells(P,!0);if(1>=Z.length)H.remove(P);else{this.isTableRow(X)||(X=Z[Z.length-1]);H.remove(X);x=0;var fa=this.getCellGeometry(X);null!=fa&&(x=fa.height);var la=this.getCellGeometry(P);null!=la&&(la=la.clone(),la.height-=x,H.setGeometry(P,la))}}finally{H.endUpdate()}};Graph.prototype.insertRow=function(x,H){for(var P=x.tBodies[0],X=P.rows[0].cells,Z=x=0;Z<X.length;Z++){var fa=
X[Z].getAttribute("colspan");x+=null!=fa?parseInt(fa):1}H=P.insertRow(H);for(Z=0;Z<x;Z++)mxUtils.br(H.insertCell(-1));return H.cells[0]};Graph.prototype.deleteRow=function(x,H){x.tBodies[0].deleteRow(H)};Graph.prototype.insertColumn=function(x,H){var P=x.tHead;if(null!=P)for(var X=0;X<P.rows.length;X++){var Z=document.createElement("th");P.rows[X].appendChild(Z);mxUtils.br(Z)}x=x.tBodies[0];for(P=0;P<x.rows.length;P++)X=x.rows[P].insertCell(H),mxUtils.br(X);return x.rows[0].cells[0<=H?H:x.rows[0].cells.length-
1]};Graph.prototype.deleteColumn=function(x,H){if(0<=H){x=x.tBodies[0].rows;for(var P=0;P<x.length;P++)x[P].cells.length>H&&x[P].deleteCell(H)}};Graph.prototype.pasteHtmlAtCaret=function(x){if(window.getSelection){var H=window.getSelection();if(H.getRangeAt&&H.rangeCount){H=H.getRangeAt(0);H.deleteContents();var P=document.createElement("div");P.innerHTML=x;x=document.createDocumentFragment();for(var X;X=P.firstChild;)lastNode=x.appendChild(X);H.insertNode(x)}}else(H=document.selection)&&"Control"!=
H.type&&H.createRange().pasteHTML(x)};Graph.prototype.createLinkForHint=function(x,H){function P(Z,fa){Z.length>fa&&(Z=Z.substring(0,Math.round(fa/2))+"..."+Z.substring(Z.length-Math.round(fa/4)));return Z}x=null!=x?x:"javascript:void(0);";if(null==H||0==H.length)H=this.isCustomLink(x)?this.getLinkTitle(x):x;var X=document.createElement("a");X.setAttribute("rel",this.linkRelation);X.setAttribute("href",this.getAbsoluteUrl(x));X.setAttribute("title",P(this.isCustomLink(x)?this.getLinkTitle(x):x,80));
null!=this.linkTarget&&X.setAttribute("target",this.linkTarget);mxUtils.write(X,P(H,40));this.isCustomLink(x)&&mxEvent.addListener(X,"click",mxUtils.bind(this,function(Z){this.customLinkClicked(x);mxEvent.consume(Z)}));return X};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(fa,la){this.popupMenuHandler.hideMenu()});var x=this.updateMouseEvent;this.updateMouseEvent=
function(fa){fa=x.apply(this,arguments);if(mxEvent.isTouchEvent(fa.getEvent())&&null==fa.getState()){var la=this.getCellAt(fa.graphX,fa.graphY);null!=la&&this.isSwimlane(la)&&this.hitsSwimlaneContent(la,fa.graphX,fa.graphY)||(fa.state=this.view.getState(la),null!=fa.state&&null!=fa.state.shape&&(this.container.style.cursor=fa.state.shape.node.style.cursor))}null==fa.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return fa};var H=!1,P=!1,X=!1,Z=this.fireMouseEvent;this.fireMouseEvent=
function(fa,la,za){fa==mxEvent.MOUSE_DOWN&&(la=this.updateMouseEvent(la),H=this.isCellSelected(la.getCell()),P=this.isSelectionEmpty(),X=this.popupMenuHandler.isMenuShowing());Z.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(fa,la){var za=mxEvent.isMouseEvent(la.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==la.getState()||!la.isSource(la.getState().control))&&(this.popupMenuHandler.popupTrigger||!X&&!za&&(P&&null==la.getCell()&&
this.isSelectionEmpty()||H&&this.isCellSelected(la.getCell())));za=!H||za?null:mxUtils.bind(this,function(ua){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()){var oa=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(la.getX()+oa.x+1,la.getY()+oa.y+1,ua,la.getEvent())}}),500)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[fa,la,za])})};mxCellEditor.prototype.isContentEditing=function(){var x=this.graph.view.getState(this.editingCell);return null!=x&&1==
x.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var x="";window.getSelection?x=window.getSelection():document.getSelection?x=document.getSelection():document.selection&&(x=document.selection.createRange().text);return""!=x};mxCellEditor.prototype.insertTab=function(x){var H=this.textarea.ownerDocument.defaultView.getSelection(),P=H.getRangeAt(0),
X="\t";if(null!=x)for(X="";0<x;)X+=" ",x--;x=document.createElement("span");x.style.whiteSpace="pre";x.appendChild(document.createTextNode(X));P.insertNode(x);P.setStartAfter(x);P.setEndAfter(x);H.removeAllRanges();H.addRange(P)};mxCellEditor.prototype.alignText=function(x,H){var P=null!=H&&mxEvent.isShiftDown(H);if(P||null!=window.getSelection&&null!=window.getSelection().containsNode){var X=!0;this.graph.processElements(this.textarea,function(Z){P||window.getSelection().containsNode(Z,!0)?(Z.removeAttribute("align"),
Z.style.textAlign=null):X=!1});X&&this.graph.cellEditor.setAlign(x)}document.execCommand("justify"+x.toLowerCase(),!1,null)};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var x=window.getSelection();if(x.getRangeAt&&x.rangeCount){for(var H=[],P=0,X=x.rangeCount;P<X;++P)H.push(x.getRangeAt(P));return H}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(x){try{if(x)if(window.getSelection){sel=
window.getSelection();sel.removeAllRanges();for(var H=0,P=x.length;H<P;++H)sel.addRange(x[H])}else document.selection&&x.select&&x.select()}catch(X){}};var k=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(x){null!=x.text&&(x.text.replaceLinefeeds="0"!=mxUtils.getValue(x.style,"nl2Br","1"));k.apply(this,arguments)};var z=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(x,H){this.isKeepFocusEvent(x)||!mxEvent.isAltDown(x.getEvent())?
z.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(x){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var t=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(x,H){x=this.graph.getStartEditingCell(x,H);t.apply(this,arguments);var P=this.graph.view.getState(x);this.textarea.className=null!=P&&1==P.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";
this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(x);P=this.graph.getModel().getParent(x);var X=this.graph.getCellGeometry(x);if(this.graph.getModel().isEdge(P)&&null!=X&&X.relative||this.graph.getModel().isEdge(x))this.textarea.style.outline=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_FF&&mxClient.IS_WIN?"gray dotted 1px":""};var B=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=function(x){function H(Z,fa){fa.originalNode=Z;Z=Z.firstChild;
for(var la=fa.firstChild;null!=Z&&null!=la;)H(Z,la),Z=Z.nextSibling,la=la.nextSibling;return fa}function P(Z,fa){if(null!=Z)if(fa.originalNode!=Z)X(Z);else for(Z=Z.firstChild,fa=fa.firstChild;null!=Z;){var la=Z.nextSibling;null==fa?X(Z):(P(Z,fa),fa=fa.nextSibling);Z=la}}function X(Z){for(var fa=Z.firstChild;null!=fa;){var la=fa.nextSibling;X(fa);fa=la}1==Z.nodeType&&("BR"===Z.nodeName||null!=Z.firstChild)||3==Z.nodeType&&0!=mxUtils.trim(mxUtils.getTextContent(Z)).length?(3==Z.nodeType&&mxUtils.setTextContent(Z,
mxUtils.getTextContent(Z).replace(/\n|\r/g,"")),1==Z.nodeType&&(Z.removeAttribute("style"),Z.removeAttribute("class"),Z.removeAttribute("width"),Z.removeAttribute("cellpadding"),Z.removeAttribute("cellspacing"),Z.removeAttribute("border"))):Z.parentNode.removeChild(Z)}B.apply(this,arguments);7!==document.documentMode&&8!==document.documentMode&&mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(Z){var fa=H(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,
function(){null!=this.textarea&&(0<=this.textarea.innerHTML.indexOf("<o:OfficeDocumentSettings>")||0<=this.textarea.innerHTML.indexOf("\x3c!--[if !mso]>")?P(this.textarea,fa):Graph.removePasteFormatting(this.textarea))}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var x=this.graph.view.getState(this.editingCell);if(null!=x){var H=null!=x&&"0"!=mxUtils.getValue(x.style,"nl2Br","1"),P=this.saveSelection();if(this.codeViewMode){za=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);
0<za.length&&"\n"==za.charAt(za.length-1)&&(za=za.substring(0,za.length-1));za=this.graph.sanitizeHtml(H?za.replace(/\n/g,"<br/>"):za,!0);this.textarea.className="mxCellEditor geContentEditable";ua=mxUtils.getValue(x.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);H=mxUtils.getValue(x.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var X=mxUtils.getValue(x.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),Z=(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,
0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,fa=(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,la=[];(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&la.push("underline");(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&la.push("line-through");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?
Math.round(ua*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ua)+"px";this.textarea.style.textDecoration=la.join(" ");this.textarea.style.fontWeight=Z?"bold":"normal";this.textarea.style.fontStyle=fa?"italic":"";this.textarea.style.fontFamily=H;this.textarea.style.textAlign=X;this.textarea.style.padding="0px";this.textarea.innerHTML!=za&&(this.textarea.innerHTML=za,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=
0<this.textarea.innerHTML.length));this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");var za=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(za=mxUtils.replaceTrailingNewlines(za,"<div><br></div>"));za=this.graph.sanitizeHtml(H?za.replace(/\n/g,"").replace(/&lt;br\s*.?&gt;/g,"<br>"):za,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var ua=mxConstants.DEFAULT_FONTSIZE;
this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ua*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ua)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.width="";this.textarea.style.padding="2px";this.textarea.innerHTML!=za&&(this.textarea.innerHTML=
za);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=P;this.resize()}};var I=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(x,H){if(null!=this.textarea)if(x=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=x){var P=x.view.scale;this.bounds=mxRectangle.fromRectangle(x);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*P;this.bounds.height=
60*P;var X=null!=x.text?x.text.margin:null;null==X&&(X=mxUtils.getAlignmentAsPoint(mxUtils.getValue(x.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(x.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=X.x*this.bounds.width;this.bounds.y+=X.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/P)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/P)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<
this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/P)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*P);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/P)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*P);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=
Math.round(this.bounds.y)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+P+","+P+")")}else this.textarea.style.height="",this.textarea.style.overflow="",I.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(x,H){if("0"==mxUtils.getValue(x.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var P=this.graph.getEditingValue(x.cell,H);"1"==mxUtils.getValue(x.style,"nl2Br",
"1")&&(P=P.replace(/\n/g,"<br/>"));return P=this.graph.sanitizeHtml(P,!0)};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(x){if("0"==mxUtils.getValue(x.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);var H=this.graph.sanitizeHtml(this.textarea.innerHTML,!0);return H="1"==mxUtils.getValue(x.style,"nl2Br","1")?H.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"):H.replace(/\r\n/g,"").replace(/\n/g,"")};var O=
mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(x){this.codeViewMode&&this.toggleViewMode();O.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(x){}};var J=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(x,H){this.graph.getModel().beginUpdate();try{J.apply(this,arguments),""==H&&this.graph.isCellDeletable(x.cell)&&0==this.graph.model.getChildCount(x.cell)&&
this.graph.isTransparentState(x)&&this.graph.removeCells([x.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(x){var H=mxUtils.getValue(x.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);null!=H&&H!=mxConstants.NONE||!(null!=x.cell.geometry&&0<x.cell.geometry.width)||0==mxUtils.getValue(x.style,mxConstants.STYLE_ROTATION,0)&&0!=mxUtils.getValue(x.style,mxConstants.STYLE_HORIZONTAL,1)||(H=mxUtils.getValue(x.style,mxConstants.STYLE_FILLCOLOR,
null));H==mxConstants.NONE&&(H=null);return H};mxCellEditor.prototype.getBorderColor=function(x){var H=mxUtils.getValue(x.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);null!=H&&H!=mxConstants.NONE||!(null!=x.cell.geometry&&0<x.cell.geometry.width)||0==mxUtils.getValue(x.style,mxConstants.STYLE_ROTATION,0)&&0!=mxUtils.getValue(x.style,mxConstants.STYLE_HORIZONTAL,1)||(H=mxUtils.getValue(x.style,mxConstants.STYLE_STROKECOLOR,null));H==mxConstants.NONE&&(H=null);return H};mxCellEditor.prototype.getMinimumSize=
function(x){var H=this.graph.getView().scale;return new mxRectangle(0,0,null==x.text?30:x.text.size*H+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(x,H){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(H.getEvent)};mxGraphView.prototype.formatUnitText=function(x){return x?d(x,this.unit):x};mxGraphHandler.prototype.updateHint=function(x){if(null!=this.pBounds&&(null!=this.shape||
this.livePreviewActive)){null==this.hint&&(this.hint=b(),this.graph.container.appendChild(this.hint));var H=this.graph.view.translate,P=this.graph.view.scale;x=this.roundLength((this.bounds.x+this.currentDx)/P-H.x);H=this.roundLength((this.bounds.y+this.currentDy)/P-H.y);P=this.graph.view.unit;this.hint.innerHTML=d(x,P)+", "+d(H,P);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+
Editor.hintOffset+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint),this.hint=null)};var y=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(x,H){y.apply(this,arguments);var P=this.graph.getCellStyle(x);if(null==P.childLayout){var X=this.graph.model.getParent(x),Z=null!=X?this.graph.getCellGeometry(X):null;if(null!=Z&&(P=this.graph.getCellStyle(X),"stackLayout"==P.childLayout)){var fa=parseFloat(mxUtils.getValue(P,
"stackBorder",mxStackLayout.prototype.border));P="1"==mxUtils.getValue(P,"horizontalStack","1");var la=this.graph.getActualStartSize(X);Z=Z.clone();P?Z.height=H.height+la.y+la.height+2*fa:Z.width=H.width+la.x+la.width+2*fa;this.graph.model.setGeometry(X,Z)}}};var ia=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function x(za){P.get(za)||(P.put(za,!0),Z.push(za))}for(var H=ia.apply(this,arguments),P=new mxDictionary,
X=this.graph.model,Z=[],fa=0;fa<H.length;fa++){var la=H[fa];this.graph.isTableCell(la)?x(X.getParent(X.getParent(la))):this.graph.isTableRow(la)&&x(X.getParent(la));x(la)}return Z};var da=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(x){var H=da.apply(this,arguments);H.stroke="#C0C0C0";H.strokewidth=1;return H};var ja=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(x){var H=
ja.apply(this,arguments);H.stroke="#C0C0C0";H.strokewidth=1;return H};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var x=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+x.x/2,this.bounds.y+this.rotationHandleVSpacing-x.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(x,H){return this.graph.isRecursiveVertexResize(x)&&!mxEvent.isAltDown(H.getEvent())};mxVertexHandler.prototype.isCenteredEvent=
function(x,H){return mxEvent.isControlDown(H.getEvent())||mxEvent.isMetaDown(H.getEvent())};var aa=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return aa.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):
this.bounds};var qa=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return qa.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var sa=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(x){return x.tableHandle||sa.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=
function(){var x=0;this.graph.isTableRow(this.state.cell)?x=1:this.graph.isTableCell(this.state.cell)&&(x=2);return x};var L=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return L.apply(this,arguments).grow(-this.getSelectionBorderInset())};var V=null,T=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==V&&(V=mxCellRenderer.defaultShapes.tableLine);var x=T.apply(this,arguments);
if(this.graph.isTable(this.state.cell)){var H=function(Ra,Ca,Ja){for(var Qa=[],$a=0;$a<Ra.length;$a++){var eb=Ra[$a];Qa.push(null==eb?null:new mxPoint((ua+eb.x+Ca)*fa,(oa+eb.y+Ja)*fa))}return Qa},P=this,X=this.graph,Z=X.model,fa=X.view.scale,la=this.state,za=this.selectionBorder,ua=this.state.origin.x+X.view.translate.x,oa=this.state.origin.y+X.view.translate.y;null==x&&(x=[]);var ta=X.view.getCellStates(Z.getChildCells(this.state.cell,!0));if(0<ta.length){var Ea=Z.getChildCells(ta[0].cell,!0),Fa=
X.getTableLines(this.state.cell,!1,!0),Pa=X.getTableLines(this.state.cell,!0,!1);for(Z=0;Z<ta.length;Z++)mxUtils.bind(this,function(Ra){var Ca=ta[Ra],Ja=Ra<ta.length-1?ta[Ra+1]:null;Ja=null!=Ja?X.getCellGeometry(Ja.cell):null;var Qa=null!=Ja&&null!=Ja.alternateBounds?Ja.alternateBounds:Ja;Ja=null!=Pa[Ra]?new V(Pa[Ra],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Ja.isDashed=za.isDashed;Ja.svgStrokeTolerance++;Ca=new mxHandle(Ca,"row-resize",null,Ja);Ca.tableHandle=!0;var $a=
0;Ca.shape.node.parentNode.insertBefore(Ca.shape.node,Ca.shape.node.parentNode.firstChild);Ca.redraw=function(){if(null!=this.shape){this.shape.stroke=0==$a?mxConstants.NONE:za.stroke;if(this.shape.constructor==V)this.shape.line=H(Pa[Ra],0,$a),this.shape.updateBoundsFromLine();else{var cb=X.getActualStartSize(la.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+$a*fa;this.shape.bounds.x=la.x+(Ra==ta.length-1?0:cb.x*fa);this.shape.bounds.width=la.width-(Ra==ta.length-
1?0:cb.width+cb.x+fa)}this.shape.redraw()}};var eb=!1;Ca.setPosition=function(cb,db,rb){$a=Math.max(Graph.minTableRowHeight-cb.height,db.y-cb.y-cb.height);eb=mxEvent.isShiftDown(rb.getEvent());null!=Qa&&eb&&($a=Math.min($a,Qa.height-Graph.minTableRowHeight))};Ca.execute=function(cb){if(0!=$a)X.setTableRowHeight(this.state.cell,$a,!eb);else if(!P.blockDelayedSelection){var db=X.getCellAt(cb.getGraphX(),cb.getGraphY())||la.cell;X.graphHandler.selectCellForEvent(db,cb)}$a=0};Ca.reset=function(){$a=0};
x.push(Ca)})(Z);for(Z=0;Z<Ea.length;Z++)mxUtils.bind(this,function(Ra){var Ca=X.view.getState(Ea[Ra]),Ja=X.getCellGeometry(Ea[Ra]),Qa=null!=Ja.alternateBounds?Ja.alternateBounds:Ja;null==Ca&&(Ca=new mxCellState(X.view,Ea[Ra],X.getCellStyle(Ea[Ra])),Ca.x=la.x+Ja.x*fa,Ca.y=la.y+Ja.y*fa,Ca.width=Qa.width*fa,Ca.height=Qa.height*fa,Ca.updateCachedBounds());Ja=Ra<Ea.length-1?Ea[Ra+1]:null;Ja=null!=Ja?X.getCellGeometry(Ja):null;var $a=null!=Ja&&null!=Ja.alternateBounds?Ja.alternateBounds:Ja;Ja=null!=Fa[Ra]?
new V(Fa[Ra],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Ja.isDashed=za.isDashed;Ja.svgStrokeTolerance++;Ca=new mxHandle(Ca,"col-resize",null,Ja);Ca.tableHandle=!0;var eb=0;Ca.shape.node.parentNode.insertBefore(Ca.shape.node,Ca.shape.node.parentNode.firstChild);Ca.redraw=function(){if(null!=this.shape){this.shape.stroke=0==eb?mxConstants.NONE:za.stroke;if(this.shape.constructor==V)this.shape.line=H(Fa[Ra],eb,0),this.shape.updateBoundsFromLine();else{var db=X.getActualStartSize(la.cell,
!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(Qa.width+eb)*fa;this.shape.bounds.y=la.y+(Ra==Ea.length-1?0:db.y*fa);this.shape.bounds.height=la.height-(Ra==Ea.length-1?0:(db.height+db.y)*fa)}this.shape.redraw()}};var cb=!1;Ca.setPosition=function(db,rb,mb){eb=Math.max(Graph.minTableColumnWidth-Qa.width,rb.x-db.x-Qa.width);cb=mxEvent.isShiftDown(mb.getEvent());null==$a||cb||(eb=Math.min(eb,$a.width-Graph.minTableColumnWidth))};Ca.execute=function(db){if(0!=eb)X.setTableColumnWidth(this.state.cell,
eb,cb);else if(!P.blockDelayedSelection){var rb=X.getCellAt(db.getGraphX(),db.getGraphY())||la.cell;X.graphHandler.selectCellForEvent(rb,db)}eb=0};Ca.positionChanged=function(){};Ca.reset=function(){eb=0};x.push(Ca)})(Z)}}return null!=x?x.reverse():null};var Y=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(x){Y.apply(this,arguments);if(null!=this.moveHandles)for(var H=0;H<this.moveHandles.length;H++)this.moveHandles[H].style.visibility=x?"":"hidden";
if(null!=this.cornerHandles)for(H=0;H<this.cornerHandles.length;H++)this.cornerHandles[H].node.style.visibility=x?"":"hidden"};mxVertexHandler.prototype.refreshMoveHandles=function(){var x=this.graph.model;if(null!=this.moveHandles){for(var H=0;H<this.moveHandles.length;H++)this.moveHandles[H].parentNode.removeChild(this.moveHandles[H]);this.moveHandles=null}this.moveHandles=[];for(H=0;H<x.getChildCount(this.state.cell);H++)mxUtils.bind(this,function(P){if(null!=P&&x.isVertex(P.cell)){var X=mxUtils.createImage(Editor.rowMoveImage);
X.style.position="absolute";X.style.cursor="pointer";X.style.width="7px";X.style.height="4px";X.style.padding="4px 2px 4px 2px";X.rowState=P;mxEvent.addGestureListeners(X,mxUtils.bind(this,function(Z){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(Z)&&this.graph.isCellSelected(P.cell)||this.graph.selectCellForEvent(P.cell,Z);mxEvent.isPopupTrigger(Z)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(Z),mxEvent.getClientY(Z),this.graph.getSelectionCells()),
this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(Z),this.graph.isMouseDown=!0);mxEvent.consume(Z)}),null,mxUtils.bind(this,function(Z){mxEvent.isPopupTrigger(Z)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(Z),mxEvent.getClientY(Z),P.cell,Z),mxEvent.consume(Z))}));this.moveHandles.push(X);this.graph.container.appendChild(X)}})(this.graph.view.getState(x.getChildAt(this.state.cell,H)))};mxVertexHandler.prototype.refresh=function(){if(null!=this.customHandles){for(var x=
0;x<this.customHandles.length;x++)this.customHandles[x].destroy();this.customHandles=this.createCustomHandles()}this.graph.isTable(this.state.cell)&&this.refreshMoveHandles()};var W=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var x=new mxPoint(0,0),H=this.tolerance,P=this.state.style.shape;null==mxCellRenderer.defaultShapes[P]&&mxStencilRegistry.getStencil(P);P=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;
if(!P&&null!=this.customHandles)for(var X=0;X<this.customHandles.length;X++)if(null!=this.customHandles[X].shape&&null!=this.customHandles[X].shape.bounds){var Z=this.customHandles[X].shape.bounds,fa=Z.getCenterX(),la=Z.getCenterY();if(Math.abs(this.state.x-fa)<Z.width/2||Math.abs(this.state.y-la)<Z.height/2||Math.abs(this.state.x+this.state.width-fa)<Z.width/2||Math.abs(this.state.y+this.state.height-la)<Z.height/2){P=!0;break}}P&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(H/=
2,this.graph.isTable(this.state.cell)&&(H+=7),x.x=this.sizers[0].bounds.width+H,x.y=this.sizers[0].bounds.height+H):x=W.apply(this,arguments);return x};mxVertexHandler.prototype.updateHint=function(x){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"&deg;";else{x=this.state.view.scale;var H=this.state.view.unit;this.hint.innerHTML=d(this.roundLength(this.bounds.width/
x),H)+" x "+d(this.roundLength(this.bounds.height/x),H)}x=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==x&&(x=this.bounds);this.hint.style.left=x.x+Math.round((x.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=x.y+x.height+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);
null!=this.linkHint&&(this.linkHint.style.display="")};var ka=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(x,H){ka.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};var q=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(x,H){q.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&(this.linkHint.style.display=
"")};mxEdgeHandler.prototype.updateHint=function(x,H){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var P=this.graph.view.translate,X=this.graph.view.scale,Z=this.roundLength(H.x/X-P.x);P=this.roundLength(H.y/X-P.y);X=this.graph.view.unit;this.hint.innerHTML=d(Z,X)+", "+d(P,X);this.hint.style.visibility="visible";if(this.isSource||this.isTarget)null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(Z=this.constraintHandler.currentConstraint.point,
this.hint.innerHTML="["+Math.round(100*Z.x)+"%, "+Math.round(100*Z.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(x.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(x.getGraphY(),H.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.prototype.expandedImage=Graph.createSvgImage(9,9,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>');
Graph.prototype.collapsedImage=Graph.createSvgImage(9,9,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>');mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=
Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');
HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'+
HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',
24,24);mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="'+HoverIcons.prototype.arrowFill+'"/>');mxVertexHandler.TABLE_HANDLE_COLOR="#fca000";mxVertexHandler.prototype.handleImage=HoverIcons.prototype.mainHandle;mxVertexHandler.prototype.secondaryHandleImage=HoverIcons.prototype.secondaryHandle;mxEdgeHandler.prototype.handleImage=HoverIcons.prototype.mainHandle;
mxEdgeHandler.prototype.endHandleImage=HoverIcons.prototype.endMainHandle;mxEdgeHandler.prototype.terminalHandleImage=HoverIcons.prototype.terminalHandle;mxEdgeHandler.prototype.endTerminalHandleImage=HoverIcons.prototype.endTerminalHandle;mxEdgeHandler.prototype.fixedHandleImage=HoverIcons.prototype.fixedHandle;mxEdgeHandler.prototype.endFixedHandleImage=HoverIcons.prototype.endFixedHandle;mxEdgeHandler.prototype.labelHandleImage=HoverIcons.prototype.secondaryHandle;mxOutline.prototype.sizerImage=
HoverIcons.prototype.mainHandle;null!=window.Sidebar&&(Sidebar.prototype.triangleUp=HoverIcons.prototype.triangleUp,Sidebar.prototype.triangleRight=HoverIcons.prototype.triangleRight,Sidebar.prototype.triangleDown=HoverIcons.prototype.triangleDown,Sidebar.prototype.triangleLeft=HoverIcons.prototype.triangleLeft,Sidebar.prototype.refreshTarget=HoverIcons.prototype.refreshTarget,Sidebar.prototype.roundDrop=HoverIcons.prototype.roundDrop);mxVertexHandler.prototype.rotationEnabled=!0;mxVertexHandler.prototype.manageSizers=
!0;mxVertexHandler.prototype.livePreview=!0;mxGraphHandler.prototype.maxLivePreview=16;mxRubberband.prototype.defaultOpacity=30;mxConnectionHandler.prototype.outlineConnect=!0;mxCellHighlight.prototype.keepOnTop=!0;mxVertexHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.dblClickRemoveEnabled=!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=
!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;mxEdgeHandler.prototype.isAddVirtualBendEvent=function(x){return!mxEvent.isShiftDown(x.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(x){return!mxEvent.isShiftDown(x.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=
12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(x){return mxEvent.isMouseEvent(x.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(x){var H=x.getEvent();return null==x.getState()&&!mxEvent.isMouseEvent(H)||mxEvent.isPopupTrigger(H)&&(null==x.getState()||mxEvent.isControlDown(H)||mxEvent.isShiftDown(H))};var F=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=
function(x,H){F.apply(this,arguments);mxEvent.isTouchEvent(H.getEvent())&&this.graph.isCellSelected(H.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)}}else mxPanningHandler.prototype.isPanningTrigger=function(x){var H=x.getEvent();return mxEvent.isLeftMouseButton(H)&&(this.useLeftButtonForPanning&&null==x.getState()||mxEvent.isControlDown(H)&&!mxEvent.isShiftDown(H))||this.usePopupTrigger&&mxEvent.isPopupTrigger(H)};mxRubberband.prototype.isSpaceEvent=function(x){return this.graph.isEnabled()&&
!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(x.getEvent())||mxEvent.isMetaDown(x.getEvent()))&&mxEvent.isShiftDown(x.getEvent())&&mxEvent.isAltDown(x.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(x,H){if(this.cancelled)this.cancelled=!1,H.consume();else{var P=null!=this.div&&"none"!=this.div.style.display,X=null,Z=null,fa=x=null;
null!=this.first&&null!=this.currentX&&null!=this.currentY&&(X=this.first.x,Z=this.first.y,x=(this.currentX-X)/this.graph.view.scale,fa=(this.currentY-Z)/this.graph.view.scale,mxEvent.isAltDown(H.getEvent())||(x=this.graph.snap(x),fa=this.graph.snap(fa),this.graph.isGridEnabled()||(Math.abs(x)<this.graph.tolerance&&(x=0),Math.abs(fa)<this.graph.tolerance&&(fa=0))));this.reset();if(P){if(this.isSpaceEvent(H)){this.graph.model.beginUpdate();try{var la=this.graph.getCellsBeyond(X,Z,this.graph.getDefaultParent(),
!0,!0);for(P=0;P<la.length;P++)if(this.graph.isCellMovable(la[P])){var za=this.graph.view.getState(la[P]),ua=this.graph.getCellGeometry(la[P]);null!=za&&null!=ua&&(ua=ua.clone(),ua.translate(x,fa),this.graph.model.setGeometry(la[P],ua))}}finally{this.graph.model.endUpdate()}}else la=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(la,H.getEvent());H.consume()}}};mxRubberband.prototype.mouseMove=function(x,H){if(!H.isConsumed()&&null!=this.first){var P=mxUtils.getScrollOrigin(this.graph.container);
x=mxUtils.getOffset(this.graph.container);P.x-=x.x;P.y-=x.y;x=H.getX()+P.x;P=H.getY()+P.y;var X=this.first.x-x,Z=this.first.y-P,fa=this.graph.tolerance;if(null!=this.div||Math.abs(X)>fa||Math.abs(Z)>fa)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(x,P),this.isSpaceEvent(H)?(x=this.x+this.width,P=this.y+this.height,X=this.graph.view.scale,mxEvent.isAltDown(H.getEvent())||(this.width=this.graph.snap(this.width/X)*X,this.height=this.graph.snap(this.height/X)*X,this.graph.isGridEnabled()||
(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=x-this.width),this.y<this.first.y&&(this.y=P-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",
null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&
(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),H.consume()}};var S=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);S.apply(this,arguments)};var ba=(new Date).getTime(),U=0,ca=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(x,H,P,X){ca.apply(this,arguments);P!=this.currentTerminalState?(ba=(new Date).getTime(),
U=0):U=(new Date).getTime()-ba;this.currentTerminalState=P};var ea=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(x){return mxEvent.isShiftDown(x.getEvent())&&mxEvent.isAltDown(x.getEvent())?!1:null!=this.currentTerminalState&&x.getState()==this.currentTerminalState&&2E3<U||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&ea.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=
function(x,H,P){H=null!=x&&0==x;var X=this.state.getVisibleTerminalState(H);x=null!=x&&(0==x||x>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==x)?this.graph.getConnectionConstraint(this.state,X,H):null;P=null!=(null!=x?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(H),x):null)?P?this.endFixedHandleImage:this.fixedHandleImage:null!=x&&null!=X?P?this.endTerminalHandleImage:this.terminalHandleImage:P?this.endHandleImage:this.handleImage;if(null!=P)return P=
new mxImageShape(new mxRectangle(0,0,P.width,P.height),P.src),P.preserveImageAspect=!1,P;P=mxConstants.HANDLE_SIZE;this.preferHtml&&--P;return new mxRectangleShape(new mxRectangle(0,0,P,P),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var na=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(x,H,P){this.handleImage=H==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:H==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;
return na.apply(this,arguments)};var ra=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(x){if(null!=x&&1==x.length){var H=this.graph.getModel(),P=H.getParent(x[0]),X=this.graph.getCellGeometry(x[0]);if(H.isEdge(P)&&null!=X&&X.relative&&(H=this.graph.view.getState(x[0]),null!=H&&2>H.width&&2>H.height&&null!=H.text&&null!=H.text.boundingBox))return mxRectangle.fromRectangle(H.text.boundingBox)}return ra.apply(this,arguments)};var ya=mxGraphHandler.prototype.getGuideStates;
mxGraphHandler.prototype.getGuideStates=function(){for(var x=ya.apply(this,arguments),H=[],P=0;P<x.length;P++)"1"!=mxUtils.getValue(x[P].style,"part","0")&&H.push(x[P]);return H};var va=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(x){var H=this.graph.getModel(),P=H.getParent(x.cell),X=this.graph.getCellGeometry(x.cell);return H.isEdge(P)&&null!=X&&X.relative&&2>x.width&&2>x.height&&null!=x.text&&null!=x.text.boundingBox?(H=x.text.unrotatedBoundingBox||
x.text.boundingBox,new mxRectangle(Math.round(H.x),Math.round(H.y),Math.round(H.width),Math.round(H.height))):va.apply(this,arguments)};var Da=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(x,H){var P=this.graph.getModel(),X=P.getParent(this.state.cell),Z=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(H)==mxEvent.ROTATION_HANDLE||!P.isEdge(X)||null==Z||!Z.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&Da.apply(this,arguments)};
mxVertexHandler.prototype.rotateClick=function(){var x=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),H=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&x==mxConstants.NONE&&H==mxConstants.NONE?(x=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,x,[this.state.cell])):this.state.view.graph.turnShapes([this.state.cell])};
var pa=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(x,H){pa.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var Aa=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(x,H){Aa.apply(this,arguments);null!=this.rotationShape&&null!=
this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&(this.linkHint.style.display="");this.blockDelayedSelection=null};var xa=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){xa.apply(this,arguments);var x=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));if(this.graph.isTable(this.state.cell))this.refreshMoveHandles();
else if(1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell))){this.cornerHandles=[];for(var H=0;4>H;H++){var P=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);P.dialect=mxConstants.DIALECT_SVG;P.init(this.graph.view.getOverlayPane());this.cornerHandles.push(P)}}var X=mxUtils.bind(this,function(){null!=this.specialHandle&&(this.specialHandle.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<
this.graph.graphHandler.maxCells?"":"none");this.redrawHandles()});this.changeHandler=mxUtils.bind(this,function(Z,fa){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));X()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.changeHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);this.editingHandler=mxUtils.bind(this,function(Z,fa){this.redrawHandles()});this.graph.addListener(mxEvent.EDITING_STOPPED,this.editingHandler);
H=this.graph.getLinkForCell(this.state.cell);P=this.graph.getLinksForState(this.state);this.updateLinkHint(H,P);if(null!=H||null!=P&&0<P.length)x=!0;x&&this.redrawHandles()};mxVertexHandler.prototype.updateLinkHint=function(x,H){try{if(null==x&&(null==H||0==H.length)||1<this.graph.getSelectionCount())null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=x||null!=H&&0<H.length){null==this.linkHint&&(this.linkHint=b(),this.linkHint.style.padding=
"6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=x&&(this.linkHint.appendChild(this.graph.createLinkForHint(x)),this.graph.isEnabled()&&"function"===typeof this.graph.editLink)){var P=document.createElement("img");P.className="geAdaptiveAsset";P.setAttribute("src",Editor.editImage);
P.setAttribute("title",mxResources.get("editLink"));P.setAttribute("width","11");P.setAttribute("height","11");P.style.marginLeft="10px";P.style.marginBottom="-1px";P.style.cursor="pointer";this.linkHint.appendChild(P);mxEvent.addListener(P,"click",mxUtils.bind(this,function(fa){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(fa)}));var X=P.cloneNode(!0);X.setAttribute("src",Editor.trashImage);X.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));
X.style.marginLeft="4px";this.linkHint.appendChild(X);mxEvent.addListener(X,"click",mxUtils.bind(this,function(fa){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(fa)}))}if(null!=H)for(P=0;P<H.length;P++){var Z=document.createElement("div");Z.style.marginTop=null!=x||0<P?"6px":"0px";Z.appendChild(this.graph.createLinkForHint(H[P].getAttribute("href"),mxUtils.getTextContent(H[P])));this.linkHint.appendChild(Z)}}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(fa){}};mxEdgeHandler.prototype.updateLinkHint=
mxVertexHandler.prototype.updateLinkHint;var Ma=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){Ma.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var x=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.labelShape&&(this.labelShape.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<
this.graph.graphHandler.maxCells?"":"none")});this.changeHandler=mxUtils.bind(this,function(X,Z){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));x();this.redrawHandles()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.changeHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);var H=this.graph.getLinkForCell(this.state.cell),P=this.graph.getLinksForState(this.state);if(null!=H||null!=P&&0<P.length)this.updateLinkHint(H,
P),this.redrawHandles()};var Oa=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){Oa.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var Na=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var x=0;x<this.moveHandles.length;x++)this.moveHandles[x].style.left=this.moveHandles[x].rowState.x+this.moveHandles[x].rowState.width-
5+"px",this.moveHandles[x].style.top=this.moveHandles[x].rowState.y+this.moveHandles[x].rowState.height/2-6+"px";if(null!=this.cornerHandles){x=this.getSelectionBorderInset();var H=this.cornerHandles,P=H[0].bounds.height/2;H[0].bounds.x=this.state.x-H[0].bounds.width/2+x;H[0].bounds.y=this.state.y-P+x;H[0].redraw();H[1].bounds.x=H[0].bounds.x+this.state.width-2*x;H[1].bounds.y=H[0].bounds.y;H[1].redraw();H[2].bounds.x=H[0].bounds.x;H[2].bounds.y=this.state.y+this.state.height-2*x;H[2].redraw();H[3].bounds.x=
H[1].bounds.x;H[3].bounds.y=H[2].bounds.y;H[3].redraw();for(x=0;x<this.cornerHandles.length;x++)this.cornerHandles[x].node.style.display=1==this.graph.getSelectionCount()?"":"none"}null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=null!=this.moveHandles||1!=this.graph.getSelectionCount()||null!=this.index&&this.index!=mxEvent.ROTATION_HANDLE?"none":"");Na.apply(this);null!=this.state&&null!=this.linkHint&&(x=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),
H=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),P=mxUtils.getBoundingBox(H,this.state.style[mxConstants.STYLE_ROTATION]||"0",x),x=null!=P?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,H=null!=this.state.text?this.state.text.boundingBox:null,null==P&&(P=this.state),P=P.y+P.height,null!=H&&(P=Math.max(P,H.y+H.height)),this.linkHint.style.left=Math.max(0,Math.round(x.x+(x.width-this.linkHint.clientWidth)/2))+"px",
this.linkHint.style.top=Math.round(P+this.verticalOffset/2+Editor.hintOffset)+"px")};var La=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){La.apply(this,arguments);if(null!=this.moveHandles){for(var x=0;x<this.moveHandles.length;x++)null!=this.moveHandles[x]&&null!=this.moveHandles[x].parentNode&&this.moveHandles[x].parentNode.removeChild(this.moveHandles[x]);this.moveHandles=null}if(null!=this.cornerHandles){for(x=0;x<this.cornerHandles.length;x++)null!=this.cornerHandles[x]&&
null!=this.cornerHandles[x].node&&null!=this.cornerHandles[x].node.parentNode&&this.cornerHandles[x].node.parentNode.removeChild(this.cornerHandles[x].node);this.cornerHandles=null}null!=this.linkHint&&(null!=this.linkHint.parentNode&&this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler),this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&
(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Ba=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Ba.apply(this),null!=this.state&&null!=this.linkHint)){var x=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(x=new mxRectangle(x.x,x.y,x.width,x.height),x.add(this.state.text.bounds));this.linkHint.style.left=Math.max(0,Math.round(x.x+(x.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=
Math.round(x.y+x.height+Editor.hintOffset)+"px"}};var ab=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){ab.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Xa=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Xa.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),
this.changeHandler=null)}}();(function(){function b(c,m,v){mxShape.call(this);this.line=c;this.stroke=m;this.strokewidth=null!=v?v:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function g(){mxSwimlane.call(this)}function l(){mxCylinder.call(this)}function D(){mxCylinder.call(this)}function p(){mxActor.call(this)}function E(){mxCylinder.call(this)}function N(){mxCylinder.call(this)}function R(){mxCylinder.call(this)}function G(){mxCylinder.call(this)}function M(){mxShape.call(this)}function Q(){mxShape.call(this)}
function e(c,m,v,n){mxShape.call(this);this.bounds=c;this.fill=m;this.stroke=v;this.strokewidth=null!=n?n:1}function f(){mxActor.call(this)}function k(){mxCylinder.call(this)}function z(){mxCylinder.call(this)}function t(){mxActor.call(this)}function B(){mxActor.call(this)}function I(){mxActor.call(this)}function O(){mxActor.call(this)}function J(){mxActor.call(this)}function y(){mxActor.call(this)}function ia(){mxActor.call(this)}function da(c,m){this.canvas=c;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");
this.defaultVariation=m;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,da.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,da.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,da.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,da.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,da.prototype.curveTo);
this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,da.prototype.arcTo)}function ja(){mxRectangleShape.call(this)}function aa(){mxRectangleShape.call(this)}function qa(){mxActor.call(this)}function sa(){mxActor.call(this)}function L(){mxActor.call(this)}function V(){mxRectangleShape.call(this)}function T(){mxRectangleShape.call(this)}function Y(){mxCylinder.call(this)}function W(){mxShape.call(this)}function ka(){mxShape.call(this)}function q(){mxEllipse.call(this)}function F(){mxShape.call(this)}
function S(){mxShape.call(this)}function ba(){mxRectangleShape.call(this)}function U(){mxShape.call(this)}function ca(){mxShape.call(this)}function ea(){mxShape.call(this)}function na(){mxShape.call(this)}function ra(){mxShape.call(this)}function ya(){mxCylinder.call(this)}function va(){mxCylinder.call(this)}function Da(){mxRectangleShape.call(this)}function pa(){mxDoubleEllipse.call(this)}function Aa(){mxDoubleEllipse.call(this)}function xa(){mxArrowConnector.call(this);this.spacing=0}function Ma(){mxArrowConnector.call(this);
this.spacing=0}function Oa(){mxActor.call(this)}function Na(){mxRectangleShape.call(this)}function La(){mxActor.call(this)}function Ba(){mxActor.call(this)}function ab(){mxActor.call(this)}function Xa(){mxActor.call(this)}function x(){mxActor.call(this)}function H(){mxActor.call(this)}function P(){mxActor.call(this)}function X(){mxActor.call(this)}function Z(){mxActor.call(this)}function fa(){mxActor.call(this)}function la(){mxEllipse.call(this)}function za(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}
function oa(){mxRhombus.call(this)}function ta(){mxEllipse.call(this)}function Ea(){mxEllipse.call(this)}function Fa(){mxEllipse.call(this)}function Pa(){mxEllipse.call(this)}function Ra(){mxActor.call(this)}function Ca(){mxActor.call(this)}function Ja(){mxActor.call(this)}function Qa(c,m,v,n){mxShape.call(this);this.bounds=c;this.fill=m;this.stroke=v;this.strokewidth=null!=n?n:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function $a(){mxConnector.call(this)}
function eb(c,m,v,n,u,A,C,ha,K,wa){C+=K;var ma=n.clone();n.x-=u*(2*C+K);n.y-=A*(2*C+K);u*=C+K;A*=C+K;return function(){c.ellipse(ma.x-u-C,ma.y-A-C,2*C,2*C);wa?c.fillAndStroke():c.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var c=null;if(null!=this.line)for(var m=0;m<this.line.length;m++){var v=this.line[m];null!=v&&(v=new mxRectangle(v.x,v.y,this.strokewidth,this.strokewidth),null==c?c=v:c.add(v))}this.bounds=null!=c?c:new mxRectangle};b.prototype.paintVertexShape=
function(c,m,v,n,u){this.paintTableLine(c,this.line,0,0)};b.prototype.paintTableLine=function(c,m,v,n){if(null!=m){var u=null;c.begin();for(var A=0;A<m.length;A++){var C=m[A];null!=C&&(null==u?c.moveTo(C.x+v,C.y+n):null!=u&&c.lineTo(C.x+v,C.y+n));u=C}c.end();c.stroke()}};b.prototype.intersectsRectangle=function(c){var m=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var v=null,n=0;n<this.line.length&&!m;n++){var u=this.line[n];null!=u&&null!=v&&(m=mxUtils.rectangleIntersectsSegment(c,
v,u));v=u}return m};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.getLabelBounds=function(c){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};d.prototype.paintVertexShape=function(c,m,v,n,u){var A=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,C=this.isHorizontal(),ha=this.getTitleSize();0==ha||this.outline?Fa.prototype.paintVertexShape.apply(this,
arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),c.translate(-m,-v));A||this.outline||!(C&&ha<u||!C&&ha<n)||this.paintForeground(c,m,v,n,u)};d.prototype.paintForeground=function(c,m,v,n,u){if(null!=this.state){var A=this.flipH,C=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ha=A;A=C;C=ha}c.rotate(-this.getShapeRotation(),A,C,m+n/2,v+u/2);s=this.scale;m=this.bounds.x/s;v=this.bounds.y/s;n=this.bounds.width/s;u=this.bounds.height/
s;this.paintTableForeground(c,m,v,n,u)}};d.prototype.paintTableForeground=function(c,m,v,n,u){n=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(u=0;u<n.length;u++)b.prototype.paintTableLine(c,n[u],m,v)};d.prototype.configurePointerEvents=function(c){0==this.getTitleSize()?c.pointerEvents=!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",
d);mxUtils.extend(g,d);g.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",g);mxUtils.extend(l,mxCylinder);l.prototype.size=20;l.prototype.darkOpacity=0;l.prototype.darkOpacity2=0;l.prototype.paintVertexShape=function(c,m,v,n,u){var A=Math.max(0,Math.min(n,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),C=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),ha=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,
"darkOpacity2",this.darkOpacity2))));c.translate(m,v);c.begin();c.moveTo(0,0);c.lineTo(n-A,0);c.lineTo(n,A);c.lineTo(n,u);c.lineTo(A,u);c.lineTo(0,u-A);c.lineTo(0,0);c.close();c.end();c.fillAndStroke();this.outline||(c.setShadow(!1),0!=C&&(c.setFillAlpha(Math.abs(C)),c.setFillColor(0>C?"#FFFFFF":"#000000"),c.begin(),c.moveTo(0,0),c.lineTo(n-A,0),c.lineTo(n,A),c.lineTo(A,A),c.close(),c.fill()),0!=ha&&(c.setFillAlpha(Math.abs(ha)),c.setFillColor(0>ha?"#FFFFFF":"#000000"),c.begin(),c.moveTo(0,0),c.lineTo(A,
A),c.lineTo(A,u),c.lineTo(0,u-A),c.close(),c.fill()),c.begin(),c.moveTo(A,u),c.lineTo(A,A),c.lineTo(0,0),c.moveTo(A,A),c.lineTo(n,A),c.end(),c.stroke())};l.prototype.getLabelMargins=function(c){return mxUtils.getValue(this.style,"boundedLbl",!1)?(c=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(c,c,0,0)):null};mxCellRenderer.registerShape("cube",l);var cb=Math.tan(mxUtils.toRadians(30)),db=(.5-cb)/2;mxCellRenderer.registerShape("isoRectangle",p);mxUtils.extend(D,
mxCylinder);D.prototype.size=6;D.prototype.paintVertexShape=function(c,m,v,n,u){c.setFillColor(this.stroke);var A=Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size))-2)+2*this.strokewidth;c.ellipse(m+.5*(n-A),v+.5*(u-A),A,A);c.fill();c.setFillColor(mxConstants.NONE);c.rect(m,v,n,u);c.fill()};mxCellRenderer.registerShape("waypoint",D);mxUtils.extend(p,mxActor);p.prototype.size=20;p.prototype.redrawPath=function(c,m,v,n,u){m=Math.min(n,u/cb);c.translate((n-m)/2,(u-m)/2+m/4);c.moveTo(0,
.25*m);c.lineTo(.5*m,m*db);c.lineTo(m,.25*m);c.lineTo(.5*m,(.5-db)*m);c.lineTo(0,.25*m);c.close();c.end()};mxCellRenderer.registerShape("isoRectangle",p);mxUtils.extend(E,mxCylinder);E.prototype.size=20;E.prototype.redrawPath=function(c,m,v,n,u,A){m=Math.min(n,u/(.5+cb));A?(c.moveTo(0,.25*m),c.lineTo(.5*m,(.5-db)*m),c.lineTo(m,.25*m),c.moveTo(.5*m,(.5-db)*m),c.lineTo(.5*m,(1-db)*m)):(c.translate((n-m)/2,(u-m)/2),c.moveTo(0,.25*m),c.lineTo(.5*m,m*db),c.lineTo(m,.25*m),c.lineTo(m,.75*m),c.lineTo(.5*
m,(1-db)*m),c.lineTo(0,.75*m),c.close());c.end()};mxCellRenderer.registerShape("isoCube",E);mxUtils.extend(N,mxCylinder);N.prototype.redrawPath=function(c,m,v,n,u,A){m=Math.min(u/2,Math.round(u/8)+this.strokewidth-1);if(A&&null!=this.fill||!A&&null==this.fill)c.moveTo(0,m),c.curveTo(0,2*m,n,2*m,n,m),A||(c.stroke(),c.begin()),c.translate(0,m/2),c.moveTo(0,m),c.curveTo(0,2*m,n,2*m,n,m),A||(c.stroke(),c.begin()),c.translate(0,m/2),c.moveTo(0,m),c.curveTo(0,2*m,n,2*m,n,m),A||(c.stroke(),c.begin()),c.translate(0,
-m);A||(c.moveTo(0,m),c.curveTo(0,-m/3,n,-m/3,n,m),c.lineTo(n,u-m),c.curveTo(n,u+m/3,0,u+m/3,0,u-m),c.close())};N.prototype.getLabelMargins=function(c){return new mxRectangle(0,2.5*Math.min(c.height/2,Math.round(c.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",N);mxUtils.extend(R,mxCylinder);R.prototype.size=30;R.prototype.darkOpacity=0;R.prototype.paintVertexShape=function(c,m,v,n,u){var A=Math.max(0,Math.min(n,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",
this.size))))),C=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));c.translate(m,v);c.begin();c.moveTo(0,0);c.lineTo(n-A,0);c.lineTo(n,A);c.lineTo(n,u);c.lineTo(0,u);c.lineTo(0,0);c.close();c.end();c.fillAndStroke();this.outline||(c.setShadow(!1),0!=C&&(c.setFillAlpha(Math.abs(C)),c.setFillColor(0>C?"#FFFFFF":"#000000"),c.begin(),c.moveTo(n-A,0),c.lineTo(n-A,A),c.lineTo(n,A),c.close(),c.fill()),c.begin(),c.moveTo(n-A,0),c.lineTo(n-A,A),c.lineTo(n,A),
c.end(),c.stroke())};mxCellRenderer.registerShape("note",R);mxUtils.extend(G,R);mxCellRenderer.registerShape("note2",G);G.prototype.getLabelMargins=function(c){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(c.height*this.scale,m*this.scale),0,0)}return null};mxUtils.extend(M,mxShape);M.prototype.isoAngle=15;M.prototype.paintVertexShape=function(c,m,v,n,u){var A=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,
"isoAngle",this.isoAngle))))*Math.PI/200;A=Math.min(n*Math.tan(A),.5*u);c.translate(m,v);c.begin();c.moveTo(.5*n,0);c.lineTo(n,A);c.lineTo(n,u-A);c.lineTo(.5*n,u);c.lineTo(0,u-A);c.lineTo(0,A);c.close();c.fillAndStroke();c.setShadow(!1);c.begin();c.moveTo(0,A);c.lineTo(.5*n,2*A);c.lineTo(n,A);c.moveTo(.5*n,2*A);c.lineTo(.5*n,u);c.stroke()};mxCellRenderer.registerShape("isoCube2",M);mxUtils.extend(Q,mxShape);Q.prototype.size=15;Q.prototype.paintVertexShape=function(c,m,v,n,u){var A=Math.max(0,Math.min(.5*
u,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c.translate(m,v);0==A?(c.rect(0,0,n,u),c.fillAndStroke()):(c.begin(),c.moveTo(0,A),c.arcTo(.5*n,A,0,0,1,.5*n,0),c.arcTo(.5*n,A,0,0,1,n,A),c.lineTo(n,u-A),c.arcTo(.5*n,A,0,0,1,.5*n,u),c.arcTo(.5*n,A,0,0,1,0,u-A),c.close(),c.fillAndStroke(),c.setShadow(!1),c.begin(),c.moveTo(n,A),c.arcTo(.5*n,A,0,0,1,.5*n,2*A),c.arcTo(.5*n,A,0,0,1,0,A),c.stroke())};mxCellRenderer.registerShape("cylinder2",Q);mxUtils.extend(e,mxCylinder);e.prototype.size=
15;e.prototype.paintVertexShape=function(c,m,v,n,u){var A=Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),C=mxUtils.getValue(this.style,"lid",!0);c.translate(m,v);0==A?(c.rect(0,0,n,u),c.fillAndStroke()):(c.begin(),C?(c.moveTo(0,A),c.arcTo(.5*n,A,0,0,1,.5*n,0),c.arcTo(.5*n,A,0,0,1,n,A)):(c.moveTo(0,0),c.arcTo(.5*n,A,0,0,0,.5*n,A),c.arcTo(.5*n,A,0,0,0,n,0)),c.lineTo(n,u-A),c.arcTo(.5*n,A,0,0,1,.5*n,u),c.arcTo(.5*n,A,0,0,1,0,u-A),c.close(),c.fillAndStroke(),c.setShadow(!1),
C&&(c.begin(),c.moveTo(n,A),c.arcTo(.5*n,A,0,0,1,.5*n,2*A),c.arcTo(.5*n,A,0,0,1,0,A),c.stroke()))};mxCellRenderer.registerShape("cylinder3",e);mxUtils.extend(f,mxActor);f.prototype.redrawPath=function(c,m,v,n,u){c.moveTo(0,0);c.quadTo(n/2,.5*u,n,0);c.quadTo(.5*n,u/2,n,u);c.quadTo(n/2,.5*u,0,u);c.quadTo(.5*n,u/2,0,0);c.end()};mxCellRenderer.registerShape("switch",f);mxUtils.extend(k,mxCylinder);k.prototype.tabWidth=60;k.prototype.tabHeight=20;k.prototype.tabPosition="right";k.prototype.arcSize=.1;
k.prototype.paintVertexShape=function(c,m,v,n,u){c.translate(m,v);m=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));v=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var A=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),C=mxUtils.getValue(this.style,"rounded",!1),ha=mxUtils.getValue(this.style,"absoluteArcSize",!1),K=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ha||(K*=Math.min(n,u));
K=Math.min(K,.5*n,.5*(u-v));m=Math.max(m,K);m=Math.min(n-K,m);C||(K=0);c.begin();"left"==A?(c.moveTo(Math.max(K,0),v),c.lineTo(Math.max(K,0),0),c.lineTo(m,0),c.lineTo(m,v)):(c.moveTo(n-m,v),c.lineTo(n-m,0),c.lineTo(n-Math.max(K,0),0),c.lineTo(n-Math.max(K,0),v));C?(c.moveTo(0,K+v),c.arcTo(K,K,0,0,1,K,v),c.lineTo(n-K,v),c.arcTo(K,K,0,0,1,n,K+v),c.lineTo(n,u-K),c.arcTo(K,K,0,0,1,n-K,u),c.lineTo(K,u),c.arcTo(K,K,0,0,1,0,u-K)):(c.moveTo(0,v),c.lineTo(n,v),c.lineTo(n,u),c.lineTo(0,u));c.close();c.fillAndStroke();
c.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(c.begin(),c.moveTo(n-30,v+20),c.lineTo(n-20,v+10),c.lineTo(n-10,v+20),c.close(),c.stroke())};mxCellRenderer.registerShape("folder",k);k.prototype.getLabelMargins=function(c){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var v=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;m=mxUtils.getValue(this.style,
"tabHeight",15)*this.scale;var n=mxUtils.getValue(this.style,"rounded",!1),u=mxUtils.getValue(this.style,"absoluteArcSize",!1),A=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));u||(A*=Math.min(c.width,c.height));A=Math.min(A,.5*c.width,.5*(c.height-m));n||(A=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(A,0,Math.min(c.width,c.width-v),Math.min(c.height,c.height-m)):new mxRectangle(Math.min(c.width,c.width-v),0,A,Math.min(c.height,c.height-
m))}return new mxRectangle(0,Math.min(c.height,m),0,0)}return null};mxUtils.extend(z,mxCylinder);z.prototype.arcSize=.1;z.prototype.paintVertexShape=function(c,m,v,n,u){c.translate(m,v);var A=mxUtils.getValue(this.style,"rounded",!1),C=mxUtils.getValue(this.style,"absoluteArcSize",!1);m=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));v=mxUtils.getValue(this.style,"umlStateConnection",null);C||(m*=Math.min(n,u));m=Math.min(m,.5*n,.5*u);A||(m=0);A=0;null!=v&&(A=10);c.begin();c.moveTo(A,
m);c.arcTo(m,m,0,0,1,A+m,0);c.lineTo(n-m,0);c.arcTo(m,m,0,0,1,n,m);c.lineTo(n,u-m);c.arcTo(m,m,0,0,1,n-m,u);c.lineTo(A+m,u);c.arcTo(m,m,0,0,1,A,u-m);c.close();c.fillAndStroke();c.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(c.roundrect(n-40,u-20,10,10,3,3),c.stroke(),c.roundrect(n-20,u-20,10,10,3,3),c.stroke(),c.begin(),c.moveTo(n-30,u-15),c.lineTo(n-20,u-15),c.stroke());"connPointRefEntry"==v?(c.ellipse(0,.5*u-10,20,20),c.fillAndStroke()):"connPointRefExit"==
v&&(c.ellipse(0,.5*u-10,20,20),c.fillAndStroke(),c.begin(),c.moveTo(5,.5*u-5),c.lineTo(15,.5*u+5),c.moveTo(15,.5*u-5),c.lineTo(5,.5*u+5),c.stroke())};z.prototype.getLabelMargins=function(c){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};mxCellRenderer.registerShape("umlState",z);mxUtils.extend(t,mxActor);t.prototype.size=30;t.prototype.isRoundable=function(){return!0};t.prototype.redrawPath=
function(c,m,v,n,u){m=Math.max(0,Math.min(n,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(m,0),new mxPoint(n,0),new mxPoint(n,u),new mxPoint(0,u),new mxPoint(0,m)],this.isRounded,v,!0);c.end()};mxCellRenderer.registerShape("card",t);mxUtils.extend(B,mxActor);B.prototype.size=.4;B.prototype.redrawPath=function(c,m,v,n,u){m=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
"size",this.size))));c.moveTo(0,m/2);c.quadTo(n/4,1.4*m,n/2,m/2);c.quadTo(3*n/4,m*(1-1.4),n,m/2);c.lineTo(n,u-m/2);c.quadTo(3*n/4,u-1.4*m,n/2,u-m/2);c.quadTo(n/4,u-m*(1-1.4),0,u-m/2);c.lineTo(0,m/2);c.close();c.end()};B.prototype.getLabelBounds=function(c){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"size",this.size),v=c.width,n=c.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return m*=
n,new mxRectangle(c.x,c.y+m,v,n-2*m);m*=v;return new mxRectangle(c.x+m,c.y,v-2*m,n)}return c};mxCellRenderer.registerShape("tape",B);mxUtils.extend(I,mxActor);I.prototype.size=.3;I.prototype.getLabelMargins=function(c){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*c.height):null};I.prototype.redrawPath=function(c,m,v,n,u){m=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c.moveTo(0,
0);c.lineTo(n,0);c.lineTo(n,u-m/2);c.quadTo(3*n/4,u-1.4*m,n/2,u-m/2);c.quadTo(n/4,u-m*(1-1.4),0,u-m/2);c.lineTo(0,m/2);c.close();c.end()};mxCellRenderer.registerShape("document",I);var rb=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(c,m,v,n){var u=mxUtils.getValue(this.style,"size");return null!=u?n*Math.max(0,Math.min(1,u)):rb.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(c){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=2*mxUtils.getValue(this.style,
"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,c.height*m),0,0)}return null};e.prototype.getLabelMargins=function(c){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(m/=2);return new mxRectangle(0,Math.min(c.height*this.scale,2*m*this.scale),0,Math.max(0,.3*m*this.scale))}return null};k.prototype.getLabelMargins=function(c){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,
"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var v=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;m=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var n=mxUtils.getValue(this.style,"rounded",!1),u=mxUtils.getValue(this.style,"absoluteArcSize",!1),A=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));u||(A*=Math.min(c.width,c.height));A=Math.min(A,.5*c.width,.5*(c.height-m));n||(A=0);return"left"==mxUtils.getValue(this.style,"tabPosition",
this.tabPosition)?new mxRectangle(A,0,Math.min(c.width,c.width-v),Math.min(c.height,c.height-m)):new mxRectangle(Math.min(c.width,c.width-v),0,A,Math.min(c.height,c.height-m))}return new mxRectangle(0,Math.min(c.height,m),0,0)}return null};z.prototype.getLabelMargins=function(c){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};G.prototype.getLabelMargins=function(c){if(mxUtils.getValue(this.style,
"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(c.height*this.scale,m*this.scale),0,Math.max(0,m*this.scale))}return null};mxUtils.extend(O,mxActor);O.prototype.size=.2;O.prototype.fixedSize=20;O.prototype.isRoundable=function(){return!0};O.prototype.redrawPath=function(c,m,v,n,u){m="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
"size",this.size))));v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,u),new mxPoint(m,0),new mxPoint(n,0),new mxPoint(n-m,u)],this.isRounded,v,!0);c.end()};mxCellRenderer.registerShape("parallelogram",O);mxUtils.extend(J,mxActor);J.prototype.size=.2;J.prototype.fixedSize=20;J.prototype.isRoundable=function(){return!0};J.prototype.redrawPath=function(c,m,v,n,u){m="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*
n,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):n*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,u),new mxPoint(m,0),new mxPoint(n-m,0),new mxPoint(n,u)],this.isRounded,v,!0)};mxCellRenderer.registerShape("trapezoid",J);mxUtils.extend(y,mxActor);y.prototype.size=.5;y.prototype.redrawPath=function(c,m,v,n,u){c.setFillColor(null);
m=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(n,0),new mxPoint(m,0),new mxPoint(m,u/2),new mxPoint(0,u/2),new mxPoint(m,u/2),new mxPoint(m,u),new mxPoint(n,u)],this.isRounded,v,!1);c.end()};mxCellRenderer.registerShape("curlyBracket",y);mxUtils.extend(ia,mxActor);ia.prototype.redrawPath=function(c,m,v,n,u){c.setStrokeWidth(1);c.setFillColor(this.stroke);
m=n/5;c.rect(0,0,m,u);c.fillAndStroke();c.rect(2*m,0,m,u);c.fillAndStroke();c.rect(4*m,0,m,u);c.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ia);da.prototype.moveTo=function(c,m){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=c;this.lastY=m;this.firstX=c;this.firstY=m};da.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};
da.prototype.quadTo=function(c,m,v,n){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=v;this.lastY=n};da.prototype.curveTo=function(c,m,v,n,u,A){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=u;this.lastY=A};da.prototype.arcTo=function(c,m,v,n,u,A,C){this.originalArcTo.apply(this.canvas,arguments);this.lastX=A;this.lastY=C};da.prototype.lineTo=function(c,m){if(null!=this.lastX&&null!=this.lastY){var v=function(ma){return"number"===typeof ma?ma?0>ma?-1:1:ma===ma?0:NaN:NaN},
n=Math.abs(c-this.lastX),u=Math.abs(m-this.lastY),A=Math.sqrt(n*n+u*u);if(2>A){this.originalLineTo.apply(this.canvas,arguments);this.lastX=c;this.lastY=m;return}var C=Math.round(A/10),ha=this.defaultVariation;5>C&&(C=5,ha/=3);var K=v(c-this.lastX)*n/C;v=v(m-this.lastY)*u/C;n/=A;u/=A;for(A=0;A<C;A++){var wa=(Math.random()-.5)*ha;this.originalLineTo.call(this.canvas,K*A+this.lastX-wa*u,v*A+this.lastY-wa*n)}this.originalLineTo.call(this.canvas,c,m)}else this.originalLineTo.apply(this.canvas,arguments);
this.lastX=c;this.lastY=m};da.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};mxShape.prototype.defaultJiggle=1.5;var mb=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(c){mb.apply(this,arguments);null==c.handJiggle&&(c.handJiggle=this.createHandJiggle(c))};var vb=mxShape.prototype.afterPaint;
mxShape.prototype.afterPaint=function(c){vb.apply(this,arguments);null!=c.handJiggle&&(c.handJiggle.destroy(),delete c.handJiggle)};mxShape.prototype.createComicCanvas=function(c){return new da(c,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle))};mxShape.prototype.createHandJiggle=function(c){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(c)};mxRhombus.prototype.defaultJiggle=2;var Bb=mxRectangleShape.prototype.isHtmlAllowed;
mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&Bb.apply(this,arguments)};var Ya=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(c,m,v,n,u){if(null==c.handJiggle||c.handJiggle.constructor!=da)Ya.apply(this,arguments);else{var A=!0;null!=this.style&&(A="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,
"1"));if(A||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)A||null!=this.fill&&this.fill!=mxConstants.NONE||(c.pointerEvents=!1),c.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?A=Math.min(n/2,Math.min(u/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,A=Math.min(n*
A,u*A)),c.moveTo(m+A,v),c.lineTo(m+n-A,v),c.quadTo(m+n,v,m+n,v+A),c.lineTo(m+n,v+u-A),c.quadTo(m+n,v+u,m+n-A,v+u),c.lineTo(m+A,v+u),c.quadTo(m,v+u,m,v+u-A),c.lineTo(m,v+A),c.quadTo(m,v,m+A,v)):(c.moveTo(m,v),c.lineTo(m+n,v),c.lineTo(m+n,v+u),c.lineTo(m,v+u),c.lineTo(m,v)),c.close(),c.end(),c.fillAndStroke()}};mxUtils.extend(ja,mxRectangleShape);ja.prototype.size=.1;ja.prototype.fixedSize=!1;ja.prototype.isHtmlAllowed=function(){return!1};ja.prototype.getLabelBounds=function(c){if(mxUtils.getValue(this.state.style,
mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var m=c.width,v=c.height;c=new mxRectangle(c.x,c.y,m,v);var n=m*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var u=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;n=Math.max(n,Math.min(m*u,v*u))}c.x+=Math.round(n);c.width-=Math.round(2*n);return c}return c};
ja.prototype.paintForeground=function(c,m,v,n,u){var A=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),C=parseFloat(mxUtils.getValue(this.style,"size",this.size));C=A?Math.max(0,Math.min(n,C)):n*Math.max(0,Math.min(1,C));this.isRounded&&(A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,C=Math.max(C,Math.min(n*A,u*A)));C=Math.round(C);c.begin();c.moveTo(m+C,v);c.lineTo(m+C,v+u);c.moveTo(m+n-C,v);c.lineTo(m+n-C,v+u);c.end();c.stroke();mxRectangleShape.prototype.paintForeground.apply(this,
arguments)};mxCellRenderer.registerShape("process",ja);mxCellRenderer.registerShape("process2",ja);mxUtils.extend(aa,mxRectangleShape);aa.prototype.paintBackground=function(c,m,v,n,u){c.setFillColor(mxConstants.NONE);c.rect(m,v,n,u);c.fill()};aa.prototype.paintForeground=function(c,m,v,n,u){};mxCellRenderer.registerShape("transparent",aa);mxUtils.extend(qa,mxHexagon);qa.prototype.size=30;qa.prototype.position=.5;qa.prototype.position2=.5;qa.prototype.base=20;qa.prototype.getLabelMargins=function(){return new mxRectangle(0,
0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};qa.prototype.isRoundable=function(){return!0};qa.prototype.redrawPath=function(c,m,v,n,u){m=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;v=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var A=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),C=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",
this.position2)))),ha=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(c,[new mxPoint(0,0),new mxPoint(n,0),new mxPoint(n,u-v),new mxPoint(Math.min(n,A+ha),u-v),new mxPoint(C,u),new mxPoint(Math.max(0,A),u-v),new mxPoint(0,u-v)],this.isRounded,m,!0,[4])};mxCellRenderer.registerShape("callout",qa);mxUtils.extend(sa,mxActor);sa.prototype.size=.2;sa.prototype.fixedSize=20;sa.prototype.isRoundable=function(){return!0};sa.prototype.redrawPath=function(c,
m,v,n,u){m="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,0),new mxPoint(n-m,0),new mxPoint(n,u/2),new mxPoint(n-m,u),new mxPoint(0,u),new mxPoint(m,u/2)],this.isRounded,v,!0);c.end()};mxCellRenderer.registerShape("step",
sa);mxUtils.extend(L,mxHexagon);L.prototype.size=.25;L.prototype.fixedSize=20;L.prototype.isRoundable=function(){return!0};L.prototype.redrawPath=function(c,m,v,n,u){m="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*n,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(m,
0),new mxPoint(n-m,0),new mxPoint(n,.5*u),new mxPoint(n-m,u),new mxPoint(m,u),new mxPoint(0,.5*u)],this.isRounded,v,!0)};mxCellRenderer.registerShape("hexagon",L);mxUtils.extend(V,mxRectangleShape);V.prototype.isHtmlAllowed=function(){return!1};V.prototype.paintForeground=function(c,m,v,n,u){var A=Math.min(n/5,u/5)+1;c.begin();c.moveTo(m+n/2,v+A);c.lineTo(m+n/2,v+u-A);c.moveTo(m+A,v+u/2);c.lineTo(m+n-A,v+u/2);c.end();c.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",
V);var Za=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(c){if(1==this.style["double"]){var m=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(c.x+m,c.y+m,c.width-2*m,c.height-2*m)}return c};mxRhombus.prototype.paintVertexShape=function(c,m,v,n,u){Za.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var A=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
0);m+=A;v+=A;n-=2*A;u-=2*A;0<n&&0<u&&(c.setShadow(!1),Za.apply(this,[c,m,v,n,u]))}};mxUtils.extend(T,mxRectangleShape);T.prototype.isHtmlAllowed=function(){return!1};T.prototype.getLabelBounds=function(c){if(1==this.style["double"]){var m=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(c.x+m,c.y+m,c.width-2*m,c.height-2*m)}return c};T.prototype.paintForeground=function(c,m,v,n,u){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var A=
Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);m+=A;v+=A;n-=2*A;u-=2*A;0<n&&0<u&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}c.setDashed(!1);A=0;do{var C=mxCellRenderer.defaultShapes[this.style["symbol"+A]];if(null!=C){var ha=this.style["symbol"+A+"Align"],K=this.style["symbol"+A+"VerticalAlign"],wa=this.style["symbol"+A+"Width"],ma=this.style["symbol"+A+"Height"],Wa=this.style["symbol"+A+"Spacing"]||0,jb=this.style["symbol"+A+"VSpacing"]||
Wa,bb=this.style["symbol"+A+"ArcSpacing"];null!=bb&&(bb*=this.getArcSize(n+this.strokewidth,u+this.strokewidth),Wa+=bb,jb+=bb);bb=m;var Ga=v;bb=ha==mxConstants.ALIGN_CENTER?bb+(n-wa)/2:ha==mxConstants.ALIGN_RIGHT?bb+(n-wa-Wa):bb+Wa;Ga=K==mxConstants.ALIGN_MIDDLE?Ga+(u-ma)/2:K==mxConstants.ALIGN_BOTTOM?Ga+(u-ma-jb):Ga+jb;c.save();ha=new C;ha.style=this.style;C.prototype.paintVertexShape.call(ha,c,bb,Ga,wa,ma);c.restore()}A++}while(null!=C)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};
mxCellRenderer.registerShape("ext",T);mxUtils.extend(Y,mxCylinder);Y.prototype.redrawPath=function(c,m,v,n,u,A){A?(c.moveTo(0,0),c.lineTo(n/2,u/2),c.lineTo(n,0),c.end()):(c.moveTo(0,0),c.lineTo(n,0),c.lineTo(n,u),c.lineTo(0,u),c.close())};mxCellRenderer.registerShape("message",Y);mxUtils.extend(W,mxShape);W.prototype.paintBackground=function(c,m,v,n,u){c.translate(m,v);c.ellipse(n/4,0,n/2,u/4);c.fillAndStroke();c.begin();c.moveTo(n/2,u/4);c.lineTo(n/2,2*u/3);c.moveTo(n/2,u/3);c.lineTo(0,u/3);c.moveTo(n/
2,u/3);c.lineTo(n,u/3);c.moveTo(n/2,2*u/3);c.lineTo(0,u);c.moveTo(n/2,2*u/3);c.lineTo(n,u);c.end();c.stroke()};mxCellRenderer.registerShape("umlActor",W);mxUtils.extend(ka,mxShape);ka.prototype.getLabelMargins=function(c){return new mxRectangle(c.width/6,0,0,0)};ka.prototype.paintBackground=function(c,m,v,n,u){c.translate(m,v);c.begin();c.moveTo(0,u/4);c.lineTo(0,3*u/4);c.end();c.stroke();c.begin();c.moveTo(0,u/2);c.lineTo(n/6,u/2);c.end();c.stroke();c.ellipse(n/6,0,5*n/6,u);c.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",
ka);mxUtils.extend(q,mxEllipse);q.prototype.paintVertexShape=function(c,m,v,n,u){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.begin();c.moveTo(m+n/8,v+u);c.lineTo(m+7*n/8,v+u);c.end();c.stroke()};mxCellRenderer.registerShape("umlEntity",q);mxUtils.extend(F,mxShape);F.prototype.paintVertexShape=function(c,m,v,n,u){c.translate(m,v);c.begin();c.moveTo(n,0);c.lineTo(0,u);c.moveTo(0,0);c.lineTo(n,u);c.end();c.stroke()};mxCellRenderer.registerShape("umlDestroy",F);mxUtils.extend(S,mxShape);
S.prototype.getLabelBounds=function(c){return new mxRectangle(c.x,c.y+c.height/8,c.width,7*c.height/8)};S.prototype.paintBackground=function(c,m,v,n,u){c.translate(m,v);c.begin();c.moveTo(3*n/8,u/8*1.1);c.lineTo(5*n/8,0);c.end();c.stroke();c.ellipse(0,u/8,n,7*u/8);c.fillAndStroke()};S.prototype.paintForeground=function(c,m,v,n,u){c.begin();c.moveTo(3*n/8,u/8*1.1);c.lineTo(5*n/8,u/4);c.end();c.stroke()};mxCellRenderer.registerShape("umlControl",S);mxUtils.extend(ba,mxRectangleShape);ba.prototype.size=
40;ba.prototype.isHtmlAllowed=function(){return!1};ba.prototype.getLabelBounds=function(c){var m=Math.max(0,Math.min(c.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(c.x,c.y,c.width,m)};ba.prototype.paintBackground=function(c,m,v,n,u){var A=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),C=mxUtils.getValue(this.style,"participant");null==C||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,
c,m,v,n,A):(C=this.state.view.graph.cellRenderer.getShape(C),null!=C&&C!=ba&&(C=new C,C.apply(this.state),c.save(),C.paintVertexShape(c,m,v,n,A),c.restore()));A<u&&(c.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),c.begin(),c.moveTo(m+n/2,v+A),c.lineTo(m+n/2,v+u),c.end(),c.stroke())};ba.prototype.paintForeground=function(c,m,v,n,u){var A=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,c,m,v,n,
Math.min(u,A))};mxCellRenderer.registerShape("umlLifeline",ba);mxUtils.extend(U,mxShape);U.prototype.width=60;U.prototype.height=30;U.prototype.corner=10;U.prototype.getLabelMargins=function(c){return new mxRectangle(0,0,c.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),c.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};U.prototype.paintBackground=function(c,m,v,n,u){var A=this.corner,C=Math.min(n,Math.max(A,parseFloat(mxUtils.getValue(this.style,
"width",this.width)))),ha=Math.min(u,Math.max(1.5*A,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),K=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);K!=mxConstants.NONE&&(c.setFillColor(K),c.rect(m,v,n,u),c.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(c,m,v,n,u),c.setGradient(this.fill,this.gradient,m,v,n,u,this.gradientDirection)):c.setFillColor(this.fill);c.begin();
c.moveTo(m,v);c.lineTo(m+C,v);c.lineTo(m+C,v+Math.max(0,ha-1.5*A));c.lineTo(m+Math.max(0,C-A),v+ha);c.lineTo(m,v+ha);c.close();c.fillAndStroke();c.begin();c.moveTo(m+C,v);c.lineTo(m+n,v);c.lineTo(m+n,v+u);c.lineTo(m,v+u);c.lineTo(m,v+ha);c.stroke()};mxCellRenderer.registerShape("umlFrame",U);mxPerimeter.CenterPerimeter=function(c,m,v,n){return new mxPoint(c.getCenterX(),c.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=function(c,
m,v,n){n=ba.prototype.size;null!=m&&(n=mxUtils.getValue(m.style,"size",n)*m.view.scale);m=parseFloat(m.style[mxConstants.STYLE_STROKEWIDTH]||1)*m.view.scale/2-1;v.x<c.getCenterX()&&(m=-1*(m+1));return new mxPoint(c.getCenterX()+m,Math.min(c.y+c.height,Math.max(c.y+n,v.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(c,m,v,n){n=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",
mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(c,m,v,n){n=parseFloat(m.style[mxConstants.STYLE_STROKEWIDTH]||1)*m.view.scale/2-1;null!=m.style.backboneSize&&(n+=parseFloat(m.style.backboneSize)*m.view.scale/2-1);if("south"==m.style[mxConstants.STYLE_DIRECTION]||"north"==m.style[mxConstants.STYLE_DIRECTION])return v.x<c.getCenterX()&&(n=-1*(n+1)),new mxPoint(c.getCenterX()+n,Math.min(c.y+c.height,Math.max(c.y,v.y)));v.y<c.getCenterY()&&(n=-1*(n+1));return new mxPoint(Math.min(c.x+
c.width,Math.max(c.x,v.x)),c.getCenterY()+n)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(c,m,v,n){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(c,new mxRectangle(0,0,0,Math.max(0,Math.min(c.height,parseFloat(mxUtils.getValue(m.style,"size",qa.prototype.size))*m.view.scale))),m.style),m,v,n)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(c,
m,v,n){var u="0"!=mxUtils.getValue(m.style,"fixedSize","0"),A=u?O.prototype.fixedSize:O.prototype.size;null!=m&&(A=mxUtils.getValue(m.style,"size",A));u&&(A*=m.view.scale);var C=c.x,ha=c.y,K=c.width,wa=c.height;m=null!=m?mxUtils.getValue(m.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;m==mxConstants.DIRECTION_NORTH||m==mxConstants.DIRECTION_SOUTH?(u=u?Math.max(0,Math.min(wa,A)):wa*Math.max(0,Math.min(1,A)),ha=[new mxPoint(C,ha),new mxPoint(C+K,ha+u),new mxPoint(C+
K,ha+wa),new mxPoint(C,ha+wa-u),new mxPoint(C,ha)]):(u=u?Math.max(0,Math.min(.5*K,A)):K*Math.max(0,Math.min(1,A)),ha=[new mxPoint(C+u,ha),new mxPoint(C+K,ha),new mxPoint(C+K-u,ha+wa),new mxPoint(C,ha+wa),new mxPoint(C+u,ha)]);wa=c.getCenterX();c=c.getCenterY();c=new mxPoint(wa,c);n&&(v.x<C||v.x>C+K?c.y=v.y:c.x=v.x);return mxUtils.getPerimeterPoint(ha,c,v)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(c,m,v,n){var u="0"!=
mxUtils.getValue(m.style,"fixedSize","0"),A=u?J.prototype.fixedSize:J.prototype.size;null!=m&&(A=mxUtils.getValue(m.style,"size",A));u&&(A*=m.view.scale);var C=c.x,ha=c.y,K=c.width,wa=c.height;m=null!=m?mxUtils.getValue(m.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;m==mxConstants.DIRECTION_EAST?(u=u?Math.max(0,Math.min(.5*K,A)):K*Math.max(0,Math.min(1,A)),ha=[new mxPoint(C+u,ha),new mxPoint(C+K-u,ha),new mxPoint(C+K,ha+wa),new mxPoint(C,ha+wa),new mxPoint(C+
u,ha)]):m==mxConstants.DIRECTION_WEST?(u=u?Math.max(0,Math.min(K,A)):K*Math.max(0,Math.min(1,A)),ha=[new mxPoint(C,ha),new mxPoint(C+K,ha),new mxPoint(C+K-u,ha+wa),new mxPoint(C+u,ha+wa),new mxPoint(C,ha)]):m==mxConstants.DIRECTION_NORTH?(u=u?Math.max(0,Math.min(wa,A)):wa*Math.max(0,Math.min(1,A)),ha=[new mxPoint(C,ha+u),new mxPoint(C+K,ha),new mxPoint(C+K,ha+wa),new mxPoint(C,ha+wa-u),new mxPoint(C,ha+u)]):(u=u?Math.max(0,Math.min(wa,A)):wa*Math.max(0,Math.min(1,A)),ha=[new mxPoint(C,ha),new mxPoint(C+
K,ha+u),new mxPoint(C+K,ha+wa-u),new mxPoint(C,ha+wa),new mxPoint(C,ha)]);wa=c.getCenterX();c=c.getCenterY();c=new mxPoint(wa,c);n&&(v.x<C||v.x>C+K?c.y=v.y:c.x=v.x);return mxUtils.getPerimeterPoint(ha,c,v)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(c,m,v,n){var u="0"!=mxUtils.getValue(m.style,"fixedSize","0"),A=u?sa.prototype.fixedSize:sa.prototype.size;null!=m&&(A=mxUtils.getValue(m.style,"size",A));u&&(A*=m.view.scale);var C=
c.x,ha=c.y,K=c.width,wa=c.height,ma=c.getCenterX();c=c.getCenterY();m=null!=m?mxUtils.getValue(m.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;m==mxConstants.DIRECTION_EAST?(u=u?Math.max(0,Math.min(K,A)):K*Math.max(0,Math.min(1,A)),ha=[new mxPoint(C,ha),new mxPoint(C+K-u,ha),new mxPoint(C+K,c),new mxPoint(C+K-u,ha+wa),new mxPoint(C,ha+wa),new mxPoint(C+u,c),new mxPoint(C,ha)]):m==mxConstants.DIRECTION_WEST?(u=u?Math.max(0,Math.min(K,A)):K*Math.max(0,Math.min(1,
A)),ha=[new mxPoint(C+u,ha),new mxPoint(C+K,ha),new mxPoint(C+K-u,c),new mxPoint(C+K,ha+wa),new mxPoint(C+u,ha+wa),new mxPoint(C,c),new mxPoint(C+u,ha)]):m==mxConstants.DIRECTION_NORTH?(u=u?Math.max(0,Math.min(wa,A)):wa*Math.max(0,Math.min(1,A)),ha=[new mxPoint(C,ha+u),new mxPoint(ma,ha),new mxPoint(C+K,ha+u),new mxPoint(C+K,ha+wa),new mxPoint(ma,ha+wa-u),new mxPoint(C,ha+wa),new mxPoint(C,ha+u)]):(u=u?Math.max(0,Math.min(wa,A)):wa*Math.max(0,Math.min(1,A)),ha=[new mxPoint(C,ha),new mxPoint(ma,ha+
u),new mxPoint(C+K,ha),new mxPoint(C+K,ha+wa-u),new mxPoint(ma,ha+wa),new mxPoint(C,ha+wa-u),new mxPoint(C,ha)]);ma=new mxPoint(ma,c);n&&(v.x<C||v.x>C+K?ma.y=v.y:ma.x=v.x);return mxUtils.getPerimeterPoint(ha,ma,v)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(c,m,v,n){var u="0"!=mxUtils.getValue(m.style,"fixedSize","0"),A=u?L.prototype.fixedSize:L.prototype.size;null!=m&&(A=mxUtils.getValue(m.style,"size",A));u&&(A*=m.view.scale);var C=
c.x,ha=c.y,K=c.width,wa=c.height,ma=c.getCenterX();c=c.getCenterY();m=null!=m?mxUtils.getValue(m.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;m==mxConstants.DIRECTION_NORTH||m==mxConstants.DIRECTION_SOUTH?(u=u?Math.max(0,Math.min(wa,A)):wa*Math.max(0,Math.min(1,A)),ha=[new mxPoint(ma,ha),new mxPoint(C+K,ha+u),new mxPoint(C+K,ha+wa-u),new mxPoint(ma,ha+wa),new mxPoint(C,ha+wa-u),new mxPoint(C,ha+u),new mxPoint(ma,ha)]):(u=u?Math.max(0,Math.min(K,A)):K*Math.max(0,
Math.min(1,A)),ha=[new mxPoint(C+u,ha),new mxPoint(C+K-u,ha),new mxPoint(C+K,c),new mxPoint(C+K-u,ha+wa),new mxPoint(C+u,ha+wa),new mxPoint(C,c),new mxPoint(C+u,ha)]);ma=new mxPoint(ma,c);n&&(v.x<C||v.x>C+K?ma.y=v.y:ma.x=v.x);return mxUtils.getPerimeterPoint(ha,ma,v)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ca,mxShape);ca.prototype.size=10;ca.prototype.paintBackground=function(c,m,v,n,u){var A=parseFloat(mxUtils.getValue(this.style,"size",this.size));
c.translate(m,v);c.ellipse((n-A)/2,0,A,A);c.fillAndStroke();c.begin();c.moveTo(n/2,A);c.lineTo(n/2,u);c.end();c.stroke()};mxCellRenderer.registerShape("lollipop",ca);mxUtils.extend(ea,mxShape);ea.prototype.size=10;ea.prototype.inset=2;ea.prototype.paintBackground=function(c,m,v,n,u){var A=parseFloat(mxUtils.getValue(this.style,"size",this.size)),C=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;c.translate(m,v);c.begin();c.moveTo(n/2,A+C);c.lineTo(n/2,u);c.end();c.stroke();
c.begin();c.moveTo((n-A)/2-C,A/2);c.quadTo((n-A)/2-C,A+C,n/2,A+C);c.quadTo((n+A)/2+C,A+C,(n+A)/2+C,A/2);c.end();c.stroke()};mxCellRenderer.registerShape("requires",ea);mxUtils.extend(na,mxShape);na.prototype.paintBackground=function(c,m,v,n,u){c.translate(m,v);c.begin();c.moveTo(0,0);c.quadTo(n,0,n,u/2);c.quadTo(n,u,0,u);c.end();c.stroke()};mxCellRenderer.registerShape("requiredInterface",na);mxUtils.extend(ra,mxShape);ra.prototype.inset=2;ra.prototype.paintBackground=function(c,m,v,n,u){var A=parseFloat(mxUtils.getValue(this.style,
"inset",this.inset))+this.strokewidth;c.translate(m,v);c.ellipse(0,A,n-2*A,u-2*A);c.fillAndStroke();c.begin();c.moveTo(n/2,0);c.quadTo(n,0,n,u/2);c.quadTo(n,u,n/2,u);c.end();c.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",ra);mxUtils.extend(ya,mxCylinder);ya.prototype.jettyWidth=20;ya.prototype.jettyHeight=10;ya.prototype.redrawPath=function(c,m,v,n,u,A){var C=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));m=parseFloat(mxUtils.getValue(this.style,"jettyHeight",
this.jettyHeight));v=C/2;C=v+C/2;var ha=Math.min(m,u-m),K=Math.min(ha+2*m,u-m);A?(c.moveTo(v,ha),c.lineTo(C,ha),c.lineTo(C,ha+m),c.lineTo(v,ha+m),c.moveTo(v,K),c.lineTo(C,K),c.lineTo(C,K+m),c.lineTo(v,K+m)):(c.moveTo(v,0),c.lineTo(n,0),c.lineTo(n,u),c.lineTo(v,u),c.lineTo(v,K+m),c.lineTo(0,K+m),c.lineTo(0,K),c.lineTo(v,K),c.lineTo(v,ha+m),c.lineTo(0,ha+m),c.lineTo(0,ha),c.lineTo(v,ha),c.close());c.end()};mxCellRenderer.registerShape("module",ya);mxUtils.extend(va,mxCylinder);va.prototype.jettyWidth=
32;va.prototype.jettyHeight=12;va.prototype.redrawPath=function(c,m,v,n,u,A){var C=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));m=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));v=C/2;C=v+C/2;var ha=.3*u-m/2,K=.7*u-m/2;A?(c.moveTo(v,ha),c.lineTo(C,ha),c.lineTo(C,ha+m),c.lineTo(v,ha+m),c.moveTo(v,K),c.lineTo(C,K),c.lineTo(C,K+m),c.lineTo(v,K+m)):(c.moveTo(v,0),c.lineTo(n,0),c.lineTo(n,u),c.lineTo(v,u),c.lineTo(v,K+m),c.lineTo(0,K+m),c.lineTo(0,K),c.lineTo(v,
K),c.lineTo(v,ha+m),c.lineTo(0,ha+m),c.lineTo(0,ha),c.lineTo(v,ha),c.close());c.end()};mxCellRenderer.registerShape("component",va);mxUtils.extend(Da,mxRectangleShape);Da.prototype.paintForeground=function(c,m,v,n,u){var A=n/2,C=u/2,ha=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;c.begin();this.addPoints(c,[new mxPoint(m+A,v),new mxPoint(m+n,v+C),new mxPoint(m+A,v+u),new mxPoint(m,v+C)],this.isRounded,ha,!0);c.stroke();mxRectangleShape.prototype.paintForeground.apply(this,
arguments)};mxCellRenderer.registerShape("associativeEntity",Da);mxUtils.extend(pa,mxDoubleEllipse);pa.prototype.outerStroke=!0;pa.prototype.paintVertexShape=function(c,m,v,n,u){var A=Math.min(4,Math.min(n/5,u/5));0<n&&0<u&&(c.ellipse(m+A,v+A,n-2*A,u-2*A),c.fillAndStroke());c.setShadow(!1);this.outerStroke&&(c.ellipse(m,v,n,u),c.stroke())};mxCellRenderer.registerShape("endState",pa);mxUtils.extend(Aa,pa);Aa.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",Aa);mxUtils.extend(xa,mxArrowConnector);
xa.prototype.defaultWidth=4;xa.prototype.isOpenEnded=function(){return!0};xa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};xa.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",xa);mxUtils.extend(Ma,mxArrowConnector);Ma.prototype.defaultWidth=10;Ma.prototype.defaultArrowWidth=20;Ma.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,
"startWidth",this.defaultArrowWidth)};Ma.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Ma.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Ma);mxUtils.extend(Oa,mxActor);Oa.prototype.size=30;Oa.prototype.isRoundable=function(){return!0};Oa.prototype.redrawPath=function(c,m,v,n,u){m=Math.min(u,parseFloat(mxUtils.getValue(this.style,
"size",this.size)));v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,u),new mxPoint(0,m),new mxPoint(n,0),new mxPoint(n,u)],this.isRounded,v,!0);c.end()};mxCellRenderer.registerShape("manualInput",Oa);mxUtils.extend(Na,mxRectangleShape);Na.prototype.dx=20;Na.prototype.dy=20;Na.prototype.isHtmlAllowed=function(){return!1};Na.prototype.paintForeground=function(c,m,v,n,u){mxRectangleShape.prototype.paintForeground.apply(this,arguments);
var A=0;if(this.isRounded){var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;A=Math.max(A,Math.min(n*C,u*C))}C=Math.max(A,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));A=Math.max(A,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));c.begin();c.moveTo(m,v+A);c.lineTo(m+n,v+A);c.end();c.stroke();c.begin();c.moveTo(m+C,v);c.lineTo(m+C,v+u);c.end();c.stroke()};mxCellRenderer.registerShape("internalStorage",Na);
mxUtils.extend(La,mxActor);La.prototype.dx=20;La.prototype.dy=20;La.prototype.redrawPath=function(c,m,v,n,u){m=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));v=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,0),new mxPoint(n,0),new mxPoint(n,v),new mxPoint(m,v),
new mxPoint(m,u),new mxPoint(0,u)],this.isRounded,A,!0);c.end()};mxCellRenderer.registerShape("corner",La);mxUtils.extend(Ba,mxActor);Ba.prototype.redrawPath=function(c,m,v,n,u){c.moveTo(0,0);c.lineTo(0,u);c.end();c.moveTo(n,0);c.lineTo(n,u);c.end();c.moveTo(0,u/2);c.lineTo(n,u/2);c.end()};mxCellRenderer.registerShape("crossbar",Ba);mxUtils.extend(ab,mxActor);ab.prototype.dx=20;ab.prototype.dy=20;ab.prototype.redrawPath=function(c,m,v,n,u){m=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,
"dx",this.dx))));v=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,0),new mxPoint(n,0),new mxPoint(n,v),new mxPoint((n+m)/2,v),new mxPoint((n+m)/2,u),new mxPoint((n-m)/2,u),new mxPoint((n-m)/2,v),new mxPoint(0,v)],this.isRounded,A,!0);c.end()};mxCellRenderer.registerShape("tee",ab);mxUtils.extend(Xa,
mxActor);Xa.prototype.arrowWidth=.3;Xa.prototype.arrowSize=.2;Xa.prototype.redrawPath=function(c,m,v,n,u){var A=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));m=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));v=(u-A)/2;A=v+A;var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,v),new mxPoint(n-m,v),new mxPoint(n-m,0),new mxPoint(n,u/2),new mxPoint(n-
m,u),new mxPoint(n-m,A),new mxPoint(0,A)],this.isRounded,C,!0);c.end()};mxCellRenderer.registerShape("singleArrow",Xa);mxUtils.extend(x,mxActor);x.prototype.redrawPath=function(c,m,v,n,u){var A=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Xa.prototype.arrowWidth))));m=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Xa.prototype.arrowSize))));v=(u-A)/2;A=v+A;var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
2;this.addPoints(c,[new mxPoint(0,u/2),new mxPoint(m,0),new mxPoint(m,v),new mxPoint(n-m,v),new mxPoint(n-m,0),new mxPoint(n,u/2),new mxPoint(n-m,u),new mxPoint(n-m,A),new mxPoint(m,A),new mxPoint(m,u)],this.isRounded,C,!0);c.end()};mxCellRenderer.registerShape("doubleArrow",x);mxUtils.extend(H,mxActor);H.prototype.size=.1;H.prototype.fixedSize=20;H.prototype.redrawPath=function(c,m,v,n,u){m="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,
"size",this.fixedSize)))):n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c.moveTo(m,0);c.lineTo(n,0);c.quadTo(n-2*m,u/2,n,u);c.lineTo(m,u);c.quadTo(m-2*m,u/2,m,0);c.close();c.end()};mxCellRenderer.registerShape("dataStorage",H);mxUtils.extend(P,mxActor);P.prototype.redrawPath=function(c,m,v,n,u){c.moveTo(0,0);c.quadTo(n,0,n,u/2);c.quadTo(n,u,0,u);c.close();c.end()};mxCellRenderer.registerShape("or",P);mxUtils.extend(X,mxActor);X.prototype.redrawPath=function(c,
m,v,n,u){c.moveTo(0,0);c.quadTo(n,0,n,u/2);c.quadTo(n,u,0,u);c.quadTo(n/2,u/2,0,0);c.close();c.end()};mxCellRenderer.registerShape("xor",X);mxUtils.extend(Z,mxActor);Z.prototype.size=20;Z.prototype.isRoundable=function(){return!0};Z.prototype.redrawPath=function(c,m,v,n,u){m=Math.min(n/2,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size))));v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(m,0),new mxPoint(n-m,0),new mxPoint(n,
.8*m),new mxPoint(n,u),new mxPoint(0,u),new mxPoint(0,.8*m)],this.isRounded,v,!0);c.end()};mxCellRenderer.registerShape("loopLimit",Z);mxUtils.extend(fa,mxActor);fa.prototype.size=.375;fa.prototype.isRoundable=function(){return!0};fa.prototype.redrawPath=function(c,m,v,n,u){m=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,0),new mxPoint(n,0),new mxPoint(n,
u-m),new mxPoint(n/2,u),new mxPoint(0,u-m)],this.isRounded,v,!0);c.end()};mxCellRenderer.registerShape("offPageConnector",fa);mxUtils.extend(la,mxEllipse);la.prototype.paintVertexShape=function(c,m,v,n,u){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.begin();c.moveTo(m+n/2,v+u);c.lineTo(m+n,v+u);c.end();c.stroke()};mxCellRenderer.registerShape("tapeData",la);mxUtils.extend(za,mxEllipse);za.prototype.paintVertexShape=function(c,m,v,n,u){mxEllipse.prototype.paintVertexShape.apply(this,
arguments);c.setShadow(!1);c.begin();c.moveTo(m,v+u/2);c.lineTo(m+n,v+u/2);c.end();c.stroke();c.begin();c.moveTo(m+n/2,v);c.lineTo(m+n/2,v+u);c.end();c.stroke()};mxCellRenderer.registerShape("orEllipse",za);mxUtils.extend(ua,mxEllipse);ua.prototype.paintVertexShape=function(c,m,v,n,u){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();c.moveTo(m+.145*n,v+.145*u);c.lineTo(m+.855*n,v+.855*u);c.end();c.stroke();c.begin();c.moveTo(m+.855*n,v+.145*u);c.lineTo(m+.145*n,
v+.855*u);c.end();c.stroke()};mxCellRenderer.registerShape("sumEllipse",ua);mxUtils.extend(oa,mxRhombus);oa.prototype.paintVertexShape=function(c,m,v,n,u){mxRhombus.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();c.moveTo(m,v+u/2);c.lineTo(m+n,v+u/2);c.end();c.stroke()};mxCellRenderer.registerShape("sortShape",oa);mxUtils.extend(ta,mxEllipse);ta.prototype.paintVertexShape=function(c,m,v,n,u){c.begin();c.moveTo(m,v);c.lineTo(m+n,v);c.lineTo(m+n/2,v+u/2);c.close();c.fillAndStroke();
c.begin();c.moveTo(m,v+u);c.lineTo(m+n,v+u);c.lineTo(m+n/2,v+u/2);c.close();c.fillAndStroke()};mxCellRenderer.registerShape("collate",ta);mxUtils.extend(Ea,mxEllipse);Ea.prototype.paintVertexShape=function(c,m,v,n,u){var A=c.state.strokeWidth/2,C=10+2*A,ha=v+u-C/2;c.begin();c.moveTo(m,v);c.lineTo(m,v+u);c.moveTo(m+A,ha);c.lineTo(m+A+C,ha-C/2);c.moveTo(m+A,ha);c.lineTo(m+A+C,ha+C/2);c.moveTo(m+A,ha);c.lineTo(m+n-A,ha);c.moveTo(m+n,v);c.lineTo(m+n,v+u);c.moveTo(m+n-A,ha);c.lineTo(m+n-C-A,ha-C/2);c.moveTo(m+
n-A,ha);c.lineTo(m+n-C-A,ha+C/2);c.end();c.stroke()};mxCellRenderer.registerShape("dimension",Ea);mxUtils.extend(Fa,mxEllipse);Fa.prototype.drawHidden=!0;Fa.prototype.paintVertexShape=function(c,m,v,n,u){this.outline||c.setStrokeColor(null);if(null!=this.style){var A=c.pointerEvents,C=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||C||(c.pointerEvents=!1);var ha="1"==mxUtils.getValue(this.style,"top","1"),K="1"==mxUtils.getValue(this.style,
"left","1"),wa="1"==mxUtils.getValue(this.style,"right","1"),ma="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||C||this.outline||ha||wa||ma||K?(c.rect(m,v,n,u),c.fill(),c.pointerEvents=A,c.setStrokeColor(this.stroke),c.setLineCap("square"),c.begin(),c.moveTo(m,v),this.outline||ha?c.lineTo(m+n,v):c.moveTo(m+n,v),this.outline||wa?c.lineTo(m+n,v+u):c.moveTo(m+n,v+u),this.outline||ma?c.lineTo(m,v+u):c.moveTo(m,v+u),(this.outline||K)&&c.lineTo(m,v),c.end(),c.stroke(),c.setLineCap("flat")):
c.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",Fa);mxUtils.extend(Pa,mxEllipse);Pa.prototype.paintVertexShape=function(c,m,v,n,u){mxEllipse.prototype.paintVertexShape.apply(this,arguments);c.setShadow(!1);c.begin();"vertical"==mxUtils.getValue(this.style,"line")?(c.moveTo(m+n/2,v),c.lineTo(m+n/2,v+u)):(c.moveTo(m,v+u/2),c.lineTo(m+n,v+u/2));c.end();c.stroke()};mxCellRenderer.registerShape("lineEllipse",Pa);mxUtils.extend(Ra,mxActor);Ra.prototype.redrawPath=function(c,
m,v,n,u){m=Math.min(n,u/2);c.moveTo(0,0);c.lineTo(n-m,0);c.quadTo(n,0,n,u/2);c.quadTo(n,u,n-m,u);c.lineTo(0,u);c.close();c.end()};mxCellRenderer.registerShape("delay",Ra);mxUtils.extend(Ca,mxActor);Ca.prototype.size=.2;Ca.prototype.redrawPath=function(c,m,v,n,u){m=Math.min(u,n);var A=Math.max(0,Math.min(m,m*parseFloat(mxUtils.getValue(this.style,"size",this.size))));m=(u-A)/2;v=m+A;var C=(n-A)/2;A=C+A;c.moveTo(0,m);c.lineTo(C,m);c.lineTo(C,0);c.lineTo(A,0);c.lineTo(A,m);c.lineTo(n,m);c.lineTo(n,v);
c.lineTo(A,v);c.lineTo(A,u);c.lineTo(C,u);c.lineTo(C,v);c.lineTo(0,v);c.close();c.end()};mxCellRenderer.registerShape("cross",Ca);mxUtils.extend(Ja,mxActor);Ja.prototype.size=.25;Ja.prototype.redrawPath=function(c,m,v,n,u){m=Math.min(n,u/2);v=Math.min(n-m,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*n);c.moveTo(0,u/2);c.lineTo(v,0);c.lineTo(n-m,0);c.quadTo(n,0,n,u/2);c.quadTo(n,u,n-m,u);c.lineTo(v,u);c.close();c.end()};mxCellRenderer.registerShape("display",Ja);mxUtils.extend(Qa,
mxActor);Qa.prototype.cst={RECT2:"mxgraph.basic.rect"};Qa.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"size",dispName:"Corner Size",type:"float",defVal:10},{name:"absoluteCornerSize",dispName:"Abs. Corner Size",type:"bool",defVal:!0},{name:"indent",dispName:"Indent",type:"float",
defVal:2},{name:"rectOutline",dispName:"Outline",type:"enum",defVal:"single",enumList:[{val:"single",dispName:"Single"},{val:"double",dispName:"Double"},{val:"frame",dispName:"Frame"}]},{name:"fillColor2",dispName:"Inside Fill Color",type:"color",defVal:"none"},{name:"gradientColor2",dispName:"Inside Gradient Color",type:"color",defVal:"none"},{name:"gradientDirection2",dispName:"Inside Gradient Direction",type:"enum",defVal:"south",enumList:[{val:"south",dispName:"South"},{val:"west",dispName:"West"},
{val:"north",dispName:"North"},{val:"east",dispName:"East"}]},{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"right",dispName:"Right",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left ",type:"bool",defVal:!0},{name:"topLeftStyle",dispName:"Top Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},
{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"topRightStyle",dispName:"Top Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomRightStyle",dispName:"Bottom Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",
dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomLeftStyle",dispName:"Bottom Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]}];Qa.prototype.paintVertexShape=function(c,m,v,n,u){c.translate(m,
v);this.strictDrawShape(c,0,0,n,u)};Qa.prototype.strictDrawShape=function(c,m,v,n,u,A){var C=A&&A.rectStyle?A.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ha=A&&A.absoluteCornerSize?A.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),K=A&&A.size?A.size:Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),wa=A&&A.rectOutline?A.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),ma=A&&A.indent?
A.indent:Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Wa=A&&A.dashed?A.dashed:mxUtils.getValue(this.style,"dashed",!1),jb=A&&A.dashPattern?A.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),bb=A&&A.relIndent?A.relIndent:Math.max(0,Math.min(50,ma)),Ga=A&&A.top?A.top:mxUtils.getValue(this.style,"top",!0),Ka=A&&A.right?A.right:mxUtils.getValue(this.style,"right",!0),Ia=A&&A.bottom?A.bottom:mxUtils.getValue(this.style,"bottom",!0),Ha=A&&A.left?A.left:
mxUtils.getValue(this.style,"left",!0),Sa=A&&A.topLeftStyle?A.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),Ta=A&&A.topRightStyle?A.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),Ua=A&&A.bottomRightStyle?A.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),Va=A&&A.bottomLeftStyle?A.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),Fb=A&&A.fillColor?A.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");
A&&A.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var Gb=A&&A.strokeWidth?A.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),Db=A&&A.fillColor2?A.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),Eb=A&&A.gradientColor2?A.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),Hb=A&&A.gradientDirection2?A.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2","south"),Ib=A&&A.opacity?A.opacity:mxUtils.getValue(this.style,"opacity","100"),
Jb=Math.max(0,Math.min(50,K));A=Qa.prototype;c.setDashed(Wa);jb&&""!=jb&&c.setDashPattern(jb);c.setStrokeWidth(Gb);K=Math.min(.5*u,.5*n,K);ha||(K=Jb*Math.min(n,u)/100);K=Math.min(K,.5*Math.min(n,u));ha||(ma=Math.min(bb*Math.min(n,u)/100));ma=Math.min(ma,.5*Math.min(n,u)-K);(Ga||Ka||Ia||Ha)&&"frame"!=wa&&(c.begin(),Ga?A.moveNW(c,m,v,n,u,C,Sa,K,Ha):c.moveTo(0,0),Ga&&A.paintNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),Ka&&A.paintNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),Ia&&
A.paintSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),Ha&&A.paintSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),c.close(),c.fill(),c.setShadow(!1),c.setFillColor(Db),Wa=ha=Ib,"none"==Db&&(ha=0),"none"==Eb&&(Wa=0),c.setGradient(Db,Eb,0,0,n,u,Hb,ha,Wa),c.begin(),Ga?A.moveNWInner(c,m,v,n,u,C,Sa,K,ma,Ga,Ha):c.moveTo(ma,0),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),Ha&&Ia&&A.paintSWInner(c,m,v,n,u,C,Va,K,ma,Ia),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),Ia&&Ka&&A.paintSEInner(c,
m,v,n,u,C,Ua,K,ma),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),Ka&&Ga&&A.paintNEInner(c,m,v,n,u,C,Ta,K,ma),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),Ga&&Ha&&A.paintNWInner(c,m,v,n,u,C,Sa,K,ma),c.fill(),"none"==Fb&&(c.begin(),A.paintFolds(c,m,v,n,u,C,Sa,Ta,Ua,Va,K,Ga,Ka,Ia,Ha),c.stroke()));Ga||Ka||Ia||!Ha?Ga||Ka||!Ia||Ha?!Ga&&!Ka&&Ia&&Ha?"frame"!=wa?(c.begin(),A.moveSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),A.paintSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),"double"==
wa&&(A.moveNWInner(c,m,v,n,u,C,Sa,K,ma,Ga,Ha),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),A.paintSWInner(c,m,v,n,u,C,Va,K,ma,Ia),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia)),c.stroke()):(c.begin(),A.moveSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),A.paintSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),A.lineNWInner(c,m,v,n,u,C,Sa,K,ma,Ga,Ha),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),A.paintSWInner(c,m,v,n,u,C,Va,K,ma,Ia),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),c.close(),
c.fillAndStroke()):Ga||!Ka||Ia||Ha?!Ga&&Ka&&!Ia&&Ha?"frame"!=wa?(c.begin(),A.moveSW(c,m,v,n,u,C,Sa,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),"double"==wa&&(A.moveNWInner(c,m,v,n,u,C,Sa,K,ma,Ga,Ha),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha)),c.stroke(),c.begin(),A.moveNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),"double"==wa&&(A.moveSEInner(c,m,v,n,u,C,Ua,K,ma,Ia),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka)),c.stroke()):(c.begin(),A.moveSW(c,m,v,n,u,C,Sa,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,
K,Ga),A.lineNWInner(c,m,v,n,u,C,Sa,K,ma,Ga,Ha),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),c.close(),c.fillAndStroke(),c.begin(),A.moveNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.lineSEInner(c,m,v,n,u,C,Ua,K,ma,Ia),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),c.close(),c.fillAndStroke()):!Ga&&Ka&&Ia&&!Ha?"frame"!=wa?(c.begin(),A.moveNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.paintSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),"double"==wa&&(A.moveSWInner(c,
m,v,n,u,C,Va,K,ma,Ha),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),A.paintSEInner(c,m,v,n,u,C,Ua,K,ma),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka)),c.stroke()):(c.begin(),A.moveNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.paintSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),A.lineSWInner(c,m,v,n,u,C,Va,K,ma,Ha),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),A.paintSEInner(c,m,v,n,u,C,Ua,K,ma),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),c.close(),c.fillAndStroke()):!Ga&&
Ka&&Ia&&Ha?"frame"!=wa?(c.begin(),A.moveNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.paintSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),A.paintSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),"double"==wa&&(A.moveNWInner(c,m,v,n,u,C,Sa,K,ma,Ga,Ha),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),A.paintSWInner(c,m,v,n,u,C,Va,K,ma,Ia),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),A.paintSEInner(c,m,v,n,u,C,Ua,K,ma),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka)),c.stroke()):
(c.begin(),A.moveNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.paintSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),A.paintSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),A.lineNWInner(c,m,v,n,u,C,Sa,K,ma,Ga,Ha),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),A.paintSWInner(c,m,v,n,u,C,Va,K,ma,Ia),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),A.paintSEInner(c,m,v,n,u,C,Ua,K,ma),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),c.close(),c.fillAndStroke()):!Ga||Ka||Ia||Ha?
Ga&&!Ka&&!Ia&&Ha?"frame"!=wa?(c.begin(),A.moveSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),A.paintNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),"double"==wa&&(A.moveNEInner(c,m,v,n,u,C,Ta,K,ma,Ka),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),A.paintNWInner(c,m,v,n,u,C,Sa,K,ma),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha)),c.stroke()):(c.begin(),A.moveSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),A.paintNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),A.lineNEInner(c,
m,v,n,u,C,Ta,K,ma,Ka),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),A.paintNWInner(c,m,v,n,u,C,Sa,K,ma),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),c.close(),c.fillAndStroke()):Ga&&!Ka&&Ia&&!Ha?"frame"!=wa?(c.begin(),A.moveNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),"double"==wa&&(A.moveNEInner(c,m,v,n,u,C,Ta,K,ma,Ka),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga)),c.stroke(),c.begin(),A.moveSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),"double"==wa&&(A.moveSWInner(c,m,v,n,u,C,Va,
K,ma,Ha),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia)),c.stroke()):(c.begin(),A.moveNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),A.lineNEInner(c,m,v,n,u,C,Ta,K,ma,Ka),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),c.close(),c.fillAndStroke(),c.begin(),A.moveSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),A.lineSWInner(c,m,v,n,u,C,Va,K,ma,Ha),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),c.close(),c.fillAndStroke()):Ga&&!Ka&&Ia&&Ha?"frame"!=wa?(c.begin(),A.moveSE(c,m,v,n,u,C,Ua,
K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),A.paintSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),A.paintNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),"double"==wa&&(A.moveNEInner(c,m,v,n,u,C,Ta,K,ma,Ka),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),A.paintNWInner(c,m,v,n,u,C,Sa,K,ma),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),A.paintSWInner(c,m,v,n,u,C,Va,K,ma,Ia),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia)),c.stroke()):(c.begin(),A.moveSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,
v,n,u,C,Va,K,Ha),A.paintSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),A.paintNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),A.lineNEInner(c,m,v,n,u,C,Ta,K,ma,Ka),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),A.paintNWInner(c,m,v,n,u,C,Sa,K,ma),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),A.paintSWInner(c,m,v,n,u,C,Va,K,ma,Ia),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),c.close(),c.fillAndStroke()):Ga&&Ka&&!Ia&&!Ha?"frame"!=wa?(c.begin(),A.moveNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,
m,v,n,u,C,Ta,K,Ka),A.paintNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),"double"==wa&&(A.moveSEInner(c,m,v,n,u,C,Ua,K,ma,Ia),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),A.paintNEInner(c,m,v,n,u,C,Ta,K,ma),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga)),c.stroke()):(c.begin(),A.moveNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),A.paintNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.lineSEInner(c,m,v,n,u,C,Ua,K,ma,Ia),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),A.paintNEInner(c,
m,v,n,u,C,Ta,K,ma),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),c.close(),c.fillAndStroke()):Ga&&Ka&&!Ia&&Ha?"frame"!=wa?(c.begin(),A.moveSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),A.paintNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),A.paintNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),"double"==wa&&(A.moveSEInner(c,m,v,n,u,C,Ua,K,ma,Ia),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),A.paintNEInner(c,m,v,n,u,C,Ta,K,ma),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),A.paintNWInner(c,
m,v,n,u,C,Sa,K,ma),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha)),c.stroke()):(c.begin(),A.moveSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),A.paintNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),A.paintNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.lineSEInner(c,m,v,n,u,C,Ua,K,ma,Ia),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),A.paintNEInner(c,m,v,n,u,C,Ta,K,ma),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),A.paintNWInner(c,m,v,n,u,C,Sa,K,ma),A.paintLeftInner(c,m,v,n,
u,C,Va,K,ma,Ia,Ha),c.close(),c.fillAndStroke()):Ga&&Ka&&Ia&&!Ha?"frame"!=wa?(c.begin(),A.moveNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),A.paintNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.paintSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),"double"==wa&&(A.moveSWInner(c,m,v,n,u,C,Va,K,ma,Ha),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),A.paintSEInner(c,m,v,n,u,C,Ua,K,ma),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),A.paintNEInner(c,m,v,n,u,C,Ta,K,ma),A.paintTopInner(c,
m,v,n,u,C,Sa,K,ma,Ha,Ga)),c.stroke()):(c.begin(),A.moveNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),A.paintNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.paintSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),A.lineSWInner(c,m,v,n,u,C,Va,K,ma,Ha),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),A.paintSEInner(c,m,v,n,u,C,Ua,K,ma),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),A.paintNEInner(c,m,v,n,u,C,Ta,K,ma),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),c.close(),c.fillAndStroke()):
Ga&&Ka&&Ia&&Ha&&("frame"!=wa?(c.begin(),A.moveNW(c,m,v,n,u,C,Sa,K,Ha),A.paintNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),A.paintNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.paintSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),A.paintSW(c,m,v,n,u,C,Va,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),c.close(),"double"==wa&&(A.moveSWInner(c,m,v,n,u,C,Va,K,ma,Ha),A.paintSWInner(c,m,v,n,u,C,Va,K,ma,Ia),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),A.paintSEInner(c,m,v,n,u,
C,Ua,K,ma),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),A.paintNEInner(c,m,v,n,u,C,Ta,K,ma),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),A.paintNWInner(c,m,v,n,u,C,Sa,K,ma),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),c.close()),c.stroke()):(c.begin(),A.moveNW(c,m,v,n,u,C,Sa,K,Ha),A.paintNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),A.paintNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.paintSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),A.paintSW(c,m,v,n,u,C,Va,K,Ia),
A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),c.close(),A.moveSWInner(c,m,v,n,u,C,Va,K,ma,Ha),A.paintSWInner(c,m,v,n,u,C,Va,K,ma,Ia),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),A.paintSEInner(c,m,v,n,u,C,Ua,K,ma),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),A.paintNEInner(c,m,v,n,u,C,Ta,K,ma),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),A.paintNWInner(c,m,v,n,u,C,Sa,K,ma),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),c.close(),c.fillAndStroke())):"frame"!=wa?(c.begin(),A.moveNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,
m,v,n,u,C,Ta,K,Ka),"double"==wa&&(A.moveNEInner(c,m,v,n,u,C,Ta,K,ma,Ka),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga)),c.stroke()):(c.begin(),A.moveNW(c,m,v,n,u,C,Sa,K,Ha),A.paintTop(c,m,v,n,u,C,Ta,K,Ka),A.lineNEInner(c,m,v,n,u,C,Ta,K,ma,Ka),A.paintTopInner(c,m,v,n,u,C,Sa,K,ma,Ha,Ga),c.close(),c.fillAndStroke()):"frame"!=wa?(c.begin(),A.moveNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),"double"==wa&&(A.moveSEInner(c,m,v,n,u,C,Ua,K,ma,Ia),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka)),c.stroke()):
(c.begin(),A.moveNE(c,m,v,n,u,C,Ta,K,Ga),A.paintRight(c,m,v,n,u,C,Ua,K,Ia),A.lineSEInner(c,m,v,n,u,C,Ua,K,ma,Ia),A.paintRightInner(c,m,v,n,u,C,Ta,K,ma,Ga,Ka),c.close(),c.fillAndStroke()):"frame"!=wa?(c.begin(),A.moveSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),"double"==wa&&(A.moveSWInner(c,m,v,n,u,C,Va,K,ma,Ha),A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia)),c.stroke()):(c.begin(),A.moveSE(c,m,v,n,u,C,Ua,K,Ka),A.paintBottom(c,m,v,n,u,C,Va,K,Ha),A.lineSWInner(c,m,v,n,u,C,Va,K,ma,Ha),
A.paintBottomInner(c,m,v,n,u,C,Ua,K,ma,Ka,Ia),c.close(),c.fillAndStroke()):"frame"!=wa?(c.begin(),A.moveSW(c,m,v,n,u,C,Sa,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),"double"==wa&&(A.moveNWInner(c,m,v,n,u,C,Sa,K,ma,Ga,Ha),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha)),c.stroke()):(c.begin(),A.moveSW(c,m,v,n,u,C,Sa,K,Ia),A.paintLeft(c,m,v,n,u,C,Sa,K,Ga),A.lineNWInner(c,m,v,n,u,C,Sa,K,ma,Ga,Ha),A.paintLeftInner(c,m,v,n,u,C,Va,K,ma,Ia,Ha),c.close(),c.fillAndStroke());c.begin();A.paintFolds(c,m,v,n,u,C,Sa,Ta,
Ua,Va,K,Ga,Ka,Ia,Ha);c.stroke()};Qa.prototype.moveNW=function(c,m,v,n,u,A,C,ha,K){"square"==C||"default"==C&&"square"==A||!K?c.moveTo(0,0):c.moveTo(0,ha)};Qa.prototype.moveNE=function(c,m,v,n,u,A,C,ha,K){"square"==C||"default"==C&&"square"==A||!K?c.moveTo(n,0):c.moveTo(n-ha,0)};Qa.prototype.moveSE=function(c,m,v,n,u,A,C,ha,K){"square"==C||"default"==C&&"square"==A||!K?c.moveTo(n,u):c.moveTo(n,u-ha)};Qa.prototype.moveSW=function(c,m,v,n,u,A,C,ha,K){"square"==C||"default"==C&&"square"==A||!K?c.moveTo(0,
u):c.moveTo(ha,u)};Qa.prototype.paintNW=function(c,m,v,n,u,A,C,ha,K){if(K)if("rounded"==C||"default"==C&&"rounded"==A||"invRound"==C||"default"==C&&"invRound"==A){m=0;if("rounded"==C||"default"==C&&"rounded"==A)m=1;c.arcTo(ha,ha,0,0,m,ha,0)}else("snip"==C||"default"==C&&"snip"==A||"fold"==C||"default"==C&&"fold"==A)&&c.lineTo(ha,0);else c.lineTo(0,0)};Qa.prototype.paintTop=function(c,m,v,n,u,A,C,ha,K){"square"==C||"default"==C&&"square"==A||!K?c.lineTo(n,0):c.lineTo(n-ha,0)};Qa.prototype.paintNE=
function(c,m,v,n,u,A,C,ha,K){if(K)if("rounded"==C||"default"==C&&"rounded"==A||"invRound"==C||"default"==C&&"invRound"==A){m=0;if("rounded"==C||"default"==C&&"rounded"==A)m=1;c.arcTo(ha,ha,0,0,m,n,ha)}else("snip"==C||"default"==C&&"snip"==A||"fold"==C||"default"==C&&"fold"==A)&&c.lineTo(n,ha);else c.lineTo(n,0)};Qa.prototype.paintRight=function(c,m,v,n,u,A,C,ha,K){"square"==C||"default"==C&&"square"==A||!K?c.lineTo(n,u):c.lineTo(n,u-ha)};Qa.prototype.paintLeft=function(c,m,v,n,u,A,C,ha,K){"square"==
C||"default"==C&&"square"==A||!K?c.lineTo(0,0):c.lineTo(0,ha)};Qa.prototype.paintSE=function(c,m,v,n,u,A,C,ha,K){if(K)if("rounded"==C||"default"==C&&"rounded"==A||"invRound"==C||"default"==C&&"invRound"==A){m=0;if("rounded"==C||"default"==C&&"rounded"==A)m=1;c.arcTo(ha,ha,0,0,m,n-ha,u)}else("snip"==C||"default"==C&&"snip"==A||"fold"==C||"default"==C&&"fold"==A)&&c.lineTo(n-ha,u);else c.lineTo(n,u)};Qa.prototype.paintBottom=function(c,m,v,n,u,A,C,ha,K){"square"==C||"default"==C&&"square"==A||!K?c.lineTo(0,
u):c.lineTo(ha,u)};Qa.prototype.paintSW=function(c,m,v,n,u,A,C,ha,K){if(K)if("rounded"==C||"default"==C&&"rounded"==A||"invRound"==C||"default"==C&&"invRound"==A){m=0;if("rounded"==C||"default"==C&&"rounded"==A)m=1;c.arcTo(ha,ha,0,0,m,0,u-ha)}else("snip"==C||"default"==C&&"snip"==A||"fold"==C||"default"==C&&"fold"==A)&&c.lineTo(0,u-ha);else c.lineTo(0,u)};Qa.prototype.paintNWInner=function(c,m,v,n,u,A,C,ha,K){if("rounded"==C||"default"==C&&"rounded"==A)c.arcTo(ha-.5*K,ha-.5*K,0,0,0,K,.5*K+ha);else if("invRound"==
C||"default"==C&&"invRound"==A)c.arcTo(ha+K,ha+K,0,0,1,K,K+ha);else if("snip"==C||"default"==C&&"snip"==A)c.lineTo(K,.5*K+ha);else if("fold"==C||"default"==C&&"fold"==A)c.lineTo(K+ha,K+ha),c.lineTo(K,K+ha)};Qa.prototype.paintTopInner=function(c,m,v,n,u,A,C,ha,K,wa,ma){wa||ma?!wa&&ma?c.lineTo(0,K):wa&&!ma?c.lineTo(K,0):wa?"square"==C||"default"==C&&"square"==A?c.lineTo(K,K):"rounded"==C||"default"==C&&"rounded"==A||"snip"==C||"default"==C&&"snip"==A?c.lineTo(ha+.5*K,K):c.lineTo(ha+K,K):c.lineTo(0,
K):c.lineTo(0,0)};Qa.prototype.paintNEInner=function(c,m,v,n,u,A,C,ha,K){if("rounded"==C||"default"==C&&"rounded"==A)c.arcTo(ha-.5*K,ha-.5*K,0,0,0,n-ha-.5*K,K);else if("invRound"==C||"default"==C&&"invRound"==A)c.arcTo(ha+K,ha+K,0,0,1,n-ha-K,K);else if("snip"==C||"default"==C&&"snip"==A)c.lineTo(n-ha-.5*K,K);else if("fold"==C||"default"==C&&"fold"==A)c.lineTo(n-ha-K,ha+K),c.lineTo(n-ha-K,K)};Qa.prototype.paintRightInner=function(c,m,v,n,u,A,C,ha,K,wa,ma){wa||ma?!wa&&ma?c.lineTo(n-K,0):wa&&!ma?c.lineTo(n,
K):wa?"square"==C||"default"==C&&"square"==A?c.lineTo(n-K,K):"rounded"==C||"default"==C&&"rounded"==A||"snip"==C||"default"==C&&"snip"==A?c.lineTo(n-K,ha+.5*K):c.lineTo(n-K,ha+K):c.lineTo(n-K,0):c.lineTo(n,0)};Qa.prototype.paintLeftInner=function(c,m,v,n,u,A,C,ha,K,wa,ma){wa||ma?!wa&&ma?c.lineTo(K,u):wa&&!ma?c.lineTo(0,u-K):wa?"square"==C||"default"==C&&"square"==A?c.lineTo(K,u-K):"rounded"==C||"default"==C&&"rounded"==A||"snip"==C||"default"==C&&"snip"==A?c.lineTo(K,u-ha-.5*K):c.lineTo(K,u-ha-K):
c.lineTo(K,u):c.lineTo(0,u)};Qa.prototype.paintSEInner=function(c,m,v,n,u,A,C,ha,K){if("rounded"==C||"default"==C&&"rounded"==A)c.arcTo(ha-.5*K,ha-.5*K,0,0,0,n-K,u-ha-.5*K);else if("invRound"==C||"default"==C&&"invRound"==A)c.arcTo(ha+K,ha+K,0,0,1,n-K,u-ha-K);else if("snip"==C||"default"==C&&"snip"==A)c.lineTo(n-K,u-ha-.5*K);else if("fold"==C||"default"==C&&"fold"==A)c.lineTo(n-ha-K,u-ha-K),c.lineTo(n-K,u-ha-K)};Qa.prototype.paintBottomInner=function(c,m,v,n,u,A,C,ha,K,wa,ma){wa||ma?!wa&&ma?c.lineTo(n,
u-K):wa&&!ma?c.lineTo(n-K,u):"square"==C||"default"==C&&"square"==A||!wa?c.lineTo(n-K,u-K):"rounded"==C||"default"==C&&"rounded"==A||"snip"==C||"default"==C&&"snip"==A?c.lineTo(n-ha-.5*K,u-K):c.lineTo(n-ha-K,u-K):c.lineTo(n,u)};Qa.prototype.paintSWInner=function(c,m,v,n,u,A,C,ha,K,wa){if(!wa)c.lineTo(K,u);else if("square"==C||"default"==C&&"square"==A)c.lineTo(K,u-K);else if("rounded"==C||"default"==C&&"rounded"==A)c.arcTo(ha-.5*K,ha-.5*K,0,0,0,ha+.5*K,u-K);else if("invRound"==C||"default"==C&&"invRound"==
A)c.arcTo(ha+K,ha+K,0,0,1,ha+K,u-K);else if("snip"==C||"default"==C&&"snip"==A)c.lineTo(ha+.5*K,u-K);else if("fold"==C||"default"==C&&"fold"==A)c.lineTo(K+ha,u-ha-K),c.lineTo(K+ha,u-K)};Qa.prototype.moveSWInner=function(c,m,v,n,u,A,C,ha,K,wa){wa?"square"==C||"default"==C&&"square"==A?c.moveTo(K,u-K):"rounded"==C||"default"==C&&"rounded"==A||"snip"==C||"default"==C&&"snip"==A?c.moveTo(K,u-ha-.5*K):("invRound"==C||"default"==C&&"invRound"==A||"fold"==C||"default"==C&&"fold"==A)&&c.moveTo(K,u-ha-K):
c.moveTo(0,u-K)};Qa.prototype.lineSWInner=function(c,m,v,n,u,A,C,ha,K,wa){wa?"square"==C||"default"==C&&"square"==A?c.lineTo(K,u-K):"rounded"==C||"default"==C&&"rounded"==A||"snip"==C||"default"==C&&"snip"==A?c.lineTo(K,u-ha-.5*K):("invRound"==C||"default"==C&&"invRound"==A||"fold"==C||"default"==C&&"fold"==A)&&c.lineTo(K,u-ha-K):c.lineTo(0,u-K)};Qa.prototype.moveSEInner=function(c,m,v,n,u,A,C,ha,K,wa){wa?"square"==C||"default"==C&&"square"==A?c.moveTo(n-K,u-K):"rounded"==C||"default"==C&&"rounded"==
A||"snip"==C||"default"==C&&"snip"==A?c.moveTo(n-K,u-ha-.5*K):("invRound"==C||"default"==C&&"invRound"==A||"fold"==C||"default"==C&&"fold"==A)&&c.moveTo(n-K,u-ha-K):c.moveTo(n-K,u)};Qa.prototype.lineSEInner=function(c,m,v,n,u,A,C,ha,K,wa){wa?"square"==C||"default"==C&&"square"==A?c.lineTo(n-K,u-K):"rounded"==C||"default"==C&&"rounded"==A||"snip"==C||"default"==C&&"snip"==A?c.lineTo(n-K,u-ha-.5*K):("invRound"==C||"default"==C&&"invRound"==A||"fold"==C||"default"==C&&"fold"==A)&&c.lineTo(n-K,u-ha-K):
c.lineTo(n-K,u)};Qa.prototype.moveNEInner=function(c,m,v,n,u,A,C,ha,K,wa){wa?"square"==C||"default"==C&&"square"==A||wa?c.moveTo(n-K,K):"rounded"==C||"default"==C&&"rounded"==A||"snip"==C||"default"==C&&"snip"==A?c.moveTo(n-K,ha+.5*K):("invRound"==C||"default"==C&&"invRound"==A||"fold"==C||"default"==C&&"fold"==A)&&c.moveTo(n-K,ha+K):c.moveTo(n,K)};Qa.prototype.lineNEInner=function(c,m,v,n,u,A,C,ha,K,wa){wa?"square"==C||"default"==C&&"square"==A||wa?c.lineTo(n-K,K):"rounded"==C||"default"==C&&"rounded"==
A||"snip"==C||"default"==C&&"snip"==A?c.lineTo(n-K,ha+.5*K):("invRound"==C||"default"==C&&"invRound"==A||"fold"==C||"default"==C&&"fold"==A)&&c.lineTo(n-K,ha+K):c.lineTo(n,K)};Qa.prototype.moveNWInner=function(c,m,v,n,u,A,C,ha,K,wa,ma){wa||ma?!wa&&ma?c.moveTo(K,0):wa&&!ma?c.moveTo(0,K):"square"==C||"default"==C&&"square"==A?c.moveTo(K,K):"rounded"==C||"default"==C&&"rounded"==A||"snip"==C||"default"==C&&"snip"==A?c.moveTo(K,ha+.5*K):("invRound"==C||"default"==C&&"invRound"==A||"fold"==C||"default"==
C&&"fold"==A)&&c.moveTo(K,ha+K):c.moveTo(0,0)};Qa.prototype.lineNWInner=function(c,m,v,n,u,A,C,ha,K,wa,ma){wa||ma?!wa&&ma?c.lineTo(K,0):wa&&!ma?c.lineTo(0,K):"square"==C||"default"==C&&"square"==A?c.lineTo(K,K):"rounded"==C||"default"==C&&"rounded"==A||"snip"==C||"default"==C&&"snip"==A?c.lineTo(K,ha+.5*K):("invRound"==C||"default"==C&&"invRound"==A||"fold"==C||"default"==C&&"fold"==A)&&c.lineTo(K,ha+K):c.lineTo(0,0)};Qa.prototype.paintFolds=function(c,m,v,n,u,A,C,ha,K,wa,ma,Wa,jb,bb,Ga){if("fold"==
A||"fold"==C||"fold"==ha||"fold"==K||"fold"==wa)("fold"==C||"default"==C&&"fold"==A)&&Wa&&Ga&&(c.moveTo(0,ma),c.lineTo(ma,ma),c.lineTo(ma,0)),("fold"==ha||"default"==ha&&"fold"==A)&&Wa&&jb&&(c.moveTo(n-ma,0),c.lineTo(n-ma,ma),c.lineTo(n,ma)),("fold"==K||"default"==K&&"fold"==A)&&bb&&jb&&(c.moveTo(n-ma,u),c.lineTo(n-ma,u-ma),c.lineTo(n,u-ma)),("fold"==wa||"default"==wa&&"fold"==A)&&bb&&Ga&&(c.moveTo(0,u-ma),c.lineTo(ma,u-ma),c.lineTo(ma,u))};mxCellRenderer.registerShape(Qa.prototype.cst.RECT2,Qa);
Qa.prototype.constraints=null;mxUtils.extend($a,mxConnector);$a.prototype.origPaintEdgeShape=$a.prototype.paintEdgeShape;$a.prototype.paintEdgeShape=function(c,m,v){for(var n=[],u=0;u<m.length;u++)n.push(mxUtils.clone(m[u]));u=c.state.dashed;var A=c.state.fixDash;$a.prototype.origPaintEdgeShape.apply(this,[c,n,v]);3<=c.state.strokeWidth&&(n=mxUtils.getValue(this.style,"fillColor",null),null!=n&&(c.setStrokeColor(n),c.setStrokeWidth(c.state.strokeWidth-2),c.setDashed(u,A),$a.prototype.origPaintEdgeShape.apply(this,
[c,m,v])))};mxCellRenderer.registerShape("filledEdge",$a);"undefined"!==typeof StyleFormatPanel&&function(){var c=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var m=this.editorUi.getSelectionState(),v=c.apply(this,arguments);"umlFrame"==m.style.shape&&v.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return v}}();mxMarker.addMarker("dash",function(c,m,v,n,u,A,C,ha,K,wa){var ma=u*(C+K+1),Wa=A*(C+K+1);return function(){c.begin();
c.moveTo(n.x-ma/2-Wa/2,n.y-Wa/2+ma/2);c.lineTo(n.x+Wa/2-3*ma/2,n.y-3*Wa/2-ma/2);c.stroke()}});mxMarker.addMarker("box",function(c,m,v,n,u,A,C,ha,K,wa){var ma=u*(C+K+1),Wa=A*(C+K+1),jb=n.x+ma/2,bb=n.y+Wa/2;n.x-=ma;n.y-=Wa;return function(){c.begin();c.moveTo(jb-ma/2-Wa/2,bb-Wa/2+ma/2);c.lineTo(jb-ma/2+Wa/2,bb-Wa/2-ma/2);c.lineTo(jb+Wa/2-3*ma/2,bb-3*Wa/2-ma/2);c.lineTo(jb-Wa/2-3*ma/2,bb-3*Wa/2+ma/2);c.close();wa?c.fillAndStroke():c.stroke()}});mxMarker.addMarker("cross",function(c,m,v,n,u,A,C,ha,K,
wa){var ma=u*(C+K+1),Wa=A*(C+K+1);return function(){c.begin();c.moveTo(n.x-ma/2-Wa/2,n.y-Wa/2+ma/2);c.lineTo(n.x+Wa/2-3*ma/2,n.y-3*Wa/2-ma/2);c.moveTo(n.x-ma/2+Wa/2,n.y-Wa/2-ma/2);c.lineTo(n.x-Wa/2-3*ma/2,n.y-3*Wa/2+ma/2);c.stroke()}});mxMarker.addMarker("circle",eb);mxMarker.addMarker("circlePlus",function(c,m,v,n,u,A,C,ha,K,wa){var ma=n.clone(),Wa=eb.apply(this,arguments),jb=u*(C+2*K),bb=A*(C+2*K);return function(){Wa.apply(this,arguments);c.begin();c.moveTo(ma.x-u*K,ma.y-A*K);c.lineTo(ma.x-2*jb+
u*K,ma.y-2*bb+A*K);c.moveTo(ma.x-jb-bb+A*K,ma.y-bb+jb-u*K);c.lineTo(ma.x+bb-jb-A*K,ma.y-bb-jb+u*K);c.stroke()}});mxMarker.addMarker("halfCircle",function(c,m,v,n,u,A,C,ha,K,wa){var ma=u*(C+K+1),Wa=A*(C+K+1),jb=n.clone();n.x-=ma;n.y-=Wa;return function(){c.begin();c.moveTo(jb.x-Wa,jb.y+ma);c.quadTo(n.x-Wa,n.y+ma,n.x,n.y);c.quadTo(n.x+Wa,n.y-ma,jb.x+Wa,jb.y-ma);c.stroke()}});mxMarker.addMarker("async",function(c,m,v,n,u,A,C,ha,K,wa){m=u*K*1.118;v=A*K*1.118;u*=C+K;A*=C+K;var ma=n.clone();ma.x-=m;ma.y-=
v;n.x+=-u-m;n.y+=-A-v;return function(){c.begin();c.moveTo(ma.x,ma.y);ha?c.lineTo(ma.x-u-A/2,ma.y-A+u/2):c.lineTo(ma.x+A/2-u,ma.y-A-u/2);c.lineTo(ma.x-u,ma.y-A);c.close();wa?c.fillAndStroke():c.stroke()}});mxMarker.addMarker("openAsync",function(c){c=null!=c?c:2;return function(m,v,n,u,A,C,ha,K,wa,ma){A*=ha+wa;C*=ha+wa;var Wa=u.clone();return function(){m.begin();m.moveTo(Wa.x,Wa.y);K?m.lineTo(Wa.x-A-C/c,Wa.y-C+A/c):m.lineTo(Wa.x+C/c-A,Wa.y-C-A/c);m.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var fb=
function(c,m,v){return hb(c,["width"],m,function(n,u,A,C,ha){ha=c.shape.getEdgeWidth()*c.view.scale+v;return new mxPoint(C.x+u*n/4+A*ha/2,C.y+A*n/4-u*ha/2)},function(n,u,A,C,ha,K){n=Math.sqrt(mxUtils.ptSegDistSq(C.x,C.y,ha.x,ha.y,K.x,K.y));c.style.width=Math.round(2*n)/c.view.scale-v})},hb=function(c,m,v,n,u){return gb(c,m,function(A){var C=c.absolutePoints,ha=C.length-1;A=c.view.translate;var K=c.view.scale,wa=v?C[0]:C[ha];C=v?C[1]:C[ha-1];ha=C.x-wa.x;var ma=C.y-wa.y,Wa=Math.sqrt(ha*ha+ma*ma);wa=
n.call(this,Wa,ha/Wa,ma/Wa,wa,C);return new mxPoint(wa.x/K-A.x,wa.y/K-A.y)},function(A,C,ha){var K=c.absolutePoints,wa=K.length-1;A=c.view.translate;var ma=c.view.scale,Wa=v?K[0]:K[wa];K=v?K[1]:K[wa-1];wa=K.x-Wa.x;var jb=K.y-Wa.y,bb=Math.sqrt(wa*wa+jb*jb);C.x=(C.x+A.x)*ma;C.y=(C.y+A.y)*ma;u.call(this,bb,wa/bb,jb/bb,Wa,K,C,ha)})},qb=function(c,m){return function(v){return[hb(v,["startWidth"],!0,function(n,u,A,C,ha){ha=mxUtils.getNumber(v.style,"startWidth",c)*v.view.scale+m;return new mxPoint(C.x+
u*n/4+A*ha/2,C.y+A*n/4-u*ha/2)},function(n,u,A,C,ha,K){n=Math.sqrt(mxUtils.ptSegDistSq(C.x,C.y,ha.x,ha.y,K.x,K.y));v.style.startWidth=Math.round(2*n)/v.view.scale-m})]}},kb=function(c){return function(m){return[gb(m,["arrowWidth","arrowSize"],function(v){var n=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Xa.prototype.arrowWidth))),u=Math.max(0,Math.min(c,mxUtils.getValue(this.state.style,"arrowSize",Xa.prototype.arrowSize)));return new mxPoint(v.x+(1-u)*v.width,v.y+(1-n)*v.height/
2)},function(v,n){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(v.y+v.height/2-n.y)/v.height*2));this.state.style.arrowSize=Math.max(0,Math.min(c,(v.x+v.width-n.x)/v.width))})]}},ib=function(c){return function(m){return[gb(m,["size"],function(v){var n=Math.max(0,Math.min(.5*v.height,parseFloat(mxUtils.getValue(this.state.style,"size",c))));return new mxPoint(v.x,v.y+n)},function(v,n){this.state.style.size=Math.max(0,n.y-v.y)},!0)]}},ub=function(c,m,v){return function(n){var u=[gb(n,["size"],
function(A){var C=Math.max(0,Math.min(A.width,Math.min(A.height,parseFloat(mxUtils.getValue(this.state.style,"size",m)))))*c;return new mxPoint(A.x+C,A.y+C)},function(A,C){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(A.width,C.x-A.x),Math.min(A.height,C.y-A.y)))/c)},!1)];v&&mxUtils.getValue(n.style,mxConstants.STYLE_ROUNDED,!1)&&u.push(lb(n));return u}},ob=function(c,m,v,n,u){v=null!=v?v:.5;return function(A){var C=[gb(A,["size"],function(ha){var K=null!=u?"0"!=mxUtils.getValue(this.state.style,
"fixedSize","0"):null,wa=parseFloat(mxUtils.getValue(this.state.style,"size",K?u:c));return new mxPoint(ha.x+Math.max(0,Math.min(.5*ha.width,wa*(K?1:ha.width))),ha.getCenterY())},function(ha,K,wa){ha=null!=u&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?K.x-ha.x:Math.max(0,Math.min(v,(K.x-ha.x)/ha.width));this.state.style.size=ha},!1,n)];m&&mxUtils.getValue(A.style,mxConstants.STYLE_ROUNDED,!1)&&C.push(lb(A));return C}},nb=function(c,m,v){c=null!=c?c:.5;return function(n){var u=[gb(n,["size"],
function(A){var C=null!=v?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ha=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",C?v:m)));return new mxPoint(A.x+Math.min(.75*A.width*c,ha*(C?.75:.75*A.width)),A.y+A.height/4)},function(A,C){A=null!=v&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?C.x-A.x:Math.max(0,Math.min(c,(C.x-A.x)/A.width*.75));this.state.style.size=A},!1,!0)];mxUtils.getValue(n.style,mxConstants.STYLE_ROUNDED,!1)&&u.push(lb(n));return u}},wb=
function(){return function(c){var m=[];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&m.push(lb(c));return m}},lb=function(c,m){return gb(c,[mxConstants.STYLE_ARCSIZE],function(v){var n=null!=m?m:v.height/8;if("1"==mxUtils.getValue(c.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var u=mxUtils.getValue(c.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(v.x+v.width-Math.min(v.width/2,u),v.y+n)}u=Math.max(0,parseFloat(mxUtils.getValue(c.style,mxConstants.STYLE_ARCSIZE,
100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(v.x+v.width-Math.min(Math.max(v.width/2,v.height/2),Math.min(v.width,v.height)*u),v.y+n)},function(v,n,u){"1"==mxUtils.getValue(c.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(v.width,2*(v.x+v.width-n.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(v.width-n.x+v.x)/Math.min(v.width,v.height))))})},gb=function(c,m,v,n,
u,A,C){var ha=new mxHandle(c,null,mxVertexHandler.prototype.secondaryHandleImage);ha.execute=function(wa){for(var ma=0;ma<m.length;ma++)this.copyStyle(m[ma]);C&&C(wa)};ha.getPosition=v;ha.setPosition=n;ha.ignoreGrid=null!=u?u:!0;if(A){var K=ha.positionChanged;ha.positionChanged=function(){K.apply(this,arguments);c.view.invalidate(this.state.cell);c.view.validate()}}return ha},tb={link:function(c){return[fb(c,!0,10),fb(c,!1,10)]},flexArrow:function(c){var m=c.view.graph.gridSize/c.view.scale,v=[];
mxUtils.getValue(c.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(v.push(hb(c,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(n,u,A,C,ha){n=(c.shape.getEdgeWidth()-c.shape.strokewidth)*c.view.scale;ha=3*mxUtils.getNumber(c.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*c.view.scale;return new mxPoint(C.x+u*(ha+c.shape.strokewidth*c.view.scale)+A*n/2,C.y+A*(ha+c.shape.strokewidth*c.view.scale)-u*n/2)},function(n,u,A,C,ha,K,wa){n=Math.sqrt(mxUtils.ptSegDistSq(C.x,
C.y,ha.x,ha.y,K.x,K.y));u=mxUtils.ptLineDist(C.x,C.y,C.x+A,C.y-u,K.x,K.y);c.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(u-c.shape.strokewidth)/3)/100/c.view.scale;c.style.width=Math.round(2*n)/c.view.scale;if(mxEvent.isShiftDown(wa.getEvent())||mxEvent.isControlDown(wa.getEvent()))c.style[mxConstants.STYLE_ENDSIZE]=c.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(wa.getEvent())||Math.abs(parseFloat(c.style[mxConstants.STYLE_STARTSIZE])-parseFloat(c.style[mxConstants.STYLE_ENDSIZE]))<
m/6&&(c.style[mxConstants.STYLE_STARTSIZE]=c.style[mxConstants.STYLE_ENDSIZE])})),v.push(hb(c,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(n,u,A,C,ha){n=(c.shape.getStartArrowWidth()-c.shape.strokewidth)*c.view.scale;ha=3*mxUtils.getNumber(c.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*c.view.scale;return new mxPoint(C.x+u*(ha+c.shape.strokewidth*c.view.scale)+A*n/2,C.y+A*(ha+c.shape.strokewidth*c.view.scale)-u*n/2)},function(n,u,A,C,ha,
K,wa){n=Math.sqrt(mxUtils.ptSegDistSq(C.x,C.y,ha.x,ha.y,K.x,K.y));u=mxUtils.ptLineDist(C.x,C.y,C.x+A,C.y-u,K.x,K.y);c.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(u-c.shape.strokewidth)/3)/100/c.view.scale;c.style.startWidth=Math.max(0,Math.round(2*n)-c.shape.getEdgeWidth())/c.view.scale;if(mxEvent.isShiftDown(wa.getEvent())||mxEvent.isControlDown(wa.getEvent()))c.style[mxConstants.STYLE_ENDSIZE]=c.style[mxConstants.STYLE_STARTSIZE],c.style.endWidth=c.style.startWidth;mxEvent.isAltDown(wa.getEvent())||
(Math.abs(parseFloat(c.style[mxConstants.STYLE_STARTSIZE])-parseFloat(c.style[mxConstants.STYLE_ENDSIZE]))<m/6&&(c.style[mxConstants.STYLE_STARTSIZE]=c.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(c.style.startWidth)-parseFloat(c.style.endWidth))<m&&(c.style.startWidth=c.style.endWidth))})));mxUtils.getValue(c.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(v.push(hb(c,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(n,u,A,C,ha){n=(c.shape.getEdgeWidth()-
c.shape.strokewidth)*c.view.scale;ha=3*mxUtils.getNumber(c.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*c.view.scale;return new mxPoint(C.x+u*(ha+c.shape.strokewidth*c.view.scale)-A*n/2,C.y+A*(ha+c.shape.strokewidth*c.view.scale)+u*n/2)},function(n,u,A,C,ha,K,wa){n=Math.sqrt(mxUtils.ptSegDistSq(C.x,C.y,ha.x,ha.y,K.x,K.y));u=mxUtils.ptLineDist(C.x,C.y,C.x+A,C.y-u,K.x,K.y);c.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(u-c.shape.strokewidth)/3)/100/c.view.scale;c.style.width=Math.round(2*
n)/c.view.scale;if(mxEvent.isShiftDown(wa.getEvent())||mxEvent.isControlDown(wa.getEvent()))c.style[mxConstants.STYLE_STARTSIZE]=c.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(wa.getEvent())||Math.abs(parseFloat(c.style[mxConstants.STYLE_ENDSIZE])-parseFloat(c.style[mxConstants.STYLE_STARTSIZE]))<m/6&&(c.style[mxConstants.STYLE_ENDSIZE]=c.style[mxConstants.STYLE_STARTSIZE])})),v.push(hb(c,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(n,u,A,C,ha){n=
(c.shape.getEndArrowWidth()-c.shape.strokewidth)*c.view.scale;ha=3*mxUtils.getNumber(c.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*c.view.scale;return new mxPoint(C.x+u*(ha+c.shape.strokewidth*c.view.scale)-A*n/2,C.y+A*(ha+c.shape.strokewidth*c.view.scale)+u*n/2)},function(n,u,A,C,ha,K,wa){n=Math.sqrt(mxUtils.ptSegDistSq(C.x,C.y,ha.x,ha.y,K.x,K.y));u=mxUtils.ptLineDist(C.x,C.y,C.x+A,C.y-u,K.x,K.y);c.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(u-c.shape.strokewidth)/3)/100/c.view.scale;
c.style.endWidth=Math.max(0,Math.round(2*n)-c.shape.getEdgeWidth())/c.view.scale;if(mxEvent.isShiftDown(wa.getEvent())||mxEvent.isControlDown(wa.getEvent()))c.style[mxConstants.STYLE_STARTSIZE]=c.style[mxConstants.STYLE_ENDSIZE],c.style.startWidth=c.style.endWidth;mxEvent.isAltDown(wa.getEvent())||(Math.abs(parseFloat(c.style[mxConstants.STYLE_ENDSIZE])-parseFloat(c.style[mxConstants.STYLE_STARTSIZE]))<m/6&&(c.style[mxConstants.STYLE_ENDSIZE]=c.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(c.style.endWidth)-
parseFloat(c.style.startWidth))<m&&(c.style.endWidth=c.style.startWidth))})));return v},swimlane:function(c){var m=[];if(mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED)){var v=parseFloat(mxUtils.getValue(c.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));m.push(lb(c,v/2))}m.push(gb(c,[mxConstants.STYLE_STARTSIZE],function(n){var u=parseFloat(mxUtils.getValue(c.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(c.style,mxConstants.STYLE_HORIZONTAL,
1)?new mxPoint(n.getCenterX(),n.y+Math.max(0,Math.min(n.height,u))):new mxPoint(n.x+Math.max(0,Math.min(n.width,u)),n.getCenterY())},function(n,u){c.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(n.height,u.y-n.y))):Math.round(Math.max(0,Math.min(n.width,u.x-n.x)))},!1,null,function(n){var u=c.view.graph;if(!mxEvent.isShiftDown(n.getEvent())&&!mxEvent.isControlDown(n.getEvent())&&(u.isTableRow(c.cell)||u.isTableCell(c.cell))){n=
u.getSwimlaneDirection(c.style);var A=u.model.getParent(c.cell);A=u.model.getChildCells(A,!0);for(var C=[],ha=0;ha<A.length;ha++)A[ha]!=c.cell&&u.isSwimlane(A[ha])&&u.getSwimlaneDirection(u.getCurrentCellStyle(A[ha]))==n&&C.push(A[ha]);u.setCellStyles(mxConstants.STYLE_STARTSIZE,c.style[mxConstants.STYLE_STARTSIZE],C)}}));return m},label:wb(),ext:wb(),rectangle:wb(),triangle:wb(),rhombus:wb(),umlLifeline:function(c){return[gb(c,["size"],function(m){var v=Math.max(0,Math.min(m.height,parseFloat(mxUtils.getValue(this.state.style,
"size",ba.prototype.size))));return new mxPoint(m.getCenterX(),m.y+v)},function(m,v){this.state.style.size=Math.round(Math.max(0,Math.min(m.height,v.y-m.y)))},!1)]},umlFrame:function(c){return[gb(c,["width","height"],function(m){var v=Math.max(U.prototype.corner,Math.min(m.width,mxUtils.getValue(this.state.style,"width",U.prototype.width))),n=Math.max(1.5*U.prototype.corner,Math.min(m.height,mxUtils.getValue(this.state.style,"height",U.prototype.height)));return new mxPoint(m.x+v,m.y+n)},function(m,
v){this.state.style.width=Math.round(Math.max(U.prototype.corner,Math.min(m.width,v.x-m.x)));this.state.style.height=Math.round(Math.max(1.5*U.prototype.corner,Math.min(m.height,v.y-m.y)))},!1)]},process:function(c){var m=[gb(c,["size"],function(v){var n="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",ja.prototype.size));return n?new mxPoint(v.x+u,v.y+v.height/4):new mxPoint(v.x+v.width*u,v.y+v.height/4)},function(v,n){v="0"!=mxUtils.getValue(this.state.style,
"fixedSize","0")?Math.max(0,Math.min(.5*v.width,n.x-v.x)):Math.max(0,Math.min(.5,(n.x-v.x)/v.width));this.state.style.size=v},!1)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&m.push(lb(c));return m},cross:function(c){return[gb(c,["size"],function(m){var v=Math.min(m.width,m.height);v=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Ca.prototype.size)))*v/2;return new mxPoint(m.getCenterX()-v,m.getCenterY()-v)},function(m,v){var n=Math.min(m.width,m.height);this.state.style.size=
Math.max(0,Math.min(1,Math.min(Math.max(0,m.getCenterY()-v.y)/n*2,Math.max(0,m.getCenterX()-v.x)/n*2)))})]},note:function(c){return[gb(c,["size"],function(m){var v=Math.max(0,Math.min(m.width,Math.min(m.height,parseFloat(mxUtils.getValue(this.state.style,"size",R.prototype.size)))));return new mxPoint(m.x+m.width-v,m.y+v)},function(m,v){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(m.width,m.x+m.width-v.x),Math.min(m.height,v.y-m.y))))})]},note2:function(c){return[gb(c,["size"],function(m){var v=
Math.max(0,Math.min(m.width,Math.min(m.height,parseFloat(mxUtils.getValue(this.state.style,"size",G.prototype.size)))));return new mxPoint(m.x+m.width-v,m.y+v)},function(m,v){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(m.width,m.x+m.width-v.x),Math.min(m.height,v.y-m.y))))})]},manualInput:function(c){var m=[gb(c,["size"],function(v){var n=Math.max(0,Math.min(v.height,mxUtils.getValue(this.state.style,"size",Oa.prototype.size)));return new mxPoint(v.x+v.width/4,v.y+3*n/4)},function(v,
n){this.state.style.size=Math.round(Math.max(0,Math.min(v.height,4*(n.y-v.y)/3)))},!1)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&m.push(lb(c));return m},dataStorage:function(c){return[gb(c,["size"],function(m){var v="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),n=parseFloat(mxUtils.getValue(this.state.style,"size",v?H.prototype.fixedSize:H.prototype.size));return new mxPoint(m.x+m.width-n*(v?1:m.width),m.getCenterY())},function(m,v){m="0"!=mxUtils.getValue(this.state.style,
"fixedSize","0")?Math.max(0,Math.min(m.width,m.x+m.width-v.x)):Math.max(0,Math.min(1,(m.x+m.width-v.x)/m.width));this.state.style.size=m},!1)]},callout:function(c){var m=[gb(c,["size","position"],function(v){var n=Math.max(0,Math.min(v.height,mxUtils.getValue(this.state.style,"size",qa.prototype.size))),u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position)));mxUtils.getValue(this.state.style,"base",qa.prototype.base);return new mxPoint(v.x+u*v.width,v.y+v.height-
n)},function(v,n){mxUtils.getValue(this.state.style,"base",qa.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(v.height,v.y+v.height-n.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(n.x-v.x)/v.width)))/100},!1),gb(c,["position2"],function(v){var n=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",qa.prototype.position2)));return new mxPoint(v.x+n*v.width,v.y+v.height)},function(v,n){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,
(n.x-v.x)/v.width)))/100},!1),gb(c,["base"],function(v){var n=Math.max(0,Math.min(v.height,mxUtils.getValue(this.state.style,"size",qa.prototype.size))),u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position))),A=Math.max(0,Math.min(v.width,mxUtils.getValue(this.state.style,"base",qa.prototype.base)));return new mxPoint(v.x+Math.min(v.width,u*v.width+A),v.y+v.height-n)},function(v,n){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position)));
this.state.style.base=Math.round(Math.max(0,Math.min(v.width,n.x-v.x-u*v.width)))},!1)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&m.push(lb(c));return m},internalStorage:function(c){var m=[gb(c,["dx","dy"],function(v){var n=Math.max(0,Math.min(v.width,mxUtils.getValue(this.state.style,"dx",Na.prototype.dx))),u=Math.max(0,Math.min(v.height,mxUtils.getValue(this.state.style,"dy",Na.prototype.dy)));return new mxPoint(v.x+n,v.y+u)},function(v,n){this.state.style.dx=Math.round(Math.max(0,
Math.min(v.width,n.x-v.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(v.height,n.y-v.y)))},!1)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&m.push(lb(c));return m},module:function(c){return[gb(c,["jettyWidth","jettyHeight"],function(m){var v=Math.max(0,Math.min(m.width,mxUtils.getValue(this.state.style,"jettyWidth",ya.prototype.jettyWidth))),n=Math.max(0,Math.min(m.height,mxUtils.getValue(this.state.style,"jettyHeight",ya.prototype.jettyHeight)));return new mxPoint(m.x+v/2,m.y+
2*n)},function(m,v){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(m.width,v.x-m.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(m.height,v.y-m.y))/2)})]},corner:function(c){return[gb(c,["dx","dy"],function(m){var v=Math.max(0,Math.min(m.width,mxUtils.getValue(this.state.style,"dx",La.prototype.dx))),n=Math.max(0,Math.min(m.height,mxUtils.getValue(this.state.style,"dy",La.prototype.dy)));return new mxPoint(m.x+v,m.y+n)},function(m,v){this.state.style.dx=Math.round(Math.max(0,
Math.min(m.width,v.x-m.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(m.height,v.y-m.y)))},!1)]},tee:function(c){return[gb(c,["dx","dy"],function(m){var v=Math.max(0,Math.min(m.width,mxUtils.getValue(this.state.style,"dx",ab.prototype.dx))),n=Math.max(0,Math.min(m.height,mxUtils.getValue(this.state.style,"dy",ab.prototype.dy)));return new mxPoint(m.x+(m.width+v)/2,m.y+n)},function(m,v){this.state.style.dx=Math.round(Math.max(0,2*Math.min(m.width/2,v.x-m.x-m.width/2)));this.state.style.dy=
Math.round(Math.max(0,Math.min(m.height,v.y-m.y)))},!1)]},singleArrow:kb(1),doubleArrow:kb(.5),"mxgraph.arrows2.wedgeArrow":qb(20,20),"mxgraph.arrows2.wedgeArrowDashed":qb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":qb(20,20),folder:function(c){return[gb(c,["tabWidth","tabHeight"],function(m){var v=Math.max(0,Math.min(m.width,mxUtils.getValue(this.state.style,"tabWidth",k.prototype.tabWidth))),n=Math.max(0,Math.min(m.height,mxUtils.getValue(this.state.style,"tabHeight",k.prototype.tabHeight)));mxUtils.getValue(this.state.style,
"tabPosition",k.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(v=m.width-v);return new mxPoint(m.x+v,m.y+n)},function(m,v){var n=Math.max(0,Math.min(m.width,v.x-m.x));mxUtils.getValue(this.state.style,"tabPosition",k.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(n=m.width-n);this.state.style.tabWidth=Math.round(n);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(m.height,v.y-m.y)))},!1)]},document:function(c){return[gb(c,["size"],function(m){var v=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,
"size",I.prototype.size))));return new mxPoint(m.x+3*m.width/4,m.y+(1-v)*m.height)},function(m,v){this.state.style.size=Math.max(0,Math.min(1,(m.y+m.height-v.y)/m.height))},!1)]},tape:function(c){return[gb(c,["size"],function(m){var v=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",B.prototype.size))));return new mxPoint(m.getCenterX(),m.y+v*m.height/2)},function(m,v){this.state.style.size=Math.max(0,Math.min(1,(v.y-m.y)/m.height*2))},!1)]},isoCube2:function(c){return[gb(c,
["isoAngle"],function(m){var v=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",M.isoAngle))))*Math.PI/200;return new mxPoint(m.x,m.y+Math.min(m.width*Math.tan(v),.5*m.height))},function(m,v){this.state.style.isoAngle=Math.max(0,50*(v.y-m.y)/m.height)},!0)]},cylinder2:ib(Q.prototype.size),cylinder3:ib(e.prototype.size),offPageConnector:function(c){return[gb(c,["size"],function(m){var v=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",fa.prototype.size))));
return new mxPoint(m.getCenterX(),m.y+(1-v)*m.height)},function(m,v){this.state.style.size=Math.max(0,Math.min(1,(m.y+m.height-v.y)/m.height))},!1)]},"mxgraph.basic.rect":function(c){var m=[Graph.createHandle(c,["size"],function(v){var n=Math.max(0,Math.min(v.width/2,v.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(v.x+n,v.y+n)},function(v,n){this.state.style.size=Math.round(100*Math.max(0,Math.min(v.height/2,v.width/2,n.x-v.x)))/100})];c=Graph.createHandle(c,
["indent"],function(v){var n=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(v.x+.75*v.width,v.y+n*v.height/200)},function(v,n){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(n.y-v.y)/v.height)))/100});m.push(c);return m},step:ob(sa.prototype.size,!0,null,!0,sa.prototype.fixedSize),hexagon:ob(L.prototype.size,!0,.5,!0,L.prototype.fixedSize),curlyBracket:ob(y.prototype.size,!1),display:ob(Ja.prototype.size,!1),cube:ub(1,
l.prototype.size,!1),card:ub(.5,t.prototype.size,!0),loopLimit:ub(.5,Z.prototype.size,!0),trapezoid:nb(.5,J.prototype.size,J.prototype.fixedSize),parallelogram:nb(1,O.prototype.size,O.prototype.fixedSize)};Graph.createHandle=gb;Graph.handleFactory=tb;var Cb=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var c=Cb.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var m=this.state.style.shape;null==mxCellRenderer.defaultShapes[m]&&
null==mxStencilRegistry.getStencil(m)?m=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(m=mxConstants.SHAPE_SWIMLANE);m=tb[m];null==m&&null!=this.state.shape&&this.state.shape.isRoundable()&&(m=tb[mxConstants.SHAPE_RECTANGLE]);null!=m&&(m=m(this.state),null!=m&&(c=null==c?m:c.concat(m)))}return c};mxEdgeHandler.prototype.createCustomHandles=function(){var c=this.state.style.shape;null==mxCellRenderer.defaultShapes[c]&&null==mxStencilRegistry.getStencil(c)&&(c=mxConstants.SHAPE_CONNECTOR);
c=tb[c];return null!=c?c(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var xb=new mxPoint(1,0),zb=new mxPoint(1,0),pb=mxUtils.toRadians(-30);xb=mxUtils.getRotatedPoint(xb,Math.cos(pb),Math.sin(pb));var yb=mxUtils.toRadians(-150);zb=mxUtils.getRotatedPoint(zb,Math.cos(yb),Math.sin(yb));mxEdgeStyle.IsometricConnector=function(c,m,v,n,u){var A=c.view;n=null!=n&&0<n.length?n[0]:null;var C=c.absolutePoints,ha=C[0];C=C[C.length-1];null!=n&&(n=A.transformControlPoint(c,n));
null==ha&&null!=m&&(ha=new mxPoint(m.getCenterX(),m.getCenterY()));null==C&&null!=v&&(C=new mxPoint(v.getCenterX(),v.getCenterY()));var K=xb.x,wa=xb.y,ma=zb.x,Wa=zb.y,jb="horizontal"==mxUtils.getValue(c.style,"elbow","horizontal");if(null!=C&&null!=ha){c=function(Ga,Ka,Ia){Ga-=bb.x;var Ha=Ka-bb.y;Ka=(Wa*Ga-ma*Ha)/(K*Wa-wa*ma);Ga=(wa*Ga-K*Ha)/(wa*ma-K*Wa);jb?(Ia&&(bb=new mxPoint(bb.x+K*Ka,bb.y+wa*Ka),u.push(bb)),bb=new mxPoint(bb.x+ma*Ga,bb.y+Wa*Ga)):(Ia&&(bb=new mxPoint(bb.x+ma*Ga,bb.y+Wa*Ga),u.push(bb)),
bb=new mxPoint(bb.x+K*Ka,bb.y+wa*Ka));u.push(bb)};var bb=ha;null==n&&(n=new mxPoint(ha.x+(C.x-ha.x)/2,ha.y+(C.y-ha.y)/2));c(n.x,n.y,!0);c(C.x,C.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Ab=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(c,m){if(m==mxEdgeStyle.IsometricConnector){var v=new mxElbowEdgeHandler(c);v.snapToTerminals=!1;return v}return Ab.apply(this,arguments)};p.prototype.constraints=[];E.prototype.getConstraints=
function(c,m,v){c=[];var n=Math.tan(mxUtils.toRadians(30)),u=(.5-n)/2;n=Math.min(m,v/(.5+n));m=(m-n)/2;v=(v-n)/2;c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,v+.25*n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m+.5*n,v+n*u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m+n,v+.25*n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m+n,v+.75*n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m+.5*n,v+(1-u)*n));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,m,v+.75*n));return c};M.prototype.getConstraints=function(c,m,v){c=[];var n=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;n=Math.min(m*Math.tan(n),.5*v);c.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,n));c.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,v-n));c.push(new mxConnectionConstraint(new mxPoint(.5,
1),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v-n));c.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n));return c};qa.prototype.getConstraints=function(c,m,v){c=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var n=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var u=m*Math.max(0,
Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1));c.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));c.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));c.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));c.push(new mxConnectionConstraint(new mxPoint(1,0),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,.5*(v-n)));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,m,v-n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v-n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(v-n)));m>=2*n&&c.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return c};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,
0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,
1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0)];mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];Fa.prototype.constraints=mxRectangleShape.prototype.constraints;
mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;V.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;R.prototype.getConstraints=function(c,m,v){c=[];var n=Math.max(0,Math.min(m,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,.5*(m-n),0));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-n,0));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-.5*n,.5*n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,.5*(v+n)));c.push(new mxConnectionConstraint(new mxPoint(1,1),!1));c.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));c.push(new mxConnectionConstraint(new mxPoint(0,1),!1));c.push(new mxConnectionConstraint(new mxPoint(0,
.5),!1));m>=2*n&&c.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return c};t.prototype.getConstraints=function(c,m,v){c=[];var n=Math.max(0,Math.min(m,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));c.push(new mxConnectionConstraint(new mxPoint(1,0),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m+n),0));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,0));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*n,.5*n));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,0,n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(v+n)));c.push(new mxConnectionConstraint(new mxPoint(0,1),!1));c.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));c.push(new mxConnectionConstraint(new mxPoint(1,1),!1));c.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));m>=2*n&&c.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return c};l.prototype.getConstraints=function(c,m,v){c=[];var n=Math.max(0,Math.min(m,Math.min(v,parseFloat(mxUtils.getValue(this.style,
"size",this.size)))));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m-n),0));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-n,0));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-.5*n,.5*n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,.5*(v+n)));c.push(new mxConnectionConstraint(new mxPoint(1,1),!1));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,.5*(m+n),v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*n,v-.5*n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v-n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(v-n)));return c};e.prototype.getConstraints=function(c,m,v){c=[];m=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));c.push(new mxConnectionConstraint(new mxPoint(0,
.5),!1));c.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));c.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,m));c.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,m));c.push(new mxConnectionConstraint(new mxPoint(1,1),!1,null,0,-m));c.push(new mxConnectionConstraint(new mxPoint(0,1),!1,null,0,-m));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,m+.5*(.5*v-m)));c.push(new mxConnectionConstraint(new mxPoint(1,
0),!1,null,0,m+.5*(.5*v-m)));c.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,v-m-.5*(.5*v-m)));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v-m-.5*(.5*v-m)));c.push(new mxConnectionConstraint(new mxPoint(.145,0),!1,null,0,.29*m));c.push(new mxConnectionConstraint(new mxPoint(.855,0),!1,null,0,.29*m));c.push(new mxConnectionConstraint(new mxPoint(.855,1),!1,null,0,.29*-m));c.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-m));return c};k.prototype.getConstraints=
function(c,m,v){c=[];var n=Math.max(0,Math.min(m,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),u=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(c.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*n,0)),c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,0)),c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,n,u)),c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m+n),u))):(c.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-.5*n,0)),c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-n,0)),c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-n,u)),c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m-n),u)));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,u));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,m,.25*(v-u)+u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,.5*(v-u)+u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,.75*(v-u)+u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(v-u)+u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(v-u)+u));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,0,.75*(v-u)+u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v));c.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));c.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));c.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return c};Na.prototype.constraints=mxRectangleShape.prototype.constraints;H.prototype.constraints=mxRectangleShape.prototype.constraints;la.prototype.constraints=mxEllipse.prototype.constraints;za.prototype.constraints=mxEllipse.prototype.constraints;
ua.prototype.constraints=mxEllipse.prototype.constraints;Pa.prototype.constraints=mxEllipse.prototype.constraints;Oa.prototype.constraints=mxRectangleShape.prototype.constraints;Ra.prototype.constraints=mxRectangleShape.prototype.constraints;Ja.prototype.getConstraints=function(c,m,v){c=[];var n=Math.min(m,v/2),u=Math.min(m-n,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*m);c.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,u,0));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(u+m-n),0));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-n,0));c.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-n,v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(u+m-n),v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,v));return c};ya.prototype.getConstraints=function(c,m,v){m=parseFloat(mxUtils.getValue(c,
"jettyWidth",ya.prototype.jettyWidth))/2;c=parseFloat(mxUtils.getValue(c,"jettyHeight",ya.prototype.jettyHeight));var n=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,m),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,
.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,m),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(v-.5*c,1.5*c)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(v-.5*c,3.5*c))];v>5*c&&n.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,m));v>8*c&&n.push(new mxConnectionConstraint(new mxPoint(0,
.5),!1,null,m));v>15*c&&n.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,m));return n};Z.prototype.constraints=mxRectangleShape.prototype.constraints;fa.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,
.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];W.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,
.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];va.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,
.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,
.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];f.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,
.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];B.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,
.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,0),!1)];sa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,
.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ca.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,
0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];mxDoubleEllipse.prototype.constraints=mxEllipse.prototype.constraints;mxRhombus.prototype.constraints=mxEllipse.prototype.constraints;mxTriangle.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,
.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,
1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,
.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];O.prototype.constraints=mxRectangleShape.prototype.constraints;J.prototype.constraints=mxRectangleShape.prototype.constraints;I.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,
0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;ab.prototype.getConstraints=function(c,m,v){c=[];var n=Math.max(0,Math.min(m,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),u=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,
"dy",this.dy))));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1));c.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));c.push(new mxConnectionConstraint(new mxPoint(1,0),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,.5*u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*m+.25*n,u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m+n),u));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,.5*(m+n),.5*(v+u)));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m+n),v));c.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m-n),v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m-n),.5*(v+u)));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m-n),u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*m-.25*n,u));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,0,u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*u));return c};La.prototype.getConstraints=function(c,m,v){c=[];var n=Math.max(0,Math.min(m,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),u=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1));c.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));c.push(new mxConnectionConstraint(new mxPoint(1,0),!1));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,m,.5*u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m+n),u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,u));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(v+u)));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*n,v));c.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,
1),!1));return c};Ba.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Xa.prototype.getConstraints=
function(c,m,v){c=[];var n=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),u=m*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));n=(v-n)/2;c.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m-u),n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-u,0));c.push(new mxConnectionConstraint(new mxPoint(1,
.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-u,v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m-u),v-n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v-n));return c};x.prototype.getConstraints=function(c,m,v){c=[];var n=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Xa.prototype.arrowWidth)))),u=m*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Xa.prototype.arrowSize))));n=(v-n)/2;c.push(new mxConnectionConstraint(new mxPoint(0,
.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*m,n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-u,0));c.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m-u,v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*m,v-n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,v));return c};Ca.prototype.getConstraints=
function(c,m,v){c=[];var n=Math.min(v,m),u=Math.max(0,Math.min(n,n*parseFloat(mxUtils.getValue(this.style,"size",this.size))));n=(v-u)/2;var A=n+u,C=(m-u)/2;u=C+u;c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,.5*n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,0));c.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,.5*n));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,u,n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,v-.5*n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,v));c.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,v-.5*n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,A));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m+u),n));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,m,n));c.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,m,A));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(m+u),A));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,A));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*C,n));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n));c.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,0,A));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*C,A));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,n));return c};ba.prototype.constraints=null;P.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,
.9),!1)];X.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];na.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ra.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,
.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}
Actions.prototype.init=function(){function b(G){p.escape();G=p.deleteCells(p.getDeletableCells(p.getSelectionCells()),G);null!=G&&p.setSelectionCells(G)}function d(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{for(var G=p.getSelectionCells(),M=0;M<G.length;M++)p.cellLabelChanged(G[M],"")}finally{p.getModel().endUpdate()}}}function g(G,M,Q,e,f){f.getModel().beginUpdate();try{var k=f.getCellGeometry(G);null!=k&&Q&&e&&(Q/=e,k=k.clone(),1<Q?k.height=k.width/Q:k.width=k.height*Q,f.getModel().setGeometry(G,
k));f.setCellStyles(mxConstants.STYLE_CLIP_PATH,M,[G]);f.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[G])}finally{f.getModel().endUpdate()}}var l=this.editorUi,D=l.editor,p=D.graph,E=function(){return Action.prototype.isEnabled.apply(this,arguments)&&p.isEnabled()};this.addAction("new...",function(){p.openLink(l.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";l.openFile()});this.addAction("smartFit",function(){p.popupMenuHandler.hideMenu();var G=p.view.scale,
M=p.view.translate.x,Q=p.view.translate.y;l.actions.get("resetView").funct();1E-5>Math.abs(G-p.view.scale)&&M==p.view.translate.x&&Q==p.view.translate.y&&l.actions.get(p.pageVisible?"fitPage":"fitWindow").funct()});this.addAction("keyPressEnter",function(){p.isEnabled()&&(p.isSelectionEmpty()?l.actions.get("smartFit").funct():p.startEditingAtCell())});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){l.hideDialog()}));
window.openFile.setConsumer(mxUtils.bind(this,function(G,M){try{var Q=mxUtils.parseXml(G);D.graph.setSelectionCells(D.graph.importGraphModel(Q.documentElement))}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}}));l.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=E;this.addAction("save",function(){l.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=E;this.addAction("saveAs...",function(){l.saveFile(!0)},null,
null,Editor.ctrlKey+"+Shift+S").isEnabled=E;this.addAction("export...",function(){l.showDialog((new ExportDialog(l)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var G=new EditDiagramDialog(l);l.showDialog(G.container,620,420,!0,!1);G.init()});this.addAction("pageSetup...",function(){l.showDialog((new PageSetupDialog(l)).container,320,240,!0,!0)}).isEnabled=E;this.addAction("print...",function(){l.showDialog((new PrintDialog(l)).container,300,180,!0,!0)},null,"sprite-print",
Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(p,null,10,10)});this.addAction("undo",function(){l.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){l.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",function(){var G=null;try{G=l.copyXml(),null!=G&&p.removeCells(G,!1)}catch(M){}null==G&&mxClipboard.cut(p)},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{l.copyXml()}catch(G){}try{mxClipboard.copy(p)}catch(G){l.handleError(G)}},
null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var G=!1;try{Editor.enableNativeCipboard&&(l.readGraphModelFromClipboard(function(M){if(null!=M){p.getModel().beginUpdate();try{l.pasteXml(M,!0)}finally{p.getModel().endUpdate()}}else mxClipboard.paste(p)}),G=!0)}catch(M){}G||mxClipboard.paste(p)}},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(G){function M(e){if(null!=e){for(var f=!0,k=0;k<
e.length&&f;k++)f=f&&p.model.isEdge(e[k]);var z=p.view.translate;k=p.view.scale;var t=z.x,B=z.y;z=null;if(1==e.length&&f){var I=p.getCellGeometry(e[0]);null!=I&&(z=I.getTerminalPoint(!0))}z=null!=z?z:p.getBoundingBoxFromGeometry(e,f);null!=z&&(f=Math.round(p.snap(p.popupMenuHandler.triggerX/k-t)),k=Math.round(p.snap(p.popupMenuHandler.triggerY/k-B)),p.cellsMoved(e,f-z.x,k-z.y))}}function Q(){p.getModel().beginUpdate();try{M(mxClipboard.paste(p))}finally{p.getModel().endUpdate()}}if(p.isEnabled()&&
!p.isCellLocked(p.getDefaultParent())){G=!1;try{Editor.enableNativeCipboard&&(l.readGraphModelFromClipboard(function(e){if(null!=e){p.getModel().beginUpdate();try{M(l.pasteXml(e,!0))}finally{p.getModel().endUpdate()}}else Q()}),G=!0)}catch(e){}G||Q()}});this.addAction("copySize",function(){var G=p.getSelectionCell();p.isEnabled()&&null!=G&&p.getModel().isVertex(G)&&(G=p.getCellGeometry(G),null!=G&&(l.copiedSize=new mxRectangle(G.x,G.y,G.width,G.height)))},null,null,"Alt+Shift+X");this.addAction("pasteSize",
function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=l.copiedSize){p.getModel().beginUpdate();try{for(var G=p.getResizableCells(p.getSelectionCells()),M=0;M<G.length;M++)if(p.getModel().isVertex(G[M])){var Q=p.getCellGeometry(G[M]);null!=Q&&(Q=Q.clone(),Q.width=l.copiedSize.width,Q.height=l.copiedSize.height,p.getModel().setGeometry(G[M],Q))}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+V");this.addAction("copyData",function(){var G=p.getSelectionCell()||p.getModel().getRoot();p.isEnabled()&&
null!=G&&(G=G.cloneValue(),null==G||isNaN(G.nodeType)||(l.copiedValue=G))},null,null,"Alt+Shift+B");this.addAction("pasteData",function(G,M){function Q(k,z){var t=e.getValue(k);z=k.cloneValue(z);z.removeAttribute("placeholders");null==t||isNaN(t.nodeType)||z.setAttribute("placeholders",t.getAttribute("placeholders"));null!=G&&mxEvent.isShiftDown(G)||z.setAttribute("label",p.convertValueToString(k));e.setValue(k,z)}G=null!=M?M:G;var e=p.getModel();if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=l.copiedValue){e.beginUpdate();
try{var f=p.getEditableCells(p.getSelectionCells());if(0==f.length)Q(e.getRoot(),l.copiedValue);else for(M=0;M<f.length;M++)Q(f[M],l.copiedValue)}finally{e.endUpdate()}}},null,null,"Alt+Shift+E");this.addAction("delete",function(G,M){G=null!=M?M:G;null!=G&&mxEvent.isShiftDown(G)?d():b(null!=G&&(mxEvent.isControlDown(G)||mxEvent.isMetaDown(G)||mxEvent.isAltDown(G)))},null,null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){d()},null,null,Editor.ctrlKey+
"+Delete");this.addAction("duplicate",function(){try{p.setSelectionCells(p.duplicateCells()),p.scrollCellToVisible(p.getSelectionCell())}catch(G){l.handleError(G)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action(mxResources.get("merge"),function(){var G=l.getSelectionState();if(null!=G.mergeCell){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",G.rowspan,[G.mergeCell]),p.setCellStyles("colspan",G.colspan,[G.mergeCell])}finally{p.getModel().endUpdate()}}}));this.put("unmergeCells",
new Action(mxResources.get("unmerge"),function(){var G=l.getSelectionState();if(0<G.cells.length){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",null,G.cells),p.setCellStyles("colspan",null,G.cells)}finally{p.getModel().endUpdate()}}}));this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(G,M){G=null!=M?M:G;p.turnShapes(p.getResizableCells(p.getSelectionCells()),null!=G?mxEvent.isShiftDown(G):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R"));
this.put("selectConnections",new Action(mxResources.get("selectEdges"),function(G){G=p.getSelectionCell();p.isEnabled()&&null!=G&&p.addSelectionCells(p.getEdges(G))}));this.addAction("selectVertices",function(){p.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){p.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",function(){p.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){p.clearSelection()},
null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{var G=p.getSelectionCells(),M=p.getCurrentCellStyle(p.getSelectionCell()),Q=1==mxUtils.getValue(M,mxConstants.STYLE_EDITABLE,1)?0:1;p.setCellStyles(mxConstants.STYLE_MOVABLE,Q,G);p.setCellStyles(mxConstants.STYLE_RESIZABLE,Q,G);p.setCellStyles(mxConstants.STYLE_ROTATABLE,Q,G);p.setCellStyles(mxConstants.STYLE_DELETABLE,Q,G);p.setCellStyles(mxConstants.STYLE_EDITABLE,
Q,G);p.setCellStyles("connectable",Q,G)}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("home",function(){p.home()},null,null,"Shift+Home");this.addAction("exitGroup",function(){p.exitGroup()},null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){p.enterGroup()},null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){p.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){p.foldCells(!1)},
null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){p.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F");this.addAction("toBack",function(){p.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B");this.addAction("bringForward",function(G){p.orderCells(!1,null,!0)});this.addAction("sendBackward",function(G){p.orderCells(!0,null,!0)});this.addAction("group",function(){if(p.isEnabled()){var G=mxUtils.sortCells(p.getSelectionCells(),!0);1!=G.length||p.isTable(G[0])||p.isTableRow(G[0])?
(G=p.getCellsForGroup(G),1<G.length&&p.setSelectionCell(p.groupCells(null,0,G))):p.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){if(p.isEnabled()){var G=p.getEditableCells(p.getSelectionCells());p.model.beginUpdate();try{var M=p.ungroupCells();if(null!=G)for(var Q=0;Q<G.length;Q++)p.model.contains(G[Q])&&(0==p.model.getChildCount(G[Q])&&p.model.isVertex(G[Q])&&p.setCellStyles("container","0",[G[Q]]),M.push(G[Q]))}finally{p.model.endUpdate()}0<
M.length&&p.setSelectionCells(M)}},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){if(p.isEnabled()){var G=p.getSelectionCells();if(null!=G){for(var M=[],Q=0;Q<G.length;Q++)p.isTableRow(G[Q])||p.isTableCell(G[Q])||M.push(G[Q]);p.removeCellsFromParent(M)}}});this.addAction("edit",function(){p.isEnabled()&&p.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var G=p.getSelectionCell()||p.getModel().getRoot();l.showDataDialog(G)},null,
null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var G=p.getSelectionCell();if(p.isEnabled()&&null!=G&&p.isCellEditable(G)){var M="";if(mxUtils.isNode(G.value)){var Q=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&G.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(Q=G.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==Q&&(Q=G.value.getAttribute("tooltip"));null!=Q&&(M=Q)}M=new TextareaDialog(l,mxResources.get("editTooltip")+":",M,function(e){p.setTooltipForCell(G,
e)});l.showDialog(M.container,320,200,!0,!0);M.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var G=p.getLinkForCell(p.getSelectionCell());null!=G&&p.openLink(G)});this.addAction("editLink...",function(){var G=p.getSelectionCell();if(p.isEnabled()&&null!=G&&p.isCellEditable(G)){var M=p.getLinkForCell(G)||"";l.showLinkDialog(M,mxResources.get("apply"),function(Q,e,f){Q=mxUtils.trim(Q);p.setLinkForCell(G,0<Q.length?Q:null);p.setAttributeForCell(G,"linkTarget",f)},!0,p.getLinkTargetForCell(G))}},
null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+"...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&(p.clearSelection(),l.actions.get("image").funct())})).isEnabled=E;this.put("insertLink",new Action(mxResources.get("link")+"...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&l.showLinkDialog("",mxResources.get("insert"),function(G,M,Q){G=mxUtils.trim(G);if(0<G.length){var e=null,f=p.getLinkTitle(G);null!=M&&0<M.length&&(e=M[0].iconUrl,
f=M[0].name||M[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));M=new mxCell(f,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=e?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+e:"spacing=10;"));M.vertex=!0;e=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([M],!0));M.geometry.x=e.x;M.geometry.y=e.y;p.setAttributeForCell(M,"linkTarget",Q);p.setLinkForCell(M,G);p.cellSizeUpdated(M,
!0);p.getModel().beginUpdate();try{M=p.addCell(M),p.fireEvent(new mxEventObject("cellsInserted","cells",[M]))}finally{p.getModel().endUpdate()}p.setSelectionCell(M);p.scrollCellToVisible(p.getSelectionCell())}},!0)})).isEnabled=E;this.addAction("link...",mxUtils.bind(this,function(){if(p.isEnabled())if(p.cellEditor.isContentEditing()){var G=p.getSelectedElement(),M=p.getParentByName(G,"A",p.cellEditor.textarea),Q="";if(null==M&&null!=G&&null!=G.getElementsByTagName)for(var e=G.getElementsByTagName("a"),
f=0;f<e.length&&null==M;f++)e[f].textContent==G.textContent&&(M=e[f]);null!=M&&"A"==M.nodeName&&(Q=M.getAttribute("href")||"",p.selectNode(M));var k=p.cellEditor.saveSelection();l.showLinkDialog(Q,mxResources.get("apply"),mxUtils.bind(this,function(z){p.cellEditor.restoreSelection(k);null!=z&&p.insertLink(z)}))}else p.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=E;this.addAction("autosize",function(){var G=p.getSelectionCells();if(null!=G){p.getModel().beginUpdate();
try{for(var M=0;M<G.length;M++){var Q=G[M];p.getModel().isVertex(Q)&&(0<p.getModel().getChildCount(Q)?p.updateGroupBounds([Q],0,!0):p.updateCellSize(Q))}}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("snapToGrid",function(){p.snapCellsToGrid(p.getSelectionCells(),p.gridSize)});this.addAction("formattedText",function(){p.stopEditing();var G=p.getCommonStyle(p.getSelectionCells());G="1"==mxUtils.getValue(G,"html","0")?null:"1";p.getModel().beginUpdate();try{for(var M=
p.getEditableCells(p.getSelectionCells()),Q=0;Q<M.length;Q++)if(state=p.getView().getState(M[Q]),null!=state){var e=mxUtils.getValue(state.style,"html","0");if("1"==e&&null==G){var f=p.convertValueToString(state.cell);"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(f=f.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var k=document.createElement("div");k.innerHTML=p.sanitizeHtml(f);f=mxUtils.extractTextWithWhitespace(k.childNodes);p.cellLabelChanged(state.cell,f);p.setCellStyles("html",G,[M[Q]])}else"0"==
e&&"1"==G&&(f=mxUtils.htmlEntities(p.convertValueToString(state.cell),!1),"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(f=f.replace(/\n/g,"<br/>")),p.cellLabelChanged(state.cell,p.sanitizeHtml(f)),p.setCellStyles("html",G,[M[Q]]))}l.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=G?G:"0"],"cells",M))}finally{p.getModel().endUpdate()}});this.addAction("wordWrap",function(){var G=p.getView().getState(p.getSelectionCell()),M="wrap";p.stopEditing();null!=G&&"wrap"==G.style[mxConstants.STYLE_WHITE_SPACE]&&
(M=null);p.setCellStyles(mxConstants.STYLE_WHITE_SPACE,M)});this.addAction("rotation",function(){var G="0",M=p.getView().getState(p.getSelectionCell());null!=M&&(G=M.style[mxConstants.STYLE_ROTATION]||G);G=new FilenameDialog(l,G,mxResources.get("apply"),function(Q){null!=Q&&0<Q.length&&p.setCellStyles(mxConstants.STYLE_ROTATION,Q)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");l.showDialog(G.container,375,80,!0,!0);G.init()});this.addAction("resetView",function(){p.zoomTo(1);
l.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(G){p.isFastZoomEnabled()?p.lazyZoom(!0,!0,l.buttonZoomDelay):p.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel");this.addAction("zoomOut",function(G){p.isFastZoomEnabled()?p.lazyZoom(!1,!0,l.buttonZoomDelay):p.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel");this.addAction("fitWindow",function(){var G=p.isSelectionEmpty()?p.getGraphBounds():p.getBoundingBox(p.getSelectionCells()),M=p.view.translate,
Q=p.view.scale;G.x=G.x/Q-M.x;G.y=G.y/Q-M.y;G.width/=Q;G.height/=Q;null!=p.backgroundImage&&(G=mxRectangle.fromRectangle(G),G.add(new mxRectangle(0,0,p.backgroundImage.width,p.backgroundImage.height)));0==G.width||0==G.height?(p.zoomTo(1),l.resetScrollbars()):(M=Editor.fitWindowBorders,null!=M&&(G.x-=M.x,G.y-=M.y,G.width+=M.width+M.x,G.height+=M.height+M.y),p.fitWindow(G))},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){p.pageVisible||this.get("pageView").funct();
var G=p.pageFormat,M=p.pageScale;p.zoomTo(Math.floor(20*Math.min((p.container.clientWidth-10)/G.width/M,(p.container.clientHeight-10)/G.height/M))/20);mxUtils.hasScrollbars(p.container)&&(G=p.getPagePadding(),p.container.scrollTop=G.y*p.view.scale-1,p.container.scrollLeft=Math.min(G.x*p.view.scale,(p.container.scrollWidth-p.container.clientWidth)/2)-1)}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){p.pageVisible||this.get("pageView").funct();var G=p.pageFormat,
M=p.pageScale;p.zoomTo(Math.floor(20*Math.min((p.container.clientWidth-10)/(2*G.width)/M,(p.container.clientHeight-10)/G.height/M))/20);mxUtils.hasScrollbars(p.container)&&(G=p.getPagePadding(),p.container.scrollTop=Math.min(G.y,(p.container.scrollHeight-p.container.clientHeight)/2),p.container.scrollLeft=Math.min(G.x,(p.container.scrollWidth-p.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){p.pageVisible||this.get("pageView").funct();
p.zoomTo(Math.floor(20*(p.container.clientWidth-10)/p.pageFormat.width/p.pageScale)/20);if(mxUtils.hasScrollbars(p.container)){var G=p.getPagePadding();p.container.scrollLeft=Math.min(G.x*p.view.scale,(p.container.scrollWidth-p.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var G=new FilenameDialog(this.editorUi,parseInt(100*p.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(M){M=parseInt(M);!isNaN(M)&&
0<M&&p.zoomTo(M/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(G.container,300,80,!0,!0);G.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var G=new FilenameDialog(this.editorUi,parseInt(100*p.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(M){M=parseInt(M);!isNaN(M)&&0<M&&(M=new ChangePageSetup(l,null,null,null,M/100),M.ignoreColor=!0,M.ignoreImage=!0,p.model.execute(M))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(G.container,
300,80,!0,!0);G.init()}));var N=null;N=this.addAction("grid",function(){p.setGridEnabled(!p.isGridEnabled());p.defaultGridEnabled=p.isGridEnabled();l.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");N.setToggleAction(!0);N.setSelectedCallback(function(){return p.isGridEnabled()});N.setEnabled(!1);N=this.addAction("guides",function(){p.graphHandler.guidesEnabled=!p.graphHandler.guidesEnabled;l.fireEvent(new mxEventObject("guidesEnabledChanged"))});N.setToggleAction(!0);
N.setSelectedCallback(function(){return p.graphHandler.guidesEnabled});N.setEnabled(!1);N=this.addAction("tooltips",function(){p.tooltipHandler.setEnabled(!p.tooltipHandler.isEnabled());l.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});N.setToggleAction(!0);N.setSelectedCallback(function(){return p.tooltipHandler.isEnabled()});N=this.addAction("collapseExpand",function(){var G=new ChangePageSetup(l);G.ignoreColor=!0;G.ignoreImage=!0;G.foldingEnabled=!p.foldingEnabled;p.model.execute(G)});
N.setToggleAction(!0);N.setSelectedCallback(function(){return p.foldingEnabled});N.isEnabled=E;N=this.addAction("scrollbars",function(){l.setScrollbars(!l.hasScrollbars())});N.setToggleAction(!0);N.setSelectedCallback(function(){return p.scrollbars});N=this.addAction("pageView",mxUtils.bind(this,function(){l.setPageVisible(!p.pageVisible)}));N.setToggleAction(!0);N.setSelectedCallback(function(){return p.pageVisible});N=this.addAction("connectionArrows",function(){p.connectionArrowsEnabled=!p.connectionArrowsEnabled;
l.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");N.setToggleAction(!0);N.setSelectedCallback(function(){return p.connectionArrowsEnabled});N=this.addAction("connectionPoints",function(){p.setConnectable(!p.connectionHandler.isEnabled());l.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");N.setToggleAction(!0);N.setSelectedCallback(function(){return p.connectionHandler.isEnabled()});N=this.addAction("copyConnect",function(){p.connectionHandler.setCreateTarget(!p.connectionHandler.isCreateTarget());
l.fireEvent(new mxEventObject("copyConnectChanged"))});N.setToggleAction(!0);N.setSelectedCallback(function(){return p.connectionHandler.isCreateTarget()});N.isEnabled=E;N=this.addAction("autosave",function(){l.editor.setAutosave(!l.editor.autosave)});N.setToggleAction(!0);N.setSelectedCallback(function(){return l.editor.autosave});N.isEnabled=E;N.visible=!1;this.addAction("help",function(){var G="";mxResources.isLanguageSupported(mxClient.language)&&(G="_"+mxClient.language);p.openLink(RESOURCES_PATH+
"/help"+G+".html")});var R=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){R||(l.showDialog((new AboutDialog(l)).container,320,280,!0,!0,function(){R=!1}),R=!0)}));N=mxUtils.bind(this,function(G,M,Q,e){return this.addAction(G,function(){if(null!=Q&&p.cellEditor.isContentEditing())Q();else{p.stopEditing(!1);p.getModel().beginUpdate();try{var f=p.getEditableCells(p.getSelectionCells());p.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,M,f);(M&mxConstants.FONT_BOLD)==
mxConstants.FONT_BOLD?p.updateLabelElements(f,function(z){z.style.fontWeight=null;"B"==z.nodeName&&p.replaceElement(z)}):(M&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?p.updateLabelElements(f,function(z){z.style.fontStyle=null;"I"==z.nodeName&&p.replaceElement(z)}):(M&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&p.updateLabelElements(f,function(z){z.style.textDecoration=null;"U"==z.nodeName&&p.replaceElement(z)});for(var k=0;k<f.length;k++)0==p.model.getChildCount(f[k])&&p.autoSizeCell(f[k],
!1)}finally{p.getModel().endUpdate()}}},null,null,e)});N("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");N("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");N("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){l.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});this.addAction("strokeColor...",
function(){l.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",function(){l.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){l.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});this.addAction("backgroundColor...",function(){l.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){l.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});this.addAction("vertical",function(){l.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,
!0)});this.addAction("shadow",function(){l.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_DASHED,null),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),l.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("dashed",function(){p.getModel().beginUpdate();
try{p.setCellStyles(mxConstants.STYLE_DASHED,"1"),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),l.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("dotted",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_DASHED,"1"),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),l.fireEvent(new mxEventObject("styleChanged",
"keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("sharp",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),p.setCellStyles(mxConstants.STYLE_CURVED,"0"),l.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});
this.addAction("rounded",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),p.setCellStyles(mxConstants.STYLE_CURVED,"0"),l.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!p.isSelectionEmpty()&&p.isEnabled()){p.getModel().beginUpdate();try{var G=p.getSelectionCells(),M=p.getCurrentCellStyle(G[0]),
Q="1"==mxUtils.getValue(M,mxConstants.STYLE_ROUNDED,"0")?"0":"1";p.setCellStyles(mxConstants.STYLE_ROUNDED,Q);p.setCellStyles(mxConstants.STYLE_CURVED,null);l.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[Q,"0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}}});this.addAction("curved",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),p.setCellStyles(mxConstants.STYLE_CURVED,
"1"),l.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("collapsible",function(){var G=p.view.getState(p.getSelectionCell()),M="1";null!=G&&null!=p.getFoldingImage(G)&&(M="0");p.setCellStyles("collapsible",M);l.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[M],"cells",p.getSelectionCells()))});this.addAction("editStyle...",
mxUtils.bind(this,function(){var G=p.getEditableCells(p.getSelectionCells());if(null!=G&&0<G.length){var M=p.getModel();M=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",M.getStyle(G[0])||"",function(Q){null!=Q&&p.setCellStyle(mxUtils.trim(Q),G)},null,null,400,220);this.editorUi.showDialog(M.container,420,300,!0,!0);M.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){p.isEnabled()&&!p.isSelectionEmpty()&&l.setDefaultStyle(p.getSelectionCell())},
null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){p.isEnabled()&&l.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var G=p.getSelectionCell();if(null!=G&&p.getModel().isEdge(G)){var M=D.graph.selectionCellsHandler.getHandler(G);if(M instanceof mxEdgeHandler){var Q=p.view.translate,e=p.view.scale,f=Q.x;Q=Q.y;G=p.getModel().getParent(G);for(var k=p.getCellGeometry(G);p.getModel().isVertex(G)&&null!=k;)f+=k.x,Q+=k.y,G=
p.getModel().getParent(G),k=p.getCellGeometry(G);f=Math.round(p.snap(p.popupMenuHandler.triggerX/e-f));e=Math.round(p.snap(p.popupMenuHandler.triggerY/e-Q));M.addPointAt(M.state,f,e)}}});this.addAction("removeWaypoint",function(){var G=l.actions.get("removeWaypoint");null!=G.handler&&G.handler.removePoint(G.handler.state,G.index)});this.addAction("clearWaypoints",function(G,M){G=null!=M?M:G;var Q=p.getSelectionCells();if(null!=Q){Q=p.getEditableCells(p.addAllEdges(Q));p.getModel().beginUpdate();try{for(var e=
0;e<Q.length;e++){var f=Q[e];if(p.getModel().isEdge(f)){var k=p.getCellGeometry(f);null!=M&&mxEvent.isShiftDown(G)?(p.setCellStyles(mxConstants.STYLE_EXIT_X,null,[f]),p.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[f]),p.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[f]),p.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[f])):null!=k&&(k=k.clone(),k.points=null,k.x=0,k.y=0,k.offset=null,p.getModel().setGeometry(f,k))}}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+C");N=this.addAction("subscript",
mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");N=this.addAction("superscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var G=mxResources.get("image")+" ("+mxResources.get("url")+"):",M=p.getView().getState(p.getSelectionCell()),
Q="",e=null;null!=M&&(Q=M.style[mxConstants.STYLE_IMAGE]||Q,e=M.style[mxConstants.STYLE_CLIP_PATH]||e);var f=p.cellEditor.saveSelection();l.showImageDialog(G,Q,function(k,z,t,B,I,O){if(p.cellEditor.isContentEditing())p.cellEditor.restoreSelection(f),p.insertImage(k,z,t);else{var J=p.getSelectionCells();if(null!=k&&(0<k.length||0<J.length)){var y=null;p.getModel().beginUpdate();try{if(0==J.length){J=[p.insertVertex(p.getDefaultParent(),null,"",0,0,z,t,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];
var ia=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry(J,!0));J[0].geometry.x=ia.x;J[0].geometry.y=ia.y;null!=B&&g(J[0],B,I,O,p);y=J;p.fireEvent(new mxEventObject("cellsInserted","cells",y))}p.setCellStyles(mxConstants.STYLE_IMAGE,0<k.length?k:null,J);var da=p.getCurrentCellStyle(J[0]);"image"!=da[mxConstants.STYLE_SHAPE]&&"label"!=da[mxConstants.STYLE_SHAPE]?p.setCellStyles(mxConstants.STYLE_SHAPE,"image",J):0==k.length&&p.setCellStyles(mxConstants.STYLE_SHAPE,null,J);null==B&&p.setCellStyles(mxConstants.STYLE_CLIP_PATH,
null,J);if(null!=z&&null!=t)for(k=0;k<J.length;k++){var ja=J[k];if("0"!=p.getCurrentCellStyle(ja).expand){var aa=p.getModel().getGeometry(ja);null!=aa&&(aa=aa.clone(),aa.width=z,aa.height=t,p.getModel().setGeometry(ja,aa))}null!=B&&g(ja,B,I,O,p)}}finally{p.getModel().endUpdate()}null!=y&&(p.setSelectionCells(y),p.scrollCellToVisible(y[0]))}}},p.cellEditor.isContentEditing(),!p.cellEditor.isContentEditing(),!0,e)}}).isEnabled=E;this.addAction("crop...",function(){var G=p.getSelectionCell();if(p.isEnabled()&&
!p.isCellLocked(p.getDefaultParent())&&null!=G){var M=p.getCurrentCellStyle(G),Q=M[mxConstants.STYLE_IMAGE],e=M[mxConstants.STYLE_SHAPE];Q&&"image"==e&&(M=new CropImageDialog(l,Q,M[mxConstants.STYLE_CLIP_PATH],function(f,k,z){g(G,f,k,z,p)}),l.showDialog(M.container,300,390,!0,!0))}}).isEnabled=E;N=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(l,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",
mxUtils.bind(this,function(){l.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){l.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),l.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");N.setToggleAction(!0);N.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));
N=this.addAction("format",mxUtils.bind(this,function(){l.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");N.setToggleAction(!0);N.setSelectedCallback(mxUtils.bind(this,function(){return l.isFormatPanelVisible()}));N=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(l,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){l.fireEvent(new mxEventObject("outline"))})),
this.outlineWindow.window.addListener("hide",function(){l.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),l.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");N.setToggleAction(!0);N.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editConnectionPoints...",function(){var G=
p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=G){var M=new ConnectionPointsDialog(l,G);l.showDialog(M.container,350,450,!0,!1,function(){M.destroy()});M.init()}}).isEnabled=E};Actions.prototype.addAction=function(b,d,g,l,D){if("..."==b.substring(b.length-3)){b=b.substring(0,b.length-3);var p=mxResources.get(b)+"..."}else p=mxResources.get(b);return this.put(b,new Action(p,d,g,l,D))};Actions.prototype.put=function(b,d){return this.actions[b]=d};
Actions.prototype.get=function(b){return this.actions[b]};function Action(b,d,g,l,D){mxEventSource.call(this);this.label=b;this.funct=this.createFunction(d);this.enabled=null!=g?g:!0;this.iconCls=l;this.shortcut=D;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(b){return b};Action.prototype.setEnabled=function(b){this.enabled!=b&&(this.enabled=b,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled};
Action.prototype.setToggleAction=function(b){this.toggleAction=b};Action.prototype.setSelectedCallback=function(b){this.selectedCallback=b};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(b,d){mxEventSource.call(this);this.ui=b;this.setData(d||"");this.initialData=this.getData();this.created=(new Date).getTime();this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource);
DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;
DrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.errorReportsEnabled=!1;DrawioFile.prototype.ageStart=null;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};
DrawioFile.prototype.getShadowPages=function(){null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData));return this.shadowPages};DrawioFile.prototype.setShadowPages=function(b){this.shadowPages=b};DrawioFile.prototype.synchronizeFile=function(b,d){this.savingFile?null!=d&&d({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(g){this.sync.cleanup(b,d,g)}),d):this.updateFile(b,d)};
DrawioFile.prototype.updateFile=function(b,d,g,l){null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=d&&d():this.getLatestVersion(mxUtils.bind(this,function(D){try{null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[D]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=d&&d():null!=D?this.mergeFile(D,b,d,l):this.reloadFile(b,
d))}catch(p){null!=d&&d(p)}}),d))};
DrawioFile.prototype.mergeFile=function(b,d,g,l){var D=!0;try{this.stats.fileMerged++;var p=this.getShadowPages(),E=b.getShadowPages();if(null!=E&&0<E.length){var N=[this.ui.diffPages(null!=l?l:p,E)],R=this.ignorePatches(N);this.setShadowPages(E);if(R)EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",R);else{null!=this.sync&&this.sync.sendLocalChanges();this.backupPatch=this.isModified()?this.ui.diffPages(p,this.ui.pages):null;l={};R={};var G=this.ui.patchPages(p,N[0]),M=this.ui.getHashValueForPages(G,
l),Q=this.ui.getHashValueForPages(E,R);EditorUi.debug("File.mergeFile",[this],"file",[b],"shadow",p,"pages",this.ui.pages,"patches",N,"backup",this.backupPatch,"checksum",M,"current",Q,"valid",M==Q,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified());if(null!=M&&M!=Q){var e=this.compressReportData(this.getAnonymizedXmlForPages(E)),f=this.compressReportData(this.getAnonymizedXmlForPages(G)),k=this.ui.hashValue(b.getCurrentEtag()),z=this.ui.hashValue(this.getCurrentEtag());
this.checksumError(g,N,"Shadow Details: "+JSON.stringify(l)+"\nChecksum: "+M+"\nCurrent: "+Q+"\nCurrent Details: "+JSON.stringify(R)+"\nFrom: "+k+"\nTo: "+z+"\n\nFile Data:\n"+e+"\nPatched Shadow:\n"+f,null,"mergeFile",M,Q,b.getCurrentRevisionId());return}if(null!=this.sync){var t=this.sync.patchRealtime(N,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null);null==t||mxUtils.isEmptyObject(t)||N.push(t)}this.patch(N,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw D=!1,Error(mxResources.get("notADiagramFile"));
this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=d&&d()}catch(O){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=g&&g(O);try{if(D)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,O);else{var B=this.getCurrentUser(),I=null!=B?B.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),I,O)}}catch(J){}}};
DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var d=new mxCodec(mxUtils.createXmlDocument()),g=d.document.createElement("mxfile");if(null!=b)for(var l=0;l<b.length;l++){var D=d.encode(new mxGraphModel(b[l].root));"1"!=urlParams.dev&&(D=this.ui.anonymizeNode(D,!0));D.setAttribute("id",b[l].getId());b[l].viewState&&this.ui.editor.graph.saveViewState(b[l].viewState,D,!0);g.appendChild(D)}return mxUtils.getPrettyXml(g)};
DrawioFile.prototype.compressReportData=function(b,d,g){d=null!=d?d:1E4;null!=g&&null!=b&&b.length>g?b=b.substring(0,g)+"[...]":null!=b&&b.length>d&&(b=Graph.compress(b)+"\n");return b};
DrawioFile.prototype.checksumError=function(b,d,g,l,D,p,E,N){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{if(this.errorReportsEnabled){if(null!=d)for(var R=0;R<d.length;R++)this.ui.anonymizePatch(d[R]);var G=mxUtils.bind(this,function(z){var t=this.compressReportData(JSON.stringify(d,null,2));z=null==z?"n/a":this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForXml(z.data)),
25E3);this.sendErrorReport("Checksum Error in "+D+" "+this.getHash(),(null!=g?g:"")+"\n\nPatches:\n"+t+(null!=z?"\n\nRemote:\n"+z:""),null,7E4)});null==l?G(null):this.getLatestVersion(mxUtils.bind(this,function(z){null!=z&&z.getCurrentEtag()==l?G(z):G(null)}),function(){})}else{var M=this.getCurrentUser(),Q=null!=M?M.id:"unknown",e=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",f=JSON.stringify(d).length,k=null;if(null!=d&&this.constructor==DriveFile&&400>f){for(R=0;R<d.length;R++)this.ui.anonymizePatch(d[R]);
k=JSON.stringify(d);k=null!=k&&250>k.length?Graph.compress(k):null}this.getLatestVersion(mxUtils.bind(this,function(z){try{var t=null!=k?"Report":"Error",B=this.ui.getHashValueForPages(z.getShadowPages());EditorUi.logError("Checksum "+t+" in "+D+" "+e,null,this.getMode()+"."+this.getId(),"user_"+Q+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+f+"-patches_"+d.length+(null!=k?"-json_"+k:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=E?"-current_"+E:"")+(null!=N?
"-rev_"+this.ui.hashValue(N):"")+(null!=B?"-latest_"+B:"")+(null!=z?"-latestRev_"+this.ui.hashValue(z.getCurrentRevisionId()):""));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+e,action:D,label:"user_"+Q+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+f+"-patches_"+d.length+"-size_"+this.getSize()})}catch(I){}}),b)}}catch(z){}};
DrawioFile.prototype.sendErrorReport=function(b,d,g,l){try{var D=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),E=this.getCurrentUser(),N=null!=E?this.ui.hashValue(E.id):"unknown",R=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",G=this.getTitle(),M=G.lastIndexOf(".");E="xml";0<M&&(E=G.substring(M));var Q=null!=g?g.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+
":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+E+")\nUser="+N+R+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=d?"\n\n"+d:
"")+(null!=g?"\n\nError: "+g.message:"")+"\n\nStack:\n"+Q+"\n\nShadow:\n"+D+"\n\nData:\n"+p,l)}catch(e){}};
DrawioFile.prototype.reloadFile=function(b,d){try{this.ui.spinner.stop();var g=mxUtils.bind(this,function(){EditorUi.debug("DrawioFile.reloadFile",[this],"hash",this.getHash(),"modified",this.isModified(),"backupPatch",this.backupPatch);this.stats.fileReloaded++;if(""==this.getHash())this.mergeLatestVersion(null!=this.backupPatch?[this.backupPatch]:null,mxUtils.bind(this,function(){this.backupPatch=null;null!=b&&b()}),d);else{var l=this.ui.editor.graph,D=l.getSelectionCells(),p=l.getViewState(),E=
this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(E,p,D);null!=this.backupPatch&&this.patch([this.backupPatch]);var N=this.ui.getCurrentFile();null!=N&&(N.stats=this.stats);null!=b&&b()}}),!0)}});this.isModified()&&null==this.backupPatch?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.handleFileSuccess("manual"==DrawioFile.SYNC)}),g,mxResources.get("cancel"),mxResources.get("discardChanges")):
g()}catch(l){null!=d&&d(l)}};DrawioFile.prototype.mergeLatestVersion=function(b,d,g){this.getLatestVersion(mxUtils.bind(this,function(l){this.ui.editor.graph.model.beginUpdate();try{this.ui.replaceFileData(l.getData()),null!=b&&this.patch(b)}finally{this.ui.editor.graph.model.endUpdate()}this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(l.getDescriptor());this.descriptorChanged();null!=d&&d()}),g)};
DrawioFile.prototype.copyFile=function(b,d){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var d=!0;if(null!=b)for(var g=0;g<b.length&&d;g++)d=d&&mxUtils.isEmptyObject(b[g]);return d};
DrawioFile.prototype.patch=function(b,d,g){if(null!=b){var l=this.ui.editor.undoManager,D=l.history.slice(),p=l.indexOfNextAdd,E=this.ui.editor.graph;E.container.style.visibility="hidden";var N=this.changeListenerEnabled;this.changeListenerEnabled=g;var R=E.foldingEnabled,G=E.mathEnabled,M=E.cellRenderer.redraw;E.cellRenderer.redraw=function(Q){Q.view.graph.isEditing(Q.cell)&&(Q.view.graph.scrollCellToVisible(Q.cell),Q.view.graph.cellEditor.resize());M.apply(this,arguments)};E.model.beginUpdate();
try{this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified()),0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage()),0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{E.container.style.visibility="";E.model.endUpdate();E.cellRenderer.redraw=M;this.changeListenerEnabled=N;g||(l.history=D,l.indexOfNextAdd=p,l.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)G!=E.mathEnabled?
(this.ui.editor.updateGraphComponents(),E.refresh()):(R!=E.foldingEnabled?E.view.revalidate():E.view.validate(),E.sizeDidChange());null!=this.sync&&this.isRealtime()&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.updateTabContainer();this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",d,"undoable",g)}return b};
DrawioFile.prototype.save=function(b,d,g,l,D,p){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",l,"overwrite",D,"manual",p,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!D&&this.invalidChecksum)if(null!=g)g({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=d&&d();else if(null!=g)g({message:mxResources.get("readOnly")});
else throw Error(mxResources.get("readOnly"));}catch(E){if(null!=g)g(E);else throw E;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var d=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=d&&(d.viewState=this.ui.editor.graph.getViewState(),d.needsUpdate=!0)}d=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return d};
DrawioFile.prototype.updateFileData=function(){null!=this.sync&&this.sync.sendLocalChanges();this.setData(this.createData());null!=this.sync&&this.sync.fileDataUpdated()};DrawioFile.prototype.isCompressedStorage=function(){return!0};DrawioFile.prototype.isCompressed=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=b?"false"!=b:this.isCompressedStorage()&&Editor.compressXml};DrawioFile.prototype.saveAs=function(b,d,g){};
DrawioFile.prototype.saveFile=function(b,d,g,l){};DrawioFile.prototype.getPublicUrl=function(b){b(null)};DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.getShadowModified=function(){return this.shadowModified};DrawioFile.prototype.setShadowModified=function(b){this.shadowModified=b};DrawioFile.prototype.setModified=function(b){this.shadowModified=this.modified=b};DrawioFile.prototype.isAutosaveOptional=function(){return!1};
DrawioFile.prototype.isAutosave=function(){return!this.inConflictState&&this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(b,d,g){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.isTrashed=function(){return!1};DrawioFile.prototype.move=function(b,d,g){};DrawioFile.prototype.share=function(){this.ui.alert(mxResources.get("sharingAvailable"),null,380)};DrawioFile.prototype.getHash=function(){return""};
DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(b){this.data=b;EditorUi.debug("DrawioFile.setData",[this],"data",[b])};DrawioFile.prototype.getData=function(){return this.data};
DrawioFile.prototype.open=function(){this.stats.opened++;var b=this.getData();if(null!=b){var d=function(g){for(var l=0;null!=g&&l<g.length;l++){var D=g[l];null!=D.id&&0==D.id.indexOf("extFont_")&&D.parentNode.removeChild(D)}};d(document.querySelectorAll("head > style[id]"));d(document.querySelectorAll("head > link[id]"));this.ui.setFileData(b);this.isModified()||this.setShadowPages(this.ui.clonePages(this.ui.pages))}this.installListeners();this.isSyncSupported()&&this.startSync()};
DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRealtime=function(){return null!=this.ownPages};DrawioFile.prototype.isRealtimeSupported=function(){return!1};DrawioFile.prototype.isRealtimeEnabled=function(){return Editor.enableRealtime&&"0"!=urlParams["fast-sync"]};DrawioFile.prototype.setRealtimeEnabled=function(){};DrawioFile.prototype.isRealtimeOptional=function(){return!1};
DrawioFile.prototype.getRealtimeState=function(){return null!=this.sync&&null!=this.sync.p2pCollab?this.sync.p2pCollab.getState():3};DrawioFile.prototype.getRealtimeError=function(){return null!=this.sync&&null!=this.sync.p2pCollab?this.sync.p2pCollab.getLastError():null};DrawioFile.prototype.isOptimisticSync=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(b,d){b(null)};
DrawioFile.prototype.loadDescriptor=function(b,d){b(null)};DrawioFile.prototype.loadPatchDescriptor=function(b,d){this.loadDescriptor(mxUtils.bind(this,function(g){b(g)}),d)};DrawioFile.prototype.patchDescriptor=function(b,d){this.setDescriptorEtag(b,this.getDescriptorEtag(d));this.descriptorChanged()};
DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC&&"fast"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.ui.fireEvent(new mxEventObject("realtimeStateChanged"))})),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};
DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(b){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(b,d){b(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};DrawioFile.prototype.setCurrentRevisionId=function(b){this.setDescriptorRevisionId(this.getDescriptor(),b)};
DrawioFile.prototype.getCurrentRevisionId=function(){return this.getDescriptorRevisionId(this.getDescriptor())};DrawioFile.prototype.setCurrentEtag=function(b){this.setDescriptorEtag(this.getDescriptor(),b)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorRevisionId=function(b,d){this.setDescriptorEtag(b,d)};
DrawioFile.prototype.getDescriptorRevisionId=function(b){return this.getDescriptorEtag(b)};DrawioFile.prototype.setDescriptorEtag=function(b,d){};DrawioFile.prototype.getDescriptorEtag=function(b){return null};DrawioFile.prototype.getDescriptorSecret=function(b){return null};
DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(this.changeListener=mxUtils.bind(this,function(b,d){b=null!=d?d.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=b&&b.ignoreEdit||this.fileChanged()}),this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener),this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener),this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener),this.ui.addListener("pageFormatChanged",
this.changeListener),this.ui.addListener("pageScaleChanged",this.changeListener),this.ui.addListener("backgroundColorChanged",this.changeListener),this.ui.addListener("backgroundImageChanged",this.changeListener),this.ui.addListener("foldingEnabledChanged",this.changeListener),this.ui.addListener("mathEnabledChanged",this.changeListener),this.ui.addListener("gridEnabledChanged",this.changeListener),this.ui.addListener("guidesEnabledChanged",this.changeListener),this.ui.addListener("tooltipsEnabledChanged",
this.changeListener),this.ui.addListener("pageViewChanged",this.changeListener),this.ui.addListener("connectionPointsChanged",this.changeListener),this.ui.addListener("connectionArrowsChanged",this.changeListener))};
DrawioFile.prototype.addAllSavedStatus=function(b){null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this&&(b=null!=b?b:mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey)),this.ui.editor.setStatus('<div title="'+b+'">'+b+"</div>"),b=this.ui.statusContainer.getElementsByTagName("div"),0<b.length&&this.isRevisionHistorySupported()&&(b[0].style.cursor="pointer",b[0].style.textDecoration="underline",mxEvent.addListener(b[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()}))))};
DrawioFile.prototype.saveDraft=function(){try{null==this.draftId&&(this.draftId=null!=this.usedDraftId?this.usedDraftId:Editor.guid());var b={type:"draft",created:this.created,modified:(new Date).getTime(),data:this.ui.getFileData(),title:this.getTitle(),fileObject:this.fileObject,aliveCheck:this.ui.draftAliveCheck};this.ui.setDatabaseItem(".draft_"+this.draftId,JSON.stringify(b));EditorUi.debug("DrawioFile.saveDraft",[this],"draftId",this.draftId,[b])}catch(d){this.removeDraft()}};
DrawioFile.prototype.removeDraft=function(){try{null!=this.draftId&&(EditorUi.debug("DrawioFile.removeDraft",[this],"draftId",this.draftId),this.ui.removeDatabaseItem(".draft_"+this.draftId),this.usedDraftId=this.draftId,this.draftId=null)}catch(b){}};
DrawioFile.prototype.addUnsavedStatus=function(b){if(!this.inConflictState&&null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this)if(b instanceof Error&&null!=b.message&&""!=b.message){var d=mxUtils.htmlEntities(mxResources.get("unsavedChanges"));this.ui.editor.setStatus('<div title="'+d+'" class="geStatusAlert">'+d+" ("+mxUtils.htmlEntities(b.message)+")</div>");d=this.ui.statusContainer.getElementsByTagName("div");null!=d&&0<d.length&&(d[0].style.cursor="pointer",mxEvent.addListener(d[0],
"click",mxUtils.bind(this,function(){this.ui.showError(mxResources.get("unsavedChanges"),mxUtils.htmlEntities(b.message))})))}else{d=this.getErrorMessage(b);if(null==d&&null!=this.lastSaved){var g=this.ui.timeSince(new Date(this.lastSaved));null!=g&&(d=mxResources.get("lastSaved",[g]))}null!=d&&60<d.length&&(d=d.substring(0,60)+"...");d=mxUtils.htmlEntities(mxResources.get("unsavedChangesClickHereToSave"))+(null!=d&&""!=d?" ("+mxUtils.htmlEntities(d)+")":"");this.ui.editor.setStatus('<div title="'+
d+'" class="geStatusAlertOrange">'+d+' <img src="'+Editor.saveImage+'"/></div>');d=this.ui.statusContainer.getElementsByTagName("div");null!=d&&0<d.length?(d[0].style.cursor="pointer",mxEvent.addListener(d[0],"click",mxUtils.bind(this,function(){this.ui.actions.get(null!=this.ui.mode&&this.isEditable()?"save":"saveAs").funct()}))):(d=mxUtils.htmlEntities(mxResources.get("unsavedChanges")),this.ui.editor.setStatus('<div title="'+d+'" class="geStatusAlert">'+d+" ("+mxUtils.htmlEntities(b.message)+")</div>"));
EditorUi.enableDrafts&&(null==this.getMode()||EditorUi.isElectronApp)&&(this.lastDraftSave=this.lastDraftSave||Date.now(),null!=this.saveDraftThread&&(window.clearTimeout(this.saveDraftThread),this.saveDraftThread=null,Date.now()-this.lastDraftSave>Math.max(2*EditorUi.draftSaveDelay,3E4)&&(this.lastDraftSave=Date.now(),this.saveDraft())),this.saveDraftThread=window.setTimeout(mxUtils.bind(this,function(){this.lastDraftSave=Date.now();this.saveDraftThread=null;this.saveDraft()}),EditorUi.draftSaveDelay||
0))}};
DrawioFile.prototype.addConflictStatus=function(b,d){this.invalidChecksum&&null==d&&(d=mxResources.get("checksum"));this.setConflictStatus(mxUtils.htmlEntities(mxResources.get("fileChangedSync"))+(null!=d&&""!=d?" ("+mxUtils.htmlEntities(d)+")":""));this.ui.spinner.stop();this.clearAutosave();d=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null;null!=d&&0<d.length?(d[0].style.cursor="pointer",mxEvent.addListener(d[0],"click",mxUtils.bind(this,function(g){"IMG"!=mxEvent.getSource(g).nodeName&&
b()}))):this.ui.alert(mxUtils.htmlEntities(mxResources.get("fileChangedSync")),b)};DrawioFile.prototype.setConflictStatus=function(b){this.ui.editor.setStatus('<div title="'+b+'" class="geStatusAlert">'+b+' <a href="https://www.diagrams.net/doc/faq/synchronize" title="'+mxResources.get("help")+'" target="_blank"><img src="'+Editor.helpImage+'"/></a></div>')};
DrawioFile.prototype.showRefreshDialog=function(b,d,g){null==g&&(g=mxResources.get("checksum"));this.ui.editor.isChromelessView()&&!this.ui.editor.editable?this.ui.alert(mxResources.get("fileChangedSync"),mxUtils.bind(this,function(){this.reloadFile(b,d)})):(this.addConflictStatus(mxUtils.bind(this,function(){this.showRefreshDialog(b,d)}),g),this.ui.showError(mxResources.get("warning")+" ("+g+")",mxResources.get("fileChangedSyncDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(b,
d)}),null,mxResources.get("merge"),mxUtils.bind(this,function(){this.reloadFile(b,d)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,130))};
DrawioFile.prototype.showCopyDialog=function(b,d,g){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(b,d)}),null,mxResources.get("overwrite"),g,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,150)};
DrawioFile.prototype.showConflictDialog=function(b,d){this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedSyncDialog"),mxResources.get("overwrite"),b,null,mxResources.get("merge"),d,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog();this.handleFileError(null,!1)}),380,130)};
DrawioFile.prototype.redirectToNewApp=function(b,d){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var g=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),l=mxResources.get("redirectToNewApp");null!=d&&(l+=" ("+d+")");d=mxUtils.bind(this,function(){var D=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==g?window.location.reload():window.location.href=
g});null==b&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),D,mxResources.get("cancel"),mxResources.get("discardChanges")):D()});null!=b?this.isModified()?this.ui.confirm(l,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()}),d,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(l,d,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()})):this.ui.alert(mxResources.get("redirectToNewApp"),
d)}};
DrawioFile.prototype.handleFileSuccess=function(b){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(EditorUi.debug("DrawioFile.handleFileSuccess",[this],"saved",b,"modified",this.isModified()),this.isModified()?this.fileChanged():b?(this.isTrashed()?this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey))+" ("+mxUtils.htmlEntities(mxResources.get("fileMovedToTrash"))+")"):this.addAllSavedStatus(),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=
!1,this.sync.fileChangedNotify()))):this.ui.editor.setStatus(""))};
DrawioFile.prototype.handleFileError=function(b,d){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.inConflictState?this.handleConflictError(b,d):(this.isModified()&&this.addUnsavedStatus(b),d?this.ui.handleError(b,null!=b?mxResources.get("errorSavingFile"):null):this.isModified()||(b=this.getErrorMessage(b),null!=b&&60<b.length&&(b=b.substring(0,60)+"..."),this.ui.editor.setStatus('<div class="geStatusAlert">'+mxUtils.htmlEntities(mxResources.get("error"))+(null!=b?" ("+mxUtils.htmlEntities(b)+
")":"")+"</div>"))))};
DrawioFile.prototype.handleConflictError=function(b,d){var g=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),l=mxUtils.bind(this,function(E){this.handleFileError(E,!0)}),D=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.editor.setStatus(""),this.save(!0,g,l,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),p=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&
this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,g,l,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),l)});"none"==DrawioFile.SYNC?this.showCopyDialog(g,l,D):this.invalidChecksum?this.showRefreshDialog(g,l,this.getErrorMessage(b)):d?this.showConflictDialog(D,p):this.addConflictStatus(mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));
this.synchronizeFile(g,l)}),this.getErrorMessage(b))};DrawioFile.prototype.getErrorMessage=function(b){var d=null!=b?null!=b.error?b.error.message:b.message:null;null==d&&null!=b&&b.code==App.ERROR_TIMEOUT&&(d=mxResources.get("timeout"));return d};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};
DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=new Date;this.setModified(!0);EditorUi.debug("DrawioFile.fileChanged",[this],"autosave",this.isAutosave(),"saving",this.savingFile);this.isAutosave()?(null!=this.savingStatusKey&&this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.savingStatusKey))+"..."),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(d){this.ui.stopSanityCheck();
null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(d){this.handleFileError(d)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};
DrawioFile.prototype.createSecret=function(b){var d=Editor.guid(32);null==this.sync||this.isOptimisticSync()?b(d):this.sync.createToken(d,mxUtils.bind(this,function(g){b(d,g)}),mxUtils.bind(this,function(){b(d)}))};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};
DrawioFile.prototype.fileSaved=function(b,d,g,l,D){this.lastSaved=new Date;this.ageStart=null;try{this.stats.saved++;this.invalidChecksum=this.inConflictState=!1;var p=this.ui.getPagesForXml(b);null==this.sync||this.isOptimisticSync()?(this.setShadowPages(p),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=g&&g()):this.sync.fileSaved(p,d,g,l,D)}catch(R){this.invalidChecksum=this.inConflictState=
!0;this.descriptorChanged();null!=l&&l(R);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,R);else{var E=this.getCurrentUser(),N=null!=E?E.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),N,R)}}catch(G){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)};
DrawioFile.prototype.autosave=function(b,d,g,l){null==this.lastAutosave&&(this.lastAutosave=Date.now());b=Date.now()-this.lastAutosave<d?b:0;this.clearAutosave();var D=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=null;this.autosaveThread==D&&(this.autosaveThread=null);EditorUi.debug("DrawioFile.autosave",[this],"thread",D,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile);if(this.isModified()&&this.isAutosaveNow()){var p=this.isAutosaveRevision();
p&&(this.lastAutosaveRevision=(new Date).getTime());this.save(p,mxUtils.bind(this,function(E){this.autosaveCompleted();null!=g&&g(E)}),mxUtils.bind(this,function(E){null!=l&&l(E)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=g&&g(null)}),b);EditorUi.debug("DrawioFile.autosave",[this],"thread",D,"delay",b,"saving",this.savingFile);this.autosaveThread=D};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};
DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};
DrawioFile.prototype.close=function(b){this.updateFileData();this.stats.closed++;this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,b);this.destroy()};DrawioFile.prototype.hasSameExtension=function(b,d){if(null!=b&&null!=d){var g=b.lastIndexOf(".");b=0<g?b.substring(g):"";g=d.lastIndexOf(".");return b===(0<g?d.substring(g):"")}return b==d};
DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};DrawioFile.prototype.destroy=function(){this.clearAutosave();this.removeListeners();this.stats.destroyed++;null!=this.sync&&(this.sync.destroy(),this.sync=null)};DrawioFile.prototype.commentsSupported=function(){return!1};
DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,d){b([])};DrawioFile.prototype.addComment=function(b,d,g){d(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,d){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,d)};LocalFile=function(b,d,g,l,D,p){DrawioFile.call(this,b,d);this.title=g;this.mode=l?null:App.MODE_DEVICE;this.fileHandle=D;this.desc=p};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};
LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(b,d,g){this.saveAs(this.title,d,g)};LocalFile.prototype.saveAs=function(b,d,g){this.saveFile(b,!1,d,g)};LocalFile.prototype.saveAs=function(b,d,g){this.saveFile(b,!1,d,g)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};
LocalFile.prototype.getLatestVersion=function(b,d){null==this.fileHandle?b(null):this.ui.loadFileSystemEntry(this.fileHandle,b,d)};
LocalFile.prototype.saveFile=function(b,d,g,l,D){b!=this.title&&(this.desc=this.fileHandle=null);this.title=b;D||this.updateFileData();var p=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var E=this.getData(),N=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=g&&g()}),R=mxUtils.bind(this,function(G){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=!0;var M=mxUtils.bind(this,
function(e){this.savingFile=!1;null!=l&&l({error:e})});this.saveDraft();this.fileHandle.createWritable().then(mxUtils.bind(this,function(e){this.fileHandle.getFile().then(mxUtils.bind(this,function(f){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[f],"conflict",this.desc.lastModified!=f.lastModified);this.desc.lastModified==f.lastModified?e.write(p?this.ui.base64ToBlob(G,"image/png"):G).then(mxUtils.bind(this,function(){e.close().then(mxUtils.bind(this,
function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(k){try{var z=this.desc;this.savingFile=!1;this.desc=k;this.fileSaved(E,z,N,M);this.removeDraft()}catch(t){M(t)}}),M)}),M)}),M):(this.inConflictState=!0,M())}),mxUtils.bind(this,function(f){this.invalidFileHandle=!0;M(f)}))}),M)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(G,b,p?"image/png":"text/xml",p);else if(G.length<MAX_REQUEST_SIZE){var Q=b.lastIndexOf(".");Q=0<Q?b.substring(Q+1):"xml";
(new mxXmlRequest(SAVE_URL,"format="+Q+"&xml="+encodeURIComponent(G)+"&filename="+encodeURIComponent(b)+(p?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(G)}));N()}});p?(d=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(G){R(G)}),l,this.ui.getCurrentFile()!=this?E:null,d.scale,d.border)):R(E)};
LocalFile.prototype.rename=function(b,d,g){this.title=b;this.descriptorChanged();null!=d&&d()};LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.prototype.appName="diagrams.net";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},{description:"diagramHtmlDesc",extension:"html",mimeType:"text/html"},
{description:"diagramXmlDesc",extension:"xml",mimeType:"text/xml"}];Editor.prototype.libraryFileTypes=[{description:"Library (.drawiolib, .xml)",extensions:["drawiolib","xml"]}];Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,
fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.styles=[{},{commonStyle:{fontColor:"#5C5C5C",strokeColor:"#006658",fillColor:"#21C0A5"}},{commonStyle:{fontColor:"#095C86",strokeColor:"#AF45ED",fillColor:"#F694C1"},edgeStyle:{strokeColor:"#60E696"}},{commonStyle:{fontColor:"#46495D",strokeColor:"#788AA3",fillColor:"#B2C9AB"}},{commonStyle:{fontColor:"#5AA9E6",strokeColor:"#FF6392",fillColor:"#FFE45E"}},{commonStyle:{fontColor:"#1D3557",strokeColor:"#457B9D",fillColor:"#A8DADC"},graph:{background:"#F1FAEE"}},
{commonStyle:{fontColor:"#393C56",strokeColor:"#E07A5F",fillColor:"#F2CC8F"},graph:{background:"#F4F1DE",gridColor:"#D4D0C0"}},{commonStyle:{fontColor:"#143642",strokeColor:"#0F8B8D",fillColor:"#FAE5C7"},edgeStyle:{strokeColor:"#A8201A"},graph:{background:"#DAD2D8",gridColor:"#ABA4A9"}},{commonStyle:{fontColor:"#FEFAE0",strokeColor:"#DDA15E",fillColor:"#BC6C25"},graph:{background:"#283618",gridColor:"#48632C"}},{commonStyle:{fontColor:"#E4FDE1",strokeColor:"#028090",fillColor:"#F45B69"},graph:{background:"#114B5F",
gridColor:"#0B3240"}},{},{vertexStyle:{strokeColor:"#D0CEE2",fillColor:"#FAD9D5"},edgeStyle:{strokeColor:"#09555B"},commonStyle:{fontColor:"#1A1A1A"}},{vertexStyle:{strokeColor:"#BAC8D3",fillColor:"#09555B",fontColor:"#EEEEEE"},edgeStyle:{strokeColor:"#0B4D6A"}},{vertexStyle:{strokeColor:"#D0CEE2",fillColor:"#5D7F99"},edgeStyle:{strokeColor:"#736CA8"},commonStyle:{fontColor:"#1A1A1A"}},{vertexStyle:{strokeColor:"#FFFFFF",fillColor:"#182E3E",fontColor:"#FFFFFF"},edgeStyle:{strokeColor:"#23445D"},graph:{background:"#FCE7CD",
gridColor:"#CFBDA8"}},{vertexStyle:{strokeColor:"#FFFFFF",fillColor:"#F08E81"},edgeStyle:{strokeColor:"#182E3E"},commonStyle:{fontColor:"#1A1A1A"},graph:{background:"#B0E3E6",gridColor:"#87AEB0"}},{vertexStyle:{strokeColor:"#909090",fillColor:"#F5AB50"},edgeStyle:{strokeColor:"#182E3E"},commonStyle:{fontColor:"#1A1A1A"},graph:{background:"#EEEEEE"}},{vertexStyle:{strokeColor:"#EEEEEE",fillColor:"#56517E",fontColor:"#FFFFFF"},edgeStyle:{strokeColor:"#182E3E"},graph:{background:"#FAD9D5",gridColor:"#BFA6A3"}},
{vertexStyle:{strokeColor:"#BAC8D3",fillColor:"#B1DDF0",fontColor:"#182E3E"},edgeStyle:{strokeColor:"#EEEEEE",fontColor:"#FFFFFF"},graph:{background:"#09555B",gridColor:"#13B4C2"}},{vertexStyle:{fillColor:"#EEEEEE",fontColor:"#1A1A1A"},edgeStyle:{fontColor:"#FFFFFF"},commonStyle:{strokeColor:"#FFFFFF"},graph:{background:"#182E3E",gridColor:"#4D94C7"}}];Editor.logoImage="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIKICAgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzA2LjE4NSAxMjAuMjk2IgogICB2aWV3Qm94PSIyNCAyNiA2OCA2OCIKICAgeT0iMHB4IgogICB4PSIwcHgiCiAgIHZlcnNpb249IjEuMSI+CiAgIAkgPGc+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNDEuMDYxIgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjkiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTUyOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNzUuMDc2IgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjgiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTAwOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGc+PHBhdGgKICAgICAgICAgZD0iTTUyLjc3Myw3Ny4wODRjMCwxLjk1NC0xLjU5OSwzLjU1My0zLjU1MywzLjU1M0gzNi45OTljLTEuOTU0LDAtMy41NTMtMS41OTktMy41NTMtMy41NTN2LTkuMzc5ICAgIGMwLTEuOTU0LDEuNTk5LTMuNTUzLDMuNTUzLTMuNTUzaDEyLjIyMmMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjc3LjA4NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnCiAgICAgICBpZD0iZzM0MTkiPjxwYXRoCiAgICAgICAgIGQ9Ik02Ny43NjIsNDguMDc0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINTEuOTg4Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M0g2NC4yMWMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjQ4LjA3NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnPjxwYXRoCiAgICAgICAgIGQ9Ik04Mi43NTIsNzcuMDg0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINjYuOTc3Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M2gxMi4yMjJjMS45NTQsMCwzLjU1MywxLjU5OSwzLjU1MywzLjU1M1Y3Ny4wODR6IgogICAgICAgICBmaWxsPSIjRkZGRkZGIiAvPjwvZz48L2c+PC9zdmc+";
Editor.saveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiPjxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48cGF0aCBkPSJNMTkgMTJ2N0g1di03SDN2N2MwIDEuMS45IDIgMiAyaDE0YzEuMSAwIDItLjkgMi0ydi03aC0yem0tNiAuNjdsMi41OS0yLjU4TDE3IDExLjVsLTUgNS01LTUgMS40MS0xLjQxTDExIDEyLjY3VjNoMnoiLz48L3N2Zz4=";Editor.globeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTEuOTkgMkM2LjQ3IDIgMiA2LjQ4IDIgMTJzNC40NyAxMCA5Ljk5IDEwQzE3LjUyIDIyIDIyIDE3LjUyIDIyIDEyUzE3LjUyIDIgMTEuOTkgMnptNi45MyA2aC0yLjk1Yy0uMzItMS4yNS0uNzgtMi40NS0xLjM4LTMuNTYgMS44NC42MyAzLjM3IDEuOTEgNC4zMyAzLjU2ek0xMiA0LjA0Yy44MyAxLjIgMS40OCAyLjUzIDEuOTEgMy45NmgtMy44MmMuNDMtMS40MyAxLjA4LTIuNzYgMS45MS0zLjk2ek00LjI2IDE0QzQuMSAxMy4zNiA0IDEyLjY5IDQgMTJzLjEtMS4zNi4yNi0yaDMuMzhjLS4wOC42Ni0uMTQgMS4zMi0uMTQgMiAwIC42OC4wNiAxLjM0LjE0IDJINC4yNnptLjgyIDJoMi45NWMuMzIgMS4yNS43OCAyLjQ1IDEuMzggMy41Ni0xLjg0LS42My0zLjM3LTEuOS00LjMzLTMuNTZ6bTIuOTUtOEg1LjA4Yy45Ni0xLjY2IDIuNDktMi45MyA0LjMzLTMuNTZDOC44MSA1LjU1IDguMzUgNi43NSA4LjAzIDh6TTEyIDE5Ljk2Yy0uODMtMS4yLTEuNDgtMi41My0xLjkxLTMuOTZoMy44MmMtLjQzIDEuNDMtMS4wOCAyLjc2LTEuOTEgMy45NnpNMTQuMzQgMTRIOS42NmMtLjA5LS42Ni0uMTYtMS4zMi0uMTYtMiAwLS42OC4wNy0xLjM1LjE2LTJoNC42OGMuMDkuNjUuMTYgMS4zMi4xNiAyIDAgLjY4LS4wNyAxLjM0LS4xNiAyem0uMjUgNS41NmMuNi0xLjExIDEuMDYtMi4zMSAxLjM4LTMuNTZoMi45NWMtLjk2IDEuNjUtMi40OSAyLjkzLTQuMzMgMy41NnpNMTYuMzYgMTRjLjA4LS42Ni4xNC0xLjMyLjE0LTIgMC0uNjgtLjA2LTEuMzQtLjE0LTJoMy4zOGMuMTYuNjQuMjYgMS4zMS4yNiAycy0uMSAxLjM2LS4yNiAyaC0zLjM4eiIvPjwvc3ZnPg==";
Editor.commentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMjEuOTkgNGMwLTEuMS0uODktMi0xLjk5LTJINGMtMS4xIDAtMiAuOS0yIDJ2MTJjMCAxLjEuOSAyIDIgMmgxNGw0IDQtLjAxLTE4ek0xOCAxNEg2di0yaDEydjJ6bTAtM0g2VjloMTJ2MnptMC0zSDZWNmgxMnYyeiIvPjxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48L3N2Zz4=";Editor.userImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgMTJjMi4yMSAwIDQtMS43OSA0LTRzLTEuNzktNC00LTQtNCAxLjc5LTQgNCAxLjc5IDQgNCA0em0wIDJjLTIuNjcgMC04IDEuMzQtOCA0djJoMTZ2LTJjMC0yLjY2LTUuMzMtNC04LTR6Ii8+PC9zdmc+";
Editor.shareImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTggMTYuMDhjLS43NiAwLTEuNDQuMy0xLjk2Ljc3TDguOTEgMTIuN2MuMDUtLjIzLjA5LS40Ni4wOS0uN3MtLjA0LS40Ny0uMDktLjdsNy4wNS00LjExYy41NC41IDEuMjUuODEgMi4wNC44MSAxLjY2IDAgMy0xLjM0IDMtM3MtMS4zNC0zLTMtMy0zIDEuMzQtMyAzYzAgLjI0LjA0LjQ3LjA5LjdMOC4wNCA5LjgxQzcuNSA5LjMxIDYuNzkgOSA2IDljLTEuNjYgMC0zIDEuMzQtMyAzczEuMzQgMyAzIDNjLjc5IDAgMS41LS4zMSAyLjA0LS44MWw3LjEyIDQuMTZjLS4wNS4yMS0uMDguNDMtLjA4LjY1IDAgMS42MSAxLjMxIDIuOTIgMi45MiAyLjkyIDEuNjEgMCAyLjkyLTEuMzEgMi45Mi0yLjkycy0xLjMxLTIuOTItMi45Mi0yLjkyeiIvPjwvc3ZnPg==";
Editor.syncImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgNFYxTDggNWw0IDRWNmMzLjMxIDAgNiAyLjY5IDYgNiAwIDEuMDEtLjI1IDEuOTctLjcgMi44bDEuNDYgMS40NkMxOS41NCAxNS4wMyAyMCAxMy41NyAyMCAxMmMwLTQuNDItMy41OC04LTgtOHptMCAxNGMtMy4zMSAwLTYtMi42OS02LTYgMC0xLjAxLjI1LTEuOTcuNy0yLjhMNS4yNCA3Ljc0QzQuNDYgOC45NyA0IDEwLjQzIDQgMTJjMCA0LjQyIDMuNTggOCA4IDh2M2w0LTQtNC00djN6Ii8+PC9zdmc+";Editor.cloudImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEyIDZjMi42MiAwIDQuODggMS44NiA1LjM5IDQuNDNsLjMgMS41IDEuNTMuMTFjMS41Ni4xIDIuNzggMS40MSAyLjc4IDIuOTYgMCAxLjY1LTEuMzUgMy0zIDNINmMtMi4yMSAwLTQtMS43OS00LTQgMC0yLjA1IDEuNTMtMy43NiAzLjU2LTMuOTdsMS4wNy0uMTEuNS0uOTVDOC4wOCA3LjE0IDkuOTQgNiAxMiA2bTAtMkM5LjExIDQgNi42IDUuNjQgNS4zNSA4LjA0IDIuMzQgOC4zNiAwIDEwLjkxIDAgMTRjMCAzLjMxIDIuNjkgNiA2IDZoMTNjMi43NiAwIDUtMi4yNCA1LTUgMC0yLjY0LTIuMDUtNC43OC00LjY1LTQuOTZDMTguNjcgNi41OSAxNS42NCA0IDEyIDR6Ii8+PC9zdmc+";
Editor.cloudOffImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTI0IDE1YzAtMi42NC0yLjA1LTQuNzgtNC42NS00Ljk2QzE4LjY3IDYuNTkgMTUuNjQgNCAxMiA0Yy0xLjMzIDAtMi41Ny4zNi0zLjY1Ljk3bDEuNDkgMS40OUMxMC41MSA2LjE3IDExLjIzIDYgMTIgNmMzLjA0IDAgNS41IDIuNDYgNS41IDUuNXYuNUgxOWMxLjY2IDAgMyAxLjM0IDMgMyAwIC45OS0uNDggMS44NS0xLjIxIDIuNGwxLjQxIDEuNDFjMS4wOS0uOTIgMS44LTIuMjcgMS44LTMuODF6TTQuNDEgMy44NkwzIDUuMjdsMi43NyAyLjc3aC0uNDJDMi4zNCA4LjM2IDAgMTAuOTEgMCAxNGMwIDMuMzEgMi42OSA2IDYgNmgxMS43M2wyIDIgMS40MS0xLjQxTDQuNDEgMy44NnpNNiAxOGMtMi4yMSAwLTQtMS43OS00LTRzMS43OS00IDQtNGgxLjczbDggOEg2eiIvPjwvc3ZnPg==";
Editor.calendarImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0cHgiIGZpbGw9IiMwMDAwMDAiPjxnPjxwYXRoIGQ9Ik0wLDBoMjR2MjRIMFYweiIgZmlsbD0ibm9uZSIvPjwvZz48Zz48cGF0aCBkPSJNMjAsNEg0QzIuOSw0LDIsNC45LDIsNnYxMmMwLDEuMSwwLjksMiwyLDJoMTZjMS4xLDAsMi0wLjksMi0yVjZDMjIsNC45LDIxLjEsNCwyMCw0eiBNOCwxMUg0VjZoNFYxMXogTTE0LDExaC00VjZoNFYxMXogTTIwLDExaC00VjZoNFYxMXogTTgsMThINHYtNWg0VjE4eiBNMTQsMThoLTR2LTVoNFYxOHogTTIwLDE4aC00di01aDRWMTh6Ii8+PC9nPjwvc3ZnPg==";
Editor.syncProblemImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyAxMmMwIDIuMjEuOTEgNC4yIDIuMzYgNS42NEwzIDIwaDZ2LTZsLTIuMjQgMi4yNEM1LjY4IDE1LjE1IDUgMTMuNjYgNSAxMmMwLTIuNjEgMS42Ny00LjgzIDQtNS42NVY0LjI2QzUuNTUgNS4xNSAzIDguMjcgMyAxMnptOCA1aDJ2LTJoLTJ2MnpNMjEgNGgtNnY2bDIuMjQtMi4yNEMxOC4zMiA4Ljg1IDE5IDEwLjM0IDE5IDEyYzAgMi42MS0xLjY3IDQuODMtNCA1LjY1djIuMDljMy40NS0uODkgNi00LjAxIDYtNy43NCAwLTIuMjEtLjkxLTQuMi0yLjM2LTUuNjRMMjEgNHptLTEwIDloMlY3aC0ydjZ6Ii8+PC9zdmc+";
Editor.tailSpin="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9Ii0yIC0yIDQ0IDQ0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPGRlZnM+CiAgICAgICAgPGxpbmVhckdyYWRpZW50IHgxPSI4LjA0MiUiIHkxPSIwJSIgeDI9IjY1LjY4MiUiIHkyPSIyMy44NjUlIiBpZD0iYSI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiM4MDgwODAiIHN0b3Atb3BhY2l0eT0iMCIgb2Zmc2V0PSIwJSIvPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjODA4MDgwIiBzdG9wLW9wYWNpdHk9Ii42MzEiIG9mZnNldD0iNjMuMTQ2JSIvPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjODA4MDgwIiBvZmZzZXQ9IjEwMCUiLz4KICAgICAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPC9kZWZzPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIj4KICAgICAgICAgICAgPHBhdGggZD0iTTM2IDE4YzAtOS45NC04LjA2LTE4LTE4LTE4IiBzdHJva2U9InVybCgjYSkiIHN0cm9rZS13aWR0aD0iNiI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMC45cyIKICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgICAgICA8Y2lyY2xlIGZpbGw9IiM4MDgwODAiIGN4PSIzNiIgY3k9IjE4IiByPSIxIj4KICAgICAgICAgICAgICAgIDxhbmltYXRlVHJhbnNmb3JtCiAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIgogICAgICAgICAgICAgICAgICAgIHR5cGU9InJvdGF0ZSIKICAgICAgICAgICAgICAgICAgICBmcm9tPSIwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIHRvPSIzNjAgMTggMTgiCiAgICAgICAgICAgICAgICAgICAgZHVyPSIwLjlzIgogICAgICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPgogICAgICAgICAgICA8L2NpcmNsZT4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPgo=";
Editor.mailImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTIyIDZjMC0xLjEtLjktMi0yLTJINGMtMS4xIDAtMiAuOS0yIDJ2MTJjMCAxLjEuOSAyIDIgMmgxNmMxLjEgMCAyLS45IDItMlY2em0tMiAwbC04IDQuOTlMNCA2aDE2em0wIDEySDRWOGw4IDUgOC01djEweiIvPjwvc3ZnPg==";Editor.cameraImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE0LjEyIDRsMS44MyAySDIwdjEySDRWNmg0LjA1bDEuODMtMmg0LjI0TTE1IDJIOUw3LjE3IDRINGMtMS4xIDAtMiAuOS0yIDJ2MTJjMCAxLjEuOSAyIDIgMmgxNmMxLjEgMCAyLS45IDItMlY2YzAtMS4xLS45LTItMi0yaC0zLjE3TDE1IDJ6bS0zIDdjMS42NSAwIDMgMS4zNSAzIDNzLTEuMzUgMy0zIDMtMy0xLjM1LTMtMyAxLjM1LTMgMy0zbTAtMmMtMi43NiAwLTUgMi4yNC01IDVzMi4yNCA1IDUgNSA1LTIuMjQgNS01LTIuMjQtNS01LTV6Ii8+PC9zdmc+";
Editor.tagsImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiBoZWlnaHQ9IjE4cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE4cHgiIGZpbGw9IiMwMDAwMDAiPjxnPjxwYXRoIGQ9Ik0wLDBoMjR2MjRIMFYweiIgZmlsbD0ibm9uZSIvPjwvZz48Zz48Zz48cGF0aCBkPSJNMjEuNDEsMTEuNDFsLTguODMtOC44M0MxMi4yMSwyLjIxLDExLjcsMiwxMS4xNywySDRDMi45LDIsMiwyLjksMiw0djcuMTdjMCwwLjUzLDAuMjEsMS4wNCwwLjU5LDEuNDFsOC44Myw4LjgzIGMwLjc4LDAuNzgsMi4wNSwwLjc4LDIuODMsMGw3LjE3LTcuMTdDMjIuMiwxMy40NiwyMi4yLDEyLjIsMjEuNDEsMTEuNDF6IE0xMi44MywyMEw0LDExLjE3VjRoNy4xN0wyMCwxMi44M0wxMi44MywyMHoiLz48Y2lyY2xlIGN4PSI2LjUiIGN5PSI2LjUiIHI9IjEuNSIvPjwvZz48L2c+PC9zdmc+";
Editor.darkModeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0iTTEyIDIxcS0zLjc1IDAtNi4zNzUtMi42MjVUMyAxMnEwLTMuNzUgMi42MjUtNi4zNzVUMTIgM3EuMzUgMCAuNjg4LjAyNS4zMzcuMDI1LjY2Mi4wNzUtMS4wMjUuNzI1LTEuNjM3IDEuODg3UTExLjEgNi4xNSAxMS4xIDcuNXEwIDIuMjUgMS41NzUgMy44MjVRMTQuMjUgMTIuOSAxNi41IDEyLjlxMS4zNzUgMCAyLjUyNS0uNjEzIDEuMTUtLjYxMiAxLjg3NS0xLjYzNy4wNS4zMjUuMDc1LjY2MlEyMSAxMS42NSAyMSAxMnEwIDMuNzUtMi42MjUgNi4zNzVUMTIgMjFabTAtMnEyLjIgMCAzLjk1LTEuMjEyIDEuNzUtMS4yMTMgMi41NS0zLjE2My0uNS4xMjUtMSAuMi0uNS4wNzUtMSAuMDc1LTMuMDc1IDAtNS4yMzgtMi4xNjJROS4xIDEwLjU3NSA5LjEgNy41cTAtLjUuMDc1LTF0LjItMXEtMS45NS44LTMuMTYyIDIuNTVRNSA5LjggNSAxMnEwIDIuOSAyLjA1IDQuOTVROS4xIDE5IDEyIDE5Wm0tLjI1LTYuNzVaIi8+PC9zdmc+";
Editor.lightModeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0iTTEyIDE1cTEuMjUgMCAyLjEyNS0uODc1VDE1IDEycTAtMS4yNS0uODc1LTIuMTI1VDEyIDlxLTEuMjUgMC0yLjEyNS44NzVUOSAxMnEwIDEuMjUuODc1IDIuMTI1VDEyIDE1Wm0wIDJxLTIuMDc1IDAtMy41MzctMS40NjNRNyAxNC4wNzUgNyAxMnQxLjQ2My0zLjUzOFE5LjkyNSA3IDEyIDd0My41MzggMS40NjJRMTcgOS45MjUgMTcgMTJxMCAyLjA3NS0xLjQ2MiAzLjUzN1ExNC4wNzUgMTcgMTIgMTdaTTIgMTNxLS40MjUgMC0uNzEyLS4yODhRMSAxMi40MjUgMSAxMnQuMjg4LS43MTNRMS41NzUgMTEgMiAxMWgycS40MjUgMCAuNzEzLjI4N1E1IDExLjU3NSA1IDEydC0uMjg3LjcxMlE0LjQyNSAxMyA0IDEzWm0xOCAwcS0uNDI1IDAtLjcxMi0uMjg4UTE5IDEyLjQyNSAxOSAxMnQuMjg4LS43MTNRMTkuNTc1IDExIDIwIDExaDJxLjQyNSAwIC43MTIuMjg3LjI4OC4yODguMjg4LjcxM3QtLjI4OC43MTJRMjIuNDI1IDEzIDIyIDEzWm0tOC04cS0uNDI1IDAtLjcxMi0uMjg4UTExIDQuNDI1IDExIDRWMnEwLS40MjUuMjg4LS43MTNRMTEuNTc1IDEgMTIgMXQuNzEzLjI4N1ExMyAxLjU3NSAxMyAydjJxMCAuNDI1LS4yODcuNzEyUTEyLjQyNSA1IDEyIDVabTAgMThxLS40MjUgMC0uNzEyLS4yODhRMTEgMjIuNDI1IDExIDIydi0ycTAtLjQyNS4yODgtLjcxMlExMS41NzUgMTkgMTIgMTl0LjcxMy4yODhRMTMgMTkuNTc1IDEzIDIwdjJxMCAuNDI1LS4yODcuNzEyUTEyLjQyNSAyMyAxMiAyM1pNNS42NSA3LjA1IDQuNTc1IDZxLS4zLS4yNzUtLjI4OC0uNy4wMTMtLjQyNS4yODgtLjcyNS4zLS4zLjcyNS0uM3QuNy4zTDcuMDUgNS42NXEuMjc1LjMuMjc1LjcgMCAuNC0uMjc1LjctLjI3NS4zLS42ODcuMjg3LS40MTMtLjAxMi0uNzEzLS4yODdaTTE4IDE5LjQyNWwtMS4wNS0xLjA3NXEtLjI3NS0uMy0uMjc1LS43MTIgMC0uNDEzLjI3NS0uNjg4LjI3NS0uMy42ODgtLjI4Ny40MTIuMDEyLjcxMi4yODdMMTkuNDI1IDE4cS4zLjI3NS4yODguNy0uMDEzLjQyNS0uMjg4LjcyNS0uMy4zLS43MjUuM3QtLjctLjNaTTE2Ljk1IDcuMDVxLS4zLS4yNzUtLjI4Ny0uNjg4LjAxMi0uNDEyLjI4Ny0uNzEyTDE4IDQuNTc1cS4yNzUtLjMuNy0uMjg4LjQyNS4wMTMuNzI1LjI4OC4zLjMuMy43MjV0LS4zLjdMMTguMzUgNy4wNXEtLjMuMjc1LS43LjI3NS0uNCAwLS43LS4yNzVaTTQuNTc1IDE5LjQyNXEtLjMtLjMtLjMtLjcyNXQuMy0uN2wxLjA3NS0xLjA1cS4zLS4yNzUuNzEzLS4yNzUuNDEyIDAgLjY4Ny4yNzUuMy4yNzUuMjg4LjY4OC0uMDEzLjQxMi0uMjg4LjcxMkw2IDE5LjQyNXEtLjI3NS4zLS43LjI4Ny0uNDI1LS4wMTItLjcyNS0uMjg3Wk0xMiAxMloiLz48L3N2Zz4=";
Editor.spinImage="data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw==";
Editor.errorImage="data:image/gif;base64,R0lGODlhEAAQAPcAAADGAIQAAISEhP8AAP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEAAAAALAAAAAAQABAAAAhoAAEIFBigYMGBCAkGGMCQ4cGECxtKHBAAYUQCEzFSHLiQgMeGHjEGEAAg4oCQJz86LCkxpEqHAkwyRClxpEyXGmGaREmTIsmOL1GO/DkzI0yOE2sKIMlRJsWhCQHENDiUaVSpS5cmDAgAOw==";
Editor.smallPlusImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=";
Editor.hiResImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAA+CAMAAACLMWy1AAAAh1BMVEUAAABMTExERERBQUFBQUFFRUVAQEBCQkJAQEA6OjpDQ0NKSkpBQUFBQUFERERERERBQUFCQkJCQkJCQkJJSUlBQUFCQkJDQ0NDQ0NCQkJDQ0NBQUFBQUFCQkJBQUFCQkJCQkJDQ0NCQkJHR0dBQUFCQkJCQkJAQEBCQkJDQ0NAQEBERERCQkIk1hS2AAAAKnRSTlMAAjj96BL7PgQFRwfu3TYazKuVjRXl1V1DPCn1uLGjnWNVIgy9hU40eGqPkM38AAACG0lEQVRYw+2X63KbMBCFzwZblgGDceN74muatpLe//m6MHV3gHGFAv2RjM94MAbxzdnVsQbBDKwH8AH8MDAyafzjqYeyOG04XE7RS8nIRDXg6BlT+rA0nmtAPh+NQRDxIASIMG44rAMrGunBgHwy3uUldxggIStGKp2f+DQc2O4h4eQsX3O2IFB/oEbsjOKbStnjAEA+zJ0ylZTbgvoDn8xNyn6Dbj5Kd4GsNpABa6duQPfSdEj88TgMAhKuCWjAkgmFXPLnsD0pWd3OFGdrMugQII/eOMPEiGOzqPMIeWrcSoMCg71W1pXBPvCP+gS/OdXqQ3uW23+93XGWLl/OaBb805bNcBPoEIcVJsnHzcxpZH86u5KZ9gDby5dQCcnKqdbke4ItI4Tzd7IW9hZQt4EO6GG9b9sYuuK9Wwn8TIr2xKbF2+3Nhr+qxChJ/AI6pIfCu4z4Zowp4ZUNihz79vewzctnHDwTvQO/hCdFBzrUGDOPn2Y/F8YKT4oOATLvlhOznzmBSdFBJWtc58y7r+UVFOCQczy3wpN6pegDqHtsCPTGvH9JuTO0Dyg8icldYPk+RB6g8Aofj4m2EKBvtTmUPD9xDd1pPcSReV2U5iD/ik2yrngtvvqBfPzOvKiDTKTsCdoHZJ7pLLffgTwlJ5vJdtJV2/jiAYaLvLGhMAEDO5QcDg2M/jOw/8Zn+K3ZwJvHT7ZffgC/NvA3zcybTeIfE4EAAAAASUVORK5CYII=";
Editor.loResImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAA+CAMAAACLMWy1AAAAS1BMVEVAQEAAAAA1NTVBQUFDQ0NDQ0NFRUVERERBQUFBQUFBQUFAQEBBQUFBQUFCQkJCQkJCQkJBQUFCQkJDQ0NDQ0NCQkJCQkJCQkJGRkb5/XqTAAAAGXRSTlP+AAWODlASCsesX+Lc2LyWe3pwa1tCPjohjSJfoAAAAI1JREFUWMPt1MkKhTAMRuG0anvneXr/J71nUypKcdqI/N8yhLMKMZE1CahnClDQzMPB44ED3EgeCubgDWnWQMHpwTtKwTe+UHD4sJ94wbUEHHFGhILlYDeSnsQeabeCgsPBgB0MOZZ9oGA5GJFiJSfUULAfjLjARrhCwX7wh2YCDwVbwZkUBKqFFJRN+wOcwSgR2sREcgAAAABJRU5ErkJggg==";Editor.blankImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==";
Editor.facebookImage=IMAGE_PATH+"/facebook.png";Editor.tweetImage=IMAGE_PATH+"/tweet.png";Editor.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');Editor.configurationKey=".configuration";Editor.settingsKey=".drawio-config";Editor.defaultCustomLibraries=[];Editor.enableCustomLibraries=!0;Editor.enableCustomProperties=!0;Editor.defaultIncludeDiagram=!0;Editor.enableServiceWorker=
"0"!=urlParams.pwa&&"serviceWorker"in navigator&&("1"==urlParams.offline||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.draw\.io$/.test(window.location.hostname));Editor.enableWebFonts="1"!=urlParams["safe-style-src"];Editor.enableShadowOption=!mxClient.IS_SF;Editor.enableExportUrl=!0;Editor.enableRealtime=!0;Editor.compressXml=!0;Editor.oneDriveInlinePicker=null!=window.urlParams&&"0"==window.urlParams.inlinePicker?!1:!0;Editor.globalVars=null;Editor.config=null;Editor.configVersion=
null;Editor.defaultBorder=5;Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(q){q.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(q,F){return"1"==mxUtils.getValue(q.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(q,F){return"1"!=mxUtils.getValue(q.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(q,
F){return"1"==mxUtils.getValue(q.style,"comic","0")||"1"==mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(q,F){return"1"==mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?"1":"0")&&0<q.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(q,F){return"1"==mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?"1":"0")&&0<q.vertices.length}},{name:"hachureAngle",
dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(q,F){return"1"==mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?"1":"0")&&0<q.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(q,F){return"1"==mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",type:"float",defVal:0,min:0,max:1,isVisible:function(q,F){return"1"==mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?
"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(q,F){return"1"==mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStrokeFill",dispName:"Disable Multi Stroke Fill",type:"bool",defVal:!1,isVisible:function(q,F){return"1"==mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?"1":"0")&&0<q.vertices.length}},{name:"dashOffset",dispName:"Dash Offset",type:"int",defVal:-1,isVisible:function(q,F){return"1"==
mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?"1":"0")&&0<q.vertices.length}},{name:"dashGap",dispName:"Dash Gap",type:"int",defVal:-1,isVisible:function(q,F){return"1"==mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?"1":"0")&&0<q.vertices.length}},{name:"zigzagOffset",dispName:"ZigZag Offset",type:"int",defVal:-1,isVisible:function(q,F){return"1"==mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?"1":"0")&&0<q.vertices.length}},{name:"sketchStyle",dispName:"Sketch Style",type:"enum",
defVal:"rough",enumList:[{val:"rough",dispName:"Rough"},{val:"comic",dispName:"Comic"}],isVisible:function(q,F){return"1"==mxUtils.getValue(q.style,"sketch","1"==urlParams.rough?"1":"0")}}];Editor.commonEdgeProperties=[{type:"separator"},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"sourcePortConstraint",dispName:"Source Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},
{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"targetPortConstraint",dispName:"Target Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"jettySize",dispName:"Jetty Size",type:"int",min:0,defVal:"auto",allowAuto:!0,isVisible:function(q){return"orthogonalEdgeStyle"==mxUtils.getValue(q.style,mxConstants.STYLE_EDGE,null)}},{name:"fillOpacity",
dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"startFill",dispName:"Start Fill",type:"bool",defVal:!0},{name:"endFill",dispName:"End Fill",type:"bool",defVal:!0},{name:"perimeterSpacing",dispName:"Terminal Spacing",type:"float",defVal:0},{name:"anchorPointDirection",dispName:"Anchor Direction",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"fixDash",
dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"metaEdit",dispName:"Edit Dialog",type:"bool",defVal:!1},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"bendable",dispName:"Bendable",type:"bool",defVal:!0},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"noJump",
dispName:"No Jumps",type:"bool",defVal:!1},{name:"flowAnimation",dispName:"Flow Animation",type:"bool",defVal:!1},{name:"ignoreEdge",dispName:"Ignore Edge",type:"bool",defVal:!1},{name:"orthogonalLoop",dispName:"Loop Routing",type:"bool",defVal:!1},{name:"orthogonal",dispName:"Orthogonal",type:"bool",defVal:!1}].concat(Editor.commonProperties);Editor.commonVertexProperties=[{name:"colspan",dispName:"Colspan",type:"int",min:1,defVal:1,isVisible:function(q,F){F=F.editorUi.editor.graph;return 1==q.vertices.length&&
0==q.edges.length&&F.isTableCell(q.vertices[0])}},{name:"rowspan",dispName:"Rowspan",type:"int",min:1,defVal:1,isVisible:function(q,F){F=F.editorUi.editor.graph;return 1==q.vertices.length&&0==q.edges.length&&F.isTableCell(q.vertices[0])}},{type:"separator"},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",getDefaultValue:function(q,F){q=F.editorUi.editor.graph.getCellStyle(1==q.vertices.length&&0==q.edges.length?q.vertices[0]:null);return"1"==mxUtils.getValue(q,"resizeLastRow","0")},
isVisible:function(q,F){F=F.editorUi.editor.graph;return 1==q.vertices.length&&0==q.edges.length&&F.isTable(q.vertices[0])}},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",getDefaultValue:function(q,F){q=F.editorUi.editor.graph.getCellStyle(1==q.vertices.length&&0==q.edges.length?q.vertices[0]:null);return"1"==mxUtils.getValue(q,"resizeLast","0")},isVisible:function(q,F){F=F.editorUi.editor.graph;return 1==q.vertices.length&&0==q.edges.length&&F.isTable(q.vertices[0])}},{name:"fillOpacity",
dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"overflow",dispName:"Text Overflow",defVal:"visible",type:"enum",enumList:[{val:"visible",dispName:"Visible"},{val:"hidden",dispName:"Hidden"},{val:"block",dispName:"Block"},{val:"fill",dispName:"Fill"},{val:"width",dispName:"Width"}]},{name:"noLabel",dispName:"Hide Label",type:"bool",defVal:!1},{name:"labelPadding",dispName:"Label Padding",type:"float",
defVal:0},{name:"direction",dispName:"Direction",type:"enum",defVal:"east",enumList:[{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraint",dispName:"Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",
defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(q,F){return F.editorUi.editor.graph.isCellConnectable(0<q.vertices.length&&0==q.edges.length?q.vertices[0]:null)},isVisible:function(q,F){return 0<q.vertices.length&&0==q.edges.length}},{name:"allowArrows",dispName:"Allow Arrows",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"perimeter",dispName:"Perimeter",defVal:"none",type:"enum",enumList:[{val:"none",dispName:"None"},
{val:"rectanglePerimeter",dispName:"Rectangle"},{val:"ellipsePerimeter",dispName:"Ellipse"},{val:"rhombusPerimeter",dispName:"Rhombus"},{val:"trianglePerimeter",dispName:"Triangle"},{val:"hexagonPerimeter2",dispName:"Hexagon"},{val:"lifelinePerimeter",dispName:"Lifeline"},{val:"orthogonalPerimeter",dispName:"Orthogonal"},{val:"backbonePerimeter",dispName:"Backbone"},{val:"calloutPerimeter",dispName:"Callout"},{val:"parallelogramPerimeter",dispName:"Parallelogram"},{val:"trapezoidPerimeter",dispName:"Trapezoid"},
{val:"stepPerimeter",dispName:"Step"},{val:"centerPerimeter",dispName:"Center"}]},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"container",dispName:"Container",type:"bool",defVal:!1,isVisible:function(q,F){return 1==q.vertices.length&&0==q.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(q,F){q=1==q.vertices.length&&0==q.edges.length?q.vertices[0]:null;F=F.editorUi.editor.graph;return null!=q&&(F.isSwimlane(q)||0<F.model.getChildCount(q))},
isVisible:function(q,F){return 1==q.vertices.length&&0==q.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(q,F){var S=1==q.vertices.length&&0==q.edges.length?q.vertices[0]:null;F=F.editorUi.editor.graph;return null!=S&&(F.isContainer(S)&&"0"!=q.style.collapsible||!F.isContainer(S)&&"1"==q.style.collapsible)},isVisible:function(q,F){return 1==q.vertices.length&&0==q.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,
isVisible:function(q,F){return 1==q.vertices.length&&0==q.edges.length&&!F.editorUi.editor.graph.isSwimlane(q.vertices[0])&&null==mxUtils.getValue(q.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1,isVisible:function(q,F){F=F.editorUi.editor.graph.model;return 0<q.vertices.length?F.isVertex(F.getParent(q.vertices[0])):!1}},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"metaEdit",dispName:"Edit Dialog",
type:"bool",defVal:!1},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"movableLabel",dispName:"Movable Label",type:"bool",defVal:!1,isVisible:function(q,F){q=0<q.vertices.length?F.editorUi.editor.graph.getCellGeometry(q.vertices[0]):null;return null!=q&&!q.relative}},{name:"autosize",dispName:"Autosize",type:"bool",defVal:!1},{name:"fixedWidth",dispName:"Fixed Width",type:"bool",defVal:!1},{name:"resizable",
dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",dispName:"Tree Moving",type:"bool",defVal:!1},{name:"pointerEvents",
dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(q,F){var S=mxUtils.getValue(q.style,mxConstants.STYLE_FILLCOLOR,null);return F.editorUi.editor.graph.isSwimlane(q.vertices[0])||null==S||S==mxConstants.NONE||0==mxUtils.getValue(q.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(q.style,mxConstants.STYLE_OPACITY,100)||null!=q.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",type:"bool",defVal:!1,isVisible:function(q,F){return 0<q.vertices.length&&
F.editorUi.editor.graph.isContainer(q.vertices[0])}}].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n#          "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart or a JSON string as used in\n## Layout, Apply. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,me@example.com,#dae8fc,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,me@example.com,#d5e8d4,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';
Editor.createRoughCanvas=function(q){var F=rough.canvas({getContext:function(){return q}});F.draw=function(S){var ba=S.sets||[];S=S.options||this.getDefaultOptions();for(var U=0;U<ba.length;U++){var ca=ba[U];switch(ca.type){case "path":null!=S.stroke&&this._drawToContext(q,ca,S);break;case "fillPath":this._drawToContext(q,ca,S);break;case "fillSketch":this.fillSketch(q,ca,S)}}};F.fillSketch=function(S,ba,U){var ca=q.state.strokeColor,ea=q.state.strokeWidth,na=q.state.strokeAlpha,ra=q.state.dashed,
ya=U.fillWeight;0>ya&&(ya=U.strokeWidth/2);q.setStrokeAlpha(q.state.fillAlpha);q.setStrokeColor(U.fill||"");q.setStrokeWidth(ya);q.setDashed(!1);this._drawToContext(S,ba,U);q.setDashed(ra);q.setStrokeWidth(ea);q.setStrokeColor(ca);q.setStrokeAlpha(na)};F._drawToContext=function(S,ba,U){S.begin();for(var ca=0;ca<ba.ops.length;ca++){var ea=ba.ops[ca],na=ea.data;switch(ea.op){case "move":S.moveTo(na[0],na[1]);break;case "bcurveTo":S.curveTo(na[0],na[1],na[2],na[3],na[4],na[5]);break;case "lineTo":S.lineTo(na[0],
na[1])}}S.end();"fillPath"===ba.type&&U.filled?S.fill():S.stroke()};return F};(function(){function q(ca,ea,na){this.canvas=ca;this.rc=ea;this.shape=na;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,q.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,q.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,q.prototype.rect);this.originalRoundrect=
this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,q.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,q.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,q.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,q.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,q.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;
this.canvas.curveTo=mxUtils.bind(this,q.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,q.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,q.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,q.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,q.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=
mxUtils.bind(this,q.prototype.fillAndStroke);this.path=[];this.passThrough=!1}q.prototype.moveOp="M";q.prototype.lineOp="L";q.prototype.quadOp="Q";q.prototype.curveOp="C";q.prototype.closeOp="Z";q.prototype.getStyle=function(ca,ea){var na=1;if(null!=this.shape.state){var ra=this.shape.state.cell.id;if(null!=ra)for(var ya=0;ya<ra.length;ya++)na=(na<<5)-na+ra.charCodeAt(ya)<<0}na={strokeWidth:this.canvas.state.strokeWidth,seed:na,preserveVertices:!0};ra=this.rc.getDefaultOptions();na.stroke=ca?this.canvas.state.strokeColor===
mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;ca=null;(na.filled=ea)?(na.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,ca=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):na.fill="";na.bowing=mxUtils.getValue(this.shape.style,"bowing",ra.bowing);na.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ra.hachureAngle);na.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",
ra.curveFitting);na.roughness=mxUtils.getValue(this.shape.style,"jiggle",ra.roughness);na.simplification=mxUtils.getValue(this.shape.style,"simplification",ra.simplification);na.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ra.disableMultiStroke);na.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ra.disableMultiStrokeFill);ea=mxUtils.getValue(this.shape.style,"hachureGap",-1);na.hachureGap="auto"==ea?-1:ea;na.dashGap=mxUtils.getValue(this.shape.style,
"dashGap",ea);na.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",ea);na.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",ea);ea=mxUtils.getValue(this.shape.style,"fillWeight",-1);na.fillWeight="auto"==ea?-1:ea;ea=mxUtils.getValue(this.shape.style,"fillStyle","auto");"auto"==ea&&(ea=mxUtils.hex2rgb(null!=this.shape.state?this.shape.state.view.graph.shapeBackgroundColor:Editor.isDarkMode()?Editor.darkColor:"#ffffff"),ea=null!=na.fill&&(null!=ca||null!=ea&&na.fill==ea)?"solid":
ra.fillStyle);na.fillStyle=ea;return na};q.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};q.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};q.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var ca=2;ca<arguments.length;ca+=2)this.lastX=arguments[ca-1],this.lastY=arguments[ca],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};
q.prototype.lineTo=function(ca,ea){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,ca,ea),this.lastX=ca,this.lastY=ea)};q.prototype.moveTo=function(ca,ea){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,ca,ea),this.lastX=ca,this.lastY=ea,this.firstX=ca,this.firstY=ea)};q.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};q.prototype.quadTo=function(ca,
ea,na,ra){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,ca,ea,na,ra),this.lastX=na,this.lastY=ra)};q.prototype.curveTo=function(ca,ea,na,ra,ya,va){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,ca,ea,na,ra,ya,va),this.lastX=ya,this.lastY=va)};q.prototype.arcTo=function(ca,ea,na,ra,ya,va,Da){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var pa=mxUtils.arcToCurves(this.lastX,this.lastY,
ca,ea,na,ra,ya,va,Da);if(null!=pa)for(var Aa=0;Aa<pa.length;Aa+=6)this.curveTo(pa[Aa],pa[Aa+1],pa[Aa+2],pa[Aa+3],pa[Aa+4],pa[Aa+5]);this.lastX=va;this.lastY=Da}};q.prototype.rect=function(ca,ea,na,ra){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(ca,ea,na,ra,this.getStyle(!0,!0)))};q.prototype.ellipse=function(ca,ea,na,ra){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(ca+
na/2,ea+ra/2,na,ra,this.getStyle(!0,!0)))};q.prototype.roundrect=function(ca,ea,na,ra,ya,va){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(ca+ya,ea),this.lineTo(ca+na-ya,ea),this.quadTo(ca+na,ea,ca+na,ea+va),this.lineTo(ca+na,ea+ra-va),this.quadTo(ca+na,ea+ra,ca+na-ya,ea+ra),this.lineTo(ca+ya,ea+ra),this.quadTo(ca,ea+ra,ca,ea+ra-va),this.lineTo(ca,ea+va),this.quadTo(ca,ea,ca+ya,ea))};q.prototype.drawPath=function(ca){if(0<this.path.length){this.passThrough=
!0;try{this.rc.path(this.path.join(" "),ca)}catch(na){}this.passThrough=!1}else if(null!=this.nextShape){for(var ea in ca)this.nextShape.options[ea]=ca[ea];ca.stroke!=mxConstants.NONE&&null!=ca.stroke||delete this.nextShape.options.stroke;ca.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};q.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};q.prototype.fill=
function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};q.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};q.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=
this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(ca){return new q(ca,Editor.createRoughCanvas(ca),this)};var F=mxShape.prototype.createHandJiggle;
mxShape.prototype.createHandJiggle=function(ca){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?F.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(ca):this.createRoughCanvas(ca)};var S=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(ca,ea,na,ra,ya){null!=ca.handJiggle&&ca.handJiggle.passThrough||S.apply(this,arguments)};var ba=mxShape.prototype.paint;mxShape.prototype.paint=
function(ca){var ea=ca.addTolerance,na=!0;null!=this.style&&(na="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=ca.handJiggle&&ca.handJiggle.constructor==q&&!this.outline){ca.save();var ra=this.fill,ya=this.stroke;this.stroke=this.fill=null;var va=this.configurePointerEvents,Da=ca.setStrokeColor;ca.setStrokeColor=function(){};var pa=ca.setFillColor;ca.setFillColor=function(){};na||null==ra||(this.configurePointerEvents=function(){});ca.handJiggle.passThrough=!0;ba.apply(this,
arguments);ca.handJiggle.passThrough=!1;ca.setFillColor=pa;ca.setStrokeColor=Da;this.configurePointerEvents=va;this.stroke=ya;this.fill=ra;ca.restore();na&&null!=ra&&(ca.addTolerance=function(){})}ba.apply(this,arguments);ca.addTolerance=ea};var U=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(ca,ea,na,ra,ya,va){null!=ca.handJiggle&&ca.handJiggle.constructor==q?(ca.handJiggle.passThrough=!0,U.apply(this,arguments),ca.handJiggle.passThrough=!1):U.apply(this,arguments)}})();
Editor.fastCompress=function(q){return null==q||0==q.length||"undefined"===typeof pako?q:Graph.arrayBufferToString(pako.deflateRaw(q))};Editor.fastDecompress=function(q){return null==q||0==q.length||"undefined"===typeof pako?q:pako.inflateRaw(Graph.stringToArrayBuffer(atob(q)),{to:"string"})};Editor.extractGraphModel=function(q,F,S){if(null!=q&&"undefined"!==typeof pako){var ba=q.ownerDocument.getElementsByTagName("div"),U=[];if(null!=ba&&0<ba.length)for(var ca=0;ca<ba.length;ca++)if("mxgraph"==ba[ca].getAttribute("class")){U.push(ba[ca]);
break}0<U.length&&(ba=U[0].getAttribute("data-mxgraph"),null!=ba?(U=JSON.parse(ba),null!=U&&null!=U.xml&&(q=mxUtils.parseXml(U.xml),q=q.documentElement)):(U=U[0].getElementsByTagName("div"),0<U.length&&(ba=mxUtils.getTextContent(U[0]),ba=Graph.decompress(ba,null,S),0<ba.length&&(q=mxUtils.parseXml(ba),q=q.documentElement))))}if(null!=q&&"svg"==q.nodeName)if(ba=q.getAttribute("content"),null!=ba&&"<"!=ba.charAt(0)&&"%"!=ba.charAt(0)&&(ba=unescape(window.atob?atob(ba):Base64.decode(cont,ba))),null!=
ba&&"%"==ba.charAt(0)&&(ba=decodeURIComponent(ba)),null!=ba&&0<ba.length)q=mxUtils.parseXml(ba).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==q||F||(U=null,"diagram"==q.nodeName?U=q:"mxfile"==q.nodeName&&(ba=q.getElementsByTagName("diagram"),0<ba.length&&(U=ba[Math.max(0,Math.min(ba.length-1,urlParams.page||0))])),null!=U&&(q=Editor.parseDiagramNode(U,S)));null==q||"mxGraphModel"==q.nodeName||F&&"mxfile"==q.nodeName||(q=null);return q};Editor.parseDiagramNode=function(q,
F){var S=mxUtils.trim(mxUtils.getTextContent(q)),ba=null;0<S.length?(q=Graph.decompress(S,null,F),null!=q&&0<q.length&&(ba=mxUtils.parseXml(q).documentElement)):(q=mxUtils.getChildNodes(q),0<q.length&&(ba=mxUtils.createXmlDocument(),ba.appendChild(ba.importNode(q[0],!0)),ba=ba.documentElement));return ba};Editor.getDiagramNodeXml=function(q){var F=mxUtils.getTextContent(q),S=null;0<F.length?S=Graph.decompress(F):null!=q.firstChild&&(S=mxUtils.getXml(q.firstChild));return S};Editor.extractGraphModelFromPdf=
function(q){q=q.substring(q.indexOf(",")+1);q=window.atob&&!mxClient.IS_SF?atob(q):Base64.decode(q,!0);if("%PDF-1.7"==q.substring(0,8)){var F=q.indexOf("EmbeddedFile");if(-1<F){var S=q.indexOf("stream",F)+9;if(0<q.substring(F,S).indexOf("application#2Fvnd.jgraph.mxfile"))return F=q.indexOf("endstream",S-1),pako.inflateRaw(Graph.stringToArrayBuffer(q.substring(S,F)),{to:"string"})}return null}S=null;F="";for(var ba=0,U=0,ca=[],ea=null;U<q.length;){var na=q.charCodeAt(U);U+=1;10!=na&&(F+=String.fromCharCode(na));
na=="/Subject (%3Cmxfile".charCodeAt(ba)?ba++:ba=0;if(19==ba){var ra=q.indexOf("%3C%2Fmxfile%3E)",U)+15;U-=9;if(ra>U){S=q.substring(U,ra);break}}10==na&&("endobj"==F?ea=null:"obj"==F.substring(F.length-3,F.length)||"xref"==F||"trailer"==F?(ea=[],ca[F.split(" ")[0]]=ea):null!=ea&&ea.push(F),F="")}null==S&&(S=Editor.extractGraphModelFromXref(ca));null!=S&&(S=decodeURIComponent(S.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return S};Editor.extractGraphModelFromXref=function(q){var F=q.trailer,S=null;
null!=F&&(F=/.* \/Info (\d+) (\d+) R/g.exec(F.join("\n")),null!=F&&0<F.length&&(F=q[F[1]],null!=F&&(F=/.* \/Subject (\d+) (\d+) R/g.exec(F.join("\n")),null!=F&&0<F.length&&(q=q[F[1]],null!=q&&(q=q.join("\n"),S=q.substring(1,q.length-1))))));return S};Editor.extractParserError=function(q,F){var S=null;q=null!=q?q.getElementsByTagName("parsererror"):null;null!=q&&0<q.length&&(S=F||mxResources.get("invalidChars"),F=q[0].getElementsByTagName("div"),0<F.length&&(S=mxUtils.getTextContent(F[0])));return null!=
S?mxUtils.trim(S):S};Editor.addRetryToError=function(q,F){null!=q&&(q=null!=q.error?q.error:q,null==q.retry&&(q.retry=F))};Editor.configure=function(q){if(null!=q){Editor.config=q;Editor.configVersion=q.version;Menus.prototype.defaultFonts=q.defaultFonts||Menus.prototype.defaultFonts;ColorDialog.prototype.presetColors=q.presetColors||ColorDialog.prototype.presetColors;ColorDialog.prototype.defaultColors=q.defaultColors||ColorDialog.prototype.defaultColors;ColorDialog.prototype.colorNames=q.colorNames||
ColorDialog.prototype.colorNames;StyleFormatPanel.prototype.defaultColorSchemes=q.defaultColorSchemes||StyleFormatPanel.prototype.defaultColorSchemes;Graph.prototype.defaultEdgeLength=q.defaultEdgeLength||Graph.prototype.defaultEdgeLength;DrawioFile.prototype.autosaveDelay=q.autosaveDelay||DrawioFile.prototype.autosaveDelay;q.debug&&(urlParams.test="1");null!=q.templateFile&&(EditorUi.templateFile=q.templateFile);null!=q.styles&&(Array.isArray(q.styles)?Editor.styles=q.styles:EditorUi.debug("Configuration Error: Array expected for styles"));
null!=q.globalVars&&(Editor.globalVars=q.globalVars);null!=q.compressXml&&(Editor.compressXml=q.compressXml);null!=q.includeDiagram&&(Editor.defaultIncludeDiagram=q.includeDiagram);null!=q.simpleLabels&&(Editor.simpleLabels=q.simpleLabels);null!=q.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=q.oneDriveInlinePicker);null!=q.darkColor&&(Editor.darkColor=q.darkColor);null!=q.lightColor&&(Editor.lightColor=q.lightColor);null!=q.settingsName&&(Editor.configurationKey="."+q.settingsName+"-configuration",
Editor.settingsKey="."+q.settingsName+"-config",mxSettings.key=Editor.settingsKey);q.customFonts&&(Menus.prototype.defaultFonts=q.customFonts.concat(Menus.prototype.defaultFonts));q.customPresetColors&&(ColorDialog.prototype.presetColors=q.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=q.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=q.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=q.css){var F=document.createElement("style");
F.setAttribute("type","text/css");F.appendChild(document.createTextNode(q.css));var S=document.getElementsByTagName("script")[0];S.parentNode.insertBefore(F,S)}null!=q.libraries&&(Sidebar.prototype.customEntries=q.libraries);null!=q.enabledLibraries&&(Array.isArray(q.enabledLibraries)?Sidebar.prototype.enabledLibraries=q.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=q.defaultLibraries&&(Sidebar.prototype.defaultEntries=q.defaultLibraries);null!=
q.defaultCustomLibraries&&(Editor.defaultCustomLibraries=q.defaultCustomLibraries);null!=q.enableCustomLibraries&&(Editor.enableCustomLibraries=q.enableCustomLibraries);null!=q.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=q.defaultVertexStyle);null!=q.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=q.defaultEdgeStyle);null!=q.defaultPageVisible&&(Graph.prototype.defaultPageVisible=q.defaultPageVisible);null!=q.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=q.defaultGridEnabled);
null!=q.zoomWheel&&(Graph.zoomWheel=q.zoomWheel);null!=q.zoomFactor&&(F=parseFloat(q.zoomFactor),!isNaN(F)&&1<F?Graph.prototype.zoomFactor=F:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=q.gridSteps&&(F=parseInt(q.gridSteps),!isNaN(F)&&0<F?mxGraphView.prototype.gridSteps=F:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=q.pageFormat&&(F=parseInt(q.pageFormat.width),S=parseInt(q.pageFormat.height),!isNaN(F)&&0<F&&!isNaN(S)&&0<S?(mxGraph.prototype.defaultPageFormat=
new mxRectangle(0,0,F,S),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));q.thumbWidth&&(Sidebar.prototype.thumbWidth=q.thumbWidth);q.thumbHeight&&(Sidebar.prototype.thumbHeight=q.thumbHeight);q.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=q.emptyLibraryXml);q.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=q.emptyDiagramXml);q.sidebarWidth&&(EditorUi.prototype.hsplitPosition=q.sidebarWidth);
q.sidebarTitles&&(Sidebar.prototype.sidebarTitles=q.sidebarTitles);q.sidebarTitleSize&&(F=parseInt(q.sidebarTitleSize),!isNaN(F)&&0<F?Sidebar.prototype.sidebarTitleSize=F:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));q.fontCss&&("string"===typeof q.fontCss?Editor.configureFontCss(q.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));null!=q.autosaveDelay&&(F=parseInt(q.autosaveDelay),!isNaN(F)&&0<F?DrawioFile.prototype.autosaveDelay=F:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));
null!=q.maxImageBytes&&(EditorUi.prototype.maxImageBytes=q.maxImageBytes);null!=q.maxImageSize&&(EditorUi.prototype.maxImageSize=q.maxImageSize);null!=q.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=q.shareCursorPosition);null!=q.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=q.showRemoteCursors)}};Editor.configureFontCss=function(q){if(null!=q){Editor.prototype.fontCss=q;var F=document.getElementsByTagName("script")[0];if(null!=F&&null!=F.parentNode){var S=document.createElement("style");
S.setAttribute("type","text/css");S.appendChild(document.createTextNode(q));F.parentNode.insertBefore(S,F);q=q.split("url(");for(S=1;S<q.length;S++){var ba=q[S].indexOf(")");ba=Editor.trimCssUrl(q[S].substring(0,ba));var U=document.createElement("link");U.setAttribute("rel","preload");U.setAttribute("href",ba);U.setAttribute("as","font");U.setAttribute("crossorigin","");F.parentNode.insertBefore(U,F)}}}};Editor.trimCssUrl=function(q){return q.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$",
"g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(q){q=null!=q?q:Editor.GUID_LENGTH;for(var F=[],S=0;S<q;S++)F.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return F.join("")};Editor.prototype.timeout=25E3;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=
!mxClient.IS_IE;var b=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(q){q=null!=q&&"mxlibrary"!=q.nodeName?this.extractGraphModel(q):null;if(null!=q){var F=Editor.extractParserError(q,mxResources.get("invalidOrMissingFile"));if(F)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[q],"cause",[F]),Error(mxResources.get("notADiagramFile")+" ("+F+")");if("mxGraphModel"==q.nodeName){F=q.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=F&&""!=
F)F!=this.graph.currentStyle&&(S=null!=this.graph.themes?this.graph.themes[F]:mxUtils.load(STYLE_PATH+"/"+F+".xml").getDocumentElement(),null!=S&&(ba=new mxCodec(S.ownerDocument),ba.decode(S,this.graph.getStylesheet())));else{var S=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=S){var ba=new mxCodec(S.ownerDocument);ba.decode(S,this.graph.getStylesheet())}}this.graph.currentStyle=F;this.graph.mathEnabled="1"==urlParams.math||
"1"==q.getAttribute("math");F=q.getAttribute("backgroundImage");null!=F?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(F)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==q.getAttribute("shadow"),!1);if(F=q.getAttribute("extFonts"))try{for(F=F.split("|").map(function(U){U=U.split("^");return{name:U[0],url:U[1]}}),S=0;S<F.length;S++)this.graph.addExtFont(F[S].name,
F[S].url)}catch(U){console.log("ExtFonts format error: "+U.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var d=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(q,F){q=null!=q?q:!0;var S=d.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&S.setAttribute("style",
this.graph.currentStyle);var ba=this.graph.getBackgroundImageObject(this.graph.backgroundImage,F);null!=ba&&S.setAttribute("backgroundImage",JSON.stringify(ba));S.setAttribute("math",this.graph.mathEnabled?"1":"0");S.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(ba=this.graph.extFonts.map(function(U){return U.name+"^"+U.url}),S.setAttribute("extFonts",ba.join("|")));return S};Editor.prototype.isDataSvg=function(q){try{var F=mxUtils.parseXml(q).documentElement.getAttribute("content");
if(null!=F&&(null!=F&&"<"!=F.charAt(0)&&"%"!=F.charAt(0)&&(F=unescape(window.atob?atob(F):Base64.decode(cont,F))),null!=F&&"%"==F.charAt(0)&&(F=decodeURIComponent(F)),null!=F&&0<F.length)){var S=mxUtils.parseXml(F).documentElement;return"mxfile"==S.nodeName||"mxGraphModel"==S.nodeName}}catch(ba){}return!1};Editor.prototype.extractGraphModel=function(q,F,S){return Editor.extractGraphModel.apply(this,arguments)};var g=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled=
"1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();g.apply(this,arguments)};var l=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){l.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=
function(q,F){if("undefined"===typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){q=null!=q?q:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];Editor.doMathJaxRender=function(U){try{MathJax.typesetClear([U]),MathJax.typeset([U]),Editor.onMathJaxDone()}catch(ca){MathJax.typesetClear([U]),null!=ca.retry?ca.retry.then(function(){MathJax.typesetPromise([U]).then(Editor.onMathJaxDone)}):null!=window.console&&console.log("Error in MathJax: "+ca.toString())}};window.MathJax=null!=F?F:{options:{skipHtmlTags:{"[+]":["text"]}},
loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"]},startup:{pageReady:function(){for(var U=0;U<Editor.mathJaxQueue.length;U++)Editor.doMathJaxRender(Editor.mathJaxQueue[U])}}};Editor.MathJaxRender=function(U){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(U):Editor.mathJaxQueue.push(U)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};Editor.onMathJaxDone=function(){};var S=Editor.prototype.init;
Editor.prototype.init=function(){S.apply(this,arguments);var U=mxUtils.bind(this,function(ca,ea){null!=this.graph.container&&this.graph.mathEnabled&&!this.graph.blockMathRender&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,U);this.graph.addListener(mxEvent.REFRESH,U)};F=document.getElementsByTagName("script");if(null!=F&&0<F.length){var ba=document.createElement("script");ba.setAttribute("type","text/javascript");ba.setAttribute("src",q);F[0].parentNode.appendChild(ba)}}};
Editor.prototype.csvToArray=function(q){if(0<q.length){var F="",S=[""],ba=0,U=!0,ca;q=$jscomp.makeIterator(q);for(ca=q.next();!ca.done;ca=q.next())ca=ca.value,'"'===ca?(U&&ca===F&&(S[ba]+=ca),U=!U):","===ca&&U?ca=S[++ba]="":S[ba]+=ca,F=ca;return S}return[]};Editor.prototype.getProxiedUrl=function(q){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(q)){var F=/(\.v(dx|sdx?))($|\?)/i.test(q)||/(\.vs(x|sx?))($|\?)/i.test(q);
F=/\.png$/i.test(q)||/\.pdf$/i.test(q)||F;var S="t="+(new Date).getTime();q=PROXY_URL+"?url="+encodeURIComponent(q)+"&"+S+(F?"&base64=1":"")}return q};Editor.prototype.isCorsEnabledForUrl=function(q){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||q.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(q)||"https://raw.githubusercontent.com/"===
q.substring(0,34)||"https://fonts.googleapis.com/"===q.substring(0,29)||"https://fonts.gstatic.com/"===q.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var q=new mxUrlConverter;q.updateBaseUrl();var F=q.convert,S=this;q.convert=function(ba){if(null!=ba){var U="http://"==ba.substring(0,7)||"https://"==ba.substring(0,8);U&&!navigator.onLine?ba=Editor.svgBrokenImage.src:!U||ba.substring(0,q.baseUrl.length)==q.baseUrl||S.crossOriginImages&&S.isCorsEnabledForUrl(ba)?"chrome-extension://"==
ba.substring(0,19)||mxClient.IS_CHROMEAPP||(ba=F.apply(this,arguments)):ba=PROXY_URL+"?url="+encodeURIComponent(ba)}return ba};return q};Editor.createSvgDataUri=function(q){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(q)))};Editor.prototype.convertImageToDataUri=function(q,F){try{var S=!0,ba=window.setTimeout(mxUtils.bind(this,function(){S=!1;F(Editor.svgBrokenImage.src)}),this.timeout);if(/(\.svg)$/i.test(q))mxUtils.get(q,mxUtils.bind(this,function(ca){window.clearTimeout(ba);
S&&F(Editor.createSvgDataUri(ca.getText()))}),function(){window.clearTimeout(ba);S&&F(Editor.svgBrokenImage.src)});else{var U=new Image;this.crossOriginImages&&(U.crossOrigin="anonymous");U.onload=function(){window.clearTimeout(ba);if(S)try{var ca=document.createElement("canvas"),ea=ca.getContext("2d");ca.height=U.height;ca.width=U.width;ea.drawImage(U,0,0);F(ca.toDataURL())}catch(na){F(Editor.svgBrokenImage.src)}};U.onerror=function(){window.clearTimeout(ba);S&&F(Editor.svgBrokenImage.src)};U.src=
q}}catch(ca){F(Editor.svgBrokenImage.src)}};Editor.prototype.convertImages=function(q,F,S,ba){null==ba&&(ba=this.createImageUrlConverter());var U=0,ca=S||{};S=mxUtils.bind(this,function(ea,na){ea=q.getElementsByTagName(ea);for(var ra=0;ra<ea.length;ra++)mxUtils.bind(this,function(ya){try{if(null!=ya){var va=ba.convert(ya.getAttribute(na));if(null!=va&&"data:"!=va.substring(0,5)){var Da=ca[va];null==Da?(U++,this.convertImageToDataUri(va,function(pa){null!=pa&&(ca[va]=pa,ya.setAttribute(na,pa));U--;
0==U&&F(q)})):ya.setAttribute(na,Da)}else null!=va&&ya.setAttribute(na,va)}}catch(pa){}})(ea[ra])});S("image","xlink:href");S("img","src");0==U&&F(q)};Editor.base64Encode=function(q){for(var F="",S=0,ba=q.length,U,ca,ea;S<ba;){U=q.charCodeAt(S++)&255;if(S==ba){F+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U>>2);F+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((U&3)<<4);F+="==";break}ca=q.charCodeAt(S++);if(S==ba){F+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U>>
2);F+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((U&3)<<4|(ca&240)>>4);F+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((ca&15)<<2);F+="=";break}ea=q.charCodeAt(S++);F+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U>>2);F+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((U&3)<<4|(ca&240)>>4);F+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((ca&15)<<2|(ea&192)>>
6);F+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(ea&63)}return F};Editor.prototype.loadUrl=function(q,F,S,ba,U,ca,ea,na){try{var ra=!ea&&(ba||/(\.png)($|\?)/i.test(q)||/(\.jpe?g)($|\?)/i.test(q)||/(\.gif)($|\?)/i.test(q)||/(\.pdf)($|\?)/i.test(q));U=null!=U?U:!0;var ya=mxUtils.bind(this,function(){mxUtils.get(q,mxUtils.bind(this,function(va){if(200<=va.getStatus()&&299>=va.getStatus()){if(null!=F){var Da=va.getText();if(ra){if((9==document.documentMode||10==document.documentMode)&&
"undefined"!==typeof window.mxUtilsBinaryToArray){va=mxUtilsBinaryToArray(va.request.responseBody).toArray();Da=Array(va.length);for(var pa=0;pa<va.length;pa++)Da[pa]=String.fromCharCode(va[pa]);Da=Da.join("")}ca=null!=ca?ca:"data:image/png;base64,";Da=ca+Editor.base64Encode(Da)}F(Da)}}else null!=S&&(0==va.getStatus()?S({message:mxResources.get("accessDenied")},va):404==va.getStatus()?S({code:va.getStatus()},va):S({message:mxResources.get("error")+" "+va.getStatus()},va))}),function(va){null!=S&&
S({message:mxResources.get("error")+" "+va.getStatus()})},ra,this.timeout,function(){U&&null!=S&&S({code:App.ERROR_TIMEOUT,retry:ya})},na)});ya()}catch(va){null!=S&&S(va)}};Editor.prototype.absoluteCssFonts=function(q){var F=null;if(null!=q){var S=q.split("url(");if(0<S.length){F=[S[0]];q=window.location.pathname;var ba=null!=q?q.lastIndexOf("/"):-1;0<=ba&&(q=q.substring(0,ba+1));ba=document.getElementsByTagName("base");var U=null;null!=ba&&0<ba.length&&(U=ba[0].getAttribute("href"));for(var ca=1;ca<
S.length;ca++)if(ba=S[ca].indexOf(")"),0<ba){var ea=Editor.trimCssUrl(S[ca].substring(0,ba));this.graph.isRelativeUrl(ea)&&(ea=null!=U?U+ea:window.location.protocol+"//"+window.location.hostname+("/"==ea.charAt(0)?"":q)+ea);F.push('url("'+ea+'"'+S[ca].substring(ba))}else F.push(S[ca])}else F=[q]}return null!=F?F.join(""):null};Editor.prototype.mapFontUrl=function(q,F,S){/^https?:\/\//.test(F)&&!this.isCorsEnabledForUrl(F)&&(F=PROXY_URL+"?url="+encodeURIComponent(F));S(q,F)};Editor.prototype.embedCssFonts=
function(q,F){var S=q.split("url("),ba=0;null==this.cachedFonts&&(this.cachedFonts={});var U=mxUtils.bind(this,function(){if(0==ba){for(var ra=[S[0]],ya=1;ya<S.length;ya++){var va=S[ya].indexOf(")");ra.push('url("');ra.push(this.cachedFonts[Editor.trimCssUrl(S[ya].substring(0,va))]);ra.push('"'+S[ya].substring(va))}F(ra.join(""))}});if(0<S.length){for(q=1;q<S.length;q++){var ca=S[q].indexOf(")"),ea=null,na=S[q].indexOf("format(",ca);0<na&&(ea=Editor.trimCssUrl(S[q].substring(na+7,S[q].indexOf(")",
na))));mxUtils.bind(this,function(ra){if(null==this.cachedFonts[ra]){this.cachedFonts[ra]=ra;ba++;var ya="application/x-font-ttf";if("svg"==ea||/(\.svg)($|\?)/i.test(ra))ya="image/svg+xml";else if("otf"==ea||"embedded-opentype"==ea||/(\.otf)($|\?)/i.test(ra))ya="application/x-font-opentype";else if("woff"==ea||/(\.woff)($|\?)/i.test(ra))ya="application/font-woff";else if("woff2"==ea||/(\.woff2)($|\?)/i.test(ra))ya="application/font-woff2";else if("eot"==ea||/(\.eot)($|\?)/i.test(ra))ya="application/vnd.ms-fontobject";
else if("sfnt"==ea||/(\.sfnt)($|\?)/i.test(ra))ya="application/font-sfnt";this.mapFontUrl(ya,ra,mxUtils.bind(this,function(va,Da){this.loadUrl(Da,mxUtils.bind(this,function(pa){this.cachedFonts[ra]=pa;ba--;U()}),mxUtils.bind(this,function(pa){ba--;U()}),!0,null,"data:"+va+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(S[q].substring(0,ca)),ea)}U()}else F(q)};Editor.prototype.loadFonts=function(q){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(F){this.resolvedFontCss=
F;null!=q&&q()})):null!=q&&q()};Editor.prototype.createGoogleFontCache=function(){var q={},F;for(F in Graph.fontMapping)Graph.isCssFontUrl(F)&&(q[F]=Graph.fontMapping[F]);return q};Editor.prototype.embedExtFonts=function(q){var F=this.graph.getCustomFonts();if(0<F.length){var S=[],ba=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var U=mxUtils.bind(this,function(){0==ba&&this.embedCssFonts(S.join(""),q)}),ca=0;ca<F.length;ca++)mxUtils.bind(this,function(ea,
na){Graph.isCssFontUrl(na)?null==this.cachedGoogleFonts[na]?(ba++,this.loadUrl(na,mxUtils.bind(this,function(ra){this.cachedGoogleFonts[na]=ra;S.push(ra+"\n");ba--;U()}),mxUtils.bind(this,function(ra){ba--;S.push("@import url("+na+");\n");U()}))):S.push(this.cachedGoogleFonts[na]+"\n"):S.push('@font-face {font-family: "'+ea+'";src: url("'+na+'")}\n')})(F[ca].name,F[ca].url);U()}else q()};Editor.prototype.addMathCss=function(q){q=q.getElementsByTagName("defs");if(null!=q&&0<q.length)for(var F=document.getElementsByTagName("style"),
S=0;S<F.length;S++){var ba=mxUtils.getTextContent(F[S]);0>ba.indexOf("mxPageSelector")&&0<ba.indexOf("MathJax")&&q[0].appendChild(F[S].cloneNode(!0))}};Editor.prototype.addFontCss=function(q,F){F=null!=F?F:this.absoluteCssFonts(this.fontCss);if(null!=F){var S=q.getElementsByTagName("defs"),ba=q.ownerDocument;0==S.length?(S=null!=ba.createElementNS?ba.createElementNS(mxConstants.NS_SVG,"defs"):ba.createElement("defs"),null!=q.firstChild?q.insertBefore(S,q.firstChild):q.appendChild(S)):S=S[0];q=null!=
ba.createElementNS?ba.createElementNS(mxConstants.NS_SVG,"style"):ba.createElement("style");q.setAttribute("type","text/css");mxUtils.setTextContent(q,F);S.appendChild(q)}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(q,F,S){var ba=mxClient.IS_FF?8192:16384;return Math.min(S,Math.min(ba/q,ba/F))};Editor.prototype.exportToCanvas=function(q,F,S,ba,U,ca,ea,na,ra,ya,va,Da,pa,Aa,xa,Ma,Oa,Na){try{ca=null!=
ca?ca:!0;ea=null!=ea?ea:!0;Da=null!=Da?Da:this.graph;pa=null!=pa?pa:0;var La=ra?null:Da.background;La==mxConstants.NONE&&(La=null);null==La&&(La=ba);null==La&&0==ra&&(La=Ma?this.graph.defaultPageBackgroundColor:"#ffffff");this.convertImages(Da.getSvg(null,null,pa,Aa,null,ea,null,null,null,ya,null,Ma,Oa,Na),mxUtils.bind(this,function(Ba){try{var ab=new Image;ab.onload=mxUtils.bind(this,function(){try{var x=function(){mxClient.IS_SF?window.setTimeout(function(){Z.drawImage(ab,0,0);q(H,Ba)},0):(Z.drawImage(ab,
0,0),q(H,Ba))},H=document.createElement("canvas"),P=parseInt(Ba.getAttribute("width")),X=parseInt(Ba.getAttribute("height"));na=null!=na?na:1;null!=F&&(na=ca?Math.min(1,Math.min(3*F/(4*X),F/P)):F/P);na=this.getMaxCanvasScale(P,X,na);P=Math.ceil(na*P);X=Math.ceil(na*X);H.setAttribute("width",P);H.setAttribute("height",X);var Z=H.getContext("2d");null!=La&&(Z.beginPath(),Z.rect(0,0,P,X),Z.fillStyle=La,Z.fill());1!=na&&Z.scale(na,na);if(xa){var fa=Da.view,la=fa.scale;fa.scale=1;var za=btoa(unescape(encodeURIComponent(fa.createSvgGrid(fa.gridColor))));
fa.scale=la;za="data:image/svg+xml;base64,"+za;var ua=Da.gridSize*fa.gridSteps*na,oa=Da.getGraphBounds(),ta=fa.translate.x*la,Ea=fa.translate.y*la,Fa=ta+(oa.x-ta)/la-pa,Pa=Ea+(oa.y-Ea)/la-pa,Ra=new Image;Ra.onload=function(){try{for(var Ca=-Math.round(ua-mxUtils.mod((ta-Fa)*na,ua)),Ja=-Math.round(ua-mxUtils.mod((Ea-Pa)*na,ua));Ca<P;Ca+=ua)for(var Qa=Ja;Qa<X;Qa+=ua)Z.drawImage(Ra,Ca/na,Qa/na);x()}catch($a){null!=U&&U($a)}};Ra.onerror=function(Ca){null!=U&&U(Ca)};Ra.src=za}else x()}catch(Ca){null!=
U&&U(Ca)}});ab.onerror=function(x){null!=U&&U(x)};ya&&this.graph.addSvgShadow(Ba);this.graph.mathEnabled&&this.addMathCss(Ba);var Xa=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ba,this.resolvedFontCss),ab.src=Editor.createSvgDataUri(mxUtils.getXml(Ba))}catch(x){null!=U&&U(x)}});this.embedExtFonts(mxUtils.bind(this,function(x){try{null!=x&&this.addFontCss(Ba,x),this.loadFonts(Xa)}catch(H){null!=U&&U(H)}}))}catch(x){null!=U&&U(x)}}),S,va)}catch(Ba){null!=U&&U(Ba)}};
Editor.crcTable=[];for(var D=0;256>D;D++)for(var p=D,E=0;8>E;E++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[D]=p;Editor.updateCRC=function(q,F,S,ba){for(var U=0;U<ba;U++)q=Editor.crcTable[(q^F.charCodeAt(S+U))&255]^q>>>8;return q};Editor.crc32=function(q){for(var F=-1,S=0;S<q.length;S++)F=F>>>8^Editor.crcTable[(F^q.charCodeAt(S))&255];return(F^-1)>>>0};Editor.writeGraphModelToPng=function(q,F,S,ba,U){function ca(va,Da){var pa=ra;ra+=Da;return va.substring(pa,ra)}function ea(va){va=ca(va,4);
return va.charCodeAt(3)+(va.charCodeAt(2)<<8)+(va.charCodeAt(1)<<16)+(va.charCodeAt(0)<<24)}function na(va){return String.fromCharCode(va>>24&255,va>>16&255,va>>8&255,va&255)}q=q.substring(q.indexOf(",")+1);q=window.atob?atob(q):Base64.decode(q,!0);var ra=0;if(ca(q,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=U&&U();else if(ca(q,4),"IHDR"!=ca(q,4))null!=U&&U();else{ca(q,17);U=q.substring(0,ra);do{var ya=ea(q);if("IDAT"==ca(q,4)){U=q.substring(0,ra-8);"pHYs"==F&&"dpi"==
S?(S=Math.round(ba/.0254),S=na(S)+na(S)+String.fromCharCode(1)):S=S+String.fromCharCode(0)+("zTXt"==F?String.fromCharCode(0):"")+ba;ba=4294967295;ba=Editor.updateCRC(ba,F,0,4);ba=Editor.updateCRC(ba,S,0,S.length);U+=na(S.length)+F+S+na(ba^4294967295);U+=q.substring(ra-8,q.length);break}U+=q.substring(ra-8,ra-4+ya);ca(q,ya);ca(q,4)}while(ya);return"data:image/png;base64,"+(window.btoa?btoa(U):Base64.encode(U,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.diagrams.net/doc/faq/save-file-formats";
var N=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(q,F){N.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var R=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){R.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(q,F){var S=null;null!=q.editor.graph.getModel().getParent(F)?S=F.getId():null!=q.currentPage&&
(S=q.currentPage.getId());return S});if(null!=window.StyleFormatPanel){var G=Format.prototype.init;Format.prototype.init=function(){G.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var M=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?M.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var q=this.editorUi.getCurrentFile();
return"1"==urlParams.embed||null!=q&&q.isEditable()};DiagramFormatPanel.prototype.isMathOptionVisible=function(q){return!1};var Q=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(q){q=Q.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var F=this.editorUi,S=F.editor.graph,ba=this.createOption(mxResources.get("shadow"),function(){return S.shadowVisible},function(U){var ca=new ChangePageSetup(F);ca.ignoreColor=!0;
ca.ignoreImage=!0;ca.shadowVisible=U;S.model.execute(ca)},{install:function(U){this.listener=function(){U(S.shadowVisible)};F.addListener("shadowVisibleChanged",this.listener)},destroy:function(){F.removeListener(this.listener)}});Editor.enableShadowOption||(ba.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(ba,60));q.appendChild(ba)}return q};var e=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(q){q=e.apply(this,arguments);
var F=this.editorUi,S=F.editor.graph;if(S.isEnabled()){var ba=F.getCurrentFile();if(null!=ba&&ba.isAutosaveOptional()){var U=this.createOption(mxResources.get("autosave"),function(){return F.editor.autosave},function(ea){F.editor.setAutosave(ea);F.editor.autosave&&ba.isModified()&&ba.fileChanged()},{install:function(ea){this.listener=function(){ea(F.editor.autosave)};F.editor.addListener("autosaveChanged",this.listener)},destroy:function(){F.editor.removeListener(this.listener)}});q.appendChild(U)}}if(this.isMathOptionVisible()&&
S.isEnabled()&&"undefined"!==typeof MathJax){U=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return S.mathEnabled},function(ea){F.actions.get("mathematicalTypesetting").funct()},{install:function(ea){this.listener=function(){ea(S.mathEnabled)};F.addListener("mathEnabledChanged",this.listener)},destroy:function(){F.removeListener(this.listener)}});U.style.paddingTop="5px";q.appendChild(U);var ca=F.menus.createHelpLink("https://www.diagrams.net/doc/faq/math-typesetting");ca.style.position=
"relative";ca.style.marginLeft="6px";ca.style.top="2px";U.appendChild(ca)}return q};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=
[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",
dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},
{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=
[{name:"size",dispName:"Size",type:"float",defVal:.3,min:0,max:1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",
type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",
type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},
{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",
min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"startSize",dispName:"Header Size",type:"float"},
{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",
type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);
mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},
{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},
{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=
[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=
[{name:"size",dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=
[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=
[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,
min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",
stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",
font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",
stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},
{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(q,F,S){if(null!=F){var ba=function(ca){if(null!=ca)if(S)for(var ea=0;ea<ca.length;ea++)F[ca[ea].name]=ca[ea];else for(var na in F){var ra=!1;for(ea=0;ea<ca.length;ea++)if(ca[ea].name==na&&ca[ea].type==F[na].type){ra=!0;break}ra||
delete F[na]}},U=this.editorUi.editor.graph.view.getState(q);null!=U&&null!=U.shape&&(U.shape.commonCustomPropAdded||(U.shape.commonCustomPropAdded=!0,U.shape.customProperties=U.shape.customProperties||[],U.cell.vertex?Array.prototype.push.apply(U.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(U.shape.customProperties,Editor.commonEdgeProperties)),ba(U.shape.customProperties));q=q.getAttribute("customProperties");if(null!=q)try{ba(JSON.parse(q))}catch(ca){}}};var f=
StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var q=this.editorUi.getSelectionState();"image"!=q.style.shape&&!q.containsLabel&&0<q.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);if(Editor.enableCustomProperties){for(var F={},S=q.vertices,ba=q.edges,U=0;U<S.length;U++)this.findCommonProperties(S[U],F,0==U);for(U=0;U<ba.length;U++)this.findCommonProperties(ba[U],F,0==S.length&&0==U);null!=Object.getOwnPropertyNames&&
0<Object.getOwnPropertyNames(F).length&&this.container.appendChild(this.addProperties(this.createPanel(),F,q))}};var k=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(q){this.addActions(q,["copyStyle","pasteStyle"]);return k.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(q,F,S){function ba(Z,fa,la,za){Da.getModel().beginUpdate();try{var ua=[],oa=[];if(null!=la.index){for(var ta=[],Ea=la.parentRow.nextSibling;Ea&&
Ea.getAttribute("data-pName")==Z;)ta.push(Ea.getAttribute("data-pValue")),Ea=Ea.nextSibling;la.index<ta.length?null!=za?ta.splice(za,1):ta[la.index]=fa:ta.push(fa);null!=la.size&&ta.length>la.size&&(ta=ta.slice(0,la.size));fa=ta.join(",");null!=la.countProperty&&(Da.setCellStyles(la.countProperty,ta.length,Da.getSelectionCells()),ua.push(la.countProperty),oa.push(ta.length))}Da.setCellStyles(Z,fa,Da.getSelectionCells());ua.push(Z);oa.push(fa);if(null!=la.dependentProps)for(Z=0;Z<la.dependentProps.length;Z++){var Fa=
la.dependentPropsDefVal[Z],Pa=la.dependentPropsVals[Z];if(Pa.length>fa)Pa=Pa.slice(0,fa);else for(var Ra=Pa.length;Ra<fa;Ra++)Pa.push(Fa);Pa=Pa.join(",");Da.setCellStyles(la.dependentProps[Z],Pa,Da.getSelectionCells());ua.push(la.dependentProps[Z]);oa.push(Pa)}if("function"==typeof la.onChange)la.onChange(Da,fa);va.editorUi.fireEvent(new mxEventObject("styleChanged","keys",ua,"values",oa,"cells",Da.getSelectionCells()))}finally{Da.getModel().endUpdate()}}function U(Z,fa,la){var za=mxUtils.getOffset(q,
!0),ua=mxUtils.getOffset(Z,!0);fa.style.position="absolute";fa.style.left=ua.x-za.x+"px";fa.style.top=ua.y-za.y+"px";fa.style.width=Z.offsetWidth+"px";fa.style.height=Z.offsetHeight-(la?4:0)+"px";fa.style.zIndex=5}function ca(Z,fa,la){var za=document.createElement("div");za.style.width="32px";za.style.height="4px";za.style.margin="2px";za.style.border="1px solid black";za.style.background=fa&&"none"!=fa?fa:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(va,function(ua){this.editorUi.pickColor(fa,
function(oa){za.style.background="none"==oa?"url('"+Dialog.prototype.noColorImage+"')":oa;ba(Z,oa,la)});mxEvent.consume(ua)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(za);return btn}function ea(Z,fa,la,za,ua,oa,ta){null!=fa&&(fa=fa.split(","),pa.push({name:Z,values:fa,type:la,defVal:za,countProperty:ua,parentRow:oa,isDeletable:!0,flipBkg:ta}));btn=mxUtils.button("+",mxUtils.bind(va,function(Ea){for(var Fa=oa,Pa=0;null!=Fa.nextSibling;)if(Fa.nextSibling.getAttribute("data-pName")==
Z)Fa=Fa.nextSibling,Pa++;else break;var Ra={type:la,parentRow:oa,index:Pa,isDeletable:!0,defVal:za,countProperty:ua};Pa=ya(Z,"",Ra,0==Pa%2,ta);ba(Z,za,Ra);Fa.parentNode.insertBefore(Pa,Fa.nextSibling);mxEvent.consume(Ea)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function na(Z,fa,la,za,ua,oa,ta){if(0<ua){var Ea=Array(ua);fa=null!=fa?fa.split(","):[];for(var Fa=0;Fa<ua;Fa++)Ea[Fa]=null!=fa[Fa]?fa[Fa]:null!=za?za:"";pa.push({name:Z,values:Ea,type:la,defVal:za,
parentRow:oa,flipBkg:ta,size:ua})}return document.createElement("div")}function ra(Z,fa,la){var za=document.createElement("input");za.type="checkbox";za.checked="1"==fa;mxEvent.addListener(za,"change",function(){ba(Z,za.checked?"1":"0",la)});return za}function ya(Z,fa,la,za,ua){var oa=la.dispName,ta=la.type,Ea=document.createElement("tr");Ea.className="gePropRow"+(ua?"Dark":"")+(za?"Alt":"")+" gePropNonHeaderRow";Ea.setAttribute("data-pName",Z);Ea.setAttribute("data-pValue",fa);za=!1;null!=la.index&&
(Ea.setAttribute("data-index",la.index),oa=(null!=oa?oa:"")+"["+la.index+"]",za=!0);var Fa=document.createElement("td");Fa.className="gePropRowCell";oa=mxResources.get(oa,null,oa);mxUtils.write(Fa,oa);Fa.setAttribute("title",oa);za&&(Fa.style.textAlign="right");Ea.appendChild(Fa);Fa=document.createElement("td");Fa.className="gePropRowCell";if("color"==ta)Fa.appendChild(ca(Z,fa,la));else if("bool"==ta||"boolean"==ta)Fa.appendChild(ra(Z,fa,la));else if("enum"==ta){var Pa=la.enumList;for(ua=0;ua<Pa.length;ua++)if(oa=
Pa[ua],oa.val==fa){mxUtils.write(Fa,mxResources.get(oa.dispName,null,oa.dispName));break}mxEvent.addListener(Fa,"click",mxUtils.bind(va,function(){var Ra=document.createElement("select");U(Fa,Ra);for(var Ca=0;Ca<Pa.length;Ca++){var Ja=Pa[Ca],Qa=document.createElement("option");Qa.value=mxUtils.htmlEntities(Ja.val);mxUtils.write(Qa,mxResources.get(Ja.dispName,null,Ja.dispName));Ra.appendChild(Qa)}Ra.value=fa;q.appendChild(Ra);mxEvent.addListener(Ra,"change",function(){var $a=mxUtils.htmlEntities(Ra.value);
ba(Z,$a,la)});Ra.focus();mxEvent.addListener(Ra,"blur",function(){q.removeChild(Ra)})}))}else"dynamicArr"==ta?Fa.appendChild(ea(Z,fa,la.subType,la.subDefVal,la.countProperty,Ea,ua)):"staticArr"==ta?Fa.appendChild(na(Z,fa,la.subType,la.subDefVal,la.size,Ea,ua)):"readOnly"==ta?(ua=document.createElement("input"),ua.setAttribute("readonly",""),ua.value=fa,ua.style.width="96px",ua.style.borderWidth="0px",Fa.appendChild(ua)):(Fa.innerHTML=mxUtils.htmlEntities(decodeURIComponent(fa)),mxEvent.addListener(Fa,
"click",mxUtils.bind(va,function(){function Ra(){var Ja=Ca.value;Ja=0==Ja.length&&"string"!=ta?0:Ja;la.allowAuto&&(null!=Ja.trim&&"auto"==Ja.trim().toLowerCase()?(Ja="auto",ta="string"):(Ja=parseFloat(Ja),Ja=isNaN(Ja)?0:Ja));null!=la.min&&Ja<la.min?Ja=la.min:null!=la.max&&Ja>la.max&&(Ja=la.max);Ja=encodeURIComponent(("int"==ta?parseInt(Ja):Ja)+"");ba(Z,Ja,la)}var Ca=document.createElement("input");U(Fa,Ca,!0);Ca.value=decodeURIComponent(fa);Ca.className="gePropEditor";"int"!=ta&&"float"!=ta||la.allowAuto||
(Ca.type="number",Ca.step="int"==ta?"1":"any",null!=la.min&&(Ca.min=parseFloat(la.min)),null!=la.max&&(Ca.max=parseFloat(la.max)));q.appendChild(Ca);mxEvent.addListener(Ca,"keypress",function(Ja){13==Ja.keyCode&&Ra()});Ca.focus();mxEvent.addListener(Ca,"blur",function(){Ra()})})));la.isDeletable&&(ua=mxUtils.button("-",mxUtils.bind(va,function(Ra){ba(Z,"",la,la.index);mxEvent.consume(Ra)})),ua.style.height="16px",ua.style.width="25px",ua.style.float="right",ua.className="geColorBtn",Fa.appendChild(ua));
Ea.appendChild(Fa);return Ea}var va=this,Da=this.editorUi.editor.graph,pa=[];q.style.position="relative";q.style.padding="0";var Aa=document.createElement("table");Aa.className="geProperties";Aa.style.whiteSpace="nowrap";Aa.style.width="100%";var xa=document.createElement("tr");xa.className="gePropHeader";var Ma=document.createElement("th");Ma.className="gePropHeaderCell";var Oa=document.createElement("img");Oa.src=Sidebar.prototype.expandedImage;Oa.style.verticalAlign="middle";Ma.appendChild(Oa);
mxUtils.write(Ma,mxResources.get("property"));xa.style.cursor="pointer";var Na=function(){var Z=Aa.querySelectorAll(".gePropNonHeaderRow");if(va.editorUi.propertiesCollapsed){Oa.src=Sidebar.prototype.collapsedImage;var fa="none";for(var la=q.childNodes.length-1;0<=la;la--)try{var za=q.childNodes[la],ua=za.nodeName.toUpperCase();"INPUT"!=ua&&"SELECT"!=ua||q.removeChild(za)}catch(oa){}}else Oa.src=Sidebar.prototype.expandedImage,fa="";for(la=0;la<Z.length;la++)Z[la].style.display=fa};mxEvent.addListener(xa,
"click",function(){va.editorUi.propertiesCollapsed=!va.editorUi.propertiesCollapsed;Na()});xa.appendChild(Ma);Ma=document.createElement("th");Ma.className="gePropHeaderCell";Ma.innerHTML=mxResources.get("value");xa.appendChild(Ma);Aa.appendChild(xa);var La=!1,Ba=!1;xa=null;1==S.vertices.length&&0==S.edges.length?xa=S.vertices[0].id:0==S.vertices.length&&1==S.edges.length&&(xa=S.edges[0].id);null!=xa&&Aa.appendChild(ya("id",mxUtils.htmlEntities(xa),{dispName:"ID",type:"readOnly"},!0,!1));for(var ab in F)if(xa=
F[ab],"function"!=typeof xa.isVisible||xa.isVisible(S,this)){var Xa=null!=S.style[ab]?mxUtils.htmlEntities(S.style[ab]+""):null!=xa.getDefaultValue?xa.getDefaultValue(S,this):xa.defVal;if("separator"==xa.type)Ba=!Ba;else{if("staticArr"==xa.type)xa.size=parseInt(S.style[xa.sizeProperty]||F[xa.sizeProperty].defVal)||0;else if(null!=xa.dependentProps){var x=xa.dependentProps,H=[],P=[];for(Ma=0;Ma<x.length;Ma++){var X=S.style[x[Ma]];P.push(F[x[Ma]].subDefVal);H.push(null!=X?X.split(","):[])}xa.dependentPropsDefVal=
P;xa.dependentPropsVals=H}Aa.appendChild(ya(ab,Xa,xa,La,Ba));La=!La}}for(Ma=0;Ma<pa.length;Ma++)for(xa=pa[Ma],F=xa.parentRow,S=0;S<xa.values.length;S++)ab=ya(xa.name,xa.values[S],{type:xa.type,parentRow:xa.parentRow,isDeletable:xa.isDeletable,index:S,defVal:xa.defVal,countProperty:xa.countProperty,size:xa.size},0==S%2,xa.flipBkg),F.parentNode.insertBefore(ab,F.nextSibling),F=ab;q.appendChild(Aa);Na();return q};StyleFormatPanel.prototype.addStyles=function(q){function F(xa){mxEvent.addListener(xa,
"mouseenter",function(){xa.style.opacity="1"});mxEvent.addListener(xa,"mouseleave",function(){xa.style.opacity="0.5"})}var S=this.editorUi,ba=S.editor.graph,U=document.createElement("div");U.style.whiteSpace="nowrap";U.style.paddingLeft="24px";U.style.paddingRight="20px";q.style.paddingLeft="16px";q.style.paddingBottom="6px";q.style.position="relative";q.appendChild(U);var ca="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" "),
ea=document.createElement("div");ea.style.whiteSpace="nowrap";ea.style.position="relative";ea.style.textAlign="center";ea.style.width="210px";for(var na=[],ra=0;ra<this.defaultColorSchemes.length;ra++){var ya=document.createElement("div");ya.style.display="inline-block";ya.style.width="6px";ya.style.height="6px";ya.style.marginLeft="4px";ya.style.marginRight="3px";ya.style.borderRadius="3px";ya.style.cursor="pointer";ya.style.background="transparent";ya.style.border="1px solid #b5b6b7";mxUtils.bind(this,
function(xa){mxEvent.addListener(ya,"click",mxUtils.bind(this,function(){va(xa)}))})(ra);na.push(ya);ea.appendChild(ya)}var va=mxUtils.bind(this,function(xa){null!=na[xa]&&(null!=this.format.currentScheme&&null!=na[this.format.currentScheme]&&(na[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=xa,Da(this.defaultColorSchemes[this.format.currentScheme]),na[this.format.currentScheme].style.background="#84d7ff")}),Da=mxUtils.bind(this,function(xa){var Ma=mxUtils.bind(this,
function(Na){var La=mxUtils.button("",mxUtils.bind(this,function(Xa){ba.getModel().beginUpdate();try{for(var x=S.getSelectionState().cells,H=0;H<x.length;H++){for(var P=ba.getModel().getStyle(x[H]),X=0;X<ca.length;X++)P=mxUtils.removeStylename(P,ca[X]);var Z=ba.getModel().isVertex(x[H])?ba.defaultVertexStyle:ba.defaultEdgeStyle;null!=Na?(mxEvent.isShiftDown(Xa)||(P=""==Na.fill?mxUtils.setStyle(P,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(P,mxConstants.STYLE_FILLCOLOR,Na.fill||mxUtils.getValue(Z,
mxConstants.STYLE_FILLCOLOR,null)),P=mxUtils.setStyle(P,mxConstants.STYLE_GRADIENTCOLOR,Na.gradient||mxUtils.getValue(Z,mxConstants.STYLE_GRADIENTCOLOR,null)),mxEvent.isControlDown(Xa)||mxClient.IS_MAC&&mxEvent.isMetaDown(Xa)||!ba.getModel().isVertex(x[H])||(P=mxUtils.setStyle(P,mxConstants.STYLE_FONTCOLOR,Na.font||mxUtils.getValue(Z,mxConstants.STYLE_FONTCOLOR,null)))),mxEvent.isAltDown(Xa)||(P=""==Na.stroke?mxUtils.setStyle(P,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(P,mxConstants.STYLE_STROKECOLOR,
Na.stroke||mxUtils.getValue(Z,mxConstants.STYLE_STROKECOLOR,null)))):(P=mxUtils.setStyle(P,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(Z,mxConstants.STYLE_FILLCOLOR,"#ffffff")),P=mxUtils.setStyle(P,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(Z,mxConstants.STYLE_STROKECOLOR,"#000000")),P=mxUtils.setStyle(P,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(Z,mxConstants.STYLE_GRADIENTCOLOR,null)),ba.getModel().isVertex(x[H])&&(P=mxUtils.setStyle(P,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(Z,mxConstants.STYLE_FONTCOLOR,
null))));ba.getModel().setStyle(x[H],P)}}finally{ba.getModel().endUpdate()}}));La.className="geStyleButton";La.style.width="36px";La.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";La.style.margin="0px 6px 6px 0px";if(null!=Na){var Ba="1"==urlParams.sketch?"2px solid":"1px solid";null!=Na.border&&(Ba=Na.border);null!=Na.gradient?mxClient.IS_IE&&10>document.documentMode?La.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+Na.fill+"', EndColorStr='"+Na.gradient+
"', GradientType=0)":La.style.backgroundImage="linear-gradient("+Na.fill+" 0px,"+Na.gradient+" 100%)":Na.fill==mxConstants.NONE?La.style.background="url('"+Dialog.prototype.noColorImage+"')":La.style.backgroundColor=""==Na.fill?mxUtils.getValue(ba.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,Editor.isDarkMode()?Editor.darkColor:"#ffffff"):Na.fill||mxUtils.getValue(ba.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,Editor.isDarkMode()?Editor.darkColor:"#ffffff");La.style.border=Na.stroke==mxConstants.NONE?
Ba+" transparent":""==Na.stroke?Ba+" "+mxUtils.getValue(ba.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,Editor.isDarkMode()?"#ffffff":Editor.darkColor):Ba+" "+(Na.stroke||mxUtils.getValue(ba.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,Editor.isDarkMode()?"#ffffff":Editor.darkColor));null!=Na.title&&La.setAttribute("title",Na.title)}else{Ba=mxUtils.getValue(ba.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"#ffffff");var ab=mxUtils.getValue(ba.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,
"#000000");La.style.backgroundColor=Ba;La.style.border="1px solid "+ab}La.style.borderRadius="0";U.appendChild(La)});U.innerText="";for(var Oa=0;Oa<xa.length;Oa++)0<Oa&&0==mxUtils.mod(Oa,4)&&mxUtils.br(U),Ma(xa[Oa])});null==this.format.currentScheme?va(Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0):va(this.format.currentScheme);ra=10>=this.defaultColorSchemes.length?28:8;var pa=document.createElement("div");pa.style.cssText="position:absolute;left:10px;top:8px;bottom:"+ra+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
mxEvent.addListener(pa,"click",mxUtils.bind(this,function(){va(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var Aa=document.createElement("div");Aa.style.cssText="position:absolute;left:202px;top:8px;bottom:"+ra+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
1<this.defaultColorSchemes.length&&(q.appendChild(pa),q.appendChild(Aa));mxEvent.addListener(Aa,"click",mxUtils.bind(this,function(){va(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));F(pa);F(Aa);Da(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&q.appendChild(ea);return q};StyleFormatPanel.prototype.addEditOps=function(q){var F=this.editorUi.getSelectionState(),S=this.editorUi.editor.graph,ba=null;1==F.cells.length&&(ba=mxUtils.button(mxResources.get("editStyle"),
mxUtils.bind(this,function(U){this.editorUi.actions.get("editStyle").funct()})),ba.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),ba.style.width="210px",ba.style.marginBottom="2px",q.appendChild(ba));S=1==F.cells.length?S.view.getState(F.cells[0]):null;null!=S&&null!=S.shape&&null!=S.shape.stencil?(F=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,function(U){this.editorUi.actions.get("editShape").funct()})),F.setAttribute("title",
mxResources.get("editShape")),F.style.marginBottom="2px",null==ba?F.style.width="210px":(ba.style.width="104px",F.style.width="104px",F.style.marginLeft="2px"),q.appendChild(F)):F.image&&0<F.cells.length&&(F=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(U){this.editorUi.actions.get("image").funct()})),F.setAttribute("title",mxResources.get("editImage")),F.style.marginBottom="2px",null==ba?F.style.width="210px":(ba.style.width="104px",F.style.width="104px",F.style.marginLeft=
"2px"),q.appendChild(F));return q}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.recentCustomFonts={};Graph.isGoogleFontUrl=function(q){return q.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS};Graph.isCssFontUrl=function(q){return Graph.isGoogleFontUrl(q)};Graph.createFontElement=function(q,
F){var S=Graph.fontMapping[F];null==S&&Graph.isCssFontUrl(F)?(q=document.createElement("link"),q.setAttribute("rel","stylesheet"),q.setAttribute("type","text/css"),q.setAttribute("charset","UTF-8"),q.setAttribute("href",F)):(null==S&&(S='@font-face {\nfont-family: "'+q+'";\nsrc: url("'+F+'");\n}'),q=document.createElement("style"),mxUtils.write(q,S));return q};Graph.addFont=function(q,F,S){if(null!=q&&0<q.length&&null!=F&&0<F.length){var ba=q.toLowerCase();if("helvetica"!=ba&&"arial"!=q&&"sans-serif"!=
ba){var U=Graph.customFontElements[ba];null!=U&&U.url!=F&&(U.elt.parentNode.removeChild(U.elt),U=null);null==U?(U=F,"http:"==F.substring(0,5)&&(U=PROXY_URL+"?url="+encodeURIComponent(F)),U={name:q,url:F,elt:Graph.createFontElement(q,U)},Graph.customFontElements[ba]=U,Graph.recentCustomFonts[ba]=U,F=document.getElementsByTagName("head")[0],null!=S&&("link"==U.elt.nodeName.toLowerCase()?(U.elt.onload=S,U.elt.onerror=S):S()),null!=F&&F.appendChild(U.elt)):null!=S&&S()}else null!=S&&S()}else null!=S&&
S();return q};Graph.getFontUrl=function(q,F){q=Graph.customFontElements[q.toLowerCase()];null!=q&&(F=q.url);return F};Graph.processFontAttributes=function(q){q=q.getElementsByTagName("*");for(var F=0;F<q.length;F++){var S=q[F].getAttribute("data-font-src");if(null!=S){var ba="FONT"==q[F].nodeName?q[F].getAttribute("face"):q[F].style.fontFamily;null!=ba&&Graph.addFont(ba,S)}}};Graph.processFontStyle=function(q){if(null!=q){var F=mxUtils.getValue(q,"fontSource",null);if(null!=F){var S=mxUtils.getValue(q,
mxConstants.STYLE_FONTFAMILY,null);null!=S&&Graph.addFont(S,decodeURIComponent(F))}}return q};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="dropShadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";
Graph.prototype.edgeMode="move"!=urlParams.edge;Graph.prototype.hiddenTags=null;Graph.prototype.defaultMathEnabled=!1;var z=Graph.prototype.init;Graph.prototype.init=function(){function q(U){F=U}z.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var F=null;mxEvent.addListener(this.container,"mouseenter",q);mxEvent.addListener(this.container,"mousemove",q);mxEvent.addListener(this.container,"mouseleave",function(U){F=null});this.isMouseInsertPoint=function(){return null!=
F};var S=this.getInsertPoint;this.getInsertPoint=function(){return null!=F?this.getPointForEvent(F):S.apply(this,arguments)};var ba=this.layoutManager.getLayout;this.layoutManager.getLayout=function(U){var ca=this.graph.getCellStyle(U);if(null!=ca&&"rack"==ca.childLayout){var ea=new mxStackLayout(this.graph,!1);ea.gridSize=null!=ca.rackUnitSize?parseFloat(ca.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;ea.marginLeft=ca.marginLeft||0;ea.marginRight=ca.marginRight||
0;ea.marginTop=ca.marginTop||0;ea.marginBottom=ca.marginBottom||0;ea.allowGaps=ca.allowGaps||0;ea.horizontal="1"==mxUtils.getValue(ca,"horizontalRack","0");ea.resizeParent=!1;ea.fill=!0;return ea}return ba.apply(this,arguments)};this.updateGlobalUrlVariables()};var t=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(q,F){return Graph.processFontStyle(t.apply(this,arguments))};var B=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(q,
F,S,ba,U,ca,ea,na,ra,ya,va){B.apply(this,arguments);Graph.processFontAttributes(va)};var I=mxText.prototype.redraw;mxText.prototype.redraw=function(){I.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(q,F,S){function ba(){for(var xa=ea.getSelectionCells(),Ma=[],Oa=0;Oa<xa.length;Oa++)ea.isCellVisible(xa[Oa])&&Ma.push(xa[Oa]);ea.setSelectionCells(Ma)}function U(xa){ea.setHiddenTags(xa?[]:na.slice());
ba();ea.refresh()}function ca(xa,Ma){ya.innerText="";if(0<xa.length){var Oa=document.createElement("table");Oa.setAttribute("cellpadding","2");Oa.style.boxSizing="border-box";Oa.style.tableLayout="fixed";Oa.style.width="100%";var Na=document.createElement("tbody");if(null!=xa&&0<xa.length)for(var La=0;La<xa.length;La++)(function(Ba){var ab=0>mxUtils.indexOf(ea.hiddenTags,Ba),Xa=document.createElement("tr"),x=document.createElement("td");x.style.align="center";x.style.width="16px";var H=document.createElement("img");
H.setAttribute("src",ab?Editor.visibleImage:Editor.hiddenImage);H.setAttribute("title",mxResources.get(ab?"hideIt":"show",[Ba]));mxUtils.setOpacity(H,ab?75:25);H.style.verticalAlign="middle";H.style.cursor="pointer";H.style.width="16px";if(F||Editor.isDarkMode())H.style.filter="invert(100%)";x.appendChild(H);mxEvent.addListener(H,"click",function(X){mxEvent.isShiftDown(X)?U(0<=mxUtils.indexOf(ea.hiddenTags,Ba)):(ea.toggleHiddenTag(Ba),ba(),ea.refresh());mxEvent.consume(X)});Xa.appendChild(x);x=document.createElement("td");
x.style.overflow="hidden";x.style.whiteSpace="nowrap";x.style.textOverflow="ellipsis";x.style.verticalAlign="middle";x.style.cursor="pointer";x.setAttribute("title",Ba);a=document.createElement("a");mxUtils.write(a,Ba);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,ab?100:40);x.appendChild(a);mxEvent.addListener(x,"click",function(X){if(mxEvent.isShiftDown(X)){U(!0);var Z=ea.getCellsForTags([Ba],null,null,!0);ea.isEnabled()?ea.setSelectionCells(Z):ea.highlightCells(Z)}else if(ab&&
0<ea.hiddenTags.length)U(!0);else{Z=na.slice();var fa=mxUtils.indexOf(Z,Ba);Z.splice(fa,1);ea.setHiddenTags(Z);ba();ea.refresh()}mxEvent.consume(X)});Xa.appendChild(x);if(ea.isEnabled()){x=document.createElement("td");x.style.verticalAlign="middle";x.style.textAlign="center";x.style.width="18px";if(null==Ma){x.style.align="center";x.style.width="16px";H=document.createElement("img");H.setAttribute("src",Editor.crossImage);H.setAttribute("title",mxResources.get("removeIt",[Ba]));mxUtils.setOpacity(H,
ab?75:25);H.style.verticalAlign="middle";H.style.cursor="pointer";H.style.width="16px";if(F||Editor.isDarkMode())H.style.filter="invert(100%)";mxEvent.addListener(H,"click",function(X){var Z=mxUtils.indexOf(na,Ba);0<=Z&&na.splice(Z,1);ea.removeTagsForCells(ea.model.getDescendants(ea.model.getRoot()),[Ba]);ea.refresh();mxEvent.consume(X)});x.appendChild(H)}else{var P=document.createElement("input");P.setAttribute("type","checkbox");P.style.margin="0px";P.defaultChecked=null!=Ma&&0<=mxUtils.indexOf(Ma,
Ba);P.checked=P.defaultChecked;P.style.background="transparent";P.setAttribute("title",mxResources.get(P.defaultChecked?"removeIt":"add",[Ba]));mxEvent.addListener(P,"change",function(X){P.checked?ea.addTagsForCells(ea.getSelectionCells(),[Ba]):ea.removeTagsForCells(ea.getSelectionCells(),[Ba]);mxEvent.consume(X)});x.appendChild(P)}Xa.appendChild(x)}Na.appendChild(Xa)})(xa[La]);Oa.appendChild(Na);ya.appendChild(Oa)}}var ea=this,na=ea.hiddenTags.slice(),ra=document.createElement("div");ra.style.userSelect=
"none";ra.style.overflow="hidden";ra.style.padding="10px";ra.style.height="100%";var ya=document.createElement("div");ya.style.boxSizing="border-box";ya.style.borderRadius="4px";ya.style.userSelect="none";ya.style.overflow="auto";ya.style.position="absolute";ya.style.left="10px";ya.style.right="10px";ya.style.top="10px";ya.style.border=ea.isEnabled()?"1px solid #808080":"none";ya.style.bottom=ea.isEnabled()?"48px":"10px";ra.appendChild(ya);var va=mxUtils.button(mxResources.get("reset"),function(xa){ea.setHiddenTags([]);
mxEvent.isShiftDown(xa)||(na=ea.hiddenTags.slice());ba();ea.refresh()});va.setAttribute("title",mxResources.get("reset"));va.className="geBtn";va.style.margin="0 4px 0 0";var Da=mxUtils.button(mxResources.get("add"),function(){null!=S&&S(na,function(xa){na=xa;pa()})});Da.setAttribute("title",mxResources.get("add"));Da.className="geBtn";Da.style.margin="0";ea.addListener(mxEvent.ROOT,function(){na=ea.hiddenTags.slice()});var pa=mxUtils.bind(this,function(xa,Ma){if(q()){xa=ea.getAllTags();for(Ma=0;Ma<
xa.length;Ma++)0>mxUtils.indexOf(na,xa[Ma])&&na.push(xa[Ma]);na.sort();ea.isSelectionEmpty()?ca(na):ca(na,ea.getCommonTagsForCells(ea.getSelectionCells()))}});ea.selectionModel.addListener(mxEvent.CHANGE,pa);ea.model.addListener(mxEvent.CHANGE,pa);ea.addListener(mxEvent.REFRESH,pa);var Aa=document.createElement("div");Aa.style.boxSizing="border-box";Aa.style.whiteSpace="nowrap";Aa.style.position="absolute";Aa.style.overflow="hidden";Aa.style.bottom="0px";Aa.style.height="42px";Aa.style.right="10px";
Aa.style.left="10px";ea.isEnabled()&&(Aa.appendChild(va),Aa.appendChild(Da),ra.appendChild(Aa));return{div:ra,refresh:pa}};Graph.prototype.getCustomFonts=function(){var q=this.extFonts;q=null!=q?q.slice():[];for(var F in Graph.customFontElements){var S=Graph.customFontElements[F];q.push({name:S.name,url:S.url})}return q};Graph.prototype.setFont=function(q,F){Graph.addFont(q,F);document.execCommand("fontname",!1,q);if(null!=F){var S=this.cellEditor.textarea.getElementsByTagName("font");F=Graph.getFontUrl(q,
F);for(var ba=0;ba<S.length;ba++)S[ba].getAttribute("face")==q&&S[ba].getAttribute("data-font-src")!=F&&S[ba].setAttribute("data-font-src",F)}};var O=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return O.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var q=JSON.parse(decodeURIComponent(urlParams.vars));
if(null!=q)for(var F in q)this.globalVars[F]=q[F]}catch(S){null!=window.console&&console.log("Error in vars URL parameter: "+S)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var J=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(q){var F=J.apply(this,arguments);null==F&&null!=this.globalVars&&(F=this.globalVars[q]);return F};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var q=
this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(q.ownerDocument)).decode(q)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var y=Graph.prototype.getSvg;Graph.prototype.getSvg=function(q,F,S,ba,U,ca,ea,na,ra,ya,va,Da,pa,Aa){var xa=null,Ma=null,Oa=null;Da||null==this.themes||"darkTheme"!=this.defaultThemeName||(xa=this.stylesheet,Ma=this.shapeForegroundColor,Oa=this.shapeBackgroundColor,this.shapeForegroundColor="darkTheme"==this.defaultThemeName?
"#000000":Editor.lightColor,this.shapeBackgroundColor="darkTheme"==this.defaultThemeName?"#ffffff":Editor.darkColor,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var Na=y.apply(this,arguments),La=this.getCustomFonts();if(va&&0<La.length){var Ba=Na.ownerDocument,ab=null!=Ba.createElementNS?Ba.createElementNS(mxConstants.NS_SVG,"style"):Ba.createElement("style");null!=Ba.setAttributeNS?ab.setAttributeNS("type","text/css"):ab.setAttribute("type","text/css");for(var Xa="",x="",H=0;H<La.length;H++){var P=
La[H].name,X=La[H].url;Graph.isCssFontUrl(X)?Xa+="@import url("+X+");\n":x+='@font-face {\nfont-family: "'+P+'";\nsrc: url("'+X+'");\n}\n'}ab.appendChild(Ba.createTextNode(Xa+x));Na.getElementsByTagName("defs")[0].appendChild(ab)}this.mathEnabled&&(document.body.appendChild(Na),Editor.MathJaxRender(Na),Na.parentNode.removeChild(Na));null!=xa&&(this.shapeBackgroundColor=Oa,this.shapeForegroundColor=Ma,this.stylesheet=xa,this.refresh());return Na};var ia=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=
function(q){ia.apply(this,arguments);null!=q.secondLabel&&(q.secondLabel.destroy(),q.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(q){return[q.shape,q.text,q.secondLabel,q.control]};var da=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){da.apply(this,arguments);this.enumerationState=0};var ja=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(q){null!=q.shape&&this.redrawEnumerationState(q);return ja.apply(this,
arguments)};mxGraphView.prototype.createEnumerationValue=function(q){q=decodeURIComponent(mxUtils.getValue(q.style,"enumerateValue",""));""==q&&(q=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(q)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(q){var F="1"==mxUtils.getValue(q.style,"enumerate",0);F&&null==q.secondLabel?(q.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),
q.secondLabel.size=12,q.secondLabel.state=q,q.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(q,q.secondLabel)):F||null==q.secondLabel||(q.secondLabel.destroy(),q.secondLabel=null);F=q.secondLabel;if(null!=F){var S=q.view.scale,ba=this.createEnumerationValue(q);q=this.graph.model.isVertex(q.cell)?new mxRectangle(q.x+q.width-4*S,q.y+4*S,0,0):mxRectangle.fromPoint(q.view.getPoint(q));F.bounds.equals(q)&&F.value==ba&&F.scale==S||(F.bounds=q,F.value=ba,F.scale=
S,F.redraw())}};var aa=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){aa.apply(this,arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var q=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||this.graph.mathEnabled&&("svg"==this.graph.container.firstChild.nodeName||
this.graph.container.firstChild==this.webKitForceRepaintNode)||(null!=this.webKitForceRepaintNode.parentNode&&this.webKitForceRepaintNode.parentNode.removeChild(this.webKitForceRepaintNode),this.webKitForceRepaintNode=null):(this.webKitForceRepaintNode=document.createElement("div"),this.webKitForceRepaintNode.style.cssText="position:absolute;",q.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,q.ownerSVGElement))}};var qa=Graph.prototype.refresh;Graph.prototype.refresh=function(){qa.apply(this,
arguments);this.refreshBackgroundImage()};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var sa=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){sa.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(q){"data:action/json,"==q.substring(0,17)&&(q=JSON.parse(q.substring(17)),
null!=q.actions&&this.executeCustomActions(q.actions))};Graph.prototype.executeCustomActions=function(q,F){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var S=!1,ba=0,U=0,ca=mxUtils.bind(this,function(){S||(S=!0,this.model.beginUpdate())}),ea=
mxUtils.bind(this,function(){S&&(S=!1,this.model.endUpdate())}),na=mxUtils.bind(this,function(){0<ba&&ba--;0==ba&&ra()}),ra=mxUtils.bind(this,function(){if(U<q.length){var ya=this.stoppingCustomActions,va=q[U++],Da=[];if(null!=va.open)if(ea(),this.isCustomLink(va.open)){if(!this.customLinkClicked(va.open))return}else this.openLink(va.open);null==va.wait||ya||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;na()}),ba++,this.pendingWaitThread=
window.setTimeout(this.pendingExecuteNextAction,""!=va.wait?parseInt(va.wait):1E3),ea());null!=va.opacity&&null!=va.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(va.opacity,!0)),va.opacity.value);null!=va.fadeIn&&(ba++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(va.fadeIn,!0)),0,1,na,ya?0:va.fadeIn.delay));null!=va.fadeOut&&(ba++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(va.fadeOut,!0)),1,0,na,ya?0:va.fadeOut.delay));null!=
va.wipeIn&&(Da=Da.concat(this.createWipeAnimations(this.getCellsForAction(va.wipeIn,!0),!0)));null!=va.wipeOut&&(Da=Da.concat(this.createWipeAnimations(this.getCellsForAction(va.wipeOut,!0),!1)));null!=va.toggle&&(ca(),this.toggleCells(this.getCellsForAction(va.toggle,!0)));if(null!=va.show){ca();var pa=this.getCellsForAction(va.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(pa),1);this.setCellsVisible(pa,!0)}null!=va.hide&&(ca(),pa=this.getCellsForAction(va.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(pa),
0),this.setCellsVisible(pa,!1));null!=va.toggleStyle&&null!=va.toggleStyle.key&&(ca(),this.toggleCellStyles(va.toggleStyle.key,null!=va.toggleStyle.defaultValue?va.toggleStyle.defaultValue:"0",this.getCellsForAction(va.toggleStyle,!0)));null!=va.style&&null!=va.style.key&&(ca(),this.setCellStyles(va.style.key,va.style.value,this.getCellsForAction(va.style,!0)));pa=[];null!=va.select&&this.isEnabled()&&(pa=this.getCellsForAction(va.select),this.setSelectionCells(pa));null!=va.highlight&&(pa=this.getCellsForAction(va.highlight),
this.highlightCells(pa,va.highlight.color,va.highlight.duration,va.highlight.opacity));null!=va.scroll&&(pa=this.getCellsForAction(va.scroll));null!=va.viewbox&&this.fitWindow(va.viewbox,va.viewbox.border);0<pa.length&&this.scrollCellToVisible(pa[0]);if(null!=va.tags){pa=[];null!=va.tags.hidden&&(pa=pa.concat(va.tags.hidden));if(null!=va.tags.visible)for(var Aa=this.getAllTags(),xa=0;xa<Aa.length;xa++)0>mxUtils.indexOf(va.tags.visible,Aa[xa])&&0>mxUtils.indexOf(pa,Aa[xa])&&pa.push(Aa[xa]);this.setHiddenTags(pa);
this.refresh()}0<Da.length&&(ba++,this.executeAnimations(Da,na,ya?1:va.steps,ya?0:va.delay));0==ba?ra():ea()}else this.stoppingCustomActions=this.executingCustomActions=!1,ea(),null!=F&&F()});ra()}};Graph.prototype.doUpdateCustomLinksForCell=function(q,F){var S=this.getLinkForCell(F);null!=S&&"data:action/json,"==S.substring(0,17)&&this.setLinkForCell(F,this.updateCustomLink(q,S));if(this.isHtmlLabel(F)){var ba=document.createElement("div");ba.innerHTML=this.sanitizeHtml(this.getLabel(F));for(var U=
ba.getElementsByTagName("a"),ca=!1,ea=0;ea<U.length;ea++)S=U[ea].getAttribute("href"),null!=S&&"data:action/json,"==S.substring(0,17)&&(U[ea].setAttribute("href",this.updateCustomLink(q,S)),ca=!0);ca&&this.labelChanged(F,ba.innerHTML)}};Graph.prototype.updateCustomLink=function(q,F){if("data:action/json,"==F.substring(0,17))try{var S=JSON.parse(F.substring(17));null!=S.actions&&(this.updateCustomLinkActions(q,S.actions),F="data:action/json,"+JSON.stringify(S))}catch(ba){}return F};Graph.prototype.updateCustomLinkActions=
function(q,F){for(var S=0;S<F.length;S++){var ba=F[S],U;for(U in ba)this.updateCustomLinkAction(q,ba[U],"cells"),this.updateCustomLinkAction(q,ba[U],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(q,F,S){if(null!=F&&null!=F[S]){for(var ba=[],U=0;U<F[S].length;U++)if("*"==F[S][U])ba.push(F[S][U]);else{var ca=q[F[S][U]];null!=ca?""!=ca&&ba.push(ca):ba.push(F[S][U])}F[S]=ba}};Graph.prototype.getCellsForAction=function(q,F){F=this.getCellsById(q.cells).concat(this.getCellsForTags(q.tags,
null,F));if(null!=q.excludeCells){for(var S=[],ba=0;ba<F.length;ba++)0>q.excludeCells.indexOf(F[ba].id)&&S.push(F[ba]);F=S}return F};Graph.prototype.getCellsById=function(q){var F=[];if(null!=q)for(var S=0;S<q.length;S++)if("*"==q[S]){var ba=this.model.getRoot();F=F.concat(this.model.filterDescendants(function(ca){return ca!=ba},ba))}else{var U=this.model.getCell(q[S]);null!=U&&F.push(U)}return F};var L=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(q){return L.apply(this,arguments)&&
!this.isAllTagsHidden(this.getTagsForCell(q))};Graph.prototype.setHiddenTags=function(q){this.hiddenTags=q;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(q){var F=mxUtils.indexOf(this.hiddenTags,q);0>F?this.hiddenTags.push(q):0<=F&&this.hiddenTags.splice(F,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(q){if(null==q||0==q.length||0==this.hiddenTags.length)return!1;q=q.split(" ");if(q.length>this.hiddenTags.length)return!1;
for(var F=0;F<q.length;F++)if(0>mxUtils.indexOf(this.hiddenTags,q[F]))return!1;return!0};Graph.prototype.getCellsForTags=function(q,F,S,ba){var U=[];if(null!=q){F=null!=F?F:this.model.getDescendants(this.model.getRoot());for(var ca=0,ea={},na=0;na<q.length;na++)0<q[na].length&&(ea[q[na]]=!0,ca++);for(na=0;na<F.length;na++)if(S&&this.model.getParent(F[na])==this.model.root||this.model.isVertex(F[na])||this.model.isEdge(F[na])){var ra=this.getTagsForCell(F[na]),ya=!1;if(0<ra.length&&(ra=ra.split(" "),
ra.length>=q.length)){for(var va=ya=0;va<ra.length&&ya<ca;va++)null!=ea[ra[va]]&&ya++;ya=ya==ca}ya&&(1!=ba||this.isCellVisible(F[na]))&&U.push(F[na])}}return U};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(q){for(var F=null,S=[],ba=0;ba<q.length;ba++){var U=this.getTagsForCell(q[ba]);S=[];if(0<U.length){U=U.split(" ");for(var ca={},ea=0;ea<U.length;ea++)if(null==F||null!=F[U[ea]])ca[U[ea]]=
!0,S.push(U[ea]);F=ca}else return[]}return S};Graph.prototype.getTagsForCells=function(q){for(var F=[],S={},ba=0;ba<q.length;ba++){var U=this.getTagsForCell(q[ba]);if(0<U.length){U=U.split(" ");for(var ca=0;ca<U.length;ca++)null==S[U[ca]]&&(S[U[ca]]=!0,F.push(U[ca]))}}return F};Graph.prototype.getTagsForCell=function(q){return this.getAttributeForCell(q,"tags","")};Graph.prototype.addTagsForCells=function(q,F){if(0<q.length&&0<F.length){this.model.beginUpdate();try{for(var S=0;S<q.length;S++){for(var ba=
this.getTagsForCell(q[S]),U=ba.split(" "),ca=!1,ea=0;ea<F.length;ea++){var na=mxUtils.trim(F[ea]);""!=na&&0>mxUtils.indexOf(U,na)&&(ba=0<ba.length?ba+" "+na:na,ca=!0)}ca&&this.setAttributeForCell(q[S],"tags",ba)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(q,F){if(0<q.length&&0<F.length){this.model.beginUpdate();try{for(var S=0;S<q.length;S++){var ba=this.getTagsForCell(q[S]);if(0<ba.length){for(var U=ba.split(" "),ca=!1,ea=0;ea<F.length;ea++){var na=mxUtils.indexOf(U,
F[ea]);0<=na&&(U.splice(na,1),ca=!0)}ca&&this.setAttributeForCell(q[S],"tags",U.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(q){this.model.beginUpdate();try{for(var F=0;F<q.length;F++)this.model.setVisible(q[F],!this.model.isVisible(q[F]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(q,F){this.model.beginUpdate();try{for(var S=0;S<q.length;S++)this.model.setVisible(q[S],F)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=
function(q,F,S,ba){for(var U=0;U<q.length;U++)this.highlightCell(q[U],F,S,ba)};Graph.prototype.highlightCell=function(q,F,S,ba,U){F=null!=F?F:mxConstants.DEFAULT_VALID_COLOR;S=null!=S?S:1E3;q=this.view.getState(q);var ca=null;null!=q&&(U=null!=U?U:4,U=Math.max(U+1,mxUtils.getValue(q.style,mxConstants.STYLE_STROKEWIDTH,1)+U),ca=new mxCellHighlight(this,F,U,!1),null!=ba&&(ca.opacity=ba),ca.highlight(q),window.setTimeout(function(){null!=ca.shape&&(mxUtils.setPrefixedStyle(ca.shape.node.style,"transition",
"all 1200ms ease-in-out"),ca.shape.node.style.opacity=0);window.setTimeout(function(){ca.destroy()},1200)},S));return ca};Graph.prototype.addSvgShadow=function(q,F,S,ba){S=null!=S?S:!1;ba=null!=ba?ba:!0;var U=q.ownerDocument,ca=null!=U.createElementNS?U.createElementNS(mxConstants.NS_SVG,"filter"):U.createElement("filter");ca.setAttribute("id",this.shadowId);var ea=null!=U.createElementNS?U.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):U.createElement("feGaussianBlur");ea.setAttribute("in",
"SourceAlpha");ea.setAttribute("stdDeviation",this.svgShadowBlur);ea.setAttribute("result","blur");ca.appendChild(ea);ea=null!=U.createElementNS?U.createElementNS(mxConstants.NS_SVG,"feOffset"):U.createElement("feOffset");ea.setAttribute("in","blur");ea.setAttribute("dx",this.svgShadowSize);ea.setAttribute("dy",this.svgShadowSize);ea.setAttribute("result","offsetBlur");ca.appendChild(ea);ea=null!=U.createElementNS?U.createElementNS(mxConstants.NS_SVG,"feFlood"):U.createElement("feFlood");ea.setAttribute("flood-color",
this.svgShadowColor);ea.setAttribute("flood-opacity",this.svgShadowOpacity);ea.setAttribute("result","offsetColor");ca.appendChild(ea);ea=null!=U.createElementNS?U.createElementNS(mxConstants.NS_SVG,"feComposite"):U.createElement("feComposite");ea.setAttribute("in","offsetColor");ea.setAttribute("in2","offsetBlur");ea.setAttribute("operator","in");ea.setAttribute("result","offsetBlur");ca.appendChild(ea);ea=null!=U.createElementNS?U.createElementNS(mxConstants.NS_SVG,"feBlend"):U.createElement("feBlend");
ea.setAttribute("in","SourceGraphic");ea.setAttribute("in2","offsetBlur");ca.appendChild(ea);ea=q.getElementsByTagName("defs");0==ea.length?(U=null!=U.createElementNS?U.createElementNS(mxConstants.NS_SVG,"defs"):U.createElement("defs"),null!=q.firstChild?q.insertBefore(U,q.firstChild):q.appendChild(U)):U=ea[0];U.appendChild(ca);S||(F=null!=F?F:q.getElementsByTagName("g")[0],null!=F&&(F.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(q.getAttribute("width")))&&ba&&(q.setAttribute("width",
parseInt(q.getAttribute("width"))+6),q.setAttribute("height",parseInt(q.getAttribute("height"))+6),F=q.getAttribute("viewBox"),null!=F&&0<F.length&&(F=F.split(" "),3<F.length&&(w=parseFloat(F[2])+6,h=parseFloat(F[3])+6,q.setAttribute("viewBox",F[0]+" "+F[1]+" "+w+" "+h))))));return ca};Graph.prototype.setShadowVisible=function(q,F){mxClient.IS_SVG&&!mxClient.IS_SF&&(F=null!=F?F:!0,(this.shadowVisible=q)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),
F&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var q=this.model.getChildCount(this.model.root),F=0;do var S=this.model.getChildAt(this.model.root,F);while(F++<q&&"1"==mxUtils.getValue(this.getCellStyle(S),"locked","0"));null!=S&&this.setDefaultParent(S)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=
[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+
"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=
[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=
[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",
STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=
[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=
[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=
[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+
"/ibm.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=
[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",
STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(q){var F=null;null!=q&&0<q.length&&("ER"==q.substring(0,2)?F="mxgraph.er":"sysML"==q.substring(0,
5)&&(F="mxgraph.sysml"));return F};var V=mxMarker.createMarker;mxMarker.createMarker=function(q,F,S,ba,U,ca,ea,na,ra,ya){if(null!=S&&null==mxMarker.markers[S]){var va=this.getPackageForType(S);null!=va&&mxStencilRegistry.getStencil(va)}return V.apply(this,arguments)};var T=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(q,F,S,ba,U,ca){"1"==mxUtils.getValue(F.style,"lineShape",null)&&q.setFillColor(mxUtils.getValue(F.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return T.apply(this,
arguments)};PrintDialog.prototype.create=function(q,F){function S(){pa.value=Math.max(1,Math.min(na,Math.max(parseInt(pa.value),parseInt(Da.value))));Da.value=Math.max(1,Math.min(na,Math.min(parseInt(pa.value),parseInt(Da.value))))}function ba(oa){function ta(Ya,Za,fb){var hb=Ya.useCssTransforms,qb=Ya.currentTranslate,kb=Ya.currentScale,ib=Ya.view.translate,ub=Ya.view.scale;Ya.useCssTransforms&&(Ya.useCssTransforms=!1,Ya.currentTranslate=new mxPoint(0,0),Ya.currentScale=1,Ya.view.translate=new mxPoint(0,
0),Ya.view.scale=1);var ob=Ya.getGraphBounds(),nb=0,wb=0,lb=za.get(),gb=1/Ya.pageScale,tb=Na.checked;if(tb){gb=parseInt(fa.value);var Cb=parseInt(la.value);gb=Math.min(lb.height*Cb/(ob.height/Ya.view.scale),lb.width*gb/(ob.width/Ya.view.scale))}else gb=parseInt(Oa.value)/(100*Ya.pageScale),isNaN(gb)&&(Ea=1/Ya.pageScale,Oa.value="100 %");lb=mxRectangle.fromRectangle(lb);lb.width=Math.ceil(lb.width*Ea);lb.height=Math.ceil(lb.height*Ea);gb*=Ea;!tb&&Ya.pageVisible?(ob=Ya.getPageLayout(),nb-=ob.x*lb.width,
wb-=ob.y*lb.height):tb=!0;if(null==Za){Za=PrintDialog.createPrintPreview(Ya,gb,lb,0,nb,wb,tb);Za.pageSelector=!1;Za.mathEnabled=!1;Aa.checked&&(Za.isCellVisible=function(pb){return Ya.isCellSelected(pb)});nb=q.getCurrentFile();null!=nb&&(Za.title=nb.getTitle());var xb=Za.writeHead;Za.writeHead=function(pb){xb.apply(this,arguments);mxClient.IS_GC&&(pb.writeln('<style type="text/css">'),pb.writeln("@media print {"),pb.writeln(".MathJax svg { shape-rendering: crispEdges; }"),pb.writeln("}"),pb.writeln("</style>"));
null!=q.editor.fontCss&&(pb.writeln('<style type="text/css">'),pb.writeln(q.editor.fontCss),pb.writeln("</style>"));for(var yb=Ya.getCustomFonts(),Ab=0;Ab<yb.length;Ab++){var c=yb[Ab].name,m=yb[Ab].url;Graph.isCssFontUrl(m)?pb.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(m)+'" charset="UTF-8" type="text/css">'):(pb.writeln('<style type="text/css">'),pb.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(c)+'";\nsrc: url("'+mxUtils.htmlEntities(m)+'");\n}'),pb.writeln("</style>"))}};
if("undefined"!==typeof MathJax){var zb=Za.renderPage;Za.renderPage=function(pb,yb,Ab,c,m,v){var n=mxClient.NO_FO,u=zb.apply(this,arguments);mxClient.NO_FO=n;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:u.className="geDisableMathJax";return u}}nb=null;wb=U.shapeForegroundColor;tb=U.shapeBackgroundColor;lb=U.enableFlowAnimation;U.enableFlowAnimation=!1;null!=U.themes&&"darkTheme"==U.defaultThemeName&&(nb=U.stylesheet,U.stylesheet=U.getDefaultStylesheet(),U.shapeForegroundColor="#000000",
U.shapeBackgroundColor="#ffffff",U.refresh());Za.open(null,null,fb,!0);U.enableFlowAnimation=lb;null!=nb&&(U.shapeForegroundColor=wb,U.shapeBackgroundColor=tb,U.stylesheet=nb,U.refresh())}else{lb=Ya.background;if(null==lb||""==lb||lb==mxConstants.NONE)lb="#ffffff";Za.backgroundColor=lb;Za.autoOrigin=tb;Za.appendGraph(Ya,gb,nb,wb,fb,!0);fb=Ya.getCustomFonts();if(null!=Za.wnd)for(nb=0;nb<fb.length;nb++)wb=fb[nb].name,tb=fb[nb].url,Graph.isCssFontUrl(tb)?Za.wnd.document.writeln('<link rel="stylesheet" href="'+
mxUtils.htmlEntities(tb)+'" charset="UTF-8" type="text/css">'):(Za.wnd.document.writeln('<style type="text/css">'),Za.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(wb)+'";\nsrc: url("'+mxUtils.htmlEntities(tb)+'");\n}'),Za.wnd.document.writeln("</style>"))}hb&&(Ya.useCssTransforms=hb,Ya.currentTranslate=qb,Ya.currentScale=kb,Ya.view.translate=ib,Ya.view.scale=ub);return Za}var Ea=parseInt(ua.value)/100;isNaN(Ea)&&(Ea=1,ua.value="100 %");Ea*=.75;var Fa=null,Pa=U.shapeForegroundColor,
Ra=U.shapeBackgroundColor;null!=U.themes&&"darkTheme"==U.defaultThemeName&&(Fa=U.stylesheet,U.stylesheet=U.getDefaultStylesheet(),U.shapeForegroundColor="#000000",U.shapeBackgroundColor="#ffffff",U.refresh());var Ca=Da.value,Ja=pa.value,Qa=!ya.checked,$a=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(q,ya.checked,Ca,Ja,Na.checked,fa.value,la.value,parseInt(Oa.value)/100,parseInt(ua.value)/100,za.get());else{Qa&&(Qa=Aa.checked||Ca==ra&&Ja==ra);if(!Qa&&null!=q.pages&&q.pages.length){var eb=
0;Qa=q.pages.length-1;ya.checked||(eb=parseInt(Ca)-1,Qa=parseInt(Ja)-1);for(var cb=eb;cb<=Qa;cb++){var db=q.pages[cb];Ca=db==q.currentPage?U:null;if(null==Ca){Ca=q.createTemporaryGraph(U.stylesheet);Ca.shapeForegroundColor=U.shapeForegroundColor;Ca.shapeBackgroundColor=U.shapeBackgroundColor;Ja=!0;eb=!1;var rb=null,mb=null;null==db.viewState&&null==db.root&&q.updatePageRoot(db);null!=db.viewState&&(Ja=db.viewState.pageVisible,eb=db.viewState.mathEnabled,rb=db.viewState.background,mb=db.viewState.backgroundImage,
Ca.extFonts=db.viewState.extFonts);null!=mb&&null!=mb.originalSrc&&(mb=q.createImageForPageLink(mb.originalSrc,db));Ca.background=rb;Ca.backgroundImage=null!=mb?new mxImage(mb.src,mb.width,mb.height,mb.x,mb.y):null;Ca.pageVisible=Ja;Ca.mathEnabled=eb;var vb=Ca.getGraphBounds;Ca.getGraphBounds=function(){var Ya=vb.apply(this,arguments),Za=this.backgroundImage;if(null!=Za&&null!=Za.width&&null!=Za.height){var fb=this.view.translate,hb=this.view.scale;Ya=mxRectangle.fromRectangle(Ya);Ya.add(new mxRectangle((fb.x+
Za.x)*hb,(fb.y+Za.y)*hb,Za.width*hb,Za.height*hb))}return Ya};var Bb=Ca.getGlobalVariable;Ca.getGlobalVariable=function(Ya){return"page"==Ya?db.getName():"pagenumber"==Ya?cb+1:"pagecount"==Ya?null!=q.pages?q.pages.length:1:Bb.apply(this,arguments)};document.body.appendChild(Ca.container);q.updatePageRoot(db);Ca.model.setRoot(db.root)}$a=ta(Ca,$a,cb!=Qa);Ca!=U&&Ca.container.parentNode.removeChild(Ca.container)}}else $a=ta(U);null==$a?q.handleError({message:mxResources.get("errorUpdatingPreview")}):
($a.mathEnabled&&(Qa=$a.wnd.document,oa&&($a.wnd.IMMEDIATE_PRINT=!0),Qa.writeln('<script type="text/javascript" src="'+DRAWIO_BASE_URL+'/js/math-print.js">\x3c/script>')),$a.closeDocument(),!$a.mathEnabled&&oa&&PrintDialog.printPreview($a));null!=Fa&&(U.shapeForegroundColor=Pa,U.shapeBackgroundColor=Ra,U.stylesheet=Fa,U.refresh())}}var U=q.editor.graph,ca=document.createElement("div"),ea=document.createElement("h3");ea.style.width="100%";ea.style.textAlign="center";ea.style.marginTop="0px";mxUtils.write(ea,
F||mxResources.get("print"));ca.appendChild(ea);var na=1,ra=1;ea=document.createElement("div");ea.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var ya=document.createElement("input");ya.style.cssText="margin-right:8px;margin-bottom:8px;";ya.setAttribute("value","all");ya.setAttribute("type","radio");ya.setAttribute("name","pages-printdialog");ea.appendChild(ya);F=document.createElement("span");mxUtils.write(F,mxResources.get("printAllPages"));ea.appendChild(F);
mxUtils.br(ea);var va=ya.cloneNode(!0);ya.setAttribute("checked","checked");va.setAttribute("value","range");ea.appendChild(va);F=document.createElement("span");mxUtils.write(F,mxResources.get("pages")+":");ea.appendChild(F);var Da=document.createElement("input");Da.style.cssText="margin:0 8px 0 8px;";Da.setAttribute("value","1");Da.setAttribute("type","number");Da.setAttribute("min","1");Da.style.width="50px";ea.appendChild(Da);F=document.createElement("span");mxUtils.write(F,mxResources.get("to"));
ea.appendChild(F);var pa=Da.cloneNode(!0);ea.appendChild(pa);mxEvent.addListener(Da,"focus",function(){va.checked=!0});mxEvent.addListener(pa,"focus",function(){va.checked=!0});mxEvent.addListener(Da,"change",S);mxEvent.addListener(pa,"change",S);if(null!=q.pages&&(na=q.pages.length,null!=q.currentPage))for(F=0;F<q.pages.length;F++)if(q.currentPage==q.pages[F]){ra=F+1;Da.value=ra;pa.value=ra;break}Da.setAttribute("max",na);pa.setAttribute("max",na);q.isPagesEnabled()?1<na&&(ca.appendChild(ea),va.checked=
!0):va.checked=!0;mxUtils.br(ea);var Aa=document.createElement("input");Aa.setAttribute("value","all");Aa.setAttribute("type","radio");Aa.style.marginRight="8px";U.isSelectionEmpty()&&Aa.setAttribute("disabled","disabled");var xa=document.createElement("div");xa.style.marginBottom="10px";1==na?(Aa.setAttribute("type","checkbox"),Aa.style.marginBottom="12px",xa.appendChild(Aa)):(Aa.setAttribute("name","pages-printdialog"),Aa.style.marginBottom="8px",ea.appendChild(Aa));F=document.createElement("span");
mxUtils.write(F,mxResources.get("selectionOnly"));Aa.parentNode.appendChild(F);1==na&&mxUtils.br(Aa.parentNode);var Ma=document.createElement("input");Ma.style.marginRight="8px";Ma.setAttribute("value","adjust");Ma.setAttribute("type","radio");Ma.setAttribute("name","printZoom");xa.appendChild(Ma);F=document.createElement("span");mxUtils.write(F,mxResources.get("adjustTo"));xa.appendChild(F);var Oa=document.createElement("input");Oa.style.cssText="margin:0 8px 0 8px;";Oa.setAttribute("value","100 %");
Oa.style.width="50px";xa.appendChild(Oa);mxEvent.addListener(Oa,"focus",function(){Ma.checked=!0});ca.appendChild(xa);ea=ea.cloneNode(!1);var Na=Ma.cloneNode(!0);Na.setAttribute("value","fit");Ma.setAttribute("checked","checked");F=document.createElement("div");F.style.cssText="display:inline-block;vertical-align:top;padding-top:2px;";F.appendChild(Na);ea.appendChild(F);xa=document.createElement("table");xa.style.display="inline-block";var La=document.createElement("tbody"),Ba=document.createElement("tr"),
ab=Ba.cloneNode(!0),Xa=document.createElement("td"),x=Xa.cloneNode(!0),H=Xa.cloneNode(!0),P=Xa.cloneNode(!0),X=Xa.cloneNode(!0),Z=Xa.cloneNode(!0);Xa.style.textAlign="right";P.style.textAlign="right";mxUtils.write(Xa,mxResources.get("fitTo"));var fa=document.createElement("input");fa.style.cssText="margin:0 8px 0 8px;";fa.setAttribute("value","1");fa.setAttribute("min","1");fa.setAttribute("type","number");fa.style.width="40px";x.appendChild(fa);F=document.createElement("span");mxUtils.write(F,mxResources.get("fitToSheetsAcross"));
H.appendChild(F);mxUtils.write(P,mxResources.get("fitToBy"));var la=fa.cloneNode(!0);X.appendChild(la);mxEvent.addListener(fa,"focus",function(){Na.checked=!0});mxEvent.addListener(la,"focus",function(){Na.checked=!0});F=document.createElement("span");mxUtils.write(F,mxResources.get("fitToSheetsDown"));Z.appendChild(F);Ba.appendChild(Xa);Ba.appendChild(x);Ba.appendChild(H);ab.appendChild(P);ab.appendChild(X);ab.appendChild(Z);La.appendChild(Ba);La.appendChild(ab);xa.appendChild(La);ea.appendChild(xa);
ca.appendChild(ea);ea=document.createElement("div");F=document.createElement("div");F.style.fontWeight="bold";F.style.marginBottom="12px";mxUtils.write(F,mxResources.get("paperSize"));ea.appendChild(F);F=document.createElement("div");F.style.marginBottom="12px";var za=PageSetupDialog.addPageFormatPanel(F,"printdialog",q.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);ea.appendChild(F);F=document.createElement("span");mxUtils.write(F,mxResources.get("pageScale"));ea.appendChild(F);var ua=
document.createElement("input");ua.style.cssText="margin:0 8px 0 8px;";ua.setAttribute("value","100 %");ua.style.width="60px";ea.appendChild(ua);ca.appendChild(ea);F=document.createElement("div");F.style.cssText="text-align:right;margin:48px 0 0 0;";ea=mxUtils.button(mxResources.get("cancel"),function(){q.hideDialog()});ea.className="geBtn";q.editor.cancelFirst&&F.appendChild(ea);q.isOffline()||(xa=mxUtils.button(mxResources.get("help"),function(){U.openLink("https://www.diagrams.net/doc/faq/print-diagram")}),
xa.className="geBtn",F.appendChild(xa));PrintDialog.previewEnabled&&(xa=mxUtils.button(mxResources.get("preview"),function(){q.hideDialog();ba(!1)}),xa.className="geBtn",F.appendChild(xa));xa=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){q.hideDialog();ba(!0)});xa.className="geBtn gePrimaryBtn";F.appendChild(xa);q.editor.cancelFirst||F.appendChild(ea);ca.appendChild(F);this.container=ca};var Y=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=
function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var q=this.image;null!=q&&null!=q.src&&Graph.isPageLink(q.src)&&(q={originalSrc:q.src});this.page.viewState.backgroundImage=q}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=
this.shadowVisible)}}else Y.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var W=document.createElement("canvas"),ka=new Image;ka.onload=function(){try{W.getContext("2d").drawImage(ka,
0,0);var q=W.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=q&&6<q.length}catch(F){}};ka.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(q){}Editor.prototype.useCanvasForExport=!1})();
(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);b.beforeDecode=function(d,g,l){l.ui=d.ui;return g};b.afterDecode=function(d,g,l){l.previousColor=l.color;l.previousImage=l.image;l.previousFormat=l.format;null!=l.foldingEnabled&&(l.foldingEnabled=!l.foldingEnabled);null!=l.mathEnabled&&(l.mathEnabled=!l.mathEnabled);null!=l.shadowVisible&&(l.shadowVisible=!l.shadowVisible);return l};mxCodecRegistry.register(b)})();
(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(d,g,l){l.ui=d.ui;return g};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="20.3.3";EditorUi.compactUi="atlas"!=uiTheme;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=
null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&
"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.diagrams.net/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,
mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.logError=function(e,f,k,z,t,B,I){B=null!=B?B:0<=e.indexOf("NetworkError")||0<=e.indexOf("SecurityError")||0<=e.indexOf("NS_ERROR_FAILURE")||0<=e.indexOf("out of memory")?"CONFIG":"SEVERE";if(EditorUi.enableLogging&&
"1"!=urlParams.dev)try{if(e!=EditorUi.lastErrorMessage&&(null==e||null==f||-1==e.indexOf("Script error")&&-1==e.indexOf("extension"))&&null!=e&&0>e.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=e;var O=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";t=null!=t?t:Error(e);(new Image).src=O+"/log?severity="+B+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(e)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=z?":colno:"+
encodeURIComponent(z):"")+(null!=t&&null!=t.stack?"&stack="+encodeURIComponent(t.stack):"")}}catch(J){}try{I||null==window.console||console.error(B,e,f,k,z,t)}catch(J){}};EditorUi.logEvent=function(e){if("1"==urlParams.dev)EditorUi.debug("logEvent",e);else if(EditorUi.enableLogging)try{var f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=e?"&data="+encodeURIComponent(JSON.stringify(e)):"")}catch(k){}};EditorUi.sendReport=
function(e,f){if("1"==urlParams.dev)EditorUi.debug("sendReport",e);else if(EditorUi.enableLogging)try{f=null!=f?f:5E4,e.length>f&&(e=e.substring(0,f)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(e))}catch(k){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var e=[(new Date).toISOString()],f=0;f<arguments.length;f++)e.push(arguments[f]);console.log.apply(console,
e)}}catch(k){}};EditorUi.removeChildNodes=function(e){for(;null!=e.firstChild;)e.removeChild(e.firstChild)};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.sidebarFooterHeight=38;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";
EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=
!0;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var e=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!e.getContext||!e.getContext("2d"))}catch(t){}try{var f=document.createElement("canvas"),k=new Image;k.onload=function(){try{f.getContext("2d").drawImage(k,0,0);var t=
f.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=t&&6<t.length}catch(B){}};k.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(t){}try{f=document.createElement("canvas");f.width=f.height=1;var z=f.toDataURL("image/jpeg");
EditorUi.prototype.jpgSupported=null!==z.match("image/jpeg")}catch(t){}})();EditorUi.prototype.openLink=function(e,f,k){return this.editor.graph.openLink(e,f,k)};EditorUi.prototype.showSplash=function(e){};EditorUi.prototype.getLocalData=function(e,f){f(localStorage.getItem(e))};EditorUi.prototype.setLocalData=function(e,f,k){localStorage.setItem(e,f);null!=k&&k()};EditorUi.prototype.removeLocalData=function(e,f){localStorage.removeItem(e);f()};EditorUi.prototype.setShareCursorPosition=function(e){this.shareCursorPosition=
e;this.fireEvent(new mxEventObject("shareCursorPositionChanged"))};EditorUi.prototype.isShareCursorPosition=function(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(e){this.showRemoteCursors=e;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(e){this.editor.graph.mathEnabled=e;this.editor.updateGraphComponents();this.editor.graph.refresh();
this.editor.graph.defaultMathEnabled=e;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(e){return this.editor.graph.mathEnabled};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(e){return this.isOfflineApp()||!navigator.onLine||!e&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};
EditorUi.prototype.createSpinner=function(e,f,k){var z=null==e||null==f;k=null!=k?k:24;var t=new Spinner({lines:12,length:k,width:Math.round(k/3),radius:Math.round(k/2),rotate:0,color:Editor.isDarkMode()?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),B=t.spin;t.spin=function(O,J){var y=!1;this.active||(B.call(this,O),this.active=!0,null!=J&&(z&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,e=document.body.clientWidth/2-2),y=document.createElement("div"),
y.style.position="absolute",y.style.whiteSpace="nowrap",y.style.background="#4B4243",y.style.color="white",y.style.fontFamily=Editor.defaultHtmlFont,y.style.fontSize="9pt",y.style.padding="6px",y.style.paddingLeft="10px",y.style.paddingRight="10px",y.style.zIndex=2E9,y.style.left=Math.max(0,e)+"px",y.style.top=Math.max(0,f+70)+"px",mxUtils.setPrefixedStyle(y.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(y.style,"transform","translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(y.style,
"boxShadow","2px 2px 3px 0px #ddd"),"..."!=J.substring(J.length-3,J.length)&&"!"!=J.charAt(J.length-1)&&(J+="..."),y.innerHTML=J,O.appendChild(y),t.status=y),this.pause=mxUtils.bind(this,function(){var ia=function(){};this.active&&(ia=mxUtils.bind(this,function(){this.spin(O,J)}));this.stop();return ia}),y=!0);return y};var I=t.stop;t.stop=function(){I.call(this);this.active=!1;null!=t.status&&null!=t.status.parentNode&&t.status.parentNode.removeChild(t.status);t.status=null};t.pause=function(){return function(){}};
return t};EditorUi.prototype.isCompatibleString=function(e){try{var f=mxUtils.parseXml(e),k=this.editor.extractGraphModel(f.documentElement,!0);return null!=k&&0==k.getElementsByTagName("parsererror").length}catch(z){}return!1};EditorUi.prototype.isVisioData=function(e){return 8<e.length&&(208==e.charCodeAt(0)&&207==e.charCodeAt(1)&&17==e.charCodeAt(2)&&224==e.charCodeAt(3)&&161==e.charCodeAt(4)&&177==e.charCodeAt(5)&&26==e.charCodeAt(6)&&225==e.charCodeAt(7)||80==e.charCodeAt(0)&&75==e.charCodeAt(1)&&
3==e.charCodeAt(2)&&4==e.charCodeAt(3)||80==e.charCodeAt(0)&&75==e.charCodeAt(1)&&3==e.charCodeAt(2)&&6==e.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(e){return 8<e.length&&(208==e.charCodeAt(0)&&207==e.charCodeAt(1)&&17==e.charCodeAt(2)&&224==e.charCodeAt(3)&&161==e.charCodeAt(4)&&177==e.charCodeAt(5)&&26==e.charCodeAt(6)&&225==e.charCodeAt(7)||60==e.charCodeAt(0)&&63==e.charCodeAt(1)&&120==e.charCodeAt(2)&&109==e.charCodeAt(3)&&108==e.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;
EditorUi.prototype.createKeyHandler=function(e){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=f.getFunction,z=this.editor.graph,t=this;f.getFunction=function(B){if(z.isSelectionEmpty()&&null!=t.pages&&0<t.pages.length){var I=t.getSelectedPageIndex();if(mxEvent.isShiftDown(B)){if(37==B.keyCode)return function(){0<I&&t.movePage(I,I-1)};if(38==B.keyCode)return function(){0<I&&t.movePage(I,0)};if(39==B.keyCode)return function(){I<t.pages.length-1&&t.movePage(I,
I+1)};if(40==B.keyCode)return function(){I<t.pages.length-1&&t.movePage(I,t.pages.length-1)}}else if(mxEvent.isControlDown(B)||mxClient.IS_MAC&&mxEvent.isMetaDown(B)){if(37==B.keyCode)return function(){0<I&&t.selectNextPage(!1)};if(38==B.keyCode)return function(){0<I&&t.selectPage(t.pages[0])};if(39==B.keyCode)return function(){I<t.pages.length-1&&t.selectNextPage(!0)};if(40==B.keyCode)return function(){I<t.pages.length-1&&t.selectPage(t.pages[t.pages.length-1])}}}return!(65<=B.keyCode&&90>=B.keyCode)||
z.isSelectionEmpty()||mxEvent.isAltDown(B)||mxEvent.isShiftDown(B)||mxEvent.isControlDown(B)||mxClient.IS_MAC&&mxEvent.isMetaDown(B)?k.apply(this,arguments):null}}return f};var d=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(e){var f=d.apply(this,arguments);if(null==f)try{var k=e.indexOf("&lt;mxfile ");if(0<=k){var z=e.lastIndexOf("&lt;/mxfile&gt;");z>k&&(f=e.substring(k,z+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,
""))}else{var t=mxUtils.parseXml(e),B=this.editor.extractGraphModel(t.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=B?mxUtils.getXml(B):""}}catch(I){}return f};EditorUi.prototype.validateFileData=function(e){if(null!=e&&0<e.length){var f=e.indexOf('<meta charset="utf-8">');0<=f&&(e=e.slice(0,f)+'<meta charset="utf-8"/>'+e.slice(f+23-1,e.length));e=Graph.zapGremlins(e)}return e};EditorUi.prototype.replaceFileData=function(e){e=this.validateFileData(e);
e=null!=e&&0<e.length?mxUtils.parseXml(e).documentElement:null;var f=null!=e?this.editor.extractGraphModel(e,!0):null;null!=f&&(e=f);if(null!=e){f=this.editor.graph;f.model.beginUpdate();try{var k=null!=this.pages?this.pages.slice():null,z=e.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<z.length||1==z.length&&z[0].hasAttribute("name")){this.fileNode=e;this.pages=null!=this.pages?this.pages:[];for(var t=z.length-1;0<=t;t--){var B=this.updatePageRoot(new DiagramPage(z[t]));null==B.getName()&&
B.setName(mxResources.get("pageWithNumber",[t+1]));f.model.execute(new ChangePage(this,B,0==t?B:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=e.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(e.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),f.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(e),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);
if(null!=k)for(t=0;t<k.length;t++)f.model.execute(new ChangePage(this,k[t],null))}finally{f.model.endUpdate()}}};EditorUi.prototype.createFileData=function(e,f,k,z,t,B,I,O,J,y,ia){f=null!=f?f:this.editor.graph;t=null!=t?t:!1;J=null!=J?J:!0;var da=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var ja="_blank";else da=ja=z;if(null==e)return"";var aa=e;if("mxfile"!=aa.nodeName.toLowerCase()){if(ia){var qa=e.ownerDocument.createElement("diagram");qa.setAttribute("id",Editor.guid());
qa.appendChild(e)}else{qa=Graph.zapGremlins(mxUtils.getXml(e));aa=Graph.compress(qa);if(Graph.decompress(aa)!=qa)return qa;qa=e.ownerDocument.createElement("diagram");qa.setAttribute("id",Editor.guid());mxUtils.setTextContent(qa,aa)}aa=e.ownerDocument.createElement("mxfile");aa.appendChild(qa)}y?(aa=aa.cloneNode(!0),aa.removeAttribute("modified"),aa.removeAttribute("host"),aa.removeAttribute("agent"),aa.removeAttribute("etag"),aa.removeAttribute("userAgent"),aa.removeAttribute("version"),aa.removeAttribute("editor"),
aa.removeAttribute("type")):(aa.removeAttribute("userAgent"),aa.removeAttribute("version"),aa.removeAttribute("editor"),aa.removeAttribute("pages"),aa.removeAttribute("type"),mxClient.IS_CHROMEAPP?aa.setAttribute("host","Chrome"):EditorUi.isElectronApp?aa.setAttribute("host","Electron"):aa.setAttribute("host",window.location.hostname),aa.setAttribute("modified",(new Date).toISOString()),aa.setAttribute("agent",navigator.appVersion),aa.setAttribute("version",EditorUi.VERSION),aa.setAttribute("etag",
Editor.guid()),e=null!=k?k.getMode():this.mode,null!=e&&aa.setAttribute("type",e),1<aa.getElementsByTagName("diagram").length&&null!=this.pages&&aa.setAttribute("pages",this.pages.length));ia=ia?mxUtils.getPrettyXml(aa):mxUtils.getXml(aa);if(!B&&!t&&(I||null!=k&&/(\.html)$/i.test(k.getTitle())))ia=this.getHtml2(mxUtils.getXml(aa),f,null!=k?k.getTitle():null,ja,da);else if(B||!t&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(z=null),
ia=this.getEmbeddedSvg(ia,f,z,null,O,J,da);return ia};EditorUi.prototype.getXmlFileData=function(e,f,k,z){e=null!=e?e:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.compressXml;var t=this.editor.getGraphXml(e,z);if(e&&null!=this.fileNode&&null!=this.currentPage)if(e=function(J){var y=J.getElementsByTagName("mxGraphModel");y=0<y.length?y[0]:null;null==y&&k?(y=mxUtils.trim(mxUtils.getTextContent(J)),J=J.cloneNode(!1),0<y.length&&(y=Graph.decompress(y),null!=y&&0<y.length&&J.appendChild(mxUtils.parseXml(y).documentElement))):
null==y||k?J=J.cloneNode(!0):(J=J.cloneNode(!1),mxUtils.setTextContent(J,Graph.compressNode(y)));t.appendChild(J)},EditorUi.removeChildNodes(this.currentPage.node),mxUtils.setTextContent(this.currentPage.node,Graph.compressNode(t)),t=this.fileNode.cloneNode(!1),f)e(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var B=this.pages[f],I=B.node;if(B!=this.currentPage)if(B.needsUpdate){var O=new mxCodec(mxUtils.createXmlDocument());O=O.encode(new mxGraphModel(B.root));this.editor.graph.saveViewState(B.viewState,
O,null,z);EditorUi.removeChildNodes(I);mxUtils.setTextContent(I,Graph.compressNode(O));delete B.needsUpdate}else z&&(this.updatePageRoot(B),null!=B.viewState.backgroundImage&&(null!=B.viewState.backgroundImage.originalSrc?B.viewState.backgroundImage=this.createImageForPageLink(B.viewState.backgroundImage.originalSrc,B):Graph.isPageLink(B.viewState.backgroundImage.src)&&(B.viewState.backgroundImage=this.createImageForPageLink(B.viewState.backgroundImage.src,B))),null!=B.viewState.backgroundImage&&
null!=B.viewState.backgroundImage.originalSrc&&(O=new mxCodec(mxUtils.createXmlDocument()),O=O.encode(new mxGraphModel(B.root)),this.editor.graph.saveViewState(B.viewState,O,null,z),I=I.cloneNode(!1),mxUtils.setTextContent(I,Graph.compressNode(O))));e(I)}return t};EditorUi.prototype.anonymizeString=function(e,f){for(var k=[],z=0;z<e.length;z++){var t=e.charAt(z);0<=EditorUi.ignoredAnonymizedChars.indexOf(t)?k.push(t):isNaN(parseInt(t))?t.toLowerCase()!=t?k.push(String.fromCharCode(65+Math.round(25*
Math.random()))):t.toUpperCase()!=t?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(t)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizePatch=function(e){if(null!=e[EditorUi.DIFF_INSERT])for(var f=0;f<e[EditorUi.DIFF_INSERT].length;f++)try{var k=mxUtils.parseXml(e[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));
e[EditorUi.DIFF_INSERT][f].data=mxUtils.getXml(k)}catch(B){e[EditorUi.DIFF_INSERT][f].data=B.message}if(null!=e[EditorUi.DIFF_UPDATE]){for(var z in e[EditorUi.DIFF_UPDATE]){var t=e[EditorUi.DIFF_UPDATE][z];null!=t.name&&(t.name=this.anonymizeString(t.name));null!=t.cells&&(f=mxUtils.bind(this,function(B){var I=t.cells[B];if(null!=I){for(var O in I)null!=I[O].value&&(I[O].value="["+I[O].value.length+"]"),null!=I[O].xmlValue&&(I[O].xmlValue="["+I[O].xmlValue.length+"]"),null!=I[O].style&&(I[O].style=
"["+I[O].style.length+"]"),mxUtils.isEmptyObject(I[O])&&delete I[O];mxUtils.isEmptyObject(I)&&delete t.cells[B]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(t.cells)&&delete t.cells);mxUtils.isEmptyObject(t)&&delete e[EditorUi.DIFF_UPDATE][z]}mxUtils.isEmptyObject(e[EditorUi.DIFF_UPDATE])&&delete e[EditorUi.DIFF_UPDATE]}return e};EditorUi.prototype.anonymizeAttributes=function(e,f){if(null!=e.attributes)for(var k=0;k<e.attributes.length;k++)"as"!=e.attributes[k].name&&
e.setAttribute(e.attributes[k].name,this.anonymizeString(e.attributes[k].value,f));if(null!=e.childNodes)for(k=0;k<e.childNodes.length;k++)this.anonymizeAttributes(e.childNodes[k],f)};EditorUi.prototype.anonymizeNode=function(e,f){f=e.getElementsByTagName("mxCell");for(var k=0;k<f.length;k++)null!=f[k].getAttribute("value")&&f[k].setAttribute("value","["+f[k].getAttribute("value").length+"]"),null!=f[k].getAttribute("xmlValue")&&f[k].setAttribute("xmlValue","["+f[k].getAttribute("xmlValue").length+
"]"),null!=f[k].getAttribute("style")&&f[k].setAttribute("style","["+f[k].getAttribute("style").length+"]"),null!=f[k].parentNode&&"root"!=f[k].parentNode.nodeName&&null!=f[k].parentNode.parentNode&&(f[k].setAttribute("id",f[k].parentNode.getAttribute("id")),f[k].parentNode.parentNode.replaceChild(f[k],f[k].parentNode));return e};EditorUi.prototype.synchronizeCurrentFile=function(e){var f=this.getCurrentFile();null!=f&&(f.savingFile?this.handleError({message:mxResources.get("busy")}):!e&&f.invalidChecksum?
f.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(f.clearAutosave(),this.editor.setStatus(""),e?f.reloadFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){f.handleFileError(k,!0)})):f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){f.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(e,f,k,z,t,B,I,
O,J,y,ia){t=null!=t?t:!0;B=null!=B?B:!1;var da=this.editor.graph;if(f||!e&&null!=J&&/(\.svg)$/i.test(J.getTitle())){var ja=null!=da.themes&&"darkTheme"==da.defaultThemeName;y=!1;if(ja||null!=this.pages&&this.currentPage!=this.pages[0]){var aa=da.getGlobalVariable;da=this.createTemporaryGraph(ja?da.getDefaultStylesheet():da.getStylesheet());da.setBackgroundImage=this.editor.graph.setBackgroundImage;da.background=this.editor.graph.background;var qa=this.pages[0];this.currentPage==qa?da.setBackgroundImage(this.editor.graph.backgroundImage):
null!=qa.viewState&&null!=qa.viewState&&da.setBackgroundImage(qa.viewState.backgroundImage);da.getGlobalVariable=function(sa){return"page"==sa?qa.getName():"pagenumber"==sa?1:aa.apply(this,arguments)};document.body.appendChild(da.container);da.model.setRoot(qa.root)}}I=null!=I?I:this.getXmlFileData(t,B,y,ia);J=null!=J?J:this.getCurrentFile();e=this.createFileData(I,da,J,window.location.href,e,f,k,z,t,O,y);da!=this.editor.graph&&da.container.parentNode.removeChild(da.container);return e};EditorUi.prototype.getHtml=
function(e,f,k,z,t,B){B=null!=B?B:!0;var I=null,O=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){I=B?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var J=f.view.scale;B=Math.floor(I.x/J-f.view.translate.x);J=Math.floor(I.y/J-f.view.translate.y);I=f.background;null==t&&(f=this.getBasenames().join(";"),0<f.length&&(O=EditorUi.drawHost+"/embed.js?s="+f));e.setAttribute("x0",B);e.setAttribute("y0",J)}null!=e&&(e.setAttribute("pan","1"),e.setAttribute("zoom","1"),e.setAttribute("resize",
"0"),e.setAttribute("fit","0"),e.setAttribute("border","20"),e.setAttribute("links","1"),null!=z&&e.setAttribute("edit",z));null!=t&&(t=t.replace(/&/g,"&amp;"));e=null!=e?Graph.zapGremlins(mxUtils.getXml(e)):"";z=Graph.compress(e);Graph.decompress(z)!=e&&(z=encodeURIComponent(e));return(null==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=t?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==t?null!=k?
"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>diagrams.net</title>\n")+(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\n":"")+"</head>\n<body"+(null==t&&null!=I&&I!=mxConstants.NONE?' style="background-color:'+I+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+z+"</div>\n</div>\n"+(null==t?'<script type="text/javascript" src="'+O+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+
t+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(e,f,k,z,t){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=t&&(t=t.replace(/&/g,"&amp;"));e={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(e),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(e.page=mxUtils.indexOf(this.pages,this.currentPage));
return(null==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=t?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==t?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>diagrams.net</title>\n")+(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+
mxUtils.htmlEntities(JSON.stringify(e))+'"></div>\n'+(null==t?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(e){e=this.validateFileData(e);this.pages=this.fileNode=this.currentPage=null;var f=null!=e&&0<e.length?mxUtils.parseXml(e).documentElement:
null,k=Editor.extractParserError(f,mxResources.get("invalidOrMissingFile"));if(k)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[e],"node",[f],"cause",[k]),Error(mxResources.get("notADiagramFile")+" ("+k+")");e=null!=f?this.editor.extractGraphModel(f,!0):null;null!=e&&(f=e);if(null!=f&&"mxfile"==f.nodeName&&(e=f.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<e.length||1==e.length&&e[0].hasAttribute("name"))){k=null;this.fileNode=f;this.pages=[];for(var z=0;z<e.length;z++)null==
e[z].getAttribute("id")&&e[z].setAttribute("id",z),f=new DiagramPage(e[z]),null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[z+1])),this.pages.push(f),null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]&&(k=f);this.currentPage=null!=k?k:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];f=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=f&&(this.fileNode=f.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(f.ownerDocument.createElement("diagram")),
this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=urlParams["layer-ids"])try{var t=urlParams["layer-ids"].split(" ");f={};for(z=0;z<t.length;z++)f[t[z]]=!0;var B=this.editor.graph.getModel(),I=B.getChildren(B.root);for(z=0;z<I.length;z++){var O=I[z];B.setVisible(O,f[O.id]||!1)}}catch(J){}};EditorUi.prototype.getBaseFilename=function(e){var f=
this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!e&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=
function(e,f,k,z,t,B,I,O,J,y,ia,da){try{z=null!=z?z:this.editor.graph.isSelectionEmpty();var ja=this.getBaseFilename("remoteSvg"==e?!1:!t),aa=ja+("xml"==e||"pdf"==e&&ia?".drawio":"")+"."+e;if("xml"==e){var qa=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,z,t,null,null,null,f);this.saveData(aa,e,qa,"text/xml")}else if("html"==e)qa=this.getHtml2(this.getFileData(!0),this.editor.graph,ja),this.saveData(aa,e,qa,"text/html");else if("svg"!=e&&"xmlsvg"!=e||!this.spinner.spin(document.body,
mxResources.get("export"))){if("xmlpng"==e)aa=ja+".png";else if("jpeg"==e)aa=ja+".jpg";else if("remoteSvg"==e){aa=ja+".svg";e="svg";var sa=parseInt(J);"string"===typeof O&&0<O.indexOf("%")&&(O=parseInt(O)/100);if(0<sa){var L=this.editor.graph,V=L.getGraphBounds();var T=Math.ceil(V.width*O/L.view.scale+2*sa);var Y=Math.ceil(V.height*O/L.view.scale+2*sa)}}this.saveRequest(aa,e,mxUtils.bind(this,function(S,ba){try{var U=this.editor.graph.pageVisible;0==B&&(this.editor.graph.pageVisible=B);var ca=this.createDownloadRequest(S,
e,z,ba,I,t,O,J,y,ia,da,T,Y);this.editor.graph.pageVisible=U;return ca}catch(ea){this.handleError(ea)}}))}else{var W=null,ka=mxUtils.bind(this,function(S){S.length<=MAX_REQUEST_SIZE?this.saveData(aa,"svg",S,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(W)}))});if("svg"==e){var q=this.editor.graph.background;if(I||q==mxConstants.NONE)q=null;var F=this.editor.graph.getSvg(q,null,null,null,null,z);k&&
this.editor.graph.addSvgShadow(F);this.editor.convertImages(F,mxUtils.bind(this,mxUtils.bind(this,function(S){this.spinner.stop();ka(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(S))})))}else aa=ja+".svg",W=this.getFileData(!1,!0,null,mxUtils.bind(this,function(S){this.spinner.stop();ka(S)}),z)}}catch(S){this.handleError(S)}};EditorUi.prototype.createDownloadRequest=function(e,f,k,z,t,B,I,O,J,y,ia,da,ja){var aa=this.editor.graph,qa=aa.getGraphBounds();k=this.getFileData(!0,null,null,
null,k,0==B?!1:"xmlpng"!=f,null,null,null,!1,"pdf"==f);var sa="",L="";if(qa.width*qa.height>MAX_AREA||k.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};y=y?"1":"0";"pdf"==f&&(null!=ia?L="&from="+ia.from+"&to="+ia.to:0==B&&(L="&allPages=1"));"xmlpng"==f&&(y="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(B=0;B<this.pages.length;B++)if(this.pages[B]==this.currentPage){sa="&from="+B;break}B=aa.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!t?
t||null!=B&&B!=mxConstants.NONE||(B="#ffffff"):B=mxConstants.NONE;t={globalVars:aa.getExportVariables()};J&&(t.grid={size:aa.gridSize,steps:aa.view.gridSteps,color:aa.view.gridColor});Graph.translateDiagram&&(t.diagramLanguage=Graph.diagramLanguage);return new mxXmlRequest(EXPORT_URL,"format="+f+sa+L+"&bg="+(null!=B?B:mxConstants.NONE)+"&base64="+z+"&embedXml="+y+"&xml="+encodeURIComponent(k)+(null!=e?"&filename="+encodeURIComponent(e):"")+"&extras="+encodeURIComponent(JSON.stringify(t))+(null!=I?
"&scale="+I:"")+(null!=O?"&border="+O:"")+(da&&isFinite(da)?"&w="+da:"")+(ja&&isFinite(ja)?"&h="+ja:""))};EditorUi.prototype.setMode=function(e,f){this.mode=e};EditorUi.prototype.loadDescriptor=function(e,f,k){var z=window.location.hash,t=mxUtils.bind(this,function(I){var O=null!=e.data?e.data:"";null!=I&&0<I.length&&(0<O.length&&(O+="\n"),O+=I);I=new LocalFile(this,"csv"!=e.format&&0<O.length?O:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);
I.getHash=function(){return z};this.fileLoaded(I);"csv"==e.format&&this.importCsv(O,mxUtils.bind(this,function(ja){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=e.update){var J=null!=e.interval?parseInt(e.interval):6E4,y=null,ia=mxUtils.bind(this,function(){var ja=this.currentPage;mxUtils.post(e.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(aa){ja===this.currentPage&&(200<=aa.getStatus()&&
300>=aa.getStatus()?(this.updateDiagram(aa.getText()),da()):this.handleError({message:mxResources.get("error")+" "+aa.getStatus()}))}),mxUtils.bind(this,function(aa){this.handleError(aa)}))}),da=mxUtils.bind(this,function(){window.clearTimeout(y);y=window.setTimeout(ia,J)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){da();ia()}));da();ia()}null!=f&&f()});if(null!=e.url&&0<e.url.length){var B=this.editor.getProxiedUrl(e.url);this.editor.loadUrl(B,mxUtils.bind(this,function(I){t(I)}),
mxUtils.bind(this,function(I){null!=k&&k(I)}))}else t("")};EditorUi.prototype.updateDiagram=function(e){function f(Y){var W=new mxCellOverlay(Y.image||t.warningImage,Y.tooltip,Y.align,Y.valign,Y.offset);W.addListener(mxEvent.CLICK,function(ka,q){z.alert(Y.tooltip)});return W}var k=null,z=this;if(null!=e&&0<e.length&&(k=mxUtils.parseXml(e),e=null!=k?k.documentElement:null,null!=e&&"updates"==e.nodeName)){var t=this.editor.graph,B=t.getModel();B.beginUpdate();var I=null;try{for(e=e.firstChild;null!=
e;){if("update"==e.nodeName){var O=B.getCell(e.getAttribute("id"));if(null!=O){try{var J=e.getAttribute("value");if(null!=J){var y=mxUtils.parseXml(J).documentElement;if(null!=y)if("1"==y.getAttribute("replace-value"))B.setValue(O,y);else for(var ia=y.attributes,da=0;da<ia.length;da++)t.setAttributeForCell(O,ia[da].nodeName,0<ia[da].nodeValue.length?ia[da].nodeValue:null)}}catch(Y){null!=window.console&&console.log("Error in value for "+O.id+": "+Y)}try{var ja=e.getAttribute("style");null!=ja&&t.model.setStyle(O,
ja)}catch(Y){null!=window.console&&console.log("Error in style for "+O.id+": "+Y)}try{var aa=e.getAttribute("icon");if(null!=aa){var qa=0<aa.length?JSON.parse(aa):null;null!=qa&&qa.append||t.removeCellOverlays(O);null!=qa&&t.addCellOverlay(O,f(qa))}}catch(Y){null!=window.console&&console.log("Error in icon for "+O.id+": "+Y)}try{var sa=e.getAttribute("geometry");if(null!=sa){sa=JSON.parse(sa);var L=t.getCellGeometry(O);if(null!=L){L=L.clone();for(key in sa){var V=parseFloat(sa[key]);"dx"==key?L.x+=
V:"dy"==key?L.y+=V:"dw"==key?L.width+=V:"dh"==key?L.height+=V:L[key]=parseFloat(sa[key])}t.model.setGeometry(O,L)}}}catch(Y){null!=window.console&&console.log("Error in icon for "+O.id+": "+Y)}}}else if("model"==e.nodeName){for(var T=e.firstChild;null!=T&&T.nodeType!=mxConstants.NODETYPE_ELEMENT;)T=T.nextSibling;null!=T&&(new mxCodec(e.firstChild)).decode(T,B)}else if("view"==e.nodeName){if(e.hasAttribute("scale")&&(t.view.scale=parseFloat(e.getAttribute("scale"))),e.hasAttribute("dx")||e.hasAttribute("dy"))t.view.translate=
new mxPoint(parseFloat(e.getAttribute("dx")||0),parseFloat(e.getAttribute("dy")||0))}else"fit"==e.nodeName&&(I=e.hasAttribute("max-scale")?parseFloat(e.getAttribute("max-scale")):1);e=e.nextSibling}}finally{B.endUpdate()}null!=I&&this.chromelessResize&&this.chromelessResize(!0,I)}return k};EditorUi.prototype.getCopyFilename=function(e,f){var k=null!=e&&null!=e.getTitle()?e.getTitle():this.defaultFilename;e="";var z=k.lastIndexOf(".");0<=z&&(e=k.substring(z),k=k.substring(0,z));if(f){f=k;var t=new Date;
k=t.getFullYear();z=t.getMonth()+1;var B=t.getDate(),I=t.getHours(),O=t.getMinutes();t=t.getSeconds();k=f+(" "+(k+"-"+z+"-"+B+"-"+I+"-"+O+"-"+t))}return k=mxResources.get("copyOf",[k])+e};EditorUi.prototype.fileLoaded=function(e,f){var k=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var z=!1;this.hideDialog();null!=k&&(EditorUi.debug("File.closed",[k]),k.removeListener(this.descriptorChangedListener),k.close());this.editor.graph.model.clear();this.editor.undoManager.clear();
var t=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=k&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!f&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerText="",this.fname.setAttribute("title",mxResources.get("rename")));this.editor.setStatus("");this.updateUi();f||this.showSplash()});
if(null!=e)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(e);e.addListener("descriptorChanged",this.descriptorChangedListener);e.addListener("contentChanged",this.descriptorChangedListener);e.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(e.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();e.isEditable()?e.isModified()?(e.addUnsavedStatus(),
null!=e.backupPatch&&e.patch([e.backupPatch])):this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</span>");!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();this.editor.fireEvent(new mxEventObject("fileLoaded"));
z=!0;if(!this.isOffline()&&null!=e.getMode()){var B="1"==urlParams.sketch?"sketch":uiTheme;if(null==B)B="default";else if("sketch"==B||"min"==B)B+=Editor.isDarkMode()?"-dark":"-light";EditorUi.logEvent({category:e.getMode().toUpperCase()+"-OPEN-FILE-"+e.getHash(),action:"size_"+e.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+B})}EditorUi.debug("File.opened",[e]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==
e.getMode()&&e.getMode()!=App.MODE_DEVICE&&null!=e.getMode())try{this.addRecent({id:e.getHash(),title:e.getTitle(),mode:e.getMode()})}catch(I){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(I){}}catch(I){this.fileLoadedError=I;if(null!=e)try{e.close()}catch(O){}if(EditorUi.enableLogging&&!this.isOffline())try{EditorUi.logEvent({category:"ERROR-LOAD-FILE-"+(null!=e?e.getHash():"none"),action:"message_"+I.message,label:"stack_"+I.stack})}catch(O){}e=mxUtils.bind(this,
function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=k?this.fileLoaded(k)||t():t()});f?e():this.handleError(I,mxResources.get("errorLoadingFile"),e,!0,null,null,!0)}else t();return z};EditorUi.prototype.getHashValueForPages=function(e,f){var k=0,z=new mxGraphModel,t=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var B=0;B<e.length;B++){this.updatePageRoot(e[B]);var I=
e[B].node.cloneNode(!1);I.removeAttribute("name");z.root=e[B].root;var O=t.encode(z);this.editor.graph.saveViewState(e[B].viewState,O,!0);O.removeAttribute("pageWidth");O.removeAttribute("pageHeight");I.appendChild(O);null!=f&&(f.eltCount+=I.getElementsByTagName("*").length,f.nodeCount+=I.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(I,function(J,y,ia,da){return!da||"mxGeometry"!=J.nodeName&&"mxPoint"!=J.nodeName||"x"!=y&&"y"!=y&&"width"!=y&&"height"!=y?da&&"mxCell"==J.nodeName&&
"previous"==y?null:ia:Math.round(ia)},f)<<0}return k};EditorUi.prototype.hashValue=function(e,f,k){var z=0;if(null!=e&&"object"===typeof e&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName&&"function"===typeof e.getAttribute){null!=e.nodeName&&(z^=this.hashValue(e.nodeName,f,k));if(null!=e.attributes){null!=k&&(k.attrCount+=e.attributes.length);for(var t=0;t<e.attributes.length;t++){var B=e.attributes[t].name,I=null!=f?f(e,B,e.attributes[t].value,!0):e.attributes[t].value;null!=I&&(z^=this.hashValue(B,
f,k)+this.hashValue(I,f,k))}}if(null!=e.childNodes)for(t=0;t<e.childNodes.length;t++)z=(z<<5)-z+this.hashValue(e.childNodes[t],f,k)<<0}else if(null!=e&&"function"!==typeof e){e=String(e);f=0;null!=k&&(k.byteCount+=e.length);for(t=0;t<e.length;t++)f=(f<<5)-f+e.charCodeAt(t)<<0;z^=f}return z};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(e,f,k,z,t,B,I){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||
mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(e){null==e&&(e=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,e,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(e){var f=mxUtils.createXmlDocument(),k=f.createElement("mxlibrary");mxUtils.setTextContent(k,JSON.stringify(e));f.appendChild(k);
return mxUtils.getXml(f)};EditorUi.prototype.closeLibrary=function(e){null!=e&&(this.removeLibrarySidebar(e.getHash()),e.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(e.getHash()),".scratchpad"==e.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(e){var f=this.sidebar.palettes[e];if(null!=f){for(var k=0;k<f.length;k++)f[k].parentNode.removeChild(f[k]);delete this.sidebar.palettes[e]}};EditorUi.prototype.repositionLibrary=function(e){var f=this.sidebar.container;
if(null==e){var k=this.sidebar.palettes["L.scratchpad"];null==k&&(k=this.sidebar.palettes.search);null!=k&&(e=k[k.length-1].nextSibling)}e=null!=e?e:f.firstChild.nextSibling.nextSibling;k=f.lastChild;var z=k.previousSibling;f.insertBefore(k,e);f.insertBefore(z,k)};EditorUi.prototype.loadLibrary=function(e,f){var k=mxUtils.parseXml(e.getData());if("mxlibrary"==k.documentElement.nodeName){var z=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(e,z,k.documentElement.getAttribute("title"),
f)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(e){return""};EditorUi.prototype.libraryLoaded=function(e,f,k,z){if(null!=this.sidebar){e.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(e.getHash());".scratchpad"==e.title&&(this.scratchpad=e);var t=this.sidebar.palettes[e.getHash()];t=null!=t?t[t.length-1].nextSibling:null;this.removeLibrarySidebar(e.getHash());var B=null,I=mxUtils.bind(this,function(T,Y){0==T.length&&e.isEditable()?
(null==B&&(B=document.createElement("div"),B.className="geDropTarget",mxUtils.write(B,mxResources.get("dragElementsHere"))),Y.appendChild(B)):this.addLibraryEntries(T,Y)});null!=this.sidebar&&null!=f&&this.sidebar.addEntries(f);null==k&&(k=e.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var O=this.sidebar.addPalette(e.getHash(),k,null!=z?z:!0,mxUtils.bind(this,function(T){I(f,T)}));this.repositionLibrary(t);var J=O.parentNode.previousSibling;z=J.getAttribute("title");
null!=z&&0<z.length&&".scratchpad"!=e.title&&J.setAttribute("title",this.getLibraryStorageHint(e)+"\n"+z);var y=document.createElement("div");y.style.position="absolute";y.style.right="0px";y.style.top="0px";y.style.padding="8px";y.style.backgroundColor="inherit";J.style.position="relative";var ia=document.createElement("img");ia.className="geAdaptiveAsset";ia.setAttribute("src",Editor.crossImage);ia.setAttribute("title",mxResources.get("close"));ia.setAttribute("valign","absmiddle");ia.setAttribute("border",
"0");ia.style.position="relative";ia.style.top="2px";ia.style.width="14px";ia.style.cursor="pointer";ia.style.margin="0 3px";var da=null;if(".scratchpad"!=e.title||this.closableScratchpad)y.appendChild(ia),mxEvent.addListener(ia,"click",mxUtils.bind(this,function(T){if(!mxEvent.isConsumed(T)){var Y=mxUtils.bind(this,function(){this.closeLibrary(e)});null!=da?this.confirm(mxResources.get("allChangesLost"),null,Y,mxResources.get("cancel"),mxResources.get("discardChanges")):Y();mxEvent.consume(T)}}));
if(e.isEditable()){var ja=this.editor.graph,aa=null,qa=mxUtils.bind(this,function(T){this.showLibraryDialog(e.getTitle(),O,f,e,e.getMode());mxEvent.consume(T)}),sa=mxUtils.bind(this,function(T){e.setModified(!0);e.isAutosave()?(null!=aa&&null!=aa.parentNode&&aa.parentNode.removeChild(aa),aa=ia.cloneNode(!1),aa.setAttribute("src",Editor.spinImage),aa.setAttribute("title",mxResources.get("saving")),aa.style.cursor="default",aa.style.marginRight="2px",aa.style.marginTop="-2px",y.insertBefore(aa,y.firstChild),
J.style.paddingRight=18*y.childNodes.length+"px",this.saveLibrary(e.getTitle(),f,e,e.getMode(),!0,!0,function(){null!=aa&&null!=aa.parentNode&&(aa.parentNode.removeChild(aa),J.style.paddingRight=18*y.childNodes.length+"px")})):null==da&&(da=ia.cloneNode(!1),da.setAttribute("src",Editor.saveImage),da.setAttribute("title",mxResources.get("save")),y.insertBefore(da,y.firstChild),mxEvent.addListener(da,"click",mxUtils.bind(this,function(Y){this.saveLibrary(e.getTitle(),f,e,e.getMode(),e.constructor==
LocalLibrary,!0,function(){null==da||e.isModified()||(J.style.paddingRight=18*y.childNodes.length+"px",da.parentNode.removeChild(da),da=null)});mxEvent.consume(Y)})),J.style.paddingRight=18*y.childNodes.length+"px")}),L=mxUtils.bind(this,function(T,Y,W,ka){T=ja.cloneCells(mxUtils.sortCells(ja.model.getTopmostCells(T)));for(var q=0;q<T.length;q++){var F=ja.getCellGeometry(T[q]);null!=F&&F.translate(-Y.x,-Y.y)}O.appendChild(this.sidebar.createVertexTemplateFromCells(T,Y.width,Y.height,ka||"",!0,null,
!1));T={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(T))),w:Y.width,h:Y.height};null!=ka&&(T.title=ka);f.push(T);sa(W);null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null)}),V=mxUtils.bind(this,function(T){if(ja.isSelectionEmpty())ja.getRubberband().isActive()?(ja.getRubberband().execute(T),ja.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var Y=ja.getSelectionCells(),W=ja.view.getBounds(Y),
ka=ja.view.scale;W.x/=ka;W.y/=ka;W.width/=ka;W.height/=ka;W.x-=ja.view.translate.x;W.y-=ja.view.translate.y;L(Y,W)}mxEvent.consume(T)});mxEvent.addGestureListeners(O,function(){},mxUtils.bind(this,function(T){ja.isMouseDown&&null!=ja.panningManager&&null!=ja.graphHandler.first&&(ja.graphHandler.suspend(),null!=ja.graphHandler.hint&&(ja.graphHandler.hint.style.visibility="hidden"),O.style.backgroundColor="#f1f3f4",O.style.cursor="copy",ja.panningManager.stop(),ja.autoScroll=!1,mxEvent.consume(T))}),
mxUtils.bind(this,function(T){ja.isMouseDown&&null!=ja.panningManager&&null!=ja.graphHandler&&(O.style.backgroundColor="",O.style.cursor="default",this.sidebar.showTooltips=!0,ja.panningManager.stop(),ja.graphHandler.reset(),ja.isMouseDown=!1,ja.autoScroll=!0,V(T),mxEvent.consume(T))}));mxEvent.addListener(O,"mouseleave",mxUtils.bind(this,function(T){ja.isMouseDown&&null!=ja.graphHandler.first&&(ja.graphHandler.resume(),null!=ja.graphHandler.hint&&(ja.graphHandler.hint.style.visibility="visible"),
O.style.backgroundColor="",O.style.cursor="",ja.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(O,"dragover",mxUtils.bind(this,function(T){O.style.backgroundColor="#f1f3f4";T.dataTransfer.dropEffect="copy";O.style.cursor="copy";this.sidebar.hideTooltip();T.stopPropagation();T.preventDefault()})),mxEvent.addListener(O,"drop",mxUtils.bind(this,function(T){O.style.cursor="";O.style.backgroundColor="";0<T.dataTransfer.files.length&&this.importFiles(T.dataTransfer.files,0,0,this.maxImageSize,
mxUtils.bind(this,function(Y,W,ka,q,F,S,ba,U,ca){if(null!=Y&&"image/"==W.substring(0,6))Y="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(Y),Y=[new mxCell("",new mxGeometry(0,0,F,S),Y)],Y[0].vertex=!0,L(Y,new mxRectangle(0,0,F,S),T,mxEvent.isAltDown(T)?null:ba.substring(0,ba.lastIndexOf(".")).replace(/_/g," ")),null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null);else{var ea=!1,na=mxUtils.bind(this,function(ra,
ya){null!=ra&&"application/pdf"==ya&&(ya=Editor.extractGraphModelFromPdf(ra),null!=ya&&0<ya.length&&(ra=ya));if(null!=ra)if(ra=mxUtils.parseXml(ra),"mxlibrary"==ra.documentElement.nodeName)try{var va=JSON.parse(mxUtils.getTextContent(ra.documentElement));I(va,O);f=f.concat(va);sa(T);this.spinner.stop();ea=!0}catch(xa){}else if("mxfile"==ra.documentElement.nodeName)try{var Da=ra.documentElement.getElementsByTagName("diagram");for(va=0;va<Da.length;va++){var pa=this.stringToCells(Editor.getDiagramNodeXml(Da[va])),
Aa=this.editor.graph.getBoundingBoxFromGeometry(pa);L(pa,new mxRectangle(0,0,Aa.width,Aa.height),T)}ea=!0}catch(xa){null!=window.console&&console.log("error in drop handler:",xa)}ea||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null)});null!=ca&&null!=ba&&(/(\.v(dx|sdx?))($|\?)/i.test(ba)||/(\.vs(x|sx?))($|\?)/i.test(ba))?this.importVisio(ca,function(ra){na(ra,"text/xml")},null,ba):(new XMLHttpRequest).upload&&
this.isRemoteFileFormat(Y,ba)&&null!=ca?this.isExternalDataComms()?this.parseFile(ca,mxUtils.bind(this,function(ra){4==ra.readyState&&(this.spinner.stop(),200<=ra.status&&299>=ra.status?na(ra.responseText,"text/xml"):this.handleError({message:mxResources.get(413==ra.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):na(Y,W)}}));T.stopPropagation();T.preventDefault()})),
mxEvent.addListener(O,"dragleave",function(T){O.style.cursor="";O.style.backgroundColor="";T.stopPropagation();T.preventDefault()}));ia=ia.cloneNode(!1);ia.setAttribute("src",Editor.editImage);ia.setAttribute("title",mxResources.get("edit"));y.insertBefore(ia,y.firstChild);mxEvent.addListener(ia,"click",qa);mxEvent.addListener(O,"dblclick",function(T){mxEvent.getSource(T)==O&&qa(T)});z=ia.cloneNode(!1);z.setAttribute("src",Editor.plusImage);z.setAttribute("title",mxResources.get("add"));y.insertBefore(z,
y.firstChild);mxEvent.addListener(z,"click",V);this.isOffline()||".scratchpad"!=e.title||null==EditorUi.scratchpadHelpLink||(z=document.createElement("span"),z.setAttribute("title",mxResources.get("help")),z.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;cursor:pointer;",mxUtils.write(z,"?"),mxEvent.addGestureListeners(z,mxUtils.bind(this,function(T){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(T)})),y.insertBefore(z,y.firstChild))}J.appendChild(y);J.style.paddingRight=
18*y.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(e,f){for(var k=0;k<e.length;k++){var z=e[k],t=z.data;if(null!=t){t=this.convertDataUri(t);var B="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==z.aspect&&(B+="aspect=fixed;");f.appendChild(this.sidebar.createVertexTemplate(B+"image="+t,z.w,z.h,"",z.title||"",!1,null,!0))}else null!=z.xml&&(t=this.stringToCells(Graph.decompress(z.xml)),0<t.length&&f.appendChild(this.sidebar.createVertexTemplateFromCells(t,
z.w,z.h,z.title||"",!0,null,!0)))}};EditorUi.prototype.getResource=function(e){return null!=e?e[mxLanguage]||e.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground="linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground=
"rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38):Editor.isDarkMode()&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor=Editor.darkColor,Format.inactiveTabBackgroundColor="black",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.shapeBackgroundColor=Editor.darkColor,Graph.prototype.shapeForegroundColor=Editor.lightColor,Graph.prototype.defaultPageBackgroundColor=Editor.darkColor,Graph.prototype.defaultPageBorderColor=
"#505759",BaseFormatPanel.prototype.buttonBackgroundColor=Editor.darkColor,mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxConstants.DROP_TARGET_COLOR="#00ff00");"1"==urlParams.sketch&&("undefined"!==typeof Menus&&(Menus.prototype.defaultFonts=Menus.prototype.defaultFonts.concat(Editor.sketchFonts)),Graph.prototype.defaultVertexStyle={hachureGap:"4"},Graph.prototype.defaultEdgeStyle={edgeStyle:"none",rounded:"0",curved:"1",jettySize:"auto",
orthogonalLoop:"1",endArrow:"open",startSize:"14",endSize:"14",sourcePerimeterSpacing:"8",targetPerimeterSpacing:"8"},Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config",Graph.prototype.defaultGridEnabled="1"==urlParams.grid,Graph.prototype.defaultPageVisible="1"==urlParams.pv,Graph.prototype.defaultEdgeLength=120,Editor.fitWindowBorders=new mxRectangle(60,30,30,30))};"1"!=urlParams["live-ui"]&&EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(e,f,k,
z,t,B,I){e=new ImageDialog(this,e,f,k,z,t,B,I);this.showDialog(e.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);e.init()};EditorUi.prototype.showBackgroundImageDialog=function(e,f){e=null!=e?e:mxUtils.bind(this,function(k,z){z||(k=new ChangePageSetup(this,null,k),k.ignoreColor=!0,this.editor.graph.model.execute(k))});e=new BackgroundImageDialog(this,e,f);this.showDialog(e.container,400,200,!0,!0);e.init()};EditorUi.prototype.showLibraryDialog=function(e,f,k,z,t){e=new LibraryDialog(this,
e,f,k,z,t);this.showDialog(e.container,640,440,!0,!1,mxUtils.bind(this,function(B){B&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));e.init()};var g=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(e){var f=g.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.createSidebarFooterContainer=function(){var e=this.createDiv("geSidebarContainer geSidebarFooter");
e.style.position="absolute";e.style.overflow="hidden";var f=document.createElement("a");f.className="geTitle";f.style.color="#DF6C0C";f.style.fontWeight="bold";f.style.height="100%";f.style.paddingTop="9px";f.innerHTML="<span>+</span>";var k=f.getElementsByTagName("span")[0];k.style.fontSize="18px";k.style.marginRight="5px";mxUtils.write(f,mxResources.get("moreShapes")+"...");mxEvent.addListener(f,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(z){z.preventDefault()}));mxEvent.addListener(f,
"click",mxUtils.bind(this,function(z){this.actions.get("shapes").funct();mxEvent.consume(z)}));e.appendChild(f);return e};EditorUi.prototype.handleError=function(e,f,k,z,t,B,I){var O=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},J=null!=e&&null!=e.error?e.error:e;if(null!=e&&("1"==urlParams.test||null!=e.stack)&&null!=e.message)try{I?null!=window.console&&console.error("EditorUi.handleError:",e):EditorUi.logError("Caught: "+(""==e.message&&null!=e.name)?e.name:e.message,
e.filename,e.lineNumber,e.columnNumber,e,"INFO")}catch(aa){}if(null!=J||null!=f){I=mxUtils.htmlEntities(mxResources.get("unknownError"));var y=mxResources.get("ok"),ia=null;f=null!=f?f:mxResources.get("error");if(null!=J){null!=J.retry&&(y=mxResources.get("cancel"),ia=function(){O();J.retry()});if(404==J.code||404==J.status||403==J.code){I=403==J.code?null!=J.message?mxUtils.htmlEntities(J.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):null!=t?t:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+
(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.displayName+", "+this.drive.user.email+")":""));var da=null!=t?null:null!=B?B:window.location.hash;if(null!=da&&("#G"==da.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==da.substring(0,45))&&(null!=e&&null!=e.error&&(null!=e.error.errors&&0<e.error.errors.length&&"fileAccess"==e.error.errors[0].reason||null!=e.error.data&&0<e.error.data.length&&"fileAccess"==e.error.data[0].reason)||404==J.code||404==J.status)){da="#U"==
da.substring(0,2)?da.substring(45,da.lastIndexOf("%26ex")):da.substring(2);this.showError(f,I,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+da);this.handleError(e,f,k,z,t)}),ia,mxResources.get("changeUser"),mxUtils.bind(this,function(){function aa(){V.innerText="";for(var T=0;T<qa.length;T++){var Y=document.createElement("option");mxUtils.write(Y,qa[T].displayName);Y.value=T;V.appendChild(Y);Y=document.createElement("option");
Y.innerHTML="&nbsp;&nbsp;&nbsp;";mxUtils.write(Y,"<"+qa[T].email+">");Y.setAttribute("disabled","disabled");V.appendChild(Y)}Y=document.createElement("option");mxUtils.write(Y,mxResources.get("addAccount"));Y.value=qa.length;V.appendChild(Y)}var qa=this.drive.getUsersList(),sa=document.createElement("div"),L=document.createElement("span");L.style.marginTop="6px";mxUtils.write(L,mxResources.get("changeUser")+": ");sa.appendChild(L);var V=document.createElement("select");V.style.width="200px";aa();
mxEvent.addListener(V,"change",mxUtils.bind(this,function(){var T=V.value,Y=qa.length!=T;Y&&this.drive.setUser(qa[T]);this.drive.authorize(Y,mxUtils.bind(this,function(){Y||(qa=this.drive.getUsersList(),aa())}),mxUtils.bind(this,function(W){this.handleError(W)}),!0)}));sa.appendChild(V);sa=new CustomDialog(this,sa,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(sa.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();
null!=k&&k()}),480,150);return}}null!=J.message?I=""==J.message&&null!=J.name?mxUtils.htmlEntities(J.name):mxUtils.htmlEntities(J.message):null!=J.response&&null!=J.response.error?I=mxUtils.htmlEntities(J.response.error):"undefined"!==typeof window.App&&(J.code==App.ERROR_TIMEOUT?I=mxUtils.htmlEntities(mxResources.get("timeout")):J.code==App.ERROR_BUSY?I=mxUtils.htmlEntities(mxResources.get("busy")):"string"===typeof J&&0<J.length&&(I=mxUtils.htmlEntities(J)))}var ja=B=null;null!=J&&null!=J.helpLink?
(B=mxResources.get("help"),ja=mxUtils.bind(this,function(){return this.editor.graph.openLink(J.helpLink)})):null!=J&&null!=J.ownerEmail&&(B=mxResources.get("contactOwner"),I+=mxUtils.htmlEntities(" ("+B+": "+J.ownerEmail+")"),ja=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(J.ownerEmail))}));this.showError(f,I,y,k,ia,null,null,B,ja,null,null,null,z?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(e,f,k){e=new ErrorDialog(this,null,e,mxResources.get("ok"),
f);this.showDialog(e.container,k||340,100,!0,!1);e.init()};EditorUi.prototype.confirm=function(e,f,k,z,t,B){var I=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},O=Math.min(200,28*Math.ceil(e.length/50));e=new ConfirmDialog(this,e,function(){I();null!=f&&f()},function(){I();null!=k&&k()},z,t,null,null,null,null,O);this.showDialog(e.container,340,46+O,!0,B);e.init()};EditorUi.prototype.showBanner=function(e,f,k,z){var t=!1;if(!(this.bannerShowing||this["hideBanner"+e]||
isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+e])){var B=document.createElement("div");B.style.cssText="position:absolute;bottom:10px;left:50%;max-width:90%;padding:18px 34px 12px 20px;font-size:16px;font-weight:bold;white-space:nowrap;cursor:pointer;z-index:"+mxPopupMenu.prototype.zIndex+";";mxUtils.setPrefixedStyle(B.style,"box-shadow","1px 1px 2px 0px #ddd");mxUtils.setPrefixedStyle(B.style,"transform","translate(-50%,120%)");mxUtils.setPrefixedStyle(B.style,"transition",
"all 1s ease");B.className="geBtn gePrimaryBtn";t=document.createElement("img");t.setAttribute("src",IMAGE_PATH+"/logo.png");t.setAttribute("border","0");t.setAttribute("align","absmiddle");t.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";B.appendChild(t);t=document.createElement("img");t.setAttribute("src",Dialog.prototype.closeImage);t.setAttribute("title",mxResources.get(z?"doNotShowAgain":"close"));t.setAttribute("border","0");t.style.cssText="position:absolute;right:10px;top:12px;filter:invert(1);padding:6px;margin:-6px;cursor:default;";
B.appendChild(t);mxUtils.write(B,f);document.body.appendChild(B);this.bannerShowing=!0;f=document.createElement("div");f.style.cssText="font-size:11px;text-align:center;font-weight:normal;";var I=document.createElement("input");I.setAttribute("type","checkbox");I.setAttribute("id","geDoNotShowAgainCheckbox");I.style.marginRight="6px";if(!z){f.appendChild(I);var O=document.createElement("label");O.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(O,mxResources.get("doNotShowAgain"));f.appendChild(O);
B.style.paddingBottom="30px";B.appendChild(f)}var J=mxUtils.bind(this,function(){null!=B.parentNode&&(B.parentNode.removeChild(B),this.bannerShowing=!1,I.checked||z)&&(this["hideBanner"+e]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+e]=Date.now(),mxSettings.save()))});mxEvent.addListener(t,"click",mxUtils.bind(this,function(ia){mxEvent.consume(ia);J()}));var y=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(B.style,"transform","translate(-50%,120%)");window.setTimeout(mxUtils.bind(this,
function(){J()}),1E3)});mxEvent.addListener(B,"click",mxUtils.bind(this,function(ia){var da=mxEvent.getSource(ia);da!=I&&da!=O?(null!=k&&k(),J(),mxEvent.consume(ia)):y()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(B.style,"transform","translate(-50%,0%)")}),500);window.setTimeout(y,3E4);t=!0}return t};EditorUi.prototype.setCurrentFile=function(e){null!=e&&(e.opened=new Date);this.currentFile=e};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=
function(){return this.editor.isExportToCanvas()};EditorUi.prototype.createImageDataUri=function(e,f,k,z){e=e.toDataURL("image/"+k);if(null!=e&&6<e.length)null!=f&&(e=Editor.writeGraphModelToPng(e,"tEXt","mxfile",encodeURIComponent(f))),0<z&&(e=Editor.writeGraphModelToPng(e,"pHYs","dpi",z));else throw{message:mxResources.get("unknownError")};return e};EditorUi.prototype.saveCanvas=function(e,f,k,z,t){var B="jpeg"==k?"jpg":k;z=this.getBaseFilename(z)+(null!=f?".drawio":"")+"."+B;e=this.createImageDataUri(e,
f,k,t);this.saveData(z,B,e.substring(e.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(e,f){e=new TextareaDialog(this,e,f,null,null,mxResources.get("close"));this.showDialog(e.container,620,460,
!0,!0,null,null,null,null,!0);e.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(e,f,k,z,t,B){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=B?B:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)e=z?this.base64ToBlob(e,k):new Blob([e],{type:k}),navigator.msSaveOrOpenBlob(e,f);else if(mxClient.IS_IE)k=window.open("about:blank","_blank"),null==k?mxUtils.popup(e,!0):(k.document.write(e),
k.document.close(),k.document.execCommand("SaveAs",!0,f),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",e):this.openInNewWindow(e,k,z);else{var I=document.createElement("a");B=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof I.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var O=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);B=65==(O?parseInt(O[2],10):
!1)?!1:B}if(B||this.isOffline()){I.href=URL.createObjectURL(z?this.base64ToBlob(e,k):new Blob([e],{type:k}));B?I.download=f:I.setAttribute("target","_blank");document.body.appendChild(I);try{window.setTimeout(function(){URL.revokeObjectURL(I.href)},2E4),I.click(),I.parentNode.removeChild(I)}catch(J){}}else this.createEchoRequest(e,f,k,z,t).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(e,f,k,z,t,B){e="xml="+encodeURIComponent(e);return new mxXmlRequest(SAVE_URL,e+(null!=
k?"&mime="+k:"")+(null!=t?"&format="+t:"")+(null!=B?"&base64="+B:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(z?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(e,f){f=f||"";e=atob(e);for(var k=e.length,z=Math.ceil(k/1024),t=Array(z),B=0;B<z;++B){for(var I=1024*B,O=Math.min(I+1024,k),J=Array(O-I),y=0;I<O;++y,++I)J[y]=e[I].charCodeAt(0);t[B]=new Uint8Array(J)}return new Blob(t,{type:f})};EditorUi.prototype.saveLocalFile=function(e,f,k,z,t,B,I,O){B=null!=B?B:!1;I=null!=I?I:"vsdx"!=
t&&(!mxClient.IS_IOS||!navigator.standalone);t=this.getServiceCount(B);isLocalStorage&&t++;var J=4>=t?2:6<t?4:3;f=new CreateDialog(this,f,mxUtils.bind(this,function(y,ia){try{if("_blank"==ia)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(e,k,z);else if(null!=k&&"text/html"==k.substring(0,9)){var da=new EmbedDialog(this,e);this.showDialog(da.container,450,240,!0,!0);da.init()}else{var ja=window.open("about:blank");null==ja?mxUtils.popup(e,!0):(ja.document.write("<pre>"+mxUtils.htmlEntities(e,
!1)+"</pre>"),ja.document.close())}else ia==App.MODE_DEVICE||"download"==ia?this.doSaveLocalFile(e,y,k,z,null,O):null!=y&&0<y.length&&this.pickFolder(ia,mxUtils.bind(this,function(aa){try{this.exportFile(e,y,k,z,ia,aa)}catch(qa){this.handleError(qa)}}))}catch(aa){this.handleError(aa)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,B,I,null,1<t,J,e,k,z);B=this.isServices(t)?t>J?390:280:160;this.showDialog(f.container,420,B,!0,!0);f.init()};
EditorUi.prototype.openInNewWindow=function(e,f,k){var z=window.open("about:blank");null==z||null==z.document?mxUtils.popup(e,!0):("image/svg+xml"!=f||mxClient.IS_SVG?"image/svg+xml"!=f||k?(e=k?e:btoa(unescape(encodeURIComponent(e))),z.document.write('<html><img style="max-width:100%;" src="data:'+f+";base64,"+e+'"/></html>')):z.document.write("<html>"+e+"</html>"):z.document.write("<html><pre>"+mxUtils.htmlEntities(e,!1)+"</pre></html>"),z.document.close())};var l=EditorUi.prototype.addChromelessToolbarItems;
EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(e){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var f=e(mxUtils.bind(this,function(z){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),
!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),this.tagsComponent.div.className="geScrollable",this.tagsComponent.div.style.maxHeight="160px",this.tagsComponent.div.style.maxWidth="120px",this.tagsComponent.div.style.padding="4px",this.tagsComponent.div.style.overflow="auto",this.tagsComponent.div.style.height="auto",this.tagsComponent.div.style.position="fixed",this.tagsComponent.div.style.fontFamily=
Editor.defaultHtmlFont,mxClient.IS_IE||mxClient.IS_IE11?(this.tagsComponent.div.style.backgroundColor="#ffffff",this.tagsComponent.div.style.border="2px solid black",this.tagsComponent.div.style.color="#000000"):(this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color="#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80)));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;
mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var t=f.getBoundingClientRect();this.tagsDialog.style.left=t.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";t=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=t.zIndex;document.body.appendChild(this.tagsDialog);
this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(z)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var z=this.editor.graph.getAllTags();f.style.display=0<z.length?"":"none"}))}l.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=
null)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));this.editor.addListener("pageSelected",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));mxEvent.addListener(this.editor.graph.container,
"click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.isExportToCanvas()&&this.isChromelessImageExportEnabled()){this.exportDialog=null;var k=e(mxUtils.bind(this,function(z){var t=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",t);null!=this.exportDialog&&
(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)t.apply(this);else{this.exportDialog=document.createElement("div");var B=k.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width=
"50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=B.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";B=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=B.zIndex;var I=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",
speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});I.spin(this.exportDialog);this.editor.exportToCanvas(mxUtils.bind(this,function(O){I.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var J=this.createImageDataUri(O,null,"png");O=document.createElement("img");O.style.maxWidth="140px";O.style.maxHeight="140px";O.style.cursor="pointer";O.style.backgroundColor="white";O.setAttribute("title",mxResources.get("openInNewWindow"));
O.setAttribute("border","0");O.setAttribute("src",J);this.exportDialog.appendChild(O);mxEvent.addListener(O,"click",mxUtils.bind(this,function(){this.openInNewWindow(J.substring(J.indexOf(",")+1),"image/png",!0);t.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(O){this.spinner.stop();this.handleError(O)}),null,null,null,null,null,null,null,Editor.defaultBorder);mxEvent.addListener(this.editor.graph.container,"click",t);document.body.appendChild(this.exportDialog)}mxEvent.consume(z)}),
Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(e,f,k,z,t){this.isLocalFileSave()?this.saveLocalFile(k,e,z,t,f):this.saveRequest(e,f,mxUtils.bind(this,function(B,I){return this.createEchoRequest(k,B,z,t,f,I)}),k,t,z)};EditorUi.prototype.saveRequest=function(e,f,k,z,t,B,I){I=null!=I?I:!mxClient.IS_IOS||!navigator.standalone;var O=this.getServiceCount(!1);isLocalStorage&&O++;var J=4>=O?2:6<O?4:3;e=new CreateDialog(this,e,mxUtils.bind(this,function(y,ia){if("_blank"==
ia||null!=y&&0<y.length){var da=k("_blank"==ia?null:y,ia==App.MODE_DEVICE||"download"==ia||null==ia||"_blank"==ia?"0":"1");null!=da&&(ia==App.MODE_DEVICE||"download"==ia||"_blank"==ia?da.simulate(document,"_blank"):this.pickFolder(ia,mxUtils.bind(this,function(ja){B=null!=B?B:"pdf"==f?"application/pdf":"image/"+f;if(null!=z)try{this.exportFile(z,y,B,!0,ia,ja)}catch(aa){this.handleError(aa)}else this.spinner.spin(document.body,mxResources.get("saving"))&&da.send(mxUtils.bind(this,function(){this.spinner.stop();
if(200<=da.getStatus()&&299>=da.getStatus())try{this.exportFile(da.getText(),y,B,!0,ia,ja)}catch(aa){this.handleError(aa)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(aa){this.spinner.stop();this.handleError(aa)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,I,null,1<O,J,z,B,t);O=this.isServices(O)?4<O?390:280:160;this.showDialog(e.container,420,O,!0,!0);e.init()};EditorUi.prototype.isServices=
function(e){return 1!=e};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(e,f,k,z,t,B){};EditorUi.prototype.pickFolder=function(e,f,k){f(null)};EditorUi.prototype.exportSvg=function(e,f,k,z,t,B,I,O,J,y,ia,da,ja,aa){if(this.spinner.spin(document.body,mxResources.get("export")))try{var qa=this.editor.graph.isSelectionEmpty();k=null!=k?k:qa;var sa=f?null:this.editor.graph.background;sa==mxConstants.NONE&&(sa=null);null==sa&&0==f&&(sa=ia?
this.editor.graph.defaultPageBackgroundColor:"#ffffff");var L=this.editor.graph.getSvg(sa,e,I,O,null,k,null,null,"blank"==y?"_blank":"self"==y?"_top":null,null,!ja,ia,da);z&&this.editor.graph.addSvgShadow(L);var V=this.getBaseFilename()+(t?".drawio":"")+".svg";aa=null!=aa?aa:mxUtils.bind(this,function(W){this.isLocalFileSave()||W.length<=MAX_REQUEST_SIZE?this.saveData(V,"svg",W,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,
function(){mxUtils.popup(W)}))});var T=mxUtils.bind(this,function(W){this.spinner.stop();t&&W.setAttribute("content",this.getFileData(!0,null,null,null,k,J,null,null,null,!1));aa(Graph.xmlDeclaration+"\n"+(t?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(W))});this.editor.graph.mathEnabled&&this.editor.addMathCss(L);var Y=mxUtils.bind(this,function(W){B?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(W,T,this.thumbImageCache)):T(W)});ja?this.embedFonts(L,
Y):(this.editor.addFontCss(L),Y(L))}catch(W){this.handleError(W)}};EditorUi.prototype.addRadiobox=function(e,f,k,z,t,B,I){return this.addCheckbox(e,k,z,t,B,I,!0,f)};EditorUi.prototype.addCheckbox=function(e,f,k,z,t,B,I,O){B=null!=B?B:!0;var J=document.createElement("input");J.style.marginRight="8px";J.style.marginTop="16px";J.setAttribute("type",I?"radio":"checkbox");I="geCheckbox-"+Editor.guid();J.id=I;null!=O&&J.setAttribute("name",O);k&&(J.setAttribute("checked","checked"),J.defaultChecked=!0);
z&&J.setAttribute("disabled","disabled");B&&(e.appendChild(J),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",I),e.appendChild(k),t||mxUtils.br(e));return J};EditorUi.prototype.addEditButton=function(e,f){var k=this.addCheckbox(e,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var z=this.getCurrentFile(),t="";null!=z&&z.getMode()!=App.MODE_DEVICE&&z.getMode()!=App.MODE_BROWSER&&(t=window.location.href);var B=document.createElement("select");B.style.maxWidth=
"200px";B.style.width="auto";B.style.marginLeft="8px";B.style.marginRight="10px";B.className="geBtn";z=document.createElement("option");z.setAttribute("value","blank");mxUtils.write(z,mxResources.get("makeCopy"));B.appendChild(z);z=document.createElement("option");z.setAttribute("value","custom");mxUtils.write(z,mxResources.get("custom")+"...");B.appendChild(z);e.appendChild(B);mxEvent.addListener(B,"change",mxUtils.bind(this,function(){if("custom"==B.value){var I=new FilenameDialog(this,t,mxResources.get("ok"),
function(O){null!=O?t=O:B.value="blank"},mxResources.get("url"),null,null,null,null,function(){B.value="blank"});this.showDialog(I.container,300,80,!0,!1);I.init()}}));mxEvent.addListener(k,"change",mxUtils.bind(this,function(){k.checked&&(null==f||f.checked)?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")}));mxUtils.br(e);return{getLink:function(){return k.checked?"blank"===B.value?"_blank":t:null},getEditInput:function(){return k},getEditSelect:function(){return B}}};EditorUi.prototype.addLinkSection=
function(e,f){function k(){var O=document.createElement("div");O.style.width="100%";O.style.height="100%";O.style.boxSizing="border-box";null!=B&&B!=mxConstants.NONE?(O.style.border="1px solid black",O.style.backgroundColor=B):(O.style.backgroundPosition="center center",O.style.backgroundRepeat="no-repeat",O.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");I.innerText="";I.appendChild(O)}mxUtils.write(e,mxResources.get("links")+":");var z=document.createElement("select");z.style.width=
"100px";z.style.padding="0px";z.style.marginLeft="8px";z.style.marginRight="10px";z.className="geBtn";var t=document.createElement("option");t.setAttribute("value","auto");mxUtils.write(t,mxResources.get("automatic"));z.appendChild(t);t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("openInNewWindow"));z.appendChild(t);t=document.createElement("option");t.setAttribute("value","self");mxUtils.write(t,mxResources.get("openInThisWindow"));z.appendChild(t);
f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),z.appendChild(f));e.appendChild(z);mxUtils.write(e,mxResources.get("borderColor")+":");var B="#0000ff",I=null;I=mxUtils.button("",mxUtils.bind(this,function(O){this.pickColor(B||"none",function(J){B=J;k()});mxEvent.consume(O)}));k();I.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";I.style.marginLeft="4px";I.style.height="22px";I.style.width=
"22px";I.style.position="relative";I.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";I.className="geColorBtn";e.appendChild(I);mxUtils.br(e);return{getColor:function(){return B},getTarget:function(){return z.value},focus:function(){z.focus()}}};EditorUi.prototype.createUrlParameters=function(e,f,k,z,t,B,I){I=null!=I?I:[];z&&("https://viewer.diagrams.net"==EditorUi.lightboxHost&&"1"!=urlParams.dev||I.push("lightbox=1"),"auto"!=e&&I.push("target="+e),null!=f&&f!=mxConstants.NONE&&
I.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=t&&0<t.length&&I.push("edit="+encodeURIComponent(t)),B&&I.push("layers=1"),this.editor.graph.foldingEnabled&&I.push("nav=1"));k&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&I.push("page-id="+this.currentPage.getId());return I};EditorUi.prototype.createLink=function(e,f,k,z,t,B,I,O,J,y){J=this.createUrlParameters(e,f,k,z,t,B,J);e=this.getCurrentFile();f=!0;null!=I?k="#U"+encodeURIComponent(I):(e=this.getCurrentFile(),
O||null==e||e.constructor!=window.DriveFile?k="#R"+encodeURIComponent(k?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+e.getHash(),f=!1));f&&null!=e&&null!=e.getTitle()&&e.getTitle()!=this.defaultFilename&&J.push("title="+encodeURIComponent(e.getTitle()));y&&1<k.length&&(J.push("open="+k.substring(1)),k="");return(z&&"1"!=urlParams.dev?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?
EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<J.length?"?"+J.join("&"):"")+k};EditorUi.prototype.createHtml=function(e,f,k,z,t,B,I,O,J,y,ia,da){this.getBasenames();var ja={};""!=t&&t!=mxConstants.NONE&&(ja.highlight=t);"auto"!==z&&(ja.target=z);y||(ja.lightbox=!1);ja.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(ja.zoom=k/100);k=[];I&&(k.push("pages"),ja.resize=!0,null!=this.pages&&null!=this.currentPage&&(ja.page=mxUtils.indexOf(this.pages,this.currentPage)));
f&&(k.push("zoom"),ja.resize=!0);O&&k.push("layers");J&&k.push("tags");0<k.length&&(y&&k.push("lightbox"),ja.toolbar=k.join(" "));null!=ia&&0<ia.length&&(ja.edit=ia);null!=e?ja.url=e:ja.xml=this.getFileData(!0,null,null,null,null,!I);f='<div class="mxgraph" style="'+(B?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(ja))+'"></div>';e=null!=e?"&fetch="+encodeURIComponent(e):"";da(f,'<script type="text/javascript" src="'+(0<e.length?
("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+e:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(e,f,k,z){var t=document.createElement("div");t.style.whiteSpace="nowrap";var B=document.createElement("h3");mxUtils.write(B,mxResources.get("html"));B.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";
t.appendChild(B);var I=document.createElement("div");I.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var O=document.createElement("input");O.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";O.setAttribute("value","url");O.setAttribute("type","radio");O.setAttribute("name","type-embedhtmldialog");B=O.cloneNode(!0);B.setAttribute("value","copy");I.appendChild(B);var J=document.createElement("span");mxUtils.write(J,mxResources.get("includeCopyOfMyDiagram"));
I.appendChild(J);mxUtils.br(I);I.appendChild(O);J=document.createElement("span");mxUtils.write(J,mxResources.get("publicDiagramUrl"));I.appendChild(J);var y=this.getCurrentFile();null==k&&null!=y&&y.constructor==window.DriveFile&&(J=document.createElement("a"),J.style.paddingLeft="12px",J.style.color="gray",J.style.cursor="pointer",mxUtils.write(J,mxResources.get("share")),I.appendChild(J),mxEvent.addListener(J,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(y.getId())})));
B.setAttribute("checked","checked");null==k&&O.setAttribute("disabled","disabled");t.appendChild(I);var ia=this.addLinkSection(t),da=this.addCheckbox(t,mxResources.get("zoom"),!0,null,!0);mxUtils.write(t,":");var ja=document.createElement("input");ja.setAttribute("type","text");ja.style.marginRight="16px";ja.style.width="60px";ja.style.marginLeft="4px";ja.style.marginRight="12px";ja.value="100%";t.appendChild(ja);var aa=this.addCheckbox(t,mxResources.get("fit"),!0);I=null!=this.pages&&1<this.pages.length;
var qa=qa=this.addCheckbox(t,mxResources.get("allPages"),I,!I),sa=this.addCheckbox(t,mxResources.get("layers"),!0),L=this.addCheckbox(t,mxResources.get("tags"),!0),V=this.addCheckbox(t,mxResources.get("lightbox"),!0),T=null;I=380;if(EditorUi.enableHtmlEditOption){T=this.addEditButton(t,V);var Y=T.getEditInput();Y.style.marginBottom="16px";I+=50;mxEvent.addListener(V,"change",function(){V.checked?Y.removeAttribute("disabled"):Y.setAttribute("disabled","disabled");Y.checked&&V.checked?T.getEditSelect().removeAttribute("disabled"):
T.getEditSelect().setAttribute("disabled","disabled")})}e=new CustomDialog(this,t,mxUtils.bind(this,function(){z(O.checked?k:null,da.checked,ja.value,ia.getTarget(),ia.getColor(),aa.checked,qa.checked,sa.checked,L.checked,V.checked,null!=T?T.getLink():null)}),null,e,f);this.showDialog(e.container,340,I,!0,!0);B.focus()};EditorUi.prototype.showPublishLinkDialog=function(e,f,k,z,t,B,I,O){var J=document.createElement("div");J.style.whiteSpace="nowrap";var y=document.createElement("h3");mxUtils.write(y,
e||mxResources.get("link"));y.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";J.appendChild(y);var ia=this.getCurrentFile();e=0;if(null==ia||ia.constructor!=window.DriveFile||f)I=null!=I?I:"https://www.diagrams.net/doc/faq/publish-diagram-as-link";else{e=80;I=null!=I?I:"https://www.diagrams.net/doc/faq/google-drive-publicly-publish-diagram";y=document.createElement("div");y.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";
var da=document.createElement("div");da.style.whiteSpace="normal";mxUtils.write(da,mxResources.get("linkAccountRequired"));y.appendChild(da);da=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(ia.getId())}));da.style.marginTop="12px";da.className="geBtn";y.appendChild(da);J.appendChild(y);da=document.createElement("a");da.style.paddingLeft="12px";da.style.color="gray";da.style.fontSize="11px";da.style.cursor="pointer";mxUtils.write(da,mxResources.get("check"));
y.appendChild(da);mxEvent.addListener(da,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(ka){this.spinner.stop();ka=new ErrorDialog(this,null,mxResources.get(null!=ka?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(ka.container,300,80,!0,!1);ka.init()}))}))}var ja=null,aa=null;if(null!=k||null!=z)e+=30,mxUtils.write(J,mxResources.get("width")+":"),ja=
document.createElement("input"),ja.setAttribute("type","text"),ja.style.marginRight="16px",ja.style.width="50px",ja.style.marginLeft="6px",ja.style.marginRight="16px",ja.style.marginBottom="10px",ja.value="100%",J.appendChild(ja),mxUtils.write(J,mxResources.get("height")+":"),aa=document.createElement("input"),aa.setAttribute("type","text"),aa.style.width="50px",aa.style.marginLeft="6px",aa.style.marginBottom="10px",aa.value=z+"px",J.appendChild(aa),mxUtils.br(J);var qa=this.addLinkSection(J,B);k=
null!=this.pages&&1<this.pages.length;var sa=null;if(null==ia||ia.constructor!=window.DriveFile||f)sa=this.addCheckbox(J,mxResources.get("allPages"),k,!k);var L=this.addCheckbox(J,mxResources.get("lightbox"),!0,null,null,!B),V=this.addEditButton(J,L),T=V.getEditInput();B&&(T.style.marginLeft=L.style.marginLeft,L.style.display="none",e-=20);var Y=this.addCheckbox(J,mxResources.get("layers"),!0);Y.style.marginLeft=T.style.marginLeft;Y.style.marginTop="8px";var W=this.addCheckbox(J,mxResources.get("tags"),
!0);W.style.marginLeft=T.style.marginLeft;W.style.marginBottom="16px";W.style.marginTop="16px";mxEvent.addListener(L,"change",function(){L.checked?(Y.removeAttribute("disabled"),T.removeAttribute("disabled")):(Y.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"));T.checked&&L.checked?V.getEditSelect().removeAttribute("disabled"):V.getEditSelect().setAttribute("disabled","disabled")});f=new CustomDialog(this,J,mxUtils.bind(this,function(){t(qa.getTarget(),qa.getColor(),null==
sa?!0:sa.checked,L.checked,V.getLink(),Y.checked,null!=ja?ja.value:null,null!=aa?aa.value:null,W.checked)}),null,mxResources.get("create"),I,O);this.showDialog(f.container,340,300+e,!0,!0);null!=ja?(ja.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ja.select():document.execCommand("selectAll",!1,null)):qa.focus()};EditorUi.prototype.showRemoteExportDialog=function(e,f,k,z,t){var B=document.createElement("div");B.style.whiteSpace="nowrap";var I=document.createElement("h3");mxUtils.write(I,
mxResources.get("image"));I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(t?"10":"4")+"px";B.appendChild(I);if(t){mxUtils.write(B,mxResources.get("zoom")+":");var O=document.createElement("input");O.setAttribute("type","text");O.style.marginRight="16px";O.style.width="60px";O.style.marginLeft="4px";O.style.marginRight="12px";O.value=this.lastExportZoom||"100%";B.appendChild(O);mxUtils.write(B,mxResources.get("borderWidth")+":");var J=document.createElement("input");J.setAttribute("type",
"text");J.style.marginRight="16px";J.style.width="60px";J.style.marginLeft="4px";J.value=this.lastExportBorder||"0";B.appendChild(J);mxUtils.br(B)}var y=this.addCheckbox(B,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),ia=z?null:this.addCheckbox(B,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);I=this.editor.graph;var da=z?null:this.addCheckbox(B,mxResources.get("transparentBackground"),I.background==mxConstants.NONE||null==I.background);null!=da&&
(da.style.marginBottom="16px");e=new CustomDialog(this,B,mxUtils.bind(this,function(){var ja=parseInt(O.value)/100||1,aa=parseInt(J.value)||0;k(!y.checked,null!=ia?ia.checked:!1,null!=da?da.checked:!1,ja,aa)}),null,e,f);this.showDialog(e.container,300,(t?25:0)+(z?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(e,f,k,z,t,B,I,O,J){I=null!=I?I:Editor.defaultIncludeDiagram;var y=document.createElement("div");y.style.whiteSpace="nowrap";var ia=this.editor.graph,da="jpeg"==O?220:300,ja=document.createElement("h3");
mxUtils.write(ja,e);ja.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";y.appendChild(ja);mxUtils.write(y,mxResources.get("zoom")+":");var aa=document.createElement("input");aa.setAttribute("type","text");aa.style.marginRight="16px";aa.style.width="60px";aa.style.marginLeft="4px";aa.style.marginRight="12px";aa.value=this.lastExportZoom||"100%";y.appendChild(aa);mxUtils.write(y,mxResources.get("borderWidth")+":");var qa=document.createElement("input");qa.setAttribute("type",
"text");qa.style.marginRight="16px";qa.style.width="60px";qa.style.marginLeft="4px";qa.value=this.lastExportBorder||"0";y.appendChild(qa);mxUtils.br(y);var sa=this.addCheckbox(y,mxResources.get("selectionOnly"),!1,ia.isSelectionEmpty()),L=document.createElement("input");L.style.marginTop="16px";L.style.marginRight="8px";L.style.marginLeft="24px";L.setAttribute("disabled","disabled");L.setAttribute("type","checkbox");var V=document.createElement("select");V.style.marginTop="16px";V.style.marginLeft=
"8px";e=["selectionOnly","diagram","page"];var T={};for(ja=0;ja<e.length;ja++)if(!ia.isSelectionEmpty()||"selectionOnly"!=e[ja]){var Y=document.createElement("option");mxUtils.write(Y,mxResources.get(e[ja]));Y.setAttribute("value",e[ja]);V.appendChild(Y);T[e[ja]]=Y}J?(mxUtils.write(y,mxResources.get("size")+":"),y.appendChild(V),mxUtils.br(y),da+=26,mxEvent.addListener(V,"change",function(){"selectionOnly"==V.value&&(sa.checked=!0)})):B&&(y.appendChild(L),mxUtils.write(y,mxResources.get("crop")),
mxUtils.br(y),da+=30,mxEvent.addListener(sa,"change",function(){sa.checked?L.removeAttribute("disabled"):L.setAttribute("disabled","disabled")}));ia.isSelectionEmpty()?J&&(sa.style.display="none",sa.nextSibling.style.display="none",sa.nextSibling.nextSibling.style.display="none",da-=30):(V.value="diagram",L.setAttribute("checked","checked"),L.defaultChecked=!0,mxEvent.addListener(sa,"change",function(){V.value=sa.checked?"selectionOnly":"diagram"}));var W=this.addCheckbox(y,mxResources.get("transparentBackground"),
!1,null,null,"jpeg"!=O),ka=null;Editor.isDarkMode()&&(ka=this.addCheckbox(y,mxResources.get("dark"),!0),da+=26);var q=this.addCheckbox(y,mxResources.get("shadow"),ia.shadowVisible),F=null;if("png"==O||"jpeg"==O)F=this.addCheckbox(y,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),da+=30;var S=this.addCheckbox(y,mxResources.get("includeCopyOfMyDiagram"),I,null,null,"jpeg"!=O);S.style.marginBottom="16px";var ba=document.createElement("input");ba.style.marginBottom="16px";ba.style.marginRight=
"8px";ba.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||ba.setAttribute("disabled","disabled");var U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="8px";U.style.marginRight="10px";U.style.marginBottom="16px";U.className="geBtn";B=document.createElement("option");B.setAttribute("value","none");mxUtils.write(B,mxResources.get("noChange"));U.appendChild(B);B=document.createElement("option");B.setAttribute("value","embedFonts");mxUtils.write(B,
mxResources.get("embedFonts"));U.appendChild(B);B=document.createElement("option");B.setAttribute("value","lblToSvg");mxUtils.write(B,mxResources.get("lblToSvg"));this.isOffline()||EditorUi.isElectronApp||U.appendChild(B);mxEvent.addListener(U,"change",mxUtils.bind(this,function(){"lblToSvg"==U.value?(ba.checked=!0,ba.setAttribute("disabled","disabled"),T.page.style.display="none","page"==V.value&&(V.value="diagram"),q.checked=!1,q.setAttribute("disabled","disabled"),ea.style.display="inline-block",
ca.style.display="none"):"disabled"==ba.getAttribute("disabled")&&(ba.checked=!1,ba.removeAttribute("disabled"),q.removeAttribute("disabled"),T.page.style.display="",ea.style.display="none",ca.style.display="")}));f&&(y.appendChild(ba),mxUtils.write(y,mxResources.get("embedImages")),mxUtils.br(y),mxUtils.write(y,mxResources.get("txtSettings")+":"),y.appendChild(U),mxUtils.br(y),da+=60);var ca=document.createElement("select");ca.style.maxWidth="260px";ca.style.marginLeft="8px";ca.style.marginRight=
"10px";ca.className="geBtn";f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));ca.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));ca.appendChild(f);f=document.createElement("option");f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));ca.appendChild(f);var ea=document.createElement("div");mxUtils.write(ea,mxResources.get("LinksLost"));
ea.style.margin="7px";ea.style.display="none";"svg"==O&&(mxUtils.write(y,mxResources.get("links")+":"),y.appendChild(ca),y.appendChild(ea),mxUtils.br(y),mxUtils.br(y),da+=50);k=new CustomDialog(this,y,mxUtils.bind(this,function(){this.lastExportBorder=qa.value;this.lastExportZoom=aa.value;t(aa.value,W.checked,!sa.checked,q.checked,S.checked,ba.checked,qa.value,L.checked,!1,ca.value,null!=F?F.checked:null,null!=ka?ka.checked:null,V.value,"embedFonts"==U.value,"lblToSvg"==U.value)}),null,k,z);this.showDialog(k.container,
340,da,!0,!0,null,null,null,null,!0);aa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?aa.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(e,f,k,z,t){var B=document.createElement("div");B.style.whiteSpace="nowrap";var I=this.editor.graph;if(null!=f){var O=document.createElement("h3");mxUtils.write(O,f);O.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";B.appendChild(O)}var J=this.addCheckbox(B,mxResources.get("fit"),
!0),y=this.addCheckbox(B,mxResources.get("shadow"),I.shadowVisible&&z,!z),ia=this.addCheckbox(B,k),da=this.addCheckbox(B,mxResources.get("lightbox"),!0),ja=this.addEditButton(B,da),aa=ja.getEditInput(),qa=1<I.model.getChildCount(I.model.getRoot()),sa=this.addCheckbox(B,mxResources.get("layers"),qa,!qa);sa.style.marginLeft=aa.style.marginLeft;sa.style.marginBottom="12px";sa.style.marginTop="8px";mxEvent.addListener(da,"change",function(){da.checked?(qa&&sa.removeAttribute("disabled"),aa.removeAttribute("disabled")):
(sa.setAttribute("disabled","disabled"),aa.setAttribute("disabled","disabled"));aa.checked&&da.checked?ja.getEditSelect().removeAttribute("disabled"):ja.getEditSelect().setAttribute("disabled","disabled")});f=new CustomDialog(this,B,mxUtils.bind(this,function(){e(J.checked,y.checked,ia.checked,da.checked,ja.getLink(),sa.checked)}),null,mxResources.get("embed"),t);this.showDialog(f.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(e,f,k,z,t,B,I,O){function J(aa){var qa=" ",sa=
"";z&&(qa=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(null!=ia?"&page="+ia:"")+(t?"&edit=_blank":"")+(B?"&layers=1":"")+"');}})(this);\"",sa+="cursor:pointer;");e&&(sa+="max-width:100%;");var L=
"";k&&(L=' width="'+Math.round(y.width)+'" height="'+Math.round(y.height)+'"');I('<img src="'+aa+'"'+L+(""!=sa?' style="'+sa+'"':"")+qa+"/>")}var y=this.editor.graph.getGraphBounds(),ia=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(aa){var qa=z?this.getFileData(!0):null;aa=this.createImageDataUri(aa,qa,"png");J(aa)}),null,null,null,mxUtils.bind(this,function(aa){O({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,f,null,
null,Editor.defaultBorder);else if(f=this.getFileData(!0),y.width*y.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var da="";k&&(da="&w="+Math.round(2*y.width)+"&h="+Math.round(2*y.height));var ja=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(z?"1":"0")+da+"&xml="+encodeURIComponent(f));ja.send(mxUtils.bind(this,function(){200<=ja.getStatus()&&299>=ja.getStatus()?J("data:image/png;base64,"+ja.getText()):O({message:mxResources.get("unknownError")})}))}else O({message:mxResources.get("drawingTooLarge")})};
EditorUi.prototype.createEmbedSvg=function(e,f,k,z,t,B,I){var O=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k),J=O.getElementsByTagName("a");if(null!=J)for(var y=0;y<J.length;y++){var ia=J[y].getAttribute("href");null!=ia&&"#"==ia.charAt(0)&&"_blank"==J[y].getAttribute("target")&&J[y].removeAttribute("target")}z&&O.setAttribute("content",this.getFileData(!0));f&&this.editor.graph.addSvgShadow(O);if(k){var da=" ",ja="";z&&(da="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
EditorUi.lightboxHost+"/?client=1"+(t?"&edit=_blank":"")+(B?"&layers=1":"")+"');}})(this);\"",ja+="cursor:pointer;");e&&(ja+="max-width:100%;");this.editor.convertImages(O,mxUtils.bind(this,function(aa){I('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(aa))+'"'+(""!=ja?' style="'+ja+'"':"")+da+"/>")}))}else ja="",z&&(f=this.getSelectedPageIndex(),O.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+
EditorUi.lightboxHost+"/?client=1"+(null!=f?"&page="+f:"")+(t?"&edit=_blank":"")+(B?"&layers=1":"")+"');}}})(this);"),ja+="cursor:pointer;"),e&&(e=parseInt(O.getAttribute("width")),t=parseInt(O.getAttribute("height")),O.setAttribute("viewBox","-0.5 -0.5 "+e+" "+t),ja+="max-width:100%;max-height:"+t+"px;",O.removeAttribute("height")),""!=ja&&O.setAttribute("style",ja),this.editor.addFontCss(O),this.editor.graph.mathEnabled&&this.editor.addMathCss(O),I(mxUtils.getXml(O))};EditorUi.prototype.timeSince=
function(e){e=Math.floor((new Date-e)/1E3);var f=Math.floor(e/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(e/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(e/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(e/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(e/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(e,f){if(null!=e){var k=null;if("diagram"==
e.nodeName)k=e;else if("mxfile"==e.nodeName){var z=e.getElementsByTagName("diagram");if(0<z.length){k=z[0];var t=f.getGlobalVariable;f.getGlobalVariable=function(B){return"page"==B?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==B?1:t.apply(this,arguments)}}}null!=k&&(e=Editor.parseDiagramNode(k))}z=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(e)}catch(B){}finally{this.editor.graph=z}return e};EditorUi.prototype.getPngFileProperties=function(e){var f=
1,k=0;if(null!=e){if(e.hasAttribute("scale")){var z=parseFloat(e.getAttribute("scale"));!isNaN(z)&&0<z&&(f=z)}e.hasAttribute("border")&&(z=parseInt(e.getAttribute("border")),!isNaN(z)&&0<z&&(k=z))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=function(e,f,k,z,t){try{var B=this.editor.graph,I=null!=B.themes&&"darkTheme"==B.defaultThemeName,O=null;if(null!=k&&0<k.length)B=this.createTemporaryGraph(I?B.getDefaultStylesheet():B.getStylesheet()),document.body.appendChild(B.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,
!0),B),O=k;else if(I||null!=this.pages&&this.currentPage!=this.pages[0]){B=this.createTemporaryGraph(I?B.getDefaultStylesheet():B.getStylesheet());var J=B.getGlobalVariable;B.setBackgroundImage=this.editor.graph.setBackgroundImage;var y=this.pages[0];this.currentPage==y?B.setBackgroundImage(this.editor.graph.backgroundImage):null!=y.viewState&&null!=y.viewState&&B.setBackgroundImage(y.viewState.backgroundImage);B.getGlobalVariable=function(ia){return"page"==ia?y.getName():"pagenumber"==ia?1:J.apply(this,
arguments)};document.body.appendChild(B.container);B.model.setRoot(y.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(ia){try{null==O&&(O=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var da=ia.toDataURL("image/png");da=Editor.writeGraphModelToPng(da,"tEXt","mxfile",encodeURIComponent(O));e(da.substring(da.lastIndexOf(",")+1));B!=this.editor.graph&&B.container.parentNode.removeChild(B.container)}catch(ja){null!=f&&f(ja)}}),null,null,null,mxUtils.bind(this,function(ia){null!=
f&&f(ia)}),null,null,z,null,B.shadowVisible,null,B,t,null,null,null,"diagram",null)}catch(ia){null!=f&&f(ia)}};EditorUi.prototype.getEmbeddedSvg=function(e,f,k,z,t,B,I,O,J,y,ia,da,ja){O=null!=O?O:!0;ia=null!=ia?ia:0;I=null!=J?J:f.background;I==mxConstants.NONE&&(I=null);B=f.getSvg(I,y,ia,null,null,B,null,null,null,f.shadowVisible||da,null,ja,"diagram");(f.shadowVisible||da)&&f.addSvgShadow(B,null,null,0==ia);null!=e&&B.setAttribute("content",e);null!=k&&B.setAttribute("resource",k);var aa=mxUtils.bind(this,
function(qa){qa=(z?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(qa);null!=t&&t(qa);return qa});f.mathEnabled&&this.editor.addMathCss(B);if(null!=t)this.embedFonts(B,mxUtils.bind(this,function(qa){O?this.editor.convertImages(qa,mxUtils.bind(this,function(sa){aa(sa)})):aa(qa)}));else return aa(B)};EditorUi.prototype.embedFonts=function(e,f){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(e,
this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(k){try{null!=k&&this.editor.addFontCss(e,k),f(e)}catch(z){f(e)}}))}catch(k){f(e)}}))};EditorUi.prototype.exportImage=function(e,f,k,z,t,B,I,O,J,y,ia,da,ja){J=null!=J?J:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var aa=this.editor.graph.isSelectionEmpty();k=null!=k?k:aa;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(qa){this.spinner.stop();
try{this.saveCanvas(qa,t?this.getFileData(!0,null,null,null,k,O):null,J,null==this.pages||0==this.pages.length,ia)}catch(sa){this.handleError(sa)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(qa){this.spinner.stop();this.handleError(qa)}),null,k,e||1,f,z,null,null,B,I,y,da,ja)}catch(qa){this.spinner.stop(),this.handleError(qa)}}};EditorUi.prototype.isCorsEnabledForUrl=function(e){return this.editor.isCorsEnabledForUrl(e)};EditorUi.prototype.importXml=function(e,f,k,z,t,B,I){f=null!=
f?f:0;k=null!=k?k:0;var O=[];try{var J=this.editor.graph;if(null!=e&&0<e.length){J.model.beginUpdate();try{var y=mxUtils.parseXml(e);e={};var ia=this.editor.extractGraphModel(y.documentElement,null!=this.pages);if(null!=ia&&"mxfile"==ia.nodeName&&null!=this.pages){var da=ia.getElementsByTagName("diagram");if(1==da.length&&!B){if(ia=Editor.parseDiagramNode(da[0]),null!=this.currentPage&&(e[da[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ja=da[0].getAttribute("name");null!=
ja&&""!=ja&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,ja))}}else if(0<da.length){B=[];var aa=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(e[da[0].getAttribute("id")]=this.pages[0].getId(),ia=Editor.parseDiagramNode(da[0]),z=!1,aa=1);for(;aa<da.length;aa++){var qa=da[aa].getAttribute("id");da[aa].removeAttribute("id");var sa=this.updatePageRoot(new DiagramPage(da[aa]));e[qa]=da[aa].getAttribute("id");var L=this.pages.length;null==sa.getName()&&sa.setName(mxResources.get("pageWithNumber",
[L+1]));J.model.execute(new ChangePage(this,sa,sa,L,!0));B.push(sa)}this.updatePageLinks(e,B)}}if(null!=ia&&"mxGraphModel"===ia.nodeName){O=J.importGraphModel(ia,f,k,z);if(null!=O)for(aa=0;aa<O.length;aa++)this.updatePageLinksForCell(e,O[aa]);var V=J.parseBackgroundImage(ia.getAttribute("backgroundImage"));if(null!=V&&null!=V.originalSrc){this.updateBackgroundPageLink(e,V);var T=new ChangePageSetup(this,null,V);T.ignoreColor=!0;J.model.execute(T)}}I&&this.insertHandler(O,null,null,J.defaultVertexStyle,
J.defaultEdgeStyle,!1,!0)}finally{J.model.endUpdate()}}}catch(Y){if(t)throw Y;this.handleError(Y)}return O};EditorUi.prototype.updatePageLinks=function(e,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(e,f[k].root),null!=f[k].viewState&&this.updateBackgroundPageLink(e,f[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(e,f){try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var k=e[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=k&&(f.originalSrc=
"data:page/id,"+k)}}catch(z){}};EditorUi.prototype.updatePageLinksForCell=function(e,f){var k=document.createElement("div"),z=this.editor.graph,t=z.getLinkForCell(f);null!=t&&z.setLinkForCell(f,this.updatePageLink(e,t));if(z.isHtmlLabel(f)){k.innerHTML=z.sanitizeHtml(z.getLabel(f));for(var B=k.getElementsByTagName("a"),I=!1,O=0;O<B.length;O++)t=B[O].getAttribute("href"),null!=t&&(B[O].setAttribute("href",this.updatePageLink(e,t)),I=!0);I&&z.labelChanged(f,k.innerHTML)}for(O=0;O<z.model.getChildCount(f);O++)this.updatePageLinksForCell(e,
z.model.getChildAt(f,O))};EditorUi.prototype.updatePageLink=function(e,f){if(Graph.isPageLink(f)){var k=e[f.substring(f.indexOf(",")+1)];f=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==f.substring(0,17))try{var z=JSON.parse(f.substring(17));if(null!=z.actions){for(var t=0;t<z.actions.length;t++){var B=z.actions[t];if(null!=B.open&&Graph.isPageLink(B.open)){var I=B.open.substring(B.open.indexOf(",")+1);k=e[I];null!=k?B.open="data:page/id,"+k:null==this.getPageById(I)&&delete B.open}}f=
"data:action/json,"+JSON.stringify(z)}}catch(O){}return f};EditorUi.prototype.isRemoteVisioFormat=function(e){return/(\.v(sd|dx))($|\?)/i.test(e)||/(\.vs(s|x))($|\?)/i.test(e)};EditorUi.prototype.importVisio=function(e,f,k,z,t){z=null!=z?z:e.name;k=null!=k?k:mxUtils.bind(this,function(I){this.handleError(I)});var B=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var I=this.isRemoteVisioFormat(z);try{var O="UNKNOWN-VISIO",J=z.lastIndexOf(".");if(0<=J&&J<z.length)O=z.substring(J+
1).toUpperCase();else{var y=z.lastIndexOf("/");0<=y&&y<z.length&&(z=z.substring(y+1))}EditorUi.logEvent({category:O+"-MS-IMPORT-FILE",action:"filename_"+z,label:I?"remote":"local"})}catch(da){}if(I)if(null==VSD_CONVERT_URL||this.isOffline())k({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{I=new FormData;I.append("file1",e,z);var ia=new XMLHttpRequest;ia.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(z)?"?stencil=1":
""));ia.responseType="blob";this.addRemoteServiceSecurityCheck(ia);null!=t&&ia.setRequestHeader("x-convert-custom",t);ia.onreadystatechange=mxUtils.bind(this,function(){if(4==ia.readyState)if(200<=ia.status&&299>=ia.status)try{var da=ia.response;if("text/xml"==da.type){var ja=new FileReader;ja.onload=mxUtils.bind(this,function(aa){try{f(aa.target.result)}catch(qa){k({message:mxResources.get("errorLoadingFile")})}});ja.readAsText(da)}else this.doImportVisio(da,f,k,z)}catch(aa){k(aa)}else try{""==ia.responseType||
"text"==ia.responseType?k({message:ia.responseText}):(ja=new FileReader,ja.onload=function(){k({message:JSON.parse(ja.result).Message})},ja.readAsText(ia.response))}catch(aa){k({})}});ia.send(I)}else try{this.doImportVisio(e,f,k,z)}catch(da){k(da)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?B():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",B))};EditorUi.prototype.importGraphML=
function(e,f,k){k=null!=k?k:mxUtils.bind(this,function(t){this.handleError(t)});var z=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(e,f,k)}catch(t){k(t)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?z():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",z))};EditorUi.prototype.exportVisio=function(e){var f=mxUtils.bind(this,
function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams(e)||this.handleError({message:mxResources.get("unknownError")})}catch(k){this.handleError(k)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?f():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",f))};EditorUi.prototype.convertLucidChart=function(e,
f,k){var z=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter)try{var t=JSON.parse(e);f(LucidImporter.importState(t));try{if(EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",action:"size_"+e.length}),null!=window.console&&"1"==urlParams.test){var B=[(new Date).toISOString(),"convertLucidChart",t];null!=t.state&&B.push(JSON.parse(t.state));if(null!=t.svgThumbs)for(var I=0;I<t.svgThumbs.length;I++)B.push(Editor.createSvgDataUri(t.svgThumbs[I]));null!=
t.thumb&&B.push(t.thumb);console.log.apply(console,B)}}catch(O){}}catch(O){null!=window.console&&console.error(O),k(O)}else k({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(z,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",
function(){mxscript("js/orgchart/mxOrgChartLayout.js",z)})})})}):mxscript("js/extensions.min.js",z))};EditorUi.prototype.generateMermaidImage=function(e,f,k,z){var t=this,B=function(){try{this.loadingMermaid=!1,f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig),f.securityLevel="strict",f.startOnLoad=!1,Editor.isDarkMode()&&(f.theme="dark"),mermaid.mermaidAPI.initialize(f),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),e,function(I){try{if(mxClient.IS_IE||mxClient.IS_IE11)I=
I.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var O=mxUtils.parseXml(I).getElementsByTagName("svg");if(0<O.length){var J=parseFloat(O[0].getAttribute("width")),y=parseFloat(O[0].getAttribute("height"));if(isNaN(J)||isNaN(y))try{var ia=O[0].getAttribute("viewBox").split(/\s+/);J=parseFloat(ia[2]);y=parseFloat(ia[3])}catch(da){J=J||100,y=y||100}k(t.convertDataUri(Editor.createSvgDataUri(I)),J,y)}else z({message:mxResources.get("invalidInput")})}catch(da){z(da)}})}catch(I){z(I)}};
"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?B():(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",B):mxscript("js/extensions.min.js",B))};EditorUi.prototype.generatePlantUmlImage=function(e,f,k,z){function t(O,J,y){c1=O>>2;c2=(O&3)<<4|J>>4;c3=(J&15)<<2|y>>6;c4=y&63;r="";r+=B(c1&63);r+=B(c2&63);r+=B(c3&63);return r+=B(c4&63)}function B(O){if(10>O)return String.fromCharCode(48+O);O-=10;if(26>O)return String.fromCharCode(65+O);O-=26;if(26>O)return String.fromCharCode(97+
O);O-=26;return 0==O?"-":1==O?"_":"?"}var I=new XMLHttpRequest;I.open("GET",("txt"==f?PLANT_URL+"/txt/":"png"==f?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(O){r="";for(i=0;i<O.length;i+=3)r=i+2==O.length?r+t(O.charCodeAt(i),O.charCodeAt(i+1),0):i+1==O.length?r+t(O.charCodeAt(i),0,0):r+t(O.charCodeAt(i),O.charCodeAt(i+1),O.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(e))),!0);"txt"!=f&&(I.responseType="blob");I.onload=function(O){if(200<=this.status&&300>this.status)if("txt"==
f)k(this.response);else{var J=new FileReader;J.readAsDataURL(this.response);J.onloadend=function(y){var ia=new Image;ia.onload=function(){try{var da=ia.width,ja=ia.height;if(0==da&&0==ja){var aa=J.result,qa=aa.indexOf(","),sa=decodeURIComponent(escape(atob(aa.substring(qa+1)))),L=mxUtils.parseXml(sa).getElementsByTagName("svg");0<L.length&&(da=parseFloat(L[0].getAttribute("width")),ja=parseFloat(L[0].getAttribute("height")))}k(J.result,da,ja)}catch(V){z(V)}};ia.src=J.result};J.onerror=function(y){z(y)}}else z(O)};
I.onerror=function(O){z(O)};I.send()};EditorUi.prototype.insertAsPreText=function(e,f,k){var z=this.editor.graph,t=null;z.getModel().beginUpdate();try{t=z.insertVertex(null,null,"<pre>"+e+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),z.updateCellSize(t,!0)}finally{z.getModel().endUpdate()}return t};EditorUi.prototype.insertTextAt=function(e,f,k,z,t,B,I,O){B=null!=B?B:!0;I=null!=I?I:!0;if(null!=e)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(e))this.isOffline()?
this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(e.replace(/\s+/g," "),mxUtils.bind(this,function(ja){4==ja.readyState&&200<=ja.status&&299>=ja.status&&this.editor.graph.setSelectionCells(this.insertTextAt(ja.responseText,f,k,!0))}));else if("data:"==e.substring(0,5)||!this.isOffline()&&(t||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(e))){var J=this.editor.graph;if("data:application/pdf;base64,"==e.substring(0,28)){var y=Editor.extractGraphModelFromPdf(e);if(null!=
y&&0<y.length)return this.importXml(y,f,k,B,!0,O)}if(Editor.isPngDataUrl(e)&&(y=Editor.extractGraphModelFromPng(e),null!=y&&0<y.length))return this.importXml(y,f,k,B,!0,O);if("data:image/svg+xml;"==e.substring(0,19))try{y=null;"data:image/svg+xml;base64,"==e.substring(0,26)?(y=e.substring(e.indexOf(",")+1),y=window.atob&&!mxClient.IS_SF?atob(y):Base64.decode(y,!0)):y=decodeURIComponent(e.substring(e.indexOf(",")+1));var ia=this.importXml(y,f,k,B,!0,O);if(0<ia.length)return ia}catch(ja){}this.loadImage(e,
mxUtils.bind(this,function(ja){if("data:"==e.substring(0,5))this.resizeImage(ja,e,mxUtils.bind(this,function(sa,L,V){J.setSelectionCell(J.insertVertex(null,null,"",J.snap(f),J.snap(k),L,V,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(sa)+";"))}),I,this.maxImageSize);else{var aa=Math.min(1,Math.min(this.maxImageSize/ja.width,this.maxImageSize/ja.height)),qa=Math.round(ja.width*aa);ja=Math.round(ja.height*
aa);J.setSelectionCell(J.insertVertex(null,null,"",J.snap(f),J.snap(k),qa,ja,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+e+";"))}}),mxUtils.bind(this,function(){var ja=null;J.getModel().beginUpdate();try{ja=J.insertVertex(J.getDefaultParent(),null,e,J.snap(f),J.snap(k),1,1,"text;"+(z?"html=1;":"")),J.updateCellSize(ja),J.fireEvent(new mxEventObject("textInserted","cells",[ja]))}finally{J.getModel().endUpdate()}J.setSelectionCell(ja)}))}else{e=
Graph.zapGremlins(mxUtils.trim(e));if(this.isCompatibleString(e))return this.importXml(e,f,k,B,null,O);if(0<e.length)if(this.isLucidChartData(e))this.convertLucidChart(e,mxUtils.bind(this,function(ja){this.editor.graph.setSelectionCells(this.importXml(ja,f,k,B,null,O))}),mxUtils.bind(this,function(ja){this.handleError(ja)}));else{J=this.editor.graph;t=null;J.getModel().beginUpdate();try{t=J.insertVertex(J.getDefaultParent(),null,"",J.snap(f),J.snap(k),1,1,"text;whiteSpace=wrap;"+(z?"html=1;":""));
J.fireEvent(new mxEventObject("textInserted","cells",[t]));"<"==e.charAt(0)&&e.indexOf(">")==e.length-1&&(e=mxUtils.htmlEntities(e));e.length>this.maxTextBytes&&(e=e.substring(0,this.maxTextBytes)+"...");t.value=e;J.updateCellSize(t);if(0<this.maxTextWidth&&t.geometry.width>this.maxTextWidth){var da=J.getPreferredSizeForCell(t,this.maxTextWidth);t.geometry.width=da.width;t.geometry.height=da.height}Graph.isLink(t.value)&&J.setLinkForCell(t,t.value);t.geometry.width+=J.gridSize;t.geometry.height+=
J.gridSize}finally{J.getModel().endUpdate()}return[t]}}return[]};EditorUi.prototype.formatFileSize=function(e){var f=-1;do e/=1024,f++;while(1024<e);return Math.max(e,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(e){if("data:"==e.substring(0,5)){var f=e.indexOf(";");0<f&&(e=e.substring(0,f)+e.substring(e.indexOf(",",f+1)))}return e};EditorUi.prototype.isRemoteFileFormat=function(e,f){return/("contentType":\s*"application\/gliffy\+json")/.test(e)};
EditorUi.prototype.isLucidChartData=function(e){return null!=e&&('{"state":"{\\"Properties\\":'==e.substring(0,26)||'{"Properties":'==e.substring(0,14))};EditorUi.prototype.importLocalFile=function(e,f){if(e&&Graph.fileSupport){if(null==this.importFileInputElt){var k=document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&(this.importFiles(k.files,null,null,this.maxImageSize),k.type="",k.type="file",k.value="")}));k.style.display=
"none";document.body.appendChild(k);this.importFileInputElt=k}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(I,O){StorageFile.listFiles(this,"F",I,O)});window.openBrowserFile=mxUtils.bind(this,function(I,O,J){StorageFile.getFileContent(this,I,O,J)});window.deleteBrowserFile=mxUtils.bind(this,function(I,O,J){StorageFile.deleteFile(this,I,O,J)});if(!f){var z=Editor.useLocalStorage;Editor.useLocalStorage=!e}window.openFile=
new OpenFile(mxUtils.bind(this,function(I){this.hideDialog(I)}));window.openFile.setConsumer(mxUtils.bind(this,function(I,O){null!=O&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(O)?(I=new Blob([I],{type:"application/octet-stream"}),this.importVisio(I,mxUtils.bind(this,function(J){this.importXml(J,0,0,!0)}),null,O)):this.editor.graph.setSelectionCells(this.importXml(I,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,
function(){window.openFile=null});if(!f){var t=this.dialog,B=t.close;this.dialog.close=mxUtils.bind(this,function(I){Editor.useLocalStorage=z;B.apply(t,arguments);I&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(e,f,k){var z=this,t=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(e).then(function(B){if(mxUtils.isEmptyObject(B.files))k();else{var I=0,O,J=!1;B.forEach(function(y,ia){y=
ia.name.toLowerCase();"diagram/diagram.xml"==y?(J=!0,ia.async("string").then(function(da){0==da.indexOf("<mxfile ")?f(da):k()})):0==y.indexOf("versions/")&&(y=parseInt(y.substr(9)),y>I&&(I=y,O=ia))});0<I?O.async("string").then(function(y){(new XMLHttpRequest).upload&&z.isRemoteFileFormat(y,e.name)?z.isOffline()?z.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):z.parseFileData(y,mxUtils.bind(this,function(ia){4==ia.readyState&&(200<=ia.status&&299>=ia.status?f(ia.responseText):
k())}),e.name):k()}):J||k()}},function(B){k(B)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?t():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",t))};EditorUi.prototype.importFile=function(e,f,k,z,t,B,I,O,J,y,ia,da){y=null!=y?y:!0;var ja=!1,aa=null,qa=mxUtils.bind(this,function(sa){var L=null;null!=sa&&"<mxlibrary"==sa.substring(0,10)?this.loadLibrary(new LocalLibrary(this,sa,I)):L=this.importXml(sa,k,z,y,null,null!=da?mxEvent.isControlDown(da):null);null!=
O&&O(L)});"image"==f.substring(0,5)?(J=!1,"image/png"==f.substring(0,9)&&(f=ia?null:this.extractGraphModelFromPng(e),null!=f&&0<f.length&&(aa=this.importXml(f,k,z,y,null,null!=da?mxEvent.isControlDown(da):null),J=!0)),J||(f=this.editor.graph,J=e.indexOf(";"),0<J&&(e=e.substring(0,J)+e.substring(e.indexOf(",",J+1))),y&&f.isGridEnabled()&&(k=f.snap(k),z=f.snap(z)),aa=[f.insertVertex(null,null,"",k,z,t,B,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
e+";")])):/(\.*<graphml )/.test(e)?(ja=!0,this.importGraphML(e,qa)):null!=J&&null!=I&&(/(\.v(dx|sdx?))($|\?)/i.test(I)||/(\.vs(x|sx?))($|\?)/i.test(I))?(ja=!0,this.importVisio(J,qa)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(e,I)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(ja=!0,t=mxUtils.bind(this,function(sa){4==sa.readyState&&(200<=sa.status&&299>=sa.status?qa(sa.responseText):null!=O&&O(null))}),null!=e?this.parseFileData(e,t,I):this.parseFile(J,
t,I)):0==e.indexOf("PK")&&null!=J?(ja=!0,this.importZipFile(J,qa,mxUtils.bind(this,function(){aa=this.insertTextAt(this.validateFileData(e),k,z,!0,null,y);O(aa)}))):/(\.v(sd|dx))($|\?)/i.test(I)||/(\.vs(s|x))($|\?)/i.test(I)||(aa=this.insertTextAt(this.validateFileData(e),k,z,!0,null,y,null,null!=da?mxEvent.isControlDown(da):null));ja||null==O||O(aa);return aa};EditorUi.prototype.importFiles=function(e,f,k,z,t,B,I,O,J,y,ia,da,ja){z=null!=z?z:this.maxImageSize;y=null!=y?y:this.maxImageBytes;var aa=
null!=f&&null!=k,qa=!0;f=null!=f?f:0;k=null!=k?k:0;var sa=!1;if(!mxClient.IS_CHROMEAPP&&null!=e)for(var L=ia||this.resampleThreshold,V=0;V<e.length;V++)if("image/svg"!==e[V].type.substring(0,9)&&"image/"===e[V].type.substring(0,6)&&e[V].size>L){sa=!0;break}var T=mxUtils.bind(this,function(){var Y=this.editor.graph,W=Y.gridSize;t=null!=t?t:mxUtils.bind(this,function(U,ca,ea,na,ra,ya,va,Da,pa){try{return null!=U&&"<mxlibrary"==U.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,
U,va)),null):this.isCompatibleString(U)&&1==e.length&&this.isBlankFile()&&!this.canUndo()?(this.spinner.stop(),this.fileLoaded(new LocalFile(this,U,va,!0)),null):this.importFile(U,ca,ea,na,ra,ya,va,Da,pa,aa,da,ja)}catch(Aa){return this.handleError(Aa),null}});B=null!=B?B:mxUtils.bind(this,function(U){Y.setSelectionCells(U)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var ka=e.length,q=ka,F=[],S=mxUtils.bind(this,function(U,ca){F[U]=ca;if(0==--q){this.spinner.stop();if(null!=
O)O(F);else{var ea=[];Y.getModel().beginUpdate();try{for(U=0;U<F.length;U++){var na=F[U]();null!=na&&(ea=ea.concat(na))}}finally{Y.getModel().endUpdate()}}B(ea)}}),ba=0;ba<ka;ba++)mxUtils.bind(this,function(U){var ca=e[U];if(null!=ca){var ea=new FileReader;ea.onload=mxUtils.bind(this,function(na){if(null==I||I(ca))if("image/"==ca.type.substring(0,6))if("image/svg"==ca.type.substring(0,9)){var ra=Graph.clipSvgDataUri(na.target.result),ya=ra.indexOf(",");ya=decodeURIComponent(escape(atob(ra.substring(ya+
1))));var va=mxUtils.parseXml(ya);ya=va.getElementsByTagName("svg");if(0<ya.length){ya=ya[0];var Da=da?null:ya.getAttribute("content");null!=Da&&"<"!=Da.charAt(0)&&"%"!=Da.charAt(0)&&(Da=unescape(window.atob?atob(Da):Base64.decode(Da,!0)));null!=Da&&"%"==Da.charAt(0)&&(Da=decodeURIComponent(Da));null==Da||"<mxfile "!==Da.substring(0,8)&&"<mxGraphModel "!==Da.substring(0,14)?S(U,mxUtils.bind(this,function(){try{if(null!=va){var xa=va.getElementsByTagName("svg");if(0<xa.length){var Ma=xa[0],Oa=Ma.getAttribute("width"),
Na=Ma.getAttribute("height");Oa=null!=Oa&&"%"!=Oa.charAt(Oa.length-1)?parseFloat(Oa):NaN;Na=null!=Na&&"%"!=Na.charAt(Na.length-1)?parseFloat(Na):NaN;var La=Ma.getAttribute("viewBox");if(null==La||0==La.length)Ma.setAttribute("viewBox","0 0 "+Oa+" "+Na);else if(isNaN(Oa)||isNaN(Na)){var Ba=La.split(" ");3<Ba.length&&(Oa=parseFloat(Ba[2]),Na=parseFloat(Ba[3]))}ra=Editor.createSvgDataUri(mxUtils.getXml(Ma));var ab=Math.min(1,Math.min(z/Math.max(1,Oa)),z/Math.max(1,Na)),Xa=t(ra,ca.type,f+U*W,k+U*W,Math.max(1,
Math.round(Oa*ab)),Math.max(1,Math.round(Na*ab)),ca.name);if(isNaN(Oa)||isNaN(Na)){var x=new Image;x.onload=mxUtils.bind(this,function(){Oa=Math.max(1,x.width);Na=Math.max(1,x.height);Xa[0].geometry.width=Oa;Xa[0].geometry.height=Na;Ma.setAttribute("viewBox","0 0 "+Oa+" "+Na);ra=Editor.createSvgDataUri(mxUtils.getXml(Ma));var H=ra.indexOf(";");0<H&&(ra=ra.substring(0,H)+ra.substring(ra.indexOf(",",H+1)));Y.setCellStyles("image",ra,[Xa[0]])});x.src=Editor.createSvgDataUri(mxUtils.getXml(Ma))}return Xa}}}catch(H){}return null})):
S(U,mxUtils.bind(this,function(){return t(Da,"text/xml",f+U*W,k+U*W,0,0,ca.name)}))}else S(U,mxUtils.bind(this,function(){return null}))}else{ya=!1;if("image/png"==ca.type){var pa=da?null:this.extractGraphModelFromPng(na.target.result);if(null!=pa&&0<pa.length){var Aa=new Image;Aa.src=na.target.result;S(U,mxUtils.bind(this,function(){return t(pa,"text/xml",f+U*W,k+U*W,Aa.width,Aa.height,ca.name)}));ya=!0}}ya||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),
mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(na.target.result,mxUtils.bind(this,function(xa){this.resizeImage(xa,na.target.result,mxUtils.bind(this,function(Ma,Oa,Na){S(U,mxUtils.bind(this,function(){if(null!=Ma&&Ma.length<y){var La=qa&&this.isResampleImageSize(ca.size,ia)?Math.min(1,Math.min(z/Oa,z/Na)):1;return t(Ma,ca.type,f+U*W,k+U*W,Math.round(Oa*La),Math.round(Na*La),ca.name)}this.handleError({message:mxResources.get("imageTooBig")});
return null}))}),qa,z,ia,ca.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ra=na.target.result,t(ra,ca.type,f+U*W,k+U*W,240,160,ca.name,function(xa){S(U,function(){return xa})},ca)});/(\.v(dx|sdx?))($|\?)/i.test(ca.name)||/(\.vs(x|sx?))($|\?)/i.test(ca.name)?t(null,ca.type,f+U*W,k+U*W,240,160,ca.name,function(na){S(U,function(){return na})},ca):"image"==ca.type.substring(0,5)||"application/pdf"==ca.type?ea.readAsDataURL(ca):ea.readAsText(ca)}})(ba)});
if(sa){sa=[];for(V=0;V<e.length;V++)sa.push(e[V]);e=sa;this.confirmImageResize(function(Y){qa=Y;T()},J)}else T()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(e,f){f=null!=f?f:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},z=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():
null,t=function(B,I){if(B||f)mxSettings.setResizeImages(B?I:null),mxSettings.save();k();e(I)};null==z||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(B){t(B,!0)},function(B){t(B,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,
!0,!0):t(!1,z)};EditorUi.prototype.parseFile=function(e,f,k){k=null!=k?k:e.name;var z=new FileReader;z.onload=mxUtils.bind(this,function(){this.parseFileData(z.result,f,k)});z.readAsText(e)};EditorUi.prototype.parseFileData=function(e,f,k){var z=new XMLHttpRequest;z.open("POST",OPEN_URL);z.setRequestHeader("Content-Type","application/x-www-form-urlencoded");z.onreadystatechange=function(){f(z)};z.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(e));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",
action:"size_"+file.size})}catch(t){}};EditorUi.prototype.isResampleImageSize=function(e,f){f=null!=f?f:this.resampleThreshold;return e>f};EditorUi.prototype.resizeImage=function(e,f,k,z,t,B,I){t=null!=t?t:this.maxImageSize;var O=Math.max(1,e.width),J=Math.max(1,e.height);if(z&&this.isResampleImageSize(null!=I?I:f.length,B))try{var y=Math.max(O/t,J/t);if(1<y){var ia=Math.round(O/y),da=Math.round(J/y),ja=document.createElement("canvas");ja.width=ia;ja.height=da;ja.getContext("2d").drawImage(e,0,0,
ia,da);var aa=ja.toDataURL();if(aa.length<f.length){var qa=document.createElement("canvas");qa.width=ia;qa.height=da;var sa=qa.toDataURL();aa!==sa&&(f=aa,O=ia,J=da)}}}catch(L){}k(f,O,J)};EditorUi.prototype.extractGraphModelFromPng=function(e){return Editor.extractGraphModelFromPng(e)};EditorUi.prototype.loadImage=function(e,f,k){try{var z=new Image;z.onload=function(){z.width=0<z.width?z.width:120;z.height=0<z.height?z.height:120;f(z)};null!=k&&(z.onerror=k);z.src=e}catch(t){if(null!=k)k(t);else throw t;
}};EditorUi.prototype.getDefaultSketchMode=function(){var e="ac.draw.io"==window.location.host?"1":"0";return"0"!=(null!=urlParams.rough?urlParams.rough:e)};var D=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();this.isSettingsEnabled()&&("1"==urlParams.sketch&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough?mxSettings.settings.sketchMode:this.getDefaultSketchMode()),null!=mxSettings.settings.sidebarTitles&&
(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());var e=this,f=this.editor.graph;Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(L){var V=L.getEvent();return null==L.getState()&&!mxEvent.isMouseEvent(V)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(V)&&(null==L.getState()||mxEvent.isControlDown(V)||mxEvent.isShiftDown(V))});f.cellEditor.editPlantUmlData=function(L,V,T){var Y=JSON.parse(T);V=new TextareaDialog(e,mxResources.get("plantUml")+
":",Y.data,function(W){null!=W&&e.spinner.spin(document.body,mxResources.get("inserting"))&&e.generatePlantUmlImage(W,Y.format,function(ka,q,F){e.spinner.stop();f.getModel().beginUpdate();try{if("txt"==Y.format)f.labelChanged(L,"<pre>"+ka+"</pre>"),f.updateCellSize(L,!0);else{f.setCellStyles("image",e.convertDataUri(ka),[L]);var S=f.model.getGeometry(L);null!=S&&(S=S.clone(),S.width=q,S.height=F,f.cellsResized([L],[S],!1))}f.setAttributeForCell(L,"plantUmlData",JSON.stringify({data:W,format:Y.format}))}finally{f.getModel().endUpdate()}},
function(ka){e.handleError(ka)})},null,null,400,220);e.showDialog(V.container,420,300,!0,!0);V.init()};f.cellEditor.editMermaidData=function(L,V,T){var Y=JSON.parse(T);V=new TextareaDialog(e,mxResources.get("mermaid")+":",Y.data,function(W){null!=W&&e.spinner.spin(document.body,mxResources.get("inserting"))&&e.generateMermaidImage(W,Y.config,function(ka,q,F){e.spinner.stop();f.getModel().beginUpdate();try{f.setCellStyles("image",ka,[L]);var S=f.model.getGeometry(L);null!=S&&(S=S.clone(),S.width=Math.max(S.width,
q),S.height=Math.max(S.height,F),f.cellsResized([L],[S],!1));f.setAttributeForCell(L,"mermaidData",JSON.stringify({data:W,config:Y.config},null,2))}finally{f.getModel().endUpdate()}},function(ka){e.handleError(ka)})},null,null,400,220);e.showDialog(V.container,420,300,!0,!0);V.init()};var k=f.cellEditor.startEditing;f.cellEditor.startEditing=function(L,V){try{var T=this.graph.getAttributeForCell(L,"plantUmlData");if(null!=T)this.editPlantUmlData(L,V,T);else if(T=this.graph.getAttributeForCell(L,"mermaidData"),
null!=T)this.editMermaidData(L,V,T);else{var Y=f.getCellStyle(L);"1"==mxUtils.getValue(Y,"metaEdit","0")?e.showDataDialog(L):k.apply(this,arguments)}}catch(W){e.handleError(W)}};f.getLinkTitle=function(L){return e.getLinkTitle(L)};f.customLinkClicked=function(L){var V=!1;try{e.handleCustomLink(L),V=!0}catch(T){e.handleError(T)}return V};var z=f.parseBackgroundImage;f.parseBackgroundImage=function(L){var V=z.apply(this,arguments);null!=V&&null!=V.src&&Graph.isPageLink(V.src)&&(V={originalSrc:V.src});
return V};var t=f.setBackgroundImage;f.setBackgroundImage=function(L){null!=L&&null!=L.originalSrc&&(L=e.createImageForPageLink(L.originalSrc,e.currentPage,this));t.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(L,V){L=null!=f.backgroundImage?f.backgroundImage.originalSrc:
null;if(null!=L){var T=L.indexOf(",");if(0<T)for(L=L.substring(T+1),V=V.getProperty("patches"),T=0;T<V.length;T++)if(null!=V[T][EditorUi.DIFF_UPDATE]&&null!=V[T][EditorUi.DIFF_UPDATE][L]||null!=V[T][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(V[T][EditorUi.DIFF_REMOVE],L)){f.refreshBackgroundImage();break}}}));var B=f.getBackgroundImageObject;f.getBackgroundImageObject=function(L,V){var T=B.apply(this,arguments);if(null!=T&&null!=T.originalSrc)if(!V)T={src:T.originalSrc};else if(V&&null!=this.themes&&
"darkTheme"==this.defaultThemeName){var Y=this.stylesheet,W=this.shapeForegroundColor,ka=this.shapeBackgroundColor;this.stylesheet=this.getDefaultStylesheet();this.shapeBackgroundColor="#ffffff";this.shapeForegroundColor="#000000";T=e.createImageForPageLink(T.originalSrc);this.shapeBackgroundColor=ka;this.shapeForegroundColor=W;this.stylesheet=Y}return T};var I=this.clearDefaultStyle;this.clearDefaultStyle=function(){I.apply(this,arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||
(EditDataDialog.placeholderHelpLink="https://www.diagrams.net/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var O=e.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(L){L=null!=L?L:"";"1"==urlParams.dev&&(L+=(0<L.length?"&":"?")+"dev=1");return O.apply(this,arguments)};var J=f.addClickHandler;f.addClickHandler=function(L,V,T){var Y=V;
V=function(W,ka){if(null==ka){var q=mxEvent.getSource(W);"a"==q.nodeName.toLowerCase()&&(ka=q.getAttribute("href"))}null!=ka&&f.isCustomLink(ka)&&(mxEvent.isTouchEvent(W)||!mxEvent.isPopupTrigger(W))&&f.customLinkClicked(ka)&&mxEvent.consume(W);null!=Y&&Y(W,ka)};J.call(this,L,V,T)};D.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var y=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(L,
V,T){e.editor.graph.isSelectionEmpty()?y.apply(this,arguments):e.menus.addMenuItems(L,"delete - cut copy copyAsImage - duplicate".split(" "),null,T)}}e.actions.get("print").funct=function(){e.showDialog((new PrintDialog(e)).container,360,null!=e.pages&&1<e.pages.length?470:390,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var ia=f.getExportVariables;f.getExportVariables=function(){var L=ia.apply(this,arguments),V=e.getCurrentFile();null!=V&&(L.filename=V.getTitle());L.pagecount=
null!=e.pages?e.pages.length:1;L.page=null!=e.currentPage?e.currentPage.getName():"";L.pagenumber=null!=e.pages&&null!=e.currentPage?mxUtils.indexOf(e.pages,e.currentPage)+1:1;return L};var da=f.getGlobalVariable;f.getGlobalVariable=function(L){var V=e.getCurrentFile();return"filename"==L&&null!=V?V.getTitle():"page"==L&&null!=e.currentPage?e.currentPage.getName():"pagenumber"==L?null!=e.currentPage&&null!=e.pages?mxUtils.indexOf(e.pages,e.currentPage)+1:1:"pagecount"==L?null!=e.pages?e.pages.length:
1:da.apply(this,arguments)};var ja=f.labelLinkClicked;f.labelLinkClicked=function(L,V,T){var Y=V.getAttribute("href");if(null==Y||!f.isCustomLink(Y)||!mxEvent.isTouchEvent(T)&&mxEvent.isPopupTrigger(T))ja.apply(this,arguments);else{if(!f.isEnabled()||null!=L&&f.isCellLocked(L.cell))f.customLinkClicked(Y),f.getRubberband().reset();mxEvent.consume(T)}};this.editor.getOrCreateFilename=function(){var L=e.defaultFilename,V=e.getCurrentFile();null!=V&&(L=null!=V.getTitle()?V.getTitle():L);return L};var aa=
this.actions.get("print");aa.setEnabled(!mxClient.IS_IOS||!navigator.standalone);aa.visible=aa.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(67,!0,"copyStyle",!0),this.keyHandler.bindAction(86,!0,"pasteStyle",!0),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(88,!0,"insertText",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,
!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.altShiftActions[83]="synchronize",this.installImagePasteHandler(),this.installNativeClipboardHandler();this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateUserElement()}));this.spinner=this.createSpinner(null,
null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(L){var V=f.cellEditor.text2,T=null;null!=V&&(mxEvent.addListener(V,"dragleave",function(Y){null!=T&&(T.parentNode.removeChild(T),T=null);Y.stopPropagation();Y.preventDefault()}),mxEvent.addListener(V,"dragover",mxUtils.bind(this,function(Y){null==T&&(!mxClient.IS_IE||10<document.documentMode)&&(T=this.highlightElement(V));Y.stopPropagation();Y.preventDefault()})),mxEvent.addListener(V,"drop",mxUtils.bind(this,
function(Y){null!=T&&(T.parentNode.removeChild(T),T=null);if(0<Y.dataTransfer.files.length)this.importFiles(Y.dataTransfer.files,0,0,this.maxImageSize,function(ka,q,F,S,ba,U){f.insertImage(ka,ba,U)},function(){},function(ka){return"image/"==ka.type.substring(0,6)},function(ka){for(var q=0;q<ka.length;q++)ka[q]()},mxEvent.isControlDown(Y));else if(0<=mxUtils.indexOf(Y.dataTransfer.types,"text/uri-list")){var W=Y.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(W)?this.loadImage(decodeURIComponent(W),
mxUtils.bind(this,function(ka){var q=Math.max(1,ka.width);ka=Math.max(1,ka.height);var F=this.maxImageSize;F=Math.min(1,Math.min(F/Math.max(1,q)),F/Math.max(1,ka));f.insertImage(decodeURIComponent(W),q*F,ka*F)})):document.execCommand("insertHTML",!1,Y.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(Y.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,Y.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(Y.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",
!1,Y.dataTransfer.getData("text/plain"));Y.stopPropagation();Y.preventDefault()})))}));this.isSettingsEnabled()&&(aa=this.editor.graph.view,aa.setUnit(mxSettings.getUnit()),aa.addListener("unitChanged",function(L,V){mxSettings.setUnit(V.getProperty("unit"));mxSettings.save()}),this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,aa.unit),this.refresh());if("1"==urlParams.styledev){aa=
document.getElementById("geFooter");null!=aa&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),
this.styleInput.value)})),aa.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(L,V){0<this.editor.graph.getSelectionCount()?(L=this.editor.graph.getSelectionCell(),L=this.editor.graph.getModel().getStyle(L),this.styleInput.value=L||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var qa=this.isSelectionAllowed;this.isSelectionAllowed=function(L){return mxEvent.getSource(L)==this.styleInput?
!0:qa.apply(this,arguments)}}aa=document.getElementById("geInfo");null!=aa&&aa.parentNode.removeChild(aa);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var sa=null;mxEvent.addListener(f.container,"dragleave",function(L){f.isEnabled()&&(null!=sa&&(sa.parentNode.removeChild(sa),sa=null),L.stopPropagation(),L.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(L){null==sa&&(!mxClient.IS_IE||10<document.documentMode)&&(sa=this.highlightElement(f.container));
null!=this.sidebar&&this.sidebar.hideTooltip();L.stopPropagation();L.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(L){null!=sa&&(sa.parentNode.removeChild(sa),sa=null);if(f.isEnabled()){var V=mxUtils.convertPoint(f.container,mxEvent.getClientX(L),mxEvent.getClientY(L)),T=L.dataTransfer.files,Y=f.view.translate,W=f.view.scale,ka=V.x/W-Y.x,q=V.y/W-Y.y;if(0<T.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(L)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&
this.fileLoaded(null),this.openFiles(T,!0)):(mxEvent.isAltDown(L)&&(q=ka=null),this.importFiles(T,ka,q,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(L),null,null,mxEvent.isShiftDown(L),L));else{mxEvent.isAltDown(L)&&(q=ka=0);var F=0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")?L.dataTransfer.getData("text/uri-list"):null;V=this.extractGraphModelFromEvent(L,null!=this.pages);if(null!=V)f.setSelectionCells(this.importXml(V,ka,q,!0));else if(0<=mxUtils.indexOf(L.dataTransfer.types,
"text/html")){var S=L.dataTransfer.getData("text/html");V=document.createElement("div");V.innerHTML=f.sanitizeHtml(S);var ba=null;T=V.getElementsByTagName("img");null!=T&&1==T.length?(S=T[0].getAttribute("src"),null==S&&(S=T[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(S)||(ba=!0)):(T=V.getElementsByTagName("a"),null!=T&&1==T.length?S=T[0].getAttribute("href"):(V=V.getElementsByTagName("pre"),null!=V&&1==V.length&&(S=mxUtils.getTextContent(V[0]))));var U=!0,ca=mxUtils.bind(this,
function(){f.setSelectionCells(this.insertTextAt(S,ka,q,!0,ba,null,U,mxEvent.isControlDown(L)))});ba&&null!=S&&S.length>this.resampleThreshold?this.confirmImageResize(function(ea){U=ea;ca()},mxEvent.isControlDown(L)):ca()}else null!=F&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(F)?this.loadImage(decodeURIComponent(F),mxUtils.bind(this,function(ea){var na=Math.max(1,ea.width);ea=Math.max(1,ea.height);var ra=this.maxImageSize;ra=Math.min(1,Math.min(ra/Math.max(1,na)),ra/Math.max(1,ea));f.setSelectionCell(f.insertVertex(null,
null,"",ka,q,na*ra,ea*ra,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+F+";"))}),mxUtils.bind(this,function(ea){f.setSelectionCells(this.insertTextAt(F,ka,q,!0))})):0<=mxUtils.indexOf(L.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(L.dataTransfer.getData("text/plain"),ka,q,!0))}}L.stopPropagation();L.preventDefault()}),!1)}f.enableFlowAnimation=!0;this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();
aa=mxUtils.bind(this,function(){f.refresh();f.view.validateBackground();this.updateTabContainer();this.hideShapePicker()});this.addListener("darkModeChanged",aa);this.addListener("sketchModeChanged",aa);this.addListener("currentThemeChanged",mxUtils.bind(this,function(){this.refresh()}));"dark"==uiTheme?(this.doSetDarkMode(!0),this.fireEvent(new mxEventObject("darkModeChanged"))):("1"==urlParams["live-ui"]||"min"==uiTheme&&"1"!=urlParams.embedInline)&&this.doSetDarkMode(null!=urlParams.dark?1==urlParams.dark&&
!mxClient.IS_IE&&!mxClient.IS_IE11:null!=mxSettings.settings.darkMode?mxSettings.settings.darkMode:window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.installSettings()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var e=this.editor.graph;e.container.addEventListener("paste",mxUtils.bind(this,function(f){if(!mxEvent.isConsumed(f))try{for(var k=f.clipboardData||f.originalEvent.clipboardData,z=!1,t=0;t<k.types.length;t++)if("text/"===k.types[t].substring(0,
5)){z=!0;break}if(!z){var B=k.items;for(index in B){var I=B[index];if("file"===I.kind){if(e.isEditing())this.importFiles([I.getAsFile()],0,0,this.maxImageSize,function(J,y,ia,da,ja,aa){e.insertImage(J,ja,aa)},function(){},function(J){return"image/"==J.type.substring(0,6)},function(J){for(var y=0;y<J.length;y++)J[y]()});else{var O=this.editor.graph.getInsertPoint();this.importFiles([I.getAsFile()],O.x,O.y,this.maxImageSize);mxEvent.consume(f)}break}}}}catch(J){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=
function(){function e(){window.setTimeout(function(){k.innerHTML="&nbsp;";k.focus();document.execCommand("selectAll",!1,null)},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";k.style.color="transparent";k.style.position=
"absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML="&nbsp;";var z=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(B){var I=mxEvent.getSource(B);
null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==I.nodeName||"TEXTAREA"==I.nodeName||224!=B.keyCode&&(mxClient.IS_MAC||17!=B.keyCode)&&(!mxClient.IS_MAC||91!=B.keyCode&&93!=B.keyCode)||z||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+10+"px",B=f.container.scrollLeft,I=f.container.scrollTop,f.container.appendChild(k),z=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=B,f.container.scrollTop=I)}));
mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(B){var I=B.keyCode;window.setTimeout(mxUtils.bind(this,function(){!z||224!=I&&17!=I&&91!=I&&93!=I||(z=!1,f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(B){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),e()}catch(I){this.handleError(I)}}));mxEvent.addListener(k,"cut",
mxUtils.bind(this,function(B){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),e()}catch(I){this.handleError(I)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(B){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&(k.innerHTML="&nbsp;",k.focus(),null!=B.clipboardData&&this.pasteCells(B,k,!0,!0),!mxEvent.isConsumed(B))){var I=f.container.scrollLeft,O=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){f.container.scrollLeft=I;f.container.scrollTop=O;
this.pasteCells(B,k,!1,!0)}),0)}}),!0);var t=this.isSelectionAllowed;this.isSelectionAllowed=function(B){return mxEvent.getSource(B)==k?!0:t.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(e,f){mxSettings.setUi(e);(f=this.doSetCurrentTheme(e)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.doSetCurrentTheme=function(e,f){function k(da){return""==da||"dark"==da||"kennedy"==da||null==da}var z=Editor.currentTheme;e=k(e)?"default":e;z=k(z)?"default":
z;var t="sketch"==z&&"default"==e||"default"==z&&"sketch"==e;if(t&&"1"==urlParams["live-ui"]&&!this.themeSwitching){Editor.currentTheme=e;this.themeSwitching=!0;var B=this.editor.graph.view.translate,I=B.x,O=B.y,J=mxUtils.getOffset(this.editor.graph.container),y=this.editor.graph.container.scrollLeft-J.x,ia=this.editor.graph.container.scrollTop-J.y;f=null!=f?f:100;mxUtils.setPrefixedStyle(this.container.style,"transition","all "+f+"ms");0==f&&(this.container.style.opacity="0");window.setTimeout(mxUtils.bind(this,
function(){this.container.style.opacity="0";window.setTimeout(mxUtils.bind(this,function(){"sketch"==z&&"default"==e?(this.sidebarFooterContainer.style.display="block",this.menubarContainer.style.display="block",this.toolbarContainer.style.display="block",this.tabContainer.style.display="block",this.hsplit.style.display="block",this.hsplitPosition=EditorUi.prototype.hsplitPosition,this.menubarHeight=App.prototype.menubarHeight,this.formatWidth=EditorUi.prototype.formatWidth):"default"==z&&"sketch"==
e&&(this.sidebarFooterContainer.style.display="none",this.menubarContainer.style.display="none",this.toolbarContainer.style.display="none",this.tabContainer.style.display="none",this.hsplit.style.display="none",this.formatWidth=this.menubarHeight=this.hsplitPosition=0);this.switchTheme(e);window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("currentThemeChanged"));this.editor.graph.refresh();var da=this.editor.graph.view.scale;J=mxUtils.getOffset(this.editor.graph.container);
this.editor.graph.container.scrollLeft=y+J.x+(B.x-I)*da;this.editor.graph.container.scrollTop=ia+J.y+(B.y-O)*da;this.container.style.opacity="";window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.container.style,"transition",null);delete this.themeSwitching}),f)}),f)}),f)}),0)}return t};EditorUi.prototype.switchTheme=function(e){this.destroyWindows();this.updateUserElement();this.updateDefaultStyles();this.switchThemeConstants(e);this.switchCssForTheme(e);this.createWrapperForTheme(e);
this.createPickerMenuForTheme(e);this.createMainMenuForTheme(e);this.createMenubarForTheme(e);this.createFooterMenuForTheme(e);this.sidebarContainer.style.display="";"sketch"==e?(this.createFormatWindow(),this.formatContainer.style.left="0px",this.formatContainer.style.top="0px",this.formatContainer.style.width="",this.createShapesWindow(),this.sidebarContainer.style.left="0px",this.sidebarContainer.style.top="0px",this.sidebarContainer.style.bottom="0px",this.sidebarContainer.style.width="100%"):
"default"==e&&null!=this.formatContainer&&(this.formatContainer.style.left="",null!=this.footerContainer&&this.footerContainer.parentNode!=this.formatContainer.parentNode&&this.footerContainer.parentNode.insertBefore(this.formatContainer,this.footerContainer),null!=this.sidebarContainer&&this.formatContainer.parentNode!=this.sidebarContainer.parentNode&&this.formatContainer.parentNode.insertBefore(this.sidebarContainer,this.formatContainer));null!=this.format&&(e="default"==e||"atlas"==e,this.format.showCloseButton!=
e&&(this.format.showCloseButton=e,this.format.refresh()))};EditorUi.prototype.destroyWindows=function(){null!=this.sidebarWindow&&(this.sidebarWindow.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),
this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null);null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null);null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null)};EditorUi.prototype.switchThemeConstants=function(e){var f=this.editor.graph;
f.defaultEdgeLength=Graph.prototype.defaultEdgeLength;f.defaultGridEnabled=Graph.prototype.defaultGridEnabled;f.defaultPageVisible=Graph.prototype.defaultPageVisible;"sketch"==e?(mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#C0C0C0" stroke-width="2"/>').src,mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#C0C0C0" stroke-width="2" fill="none"/>').src,mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,
10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#C0C0C0" stroke-width="2" fill="none"/>').src,Editor.fitWindowBorders=new mxRectangle(60,30,30,30),f.defaultEdgeLength=120,null==urlParams.grid&&(f.defaultGridEnabled=!1),null==urlParams.pv&&(f.defaultPageVisible=!1)):(mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",Editor.fitWindowBorders=null)};
EditorUi.prototype.switchCssForTheme=function(e){"sketch"==e?null==this.sketchStyleElt&&(this.sketchStyleElt=document.createElement("style"),this.sketchStyleElt.setAttribute("type","text/css"),this.sketchStyleElt.innerHTML=Editor.createMinimalCss(),document.getElementsByTagName("head")[0].appendChild(this.sketchStyleElt)):null!=this.sketchStyleElt&&(this.sketchStyleElt.parentNode.removeChild(this.sketchStyleElt),this.sketchStyleElt=null)};EditorUi.prototype.createWrapperForTheme=function(e){"sketch"==
e?(null==this.sketchWrapperElt&&(this.sketchWrapperElt=document.createElement("div"),this.sketchWrapperElt.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;"),this.diagramContainer.parentNode.appendChild(this.sketchWrapperElt),this.sketchWrapperElt.appendChild(this.diagramContainer)):null!=this.sketchWrapperElt&&null!=this.sketchWrapperElt.parentNode&&(this.tabContainer.parentNode.insertBefore(this.diagramContainer,this.tabContainer),this.sketchWrapperElt.parentNode.removeChild(this.sketchWrapperElt))};
EditorUi.prototype.createMainMenuForTheme=function(e){if("sketch"==e&&null==this.sketchMainMenuElt){this.sketchMainMenuElt=document.createElement("div");this.sketchMainMenuElt.className="geToolbarContainer";this.sketchMainMenuElt.style.cssText="position:absolute;left:10px;top:10px;height:44px;border-radius:4px;padding:9px 12px;overflow:hidden;z-index:1;white-space:nowrap;text-align:right;user-select:none;box-sizing:border-box;border-bottom:1px solid lightgray;";this.sketchMainMenuElt.appendChild(this.createMenu("diagram",
Editor.menuImage));this.sketchMainMenuElt.appendChild(this.createMenuItem("delete",Editor.trashImage));var f=this.sketchMainMenuElt.appendChild(this.createMenuItem("undo",Editor.undoImage)),k=this.sketchMainMenuElt.appendChild(this.createMenuItem("redo",Editor.redoImage));e=mxUtils.bind(this,function(){f.style.display=0<this.editor.undoManager.history.length||this.editor.graph.isEditing()?"inline-block":"none";k.style.display=f.style.display});this.actions.get("undo").addListener("stateChanged",e);
this.actions.get("redo").addListener("stateChanged",e);e();this.sketchWrapperElt.appendChild(this.sketchMainMenuElt)}};EditorUi.prototype.createFooterMenuForTheme=function(e){if("sketch"==e&&null==this.sketchFooterMenuElt){this.sketchFooterMenuElt=document.createElement("div");this.sketchFooterMenuElt.className="geToolbarContainer";this.sketchFooterMenuElt.style.cssText="position:absolute;right:12px;bottom:12px;height:44px;border-radius:4px;padding:9px 12px;overflow:hidden;z-index:1;white-space:nowrap;text-align:right;user-select:none;box-sizing:border-box;border-bottom:1px solid lightgray;";
e=this.sketchFooterMenuElt;var f=this.createPageMenuTab(!1,!0);f.className="geToolbarButton";f.style.cssText="display:inline-block;cursor:pointer;overflow:hidden;padding:4px;white-space:nowrap;max-width:160px;text-overflow:ellipsis;filter:none;opacity:1;";e.appendChild(f);var k=mxUtils.bind(this,function(){f.innerText="";if(null!=this.currentPage){mxUtils.write(f,this.currentPage.getName());var z=null!=this.pages?this.pages.length:1,t=this.getPageIndex(this.currentPage);t=null!=t?t+1:1;var B=this.currentPage.getId();
f.setAttribute("title",this.currentPage.getName()+" ("+t+"/"+z+")"+(null!=B?" ["+B+"]":""))}});this.editor.addListener("pagesPatched",k);this.editor.addListener("pageSelected",k);this.editor.addListener("pageRenamed",k);this.editor.addListener("fileLoaded",k);k();k=mxUtils.bind(this,function(){f.style.display=null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)?"inline-block":"none"});this.addListener("fileDescriptorChanged",k);this.addListener("pagesVisibleChanged",
k);this.editor.addListener("pagesPatched",k);k();e.appendChild(this.createMenuItem("zoomOut",Editor.zoomOutImage));k=this.createMenu("viewZoom",Editor.plusImage);k.setAttribute("title",mxResources.get("zoom"));k.innerHTML="100%";k.className="geToolbarButton";k.style.cssText="display:inline-block;position:relative;vertical-align:top;opacity:1;color:inherit;padding:4px;box-shadow:none;width:40px;text-align:center;margin-right:-6px;filter:none;";e.appendChild(k);mxUtils.bind(this,function(z){mxEvent.addListener(z,
"click",mxUtils.bind(this,function(B){mxEvent.isAltDown(B)?(this.hideCurrentMenu(),this.actions.get("customZoom").funct(),mxEvent.consume(B)):mxEvent.isShiftDown(B)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(B))}));var t=mxUtils.bind(this,function(){z.innerText="";mxUtils.write(z,Math.round(100*this.editor.graph.view.scale)+"%")});this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,t);this.editor.addListener("resetGraphView",t);this.editor.addListener("pageSelected",
t)})(k);e.appendChild(this.createMenuItem("zoomIn",Editor.zoomInImage));this.sketchWrapperElt.appendChild(this.sketchFooterMenuElt)}};EditorUi.prototype.createPickerMenuForTheme=function(e){if("sketch"==e&&null==this.sketchPickerMenuElt){this.sketchPickerMenuElt=document.createElement("div");this.sketchPickerMenuElt.className="geToolbarContainer";this.sketchPickerMenuElt.style.cssText="position:absolute;left:10px;border-radius:4px;padding:0px 4px 4px;white-space:nowrap;z-index:1;transform:translate(0, -50%);top:50%;user-select:none;width:40px;";
var f=this.sketchPickerMenuElt;mxUtils.setPrefixedStyle(f.style,"transition","transform .3s ease-out");var k=document.createElement("a");k.style.padding="0px";k.style.boxShadow="none";k.className="geMenuItem";k.style.display="block";k.style.width="100%";k.style.height="14px";k.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")";k.style.backgroundPosition="top center";k.style.backgroundRepeat="no-repeat";k.setAttribute("title","Minimize");var z=this.createMenuItem("insertFreehand",Editor.freehandImage,
!0);z.style.paddingLeft="12px";z.style.backgroundSize="";z.style.width="26px";z.style.height="30px";z.style.opacity="0.7";var t=this.createMenu("insert",Editor.plusImage);t.style.backgroundSize="";t.style.marginBottom="4px";t.style.display="block";t.style.width="30px";t.style.height="30px";t.style.padding="4px";t.style.opacity="0.7";var B=!1,I=mxUtils.bind(this,function(){f.innerText="";if(!B){var O=function(y,ia,da,ja){null!=ia&&y.setAttribute("title",ia);y.style.cursor="pointer";y.style.margin=
"8px 0px";y.style.display="block";f.appendChild(y);null!=ja&&(y.style.position="relative",y.style.overflow="visible",ia=document.createElement("div"),ia.style.position="absolute",ia.style.fontSize="8px",ia.style.left="32px",ia.style.top="28px",mxUtils.write(ia,ja),y.appendChild(ia));return y};O(this.sidebar.createVertexTemplate("text;strokeColor=none;fillColor=none;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;",60,30,"Text",mxResources.get("text")+" (A)",!0,!1,null,!0,!0),mxResources.get("text")+
" (A)",null,"A");O(this.sidebar.createVertexTemplate("shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",140,160,"",mxResources.get("note")+" (S)",!0,!1,null,!0),mxResources.get("note")+" (S)",null,"S");O(this.sidebar.createVertexTemplate("rounded=0;whiteSpace=wrap;html=1;",160,80,"",mxResources.get("rectangle")+" (D)",
!0,!1,null,!0),mxResources.get("rectangle")+" (D)",null,"D");O(this.sidebar.createVertexTemplate("ellipse;whiteSpace=wrap;html=1;",160,100,"",mxResources.get("ellipse")+" (F)",!0,!1,null,!0),mxResources.get("ellipse")+" (F)",null,"F");var J=new mxCell("",new mxGeometry(0,0,this.editor.graph.defaultEdgeLength+20,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;");J.geometry.setTerminalPoint(new mxPoint(0,0),!0);J.geometry.setTerminalPoint(new mxPoint(J.geometry.width,0),!1);J.geometry.points=
[];J.geometry.relative=!0;J.edge=!0;O(this.sidebar.createEdgeTemplateFromCells([J],J.geometry.width,J.geometry.height,mxResources.get("line")+" (C)",!0,null,!0,!1),mxResources.get("line")+" (C)",null,"C");J=J.clone();J.style="edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;";J.geometry.width=this.editor.graph.defaultEdgeLength+20;J.geometry.setTerminalPoint(new mxPoint(0,20),!0);J.geometry.setTerminalPoint(new mxPoint(J.geometry.width,20),!1);
O(this.sidebar.createEdgeTemplateFromCells([J],J.geometry.width,40,mxResources.get("arrow"),!0,null,!0,!1),mxResources.get("arrow"));O(z,mxResources.get("freehand")+" (X)",null,"X");this.sketchPickerMenuElt.appendChild(t)}"1"!=urlParams.embedInline&&f.appendChild(k)});mxEvent.addListener(k,"click",mxUtils.bind(this,function(){B?(mxUtils.setPrefixedStyle(f.style,"transform","translate(0, -50%)"),f.style.padding="8px 6px 4px",f.style.width="40px",f.style.top="50%",f.style.bottom="",f.style.height="",
k.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",k.setAttribute("title","Minimize"),k.style.height="14px",B=!1,I()):(f.innerText="",f.appendChild(k),mxUtils.setPrefixedStyle(f.style,"transform","translate(0, 0)"),f.style.bottom="12px",f.style.padding="0px",f.style.height="24px",f.style.width="24px",f.style.top="",k.style.backgroundImage="url("+Editor.plusImage+")",k.setAttribute("title",mxResources.get("insert")),k.style.height="24px",B=!0)}));this.addListener("darkModeChanged",
I);this.addListener("sketchModeChanged",I);I();this.sketchWrapperElt.appendChild(this.sketchPickerMenuElt)}};EditorUi.prototype.createMenubarForTheme=function(e){"sketch"==e?(null==this.sketchMenubarElt&&(this.sketchMenubarElt=document.createElement("div"),this.sketchMenubarElt.className="geToolbarContainer",this.sketchMenubarElt.style.cssText="position:absolute;right:12px;top:10px;height:44px;border-radius:4px;padding:7px 12px;overflow:hidden;z-index:1;white-space:nowrap;text-align:right;user-select:none;box-sizing:border-box;border-bottom:1px solid lightgray;",
this.sketchWrapperElt.appendChild(this.sketchMenubarElt)),null!=this.statusContainer&&(this.sketchMenubarElt.appendChild(this.statusContainer),this.statusContainer.style.marginTop="4px"),null!=this.userElement&&this.sketchMenubarElt.appendChild(this.userElement),e=this.menubar.langIcon,null!=e&&(e.style.position="relative",e.style.height="21px",e.style.width="21px",e.style.right="0px",e.style.top="3px",this.sketchMenubarElt.appendChild(e))):(null!=this.statusContainer&&(this.menubar.container.appendChild(this.statusContainer),
this.statusContainer.style.marginTop=""),null!=this.userElement&&this.menubarContainer.appendChild(this.userElement),e=this.menubar.langIcon,null!=e&&(e.style.position="absolute",e.style.height="18px",e.style.width="18px",e.style.right="14px",e.style.top="5px",document.body.appendChild(e)))};EditorUi.prototype.createMenu=function(e,f){var k=this.menus.get(e),z=this.menubar.addMenu(mxResources.get(e),k.funct);z.className="geToolbarButton";z.style.display="inline-block";z.style.cursor="pointer";z.style.height=
"24px";z.setAttribute("title",mxResources.get(e));this.menus.menuCreated(k,z,"geMenuItem");null!=f&&(z.style.backgroundImage="url("+f+")",z.style.backgroundPosition="center center",z.style.backgroundRepeat="no-repeat",z.style.backgroundSize="100% 100%",z.style.width="24px",z.innerText="");return z};EditorUi.prototype.createMenuItem=function(e,f,k){var z=document.createElement("a");z.className="geToolbarButton";z.setAttribute("title",mxResources.get(e));z.style.backgroundImage="url("+f+")";z.style.backgroundPosition=
"center center";z.style.backgroundRepeat="no-repeat";z.style.backgroundSize="100% 100%";z.style.display="inline-block";z.style.cursor="pointer";z.style.marginLeft="6px";z.style.width="24px";z.style.height="24px";var t=this.actions.get(e);null!=t&&(mxEvent.addListener(z,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(B){B.preventDefault()})),mxEvent.addListener(z,"click",function(B){"disabled"!=z.getAttribute("disabled")&&t.funct(B);mxEvent.consume(B)}),k||(e=function(){t.isEnabled()?
(z.removeAttribute("disabled"),z.style.cursor="pointer"):(z.setAttribute("disabled","disabled"),z.style.cursor="default");z.style.opacity=t.isEnabled()?"":"0.2"},this.editor.graph.addListener("enabledChanged",e),t.addListener("stateChanged",e),e()));return z};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var e=Math.max(10,this.diagramContainer.parentNode.clientWidth-256),f="1"==urlParams.winCtrls&&"1"==urlParams.sketch?80:60,k="1"==urlParams.embedInline?580:"1"==urlParams.sketch?
580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),e,f,240,k,mxUtils.bind(this,function(z){z.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);this.formatWindow.window.setVisible(!1)}};var p=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=
function(e){var f=this.formatWindow;null!=f?f.window.setVisible(null!=e?e:!this.isFormatPanelVisible()):p.apply(this,arguments)};var E=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var e=this.formatWindow;return null!=e?e.window.isVisible():E.apply(this,arguments)};var N=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(e){null!=this.sketchWrapperElt&&null!=this.sketchWrapperElt.parentNode?(this.diagramContainer.style.left="0",this.diagramContainer.style.top=
"0",this.diagramContainer.style.right="0",this.diagramContainer.style.bottom="0",(null!=e?e:1)&&this.editor.graph.sizeDidChange()):N.apply(this,arguments)};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var e=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),f="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650);this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),"sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline?
66:10,"sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-f)/2):56,e-6,f-6,mxUtils.bind(this,function(k){k.appendChild(this.sidebarContainer)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(e){this.spinner.spin(document.body,
mxResources.get("working")+"...")&&window.setTimeout(mxUtils.bind(this,function(){this.spinner.stop();this.doSetSketchMode(e);null==urlParams.rough&&(mxSettings.settings.sketchMode=e,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))}),0)};Editor.createMinimalCss=function(){return"* { -webkit-font-smoothing: antialiased; }html body td.mxWindowTitle > div > img { padding: 8px 4px; }"+(Editor.isDarkMode()?"html body td.mxWindowTitle > div > img { margin: -4px; }html body .geToolbarContainer .geMenuItem, html body .geToolbarContainer .geToolbarButton, html body .geMenubarContainer .geMenuItem .geMenuItem, html body .geMenubarContainer a.geMenuItem,html body .geMenubarContainer .geToolbarButton { filter: invert(1); }html body div.geToolbarContainer a.geInverted { filter: none; }html body .geMenubarContainer .geMenuItem .geMenuItem, html body .geMenubarContainer a.geMenuItem { color: #353535; }html > body > div > .geToolbarContainer { border: 1px solid #c0c0c0 !important; box-shadow: none !important; }html > body.geEditor > div > a.geItem { background-color: #2a2a2a; color: #cccccc; border-color: #505759; }html body .geTabContainer, html body .geTabContainer div, html body .geMenubarContainer { border-color: #505759 !important; }html body .mxCellEditor { color: #f0f0f0; }":
"html > body > div > .geToolbarContainer { box-shadow:0px 0px 3px 1px #c0c0c0; }html body div.geToolbarContainer a.geInverted { filter: invert(1); }html body.geEditor .geTabContainer div { border-color: #e5e5e5 !important; }")+'html > body > div > a.geItem { background-color: #ffffff; color: #707070; border-top: 1px solid lightgray; border-left: 1px solid lightgray; }html body .geMenubarContainer { border-bottom:1px solid lightgray;background-color:#ffffff; }html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0; }html body .geSidebarContainer *:not(svg *) { font-size:9pt; }html body table.mxWindow td.mxWindowPane div.mxWindowPane *:not(svg *) { font-size:9pt; }table.mxWindow * :not(svg *) { font-size:13px; }html body .mxWindow { z-index: 3; }html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700; border-radius: 5px; }html body button.geBtn:active { opacity: 0.6; }html body a.geMenuItem { opacity: 0.75; cursor: pointer; user-select: none; }html body a.geMenuItem[disabled] { opacity: 0.2; }html body a.geMenuItem[disabled]:active { opacity: 0.2; }html body div.geActivePage { opacity: 0.7; }html body a.geMenuItem:active { opacity: 0.2; }html body .geToolbarButton:active { opacity: 0.15; }html body .geStatus:active { opacity: 0.5; }.geStatus > div { box-sizing: border-box; max-width: 100%; text-overflow: ellipsis; }html body .geMenubarContainer .geStatus { margin-top: 0px !important; }html table.mxPopupMenu tr.mxPopupMenuItemHover:active { opacity: 0.7; }html body .geDialog input, html body .geToolbarContainer input, html body .mxWindow input {padding: 2px; display: inline-block; }html body .mxWindow input[type="checkbox"] {padding: 0px; }div.geDialog { border-radius: 5px; }html body div.geDialog button.geBigButton { color: '+
(Editor.isDarkMode()?Editor.darkColor:"#fff")+" !important; border: none !important; }html body .geToolbarContainer a div { color: "+(Editor.isDarkMode()?"#707070":Editor.darkColor)+" }.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }html body .mxWindow .geColorBtn, html body .geDialog .geColorBtn { background: none; }html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: "+(Editor.isDarkMode()?
"#cccccc":"#353535")+" !important; border-style: solid; border-width: 1px; border-color: rgb(216, 216, 216); }html body div.diagramContainer button:hover, html body .mxWindow button:hover, html body .geDialog button:hover { border-color: rgb(177, 177, 177); }html body div.diagramContainer button:active, html body .mxWindow button:active, html body .geDialog button:active { opacity: 0.6; }div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }div.diagramContainer button.gePrimaryBtn, .mxWindow button.gePrimaryBtn, .geDialog button.gePrimaryBtn, html body .gePrimaryBtn { background: #29b6f2; color: #fff !important; border: none; box-shadow: none; }html body .gePrimaryBtn:hover { background: #29b6f2; border: none; box-shadow: inherit; }html body button.gePrimaryBtn:hover { background: #29b6f2; border: none; }.geBtn button { min-width:72px !important; }div.geToolbarContainer a.geButton { margin:0px; padding: 0 2px 4px 2px; } html body div.geToolbarContainer a.geColorBtn { margin: 2px; } html body .mxWindow td.mxWindowPane input, html body .mxWindow td.mxWindowPane select, html body .mxWindow td.mxWindowPane textarea, html body .mxWindow td.mxWindowPane radio { padding: 0px; box-sizing: border-box; }.geDialog, .mxWindow td.mxWindowPane *, div.geSprite, td.mxWindowTitle, .geDiagramContainer { box-sizing:content-box; }.mxWindow div button.geStyleButton { box-sizing: border-box; }.mxWindowPane > .geSidebarContainer { border: none !important; }table.mxWindow td.mxWindowPane button.geColorBtn { padding:0px; box-sizing: border-box; }td.mxWindowPane .geSidebarContainer button { padding:2px; box-sizing: border-box; }html body .geMenuItem { font-size:14px; text-decoration: none; font-weight: normal; padding: 6px 10px 6px 10px; border: none; border-radius: 5px; color: #353535; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); "+
(EditorUi.isElectronApp?"app-region: no-drag; ":"")+"}.geTabContainer { border-bottom:1px solid lightgray; border-top:1px solid lightgray; background: "+(Editor.isDarkMode()?Editor.darkColor:"#fff")+" !important; }html body .geToolbarContainer { background: "+(Editor.isDarkMode()?Editor.darkColor:"#fff")+"; }div.geSidebarContainer { background-color: "+(Editor.isDarkMode()?Editor.darkColor:"#fff")+"; }div.geSidebarContainer .geTitle { background-color: "+(Editor.isDarkMode()?Editor.darkColor:"#fdfdfd")+
"; }div.mxWindow td.mxWindowPane button { background-image: none; float: none; }td.mxWindowTitle { height: 22px !important; background: none !important; font-size: 13px !important; text-align:center !important; border-bottom:1px solid lightgray; }div.mxWindow, div.mxWindowTitle { background-image: none !important; background-color:"+(Editor.isDarkMode()?Editor.darkColor:"#fff")+" !important; }div.mxWindow { border-radius:5px; box-shadow: 0px 0px 2px #C0C0C0 !important;}div.mxWindow *:not(svg *) { font-family: inherit !important; }html div.geVerticalHandle { position:absolute;bottom:0px;left:50%;cursor:row-resize;width:11px;height:11px;background:white;margin-bottom:-6px; margin-left:-6px; border: none; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }html div.geInactivePage { background: "+
(Editor.isDarkMode()?Editor.darkColor:"rgb(249, 249, 249)")+" !important; color: #A0A0A0 !important; } html div.geActivePage { background:  "+(Editor.isDarkMode()?Editor.darkColor:"#fff")+" !important;  "+(Editor.isDarkMode()?"":"color: #353535 !important; } ")+"html div.mxRubberband { border:1px solid; border-color: #29b6f2 !important; background:rgba(41,182,242,0.4) !important; } html body div.mxPopupMenu { border-radius:5px; border:1px solid #c0c0c0; padding:5px 0 5px 0; box-shadow: 0px 4px 17px -4px rgba(96,96,96,1); } html table.mxPopupMenu td.mxPopupMenuItem { color: "+
(Editor.isDarkMode()?"#cccccc":"#353535")+"; font-size: 14px; padding-top: 4px; padding-bottom: 4px; }html table.mxPopupMenu tr.mxPopupMenuItemHover { background-color: "+(Editor.isDarkMode()?"#000000":"#29b6f2")+"; }html tr.mxPopupMenuItemHover td.mxPopupMenuItem, html tr.mxPopupMenuItemHover td.mxPopupMenuItem span { color: "+(Editor.isDarkMode()?"#cccccc":"#ffffff")+" !important; }html tr.mxPopupMenuItem, html td.mxPopupMenuItem { transition-property: none !important; }html table.mxPopupMenu hr { height: 2px; background-color: rgba(0,0,0,.07); margin: 5px 0; }html body td.mxWindowTitle { padding-right: 14px; }html td.mxWindowTitle div { top: 0px !important; }"+
(mxClient.IS_IOS?"html input[type=checkbox], html input[type=radio] { height:12px; }":"")+("1"==urlParams.sketch?"a.geStatus > div { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }":"")};EditorUi.prototype.setDarkMode=function(e){this.doSetDarkMode(e);null==urlParams.dark&&(mxSettings.settings.darkMode=e,mxSettings.save());this.fireEvent(new mxEventObject("darkModeChanged"))};var R=document.createElement("link");R.setAttribute("rel","stylesheet");R.setAttribute("href",STYLE_PATH+"/dark.css");
R.setAttribute("charset","UTF-8");R.setAttribute("type","text/css");EditorUi.prototype.doSetDarkMode=function(e){if(Editor.darkMode!=e){var f=this.editor.graph;Editor.darkMode=e;this.spinner.opts.color=Editor.isDarkMode()?"#c0c0c0":"#000";f.view.defaultGridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultDarkGridColor:mxGraphView.prototype.defaultGridColor;f.view.gridColor=f.view.defaultGridColor;f.defaultPageBackgroundColor="1"==urlParams.embedInline?"transparent":Editor.isDarkMode()?Editor.darkColor:
"#ffffff";f.defaultPageBorderColor=Editor.isDarkMode()?"#505759":"#ffffff";f.shapeBackgroundColor=Editor.isDarkMode()?Editor.darkColor:"#ffffff";f.shapeForegroundColor=Editor.isDarkMode()?Editor.lightColor:"#000000";f.defaultThemeName=Editor.isDarkMode()?"darkTheme":"default-style2";f.graphHandler.previewColor=Editor.isDarkMode()?"#cccccc":"black";document.body.style.backgroundColor="1"==urlParams.embedInline?"transparent":Editor.isDarkMode()?Editor.darkColor:"#ffffff";f.loadStylesheet();null!=this.actions.layersWindow&&
(e=this.actions.layersWindow.window.isVisible(),this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.destroy(),this.actions.layersWindow=null,e&&window.setTimeout(this.actions.get("layers").funct,0));null!=this.menus.commentsWindow&&(this.menus.commentsWindow.window.setVisible(!1),this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null);null!=this.ruler&&this.ruler.updateStyle();Graph.prototype.defaultPageBackgroundColor=f.defaultPageBackgroundColor;Graph.prototype.defaultPageBorderColor=
f.defaultPageBorderColor;Graph.prototype.shapeBackgroundColor=f.shapeBackgroundColor;Graph.prototype.shapeForegroundColor=f.shapeForegroundColor;Graph.prototype.defaultThemeName=f.defaultThemeName;StyleFormatPanel.prototype.defaultStrokeColor=Editor.isDarkMode()?"#cccccc":"black";BaseFormatPanel.prototype.buttonBackgroundColor=Editor.isDarkMode()?Editor.darkColor:"white";Format.inactiveTabBackgroundColor=Editor.isDarkMode()?"black":"#f0f0f0";Dialog.backdropColor=Editor.isDarkMode()?Editor.darkColor:
"white";mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000FF";Editor.helpImage=Editor.isDarkMode()&&mxClient.IS_SVG?Editor.darkHelpImage:Editor.lightHelpImage;Editor.checkmarkImage=Editor.isDarkMode()&&mxClient.IS_SVG?Editor.darkCheckmarkImage:Editor.lightCheckmarkImage;null!=this.sketchStyleElt?this.sketchStyleElt.innerHTML=Editor.createMinimalCss():null!=Editor.styleElt&&(Editor.styleElt.innerHTML=Editor.createMinimalCss());Editor.isDarkMode()?null==R.parentNode&&document.getElementsByTagName("head")[0].appendChild(R):
null!=R.parentNode&&R.parentNode.removeChild(R)}};EditorUi.prototype.setPagesVisible=function(e){Editor.pagesVisible!=e&&(Editor.pagesVisible=e,mxSettings.settings.pagesVisible=e,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(e,f){this.sidebar.sidebarTitles!=e&&(this.sidebar.sidebarTitles=e,this.sidebar.refresh(),this.isSettingsEnabled()&&f&&(mxSettings.settings.sidebarTitles=e,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};
EditorUi.prototype.setInlineFullscreen=function(e){Editor.inlineFullscreen!=e&&(Editor.inlineFullscreen=e,this.fireEvent(new mxEventObject("inlineFullscreenChanged")),(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),window.setTimeout(mxUtils.bind(this,function(){this.refresh();this.actions.get("resetView").funct()}),10))};EditorUi.prototype.doSetSketchMode=function(e){Editor.sketchMode!=
e&&(Editor.sketchMode=e,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var e=this.editor.graph;e.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);e.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);this.menus.defaultFontSize=Editor.sketchMode?20:"sketch"==Editor.currentTheme?16:Menus.prototype.defaultFontSize;if(this.menus.defaultFontSize==Menus.prototype.defaultFontSize)e.defaultEdgeStyle.fontSize=null,e.defaultVertexStyle.fontSize=
null;else{e.defaultVertexStyle.fontSize=this.menus.defaultFontSize;var f=parseInt(this.menus.defaultFontSize)-4;e.defaultEdgeStyle.fontSize=f}"sketch"==Editor.currentTheme&&(e.defaultEdgeStyle.edgeStyle="none",e.defaultEdgeStyle.curved="1",e.defaultEdgeStyle.rounded="0",e.defaultEdgeStyle.jettySize="auto",e.defaultEdgeStyle.orthogonalLoop="1",e.defaultEdgeStyle.endArrow="open",e.defaultEdgeStyle.endSize="14",e.defaultEdgeStyle.startSize="14",e.defaultEdgeStyle.sourcePerimeterSpacing="8",e.defaultEdgeStyle.targetPerimeterSpacing=
"8");Editor.sketchMode?(this.menus.defaultFonts=Menus.prototype.defaultFonts.concat(Editor.sketchFonts),e.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,e.defaultVertexStyle.fontSource=Editor.sketchFontSource,e.defaultVertexStyle.hachureGap="4",e.defaultVertexStyle.sketch="1",e.defaultVertexStyle.jiggle="2",e.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,e.defaultEdgeStyle.fontSource=Editor.sketchFontSource,e.defaultEdgeStyle.sketch="1",e.defaultEdgeStyle.jiggle="2",e.defaultEdgeStyle.hachureGap=
"4"):this.menus.defaultFonts=Menus.prototype.defaultFonts;e.currentVertexStyle=mxUtils.clone(e.defaultVertexStyle);e.currentEdgeStyle=mxUtils.clone(e.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(e){var f=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(e)){var k=e.indexOf(",");0<k&&(f=this.getPageById(e.substring(k+1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}else"data:"==e.substring(0,5)&&(f=mxResources.get("action"));return f};
EditorUi.prototype.handleCustomLink=function(e){if(Graph.isPageLink(e)){var f=e.indexOf(",");if(e=this.getPageById(e.substring(f+1)))this.selectPage(e);else throw Error(mxResources.get("pageNotFound")||"Page not found");}else this.editor.graph.handleCustomLink(e)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){Editor.pagesVisible=mxSettings.settings.pagesVisible;
ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(e){e.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(e){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(e,
f){"1"!=urlParams["ext-fonts"]?mxSettings.setCustomFonts(this.menus.customFonts):(e=f.getProperty("customFonts"),this.menus.customFonts=e,mxSettings.setCustomFonts(e));mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(e,f){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=
null!=this.editor.graph.defaultPageFormat?this.editor.graph.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(e,f){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor(Editor.isDarkMode());this.editor.graph.view.defaultDarkGridColor=mxSettings.getGridColor(!0);this.editor.graph.view.defaultGridColor=mxSettings.getGridColor(!1);this.addListener("gridColorChanged",
mxUtils.bind(this,function(e,f){mxSettings.setGridColor(this.editor.graph.view.gridColor,Editor.isDarkMode());mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(e,f){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),
this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(e,f,k){try{null!=navigator.clipboard&&this.spinner.spin(document.body,mxResources.get("exporting"))&&
this.editor.exportToCanvas(mxUtils.bind(this,function(z,t){try{this.spinner.stop();var B=this.createImageDataUri(z,f,"png"),I=parseInt(t.getAttribute("width")),O=parseInt(t.getAttribute("height"));this.writeImageToClipboard(B,I,O,mxUtils.bind(this,function(J){this.handleError(J)}))}catch(J){this.handleError(J)}}),null,null,null,mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),null,null,null!=k?k:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,
null,null,null,10,null,null,!1,null,0<e.length?e:null)}catch(z){this.handleError(z)}};EditorUi.prototype.writeImageToClipboard=function(e,f,k,z){var t=this.base64ToBlob(e.substring(e.indexOf(",")+1),"image/png");e=new ClipboardItem({"image/png":t,"text/html":new Blob(['<img src="'+e+'" width="'+f+'" height="'+k+'">'],{type:"text/html"})});navigator.clipboard.write([e])["catch"](z)};EditorUi.prototype.copyCells=function(e,f){var k=this.editor.graph;if(k.isSelectionEmpty())e.innerText="";else{var z=
mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),t=mxUtils.getXml(k.encodeCells(z));mxUtils.setTextContent(e,encodeURIComponent(t));f?(k.removeCells(z,!1),k.lastPasteXml=null):(k.lastPasteXml=t,k.pasteCounter=0);e.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var e=null;if(Editor.enableNativeCipboard){var f=this.editor.graph;f.isSelectionEmpty()||(e=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),
f=mxUtils.getXml(f.encodeCells(e)),navigator.clipboard.writeText(f))}return e};EditorUi.prototype.pasteXml=function(e,f,k,z){var t=this.editor.graph,B=null;t.lastPasteXml==e?t.pasteCounter++:(t.lastPasteXml=e,t.pasteCounter=0);var I=t.pasteCounter*t.gridSize;if(k||this.isCompatibleString(e))B=this.importXml(e,I,I),t.setSelectionCells(B);else if(f&&1==t.getSelectionCount()){I=t.getStartEditingCell(t.getSelectionCell(),z);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(e)&&"image"==t.getCurrentCellStyle(I)[mxConstants.STYLE_SHAPE])t.setCellStyles(mxConstants.STYLE_IMAGE,
e,[I]);else{t.model.beginUpdate();try{t.labelChanged(I,e),Graph.isLink(e)&&t.setLinkForCell(I,e)}finally{t.model.endUpdate()}}t.setSelectionCell(I)}else B=t.getInsertPoint(),t.isMouseInsertPoint()&&(I=0,t.lastPasteXml==e&&0<t.pasteCounter&&t.pasteCounter--),B=this.insertTextAt(e,B.x+I,B.y+I,!0),t.setSelectionCells(B);t.isSelectionEmpty()||(t.scrollCellToVisible(t.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(t.view.getState(t.getSelectionCell())));return B};EditorUi.prototype.pasteCells=
function(e,f,k,z){if(!mxEvent.isConsumed(e)){var t=f,B=!1;if(k&&null!=e.clipboardData&&e.clipboardData.getData){var I=e.clipboardData.getData("text/plain"),O=!1;if(null!=I&&0<I.length&&"%3CmxGraphModel%3E"==I.substring(0,18))try{var J=decodeURIComponent(I);this.isCompatibleString(J)&&(O=!0,I=J)}catch(qa){}O=O?null:e.clipboardData.getData("text/html");null!=O&&0<O.length?(t=this.parseHtmlData(O),B="text/plain"!=t.getAttribute("data-type")):null!=I&&0<I.length&&(t=document.createElement("div"),mxUtils.setTextContent(t,
O))}I=t.getElementsByTagName("span");if(null!=I&&0<I.length&&"application/vnd.lucid.chart.objects"===I[0].getAttribute("data-lucid-type"))k=I[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(qa){var sa=this.editor.graph;sa.lastPasteXml==qa?sa.pasteCounter++:(sa.lastPasteXml=qa,sa.pasteCounter=0);var L=sa.pasteCounter*sa.gridSize;sa.setSelectionCells(this.importXml(qa,L,L));sa.scrollCellToVisible(sa.getSelectionCell())}),mxUtils.bind(this,
function(qa){this.handleError(qa)})),mxEvent.consume(e));else{var y=B?t.innerHTML:mxUtils.trim(null==t.innerText?mxUtils.getTextContent(t):t.innerText),ia=!1;try{var da=y.lastIndexOf("%3E");0<=da&&da<y.length-3&&(y=y.substring(0,da+3))}catch(qa){}try{I=t.getElementsByTagName("span"),(J=null!=I&&0<I.length?mxUtils.trim(decodeURIComponent(I[0].textContent)):decodeURIComponent(y))&&(this.isCompatibleString(J)||0==J.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(ia=!0,y=J)}catch(qa){}try{if(null!=
y&&0<y.length){if(0==y.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var ja=mxUtils.bind(this,function(){try{y=(new MiroImporter).importMiroJson(JSON.parse(y)),this.pasteXml(y,z,ia,e)}catch(qa){console.log("Miro import error:",qa)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",ja):ja()}else this.pasteXml(y,z,ia,e);try{mxEvent.consume(e)}catch(qa){}}else if(!k){var aa=this.editor.graph;aa.lastPasteXml=null;aa.pasteCounter=0}}catch(qa){this.handleError(qa)}}}f.innerHTML=
"&nbsp;"};EditorUi.prototype.addFileDropHandler=function(e){if(Graph.fileSupport)for(var f=null,k=0;k<e.length;k++)mxEvent.addListener(e[k],"dragleave",function(z){null!=f&&(f.parentNode.removeChild(f),f=null);z.stopPropagation();z.preventDefault()}),mxEvent.addListener(e[k],"dragover",mxUtils.bind(this,function(z){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(f=this.highlightElement());z.stopPropagation();z.preventDefault()})),
mxEvent.addListener(e[k],"drop",mxUtils.bind(this,function(z){null!=f&&(f.parentNode.removeChild(f),f=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<z.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(z.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(z)&&!mxEvent.isShiftDown(z)):this.openFiles(z.dataTransfer.files,!0);else{var t=this.extractGraphModelFromEvent(z);if(null==t){var B=null!=z.dataTransfer?z.dataTransfer:
z.clipboardData;null!=B&&(10==document.documentMode||11==document.documentMode?t=B.getData("Text"):(t=null,t=0<=mxUtils.indexOf(B.types,"text/uri-list")?z.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(B.types,"text/html")?B.getData("text/html"):null,null!=t&&0<t.length?(B=document.createElement("div"),B.innerHTML=this.editor.graph.sanitizeHtml(t),B=B.getElementsByTagName("img"),0<B.length&&(t=B[0].getAttribute("src"))):0<=mxUtils.indexOf(B.types,"text/plain")&&(t=B.getData("text/plain"))),
null!=t&&(Editor.isPngDataUrl(t)?(t=Editor.extractGraphModelFromPng(t),null!=t&&0<t.length&&this.openLocalFile(t,null,!0)):this.isRemoteFileFormat(t)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(t))).send(mxUtils.bind(this,function(I){200<=I.getStatus()&&299>=I.getStatus()&&this.openLocalFile(I.getText(),null,!0)})):/^https?:\/\//.test(t)&&(null==this.getCurrentFile()?window.location.hash=
"#U"+encodeURIComponent(t):window.openWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(t)))))}else this.openLocalFile(t,null,!0)}z.stopPropagation();z.preventDefault()}))};EditorUi.prototype.highlightElement=function(e){var f=0,k=0;if(null==e){var z=document.body;var t=document.documentElement;var B=(z.clientWidth||t.clientWidth)-3;z=Math.max(z.clientHeight||0,t.clientHeight)-3}else f=e.offsetTop,k=e.offsetLeft,B=e.clientWidth,
z=e.clientHeight;t=document.createElement("div");t.style.zIndex=mxPopupMenu.prototype.zIndex+2;t.style.border="3px dotted rgb(254, 137, 12)";t.style.pointerEvents="none";t.style.position="absolute";t.style.top=f+"px";t.style.left=k+"px";t.style.width=Math.max(0,B-3)+"px";t.style.height=Math.max(0,z-3)+"px";null!=e&&e.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(t):document.body.appendChild(t);return t};EditorUi.prototype.stringToCells=function(e){e=mxUtils.parseXml(e);
var f=this.editor.extractGraphModel(e.documentElement);e=[];if(null!=f){var k=new mxCodec(f.ownerDocument),z=new mxGraphModel;k.decode(f,z);f=z.getChildAt(z.getRoot(),0);for(k=0;k<z.getChildCount(f);k++)e.push(z.getChildAt(f,k))}return e};EditorUi.prototype.openFileHandle=function(e,f,k,z,t){if(null!=f&&0<f.length){!this.useCanvasForExport&&/(\.png)$/i.test(f)?f=f.substring(0,f.length-4)+".drawio":/(\.pdf)$/i.test(f)&&(f=f.substring(0,f.length-4)+".drawio");var B=mxUtils.bind(this,function(O){f=0<=
f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==O.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,z);try{this.loadLibrary(new LocalLibrary(this,O,f))}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(O,f,z)});if(/(\.v(dx|sdx?))($|\?)/i.test(f)||/(\.vs(x|sx?))($|\?)/i.test(f))this.importVisio(k,mxUtils.bind(this,function(O){this.spinner.stop();
B(O)}));else if(/(\.*<graphml )/.test(e))this.importGraphML(e,mxUtils.bind(this,function(O){this.spinner.stop();B(O)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(e,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(O){4==O.readyState&&(this.spinner.stop(),200<=O.status&&299>=O.status?B(O.responseText):this.handleError({message:mxResources.get(413==O.status?
"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(e))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".drawio"),this.convertLucidChart(e,mxUtils.bind(this,function(O){this.spinner.stop();this.openLocalFile(O,f,z)}),mxUtils.bind(this,function(O){this.spinner.stop();this.handleError(O)}));else if("<mxlibrary"==e.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,
this.defaultFilename,z);try{this.loadLibrary(new LocalLibrary(this,e,k.name))}catch(O){this.handleError(O,mxResources.get("errorLoadingFile"))}}else if(0==e.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(O){this.spinner.stop();B(O)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(e,f,z)}));else{if("image/png"==k.type.substring(0,9))e=this.extractGraphModelFromPng(e);else if("application/pdf"==k.type){var I=Editor.extractGraphModelFromPdf(e);null!=I&&(t=null,z=!0,
e=I)}this.spinner.stop();this.openLocalFile(e,f,z,t,null!=t?k:null)}}};EditorUi.prototype.openFiles=function(e,f){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=0;k<e.length;k++)mxUtils.bind(this,function(z){var t=new FileReader;t.onload=mxUtils.bind(this,function(B){try{this.openFileHandle(B.target.result,z.name,z,f)}catch(I){this.handleError(I)}});t.onerror=mxUtils.bind(this,function(B){this.spinner.stop();this.handleError(B);window.openFile=null});"image"!==z.type.substring(0,
5)&&"application/pdf"!==z.type||"image/svg"===z.type.substring(0,9)?t.readAsText(z):t.readAsDataURL(z)})(e[k])};EditorUi.prototype.openLocalFile=function(e,f,k,z,t){var B=this.getCurrentFile(),I=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var O=mxUtils.parseXml(e);null!=O&&(this.editor.setGraphXml(O.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,e,f||this.defaultFilename,k,z,t))});if(null!=
e&&0<e.length)null==B||!B.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=z)?I():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=z)&&null!=B&&B.isModified()?this.confirm(mxResources.get("allChangesLost"),null,I,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(e,f),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=B&&B.isModified()?this.confirm(mxResources.get("allChangesLost"),
null,I,mxResources.get("cancel"),mxResources.get("discardChanges")):I()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var e={};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,e);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),e);f=[];for(var k in e)f.push(k);return f};EditorUi.prototype.addBasenamesForCell=function(e,f){function k(I){if(null!=
I){var O=I.lastIndexOf(".");0<O&&(I=I.substring(O+1,I.length));null==f[I]&&(f[I]=!0)}}var z=this.editor.graph,t=z.getCellStyle(e);k(mxStencilRegistry.getBasenameForStencil(t[mxConstants.STYLE_SHAPE]));z.model.isEdge(e)&&(k(mxMarker.getPackageForType(t[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(t[mxConstants.STYLE_ENDARROW])));t=z.model.getChildCount(e);for(var B=0;B<t;B++)this.addBasenamesForCell(z.model.getChildAt(e,B),f)};EditorUi.prototype.setGraphEnabled=function(e){this.diagramContainer.style.visibility=
e?"":"hidden";this.formatContainer.style.visibility=e?"":"hidden";this.sidebarFooterContainer.style.display=e?"":"none";this.sidebarContainer.style.display=e?"":"none";this.hsplit.style.display=e?"":"none";this.editor.graph.setEnabled(e);null!=this.ruler&&(this.ruler.hRuler.container.style.visibility=e?"":"hidden",this.ruler.vRuler.container.style.visibility=e?"":"hidden");null!=this.tabContainer&&(this.tabContainer.style.visibility=e?"":"hidden");e||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),
null!=this.actions.layersWindow&&this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1),null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1),null!=this.menus.findReplaceWindow&&this.menus.findReplaceWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var e=
!1;this.installMessageHandler(mxUtils.bind(this,function(f,k,z,t){e||(e=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);if(t)try{var B=this.editor.graph;B.setGridEnabled(!1);B.pageVisible=!1;var I=B.model.cells,O;for(O in I){var J=I[O];null!=J&&null!=J.style&&(J.style+=";sketch=1;"+(-1==J.style.indexOf("fontFamily=")||-1<J.style.indexOf("fontFamily=Helvetica;")?
"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(y){console.log(y)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=z?z:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=
function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(e,f){null!=e?e.getPublicUrl(f):f(null)};EditorUi.prototype.createLoadMessage=function(e){var f=this.editor.graph;return{event:e,pageVisible:f.pageVisible,translate:f.view.translate,bounds:f.getGraphBounds(),currentPage:this.getSelectedPageIndex(),
scale:f.view.scale,page:f.view.getBackgroundPageBounds()}};EditorUi.prototype.sendEmbeddedSvgExport=function(e){var f=this.editor.graph;f.isEditing()&&f.stopEditing(!f.isInvokesStopCellEditing());var k=window.opener||window.parent;if(this.editor.modified){var z=f.background;if(null==z||z==mxConstants.NONE)z=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),f,null,!0,mxUtils.bind(this,function(t){k.postMessage(JSON.stringify({event:"export",
point:this.embedExitPoint,exit:null!=e?!e:!0,data:Editor.createSvgDataUri(t)}),"*")}),null,null,!0,z,1,this.embedExportBorder)}else e||k.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),"*");e||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,f.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))};EditorUi.prototype.installMessageHandler=
function(e){var f=null,k=!1,z=!1,t=null,B=mxUtils.bind(this,function(J,y){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,B);mxEvent.addListener(window,"message",mxUtils.bind(this,function(J){if(J.source==(window.opener||window.parent)){var y=J.data,ia=null,da=mxUtils.bind(this,function(pa){if(null!=pa&&"function"===
typeof pa.charAt&&"<"!=pa.charAt(0))try{Editor.isPngDataUrl(pa)?pa=Editor.extractGraphModelFromPng(pa):"data:image/svg+xml;base64,"==pa.substring(0,26)?pa=atob(pa.substring(26)):"data:image/svg+xml;utf8,"==pa.substring(0,24)&&(pa=pa.substring(24)),null!=pa&&("%"==pa.charAt(0)?pa=decodeURIComponent(pa):"<"!=pa.charAt(0)&&(pa=Graph.decompress(pa)))}catch(Aa){}return pa});if("json"==urlParams.proto){var ja=!1;try{y=JSON.parse(y),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[J],"data",
[y])}catch(pa){y=null}try{if(null==y)return;if("dialog"==y.action){this.showError(null!=y.titleKey?mxResources.get(y.titleKey):y.title,null!=y.messageKey?mxResources.get(y.messageKey):y.message,null!=y.buttonKey?mxResources.get(y.buttonKey):y.button);null!=y.modified&&(this.editor.modified=y.modified);return}if("layout"==y.action){this.executeLayouts(this.editor.graph.createLayouts(y.layouts));return}if("prompt"==y.action){this.spinner.stop();var aa=new FilenameDialog(this,y.defaultValue||"",null!=
y.okKey?mxResources.get(y.okKey):y.ok,function(pa){null!=pa?I.postMessage(JSON.stringify({event:"prompt",value:pa,message:y}),"*"):I.postMessage(JSON.stringify({event:"prompt-cancel",message:y}),"*")},null!=y.titleKey?mxResources.get(y.titleKey):y.title);this.showDialog(aa.container,300,80,!0,!1);aa.init();return}if("draft"==y.action){var qa=da(y.xml);this.spinner.stop();aa=new DraftDialog(this,mxResources.get("draftFound",[y.name||this.defaultFilename]),qa,mxUtils.bind(this,function(){this.hideDialog();
I.postMessage(JSON.stringify({event:"draft",result:"edit",message:y}),"*")}),mxUtils.bind(this,function(){this.hideDialog();I.postMessage(JSON.stringify({event:"draft",result:"discard",message:y}),"*")}),y.editKey?mxResources.get(y.editKey):null,y.discardKey?mxResources.get(y.discardKey):null,y.ignore?mxUtils.bind(this,function(){this.hideDialog();I.postMessage(JSON.stringify({event:"draft",result:"ignore",message:y}),"*")}):null);this.showDialog(aa.container,640,480,!0,!1,mxUtils.bind(this,function(pa){pa&&
this.actions.get("exit").funct()}));try{aa.init()}catch(pa){I.postMessage(JSON.stringify({event:"draft",error:pa.toString(),message:y}),"*")}return}if("template"==y.action){this.spinner.stop();var sa=1==y.enableRecent,L=1==y.enableSearch,V=1==y.enableCustomTemp;if("1"==urlParams.newTempDlg&&!y.templatesOnly&&null!=y.callback){var T=this.getCurrentUser(),Y=new TemplatesDialog(this,function(pa,Aa,xa){pa=pa||this.emptyDiagramXml;I.postMessage(JSON.stringify({event:"template",xml:pa,blank:pa==this.emptyDiagramXml,
name:Aa,tempUrl:xa.url,libs:xa.libs,builtIn:null!=xa.info&&null!=xa.info.custContentId,message:y}),"*")},mxUtils.bind(this,function(){this.actions.get("exit").funct()}),null,null,null!=T?T.id:null,sa?mxUtils.bind(this,function(pa,Aa,xa){this.remoteInvoke("getRecentDiagrams",[xa],null,pa,Aa)}):null,L?mxUtils.bind(this,function(pa,Aa,xa,Ma){this.remoteInvoke("searchDiagrams",[pa,Ma],null,Aa,xa)}):null,mxUtils.bind(this,function(pa,Aa,xa){this.remoteInvoke("getFileContent",[pa.url],null,Aa,xa)}),null,
V?mxUtils.bind(this,function(pa){this.remoteInvoke("getCustomTemplates",null,null,pa,function(){pa({},0)})}):null,!1,!1,!0,!0);this.showDialog(Y.container,window.innerWidth,window.innerHeight,!0,!1,null,!1,!0);return}aa=new NewDialog(this,!1,y.templatesOnly?!1:null!=y.callback,mxUtils.bind(this,function(pa,Aa,xa,Ma){pa=pa||this.emptyDiagramXml;null!=y.callback?I.postMessage(JSON.stringify({event:"template",xml:pa,blank:pa==this.emptyDiagramXml,name:Aa,tempUrl:xa,libs:Ma,builtIn:!0,message:y}),"*"):
(e(pa,J,pa!=this.emptyDiagramXml,y.toSketch),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,sa?mxUtils.bind(this,function(pa){this.remoteInvoke("getRecentDiagrams",[null],null,pa,function(){pa(null,"Network Error!")})}):null,L?mxUtils.bind(this,function(pa,Aa){this.remoteInvoke("searchDiagrams",[pa,null],null,Aa,function(){Aa(null,"Network Error!")})}):null,mxUtils.bind(this,function(pa,Aa,xa){I.postMessage(JSON.stringify({event:"template",docUrl:pa,info:Aa,
name:xa}),"*")}),null,null,V?mxUtils.bind(this,function(pa){this.remoteInvoke("getCustomTemplates",null,null,pa,function(){pa({},0)})}):null,1==y.withoutType);this.showDialog(aa.container,620,460,!0,!1,mxUtils.bind(this,function(pa){this.sidebar.hideTooltip();pa&&this.actions.get("exit").funct()}));aa.init();return}if("textContent"==y.action){var W=this.getDiagramTextContent();I.postMessage(JSON.stringify({event:"textContent",data:W,message:y}),"*");return}if("status"==y.action){null!=y.messageKey?
this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(y.messageKey))):null!=y.message&&this.editor.setStatus(mxUtils.htmlEntities(y.message));null!=y.modified&&(this.editor.modified=y.modified);return}if("spinner"==y.action){var ka=null!=y.messageKey?mxResources.get(y.messageKey):y.message;null==y.show||y.show?this.spinner.spin(document.body,ka):this.spinner.stop();return}if("exit"==y.action){this.actions.get("exit").funct();return}if("viewport"==y.action){null!=y.viewport&&(this.embedViewport=
y.viewport);return}if("snapshot"==y.action){this.sendEmbeddedSvgExport(!0);return}if("export"==y.action){if("png"==y.format||"xmlpng"==y.format){if(null==y.spin&&null==y.spinKey||this.spinner.spin(document.body,null!=y.spinKey?mxResources.get(y.spinKey):y.spin)){var q=null!=y.xml?y.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var F=this.editor.graph,S=mxUtils.bind(this,function(pa){this.editor.graph.setEnabled(!0);this.spinner.stop();var Aa=this.createLoadMessage("export");Aa.format=
y.format;Aa.message=y;Aa.data=pa;Aa.xml=q;I.postMessage(JSON.stringify(Aa),"*")}),ba=mxUtils.bind(this,function(pa){null==pa&&(pa=Editor.blankImage);"xmlpng"==y.format&&(pa=Editor.writeGraphModelToPng(pa,"tEXt","mxfile",encodeURIComponent(q)));F!=this.editor.graph&&F.container.parentNode.removeChild(F.container);S(pa)}),U=y.pageId||(null!=this.pages?y.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var ca=mxUtils.bind(this,function(){if(null!=this.pages&&
this.currentPage.getId()!=U){var pa=F.getGlobalVariable;F=this.createTemporaryGraph(F.getStylesheet());for(var Aa,xa=0;xa<this.pages.length;xa++)if(this.pages[xa].getId()==U){Aa=this.updatePageRoot(this.pages[xa]);break}null==Aa&&(Aa=this.currentPage);F.getGlobalVariable=function(La){return"page"==La?Aa.getName():"pagenumber"==La?1:pa.apply(this,arguments)};document.body.appendChild(F.container);F.model.setRoot(Aa.root)}if(null!=y.layerIds){var Ma=F.model,Oa=Ma.getChildCells(Ma.getRoot()),Na={};for(xa=
0;xa<y.layerIds.length;xa++)Na[y.layerIds[xa]]=!0;for(xa=0;xa<Oa.length;xa++)Ma.setVisible(Oa[xa],Na[Oa[xa].id]||!1)}this.editor.exportToCanvas(mxUtils.bind(this,function(La){ba(La.toDataURL("image/png"))}),y.width,null,y.background,mxUtils.bind(this,function(){ba(null)}),null,null,y.scale,y.transparent,y.shadow,null,F,y.border,null,y.grid,y.keepTheme)});null!=y.xml&&0<y.xml.length&&(k=!0,this.setFileData(q),k=!1);ca()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==y.format?"1":
"0")+(null!=U?"&pageId="+U:"")+(null!=y.layerIds&&0<y.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:y.layerIds})):"")+(null!=y.scale?"&scale="+y.scale:"")+"&base64=1&xml="+encodeURIComponent(q))).send(mxUtils.bind(this,function(pa){200<=pa.getStatus()&&299>=pa.getStatus()?S("data:image/png;base64,"+pa.getText()):ba(null)}),mxUtils.bind(this,function(){ba(null)}))}}else if(ca=mxUtils.bind(this,function(){var pa=this.createLoadMessage("export");pa.message=y;if("html2"==y.format||
"html"==y.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Aa=this.getXmlFileData();pa.xml=mxUtils.getXml(Aa);pa.data=this.getFileData(null,null,!0,null,null,null,Aa);pa.format=y.format}else if("html"==y.format)Aa=this.editor.getGraphXml(),pa.data=this.getHtml(Aa,this.editor.graph),pa.xml=mxUtils.getXml(Aa),pa.format=y.format;else{mxSvgCanvas2D.prototype.foAltText=null;Aa=null!=y.background?y.background:this.editor.graph.background;Aa==mxConstants.NONE&&(Aa=null);pa.xml=
this.getFileData(!0,null,null,null,null,null,null,null,null,!1);pa.format="svg";var xa=mxUtils.bind(this,function(Ma){this.editor.graph.setEnabled(!0);this.spinner.stop();pa.data=Editor.createSvgDataUri(Ma);I.postMessage(JSON.stringify(pa),"*")});if("xmlsvg"==y.format)(null==y.spin&&null==y.spinKey||this.spinner.spin(document.body,null!=y.spinKey?mxResources.get(y.spinKey):y.spin))&&this.getEmbeddedSvg(pa.xml,this.editor.graph,null,!0,xa,null,null,y.embedImages,Aa,y.scale,y.border,y.shadow,y.keepTheme);
else if(null==y.spin&&null==y.spinKey||this.spinner.spin(document.body,null!=y.spinKey?mxResources.get(y.spinKey):y.spin))this.editor.graph.setEnabled(!1),Aa=this.editor.graph.getSvg(Aa,y.scale,y.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||y.shadow,null,y.keepTheme),(this.editor.graph.shadowVisible||y.shadow)&&this.editor.graph.addSvgShadow(Aa),this.embedFonts(Aa,mxUtils.bind(this,function(Ma){y.embedImages||null==y.embedImages?this.editor.convertImages(Ma,mxUtils.bind(this,
function(Oa){xa(mxUtils.getXml(Oa))})):xa(mxUtils.getXml(Ma))}));return}I.postMessage(JSON.stringify(pa),"*")}),null!=y.xml&&0<y.xml.length){if(this.editor.graph.mathEnabled){var ea=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ea.apply(this,arguments);ca()}}k=!0;this.setFileData(y.xml);k=!1;this.editor.graph.mathEnabled||ca()}else ca();return}if("load"==y.action){ja=y.toSketch;z=1==y.autosave;this.hideDialog();null!=y.modified&&null==urlParams.modified&&(urlParams.modified=y.modified);null!=
y.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=y.saveAndExit);null!=y.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=y.noSaveBtn);if(null!=y.rough){var na=Editor.sketchMode;this.doSetSketchMode(y.rough);na!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=y.dark&&(na=Editor.darkMode,this.doSetDarkMode(y.dark),na!=Editor.darkMode&&this.fireEvent(new mxEventObject("darkModeChanged")));null!=y.border&&(this.embedExportBorder=y.border);null!=
y.background&&(this.embedExportBackground=y.background);null!=y.viewport&&(this.embedViewport=y.viewport);this.embedExitPoint=null;if(null!=y.rect){var ra=this.embedExportBorder;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.top=y.rect.top+"px";this.diagramContainer.style.left=y.rect.left+"px";this.diagramContainer.style.height=y.rect.height+"px";this.diagramContainer.style.width=y.rect.width+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right=
"";ia=mxUtils.bind(this,function(){var pa=this.editor.graph,Aa=pa.maxFitScale;pa.maxFitScale=y.maxFitScale;pa.fit(2*ra);pa.maxFitScale=Aa;pa.container.scrollTop-=2*ra;pa.container.scrollLeft-=2*ra;this.fireEvent(new mxEventObject("editInlineStart","data",[y]))})}null!=y.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=y.noExitBtn);null!=y.title&&null!=this.buttonContainer&&(qa=document.createElement("span"),mxUtils.write(qa,y.title),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),
this.buttonContainer.appendChild(qa),this.embedFilenameSpan=qa);try{y.libs&&this.sidebar.showEntries(y.libs)}catch(pa){}y=null!=y.xmlpng?this.extractGraphModelFromPng(y.xmlpng):null!=y.descriptor?y.descriptor:y.xml}else{if("merge"==y.action){var ya=this.getCurrentFile();null!=ya&&(qa=da(y.xml),null!=qa&&""!=qa&&ya.mergeFile(new LocalFile(this,qa),function(){I.postMessage(JSON.stringify({event:"merge",message:y}),"*")},function(pa){I.postMessage(JSON.stringify({event:"merge",message:y,error:pa}),"*")}))}else"remoteInvokeReady"==
y.action?this.handleRemoteInvokeReady(I):"remoteInvoke"==y.action?this.handleRemoteInvoke(y,J.origin):"remoteInvokeResponse"==y.action?this.handleRemoteInvokeResponse(y):I.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(y)}),"*");return}}catch(pa){this.handleError(pa)}}var va=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Da=mxUtils.bind(this,function(pa,Aa){k=!0;
try{e(pa,Aa,null,ja)}catch(xa){this.handleError(xa)}k=!1;null!=urlParams.modified&&this.editor.setStatus("");t=va();z&&null==f&&(f=mxUtils.bind(this,function(xa,Ma){xa=va();xa==t||k||(Ma=this.createLoadMessage("autosave"),Ma.xml=xa,(window.opener||window.parent).postMessage(JSON.stringify(Ma),"*"));t=xa}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",
f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));if("1"==urlParams.returnbounds||"json"==urlParams.proto)Aa=this.createLoadMessage("load"),Aa.xml=pa,I.postMessage(JSON.stringify(Aa),"*");null!=ia&&ia()});null!=
y&&"function"===typeof y.substring&&"data:application/vnd.visio;base64,"==y.substring(0,34)?(da="0M8R4KGxGuE"==y.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(y.substring(y.indexOf(",")+1)),function(pa){Da(pa,J)},mxUtils.bind(this,function(pa){this.handleError(pa)}),da)):null!=y&&"function"===typeof y.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(y,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(y,
mxUtils.bind(this,function(pa){4==pa.readyState&&200<=pa.status&&299>=pa.status&&"<mxGraphModel"==pa.responseText.substring(0,13)&&Da(pa.responseText,J)}),""):null!=y&&"function"===typeof y.substring&&this.isLucidChartData(y)?this.convertLucidChart(y,mxUtils.bind(this,function(pa){Da(pa)}),mxUtils.bind(this,function(pa){this.handleError(pa)})):null==y||"object"!==typeof y||null==y.format||null==y.data&&null==y.url?(y=da(y),Da(y,J)):this.loadDescriptor(y,mxUtils.bind(this,function(pa){Da(va(),J)}),
mxUtils.bind(this,function(pa){this.handleError(pa,mxResources.get("errorLoadingFile"))}))}}));var I=window.opener||window.parent;B="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";I.postMessage(B,"*");if("json"==urlParams.proto){var O=this.editor.graph.openLink;this.editor.graph.openLink=function(J,y,ia){O.apply(this,arguments);I.postMessage(JSON.stringify({event:"openLink",href:J,target:y,allowOpener:ia}),"*")}}};EditorUi.prototype.addEmbedButtons=function(){if(null!=
this.menubar&&"1"!=urlParams.embedInline){var e=document.createElement("div");e.style.display="inline-block";e.style.position="absolute";e.style.paddingTop="2px";e.style.paddingLeft="8px";e.style.paddingBottom="2px";e.style.marginRight="12px";e.style.right="atlas"==uiTheme||"1"==urlParams.atlas||"1"==urlParams["live-ui"]?"52px":"72px";var f=document.createElement("button");f.className="geBigButton";if("1"==urlParams.noSaveBtn){if("0"!=urlParams.saveAndExit){var k="1"==urlParams.publishClose?mxResources.get("publish"):
mxResources.get("saveAndExit");mxUtils.write(f,k);f.setAttribute("title",k);mxEvent.addListener(f,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()}));e.appendChild(f)}}else mxUtils.write(f,mxResources.get("save")),f.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(f,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})),e.appendChild(f),"1"==urlParams.saveAndExit&&(f=document.createElement("a"),mxUtils.write(f,
mxResources.get("saveAndExit")),f.setAttribute("title",mxResources.get("saveAndExit")),f.className="geBigButton geBigStandardButton",f.style.marginLeft="6px",mxEvent.addListener(f,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),e.appendChild(f));"1"!=urlParams.noExitBtn&&(f=document.createElement("a"),k="1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),mxUtils.write(f,k),f.setAttribute("title",k),f.className="geBigButton geBigStandardButton",
f.style.marginLeft="6px",mxEvent.addListener(f,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()})),e.appendChild(f));this.toolbar.container.appendChild(e);this.toolbar.staticElements.push(e)}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(e){this.importCsv(e)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?
null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.loadOrgChartLayouts=function(e){var f=mxUtils.bind(this,function(){this.loadingOrgChart=!1;this.spinner.stop();e()});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?f():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",
function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",f)})})}):mxscript(DRAWIO_BASE_URL+"/js/orgchart.min.js",f))};EditorUi.prototype.importCsv=function(e,f){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(e,f)}))};EditorUi.prototype.doImportCsv=function(e,f){try{var k=e.split("\n"),z=[],t=[],B=[],I={};if(0<k.length){var O={},J=this.editor.graph,y=null,ia=null,
da=null,ja=null,aa=null,qa=null,sa=null,L="whiteSpace=wrap;html=1;",V=null,T=null,Y="",W="auto",ka="auto",q=!1,F=null,S=null,ba=40,U=40,ca=100,ea=0,na=mxUtils.bind(this,function(){null!=f?f(Fa):(J.setSelectionCells(Fa),J.scrollCellToVisible(J.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ra=J.getFreeInsertPoint(),ya=ra.x,va=ra.y;ra=va;var Da=null,pa="auto";T=null;for(var Aa=[],xa=null,Ma=null,Oa=0;Oa<k.length&&"#"==
k[Oa].charAt(0);){e=k[Oa].replace(/\r$/,"");for(Oa++;Oa<k.length&&"\\"==e.charAt(e.length-1)&&"#"==k[Oa].charAt(0);)e=e.substring(0,e.length-1)+mxUtils.trim(k[Oa].substring(1)),Oa++;if("#"!=e.charAt(1)){var Na=e.indexOf(":");if(0<Na){var La=mxUtils.trim(e.substring(1,Na)),Ba=mxUtils.trim(e.substring(Na+1));"label"==La?Da=J.sanitizeHtml(Ba):"labelname"==La&&0<Ba.length&&"-"!=Ba?aa=Ba:"labels"==La&&0<Ba.length&&"-"!=Ba?sa=JSON.parse(Ba):"style"==La?ia=Ba:"parentstyle"==La?L=Ba:"unknownStyle"==La&&"-"!=
Ba?qa=Ba:"stylename"==La&&0<Ba.length&&"-"!=Ba?ja=Ba:"styles"==La&&0<Ba.length&&"-"!=Ba?da=JSON.parse(Ba):"vars"==La&&0<Ba.length&&"-"!=Ba?y=JSON.parse(Ba):"identity"==La&&0<Ba.length&&"-"!=Ba?V=Ba:"parent"==La&&0<Ba.length&&"-"!=Ba?T=Ba:"namespace"==La&&0<Ba.length&&"-"!=Ba?Y=Ba:"width"==La?W=Ba:"height"==La?ka=Ba:"collapsed"==La&&"-"!=Ba?q="true"==Ba:"left"==La&&0<Ba.length?F=Ba:"top"==La&&0<Ba.length?S=Ba:"ignore"==La?Ma=Ba.split(","):"connect"==La?Aa.push(JSON.parse(Ba)):"link"==La?xa=Ba:"padding"==
La?ea=parseFloat(Ba):"edgespacing"==La?ba=parseFloat(Ba):"nodespacing"==La?U=parseFloat(Ba):"levelspacing"==La?ca=parseFloat(Ba):"layout"==La&&(pa=Ba)}}}if(null==k[Oa])throw Error(mxResources.get("invalidOrMissingFile"));var ab=this.editor.csvToArray(k[Oa].replace(/\r$/,""));Na=e=null;La=[];for(Ba=0;Ba<ab.length;Ba++)V==ab[Ba]&&(e=Ba),T==ab[Ba]&&(Na=Ba),La.push(mxUtils.trim(ab[Ba]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Da&&(Da="%"+La[0]+"%");if(null!=Aa)for(var Xa=
0;Xa<Aa.length;Xa++)null==O[Aa[Xa].to]&&(O[Aa[Xa].to]={});V=[];for(Ba=Oa+1;Ba<k.length;Ba++){var x=this.editor.csvToArray(k[Ba].replace(/\r$/,""));if(null==x){var H=40<k[Ba].length?k[Ba].substring(0,40)+"...":k[Ba];throw Error(H+" ("+Ba+"):\n"+mxResources.get("containsValidationErrors"));}0<x.length&&V.push(x)}J.model.beginUpdate();try{for(Ba=0;Ba<V.length;Ba++){x=V[Ba];var P=null,X=null!=e?Y+x[e]:null;k=!1;null!=X&&(P=J.model.getCell(X),k=null==P||0<=mxUtils.indexOf(z,P));var Z=new mxCell(Da,new mxGeometry(ya,
ra,0,0),ia||"whiteSpace=wrap;html=1;");Z.collapsed=q;Z.vertex=!0;Z.id=X;null==P||k||J.model.setCollapsed(P,q);for(var fa=0;fa<x.length;fa++)J.setAttributeForCell(Z,La[fa],x[fa]),null==P||k||J.setAttributeForCell(P,La[fa],x[fa]);if(null!=aa&&null!=sa){var la=sa[Z.getAttribute(aa)];null!=la&&(J.labelChanged(Z,la),null==P||k||J.cellLabelChanged(P,la))}if(null!=ja&&null!=da){var za=da[Z.getAttribute(ja)];null!=za&&(Z.style=za)}J.setAttributeForCell(Z,"placeholders","1");Z.style=J.replacePlaceholders(Z,
Z.style,y);null==P||k?J.fireEvent(new mxEventObject("cellsInserted","cells",[Z])):(J.model.setStyle(P,Z.style),0>mxUtils.indexOf(B,P)&&B.push(P),J.fireEvent(new mxEventObject("cellsInserted","cells",[P])));k=null!=P;P=Z;if(!k)for(Xa=0;Xa<Aa.length;Xa++)O[Aa[Xa].to][P.getAttribute(Aa[Xa].to)]=P;null!=xa&&"link"!=xa&&(J.setLinkForCell(P,P.getAttribute(xa)),J.setAttributeForCell(P,xa,null));var ua=this.editor.graph.getPreferredSizeForCell(P);T=null!=Na?J.model.getCell(Y+x[Na]):null;if(P.vertex){H=null!=
T?0:ya;Oa=null!=T?0:va;null!=F&&null!=P.getAttribute(F)&&(P.geometry.x=H+parseFloat(P.getAttribute(F)));null!=S&&null!=P.getAttribute(S)&&(P.geometry.y=Oa+parseFloat(P.getAttribute(S)));var oa="@"==W.charAt(0)?P.getAttribute(W.substring(1)):null;P.geometry.width=null!=oa&&"auto"!=oa?parseFloat(P.getAttribute(W.substring(1))):"auto"==W||"auto"==oa?ua.width+ea:parseFloat(W);var ta="@"==ka.charAt(0)?P.getAttribute(ka.substring(1)):null;P.geometry.height=null!=ta&&"auto"!=ta?parseFloat(ta):"auto"==ka||
"auto"==ta?ua.height+ea:parseFloat(ka);ra+=P.geometry.height+U}k?(null==I[X]&&(I[X]=[]),I[X].push(P)):(z.push(P),null!=T?(T.style=J.replacePlaceholders(T,L,y),J.addCell(P,T),t.push(T)):B.push(J.addCell(P)))}for(Ba=0;Ba<t.length;Ba++)oa="@"==W.charAt(0)?t[Ba].getAttribute(W.substring(1)):null,ta="@"==ka.charAt(0)?t[Ba].getAttribute(ka.substring(1)):null,"auto"!=W&&"auto"!=oa||"auto"!=ka&&"auto"!=ta||J.updateGroupBounds([t[Ba]],ea,!0);var Ea=B.slice(),Fa=B.slice();for(Xa=0;Xa<Aa.length;Xa++){var Pa=
Aa[Xa];for(Ba=0;Ba<z.length;Ba++){P=z[Ba];var Ra=mxUtils.bind(this,function(Ya,Za,fb){var hb=Za.getAttribute(fb.from);if(null!=hb&&""!=hb){hb=hb.split(",");for(var qb=0;qb<hb.length;qb++){var kb=O[fb.to][hb[qb]];if(null==kb&&null!=qa){kb=new mxCell(hb[qb],new mxGeometry(ya,va,0,0),qa);kb.style=J.replacePlaceholders(Za,kb.style,y);var ib=this.editor.graph.getPreferredSizeForCell(kb);kb.geometry.width=ib.width+ea;kb.geometry.height=ib.height+ea;O[fb.to][hb[qb]]=kb;kb.vertex=!0;kb.id=hb[qb];B.push(J.addCell(kb))}if(null!=
kb){ib=fb.label;null!=fb.fromlabel&&(ib=(Za.getAttribute(fb.fromlabel)||"")+(ib||""));null!=fb.sourcelabel&&(ib=J.replacePlaceholders(Za,fb.sourcelabel,y)+(ib||""));null!=fb.tolabel&&(ib=(ib||"")+(kb.getAttribute(fb.tolabel)||""));null!=fb.targetlabel&&(ib=(ib||"")+J.replacePlaceholders(kb,fb.targetlabel,y));var ub="target"==fb.placeholders==!fb.invert?kb:Ya;ub=null!=fb.style?J.replacePlaceholders(ub,fb.style,y):J.createCurrentEdgeStyle();ib=J.insertEdge(null,null,ib||"",fb.invert?kb:Ya,fb.invert?
Ya:kb,ub);if(null!=fb.labels)for(ub=0;ub<fb.labels.length;ub++){var ob=fb.labels[ub],nb=new mxCell(ob.label||ub,new mxGeometry(null!=ob.x?ob.x:0,null!=ob.y?ob.y:0,0,0),"resizable=0;html=1;");nb.vertex=!0;nb.connectable=!1;nb.geometry.relative=!0;null!=ob.placeholders&&(nb.value=J.replacePlaceholders("target"==ob.placeholders==!fb.invert?kb:Ya,nb.value,y));if(null!=ob.dx||null!=ob.dy)nb.geometry.offset=new mxPoint(null!=ob.dx?ob.dx:0,null!=ob.dy?ob.dy:0);ib.insert(nb)}Fa.push(ib);mxUtils.remove(fb.invert?
Ya:kb,Ea)}}}});Ra(P,P,Pa);if(null!=I[P.id])for(fa=0;fa<I[P.id].length;fa++)Ra(P,I[P.id][fa],Pa)}}if(null!=Ma)for(Ba=0;Ba<z.length;Ba++)for(P=z[Ba],fa=0;fa<Ma.length;fa++)J.setAttributeForCell(P,mxUtils.trim(Ma[fa]),null);if(0<B.length){var Ca=new mxParallelEdgeLayout(J);Ca.spacing=ba;Ca.checkOverlap=!0;var Ja=function(){0<Ca.spacing&&Ca.execute(J.getDefaultParent());for(var Ya=0;Ya<B.length;Ya++){var Za=J.getCellGeometry(B[Ya]);Za.x=Math.round(J.snap(Za.x));Za.y=Math.round(J.snap(Za.y));"auto"==W&&
(Za.width=Math.round(J.snap(Za.width)));"auto"==ka&&(Za.height=Math.round(J.snap(Za.height)))}};if("["==pa.charAt(0)){var Qa=na;J.view.validate();this.executeLayouts(J.createLayouts(JSON.parse(pa)),function(){Ja();Qa()});na=null}else if("circle"==pa){var $a=new mxCircleLayout(J);$a.disableEdgeStyle=!1;$a.resetEdges=!1;var eb=$a.isVertexIgnored;$a.isVertexIgnored=function(Ya){return eb.apply(this,arguments)||0>mxUtils.indexOf(B,Ya)};this.executeLayout(function(){$a.execute(J.getDefaultParent());Ja()},
!0,na);na=null}else if("horizontaltree"==pa||"verticaltree"==pa||"auto"==pa&&Fa.length==2*B.length-1&&1==Ea.length){J.view.validate();var cb=new mxCompactTreeLayout(J,"horizontaltree"==pa);cb.levelDistance=U;cb.edgeRouting=!1;cb.resetEdges=!1;this.executeLayout(function(){cb.execute(J.getDefaultParent(),0<Ea.length?Ea[0]:null)},!0,na);na=null}else if("horizontalflow"==pa||"verticalflow"==pa||"auto"==pa&&1==Ea.length){J.view.validate();var db=new mxHierarchicalLayout(J,"horizontalflow"==pa?mxConstants.DIRECTION_WEST:
mxConstants.DIRECTION_NORTH);db.intraCellSpacing=U;db.parallelEdgeSpacing=ba;db.interRankCellSpacing=ca;db.disableEdgeStyle=!1;this.executeLayout(function(){db.execute(J.getDefaultParent(),Fa);J.moveCells(Fa,ya,va)},!0,na);na=null}else if("orgchart"==pa){J.view.validate();var rb=new mxOrgChartLayout(J,2,ca,U),mb=rb.isVertexIgnored;rb.isVertexIgnored=function(Ya){return mb.apply(this,arguments)||0>mxUtils.indexOf(B,Ya)};this.executeLayout(function(){rb.execute(J.getDefaultParent());Ja()},!0,na);na=
null}else if("organic"==pa||"auto"==pa&&Fa.length>B.length){J.view.validate();var vb=new mxFastOrganicLayout(J);vb.forceConstant=3*U;vb.disableEdgeStyle=!1;vb.resetEdges=!1;var Bb=vb.isVertexIgnored;vb.isVertexIgnored=function(Ya){return Bb.apply(this,arguments)||0>mxUtils.indexOf(B,Ya)};this.executeLayout(function(){vb.execute(J.getDefaultParent());Ja()},!0,na);na=null}}this.hideDialog()}finally{J.model.endUpdate()}null!=na&&na()}}catch(Ya){this.handleError(Ya)}};EditorUi.prototype.getSearch=function(e){var f=
"";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=e&&0<window.location.search.length){var k="?",z;for(z in urlParams)0>mxUtils.indexOf(e,z)&&null!=urlParams[z]&&(f+=k+z+"="+urlParams[z],k="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(e){e=null!=e?e:window.location.pathname;var f=0<e.indexOf("?")?1:0;if("1"==urlParams.offline)e+=window.location.search;else{var k="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
z;for(z in urlParams)0>mxUtils.indexOf(k,z)&&(e=0==f?e+"?":e+"&",null!=urlParams[z]&&(e+=z+"="+urlParams[z],f++))}return e};EditorUi.prototype.showLinkDialog=function(e,f,k,z,t){e=new LinkDialog(this,e,f,k,!0,z,t);this.showDialog(e.container,560,130,!0,!0);e.init()};EditorUi.prototype.getServiceCount=function(e){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||
f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;e&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var e=this.getCurrentFile(),f=null!=e||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var k=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==e||e.isRestricted());this.actions.get("makeCopy").setEnabled(!k);
this.actions.get("print").setEnabled(!k);this.menus.get("exportAs").setEnabled(!k);this.menus.get("embed").setEnabled(!k);k="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(k);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(k),this.menus.get("newLibrary").setEnabled(k));e="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=e&&e.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);
this.actions.get("resetView").setEnabled(f);this.actions.get("toggleDarkMode").setEnabled("atlas"!=uiTheme);this.actions.get("undo").setEnabled(this.canUndo()&&e);this.actions.get("redo").setEnabled(this.canRedo()&&e);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);this.menus.get("importFrom").setEnabled(e);this.menus.get("arrange").setEnabled(e);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(e),null!=this.toolbar.edgeStyleMenu&&
this.toolbar.edgeStyleMenu.setEnabled(e));this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var e=this.getCurrentFile();return null!=e&&e.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var G=EditorUi.prototype.createSidebar;EditorUi.prototype.createSidebar=
function(e){var f=G.apply(this,arguments);this.addListener("darkModeChanged",mxUtils.bind(this,function(){f.refresh()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){f.refresh()}));return f};var M=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){M.apply(this,arguments);var e=this.editor.graph,f=this.getCurrentFile(),k=this.getSelectionState(),z=this.isDiagramActive();this.actions.get("pageSetup").setEnabled(z);this.actions.get("autosave").setEnabled(null!=
f&&f.isEditable()&&f.isAutosaveOptional());this.actions.get("guides").setEnabled(z);this.actions.get("editData").setEnabled(e.isEnabled());this.actions.get("shadowVisible").setEnabled(z);this.actions.get("connectionArrows").setEnabled(z);this.actions.get("connectionPoints").setEnabled(z);this.actions.get("copyStyle").setEnabled(z&&!e.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(z&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length);this.actions.get("createShape").setEnabled(z);
this.actions.get("createRevision").setEnabled(z);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(z&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("tags").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("outline").setEnabled("hidden"!=
this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("hidden"!=this.diagramContainer.style.visibility);f.label=mxResources.get("find")+(e.isEnabled()?"/"+mxResources.get("replace"):"");e=e.view.getState(e.getSelectionCell());this.actions.get("editShape").setEnabled(z&&null!=
e&&null!=e.shape&&null!=e.shape.stencil)};var Q=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);Q.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(e,f,k,z,t,B,I,O){var J=e.editor.graph;if("xml"==k)e.hideDialog(),e.saveData(f,"xml",mxUtils.getXml(e.editor.getGraphXml()),"text/xml");
else if("svg"==k)e.hideDialog(),e.saveData(f,"svg",mxUtils.getXml(J.getSvg(z,t,B)),"image/svg+xml");else{var y=e.getFileData(!0,null,null,null,null,!0),ia=J.getGraphBounds(),da=Math.floor(ia.width*t/J.view.scale),ja=Math.floor(ia.height*t/J.view.scale);if(y.length<=MAX_REQUEST_SIZE&&da*ja<MAX_AREA)if(e.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!e.isExportToCanvas()){var aa={globalVars:J.getExportVariables()};O&&(aa.grid={size:J.gridSize,steps:J.view.gridSteps,color:J.view.gridColor});e.saveRequest(f,
k,function(qa,sa){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(sa||"0")+(null!=qa?"&filename="+encodeURIComponent(qa):"")+"&extras="+encodeURIComponent(JSON.stringify(aa))+(0<I?"&dpi="+I:"")+"&bg="+(null!=z?z:"none")+"&w="+da+"&h="+ja+"&border="+B+"&xml="+encodeURIComponent(y))})}else"png"==k?e.exportImage(t,null==z||"none"==z,!0,!1,!1,B,!0,!1,null,O,I):e.exportImage(t,!1,!0,!1,!1,B,!0,!1,"jpeg",O);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=
function(){this.editor.graph.setEnabled(!1);var e=this.editor.graph,f="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var z=e;this.currentPage!=this.pages[k]&&(z=this.createTemporaryGraph(e.getStylesheet()),this.updatePageRoot(this.pages[k]),z.model.setRoot(this.pages[k].root));f+=this.pages[k].getName()+" "+z.getIndexableText()+" "}else f=e.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.showRemotelyStoredLibrary=function(e){var f={},k=document.createElement("div");
k.style.whiteSpace="nowrap";var z=document.createElement("h3");mxUtils.write(z,mxUtils.htmlEntities(e));z.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(z);var t=document.createElement("div");t.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";t.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var B={};try{var I=mxSettings.getCustomLibraries();for(e=0;e<I.length;e++){var O=I[e];if("R"==
O.substring(0,1)){var J=JSON.parse(decodeURIComponent(O.substring(1)));B[J[0]]={id:J[0],title:J[1],downloadUrl:J[2]}}}}catch(y){}this.remoteInvoke("getCustomLibraries",null,null,function(y){t.innerText="";if(0==y.length)t.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var ia=0;ia<y.length;ia++){var da=y[ia];B[da.id]&&(f[da.id]=da);var ja=this.addCheckbox(t,da.title,B[da.id]);(function(aa,qa){mxEvent.addListener(qa,
"change",function(){this.checked?f[aa.id]=aa:delete f[aa.id]})})(da,ja)}},mxUtils.bind(this,function(y){t.innerText="";var ia=document.createElement("div");ia.style.padding="8px";ia.style.textAlign="center";mxUtils.write(ia,mxResources.get("error")+": ");mxUtils.write(ia,null!=y&&null!=y.message?y.message:mxResources.get("unknownError"));t.appendChild(ia)}));k.appendChild(t);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var y=0,
ia;for(ia in f)null==B[ia]&&(y++,mxUtils.bind(this,function(da){this.remoteInvoke("getFileContent",[da.downloadUrl],null,mxUtils.bind(this,function(ja){y--;0==y&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,ja,da))}catch(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){y--;0==y&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[ia]));for(ia in B)f[ia]||this.closeLibrary(new RemoteLibrary(this,null,B[ia]));
0==y&&this.spinner.stop()}),null,null,"https://www.diagrams.net/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];
EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(e){this.remoteWin=e;for(var f=0;f<this.remoteInvokeQueue.length;f++)e.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(e){var f=e.msgMarkers,k=this.remoteInvokeCallbacks[f.callbackId];if(null==k)throw Error("No callback for "+(null!=f?f.callbackId:"null"));e.error?k.error&&k.error(e.error.errResp):k.callback&&k.callback.apply(this,
e.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(e,f,k,z,t){var B=!0,I=window.setTimeout(mxUtils.bind(this,function(){B=!1;t({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),O=mxUtils.bind(this,function(){window.clearTimeout(I);B&&z.apply(this,arguments)}),J=mxUtils.bind(this,function(){window.clearTimeout(I);B&&t.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:O,
error:J});e=JSON.stringify({event:"remoteInvoke",funtionName:e,functionArgs:f,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(e,"*"):this.remoteInvokeQueue.push(e)};EditorUi.prototype.handleRemoteInvoke=function(e,f){var k=mxUtils.bind(this,function(y,ia){var da={event:"remoteInvokeResponse",msgMarkers:e.msgMarkers};null!=ia?da.error={errResp:ia}:null!=y&&(da.resp=y);this.remoteWin.postMessage(JSON.stringify(da),"*")});try{var z=e.funtionName,t=this.remoteInvokableFns[z];if(null!=t&&
"function"===typeof this[z]){if(t.allowedDomains){for(var B=!1,I=0;I<t.allowedDomains.length;I++)if(f=="https://"+t.allowedDomains[I]){B=!0;break}if(!B){k(null,"Invalid Call: "+z+" is not allowed.");return}}var O=e.functionArgs;Array.isArray(O)||(O=[]);if(t.isAsync)O.push(function(){k(Array.prototype.slice.apply(arguments))}),O.push(function(y){k(null,y||"Unkown Error")}),this[z].apply(this,O);else{var J=this[z].apply(this,O);k([J])}}else k(null,"Invalid Call: "+z+" is not found.")}catch(y){k(null,
"Invalid Call: An error occurred, "+y.message)}};EditorUi.prototype.openDatabase=function(e,f){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var z=k.open("database",2);z.onupgradeneeded=function(t){try{var B=z.result;1>t.oldVersion&&B.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&(B.createObjectStore("files",{keyPath:"title"}),B.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(I){null!=
f&&f(I)}};z.onsuccess=mxUtils.bind(this,function(t){var B=z.result;this.database=B;EditorUi.migrateStorageFiles&&(StorageFile.migrate(B),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(I){if(!I||"1"==urlParams.forceMigration){var O=document.createElement("iframe");O.style.display="none";O.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+
urlParams.forceMigration);document.body.appendChild(O);var J=!0,y=!1,ia,da=0,ja=mxUtils.bind(this,function(){y=!0;this.setDatabaseItem(".drawioMigrated3",!0);O.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),aa=mxUtils.bind(this,function(){da++;qa()}),qa=mxUtils.bind(this,function(){try{if(da>=ia.length)ja();else{var L=ia[da];StorageFile.getFileContent(this,L,mxUtils.bind(this,function(V){null==V||".scratchpad"==L&&V==this.emptyLibraryXml?O.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",
funtionName:"getLocalStorageFile",functionArgs:[L]}),"*"):aa()}),aa)}}catch(V){console.log(V)}}),sa=mxUtils.bind(this,function(L){try{this.setDatabaseItem(null,[{title:L.title,size:L.data.length,lastModified:Date.now(),type:L.isLib?"L":"F"},{title:L.title,data:L.data}],aa,aa,["filesInfo","files"])}catch(V){console.log(V)}});I=mxUtils.bind(this,function(L){try{if(L.source==O.contentWindow){var V={};try{V=JSON.parse(L.data)}catch(T){}"init"==V.event?(O.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),
"*"),O.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=V.event||y||(J?null!=V.resp&&0<V.resp.length&&null!=V.resp[0]?(ia=V.resp[0],J=!1,qa()):ja():null!=V.resp&&0<V.resp.length&&null!=V.resp[0]?sa(V.resp[0]):aa())}}catch(T){console.log(T)}});window.addEventListener("message",I)}})));e(B);B.onversionchange=function(){B.close()}});z.onerror=f;z.onblocked=function(){}}catch(t){null!=f&&f(t)}else null!=f&&f()}else e(this.database)};
EditorUi.prototype.setDatabaseItem=function(e,f,k,z,t){this.openDatabase(mxUtils.bind(this,function(B){try{t=t||"objects";Array.isArray(t)||(t=[t],e=[e],f=[f]);var I=B.transaction(t,"readwrite");I.oncomplete=k;I.onerror=z;for(B=0;B<t.length;B++)I.objectStore(t[B]).put(null!=e&&null!=e[B]?{key:e[B],data:f[B]}:f[B])}catch(O){null!=z&&z(O)}}),z)};EditorUi.prototype.removeDatabaseItem=function(e,f,k,z){this.openDatabase(mxUtils.bind(this,function(t){z=z||"objects";Array.isArray(z)||(z=[z],e=[e]);t=t.transaction(z,
"readwrite");t.oncomplete=f;t.onerror=k;for(var B=0;B<z.length;B++)t.objectStore(z[B]).delete(e[B])}),k)};EditorUi.prototype.getDatabaseItem=function(e,f,k,z){this.openDatabase(mxUtils.bind(this,function(t){try{z=z||"objects";var B=t.transaction([z],"readonly").objectStore(z).get(e);B.onsuccess=function(){f(B.result)};B.onerror=k}catch(I){null!=k&&k(I)}}),k)};EditorUi.prototype.getDatabaseItems=function(e,f,k){this.openDatabase(mxUtils.bind(this,function(z){try{k=k||"objects";var t=z.transaction([k],
"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),B=[];t.onsuccess=function(I){null==I.target.result?e(B):(B.push(I.target.result.value),I.target.result.continue())};t.onerror=f}catch(I){null!=f&&f(I)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(e,f,k){this.openDatabase(mxUtils.bind(this,function(z){try{k=k||"objects";var t=z.transaction([k],"readonly").objectStore(k).getAllKeys();t.onsuccess=function(){e(t.result)};t.onerror=f}catch(B){null!=f&&f(B)}}),f)};EditorUi.prototype.commentsSupported=
function(){var e=this.getCurrentFile();return null!=e?e.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var e=this.getCurrentFile();return null!=e?e.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var e=this.getCurrentFile();return null!=e?e.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(e,f){var k=this.getCurrentFile();null!=k?k.getComments(e,f):e([])};EditorUi.prototype.addComment=function(e,f,k){var z=this.getCurrentFile();
null!=z?z.addComment(e,f,k):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var e=this.getCurrentFile();return null!=e?e.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var e=this.getCurrentFile();return null!=e?e.canComment():!0};EditorUi.prototype.newComment=function(e,f){var k=this.getCurrentFile();return null!=k?k.newComment(e,f):new DrawioComment(this,null,e,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var e=this.getCurrentFile();
return null!=e&&e.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(e,f){var k=this.getCurrentFile();null!=k&&k.getRevisions?k.getRevisions(e,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var e=this.getCurrentFile();return null!=e&&(e.constructor==DriveFile&&e.isEditable()||e.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(e){e.setRequestHeader("Content-Language",
"da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(e,f,k,z,t,B,I,O){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(e,f,k,z,t,B,I,O)};EditorUi.prototype.loadFonts=function(e){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(e)};EditorUi.prototype.createSvgDataUri=function(e){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(e)};EditorUi.prototype.embedCssFonts=function(e,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");
return this.editor.embedCssFonts(e,f)};EditorUi.prototype.embedExtFonts=function(e){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(e)};EditorUi.prototype.exportToCanvas=function(e,f,k,z,t,B,I,O,J,y,ia,da,ja,aa,qa,sa){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(e,f,k,z,t,B,I,O,J,y,ia,da,ja,aa,qa,sa)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");
return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(e,f,k,z){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(e,f,k,z)};EditorUi.prototype.convertImageToDataUri=function(e,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(e,f)};EditorUi.prototype.base64Encode=function(e){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(e)};EditorUi.prototype.updateCRC=
function(e,f,k,z){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(e,f,k,z)};EditorUi.prototype.crc32=function(e){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(e)};EditorUi.prototype.writeGraphModelToPng=function(e,f,k,z,t){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(e,f,k,z,t)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=
urlParams.forceMigration)return null;for(var e=[],f=0;f<localStorage.length;f++){var k=localStorage.key(f),z=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<z.length){var t="<mxfile "===z.substring(0,8)||"<?xml"===z.substring(0,5)||"\x3c!--[if IE]>"===z.substring(0,12);z="<mxlibrary>"===z.substring(0,11);(t||z)&&e.push(k)}}return e};EditorUi.prototype.getLocalStorageFile=function(e){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;
var f=localStorage.getItem(e);return{title:e,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
var CommentsWindow=function(b,d,g,l,D,p){function E(){for(var aa=I.getElementsByTagName("div"),qa=0,sa=0;sa<aa.length;sa++)"none"!=aa[sa].style.display&&aa[sa].parentNode==I&&qa++;O.style.display=0==qa?"block":"none"}function N(aa,qa,sa,L){function V(){qa.removeChild(W);qa.removeChild(ka);Y.style.display="block";T.style.display="block"}z={div:qa,comment:aa,saveCallback:sa,deleteOnCancel:L};var T=qa.querySelector(".geCommentTxt"),Y=qa.querySelector(".geCommentActionsList"),W=document.createElement("textarea");
W.className="geCommentEditTxtArea";W.style.minHeight=T.offsetHeight+"px";W.value=aa.content;qa.insertBefore(W,T);var ka=document.createElement("div");ka.className="geCommentEditBtns";var q=mxUtils.button(mxResources.get("cancel"),function(){L?(qa.parentNode.removeChild(qa),E()):V();z=null});q.className="geCommentEditBtn";ka.appendChild(q);var F=mxUtils.button(mxResources.get("save"),function(){T.innerText="";aa.content=W.value;mxUtils.write(T,aa.content);V();sa(aa);z=null});mxEvent.addListener(W,
"keydown",mxUtils.bind(this,function(S){mxEvent.isConsumed(S)||((mxEvent.isControlDown(S)||mxClient.IS_MAC&&mxEvent.isMetaDown(S))&&13==S.keyCode?(F.click(),mxEvent.consume(S)):27==S.keyCode&&(q.click(),mxEvent.consume(S)))}));F.focus();F.className="geCommentEditBtn gePrimaryBtn";ka.appendChild(F);qa.insertBefore(ka,T);Y.style.display="none";T.style.display="none";W.focus()}function R(aa,qa){qa.innerText="";aa=new Date(aa.modifiedDate);var sa=b.timeSince(aa);null==sa&&(sa=mxResources.get("lessThanAMinute"));
mxUtils.write(qa,mxResources.get("timeAgo",[sa],"{1} ago"));qa.setAttribute("title",aa.toLocaleDateString()+" "+aa.toLocaleTimeString())}function G(aa){var qa=document.createElement("img");qa.className="geCommentBusyImg";qa.src=IMAGE_PATH+"/spin.gif";aa.appendChild(qa);aa.busyImg=qa}function M(aa){aa.style.border="1px solid red";aa.removeChild(aa.busyImg)}function Q(aa){aa.style.border="";aa.removeChild(aa.busyImg)}function e(aa,qa,sa,L,V){function T(U,ca,ea){var na=document.createElement("li");na.className=
"geCommentAction";var ra=document.createElement("a");ra.className="geCommentActionLnk";mxUtils.write(ra,U);na.appendChild(ra);mxEvent.addListener(ra,"click",function(ya){ca(ya,aa);ya.preventDefault();mxEvent.consume(ya)});ba.appendChild(na);ea&&(na.style.display="none")}function Y(){function U(na){ca.push(ea);if(null!=na.replies)for(var ra=0;ra<na.replies.length;ra++)ea=ea.nextSibling,U(na.replies[ra])}var ca=[],ea=ka;U(aa);return{pdiv:ea,replies:ca}}function W(U,ca,ea,na,ra){function ya(){G(Aa);
aa.addReply(pa,function(xa){pa.id=xa;aa.replies.push(pa);Q(Aa);ea&&ea()},function(xa){va();M(Aa);b.handleError(xa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},na,ra)}function va(){N(pa,Aa,function(xa){ya()},!0)}var Da=Y().pdiv,pa=b.newComment(U,b.getCurrentUser());pa.pCommentId=aa.id;null==aa.replies&&(aa.replies=[]);var Aa=e(pa,aa.replies,Da,L+1);ca?va():ya()}if(V||!aa.isResolved){O.style.display="none";var ka=document.createElement("div");ka.className="geCommentContainer";
ka.setAttribute("data-commentId",aa.id);ka.style.marginLeft=20*L+5+"px";aa.isResolved&&!Editor.isDarkMode()&&(ka.style.backgroundColor="ghostWhite");var q=document.createElement("div");q.className="geCommentHeader";var F=document.createElement("img");F.className="geCommentUserImg";F.src=aa.user.pictureUrl||Editor.userImage;q.appendChild(F);F=document.createElement("div");F.className="geCommentHeaderTxt";q.appendChild(F);var S=document.createElement("div");S.className="geCommentUsername";mxUtils.write(S,
aa.user.displayName||"");F.appendChild(S);S=document.createElement("div");S.className="geCommentDate";S.setAttribute("data-commentId",aa.id);R(aa,S);F.appendChild(S);ka.appendChild(q);q=document.createElement("div");q.className="geCommentTxt";mxUtils.write(q,aa.content||"");ka.appendChild(q);aa.isLocked&&(ka.style.opacity="0.5");q=document.createElement("div");q.className="geCommentActions";var ba=document.createElement("ul");ba.className="geCommentActionsList";q.appendChild(ba);f||aa.isLocked||0!=
L&&!k||T(mxResources.get("reply"),function(){W("",!0)},aa.isResolved);F=b.getCurrentUser();null==F||F.id!=aa.user.id||f||aa.isLocked||(T(mxResources.get("edit"),function(){function U(){N(aa,ka,function(){G(ka);aa.editComment(aa.content,function(){Q(ka)},function(ca){M(ka);U();b.handleError(ca,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}U()},aa.isResolved),T(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){G(ka);aa.deleteComment(function(U){if(!0===
U){U=ka.querySelector(".geCommentTxt");U.innerText="";mxUtils.write(U,mxResources.get("msgDeleted"));var ca=ka.querySelectorAll(".geCommentAction");for(U=0;U<ca.length;U++)ca[U].parentNode.removeChild(ca[U]);Q(ka);ka.style.opacity="0.5"}else{ca=Y(aa).replies;for(U=0;U<ca.length;U++)I.removeChild(ca[U]);for(U=0;U<qa.length;U++)if(qa[U]==aa){qa.splice(U,1);break}O.style.display=0==I.getElementsByTagName("div").length?"block":"none"}},function(U){M(ka);b.handleError(U,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},
aa.isResolved));f||aa.isLocked||0!=L||T(aa.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(U){function ca(){var ea=U.target;ea.innerText="";aa.isResolved=!aa.isResolved;mxUtils.write(ea,aa.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var na=aa.isResolved?"none":"",ra=Y(aa).replies,ya=Editor.isDarkMode()?"transparent":aa.isResolved?"ghostWhite":"white",va=0;va<ra.length;va++){ra[va].style.backgroundColor=ya;for(var Da=ra[va].querySelectorAll(".geCommentAction"),
pa=0;pa<Da.length;pa++)Da[pa]!=ea.parentNode&&(Da[pa].style.display=na);ia||(ra[va].style.display="none")}E()}aa.isResolved?W(mxResources.get("reOpened")+": ",!0,ca,!1,!0):W(mxResources.get("markedAsResolved"),!1,ca,!0)});ka.appendChild(q);null!=sa?I.insertBefore(ka,sa.nextSibling):I.appendChild(ka);for(sa=0;null!=aa.replies&&sa<aa.replies.length;sa++)q=aa.replies[sa],q.isResolved=aa.isResolved,e(q,aa.replies,null,L+1,V);null!=z&&(z.comment.id==aa.id?(V=aa.content,aa.content=z.comment.content,N(aa,
ka,z.saveCallback,z.deleteOnCancel),aa.content=V):null==z.comment.id&&z.comment.pCommentId==aa.id&&(I.appendChild(z.div),N(z.comment,z.div,z.saveCallback,z.deleteOnCancel)));return ka}}var f=!b.canComment(),k=b.canReplyToReplies(),z=null,t=document.createElement("div");t.className="geCommentsWin";t.style.background=Editor.isDarkMode()?Dialog.backdropColor:"whiteSmoke";var B=EditorUi.compactUi?"26px":"30px",I=document.createElement("div");I.className="geCommentsList";I.style.backgroundColor=Editor.isDarkMode()?
Dialog.backdropColor:"whiteSmoke";I.style.bottom=parseInt(B)+7+"px";t.appendChild(I);var O=document.createElement("span");O.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(O,mxResources.get("noCommentsFound"));var J=document.createElement("div");J.className="geToolbarContainer geCommentsToolbar";J.style.height=B;J.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";J.style.backgroundColor=Editor.isDarkMode()?Dialog.backdropColor:"whiteSmoke";B=document.createElement("a");
B.className="geButton";if(!f){var y=B.cloneNode();y.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';y.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(y,"click",function(aa){function qa(){N(sa,L,function(V){G(L);b.addComment(V,function(T){V.id=T;da.push(V);Q(L)},function(T){M(L);qa();b.handleError(T,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var sa=b.newComment("",b.getCurrentUser()),L=e(sa,da,null,0);
qa();aa.preventDefault();mxEvent.consume(aa)});J.appendChild(y)}y=B.cloneNode();y.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';y.setAttribute("title",mxResources.get("showResolved"));y.className="geAdaptiveAsset";var ia=!1;mxEvent.addListener(y,"click",function(aa){this.className=(ia=!ia)?"geButton geCheckedBtn":"geButton";ja();aa.preventDefault();mxEvent.consume(aa)});J.appendChild(y);b.commentsRefreshNeeded()&&(y=B.cloneNode(),y.innerHTML='<img src="'+IMAGE_PATH+
'/update16.png" style="width: 16px; padding: 2px;">',y.setAttribute("title",mxResources.get("refresh")),y.className="geAdaptiveAsset",mxEvent.addListener(y,"click",function(aa){ja();aa.preventDefault();mxEvent.consume(aa)}),J.appendChild(y));b.commentsSaveNeeded()&&(B=B.cloneNode(),B.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',B.setAttribute("title",mxResources.get("save")),B.className="geAdaptiveAsset",mxEvent.addListener(B,"click",function(aa){p();aa.preventDefault();
mxEvent.consume(aa)}),J.appendChild(B));t.appendChild(J);var da=[],ja=mxUtils.bind(this,function(){this.hasError=!1;if(null!=z)try{z.div=z.div.cloneNode(!0);var aa=z.div.querySelector(".geCommentEditTxtArea"),qa=z.div.querySelector(".geCommentEditBtns");z.comment.content=aa.value;aa.parentNode.removeChild(aa);qa.parentNode.removeChild(qa)}catch(sa){b.handleError(sa)}I.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+
"...</div>";k=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(sa){function L(V){if(null!=V){V.sort(function(Y,W){return new Date(Y.modifiedDate)-new Date(W.modifiedDate)});for(var T=0;T<V.length;T++)L(V[T].replies)}}sa.sort(function(V,T){return new Date(V.modifiedDate)-new Date(T.modifiedDate)});I.innerText="";I.appendChild(O);O.style.display="block";da=sa;for(sa=0;sa<da.length;sa++)L(da[sa].replies),e(da[sa],da,null,0,ia);null!=z&&null==z.comment.id&&null==z.comment.pCommentId&&
(I.appendChild(z.div),N(z.comment,z.div,z.saveCallback,z.deleteOnCancel))},mxUtils.bind(this,function(sa){I.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(sa&&sa.message?": "+sa.message:""));this.hasError=!0})):I.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});ja();this.refreshComments=ja;J=mxUtils.bind(this,function(){function aa(T){var Y=sa[T.id];if(null!=Y)for(R(T,Y),Y=0;null!=T.replies&&Y<T.replies.length;Y++)aa(T.replies[Y])}if(this.window.isVisible()){for(var qa=I.querySelectorAll(".geCommentDate"),
sa={},L=0;L<qa.length;L++){var V=qa[L];sa[V.getAttribute("data-commentId")]=V}for(L=0;L<da.length;L++)aa(da[L])}});setInterval(J,6E4);this.refreshCommentsTime=J;this.window=new mxWindow(mxResources.get("comments"),t,d,g,l,D,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));
b.installResizeHandler(this,!0)},ConfirmDialog=function(b,d,g,l,D,p,E,N,R,G,M){var Q=document.createElement("div");Q.style.textAlign="center";M=null!=M?M:44;var e=document.createElement("div");e.style.padding="6px";e.style.overflow="auto";e.style.maxHeight=M+"px";e.style.lineHeight="1.2em";mxUtils.write(e,d);Q.appendChild(e);null!=G&&(e=document.createElement("div"),e.style.padding="6px 0 6px 0",d=document.createElement("img"),d.setAttribute("src",G),e.appendChild(d),Q.appendChild(e));G=document.createElement("div");
G.style.textAlign="center";G.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type","checkbox");p=mxUtils.button(p||mxResources.get("cancel"),function(){b.hideDialog();null!=l&&l(f.checked)});p.className="geBtn";null!=N&&(p.innerHTML=N+"<br>"+p.innerHTML,p.style.paddingBottom="8px",p.style.paddingTop="8px",p.style.height="auto",p.style.width="40%");b.editor.cancelFirst&&G.appendChild(p);var k=mxUtils.button(D||mxResources.get("ok"),function(){b.hideDialog();null!=g&&
g(f.checked)});G.appendChild(k);null!=E?(k.innerHTML=E+"<br>"+k.innerHTML+"<br>",k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height="auto",k.className="geBtn",k.style.width="40%"):k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||G.appendChild(p);Q.appendChild(G);R?(G.style.marginTop="10px",e=document.createElement("p"),e.style.marginTop="20px",e.style.marginBottom="0px",e.appendChild(f),D=document.createElement("span"),mxUtils.write(D," "+mxResources.get("rememberThisSetting")),
e.appendChild(D),Q.appendChild(e),mxEvent.addListener(D,"click",function(z){f.checked=!f.checked;mxEvent.consume(z)})):G.style.marginTop="12px";this.init=function(){k.focus()};this.container=Q};function DiagramPage(b,d){this.node=b;null!=d?this.node.setAttribute("id",d):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};
DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};function RenamePage(b,d,g){this.ui=b;this.page=d;this.previous=this.name=g}RenamePage.prototype.execute=function(){var b=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
function MovePage(b,d,g){this.ui=b;this.oldIndex=d;this.newIndex=g}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var b=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};
function SelectPage(b,d,g){this.ui=b;this.previousPage=this.page=d;this.neverShown=!0;null!=d&&(this.neverShown=null==d.viewState,this.ui.updatePageRoot(d),null!=g&&(d.viewState=g,this.neverShown=!1))}
SelectPage.prototype.execute=function(){var b=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=b){b=this.ui.currentPage;var d=this.ui.editor,g=d.graph,l=Graph.compressNode(d.getGraphXml(!0));mxUtils.setTextContent(b.node,l);b.viewState=g.getViewState();b.root=g.model.root;null!=b.model&&b.model.rootChanged(b.root);g.view.clear(b.root,!0);g.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=b;b=this.ui.currentPage;g.model.prefix=Editor.guid()+"-";g.model.rootChanged(b.root);
g.setViewState(b.viewState);g.gridEnabled=g.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);d.updateGraphComponents();g.view.validate();g.blockMathRender=!0;g.sizeDidChange();g.blockMathRender=!1;this.neverShown&&(this.neverShown=!1,g.selectUnlockedLayer());d.graph.fireEvent(new mxEventObject(mxEvent.ROOT));d.fireEvent(new mxEventObject("pageSelected","change",this))}};
function ChangePage(b,d,g,l,D){SelectPage.call(this,b,g);this.relatedPage=d;this.index=l;this.previousIndex=null;this.noSelect=D}mxUtils.extend(ChangePage,SelectPage);
ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObject("beforePageChange","change",this));this.previousIndex=this.index;if(null==this.index){var b=mxUtils.indexOf(this.ui.pages,this.relatedPage);this.ui.pages.splice(b,1);this.index=b}else this.ui.pages.splice(this.index,0,this.relatedPage),this.index=null;this.noSelect||SelectPage.prototype.execute.apply(this,arguments)};EditorUi.prototype.tabContainerHeight=38;EditorUi.prototype.getSelectedPageIndex=function(){return this.getPageIndex(this.currentPage)};
EditorUi.prototype.getPageIndex=function(b){var d=null;if(null!=this.pages&&null!=b)for(var g=0;g<this.pages.length;g++)if(this.pages[g]==b){d=g;break}return d};EditorUi.prototype.getPageById=function(b,d){d=null!=d?d:this.pages;if(null!=d)for(var g=0;g<d.length;g++)if(d[g].getId()==b)return d[g];return null};
EditorUi.prototype.createImageForPageLink=function(b,d,g){var l=b.indexOf(","),D=null;0<l&&(l=this.getPageById(b.substring(l+1)),null!=l&&l!=d&&(D=this.getImageForPage(l,d,g),D.originalSrc=b));null==D&&(D={originalSrc:b});return D};
EditorUi.prototype.getImageForPage=function(b,d,g){g=null!=g?g:this.editor.graph;var l=g.getGlobalVariable,D=this.createTemporaryGraph(g.getStylesheet());D.defaultPageBackgroundColor=g.defaultPageBackgroundColor;D.shapeBackgroundColor=g.shapeBackgroundColor;D.shapeForegroundColor=g.shapeForegroundColor;var p=this.getPageIndex(null!=d?d:this.currentPage);D.getGlobalVariable=function(N){return"pagenumber"==N?p+1:"page"==N&&null!=d?d.getName():l.apply(this,arguments)};document.body.appendChild(D.container);
this.updatePageRoot(b);D.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText="";g=D.getSvg(null,null,null,null,null,null,null,null,null,null,null,!0);var E=D.getGraphBounds();document.body.removeChild(D.container);Graph.foreignObjectWarningText=b;return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(g)),E.width,E.height,E.x,E.y)};
EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.isPagesEnabled()&&(this.keyHandler.bindAction(33,!0,"previousPage",!0),this.keyHandler.bindAction(34,!0,"nextPage",!0));var b=this.editor.graph,d=b.view.validateBackground;b.view.validateBackground=mxUtils.bind(this,function(){if(null!=this.tabContainer){var D=
this.tabContainer.style.height;this.tabContainer.style.height=null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":this.tabContainerHeight+"px";D!=this.tabContainer.style.height&&this.refresh(!1)}d.apply(b.view,arguments)});var g=null,l=mxUtils.bind(this,function(){this.updateTabContainer();var D=this.currentPage;null!=D&&D!=g&&(null==D.viewState||null==D.viewState.scrollLeft?(this.resetScrollbars(),b.isLightboxView()&&this.lightboxFit(),null!=this.chromelessResize&&
(b.container.scrollLeft=0,b.container.scrollTop=0,this.chromelessResize())):(b.container.scrollLeft=b.view.translate.x*b.view.scale+D.viewState.scrollLeft,b.container.scrollTop=b.view.translate.y*b.view.scale+D.viewState.scrollTop),g=D);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"===typeof Editor.MathJaxClear||this.editor.graph.mathEnabled&&null!=this.editor||Editor.MathJaxClear()});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(D,
p){D=p.getProperty("edit").changes;for(p=0;p<D.length;p++)if(D[p]instanceof SelectPage||D[p]instanceof RenamePage||D[p]instanceof MovePage||D[p]instanceof mxRootChange){l();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)}};
EditorUi.prototype.restoreViewState=function(b,d,g){b=null!=b?this.getPageById(b.getId()):null;var l=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,d):(l.setViewState(d),this.editor.updateGraphComponents(),l.view.revalidate(),l.sizeDidChange()),l.container.scrollLeft=l.view.translate.x*l.view.scale+d.scrollLeft,l.container.scrollTop=l.view.translate.y*l.view.scale+d.scrollTop,l.restoreSelection(g))};
Graph.prototype.createViewState=function(b){var d=b.getAttribute("page"),g=parseFloat(b.getAttribute("pageScale")),l=parseFloat(b.getAttribute("pageWidth")),D=parseFloat(b.getAttribute("pageHeight")),p=b.getAttribute("background"),E=this.parseBackgroundImage(b.getAttribute("backgroundImage")),N=b.getAttribute("extFonts");if(N)try{N=N.split("|").map(function(R){R=R.split("^");return{name:R[0],url:R[1]}})}catch(R){console.log("ExtFonts format error: "+R.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),
gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=d?"0"!=d:this.defaultPageVisible,background:null!=p&&0<p.length?p:null,backgroundImage:E,pageScale:isNaN(g)?mxGraph.prototype.pageScale:g,pageFormat:isNaN(l)||isNaN(D)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:
mxSettings.getPageFormat():new mxRectangle(0,0,l,D),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:N||[]}};
Graph.prototype.saveViewState=function(b,d,g,l){g||(d.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),d.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),d.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),d.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),d.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),d.setAttribute("connect",null==b||b.connect?"1":"0"),d.setAttribute("arrows",null==b||b.arrows?"1":"0"),d.setAttribute("fold",
null==b||b.foldingEnabled?"1":"0"));d.setAttribute("pageScale",null!=b&&null!=b.pageScale?b.pageScale:mxGraph.prototype.pageScale);g=null!=b?b.pageFormat:"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=g&&(d.setAttribute("pageWidth",g.width),d.setAttribute("pageHeight",g.height));null!=b&&(null!=b.background&&d.setAttribute("background",b.background),l=this.getBackgroundImageObject(b.backgroundImage,l),null!=l&&d.setAttribute("backgroundImage",
JSON.stringify(l)));d.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");d.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null!=b&&null!=b.extFonts&&0<b.extFonts.length&&d.setAttribute("extFonts",b.extFonts.map(function(D){return D.name+"^"+D.url}).join("|"))};
Graph.prototype.getViewState=function(){return{defaultParent:this.defaultParent,currentRoot:this.view.currentRoot,gridEnabled:this.gridEnabled,gridSize:this.gridSize,guidesEnabled:this.graphHandler.guidesEnabled,foldingEnabled:this.foldingEnabled,shadowVisible:this.shadowVisible,scrollbars:this.scrollbars,pageVisible:this.pageVisible,background:this.background,backgroundImage:this.backgroundImage,pageScale:this.pageScale,pageFormat:this.pageFormat,tooltips:this.tooltipHandler.isEnabled(),connect:this.connectionHandler.isEnabled(),
arrows:this.connectionArrowsEnabled,scale:this.view.scale,scrollLeft:this.container.scrollLeft-this.view.translate.x*this.view.scale,scrollTop:this.container.scrollTop-this.view.translate.y*this.view.scale,translate:this.view.translate.clone(),lastPasteXml:this.lastPasteXml,pasteCounter:this.pasteCounter,mathEnabled:this.mathEnabled,hiddenTags:this.hiddenTags,extFonts:this.extFonts}};
Graph.prototype.setViewState=function(b,d){if(null!=b){this.lastPasteXml=b.lastPasteXml;this.pasteCounter=b.pasteCounter||0;this.mathEnabled=b.mathEnabled;this.gridEnabled=b.gridEnabled;this.gridSize=b.gridSize;this.graphHandler.guidesEnabled=b.guidesEnabled;this.foldingEnabled=b.foldingEnabled;this.setShadowVisible(b.shadowVisible,!1);this.scrollbars=b.scrollbars;this.pageVisible=!this.isViewer()&&b.pageVisible;this.background=b.background;this.pageScale=b.pageScale;this.pageFormat=b.pageFormat;
this.view.currentRoot=b.currentRoot;this.defaultParent=b.defaultParent;this.connectionArrowsEnabled=b.arrows;this.setTooltips(b.tooltips);this.setConnectable(b.connect);this.setBackgroundImage(b.backgroundImage);this.hiddenTags=b.hiddenTags;var g=this.extFonts;this.extFonts=b.extFonts||[];if(d&&null!=g)for(d=0;d<g.length;d++){var l=document.getElementById("extFont_"+g[d].name);null!=l&&l.parentNode.removeChild(l)}for(d=0;d<this.extFonts.length;d++)this.addExtFont(this.extFonts[d].name,this.extFonts[d].url,
!0);this.view.scale=null!=b.scale?b.scale:1;null==this.view.currentRoot||this.model.contains(this.view.currentRoot)||(this.view.currentRoot=null);null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer());null!=b.translate&&(this.view.translate=b.translate)}else this.view.currentRoot=null,this.view.scale=1,this.gridEnabled=this.defaultGridEnabled,this.gridSize=mxGraph.prototype.gridSize,this.pageScale=mxGraph.prototype.pageScale,this.pageFormat=
"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat(),this.pageVisible=this.defaultPageVisible,this.backgroundImage=this.background=null,this.scrollbars=this.defaultScrollbars,this.foldingEnabled=this.graphHandler.guidesEnabled=!0,this.setShadowVisible(!1,!1),this.defaultParent=null,this.setTooltips(!0),this.setConnectable(!0),this.lastPasteXml=null,this.pasteCounter=0,this.mathEnabled=this.defaultMathEnabled,this.connectionArrowsEnabled=
!0,this.hiddenTags=[],this.extFonts=[];this.preferPageSize=this.pageBreaksVisible=this.pageVisible;this.fireEvent(new mxEventObject("viewStateChanged","state",b))};
Graph.prototype.addExtFont=function(b,d,g){if(b&&d){"1"!=urlParams["ext-fonts"]&&(Graph.recentCustomFonts[b.toLowerCase()]={name:b,url:d});var l="extFont_"+b;if(null==document.getElementById(l))if(0==d.indexOf(Editor.GOOGLE_FONTS))mxClient.link("stylesheet",d,null,l);else{document.getElementsByTagName("head");var D=document.createElement("style");D.appendChild(document.createTextNode('@font-face {\n\tfont-family: "'+b+'";\n\tsrc: url("'+d+'");\n}'));D.setAttribute("id",l);document.getElementsByTagName("head")[0].appendChild(D)}if(!g){null==
this.extFonts&&(this.extFonts=[]);g=this.extFonts;l=!0;for(D=0;D<g.length;D++)if(g[D].name==b){l=!1;break}l&&this.extFonts.push({name:b,url:d})}}};
EditorUi.prototype.updatePageRoot=function(b,d){if(null==b.root){d=this.editor.extractGraphModel(b.node,null,d);var g=Editor.extractParserError(d);if(g)throw Error(g);null!=d?(b.graphModelNode=d,b.viewState=this.editor.graph.createViewState(d),g=new mxCodec(d.ownerDocument),b.root=g.decode(d).root):b.root=this.editor.graph.model.createRoot()}else if(null==b.viewState){if(null==b.graphModelNode){d=this.editor.extractGraphModel(b.node);if(g=Editor.extractParserError(d))throw Error(g);null!=d&&(b.graphModelNode=
d)}null!=b.graphModelNode&&(b.viewState=this.editor.graph.createViewState(b.graphModelNode))}return b};
EditorUi.prototype.selectPage=function(b,d,g){try{if(b!=this.currentPage){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);d=null!=d?d:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var l=this.editor.graph.model.createUndoableEdit();l.ignoreEdit=!0;var D=new SelectPage(this,b,g);D.execute();l.add(D);l.notify();this.editor.graph.tooltipHandler.hide();d||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",l))}}catch(p){this.handleError(p)}};
EditorUi.prototype.selectNextPage=function(b){var d=this.currentPage;null!=d&&null!=this.pages&&(d=mxUtils.indexOf(this.pages,d),b?this.selectPage(this.pages[mxUtils.mod(d+1,this.pages.length)]):b||this.selectPage(this.pages[mxUtils.mod(d-1,this.pages.length)]))};
EditorUi.prototype.insertPage=function(b,d){this.editor.graph.isEnabled()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1),b=null!=b?b:this.createPage(null,this.createPageId()),d=null!=d?d:this.pages.length,d=new ChangePage(this,b,b,d),this.editor.graph.model.execute(d));return b};EditorUi.prototype.createPageId=function(){do var b=Editor.guid();while(null!=this.getPageById(b));return b};
EditorUi.prototype.createPage=function(b,d){d=new DiagramPage(this.fileNode.ownerDocument.createElement("diagram"),d);d.setName(null!=b?b:this.createPageName());this.initDiagramNode(d);return d};EditorUi.prototype.createPageName=function(){for(var b={},d=0;d<this.pages.length;d++){var g=this.pages[d].getName();null!=g&&0<g.length&&(b[g]=g)}d=this.pages.length;do g=mxResources.get("pageWithNumber",[++d]);while(null!=b[g]);return g};
EditorUi.prototype.removePage=function(b){try{var d=this.editor.graph,g=mxUtils.indexOf(this.pages,b);if(d.isEnabled()&&0<=g){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);d.model.beginUpdate();try{var l=this.currentPage;l==b&&1<this.pages.length?(g==this.pages.length-1?g--:g++,l=this.pages[g]):1>=this.pages.length&&(l=this.insertPage(),d.model.execute(new RenamePage(this,l,mxResources.get("pageWithNumber",[1]))));d.model.execute(new ChangePage(this,b,l))}finally{d.model.endUpdate()}}}catch(D){this.handleError(D)}return b};
EditorUi.prototype.duplicatePage=function(b,d){var g=null;try{var l=this.editor.graph;if(l.isEnabled()){l.isEditing()&&l.stopEditing();var D=b.node.cloneNode(!1);D.removeAttribute("id");var p={},E=l.createCellLookup([l.model.root]);g=new DiagramPage(D);g.root=l.cloneCell(l.model.root,null,p);var N=new mxGraphModel;N.prefix=Editor.guid()+"-";N.setRoot(g.root);l.updateCustomLinks(l.createCellMapping(p,E),[g.root]);g.viewState=b==this.currentPage?l.getViewState():b.viewState;this.initDiagramNode(g);
g.viewState.scale=1;g.viewState.scrollLeft=null;g.viewState.scrollTop=null;g.viewState.currentRoot=null;g.viewState.defaultParent=null;g.setName(d);g=this.insertPage(g,mxUtils.indexOf(this.pages,b)+1)}}catch(R){this.handleError(R)}return g};EditorUi.prototype.initDiagramNode=function(b){var d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root));this.editor.graph.saveViewState(b.viewState,d);mxUtils.setTextContent(b.node,Graph.compressNode(d))};
EditorUi.prototype.clonePages=function(b){for(var d=[],g=0;g<b.length;g++)d.push(this.clonePage(b[g]));return d};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var d=new DiagramPage(b.node.cloneNode(!0)),g=b==this.currentPage?this.editor.graph.getViewState():b.viewState;d.viewState=mxUtils.clone(g,EditorUi.transientViewStateProperties);d.root=this.editor.graph.model.cloneCell(b.root,null,!0);return d};
EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var d=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(g){null!=g&&0<g.length&&this.editor.graph.model.execute(new RenamePage(this,b,g))}),mxResources.get("rename"));this.showDialog(d.container,300,80,!0,!0);d.init()}return b};EditorUi.prototype.movePage=function(b,d){this.editor.graph.model.execute(new MovePage(this,b,d))};
EditorUi.prototype.createTabContainer=function(){var b=document.createElement("div");b.className="geTabContainer";b.style.position="absolute";b.style.whiteSpace="nowrap";b.style.overflow="hidden";b.style.height="0px";return b};
EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var b=this.editor.graph,d=document.createElement("div");d.style.position="relative";d.style.display="inline-block";d.style.verticalAlign="top";d.style.height=this.tabContainer.style.height;d.style.whiteSpace="nowrap";d.style.overflow="hidden";d.style.fontSize="13px";d.style.marginLeft="30px";for(var g=this.editor.isChromelessView()?29:59,l=Math.min(140,Math.max(20,(this.tabContainer.clientWidth-g)/this.pages.length)+
1),D=null,p=0;p<this.pages.length;p++)mxUtils.bind(this,function(G,M){this.pages[G]==this.currentPage?(M.className="geActivePage",M.style.backgroundColor=Editor.isDarkMode()?Editor.darkColor:"#fff"):M.className="geInactivePage";M.setAttribute("draggable","true");mxEvent.addListener(M,"dragstart",mxUtils.bind(this,function(Q){b.isEnabled()?(mxClient.IS_FF&&Q.dataTransfer.setData("Text","<diagram/>"),D=G):mxEvent.consume(Q)}));mxEvent.addListener(M,"dragend",mxUtils.bind(this,function(Q){D=null;Q.stopPropagation();
Q.preventDefault()}));mxEvent.addListener(M,"dragover",mxUtils.bind(this,function(Q){null!=D&&(Q.dataTransfer.dropEffect="move");Q.stopPropagation();Q.preventDefault()}));mxEvent.addListener(M,"drop",mxUtils.bind(this,function(Q){null!=D&&G!=D&&this.movePage(D,G);Q.stopPropagation();Q.preventDefault()}));d.appendChild(M)})(p,this.createTabForPage(this.pages[p],l,this.pages[p]!=this.currentPage,p+1));this.tabContainer.innerText="";this.tabContainer.appendChild(d);l=this.createPageMenuTab();this.tabContainer.appendChild(l);
l=null;this.isPageInsertTabVisible()&&(l=this.createPageInsertTab(),this.tabContainer.appendChild(l));if(d.clientWidth>this.tabContainer.clientWidth-g){null!=l&&(l.style.position="absolute",l.style.right="0px",d.style.marginRight="30px");var E=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");E.style.position="absolute";E.style.right=this.editor.chromeless?"29px":"55px";E.style.fontSize="13pt";this.tabContainer.appendChild(E);var N=this.createControlTab(4,"&nbsp;&#10095;");N.style.position="absolute";
N.style.right=this.editor.chromeless?"0px":"29px";N.style.fontSize="13pt";this.tabContainer.appendChild(N);var R=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));d.style.width=R+"px";mxEvent.addListener(E,"click",mxUtils.bind(this,function(G){d.scrollLeft-=Math.max(20,R-20);mxUtils.setOpacity(E,0<d.scrollLeft?100:50);mxUtils.setOpacity(N,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.consume(G)}));mxUtils.setOpacity(E,0<d.scrollLeft?100:50);mxUtils.setOpacity(N,
d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.addListener(N,"click",mxUtils.bind(this,function(G){d.scrollLeft+=Math.max(20,R-20);mxUtils.setOpacity(E,0<d.scrollLeft?100:50);mxUtils.setOpacity(N,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.consume(G)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
EditorUi.prototype.createTab=function(b){var d=document.createElement("div");d.style.display="inline-block";d.style.whiteSpace="nowrap";d.style.boxSizing="border-box";d.style.position="relative";d.style.overflow="hidden";d.style.textAlign="center";d.style.marginLeft="-1px";d.style.height=this.tabContainer.clientHeight+"px";d.style.padding="12px 4px 8px 4px";d.style.border=Editor.isDarkMode()?"1px solid #505759":"1px solid #e8eaed";d.style.borderTopStyle="none";d.style.borderBottomStyle="none";d.style.backgroundColor=
this.tabContainer.style.backgroundColor;d.style.cursor="move";d.style.color="gray";b&&(mxEvent.addListener(d,"mouseenter",mxUtils.bind(this,function(g){this.editor.graph.isMouseDown||(d.style.backgroundColor=Editor.isDarkMode()?"black":"#e8eaed",mxEvent.consume(g))})),mxEvent.addListener(d,"mouseleave",mxUtils.bind(this,function(g){d.style.backgroundColor=this.tabContainer.style.backgroundColor;mxEvent.consume(g)})));return d};
EditorUi.prototype.createControlTab=function(b,d,g){g=this.createTab(null!=g?g:!0);g.style.lineHeight=this.tabContainerHeight+"px";g.style.paddingTop=b+"px";g.style.cursor="pointer";g.style.width="30px";g.innerHTML=d;null!=g.firstChild&&null!=g.firstChild.style&&mxUtils.setOpacity(g.firstChild,40);return g};EditorUi.prototype.getShortPageName=function(b){b=b.getName();36<b.length&&(b=b.substring(0,34)+"...");return b};
EditorUi.prototype.createPageMenuTab=function(b,d){b=this.createControlTab(3,'<div class="geSprite geSprite-dots"></div>',b);b.setAttribute("title",mxResources.get("pages"));b.style.position="absolute";b.style.marginLeft="0px";b.style.top="0px";b.style.left="1px";var g=b.getElementsByTagName("div")[0];g.style.display="inline-block";g.style.marginTop="5px";g.style.width="21px";g.style.height="21px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(l){this.editor.graph.popupMenuHandler.hideMenu();
var D=new mxPopupMenu(mxUtils.bind(this,function(N,R){var G=mxUtils.bind(this,function(){for(var f=0;f<this.pages.length;f++)mxUtils.bind(this,function(k){var z=N.addItem(this.getShortPageName(this.pages[k]),null,mxUtils.bind(this,function(){this.selectPage(this.pages[k])}),R),t=this.pages[k].getId();z.setAttribute("title",this.pages[k].getName()+" ("+(k+1)+"/"+this.pages.length+")"+(null!=t?" ["+t+"]":""));this.pages[k]==this.currentPage&&N.addCheckmark(z,Editor.checkmarkImage)})(f)}),M=mxUtils.bind(this,
function(){N.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){this.insertPage()}),R)});d||G();if(this.editor.graph.isEnabled()){d||(N.addSeparator(R),M());var Q=this.currentPage;if(null!=Q){N.addSeparator(R);var e=this.getShortPageName(Q);N.addItem(mxResources.get("removeIt",[e]),null,mxUtils.bind(this,function(){this.removePage(Q)}),R);N.addItem(mxResources.get("renameIt",[e]),null,mxUtils.bind(this,function(){this.renamePage(Q,Q.getName())}),R);d||N.addSeparator(R);N.addItem(mxResources.get("duplicateIt",
[e]),null,mxUtils.bind(this,function(){this.duplicatePage(Q,mxResources.get("copyOf",[Q.getName()]))}),R)}}d&&(N.addSeparator(R),M(),N.addSeparator(R),G())}));D.div.className+=" geMenubarMenu";D.smartSeparators=!0;D.showDisabled=!0;D.autoExpand=!0;D.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(D,arguments);D.destroy()});var p=mxEvent.getClientX(l),E=mxEvent.getClientY(l);D.popup(p,E,null,l);this.setCurrentMenu(D);mxEvent.consume(l)}));return b};
EditorUi.prototype.createPageInsertTab=function(){var b=this.createControlTab(4,'<div class="geSprite geSprite-plus"></div>');b.setAttribute("title",mxResources.get("insertPage"));mxEvent.addListener(b,"click",mxUtils.bind(this,function(g){this.insertPage();mxEvent.consume(g)}));var d=b.getElementsByTagName("div")[0];d.style.display="inline-block";d.style.width="21px";d.style.height="21px";return b};
EditorUi.prototype.createTabForPage=function(b,d,g,l){g=this.createTab(g);var D=b.getName()||mxResources.get("untitled"),p=b.getId();g.setAttribute("title",D+(null!=p?" ("+p+")":"")+" ["+l+"]");mxUtils.write(g,D);g.style.maxWidth=d+"px";g.style.width=d+"px";this.addTabListeners(b,g);42<d&&(g.style.textOverflow="ellipsis");return g};
EditorUi.prototype.addTabListeners=function(b,d){mxEvent.disableContextMenu(d);var g=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(p){this.renamePage(b);mxEvent.consume(p)}));var l=!1,D=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,function(p){l=null!=this.currentMenu;D=b==this.currentPage;g.isMouseDown||D||this.selectPage(b)}),null,mxUtils.bind(this,function(p){if(g.isEnabled()&&!g.isMouseDown&&(mxEvent.isTouchEvent(p)&&D||mxEvent.isPopupTrigger(p))){g.popupMenuHandler.hideMenu();
this.hideCurrentMenu();if(!mxEvent.isTouchEvent(p)||!l){var E=new mxPopupMenu(this.createPageMenu(b));E.div.className+=" geMenubarMenu";E.smartSeparators=!0;E.showDisabled=!0;E.autoExpand=!0;E.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(E,arguments);this.resetCurrentMenu();E.destroy()});var N=mxEvent.getClientX(p),R=mxEvent.getClientY(p);E.popup(N,R,null,p);this.setCurrentMenu(E,d)}mxEvent.consume(p)}}))};
EditorUi.prototype.getLinkForPage=function(b,d,g){if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp){var l=this.getCurrentFile();if(null!=l&&l.constructor!=LocalFile&&"draw.io"==this.getServiceName()){var D=this.getSearch("create title mode url drive splash state clibs ui viewbox hide-pages sketch".split(" "));D+=(0==D.length?"?":"&")+"page-id="+b.getId();null!=d&&(D+="&"+d.join("&"));return(g&&"1"!=urlParams.dev?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?
EditorUi.drawHost:"https://"+window.location.host)+"/"+D+"#"+l.getHash()}}return null};
EditorUi.prototype.createPageMenu=function(b,d){return mxUtils.bind(this,function(g,l){var D=this.editor.graph;g.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,b)+1)}),l);g.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),l);g.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(b,d)}),l);null!=this.getLinkForPage(b)&&(g.addSeparator(l),g.addItem(mxResources.get("link"),
null,mxUtils.bind(this,function(){this.showPublishLinkDialog(mxResources.get("url"),!0,null,null,mxUtils.bind(this,function(p,E,N,R,G,M){p=this.createUrlParameters(p,E,N,R,G,M);N||p.push("hide-pages=1");D.isSelectionEmpty()||(N=D.getBoundingBox(D.getSelectionCells()),E=D.view.translate,G=D.view.scale,N.width/=G,N.height/=G,N.x=N.x/G-E.x,N.y=N.y/G-E.y,p.push("viewbox="+encodeURIComponent(JSON.stringify({x:Math.round(N.x),y:Math.round(N.y),width:Math.round(N.width),height:Math.round(N.height),border:100}))));
R=new EmbedDialog(this,this.getLinkForPage(b,p,R));this.showDialog(R.container,450,240,!0,!0);R.init()}))})));g.addSeparator(l);g.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",[b.getName()]))}),l);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||(g.addSeparator(l),g.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,
!0,!0))}),l))})};(function(){var b=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(){b.apply(this,arguments);this.updateTabContainer()}})();(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var b=new mxObjectCodec(new MovePage,["ui"]);b.beforeDecode=function(d,g,l){l.ui=d.ui;return g};b.afterDecode=function(d,g,l){d=l.oldIndex;l.oldIndex=l.newIndex;l.newIndex=d;return l};mxCodecRegistry.register(b)})();
(function(){var b=new mxObjectCodec(new RenamePage,["ui","page"]);b.beforeDecode=function(d,g,l){l.ui=d.ui;return g};b.afterDecode=function(d,g,l){d=l.previous;l.previous=l.name;l.name=d;return l};mxCodecRegistry.register(b)})();
(function(){var b=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" "));b.afterEncode=function(d,g,l){l.setAttribute("relatedPage",g.relatedPage.getId());null==g.index&&(l.setAttribute("name",g.relatedPage.getName()),null!=g.relatedPage.viewState&&l.setAttribute("viewState",JSON.stringify(g.relatedPage.viewState,function(D,p){return 0>mxUtils.indexOf(EditorUi.transientViewStateProperties,D)?p:void 0})),null!=g.relatedPage.root&&d.encodeCell(g.relatedPage.root,
l));return l};b.beforeDecode=function(d,g,l){l.ui=d.ui;l.relatedPage=l.ui.getPageById(g.getAttribute("relatedPage"));if(null==l.relatedPage){var D=g.ownerDocument.createElement("diagram");D.setAttribute("id",g.getAttribute("relatedPage"));D.setAttribute("name",g.getAttribute("name"));l.relatedPage=new DiagramPage(D);D=g.getAttribute("viewState");null!=D&&(l.relatedPage.viewState=JSON.parse(D),g.removeAttribute("viewState"));g=g.cloneNode(!0);D=g.firstChild;if(null!=D)for(l.relatedPage.root=d.decodeCell(D,
!1),l=D.nextSibling,D.parentNode.removeChild(D),D=l;null!=D;){l=D.nextSibling;if(D.nodeType==mxConstants.NODETYPE_ELEMENT){var p=D.getAttribute("id");null==d.lookup(p)&&d.decodeCell(D)}D.parentNode.removeChild(D);D=l}}return g};b.afterDecode=function(d,g,l){l.index=l.previousIndex;return l};mxCodecRegistry.register(b)})();(function(){EditorUi.prototype.altShiftActions[68]="selectDescendants";var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(l,D,p,E,N){D=null!=D?D:!1;null==p&&(p=this.getFoldableCells(this.getSelectionCells(),l));this.stopEditing();this.model.beginUpdate();try{for(var R=p.slice(),G=0;G<p.length;G++)"1"==mxUtils.getValue(this.getCurrentCellStyle(p[G]),"treeFolding","0")&&this.foldTreeCell(l,p[G]);p=R;p=b.apply(this,arguments)}finally{this.model.endUpdate()}return p};Graph.prototype.foldTreeCell=
function(l,D){this.model.beginUpdate();try{var p=[];this.traverse(D,!0,mxUtils.bind(this,function(N,R){var G=null!=R&&this.isTreeEdge(R);G&&p.push(R);N==D||null!=R&&!G||p.push(N);return(null==R||G)&&(N==D||!this.model.isCollapsed(N))}));this.model.setCollapsed(D,l);for(var E=0;E<p.length;E++)this.model.setVisible(p[E],!l)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(l){return!this.isEdgeIgnored(l)};Graph.prototype.getTreeEdges=function(l,D,p,E,N,R){return this.model.filterCells(this.getEdges(l,
D,p,E,N,R),mxUtils.bind(this,function(G){return this.isTreeEdge(G)}))};Graph.prototype.getIncomingTreeEdges=function(l,D){return this.getTreeEdges(l,D,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(l,D){return this.getTreeEdges(l,D,!1,!0,!1)};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function l(L){return z.isVertex(L)&&p(L)}function D(L){var V=
!1;null!=L&&(V="1"==k.getCurrentCellStyle(L).treeMoving);return V}function p(L){var V=!1;null!=L&&(L=z.getParent(L),V=k.view.getState(L),V="tree"==(null!=V?V.style:k.getCellStyle(L)).containerType);return V}function E(L){var V=!1;null!=L&&(L=z.getParent(L),V=k.view.getState(L),k.view.getState(L),V=null!=(null!=V?V.style:k.getCellStyle(L)).childLayout);return V}function N(L){L=k.view.getState(L);if(null!=L){var V=k.getIncomingTreeEdges(L.cell);if(0<V.length&&(V=k.view.getState(V[0]),null!=V&&(V=V.absolutePoints,
null!=V&&0<V.length&&(V=V[V.length-1],null!=V)))){if(V.y==L.y&&Math.abs(V.x-L.getCenterX())<L.width/2)return mxConstants.DIRECTION_SOUTH;if(V.y==L.y+L.height&&Math.abs(V.x-L.getCenterX())<L.width/2)return mxConstants.DIRECTION_NORTH;if(V.x>L.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function R(L,V){V=null!=V?V:!0;k.model.beginUpdate();try{var T=k.model.getParent(L),Y=k.getIncomingTreeEdges(L),W=k.cloneCells([Y[0],L]);k.model.setTerminal(W[0],k.model.getTerminal(Y[0],
!0),!0);var ka=N(L),q=T.geometry;ka==mxConstants.DIRECTION_SOUTH||ka==mxConstants.DIRECTION_NORTH?W[1].geometry.x+=V?L.geometry.width+10:-W[1].geometry.width-10:W[1].geometry.y+=V?L.geometry.height+10:-W[1].geometry.height-10;k.view.currentRoot!=T&&(W[1].geometry.x-=q.x,W[1].geometry.y-=q.y);var F=k.view.getState(L),S=k.view.scale;if(null!=F){var ba=mxRectangle.fromRectangle(F);ka==mxConstants.DIRECTION_SOUTH||ka==mxConstants.DIRECTION_NORTH?ba.x+=(V?L.geometry.width+10:-W[1].geometry.width-10)*S:
ba.y+=(V?L.geometry.height+10:-W[1].geometry.height-10)*S;var U=k.getOutgoingTreeEdges(k.model.getTerminal(Y[0],!0));if(null!=U){for(var ca=ka==mxConstants.DIRECTION_SOUTH||ka==mxConstants.DIRECTION_NORTH,ea=q=Y=0;ea<U.length;ea++){var na=k.model.getTerminal(U[ea],!1);if(ka==N(na)){var ra=k.view.getState(na);na!=L&&null!=ra&&(ca&&V!=ra.getCenterX()<F.getCenterX()||!ca&&V!=ra.getCenterY()<F.getCenterY())&&mxUtils.intersects(ba,ra)&&(Y=10+Math.max(Y,(Math.min(ba.x+ba.width,ra.x+ra.width)-Math.max(ba.x,
ra.x))/S),q=10+Math.max(q,(Math.min(ba.y+ba.height,ra.y+ra.height)-Math.max(ba.y,ra.y))/S))}}ca?q=0:Y=0;for(ea=0;ea<U.length;ea++)if(na=k.model.getTerminal(U[ea],!1),ka==N(na)&&(ra=k.view.getState(na),na!=L&&null!=ra&&(ca&&V!=ra.getCenterX()<F.getCenterX()||!ca&&V!=ra.getCenterY()<F.getCenterY()))){var ya=[];k.traverse(ra.cell,!0,function(va,Da){var pa=null!=Da&&k.isTreeEdge(Da);pa&&ya.push(Da);(null==Da||pa)&&ya.push(va);return null==Da||pa});k.moveCells(ya,(V?1:-1)*Y,(V?1:-1)*q)}}}return k.addCells(W,
T)}finally{k.model.endUpdate()}}function G(L){k.model.beginUpdate();try{var V=N(L),T=k.getIncomingTreeEdges(L),Y=k.cloneCells([T[0],L]);k.model.setTerminal(T[0],Y[1],!1);k.model.setTerminal(Y[0],Y[1],!0);k.model.setTerminal(Y[0],L,!1);var W=k.model.getParent(L),ka=W.geometry,q=[];k.view.currentRoot!=W&&(Y[1].geometry.x-=ka.x,Y[1].geometry.y-=ka.y);k.traverse(L,!0,function(ba,U){var ca=null!=U&&k.isTreeEdge(U);ca&&q.push(U);(null==U||ca)&&q.push(ba);return null==U||ca});var F=L.geometry.width+40,S=
L.geometry.height+40;V==mxConstants.DIRECTION_SOUTH?F=0:V==mxConstants.DIRECTION_NORTH?(F=0,S=-S):V==mxConstants.DIRECTION_WEST?(F=-F,S=0):V==mxConstants.DIRECTION_EAST&&(S=0);k.moveCells(q,F,S);return k.addCells(Y,W)}finally{k.model.endUpdate()}}function M(L,V){k.model.beginUpdate();try{var T=k.model.getParent(L),Y=k.getIncomingTreeEdges(L),W=N(L);0==Y.length&&(Y=[k.createEdge(T,null,"",null,null,k.createCurrentEdgeStyle())],W=V);var ka=k.cloneCells([Y[0],L]);k.model.setTerminal(ka[0],L,!0);if(null==
k.model.getTerminal(ka[0],!1)){k.model.setTerminal(ka[0],ka[1],!1);var q=k.getCellStyle(ka[1]).newEdgeStyle;if(null!=q)try{var F=JSON.parse(q),S;for(S in F)k.setCellStyles(S,F[S],[ka[0]]),"edgeStyle"==S&&"elbowEdgeStyle"==F[S]&&k.setCellStyles("elbow",W==mxConstants.DIRECTION_SOUTH||W==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",[ka[0]])}catch(ra){}}Y=k.getOutgoingTreeEdges(L);var ba=T.geometry;V=[];k.view.currentRoot==T&&(ba=new mxRectangle);for(q=0;q<Y.length;q++){var U=k.model.getTerminal(Y[q],
!1);null!=U&&V.push(U)}var ca=k.view.getBounds(V),ea=k.view.translate,na=k.view.scale;W==mxConstants.DIRECTION_SOUTH?(ka[1].geometry.x=null==ca?L.geometry.x+(L.geometry.width-ka[1].geometry.width)/2:(ca.x+ca.width)/na-ea.x-ba.x+10,ka[1].geometry.y+=ka[1].geometry.height-ba.y+40):W==mxConstants.DIRECTION_NORTH?(ka[1].geometry.x=null==ca?L.geometry.x+(L.geometry.width-ka[1].geometry.width)/2:(ca.x+ca.width)/na-ea.x+-ba.x+10,ka[1].geometry.y-=ka[1].geometry.height+ba.y+40):(ka[1].geometry.x=W==mxConstants.DIRECTION_WEST?
ka[1].geometry.x-(ka[1].geometry.width+ba.x+40):ka[1].geometry.x+(ka[1].geometry.width-ba.x+40),ka[1].geometry.y=null==ca?L.geometry.y+(L.geometry.height-ka[1].geometry.height)/2:(ca.y+ca.height)/na-ea.y+-ba.y+10);return k.addCells(ka,T)}finally{k.model.endUpdate()}}function Q(L,V,T){L=k.getOutgoingTreeEdges(L);T=k.view.getState(T);var Y=[];if(null!=T&&null!=L){for(var W=0;W<L.length;W++){var ka=k.view.getState(k.model.getTerminal(L[W],!1));null!=ka&&(!V&&Math.min(ka.x+ka.width,T.x+T.width)>=Math.max(ka.x,
T.x)||V&&Math.min(ka.y+ka.height,T.y+T.height)>=Math.max(ka.y,T.y))&&Y.push(ka)}Y.sort(function(q,F){return V?q.x+q.width-F.x-F.width:q.y+q.height-F.y-F.height})}return Y}function e(L,V){var T=N(L),Y=V==mxConstants.DIRECTION_EAST||V==mxConstants.DIRECTION_WEST;(T==mxConstants.DIRECTION_EAST||T==mxConstants.DIRECTION_WEST)==Y&&T!=V?f.actions.get("selectParent").funct():T==V?(V=k.getOutgoingTreeEdges(L),null!=V&&0<V.length&&k.setSelectionCell(k.model.getTerminal(V[0],!1))):(T=k.getIncomingTreeEdges(L),
null!=T&&0<T.length&&(Y=Q(k.model.getTerminal(T[0],!0),Y,L),L=k.view.getState(L),null!=L&&(L=mxUtils.indexOf(Y,L),0<=L&&(L+=V==mxConstants.DIRECTION_NORTH||V==mxConstants.DIRECTION_WEST?-1:1,0<=L&&L<=Y.length-1&&k.setSelectionCell(Y[L].cell)))))}var f=this,k=f.editor.graph,z=k.getModel(),t=f.menus.createPopupMenu;f.menus.createPopupMenu=function(L,V,T){t.apply(this,arguments);if(1==k.getSelectionCount()){V=k.getSelectionCell();var Y=k.getOutgoingTreeEdges(V);L.addSeparator();0<Y.length&&(l(k.getSelectionCell())&&
this.addMenuItems(L,["selectChildren"],null,T),this.addMenuItems(L,["selectDescendants"],null,T));l(k.getSelectionCell())?(L.addSeparator(),0<k.getIncomingTreeEdges(V).length&&this.addMenuItems(L,["selectSiblings","selectParent"],null,T)):0<k.model.getEdgeCount(V)&&this.addMenuItems(L,["selectConnections"],null,T)}};f.actions.addAction("selectChildren",function(){if(k.isEnabled()&&1==k.getSelectionCount()){var L=k.getSelectionCell();L=k.getOutgoingTreeEdges(L);if(null!=L){for(var V=[],T=0;T<L.length;T++)V.push(k.model.getTerminal(L[T],
!1));k.setSelectionCells(V)}}},null,null,"Alt+Shift+X");f.actions.addAction("selectSiblings",function(){if(k.isEnabled()&&1==k.getSelectionCount()){var L=k.getSelectionCell();L=k.getIncomingTreeEdges(L);if(null!=L&&0<L.length&&(L=k.getOutgoingTreeEdges(k.model.getTerminal(L[0],!0)),null!=L)){for(var V=[],T=0;T<L.length;T++)V.push(k.model.getTerminal(L[T],!1));k.setSelectionCells(V)}}},null,null,"Alt+Shift+S");f.actions.addAction("selectParent",function(){if(k.isEnabled()&&1==k.getSelectionCount()){var L=
k.getSelectionCell();L=k.getIncomingTreeEdges(L);null!=L&&0<L.length&&k.setSelectionCell(k.model.getTerminal(L[0],!0))}},null,null,"Alt+Shift+P");f.actions.addAction("selectDescendants",function(L,V){L=k.getSelectionCell();if(k.isEnabled()&&k.model.isVertex(L)){if(null!=V&&mxEvent.isAltDown(V))k.setSelectionCells(k.model.getTreeEdges(L,null==V||!mxEvent.isShiftDown(V),null==V||!mxEvent.isControlDown(V)));else{var T=[];k.traverse(L,!0,function(Y,W){var ka=null!=W&&k.isTreeEdge(W);ka&&T.push(W);null!=
W&&!ka||null!=V&&mxEvent.isShiftDown(V)||T.push(Y);return null==W||ka})}k.setSelectionCells(T)}},null,null,"Alt+Shift+D");var B=k.removeCells;k.removeCells=function(L,V){V=null!=V?V:!0;null==L&&(L=this.getDeletableCells(this.getSelectionCells()));V&&(L=this.getDeletableCells(this.addAllEdges(L)));for(var T=[],Y=0;Y<L.length;Y++){var W=L[Y];z.isEdge(W)&&p(W)&&(T.push(W),W=z.getTerminal(W,!1));if(l(W)){var ka=[];k.traverse(W,!0,function(q,F){var S=null!=F&&k.isTreeEdge(F);S&&ka.push(F);(null==F||S)&&
ka.push(q);return null==F||S});0<ka.length&&(T=T.concat(ka),W=k.getIncomingTreeEdges(L[Y]),L=L.concat(W))}else null!=W&&T.push(L[Y])}L=T;return B.apply(this,arguments)};f.hoverIcons.getStateAt=function(L,V,T){return l(L.cell)?null:this.graph.view.getState(this.graph.getCellAt(V,T))};var I=k.duplicateCells;k.duplicateCells=function(L,V){L=null!=L?L:this.getSelectionCells();for(var T=L.slice(0),Y=0;Y<T.length;Y++){var W=k.view.getState(T[Y]);if(null!=W&&l(W.cell)){var ka=k.getIncomingTreeEdges(W.cell);
for(W=0;W<ka.length;W++)mxUtils.remove(ka[W],L)}}this.model.beginUpdate();try{var q=I.call(this,L,V);if(q.length==L.length)for(Y=0;Y<L.length;Y++)if(l(L[Y])){var F=k.getIncomingTreeEdges(q[Y]);ka=k.getIncomingTreeEdges(L[Y]);if(0==F.length&&0<ka.length){var S=this.cloneCell(ka[0]);this.addEdge(S,k.getDefaultParent(),this.model.getTerminal(ka[0],!0),q[Y])}}}finally{this.model.endUpdate()}return q};var O=k.moveCells;k.moveCells=function(L,V,T,Y,W,ka,q){var F=null;this.model.beginUpdate();try{var S=
W,ba=this.getCurrentCellStyle(W);if(null!=L&&l(W)&&"1"==mxUtils.getValue(ba,"treeFolding","0")){for(var U=0;U<L.length;U++)if(l(L[U])||k.model.isEdge(L[U])&&null==k.model.getTerminal(L[U],!0)){W=k.model.getParent(L[U]);break}if(null!=S&&W!=S&&null!=this.view.getState(L[0])){var ca=k.getIncomingTreeEdges(L[0]);if(0<ca.length){var ea=k.view.getState(k.model.getTerminal(ca[0],!0));if(null!=ea){var na=k.view.getState(S);null!=na&&(V=(na.getCenterX()-ea.getCenterX())/k.view.scale,T=(na.getCenterY()-ea.getCenterY())/
k.view.scale)}}}}F=O.apply(this,arguments);if(null!=F&&null!=L&&F.length==L.length)for(U=0;U<F.length;U++)if(this.model.isEdge(F[U]))l(S)&&0>mxUtils.indexOf(F,this.model.getTerminal(F[U],!0))&&this.model.setTerminal(F[U],S,!0);else if(l(L[U])&&(ca=k.getIncomingTreeEdges(L[U]),0<ca.length))if(!Y)l(S)&&0>mxUtils.indexOf(L,this.model.getTerminal(ca[0],!0))&&this.model.setTerminal(ca[0],S,!0);else if(0==k.getIncomingTreeEdges(F[U]).length){ba=S;if(null==ba||ba==k.model.getParent(L[U]))ba=k.model.getTerminal(ca[0],
!0);Y=this.cloneCell(ca[0]);this.addEdge(Y,k.getDefaultParent(),ba,F[U])}}finally{this.model.endUpdate()}return F};if(null!=f.sidebar){var J=f.sidebar.dropAndConnect;f.sidebar.dropAndConnect=function(L,V,T,Y){var W=k.model,ka=null;W.beginUpdate();try{if(ka=J.apply(this,arguments),l(L))for(var q=0;q<ka.length;q++)if(W.isEdge(ka[q])&&null==W.getTerminal(ka[q],!0)){W.setTerminal(ka[q],L,!0);var F=k.getCellGeometry(ka[q]);F.points=null;null!=F.getTerminalPoint(!0)&&F.setTerminalPoint(null,!0)}}finally{W.endUpdate()}return ka}}var y=
{88:f.actions.get("selectChildren"),84:f.actions.get("selectSubtree"),80:f.actions.get("selectParent"),83:f.actions.get("selectSiblings")},ia=f.onKeyDown;f.onKeyDown=function(L){try{if(k.isEnabled()&&!k.isEditing()&&l(k.getSelectionCell())&&1==k.getSelectionCount()){var V=null;0<k.getIncomingTreeEdges(k.getSelectionCell()).length&&(9==L.which?V=mxEvent.isShiftDown(L)?G(k.getSelectionCell()):M(k.getSelectionCell()):13==L.which&&(V=R(k.getSelectionCell(),!mxEvent.isShiftDown(L))));if(null!=V&&0<V.length)1==
V.length&&k.model.isEdge(V[0])?k.setSelectionCell(k.model.getTerminal(V[0],!1)):k.setSelectionCell(V[V.length-1]),null!=f.hoverIcons&&f.hoverIcons.update(k.view.getState(k.getSelectionCell())),k.startEditingAtCell(k.getSelectionCell()),mxEvent.consume(L);else if(mxEvent.isAltDown(L)&&mxEvent.isShiftDown(L)){var T=y[L.keyCode];null!=T&&(T.funct(L),mxEvent.consume(L))}else 37==L.keyCode?(e(k.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(L)):38==L.keyCode?(e(k.getSelectionCell(),mxConstants.DIRECTION_NORTH),
mxEvent.consume(L)):39==L.keyCode?(e(k.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(L)):40==L.keyCode&&(e(k.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(L))}}catch(Y){f.handleError(Y)}mxEvent.isConsumed(L)||ia.apply(this,arguments)};var da=k.connectVertex;k.connectVertex=function(L,V,T,Y,W,ka,q){var F=k.getIncomingTreeEdges(L);if(l(L)){var S=N(L),ba=S==mxConstants.DIRECTION_EAST||S==mxConstants.DIRECTION_WEST,U=V==mxConstants.DIRECTION_EAST||V==mxConstants.DIRECTION_WEST;
return S==V||0==F.length?M(L,V):ba==U?G(L):R(L,V!=mxConstants.DIRECTION_NORTH&&V!=mxConstants.DIRECTION_WEST)}return da.apply(this,arguments)};k.getSubtree=function(L){var V=[L];!D(L)&&!l(L)||E(L)||k.traverse(L,!0,function(T,Y){var W=null!=Y&&k.isTreeEdge(Y);W&&0>mxUtils.indexOf(V,Y)&&V.push(Y);(null==Y||W)&&0>mxUtils.indexOf(V,T)&&V.push(T);return null==Y||W});return V};var ja=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){ja.apply(this,arguments);(D(this.state.cell)||l(this.state.cell))&&
!E(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(L){this.graph.graphHandler.start(this.state.cell,
mxEvent.getClientX(L),mxEvent.getClientY(L),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(L);this.graph.isMouseDown=!0;f.hoverIcons.reset();mxEvent.consume(L)})))};var aa=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){aa.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=
this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var qa=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(L){qa.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=L?"":"none")};var sa=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(L,V){sa.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==
typeof Sidebar){var g=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var l=g.apply(this,arguments),D=this.graph;return l.concat([this.addEntry("tree container",function(){var p=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");p.vertex=!0;var E=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
E.vertex=!0;var N=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');N.vertex=!0;var R=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");R.geometry.relative=!0;R.edge=!0;E.insertEdge(R,!0);N.insertEdge(R,!1);p.insert(R);p.insert(E);p.insert(N);return sb.createVertexTemplateFromCells([p],p.geometry.width,
p.geometry.height,p.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var p=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");p.vertex=!0;var E=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');E.vertex=!0;var N=new mxCell("Topic",
new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');N.vertex=!0;var R=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");R.geometry.relative=!0;R.edge=!0;E.insertEdge(R,!0);N.insertEdge(R,!1);
var G=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');G.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
M.geometry.relative=!0;M.edge=!0;E.insertEdge(M,!0);G.insertEdge(M,!1);var Q=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');Q.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
e.geometry.relative=!0;e.edge=!0;E.insertEdge(e,!0);Q.insertEdge(e,!1);var f=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');f.vertex=!0;var k=new mxCell("",new mxGeometry(0,
0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");k.geometry.relative=!0;k.edge=!0;E.insertEdge(k,!0);f.insertEdge(k,!1);p.insert(R);p.insert(M);p.insert(e);p.insert(k);p.insert(E);p.insert(N);p.insert(G);p.insert(Q);p.insert(f);return sb.createVertexTemplateFromCells([p],p.geometry.width,p.geometry.height,p.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var p=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};treeFolding=1;treeMoving=1;');
p.vertex=!0;return sb.createVertexTemplateFromCells([p],p.geometry.width,p.geometry.height,p.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var p=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');
p.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");E.geometry.setTerminalPoint(new mxPoint(-40,40),!0);E.geometry.relative=!0;E.edge=!0;p.insertEdge(E,!1);return sb.createVertexTemplateFromCells([p,E],p.geometry.width,p.geometry.height,p.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var p=new mxCell("Sub Topic",new mxGeometry(0,0,72,26),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');
p.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");E.geometry.setTerminalPoint(new mxPoint(-40,40),!0);E.geometry.relative=!0;E.edge=!0;p.insertEdge(E,!1);return sb.createVertexTemplateFromCells([p,E],p.geometry.width,p.geometry.height,p.value)}),this.addEntry("tree orgchart organization division",function(){var p=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
p.vertex=!0;var E=new mxCell("Organization",new mxGeometry(80,40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');D.setAttributeForCell(E,"treeRoot","1");E.vertex=!0;var N=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
N.vertex=!0;var R=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");R.geometry.relative=!0;R.edge=!0;E.insertEdge(R,!0);N.insertEdge(R,!1);var G=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');G.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");
M.geometry.relative=!0;M.edge=!0;E.insertEdge(M,!0);G.insertEdge(M,!1);p.insert(R);p.insert(M);p.insert(E);p.insert(N);p.insert(G);return sb.createVertexTemplateFromCells([p],p.geometry.width,p.geometry.height,p.value)}),this.addEntry("tree root",function(){var p=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');D.setAttributeForCell(p,"treeRoot",
"1");p.vertex=!0;return sb.createVertexTemplateFromCells([p],p.geometry.width,p.geometry.height,p.value)}),this.addEntry("tree division",function(){var p=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');p.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");
E.geometry.setTerminalPoint(new mxPoint(0,0),!0);E.geometry.relative=!0;E.edge=!0;p.insertEdge(E,!1);return sb.createVertexTemplateFromCells([p,E],p.geometry.width,p.geometry.height,p.value)}),this.addEntry("tree sub sections",function(){var p=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");p.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");
E.geometry.setTerminalPoint(new mxPoint(110,-40),!0);E.geometry.relative=!0;E.edge=!0;p.insertEdge(E,!1);var N=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");N.vertex=!0;var R=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");R.geometry.setTerminalPoint(new mxPoint(110,-40),!0);R.geometry.relative=
!0;R.edge=!0;N.insertEdge(R,!1);return sb.createVertexTemplateFromCells([E,R,p,N],220,60,"Sub Sections")})])}}})();"1"==urlParams["live-ui"]&&"min"==uiTheme&&"1"==urlParams.sketch&&(Editor.currentTheme="sketch",uiTheme="kennedy");EditorUi.windowed="0"!=urlParams.windows;
EditorUi.initMinimalTheme=function(){function b(t,B){if(EditorUi.windowed){var I=t.editor.graph;I.popupMenuHandler.hideMenu();if(null==t.formatWindow){B="1"==urlParams.sketch?Math.max(10,t.diagramContainer.clientWidth-244):Math.max(10,t.diagramContainer.clientWidth-248);var O="1"==urlParams.winCtrls&&"1"==urlParams.sketch?80:60;I="1"==urlParams.embedInline?580:"1"==urlParams.sketch?580:Math.min(566,I.container.clientHeight-10);t.formatWindow=new WrapperWindow(t,mxResources.get("format"),B,O,240,I,
function(J){t.createFormat(J).init()});t.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){t.formatWindow.window.fit()}));t.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)}else t.formatWindow.window.setVisible(null!=B?B:!t.formatWindow.window.isVisible())}else null==t.formatElt&&(t.formatElt=t.createSidebarContainer(),t.createFormat(t.formatElt).init(),t.formatElt.style.border="none",t.formatElt.style.width="240px",t.formatElt.style.borderLeft="1px solid gray",
t.formatElt.style.right="0px"),I=t.diagramContainer.parentNode,null!=t.formatElt.parentNode?(t.formatElt.parentNode.removeChild(t.formatElt),I.style.right="0px"):(I.parentNode.appendChild(t.formatElt),I.style.right=t.formatElt.style.width)}function d(t,B){function I(ia,da){var ja=t.menus.get(ia);ia=y.addMenu(da,mxUtils.bind(this,function(){ja.funct.apply(this,arguments)}));ia.style.cssText="position:absolute;border-top:1px solid lightgray;width:50%;height:24px;bottom:0px;text-align:center;cursor:pointer;padding:6px 0 0 0;cusor:pointer;";
ia.className="geTitle";B.appendChild(ia);return ia}var O=document.createElement("div");O.style.cssText="position:absolute;left:0;right:0;border-top:1px solid lightgray;height:24px;bottom:31px;text-align:center;cursor:pointer;padding:6px 0 0 0;";O.className="geTitle";var J=document.createElement("span");J.style.fontSize="18px";J.style.marginRight="5px";J.innerHTML="+";O.appendChild(J);mxUtils.write(O,mxResources.get("moreShapes"));B.appendChild(O);mxEvent.addListener(O,"click",function(){t.actions.get("shapes").funct()});
var y=new Menubar(t,B);!Editor.enableCustomLibraries||"1"==urlParams.embed&&"1"!=urlParams.libraries?O.style.bottom="0":null!=t.actions.get("newLibrary")?(O=document.createElement("div"),O.style.cssText="position:absolute;left:0px;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;",O.className="geTitle",J=document.createElement("span"),J.style.cssText="position:relative;top:6px;",mxUtils.write(J,mxResources.get("newLibrary")),O.appendChild(J),
B.appendChild(O),mxEvent.addListener(O,"click",t.actions.get("newLibrary").funct),O=document.createElement("div"),O.style.cssText="position:absolute;left:50%;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;border-left: 1px solid lightgray;",O.className="geTitle",J=document.createElement("span"),J.style.cssText="position:relative;top:6px;",mxUtils.write(J,mxResources.get("openLibrary")),O.appendChild(J),B.appendChild(O),mxEvent.addListener(O,
"click",t.actions.get("openLibrary").funct)):(O=I("newLibrary",mxResources.get("newLibrary")),O.style.boxSizing="border-box",O.style.paddingRight="6px",O.style.paddingLeft="6px",O.style.height="32px",O.style.left="0",O=I("openLibraryFrom",mxResources.get("openLibraryFrom")),O.style.borderLeft="1px solid lightgray",O.style.boxSizing="border-box",O.style.paddingRight="6px",O.style.paddingLeft="6px",O.style.height="32px",O.style.left="50%");B.appendChild(t.sidebar.container);B.style.overflow="hidden"}
function g(t,B){if(EditorUi.windowed){var I=t.editor.graph;I.popupMenuHandler.hideMenu();if(null==t.sidebarWindow){B=Math.min(I.container.clientWidth-10,218);var O="1"==urlParams.embedInline?650:Math.min(I.container.clientHeight-40,650);t.sidebarWindow=new WrapperWindow(t,mxResources.get("shapes"),"1"==urlParams.sketch&&"1"!=urlParams.embedInline?66:10,"1"==urlParams.sketch&&"1"!=urlParams.embedInline?Math.max(30,(I.container.clientHeight-O)/2):56,B-6,O-6,function(J){d(t,J)});t.sidebarWindow.window.addListener(mxEvent.SHOW,
mxUtils.bind(this,function(){t.sidebarWindow.window.fit()}));t.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);t.sidebarWindow.window.setVisible(!0);isLocalStorage&&t.getLocalData("sidebar",function(J){t.sidebar.showEntries(J,null,!0)});t.restoreLibraries()}else t.sidebarWindow.window.setVisible(null!=B?B:!t.sidebarWindow.window.isVisible())}else null==t.sidebarElt&&(t.sidebarElt=t.createSidebarContainer(),d(t,t.sidebarElt),t.sidebarElt.style.border="none",t.sidebarElt.style.width="210px",
t.sidebarElt.style.borderRight="1px solid gray"),I=t.diagramContainer.parentNode,null!=t.sidebarElt.parentNode?(t.sidebarElt.parentNode.removeChild(t.sidebarElt),I.style.left="0px"):(I.parentNode.appendChild(t.sidebarElt),I.style.left=t.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var l=0;try{l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}catch(t){}Editor.checkmarkImage=
Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="#29b6f2"/>').src;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#C0C0C0" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#C0C0C0" stroke-width="2" fill="none"/>').src;
mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#C0C0C0" stroke-width="2" fill="none"/>').src;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR=
"#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.HIGHLIGHT_STROKEWIDTH=5;mxConstants.HIGHLIGHT_OPACITY=35;mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";Format.inactiveTabBackgroundColor="#f0f0f0";mxGraphHandler.prototype.previewColor=
"#C0C0C0";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;Format.prototype.showCloseButton=!1;EditorUi.prototype.closableScratchpad=!1;EditorUi.prototype.toolbarHeight="1"==urlParams.sketch?1:46;EditorUi.prototype.footerHeight=0;Graph.prototype.editAfterInsert="1"!=urlParams.sketch&&!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.styleElt=document.createElement("style");Editor.styleElt.type="text/css";Editor.styleElt.innerHTML=Editor.createMinimalCss();document.getElementsByTagName("head")[0].appendChild(Editor.styleElt);
Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var D=EditorUi.prototype.updateTabContainer;EditorUi.prototype.updateTabContainer=function(){null!=this.tabContainer&&(this.tabContainer.style.right="70px",this.diagramContainer.style.bottom="1"==urlParams.sketch?"0px":this.tabContainerHeight+"px");D.apply(this,arguments)};var p=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){p.apply(this,arguments);this.menus.get("save").setEnabled(null!=
this.getCurrentFile()||"1"==urlParams.embed)};var E=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(t,B){null!=B.shortcut&&900>l&&!mxClient.IS_IOS?t.firstChild.nextSibling.setAttribute("title",B.shortcut):E.apply(this,arguments)};var N=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){N.apply(this,arguments);if(null!=this.userElement){var t=this.userElement;t.style.cssText="position:relative;cursor:pointer;display:"+t.style.display;t.className="geToolbarButton";
t.innerText="";t.style.backgroundImage="url("+Editor.userImage+")";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";t.style.backgroundSize="24px 24px";t.style.height="24px";t.style.width="24px";var B=mxResources.get("changeUser");if("none"!=t.style.display){t.style.display="inline-block";var I=this.getCurrentFile();if(null!=I&&I.isRealtimeEnabled()&&I.isRealtimeSupported()){var O=document.createElement("img");O.setAttribute("border","0");O.style.position="absolute";
O.style.left="18px";O.style.top="2px";O.style.width="12px";O.style.height="12px";var J=I.getRealtimeError();I=I.getRealtimeState();B+=" ("+mxResources.get("realtimeCollaboration")+": ";1==I?(O.src=Editor.syncImage,B+=mxResources.get("online")):(O.src=Editor.syncProblemImage,B=null!=J&&null!=J.message?B+J.message:B+mxResources.get("disconnected"));t.style.marginRight="6px";t.appendChild(O);B+=")"}}t.setAttribute("title",B)}};var R=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=
function(){R.apply(this,arguments);null!=this.shareButton&&(this.shareButton.style.display="none")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.buttonContainer&&"1"!=urlParams.embedInline){var t=document.createElement("div");t.style.display="inline-block";t.style.position="relative";t.style.marginTop="6px";t.style.marginRight="4px";var B=document.createElement("a");B.className="geMenuItem gePrimaryBtn";B.style.marginLeft="8px";B.style.padding="6px";if("1"==urlParams.noSaveBtn){if("0"!=
urlParams.saveAndExit){var I="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit");mxUtils.write(B,I);B.setAttribute("title",I);mxEvent.addListener(B,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()}));t.appendChild(B)}}else mxUtils.write(B,mxResources.get("save")),B.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(B,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})),t.appendChild(B),
"1"==urlParams.saveAndExit&&(B=document.createElement("a"),mxUtils.write(B,mxResources.get("saveAndExit")),B.setAttribute("title",mxResources.get("saveAndExit")),B.className="geMenuItem",B.style.marginLeft="6px",B.style.padding="6px",mxEvent.addListener(B,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),t.appendChild(B));"1"!=urlParams.noExitBtn&&(B=document.createElement("a"),I="1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),mxUtils.write(B,
I),B.setAttribute("title",I),B.className="geMenuItem",B.style.marginLeft="6px",B.style.padding="6px",mxEvent.addListener(B,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()})),t.appendChild(B));this.buttonContainer.appendChild(t);this.buttonContainer.style.top="6px";this.editor.fireEvent(new mxEventObject("statusChanged"))}};var G=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(t,B,I){var O=this.editorUi.editor.graph;t.smartSeparators=!0;G.apply(this,arguments);
"1"==urlParams.sketch?O.isEnabled()&&(t.addSeparator(),1==O.getSelectionCount()&&this.addMenuItems(t,["-","lockUnlock"],null,I)):1==O.getSelectionCount()?(O.isCellFoldable(O.getSelectionCell())&&this.addMenuItems(t,O.isCellCollapsed(B)?["expand"]:["collapse"],null,I),this.addMenuItems(t,["collapsible","-","lockUnlock","enterGroup"],null,I),t.addSeparator(),this.addSubmenu("layout",t)):O.isSelectionEmpty()&&O.isEnabled()?(t.addSeparator(),this.addMenuItems(t,["editData"],null,I),t.addSeparator(),this.addSubmenu("layout",
t),this.addSubmenu("insert",t),this.addMenuItems(t,["-","exitGroup"],null,I)):O.isEnabled()&&this.addMenuItems(t,["-","lockUnlock"],null,I)};var M=Menus.prototype.addPopupMenuEditItems;Menus.prototype.addPopupMenuEditItems=function(t,B,I){M.apply(this,arguments);this.editorUi.editor.graph.isSelectionEmpty()&&this.addMenuItems(t,["copyAsImage"],null,I)};EditorUi.prototype.toggleFormatPanel=function(t){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=t?t:!this.formatWindow.window.isVisible()):
b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var Q=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();Q.apply(this,arguments)};var e=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(t){e.apply(this,arguments);if(t){var B=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
1E3<=B&&null!=this.sidebarWindow&&"1"!=urlParams.sketch&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&(1E3<=B||"1"==urlParams.sketch)&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var f=Menus.prototype.init;Menus.prototype.init=function(){f.apply(this,arguments);var t=this.editorUi,B=t.actions.put("togglePagesVisible",
new Action(mxResources.get("pages"),function(da){t.setPagesVisible(!Editor.pagesVisible)}));B.setToggleAction(!0);B.setSelectedCallback(function(){return Editor.pagesVisible});t.actions.put("toggleShapes",new Action(mxResources.get("shapes"),function(){g(t)},null,null,Editor.ctrlKey+"+Shift+K"));EditorUi.enablePlantUml&&!t.isOffline()&&t.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var da=new ParseDialog(t,mxResources.get("plantUml")+"...","plantUml");t.showDialog(da.container,
620,420,!0,!1);da.init()}));t.actions.put("mermaid",new Action(mxResources.get("mermaid")+"...",function(){var da=new ParseDialog(t,mxResources.get("mermaid")+"...","mermaid");t.showDialog(da.container,620,420,!0,!1);da.init()}));var I=this.addPopupMenuCellEditItems;this.put("editCell",new Menu(mxUtils.bind(this,function(da,ja){var aa=this.editorUi.editor.graph,qa=aa.getSelectionCell();I.call(this,da,qa,null,ja);this.addMenuItems(da,["editTooltip"],ja);aa.model.isVertex(qa)&&this.addMenuItems(da,
["editGeometry"],ja);this.addMenuItems(da,["-","edit"],ja)})));this.addPopupMenuCellEditItems=function(da,ja,aa,qa){da.addSeparator();this.addSubmenu("editCell",da,qa,mxResources.get("edit"))};var O=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(da,ja){O.funct(da,ja);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||t.menus.addMenuItems(da,["publishLink"],ja);t.mode!=App.MODE_ATLAS&&"1"!=urlParams.extAuth&&(da.addSeparator(ja),t.menus.addSubmenu("embed",da,ja))})));var J=
this.get("units");this.put("units",new Menu(mxUtils.bind(this,function(da,ja){J.funct(da,ja);this.addMenuItems(da,["-","ruler","-","pageScale"],ja)})));var y="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),ia=function(da,ja,aa,qa){da.addItem(aa,null,mxUtils.bind(this,function(){var sa=new CreateGraphDialog(t,aa,qa);t.showDialog(sa.container,620,420,!0,!1);sa.init()}),ja)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(da,ja){for(var aa=
0;aa<y.length;aa++)"-"==y[aa]?da.addSeparator(ja):ia(da,ja,mxResources.get(y[aa])+"...",y[aa])})))};EditorUi.prototype.installFormatToolbar=function(t){var B=this.editor.graph,I=document.createElement("div");I.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";B.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(O,J){0<B.getSelectionCount()?
(t.appendChild(I),I.innerHTML="Selected: "+B.getSelectionCount()):null!=I.parentNode&&I.parentNode.removeChild(I)}))};var k=!1;EditorUi.prototype.initFormatWindow=function(){if(!k&&null!=this.formatWindow){k=!0;var t=this.formatWindow.window.toggleMinimized,B=240;this.formatWindow.window.toggleMinimized=function(){t.apply(this,arguments);this.minimized?(B=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+B-
140+"px"):(this.div.style.width=B+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-B+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(I){mxEvent.getSource(I)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var z=EditorUi.prototype.init;EditorUi.prototype.init=function(){function t(oa,ta,Ea){var Fa=y.menus.get(oa),Pa=aa.addMenu(mxResources.get(oa),
mxUtils.bind(this,function(){Fa.funct.apply(this,arguments)}),ja);Pa.className="1"==urlParams.sketch?"geToolbarButton":"geMenuItem";Pa.style.display="inline-block";Pa.style.boxSizing="border-box";Pa.style.top="6px";Pa.style.marginRight="6px";Pa.style.height="30px";Pa.style.paddingTop="6px";Pa.style.paddingBottom="6px";Pa.style.cursor="pointer";Pa.setAttribute("title",mxResources.get(oa));y.menus.menuCreated(Fa,Pa,"geMenuItem");null!=Ea?(Pa.style.backgroundImage="url("+Ea+")",Pa.style.backgroundPosition=
"center center",Pa.style.backgroundRepeat="no-repeat",Pa.style.backgroundSize="24px 24px",Pa.style.width="34px",Pa.innerText=""):ta||(Pa.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",Pa.style.backgroundPosition="right 6px center",Pa.style.backgroundRepeat="no-repeat",Pa.style.paddingRight="22px");return Pa}function B(oa,ta,Ea,Fa,Pa,Ra){var Ca=document.createElement("a");Ca.className="1"==urlParams.sketch?"geToolbarButton":"geMenuItem";Ca.style.display="inline-block";Ca.style.boxSizing=
"border-box";Ca.style.height="30px";Ca.style.padding="6px";Ca.style.position="relative";Ca.style.verticalAlign="top";Ca.style.top="0px";"1"==urlParams.sketch&&(Ca.style.borderStyle="none",Ca.style.boxShadow="none",Ca.style.padding="6px",Ca.style.margin="0px");null!=y.statusContainer?da.insertBefore(Ca,y.statusContainer):da.appendChild(Ca);null!=Ra?(Ca.style.backgroundImage="url("+Ra+")",Ca.style.backgroundPosition="center center",Ca.style.backgroundRepeat="no-repeat",Ca.style.backgroundSize="24px 24px",
Ca.style.width="34px"):mxUtils.write(Ca,oa);mxEvent.addListener(Ca,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(Ja){Ja.preventDefault()}));mxEvent.addListener(Ca,"click",function(Ja){"disabled"!=Ca.getAttribute("disabled")&&ta(Ja);mxEvent.consume(Ja)});null==Ea&&(Ca.style.marginRight="4px");null!=Fa&&Ca.setAttribute("title",Fa);null!=Pa&&(oa=function(){Pa.isEnabled()?(Ca.removeAttribute("disabled"),Ca.style.cursor="pointer"):(Ca.setAttribute("disabled","disabled"),Ca.style.cursor=
"default")},Pa.addListener("stateChanged",oa),ia.addListener("enabledChanged",oa),oa());return Ca}function I(oa,ta,Ea){Ea=document.createElement("div");Ea.className="geMenuItem";Ea.style.display="inline-block";Ea.style.verticalAlign="top";Ea.style.marginRight="6px";Ea.style.padding="0 4px 0 4px";Ea.style.height="30px";Ea.style.position="relative";Ea.style.top="0px";"1"==urlParams.sketch&&(Ea.style.boxShadow="none");for(var Fa=0;Fa<oa.length;Fa++)null!=oa[Fa]&&("1"==urlParams.sketch&&(oa[Fa].style.padding=
"10px 8px",oa[Fa].style.width="30px"),oa[Fa].style.margin="0px",oa[Fa].style.boxShadow="none",Ea.appendChild(oa[Fa]));null!=ta&&mxUtils.setOpacity(Ea,ta);null!=y.statusContainer&&"1"!=urlParams.sketch?da.insertBefore(Ea,y.statusContainer):da.appendChild(Ea);return Ea}function O(){if("1"==urlParams.sketch)"1"!=urlParams.embedInline&&(ka.style.left=58>W.offsetTop-W.offsetHeight/2?"70px":"10px");else{for(var oa=da.firstChild;null!=oa;){var ta=oa.nextSibling;"geMenuItem"!=oa.className&&"geItem"!=oa.className||
oa.parentNode.removeChild(oa);oa=ta}ja=da.firstChild;l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;oa=1E3>l||"1"==urlParams.sketch;var Ea=null;oa||(Ea=t("diagram"));ta=oa?t("diagram",null,Editor.menuImage):null;null!=ta&&(Ea=ta);I([Ea,B(mxResources.get("shapes"),y.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),y.actions.get("image"),oa?Editor.shapesImage:null),B(mxResources.get("format"),y.actions.get("format").funct,null,mxResources.get("format")+
" ("+y.actions.get("format").shortcut+")",y.actions.get("image"),oa?Editor.formatImage:null)],oa?60:null);ta=t("insert",!0,oa?T:null);I([ta,B(mxResources.get("delete"),y.actions.get("delete").funct,null,mxResources.get("delete"),y.actions.get("delete"),oa?Editor.trashImage:null)],oa?60:null);411<=l&&(I([Oa,Na],60),520<=l&&I([P,640<=l?B("",Da.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",Da,Editor.zoomInImage):null,640<=l?B("",pa.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+
" -)",pa,Editor.zoomOutImage):null],60))}null!=Ea&&(mxEvent.disableContextMenu(Ea),mxEvent.addGestureListeners(Ea,mxUtils.bind(this,function(Fa){(mxEvent.isShiftDown(Fa)||mxEvent.isAltDown(Fa)||mxEvent.isMetaDown(Fa)||mxEvent.isControlDown(Fa)||mxEvent.isPopupTrigger(Fa))&&y.appIconClicked(Fa)}),null,null));ta=y.menus.get("language");null!=ta&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=l&&"1"!=urlParams.embed&&"1"!=urlParams.sketch?(null==Z&&(ta=aa.addMenu("",ta.funct),ta.setAttribute("title",
"language"),ta.className="geToolbarButton",ta.style.backgroundImage="url("+Editor.globeImage+")",ta.style.backgroundPosition="center center",ta.style.backgroundRepeat="no-repeat",ta.style.backgroundSize="22px 22px",ta.style.position="absolute",ta.style.height="24px",ta.style.width="24px",ta.style.zIndex="1",ta.style.right="8px",ta.style.cursor="pointer",ta.style.top="12px",da.appendChild(ta),Z=ta),y.buttonContainer.style.paddingRight="34px"):(y.buttonContainer.style.paddingRight="4px",null!=Z&&(Z.parentNode.removeChild(Z),
Z=null))}z.apply(this,arguments);var J=document.createElement("div");J.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";J.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(J);"1"==urlParams.sketch&&null!=this.sidebar&&this.isSettingsEnabled()&&(this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save()),
this.sidebar.showPalette("search",mxSettings.settings.search));if("1"!=urlParams.sketch&&1E3<=l||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])g(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));var y=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==y.embedViewport)mxUtils.fit(this.div);else{var oa=parseInt(this.div.offsetLeft),
ta=parseInt(this.div.offsetWidth),Ea=y.embedViewport.x+y.embedViewport.width,Fa=parseInt(this.div.offsetTop),Pa=parseInt(this.div.offsetHeight),Ra=y.embedViewport.y+y.embedViewport.height;this.div.style.left=Math.max(y.embedViewport.x,Math.min(oa,Ea-ta))+"px";this.div.style.top=Math.max(y.embedViewport.y,Math.min(Fa,Ra-Pa))+"px";this.div.style.height=Math.min(y.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(y.embedViewport.width,parseInt(this.div.style.width))+
"px"}};EditorUi.windowed&&("1"==urlParams.sketch||1E3<=l)&&"1"!=urlParams.embedInline&&(b(this,!0),"1"==urlParams.sketch?(this.initFormatWindow(),J=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,null!=this.formatWindow&&(1200>l||708>J)?this.formatWindow.window.toggleMinimized():this.formatWindow.window.setVisible(!0)):this.formatWindow.window.setVisible(!0));y=this;var ia=y.editor.graph;y.toolbar=this.createToolbar(y.createDiv("geToolbar"));y.defaultLibraryName=
mxResources.get("untitledLibrary");var da=document.createElement("div");da.className="geMenubarContainer";var ja=null,aa=new Menubar(y,da);y.statusContainer=y.createStatusContainer();y.statusContainer.style.position="relative";y.statusContainer.style.maxWidth="";y.statusContainer.style.marginTop="7px";y.statusContainer.style.marginLeft="6px";y.statusContainer.style.color="gray";y.statusContainer.style.cursor="default";var qa=y.hideCurrentMenu;y.hideCurrentMenu=function(){qa.apply(this,arguments);
this.editor.graph.popupMenuHandler.hideMenu()};var sa=y.descriptorChanged;y.descriptorChanged=function(){sa.apply(this,arguments);var oa=y.getCurrentFile();if(null!=oa&&null!=oa.getTitle()){var ta=oa.getMode();"google"==ta?ta="googleDrive":"github"==ta?ta="gitHub":"gitlab"==ta?ta="gitLab":"onedrive"==ta&&(ta="oneDrive");ta=mxResources.get(ta);da.setAttribute("title",oa.getTitle()+(null!=ta?" ("+ta+")":""))}else da.removeAttribute("title")};y.setStatusText(y.editor.getStatus());da.appendChild(y.statusContainer);
y.buttonContainer=document.createElement("div");y.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;";da.appendChild(y.buttonContainer);y.menubarContainer=y.buttonContainer;y.tabContainer=document.createElement("div");y.tabContainer.className="geTabContainer";y.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;margin-bottom:-2px;visibility:hidden;";
J=y.diagramContainer.parentNode;var L=document.createElement("div");L.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";y.diagramContainer.style.top="1"==urlParams.sketch?"0px":"47px";if("1"==urlParams.winCtrls&&"1"==urlParams.sketch){L.style.top="20px";y.titlebar=document.createElement("div");y.titlebar.style.cssText="position:absolute;top:0px;left:0px;right:0px;height:20px;overflow:hidden;box-shadow: 0px 0px 2px #c0c0c0;";var V=document.createElement("div");
V.style.cssText="max-width: calc(100% - 100px);text-overflow: ellipsis;user-select:none;height:20px;margin: 2px 10px;font-size: 12px;white-space: nowrap;overflow: hidden;";y.titlebar.appendChild(V);J.appendChild(y.titlebar)}var T="1"!=urlParams.sketch?Editor.plusImage:Editor.shapesImage,Y="1"==urlParams.sketch?document.createElement("div"):null,W="1"==urlParams.sketch?document.createElement("div"):null,ka="1"==urlParams.sketch?document.createElement("div"):null,q=mxUtils.bind(this,function(){if(Editor.inlineFullscreen)ka.style.left=
"10px",ka.style.top="10px",W.style.left="10px",W.style.top="60px",Y.style.top="10px",Y.style.right="12px",Y.style.left="",y.diagramContainer.setAttribute("data-bounds",y.diagramContainer.style.top+" "+y.diagramContainer.style.left+" "+y.diagramContainer.style.width+" "+y.diagramContainer.style.height),y.diagramContainer.style.top="0px",y.diagramContainer.style.left="0px",y.diagramContainer.style.bottom="0px",y.diagramContainer.style.right="0px",y.diagramContainer.style.width="",y.diagramContainer.style.height=
"";else{var oa=y.diagramContainer.getAttribute("data-bounds");if(null!=oa){y.diagramContainer.style.background="transparent";y.diagramContainer.removeAttribute("data-bounds");var ta=ia.getGraphBounds();oa=oa.split(" ");y.diagramContainer.style.top=oa[0];y.diagramContainer.style.left=oa[1];y.diagramContainer.style.width=ta.width+50+"px";y.diagramContainer.style.height=ta.height+46+"px";y.diagramContainer.style.bottom="";y.diagramContainer.style.right="";(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",
rect:y.diagramContainer.getBoundingClientRect()}),"*");y.refresh()}ka.style.left=y.diagramContainer.offsetLeft+"px";ka.style.top=y.diagramContainer.offsetTop-ka.offsetHeight-4+"px";W.style.display="";W.style.left=y.diagramContainer.offsetLeft-W.offsetWidth-4+"px";W.style.top=y.diagramContainer.offsetTop+"px";Y.style.left=y.diagramContainer.offsetLeft+y.diagramContainer.offsetWidth-Y.offsetWidth+"px";Y.style.top=ka.style.top;Y.style.right="";y.bottomResizer.style.left=y.diagramContainer.offsetLeft+
(y.diagramContainer.offsetWidth-y.bottomResizer.offsetWidth)/2+"px";y.bottomResizer.style.top=y.diagramContainer.offsetTop+y.diagramContainer.offsetHeight-y.bottomResizer.offsetHeight/2-1+"px";y.rightResizer.style.left=y.diagramContainer.offsetLeft+y.diagramContainer.offsetWidth-y.rightResizer.offsetWidth/2-1+"px";y.rightResizer.style.top=y.diagramContainer.offsetTop+(y.diagramContainer.offsetHeight-y.bottomResizer.offsetHeight)/2+"px"}y.bottomResizer.style.visibility=Editor.inlineFullscreen?"hidden":
"";y.rightResizer.style.visibility=y.bottomResizer.style.visibility;da.style.display="none";ka.style.visibility="";Y.style.visibility=""});V=y.actions.get("fullscreen");var F=B("",V.funct,null,mxResources.get(""),V,Editor.fullscreenImage),S=mxUtils.bind(this,function(){F.style.backgroundImage="url("+(Editor.inlineFullscreen?Editor.fullscreenExitImage:Editor.fullscreenImage)+")";this.diagramContainer.style.background=Editor.inlineFullscreen?Editor.isDarkMode()?Editor.darkColor:"#ffffff":"transparent";
q()});V=mxUtils.bind(this,function(){b(y,!0);y.initFormatWindow();var oa=this.diagramContainer.getBoundingClientRect();this.formatWindow.window.setLocation(oa.x+oa.width+4,oa.y);S()});y.addListener("inlineFullscreenChanged",S);y.addListener("editInlineStart",V);"1"==urlParams.embedInline&&y.addListener("darkModeChanged",V);y.addListener("editInlineStop",mxUtils.bind(this,function(oa){y.diagramContainer.style.width="10px";y.diagramContainer.style.height="10px";y.diagramContainer.style.border="";y.bottomResizer.style.visibility=
"hidden";y.rightResizer.style.visibility="hidden";ka.style.visibility="hidden";Y.style.visibility="hidden";W.style.display="none"}));if(null!=y.hoverIcons){var ba=y.hoverIcons.update;y.hoverIcons.update=function(){ia.freehand.isDrawing()||ba.apply(this,arguments)}}if(null!=ia.freehand){var U=ia.freehand.createStyle;ia.freehand.createStyle=function(oa){return U.apply(this,arguments)+"sketch=0;"}}if("1"==urlParams.sketch){W.className="geToolbarContainer";Y.className="geToolbarContainer";ka.className=
"geToolbarContainer";da.className="geToolbarContainer";y.picker=W;y.sketchPickerMenuElt=W;var ca=!1;"1"!=urlParams.embed&&"atlassian"!=y.getServiceName()&&(mxEvent.addListener(da,"mouseenter",function(){y.statusContainer.style.display="inline-block"}),mxEvent.addListener(da,"mouseleave",function(){ca||(y.statusContainer.style.display="none")}));var ea=mxUtils.bind(this,function(oa){null!=y.notificationBtn&&(null!=oa?y.notificationBtn.setAttribute("title",oa):y.notificationBtn.removeAttribute("title"))});
da.style.visibility=20>da.clientWidth?"hidden":"";y.editor.addListener("statusChanged",mxUtils.bind(this,function(){y.setStatusText(y.editor.getStatus());if("1"!=urlParams.embed&&"atlassian"!=y.getServiceName())if(y.statusContainer.style.display="inline-block",ca=!0,1==y.statusContainer.children.length&&""==y.editor.getStatus())da.style.visibility="hidden";else{if(0==y.statusContainer.children.length||1==y.statusContainer.children.length&&"function"===typeof y.statusContainer.firstChild.getAttribute&&
null==y.statusContainer.firstChild.getAttribute("class")){var oa=null!=y.statusContainer.firstChild&&"function"===typeof y.statusContainer.firstChild.getAttribute?y.statusContainer.firstChild.getAttribute("title"):y.editor.getStatus();ea(oa);var ta=y.getCurrentFile();ta=null!=ta?ta.savingStatusKey:DrawioFile.prototype.savingStatusKey;oa==mxResources.get(ta)+"..."?(y.statusContainer.innerHTML='<img title="'+mxUtils.htmlEntities(mxResources.get(ta))+'..."src="'+Editor.tailSpin+'">',y.statusContainer.style.display=
"inline-block",ca=!0):6<y.buttonContainer.clientWidth&&(y.statusContainer.style.display="none",ca=!1)}else y.statusContainer.style.display="inline-block",ea(null),ca=!0;da.style.visibility=20>da.clientWidth&&!ca?"hidden":""}}));H=t("diagram",null,Editor.menuImage);H.style.boxShadow="none";H.style.padding="6px";H.style.margin="0px";ka.appendChild(H);mxEvent.disableContextMenu(H);mxEvent.addGestureListeners(H,mxUtils.bind(this,function(oa){(mxEvent.isShiftDown(oa)||mxEvent.isAltDown(oa)||mxEvent.isMetaDown(oa)||
mxEvent.isControlDown(oa)||mxEvent.isPopupTrigger(oa))&&this.appIconClicked(oa)}),null,null);y.statusContainer.style.position="";y.statusContainer.style.display="none";y.statusContainer.style.margin="0px";y.statusContainer.style.padding="6px 0px";y.statusContainer.style.maxWidth=Math.min(l-240,280)+"px";y.statusContainer.style.display="inline-block";y.statusContainer.style.textOverflow="ellipsis";y.buttonContainer.style.display="inline-block";y.buttonContainer.style.position="relative";y.buttonContainer.style.paddingRight=
"0px";y.buttonContainer.style.top="0px";var na=document.createElement("a");na.style.padding="0px";na.style.boxShadow="none";na.className="geMenuItem";na.style.display="inline-block";na.style.width="40px";na.style.height="12px";na.style.marginBottom="-2px";na.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")";na.style.backgroundPosition="top center";na.style.backgroundRepeat="no-repeat";na.setAttribute("title","Minimize");var ra=!1,ya=mxUtils.bind(this,function(){W.innerText="";if(!ra){var oa=
function(ta,Ea,Fa,Pa){null!=Ea&&ta.setAttribute("title",Ea);ta.style.cursor=null!=Fa?Fa:"default";ta.style.margin="2px 0px";W.appendChild(ta);mxUtils.br(W);null!=Pa&&(ta.style.position="relative",ta.style.overflow="visible",Ea=document.createElement("div"),Ea.style.position="absolute",Ea.style.left="34px",Ea.style.top="28px",Ea.style.fontSize="8px",mxUtils.write(Ea,Pa),ta.appendChild(Ea));return ta};oa(y.sidebar.createVertexTemplate("text;strokeColor=none;fillColor=none;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;",
60,30,"Text",mxResources.get("text")+" (A)",!0,!1,null,!0,!0),mxResources.get("text")+" (A)",null,"A");oa(y.sidebar.createVertexTemplate("shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",140,160,"",mxResources.get("note")+" (S)",!0,!1,null,!0),mxResources.get("note")+" (S)",null,"S");oa(y.sidebar.createVertexTemplate("rounded=0;whiteSpace=wrap;html=1;",
160,80,"",mxResources.get("rectangle")+" (D)",!0,!1,null,!0),mxResources.get("rectangle")+" (D)",null,"D");oa(y.sidebar.createVertexTemplate("ellipse;whiteSpace=wrap;html=1;",160,100,"",mxResources.get("ellipse")+" (F)",!0,!1,null,!0),mxResources.get("ellipse")+" (F)",null,"F");(function(){var ta=new mxCell("",new mxGeometry(0,0,ia.defaultEdgeLength,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;");ta.geometry.setTerminalPoint(new mxPoint(0,0),!0);ta.geometry.setTerminalPoint(new mxPoint(ta.geometry.width,
0),!1);ta.geometry.points=[];ta.geometry.relative=!0;ta.edge=!0;oa(y.sidebar.createEdgeTemplateFromCells([ta],ta.geometry.width,ta.geometry.height,mxResources.get("line")+" (C)",!0,null,!0,!1),mxResources.get("line")+" (C)",null,"C");ta=ta.clone();ta.style="edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;";ta.geometry.width=ia.defaultEdgeLength+20;ta.geometry.setTerminalPoint(new mxPoint(0,20),!0);ta.geometry.setTerminalPoint(new mxPoint(ta.geometry.width,
20),!1);oa(y.sidebar.createEdgeTemplateFromCells([ta],ta.geometry.width,40,mxResources.get("arrow"),!0,null,!0,!1),mxResources.get("arrow"))})();(function(ta,Ea,Fa,Pa){ta=B("",ta.funct,null,Ea,ta,Fa);ta.style.width="40px";ta.style.height="34px";ta.style.opacity="0.7";return oa(ta,null,"pointer",Pa)})(y.actions.get("insertFreehand"),mxResources.get("freehand")+" (X)",Editor.freehandImage,"X");H=t("insert",null,Editor.plusImage);H.style.boxShadow="none";H.style.opacity="0.7";H.style.padding="6px";H.style.margin=
"0px";H.style.height="34px";H.style.width="37px";oa(H,null,"pointer")}"1"!=urlParams.embedInline&&W.appendChild(na)});mxEvent.addListener(na,"click",mxUtils.bind(this,function(){ra?(mxUtils.setPrefixedStyle(W.style,"transform","translate(0, -50%)"),W.style.padding="8px 6px 4px",W.style.top="50%",W.style.bottom="",W.style.height="",na.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",na.style.width="40px",na.style.height="12px",na.setAttribute("title","Minimize"),ra=!1,ya()):(W.innerText=
"",W.appendChild(na),mxUtils.setPrefixedStyle(W.style,"transform","translate(0, 0)"),W.style.top="",W.style.bottom="12px",W.style.padding="0px",W.style.height="24px",na.style.height="24px",na.style.backgroundImage="url("+Editor.plusImage+")",na.setAttribute("title",mxResources.get("insert")),na.style.width="24px",ra=!0)}));ya();y.addListener("darkModeChanged",ya);y.addListener("sketchModeChanged",ya)}else y.editor.addListener("statusChanged",mxUtils.bind(this,function(){y.setStatusText(y.editor.getStatus())}));
V=y.menus.get("viewZoom");if(null!=V){var va=function(oa){if(mxEvent.isAltDown(oa))y.hideCurrentMenu(),y.actions.get("customZoom").funct(),mxEvent.consume(oa);else if("geItem"!=mxEvent.getSource(oa).className||mxEvent.isShiftDown(oa))y.hideCurrentMenu(),y.actions.get("smartFit").funct(),mxEvent.consume(oa)},Da=y.actions.get("zoomIn"),pa=y.actions.get("zoomOut"),Aa=y.actions.get("resetView"),xa=y.actions.get("undo"),Ma=y.actions.get("redo"),Oa=B("",xa.funct,null,mxResources.get("undo")+" ("+xa.shortcut+
")",xa,Editor.undoImage),Na=B("",Ma.funct,null,mxResources.get("redo")+" ("+Ma.shortcut+")",Ma,Editor.redoImage);if(null!=Y){Aa=function(){x.style.display=null!=y.pages&&("0"!=urlParams.pages||1<y.pages.length||Editor.pagesVisible)?"inline-block":"none"};var La=function(){x.innerText="";if(null!=y.currentPage){mxUtils.write(x,y.currentPage.getName());var oa=null!=y.pages?y.pages.length:1,ta=y.getPageIndex(y.currentPage);ta=null!=ta?ta+1:1;var Ea=y.currentPage.getId();x.setAttribute("title",y.currentPage.getName()+
" ("+ta+"/"+oa+")"+(null!=Ea?" ["+Ea+"]":""))}},Ba=y.actions.get("delete"),ab=B("",Ba.funct,null,mxResources.get("delete"),Ba,Editor.trashImage);ab.style.opacity="0.3";ka.appendChild(ab);Ba.addListener("stateChanged",function(){ab.style.opacity=Ba.enabled?"":"0.3"});var Xa=function(){Oa.style.display=0<y.editor.undoManager.history.length||ia.isEditing()?"inline-block":"none";Na.style.display=Oa.style.display;Oa.style.opacity=xa.enabled?"":"0.3";Na.style.opacity=Ma.enabled?"":"0.3"};ka.appendChild(Oa);
ka.appendChild(Na);xa.addListener("stateChanged",Xa);Ma.addListener("stateChanged",Xa);Xa();var x=this.createPageMenuTab(!1,!0);x.style.cssText="display:inline-block;white-space:nowrap;overflow:hidden;padding:6px;cursor:pointer;max-width:160px;text-overflow:ellipsis;";Y.appendChild(x);y.editor.addListener("pagesPatched",La);y.editor.addListener("pageSelected",La);y.editor.addListener("pageRenamed",La);y.editor.addListener("fileLoaded",La);La();y.addListener("fileDescriptorChanged",Aa);y.addListener("pagesVisibleChanged",
Aa);y.editor.addListener("pagesPatched",Aa);Aa();Aa=B("",pa.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -/Alt+Mousewheel)",pa,Editor.zoomOutImage);Y.appendChild(Aa);var H=aa.addMenu("100%",V.funct);H.setAttribute("title",mxResources.get("zoom"));H.innerHTML="100%";H.style.display="inline-block";H.style.color="inherit";H.style.cursor="pointer";H.style.textAlign="center";H.style.whiteSpace="nowrap";H.style.paddingRight="10px";H.style.textDecoration="none";H.style.verticalAlign="top";H.style.padding=
"6px 0";H.style.fontSize="14px";H.style.width="40px";Y.appendChild(H);V=B("",Da.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +/Alt+Mousewheel)",Da,Editor.zoomInImage);Y.appendChild(V);"1"==urlParams.embedInline?(Y.appendChild(F),V=y.actions.get("exit"),Y.appendChild(B("",V.funct,null,mxResources.get("exit"),V,Editor.closeImage))):F.parentNode.removeChild(F);y.tabContainer.style.visibility="hidden";da.style.cssText="position:absolute;right:12px;top:10px;height:30px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;border-bottom:1px solid lightgray;text-align:right;white-space:nowrap;overflow:hidden;user-select:none;";
ka.style.cssText="position:absolute;left:10px;top:10px;height:30px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;border-bottom:1px solid lightgray;text-align:right;white-space:nowrap;overflow:hidden;user-select:none;";Y.style.cssText="position:absolute;right:12px;bottom:12px;height:28px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:8px;white-space:nowrap;user-select:none;";L.appendChild(ka);L.appendChild(Y);W.style.cssText="position:absolute;left:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:8px 6px 4px 6px;white-space:nowrap;transform:translate(0, -50%);top:50%;user-select:none;";
mxClient.IS_POINTER&&(W.style.touchAction="none");L.appendChild(W);window.setTimeout(function(){mxUtils.setPrefixedStyle(W.style,"transition","transform .3s ease-out")},0);"1"==urlParams["format-toolbar"]&&this.installFormatToolbar(L)}else{var P=B("",va,!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",Aa,Editor.zoomFitImage);da.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;text-align:left;white-space:nowrap;";this.tabContainer.style.right="70px";H=aa.addMenu("100%",
V.funct);H.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");H.style.whiteSpace="nowrap";H.style.paddingRight="10px";H.style.textDecoration="none";H.style.textDecoration="none";H.style.overflow="hidden";H.style.visibility="hidden";H.style.textAlign="center";H.style.cursor="pointer";H.style.height=parseInt(y.tabContainerHeight)-1+"px";H.style.lineHeight=parseInt(y.tabContainerHeight)+1+"px";H.style.position="absolute";H.style.display="block";H.style.fontSize="12px";H.style.width="59px";
H.style.right="0px";H.style.bottom="0px";H.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";H.style.backgroundPosition="right 6px center";H.style.backgroundRepeat="no-repeat";L.appendChild(H)}(function(oa){mxEvent.addListener(oa,"click",va);var ta=mxUtils.bind(this,function(){oa.innerText="";mxUtils.write(oa,Math.round(100*y.editor.graph.view.scale)+"%")});y.editor.graph.view.addListener(mxEvent.EVENT_SCALE,ta);y.editor.addListener("resetGraphView",ta);y.editor.addListener("pageSelected",
ta)})(H);var X=y.setGraphEnabled;y.setGraphEnabled=function(){X.apply(this,arguments);null!=this.tabContainer&&(H.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility&&null==Y?this.tabContainerHeight+"px":"0px")}}L.appendChild(da);L.appendChild(y.diagramContainer);J.appendChild(L);y.updateTabContainer();!EditorUi.windowed&&("1"==urlParams.sketch||1E3<=l)&&"1"!=urlParams.embedInline&&b(this,!0);null==Y&&L.appendChild(y.tabContainer);
var Z=null;O();mxEvent.addListener(window,"resize",function(){O();null!=y.sidebarWindow&&y.sidebarWindow.window.fit();null!=y.formatWindow&&y.formatWindow.window.fit();null!=y.actions.outlineWindow&&y.actions.outlineWindow.window.fit();null!=y.actions.layersWindow&&y.actions.layersWindow.window.fit();null!=y.menus.tagsWindow&&y.menus.tagsWindow.window.fit();null!=y.menus.findWindow&&y.menus.findWindow.window.fit();null!=y.menus.findReplaceWindow&&y.menus.findReplaceWindow.window.fit()});if("1"==urlParams.embedInline){document.body.style.cursor=
"text";W.style.transform="";mxEvent.addGestureListeners(y.diagramContainer.parentNode,function(oa){mxEvent.getSource(oa)==y.diagramContainer.parentNode&&(y.embedExitPoint=new mxPoint(mxEvent.getClientX(oa),mxEvent.getClientY(oa)),y.sendEmbeddedSvgExport())});J=document.createElement("div");J.style.position="absolute";J.style.width="10px";J.style.height="10px";J.style.borderRadius="5px";J.style.border="1px solid gray";J.style.background="#ffffff";J.style.cursor="row-resize";y.diagramContainer.parentNode.appendChild(J);
y.bottomResizer=J;var fa=null,la=null,za=null,ua=null;mxEvent.addGestureListeners(J,function(oa){ua=parseInt(y.diagramContainer.style.height);la=mxEvent.getClientY(oa);ia.popupMenuHandler.hideMenu();mxEvent.consume(oa)});J=J.cloneNode(!1);J.style.cursor="col-resize";y.diagramContainer.parentNode.appendChild(J);y.rightResizer=J;mxEvent.addGestureListeners(J,function(oa){za=parseInt(y.diagramContainer.style.width);fa=mxEvent.getClientX(oa);ia.popupMenuHandler.hideMenu();mxEvent.consume(oa)});mxEvent.addGestureListeners(document.body,
null,function(oa){var ta=!1;null!=fa&&(y.diagramContainer.style.width=Math.max(20,za+mxEvent.getClientX(oa)-fa)+"px",ta=!0);null!=la&&(y.diagramContainer.style.height=Math.max(20,ua+mxEvent.getClientY(oa)-la)+"px",ta=!0);ta&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:y.diagramContainer.getBoundingClientRect()}),"*"),q(),y.refresh())},function(oa){null==fa&&null==la||mxEvent.consume(oa);la=fa=null});this.diagramContainer.style.borderRadius=
"4px";document.body.style.backgroundColor="transparent";y.bottomResizer.style.visibility="hidden";y.rightResizer.style.visibility="hidden";ka.style.visibility="hidden";Y.style.visibility="hidden";W.style.display="none"}"1"==urlParams.prefetchFonts&&y.editor.loadFonts()}}};(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,d,g,l,D,p,E){this.file=b;this.id=d;this.content=g;this.modifiedDate=l;this.createdDate=D;this.isResolved=p;this.user=E;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,d,g,l,D){d()};DrawioComment.prototype.editComment=function(b,d,g){d()};DrawioComment.prototype.deleteComment=function(b,d){b()};DrawioUser=function(b,d,g,l,D){this.id=b;this.email=d;this.displayName=g;this.pictureUrl=l;this.locale=D};mxResources.parse('# *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*\n# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE\nabout=About\naboutDrawio=About draw.io\naccessDenied=Access Denied\naction=Action\nactualSize=Actual Size\nadd=Add\naddAccount=Add account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nalign=Align\nalignment=Alignment\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change user\nchangeStorage=Change storage\nchangesNotSaved=Changes have not been saved\nclassDiagram=Class Diagram\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ndark=Dark\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed:  / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyConnect=Copy on connect\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySize=Copy Size\ncopyStyle=Copy Style\ncreate=Create\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide later\ndefault=Default\ndelete=Delete\ndeleteColumn=Delete Column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\nembed=Embed\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfacebook=Facebook\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nformat=Format\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatSvgEmbedded=SVG (with XML)\nformatVsdx=VSDX\nformatVssx=VSSX\nformatXmlPlain=XML (Plain)\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngooglePlus=Google+\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\nguides=Guides\nhateApp=I hate draw.io\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimport=Import\nimportFrom=Import from\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters:  / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://support.draw.io/display/DFCS/Licensing+your+draw.io+plugin">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlineJumps=Line jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkText=Link Text\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nline=Line\nlineend=Line end\nlineheight=Line Height\nlinestart=Line start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloveIt=I love {1}\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmerge=Merge\nmermaid=Mermaid\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nmisc=Misc\nmockups=Mockups\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move selection to {1}\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered list\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste here\npasteSize=Paste Size\npasteStyle=Paste Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\nprint=Print\nprintAllPages=Print All Pages\nprocEng=Proc. Eng.\nproject=Project\npriority=Priority\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nrememberMe=Remember me\nrememberThisSetting=Remember this setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace existing drawing\nrequired=required\nreset=Reset\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchShapes=Search Shapes\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselectNone=Select None\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nshadow=Shadow\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nshowStartScreen=Show Start Screen\nsidebarTooltip=Click to expand. Drag and drop shapes into the diagram. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsnapToGrid=Snap to Grid\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstandard=Standard\nstartDrawing=Start drawing\nstopDrawing=Stop drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate shape only by 90°\ntype=Type\ntwitter=Twitter\numl=UML\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nupdateFile=Update {1}\nupdatingDocument=Updating Document. Please wait...\nupdatingPreview=Updating Preview. Please wait...\nupdatingSelection=Updating Selection. Please wait...\nupload=Upload\nurl=URL\nuseOffline=Use Offline\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbasic=Basic\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nmockups=Mockups\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently used\nlistView=List view\ngridView=Grid view\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # %  * : < > ? /  { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft Read Error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft Write Error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing (beta)\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\naction=Action\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving Failed (Unexpected Error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nworking=Working\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload Failed (Unexpected Error)\nhiResPreview=High Res Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs Import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a file...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the viewer (px)\nheightOfViewer=Height of the viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit owning page\ndeepIndexing=Deep Indexing (Index diagrams that aren\'t used in any page also)\nconfADeepIndexStarted=Deep Indexing Started\nconfADeepIndexDone=Deep Indexing Done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last modified on\nsearchResults=Search Results\nshowAllTemps=Show all templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfDraftTooBigErr=Draft size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration?\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell checker\nnoChange=No Change\nlblToSvg=Convert labels to SVG\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft save interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;
Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];GraphViewer=function(b,d,g){this.init(b,d,g)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="https://app.diagrams.net/";GraphViewer.prototype.imageBaseUrl="https://viewer.diagrams.net/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?24:26;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;GraphViewer.prototype.autoFit=!1;GraphViewer.prototype.autoCrop=!1;
GraphViewer.prototype.autoOrigin=!0;GraphViewer.prototype.center=!1;GraphViewer.prototype.forceCenter=!1;GraphViewer.prototype.allowZoomIn=!1;GraphViewer.prototype.allowZoomOut=!0;GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;GraphViewer.prototype.responsive=!1;
GraphViewer.prototype.init=function(b,d,g){this.graphConfig=null!=g?g:{};this.autoFit=null!=this.graphConfig["auto-fit"]?this.graphConfig["auto-fit"]:this.autoFit;this.autoCrop=null!=this.graphConfig["auto-crop"]?this.graphConfig["auto-crop"]:this.autoCrop;this.autoOrigin=null!=this.graphConfig["auto-origin"]?this.graphConfig["auto-origin"]:this.autoOrigin;this.allowZoomOut=null!=this.graphConfig["allow-zoom-out"]?this.graphConfig["allow-zoom-out"]:this.allowZoomOut;this.allowZoomIn=null!=this.graphConfig["allow-zoom-in"]?
this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.forceCenter=null!=this.graphConfig.forceCenter?this.graphConfig.forceCenter:this.forceCenter;this.center=null!=this.graphConfig.center?this.graphConfig.center:this.center||this.forceCenter;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(" "):[];this.zoomEnabled=0<=mxUtils.indexOf(this.toolbarItems,
"zoom");this.layersEnabled=0<=mxUtils.indexOf(this.toolbarItems,"layers");this.tagsEnabled=0<=mxUtils.indexOf(this.toolbarItems,"tags");this.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialOverflow=document.body.style.overflow;this.initialWidth=null!=b?b.style.width:null;this.widthIsEmpty=null!=this.initialWidth?""==this.initialWidth:!0;this.currentPage=parseInt(this.graphConfig.page)||0;this.responsive=(null!=this.graphConfig.responsive?
this.graphConfig.responsive:this.responsive)&&!this.zoomEnabled&&!mxClient.NO_FO&&!mxClient.IS_SF;this.pageId=this.graphConfig.pageId;this.editor=null;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=d&&(this.xmlDocument=d.ownerDocument,this.xmlNode=d,this.xml=mxUtils.getXml(d),null!=b)){var l=mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.graph.defaultPageBackgroundColor="transparent";this.graph.transparentBackground=
!1;if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var E=this.graph.view.getDrawPane().ownerSVGElement;this.graph.view.getCanvas();null!=this.graphConfig.border?E.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(E.style.padding="8px");E.style.boxSizing="border-box";E.style.overflow="visible";this.graph.fit=function(){};this.graph.sizeDidChange=function(){var z=this.view.graphBounds,t=this.view.translate;E.setAttribute("viewBox",z.x+t.x-this.panDx+" "+(z.y+t.y-this.panDy)+
" "+(z.width+1)+" "+(z.height+1));this.container.style.backgroundColor=E.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",z))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(z){return!0});this.lightboxClickEnabled&&(b.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=!0;this.graph.centerZoom=!1;this.graph.autoExtend=!1;this.graph.autoScroll=!1;this.graph.setEnabled(!1);1==
this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");this.xmlNode=this.editor.extractGraphModel(this.xmlNode,!0);this.xmlNode!=d&&(this.xml=mxUtils.getXml(this.xmlNode),this.xmlDocument=this.xmlNode.ownerDocument);var N=this;this.graph.getImageFromBundles=function(z){return N.getImageUrl(z)};mxClient.IS_SVG&&this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var R=this.xmlNode.getElementsByTagName("diagram");if(0<
R.length){if(null!=this.pageId)for(var G=0;G<R.length;G++)if(this.pageId==R[G].getAttribute("id")){this.currentPage=G;break}var M=this.graph.getGlobalVariable;N=this;this.graph.getGlobalVariable=function(z){var t=R[N.currentPage];return"page"==z?t.getAttribute("name")||"Page-"+(N.currentPage+1):"pagenumber"==z?N.currentPage+1:"pagecount"==z?R.length:M.apply(this,arguments)}}}this.diagrams=[];var Q=null;this.selectPage=function(z){this.handlingResize||(this.currentPage=mxUtils.mod(z,this.diagrams.length),
this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(z){z=this.getIndexById(z);var t=0<=z;t&&this.selectPage(z);return t};G=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=Q&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),Q=this.xmlNode)});var e=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(z){if(null!=z&&Graph.isPageLink(z.src)){var t=z.src,
B=t.indexOf(",");0<B&&(B=N.getIndexById(t.substring(B+1)),0<=B&&(z=N.getImageForGraphModel(Editor.parseDiagramNode(N.diagrams[B])),z.originalSrc=t))}e.apply(this,arguments)};var f=this.graph.getGraphBounds;this.graph.getGraphBounds=function(z){var t=f.apply(this,arguments);z=this.backgroundImage;if(null!=z){var B=this.view.translate,I=this.view.scale;t=mxRectangle.fromRectangle(t);t.add(new mxRectangle((B.x+z.x)*I,(B.y+z.y)*I,z.width*I,z.height*I))}return t};this.addListener("xmlNodeChanged",G);G();
urlParams.page=N.currentPage;G=null;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.view.scale=this.graphConfig.zoom||1,G=this.setLayersVisible(),this.responsive||(this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.graph.panningHandler.isForcePanningEvent=function(z){return!mxEvent.isPopupTrigger(z.getEvent())&&"auto"==this.graph.container.style.overflow},
this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.panningHandler.ignoreCell=!0,this.graph.panningHandler.usePopupTrigger=!1,this.graph.panningHandler.pinchEnabled=!1);this.graph.setPanning(!1);null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&b.setAttribute("title",this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);
this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=G&&this.setLayersVisible(G);this.graph.customLinkClicked=function(z){if(Graph.isPageLink(z)){var t=z.indexOf(",");N.selectPageById(z.substring(t+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else this.handleCustomLink(z);return!0};var k=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=
!0;return k.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});g=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&"undefined"!==typeof g){var D=this.getObservableParent(b),p=new g(mxUtils.bind(this,function(E){0<b.offsetWidth&&(p.disconnect(),l())}));p.observe(D,{attributes:!0})}else l()}};
GraphViewer.prototype.getObservableParent=function(b){for(b=b.parentNode;b!=document.body&&null!=b.parentNode&&"none"!==mxUtils.getCurrentStyle(b).display;)b=b.parentNode;return b};GraphViewer.prototype.getImageUrl=function(b){null!=b&&"http://"!=b.substring(0,7)&&"https://"!=b.substring(0,8)&&"data:image"!=b.substring(0,10)&&("/"==b.charAt(0)&&(b=b.substring(1,b.length)),b=this.imageBaseUrl+b);return b};
GraphViewer.prototype.getImageForGraphModel=function(b){var d=Graph.createOffscreenGraph(this.graph.getStylesheet());d.getGlobalVariable=this.graph.getGlobalVariable;document.body.appendChild(d.container);b=(new mxCodec(b.ownerDocument)).decode(b).root;d.model.setRoot(b);b=d.getSvg();var g=d.getGraphBounds();document.body.removeChild(d.container);return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(b)),g.width,g.height,g.x,g.y)};
GraphViewer.prototype.getIndexById=function(b){if(null!=this.diagrams)for(var d=0;d<this.diagrams.length;d++)if(this.diagrams[d].getAttribute("id")==b)return d;return-1};GraphViewer.prototype.setXmlNode=function(b){b=this.editor.extractGraphModel(b,!0);this.xmlDocument=b.ownerDocument;this.xml=mxUtils.getXml(b);this.xmlNode=b;this.updateGraphXml(b);this.fireEvent(new mxEventObject("xmlNodeChanged"))};
GraphViewer.prototype.setFileNode=function(b){null==this.xmlNode&&(this.xmlDocument=b.ownerDocument,this.xml=mxUtils.getXml(b),this.xmlNode=b);this.setGraphXml(b)};GraphViewer.prototype.updateGraphXml=function(b){this.setGraphXml(b);this.fireEvent(new mxEventObject("graphChanged"))};
GraphViewer.prototype.setLayersVisible=function(b){var d=!0;if(!this.autoOrigin){var g=[],l=this.graph.getModel();l.beginUpdate();try{for(var D=0;D<l.getChildCount(l.root);D++){var p=l.getChildAt(l.root,D);d=d&&l.isVisible(p);g.push(l.isVisible(p));l.setVisible(p,null!=b?b[D]:!0)}}finally{l.endUpdate()}}return d?null:g};
GraphViewer.prototype.setGraphXml=function(b){if(null!=this.graph){this.graph.view.translate=new mxPoint;this.graph.view.scale=1;var d=null;this.graph.getModel().beginUpdate();try{this.graph.getModel().clear(),this.editor.setGraphXml(b),d=this.setLayersVisible(!0)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph());this.graph.initialViewState=
{translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};d&&this.setLayersVisible(d)}};
GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,d=this.graph.getGraphBounds(),g=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var l=mxUtils.bind(this,function(){if(!g){g=!0;var N=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?N.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){N=b.getBoundingClientRect();var R=mxUtils.getScrollOrigin(document.body);
R="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-R.x,top:-R.y};N={left:N.left-R.left,top:N.top-R.top,bottom:N.bottom-R.top,right:N.right-R.left};this.toolbar.style.left=N.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=N.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=N.top+1+"px"):this.toolbar.style.top=N.top+"px"}else null!=
this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());g=!1}}),D=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(N){var R=b.offsetWidth;R==D||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=N?N:this.graphConfig.zoom||
(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(),this.graph.maxFitScale=null,0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},D=R,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=
!1}),0))});GraphViewer.useResizeSensor&&(9>=document.documentMode?(mxEvent.addListener(window,"resize",l),this.graph.addListener("size",l)):new ResizeSensor(this.graph.container,l));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(!this.widthIsEmpty||""!=b.style.height&&this.autoFit||this.updateContainerWidth(b,d.width+2*this.graph.border),
0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,d.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var p=D=null;l=mxUtils.bind(this,function(){window.clearTimeout(p);this.handlingResize||(p=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",l):new ResizeSensor(this.graph.container,l))}else 9>=document.documentMode||this.graph.addListener("size",
l);var E=mxUtils.bind(this,function(N){var R=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var G=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==N&&this.allowZoomOut&&(this.allowZoomIn||d.width+2*this.graph.border>b.offsetWidth||d.height+2*this.graph.border>G)?(N=null,null!=G&&d.height+2*this.graph.border>G-2&&(N=(G-2*this.graph.border-2)/d.height),this.fitGraph(N)):this.widthIsEmpty||
null!=N||0!=this.graphConfig.resize||""==b.style.height?(N=null!=N?N:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-d.x/this.graph.view.scale)+N.x,Math.floor(this.graph.border-d.y/this.graph.view.scale)+N.y),D=b.offsetWidth):this.graph.center((!this.widthIsEmpty||d.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=R});8==document.documentMode?window.setTimeout(E,0):E();this.positionGraph=function(N){d=this.graph.getGraphBounds();D=null;E(N)}};
GraphViewer.prototype.crop=function(){var b=this.graph,d=b.getGraphBounds(),g=b.border,l=b.view.scale;b.view.setTranslate(null!=d.x?Math.floor(b.view.translate.x-d.x/l+g):g,null!=d.y?Math.floor(b.view.translate.y-d.y/l+g):g)};GraphViewer.prototype.updateContainerWidth=function(b,d){b.style.width=d+"px"};GraphViewer.prototype.updateContainerHeight=function(b,d){if(this.forceCenter||this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||8==document.documentMode)b.style.height=d+"px"};
GraphViewer.prototype.showLayers=function(b,d){var g=this.graphConfig.layers;g=null!=g&&0<g.length?g.split(" "):[];var l=this.graphConfig.layerIds,D=null!=l&&0<l.length,p=!1;if(0<g.length||D||null!=d){d=null!=d?d.getModel():null;b=b.getModel();b.beginUpdate();try{var E=b.getChildCount(b.root);if(null==d){d=!1;p={};if(D)for(var N=0;N<l.length;N++){var R=b.getCell(l[N]);null!=R&&(d=!0,p[R.id]=!0)}else for(N=0;N<g.length;N++)R=b.getChildAt(b.root,parseInt(g[N])),null!=R&&(d=!0,p[R.id]=!0);for(N=0;d&&
N<E;N++)R=b.getChildAt(b.root,N),b.setVisible(R,p[R.id]||!1)}else for(N=0;N<E;N++)b.setVisible(b.getChildAt(b.root,N),d.isVisible(d.getChildAt(d.root,N)))}finally{b.endUpdate()}p=!0}return p};
GraphViewer.prototype.addToolbar=function(){var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var d=b.ownerDocument.createElement("div");d.style.position="absolute";d.style.overflow="hidden";d.style.boxSizing="border-box";d.style.whiteSpace="nowrap";d.style.textAlign="left";d.style.zIndex=this.toolbarZIndex;d.style.backgroundColor="#eee";
d.style.height=this.toolbarHeight+"px";this.toolbar=d;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(d.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(d,30);var g=null,l=null,D=mxUtils.bind(this,function(ja){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=l&&(window.clearTimeout(l),fadeThead2=null);g=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(d,0);g=null;l=window.setTimeout(mxUtils.bind(this,function(){d.style.display="none";
l=null}),100)}),ja||200)}),p=mxUtils.bind(this,function(ja){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=l&&(window.clearTimeout(l),fadeThead2=null);d.style.display="";mxUtils.setOpacity(d,ja||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(ja){mxEvent.isTouchEvent(ja)||(p(30),D())}));mxEvent.addListener(d,mxClient.IS_POINTER?"pointermove":"mousemove",function(ja){mxEvent.consume(ja)});mxEvent.addListener(d,"mouseenter",
mxUtils.bind(this,function(ja){p(100)}));mxEvent.addListener(d,"mousemove",mxUtils.bind(this,function(ja){p(100);mxEvent.consume(ja)}));mxEvent.addListener(d,"mouseleave",mxUtils.bind(this,function(ja){mxEvent.isTouchEvent(ja)||p(30)}));var E=this.graph,N=E.getTolerance();E.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(ja,aa){this.startX=aa.getGraphX();this.startY=aa.getGraphY();this.scrollLeft=E.container.scrollLeft;this.scrollTop=E.container.scrollTop},mouseMove:function(ja,
aa){},mouseUp:function(ja,aa){mxEvent.isTouchEvent(aa.getEvent())&&Math.abs(this.scrollLeft-E.container.scrollLeft)<N&&Math.abs(this.scrollTop-E.container.scrollTop)<N&&Math.abs(this.startX-aa.getGraphX())<N&&Math.abs(this.startY-aa.getGraphY())<N&&(0<parseFloat(d.style.opacity||0)?D():p(30))}})}for(var R=this.toolbarItems,G=0,M=mxUtils.bind(this,function(ja,aa,qa,sa){ja=this.createToolbarButton(ja,aa,qa,sa);d.appendChild(ja);G++;return ja}),Q=null,e=null,f=null,k=null,z=0;z<R.length;z++){var t=R[z];
if("pages"==t){k=b.ownerDocument.createElement("div");k.style.cssText="display:inline-block;position:relative;top:5px;padding:0 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;;cursor:default;";mxUtils.setOpacity(k,70);var B=M(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");B.style.borderRightStyle="none";B.style.paddingLeft="0px";B.style.paddingRight="0px";d.appendChild(k);var I=M(mxUtils.bind(this,
function(){this.selectPage(this.currentPage+1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");I.style.paddingLeft="0px";I.style.paddingRight="0px";t=mxUtils.bind(this,function(){k.innerText="";mxUtils.write(k,this.currentPage+1+" / "+this.diagrams.length);k.style.display=1<this.diagrams.length?"inline-block":"none";B.style.display=k.style.display;I.style.display=k.style.display});this.addListener("graphChanged",t);t()}else if("zoom"==t)this.zoomEnabled&&(M(mxUtils.bind(this,function(){this.graph.zoomOut()}),
Editor.zoomOutImage,mxResources.get("zoomOut")||"Zoom Out"),M(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),M(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==t){if(this.layersEnabled){var O=this.graph.getModel(),J=M(mxUtils.bind(this,function(ja){if(null!=
Q)Q.parentNode.removeChild(Q),Q=null;else{Q=this.graph.createLayersDialog(mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var qa=this.graph.getGraphBounds(),sa=this.graph.view;0>qa.x||0>qa.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:sa.translate.clone(),scale:sa.scale}):null!=this.graph.originalViewState&&0<qa.x/sa.scale+this.graph.originalViewState.translate.x-sa.translate.x&&0<qa.y/sa.scale+this.graph.originalViewState.translate.y-
sa.translate.y&&(sa.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:sa.translate.clone(),scale:sa.scale})}}));mxEvent.addListener(Q,"mouseleave",function(){Q.parentNode.removeChild(Q);Q=null});ja=J.getBoundingClientRect();Q.style.width="140px";Q.style.padding="2px 0px 2px 0px";Q.style.border="1px solid #d0d0d0";Q.style.backgroundColor="#eee";Q.style.fontFamily=Editor.defaultHtmlFont;
Q.style.fontSize="11px";Q.style.overflowY="auto";Q.style.maxHeight=this.graph.container.clientHeight-this.toolbarHeight-10+"px";Q.style.zIndex=this.toolbarZIndex+1;mxUtils.setOpacity(Q,80);var aa=mxUtils.getDocumentScrollOrigin(document);Q.style.left=aa.x+ja.left-1+"px";Q.style.top=aa.y+ja.bottom-2+"px";document.body.appendChild(Q)}}),Editor.layersImage,mxResources.get("layers")||"Layers");O.addListener(mxEvent.CHANGE,function(){J.style.display=1<O.getChildCount(O.root)?"inline-block":"none"});J.style.display=
1<O.getChildCount(O.root)?"inline-block":"none"}}else if("tags"==t){if(this.tagsEnabled){var y=M(mxUtils.bind(this,function(ja){null==e&&(e=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),e.div.getElementsByTagName("div")[0].style.position="",e.div.style.maxHeight="160px",e.div.style.maxWidth="120px",e.div.style.padding="2px",e.div.style.overflow="auto",e.div.style.height="auto",e.div.style.position="fixed",e.div.style.fontFamily=Editor.defaultHtmlFont,e.div.style.fontSize="11px",
e.div.style.backgroundColor="#eee",e.div.style.color="#000",e.div.style.border="1px solid #d0d0d0",e.div.style.zIndex=this.toolbarZIndex+1,mxUtils.setOpacity(e.div,80));if(null!=f)f.parentNode.removeChild(f),f=null;else{f=e.div;mxEvent.addListener(f,"mouseleave",function(){f.parentNode.removeChild(f);f=null});ja=y.getBoundingClientRect();var aa=mxUtils.getDocumentScrollOrigin(document);f.style.left=aa.x+ja.left-1+"px";f.style.top=aa.y+ja.bottom-2+"px";document.body.appendChild(f);e.refresh()}}),Editor.tagsImage,
mxResources.get("tags")||"Tags");O.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){y.style.display=0<this.graph.getAllTags().length?"inline-block":"none"}));y.style.display=0<this.graph.getAllTags().length?"inline-block":"none"}}else"lightbox"==t?this.lightboxEnabled&&M(mxUtils.bind(this,function(){this.showLightbox()}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(t=this.graphConfig["toolbar-buttons"][t],null!=t&&(t.elem=M(null==
t.enabled||t.enabled?t.handler:function(){},t.image,t.title,t.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*G);null!=this.graphConfig.title&&(R=b.ownerDocument.createElement("div"),R.style.cssText="display:inline-block;position:relative;padding:3px 6px 0 6px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;",R.setAttribute("title",this.graphConfig.title),mxUtils.write(R,this.graphConfig.title),mxUtils.setOpacity(R,70),
d.appendChild(R),this.filename=R);this.minToolbarWidth=34*G;var ia=b.style.border,da=mxUtils.bind(this,function(){d.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";d.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var ja=b.getBoundingClientRect(),aa=mxUtils.getScrollOrigin(document.body);aa="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-aa.x,top:-aa.y};ja={left:ja.left-
aa.left,top:ja.top-aa.top,bottom:ja.bottom-aa.top,right:ja.right-aa.left};d.style.left=ja.left+"px";"bottom"==this.graphConfig["toolbar-position"]?d.style.top=ja.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(d.style.marginTop=-this.toolbarHeight+"px",d.style.top=ja.top+1+"px"):d.style.top=ja.top+"px";"1px solid transparent"==ia&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(d);var qa=mxUtils.bind(this,function(){null!=d.parentNode&&d.parentNode.removeChild(d);null!=
Q&&(Q.parentNode.removeChild(Q),Q=null);b.style.border=ia});mxEvent.addListener(document,"mousemove",function(sa){for(sa=mxEvent.getSource(sa);null!=sa;){if(sa==b||sa==d||sa==Q)return;sa=sa.parentNode}qa()});mxEvent.addListener(document.body,"mouseleave",function(sa){qa()})}else d.style.top=-this.toolbarHeight+"px",b.appendChild(d)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",da):da();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=
d.parentNode&&da()})).observe(b)};
GraphViewer.prototype.createToolbarButton=function(b,d,g,l){var D=document.createElement("div");D.style.borderRight="1px solid #d0d0d0";D.style.padding="3px 6px 3px 6px";mxEvent.addListener(D,"click",b);null!=g&&D.setAttribute("title",g);D.style.display="inline-block";b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",d);b.style.width="18px";null==l||l?(mxEvent.addListener(D,"mouseenter",function(){D.style.backgroundColor="#ddd"}),mxEvent.addListener(D,"mouseleave",
function(){D.style.backgroundColor="#eee"}),mxUtils.setOpacity(b,60),D.style.cursor="pointer"):mxUtils.setOpacity(D,30);D.appendChild(b);return D};GraphViewer.prototype.disableButton=function(b){var d=this.graphConfig["toolbar-buttons"]?this.graphConfig["toolbar-buttons"][b]:null;null!=d&&(mxUtils.setOpacity(d.elem,30),mxEvent.removeListener(d.elem,"click",d.handler),mxEvent.addListener(d.elem,"mouseenter",function(){d.elem.style.backgroundColor="#eee"}))};
GraphViewer.prototype.addClickHandler=function(b,d){b.linkPolicy=this.graphConfig.target||b.linkPolicy;b.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(g,l){if(null==l)for(var D=mxEvent.getSource(g);D!=b.container&&null!=D&&null==l;)"a"==D.nodeName.toLowerCase()&&(l=D.getAttribute("href")),D=D.parentNode;null!=d?null==l||b.isCustomLink(l)?mxEvent.consume(g):b.isExternalProtocol(l)||b.isBlankLink(l)||window.setTimeout(function(){d.destroy()},0):null!=l&&null==d&&b.isCustomLink(l)&&
(mxEvent.isTouchEvent(g)||!mxEvent.isPopupTrigger(g))&&b.customLinkClicked(l)&&(mxUtils.clearSelection(),mxEvent.consume(g))}),mxUtils.bind(this,function(g){null!=d||!this.lightboxClickEnabled||mxEvent.isTouchEvent(g)&&0!=this.toolbarItems.length||this.showLightbox()}))};
GraphViewer.prototype.showLightbox=function(b,d,g){if("open"==this.graphConfig.lightbox||window.self!==window.top)if(null==this.lightboxWindow||this.lightboxWindow.closed){b=null!=b?b:null!=this.graphConfig.editable?this.graphConfig.editable:!0;g={client:1,target:null!=g?g:"blank"};b&&(g.edit=this.graphConfig.edit||"_blank");if(null!=d?d:1)g.close=1;this.layersEnabled&&(g.layers=1);this.tagsEnabled&&(g.tags={});null!=this.graphConfig&&0!=this.graphConfig.nav&&(g.nav=1);null!=this.graphConfig&&null!=
this.graphConfig.highlight&&(g.highlight=this.graphConfig.highlight.substring(1));null!=this.currentPage&&0<this.currentPage&&(g.page=this.currentPage);"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)?null==this.lightboxWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(l){"ready"==l.data&&l.source==this.lightboxWindow&&this.lightboxWindow.postMessage(this.xml,"*")})):g.data=encodeURIComponent(this.xml);"1"==urlParams.dev&&(g.dev=
"1");this.lightboxWindow=window.open(("1"!=urlParams.dev?EditorUi.lightboxHost:"https://test.draw.io")+"/#P"+encodeURIComponent(JSON.stringify(g)))}else this.lightboxWindow.focus();else this.showLocalLightbox()};
GraphViewer.prototype.showLocalLightbox=function(){mxUtils.getDocumentScrollOrigin(document);var b=document.createElement("div");b.style.cssText="position:fixed;top:0;left:0;bottom:0;right:0;";b.style.zIndex=this.lightboxZIndex;b.style.backgroundColor="#000000";mxUtils.setOpacity(b,70);document.body.appendChild(b);var d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("src",Editor.closeBlackImage);d.style.cssText="position:fixed;top:32px;right:32px;";d.style.cursor="pointer";
mxEvent.addListener(d,"click",function(){l.destroy()});urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):null;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";this.tagsEnabled&&(urlParams.tags="{}");if(null==document.documentMode||10<=document.documentMode)Editor.prototype.editButtonLink=
this.graphConfig.edit,Editor.prototype.editButtonFunc=this.graphConfig.editFunc;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};var g=Graph.prototype.shadowId;Graph.prototype.shadowId="lightboxDropShadow";var l=new EditorUi(new Editor(!0),document.createElement("div"),!0);l.editor.editBlankUrl=this.editBlankUrl;l.editor.graph.shadowId="lightboxDropShadow";Graph.prototype.shadowId=g;
l.refresh=function(){};var D=mxUtils.bind(this,function(Q){27==Q.keyCode&&l.destroy()}),p=this.initialOverflow,E=l.destroy;l.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",D);document.body.removeChild(b);document.body.removeChild(d);document.body.style.overflow=p;GraphViewer.resizeSensorEnabled=!0;E.apply(this,arguments)};var N=l.editor.graph,R=N.container;R.style.overflow="hidden";this.lightboxChrome?(R.style.border="1px solid #c0c0c0",R.style.margin="40px",mxEvent.addListener(document.documentElement,
"keydown",D)):(b.style.display="none",d.style.display="none");var G=this;N.getImageFromBundles=function(Q){return G.getImageUrl(Q)};var M=l.createTemporaryGraph;l.createTemporaryGraph=function(){var Q=M.apply(this,arguments);Q.getImageFromBundles=function(e){return G.getImageUrl(e)};return Q};this.graphConfig.move&&(N.isMoveCellsEvent=function(Q){return!0});mxUtils.setPrefixedStyle(R.style,"border-radius","4px");R.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow=
"hidden";mxClient.IS_SF||mxClient.IS_EDGE||(mxUtils.setPrefixedStyle(R.style,"transform","rotateY(90deg)"),mxUtils.setPrefixedStyle(R.style,"transition","all .25s ease-in-out"));this.addClickHandler(N,l);window.setTimeout(mxUtils.bind(this,function(){R.style.outline="none";R.style.zIndex=this.lightboxZIndex;d.style.zIndex=this.lightboxZIndex;document.body.appendChild(R);document.body.appendChild(d);l.setFileData(this.xml);mxUtils.setPrefixedStyle(R.style,"transform","rotateY(0deg)");l.chromelessToolbar.style.bottom=
"60px";l.chromelessToolbar.style.zIndex=this.lightboxZIndex;document.body.appendChild(l.chromelessToolbar);l.getEditBlankXml=mxUtils.bind(this,function(){return this.xml});l.lightboxFit();l.chromelessResize();this.showLayers(N,this.graph);mxEvent.addListener(b,"click",function(){l.destroy()})}),0);return l};
GraphViewer.prototype.updateTitle=function(b){b=b||"";this.showTitleAsTooltip&&null!=this.graph&&null!=this.graph.container&&this.graph.container.setAttribute("title",b);null!=this.filename&&(this.filename.innerText="",mxUtils.write(this.filename,b),this.filename.setAttribute("title",b))};
GraphViewer.processElements=function(b){mxUtils.forEach(GraphViewer.getElementsByClassName(b||"mxgraph"),function(d){try{d.innerText="",GraphViewer.createViewerForElement(d)}catch(g){d.innerText=g.message,null!=window.console&&console.error(g)}})};
GraphViewer.getElementsByClassName=function(b){if(document.getElementsByClassName){var d=document.getElementsByClassName(b);b=[];for(var g=0;g<d.length;g++)b.push(d[g]);return b}var l=document.getElementsByTagName("*");d=[];for(g=0;g<l.length;g++){var D=l[g].className;null!=D&&0<D.length&&(D=D.split(" "),0<=mxUtils.indexOf(D,b)&&d.push(l[g]))}return d};
GraphViewer.createViewerForElement=function(b,d){var g=b.getAttribute("data-mxgraph");if(null!=g){var l=JSON.parse(g),D=function(p){p=mxUtils.parseXml(p);p=new GraphViewer(b,p.documentElement,l);null!=d&&d(p)};null!=l.url?GraphViewer.getUrl(l.url,function(p){D(p)}):D(l.xml)}};
GraphViewer.initCss=function(){try{var b=document.createElement("style");b.type="text/css";b.innerHTML="div.mxTooltip {\n-webkit-box-shadow: 3px 3px 12px #C0C0C0;\n-moz-box-shadow: 3px 3px 12px #C0C0C0;\nbox-shadow: 3px 3px 12px #C0C0C0;\nbackground: #FFFFCC;\nborder-style: solid;\nborder-width: 1px;\nborder-color: black;\nfont-family: Arial;\nfont-size: 8pt;\nposition: absolute;\ncursor: default;\npadding: 4px;\ncolor: black;}\ntd.mxPopupMenuIcon div {\nwidth:16px;\nheight:16px;}\nhtml div.mxPopupMenu {\n-webkit-box-shadow:2px 2px 3px #d5d5d5;\n-moz-box-shadow:2px 2px 3px #d5d5d5;\nbox-shadow:2px 2px 3px #d5d5d5;\n_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d0d0d0',Positive='true');\nbackground:white;\nposition:absolute;\nborder:3px solid #e7e7e7;\npadding:3px;}\nhtml table.mxPopupMenu {\nborder-collapse:collapse;\nmargin:0px;}\nhtml td.mxPopupMenuItem {\npadding:7px 30px 7px 30px;\nfont-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;}\nhtml td.mxPopupMenuIcon {\nbackground-color:white;\npadding:0px;}\ntd.mxPopupMenuIcon .geIcon {\npadding:2px;\npadding-bottom:4px;\nmargin:2px;\nborder:1px solid transparent;\nopacity:0.5;\n_width:26px;\n_height:26px;}\ntd.mxPopupMenuIcon .geIcon:hover {\nborder:1px solid gray;\nborder-radius:2px;\nopacity:1;}\nhtml tr.mxPopupMenuItemHover {\nbackground-color: #eeeeee;\ncolor: black;}\ntable.mxPopupMenu hr {\ncolor:#cccccc;\nbackground-color:#cccccc;\nborder:none;\nheight:1px;}\ntable.mxPopupMenu tr {\tfont-size:4pt;}\n.geDialog, .geDialog table { font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;\nborder:none;\nmargin:0px;}\n.geDialog {\tposition:absolute;\tbackground:white;\toverflow:hidden;\tpadding:30px;\tborder:1px solid #acacac;\t-webkit-box-shadow:0px 0px 2px 2px #d5d5d5;\t-moz-box-shadow:0px 0px 2px 2px #d5d5d5;\tbox-shadow:0px 0px 2px 2px #d5d5d5;\t_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d5d5d5', Positive='true');\tz-index: 2;}.geDialogClose {\tposition:absolute;\twidth:9px;\theight:9px;\topacity:0.5;\tcursor:pointer;\t_filter:alpha(opacity=50);}.geDialogClose:hover {\topacity:1;}.geDialogTitle {\tbox-sizing:border-box;\twhite-space:nowrap;\tbackground:rgb(229, 229, 229);\tborder-bottom:1px solid rgb(192, 192, 192);\tfont-size:15px;\tfont-weight:bold;\ttext-align:center;\tcolor:rgb(35, 86, 149);}.geDialogFooter {\tbackground:whiteSmoke;\twhite-space:nowrap;\ttext-align:right;\tbox-sizing:border-box;\tborder-top:1px solid #e5e5e5;\tcolor:darkGray;}\n.geBtn {\tbackground-color: #f5f5f5;\tborder-radius: 2px;\tborder: 1px solid #d8d8d8;\tcolor: #333;\tcursor: default;\tfont-size: 11px;\tfont-weight: bold;\theight: 29px;\tline-height: 27px;\tmargin: 0 0 0 8px;\tmin-width: 72px;\toutline: 0;\tpadding: 0 8px;\tcursor: pointer;}.geBtn:hover, .geBtn:focus {\t-webkit-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\t-moz-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tbox-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tborder: 1px solid #c6c6c6;\tbackground-color: #f8f8f8;\tbackground-image: linear-gradient(#f8f8f8 0px,#f1f1f1 100%);\tcolor: #111;}.geBtn:disabled {\topacity: .5;}.gePrimaryBtn {\tbackground-color: #4d90fe;\tbackground-image: linear-gradient(#4d90fe 0px,#4787ed 100%);\tborder: 1px solid #3079ed;\tcolor: #fff;}.gePrimaryBtn:hover, .gePrimaryBtn:focus {\tbackground-color: #357ae8;\tbackground-image: linear-gradient(#4d90fe 0px,#357ae8 100%);\tborder: 1px solid #2f5bb7;\tcolor: #fff;}.gePrimaryBtn:disabled {\topacity: .5;}";document.getElementsByTagName("head")[0].appendChild(b)}catch(d){}};
GraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,d,g){if(null!=GraphViewer.cachedUrls[b])d(GraphViewer.cachedUrls[b]);else{var l=null!=navigator.userAgent&&0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;l.open("GET",b);l.onload=function(){d(null!=l.getText?l.getText():l.responseText)};l.onerror=g;l.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0;
(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(g){return window.setTimeout(g,20)},d=function(g,l){function D(){this.q=[];this.add=function(f){this.q.push(f)};var Q,e;this.call=function(){Q=0;for(e=this.q.length;Q<e;Q++)this.q[Q].call()}}function p(Q,e){return Q.currentStyle?Q.currentStyle[e]:window.getComputedStyle?window.getComputedStyle(Q,null).getPropertyValue(e):Q.style[e]}function E(Q,e){if(!Q.resizedAttached)Q.resizedAttached=
new D,Q.resizedAttached.add(e);else if(Q.resizedAttached){Q.resizedAttached.add(e);return}Q.resizeSensor=document.createElement("div");Q.resizeSensor.className="resize-sensor";Q.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";Q.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';
Q.appendChild(Q.resizeSensor);"static"==p(Q,"position")&&(Q.style.position="relative");var f=Q.resizeSensor.childNodes[0],k=f.childNodes[0],z=Q.resizeSensor.childNodes[1],t=function(){k.style.width="100000px";k.style.height="100000px";f.scrollLeft=1E5;f.scrollTop=1E5;z.scrollLeft=1E5;z.scrollTop=1E5};t();var B=!1,I=function(){Q.resizedAttached&&(B&&(Q.resizedAttached.call(),B=!1),b(I))};b(I);var O,J,y,ia;e=function(){if((y=Q.offsetWidth)!=O||(ia=Q.offsetHeight)!=J)B=!0,O=y,J=ia;t()};var da=function(ja,
aa,qa){ja.attachEvent?ja.attachEvent("on"+aa,qa):ja.addEventListener(aa,qa)};da(f,"scroll",e);da(z,"scroll",e)}var N=function(){GraphViewer.resizeSensorEnabled&&l()},R=Object.prototype.toString.call(g),G="[object Array]"===R||"[object NodeList]"===R||"[object HTMLCollection]"===R||"undefined"!==typeof jQuery&&g instanceof jQuery||"undefined"!==typeof Elements&&g instanceof Elements;if(G){R=0;for(var M=g.length;R<M;R++)E(g[R],N)}else E(g,N);this.detach=function(){if(G)for(var Q=0,e=g.length;Q<e;Q++)d.detach(g[Q]);
else d.detach(g)}};d.detach=function(g){g.resizeSensor&&(g.removeChild(g.resizeSensor),delete g.resizeSensor,delete g.resizedAttached)};window.ResizeSensor=d})();
(function(){Editor.initMath();GraphViewer.initCss();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();